fix: canonical entity_type + remove unused docket type - #61
Conversation
ledgerClient was calling /api/evidence, /api/cases/*, and /api/evidence/*/custody — none of which exist on ChittyLedger. These endpoints belong to ChittyEvidence. - Rewrite ledgerClient to only expose real ChittyLedger endpoints: POST /entries, GET /entries, GET /custody/:id, GET /verify, GET /statistics - Add submitDocument and addCustodyEntry to evidenceClient - Update all callers (bridge, mcp, documents, timeline, dispute-sync) to use evidenceClient for evidence/case operations - Remove duplicate evidence fetch in timeline route - All operations include Bearer auth via CHITTYLEDGER_TOKEN Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The get_case_timeline handler still called ledger.getEvidenceByCase() which was removed from the rewritten ledgerClient. Evidence documents are already fetched via evidenceClient in the facts section above. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ledger_case_id is used for timeline/deadline joins and must be a stable
case reference (CC-DISPUTE-{prefix}), not a ledger audit entry UUID.
Store the entry UUID separately as ledger_entry_id.
Fixes CodeRabbit review findings on both mcp.ts and dispute-sync.ts.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… null guard - Fix Neon SQL template literal: conditional WHERE clauses don't work inline, use separate query branches for date filtering in get_case_timeline - Fix cc_disputes query: 'domain' column doesn't exist, use 'dispute_type' - Fix listJobs null guard: check Array.isArray(result.jobs) before .map() Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…per canon - Remove 'docket' from TimelineEvent union (never populated) - Fix entity_type: 'dispute' → 'event' in dispute-sync.ts and integrations.ts per chittycanon://gov/governance#core-types (disputes are Event (E)) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughThis PR refactors the ledger and evidence integration system to use a generalized entity-driven model for audit entries and splits evidence operations into a dedicated Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
To use Codex here, create a Codex account and connect to github. |
Summary
'docket'fromTimelineEventtype union — defined but never populated by any code pathentity_type: 'dispute'→'event'in dispute classification (dispute-sync.ts + integrations.ts) perchittycanon://gov/governance#core-types— disputes are occurrences in time (Event/E), not a valid canonical typeTest plan
type: 'docket'eventsentity_typechange aligns with P/L/T/E/A canonical ontologyclassifyDisputeaccepts string entity_type (no breaking change)🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Improvements