ai-powered-conversational-intelligence

Production Readiness & Release Gate (Prompt 25)

Date: 2026-10-03. Scope: the full backend/platform, across every prompt built to date (02 through 24) — architecture, SQL safety, onboarding, semantics, analytics, recommendations, tenancy, security, scale, observability, backup/recovery, rollback, deployment, operations. Method: every row/finding below is either (a) re-verified fresh this session against the running code (full pytest suite, ruff/black/ mypy/bandit, the frontend’s own vitest suite and production build), or (b) carried forward explicitly from a named, dated prior report, with its own currency stated plainly rather than silently assumed.

This document is now the authoritative production-readiness source for this project. It explicitly supersedes the scores and verdicts (not the underlying evidence, which remains valid history) of:

None of those documents’ underlying evidence is wrong for the state it was captured against — they’re kept as history, now each carrying a one-line pointer to this document. Nothing here was re-scored by replaying every original finding; §2’s gate matrix re-verifies what changed and explicitly marks what it did not re-touch.

1. Executive summary

Verdict: CONDITIONALLY READY — not NOT READY, not an unconditional GO. This is a real change from the 2026-09-18 report’s NOT READY verdict, and the reason is structural, not a re-scoring of the same facts: that gate’s own decision rule made any unverifiable mandatory control an automatic NOT READY, with no distinction between “verification is incomplete” and “a vulnerability was found.” Re-applying that same rule here still yields the same three environment-blocked NOT VERIFIED items (DAST, live-OIDC, live malware-scanner) — nothing closed those this session either, for the identical reason: no live IdP, no live ClamAV daemon, and no network-reachable deployment exist in this sandboxed environment, same as every prior session. What changed is that this pass also verified, fresh, that the two months of work since (multi-tenancy, scale hardening, a dedicated security audit, observability, full-pipeline integration testing) hold up under direct re-inspection, and closed two previously- open, concretely-fixable gaps (backup/recovery and rollback documentation, §5). The honest framing: this platform’s code-level controls are unusually mature and freshly re-verified; the three operational verification gaps are the same three they were in September and still require real infrastructure this environment cannot provide.

2. Gate matrix

Extends docs/security/FINAL_PRODUCTION_GATE.md’s own 25-row matrix (unchanged rows carried forward by reference, not reproduced below) with the rows that changed since 2026-09-18 and the rows that prompt covered but this broader one (analytics/recommendations/tenancy/onboarding/ semantics/AI evaluation/scale) did not.

Status legend: PASS · FAIL · PARTIAL · NOT VERIFIED · N/A

2a. Rows changed since 2026-09-18

Domain Status (was) Status (now) Evidence
Authentication/RBAC PASS PASS, broader Prompt 20 added real multi-tenancy on top of the existing 4 auth modes/15 permissions — tests/security/test_cross_tenant_isolation.py (532 lines) and test_cross_tenant_shared_infrastructure.py (269 lines, proves no tenant leak under real concurrent threading, not just sequentially) both pass fresh this session.
Rate Limiting PARTIAL (process-local only) PARTIAL, same root cause, narrower blast radius Still process-local (unchanged — no Redis anywhere in this codebase, confirmed by fresh grep). Prompt 22 added a second, independent limiter dimension: per-database execution concurrency (agent.rate_limit.get_database_execution_limiter), protecting one database’s own connection pool from being saturated by concurrent /ask//execute calls regardless of the API-tier limiter’s own state — a different failure mode than the one this row originally scoped. Measured (in-process benchmark, not live k6 — Docker unavailable in this environment): p50 drops from 540.7ms to 0.8ms at saturation. See docs/SCALE_BASELINE.md’s “Prompt 22” entry.
Monitoring PARTIAL (no metrics backend) PARTIAL, same root cause, real log-based improvement Still no Prometheus/OpenTelemetry (unchanged, deliberate posture). Prompt 23 closed the real gap underneath this row’s own “operational maturity” framing: every log line (not just security.audit events) now carries both correlation ID and tenant, and every LangGraph stage emits an additive [trace] line (status/error-category/model/db-provider/hashed-query-fingerprint/result-size) — the acceptance criterion “failures can be attributed to a specific stage” is now mechanically true from logs alone. See docs/OBSERVABILITY.md’s §3/§3a.
Backup/Recovery NOT VERIFIED PARTIAL — closed where this app has a real opinion, honestly scoped where it doesn’t §5 below. A real procedure now exists for what this app actually owns (the optional identity Postgres database’s schema via Alembic, the regenerable Chroma vector index, .env/configuration). The operator’s own connected business database remains explicitly out of scope, as it always was — this app is a read-only client of it, never its data owner.
Rollback (not a named row before) PARTIAL — new row §5 below. Container-image rollback (digest-pinned, tag-addressable), alembic downgrade for the identity schema, and .env-flag rollback for every opt-in feature added since Prompt 08 are now documented. Not independently exercised against a real deployment in this session (no live environment) — documented and code-level-verified (every migration file has a real downgrade(), confirmed by direct read), not drilled.
Dependencies PARTIAL PARTIAL, re-verified, zero drift Fresh pip-audit run this session (Prompt 21): identical CVE set to the 2026-09-18 triage, all already covered by CI’s own --ignore-vuln allowlist with individual, file:line-cited justification in docs/security/CVE_TRIAGE.md. Re-verified that no new first-party usage of CachePolicy/Checkpointer/ChatOpenAI was introduced across Prompts 19-24 (the preconditions that would make any of these CVEs newly reachable) — still 0 matches outside env//.venv/.

