How johan8124/civictrail works
CivicTrail is a web-based, evidence-first civic workflow assistant. A person enters a problem and evidence in the case intake; the triage API validates the request and delegates to an orchestrator that uses an agent to suggest a supported workflow and official route. Deterministic rules—not the agent—evaluate evidence and determine readiness. Results include an inspectable evidence ledger and a source-referenced action packet for human review; the product does not submit actions automatically. The graph reflects documented responsibilities and sampled calls; internal agent-tool wiring is summarized where its implementation was not sampled.
Main entry points: triage-orchestrator.ts Triage orchestrator · CaseIntake.tsx Case intake · route.ts Triage API · engine.ts Readiness computation
Components 15
User experience
- Case intake
app/components/CaseIntake.tsx - Result views
app/components/ReadinessBanner.tsx
Triage orchestration
- Triage API
app/api/triage/route.ts - Triage orchestrator
lib/agent/triage-orchestrator.ts - Strands agent
lib/agent/triage-agent.ts - Typed agent tools
lib/agent/agent-tools.ts - Classification guard
lib/agent/classification.ts
Verification and evidence
- Deterministic rule engine
lib/rules/engine.ts - Readiness computation
lib/readiness/engine.ts - Evidence ledger
lib/evidence/ledger.ts - Action packet
lib/action-packet/packet.ts
Official routing
- Official route catalog
lib/routes/index.ts - Verified source registry
lib/source-registry/registry.ts
Other components
- Person
- Human reviewer
Connections 16
- Person → Case intake: enters case
- Case intake → Triage API: posts case
- Triage API → Triage orchestrator: runs triage
- Triage orchestrator → Strands agent: requests analysis
- Strands agent → Typed agent tools: calls tools
- Triage orchestrator → Classification guard: guards workflow
- Triage orchestrator → Readiness computation: computes readiness
- Readiness computation → Deterministic rule engine: evaluates evidence
- Readiness computation → Evidence ledger: records findings
- Triage orchestrator → Official route catalog: resolves route
- Official route catalog → Verified source registry: reads verified sources
- Triage orchestrator → Evidence ledger: records classification and route
- Triage orchestrator → Action packet: builds packet
- Triage API → Case intake: returns result
- Case intake → Result views: renders result
- Result views → Human reviewer: presents for review