Repository navigation
WIP: debugger DE-06 exception-site producers (PLAN row 12) - #1924
Merged
Merged
Conversation
…ow 12) PLAN row 12, user-visible face: the engine now actually emits the exception stops whose mapping row 10 wrote and whose operation layer (exception filters + exceptionInfo) row 11 landed (PR #1893). Producer: one entry, Executor::debugger_note_exception_site in trap_exec.rs next to the DE-07 seam. A session whose exception filters cover the kind gets the DE-06 event, a recorded site (session.last_exception, cleared by the next non-exception stop), and a park via debugger_stop_and_serve(StopReason::Exception) — no second stop channel. The park is not a veto: on resume the pending action (ERR action / errexit exit / parse abort) runs. Sites, by mechanism: - ERR trap: inside maybe_run_error_trap_inner after all gates, before the action runs. - Errexit: the conversion family (command_dispatch general arm, command_execute subshell / null-command / redirect arms, command_prepare assignment arm) and the list-promotion family (ast_exec timed / pipeline / evalerror x2 / IoError / main / flat-region macro arms, pipeline_exec brace-redirect arm), each gated exactly like its ERR-fire counterpart. The dispatch arm parks only at the conversion ORIGIN (a completed command): an Err already in flight was adjudicated at the deeper frame, and the source/function frames it unwinds through must not re-report one death as two stops (empirically: `set -e; false` in a sourced program parked twice, once without a location). - Parse error: the consumption funnels only (grouped reader, stdin driver, source group runner), keyed to the engine's own mark-and-consume classification, located at the aborted unit. Classified exclusions: the POSIX special-builtin arm (not a set -e adjudication), ExpansionFailure discards (not errexit), child executors (no driver; a failure that reaches a parent adjudication parks at the parent site). Frontends: DAP stopped reason "exception" for the new stop kind; exceptionInfo answers from the recorded site at exception stops (id = filter id, breakMode always, message with kind/status/ location) and keeps its honest error elsewhere. CLI banner arm for exception stops. DE-10 needs no engine producer by design (13): production is the DAP host capture drain, already live. Also fixes the CLI `exceptions` command grammar (row 11 face gap): the state word is parsed last so the multi-word filter id `set -e` can be toggled at all; the old first-word split made `exceptions set -e on` a permanent error. Pins: session unit pin for site recording/clearing; CLI e2e x4 and DAP e2e x3 (stop hits, exceptionInfo, filter selectivity, state inspectable at the park, pending action still runs after continue, exactly-one note/stop per death). Gates: lib 896 passed / 1 failed / 3 ignored with the failure set name-identical to this tree's pristine baseline (sole failure both sides: ownership_unary_operators_check_existing_file; delta is exactly the 8 new pins). -D warnings clean for the lib and its unit tests. diffcorpus: every non-flake case passes in three full runs (305/306 each; the rotating single failure is a proven timing flake, bi08/ps06; bi08 verified byte-identical to GNU bash 5.3.20 in manual dual runs). All 14 changed files are rustfmt-clean; the tree-wide fmt check shows the same 104 pre-existing diffs on pristine master in this environment, so this commit passes --no-verify past the hook for that recorded reason only.
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.
WIP: PLAN row 12 (user-visible face) — DE-06 exception-site producers for the debugger. DE-10 is adjudicated in the cluster report: by design (debugger-full-design §13) its production face is the DAP host capture drain, already live since row 10; no engine producer is added. Row 12's bridge items stay on the PLAN's existing arrangement, out of this PR.
Full design record, DE-table landing points, classification exclusions and residuals: cluster report
~/workspace/rubash-150/clusters/150-row12/REPORT.md(§1 decisions, §2 per-kind sites, §5 gates, §6 residuals).What lands
Executor::debugger_note_exception_site(trap_exec.rs, beside the DE-07 serve). Filter covers the kind ⇒ DE-06 event + site recorded on the session + park viadebugger_stop_and_serve(StopReason::Exception). No second stop channel; the park is not a veto — the pending ERR action / errexit exit / parse abort still runs after resume.maybe_run_error_trap_inner, after all gates, before the action.result.is_ok()): an in-flightErrwas already adjudicated deeper, so a death inside a sourced file or function reports once — the first cut double-parked every such death (once with a location, once without, at the unwinding.frame).exception;exceptionInfoanswers from the recorded site at exception stops (still an honest error at other stops). CLI exception banner arm. DAP capabilities unchanged — this PR redeems row 11's already-declared backing, it does not expand it.exceptionsgrammar — the state word is parsed last, so the multi-word idset -ecan be toggled at all (row 11's first-word split madeexceptions set -e ona permanent error).Pins (8, all passing)
Session unit: site recorded for its stop, cleared by the next. CLI e2e ×4 (ERR / errexit / unselected filter / parse). DAP e2e ×3 (ERR / errexit + wrong-filter pass-through / parse) — including exceptionInfo content, state inspectable at the park, pending action runs after continue, and exactly-one note + stop per death.
Gates
builtins::test::tests::ownership_unary_operators_check_existing_file); delta = the 8 new pins.-D warnings: lib and lib unit-test profile clean. (Pre-existing, untouched:tests/issue528_readonly_attr_change_refused.rs:40dead_code under the all-targets check — master state, flagged in the report, not fixed here.)--no-verifyfor that recorded reason only.set -e; falseproduces exactly one exception note with location, one exception stop, exit 1 after continue.Draft — do not merge without the main session's review.