Repository navigation
WIP: 1.5.0 row 11 (rubash half) — CLI frontend (--debug), WP-15, canonical file identity, SessionDriver Drop disarm, WP-16 extension - #1893
Merged
Conversation
…ters, canonical file identity, SessionDriver Drop disarm, WP-16 extension - src/debugger/cli.rs: the M1 terminal frontend over the frozen session operation set; command stream engine-level injectable (design Q5 (a)); rendering only through the row-6 views. main.rs leading scan claims the script-operand form of --debug; -c/-s/interactive keep the extdebug behavior. - step+/step- armings (design 6.1 portable readings) with stepping predicates; step+ compares canonical file identities at the consult. - WP-15: exception filters (err-trap / set -e / parse-error) stored in the session core; both DAP setExceptionBreakpoints sites write the one store, unknown ids rejected as a batch; exceptionInfo answered honestly (no exception at a stop until the row-12 producers land); capabilities claimed in the same change. CLI exposes the same store. - Canonical file identity (resolution::file_identity) keys breakpoint insert/query/clear and syntax-view registration: symlink, relative and short-name spellings of one file meet on one entry; different files never merge. - SessionDriver Drop disarms the gate (row-5 tail); install_debug_session stores before activating so a replaced driver's disarm lands first. - Tier A signal face: Executor::inject_signal / interrupt (RFC 6.4); Tier B driver faces script_driver:: inject_console_ctrl_c / consume_background_wrapper_handshake replace the builtins::kill hooks for hosts (M-3 staging; demotion follows niubash's migration, see the ledger). - editors/vscode/: zero-JS WP-16 extension (manifest only, adapter = rubash --debug --dap) with a validation pin. - docs/debugger-cli.md: WP-11 user guide + bashdb divergences. - Tests: scripted-stream transcript golden, CLI<->DAP stop sequence consistency pin, canonical-keying pins (symlink / relative / counter-example), Drop disarm pins, WP-15 DAP transcript. Refs rubash#595, rubash#497.
Re-census at rubash 231ffe1 / niubash c06b2a08 (65 distinct paths, 133 occurrences, 7 files). The builtins::kill hooks exit the consumed surface (Tier A Executor::inject_signal / interrupt and Tier B script_driver host faces replace them); invocation ruled Tier B (driver-layer input type); session-configuration methods ruled Tier A; driver path resolution ruled Tier B; the bind registry's gated-surface home is recorded as landed on the niubash side. The niubash copy mirrors this file in the row-11 niu PR (byte-identical rule); the pairing cmp is red by design until that lands.
…refix) The Windows goldens leg failed all three transcript tests with byte-identical behavior: the test helper canonicalized the temp program path (keeping the canonicalizer's extended-length prefix) while the frontend prints the identity form (prefix stripped), so the transcript normalization replaced nothing. The helper now produces the identity spelling itself. Linux runs were unaffected.
Member
Author
|
Companion PR is up: unixwin/niubash#626 (niu half: M-3 Tier C exits, M-4 pin to this PR's head bdc1d78, --debug/--dap host wiring, ledger v2 mirror). Its submission confirms the pairing story from the other side: niu CI fails only on the four new engine faces missing from rubash master. After this PR merges: (1) re-run #626's checks, (2) refresh #626's pin to this PR's merge commit, (3) land the recorded follow-up demoting the two kill-hook items to pub(crate). |
caomengxuan666
marked this pull request as ready for review
October 28, 2026 04:02
SpookyWaste
pushed a commit
to SpookyWaste/rubash
that referenced
this pull request
Oct 29, 2026
…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 unixwin#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: 1.5.0 row 11 (rubash half) — CLI frontend (--debug), WP-15, canonical file identity, SessionDriver Drop disarm, WP-16 extension
PLAN row 11, rubash half. The niu half follows as a niubash PR
whose pin names this PR's merge commit.
What lands
--debug) —src/debugger/cli.rs:the M1 command set (breakpoints incl. conditions and
one-shot, step/step+/step-/next/finish/return, where/frame/
up/down, list, print/eval,
set args/set varwrite-back,info topics, quit/kill lifecycle) over the frozen session
operation set; rendering only through the row-6 views.
The command stream is engine-level injectable (design Q5
ruling (a)): production opens the controlling terminal
(
/dev/tty/CONIN$, refusing with the reason when noterminal exists), tests inject a scripted stream.
main.rs's leading scan claims exactly the script-operandform;
-c/-s/interactive forms keep the extdebug behavior,and the invocation layer's
--debugregistration isre-documented accordingly.
step+/step-are new sessionarmings (design 6.1 portable readings), evaluated by the
stepping predicates —
step+compares canonical fileidentities at the consult.
err-trap,set -e,parse-error) live in the session core as operation-setstate; both
setExceptionBreakpointssites store them(unknown ids rejected as a batch),
exceptionInfoisanswered honestly (no exception at a stop until the row-12
site producers land; parking is M2), and the capabilities
claim (
supportsExceptionInfoRequest+exceptionBreakpointFilters) lands in the same change, per§13. The CLI exposes the same store (
exceptions,info exceptions).(
debugger::resolution::file_identity) keys breakpointinsertion, table queries,
clear_at, syntax-viewregistration, and completion notes: symlink / relative /
short-name spellings of one file resolve to one entry;
different files never merge; pseudo-sources pass through.
Pins: symlink spelling, relative spelling, counter-example,
idempotence. (The Windows 8.3 spelling rides the same
canonicalize call; it is exercised by CI's Windows leg via
the existing RUNNER~1-shaped fixtures, not by a Linux pin.)
disarms the process gate (the row-5 tail: an abandoned
session previously left the gate armed forever), and
install_debug_sessionstores before activating so areplaced driver's disarm lands before the new activation.
Pins: bare drop, executor drop + a fresh inert run,
install-over-install.
editors/vscode/(manifest + launch declarations only, adapter =
rubash --debug --dap), with an in-repo validation pin(manifest parses, no
main, program/args exact).Executor:: inject_signal/Executor::interrupt(RFC §6.4) and theTier B driver faces
script_driver::inject_console_ctrl_c/script_driver::consume_background_wrapper_handshake.The
builtins::killhooks staypubuntil niubash'smigration is on master (pairing compiles niubash master
against this tree); their demotion is the recorded
follow-up in the ledger.
docs/debugger-cli.md(WP-11 user guide incl.the bashdb divergences); API ledger v2 (separate commit —
see the note below).
M1 exit evidence (this half)
step into call → step into function → next ×2 → print →
finish → state → write-back (
set var) → re-print → step+ →continue, all green (
debugger::cli_tests).both frontends stops at the same lines (1, 2, 3) — PLAN §3
discipline as a test.
Gates
stock failure (
ownership_unary_operators_check_existing_file),name-identical.
-D warningson lib+bins: clean. (tests/ targets carry twopre-existing stock lints —
tests/debugger_flag_gnu_parity.rsunused import, one
unused_mutin an issue1184 test file —untouched here; they are the recorded lint-debt line.)
cargo test --test regression) locally: theidentical 4-failure set as pristine master in this
environment (CI is the goldens gate; no new red).
Ledger note for the merger
The last commit updates
docs/api-ledger.mdto v2. Thepairing job's
cmpagainst niubash master's copy goes redby design until the niu half's PR mirrors v2 (its pin
commit names this PR's merge); the pairing compile half is
green (all changes are additive to the consumed surface).
Refs: rubash#595, rubash#497 (implementation progress; both
close when the plan completes, not here).