Skip to content

docs(adr): ADR-0072 tape-native memory — semantic index v0 + read/write switch - #613

Merged
delete-cloud merged 2 commits into
mainfrom
adr/0072-tape-memory
Jun 24, 2026
Merged

delete-cloud merged 2 commits into
mainfrom
adr/0072-tape-memory

Conversation

@delete-cloud

@delete-cloud delete-cloud commented Jun 24, 2026 •

Copy link
Copy Markdown
Owner

What

Adds ADR-0072 (Proposed) — design only, no code change.

Why

Records the decision for the next steps on tape-native memory. An external design proposal claimed the tape-native memory/retrieval layer was missing; two independent reviews (Claude + codex, read-only against the live tree) found that premise is broadly false — the layer already ships (plugins/memory.py build_context/on_turn_end, topics/ recall + ContextPackRenderer grounding, MemoryRecord in agentkit/directive/types.py, durable review store from ADR-0069). This ADR pins down the two genuinely narrow gaps.

Decisions

  • A — read/write memory enable switch (gates the first implementation PR): config-level [memory] with enabled / read_enabled / write_enabled, read/write separated. Invariant: memory off ≠ tape off. Generalizes the existing TopicRecallPlannerInput.enabled (read-half only) and adds the write half + config surface. Not coupled to the external KB/RAG toggle.
  • B — semantic tape index v0 (lands after the switch PR): an optional, hybrid embedding backend that coexists with the deterministic TopicRangeIndex, never replaces it; must pass the same _FORBIDDEN_TEXT_MARKERS redaction guard. Only a minimal MemoryIndex/MemoryHit protocol goes in AgentKit; embedding/backend/rerank/merge stay in coding_agent plugins.

Consistency

Aligned with ADR-0039 / 0046 / 0067 / 0068 / 0069. Does not supersede ADR-0046 — the deterministic index stays the default recall path; semantic is additive/opt-in.

Validation

Design-only; the Acceptance Criteria tests (test_memory_switch.py, test_semantic_tape_index.py) are intended/pending and will gate the follow-up implementation PRs.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added architecture documentation for new memory configuration options, enabling independent control of memory read and write behavior.
    • Documented semantic indexing v0 as an optional retrieval enhancement for improved memory operations.

…ite switch

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 24, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@delete-cloud, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 34 minutes and 8 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4622b3a4-7e47-44a3-b23c-44afa4954001

📥 Commits

Reviewing files that changed from the base of the PR and between 1936bd6 and e8cea95.

📒 Files selected for processing (1)
  • coding-agent/docs/adr/0072-tape-memory-semantic-index-and-enable-switch.md
📝 Walkthrough

Walkthrough

A new Architecture Decision Record (ADR-0072) is added, specifying the [memory] configuration section in agent.toml with enabled, read_enabled, and write_enabled keys, their effective gating logic, non-interference rules with tape persistence, semantic tape index v0 design as an opt-in hybrid retrieval backend, scope boundaries between AgentKit and coding-agent, and pending acceptance criteria.

Changes

ADR-0072: Tape-Native Memory Configuration and Semantic Index

Layer / File(s) Summary
Memory switch spec and semantic index design
coding-agent/docs/adr/0072-tape-memory-semantic-index-and-enable-switch.md
Introduces ADR-0072 defining the [memory] config section (enabled, read_enabled, write_enabled) with effective read/write gating (enabled && read_enabled / enabled && write_enabled), explicit non-interference with tape persistence/checkpointing/replay, build_context skipping recall when effective read is off, on_turn_end skipping candidate production when effective write is off, semantic tape index v0 as an opt-in hybrid backend alongside TopicRangeIndex, the _FORBIDDEN_TEXT_MARKERS boundary preservation, AgentKit vs coding-agent scope constraints, and enumerated pending test acceptance criteria.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

A rabbit hops through memory lanes,
With switches to toggle the context chains,
Tape rolls on though recall sleeps tight,
Semantic index blooms in soft moonlight,
ADR writ, the boundaries clear—
🐇 No forbidden text shall interfere!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main change: introducing ADR-0072 documenting tape-native memory configuration with semantic index v0 and read/write enable switch, which aligns with the PR's core design decisions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch adr/0072-tape-memory

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@coding-agent/docs/adr/0072-tape-memory-semantic-index-and-enable-switch.md`:
- Around line 61-79: The ADR Decision B section describes semantic retrieval as
hybrid support alongside TopicRangeIndex but does not specify the merge contract
for when both retrieval paths return results. Add explicit specifications to the
decision that define the ordering, deduplication, and tie-breaking strategy when
both the semantic index and TopicRangeIndex return hits. Include details on how
results will be merged into build_context output, how duplicate memories across
both indexes will be deduplicated, and what ranking or priority rules apply when
both paths return the same memory to ensure deterministic and predictable
behavior.
- Around line 39-54: The ADR section describing the memory read and write
switches does not clearly specify how the new `[memory].enabled` and
`read_enabled` configuration flags compose with the existing
`TopicRecallPlannerInput.enabled` field. Add a clear statement in the decision
section that explicitly defines the composition rule: specify whether
`TopicRecallPlannerInput.enabled` acts as an additional AND gate applied after
the effective_read calculation, serves as an override, or remains an
internal-only implementation detail. This clarification will prevent the
follow-up implementation from creating two independent sources of truth for
recall behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2e71329d-e0df-475f-ab1a-2aab2ef71b64

📥 Commits

Reviewing files that changed from the base of the PR and between 70f2eeb and 1936bd6.

📒 Files selected for processing (1)
  • coding-agent/docs/adr/0072-tape-memory-semantic-index-and-enable-switch.md

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