feat(prd-7): materialize AUDIT.log sheet — AuditRow, 9 columns, MetaFlag Display (#57)#92
Merged
Merged
Conversation
From<&TransactionInput> for DocumentFields conflicted with Rust's blanket TryFrom via Into. Keep only TryFrom (the fallible parse-aware version). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…lag Display Closes #57. Makes the PRD-7 verification layer CPA-visible: every committed transaction now emits a row in AUDIT.log with the full verification provenance. - validation.rs: add Display for MetaFlag (all 5 variants) - workbook.rs: AuditRow struct + constructor (blake3 entry_id, worst-case disposition, legal_violation scan, serde_json stage trace, comma-joined flags) - workbook.rs: setup_audit_sheet() with 9 headers; stage_trace_json column pinned to width 8 to avoid overwhelming the CPA view - workbook.rs: wire setup_audit_sheet into initialize_workbook + copy_all_sheets - workbook.rs: WorkbookWriter::append_audit_row() - 3 new tests: legal_violation result, Approved gate, stage_trace_json round-trip Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
45bcd90 to
70e7898
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes the PRD-7 verification layer CPA-visible. Every committed transaction can now emit a row in
AUDIT.logcarrying the full verification provenance — constraint score, legal result, disposition, accumulated confidence, stage trace, flags, invoice arithmetic, and commit gate.validation.rs—Display for MetaFlag(all 5 variants:new_vendor:,anomaly:,repair:,low_conf:,constraint_weak:)workbook.rs—AuditRowstruct with 9-column constructor: blake3entry_id, worst-casedisposition,legal_violationscan,serde_jsonstage trace, comma-joined flag display,CommitGatevariant nameworkbook.rs—setup_audit_sheet(): 9 column headers +stage_trace_jsoncolumn pinned to width 8 (CPA-friendly)workbook.rs—setup_audit_sheetwired into bothinitialize_workbookandcopy_all_sheetsforAUDIT.logworkbook.rs—WorkbookWriter::append_audit_row(&self, row: &AuditRow)Closes #57. Completes PRD-7 Phase 3; unblocks the full PDF → legal verification → audit trail path end-to-end.
Test plan
test_audit_row_legal_violation_result—Z3Result::Violatedissue →legal_result = "legal_violation",commit_gate = "Blocked",disposition = "unrecoverable"test_audit_row_approved_gate—CommitGate::Approved { confidence: 0.95 }→commit_gate = "Approved",legal_result = "ok"test_audit_row_stage_trace_json_is_valid—stage_trace_jsonround-trips throughserde_json::from_stras a 2-element array@copilot please review
🤖 Generated with Claude Code