feat(phase5): epistemic confidence model#137
Merged
Merged
Conversation
Calibrated uncertainty levels (established/provisional/contested/inferred) on warm-tier memories with auto-promotion via new sleep cycle Phase 5.12. New columns: epistemic_status, evidence_count, last_corroborated_at on warm_tier. New endpoint GET /memory/:id/epistemic and MCP tools memforge_certainty + memforge_epistemic_profile. Phase 5.12 promotes provisional rows with evidence_count >= 3 and multi-namespace positive retrievals to established, stamps last_corroborated_at, and demotes stale established rows back to provisional. Epistemic filter on query() restricts results to the desired confidence tier. TypeScript SDK, Python SDK, tool-definitions, and OpenAPI spec updated. Migration: schema/migration-v3.9.sql Split from #129 (PR-B of 6). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This was referenced Jul 26, 2026
salishforge
added a commit
that referenced
this pull request
Jul 26, 2026
The final Phase 5 slice — the Feature 1 remnant that never landed with PR #137. Phase 2.5 conflict resolution stops encoding noise as fact. - When the multi-factor score gap between two conflicting live memories is at most one point (one factor's worth of noise on the quantized integer scale), both are marked epistemic_status='contested' and the conflict resolves with a contested(...) strategy and no winner. The umbrella used a relative 20% threshold, which inverts on small integer scores (pure-noise 1-vs-0 reads as decisive, well-evidenced 6-vs-5 as contested) and is distorted by the mutual +100 supersession offset — the absolute delta is immune to both. - Superseded rows never contest: supersession is an absolute signal, and marking stale facts contested would resurface them as live disputes. - Contested is not terminal (the trap this same stack fixed for 'inferred'): Phase 5.12 promotes contested rows that earn the corroboration bar, and a decisive re-resolution of the dispute clears the winner's badge back to provisional. - tests/contested-conflicts.test.ts: 9 tests — close-call semantics, the exact one-vs-two-point boundary, winner/loser path preservation incl. untouched winner confidence, both-superseded decisiveness, contested recovery via decisive re-resolution. Conflict pairs share an identical relative timestamp (separate INSERTs see different now(), silently handing one side the +3 recency factor). - tests/epistemic-confidence.test.ts: the promotion tests now pin the new behavior (corroborated contested rows promote; uncorroborated ones stay). Claude-Session: https://claude.ai/code/session_011xCqQo49d3CEbn6oEvb3Ru Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Second of six PRs splitting #129. Ships Feature 1: Epistemic Confidence Model — calibrated uncertainty levels on warm-tier memories with auto-promotion via sleep cycle.
What lands
warm_tier:epistemic_status TEXT NOT NULL DEFAULT 'provisional',evidence_count INTEGER NOT NULL DEFAULT 1,last_corroborated_at TIMESTAMPTZ. Indexwarm_tier_epistemic_idxon(agent_id, epistemic_status).run()loop after deprecated decay, before drift snapshot. Promotesprovisional → establishedwhen bothevidence_count >= 3AND positive retrievals come from ≥2 distinct namespaces (cross-context corroboration required). Stampslast_corroborated_at. Does NOT touchcontestedrows.query({ epistemic: 'established' })or array form filters retrieval by status.GET /memory/:agentId/epistemicreturns per-status counts.memforge_certainty(filtered query) andmemforge_epistemic_profile(counts).epistemicquery param andepistemicProfile()method.Migration:
schema/migration-v3.9.sql.Notes
memforge_certaintyMCP executor builtepistemicOptsbut passed a separate options object toclient.query()that ignored the field. Corrected here so the tool actually filters.evidence_countdefaults to1(not0) — a newly consolidated row counts the consolidation event itself as one unit of evidence, matching PR feat: Phase 5 — Autonomous Knowledge Architecture (7 features) #129's design.Part of the #129 split
Test plan
🤖 Generated with Claude Code