Repository navigation
fix(firmware): stop recommending a raise at the staging budget ceiling - #6971
Conversation
The staging refusal told callers to increase max_output_files or max_output_bytes within its schema maximum. At the schema ceiling that recovery does not exist, so the refusal was unactionable exactly where the least room remains. firmwareStagingBudgetRemediation now branches on the selected value against the schema maximum: below the ceiling it names the room and the control, at the ceiling it states that a further raise is unsupported and points at a smaller firmware byte range. The schema maxima move into named constants so the advice and the accepted range cannot drift apart. Verified with a module test for both budgets at the ceiling and one below it (red on the previous single-form remediation), plus the existing firmware suites.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
baron
left a comment
There was a problem hiding this comment.
Reviewed commit 4c89ef5. No actionable correctness findings. The schema ceilings remain unchanged, remediation uses the same named constants, and both live and final inventory checks pass through the caller-selected budgets correctly.
Optional follow-up: exercise the error emitted by inventoryFirmwareOutput in a regression test, rather than only testing the wording helper, to protect the production wiring.
Validation scope: source review only. I did not run tests against the PR revision or perform a real Unblob extraction.
The ceiling recovery added in morluto#6971 was covered through the wording helper only, so a wiring change that passed the schema ceiling where the selected value belongs, or that dropped the remediation, would have stayed green. Adds boundary coverage that calls inventoryFirmwareOutput itself: a sparse file reaches the real byte ceiling without storing the bytes and asserts the projected refusal carries the ceiling recovery, and a one-byte tree below the ceiling asserts the raise advice. Verified red on both regressions — passing the schema ceiling for the selected value fails the below-ceiling case, and restoring the single-form remediation fails both.
The ceiling recovery added in morluto#6971 was covered through the wording helper only, so a wiring change that passed the schema ceiling where the selected value belongs, or that dropped the remediation, would have stayed green. Adds boundary coverage that calls inventoryFirmwareOutput itself: a sparse file reaches the real byte ceiling without storing the bytes and asserts the projected refusal carries the ceiling recovery, and a one-byte tree below the ceiling asserts the raise advice. Verified red on both regressions — passing the schema ceiling for the selected value fails the below-ceiling case, and restoring the single-form remediation fails both.
The ceiling recovery added in morluto#6971 was covered through the wording helper only, so a wiring change that passed the schema ceiling where the selected value belongs, or that dropped the remediation, would have stayed green. Adds boundary coverage that calls inventoryFirmwareOutput itself: a sparse file reaches the real byte ceiling without storing the bytes and asserts the projected refusal carries the ceiling recovery, and a one-byte tree below the ceiling asserts the raise advice. Verified red on both regressions — passing the schema ceiling for the selected value fails the below-ceiling case, and restoring the single-form remediation fails both.
The ceiling recovery added in morluto#6971 was covered through the wording helper only, so a wiring change that passed the schema ceiling where the selected value belongs, or that dropped the remediation, would have stayed green. Adds boundary coverage that calls inventoryFirmwareOutput itself: a sparse file reaches the real byte ceiling without storing the bytes and asserts the projected refusal carries the ceiling recovery, and a one-byte tree below the ceiling asserts the raise advice. Verified red on both regressions — passing the schema ceiling for the selected value fails the below-ceiling case, and restoring the single-form remediation fails both.
The ceiling recovery added in morluto#6971 was covered through the wording helper only, so a wiring change that passed the schema ceiling where the selected value belongs, or that dropped the remediation, would have stayed green. Adds boundary coverage that calls inventoryFirmwareOutput itself: a sparse file reaches the real byte ceiling without storing the bytes and asserts the projected refusal carries the ceiling recovery, and a one-byte tree below the ceiling asserts the raise advice. Verified red on both regressions — passing the schema ceiling for the selected value fails the below-ceiling case, and restoring the single-form remediation fails both.
The ceiling recovery added in morluto#6971 was covered through the wording helper only, so a wiring change that passed the schema ceiling where the selected value belongs, or that dropped the remediation, would have stayed green. Adds boundary coverage that calls inventoryFirmwareOutput itself: a sparse file reaches the real byte ceiling without storing the bytes and asserts the projected refusal carries the ceiling recovery, and a one-byte tree below the ceiling asserts the raise advice. Verified red on both regressions — passing the schema ceiling for the selected value fails the below-ceiling case, and restoring the single-form remediation fails both.
The ceiling recovery added in morluto#6971 was covered through the wording helper only, so a wiring change that passed the schema ceiling where the selected value belongs, or that dropped the remediation, would have stayed green. Adds boundary coverage that calls inventoryFirmwareOutput itself: a sparse file reaches the real byte ceiling without storing the bytes and asserts the projected refusal carries the ceiling recovery, and a one-byte tree below the ceiling asserts the raise advice. Verified red on both regressions — passing the schema ceiling for the selected value fails the below-ceiling case, and restoring the single-form remediation fails both.
* test(firmware): exercise the staging ceiling through the emitted refusal The ceiling recovery added in #6971 was covered through the wording helper only, so a wiring change that passed the schema ceiling where the selected value belongs, or that dropped the remediation, would have stayed green. Adds boundary coverage that calls inventoryFirmwareOutput itself: a sparse file reaches the real byte ceiling without storing the bytes and asserts the projected refusal carries the ceiling recovery, and a one-byte tree below the ceiling asserts the raise advice. Verified red on both regressions — passing the schema ceiling for the selected value fails the below-ceiling case, and restoring the single-form remediation fails both. * test(firmware): compare the emitted recovery with its owner The wiring test matched three phrases of the emitted remediation, so an ad-hoc or truncated action that kept those phrases would still pass while the emitted recovery had diverged from firmwareStagingBudgetRemediation. Assert exact equality with the owner's output for the selected value in both cases instead. Verified red: replacing the emitted action with a divergent sentence that keeps the ceiling phrases now fails both cases, where the phrase matching passed. * chore: retrigger title and readiness checks after the title was corrected * test(firmware): drive the staging ceiling through the request boundary greptile and codex both flagged that the ceiling tests called inventoryFirmwareOutput directly, so they would still pass if request parsing or the provider wiring dropped or replaced max_output_bytes. Add a request-level test that records the parsed request a provider receives: the caller's max_output_bytes arrives unchanged at the schema ceiling and below it, the documented default applies when omitted, and a budget above the schema maximum is rejected before the provider runs. That is the wiring the previous tests assumed rather than asserted.
Summary
The firmware staging-budget refusal told callers to raise
max_output_bytesormax_output_files"within its schema maximum". At the schema ceiling that recovery does not exist, so the one case
where the selected value cannot grow received advice that cannot be followed.
Part of the contract described in #5846, which already returns a nonretryable resource constraint
naming the selected limit. This change only corrects the recovery text at the ceiling and pins the
schema maxima to named constants.
Problem and expected behavior
Smallest trigger:
extract_firmwarewithmax_output_filesat its schema maximum (100000) on astaging tree that still exceeds it, or
max_output_bytesat536870912. Both refusals keep theirresource_constraint/capacityclassification andreported_limits, but the remediation says"Increase max_output_files within its schema maximum if the larger extraction is required" — and no
larger value is accepted.
Expected: below the ceiling the remediation names the remaining room and the control to change. At
the ceiling it states that a further raise is not supported and points at a smaller firmware byte
range, which is the recovery that actually exists.
Change and scope
src/domain/firmware/firmwareAnalysis.ts: the two schema maxima becomeMAX_FIRMWARE_STAGING_BYTESand
MAX_FIRMWARE_STAGING_ENTRIES, and the schema's.max()calls use them, so the accepted rangeand the advice cannot drift apart.
src/firmware/FirmwareFiles.ts:firmwareStagingBudgetRemediationselects the below-ceiling orat-ceiling wording from the selected value;
firmwareStagingLimituses it.Intentionally not included: the classification itself (
resource_constraint,capacity,reported_limits,retryable: false) is unchanged — it is already correct on the base revision. Nobudget default, extraction behavior, Unblob invocation or deadline path changes.
Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block integration. Link the
required maintainer scope decision for new providers or capabilities involving target execution,
injection, mutation, or protection recovery; ordinary fixes within existing boundaries may state
"not applicable".
Not applicable — this is an ordinary fix inside the existing firmware admission boundary.
Contract and boundary impact
inventoryFirmwareOutput; the earliest changed stage is the refusal's remediation text, not therefusal.
applicable.
reported_limits. Onlythe
remediation.actionstring for this refusal changes, which is the reported defect.provider path and the command deadline path.
a budget is exceeded, as before.
extra process is launched and workspace cleanup keeps its existing path.
docs/public/product-catalog.json), package, or installation impact (CIgenerates and validates ignored catalogs and
skills/; edit authored instructions in.agents/skills/reverse-engineer-anything/and never commit build outputs): none.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
src/firmware/FirmwareStagingBudget.test.ts— a budget below its ceilingoffers the room and the control, both budgets at their ceilings state that a further raise is not
supported and point at a smaller range, and the selected value and ceiling are named in both cases.
firmwareStagingBudgetRemediationdoesnot exist and the single-form remediation says "Increase within its schema maximum" for
every selected value. Verified red → green: restoring that single form makes all four new cases
fail; the change makes them pass.
extract_firmwareat the entry ceiling theremediation.actionnow reads "The staging entry budget, which counts extracted directories andlinks, reached its supported maximum (max_output_files=100000; maximum 100000). Raising
max_output_files further is not supported. Select a smaller firmware byte range or analyze a
smaller image. analysis_timeout_ms does not raise this staging allowance." Below the ceiling it
reads "…was exceeded (max_output_files=1; supported maximum 100000). Increase max_output_files up to
100000 if the larger extraction is required, or select a materially narrower firmware byte range."
extract_firmwareMCP call. The 39 firmware integration cases are skipped by host configuration onthis machine, and no real Unblob extraction was run.
For evidence-bearing changes:
Validation performed
node node_modules/vitest/vitest.mjs run src/firmware tests/boundary/firmware --maxWorkers=1— 81passed, 52 skipped (10 files; the skips are host-gated firmware integration and workspace recovery).
npx tsc --noEmit -p .— no errors.npx oxfmt <changed files>— formatted.npm run verify:module-boundaries— 2898 source files checked, no violations.src/firmware/FirmwareStagingBudget.test.ts: 4 failed with the previous single-formremediation, 4 passed with the change.
Compatibility, safety, and release
reported_limitsareunchanged; only the recovery sentence changes, and only where the previous sentence recommended an
unsupported value.
Author readiness
Human owner: @XiaoBinGan
Before merge
type(scope): outcome.