[PR #7048] [MERGED] test(firmware): keep producer fixtures within supported Node limits #7603

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/7048
Author: @Plastic-time
Created: 10/24/2026
Status: ✅ Merged
Merged: 10/28/2026
Merged by: @morluto

Base: main ← Head: codex/fix-firmware-fixture-node-compat-20261024


📝 Commits (2)

  • da9e3cd test(firmware): bound fixture hashing and avoid Node startup warnings
  • 15c9c97 test(firmware): apply the Wasm flag only on Node 22

📊 Changes

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

View changed files

📝 tests/fixtures/firmware/producer.mjs (+19 -3)
📝 tests/fixtures/firmware/provider.ts (+3 -0)

📄 Description

Summary

Keep the synthetic firmware producers reliable on the supported Node 22/24/26 lines without changing production resource limits or weakening test assertions.

Related to #5672: these failures were found while rerunning its cancellation fix after @CassieFox23 requested fresh verification. The recorded findings reproduced on unchanged upstream. This PR is independently based on 238914974; #5672 is the discovery context, not a dependency.

Problem and expected behavior

  • Node 22.23.4 prepends a V8 flag-conflict warning when the fixture starts with --jitless, breaking the two exact missing-report stderr assertions.
  • Node 26.12.1 intermittently aborts the oversized-child producer with Worklist::Segment::Create out-of-memory under the existing 1 GiB address-space limit, before the intended publication/continuation assertions run.

The synthetic producer should finish within the real limiter and emit its intended diagnostics.

Change and scope

  • Pass --no-expose-wasm only on Node 22, where it prevents the startup warning. Newer tested versions do not accept this option.
  • Hash the actual oversized file with one reusable 64 KiB buffer and a file handle closed in finally, reducing chunk-allocation pressure.
  • Preserve the 128 MiB + 1 byte child, actual digest, existing assertions, and production limits. Only two fixture files change.

Contribution scope: not applicable — ordinary test-fixture maintenance within the existing boundary.

Contract and boundary impact

  • Owner: synthetic firmware producer launch and report generation.
  • CLI/MCP, provider contracts, evidence semantics, generated metadata and package behavior: unchanged.
  • Test effects: launch the existing synthetic Node processes; read and write disposable fixture files. No real firmware engine or target execution, new network access, or containment relaxation.

Evidence and regression coverage

Linux matrix, exact candidate 15c9c975:

Node Six existing boundary/MCP files
22.23.4 66 passed
24.22.1 66 passed
26.12.1 66 passed

Unchanged 238914974 reproduces the two Node 22 failures. The Node 26 failure is intermittent: its suite passed in this matrix, but two of three standalone producer repeats aborted; the earlier baseline suite also failed the oversized-child case.

A same-runner Node 26 comparison then ran each revision 20 times under the unchanged 1 GiB limit: baseline 14 aborts/20, candidate 0/20. Every successful output was independently checked with Python for size 134,217,729 and SHA-256 matching its report. This is a bounded sample, not a failure-rate estimate.

For completed standalone Node 26 runs on that runner, peak RSS was 64,824–65,036 KiB on baseline versus 49,852–50,272 KiB on the candidate; elapsed time was 0.12–0.13 s versus 0.14–0.15 s, and user+system CPU was 0.15–0.16 s versus 0.13–0.14 s. These are /usr/bin/time -v producer-process measurements, not full extraction benchmarks or cold/warm cache comparisons. Agent-token costs were not measured.

Validation performed

  • npm run test:focused -- the five firmware boundary files plus tests/boundary/mcp/firmwareMcp.test.ts — 66 passed on each Node version.
  • npm run check on Node 24/Linux — passed, including typecheck, built lint, formatting, knip, metadata and architecture guards; lint reported 0 errors and 2744 warnings.
  • git diff --check — passed.

Compatibility, safety, and release

No production or release changes. The temporary verification workflows stay on separate fork branches. Real Unblob/Binwalk and other operating systems were not exercised by this change; the MCP test uses the synthetic producer. Full-suite coverage remains with upstream CI.

Author readiness

Human owner: @Plastic-time

  • 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.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 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/7048 **Author:** [@Plastic-time](https://github.com/Plastic-time) **Created:** 10/24/2026 **Status:** ✅ Merged **Merged:** 10/28/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `codex/fix-firmware-fixture-node-compat-20261024` --- ### 📝 Commits (2) - [`da9e3cd`](https://github.com/morluto/rea/commit/da9e3cda08bedccad0007c77ab572702376cd472) test(firmware): bound fixture hashing and avoid Node startup warnings - [`15c9c97`](https://github.com/morluto/rea/commit/15c9c975f04b7ebe55ea8caf4b8214fd017b21c5) test(firmware): apply the Wasm flag only on Node 22 ### 📊 Changes **2 files changed** (+22 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `tests/fixtures/firmware/producer.mjs` (+19 -3) 📝 `tests/fixtures/firmware/provider.ts` (+3 -0) </details> ### 📄 Description ## Summary Keep the synthetic firmware producers reliable on the supported Node 22/24/26 lines without changing production resource limits or weakening test assertions. Related to #5672: these failures were found while rerunning its cancellation fix after @CassieFox23 requested fresh verification. The [recorded findings](https://github.com/morluto/rea/pull/5672#issuecomment-6390314319) reproduced on unchanged upstream. This PR is independently based on `238914974`; #5672 is the discovery context, not a dependency. ## Problem and expected behavior - Node 22.23.4 prepends a V8 flag-conflict warning when the fixture starts with `--jitless`, breaking the two exact missing-report stderr assertions. - Node 26.12.1 intermittently aborts the oversized-child producer with `Worklist::Segment::Create` out-of-memory under the existing 1 GiB address-space limit, before the intended publication/continuation assertions run. The synthetic producer should finish within the real limiter and emit its intended diagnostics. ## Change and scope - Pass `--no-expose-wasm` only on Node 22, where it prevents the startup warning. Newer tested versions do not accept this option. - Hash the actual oversized file with one reusable 64 KiB buffer and a file handle closed in `finally`, reducing chunk-allocation pressure. - Preserve the 128 MiB + 1 byte child, actual digest, existing assertions, and production limits. Only two fixture files change. Contribution scope: not applicable — ordinary test-fixture maintenance within the existing boundary. ## Contract and boundary impact - Owner: synthetic firmware producer launch and report generation. - CLI/MCP, provider contracts, evidence semantics, generated metadata and package behavior: unchanged. - Test effects: launch the existing synthetic Node processes; read and write disposable fixture files. No real firmware engine or target execution, new network access, or containment relaxation. ## Evidence and regression coverage [Linux matrix](https://github.com/Plastic-time/rea/actions/runs/40139521896), exact candidate `15c9c975`: | Node | Six existing boundary/MCP files | | --- | --- | | 22.23.4 | 66 passed | | 24.22.1 | 66 passed | | 26.12.1 | 66 passed | Unchanged `238914974` reproduces the two Node 22 failures. The Node 26 failure is intermittent: its suite passed in this matrix, but two of three standalone producer repeats aborted; the [earlier baseline suite](https://github.com/Plastic-time/rea/actions/runs/40139359203/job/121007608422) also failed the oversized-child case. A [same-runner Node 26 comparison](https://github.com/Plastic-time/rea/actions/runs/40139666282) then ran each revision 20 times under the unchanged 1 GiB limit: baseline **14 aborts/20**, candidate **0/20**. Every successful output was independently checked with Python for size 134,217,729 and SHA-256 matching its report. This is a bounded sample, not a failure-rate estimate. For completed standalone Node 26 runs on that runner, peak RSS was 64,824–65,036 KiB on baseline versus 49,852–50,272 KiB on the candidate; elapsed time was 0.12–0.13 s versus 0.14–0.15 s, and user+system CPU was 0.15–0.16 s versus 0.13–0.14 s. These are `/usr/bin/time -v` producer-process measurements, not full extraction benchmarks or cold/warm cache comparisons. Agent-token costs were not measured. ## Validation performed - `npm run test:focused --` the five firmware boundary files plus `tests/boundary/mcp/firmwareMcp.test.ts` — 66 passed on each Node version. - `npm run check` on Node 24/Linux — passed, including typecheck, built lint, formatting, knip, metadata and architecture guards; lint reported 0 errors and 2744 warnings. - `git diff --check` — passed. ## Compatibility, safety, and release No production or release changes. The temporary verification workflows stay on separate fork branches. Real Unblob/Binwalk and other operating systems were not exercised by this change; the MCP test uses the synthetic producer. Full-suite coverage remains with upstream CI. ## Author readiness Human owner: @Plastic-time - [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. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 13:39:03 +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#7603
No description provided.