Skip to content

feat(phase5): epistemic confidence model#137

Merged
salishforge merged 1 commit into
mainfrom
feat/phase5-epistemic-confidence
May 21, 2026
Merged

feat(phase5): epistemic confidence model#137
salishforge merged 1 commit into
mainfrom
feat/phase5-epistemic-confidence

Conversation

@salishforge
Copy link
Copy Markdown
Owner

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

  • New columns on warm_tier: epistemic_status TEXT NOT NULL DEFAULT 'provisional', evidence_count INTEGER NOT NULL DEFAULT 1, last_corroborated_at TIMESTAMPTZ. Index warm_tier_epistemic_idx on (agent_id, epistemic_status).
  • Sleep cycle Phase 5.12 (Epistemic Promotion) — runs in the run() loop after deprecated decay, before drift snapshot. Promotes provisional → established when both evidence_count >= 3 AND positive retrievals come from ≥2 distinct namespaces (cross-context corroboration required). Stamps last_corroborated_at. Does NOT touch contested rows.
  • Query filter: query({ epistemic: 'established' }) or array form filters retrieval by status.
  • REST endpoint: GET /memory/:agentId/epistemic returns per-status counts.
  • MCP tools: memforge_certainty (filtered query) and memforge_epistemic_profile (counts).
  • SDK: TypeScript + Python clients both gain epistemic query param and epistemicProfile() method.

Migration: schema/migration-v3.9.sql.

Notes

Part of the #129 split

Test plan

  • `npm run type-check` — clean
  • `npm run build` — clean
  • `npm run lint` — clean
  • `npm run test:epistemic-confidence` — 30/30 pass (7 unit + 12 integration + 5 e2e + 6 migration)
  • `npm audit --omit=dev` — 0 vulnerabilities
  • CI green on push

🤖 Generated with Claude Code

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>
@salishforge salishforge merged commit 8d2b16c into main May 21, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant