[PR #7029] [MERGED] test(mcp): verify recovery before reading retained views #7587

Closed
opened 2026-11-03 13:38:54 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/7029
Author: @gensokyo-dev
Created: 10/24/2026
Status: ✅ Merged
Merged: 10/24/2026
Merged by: @gensokyo-dev

Base: main ← Head: test/mcp-resource-recovery-20261024


📝 Commits (1)

  • 4ce733b test(mcp): verify recovery before reading retained views

📊 Changes

1 file changed (+88 additions, -65 deletions)

View changed files

📝 tests/boundary/mcp/javascriptAnalysisResources.test.ts (+88 -65)

📄 Description

Problem and outcome

Main push CI intermittently rejects the resource test's recovery request with parent_result_budget_exhausted. Worker recovery was checked after large retained-view queries, conflating worker readiness with the parent heap consumed by those queries. The parent capacity guard is valid and remains unchanged.

Check real recovery immediately after the constrained analysis, then prove its old Evidence remains usable after a different analysis completes. Recovery must still succeed; additionally verify its exact input path and one successfully parsed source. Replace module-page/full-item reads with one existing javascript-facts query requesting identities/provenance only. Keep all 1,500 paths and source hashes, require one shared asset identity, 1,500 unique observation identities, empty unrequested properties and exhausted coverage. Share the duplicated recovery request in one helper. No runtime, heap, timeout, fixture-size, safety-guard or retry changes.

Executed validation

Node 24.22.1 / npm 11.16.0, Linux x64, two CPUs:

  • Final workflow: three fresh-process runs passed at the original 512 MiB parent / 128 MiB worker limits, and three more passed at a diagnostic 480 MiB parent limit. Original ordering at 480 MiB passed twice and reproduced the same capacity failure once; field selection alone also failed once, which is why ordering is part of this fix. All temporary pressure/instrumentation edits were restored.

  • Negative control: malformed recovery source makes the strengthened parsed-file assertions fail, instead of treating any non-error response as recovery. Fixture restored.

  • Rebased on latest 97194c4b: runtime build passed (30.25 s wall / 40.60 s family CPU / 1158.0 MiB sampled family RSS). Five resource/facts MCP tests passed, including actual stdio server/worker processes and retained/portable identity, paging and field selection (58.23 s / 68.99 s CPU / 2115.6 MiB).

  • Final latest-base npm run check and git diff --check passed (23.66 s wall / 44.11 s CPU / 2732.4 MiB).

Latest-main compatibility was additionally checked on local rebased tree 5f2e5fcc over 12f6e097 (including the new shared partial-Evidence delivery). The published 4ce733b6 patch is unchanged (git range-diff reports equality), so its current CI/review remains pinned to that published head. Runtime build and static checks passed (25.99 s / 34.29 s CPU / 1120.3 MiB; 37.74 s / 70.57 s CPU / 2681.4 MiB). The four-file combination had 22 passed and one unchanged facts/schema case hit its 30 s timeout. Testing that complete facts file in isolation then passed both cases (36.10 s / 40.83 s CPU / 2221.0 MiB; slow case 20.19 s). The combined timeout is retained as a failed attempt, not reported green; all recovery/delivery cases passed. No timeout was raised.

Matched timeout tasks, three fresh-process runs each on pinned 422ca5a8, OS caches uncontrolled:

Metric Original Final workflow
tools/call requests 5 4
Re-encoded tools/call result bytes 4,101,046 3,259,279
Median whole-task wall / CPU 14.870 / 18.358 s 15.319 / 19.141 s
Maximum sampled family RSS 889.2 MiB 897.9 MiB

The roughly 20.5% byte reduction counts text and structured results; initialization/catalog/ping bytes and agent tokens were not measured. This is not a latency or peak-memory improvement claim. Each process has a fresh module graph; isolated warm-process costs were not measured. RSS sampling sums descendants around every 100 ms and can double-count shared pages or miss brief/reparented children; it is not a hard aggregate cap. Tests/build had a 3 GiB sampled stop; static checks an 8 GiB stop. No host OOM occurred. These are authored inert fixtures using real CLI/MCP analysis, not new real-provider claims.

Published head 4ce733b6 passed complete selected CI: 32,665 tests passed, zero failed, 233 skipped, all eight built shards and source/static/build/final gates passed. Codex and Greptile reviewed that exact head without actionable findings.

Author readiness

Human owner: @gensokyo-dev

The owner explicitly delegated readiness declarations and agent-managed review. Inspection and execution were performed by Codex; no separate human inspection is claimed.

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/7029 **Author:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Created:** 10/24/2026 **Status:** ✅ Merged **Merged:** 10/24/2026 **Merged by:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Base:** `main` ← **Head:** `test/mcp-resource-recovery-20261024` --- ### 📝 Commits (1) - [`4ce733b`](https://github.com/morluto/rea/commit/4ce733b64fb8d6539600110ac9948bd33dcf8037) test(mcp): verify recovery before reading retained views ### 📊 Changes **1 file changed** (+88 additions, -65 deletions) <details> <summary>View changed files</summary> 📝 `tests/boundary/mcp/javascriptAnalysisResources.test.ts` (+88 -65) </details> ### 📄 Description ## Problem and outcome [Main push CI](https://github.com/morluto/rea/actions/runs/40113118793/job/120929004367) intermittently rejects the resource test's recovery request with `parent_result_budget_exhausted`. Worker recovery was checked after large retained-view queries, conflating worker readiness with the parent heap consumed by those queries. The parent capacity guard is valid and remains unchanged. Check real recovery immediately after the constrained analysis, then prove its old Evidence remains usable after a different analysis completes. Recovery must still succeed; additionally verify its exact input path and one successfully parsed source. Replace module-page/full-item reads with one existing `javascript-facts` query requesting identities/provenance only. Keep all 1,500 paths and source hashes, require one shared asset identity, 1,500 unique observation identities, empty unrequested properties and exhausted coverage. Share the duplicated recovery request in one helper. No runtime, heap, timeout, fixture-size, safety-guard or retry changes. ## Executed validation Node 24.22.1 / npm 11.16.0, Linux x64, two CPUs: - Final workflow: three fresh-process runs passed at the original **512 MiB parent / 128 MiB worker** limits, and three more passed at a diagnostic **480 MiB parent** limit. Original ordering at 480 MiB passed twice and reproduced the same capacity failure once; field selection alone also failed once, which is why ordering is part of this fix. All temporary pressure/instrumentation edits were restored. - Negative control: malformed recovery source makes the strengthened parsed-file assertions fail, instead of treating any non-error response as recovery. Fixture restored. - Rebased on latest `97194c4b`: runtime build passed (30.25 s wall / 40.60 s family CPU / 1158.0 MiB sampled family RSS). **Five resource/facts MCP tests passed**, including actual stdio server/worker processes and retained/portable identity, paging and field selection (58.23 s / 68.99 s CPU / 2115.6 MiB). - Final latest-base `npm run check` and `git diff --check` passed (23.66 s wall / 44.11 s CPU / 2732.4 MiB). Latest-main compatibility was additionally checked on local rebased tree `5f2e5fcc` over `12f6e097` (including the new shared partial-Evidence delivery). The published `4ce733b6` patch is unchanged (`git range-diff` reports equality), so its current CI/review remains pinned to that published head. Runtime build and static checks passed (25.99 s / 34.29 s CPU / 1120.3 MiB; 37.74 s / 70.57 s CPU / 2681.4 MiB). The four-file combination had 22 passed and one unchanged facts/schema case hit its 30 s timeout. Testing that complete facts file in isolation then passed both cases (36.10 s / 40.83 s CPU / 2221.0 MiB; slow case 20.19 s). The combined timeout is retained as a failed attempt, not reported green; all recovery/delivery cases passed. No timeout was raised. Matched timeout tasks, three fresh-process runs each on pinned `422ca5a8`, OS caches uncontrolled: | Metric | Original | Final workflow | | --- | ---: | ---: | | tools/call requests | 5 | 4 | | Re-encoded tools/call result bytes | 4,101,046 | 3,259,279 | | Median whole-task wall / CPU | 14.870 / 18.358 s | 15.319 / 19.141 s | | Maximum sampled family RSS | 889.2 MiB | 897.9 MiB | The roughly 20.5% byte reduction counts text and structured results; initialization/catalog/ping bytes and agent tokens were not measured. This is not a latency or peak-memory improvement claim. Each process has a fresh module graph; isolated warm-process costs were not measured. RSS sampling sums descendants around every 100 ms and can double-count shared pages or miss brief/reparented children; it is not a hard aggregate cap. Tests/build had a 3 GiB sampled stop; static checks an 8 GiB stop. No host OOM occurred. These are authored inert fixtures using real CLI/MCP analysis, not new real-provider claims. Published head `4ce733b6` passed [complete selected CI](https://github.com/morluto/rea/actions/runs/40116838147): **32,665 tests passed, zero failed, 233 skipped**, all eight built shards and source/static/build/final gates passed. Codex and Greptile reviewed that exact head without actionable findings. ## Author readiness Human owner: @gensokyo-dev The owner explicitly delegated readiness declarations and agent-managed review. Inspection and execution were performed by Codex; no separate human inspection is claimed. - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 13:38:54 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#7587
No description provided.