Skip to content

fix: critical correctness — case registry, watchdog overrides, transcript paths - #117

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-correctness-issues-0ba6
Draft

fix: critical correctness — case registry, watchdog overrides, transcript paths#117
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-correctness-issues-0ba6

Conversation

@cursor

@cursor cursor Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Daily critical-correctness scan identified four high-severity bugs still present on main after recent portal/test commits (#54, #66, #84).

Bugs fixed

1. Duplicate Case Nos / registry corruption (litigation/run.py)

  • Impact: Concurrent transcript saves could assign identical Case Nos; missing registry returned hardcoded DEL-001 without persisting.
  • Root cause: Unlocked read-modify-write on case-registry.yaml; early return when registry missing.
  • Fix: fcntl exclusive lock, create registry on first use, year rollover reset, max(nnn, 1) for zero-seeded categories.

2. Executive override bypass (executive/watchdog.py)

  • Impact: Any action with override in action_type skipped approval checks; any non-empty override_proof bypassed verification.
  • Root cause: Inverted guard logic treated override label as exemption instead of requiring OverrideProof.verify().
  • Fix: Override actions must present HMAC-verified proof; unapproved non-override actions still alert.

3. Portal export 404 (courtroom/portal/export_transcript.py)

  • Impact: Paths like courtroom/transcripts/foo.md resolved to nonexistent courtroom/courtroom/transcripts/foo.md.
  • Root cause: BASE_DIR / args.transcript double-prefixed when path already included courtroom/.
  • Fix: resolve_transcript_path() strips repo-root prefix before joining.

4. Wrong transcript served (litigation/viewer.py)

  • Impact: Query bar matched foo-bar via substring (name in stem).
  • Root cause: Overly broad substring matching in cmd_show and HTTP handler.
  • Fix: Exact, prefix, or suffix (-{name} / _{name}) matching via _resolve_transcript().

Validation

  • 69 tests passing (python3 -m pytest tests/)
  • New regression tests for all four fixes
Open in Web View Automation 

…verification, transcript paths

- litigation/run.py: create registry on first use, fcntl lock for concurrent
  saves, year rollover reset, treat category 0 as first case
- executive/watchdog.py: require HMAC-verified OverrideProof for override
  actions instead of bypassing approval checks
- export_transcript.py: resolve_transcript_path() avoids double-prefix 404
- litigation/viewer.py: exact/prefix/suffix matching instead of substring

Adds regression tests for all four fixes (69 tests passing).

Co-authored-by: Jack J Burleson // LJM <Exios66@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant