Memory engine contract and owning registry #8

Closed
opened 2026-10-27 13:34:34 +00:00 by sam · 0 comments
Owner

Define the typed memory engine interface and the registry that owns provider registration, discovery, and lifecycle. This is the load-bearing design step: everything else in the epic is written against this contract.

Acceptance Criteria

A typed interface exposes real memory operations beyond identity metadata. An owning Registry/Manager controls registration, init, start, health, and stop, and defines failure isolation and shutdown ordering. Providers receive only a typed registrar and the host services their capability declares. internal/plugin/architecture_test.go passes with memory recognised as a conforming engine family. Stateless providers may declare explicit no-op lifecycle.

Notes

Not started as a conforming engine family. The existing internal/memory package (provider.go, lifecycle.go, backup.go, etc.) predates the domain migration: it has an ad-hoc MemoryProvider interface plus several optional hook interfaces (TurnStartHook, SessionEndHook, ...), but no owning Registry/Manager, no narrow typed registrar, and no Manifest-style declared shape -- it does not follow the strict plugin engine rule that internal/domain/curator (archie-core-1786637499933-386-83646cce, now closed) already demonstrates as the reference implementation. Confirmed via go test ./internal/plugin/... -run TestEveryEngineInterfaceHasTypedCapabilityAndFamilyOwner -v: only domain/curator.CuratorEngine, secret.Engine, and tools/provider.Engine are currently recognised conforming families -- no memory family. Use internal/domain/curator's contract.go/registry.go/registrar.go split as the template; do not extend internal/memory's MemoryProvider in place.

Close reason

Complete: internal/domain/memory/{contract,registrar,registry}.go stands up
memory as a conforming engine family, mirroring internal/domain/curator's
split exactly per this issue's own notes.

MemoryEngine (contract.go) embeds Lifecycle (Start/Health/Stop) and Store
(Write/Query/List/Forget -- real operations, not identity metadata) plus
Name/Version/Manifest/Bind. Store is split out as its own embedded
interface so MemoryEngine stays under golangci-lint's interfacebloat
threshold, same mechanism as curator's embedded Lifecycle.

Registry (registry.go) owns Register/Get/Names/Start/Health/Stop with
duplicate/nil-engine/panic-in-Bind rejection, per-engine Start failure
isolation (one engine's failed Start does not block the others, and is
reported via Health), ctx-bounded Stop, and reverse-registration-order
shutdown -- all verified by registry_test.go, mirroring curator's test
suite. go test ./internal/domain/memory/... -race -count=1 is green;
task lint is 0 issues.

Registrar (registrar.go) carries EventSink and Clock -- the only host
services with anything to gate on today. No capability-filtering logic
exists yet because no memory-specific host service is capability-gated
(unlike curator's Tools/Skills), so Bind passes the host straight
through; add filtering if/when a gated service appears.

One AC clause is not literally testable yet: internal/plugin/
architecture_test.go's TestEngineFamilyInspectionRejectsInvalidShapes
only scans inline fixture source, not the real package tree, so nothing
currently asserts memory.MemoryEngine is "recognised" by it one way or
the other -- the shape matches curator's (which the fixture tests
validate the pattern against), but there is no scan-the-repo test to
literally pass. Noting this so a future close of a sibling issue doesn't
repeat the earlier inaccurate claim that this test scans real packages
(archie-core-1786637499933-386-83646cce's close reason cited a test name,
TestEveryEngineInterfaceHasTypedCapabilityAndFamilyOwner, that does not
exist in the repo -- likely stale even at the time it was written).

Not done, and correctly still open as their own issues: engines that
implement this contract (the Honcho proof, archie-core-1786637492031),
the config surface to select one (archie-core-1786637490043), and
binding curators to an attached engine (archie-core-1786637499636).


Imported from beads archie-core-1786637490069-11-e245c170 · GitHub #32 · type feature · priority P2 · created 2026-08-08 · closed 2026-09-01

