Repository navigation
feat(debuggers): name why an owned debugger stop is incomplete - #11517
Conversation
Codex Review Summary: ❌ FailedThis 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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
[Medium impact] No new blocking issue was established in the reviewed changes. SummaryAdds structured reasons when REA cannot confirm that an owned GDB or Rizin debugger stopped.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
Stop["Stop cannot be confirmed"] --> Facts["Cleanup code and reason"]
Facts --> Session["Retained session errors"]
Facts --> All["Close-all child errors"]
All --> Collect["Collect cleanup codes"]
Collect --> Exit["CLI and shutdown details"]
Reviews (3) · Last reviewed commit: "fix(debuggers): put the cleanup code on ..." · Reviewed by Greptile |
|
@greptileai review |
Owned debugger stop results carry a cleanup code; retained Rizin and GDB cleanup failures project it as details.diagnostics.debugger_cleanup, close-all failures carry it, and GDB detach refusals name multiple inferiors, a missing durable output sink, unknown inferior state or a changed inferior TTY. GdbSessionManagerCoverage asserts the codes instead of reason prose.
incompleteStopFacts builds the cleanup observation and debugger_cleanup diagnostic together, so GDB startup, cancellation and timeout failures carry the code; Rizin's composed cleanup failure retains it at its top level; and one-shot debug commands report debugger_cleanup_codes from the close-all failure.
b0acfac to
8c93485
Compare
|
Rebased onto main (8c93485). Conflicts: main's @greptileai review |
Summary
Refs #10508 (Phase 6.1). When REA cannot confirm that an owned GDB or Rizin process stopped, the retained failure now names why as
details.diagnostics.debugger_cleanup(15 codes), so agents and tests no longer read the reason sentence.GdbSessionManagerCoverageasserts the codes instead of matching "inferior disposition", "multiple inferiors", "durable output sink", "inferior detach", "inferior state" and "did not stop cleanly".Problem and expected behavior
details.diagnostics.session_stop, but an incomplete stop (OwnedDebuggerStopResultincomplete) carried only a sentence. GDB detach refusals were plainErrors whose text was folded into "inferior detach could not be verified: ...", and close-all failures were bareError(reason).GdbSessionManagerCoveragedid exactly that.Change and scope
src/domain/debuggerSessionErrors.ts:DEBUGGER_CLEANUP_INCOMPLETE_CODESandDebuggerCleanupIncomplete {code, reason}beside the existing stop codes.src/process/ownedDebuggerSession.ts: each incomplete result names its code (output-unsettled,detach-pending,inferior-disposition-unverified,inferior-identity-unverified,windows-stop-unsafe,detach-unsupported,detach-timeout,detach-unconfirmed,process-did-not-exit; detach errors keep a provider code fromOwnedDebuggerDetachFailure, otherwisedetach-failed).closeOwnedDebuggerSessionsreportsOwnedDebuggerStopFailure(withcode) per session.retainedDebuggerCleanupFailuretakes the incomplete stop and addsdiagnostics.debugger_cleanup.OwnedDebuggerSessionRegistry:retainCleanupFailuretakes the stop result instead of its reason string; a rejected stop isstop-failed.GdbSessionManager.#detachInferiorthrowsOwnedDebuggerDetachFailurewithinferior-state-unknown,multiple-inferiors,no-durable-output-sink,inferior-tty-changedordetach-failed; the two GDB errors that build their own cleanup observation also carrydebugger_cleanupbesidesession_stop.incompleteStopFacts(stopped, resources)is the one owner of the cleanup observation plusdiagnostics.debugger_cleanup; GDB startup, protocol-failure, timeout and cancellation errors use it, and Rizin's composed#finalizeFailureresult retains the code at its top level (review round 1).retainedDebuggerDiagnosticsaddsdebugger_cleanup_codesfrom the close-all failure tree, sorea debug-with-gdb/debug-with-rizinfinal cleanup failures, MCP server shutdown and the shutdown log carry the codes.docs/reverse-engineering-tools.mdlists the codes anddebugger_cleanup_codes.gdb_consoleremediation) keeps its existingcapability_unavailableshape; LLDB is not on this owner.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".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.
Contract and boundary impact
stopOwnedDebuggerProcess(src/process/ownedDebuggerSession.ts) produces the code; the session registry andretainedDebuggerCleanupFailureproject it; GDB's detach owns its refusal codesdetails.diagnostics.debugger_cleanup; messages anddetails.cleanupare unchangeddocs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs andskills/; edit authored instructions in.agents/skills/reverse-engineer-anything/and never commit build outputs): noneExpected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
GdbSessionManagerCoverage.test.ts(7 prose matches ->debugger_cleanup/errors[].code; two exactdiagnosticsexpectations now includedebugger_cleanup),ownedDebuggerSession.test.ts(12 stop results now assert their exact code; close-all failure assertscode), and fakestopProcessfixtures in 11 GDB/Rizin test files name a code (stop-failed).codeand errors nodebugger_cleanup, so the converted assertions cannot match; not run against base.For boundary fixes, identify the applicable boundary regressions
and lifecycle regressions
covered by the evidence above, and explain relevant gaps.
For evidence-bearing changes:
Validation performed
npm run test:focused --GdbSessionManagerCoverage, ownedDebuggerSession, GdbSessionReviewRegressions, gdbStartupCleanupCli, gdbCancellationMcp, rizinStoppedSessionMcp, RizinDebugSessionCoverage.part1/part3, RizinDebugSessionReviewRegressions, RizinInferiorTty, reverseEngineeringCommands, GdbSessionManagers, RizinDebugSessionManagers: 13 files, 388 passed, 21 skipped (after fixing expectations; final rerun of ownedDebuggerSession + GdbSessionManagerCoverage: 249 passed).npm run check:fast(typecheck, lint, architecture guards): passed. Pre-push hook passed.npm run test:focused --reverseEngineeringCommands, rizinStoppedSessionMcp, RizinDebugSessionCoverage.part3/part1, GdbSessionManagerCoverage, ownedDebuggerSession, GdbSessionReviewRegressions, gdbCancellationMcp, gdbStartupCleanupCli, RizinDebugSessionReviewRegressions: 10 files, 365 passed, 2 skipped. The Rizin composed-failure assertion fails with theretainDiagnosticscall removed (1 failed, 25 passed) and passes with it.npm run check:fastandnpm run docs:checkpassed.npm run docs:check,npx oxfmt --checkon changed files: passed.Compatibility, safety, and release
retainCleanupFailureandretainedDebuggerCleanupFailuretake the incomplete stop, andOwnedDebuggerStopResultincompleterequirescode.Author readiness
Human owner:
Before merge
type(scope): outcome.