Skip to content

test(e2e): wipe memory tree during test reset#2308

Merged
senamakel merged 3 commits into
tinyhumansai:mainfrom
aqilaziz:codex/1862-test-reset-memory-tree
May 21, 2026
Merged

test(e2e): wipe memory tree during test reset#2308
senamakel merged 3 commits into
tinyhumansai:mainfrom
aqilaziz:codex/1862-test-reset-memory-tree

Conversation

@aqilaziz
Copy link
Copy Markdown
Contributor

@aqilaziz aqilaziz commented May 20, 2026

Summary

  • Extends openhuman.test_reset so E2E resets also wipe Memory Tree state via the existing memory_tree_wipe_all path.
  • Adds reset summary fields for memory-tree rows, content directories, and Composio sync-state rows so Appium logs show exactly what was cleared.
  • Adds a focused async unit test covering memory-tree content directory cleanup through the new reset helper.

Problem

Solution

  • Calls read_rpc::wipe_all_rpc(&config) from test_support::rpc::reset after cron cleanup and before config/auth clearing.
  • Surfaces memory_tree_rows_deleted, memory_tree_dirs_removed, and memory_tree_sync_state_cleared in ResetSummary, reset_json, and the controller schema.
  • Keeps this as a scoped Expand openhuman.test_reset coverage as more domains are touched by E2E #1862 slice; other domains listed in the issue can land as separate hook PRs.

Submission Checklist

  • Tests added or updated (happy path + at least one failure / edge case) per Testing Strategy — focused unit test covers Memory Tree content-dir cleanup; existing wipe_all_rpc owns table/sync-state failure behavior.
  • Diff coverage >= 80% — new Rust test covers the new helper path; CI coverage gate is authoritative.
  • Coverage matrix updated — N/A: E2E test-support reset plumbing, no product feature row added/removed.
  • All affected feature IDs from the matrix are listed in the PR description under ## Related — N/A: no feature matrix row.
  • No new external network dependencies introduced (mock backend used per Testing Strategy)
  • Manual smoke checklist updated if this touches release-cut surfaces (docs/RELEASE-MANUAL-SMOKE.md) — N/A: test-support RPC only.
  • Linked issue closed via Closes #NNN in the ## Related section — N/A: scoped slice; references Expand openhuman.test_reset coverage as more domains are touched by E2E #1862 without closing the umbrella.

Impact

  • E2E specs that call resetApp(...) now start without prior Memory Tree chunks, summary/wiki files, or sync cursors.
  • User runtime behavior is unchanged unless the E2E-only openhuman.test_reset controller is compiled/enabled.

Related


AI Authored PR Metadata (required for Codex/Linear PRs)

Linear Issue

  • Key: N/A
  • URL: N/A

Commit & Branch

  • Branch: codex/1862-test-reset-memory-tree
  • Commit SHA: 48630b40f69400d6a3c5e055e80c25486e3bba6d

Validation Run

  • pnpm --filter openhuman-app format:check — N/A: no frontend files changed.
  • pnpm typecheck — N/A: no TypeScript files changed.
  • Focused tests: attempted cargo test -p openhuman test_support::rpc::tests::wipe_memory_tree_removes_content_dirs_and_reports_summary --lib.
  • Rust fmt/check (if changed): cargo fmt --all --check; git diff --check.
  • Tauri fmt/check (if changed): N/A: no Tauri shell files changed.

Validation Blocked

  • command: cargo test -p openhuman test_support::rpc::tests::wipe_memory_tree_removes_content_dirs_and_reports_summary --lib
  • error: local Windows build fails before tests in whisper-rs-sys because clang.dll / libclang.dll is missing and LIBCLANG_PATH is unset.
  • impact: focused test did not execute locally; CI Linux/Windows runners with libclang are expected to compile and run it.

Behavior Changes

  • Intended behavior change: E2E-only test reset now wipes Memory Tree state in addition to cron/auth/onboarding state.
  • User-visible effect: none in normal builds; E2E logs show memory-tree wipe counts.

Parity Contract

  • Legacy behavior preserved: cron cleanup, auth clearing, onboarding reset, and active-user removal still run and still short-circuit on failure.
  • Guard/fallback/dispatch parity checks: Memory Tree wipe reuses the existing user-facing wipe_all_rpc implementation instead of adding a second deletion path.

