docs(review): add strict offline JSON CLI workflow and exit code contract
davoodmehraban89 committed
Oct 31, 2026 at 00:27 UTC
0249a22fb1369f559d03a339d15702fafe5ad35d
1 file changed
+35
-1
docs/NOTE_RECONCILIATION_REVIEW.md
+35
-1
@@ -49,4 +49,38 @@ Statement generation and financial-sign policy, authenticated reviewer identitie
49
50
## Verification
51
52
-Run `cd backend && pytest tests/test_reconciliation_review.py` and then full Backend CI (all tests, SQLite migration round trip, bytecode compilation) on the exact last commit. Review against the accepted parent, keep accounting sources untouched, and obtain real external C1/C2/C3 reviews before any merge. Use the linked PR's CI instead of agent-written counts for acceptance.
\ No newline at end of file
52
+Run `cd backend && pytest tests/test_reconciliation_review.py` and then full Backend CI (all tests, SQLite migration round trip, bytecode compilation) on the exact last commit. Review against the accepted parent, keep accounting sources untouched, and obtain real external C1/C2/C3 reviews before any merge. Use the linked PR's CI instead of agent-written counts for acceptance.
53
+
54
+
55
+## Safe offline command
56
+
57
+Create a **local**, authorized reference file (never commit financial data):
58
+
59
+```json
60
+{
61
+ "schema_version": 1,
62
+ "company_code": "001",
63
+ "fiscal_year": 1404,
64
+ "references": [
65
+ {
66
+ "statement": "BS",
67
+ "section": "Assets",
68
+ "note_number": "N01",
69
+ "subnote_code": "",
70
+ "expected_closing_exposure": "126.00",
71
+ "evidence_ref": "SYNTHETIC-TB-1"
72
+ }
73
+ ]
74
+}
75
+```
76
+
77
+```bash
78
+cd backend
79
+python -m aram_backend.reconciliation_review_cli --file ./synthetic.xlsx --references ./synthetic_references.json
80
+```
81
+
82
+The manifest must be strict schema version 1; extra or duplicate JSON keys fail closed. Reference amounts must be strings, not floats. Both input files must be local regular files, never symlinks, with bounded reads and file-identity checks; reference JSON is limited to 512 KiB.
83
+
84
+Exit status: `0` for exact note exposure match **for analyst review only**; `3` for a valid but blocked/mismatched comparison (JSON findings are still printed); `2` for an invalid or unsafe input. No file is saved and no output is a statutory financial statement. Do not share source or reference files in a public GitHub repository.
85
+
86
+Run `pytest tests/test_reconciliation_review.py tests/test_reconciliation_review_cli.py` plus full Backend CI.
\ No newline at end of file