Skip to content
Closed
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
13 changes: 13 additions & 0 deletions package-lock.json

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

28 changes: 28 additions & 0 deletions schemas/aep/memory-evidence.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"$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 — binds an agent memory access to a content digest and the digest of the memory state observed immediately before, so a chain of memory operations is verifiable and non-repudiable. Shares the AEP signature envelope.",
"type": "object",
"required": ["schema_version", "mem_ref", "op", "digest", "prior_digest", "timestamp_ms"],
"properties": {
"schema_version": { "type": "string", "enum": ["aep/v0.1"], "description": "Semver-like schema identifier for the memory-evidence evidence type" },
"trace_id": { "type": "string", "description": "Optional correlation ID linking related evidence records" },
"mem_ref": { "type": "string", "description": "Stable reference (URI or opaque id) of the memory cell or region accessed" },
"op": { "type": "string", "enum": ["read", "write"], "description": "Memory operation performed against mem_ref" },
"digest": { "type": "string", "description": "Content digest of the memory value read or written (e.g. sha256:...)" },
"prior_digest": { "type": ["string", "null"], "description": "Content digest of the memory cell immediately before this op; null on a cold read / first write so the chain start is explicit" },
"timestamp_ms": { "type": "number", "description": "UTC epoch milliseconds when the memory op was recorded" },
"signature": {
"type": "object",
"description": "Optional tamper-evident signature over the record content",
"required": ["alg", "key_id", "sig"],
"properties": {
"alg": { "type": "string", "description": "Signature algorithm, e.g. ed25519" },
"key_id": { "type": "string", "description": "Identifier of the signing key" },
"sig": { "type": "string", "description": "Base64-encoded signature bytes" }
},
"additionalProperties": false
}
}
}
15 changes: 15 additions & 0 deletions schemas/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@
],
"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"
],
"summary": "Tamper-evident memory read/write record \u2014 binds a memory access to a content digest and the prior state digest so a chain of memory operations is verifiable."
},
{
"id": "constraint-ir",
"title": "ConstraintIR",
Expand Down
8 changes: 8 additions & 0 deletions tests/fixtures/invalid/memory-evidence/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"schema_version": "aep/v0.1",
"mem_ref": "mem://agent-1/context-window",
"op": "delete",
"digest": "sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
"prior_digest": null,
"timestamp_ms": 1737600000200
}
14 changes: 14 additions & 0 deletions tests/fixtures/valid/memory-evidence/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"schema_version": "aep/v0.1",
"trace_id": "trace-mem-001",
"mem_ref": "mem://agent-1/context-window",
"op": "write",
"digest": "sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
"prior_digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"timestamp_ms": 1737600000200,
"signature": {
"alg": "ed25519",
"key_id": "mem-key-001",
"sig": "base64sig=="
}
}
24 changes: 24 additions & 0 deletions tests/test_conformance.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""Pytest entry point for the conformance harness.

`tests/conformance.py` is a standalone script (run via `python3 tests/conformance.py`
in CLAUDE.md / CI). This thin wrapper re-exposes it under pytest so `pytest tests/`
collects and runs the same invariants — every schema well-formed, refs resolve,
index entries match on-disk `$id`s, and each registered schema has VALID fixtures
that pass plus INVALID fixtures that fail. It owns no logic of its own.
"""
from __future__ import annotations

import sys
from pathlib import Path

# tests/ is not a package; put it on sys.path so `import conformance` works
# regardless of pytest's invocation cwd.
TESTS_DIR = Path(__file__).resolve().parent
if str(TESTS_DIR) not in sys.path:
sys.path.insert(0, str(TESTS_DIR))

import conformance # noqa: E402


def test_conformance_harness_passes() -> None:
assert conformance.main() == 0
Loading