Skip to content

docs(adr): Context Architecture v2 — lifecycle, projection, typed memory (#3192) - #3203

Closed
mabry1985 wants to merge 2 commits into
mainfrom
feat/3192-context-architecture-v2-adr
Closed

docs(adr): Context Architecture v2 — lifecycle, projection, typed memory (#3192)#3203
mabry1985 wants to merge 2 commits into
mainfrom
feat/3192-context-architecture-v2-adr

Conversation

@mabry1985

Copy link
Copy Markdown
Member

Summary

Governing ADR (0107) for the Context Architecture v2 initiative, the gate for all implementation work under #3184.

  • D1: Separate durable state from model-visible context. The projection pipeline composes at request time without checkpointing derived frames, eliminating stale-snapshot accumulation in conversation history.
  • D2: Typed memory axes on one physical backend. Four new columns (memory_kind, subject, review_state, expires_at) provide orthogonal classification while domain stays as a topic bucket.
  • D3: Four context layers with stable ordering. Stable prefix, session-frozen snapshot, current-turn delta, on-demand retrieval — ordered for maximum prefix-cache hit rate.
  • D4: One semantic runtime context contract. Named delivery adapters per surface (lead, subagent, ACP, goal, scheduler, plugin, incognito) with documented injection/persistence/trust policies.

Also includes:

  • Phase 0 characterization fixtures (tests/test_context_characterization.py, 11 tests) documenting today's Chunk fields, compose_context return contract, and context_frame_message shape
  • Changelog fragment

Resolves #3192 · Tracker: #3184

Test plan

  • ruff check . passes
  • python -m pytest tests/test_context_characterization.py -q — 11 passed
  • Human review of ADR content and invariant definitions

🤖 Generated with Claude Code

https://claude.ai/code/session_01WEMxBi71vjtmmmziFCMcby

…ory (#3192)

Governing ADR for the Context Architecture v2 initiative (#3184).
Establishes four invariants: (D1) durable state separate from model-visible
projection, (D2) typed memory axes on one physical backend, (D3) four
context layers with stable ordering, (D4) one semantic runtime contract.

Includes Phase 0 characterization fixtures (11 tests documenting the current
Chunk fields, compose_context contract, and context_frame_message shape) and
a changelog fragment.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WEMxBi71vjtmmmziFCMcby
@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

The ADR and compose_context docstring still referenced `before_model`,
which was replaced by `before_agent` in knowledge.py. Also add
prior-sessions cache bypass to test_compose_context_returns_context_keys
so it never touches the real filesystem, matching the other compose_context
tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WEMxBi71vjtmmmziFCMcby
@mabry1985

Copy link
Copy Markdown
Member Author

Duplicate — work consolidated on #3204.

@mabry1985 mabry1985 closed this Aug 27, 2026
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.

ADR: Context Architecture v2 lifecycle, authority, and projection contract

1 participant