Skip to content

test(reborn): add memory_search/memory_tree int-tier scenarios (T0-MEMQ) - #5434

Merged
henrypark133 merged 2 commits into
mainfrom
reborn-cov-T0-MEMQ
Jul 2, 2026
Merged

henrypark133 merged 2 commits into
mainfrom
reborn-cov-T0-MEMQ

Conversation

@henrypark133

Copy link
Copy Markdown
Collaborator

What

Closes T0-MEMQ from the Reborn backend coverage roadmap (docs/reborn/reborn-backend-coverage-roadmap.md, Tier 0). Adds two integration-tier scenarios to the reborn_group_memory group, covering the builtin.memory_search and builtin.memory_tree first-party tools — already registered by builtin_tools() but previously exercised only at trace/QA tier in-process int-tier.

Scenarios added

  • memory_search_finds_seeded (tests/reborn_group_memory/scenario_memory_search_finds_seeded.rs) — writer conversation seeds a distinctive sentence via memory_write (target: "memory"); a different conversation issues memory_search over the shared store and asserts the hit's snippet surfaces the marker (osprey-meridian-7). This exercises the write→reindex→FTS-chunk-projection→search path end to end. Cross-thread search works because the chunk records + FTS index live in the shared RootFilesystem.
  • memory_tree_reflects_structure (tests/reborn_group_memory/scenario_memory_tree_reflects_structure.rs) — writer seeds a nested path (projects/atlas/runbook.md); a different conversation lists via memory_tree (root, depth 3) and asserts both the intermediate directory (atlas/) and the leaf (runbook.md) appear.

Both mirror the existing scenario_write_then_read_cross_thread.rs pattern (writer + assert_tool_invoked, then assert_tool_result_contains on the consumer) and each carries a committed negative guard (an unwritten marker / uncreated directory) so the positive assertion is proven to discriminate rather than pass vacuously.

