Wire the memory port: store-backed adapter, loop injection, migration parity (N3 WP5) #95

Merged
weichen merged 1 commits from feature/n3-memory-wp5 into main 2026-10-07 16:24:58 +00:00
Owner

Why: memory recall lived as a product-side interface assertion with no library port, AgentSpec.MemoryScope had no consumer, and the model had no write-back path.

What: storeMemory adapter over memory_entries (scope filters, limit, project-context inheritance); runCtx.StoreMemory outlet; llm_direct wires Config.Memory (loop injects per request); assembly-side injection removed (same text, no duplication).

Evidence: go test -count=1 ./... green; adapter unit tests plus the migration parity test (block text shape and deterministic order preserved).

Impact: recall defaults to all scopes (pre-migration semantics); memory_write on the kernel path.

Refs: Agent-Native#34, Agent-Squad#38, Agent-System-Documents#43

Why: memory recall lived as a product-side interface assertion with no library port, AgentSpec.MemoryScope had no consumer, and the model had no write-back path. What: storeMemory adapter over memory_entries (scope filters, limit, project-context inheritance); runCtx.StoreMemory outlet; llm_direct wires Config.Memory (loop injects per request); assembly-side injection removed (same text, no duplication). Evidence: go test -count=1 ./... green; adapter unit tests plus the migration parity test (block text shape and deterministic order preserved). Impact: recall defaults to all scopes (pre-migration semantics); memory_write on the kernel path. Refs: Agent-Native#34, Agent-Squad#38, Agent-System-Documents#43
weichen added 1 commit 2026-10-07 16:23:38 +00:00
Why: memory recall lived as a product-side interface assertion with no
library port, AgentSpec.MemoryScope had no consumer, and the model had
no write-back path. The port (Agent-Native#34) now exists; the product
adapts it over memory_entries.
Evidence: go test -count=1 ./... green; TestStoreMemoryRecallScopeAndLimit
(scope filters and limit), TestStoreMemoryAppendRoundtrip (project
context inheritance), TestRunCtxStoreMemory (runCtx outlet),
TestDirectRunInjectsMemoryBlock (the [记忆] block reaches the request
with the pre-migration text shape and deterministic order).
Impact: assembly-side injection removed (the loop injects per request
— same text, no duplication); memory_write available on the kernel
path; recall defaults to all scopes (pre-migration semantics), with
AgentSpec.MemoryScope narrowing where hosts pass it.
Refs: Agent-Native#34, Agent-Squad#38, N3 plan WP5
weichen merged commit e5034e177d into main 2026-10-07 16:24:58 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System-Backend#95