Enforce the anti-split-brain guarantees in the Step 4 memory scaffold (conflict records, promotion gate, freshness) #137
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up from the Step 4 memory subsystem scaffold review (PR #136).
The scaffold encodes the memory contract (one logical
Store, mandatoryprovenance, read-only Oxigraph projection, deterministic Boundary 1 capacity).
It does not yet encode the decision's anti-split-brain guarantees. As
written, the code permits exactly the duplicate-writer / authority-drift
condition the architecture direction forbids.
1.
Rememberblind-overwrites — no conflict record (highest priority)store_memory.goRememberdoess.records[key] = &recCopywith no conflicthandling. But:
docs/plans/LAYERED-MEMORY-AUTHORITY-LIFECYCLE.mddefines a Conflictrecord class: "both candidates are preserved with provenance until explicit
operator resolution."
docs/wiki/shared-memory-architecture.md: "a derived fact is notautomatically promoted into canonical memory."
Today any record (including
derivation_method = agent_summary) is promotedstraight into the store, and a second writer clobbers the first.
Expected: when a write targets an existing
(tenant, id)with a differentcontent_hash, preserve both candidates as a conflict record and require anexplicit operator disposition; do not overwrite.
2.
Improvesilently downgrades provenancestore_memory.goImprove, on a content change withoutNewProvenance:So an
operator_assertionordirect_observationfact is silently rewrittenas an agent summary, re-hashed and re-timestamped. Authority is changed by an
agent edit with no operator gate.
Related:
ProvenanceEnvelope.OperatorApprovalexists butValidate()neverrequires it for
operator_assertionor for overrides.Expected: authority changes require explicit
NewProvenance(and operatorapproval where the target was operator-asserted / canonical); keep an
append-only revision trail instead of mutating derivation in place.
3. Freshness is faked
oxigraph.goHTTPOxigraphClient.QueryNodeCapacitystamps:That is query time, not the graph's observation time.
docs/wiki/shared-memory-architecture.mdrequires Colibri tofreshness-check hard factual constraints. A stale projection currently
looks live.
Expected: read
observedAtfrom the graph; add a max-age gate inBuildBoundary1Envelopethat returnsMISSING_CAPACITY_EVIDENCE(fail-closed)when evidence is stale.
Also worth addressing (lower priority)
MemoryStoreis volatile/in-memory by its owndocstring. "One canonical system of record" is still unowned.
FormatSPARQLTurtledrops provenance (nosource_ref/derivation_method/content_hash) — if used for ingest, it violates the"every projected triple carries provenance" invariant.
MemoryKind(episodic/semantic/procedural/mesh_state) is orthogonal tothe planes (
system_skills/system_brain/system_ops) and projections(OpenViking/Oxigraph); document the canonical↔projection mapping.
ZFSQuotasBytes/Capabilitiesare fetchedbut unused.
Acceptance
Improvecannot changederivation_methodwithout explicit new provenance (plus operator approval where applicable).Root cause and terminology fixes tracked as companion items:
memory.db), which turns the three acceptance criteria below into schema constraints rather than temporary Go mocks.The guarantees in this issue are the Anti-Split-Brain Guards.