Phase 1 — Production Readiness Gap Remediation Backlog¶
Baseline: 3b8dd47807ea27ee6a3a51beed7281e87f34b97d
Scope rule: every item below closes a documented requirement, corrects a verified implementation defect, or provides standard hardening required for the requested local/cloud production parity. No new product feature is introduced.
Priority model¶
- Blocker: handling real complaint data, shared deployment, or reliable deployment is unsafe or impossible until closed.
- High: required for production reliability, operability, or parity but can follow the foundational blockers.
- Medium: hardening, assurance, or maintainability work required before final sign-off.
Blockers¶
| ID / pillar | Gap and evidence | Required remediation | Verifiable acceptance criteria | Target phase |
|---|---|---|---|---|
| B-SEC-01 Security | Status, retry, escalate, evidence, and delete accept only a short tracking ID and perform no ownership check (backend/app/main.py:294-428). OpenAPI declares no security scheme. |
Integrate a production IdP using OIDC/OAuth 2.1; require authenticated subject ownership or explicit scoped capability for every complaint object; enforce admin policy separately; use opaque high-entropy public identifiers; add negative authorization tests. | Cross-user read/write/delete/upload returns 403; anonymous access follows an approved capability model; admin access is audited; OpenAPI defines bearer/OIDC scopes; IDOR tests pass. | 3 |
| B-SEC-02 Security / parity | Demo identity and fallback JWT secret are enabled by default; Compose contains static credentials (backend/app/auth.py:30-56, infra/docker-compose.yml:3-15). |
Add typed startup configuration with explicit local, test, staging, and production modes; production must fail closed when demo mode, fallback secrets, mock connectors, permissive origins, or non-TLS public URLs are present; source cloud secrets from a managed secret store. |
Invalid/missing config exits non-zero before serving; production rejects demo secrets/connectors; committed files contain no deployable secret; rotation procedure is tested. | 2–4 |
| B-SEC-03 CI/CD | Live audits fail: npm reports 16 advisories including 5 high; pip-audit reports 17 advisories in PyJWT 2.13.0 and OpenTelemetry API 1.40.0. | Upgrade to fixed compatible versions, regenerate locks, run regression tests, and make npm/pip/container advisory thresholds mandatory PR gates with documented exception expiry. | npm audit --audit-level=high and pip-audit -r backend/requirements.txt pass or only contain time-bounded approved exceptions; image scan has no unapproved critical/high CVEs. |
2–3 |
| B-APP-01 Application | Celery polling and escalation tasks only count records, email uses a fixed recipient, and no retention task exists (backend/app/tasks.py:102-147). |
Implement the documented state machine: claim due work safely, call plugin status/escalation, persist idempotent transitions, send to the complaint owner, enforce retry/dead-letter policy, and purge/redact due data per governance rules. | Integration tests prove successful polling, timeout/backoff, exhausted retry, escalation, correct recipient, duplicate delivery safety, and retention purge/legal-hold behavior against Postgres/Redis. | 3 |
| B-DATA-01 Data | Complaint PII and evidence bytes are stored directly in database/local volumes without managed encryption, object isolation, automated retention, legal hold, backup, or restore validation. | Use managed encrypted PostgreSQL and encrypted object storage with malware scanning; minimize/tokenize fields; implement retention/legal hold/deletion; define RPO/RTO; automate encrypted backups and restore drills. | Encryption and key rotation are evidenced; purge and legal hold tests pass; evidence never enters relational rows; a staged restore meets approved RPO/RTO and is recorded. | 3–4 |
| B-APP-02 Application / external dependency | All eight connectors are simulations, while requirements call for auto-routing to agency connectors (backend/app/plugins/registry.py; docs/BRD_TRD.md). |
Select one documented launch agency, complete legal/contract review, implement its sandbox/approved contract behind the existing plugin interface, and retain official-site fallback. Do not expand to other agencies until its gate passes. | Contract tests, sandbox certification, failure playbook, consent/data mapping review, rate-limit handling, and rollback/disable switch are approved for the selected agency. | 3–5 |
| B-CLOUD-01 Parity / IaC | No cloud target, network design, compute definition, managed data service, TLS, secret store, or IaC exists. | Record a cloud ADR, then implement modular Terraform/OpenTofu (or repository-approved equivalent) for networking, ingress/TLS, compute, managed Postgres/Redis/object storage, secret store, telemetry, backups, IAM, and staging/prod isolation. | Format/validate/lint/security scan pass; staging plan is reviewed; drift check is clean; destructive changes require approval; local and cloud service contracts use the same images/config schema/migrations. | 4 |
| B-CICD-01 CI/CD | CI does not build/run images or exercise Postgres/Redis; E2E mocks API/auth; no release/deploy workflow exists (.github/workflows/ci.yml, frontend/e2e/demo-smoke.spec.ts). |
Add service-backed integration tests, image builds, SAST, secret and IaC scans, SBOM/provenance, registry publication, migration job, staged deployment, synthetic smoke tests, and automated rollback gate. | PR gate exercises real containers and critical API/UI flow; signed immutable images are promoted by digest; migrations are backward-compatible; failed smoke test rolls back; production requires protected-environment approval. | 2–4 |
High priority¶
| ID / pillar | Gap and evidence | Required remediation | Verifiable acceptance criteria | Target phase |
|---|---|---|---|---|
| H-APP-01 Application | State-changing routes allow arbitrary transitions and retries without idempotency or transition policy. | Centralize an allowed transition graph, use idempotency keys for submissions/actions, and reject conflicting/out-of-order work. | Concurrency tests show one durable outcome for duplicate and racing requests; invalid transitions return a standard 409 response. | 3 |
| H-APP-02 Application | Error responses are framework-dependent; middleware does not normalize unhandled exceptions; no explicit resource shutdown exists. | Add a versioned error envelope, exception mapping, request/trace ID propagation, bounded upstream timeouts, and lifespan shutdown for database/telemetry resources. | All error classes conform to the API contract and contain a correlation ID without PII; SIGTERM drains in-flight requests/tasks within the configured grace period. | 3 |
| H-SEC-01 Security | Rate limiting is process-local and trusts request.client.host; no distributed abuse or bot control exists. |
Implement Redis-backed limits by trusted client identity and route class, proxy trust configuration, payload quotas, accessible bot defense, and abuse telemetry. | Limits remain consistent across replicas; forged forwarding headers cannot bypass limits; accessible challenge and alert paths pass tests. | 3 |
| H-SEC-02 Security | Evidence validation trusts declared MIME type and uses only an EICAR substring check. | Stream uploads to quarantine object storage, detect real content type, scan asynchronously with a maintained engine/service, enforce decompression and file-type limits, and release only clean objects. | Polyglot, archive bomb, MIME spoof, oversize, timeout, and scanner-unavailable tests fail closed; clean objects become available only after scan completion. | 3–4 |
| H-DATA-01 Data | Alembic is present, but application startup also calls create_all; two incompatible legacy SQL schemas remain. |
Make Alembic the only production schema authority; remove or archive stale SQL; add migration compatibility and rollback policy. | Empty and previous-version databases migrate cleanly; application startup never creates schema in staging/production; schema drift test passes. | 2–3 |
| H-DATA-02 Data | Default engine pooling is implicit; polling queries load a fixed 200 rows then filter in memory; due-time/evidence-retention indexes are absent. | Configure pool size/timeouts/recycle per environment; query due rows in SQL with bounded batches and row locking/skip-locked; add indexes after explain-plan review. | Load test meets p95 target without pool exhaustion; query plans use approved indexes; concurrent workers do not double-claim work. | 3 |
| H-OBS-01 Observability | Worker/scheduler traces are absent, application and platform logs are fragmented, and OTel exports only to debug. | Instrument Celery and outbound HTTP; propagate trace context through tasks; standardize all service logs; deploy managed traces/logs/metrics with PII filters and retention controls. | One synthetic complaint is traceable edge-to-worker-to-connector with correlated, PII-safe logs; telemetry loss and cardinality tests pass. | 3–4 |
| H-OBS-02 Observability | Prometheus scrapes only API/itself; no alert rules, contact points, SLOs, or runbook links exist. | Add exporters/service metrics where justified, recording/alert rules, SLOs and burn-rate alerts, routing, and runbook annotations. | Staging exercises DB down, Redis down, queue backlog, connector failures, latency, and telemetry loss; each pages the intended route with an actionable runbook. | 3–4 |
| H-OPS-01 Operations | Readiness checks only the database and does not express degraded dependencies. | Define dependency criticality; check DB and required broker/config; expose component state without secrets; keep liveness independent. | Orchestrator removes an instance when a required dependency fails and does not restart it for ordinary dependency outages; recovery is automatic. | 2–3 |
| H-PARITY-01 Environment parity | Every infrastructure service uses a fixed host port and binds to all interfaces. On hamlet-server, existing TCP 9090 prevents the unmodified topology from starting; Postgres and Redis are exposed to the LAN. |
Add environment-driven loopback host bindings and Compose profiles/overrides for application, data, and observability services; make data services internal by default; document integration with an existing reverse proxy and monitoring stack. | A clean developer profile starts unchanged; a shared-host profile starts without collisions, exposes only approved ingress endpoints, and passes the same health/E2E suite; no database, broker, SMTP, or collector port is reachable from an unauthorized network. | 2 |
| H-CTR-01 Containers | Backend images are single-stage; frontend runtime does not declare non-root; services lack read-only roots/capability drops/resource constraints; tags are mutable. | Use reproducible multi-stage minimal images, non-root runtime UIDs, read-only roots/tmpfs, dropped capabilities, resource requests/limits, digest pinning strategy, and OCI metadata. | Image policy confirms non-root/no-new-privileges/read-only compatibility; container scan passes; graceful stop and writable-path tests pass. | 2–3 |
| H-TEST-01 Testing | Unit coverage is high, but no real full-stack API/UI test, browser matrix, failure injection, migration test, or concurrency/load gate exists. | Add Postgres/Redis integration suites, full Compose browser flows, mobile/desktop accessibility checks, migration tests, connector contract tests, and k6/Locust-style load thresholds. | CI proves submit-track-retry-evidence-delete through the real proxy/API/worker; at 50 concurrent users average submission latency is below 500 ms with fewer than 5% errors; every simulated FCC outage recovers without lost/duplicate state. | 2–3 |
| H-A11Y-01 Functional | WCAG and Spanish are documented requirements, but tests cover two axe surfaces and two desktop smoke paths; strings are hard-coded. | Introduce i18n keys, Spanish content review, automated axe coverage for critical states, keyboard/screen-reader/manual test matrix, and independent WCAG 2.2 AA audit before launch. | English/Spanish critical journeys pass; zero serious/critical axe violations; independent audit findings are closed or formally accepted. | 3–5 |
| H-DOC-01 Documentation | Vision, plugin, architecture, data-governance, observability, accessibility, and handoff documents contradict executable rc.3 behavior. | Establish current-state versus target-state labels, rewrite plugin guidance, remove false “live/integrated/complete” claims, and generate/reference contracts from code. | Documentation link/claim checks pass; every production claim maps to deployed evidence; architecture diagrams match staging. | 3–5 |
Medium priority¶
| ID / pillar | Gap and evidence | Required remediation | Verifiable acceptance criteria | Target phase |
|---|---|---|---|---|
| M-SEC-01 Security | CSP permits inline styles; metrics/API docs exposure policy is undefined; security headers are split between nginx and app. | Define edge-owned header policy with nonces/hashes, restrict operational endpoints by network/auth policy, and test headers at the public ingress. | Browser/security tests show no required unsafe directives; metrics/docs are inaccessible outside approved paths; header policy is single-source. | 3–4 |
| M-CICD-01 CI/CD | No artifact retention policy, release manifest, changelog enforcement, or automated API compatibility check exists. | Produce a release manifest containing commit, image digests, SBOMs, migration revision, config schema, and test evidence; add OpenAPI breaking-change review. | A release can be reproduced and audited from the manifest; unapproved API break fails the PR gate. | 4 |
| M-OPS-01 Operations | Tabletop material is generic and no tested service-specific incident, backup, connector-disable, or rollback runbook exists. | Create executable runbooks with owners, severity, communication path, and quarterly exercise schedule. | Staging tabletop and restore/rollback exercises produce timestamps, outcomes, gaps, and owners; critical actions are executable by an on-call engineer. | 4–5 |
| M-PERF-01 Performance | Frontend ships a 1.44 MB uncompressed wayfinding image and has no bundle/performance budget. | Optimize responsive media and add bundle/Lighthouse budgets for critical routes without changing visual direction. | Approved mobile profile meets defined LCP/CLS/INP and asset-size budgets in CI. | 3 |
| M-DATA-01 Data | Database-level audit events are not immutable and do not record the actor or access to PII. | Add actor, request/trace, purpose, and policy outcome fields; prevent update/delete by application role; export tamper-evident audit records. | Application role cannot mutate audit rows; read/write/delete/admin access generates actor-attributed events; integrity verification detects tampering. | 3–4 |
Ordered execution dependency¶
- Phase 2: configuration schema/fail-closed profiles, dependency remediation, hardened local images/Compose, migration authority, real service-backed CI tests.
- Phase 3: identity and object authorization, durable workflows, data/evidence controls, state/idempotency, observability, abuse controls, accessibility/localization, performance and load verification.
- Phase 4: cloud ADR and IaC, managed services/secrets/telemetry, protected CI/CD promotion, staging deployment, synthetic and rollback tests.
- Phase 5: one approved real connector, legal/privacy/accessibility/security sign-offs, documentation reconciliation, restore/rollback rehearsal, and production cutover checklist.
Phase 2 must not start until the Phase 1 gate is accepted and Docker runtime verification can be executed.