Repository navigation
feat: epistemic provenance on memories — basis, confidence, evidence (#32) - #44
Merged
Merged
Conversation
…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>
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.
Closes #32. Stacked on #43 (signed records) — base is
feat/signed-records; retarget tomainonce #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 onmemory_save.confidence: optional, 0–1.evidence: up to 8 citations —{kind:"credential", credentialId, digest?},{kind:"memory", key},{kind:"record", roomId, key}.verifiedmust cite at least one. Identifiers only; nothing is ever fetched.The vocabulary and the credential/record shapes are the ones
rooms/records/put/0.5publishes (VTI#2117), so a record moved between memory and a room keeps its meaning.Recall / get / list show
basisandconfidence; get addsevidence. Averifiedrecord that cites nothing carries abasisNoteand ranks as an inference. Records written before this read asunstated. 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
evidencelist rather than a free-formsourcefield, for alignment with VTI#2117. A credential citation carriescredentialId(+ optionaldigest), notissuer, matching the rooms shape.selfAsserted/credentialBackedvocabulary is not reused: the roomsRecordBasisvocabulary is the closer and more recent alignment, and persona provenance describes a profile value's source, not a claim's epistemic status.Acceptance
basisis required on new saves; MCP schema and skill updated (the_save_schema_requires_a_basis).basisandconfidence.record.rsranking tests;recall_prefers_what_the_user_said_over_what_was_inferred).Testing
cargo fmt,cargo clippy --all-targetsclean; 96 unit + 32 roundtrip + binary/hook/stdio suites pass.