This document connects the canonical CleanApp philosophy docs to the system that is actually live today.
It is intentionally not a replacement for:
/Users/anon16/Downloads/cleanapp_back_end_v2/WHY.md/Users/anon16/Downloads/cleanapp_back_end_v2/THEORY.md/Users/anon16/Downloads/cleanapp_back_end_v2/INVARIANTS.md/Users/anon16/Downloads/cleanapp_back_end_v2/ARCHITECTURE.md
Those remain the canonical mission and system-design backbone.
Use this file when you need to answer:
- what is live today
- which subsystems are canonical vs transitional
- where the main logic currently lives in code
For the full system model:
/Users/anon16/Downloads/cleanapp_back_end_v2/WHY.md/Users/anon16/Downloads/cleanapp_back_end_v2/THEORY.md/Users/anon16/Downloads/cleanapp_back_end_v2/INVARIANTS.md/Users/anon16/Downloads/cleanapp_back_end_v2/ARCHITECTURE.md- this file
Canonical machine-ingest core:
- CleanApp Wire on
report-listener - documented in
/Users/anon16/Downloads/cleanapp_back_end_v2/docs/cleanapp-wire.md
Canonical human-ingest facade:
POST /api/v1/human-reports/submit- implemented on top of the same Wire-backed ingest core
- documented in
/Users/anon16/Downloads/cleanapp_back_end_v2/docs/security-hardening-2026-03-11.md
Implementation center:
/Users/anon16/Downloads/cleanapp_back_end_v2/report-listener/handlers/cleanapp_wire_v1.go/Users/anon16/Downloads/cleanapp_back_end_v2/report-listener/handlers/human_ingest.go/Users/anon16/Downloads/cleanapp_back_end_v2/report-listener/database/cleanapp_wire_v1.go
Canonical public report identity:
public_id
Canonical public report detail path:
- report pages keyed by
public_id
Canonical read-plane design principle:
- public browsing stays open
- export-like bulk surfaces should be constrained
- visualization and stable identifiers are separated where possible
Implementation center:
/Users/anon16/Downloads/cleanapp_back_end_v2/report-listener/main.go/Users/anon16/Downloads/cleanapp_back_end_v2/report-listener-v4/src/main.rs/Users/anon16/Downloads/cleanapp_back_end_v2/docs/security-hardening-2026-03-11.md
Canonical case model:
- a case is a durable aggregate of one or more cluster snapshots
- a cluster is not automatically identical to a case
- new clusters may attach to an existing case rather than creating duplicates
Implementation center:
/Users/anon16/Downloads/cleanapp_back_end_v2/report-listener/handlers/cases.go/Users/anon16/Downloads/cleanapp_back_end_v2/report-listener/database/cases.go/Users/anon16/Downloads/cleanapp_back_end_v2/report-listener/database/case_accumulation.go/Users/anon16/Downloads/cleanapp_back_end_v2/docs/cleanapp-cases.md
Canonical routing posture:
- defect-general, not physical-only
- shared routing engine for cases and solo reports
- responsibility routing is distinct from raw contact discovery
- notify plans are wave-based and multi-party
- outcome memory should improve routing over time
Implementation center:
/Users/anon16/Downloads/cleanapp_back_end_v2/report-listener/handlers/case_contact_discovery.go/Users/anon16/Downloads/cleanapp_back_end_v2/report-listener/handlers/case_notify_routing.go/Users/anon16/Downloads/cleanapp_back_end_v2/report-listener/handlers/contact_routing_context.go/Users/anon16/Downloads/cleanapp_back_end_v2/report-listener/handlers/report_contact_strategy.go/Users/anon16/Downloads/cleanapp_back_end_v2/report-listener/database/subject_routing_strategy.go/Users/anon16/Downloads/cleanapp_back_end_v2/docs/case-contact-discovery-2026-03-11.md
These parts of the system exist, but should be treated as transitional or compatibility surfaces rather than the cleanest expression of the architecture:
- legacy v2 backend compatibility routes
- older v3/v4 bulk-ingest compatibility callers
- older notification flows centered only on email-service polling
- docs that describe first shipped slices before later refactors
When a topical doc and code disagree:
- philosophy and intent: root docs win
- implementation reality: code wins
- this file should be updated to explain the gap
Primary responsibility:
- ingest edge
- public report APIs
- case APIs
- contact routing
- escalation plans and delivery records
Primary responsibility:
- fast public renderer/read surfaces
- globe and lightweight public consumption paths
Primary responsibility:
- AI enrichment
- analysis generation
- report-level structure extraction
Primary responsibility:
- actual email execution
- provider integration and delivery status
Primary responsibility:
- public browsing, report detail, case review, escalation workflows
- should reflect the shared backend routing model, not invent parallel logic
- Ingest raw signal.
- Preserve the raw report.
- Enrich it with analysis and structure.
- Compound signals into clusters and cases where appropriate.
- Route to the best responsible and interested actors.
- Execute outreach through the best available channels.
- Learn from delivery, acknowledgment, and outcome signals.
/Users/anon16/Downloads/cleanapp_back_end_v2/docs/cleanapp-wire.md/Users/anon16/Downloads/cleanapp_back_end_v2/docs/cleanapp-cases.md/Users/anon16/Downloads/cleanapp_back_end_v2/docs/security-hardening-2026-03-11.md/Users/anon16/Downloads/cleanapp_back_end_v2/docs/case-contact-discovery-2026-03-11.md/Users/anon16/Downloads/cleanapp_back_end_v2/docs/architecture/domain-model.md/Users/anon16/Downloads/cleanapp_back_end_v2/docs/decisions/decision-log.md