feat(memory): unify the working-awareness stores under one ranked read path (rung 2)#380
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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>
3c387c9 to
8565007
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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): theWorkingSetItemlingua franca +blendedScore/rankWorkingSet, and two read-only, degrade-safe source adapters —topicIntentToWorkingSet(refs ≥ tentative; relevance = confidence, recency = lastReinforcedAt) andplaybookManifestToWorkingSet(scans{stateDir}/playbook/**.json, trigger/tag-gated, never invokes the Python scripts).WorkingMemoryAssembler: optionaltopicIntentStore+stateDir; aworkingSetbudget; the new section appended after the existing knowledge/episodes/relationships and gated on the new deps + content.server.tswires 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/:topicIdsurfaces 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+/crossreviewmulti-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