[PR #3899] feat(doctor): diagnose firmware integration readiness #5958

Open
opened 2026-10-31 01:10:44 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3899
Author: @jsk1004ha
Created: 10/15/2026
Status: 🔄 Open

Base: main ← Head: feat/firmware-doctor-3758


📝 Commits (10+)

  • c747c58 feat(doctor): diagnose firmware integration readiness
  • 960fb59 fix(doctor): merge main and preserve Kuna diagnostics
  • 957b570 chore: merge current main into firmware doctor branch
  • 6951d3d chore: sync firmware doctor PR with upstream main
  • dd955d0 fix(doctor): preserve firmware diagnostics through upstream lifecycle changes
  • a802ee5 fix(doctor): gate provider probes and preserve path cancellation
  • b9ad9ca fix(doctor): recognize renamed util-linux prlimit binaries
  • fb62071 chore(doctor): merge upstream main and retain firmware readiness guidance
  • 1b04fab fix(doctor): preserve probe failures and bound process diagnostics
  • d3e61fb fix(process): separate host inventory output budget

📊 Changes

20 files changed (+2924 additions, -108 deletions)

View changed files

📝 docs/firmware-analysis.md (+26 -4)
📝 docs/installation.md (+19 -0)
📝 src/application/Doctor.lifecycle.test.ts (+340 -4)
📝 src/application/Doctor.ts (+75 -22)
📝 src/application/DoctorProviderIds.ts (+3 -1)
📝 src/application/SetupRegistrationEnvironment.ts (+1 -0)
📝 src/cli/setupCommands.ts (+6 -2)
📝 src/config/environment.ts (+2 -0)
➕ src/config/processTableOutputBudget.test.ts (+64 -0)
➕ src/config/processTableOutputBudget.ts (+39 -0)
📝 src/doctorRuntime.test.ts (+116 -0)
📝 src/doctorRuntime.ts (+68 -23)
📝 src/firmware/FirmwareCommand.test.ts (+46 -1)
📝 src/firmware/FirmwareCommand.ts (+23 -45)
➕ src/firmware/FirmwareConfiguration.ts (+45 -0)
➕ src/firmware/FirmwareDoctor.test.ts (+1202 -0)
➕ src/firmware/FirmwareDoctor.ts (+595 -0)
➕ src/process/ProcessOwnership.outputLimit.test.ts (+198 -0)
📝 src/process/ProcessOwnershipObservation.ts (+51 -6)
📝 src/setupEnvironment.test.ts (+5 -0)

📄 Description

Summary

Fixes #3758. Add firmware integration readiness to rea doctor, including
--provider binwalk and --provider unblob. A selected firmware integration
can be assessed independently of absent Hopper/Ghidra/IDA/JADX installations.

Problem and expected behavior

Doctor previously omitted the firmware adapters entirely. It now reports Linux
support, caller-supplied executable paths, procps-compatible ps, util-linux
prlimit, supported versus verified release versions, and Unblob's external
extractor inventory. Unknown or inconsistent dependency output remains unknown.
Missing extractors make readiness unhealthy while preserving that selected
formats may still extract with partial coverage.

Change and scope

The firmware adapter owns the diagnostics. Executable-path validation is shared
with analysis rather than duplicated, and release admission reuses the existing
firmware version policy. Probes use bounded owned-command supervision; incomplete
cleanup is retained, prevents further launches, and is retried during host close.
Setup explicitly omits these diagnostics from its engine selection, preserving
its existing installation and registration behavior.

Only #3758 is addressed. The prerequisite-description work in #3757 / #3761 is
not included. No firmware target is opened or extracted by doctor.

Contract and boundary impact

  • Semantic owner and earliest changed stage: FirmwareDoctor, shared firmware executable validation, and outer doctor composition.
  • Contribution scope: routine diagnostics for existing adapters; no new provider or target authority. No advance scope decision claimed.
  • CLI/MCP: additive doctor provider selectors and diagnostic rows; firmware analysis schemas and MCP operations are unchanged.
  • Compatibility: Linux firmware diagnostics; other hosts receive unsupported-host results. Compatible patch versions retain an explicit unverified limitation.
  • Evidence and target boundaries: no target selection or analysis Evidence changes; no target execution, extraction, network access, dependency installation or registration writes.
  • Generated metadata/package impact: no generated files, version changes or dependency changes committed.

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

The launched processes are caller-supplied diagnostic tools and host prerequisite
probes, not firmware targets. These checks are not an aggregate containment claim.

Evidence and regression coverage

The firmware-doctor cases cover invalid/missing executable paths, host
support, optional integrations, scoped readiness, compatible/unsupported/unknown
versions, dependency exit 1, malformed/duplicate/inconsistent reports, missing
ps, invalid limiter, timeout/output/process errors, cleanup retention/retry, and doctor cancellation.
Version, dependency and supervision observations in positive tests use a recording
host; these are not real Binwalk/Unblob verification. Path checks use real files.
Existing doctor/runtime/setup tests also pass, including a regression that setup
does not include firmware diagnostics in its engine selection.

Executed CLI doctor --provider binwalk --json and
doctor --provider unblob --json both publish the selected firmware checks and
keep absent native engines informational. Both are unhealthy in this environment:
the firmware tools are unconfigured and Node-launched procps fails with
fatal library error, lookup self. This is reported, not hidden as readiness.

Validation performed

Final checks used Node 24.18.0 and npm 11.16.0 as pinned by this checkout:

  • npm run test:local -- src/firmware/FirmwareDoctor.test.ts src/firmware/FirmwareCommand.test.ts src/firmware/FirmwareVersion.test.ts src/doctorRuntime.test.ts src/application/Doctor.test.ts src/setupEnvironment.test.ts — 84 passed across six files.
  • npm run check — passed, including typechecking, formatting, lint, Knip, metadata and architecture guards; existing nonblocking lint/bundler warnings remain.
  • npm run docs:check — passed, including five README consistency tests.
  • npm run verify:test-discovery — passed, all 1,319 tests discovered exactly once.
  • git diff --check — passed.

npm run verify:firmware was not run: actual Binwalk/Unblob are not installed,
and this runner cannot establish Linux owned-process inspection from Node.
No successful real-engine, macOS, Windows, or firmware-extraction coverage is
claimed. Token usage, CPU, peak process-family memory and cold/warm performance
comparisons were not measured; no performance improvement is claimed.

Compatibility, safety, and release

No breaking input changes or migrations. Firmware tool probes have a five-second
deadline and 64 KiB retained-output budget. The whole-host process table has a
separate configurable byte allowance, documented in the latest follow-up below. Engine probes additionally use the
existing firmware address-space limit, zero regular-file/core output limit, and
five CPU seconds through the selected limiter. No binaries or generated outputs
are committed. Readiness does not guarantee analysis of a particular target.

Author readiness

Human owner: @jsk1004ha

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

Main synchronization

  • Merged upstream main at 23f984b1a884baefc3c44e4ab697f6eff61dffb6 in 957b5700dae6bd0b43c6414b8f8c7cc18dbe84a5, preserving doctor cancellation and FirmwareFileAccess.hash changes while retaining firmware readiness diagnostics.
  • Merged upstream main at b0b485abff802b79d238dd24a9fa4abd0713d3ee in 6951d3d83c91178c4e8f9a3b06770b3f34c7f528. This retains the newly introduced Hopper embedded Python runtime diagnostics, existing Hopper tests, firmware readiness wiring and setup exclusions.

GitHub reports no merge conflicts at the second merge commit. The local validation reported above applies to the earlier fc712b375 tree; the current merged tree has not had full local validation. GitHub's new CI and PR-title workflow runs report action_required and did not execute test jobs; passing validation on the merged tree is not claimed.

Review fixes and validation — 2026-10-27

Synchronized with upstream 6749bd090, resolved the doctor/firmware conflicts, preserved invocation identity and shared lifecycle cancellation, and fixed a retained-cleanup self-wait. Unconfigured optional engines no longer cause unnecessary host probes.

  • Doctor/firmware/setup regressions: 177 passed, 1 pre-existing skip on the feature-final tree before four nonoverlapping upstream commits.
  • Final synchronized tree: npm run check:fast and formatting passed.
  • Documentation checks: 9 README tests passed; compiled Binwalk/Unblob smoke checks correctly report unconfigured tools.
  • Real Binwalk/Unblob execution and the complete repository test suite were not run locally. Fresh upstream CI currently requires workflow approval.

Existing human declarations above are preserved.

Follow-up review fixes

Published a802ee59514d8a240214f3f2502038887b28a857 after validating the fresh review findings:

  • Provider inspection groups now finish their active scope before the next group is admitted. Earlier retained cleanup must succeed before firmware probes can start; failed cleanup preserves a typed error and its exact resource owner, without a nested self-wait.
  • Cancellation during limiter or engine path admission now reaches the doctor boundary as AnalysisCancelledError with the caller's original reason.
  • Removed the older documentation statement that firmware readiness is unsupported.

The focused runtime, firmware doctor, doctor lifecycle, and setup suite passed 64/64 tests. The final tree also passes npm run check:fast, formatting, and staged diff checks. The three corresponding review threads are resolved; full upstream CI still depends on workflow approval.

Review follow-up — 2026-10-29

Fixed the renamed util-linux limiter false negative identified in the latest review (commit b9ad9caa65e9affc16245743c12163699ebca3f7). util-linux derives the program name in its --version banner from the invocation name, so FirmwareDoctor now accepts a name-independent from util-linux <version> prefix while still requiring exit 0. The configured absolute invocation path is preserved. A regression covers a differently named limiter and verifies that both Binwalk and Unblob readiness probes proceed; the existing non-util-linux refusal test remains.

Validation: npm run test:local -- src/firmware/FirmwareDoctor.test.ts src/firmware/FirmwareCommand.test.ts src/doctorRuntime.test.ts — 70/70 passed on Linux with Node 24.22.1; npm run check:fast passed (typecheck and lint); npx oxfmt and git diff --check passed. A direct exec -a check against system util-linux 2.39.3 reproduced the changed banner. The complete suite and actual Binwalk/Unblob execution were not run for this follow-up.

Review follow-up — 2026-10-31

Addressed the three outstanding Greptile threads in 1b04fabfd9918b0d89f5212ee40def45c34f6023.

  • Failure/cancellation precedence: firmware diagnostics consume the command owner's recorded reason and captured output. The first physical failure stays primary when cancellation arrives during cleanup or a later path admission; genuine cancellation keeps the caller's recorded reason and output. Later physical probe failures are retained separately. Progress is local to each inspection, and ordinary failed diagnostics still allow peer inspection.
  • Bounded process inspection: the shared process-table reader captures at most 65,536 bytes of stdout and 65,536 bytes of stderr before decoding/parsing. Overflow rejects the incomplete table, remains unverifiable for cleanup, and becomes an unknown firmware prerequisite with structured limit details. No subsequent firmware command is launched.
  • Completed provider facts: provider-group failures retain completed checks, versions and group coverage in typed error diagnostics. Failed cleanup still blocks admission, retains its exact owner and can be retried without discarding earlier observations.
  • Doctor now uses the existing shared prlimitArgumentVector, preserving its 1 GiB address-space, zero file/core-output and five CPU-second ceilings and the selected invocation paths. This also removes the inline-limiter architecture-guard finding without changing the already-fixed renamed-limiter admission.

Final validation — Linux, Node 24.22.1, npm 11.16.0:

  • Related source tests: 311 passed, 1 pre-existing skip across 14 files. This includes FirmwareDoctor, FirmwareCommand, FirmwareVersion, process-table bounds, process ownership facts, OwnedCommand/preparation, ExecFileOutput/bounded output, Linux resource limits, Doctor/lifecycle, doctor runtime and setup.
  • Added 17 regression/control cases. Reverting the respective production fixes reproduced the original failures: nine firmware cases, four provider-result cases, and both process-table overflow cases failed while their original/small-table controls still passed.
  • npm run check:fast passed.
  • Changed-file typed lint passed: 6 files, 0 errors (26 nonblocking warnings).
  • Full format check, ordinary Knip, metadata validation and compilation passed during npm run check; changed-file formatting and git diff --check also passed after the final limiter cleanup.
  • npm run knip:production passed with advisory findings.
  • npm run verify:test-discovery passed: all 2,838 test files discovered exactly once.

Remaining validation limits: the full npm run check is not green. The final architecture-guard run still reports pre-existing backtick/NUL-key findings in src/application/GuidanceAccess.ts and src/domain/webCaptureDiff.ts; both files and the guard are unchanged from fb620711. Whole-project typed lint was terminated by SIGKILL at this runner's memory limit; the scoped typed check above completed successfully. These checks are not reported as full passes. Actual Binwalk/Unblob execution and the complete repository test suite were not run.

The new GitHub CI and PR title runs report action_required and await workflow approval; PR readiness reports success. No upstream CI pass or merge is claimed. Existing author-readiness declarations and draft state are preserved.

Busy-host regression and main synchronization — 2026-11-05

Addressed the process-table regression in d3e61fba, which also merges upstream main at 71f680d7c1aa7a45ba0325fe87b104744b0c105f.

  • The whole-host process inventory now has its own 8 MiB per stdout/stderr stream default. REA_PROCESS_TABLE_MAX_BYTES selects a positive decimal byte allowance up to Node's single-string limit. Firmware tool probes retain their separate 64 KiB budget.
  • Configuration is validated at CLI/MCP admission and lazily before process inspection; invalid settings do not become a misleading missing-procps error. Setup preserves explicit selections.
  • Overflow still rejects incomplete tables, preserves the actual selected limit and captured output, keeps cleanup unverifiable, and starts no firmware probe. Recovery explains how to change the setting and restart REA. This is a captured-byte bound, not a total-RSS guarantee.
  • Resolved both main conflicts while retaining JADX documentation, firmware executable-alias coverage, and upstream signal/lifecycle tests. Adapted the existing secondary-error projection callback to upstream's extended signature.

Verification: 477 tests passed and one pre-existing test was skipped across 17 related files. A valid 1,001-row table with REA's row beyond the former 64 KiB cutoff failed before the fix and now passes. Coverage also includes exact byte limits, multibyte stdout/stderr overflow, Linux/Darwin reader branches, invalid configuration, firmware refusal, and setup forwarding.

npm run check:fast, documentation checks (9 tests), test discovery (3,031 files exactly once), formatting and git diff --check pass. Full npm run check passed typecheck, lint, formatting, ordinary Knip, metadata, compilation, architecture guards and production reachability; its repository-wide typed lint was terminated by SIGKILL. A separate typed-lint run over all 18 PR-changed TypeScript files passed with zero errors and 34 warnings. The full check is therefore not claimed green.

Executed the compiled Binwalk-scoped doctor CLI with invalid and valid table settings: invalid input is reported as configuration drift; valid input is admitted while the absent firmware engine remains unconfigured. Actual Binwalk/Unblob, native macOS/Windows execution, the full test suite, and aggregate memory/performance measurements were not run. Toolchain: Node 24.22.1 and available npm 11.9.0; pinned npm 11.16.0 was unavailable in the offline cache.

GitHub confirms this head is mergeable. CI, CodeQL, and PR title require maintainer workflow approval. No upstream CI pass or PR merge is claimed. Existing author-readiness declarations and draft state are preserved.


🔄 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/3899 **Author:** [@jsk1004ha](https://github.com/jsk1004ha) **Created:** 10/15/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/firmware-doctor-3758` --- ### 📝 Commits (10+) - [`c747c58`](https://github.com/morluto/rea/commit/c747c58bae2586fe6a7bfc5cd4fd28daa9118c58) feat(doctor): diagnose firmware integration readiness - [`960fb59`](https://github.com/morluto/rea/commit/960fb59a8fd0980eb4cf7e0ac2ae1898ee1fefad) fix(doctor): merge main and preserve Kuna diagnostics - [`957b570`](https://github.com/morluto/rea/commit/957b5700dae6bd0b43c6414b8f8c7cc18dbe84a5) chore: merge current main into firmware doctor branch - [`6951d3d`](https://github.com/morluto/rea/commit/6951d3d83c91178c4e8f9a3b06770b3f34c7f528) chore: sync firmware doctor PR with upstream main - [`dd955d0`](https://github.com/morluto/rea/commit/dd955d0b3be69b123e6a87c7d06eb570306517ab) fix(doctor): preserve firmware diagnostics through upstream lifecycle changes - [`a802ee5`](https://github.com/morluto/rea/commit/a802ee59514d8a240214f3f2502038887b28a857) fix(doctor): gate provider probes and preserve path cancellation - [`b9ad9ca`](https://github.com/morluto/rea/commit/b9ad9caa65e9affc16245743c12163699ebca3f7) fix(doctor): recognize renamed util-linux prlimit binaries - [`fb62071`](https://github.com/morluto/rea/commit/fb620711f740413d9d8e77eb958113e0530a0403) chore(doctor): merge upstream main and retain firmware readiness guidance - [`1b04fab`](https://github.com/morluto/rea/commit/1b04fabfd9918b0d89f5212ee40def45c34f6023) fix(doctor): preserve probe failures and bound process diagnostics - [`d3e61fb`](https://github.com/morluto/rea/commit/d3e61fba934cf12eab9afeae942fd874df1368e8) fix(process): separate host inventory output budget ### 📊 Changes **20 files changed** (+2924 additions, -108 deletions) <details> <summary>View changed files</summary> 📝 `docs/firmware-analysis.md` (+26 -4) 📝 `docs/installation.md` (+19 -0) 📝 `src/application/Doctor.lifecycle.test.ts` (+340 -4) 📝 `src/application/Doctor.ts` (+75 -22) 📝 `src/application/DoctorProviderIds.ts` (+3 -1) 📝 `src/application/SetupRegistrationEnvironment.ts` (+1 -0) 📝 `src/cli/setupCommands.ts` (+6 -2) 📝 `src/config/environment.ts` (+2 -0) ➕ `src/config/processTableOutputBudget.test.ts` (+64 -0) ➕ `src/config/processTableOutputBudget.ts` (+39 -0) 📝 `src/doctorRuntime.test.ts` (+116 -0) 📝 `src/doctorRuntime.ts` (+68 -23) 📝 `src/firmware/FirmwareCommand.test.ts` (+46 -1) 📝 `src/firmware/FirmwareCommand.ts` (+23 -45) ➕ `src/firmware/FirmwareConfiguration.ts` (+45 -0) ➕ `src/firmware/FirmwareDoctor.test.ts` (+1202 -0) ➕ `src/firmware/FirmwareDoctor.ts` (+595 -0) ➕ `src/process/ProcessOwnership.outputLimit.test.ts` (+198 -0) 📝 `src/process/ProcessOwnershipObservation.ts` (+51 -6) 📝 `src/setupEnvironment.test.ts` (+5 -0) </details> ### 📄 Description ## Summary Fixes #3758. Add firmware integration readiness to `rea doctor`, including `--provider binwalk` and `--provider unblob`. A selected firmware integration can be assessed independently of absent Hopper/Ghidra/IDA/JADX installations. ## Problem and expected behavior Doctor previously omitted the firmware adapters entirely. It now reports Linux support, caller-supplied executable paths, procps-compatible `ps`, util-linux `prlimit`, supported versus verified release versions, and Unblob's external extractor inventory. Unknown or inconsistent dependency output remains unknown. Missing extractors make readiness unhealthy while preserving that selected formats may still extract with partial coverage. ## Change and scope The firmware adapter owns the diagnostics. Executable-path validation is shared with analysis rather than duplicated, and release admission reuses the existing firmware version policy. Probes use bounded owned-command supervision; incomplete cleanup is retained, prevents further launches, and is retried during host close. Setup explicitly omits these diagnostics from its engine selection, preserving its existing installation and registration behavior. Only #3758 is addressed. The prerequisite-description work in #3757 / #3761 is not included. No firmware target is opened or extracted by doctor. ## Contract and boundary impact - Semantic owner and earliest changed stage: `FirmwareDoctor`, shared firmware executable validation, and outer doctor composition. - Contribution scope: routine diagnostics for existing adapters; no new provider or target authority. No advance scope decision claimed. - CLI/MCP: additive doctor provider selectors and diagnostic rows; firmware analysis schemas and MCP operations are unchanged. - Compatibility: Linux firmware diagnostics; other hosts receive unsupported-host results. Compatible patch versions retain an explicit unverified limitation. - Evidence and target boundaries: no target selection or analysis Evidence changes; no target execution, extraction, network access, dependency installation or registration writes. - Generated metadata/package impact: no generated files, version changes or dependency changes committed. Expected effects: - [x] Read existing files or captured data. - [x] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. The launched processes are caller-supplied diagnostic tools and host prerequisite probes, not firmware targets. These checks are not an aggregate containment claim. ## Evidence and regression coverage The firmware-doctor cases cover invalid/missing executable paths, host support, optional integrations, scoped readiness, compatible/unsupported/unknown versions, dependency exit 1, malformed/duplicate/inconsistent reports, missing `ps`, invalid limiter, timeout/output/process errors, cleanup retention/retry, and doctor cancellation. Version, dependency and supervision observations in positive tests use a recording host; these are not real Binwalk/Unblob verification. Path checks use real files. Existing doctor/runtime/setup tests also pass, including a regression that setup does not include firmware diagnostics in its engine selection. Executed CLI `doctor --provider binwalk --json` and `doctor --provider unblob --json` both publish the selected firmware checks and keep absent native engines informational. Both are unhealthy in this environment: the firmware tools are unconfigured and Node-launched procps fails with `fatal library error, lookup self`. This is reported, not hidden as readiness. ## Validation performed Final checks used Node 24.18.0 and npm 11.16.0 as pinned by this checkout: - `npm run test:local -- src/firmware/FirmwareDoctor.test.ts src/firmware/FirmwareCommand.test.ts src/firmware/FirmwareVersion.test.ts src/doctorRuntime.test.ts src/application/Doctor.test.ts src/setupEnvironment.test.ts` — 84 passed across six files. - `npm run check` — passed, including typechecking, formatting, lint, Knip, metadata and architecture guards; existing nonblocking lint/bundler warnings remain. - `npm run docs:check` — passed, including five README consistency tests. - `npm run verify:test-discovery` — passed, all 1,319 tests discovered exactly once. - `git diff --check` — passed. `npm run verify:firmware` was not run: actual Binwalk/Unblob are not installed, and this runner cannot establish Linux owned-process inspection from Node. No successful real-engine, macOS, Windows, or firmware-extraction coverage is claimed. Token usage, CPU, peak process-family memory and cold/warm performance comparisons were not measured; no performance improvement is claimed. ## Compatibility, safety, and release No breaking input changes or migrations. Firmware tool probes have a five-second deadline and 64 KiB retained-output budget. The whole-host process table has a separate configurable byte allowance, documented in the latest follow-up below. Engine probes additionally use the existing firmware address-space limit, zero regular-file/core output limit, and five CPU seconds through the selected limiter. No binaries or generated outputs are committed. Readiness does not guarantee analysis of a particular target. ## Author readiness Human owner: @jsk1004ha - [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. ## Main synchronization - Merged upstream `main` at `23f984b1a884baefc3c44e4ab697f6eff61dffb6` in `957b5700dae6bd0b43c6414b8f8c7cc18dbe84a5`, preserving doctor cancellation and `FirmwareFileAccess.hash` changes while retaining firmware readiness diagnostics. - Merged upstream `main` at `b0b485abff802b79d238dd24a9fa4abd0713d3ee` in `6951d3d83c91178c4e8f9a3b06770b3f34c7f528`. This retains the newly introduced Hopper embedded Python runtime diagnostics, existing Hopper tests, firmware readiness wiring and setup exclusions. GitHub reports no merge conflicts at the second merge commit. The local validation reported above applies to the earlier `fc712b375` tree; the current merged tree has not had full local validation. GitHub's new CI and PR-title workflow runs report `action_required` and did not execute test jobs; passing validation on the merged tree is not claimed. ## Review fixes and validation — 2026-10-27 Synchronized with upstream `6749bd090`, resolved the doctor/firmware conflicts, preserved invocation identity and shared lifecycle cancellation, and fixed a retained-cleanup self-wait. Unconfigured optional engines no longer cause unnecessary host probes. - Doctor/firmware/setup regressions: 177 passed, 1 pre-existing skip on the feature-final tree before four nonoverlapping upstream commits. - Final synchronized tree: `npm run check:fast` and formatting passed. - Documentation checks: 9 README tests passed; compiled Binwalk/Unblob smoke checks correctly report unconfigured tools. - Real Binwalk/Unblob execution and the complete repository test suite were not run locally. Fresh upstream CI currently requires workflow approval. Existing human declarations above are preserved. ### Follow-up review fixes Published `a802ee59514d8a240214f3f2502038887b28a857` after validating the fresh review findings: - Provider inspection groups now finish their active scope before the next group is admitted. Earlier retained cleanup must succeed before firmware probes can start; failed cleanup preserves a typed error and its exact resource owner, without a nested self-wait. - Cancellation during limiter or engine path admission now reaches the doctor boundary as `AnalysisCancelledError` with the caller's original reason. - Removed the older documentation statement that firmware readiness is unsupported. The focused runtime, firmware doctor, doctor lifecycle, and setup suite passed **64/64 tests**. The final tree also passes `npm run check:fast`, formatting, and staged diff checks. The three corresponding review threads are resolved; full upstream CI still depends on workflow approval. ### Review follow-up — 2026-10-29 Fixed the renamed util-linux limiter false negative identified in the latest review (commit `b9ad9caa65e9affc16245743c12163699ebca3f7`). util-linux derives the program name in its `--version` banner from the invocation name, so `FirmwareDoctor` now accepts a name-independent `from util-linux <version>` prefix while still requiring exit 0. The configured absolute invocation path is preserved. A regression covers a differently named limiter and verifies that both Binwalk and Unblob readiness probes proceed; the existing non-util-linux refusal test remains. Validation: `npm run test:local -- src/firmware/FirmwareDoctor.test.ts src/firmware/FirmwareCommand.test.ts src/doctorRuntime.test.ts` — **70/70 passed** on Linux with Node 24.22.1; `npm run check:fast` passed (typecheck and lint); `npx oxfmt` and `git diff --check` passed. A direct `exec -a` check against system util-linux 2.39.3 reproduced the changed banner. The complete suite and actual Binwalk/Unblob execution were not run for this follow-up. ### Review follow-up — 2026-10-31 Addressed the three outstanding Greptile threads in [`1b04fabfd9918b0d89f5212ee40def45c34f6023`](https://github.com/jsk1004ha/rea/commit/1b04fabfd9918b0d89f5212ee40def45c34f6023). - **Failure/cancellation precedence:** firmware diagnostics consume the command owner's recorded reason and captured output. The first physical failure stays primary when cancellation arrives during cleanup or a later path admission; genuine cancellation keeps the caller's recorded reason and output. Later physical probe failures are retained separately. Progress is local to each inspection, and ordinary failed diagnostics still allow peer inspection. - **Bounded process inspection:** the shared process-table reader captures at most 65,536 bytes of stdout and 65,536 bytes of stderr before decoding/parsing. Overflow rejects the incomplete table, remains unverifiable for cleanup, and becomes an `unknown` firmware prerequisite with structured limit details. No subsequent firmware command is launched. - **Completed provider facts:** provider-group failures retain completed checks, versions and group coverage in typed error diagnostics. Failed cleanup still blocks admission, retains its exact owner and can be retried without discarding earlier observations. - Doctor now uses the existing shared `prlimitArgumentVector`, preserving its 1 GiB address-space, zero file/core-output and five CPU-second ceilings and the selected invocation paths. This also removes the inline-limiter architecture-guard finding without changing the already-fixed renamed-limiter admission. **Final validation** — Linux, Node 24.22.1, npm 11.16.0: - Related source tests: **311 passed, 1 pre-existing skip across 14 files**. This includes FirmwareDoctor, FirmwareCommand, FirmwareVersion, process-table bounds, process ownership facts, OwnedCommand/preparation, ExecFileOutput/bounded output, Linux resource limits, Doctor/lifecycle, doctor runtime and setup. - Added **17 regression/control cases**. Reverting the respective production fixes reproduced the original failures: nine firmware cases, four provider-result cases, and both process-table overflow cases failed while their original/small-table controls still passed. - `npm run check:fast` passed. - Changed-file typed lint passed: **6 files, 0 errors** (26 nonblocking warnings). - Full format check, ordinary Knip, metadata validation and compilation passed during `npm run check`; changed-file formatting and `git diff --check` also passed after the final limiter cleanup. - `npm run knip:production` passed with advisory findings. - `npm run verify:test-discovery` passed: all **2,838 test files discovered exactly once**. **Remaining validation limits:** the full `npm run check` is not green. The final architecture-guard run still reports pre-existing backtick/NUL-key findings in `src/application/GuidanceAccess.ts` and `src/domain/webCaptureDiff.ts`; both files and the guard are unchanged from `fb620711`. Whole-project typed lint was terminated by SIGKILL at this runner's memory limit; the scoped typed check above completed successfully. These checks are not reported as full passes. Actual Binwalk/Unblob execution and the complete repository test suite were not run. The new GitHub **CI** and **PR title** runs report `action_required` and await workflow approval; `PR readiness` reports success. No upstream CI pass or merge is claimed. Existing author-readiness declarations and draft state are preserved. ### Busy-host regression and main synchronization — 2026-11-05 Addressed the process-table regression in [`d3e61fba`](https://github.com/jsk1004ha/rea/commit/d3e61fba934cf12eab9afeae942fd874df1368e8), which also merges upstream `main` at `71f680d7c1aa7a45ba0325fe87b104744b0c105f`. - The whole-host process inventory now has its own **8 MiB per stdout/stderr stream** default. `REA_PROCESS_TABLE_MAX_BYTES` selects a positive decimal byte allowance up to Node's single-string limit. Firmware tool probes retain their separate 64 KiB budget. - Configuration is validated at CLI/MCP admission and lazily before process inspection; invalid settings do not become a misleading missing-procps error. Setup preserves explicit selections. - Overflow still rejects incomplete tables, preserves the actual selected limit and captured output, keeps cleanup unverifiable, and starts no firmware probe. Recovery explains how to change the setting and restart REA. This is a captured-byte bound, not a total-RSS guarantee. - Resolved both main conflicts while retaining JADX documentation, firmware executable-alias coverage, and upstream signal/lifecycle tests. Adapted the existing secondary-error projection callback to upstream's extended signature. **Verification:** 477 tests passed and one pre-existing test was skipped across 17 related files. A valid 1,001-row table with REA's row beyond the former 64 KiB cutoff failed before the fix and now passes. Coverage also includes exact byte limits, multibyte stdout/stderr overflow, Linux/Darwin reader branches, invalid configuration, firmware refusal, and setup forwarding. `npm run check:fast`, documentation checks (9 tests), test discovery (3,031 files exactly once), formatting and `git diff --check` pass. Full `npm run check` passed typecheck, lint, formatting, ordinary Knip, metadata, compilation, architecture guards and production reachability; its repository-wide typed lint was terminated by **SIGKILL**. A separate typed-lint run over all **18 PR-changed TypeScript files** passed with zero errors and 34 warnings. The full check is therefore not claimed green. Executed the compiled Binwalk-scoped doctor CLI with invalid and valid table settings: invalid input is reported as configuration drift; valid input is admitted while the absent firmware engine remains unconfigured. Actual Binwalk/Unblob, native macOS/Windows execution, the full test suite, and aggregate memory/performance measurements were not run. Toolchain: Node 24.22.1 and available npm 11.9.0; pinned npm 11.16.0 was unavailable in the offline cache. GitHub confirms this head is mergeable. [CI](https://github.com/morluto/rea/actions/runs/41974429261), [CodeQL](https://github.com/morluto/rea/actions/runs/41974429236), and [PR title](https://github.com/morluto/rea/actions/runs/41974429195) require maintainer workflow approval. No upstream CI pass or PR merge is claimed. Existing author-readiness declarations and draft state are preserved. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#5958
No description provided.