spec(context): add Context-Adaptive Memory specification (CAM)#4546
Merged
Conversation
Formal spec package for the Context-Adaptive Memory subsystem covering GitHub issues #4016 (AgeMem proactive summarization), #4017 (Adaptive Focus Memory three-level fidelity), and #4018 (PAACE plan-aware context engineering). Spec includes BRD, SRS (35 FRs, 10 NFRs), main spec with 12 invariants, implementation plan, and 10 granular developer tasks. MVP scope (v0.21): ContextFidelity enum in zeph-common, heuristic FidelityScorer, proactive regrade trigger, PlannedToolHint in ContextBuildRequest. RL training and orchestration wiring deferred to Phase 2. Closes #4016 Closes #4017 Closes #4018
a7f5541 to
ebc0a8c
Compare
This was referenced May 28, 2026
Closed
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.
Summary
Formal specification package for the Context-Adaptive Memory (CAM) subsystem, covering three research issues:
The three approaches are unified into a single coherent subsystem. Spec produced via the spec-driven team-develop workflow (architect → critic → SDD → reviewer), with architect plan revised after SIGNIFICANT critic findings (S1-S4: index invalidation race, CompactionState underspec, LLM API contract violation, weight normalization).
Spec package
specs/062-context-adaptive-memory/:spec.md— 12 invariants (INV-01..12), full data flow, scoring rules, fidelity application rules, 12 ACsbrd.md— problem statement, 40–60% token reduction target, stakeholderssrs.md— 35 FRs (EARS notation), 10 measurable NFRsplan.md— Phase 1 MVP + Phase 2 deferred + risk registertasks.md— 10 granular developer tasks (T-01..T-10)MVP scope (Phase 1, v0.21)
ContextFidelity { Full, Compressed, Placeholder }enum inzeph-commonFidelityScorerinzeph-context(temporal decay + role importance + keyword overlap + plan relevance)regraded_this_turnre-entry guard)PlannedToolHinttype inContextBuildRequestassembler.rs(AFTERapply_prepared_context())Deferred (Phase 2)
Critical invariants
apply_prepared_context()returns (index invalidation prevention)regraded_this_turnguard prevents double-regradeTest plan
.local/testing/playbooks/context-adaptive-memory.mdCloses #4016
Closes #4017
Closes #4018