Repository navigation
fix(pwntools): surface actionable configuration remediation - #3087
1052326311 wants to merge 3 commits into
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
|
CI-fix track: none of the failures came from this PR. IDA native admission, the JavaScript semantic, source-map and contextBridge tests, |
Carry the concrete configuration and admission reason through the typed provider-selection error to CLI callers. Fixes #3055. Reviewed-PR: #3087 Co-authored-by: 1052326311 <[email protected]>
|
Superseded by |
Summary
Fixes #3055. Pwntools configuration failures now put their actual recovery guidance in the top-level error message and remediation, instead of recommending
rea doctor, which does not inspect this adapter.Problem and expected behavior
With
REA_PWNTOOLS_PYTHONunset, bothinspect-binary-layoutandinspect-recorded-crashreturnedprovider_unavailablewith a generic doctor recommendation. The useful requirement was only indetails.rejections. The same loss affected missing/non-executable paths and invalid input-limit configuration.The top-level
messageandremediation.actionnow retain the producer's specific guidance, while the error code, candidate identity, original rejection diagnostics and exit status 1 are preserved. For example, an unset variable reports “Set REA_PWNTOOLS_PYTHON to an absolute caller-supplied Python executable with pwntools 4.15.0, pyelftools 0.33 and Unicorn 2.1.2; REA never installs Python or packages.”Change and scope
ProviderSelectionErroraccepts an optional caller-supplied user message, following the existing tagged-error convention.pwntoolsUnavailablesupplies its already-owned reason; the shared projection carries it to CLI/MCP consumers. Other provider selection errors retain their existing default messages. No provider IDs or configuration interpretation are hardcoded in the domain layer.The CLI guide now limits
doctor --provideradvice to Hopper/Ghidra/IDA/JADX and directs other adapter callers to the returned configuration guidance. This is an existing diagnostic-contract repair; a new-capability scope decision is not applicable.Contract and boundary impact
pwntoolsUnavailableproduces the recovery reason;ProviderSelectionErrorpreviously replaced its user-facing message with a generic fallback.message/remediation.action; error schema, codes and original rejection details retained.Expected effects of this correction:
Evidence and regression coverage
The new CLI regression exercises both commands through their real application services and pwntools providers. Only the composition entry point is injected to supply isolated configuration. Five cases per command cover unset Python, a directory, a missing file, missing execute permission, and an invalid
REA_PWNTOOLS_MAX_INPUT_BYTES. Assertions check final JSON message/remediation, code, retained rejection/configuration identity and exit status 1.c7105d97, both command regressions fail because the top-level advice is generic.Validation performed
npm run test:focused -- tests/process-global/pwntoolsCliRemediation.test.ts tests/process-global/pwntoolsCliFinalization.test.ts src/domain/analysisErrorProjection.test.ts src/native/pwntools/PwntoolsInputLimit.test.ts— 80 passed.npm run check— passed, including runtime build, typecheck/lint/format and architecture guards.npm run docs:check— passed, including 5 README consistency tests.npm run verify:test-discovery— all 1,234 test files discovered exactly once.git diff --check— passed.Validated against base
c7105d97. Publication refresh through main70771523found no changes to the selected error producer, domain error, service, or guide. New unrelated dependency/owner changes were not locally revalidated as part of this candidate.Compatibility, safety, and release
No schema, exit status, configuration, authority or dependency change. Callers should use structured error codes rather than exact prose. Windows, native Linux x64 and real pwntools/pwndbg execution were not verified for this diagnostic-only change.
Before merge
Review follow-up and hosted CI
Follow-up
2df49734adds JADX to the guide, matchingDOCTOR_PROVIDER_IDS, and resetsprocess.exitCodeto zero before every CLI invocation so each configuration independently proves its exit status. The error producer and projection are unchanged. The corrected CLI regression (2 tests covering 10 configurations),src/doctorRuntime.test.ts(supported-provider contract),npm run check,npm run docs:check, and the pre-pushcheck:fastall passed.On the original head
f17c87ad, hosted static/build/docs, native Linux package, and both matching real binary-layout/recorded-crash lanes passed. Overall CI did not pass: the source suite has five failures in IDA admission and JavaScript graph/source semantics. I reproduced the same five failing tests with 87 passing tests on clean main70771523, the exact base used by hosted mergecb6007a, using:Original source-suite job. A compiled shard also reports failures in development-runner formatting assertions, source-map/contextBridge expectations, and Ghidra launch diagnostics; those additional failures have not all been reproduced locally. This is not a request to waive checks. The updated head's hosted checks are separate and must pass or receive explicit maintainer adjudication before merge.
Latest hosted result
Run 38499905582 for
2df49734has completed. Static checks, runtime build, docs generation, Windows native build, native Linux package baseline, and both matching real binary-layout/recorded-crash lanes passed. Source tests and shard 4 failed; other shards were cancelled, so overall required CI is failing.The source job reports the same five source failures reproduced on exact base
70771523above. Shard 4 reports nine failures across development-runner color assertions, application/source-map expectations and Ghidra launch diagnostics; I have not locally reproduced all of them. Existing #3080 contains repairs in those owners; this PR does not duplicate that work or claim its results. Both review threads on this PR are resolved, and automated review of2df49734reported no new blocker.The author of overlapping #3088 has closed it in favor of this PR. Their separately reported Linux CLI/pwntools checks concern the overlapping recovery approach, not execution of this PR's exact head.