--- name: Session 2026-04-03 — Epistemic Integrity description: Major diagnostic session. Found confidence kill chain in L1 pipeline. Three invariants for Cluster A. Constitutional position on earned confidence. Branch with performance fixes and observation-recall coupling. type: project permalink: claude-memory/session-2026-04-03-epistemic-integrity --- ## Session 2026-04-03 (morning/afternoon) ### What happened - Pulled Seb's Amendment 58 (quality gate) + Amendment 59 (TSDoc headers) + pipeline QA monitor - Server SIGILL crash on write load — same #78 pattern - **Diagnosed root cause:** entity module `tombstoneWeakEdges()` full table scan every 100 events + budget module triple-nested N+1 query cascade - **Built branch `feat/observation-recall-coupling`** with 5 commits: - Observation-recall coupling (PENDING-16 architecture) - Entity tombstone interval 100→10000 + compound index - Budget N+1 cascade fix + safety post-filter to SQL - Temporal coverage unconditional latest overwrite fix - Density gate ordering fix (also on main) - **All tests green:** 250 files, 3719 tests, 0 failures ### Major finding: Epistemic Integrity Thistleweld-driven diagnostic found the confidence kill chain: 1. Classification computes confidence → no module reads it (`base.ts:83`) 2. Bloom filter locks in degraded guesses as permanent records 3. Entity graph launders source uncertainty through resolution confidence 4. Recall returns guesses with same authority as knowledge 5. Four models in pipeline, none knows if others failed ### Three invariants proposed (Cluster A) - **I-CF:** Processing Confidence Floor (no module processes unearned confidence) - **I-CC:** Classification Confidence Ceiling (cap to source accuracy) - **I-NF:** Novelty Floor (already in REVIEWED-18) ### Constitutional position: Earned Confidence - Jurist assessed as constitutional position for L2 preamble - "The system does not grant epistemic authority to its own outputs without external grounding" - Connects to constitutive seam: grounding chain terminates at ICP-19/external reviewer - L0 readiness condition: L1 must be epistemically honest for contamination problem inquiry ### Documents produced - `amendments/amendment-epistemic-integrity.md` — consolidated amendment (supersedes the three below) - `amendments/amendment-observation-recall-coupling.md` — authorized, branch built - `amendments/amendment-epistemic-confidence-chain.md` — superseded by consolidated - `amendments/epistemic-confidence-chain-dataflow.md` — superseded by consolidated ### Governance state - PENDING-16 (observation-recall coupling): AUTHORIZED in REVIEWED-18 - Epistemic integrity amendment: DRAFT — jurist reviewed, awaiting steward decision on PENDING filing - Density gate fix: committed to main (`247bf6d`) - Feature branch: NOT pushed (awaiting Seb review) ### Open for Seb - Amendment note with 6 engineering questions - Feature branch for review - Server instability on current data (1.3 GB SurrealDB) — recommend repair before re-ingestion - TOMBSTONE_INTERVAL + budget cascade are the immediate crash fixes ### Open for governance - File consolidated amendment as PENDING-17? - Three invariants for Cluster A formal review - "Earned confidence" constitutional position for L2 preamble - I-CC enforcement vocabulary question (CAP/BOUND vs binary actions) - Competence-change replay trigger design ### Key insight **L0 is the contamination problem.** L1 must be epistemically honest to support L0 inquiry. The epistemic integrity amendment is the L0 readiness condition. Without it, L0 inherits false confidence from L1. The grounding chain terminates outside the system — ICP-19 and external review are constitutive, not decorative. ## Session 2026-04-04 (overnight/morning) ### Seb shipped Amendment 61 - Read our amendment, agreed, built the entire epistemic confidence chain overnight - 9 commits: EarnedConfidence type, confidence ceiling (I-CC), confidence floor (I-CF) at base.ts:83, dual bloom filter, source_classification_confidence on vector/entity/temporal, confidence-weighted recall, epistemic health reporting, regression tests - Merged our feature branch as Amendment 60 - Synthesized Amendments 58-61 into specs (batch 45) - Minor fixes needed: EntityExtractionRule missing `flags` field, seed rule count assertions (35→38). Both pushed. ### Repair + replay initiated - Factory repair: wiped 1.4 GB SurrealDB, preserved 129 MB logchain (22,077 entries) - Replay running through new pipeline (Amendment 61 active) - After 5 hours: 28/22,077 events replayed. Server STABLE — no SIGILL. - Epistemic state visible: degraded_event_ratio 3.6%, confidence_floor 0.35, grounded_ratio 0 - 27/28 events classified by rules successfully. 1 degraded. ### Performance findings during replay - Entity p50: 170ms (fixed from 3000ms), BUT p95: 3701ms — Levenshtein fuzzy match still spikes - Vector p50: 139ms, p95: 799ms — Ollama embedding bottleneck on 16 GB RAM - Replay throughput: ~5 events/hour. Full replay at this rate: ~184 days. NOT VIABLE. - SurrealDB: 656 MB from 28 events — storage bloat per event unchanged ### Open issues for Seb 1. **Replay throughput** — 5 events/hour won't finish. Vector embedding is the bottleneck. Options: skip vector during replay, defer to later pass, or run on machine with more RAM. 2. **Entity Levenshtein spikes** — p95 still 3.7s. Needs candidate pre-filter or length-bucketed cache. 3. **SurrealDB bloat** — 656 MB for 28 events (23 MB/event). This is internal SurrealDB overhead, not our code. 4. **Bloom filter monitoring gap** — health reports allocated size (12 KB) not fill count. Can't verify dual bloom is differentiating understood vs degraded. 5. **80 skipped tests** — 31 e2e, 21 MCP validation, 11 spec-corpus, 6 event-bus. Integration tests that would catch cross-module epistemic issues aren't running.