Skip to content

test(memory): cover semantic index ADR gaps - #641

Merged
delete-cloud merged 2 commits into
mainfrom
test/adr-0072-memory-index-gaps
Jun 27, 2026
Merged

delete-cloud merged 2 commits into
mainfrom
test/adr-0072-memory-index-gaps

Conversation

@delete-cloud

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

Copy link
Copy Markdown
Owner

Summary

  • add AgentKit protocol coverage that keeps MemoryIndex provider/backend agnostic
  • add semantic sync rebuild coverage proving derived backend contents are not authority
  • mark the remaining ADR-0072 acceptance items complete with full-suite evidence

Verification

  • uv run pytest -q tests/agentkit/storage/test_protocols.py::test_memory_index_protocol_stays_provider_agnostic tests/coding_agent/test_semantic_sync.py::test_manifest_cache_is_not_sync_authority
  • uv run pytest -q tests/agentkit/storage/test_protocols.py tests/coding_agent/test_semantic_sync.py tests/coding_agent/test_memory_index_backend_contract.py tests/coding_agent/test_semantic_tape_index.py
  • uv run ruff check tests/agentkit/storage/test_protocols.py tests/coding_agent/test_semantic_sync.py
  • uv run ruff format --check tests/agentkit/storage/test_protocols.py tests/coding_agent/test_semantic_sync.py
  • uv run pytest -q (3945 passed, 8 skipped, 20 xfailed)
  • local subagent review: NO P1/P2 twice after implementation, final review NO P1/P2

Summary by CodeRabbit

  • Bug Fixes

    • Improved semantic memory sync reliability so stale cached content is no longer treated as the source of truth during rebuilds.
    • Strengthened storage protocol checks to keep memory indexing behavior consistent and provider-agnostic.
  • Tests

    • Added coverage for memory index protocol behavior and semantic sync rebuild correctness.
    • Updated release checklist to reflect completed validation.

@coderabbitai

coderabbitai Bot commented Jun 27, 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 52 minutes and 54 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 review availability.

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, additional reviews become available more gradually as earlier reviews age out of the rolling window.

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: 709cc9df-8484-423e-bca9-e7efeef90440

📥 Commits

Reviewing files that changed from the base of the PR and between b2a242f and faa20ab.

📒 Files selected for processing (1)
  • coding-agent/tests/coding_agent/test_semantic_sync.py
📝 Walkthrough

Walkthrough

Updated the ADR-0072 checklist and added tests for the MemoryIndex protocol contract and semantic sync rebuild behavior.

Changes

Semantic memory protocol and sync checks

Layer / File(s) Summary
MemoryIndex protocol contract and in-memory test double
coding-agent/tests/agentkit/storage/test_protocols.py
Expands storage protocol imports, adds InMemoryMemoryIndex, and checks MemoryIndex method names, signatures, and MemoryHit fields.
Semantic sync rebuild test
coding-agent/tests/coding_agent/test_semantic_sync.py
Adds a rebuild test that compares stale and authoritative topic and memory data, then checks deleted, indexed, and backend IDs.
ADR-0072 checklist completion
coding-agent/docs/adr/0072-tape-memory-semantic-index-and-enable-switch.md
Marks the two new tests and the uv run pytest -q command as complete in the acceptance criteria list.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

I thumped through checks with a twitchy nose,
Found stale little crumbs where the old cache goes.
Fresh memory hops now line up neat,
And the checklist says the run is complete.
🐇✨

🚥 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 is concise and accurately summarizes the main change: added tests covering semantic index ADR gaps.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/adr-0072-memory-index-gaps

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: 1

🤖 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/tests/coding_agent/test_semantic_sync.py`:
- Around line 249-258: The rebuild assertions in test_semantic_sync are
order-sensitive even though rebuild() only guarantees which IDs are deleted and
indexed, not their sequence. Update the checks around expected_indexed_ids,
report.deleted_ids, report.indexed_ids, and backend.list_ids() to compare
unordered collections (or sort both sides) so the test stays provider-agnostic
and does not depend on backend iteration order.
🪄 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: 9b176761-ff79-4abe-b607-a4163d05ebcc

📥 Commits

Reviewing files that changed from the base of the PR and between d577a53 and b2a242f.

📒 Files selected for processing (3)
  • coding-agent/docs/adr/0072-tape-memory-semantic-index-and-enable-switch.md
  • coding-agent/tests/agentkit/storage/test_protocols.py
  • coding-agent/tests/coding_agent/test_semantic_sync.py

@delete-cloud
delete-cloud merged commit 7a3cf30 into main Jun 27, 2026
2 checks passed
@delete-cloud
delete-cloud deleted the test/adr-0072-memory-index-gaps branch June 27, 2026 09:39
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