[PR #6941] [MERGED] fix(test): reserve heap headroom for shared CLI workers #7460

Closed
opened 2026-11-01 21:48:01 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: fix/shared-cli-worker-headroom


📝 Commits (1)

  • 2b2f93c fix(test): reserve heap headroom for shared CLI workers

📊 Changes

3 files changed (+19 additions, -22 deletions)

View changed files

📝 docs/testing.md (+9 -8)
📝 tests/boundary/filesystem/ciTestProjects.test.ts (+6 -10)
📝 vitest.config.ts (+4 -4)

📄 Description

Problem and outcome

Main CI at 2968d1e9 lost a reused CLI worker while running pcapCli.test.ts: V8 reported heap-limit exhaustion at the ordinary 384 MiB limit. Its final collections retained 342–376 MiB before further command/schema allocations. The same 384 MiB policy remained on the inspected main revisions.

Use the existing coverage capacity of 512 MiB old space for ordinary CLI workers too. Concurrency stays bounded at two; coverage instrumentation, thresholds, deadlines and fresh spawned REA processes keep their existing policies. Remove the obsolete coverage-dependent heap branch and repeated heap expectations, while retaining every flag/shard assertion. Update the testing guide. This directly repairs observed CI exhaustion; no separate issue was opened.

Executed validation

Rebased onto main@2bd981b01 before final checks; Node 24.22.1 / npm 11.16.0, Linux x64:

  • npm run test:focused -- tests/boundary/cli/pcapCli.test.ts tests/boundary/filesystem/ciTestProjects.test.ts — 19 passed after rebase. Earlier serial warm-graph control (strict positionals → aliases → symlink caller paths → inventory → pcap): 14 passed without diagnostic GC.
  • Real TShark/capinfos 4.0.17, node scripts/verify-pcap.mjs --pcap PATH — CLI/MCP named-schema and Evidence parity passed on a synthesized offline DNS capture: one packet, two addresses, complete coverage; input hash unchanged.
  • npm run check, npm run docs:check, git diff --check — passed after rebase. Documentation checks include nine README conformance cases.

Completed-run costs (two CPUs; warm build cache, fresh workers):

Workload Wall / CPU seconds Peak sampled family RSS
Final focused 19 cases incl. preparation 33.43 / 51.91 1414.9 MiB
Final real pcap CLI/MCP task 12.50 / 14.71 1258.3 MiB
Final npm run check 20.99 / 39.31 2700.3 MiB
Final npm run docs:check 14.30 / 17.80 771.2 MiB

RSS sums descendants at 100 ms intervals; shared pages may double-count and short-lived/reparented children may be missed. Runs had elapsed limits and an 8 GiB sampled stop. The normal-worker allowance increases by 128 MiB per worker; this is a capacity repair, with no measured suite speedup or agent-token claim.

Limits: a full local CLI-project attempt hit its declared 420 s bound and is not a full-suite pass. It showed no worker OOM; two artifact-view cases hit their unchanged 30 s deadlines. Those two pass in isolation on clean main@e2463372e (29.3 / 20.3 s), so broad-run timing attribution remains unresolved. Diagnostic GC probes are kept separate from normal-run measurements. No timeout, assertion or retry was relaxed. Real engine evidence here covers only the installed packet tools; no real IDA/Ghidra/Apple-host verification is claimed locally.

Current-head CI

CI for 2b2f93ccf passed source tests, static checks, docs and runtime/native-control preparation. Codex review completed with no findings. Readiness initially failed because the Actions installation had zero REST quota; one retry after its advertised reset passed.

The completed failing shard has one Kuna held-output timing failure: 16566 ms exceeds a 16000 ms assertion that starts before CLI startup, despite the test already waiting for a probe-readiness marker. On clean exact base 7f70797b9, with the original 384 MiB policy and a controlled 7 s delay applied only to CLI startup, the same assertion fails at 16387 ms. The existing 20 s command guard was retained. This establishes an independent test-clock boundary problem; it will be handled separately, rather than mixed into this heap-policy change. No worker OOM was reported in the available results. PR fail-fast cancelled the other seven shards, so this is not green/full CI coverage. Apple verification was skipped and is not claimed. The owner explicitly authorized proceeding past demonstrated independent failures.

Post-merge integration

After the following independent clock repair #6944, clean merged main f9fabdfcb passed the combined five relevant files / 29 tests, static checks, and real tshark/capinfos CLI/MCP schema and Evidence-parity verification. #6944 validation records the measured resource costs and remaining independently reproduced source-suite failures. All eight built CI shards passed there; the overall CI gate remains red for those two baseline Apple metadata assertions.

Author readiness

Human owner: @gensokyo-dev

The owner explicitly delegated readiness declarations and agent-managed review. Code inspection and command execution above 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/6941 **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:** `fix/shared-cli-worker-headroom` --- ### 📝 Commits (1) - [`2b2f93c`](https://github.com/morluto/rea/commit/2b2f93ccf37e32d67048aa3fb0a84453fd8cf224) fix(test): reserve heap headroom for shared CLI workers ### 📊 Changes **3 files changed** (+19 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `docs/testing.md` (+9 -8) 📝 `tests/boundary/filesystem/ciTestProjects.test.ts` (+6 -10) 📝 `vitest.config.ts` (+4 -4) </details> ### 📄 Description ## Problem and outcome [Main CI at `2968d1e9`](https://github.com/morluto/rea/actions/runs/40052233413/job/120747754249) lost a reused CLI worker while running `pcapCli.test.ts`: V8 reported heap-limit exhaustion at the ordinary 384 MiB limit. Its final collections retained 342–376 MiB before further command/schema allocations. The same 384 MiB policy remained on the inspected main revisions. Use the existing coverage capacity of **512 MiB old space for ordinary CLI workers too**. Concurrency stays bounded at two; coverage instrumentation, thresholds, deadlines and fresh spawned REA processes keep their existing policies. Remove the obsolete coverage-dependent heap branch and repeated heap expectations, while retaining every flag/shard assertion. Update the testing guide. This directly repairs observed CI exhaustion; no separate issue was opened. ## Executed validation Rebased onto `main@2bd981b01` before final checks; Node 24.22.1 / npm 11.16.0, Linux x64: - `npm run test:focused -- tests/boundary/cli/pcapCli.test.ts tests/boundary/filesystem/ciTestProjects.test.ts` — **19 passed** after rebase. Earlier serial warm-graph control (strict positionals → aliases → symlink caller paths → inventory → pcap): **14 passed** without diagnostic GC. - Real TShark/capinfos **4.0.17**, `node scripts/verify-pcap.mjs --pcap PATH` — CLI/MCP named-schema and Evidence parity passed on a synthesized offline DNS capture: one packet, two addresses, complete coverage; input hash unchanged. - `npm run check`, `npm run docs:check`, `git diff --check` — passed after rebase. Documentation checks include nine README conformance cases. Completed-run costs (two CPUs; warm build cache, fresh workers): | Workload | Wall / CPU seconds | Peak sampled family RSS | | --- | ---: | ---: | | Final focused 19 cases incl. preparation | 33.43 / 51.91 | 1414.9 MiB | | Final real pcap CLI/MCP task | 12.50 / 14.71 | 1258.3 MiB | | Final `npm run check` | 20.99 / 39.31 | 2700.3 MiB | | Final `npm run docs:check` | 14.30 / 17.80 | 771.2 MiB | RSS sums descendants at 100 ms intervals; shared pages may double-count and short-lived/reparented children may be missed. Runs had elapsed limits and an 8 GiB sampled stop. The normal-worker allowance increases by 128 MiB per worker; this is a capacity repair, with no measured suite speedup or agent-token claim. Limits: a full local CLI-project attempt hit its declared 420 s bound and is **not a full-suite pass**. It showed no worker OOM; two artifact-view cases hit their unchanged 30 s deadlines. Those two pass in isolation on clean `main@e2463372e` (29.3 / 20.3 s), so broad-run timing attribution remains unresolved. Diagnostic GC probes are kept separate from normal-run measurements. No timeout, assertion or retry was relaxed. Real engine evidence here covers only the installed packet tools; no real IDA/Ghidra/Apple-host verification is claimed locally. ## Current-head CI [CI for `2b2f93ccf`](https://github.com/morluto/rea/actions/runs/40056596476) passed source tests, static checks, docs and runtime/native-control preparation. Codex review completed with no findings. Readiness initially failed because the Actions installation had zero REST quota; one retry after its advertised reset passed. The completed failing shard has one Kuna held-output timing failure: 16566 ms exceeds a 16000 ms assertion that starts **before CLI startup**, despite the test already waiting for a probe-readiness marker. On clean exact base `7f70797b9`, with the original 384 MiB policy and a controlled 7 s delay applied only to CLI startup, the same assertion fails at 16387 ms. The existing 20 s command guard was retained. This establishes an independent test-clock boundary problem; it will be handled separately, rather than mixed into this heap-policy change. No worker OOM was reported in the available results. PR fail-fast cancelled the other seven shards, so this is **not green/full CI coverage**. Apple verification was skipped and is not claimed. The owner explicitly authorized proceeding past demonstrated independent failures. ## Post-merge integration After the following independent clock repair [#6944](https://github.com/morluto/rea/pull/6944), clean merged main `f9fabdfcb` passed the combined five relevant files / **29 tests**, static checks, and real tshark/capinfos CLI/MCP schema and Evidence-parity verification. [#6944 validation](https://github.com/morluto/rea/pull/6944) records the measured resource costs and remaining independently reproduced source-suite failures. All eight built CI shards passed there; the overall CI gate remains red for those two baseline Apple metadata assertions. ## Author readiness Human owner: @gensokyo-dev The owner explicitly delegated readiness declarations and agent-managed review. Code inspection and command execution above 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-01 21:48:01 +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#7460
No description provided.