2b. New rows (areas this gate’s September predecessor didn’t cover)

Domain Status Evidence
Tenant Isolation PASS Real tenant resolution from a server-signed token claim only (never a client-supplied header — security.tenancy.reject_client_tenant_override refuses X-Tenant-Id-shaped headers outright, even in AUTH_MODE=none). Deny-by-default on missing/suspended tenant, anti-enumeration (cross-tenant denial maps to the same 404 a nonexistent resource gets, everywhere this pattern is used). Shared infrastructure (compiled LangGraph graph, cached Ollama client) proven not to leak tenant context under genuine concurrent threading, not just sequential calls (tests/security/test_cross_tenant_shared_infrastructure.py). Known, disclosed limitation, not a hidden gap: no live two-tenant deployment has ever been exercised — every invariant above is verified against an in-memory SQLite identity database, and PII classification + RBAC role definitions remain intentionally global, not per-tenant (docs/MULTI_TENANCY.md’s own “Known limitations”).
Database Safety PASS AST-based allowlist (unchanged, still the real boundary per the September gate’s own row), plus: restricted-column enforcement extended to the new Prompt 22 result cache (never caches SQL touching a classified-restricted column, regardless of flag state or caller permission) and verified end-to-end through the real compiled graph for the first time this session (Prompt 24’s tests/test_full_pipeline_integration.py). Query Store intelligence (Prompt 19, SQL-Server-only) never returns raw SQL text, only a sqlglot-literal-masked preview — verified by direct read, no live SQL Server with Query Store enabled available to test against real data.
Onboarding Engine PASS (code-level), NOT LIVE-VERIFIED No connection secret ever persisted (verified: identity.models.OnboardingJob has no password field at all); publish is blocked while any review item is still pending (OnboardingJobError, closing the “silently promoted inference” risk master rule 10 forbids); a real create→discover→review→publish lifecycle passes against a real SQLite target database (tests/test_api_onboarding.py::TestFullLifecycle, re-run fresh this session). Prompt 21 found and closed a real gap (no rate limit on three routes that open outbound connections to caller-supplied host/port, usable as a TCP-connect reconnaissance oracle even though already admin-gated) — now bounded. Never exercised against a real, external client database by an actual SME reviewer.
Semantic Catalog / Governed Metrics PASS Only a PUBLISHED, CONFIRMED_BUSINESS_TRUTH catalog entry is ever rendered into a retrieval chunk or a mandatory-metrics prompt block — structurally guaranteed (the rendering functions are only ever called from the publish code path), not a runtime check that could be forgotten. Deterministic-rendering guarantee re-verified this session two ways: eval/component_benchmark/cases_semantic.py (6 cases, direct function calls) and tests/test_full_pipeline_integration.py::TestGovernedMetricEnforcementJourney (the real graph, review_metric_conformance_node actually engaging mid-run).
Analytics Correctness PASS Pure, deterministic, zero-I/O engine (analytics/engine.py) — reused directly (not re-implemented) by a new regression harness this session (eval/component_benchmark/cases_analytics.py, 8 cases covering all 6 ResultShapes) and exercised through the real compiled graph for the first time (Prompt 24). Every finding carries its own formula/engine-version metadata, verified by a dedicated case.
Recommendation Evidence PASS “No recommendation without evidence” is enforced in code (recommendation.engine._finalize_candidate is the only construction site, and refuses an empty-evidence candidate), re-verified by direct function call (eval/component_benchmark/cases_recommendations.py, 5 cases including the SECURITY-category suppression/authorization check) and through the real graph end-to-end (Prompt 24). The operations category (root-cause analysis) is a known, disclosed non-firing path in the live graph — it needs a second comparison dataset this single-query pipeline doesn’t produce; fully built and tested, just never reached live.
AI Accuracy (Text-to-SQL) STALE — not re-verified this session The only real numbers that exist (docs/EVALUATION_CURRENT.md: 92.5% execution accuracy / 42.3% result-set accuracy / 50% final accuracy) are from a live run dated 2026-09-16 — 13 prompts of real pipeline changes ago (planning, governed metrics, intent classification, analytics, forecasting, recommendations, Query Store, multi-tenancy, scale/perf changes, observability). None of those numbers have been re-measured against current code, because doing so needs a live Ollama instance and a live database, neither available in this sandboxed environment. This is this gate’s single most significant unverified-by-staleness item outside the three already-named NOT VERIFIED rows — see §4, P1-1.
Prompt-Injection Benchmark PASS, presumed still valid, not re-run The 500-case benchmark (0 critical findings, dated 2026-09-24/25) is still presumed accurate: its own disclosed re-run trigger (“re-run after any change to agent/sql_validator.py, security/injection_patterns.py, or the orchestrator’s prompt construction”) was checked against every file touched in Prompts 20-24 — none of those three were modified. Not independently re-run this session (needs live LLM+DB).
Scale (single-instance) PARTIAL, Phase 0 of 11 only Real, measured (Prompt 22, in-process threaded benchmark — not a live k6 run, Docker unavailable): the new per-database concurrency limiter drops p50 from 540.7ms to 0.8ms at saturation. The real HTTP-level k6 baseline (docs/SCALE_BASELINE.md Runs 1-2, 2026-09-26) remains Phase 0 only — single node, no distributed rate limiting, no separate inference tier. No multi-replica deployment has ever been exercised.

