fix: watchdog override verification and case registry allocation - #107
Draft
cursor[bot] wants to merge 1 commit into
Draft
fix: watchdog override verification and case registry allocation#107cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
- Verify OverrideProof for unapproved executive actions instead of accepting any truthy proof or skipping checks when action_type contains 'override' - Alert on actions missing ruling_id - Initialize case-registry.yaml on first allocation and use file locking to prevent duplicate Case Nos under concurrent saves Co-authored-by: Jack J Burleson // LJM <Exios66@users.noreply.github.com>
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
Critical correctness fixes from the nightly bug-finding automation.
Bug 1: Executive watchdog auth bypass (security)
Impact: Unapproved executive actions could pass watchdog checks without valid cryptographic proof, violating
executive/protocol.md.Root cause:
run_checks()skipped approval validation whenaction_typecontained"override", and treated any non-emptyoverride_proofas sufficient without callingOverrideProof.verify().Fix: Require
ruling_idon all actions; for unapproved rulings, verify HMAC proof viaOverrideProof.verify()and alert on missing/invalid proof. Added regression tests for override-without-proof, fake proof, valid proof, and missing ruling_id.Bug 2: Duplicate Case Nos from
allocate_case_no(data integrity)Impact: When
courtroom/case-registry.yamlwas missing, every litigation save receivedYYYY-DEL-001-001. Concurrent saves could also read-modify-write the registry non-atomically and assign duplicate Case Nos.Root cause: Introduced in #66 — missing-registry fallback returned a static case number without persisting state; registry updates used non-atomic full-file overwrites.
Fix: Initialize the registry on first allocation; use
fcntlexclusive file locking around read-modify-write. Added regression test for missing-registry initialization.Validation
python3 -m pytest tests/— 65 passed