Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions schemas/aep/memory-evidence.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://wasmagent.dev/schemas/aep/memory-evidence.schema.json",
"title": "MemoryEvidence",
"description": "Tamper-evident memory read/write record. Each op records the content digest of the memory cell plus the digest observed immediately before the op (prior_digest), so successive records form a hash chain: altering any past write changes its digest and breaks the chain at the next read/write, making tamper detectable. Records are linked into AEP actions via aep-record's memory_read_refs / memory_write_refs.",
"type": "object",
"required": [
"mem_ref",
"op",
"digest",
"prior_digest",
"timestamp_ms"
],
"properties": {
"mem_ref": {
"type": "string",
"description": "Stable reference (key/path) to the memory cell that was read or written"
},
"op": {
"type": "string",
"enum": [
"read",
"write"
],
"description": "Memory operation performed against the referenced cell"
},
"digest": {
"type": "string",
"description": "Content digest of the memory cell — post-write content for a write, or the value returned by a read"
},
"prior_digest": {
"type": [
"string",
"null"
],
"description": "Digest of the memory cell's content immediately before this op. Null when the cell did not previously exist (first write / creation). Carries the hash-chain link that makes the record tamper-evident."
},
"timestamp_ms": {
"type": "number",
"description": "UTC epoch milliseconds when the memory op was recorded"
}
}
}
16 changes: 16 additions & 0 deletions schemas/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,22 @@
],
"summary": "Shared envelope base for all AEP evidence records \u2014 schema_version, trace_id, created_at_ms, and optional signature."
},
{
"id": "memory-evidence",
"title": "MemoryEvidence",
"path": "schemas/aep/memory-evidence.schema.json",
"canonical_id": "https://wasmagent.dev/schemas/aep/memory-evidence.schema.json",
"version": "aep/v0.1",
"stability": "evolving",
"owners": [
"wasmagent-protocol"
],
"consumers": [
"wasmagent-js",
"trace-pipeline"
],
"summary": "Tamper-evident memory read/write record \u2014 digest + prior_digest hash chain over a memory cell (keys: mem_ref, op, digest, prior_digest, timestamp_ms)."
},
{
"id": "constraint-ir",
"title": "ConstraintIR",
Expand Down
6 changes: 6 additions & 0 deletions tests/fixtures/invalid/memory-evidence/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"mem_ref": "mem://agent-1/context/window-7",
"op": "delete",
"digest": "sha256:abc",
"timestamp_ms": 1737600000500
}
7 changes: 7 additions & 0 deletions tests/fixtures/valid/memory-evidence/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"mem_ref": "mem://agent-1/context/window-7",
"op": "write",
"digest": "sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
"prior_digest": "sha256:2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae",
"timestamp_ms": 1737600000500
}
Loading