Skip to content

Commit e4be9ed

Browse files
authored
feat(schemas): add FSMS memory schema family (T-mem) (#47)
Typed spine for the three-tier memory model: working-memory-state (per-session), episode-bundle (episodic), semantic-memory-release (semantic), plus procedural-memory-bundle and the forgetting-policy / promotion-rule that move memory between tiers. Rehomed from the fsms_memory_pack to the memory-mesh namespace (schemas.socioprophet.org/memory-mesh/*). - 6 schemas (draft 2020-12) + 6 validating examples - scripts/validate_fsms_memory_schemas.py: validates each schema+example and asserts required-field rejection on each (fail closed on incomplete records) - Makefile: validate-fsms-memory-schemas wired into validate Extends #45. Closes #46
1 parent 2b991dd commit e4be9ed

14 files changed

Lines changed: 719 additions & 2 deletions

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
PYTHON ?= python
22

3-
.PHONY: validate-upstreams validate-python validate-deploy-assets validate-agent-learning-proposal validate-scenario-learning-binding validate-governed-learning-lifecycle validate-workspace-recall-promotion validate-channel-provenance-write-gate validate-wallguard-memory-compartment-gate validate-memory-distribution-grant validate-gateway-call-audit validate-prophet-mesh-scope-mirror validate local-preflight local-up local-smoke local-debug local-down
3+
.PHONY: validate-upstreams validate-python validate-deploy-assets validate-agent-learning-proposal validate-scenario-learning-binding validate-governed-learning-lifecycle validate-workspace-recall-promotion validate-channel-provenance-write-gate validate-wallguard-memory-compartment-gate validate-memory-distribution-grant validate-gateway-call-audit validate-fsms-memory-schemas validate-prophet-mesh-scope-mirror validate local-preflight local-up local-smoke local-debug local-down
44

55
validate-upstreams:
66
$(PYTHON) scripts/validate_upstreams.py third_party/upstreams.lock.yaml
@@ -40,7 +40,10 @@ validate-gateway-call-audit:
4040
$(PYTHON) scripts/validate_gateway_call_audit.py
4141
$(PYTHON) -m pytest -q adapters/litellm/tests/test_gateway_audit.py
4242

43-
validate: validate-upstreams validate-python validate-deploy-assets validate-wallguard-memory-compartment-gate validate-memory-distribution-grant validate-gateway-call-audit validate-prophet-mesh-scope-mirror
43+
validate-fsms-memory-schemas:
44+
$(PYTHON) scripts/validate_fsms_memory_schemas.py
45+
46+
validate: validate-upstreams validate-python validate-deploy-assets validate-wallguard-memory-compartment-gate validate-memory-distribution-grant validate-gateway-call-audit validate-fsms-memory-schemas validate-prophet-mesh-scope-mirror
4447

4548
local-preflight:
4649
bash deploy/local/scripts/preflight-podman-m2.sh
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"episode_id": "ep-001",
3+
"task_id": "task-001",
4+
"actor_id": "agent-alpha",
5+
"start_ts": "2026-07-31T04:00:00Z",
6+
"end_ts": null,
7+
"status": "open",
8+
"working_memory_refs": [
9+
"wm-001"
10+
],
11+
"summary": null
12+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"forgetting_policy_id": "fp-001",
3+
"memory_class": "episodic",
4+
"retention_ttl": "P30D",
5+
"active_flag": true
6+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"procedural_bundle_id": "pb-001",
3+
"governance_scope": "workspace",
4+
"active_flag": true
5+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"promotion_rule_id": "pr-001",
3+
"source_memory_class": "episodic",
4+
"destination_memory_class": "semantic",
5+
"trigger_conditions": [
6+
"review_passed",
7+
"min_occurrences>=3"
8+
],
9+
"approval_threshold": 0.8,
10+
"active_flag": true
11+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"semantic_release_id": "sr-001",
3+
"corpus_release_ref": "corpus-2026-07",
4+
"created_at": "2026-07-31T04:00:00Z"
5+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"working_memory_id": "wm-001",
3+
"task_id": "task-001",
4+
"actor_id": "agent-alpha",
5+
"identity_projection_ref": "idp-001",
6+
"created_at": "2026-07-31T04:00:00Z",
7+
"expires_at": "2026-07-31T05:00:00Z",
8+
"modality_set": [
9+
"text"
10+
],
11+
"query_stack": [
12+
"q1"
13+
]
14+
}

schemas/episode-bundle.schema.json

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://schemas.socioprophet.org/memory-mesh/episode-bundle.schema.json",
4+
"title": "EpisodeBundle",
5+
"type": "object",
6+
"required": [
7+
"episode_id",
8+
"task_id",
9+
"actor_id",
10+
"start_ts",
11+
"status"
12+
],
13+
"properties": {
14+
"episode_id": {
15+
"type": "string"
16+
},
17+
"task_id": {
18+
"type": "string"
19+
},
20+
"actor_id": {
21+
"type": "string"
22+
},
23+
"start_ts": {
24+
"type": "string",
25+
"format": "date-time"
26+
},
27+
"end_ts": {
28+
"type": [
29+
"string",
30+
"null"
31+
],
32+
"format": "date-time"
33+
},
34+
"goal": {
35+
"type": [
36+
"string",
37+
"null"
38+
]
39+
},
40+
"working_memory_refs": {
41+
"type": "array",
42+
"items": {
43+
"type": "string"
44+
}
45+
},
46+
"query_history": {
47+
"type": "array",
48+
"items": {
49+
"type": [
50+
"object",
51+
"string"
52+
]
53+
}
54+
},
55+
"retrieval_history": {
56+
"type": "array",
57+
"items": {
58+
"type": [
59+
"object",
60+
"string"
61+
]
62+
}
63+
},
64+
"graph_navigation_history": {
65+
"type": "array",
66+
"items": {
67+
"type": [
68+
"object",
69+
"string"
70+
]
71+
}
72+
},
73+
"recommendation_refs": {
74+
"type": "array",
75+
"items": {
76+
"type": "string"
77+
}
78+
},
79+
"action_history": {
80+
"type": "array",
81+
"items": {
82+
"type": [
83+
"object",
84+
"string"
85+
]
86+
}
87+
},
88+
"validation_results": {
89+
"type": "array",
90+
"items": {
91+
"type": [
92+
"object",
93+
"string"
94+
]
95+
}
96+
},
97+
"review_refs": {
98+
"type": "array",
99+
"items": {
100+
"type": "string"
101+
}
102+
},
103+
"decomposition_trace_refs": {
104+
"type": "array",
105+
"items": {
106+
"type": "string"
107+
}
108+
},
109+
"drift_signals": {
110+
"type": "array",
111+
"items": {
112+
"type": [
113+
"object",
114+
"string"
115+
]
116+
}
117+
},
118+
"summary": {
119+
"type": [
120+
"string",
121+
"null"
122+
]
123+
},
124+
"status": {
125+
"type": "string"
126+
}
127+
}
128+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://schemas.socioprophet.org/memory-mesh/forgetting-policy.schema.json",
4+
"title": "ForgettingPolicy",
5+
"type": "object",
6+
"required": [
7+
"forgetting_policy_id",
8+
"memory_class",
9+
"retention_ttl",
10+
"active_flag"
11+
],
12+
"properties": {
13+
"forgetting_policy_id": {
14+
"type": "string"
15+
},
16+
"memory_class": {
17+
"type": "string"
18+
},
19+
"retention_ttl": {
20+
"type": "string"
21+
},
22+
"decay_strategy": {
23+
"type": [
24+
"string",
25+
"null"
26+
]
27+
},
28+
"compaction_strategy": {
29+
"type": [
30+
"string",
31+
"null"
32+
]
33+
},
34+
"archive_strategy": {
35+
"type": [
36+
"string",
37+
"null"
38+
]
39+
},
40+
"purge_conditions": {
41+
"type": [
42+
"object",
43+
"array",
44+
"string",
45+
"null"
46+
]
47+
},
48+
"snapshot_cadence": {
49+
"type": [
50+
"string",
51+
"null"
52+
]
53+
},
54+
"legal_hold_override": {
55+
"type": [
56+
"boolean",
57+
"null"
58+
]
59+
},
60+
"active_flag": {
61+
"type": "boolean"
62+
}
63+
}
64+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://schemas.socioprophet.org/memory-mesh/procedural-memory-bundle.schema.json",
4+
"title": "ProceduralMemoryBundle",
5+
"type": "object",
6+
"required": [
7+
"procedural_bundle_id",
8+
"governance_scope",
9+
"active_flag"
10+
],
11+
"properties": {
12+
"procedural_bundle_id": {
13+
"type": "string"
14+
},
15+
"routing_policy_refs": {
16+
"type": "array",
17+
"items": {
18+
"type": "string"
19+
}
20+
},
21+
"ranking_profile_refs": {
22+
"type": "array",
23+
"items": {
24+
"type": "string"
25+
}
26+
},
27+
"recommendation_playbook_refs": {
28+
"type": "array",
29+
"items": {
30+
"type": "string"
31+
}
32+
},
33+
"promotion_rule_refs": {
34+
"type": "array",
35+
"items": {
36+
"type": "string"
37+
}
38+
},
39+
"retrain_job_refs": {
40+
"type": "array",
41+
"items": {
42+
"type": "string"
43+
}
44+
},
45+
"surgery_plan_refs": {
46+
"type": "array",
47+
"items": {
48+
"type": "string"
49+
}
50+
},
51+
"rollback_plan_refs": {
52+
"type": "array",
53+
"items": {
54+
"type": "string"
55+
}
56+
},
57+
"operator_effectiveness_refs": {
58+
"type": "array",
59+
"items": {
60+
"type": "string"
61+
}
62+
},
63+
"governance_scope": {
64+
"type": "string"
65+
},
66+
"active_flag": {
67+
"type": "boolean"
68+
}
69+
}
70+
}

0 commit comments

Comments
 (0)