dboa9 commited on
Commit
1ef768e
·
1 Parent(s): a8b61fd
.claude/rules/court-bundle-rules.md ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Court Bundle Generator — Claude Code Rules
2
+
3
+ ## Project Structure
4
+ - P2: /home/mrdbo/projects/courtBundleGenerator2 (Evidence Root)
5
+ - P3: /home/mrdbo/projects/courtBundleGenerator3 (Logic Center)
6
+ - Output P2: /home/mrdbo/court_data/CourtBundleOutput
7
+ - Output P3: /home/mrdbo/court_data/2nd_CourtBundleOutput
8
+
9
+ ## Key Files
10
+ - Web editor: adapters/moltbot_web_editor.py
11
+ - Task dispatcher: adapters/clawdbot_task_dispatcher.py
12
+ - ClawdBot modules: clawdbot/*.py (8 modules)
13
+ - SSOT: tools/exhibit_schedule.json, tools/ssot_canonical.json
14
+ - LangGraph agent: tools/ssot_langgraph_agent.py
15
+
16
+ ## Current Task: ClawdBot Kasm Completion
17
+ - 43/43 handlers exist
18
+ - 37/43 buttons exist (missing: exhibit_verify_skill, cross_verify_skill)
19
+ - 1/43 proof logs (need runtime proof for all tasks)
20
+ - Feature map: see CLAWDBOT_FEATURE_MAP.md
21
+
22
+ ## Rules
23
+ - Empirical evidence only — no guessing
24
+ - No placeholders or stubs
25
+ - DRY — reuse existing code
26
+ - No standalone scripts — integrate into existing files
27
+ - Exhibit format: Exhibit [Letter][Number] (DB-[N]) — [Filename]
28
+ - Protected files: never overwrite without backup
.rgignore ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ evidence/
2
+ logs/
3
+ CourtBundleOutput/
4
+ 2nd_CourtBundleOutput/
5
+ court_venv_*/
6
+ *.pdf
7
+ *.mp4
8
+ *.mp3
9
+ *.wav
10
+ *.avi
11
+ *.zip
12
+ *.tar.gz
13
+ *.pyc
14
+ __pycache__/
15
+ .git/
16
+ node_modules/
17
+ .venv/
18
+ court_data/
19
+
CLAUDE.md ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Court Bundle Generator Project Memory (Updated 2025-07-25)
2
+
3
+ ## 🚨 CRITICAL PROJECT-WIDE REQUIREMENT (2025-07-25)
4
+ ### Universal Evidence Root: `/evidence/*`
5
+
6
+ **MANDATORY IMPLEMENTATION ACROSS ALL SYSTEMS:**
7
+ - **Evidence Root**: `/evidence/*` is the ONLY evidence root project-wide
8
+ - **Auto-Discovery**: ALL systems MUST auto-discover subdirectories in `/evidence/*`
9
+ - **NO Hardcoded Paths**: Hardcoded evidence directory lists are PROHIBITED
10
+ - **Affected Systems**: Path resolution, bridge systems, config management, search engines, fuzzy matching, cache systems, indexing engines, strategy management
11
+
12
+ **PROHIBITED PATTERNS:**
13
+ ```python
14
+ # ❌ PROHIBITED - Hardcoded directory lists
15
+ self.evidence_dirs = [
16
+ "evidence/Repairs",
17
+ "evidence/Medical",
18
+ "evidence/Legal"
19
+ ]
20
+
21
+ # ✅ REQUIRED - Universal evidence root
22
+ self.evidence_root = Path("/evidence")
23
+ self.evidence_dirs = [d for d in self.evidence_root.rglob("*") if d.is_dir()]
24
+ ```
25
+
26
+ **ENFORCEMENT:**
27
+ - This requirement is written into `.claude/settings.local.json`
28
+ - ALL evidence-related code must comply
29
+ - NO EXCEPTIONS
30
+
31
+ ## Evidence List Integration Solution (2025-07-05)
32
+
33
+ ### Problem
34
+ - Evidence lists existed in two separate systems:
35
+ 1. Original evidence lists in `/EvidenceListsOriginal/convertedToPandPy` (56 categories)
36
+ 2. Regenerated evidence lists from actual files (13 categories + uncategorized)
37
+ - Needed to preserve original categories while ensuring file paths are verified
38
+
39
+ ### Solution
40
+ Created integrated evidence lists that:
41
+ 1. Preserve all 56 original categories from `convertedToPandPy`
42
+ 2. Include only files with verified paths (527 out of 754 items)
43
+ 3. Maintain original evidence priority
44
+ 4. Output to `/EvidenceListsIntegrated/`
45
+
46
+ ### Implementation
47
+ ```bash
48
+ # Step 1: Regenerate clean lists from actual files (5,727 files)
49
+ python3 regenerate_evidence_standalone.py
50
+
51
+ # Step 2: Integrate with original categories
52
+ python3 integrate_original_evidence.py
53
+
54
+ # Step 3: Use integrated lists for all processing
55
+ # Location: /EvidenceListsIntegrated/
56
+ ```
57
+
58
+ ### Results
59
+ - **Integrated Evidence Lists**: 56 categories preserved
60
+ - **Verified Files**: 527 items with confirmed paths
61
+ - **Master List**: `Master_Integrated_Evidence.json` with all 754 items
62
+ - **Output Directory**: `/EvidenceListsIntegrated/`
63
+
64
+ ## Universal Evidence Root Enforcement (2025-07-05)
65
+ ### Critical Implementation
66
+ - **Requirement**: `/evidence/*` is the ONLY evidence root project-wide
67
+ - **Files Updated**:
68
+ - court_compliance_solution.py
69
+ - universal_compliant_bundle_generator.py
70
+ - create_proper_embedded_bundle.py
71
+ - **Pattern**: Auto-discovery with `evidence_root.rglob("*")`
72
+ - **Result**: No more hardcoded evidence directory lists
73
+
74
+ ## PDF Metadata Status (2025-07-05)
75
+ ### Investigation Complete
76
+ - **Finding**: PDF metadata generation is working correctly
77
+ - **Issue**: CORRECTED_DOCS_BUNDLE.pdf was generated before metadata implementation
78
+ - **Current Status**: All recent bundles have full case metadata on cover pages
79
+ - **Verification**: Recent bundles include court name, case number, parties, and address
80
+
81
+ ## Self-Healing Bundle Implementation (2025-07-25)
82
+ ### Critical Components
83
+ - **Script**: `/home/mrdbo/projects/courtBundleGenerator2/scripts/self_healing_bundle.py`
84
+ - **Status**: Enhanced with 13-point validation system
85
+ - **Key Features**:
86
+ - TOC insertion with clickable links
87
+ - JPEG orientation correction
88
+ - Exhibit date stamping
89
+ - Availability metadata appending
90
+ - Video/audio thumbnail generation
91
+ - In-place PDF modification with PyMuPDF
92
+ - Compliance scoring (target ≥ 0.95)
93
+
94
+ ### Bundle Generation Workflow
95
+ 1. **Primary Generator**: `create_proper_embedded_bundle.py`
96
+ 2. **Evidence List**: `EvidenceListsFormatted/n244_formatted_evidence.json`
97
+ 3. **Command**:
98
+ ```bash
99
+ python3 create_proper_embedded_bundle.py \
100
+ EvidenceListsFormatted/n244_formatted_evidence.json \
101
+ --strategy high-impact --limit 150 --volume-split 50 \
102
+ --metadata-format real_evidence_bundle_standard \
103
+ --output-dir /home/mrdbo/court_data/CourtBundleOutput
104
+ ```
105
+ 4. **Self-Healing**: Run up to 3 iterations until compliance_score ≥ 0.95
106
+
107
+ ### Metadata Bridge Integration (2025-07-25)
108
+ - **File**: `metadata_bridge.py`
109
+ - **Purpose**: Bridges metadata extraction between legacy and new systems
110
+ - **Integration**: Works with `dual_category_evidence_processor.py`
111
+ - **Features**: Rich metadata extraction for court compliance
112
+
113
+ ### Dual Category Evidence Processor (2025-07-25)
114
+ - **File**: `dual_category_evidence_processor.py`
115
+ - **Status**: Enhanced with proper categorization logic
116
+ - **Features**:
117
+ - Maintains topical categories (Medical, Legal, etc.)
118
+ - Adds priority designations (Critical, High, Medium, Low)
119
+ - Preserves original evidence structure
120
+ - Integrates with metadata bridge
121
+
122
+ ## Test Suite Updates (2025-07-25)
123
+ - **New Test**: `test_self_healing_fixes.py`
124
+ - **Purpose**: Validates self-healing bundle functionality
125
+ - **Coverage**: TOC insertion, JPEG rotation, metadata, date stamps
126
+
127
+ ## Output Standardization (2025-07-04)
128
+ - Generator creates timestamped bundles (e.g. `ultra_fast_bundle_20250704_163733.json`)
129
+ - `latest_bundle.json` symlink points to newest bundle
130
+ - Validators MUST use symlink path
131
+
132
+ ## Pagination Mismatch Analysis (2026-02-09)
133
+ - **Symptom:** PDF verifier or manual inspection shows "Printed Page Number" on evidence pages not matching PDF physical page (e.g. page 461 shows "Page 2", or page 474 shows "Page 3283").
134
+ - **Tool:** `courtBundleGenerator3/tools/pagination_mismatch_analyzer.py` — run against bundle output directory or single PDF. Produces per-page mismatches, pattern hints (e.g. printed=0, printed=source-doc page), and root-cause suggestions (script/function).
135
+ - **Typical root causes:** `add_volume_pagination()` using wrong counter; `embed_evidence_with_metadata()` writing `raw_pg`/`needed_pages` instead of actual PDF page index; TOC page count not included when stamping "Page N".
136
+ - **Command:**
137
+ ```bash
138
+ cd /home/mrdbo/projects/courtBundleGenerator3 && python3 tools/pagination_mismatch_analyzer.py /home/mrdbo/court_data/2nd_CourtBundleOutput --json out.json
139
+ ```
140
+ @memory-bank/CRITICAL_INSTRUCTIONS.md
141
+ @memory-bank/CRITICAL_INSTRUCTIONS.md
142
+ @memory-bank/CRITICAL_INSTRUCTIONS.md
prompts/full_evidence_reference.txt CHANGED
@@ -287,3 +287,7 @@ Exhibit I1 (DB-41) — Flat_105c_floor_construction_breaching_ombudsman_orders_2
287
  Exhibit I2 (DB-42) — Flat_105c_floor_construction_breaching_ombudsman_orders_2024_05_25_11_18_58.jpg
288
  Exhibit I3 (DB-43) — Flat_105c_floor_construction_breaching_ombudsman_orders_2024_05_2511_19_05.jpg
289
  Exhibit I4 (DB-4288) — 20250610_105938_Potential_asbestos_workmen_with_chemical_tre
 
 
 
 
 
287
  Exhibit I2 (DB-42) — Flat_105c_floor_construction_breaching_ombudsman_orders_2024_05_25_11_18_58.jpg
288
  Exhibit I3 (DB-43) — Flat_105c_floor_construction_breaching_ombudsman_orders_2024_05_2511_19_05.jpg
289
  Exhibit I4 (DB-4288) — 20250610_105938_Potential_asbestos_workmen_with_chemical_tre
290
+ Exhibit E36 (DB-4579) — Spinal_Operation_Discharge_Letters.pdf
291
+ Exhibit E37 (DB-4580) — Leo_Sunil_psychologist_Medical_wellbeing_25-1-24.jpg
292
+ Exhibit E38 (DB-4581) — Drs_consultation_stating_asb_living_conditions_wellbeing_impact_x_consoltation_summary_decline_at_decant.PDF.pdf
293
+ Exhibit E39 (DB-4582) — therapy-Letter_1730394159.pdf