Repository navigation
WIP: api: tier-C executor seam + inject_signal doc alignment + kill hook demotion (1.5.0 migration companion) - #1999
Merged
Conversation
…emotion (1.5.0 migration companion) Companion to the niubash Session migration (rubash#1978): - Session::executor()/executor_mut(): recorded tier-C seam for the audited direct faces the contract does not cover (bind registry, design-3.2 AST routes, post-build provider install). The seam is the exception, never the default route. - Executor::inject_signal / interrupt docs aligned with the DECISIONS 6.4 measured contract (queue's real contract is trap dispatch; an untrapped queued copy is dropped as stale at the boundary poll; the FATAL resident set excludes SIGINT). Docs only, no behavior change. - builtins::kill::note_console_ctrl_c and consume_background_wrapper_handshake demoted pub -> pub(crate) per the API ledger's v2 demotion notes: no consumer outside this crate (niubash consumes neither hook); src/main.rs now calls the script_driver adoption face like every other consumer. Gates: cargo check --locked --lib --bins --examples with -D warnings clean; lib tests kill 25/25, api:: 13/13; check-api-ledger existence green (125 symbols). Ledger entries for the seam land with the migration's closing ledger sync, byte-identical in both repos.
caomengxuan666
added a commit
to unixwin/niubash
that referenced
this pull request
Oct 28, 2026
…nBuilder First migration step of the 1.5.0 Session contract adoption (rubash#1978; consumption audit 55-row ledger): - Shell's field becomes (None only after the finish funnel consumes it through Session::close). Accessors: session()/session_mut() for the contract faces, executor()/executor_mut() as the single recorded doors to the tier-C seam (rubash companion PR unixwin/rubash#1999). - Construction accumulates the host's configuration into SessionBuilder instead of writing it onto a bare Executor: env seeds (shell name, STARSHIP_SHELL, SHELL, BASH, BASH_ARGV0), login via builder.login_shell (the engine's mark_login_shell pair, replacing the host's hand copy), posix env seed + post-build option, disable_builtin(sudo), shell_root / winuxcmd_path / compatible_shell_path knobs, argv0 for the script name. Process-exit role stays at the builder default (library role), as with Executor::new(). HistoryProvider is deliberately NOT builder-injected: the provider installs at interactive entry through the seam, preserving the single-stream history discipline. - Every existing call site is re-pointed at the accessors unchanged (executor_mut() default, executor() where the receiver was shared); behavior-preserving by construction. The HISTFILE write in enter_interactive already goes through the variables view (borrow shape forced it, semantics are the view's own set_env funnel). Gates (local Linux): cargo check --locked --workspace --all-targets green; -D warnings workspace clean; runtime lib tests 653 passed / 21 failed with the failure name set byte-identical to the pre-migration pin-bump baseline.
caomengxuan666
added a commit
to unixwin/niubash
that referenced
this pull request
Oct 28, 2026
…nBuilder First migration step of the 1.5.0 Session contract adoption (rubash#1978; consumption audit 55-row ledger): - Shell's `pub executor: Executor` field becomes `pub session: Option<Session>` (None only after the finish funnel consumes it through Session::close). Accessors: session()/session_mut() for the contract faces, executor()/executor_mut() as the single recorded doors to the tier-C seam (rubash companion PR unixwin/rubash#1999). - Construction accumulates the host's configuration into SessionBuilder instead of writing it onto a bare Executor: env seeds (shell name, STARSHIP_SHELL, SHELL, BASH, BASH_ARGV0), login via builder.login_shell (the engine's mark_login_shell pair, replacing the host's hand copy), posix env seed + post-build option, disable_builtin(sudo), shell_root / winuxcmd_path / compatible_shell_path knobs, argv0 for the script name. Process-exit role stays at the builder default (library role), as with Executor::new(). HistoryProvider is deliberately NOT builder-injected: the provider installs at interactive entry through the seam, preserving the single-stream history discipline. - Every existing call site is re-pointed at the accessors unchanged (executor_mut() default, executor() where the receiver was shared); behavior-preserving by construction. The HISTFILE write in enter_interactive already goes through the variables view (borrow shape forced it, semantics are the view's own set_env funnel). Gates (local Linux): cargo check --locked --workspace --all-targets green; -D warnings workspace clean; runtime lib tests 653 passed / 21 failed with the failure name set byte-identical to the pre-migration pin-bump baseline.
The migration's closing ledger update, byte-identical in both repos (niubash migration branch carries the same file): §2.3 records the Session-side census and the deliberate non-adoptions; §2.2 is re-censused to the retained tier-C seam set (31 methods; 14 leave the called set, 4 previously unrecorded seam calls recorded); §4 gains the seam row and the kill demotion is marked landed; §6 records the rubash::api surface and drops the exited script_driver faces. Checker: all 148 symbols present; all 75 consumed niubash paths recorded; no warnings.
caomengxuan666
marked this pull request as ready for review
October 28, 2026 23:26
This was referenced Oct 29, 2026
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: companion to the niubash Session migration (niubash
feat/150-session-migration, tracking rubash#1978). Do not merge ahead of the migration train described below.What
Session::executor()/Session::executor_mut()insrc/api/session.rs. The published Session contract (PR WIP: feat(api): publish the 1.5.0 Session API contract in-tree #1986) deliberately has no executor accessor; the migration audit's retained direct faces (bind registry per design §8, the frozen §3.2 AST routes, post-build history-provider install) need one recorded door instead of a private-field workaround on the host side. The seam is documented as the exception whose consumer set is expected to shrink, never grow. One bullet insrc/api/mod.rsnotes the exception.inject_signaldoc alignment (docs only) —Executor::inject_signal/interruptcomments rewritten to the DECISIONS §6.4 measured contract: the queue's real contract is trap dispatch; a copy still queued at the boundary poll with no trap installed is dropped as stale; the FATAL resident set is {SIGSEGV, SIGBUS, SIGILL, SIGFPE} and excludes SIGINT. The old text claimed an untrapped fatal signal ends the run with 128+signal, which the fix: capture pipeline output in command substitution #6.4 measurements disproved. No behavior change.builtins::kill::note_console_ctrl_candconsume_background_wrapper_handshakegopub→pub(crate)per the API ledger's v2 demotion notes: neither has a consumer outside this crate (niubash consumes neither; the hosted producers/consumers are in-crate).src/main.rsnow calls thescript_driveradoption face for the handshake like every other consumer.Sequencing
cmpcanary is red until both land, per the established pairing pattern.Gates (local, this branch)
cargo check --locked --lib --bins --exampleswith-D warnings: clean.kill25/25,api::13/13.scripts/check-api-ledger.pyexistence: 125 symbols present.cargo check --all-targets -D warningsfails on master too (unusedmutintests/issue1184_f4_procsub_diag_line_regressions.rs); left untouched here, noted for a separate hygiene fix.