@personaxis/spec 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,48 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://personaxis.com/schemas/memory/1.0/memory.schema.json",
4
+ "title": "episodic memory entry v1.0",
5
+ "description": "Schema for one entry in a persona's append-only episodic memory log (memory/episodic.jsonl, one JSON object per line). Every entry carries a provenance source and forms a tamper-evident hash chain (prev_hash -> hash). v1.0 (D6): the chain hash commits to content_hash — NOT to the content bytes — so an entry's content can be REDACTED (real erasure, right-to-be-forgotten) while the chain stays verifiable end-to-end. Deletion has two sanctioned forms: tombstone (a superseding entry is appended; bytes retained, hidden from retrieval) and redaction (the only sanctioned rewrite of a prior line: content is replaced by '[redacted]', redacted: true is set, content_hash is retained, and a tombstone-format audit record is appended). Legacy (≤0.10) entries hash over the content directly and appear without content_hash; conforming runtimes verify each entry per its own format and re-anchor legacy logs before redacting.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["ts", "content", "source", "tags", "content_hash", "prev_hash", "hash"],
9
+ "properties": {
10
+ "ts": {
11
+ "type": "string",
12
+ "format": "date-time",
13
+ "description": "ISO-8601 timestamp the entry was committed."
14
+ },
15
+ "content": {
16
+ "type": "string",
17
+ "description": "The remembered content. After redaction this is the literal marker '[redacted]' and redacted is true."
18
+ },
19
+ "source": {
20
+ "type": "string",
21
+ "enum": ["user", "tool", "internal", "synthesis"],
22
+ "description": "Provenance channel. Drives trust + sensitive-action gates: 'user' is most trusted; 'tool'/'synthesis' are the poisoning-prone channels and must not, on their own, justify a sensitive action."
23
+ },
24
+ "tags": {
25
+ "type": "array",
26
+ "items": { "type": "string" },
27
+ "description": "Free-form tags. Reserved: 'tombstone' (a deletion record; its 'target:<hash>' tag names the superseded entry) and 'injection-flagged' (written under a detected prompt injection)."
28
+ },
29
+ "content_hash": {
30
+ "type": "string",
31
+ "pattern": "^[0-9a-f]{64}$",
32
+ "description": "sha256 of content at write time. The chain hash commits to this, enabling erasure: redaction removes the content bytes but retains content_hash, so the chain still verifies. When redacted is not true, conforming verifiers ALSO check sha256(content) === content_hash."
33
+ },
34
+ "redacted": {
35
+ "type": "boolean",
36
+ "description": "True when content was erased by a sanctioned redaction. Verifiers skip the content-matches-content_hash check for redacted entries."
37
+ },
38
+ "prev_hash": {
39
+ "type": "string",
40
+ "description": "Hash of the previous entry in the chain; empty string for the first entry. Lineage / tamper-evidence."
41
+ },
42
+ "hash": {
43
+ "type": "string",
44
+ "pattern": "^[0-9a-f]{64}$",
45
+ "description": "sha256 over {ts, content_hash, source, tags, prev_hash}. Any rewrite of a prior line other than a sanctioned redaction breaks the chain and is detectable."
46
+ }
47
+ }
48
+ }