Mandatory policy text doesn't appear in note_policies
You inspected note_policies after Generate notes and the verbatim Income-Tax / Employee-Benefits / Provisions paragraph is missing or paraphrased.
What this means
The notes generator is instructed to insert the verbatim constitution text. The constitution lives at:
packages/financial-statements/constitution/mandatory_policies/income_tax.mdpackages/financial-statements/constitution/mandatory_policies/employee_benefits.mdpackages/financial-statements/constitution/mandatory_policies/provisions.md
If the text in the note differs from the constitution by anything more than whitespace normalisation, the DOCX export will refuse with mandatory_policy_mismatch.
Causes
- Claude paraphrased. The LLM occasionally restates the verbatim block despite the instruction. The fix is regenerate.
- Constitution file changed. A PR updated the constitution; the prior note was generated against the old text. The fix is regenerate.
- Loader cache. In long-lived dev sessions, the constitution is cached on first read. If you edited a constitution file and didn't restart the worker, the worker is using the stale cache. Restart the worker or call
clearPolicyCache()in the loader.
Diagnose
Compare the note text to the constitution:
sql
SELECT content FROM fs_notes
WHERE engagement_id = '<engagementId>' AND note_key = 'note_policies';bash
cat packages/financial-statements/constitution/mandatory_policies/income_tax.mdIf the body of the relevant paragraph block in the note differs from the markdown file, regenerate.
Fix
- Open the Notes tab.
- Click Regenerate notes.
- Spot-check
note_policiesagain. If the same paraphrase appears, file an issue with the failure record and the engagement id.
Why we don't auto-replace
The renderer asserts at export time but does not rewrite the note's stored body. A reviewer must be able to see what the LLM produced before it lands in a DOCX — silent rewrites would hide drift.