Repository navigation
feat: sign memory records and verify authorship on read (#31) - #43
Merged
Merged
Conversation
Every save is now signed by the writer's own did:key: a Data Integrity proof (the SDK's sign_object_for_assertion, as Data Rooms use for sealed record bodies) over a v2 record that names its `author`, `authorKind` and the `(contextId, key)` it was written to. Every read checks it before a value becomes an Entry. A record that was altered after signing, relocated to another key or context, claims an author other than its signer, or is v2 with its proof stripped is Refused: not returned as memory, but reported by key and reason from recall, list, get and the SessionStart hook. Legacy v0/v1 records stay readable, marked `unattributed`. Verification is did:key-only and does no network I/O. The signer is loaded from the session store after connecting, since the first connect of an enrolled identity rotates its key; setup and enrol fail early if the session cannot sign. `doctor` reports the signing DID. Bumps the plugin to 0.4.0. Closes #31 Signed-off-by: Glenn Gore <glenn.g@affinidi.com>
…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>
3 tasks done
feat: epistemic provenance on memories — basis, confidence, evidence (#32)
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 #31.
What changes
did:key: a Data Integrity proof (vta_sdk::trust_task_sign::sign_object_for_assertion, the primitive Data Rooms use for sealed record bodies) over a v2 record that namesauthor,authorKind(agent|operator),contextIdandkey. AStorewithout a signer refuses to save.Entry(Store::check, the single place). A record is refused — not returned as memory, but reported by key + reason — when it:authorother than its signer, orv >= 2with itsproofstripped (refused, not downgraded).unattributed.authorblock (verifiedwithdid/kind/thisAgent, orunattributed); recall and list carryrefused; the SessionStart hook notes other writers and lists refusals;doctorprints the signing DID.setup/enrolfail early if the session cannot sign.did:key-only resolver: no network I/O, so a stored record cannot make recall fetch anything.Skill, README and CLAUDE.md updated. Plugin and crate bumped to 0.4.0.
Acceptance
a_tampered_record_is_refused_on_recall_list_and_get,a_relocated_record_is_refused, plus stripped-proof and forged-author cases).Known limits
unattributed, neververified. A "require signed" config switch would close that — not added here.Config::signer()(session-store load, post-rotation) isn't covered by tests; it needs a real session. Not yet exercised against a live VTA — nothing on the wire changes except the content of the stored value.Testing
cargo fmt,cargo clippy --all-targetsclean; all suites pass (82 unit, 29 roundtrip, plus binary/hook/stdio tests).