Skip to content

feat: epistemic provenance on memories — basis, confidence, evidence (#32) - #44

Merged
stormer78 merged 1 commit into
feat/signed-recordsfrom
feat/epistemic-provenance
Nov 10, 2026
Merged

stormer78 merged 1 commit into
feat/signed-recordsfrom
feat/epistemic-provenance

Conversation

@stormer78

Copy link
Copy Markdown
Contributor

Closes #32. Stacked on #43 (signed records) — base is feat/signed-records; retarget to main once #43 merges.

What changes

Every save states what kind of claim it is, inside the record's signature (so it can't be upgraded after the fact — there's a test for exactly that):

  • basis: declared | observed | verified | inferred — required on memory_save.
  • confidence: optional, 0–1.
  • evidence: up to 8 citations — {kind:"credential", credentialId, digest?}, {kind:"memory", key}, {kind:"record", roomId, key}. verified must cite at least one. Identifiers only; nothing is ever fetched.

The vocabulary and the credential/record shapes are the ones rooms/records/put/0.5 publishes (VTI#2117), so a record moved between memory and a room keeps its meaning.

Recall / get / list show basis and confidence; get adds evidence. A verified record that cites nothing carries a basisNote and ranks as an inference. Records written before this read as unstated. The hook/CLI render notes the basis (_[inferred, confidence 0.60]_).

Ranking multiplies relevance by a basis weight — declared / evidenced verified 10, observed 9, unstated 8, inferred 6 — and empty-query ties break on it, so stated memories survive the session-start limit ahead of inferred ones. A nudge, not an override (tested both ways).

Confidence is displayed, never ranked on. The rooms schema says a reader MUST NOT rank by it across authors, since two writers' numbers aren't on one scale.

Skill, /remember, README and CLAUDE.md updated. Plugin and crate → 0.5.0.

Deviations from the issue

  • Uses rooms' evidence list rather than a free-form source field, for alignment with VTI#2117. A credential citation carries credentialId (+ optional digest), not issuer, matching the rooms shape.
  • The persona selfAsserted / credentialBacked vocabulary is not reused: the rooms RecordBasis vocabulary is the closer and more recent alignment, and persona provenance describes a profile value's source, not a claim's epistemic status.

Acceptance

  • basis is required on new saves; MCP schema and skill updated (the_save_schema_requires_a_basis).
  • Recall summaries display basis and confidence.
  • Ranking applies a basis weight, with tests (record.rs ranking tests; recall_prefers_what_the_user_said_over_what_was_inferred).

Testing

cargo fmt, cargo clippy --all-targets clean; 96 unit + 32 roundtrip + binary/hook/stdio suites pass.

…32)

Every save now states what kind of claim it is, inside the record's
signature: `basis` (declared | observed | verified | inferred), an
optional `confidence` (0–1), and `evidence` citing a credential, another
memory, or a data-room record. The vocabulary and the credential/record
citation shapes are the ones rooms/records/put/0.5 publishes, so a
record keeps its meaning between memory and a room.

- memory_save requires `basis`; `verified` must cite evidence;
  confidence must be in [0, 1]. Checked before the store, like the
  size limits.
- Recall/get/list show `basis` and `confidence` (get adds `evidence`);
  a `verified` record citing nothing carries a `basisNote`. Records
  from before provenance read as `unstated`.
- Ranking multiplies relevance by a basis weight (declared/evidenced
  verified 10, observed 9, unstated 8, inferred 6), and breaks empty-
  query ties on it, so stated memories survive a limit ahead of
  inferred ones. Confidence is never ranked on: the rooms schema says
  it is not comparable across authors.
- The hook/CLI render notes the basis; the skill and /remember say how
  to choose one.

basis and evidence are kept as strings/raw values in the record so a
later writer's unknown basis or citation kind does not make the record
undecodable.

Bumps the plugin to 0.5.0.

Closes #32

Signed-off-by: Glenn Gore <glenn.g@affinidi.com>
@stormer78
stormer78 merged commit b4643a3 into feat/signed-records Nov 10, 2026
4 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