3. Corrected claims (actively false, not just stale)

Two documents contained claims that are now incorrect, not just dated — each corrected in place this session with a pointer to this document, rather than left to mislead a future reader:

4. P0 / P1 / P2 / P3 findings

P0 (blocking, must resolve before a genuine multi-user production launch) — unchanged from 2026-09-18, still environment-blocked, not closed this session:

# Finding Why still open
P0-1 DAST has never been run against this application, at any point in its history. No staging environment or scanner (OWASP ZAP) available in this sandboxed session — identical constraint every prior session hit.
P0-2 OIDC has never been verified end-to-end against a live Identity Provider. No live IdP available. Code-level review (algorithm allowlist, audience/issuer validation, JWKS-based signature verification, PKCE flow) was independently re-confirmed by direct read this session, not newly re-verified against a live provider.
P0-3 Malware scanning (security/malware_scanner.py) ships disabled by default and has never been run against a real clamd daemon. No ClamAV daemon available. The fail-closed contract (infected/timeout/unreachable/malformed all block) is verified against a mocked socket only.

P1 (should resolve before production, or explicitly accept with sign-off):

# Finding Status this session
P1-1 AI accuracy benchmark numbers are 13 prompts stale (§2b). Not closed — needs a live Ollama + database re-run, unavailable here. Documented as the single most actionable follow-up once such an environment exists (scripts/run_benchmark.py).
P1-2 No backup/recovery procedure for what this app itself owns (identity DB schema, Chroma index, configuration). Closed this session — see §5 and docs/DEPLOYMENT.md’s new “Backup & Recovery” section.
P1-3 No rollback procedure (container image, identity-DB migration, feature-flag-based). Closed this session — see §5 and docs/DEPLOYMENT.md’s new “Rollback” section.
P1-4 Two documents contained actively false security claims (§3). Closed this session — corrected in place.
P1-5 Rate limiting remains process-local only; no distributed coordination across replicas. Not closed — needs a shared store (Redis), a real, separate, larger piece of work explicitly out of scope for this pass, same as every prior session’s own disclosure.
P1-6 Planning/review/intent/forecast LLM calls (6 of 7 *_from_llm functions) are not individually rate-limited — only generate_sql_from_llm checks agent.rate_limit.get_llm_call_limiter (confirmed by fresh grep this session: exactly one call site). Not closed. Partially mitigated structurally: total LLM calls per question are still bounded by state["max_retries"] (3-5 typically), so this is “the limiter undercounts total LLM load,” not “load is unbounded” — carried forward from docs/RISK_REGISTER.md R-007, not re-scored to a higher severity, not newly discovered.

P2 (track, fix opportunistically):

P3 (cosmetic / low-value):

5. Backup, recovery & rollback

Closed this session — see docs/DEPLOYMENT.md’s new “Backup & Recovery” and “Rollback” sections for the full, operator-facing procedure. Summary:

6. Release checklist

A consolidated, current go/no-go list — supersedes the scattered, partially-stale items in docs/PRODUCTION_CHECKLIST.md/ SECURITY_PRODUCTION_CHECKLIST.md for anyone starting a new deployment today (those two files remain as historical detail, pointed here).

Blocking:

Strongly recommended, not blocking a single-tenant/trusted-network deployment:

7. Prerequisites for production

8. Post-release monitoring plan

Building directly on Prompt 23’s observability work, not a new mechanism: