Skip to content

Wire assembleView into executeLLM with atomic/eventual recall - #17

Open
mattapperson wants to merge 3 commits into
mainfrom
feat/assemble-view-wiring
Open

Wire assembleView into executeLLM with atomic/eventual recall#17
mattapperson wants to merge 3 commits into
mainfrom
feat/assemble-view-wiring

Conversation

@mattapperson

Copy link
Copy Markdown
Owner

Summary

  • Wire the full memory pipeline into executeLLM: initLayersallocateBudgetsrecallLayersAtomic + recallLayersEventualassembleViewcallModelstoreLayers
  • Add recallMode to MemoryLayer: 'atomic' (default, blocks callModel) vs 'eventual' (cached, refreshes on state change via store)
  • Add ProjectionPolicy config at harness level (default) and step level (override)
  • Zero behavioral change when no layers are present

Changed files

  • execute-llm.ts — core pipeline wiring with partitionItems helper
  • layer-lifecycle.tsrecallLayersAtomic(), recallLayersEventual(), RecallCache type, stale marking in storeLayers
  • agent-harness.tsprojection config, recallCache field, new recall methods
  • types/memory.tsrecallMode on MemoryLayer
  • types/step.tsprojection on StepLLM
  • types/runtime.tsprojection on AgentConfig, new methods on AgentHarnessContract
  • observational-memory.ts — only built-in layer with recallMode: 'eventual'
  • specs/11-memory-layer-system.md — recall modes, assembly algorithm, ProjectionPolicy docs
  • Skill api-reference.mdProjectionPolicy section

Test plan

  • 9 new tests across execute-llm.test.ts and layer-lifecycle.test.ts
  • recallLayersAtomic filters to atomic layers only
  • recallLayersEventual returns cached results, re-recalls on stale
  • executeLLM calls recall + store when layers present
  • executeLLM skips pipeline when no layers (existing behavior preserved)
  • All 612 tests passing, 0 failures
  • bunx biome check clean
  • Typecheck clean (only pre-existing CallModelRequest union error)

…call modes

Connect the dormant memory pipeline (allocateBudgets, recallLayers, assembleView,
storeLayers) into the LLM execution path. Layers now participate in every callModel
cycle: init → budget → recall → assemble → call → store.

Add recallMode to MemoryLayer: atomic (default, blocks callModel) vs eventual
(uses cached results, refreshes on state change). Add ProjectionPolicy config
at harness and step levels.
@vercel

vercel Bot commented Apr 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
noetic-web Ready Ready Preview, Comment Apr 1, 2026 2:19pm

Request Review

- Move init sentinel inside storage guard so layers aren't falsely marked
  initialized when no storage adapter is configured
- Make recallLayersEventual fully non-blocking: first call returns empty
  and seeds cache in background, stale calls return cached value immediately
- Evict cache entries when stale refresh yields empty results
- Add .catch() to fire-and-forget recall promises to prevent unhandled rejections
- Sort eventual layers by slot order for consistent prompt assembly
- Count system messages from item log in budget allocation
- Add clearRecallCache and call it in disposeLayers to prevent leaks
…tructions

Merge main's `instructions` field (renamed from `system`) into the PR's
memory pipeline code. Both features now coexist: assembleView builds the
request items while `step.instructions` is passed through to callModel.

Also fixes pre-existing type mismatch in CallModelRequestWithoutTools
where ctx was typed as `undefined` but always passed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant