Skip to content

feat(memory): unify the working-awareness stores under one ranked read path (rung 2)#380

Merged
JKHeadley merged 2 commits into
mainfrom
echo/cwa-rung2-unify-stores-spec
May 25, 2026
Merged

feat(memory): unify the working-awareness stores under one ranked read path (rung 2)#380
JKHeadley merged 2 commits into
mainfrom
echo/cwa-rung2-unify-stores-spec

Conversation

@JKHeadley
Copy link
Copy Markdown
Owner

What

Rung 2 of Continuous Working Awareness: give the working-awareness stores one ranked read path. Topic-intent (rungs 0–1), Playbook, and semantic/episodic memory each had their own read path + ranking. This unifies the reading — the existing WorkingMemoryAssembler (already a token-budgeted multi-source builder) now also draws topic-intent + Playbook into one ranked "Working Set" section, blended by relevance × recency-decay.

The load-bearing design choice (ratified): unify the READ, not the storage. The three stores keep their backends + write paths; the assembler is the single unified read. Additive, reversible, no data migration.

How

  • src/memory/WorkingSet.ts (new): the WorkingSetItem lingua franca + blendedScore/rankWorkingSet, and two read-only, degrade-safe source adapters — topicIntentToWorkingSet (refs ≥ tentative; relevance = confidence, recency = lastReinforcedAt) and playbookManifestToWorkingSet (scans {stateDir}/playbook/**.json, trigger/tag-gated, never invokes the Python scripts).
  • WorkingMemoryAssembler: optional topicIntentStore + stateDir; a workingSet budget; the new section appended after the existing knowledge/episodes/relationships and gated on the new deps + content. server.ts wires the deps + broadens the construction gate.

Regression pin (the safety anchor)

With the new sources absent or empty, the assembled output is byte-for-byte unchanged. Verified three ways: a dedicated unit test; the existing 49 assembler + working-memory tests all still green; and a boot-path route test asserting a ref-less topic yields no Working Set section.

Testing (all tiers)

11 new tests: 8 unit (blended ranking + recency decay; both adapters; degrade-safety on missing store / corrupt manifest; the regression pin; new-section-on-content) + 3 boot-path route (real AgentServer/session/context/:topicId surfaces a topic-intent ref in a "Working Set" section; ref-less topic unchanged). tsc + lint clean (incl. no-raw-LLM guard).

Honesty note

Claude-authored spec + manual review; full /spec-converge + /crossreview multi-model tooling isn't on the build host. This is the most architectural rung (touches the shared assembler), so the regression pin is the primary safety and a fuller multi-model review remains advisable. Ratified by Justin with that caveat explicit.

Spec: docs/specs/cwa-unify-stores.md. Side-effects: upgrades/side-effects/cwa-unify-stores.md.

🤖 Generated with Claude Code

@vercel
Copy link
Copy Markdown

vercel Bot commented May 25, 2026

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

Project Deployment Actions Updated (UTC)
instar Ready Ready Preview, Comment May 25, 2026 9:08am

Request Review

Instar Agent (echo) and others added 2 commits May 25, 2026 02:08
Unify the working-awareness stores (Playbook + memory + topic-intent)
under one ranked read path. Key reframing: extend the existing
WorkingMemoryAssembler to add topic-intent + Playbook as sources under a
common WorkingSetItem shape + one blended ranking + token budget — NOT a
physical store migration. Additive, reversible, regression-pinned (empty
new sources → unchanged output). Signal-only; per-source observability.

Draft + manual review; not through full multi-model convergence (tooling
absent) and not ratified. approved:false. Stops at the ratification gate.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…d path (rung 2)

Extends WorkingMemoryAssembler to draw topic-intent refs + Playbook
manifest items into one ranked "Working Set" section, blended by
relevance × recency-decay — unifying the READ, not migrating storage.

- src/memory/WorkingSet.ts (new): WorkingSetItem lingua franca +
  blendedScore/rankWorkingSet + read-only degrade-safe adapters
  (topicIntentToWorkingSet; playbookManifestToWorkingSet — scans manifest
  JSON, never invokes Python).
- WorkingMemoryAssembler: optional topicIntentStore + stateDir; workingSet
  budget; the new section appended AFTER existing sources, gated on deps +
  content. server.ts wires the deps + broadens the construction gate.
- REGRESSION PIN: with new sources empty, assembled output is byte-for-byte
  unchanged — verified by a unit test + the unchanged existing 49-test
  assembler/working-memory suites + a ref-less-topic route test.

11 new tests (8 unit + 3 boot-path route). tsc + lint clean.

Spec: docs/specs/cwa-unify-stores.md (approved; Claude-authored + manual
review — most architectural rung, fuller multi-model review advisable,
caveat ratified).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@JKHeadley JKHeadley force-pushed the echo/cwa-rung2-unify-stores-spec branch from 3c387c9 to 8565007 Compare May 25, 2026 09:08
@JKHeadley JKHeadley merged commit 511aca1 into main May 25, 2026
18 checks 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