Duplicate / Superseded PR Handling

  • Duplicate PR(s): N/A
  • Canonical PR: this PR
  • Resolution (closed/superseded/updated): N/A

Summary by CodeRabbit

  • New Features

    • Reset now clears memory-tree persistent data during fresh-install resets and reports rows deleted, directories removed, and sync-state entries cleared.
  • Documentation

    • Updated reset operation schema and outputs to include memory-tree cleanup fields.
  • Tests

    • Added a unit test verifying memory-tree wipe removes content directories and reports summary metrics.
  • Bug Fixes

    • Increased core startup readiness timeout to reduce startup failures.

Review Change Stack

@aqilaziz aqilaziz requested a review from a team May 20, 2026 08:14
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

Caution

Review failed

Failed to post review comments

📝 Walkthrough

Walkthrough

The reset flow now wipes memory-tree persistent data and reports results. ResetSummary and the reset controller schema include three memory-tree fields; a new wipe_memory_tree helper integrates the cleanup into reset, and the JSON output plus a unit test were added. The core process readiness polling budget was increased to 20s.

Changes

Memory-tree cleanup in test reset

Layer / File(s) Summary
Reset contract — types and schema
src/openhuman/test_support/rpc.rs, src/openhuman/test_support/schemas.rs
ResetSummary struct gains three new fields (memory_tree_rows_deleted, memory_tree_dirs_removed, memory_tree_sync_state_cleared), the reset baseline comment and import for the read RPC were updated, and the reset controller schema description and outputs were extended with the new memory-tree fields.
Memory-tree wipe and reset integration
src/openhuman/test_support/rpc.rs
A private wipe_memory_tree helper wraps read_rpc::wipe_all_rpc. The reset workflow invokes this helper, logs results, populates the new ResetSummary fields from its output, appends a memory_tree_log entry to the reset debug/status vector, and reset_json is updated to include the three memory-tree fields.
JSON output and unit test
src/openhuman/test_support/rpc.rs
The reset_json response includes the memory-tree summary fields. A new async unit test creates memory-tree content directories and files, runs wipe_memory_tree, asserts expected directory removals, and verifies the returned summary fields.

Core process readiness budget

Layer / File(s) Summary
Increase ensure_running readiness budget
app/src-tauri/src/core_process.rs
CoreProcessHandle::ensure_running increases the readiness polling iterations from 100 to 200 (100ms cadence), extending the JSON-RPC readiness budget from 10s to 20s.

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • tinyhumansai/openhuman#2326: Modifies the reset/test_reset RPC path; may overlap with gating or sequence of reset steps.
  • tinyhumansai/openhuman#2277: Also edits src/openhuman/test_support/rpc.rs reset flow—potential overlap around runtime guards and reset execution.

"I hopped through files with a curious cheer,
I cleared the memory tree, no root left near,
I counted rows and folders gone,
Wrote them down at break of dawn,
A tiny rabbit's tidy reset here!" 🐇✨

🚥 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 directly and specifically describes the main change: extending the E2E test reset to wipe memory tree state, which is the primary objective of this PR.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.


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 and usage tips.

coderabbitai[bot]
coderabbitai Bot previously approved these changes May 20, 2026
@aqilaziz aqilaziz force-pushed the codex/1862-test-reset-memory-tree branch from 48630b4 to d1fd489 Compare May 20, 2026 08:34
@senamakel senamakel self-assigned this May 20, 2026
# Conflicts:
#	src/openhuman/test_support/rpc.rs
@coderabbitai coderabbitai Bot added the working A PR that is being worked on by the team. label May 20, 2026
cargo-llvm-cov instrumentation roughly doubles cold-start time for
the embedded core. The 10s budget added in tinyhumansai#2116 still flakes the
ensure_running_falls_back_to_7789_when_7788_is_busy test on the
Tauri coverage runner. 20s gives the readiness probe enough slack
without affecting user-visible startup (ready signal lands in <1s
on normal runs and the loop exits immediately).
@senamakel senamakel merged commit 369a392 into tinyhumansai:main May 21, 2026
29 checks passed
@senamakel
Copy link
Copy Markdown
Member

merged 🙌 thanks @aqilaziz, love that test_reset now wipes the memory tree too (plus those reset summary fields are gonna make appium logs way easier to debug). always a treat seeing you back in the prs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

working A PR that is being worked on by the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants