Repository navigation
refactor(providers): build decompiler-provider cancellations with a required reason - #10587
Merged
morluto merged 1 commit intoNov 14, 2026
Conversation
…equired reason Migrate every AnalysisCancelledError construction under src/ghidra, src/ida, src/cutter, src/jeb and src/kuna to cancelledBy and lower the guard baseline from 671 to 572. Closed Kuna target commands report OwnerCancellation.ownerClosed instead of an absent reason, and Kuna and JEB close abort their lifetimes with that typed reason.
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; no blocking issues were found. SummaryMigrates 99 provider cancellation errors to
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["Aborted caller signal"] --> D["cancelledBy"]
B["Captured reason or earlier cancellation"] --> D
C["OwnerCancellation.ownerClosed"] --> D
D --> E["AnalysisCancelledError"]
E --> F["Existing error reporting and cleanup"]
Reviews (2) · Last reviewed commit: "refactor(providers): build decompiler-pr..." · Reviewed by Greptile |
11 tasks
morluto
added a commit
that referenced
this pull request
Nov 14, 2026
…10566) * refactor(errors): require a reason for every analysis cancellation Add cancelledBy, the one constructor for AnalysisCancelledError. Its reason argument is required: an aborted signal, an earlier cancellation, a reason carried from an inner failure, or an OwnerCancellation when REA closed the work's owner itself. Closed adb, apktool, firmware, sqlite, gdb, web-bundle analyzer and binary-session record owners now report OwnerCancellation.ownerClosed instead of an absent reason. Firmware's predecessor wait returns its cancellation as a Result, removing an unreachable reason-less fallback. An architecture guard rejects new direct constructions, with a counted per-file baseline that can only shrink. * refactor(errors): share one aborted-signal predicate with cancelledBy * refactor(process): return a departing caller's reason from a shared startup wait * refactor(providers): build decompiler-provider cancellations with a required reason (#10587) Migrate every AnalysisCancelledError construction under src/ghidra, src/ida, src/cutter, src/jeb and src/kuna to cancelledBy and lower the guard baseline from 671 to 572. Closed Kuna target commands report OwnerCancellation.ownerClosed instead of an absent reason, and Kuna and JEB close abort their lifetimes with that typed reason. * fix(errors): read the reason of any signal-shaped cancellation source * test(ci): cover the counted-baseline comparison behind the architecture guard
morluto
added a commit
that referenced
this pull request
Nov 14, 2026
…d reason (#10590) * refactor(errors): require a reason for every analysis cancellation Add cancelledBy, the one constructor for AnalysisCancelledError. Its reason argument is required: an aborted signal, an earlier cancellation, a reason carried from an inner failure, or an OwnerCancellation when REA closed the work's owner itself. Closed adb, apktool, firmware, sqlite, gdb, web-bundle analyzer and binary-session record owners now report OwnerCancellation.ownerClosed instead of an absent reason. Firmware's predecessor wait returns its cancellation as a Result, removing an unreachable reason-less fallback. An architecture guard rejects new direct constructions, with a counted per-file baseline that can only shrink. * refactor(errors): share one aborted-signal predicate with cancelledBy * refactor(process): return a departing caller's reason from a shared startup wait * refactor(android): build mobile-provider cancellations with a required reason Migrate every remaining AnalysisCancelledError construction under src/adb, src/android, src/apktool, src/apkSignature, src/flutter, src/il2cpp, src/dotnet and src/frida to cancelledBy and lower the guard baseline from 671 to 608. A closed adb provider reports OwnerCancellation.ownerClosed for later probes, and JADX and apktool shutdown abort with that typed reason. * refactor(providers): build decompiler-provider cancellations with a required reason (#10587) Migrate every AnalysisCancelledError construction under src/ghidra, src/ida, src/cutter, src/jeb and src/kuna to cancelledBy and lower the guard baseline from 671 to 572. Closed Kuna target commands report OwnerCancellation.ownerClosed instead of an absent reason, and Kuna and JEB close abort their lifetimes with that typed reason. * fix(errors): read the reason of any signal-shaped cancellation source * test(ci): cover the counted-baseline comparison behind the architecture guard
morluto
added a commit
that referenced
this pull request
Nov 15, 2026
…10601) * refactor(errors): require a reason for every analysis cancellation Add cancelledBy, the one constructor for AnalysisCancelledError. Its reason argument is required: an aborted signal, an earlier cancellation, a reason carried from an inner failure, or an OwnerCancellation when REA closed the work's owner itself. Closed adb, apktool, firmware, sqlite, gdb, web-bundle analyzer and binary-session record owners now report OwnerCancellation.ownerClosed instead of an absent reason. Firmware's predecessor wait returns its cancellation as a Result, removing an unreachable reason-less fallback. An architecture guard rejects new direct constructions, with a counted per-file baseline that can only shrink. * refactor(errors): share one aborted-signal predicate with cancelledBy * refactor(process): return a departing caller's reason from a shared startup wait * refactor(providers): build decompiler-provider cancellations with a required reason (#10587) Migrate every AnalysisCancelledError construction under src/ghidra, src/ida, src/cutter, src/jeb and src/kuna to cancelledBy and lower the guard baseline from 671 to 572. Closed Kuna target commands report OwnerCancellation.ownerClosed instead of an absent reason, and Kuna and JEB close abort their lifetimes with that typed reason. * fix(errors): read the reason of any signal-shaped cancellation source * test(ci): cover the counted-baseline comparison behind the architecture guard * refactor(hopper): build Hopper cancellations with a required reason Migrate the remaining AnalysisCancelledError constructions under src/hopper to cancelledBy. Regex-search close aborts its workers with OwnerCancellation.ownerClosed. HopperCleanup and HopperClient are not touched. * test(hopper): cover cancellation during search shutdown
morluto
added a commit
that referenced
this pull request
Nov 15, 2026
… reason (#10595) * refactor(errors): require a reason for every analysis cancellation Add cancelledBy, the one constructor for AnalysisCancelledError. Its reason argument is required: an aborted signal, an earlier cancellation, a reason carried from an inner failure, or an OwnerCancellation when REA closed the work's owner itself. Closed adb, apktool, firmware, sqlite, gdb, web-bundle analyzer and binary-session record owners now report OwnerCancellation.ownerClosed instead of an absent reason. Firmware's predecessor wait returns its cancellation as a Result, removing an unreachable reason-less fallback. An architecture guard rejects new direct constructions, with a counted per-file baseline that can only shrink. * refactor(errors): share one aborted-signal predicate with cancelledBy * refactor(process): return a departing caller's reason from a shared startup wait * refactor(providers): build decompiler-provider cancellations with a required reason (#10587) Migrate every AnalysisCancelledError construction under src/ghidra, src/ida, src/cutter, src/jeb and src/kuna to cancelledBy and lower the guard baseline from 671 to 572. Closed Kuna target commands report OwnerCancellation.ownerClosed instead of an absent reason, and Kuna and JEB close abort their lifetimes with that typed reason. * refactor(process): build infrastructure cancellations with a required reason Migrate every AnalysisCancelledError construction in shared process, provider, artifact, domain, server and CLI code and in the smaller providers to cancelledBy, lowering the guard baseline from 671 to 566. Option bags that carried a cause are split so the cancellation branch cannot receive one. * fix(errors): read the reason of any signal-shaped cancellation source * test(ci): cover the counted-baseline comparison behind the architecture guard
morluto
added a commit
that referenced
this pull request
Nov 15, 2026
…#10581) * refactor(errors): require a reason for every analysis cancellation Add cancelledBy, the one constructor for AnalysisCancelledError. Its reason argument is required: an aborted signal, an earlier cancellation, a reason carried from an inner failure, or an OwnerCancellation when REA closed the work's owner itself. Closed adb, apktool, firmware, sqlite, gdb, web-bundle analyzer and binary-session record owners now report OwnerCancellation.ownerClosed instead of an absent reason. Firmware's predecessor wait returns its cancellation as a Result, removing an unreachable reason-less fallback. An architecture guard rejects new direct constructions, with a counted per-file baseline that can only shrink. * refactor(errors): share one aborted-signal predicate with cancelledBy * refactor(process): return a departing caller's reason from a shared startup wait * refactor(browser): build browser cancellations with a required reason Migrate every AnalysisCancelledError construction under src/browser, src/javascript, src/electron, src/inspector and src/captures to cancelledBy and lower the guard baseline from 671 to 572. Service-worker setup aborts with OwnerCancellation.ownerClosed on close. * refactor(providers): build decompiler-provider cancellations with a required reason (#10587) Migrate every AnalysisCancelledError construction under src/ghidra, src/ida, src/cutter, src/jeb and src/kuna to cancelledBy and lower the guard baseline from 671 to 572. Closed Kuna target commands report OwnerCancellation.ownerClosed instead of an absent reason, and Kuna and JEB close abort their lifetimes with that typed reason. * fix(errors): read the reason of any signal-shaped cancellation source * test(ci): cover the counted-baseline comparison behind the architecture guard * refactor(electron): drop an unused error import from the fuse failure mapper
morluto
added a commit
that referenced
this pull request
Nov 15, 2026
…ired reason (#10599) * refactor(errors): require a reason for every analysis cancellation Add cancelledBy, the one constructor for AnalysisCancelledError. Its reason argument is required: an aborted signal, an earlier cancellation, a reason carried from an inner failure, or an OwnerCancellation when REA closed the work's owner itself. Closed adb, apktool, firmware, sqlite, gdb, web-bundle analyzer and binary-session record owners now report OwnerCancellation.ownerClosed instead of an absent reason. Firmware's predecessor wait returns its cancellation as a Result, removing an unreachable reason-less fallback. An architecture guard rejects new direct constructions, with a counted per-file baseline that can only shrink. * refactor(errors): share one aborted-signal predicate with cancelledBy * refactor(process): return a departing caller's reason from a shared startup wait * refactor(providers): build decompiler-provider cancellations with a required reason (#10587) Migrate every AnalysisCancelledError construction under src/ghidra, src/ida, src/cutter, src/jeb and src/kuna to cancelledBy and lower the guard baseline from 671 to 572. Closed Kuna target commands report OwnerCancellation.ownerClosed instead of an absent reason, and Kuna and JEB close abort their lifetimes with that typed reason. * fix(errors): read the reason of any signal-shaped cancellation source * refactor(native): build debugger and native cancellations with a required reason Migrate every AnalysisCancelledError construction under src/native, src/gdb and src/rizin to cancelledBy and delete Rizin's local rizinCancellation constructor; its reason choice becomes a CancellationReason. GDB close aborts active startups with OwnerCancellation.ownerClosed. * test(ci): cover the counted-baseline comparison behind the architecture guard * refactor(native): drop an unused cancellation import from native UI observation
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
Migrates every
AnalysisCancelledErrorconstruction undersrc/ghidra/,src/ida/,src/cutter/,src/jeb/andsrc/kuna/(99 sites) tocancelledBy, the reason-requiring owner from #10566. The guard baseline drops from 671 to 572. Stacked on #10566 (its base branch); retarget tomainafter #10566 merges. Independent of the other slice PRs.Refs #8223
Problem and expected behavior
KunaTargetCommands.run,prepareandinputHeadrefused work while closing withcause: undefinedunless the signal had aborted. They now reportOwnerCancellation.ownerClosedin that case and keep the caller's reason when the caller aborted.KunaSessionClient.closeand the JEB MCP connection's close aborted their lifetime controllers with no reason. Work cancelled by that close (for example Kuna target commands readinglifetime.signal.reason) then reported a genericAbortError. Both now abort withOwnerCancellation.ownerClosed.GhidraProvider,GhidraNativeAotSnapshotOwner) and Kuna rereadcallerSignal?.reasonafter a shared startup wait reportedcancelled. They now use the departing caller's reason that the wait returns (refactor(errors): require a reason for every analysis cancellation #10566).Change and scope
new AnalysisCancelledError(op, { cause: s.reason, ...rest })becamecancelledBy(op, s, rest)whereversis a narrowedAbortSignal. Every other cause becamecarriedReason(x), which keeps the existing value.isAborted:GhidraLauncher'sisAborted, IDA'swasCancelled,KunaSessionClient'scancelledandKunaStringQueries'#cancelled.ABORTED(IDA call wait, KunawaitFor, project reader, query work, project cache, single-function waiters, Cutter session listing, JEB catalog wait), keep their value throughcarriedReason(signal?.reason). They run only after the signal aborts.JebProvider,GhidraProviderClientandKunaCommandbuilt shared options that includedcause. The cancellation branch now passes those options withoutcause, andcause?: neverenforces that; the timeout and provider branches are unchanged.abort()calls with no reason (KunaProjectCachewaiter-less export,KunaJsonStreamrejection, yielded reader), whose reasons are not surfaced as cancellation causes, and W4b finalization.Contract and boundary impact
cancelledByandisAbortedinsrc/domain/analysisErrorCore.ts, andSharedStartupAttempt.wait(refactor(errors): require a reason for every analysis cancellation #10566); the provider adapters are consumers.causeis not projected.Expected effects: none checked. This changes error construction only.
Evidence and regression coverage
tests/boundary/providers/kuna/kunaCommandFailures.test.ts. A closedKunaTargetCommandswithout a caller abort now reportsOwnerCancellation.ownerClosed, not an invented caller cause. The test previously pinnedcausetoundefined, so it fails against the unmigrated code.Validation performed
npm run check:fast— passed (typecheck, lint).node scripts/verify/architecture-guards.mjs— passed; baseline 572 sites in 203 files, none under the migrated directories.npm run test:focused --the test files beside the changed modules plus thetests/files that import a changed module and assert on cancellation orcause(43 files) — 42 passed, 1 failed:kunaCommandFailures.test.tspinned the old absent cause. After the update,npm run test:focused -- tests/boundary/providers/kuna/kunaCommandFailures.test.ts— 9 passed.npx oxfmton changed files — formatted.Compatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.