Repository navigation
refactor(providers): classify raw provider failures through one owner - #10757
Merged
Merged
Conversation
When a capture read's tool launch was refused with EPERM, pcap reported it as unreadable tool output (AnalysisProtocolError) instead of an unavailable tool. Pcap also never told "not executable" apart from "missing". Add classifyLaunchFailure in src/process as the one owner of which spawn errnos mean missing (ENOENT, ENOTDIR) and which mean present but not executable (EACCES, EPERM, ENOEXEC, EISDIR). Pcap, apktool and gdb used three different errno lists; all three now use it.
Add ProviderOutcome, read once from the supervisor's facts, and classifyProviderOutcome, the one mapping from an outcome to a typed error. Migrate pcap and the shared artifact producer command failure (TShark, sigrok). Add the rea/provider-failure-classifier lint rule with a shrink-only baseline of per-site (cause: unknown) => AnalysisError functions.
…red owner (#10598) The Ghidra and JADX Java probes and adb's version probe now take missing-versus-not-executable from classifyLaunchFailure instead of their own errno checks. ELOOP and ENAMETOOLONG join the owner's missing set, so adb keeps its existing classification and both Java probes now treat a non-directory path component as a missing runtime.
…ol exits unsuccessfully
Add ProviderOutcome, read once from the supervisor's facts, and classifyProviderOutcome, the one mapping from an outcome to a typed error. Migrate pcap and the shared artifact producer command failure (TShark, sigrok). Add the rea/provider-failure-classifier lint rule with a shrink-only baseline of per-site (cause: unknown) => AnalysisError functions.
…nto HEAD # Conflicts: # src/pcap/PcapCommand.ts
… a target refusal The supervisor now watches for a managed runtime's out-of-memory report while output streams (JVM java.lang.OutOfMemoryError, V8 'JavaScript heap out of memory'), so a retention budget cannot hide it. ProviderOutcome gains a runtime-exhausted kind and classifyProviderOutcome maps it once. Apktool decode opts in and moves to the shared classifier; Ghidra's single-purpose output token becomes the JVM runtime option and its area matching reuses the shared table.
…HEAD # Conflicts: # src/pcap/PcapCommand.ts # tests/evaluation/providerFailureClassifierRule.test.ts
…nto refactor/provider-outcome # Conflicts: # src/pcap/PcapCommand.ts
…fix/streaming-runtime-exhaustion
Name the executable on errnos Node throws synchronously from spawn (ENOEXEC, ENOTDIR, ...) and read the Windows native launcher's executable-launch constraint, so pcap attributes those refusals to the selected tool or limiter instead of an unknown stage.
…nto w5/provider-outcome # Conflicts: # src/pcap/PcapCommand.ts
…t retained stderr (#10724) The SQLite worker and the Node capture decoders now declare runtime: "v8", so the supervisor observes V8's heap report as output streams. Both classifiers read the runtime-exhausted outcome instead of matching retained stderr, so a report beyond the retention budget, or one whose process then overflowed its output budget, is still reported as memory exhaustion.
# Conflicts: # .oxlintrc.json # scripts/lint/index.mjs # src/pcap/PcapCommand.ts
…vider classifier (#10716) * refactor(evm): classify EVMole worker outcomes through the shared provider classifier The EVMole worker's cancellation, deadline, output budget and CPU/file-size signals now go through classifyProviderOutcome; only the prlimit launch refusal and the reserved EFBIG exit remain in its dialect. The worker is opted into V8 exhaustion scanning so a heap report names its fixed 256 MiB heap. providerOutcomeOf now reads a launch refusal only from a spawn errno, so a private-storage or carrier read errno is no longer reported as a limiter launch failure. * fix(evm): keep a stream failure's exit status and update Linux worker expectations * refactor(process): read launch refusals through the launcher identity owner * refactor(wasm): classify WABT command outcomes through the shared provider classifier (#10727) * refactor(wasm): classify WABT command outcomes through the shared provider classifier WABT's cancellation, command deadline, output budget, and inherited-limit signals now go through classifyProviderOutcome; its dialect keeps only the configuration-probe and launch-refusal unavailability and the unclassified-exit output error. A tool ended by SIGXCPU/SIGXFSZ or the memory limit is now a resource constraint instead of an output error, and a refused launch in the producer phase is reported as unavailable. The shared timeout context gains the analysis setting that selected the deadline, and the output-limit context may name its exceeded budget. * fix(wasm): keep setup guidance when a WABT version probe's output cannot be collected
…w5-10634 # Conflicts: # src/apktool/ApktoolProvider.ts # src/ghidra/GhidraDiagnostics.ts
Codex Review Summary: ✅ CompletedThis 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. |
Contributor
[Medium impact] The PR appears safe to merge, with WABT’s deferred cancellation cleanup covered by dependent PR #10796. SummaryAdds
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
Raw["Raw provider failure"] --> Typed{"Already AnalysisError?"}
Typed -->|Yes| Pass["Return unchanged"]
Typed -->|No| Command{"Command outcome?"}
Command -->|Yes| Outcome["classifyProviderOutcome"]
Outcome --> Cleanup["Provider cleanup report when needed"]
Command -->|No| Recognise["Provider recognise hook"]
Recognise --> File["Shared selected-file projections"]
File --> Fallback["Provider unclassified report"]
Recognise --> Retain["Retain file identity and cleanup leases"]
File --> Retain
Fallback --> Retain
Reviews (7) · Last reviewed commit: "Merge origin/main into refactor/provider..." · Reviewed by Greptile |
…d the carried caller reason
…lassifier baseline
…rror that claims it SQLite and historical-capture memory errors recognised a streamed V8 heap report but dropped it, so a report outside retained output reached callers without its source line or omission flags. One projection, runtimeExhaustionReport, now owns that shape for the shared classifier and both consumers. Also lowers the EVMole and WABT cancellation-constructor baselines.
…-classifier; build the shared read cancellation with cancelledBy
22 tasks
…tion report The shared classifier replaced the provider-supplied recovery with generic capacity advice whenever the JVM reported it could not create a native thread, dropping Apktool's launcher guidance and flipping retryable to true. The provider's recovery now wins; the capacity advice remains the fallback for providers that supply none.
…vider classifier (#10782) * refactor(pwntools): classify pwntools failures through the shared provider classifier pwntools' per-site classifier is replaced by pwntoolsFailureDialect for classifyProviderFailure. Command outcomes go through classifyProviderOutcome, launch refusals through launcherRefusalOf instead of a 'spawn ' syscall prefix check, the input limit through the file dialect's fileSize, and the cleanup report through commandCleanup. The shared read cancellation now carries the reader's partial observation, and resource-signal reports accept provider detail. * fix(pwntools): report a failed command's output once and expect resource_constraint for overflow The shared outcome owner already attaches the command's output as capturedOutput, so the pwntools adapter fallback no longer copies the same text into diagnostics.stdout, diagnostics.stderr and diagnostics.captured_output; diagnostics keep the exit facts. Update the overflow expectations the dialect migration missed (layout provider cleanup and over-budget rows, pwntools cleanup) to resource_constraint.
22 tasks
morluto
changed the base branch from
fix/streaming-runtime-exhaustion
to
main
November 15, 2026 07:11
22 tasks
morluto
added a commit
that referenced
this pull request
Nov 15, 2026
20 of 29 tasks
Plastic-time
added a commit
to Plastic-time/rea
that referenced
this pull request
Nov 15, 2026
…ailure Main now rejects new per-site failure classifiers (morluto#10757) and verifier temp roots outside VerifierFixture. - The provider passes a dialect to classifyProviderFailure: the parser's budget and format refusals, the file-size recovery, and the read cleanup. A nested read keeps its physical primary under one cleanup envelope, as the shared PE projection did. - scripts/verify-pe-rich-header.mjs allocates its scratch root with VerifierFixture.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds one owner for turning a raw provider failure into a typed
AnalysisError:classifyProviderFailure(cause, dialect)insrc/providers/classifyProviderFailure.ts. A provider now supplies a dialect (its own typed refusals, command settings, the file it read and what it reports for an unrecognised cause) instead of writing a(cause: unknown) => AnalysisErrorclassifier. EVMole and WABT are converted to show the shape; their per-site classifiers are deleted and therea/provider-failure-classifierbaseline drops from 107 to 104.Stacked on #10634 (which now carries #10716, #10727 and #10724). Refs #10482 (W5c of the structural cleanup).
Problem and expected behavior
Every provider re-derived the same facts from
unknown: is this already typed, an owned command outcome, a cancelled or changed file read, an errno that names the selected path, or something else. Each copy made slightly different choices. For example, EVMole treatedEISDIR,ENOTFILEandESTALEon the selected carrier as a provider adapter failure, while the shared selected-file projection treats them as invalid input. Expected: one classifier decides these shared facts, and the provider decides only its own meaning.Change and scope
classifyProviderFailureworks through the cause in this order:AnalysisErrorvalues pass through unchanged.providerOutcomeOf) go toclassifyProviderOutcomewith the provider'scommandcontext. If command cleanup failed,commandCleanupbuilds the report. When a provider gives nocommandCleanup, the primary failure is composed with aProviderCleanupError.recognisehook checks provider-owned typed failures.AnalysisCancelledError, integrity becomesAnalysisArtifactChangedError, the file-size limit goes to the provider'sfileSize, path and format rejections usestableArtifactInputFailure, and errno values useprojectSelectedArtifactFileFailure.unclassifiedreport. W5d will replace this withUnclassifiedProviderFailurecarrying the examined outcome.Every result keeps the read's unresolved cleanup (passed to each constructor as
details) and its bound cleanup leases. When the provider asks for it, the result also keeps the completed read's byte identity (retainCompletedIdentity).Supporting changes:
projectSelectedArtifactFileFailureandstableArtifactInputFailureaccept a request-pathfield(for example["candidate_paths", 2]) and extra error options.owners(exempt from the rule) andcounts(a list that can only shrink). The rule message points toclassifyProviderFailure.docs/development/tool-design.mddescribes the owner.evmInterfaceFailureis replaced byevmFailureDialect. The provider's duplicate lease binding and snapshot-identity code after classification is removed, because the owner now does both.wabtFailureandclassifyWabtFailureare replaced bywabtFailureDialect.Not included: the other providers. They follow as one PR each, in this order: pwntools, firmware, TShark/sigrok, Ghidra, Hopper, IDA, Kuna, JEB, gdb, rizin, ADB, SQLite/capture. Also not included: replacing the
spawnprefix checks withlauncherRefusalOf, which lands with pwntools and EVMole's remaining sites, and W5d.Error categories that changed, all for selected-file reads:
EISDIR,ENOTFILEorESTALE: wasProviderAdapterError, nowAnalysisInputError(invalid_value, "Selected bytecode carrier could not be read (EISDIR): ."), matching the shared selected-file set.pathorformatrejection: the issue reason wasinvalid_value, nowinvalid_format, the same as every otherstableArtifactInputFailurecaller.ENOENT,ENOTDIR,ELOOPand similar errno values: the issue message is now the shared "Selected WebAssembly input could not be read (): ." instead of the raw errno text.Contribution scope: ordinary refactor within existing boundaries; no maintainer scope decision is needed.
Contract and boundary impact
Semantic owner and earliest changed stage:
classifyProviderFailureowns the mapping from raw failure to typed error;classifyProviderOutcomestill owns command outcomes, andStableArtifactFailurestill owns the file projections. The per-site EVMole and WABT classifiers are removed.Contribution scope fit and linked maintainer decision: not applicable; ordinary refactor.
CLI and MCP/tool-catalog contract: schemas are unchanged. Error categories change only as listed above.
Provider, bridge, target-format, or platform compatibility: none.
Evidence, artifact, provenance, or reconstruction contract: unchanged. Cleanup observations, leases, captured output and completed snapshot identity stay on the reported error.
Target selection, authority, upstream behavior, and cleanup details: cleanup ownership is unchanged; binding moved into the owner.
Generated metadata, package, or installation impact: none.
Read existing files or captured data.
Evidence and regression coverage
src/evm/EvmoleFailures.test.tsadds a test that a carrier read failing withEISDIRis reported as invalid input. EVMole and WABT tests now call the provider dialect throughclassifyProviderFailure.tests/evaluation/providerFailureClassifierRule.test.tscovers the owner exemption and checks that owner files exist.artifactSelectedPathErrnodoes not includeEISDIR, so the new EVMole test would fall through toProviderAdapterError. The test was not run against the base, because the base has noevmFailureDialectexport.Validation performed
npm run check:fast: typecheck and lint pass, including module-layer boundaries. A first attempt that placed the owner insrc/processfailed theprocess -> artifactsupward-import baseline; the owner was moved tosrc/providers.npm run test:local -- src/evm/EvmoleFailures.test.ts src/evm/EvmoleInterfaceProvider.test.ts src/wasm/WabtFailures.test.ts src/wasm/WabtRuntime.test.ts src/wasm/WabtArtifactProvider.test.ts tests/evaluation/providerFailureClassifierRule.test.ts: 6 files, 118 tests passed.npm run test:focused -- tests/boundary/filesystem/wabtEnvironment.test.ts tests/boundary/mcp/wasmArtifactMcp.test.ts tests/boundary/mcp/evmLimiterAvailability.test.ts tests/boundary/mcp/evmInterfaceMcp.test.ts tests/boundary/cli/wasmAcquiredInputsCli.test.ts tests/boundary/cli/wasmLateCancellationCli.test.ts: 30 passed, 1 skipped.npm run check:fastpass;npm run test:focusedon EvmoleFailures, evmoleInterfaceProvider, wabtEnvironment, providerFailureClassifierRule and cancellationCauseLint tests 55 passed, 36 skipped. Pushed with--no-verify(hooks resolve the rejected default Node 25); check:fast was run by hand.Compatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.