fix: duplicate Case Nos when registry missing and export path double-prefix - #102
Draft
cursor[bot] wants to merge 1 commit into
Draft
fix: duplicate Case Nos when registry missing and export path double-prefix#102cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
…prefix allocate_case_no() returned 2026-DEL-001-001 on every call when courtroom/case-registry.yaml was absent, without creating the registry. Now initializes the registry on first allocation and increments normally. export_transcript.py joined BASE_DIR (courtroom/) with paths like courtroom/transcripts/foo.md, resolving to a nonexistent double path. Documented README usage now works via resolve_transcript_path(). Regression tests added for both issues. 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 found during nightly bug audit of recent commits.
Bug 1: Duplicate Case Numbers when registry is missing (High)
Impact: Every
litigation/run.pysave assignedYYYY-DEL-001-001whencourtroom/case-registry.yamlwas absent, with no registry created. Multiple deliberations received identical Case Nos — a data-integrity failure matching the legacy2026-DEL-001collision problem.Root cause:
allocate_case_no()early-returned without persisting state when the registry file did not exist (introduced in #66).Fix: Initialize
case-registry.yamlon first allocation withcategories[DEL]=2after assigning001.Bug 2: export_transcript path double-prefix (Medium)
Impact: Documented README usage (
python3 courtroom/portal/export_transcript.py courtroom/transcripts/foo.md) resolved tocourtroom/courtroom/transcripts/foo.mdand failed with "File not found".launch.shwas unaffected (uses absolute paths).Root cause:
BASE_DIRis alreadycourtroom/; joining with acourtroom/transcripts/prefix doubled the segment.Fix: Added
resolve_transcript_path()to strip a leadingcourtroom/prefix before joining.Validation
test_allocate_case_no_creates_registry_when_missingtest_resolve_transcript_path_accepts_repo_root_prefixand_courtroom_relative_prefix