Repository navigation
feat(ring-sr-mem-00): GOLD IV memory-types Β· closes #449 - #477
Merged
Merged
Conversation
Adds trios-agent-memory/SR-MEM-00 β anti-amnesia foundation. Pure
serde + SHA-256 content addressing, no I/O. Bottom of GOLD IV
dependency graph.
## Public types
- TripleId([u8; 32]) β SHA-256 of subject||predicate||object, hex64 JSON
- AgentRole β Scarab/Gardener/Trainer/Doctor/Claude/Lead (snake_case)
- MemoryKind β Working/Session/LongTerm/Episodic/Semantic
- ForgetPolicy β tagged: GdprByAgent{agent} / AgeOlderThan{duration} / PredicateMatches{predicate}
- Provenance { agent_id, task_id (UUID), source_sha (TripleId), ts }
- Triple { id, subject, predicate, object, provenance } + Triple::new() builder
## Content-addressed insert
TripleId::from_triple(s, p, o) = SHA-256(s || p || o).
Two calls with identical inputs always produce the same id β proven
idempotent. Every backend (Neon lessons, trios-kg, zig-knowledge-graph,
HDC) can use it as PK without coordination.
## Tests (15/15 GREEN)
- triple_id_is_content_addressed (same SPO β same id)
- triple_id_distinguishes_inputs (different SPO β different id)
- triple_id_serialises_as_hex64
- triple_id_rejects_wrong_length (31-byte hex fails)
- triple_id_display_lowercase_hex
- agent_role_serialises_snake_case
- memory_kind_roundtrip (every variant)
- memory_kind_long_term_is_snake_case
- forget_policy_gdpr_roundtrip (tagged kind)
- forget_policy_age_serializes_as_seconds
- forget_policy_predicate_roundtrip
- provenance_roundtrip
- triple_new_computes_id (builder derives correct id)
- triple_idempotent_insert (byte-equality on re-build)
- triple_full_roundtrip
## Compliance
- L1/L3/L4/L6/L13/L14 β
- R-RING-DEP-002 β deps = serde + serde_json + uuid + chrono + sha2
- R-RING-FACADE-001 β outer src/lib.rs re-exports only
- I5 β
π» phi^2 + phi^-2 = 3 Β· TRINITY Β· GOLD IV bottom Β· anti-amnesia
Soul-name: Memory Mason
Closes #449
Part of #446
Agent: Memory-Mason
22 tasks
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.
SR-MEM-00 β Memory Types (anti-amnesia foundation)
Closes #449 Β· Part of #446 Β· No blockers (independent GOLD IV thread)
Soul-name:
Memory MasonΒ· Codename:LEADΒ· Tier: π₯ Bronze Β· Kingdom: RustWhat landed
Bottom of the GOLD IV dependency graph. Every backend (Neon
lessons,trios-kg,zig-knowledge-graph, HDC episodic agents) speaks the sameTriple/TripleId/Provenance/ForgetPolicy/AgentRole/MemoryKindshape.Public types
TripleId([u8; 32])subject || predicate || object(lowercase-hex JSON, length 64)AgentRoleScarab/Gardener/Trainer/Doctor/Claude/Lead(snake_case)MemoryKindWorking/Session/LongTerm/Episodic/SemanticForgetPolicyGdprByAgent{agent}/AgeOlderThan{duration}/PredicateMatches{predicate}Provenanceagent_id,task_id(UUID),source_sha(TripleId),tsTripleid,subject,predicate,object,provenanceContent-addressed idempotent insert
TripleId::from_triple(s, p, o) = SHA-256(s || p || o)β two calls with identical inputs always produce the same id.Triple::new()derivesidfrom SPO, so re-inserting the same triple with the same provenance is byte-equal. Proven bytriple_id_is_content_addressed+triple_idempotent_inserttests.Tests (15/15 GREEN)
TripleId (5), AgentRole + MemoryKind (3), ForgetPolicy (3), Provenance (1), Triple (3).
Compliance
L1 β Β· L3 β Β· L4 β Β· L6 β Β· L13 β Β· L14 β Β· R-RING-DEP-002 β (
serde + serde_json + uuid + chrono + sha2) Β· R-RING-FACADE-001 β Β· I5 βAgent: Memory-Mason