KAMIWAZA Gate
I built a document-checking tool with a Python library, CLI and review interface. YAML rules identify issues; a person can approve an exception or return a document, and the audit history preserves both the finding and the decision.
The project
The system accepts normalized JSON and checks required fields, dates, duplicates, and totals against declarative rules. Each finding identifies the rule, affected field, and reason for holding the document.
A Python library and CLI support the workflow, alongside a local review interface for approving or returning held documents. Exported records retain the distinction between an automatic pass and a human exception.
How it works
Check the document
The checker compares document fields and totals with the rules, marking each problem with a reason.
Pass or human review
Documents without findings pass automatically; those with problems wait for a person to approve or return them.
Export with the decision
Only automatically passed or human-approved documents are exported, keeping that distinction and the original findings and decisions.
Reproducing a result requires the document, rule configuration, reference date, and prior-document history. Monetary values are calculated from decimal strings, and the rules contain no executable Python expressions.
Evaluations and human decisions are appended to SQLite and linked with SHA-256. An approval preserves the original findings; audit verification can also compare the chain head with a checkpoint kept under independent control.
What the records show
The 20 bundled rules have passing and failing cases, and 426 tests passed locally. The CLI, library, and review interface were exercised through checking, human review, and export.
The checks confirmed that approval preserves the original failure, returned documents stay out of the export, and editing an audit event produces a detectable hash mismatch.
- Bundled rules
- 20
- Local tests
- 426 passed
What this covers
This is a local implementation validated with synthetic data, with no production operating record. Document extraction, a live LLM connection, and user authentication are outside its scope. Detecting a fully rewritten and recomputed audit chain requires an independently retained checkpoint.
