fix: case registry locking, watchdog proof verification, viewer matching, export paths - #121
Draft
cursor[bot] wants to merge 1 commit into
Draft
fix: case registry locking, watchdog proof verification, viewer matching, export paths#121cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
…ing, export paths - allocate_case_no: create registry when missing, exclusive fcntl lock, fsync, and year rollover reset to prevent duplicate Case Nos under concurrent saves - watchdog: require OverrideProof.verify() for override actions instead of skipping checks when action_type contains override or proof is non-empty - litigation viewer: resolve transcripts by exact/prefix/suffix rules, not arbitrary substring match (bar must not match foo-bar) - export_transcript: resolve_transcript_path strips courtroom/ prefix so repo-root paths do not double-prefix to courtroom/courtroom/transcripts 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
Nightly critical-correctness scan found four high-severity bugs in recently merged code that escaped review. This PR applies minimal, targeted fixes with regression tests.
Bugs fixed
1.
litigation/run.py— duplicate Case Nos / registry corruptionImpact: Concurrent transcript saves could assign duplicate Case Nos or corrupt
case-registry.yaml. When the registry file was missing, every save returnedYYYY-DEL-001without persisting, causing permanent duplicate numbering.Root cause: Unlocked read-modify-write on the registry; early return on missing file without creating/persisting.
Fix: Exclusive
fcntlfile lock, create registry on first use, year rollover reset,fsyncafter write.2.
executive/watchdog.py— override approval bypassImpact: Any executive action whose
action_typecontained the substring"override"skipped judicial approval checks entirely, even with missing or forged proof.Root cause: Inverted guard — presence of
"override"in action type exempted the action from verification.Fix: Require
OverrideProof.verify()for override actions; alert on missing/invalid proof.3.
litigation/viewer.py— wrong transcript servedImpact: Substring matching (
name in stem) could return the wrong transcript when names shared a common substring (e.g. querydisputematchingborder-disputeandtrade-dispute).Fix: Exact/prefix/suffix matching via
_resolve_transcript().4.
courtroom/portal/export_transcript.py— double-prefix path 404Impact: Passing
courtroom/transcripts/foo.mdresolved to nonexistentcourtroom/courtroom/transcripts/foo.md, breaking portal export.Fix:
resolve_transcript_path()strips redundantcourtroom/prefix.Validation
python3 -m pytest tests/ -q— 69 passed