A rule I expected isn't triggered
You're on the Interrogation tab; you expected to see (for example) DISC-010 (PPE) but the accordion does not list it.
What this means
The rule engine fires deterministically against the mapped TB keys. A conditional rule like DISC-010 has trigger_condition: "tb_contains_any(['ppe'])". If no TB row carries taxonomy_key = 'ppe', the rule does not fire.
Causes
- No TB row was mapped to the triggering key. The PPE rows in the source TB exist but were mapped to a different key.
- The TB has no PPE. Genuinely the entity has no PPE.
- A rule's
trigger_conditiondoes not match what you expected. The constitution is the source of truth.
Diagnose
Check the mapped keys:
sql
SELECT DISTINCT taxonomy_key FROM fs_trial_balance_items
WHERE engagement_id = '<engagementId>' AND taxonomy_key IS NOT NULL
ORDER BY taxonomy_key;Check the rule:
bash
grep -A 5 '"rule_id": "DISC-010"' packages/financial-statements/constitution/disclosure_rules.jsonThe trigger_condition is canonical. Mandatory rules use always; conditionals use tb_contains_any([...]) (joinable by " OR ").
Fix
- If the entity has PPE but no row was mapped to it: open Mapping; find the relevant row; override
taxonomy_keytoppe. The Interrogation tab will refresh and surface DISC-010. - If the entity has no PPE: correct behaviour. The rule is not triggered. Move on.
- If you believe the rule's trigger is wrong: the constitution is governed. File a PR to update the trigger with qualified-accountant sign-off.
Live evaluation
You can preview the gap list without saving anything:
http
GET /ops/financial-statements/engagements/<engagementId>/disclosures/gapsThis returns the triggered rules, sorted by priority. If a rule you expect is missing here, the underlying mapping state is the issue.