Mutation proof (protocol #4)

Code-under-test: crates/ironclaw_host_runtime/src/first_party_tools/memory.rs.

  • Forced search_response_to_value to emit empty results → only memory_search_finds_seeded went RED: "no recorded capability result containing osprey-meridian-7". Reverted.
  • Forced tree_response_to_value to return an empty array → only memory_tree_reflects_structure went RED: "no recorded capability result containing atlas/". Reverted.

Each mutation reddened exactly the intended scenario for the right reason; the other scenarios stayed green.

Verification

  • cargo build --tests --all-features — green
  • cargo clippy --all --tests --all-features -- -D warnings — clean
  • reborn_group_memory green under --features libsql and --all-features (5× consecutive under all-features, no flake)
  • Post-impl review (thermo-nuclear / approach / local-patterns / maintainability lenses via Sonnet reviewer): clean, no defects.

Notes / deferred

  • No production code changed — pure test authoring. The two mutation edits above were temporary and reverted (the host_runtime file has no net diff).
  • T0-MEMQ has no merged-dependency gate; branched from main (efcacdc50).

🤖 Generated with Claude Code

@railway-app
railway-app Bot temporarily deployed to ironclaw-ci-preview / ironclaw-pr-5434 June 30, 2026 06:00 Destroyed
@github-actions github-actions Bot added the size: XS < 10 changed lines (excluding docs) label Jun 30, 2026
@coderabbitai

coderabbitai Bot commented Jun 30, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: abb641f9-d952-44df-9412-de6c931c726b

📥 Commits

Reviewing files that changed from the base of the PR and between abe5d62 and 456db08.

📒 Files selected for processing (3)
  • tests/reborn_group_memory/main.rs
  • tests/reborn_group_memory/scenario_memory_search_finds_seeded.rs
  • tests/reborn_group_memory/scenario_memory_tree_reflects_structure.rs
💤 Files with no reviewable changes (3)
  • tests/reborn_group_memory/main.rs
  • tests/reborn_group_memory/scenario_memory_search_finds_seeded.rs
  • tests/reborn_group_memory/scenario_memory_tree_reflects_structure.rs

📝 Walkthrough

Summary by CodeRabbit

  • Tests
    • Expanded end-to-end memory persistence coverage with additional deterministic scenarios executed in sequence against a shared integration group.
    • Added multi-conversation checks that written memory becomes searchable, including negative guards to fail on unexpected results.
    • Added validation that the memory tree view from the root correctly shows saved directory and file paths, also with negative guards.
    • Improved scenario independence using per-scenario seeding.

Walkthrough

Two new integration test scenarios are added to tests/reborn_group_memory: one verifies cross-thread builtin.memory_search discovery of a seeded marker token, the other verifies builtin.memory_tree reflects a seeded nested filesystem path. Both are wired into the existing sequential memory_group_e2e test.

Changes

Memory Group E2E Scenario Expansion

Layer / File(s) Summary
Scenario implementations
tests/reborn_group_memory/scenario_memory_search_finds_seeded.rs, tests/reborn_group_memory/scenario_memory_tree_reflects_structure.rs
builtin.memory_search is verified against a seeded marker token across conversations, and builtin.memory_tree is verified against a seeded nested path, each with a negative guard for unexpected output.
Main test wiring
tests/reborn_group_memory/main.rs
Updates the shared sequential memory_group_e2e test comment, adds the new scenario modules, and records both new scenarios after the existing cross-thread write/read case.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • nearai/ironclaw#5402: Adds the reborn_group_memory group-test wiring and entrypoint that this PR extends with additional persisted-memory scenarios.

Poem

One thread writes seeds into the deep,
One thread asks what roots they keep.
A tree, a search, a shared small lore,
With phantom paths kept out the door.

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description has useful detail, but it does not follow the repository template and omits required sections like Change Type, Linked Issue, and Security Impact. Rewrite it to match the template headings and fill Summary, Change Type, Linked Issue, Validation, Security Impact, DB Impact, Blast Radius, Rollback Plan, Review Follow-Through, and the trust-boundary checklist.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title uses Conventional Commits style and accurately summarizes the new reborn memory_search/memory_tree integration scenarios.
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.

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.

@github-actions github-actions Bot added risk: low Changes to docs, tests, or low-risk modules contributor: core 20+ merged PRs labels Jun 30, 2026

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces two new integration test scenarios to the reborn_group_memory test suite: scenario_memory_search_finds_seeded and scenario_memory_tree_reflects_structure. These scenarios verify that documents written by one thread are correctly searchable and visible in the directory tree structure from a different thread/conversation sharing the same underlying store. There are no review comments, so no feedback is provided.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 `@tests/reborn_group_memory/scenario_memory_search_finds_seeded.rs`:
- Around line 54-69: The test in scenario_memory_search_finds_seeded is too weak
to prove that builtin.memory_search is query-selective because it only checks
for an unwritten token; strengthen the guard by seeding a second unrelated
document and asserting its unique marker is not present in the search result for
the target query, using searcher.assert_tool_result_contains (or an equivalent
negative check) around the existing memory_search assertion, or else soften the
comment to describe intent rather than a guarantee.

In `@tests/reborn_group_memory/scenario_memory_tree_reflects_structure.rs`:
- Around line 52-55: The current assertions in the scenario only check for the
presence of “atlas/” and “runbook.md”, which can still pass if the tree is
flattened or mis-parented. Update the test in
scenario_memory_tree_reflects_structure to verify the hierarchy by asserting the
parent path is reflected as well, and/or add a second memory_tree call scoped to
“projects/atlas” so the leaf is validated through its real parent. Use the
existing lister assertions around assert_tool_result_contains and the
memory_tree invocation to keep the structure check tied to the actual
parent-child relationship.
🪄 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f80d2901-a1bd-43df-8be8-2c8e65287b6e

📥 Commits

Reviewing files that changed from the base of the PR and between efcacdc and abe5d62.

📒 Files selected for processing (3)
  • tests/reborn_group_memory/main.rs
  • tests/reborn_group_memory/scenario_memory_search_finds_seeded.rs
  • tests/reborn_group_memory/scenario_memory_tree_reflects_structure.rs

Comment on lines +54 to +69
// The hit's snippet includes the marker → search located the seeded doc.
searcher.assert_tool_result_contains("osprey-meridian-7").await?;

// Committed negative guard (non-vacuity): a marker that was never written
// must be ABSENT from the search result, so `assert_tool_result_contains`
// is proven to discriminate rather than pass unconditionally (e.g. if the
// search silently returned every document or an empty-but-stringified set).
if searcher
.assert_tool_result_contains("tungsten-mirage-88")
.await
.is_ok()
{
return Err(
"negative guard failed: search result must not contain an unwritten marker".into(),
);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

This does not prove memory_search is query-selective.

The current negative guard only proves the response does not contain an unwritten token. A broken builtin.memory_search that returns every indexed document would still pass because the seeded marker is present and tungsten-mirage-88 is absent. Seed a second unrelated document and assert that its marker is not returned for this query, or soften the guarantee in the comment.

As per path instructions, "Comments that promise guarantees across layers must either be enforced by code/tests or softened to describe intent."

🤖 Prompt for 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.

In `@tests/reborn_group_memory/scenario_memory_search_finds_seeded.rs` around
lines 54 - 69, The test in scenario_memory_search_finds_seeded is too weak to
prove that builtin.memory_search is query-selective because it only checks for
an unwritten token; strengthen the guard by seeding a second unrelated document
and asserting its unique marker is not present in the search result for the
target query, using searcher.assert_tool_result_contains (or an equivalent
negative check) around the existing memory_search assertion, or else soften the
comment to describe intent rather than a guarantee.

Source: Path instructions

Comment on lines +52 to +55
// The serialized tree array must contain both the intermediate directory
// and the leaf file, proving the structure was reflected (not dropped).
lister.assert_tool_result_contains("atlas/").await?;
lister.assert_tool_result_contains("runbook.md").await?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

These asserts do not verify the hierarchy.

Checking only "atlas/" and "runbook.md" allows a flattened or mis-parented tree to pass. If this scenario is meant to prove projects/atlas/runbook.md is reflected structurally, assert on the parent directory as well and/or drive a second memory_tree call at path: "projects/atlas" so the leaf is verified through its real parent.

As per path instructions, "Comments that promise guarantees across layers must either be enforced by code/tests or softened to describe intent."

🤖 Prompt for 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.

In `@tests/reborn_group_memory/scenario_memory_tree_reflects_structure.rs` around
lines 52 - 55, The current assertions in the scenario only check for the
presence of “atlas/” and “runbook.md”, which can still pass if the tree is
flattened or mis-parented. Update the test in
scenario_memory_tree_reflects_structure to verify the hierarchy by asserting the
parent path is reflected as well, and/or add a second memory_tree call scoped to
“projects/atlas” so the leaf is validated through its real parent. Use the
existing lister assertions around assert_tool_result_contains and the
memory_tree invocation to keep the structure check tied to the actual
parent-child relationship.

Source: Path instructions

@railway-app

railway-app Bot commented Jun 30, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the ironclaw-pr-5434 environment in ironclaw-ci-preview

Service Status Web Updated (UTC)
ironclaw ✅ Success (View Logs) Web Jul 1, 2026 at 12:35 am

henrypark133 and others added 2 commits June 30, 2026 17:12
Add two integration-tier scenarios to the `reborn_group_memory` group,
covering the `builtin.memory_search` and `builtin.memory_tree` first-party
tools that `builtin_tools()` already registers but no int-tier test exercised.

Both mirror the existing cross-thread write_then_read pattern: a writer
conversation seeds a document via `memory_write`, then a different
conversation over the shared store exercises the tool and asserts on a
distinctive marker. Each carries a committed negative guard (an unwritten
marker / uncreated directory) so the positive assertion is proven to
discriminate rather than pass vacuously.

memory_search relies on the FTS chunk projection persisting in the shared
RootFilesystem, so cross-thread search hits the writer's chunks end to end.

Mutation-verified: forcing search to return empty results turns only the
search scenario RED; forcing the tree to drop nodes turns only the tree
scenario RED — each for the right reason.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…T0-MEMQ)

Style-only, no behavior change: rustfmt line-wrap fixes in the two new
test scenario files added by this PR. clippy --all-targets --all-features
-D warnings was already clean on these files; no lint fixes were needed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 1, 2026 00:28
@railway-app
railway-app Bot temporarily deployed to ironclaw-ci-preview / ironclaw-pr-5434 July 1, 2026 00:28 Destroyed

Copilot AI 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.

Pull request overview

Adds missing integration-tier (int-tier) coverage for the first-party builtin.memory_search and builtin.memory_tree tools within the existing reborn_group_memory sequential group harness, exercising cross-conversation visibility through the shared workspace/memory store.

Changes:

  • Add memory_search_finds_seeded scenario that writes a distinctive marker via builtin.memory_write in one conversation, then finds it via builtin.memory_search in another (with a negative guard).
  • Add memory_tree_reflects_structure scenario that writes a nested document path in one conversation, then verifies builtin.memory_tree in another reflects the intermediate directory + leaf (with a negative guard).
  • Wire both scenarios into tests/reborn_group_memory/main.rs and update the module-level rationale comment accordingly.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tests/reborn_group_memory/main.rs Registers and executes the two new memory scenarios in the existing sequential group runner.
tests/reborn_group_memory/scenario_memory_search_finds_seeded.rs New int-tier cross-thread scenario covering builtin.memory_search against a seeded marker.
tests/reborn_group_memory/scenario_memory_tree_reflects_structure.rs New int-tier cross-thread scenario covering builtin.memory_tree structural output for nested paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@henrypark133 henrypark133 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Code Review (multi-agent)

Intent: Add Reborn integration-tier tests for builtin.memory_search and builtin.memory_tree shared-store memory scenarios.

Stats: 0 net-new findings (from 4 raw reviewer findings, 2 after overlap dedup, 0 after live-thread dedupe) across 0 files. Reviewers run: security, bugs, performance, tests, conventions, local-patterns, maintainability, approach. Reviewers failed: none. Body-only: 0.

Dedupe Notes

  1. The search negative-guard/comment concern is already covered by the unresolved CodeRabbit thread on tests/reborn_group_memory/scenario_memory_search_finds_seeded.rs.
  2. The tree hierarchy/comment concern is already covered by the unresolved CodeRabbit thread on tests/reborn_group_memory/scenario_memory_tree_reflects_structure.rs.

No additional net-new issues survived current-head validation.

@henrypark133
henrypark133 merged commit f2e4169 into main Jul 2, 2026
101 checks passed
@henrypark133
henrypark133 deleted the reborn-cov-T0-MEMQ branch July 2, 2026 00:39

This branch was successfully deployed

No deployments
ironclaw-ci-preview / ironclaw-pr-5434 — 456db08c Deployed Jul 1, 2026 by railway-app[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor: core 20+ merged PRs risk: low Changes to docs, tests, or low-risk modules size: XS < 10 changed lines (excluding docs)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants