The rules detection runs at startup — the single source of truth, one entry shape per ADR-003 §2. Editing is the approval-gated write path deferred to ADR-004; this view is read-only.
▚
orders
5 rules
Flag when 'amount' differs across systems (a hand-edit that didn't propagate).
cross_system_value_mismatch
field:amount
initial migration from DOMAIN_CONFIG (harness/run_poc.py)
Flag when any of order_ref, customer is empty or missing in a single source's data.
structural_not_null
fields:order_ref, customer
order_ref is the identity field; customer is required (structural axis, ADR-006)
Flag when an entity is missing from any of: crm, billing (a record vanished upstream).
cross_system_missing_upstream
expected_systems:crm, billing
initial migration from DOMAIN_CONFIG (harness/run_poc.py)
Flag when a record is missing one or more expected fields (a field renamed/retyped).
cross_system_schema_drift
expected_fields:order_ref, amount, customer, status
initial migration from DOMAIN_CONFIG (harness/run_poc.py)
Flag when 'status' doesn't match the required pattern in a single source's data.
structural_format
field:status · pattern:^(pending|paid|shipped)$
status must be one of the known order states (structural axis, ADR-006)
▚
products
5 rules
Flag when an entity is missing from any of: a, b, c (a record vanished upstream).
cross_system_missing_upstream
expected_systems:a, b, c
initial migration from DOMAIN_CONFIG (harness/run_poc.py)
Flag when 'price' differs across systems (a hand-edit that didn't propagate).
cross_system_value_mismatch
field:price
initial migration from DOMAIN_CONFIG (harness/run_poc.py)
Flag when a record is missing one or more expected fields (a field renamed/retyped).
cross_system_schema_drift
expected_fields:sku, price, name, stock
initial migration from DOMAIN_CONFIG (harness/run_poc.py)
Flag when any of sku, name is empty or missing in a single source's data.
structural_not_null
fields:sku, name
sku is the identity field; name is required (structural axis, ADR-006)
Flag when 'stock' is below 0 in a single source's data.
structural_range
field:stock · min:0
stock cannot be negative (structural axis, ADR-006)