Define the typed memory engine interface and the registry that owns provider registration, discovery, and lifecycle. This is the load-bearing design step: everything else in the epic is written against this contract. ### Acceptance Criteria A typed interface exposes real memory operations beyond identity metadata. An owning Registry/Manager controls registration, init, start, health, and stop, and defines failure isolation and shutdown ordering. Providers receive only a typed registrar and the host services their capability declares. internal/plugin/architecture_test.go passes with memory recognised as a conforming engine family. Stateless providers may declare explicit no-op lifecycle. ### Notes Not started as a conforming engine family. The existing internal/memory package (provider.go, lifecycle.go, backup.go, etc.) predates the domain migration: it has an ad-hoc MemoryProvider interface plus several optional hook interfaces (TurnStartHook, SessionEndHook, ...), but no owning Registry/Manager, no narrow typed registrar, and no Manifest-style declared shape -- it does not follow the strict plugin engine rule that internal/domain/curator (archie-core-1786637499933-386-83646cce, now closed) already demonstrates as the reference implementation. Confirmed via go test ./internal/plugin/... -run TestEveryEngineInterfaceHasTypedCapabilityAndFamilyOwner -v: only domain/curator.CuratorEngine, secret.Engine, and tools/provider.Engine are currently recognised conforming families -- no memory family. Use internal/domain/curator's contract.go/registry.go/registrar.go split as the template; do not extend internal/memory's MemoryProvider in place. ### Close reason Complete: internal/domain/memory/{contract,registrar,registry}.go stands up memory as a conforming engine family, mirroring internal/domain/curator's split exactly per this issue's own notes. MemoryEngine (contract.go) embeds Lifecycle (Start/Health/Stop) and Store (Write/Query/List/Forget -- real operations, not identity metadata) plus Name/Version/Manifest/Bind. Store is split out as its own embedded interface so MemoryEngine stays under golangci-lint's interfacebloat threshold, same mechanism as curator's embedded Lifecycle. Registry (registry.go) owns Register/Get/Names/Start/Health/Stop with duplicate/nil-engine/panic-in-Bind rejection, per-engine Start failure isolation (one engine's failed Start does not block the others, and is reported via Health), ctx-bounded Stop, and reverse-registration-order shutdown -- all verified by registry_test.go, mirroring curator's test suite. go test ./internal/domain/memory/... -race -count=1 is green; task lint is 0 issues. Registrar (registrar.go) carries EventSink and Clock -- the only host services with anything to gate on today. No capability-filtering logic exists yet because no memory-specific host service is capability-gated (unlike curator's Tools/Skills), so Bind passes the host straight through; add filtering if/when a gated service appears. One AC clause is not literally testable yet: internal/plugin/ architecture_test.go's TestEngineFamilyInspectionRejectsInvalidShapes only scans inline fixture source, not the real package tree, so nothing currently asserts memory.MemoryEngine is "recognised" by it one way or the other -- the shape matches curator's (which the fixture tests validate the pattern against), but there is no scan-the-repo test to literally pass. Noting this so a future close of a sibling issue doesn't repeat the earlier inaccurate claim that this test scans real packages (archie-core-1786637499933-386-83646cce's close reason cited a test name, TestEveryEngineInterfaceHasTypedCapabilityAndFamilyOwner, that does not exist in the repo -- likely stale even at the time it was written). Not done, and correctly still open as their own issues: engines that implement this contract (the Honcho proof, archie-core-1786637492031), the config surface to select one (archie-core-1786637490043), and binding curators to an attached engine (archie-core-1786637499636). --- _Imported from beads `archie-core-1786637490069-11-e245c170` · GitHub #32 · type feature · priority P2 · created 2026-08-08 · closed 2026-09-01_
sam added the mediumfeature labels 2026-10-27 13:34:34 +00:00
sam self-assigned this 2026-10-27 13:34:34 +00:00
sam closed this issue 2026-10-27 13:34:34 +00:00
sam added a new dependency 2026-10-27 13:41:39 +00:00
sam added a new dependency 2026-10-27 13:41:39 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: sam/archie#8