Archive

032 — Phase 3 Exit Audit (Detailed Register)

Phase 3 detailed gap register — P0 through P3, ADR fidelity, CI inventory.

Phase 3 Exit Audit — Detailed Gap Register

Date: 2026-08-31
Git SHA (main at audit): 45696a2
Branch: docs/m3-e5-phase3-exit-audit
Gate milestone: 3.E.5 Phase 3 exit audit
Tracks: A (schema), B (vector store), C (write pipeline), D (read/ranking), E (exit gate)


Executive summary

Phase 3 delivers the core memory substrate: schema v2 with HNSW, vector store abstraction, nine-step write pipeline (PII, dedup, temporal conflict, orchestration, multi-label), semantic search with composite ranking, hot cache read path, ISO-* security integration (12 cases), e2e lifecycle smoke, and retrieval-quality CI gates (HNSW + ranking + write pipeline).

Verdict: Phase 3 is substantively complete with zero open P0 gaps. Remaining items are P2 hygiene (schema doc drift, eval harness gaps) and P3 explicit deferrals (#641, #627, #642, #647, 1M full-profile benchmark, real MCP tools in Phase 3.5.E.2).

The original 3.E.5 exit-criteria list included a misplaced MCP E2E criterion and org-scope GDPR language; both are corrected in this register and the unified 10-item exit criteria published with the sign-off PR.


Severity definitions

LevelMeaning
P0Blocker — must be green before Phase 3.5
P1High — fix at exit gate or immediately after
P2Hygiene — fix before phase sign-off PR or document as accepted debt
P3Defer — document as Phase 3.5+ / Phase 4; not hidden

P0 — Blockers

None found. memory-test, memory-integration, and memory-security-integration are required on both ci-gate-python and ci-gate-go; e2e-smoke-p3-memory is required on ci-gate-python only. Published benchmark JSON on main (2026-08-31) reports status: pass for HNSW, ranking-quality, and write-pipeline suites.


P1 — High

None found. No blocking correctness or security defects identified in live code review for Tracks A–E.


P2 — Hygiene

GAP-3-P2-001 — DATABASE_SCHEMA.md missing memory_conflict_escalations

FieldValue
TrackA
EvidenceMigrations 000019 / 000020 create ibex_core.memory_conflict_escalations and memory_conflict_escalation_status ENUM; grep memory_conflict in DATABASE_SCHEMA.md returns no matches
RemediationAdd CREATE TABLE + ENUM block to DATABASE_SCHEMA.md; cite migrations 000019–000020
StatusOpen — documented; fix in Phase 3.5 hygiene or dedicated schema-doc PR

GAP-3-P2-002 — memory_versions documented but not migrated

FieldValue
TrackA
EvidenceDATABASE_SCHEMA.md lines ~742–773 define partitioned memory_versions; no memory_versions migration under infra/migrations/postgres/
RemediationMark as aspirational in schema doc or defer migration to Phase 3.5+ extraction/versioning work
StatusOpen — documented; not a Phase 3 deliverable

GAP-3-P2-003 — ADR-0057 status column vs migration 000020 ENUM

FieldValue
TrackB
EvidenceADR-0057 DDL shows TEXT + CHECK; live DB uses ibex_core.memory_conflict_escalation_status ENUM after 000020
RemediationUpdate ADR-0057 DDL snippet to match 000020
StatusOpen — doc drift only; runtime matches migration

GAP-3-P2-004 — PII structured recall fixture not CI-gated

FieldValue
TrackC
Evidencebenchmarks/memory/pii/recall_structured.json — n=20, recall=1.0, pass=true; no .github/workflows reference to recall_structured
RemediationAdd optional CI job or document manual refresh cadence in ADR-0054
StatusOpen — measured recall meets >95% goal; gate is manual

GAP-3-P2-005 — No labeled conflict-detection precision benchmark

FieldValue
TrackC
Evidencetest_conflict_service.py covers sequential supersede + overlapping escalation inline; no benchmarks/**/conflict* gold set
RemediationAdd labeled ambiguous-interval eval harness in Phase 3.5 or Track C hygiene
StatusOpen — unit/e2e coverage sufficient for Phase 3 exit; precision not quantified

GAP-3-P2-006 — Stale exit criteria on 3.E.5 milestone page

FieldValue
TrackE
Evidence3.E.5 listed MCP E2E + 11 criteria; Phase 3 scope excludes proxy hot path and real MCP tools
RemediationUnify to 10-item corrected list in sign-off PR
StatusResolved in 3.E.5 sign-off PR

P3 — Deferred (explicit)

IDItemRationaleDestination
GAP-3-P3-001Org-scope GDPR delete + MinIO archive purge + partial-failure orphan-detectionISO-2.2 not implemented; no org-delete API in Phase 3Phase 4.A.2 (#641) — issue CLOSED as deferral tracker
GAP-3-P3-002Escalation worker consuming memory_conflict_escalationsNoopConflictClassifier + durable rows sufficient for Phase 3Phase 3.5+ (#627)
GAP-3-P3-003Tier-2 async Presidio re-scan on read pathTier-1 regex guard ships; contextual PII residual risk documentedPhase 3.5+ (#642)
GAP-3-P3-004Explicit Redis ZREM / object-cache invalidation on SQL deleteHydrate-on-read drops stale members per ADR-0059Phase 3.5+ (#647)
GAP-3-P3-005HNSW 1M-row full-profile benchmark on default CIhas_1m: false on smoke/fast profile by design (publish_cells.py, test_build_published_data.py)Informational; run full profile manually or on schedule
GAP-3-P3-006CodeRabbit / Sonar / CodeScene advisory findings from Phase 3 PRsNot machine-auditable from repoManual review backlog; advisory only
GAP-3-P3-007MCP search_memory / write_memory E2E with ClickHouse tracingStubs only (services/mcp-memory/app/tools.py — persisted: False)Phase 3.5.E.2 (milestone)

Phase 3 exit criteria — evidence matrix (corrected 10-item list)

#CriterionEvidenceStatus
1Write pipeline passes unit + ISO-* testsCI jobs memory-test, memory-integration, memory-security-integration in ci-gate-python / ci-gate-goPass
2HNSW recall@10 ≥ 98% on committed CI profile; 1M optional on smoke/fasthnsw-benchmark-data.json latest run worst_recall_at_10: 1.0, gate_summary.recall_ok: true, has_1m: false (expected)Pass (smoke/fast profile)
3Temporal conflict: sequential supersede, overlapping escalate, no LLM on non-overlaptest_sequential_fact_supersedes_without_llm, test_overlapping_intervals_escalate_to_classifier; verify_phase3_memory_e2e.shPass
4Retrieval-quality benchmarks in CI with baselinesranking-quality-benchmark-data.json, write-pipeline-benchmark-data.json — status: pass 2026-08-31; memory-benchmark.yml regression gatesPass
5All 12 ISO-* security cases passmemory-security-integration-test-ci.sh requires ≥12 test_memory_iso_*; includes ISO-1.4 relationships cross-orgPass
6Per-memory FK cascade (ISO-2.1); org-scope GDPR deferredtest_memory_iso_2_1_memory_delete_cascades_fk_children; ADR-0060 §4; #641 deferredPass (per-memory only)
7Phase 1 + 2 security regression tests passsecurity-integration in ci-gate-goPass
8make e2e-smoke-p3-memory exits 0CI job e2e-smoke-p3-memory in ci-gate-pythonPass
9Phase 3 ADRs 0047–0049, 0052–0061 publishedADR nav through 0061; decisions.mdxPass
10No proxy hot-path changes in Phase 3git log e66e359..45696a2 -- services/proxy/internal/handler services/proxy/internal/middleware services/proxy/cmd/proxy — empty; only services/proxy/Dockerfile touched in #600Pass

Relocated: MCP search_memory/write_memory E2E → GAP-3-P3-007 (Phase 3.5.E.2). Phase 2.5 delivered MCP skeleton only (ADR-0050).


Track A — Schema & migrations (000014–000020)

MigrationShipsDATABASE_SCHEMA.md
000014memories foundation + RLS + temporal columnsAligned
000015memory_labels + primary sync triggerAligned
000016memory_relationships + supersession viewAligned
000017HNSW index (m=16, ef_construction=64), quality cols, search_vectorAligned
000018Partial unique on active content_hashAligned
000019memory_conflict_escalations tableMissing (GAP-3-P2-001)
000020memory_conflict_escalation_status ENUMMissing (GAP-3-P2-001)

HNSW build parameters: documented in 000017, ADR-0052, ADR-0053, ADR-0061, benchmarks/memory/publish_cells.py (ef_search=40 query-time GUC).


Track B — ADR fidelity (0047–0049, 0052–0061)

ADRStatusNotes
0047ImplementedTemporal validity columns, RLS
0048Implementedmemory_labels multi-label
0049Implementedmemory_relationships graph
0052ImplementedSchema v2 expand, HNSW
0053ImplementedPgVectorStore, composite scoring
0054ImplementedIn-process Presidio PII
0055ImplementedWrite-path dedup
0056ImplementedTemporal-interval conflict
0057ImplementedWrite orchestration; doc drift GAP-3-P2-003
0058ImplementedSemantic search FTS fallback
0059ImplementedHot cache read path
0060ImplementedTenant isolation + ISO-* CI
0061ImplementedBenchmark methodology + gates

Track C — Write pipeline

CheckResult
POST /v1/memories nine-step pipelineShipped 3.C.1–3.C.5
PII structured recall20/20 (recall_structured.json); not CI-gated (GAP-3-P2-004)
Sequential-fact zero LLMUnit test + e2e
Overlapping-interval escalationUnit test + e2e escalation row
memory_conflict_escalations durable rowsMigration 000019; worker deferred #627

Track D — Read/ranking + hot cache

CheckResult
POST /v1/memories/search semantic path3.D.1 shipped
Composite scoring in ranking3.D.2 + ranking-quality gold set v1
MemoryHotCacheReader + top-50 trim3.D.3 ADR-0059
Cross-org search isolationISO-1.1, ISO-1.5

Track E — Exit gate

ISO-* matrix (12 cases)

IDTestStatus
ISO-1.1Cross-org search emptyCovered
ISO-1.2Cross-org agent forbiddenCovered
ISO-1.3RLS floor malformed WHERECovered
ISO-1.4Relationship cross-org insert rejectedCovered
ISO-1.5HNSW no cross-org leakageCovered
ISO-1.6 / 1.8Hot cache agent isolation (parametrized)Covered
ISO-1.7Conflict escalations RLS isolationCovered
ISO-2.1Per-memory DELETE cascades FK childrenCovered
ISO-2.2Org-scope GDPR + MinIODeferred #641 (GAP-3-P3-001)
ISO-3.1Tier-1 PII bypass blocked on searchCovered (2 cases)
ISO-3.2Quarantined never in searchCovered

Benchmark freshness (latest on main, 2026-08-31)

SuiteFilestatusNotes
HNSWweb/public/benchmarks/hnsw-benchmark-data.jsonpassrecall@10=1.0, 10K+100K cells
Rankingweb/public/benchmarks/ranking-quality-benchmark-data.jsonpassgold set v1, 20 queries
Writeweb/public/benchmarks/write-pipeline-benchmark-data.jsonpassp95=47.3ms < 200ms SLA

Required on ci-gate-python / ci-gate-go:

JobScriptGate
memory-testmemory-test-ci.shboth
memory-coveragememory-test-ci.sh + coverage gateboth
memory-integrationmemory-integration-test-ci.shboth
memory-security-integrationmemory-security-integration-test-ci.shboth
e2e-smoke-p3-memorymemory-e2e-test-ci.shpython only
mcp-memory-testmcp-memory-test-ci.shboth
mcp-memory-coveragemcp-memory tests + coverageboth

Benchmark workflow (memory-benchmark.yml): collect-hnsw-benchmarks, collect-ranking-quality, collect-write-pipeline-bench — regression gates via check_hnsw_gate_status.py and suite-specific gate scripts.

Phase 1/2 regression: security-integration required on ci-gate-go.


What was already solid at audit

  • HNSW index from day one (no IVFFlat migration debt)
  • Composed tenant isolation (RLS + app-layer org_id + Redis namespacing) proven in CI
  • Write pipeline ordering (PII before embed) enforced in orchestrator
  • Category-conditional composite scoring wired through search and hot cache
  • Benchmark bot publish pipeline with committed baselines and CI regression gates

Sign-off criteria (post-audit)

  • Gap register complete (this document — 032-phase3-exit-audit.md)
  • Public summary published (phase3-exit-audit.mdx)
  • Zero open P0 gaps
  • All 12 ISO-* cases pass (pytest -m security_integration)
  • memory-security-integration required on main
  • Corrected 10-item exit criteria verified against evidence
  • current-state reflects Phase 3 complete
  • P2 hygiene items (GAP-3-P2-001–005) — open, documented, non-blocking
Edit on GitHub

Last updated on