Skip to content

WIP: api: tier-C executor seam + inject_signal doc alignment + kill hook demotion (1.5.0 migration companion) - #1999

Merged
caomengxuan666 merged 2 commits into
masterfrom
feat/150-session-tierc-seam
Oct 28, 2026
Merged

caomengxuan666 merged 2 commits into
masterfrom
feat/150-session-tierc-seam

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

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

  1. Tier-C executor seam — Session::executor() / Session::executor_mut() in src/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 in src/api/mod.rs notes the exception.
  2. inject_signal doc alignment (docs only) — Executor::inject_signal / interrupt comments 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.
  3. kill-items demotion — builtins::kill::note_console_ctrl_c and consume_background_wrapper_handshake go pub → 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.rs now calls the script_driver adoption face for the handshake like every other consumer.

Sequencing

  • niubash CI builds against rubash master, so the niubash migration PR compiles against this seam only once this PR merges; its CI red on the seam before that is the expected transitional state (same family as the ledger pairing).
  • The niubash pin bump to a rev containing this PR is a release-step concern; the migration branch already pins 5b63c80 (PR WIP: feat(api): publish the 1.5.0 Session API contract in-tree #1986's merge).
  • The closing ledger sync (seam entries + migrated consumption rows) lands as a final commit here and a byte-identical copy on the niubash branch; the cross-repo cmp canary is red until both land, per the established pairing pattern.

Gates (local, this branch)

  • cargo check --locked --lib --bins --examples with -D warnings: clean.
  • Lib tests: kill 25/25, api:: 13/13.
  • scripts/check-api-ledger.py existence: 125 symbols present.
  • Pre-existing, not from this change: cargo check --all-targets -D warnings fails on master too (unused mut in tests/issue1184_f4_procsub_diag_line_regressions.rs); left untouched here, noted for a separate hygiene fix.

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant