test(store): golden file for draft states, discard and the evidence gate
One fixture serves both parity rows (draft states and discard; the one evidence gate). A Store fixture, because the gate's receipt-on-file half lives in the store. New fixture, built like books_for_drafts and extended. Hand-computed in plan/golden-worksheets/draft-states-and-evidence-gate.md, before serializing anything: - Requirement (B-43 inv. 2, threshold strictly > 25.00): drafts of 40.00, 60.00 and 100.00 are Required; 12.50 is Exempt (policy); the reversal (debits 100.00) is Exempt by origin (D-47, D-12); the closing entry (52.50) is Exempt by origin. Receipt counts are pinned beside them: the gate refuses the 40.00 and 60.00 drafts (no receipt) with the journal head unchanged, then lets the rest post; the reversal has no receipt. - Trial balance 2026-01-31 before and after the discard of the 60.00 draft: Cash 447.50 Dr, Equity 500.00 Cr, Software 52.50 Dr, totals 500.00; identical after the discard, next entry id 7 both times. - The close is refused while the draft is open (B-12), accepted after the discard: Dr Retained Earnings 52.50 / Cr Software 52.50 (a loss), id 7; trial balance then 447.50 Dr, 500.00 Cr, 52.50 Dr. Code and hand values agreed on the first run. Strength: four scratch edits of the golden (a balance, a decision, a discard reason, the next id) each fail the test. Adds serde::Serialize to evidence::Requirement (tagged, snake_case) so the gate's result can be pinned. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3ac3e8b1b4
commit
2593931c47
4 files changed
+670
-1
No files matched your search
@@ -137,7 +137,11 @@ pub enum Origin {
|
||||
}
|
||||
|
||||
/// Whether an entry needs evidence before it posts, and why (or why not).
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
/// Serialized as `{"decision": "required", "reason": ..}` or
|
||||
/// `{"decision": "exempt", "source": ..}` (the golden for the evidence
|
||||
/// gate pins it).
|
||||
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize)]
|
||||
#[serde(tag = "decision", rename_all = "snake_case")]
|
||||
pub enum Requirement {
|
||||
/// The receipt policy covers it: at least one receipt is needed.
|
||||
Required {
|
||||
|
||||
Reference in new issue
Block a user