Skip to content

WIP: 1.5.0 row 11 (niu half) — M-3 Tier C exits (bind surface + kill faces), M-4 pin to rubash#1893, --debug/--dap host wiring - #626

Merged
caomengxuan666 merged 4 commits into
masterfrom
feat150/niu-cli-m1
Oct 28, 2026
Merged

caomengxuan666 merged 4 commits into
masterfrom
feat150/niu-cli-m1

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

1.5.0 PLAN row 11, niubash half (S5 / M1). Companion to
unixwin/rubash#1893 (the rubash half). Draft — do not merge
ahead of #1893.

Pin (M-4)

scripts/release/rubash-pin.json now pins rubash
bdc1d78b002e5d76c960d98a1e0f658bef2d2cba — PR #1893's head
at this PR's submission. The pin takes #1893's merge
commit
in the integration refresh after #1893 merges; the
pin file's own note says so, in the file's established style.
Cargo floors are real from this bump: root Cargo.toml and
crates/niubash-runtime/Cargo.toml both state
rubash = "1.4.3", equal to the pinned crate version (they
previously lagged at 1.4.1 / 1.3.4 while the lock already
carried 1.4.3). The API RFC §7.2's literal
version = "1.5" floor lands with row 13's version bump; the
crate is 1.4.3 until then and stating "1.5" now would break
the pairing build it is meant to protect.

M-3: Tier C exits the main path

  • Bind registry → gated, one module. New
    crates/niubash-runtime/src/bind_surface.rs is the only
    file in the workspace naming rubash::shell::bind_registry
    or the executor's registry accessors. It converts to
    host-owned mirror types (EngineBindEntry /
    EngineBindKind) under the new internals feature of
    niubash-runtime (default-on in this change; the main binary
    enables it explicitly by depending with default features).
    grep -rn bind_registry crates/niubash-runtime/src src/
    hits exactly one file. With the feature off,
    load_engine_bindings returns empty and
    engine_bindings_stale never fires — the host runs
    degraded-but-correct, and cargo check -p niubash-runtime --no-default-features compiles with zero Tier C references
    (run in this change's verification; the compile is the
    evidence).
  • Kill hooks → Tier A/B faces. The Ctrl+C path
    (crates/niubash-runtime/src/ctrl_c.rs) now calls
    rubash::script_driver::inject_console_ctrl_c(); the
    background-wrapper handshake in src/main.rs calls
    rubash::script_driver::consume_background_wrapper_handshake().
    grep -rn "builtins::kill" crates src = 0 hits. The
    pub demotion of the old hooks lands in a rubash follow-up
    once this PR is on master (pairing CI compiles master
    against the new rubash tree, so the demotion cannot precede
    this migration).

M-2: main path on sanctioned faces

The runtime's engine contact now runs through Tier A
(Session/Executor public surface) plus Tier B driver helpers;
the two remaining Tier C families are disposed of above
(bind registry gated behind internals in one module; kill
hooks exited). docs/api-ledger.md is byte-identical to the
rubash copy (ledger v2, mirrored in this PR; pairing cmp
enforces it from here on).

Item 9: host wiring for --debug / --dap

src/main.rs::run_shell_invocation now dispatches on the
registered invocation flags before the normal route:

  • niu --dap script [args…] →
    rubash::run_dap_stdio(DapLaunchPreset { program, args })
    (the spelled-out host form's stdio endpoint);
  • niu --debug script [args…] (script form, no -c, not
    interactive) → rubash::run_debug_cli(DebugCliPreset { … })
    — the engine opens the controlling terminal for the command
    stream and refuses with the reason when there is none, per
    the debugger design;
  • every other --debug form (-c, interactive) keeps the
    existing route untouched (engine extdebug semantics).

End-to-end evidence with the real niu binary from this tree
is recorded in the cluster REPORT (DAP over stdio; --debug
under a PTY).

Verification (local; CI is the merge gate)

  • cargo check --workspace ✓; cargo check -p niubash-runtime --no-default-features ✓ (feature-off
    proof); cargo build --locked ✓; cargo fmt --check -p niubash ✓; sh scripts/check-rename-clean.sh ✓ (metadata
    confirms rubash 1.4.3).
  • cargo test -p niubash-runtime --lib --locked: failure set
    compared name-by-name against the pristine pair
    (master niubash + master rubash) on this machine — see the
    cluster REPORT for the two sets. The scripted
    cargo test --workspace route does not execute the runtime
    lib binary; that standing gap is unchanged and recorded.

…t wiring

- Bind registry gated: new crates/niubash-runtime/src/
  bind_surface.rs is the only file naming the engine's bind
  registry; it converts to host-owned mirror types under the
  new `internals` feature. Shell and REPL consume the
  surface only (staleness via Shell::engine_bindings_stale);
  with the feature off the host compiles and runs with zero
  Tier C references (cargo check -p niubash-runtime
  --no-default-features).
- Kill hooks exited: ctrl_c.rs calls
  rubash::script_driver::inject_console_ctrl_c(); the
  background-wrapper handshake in main.rs calls
  rubash::script_driver::consume_background_wrapper_handshake.
  No builtins::kill references remain in the workspace.
- M-4: pin -> rubash bdc1d78b (PR unixwin/rubash#1893 head;
  takes the merge commit at integration refresh, noted in
  the pin file); Cargo floors (root + runtime) now state
  rubash 1.4.3, equal to the pinned crate version.
- Host wiring: run_shell_invocation dispatches --dap to
  rubash::run_dap_stdio and the script form of --debug to
  rubash::run_debug_cli before the normal route; other
  --debug forms keep the existing route.
- refs unixwin/rubash#595, unixwin/rubash#497.
Mirrors unixwin/rubash#1893's ledger v2 commit; the pairing
cmp keeps the two copies identical from here on.
@caomengxuan666

Copy link
Copy Markdown
Member Author

Status at submission (paired-PR transient, expected): this PR's cross-check/cross-target jobs compile against rubash master, which does not yet carry the four engine faces this migration consumes (script_driver::inject_console_ctrl_c, script_driver::consume_background_wrapper_handshake, run_debug_cli, DebugCliPreset — all landing in unixwin/rubash#1893). CI log confirms those are the only errors. The ledger job is red mirror-wise (master still carries ledger v1; this PR carries v2). All reds clear when #1893 merges and checks re-run here.

Local verification against the paired row-11 rubash tree (this PR's pin): cargo check --workspace ✓, cargo check -p niubash-runtime --no-default-features ✓ (the zero-Tier-C compile proof), cargo build --locked ✓, runtime lib tests 599 passed / 21 failed with the failure set name-identical to the pristine pair's on this machine, plus real-binary end-to-end: niu --dap full DAP session over stdio (breakpoint stop, program output, exited 0) and niu --debug under a PTY (entry stop, break, print, continue). Full evidence: the row-11 cluster REPORT.

@caomengxuan666
caomengxuan666 marked this pull request as ready for review October 28, 2026 04:14
… keymap K1+K2 #632 + niugit pin #629 meet the row-11 migration)

# Conflicts:
#	crates/niubash-runtime/src/repl.rs
@caomengxuan666
caomengxuan666 merged commit bdd5092 into master Oct 28, 2026
9 of 10 checks passed
@caomengxuan666
caomengxuan666 deleted the feat150/niu-cli-m1 branch October 30, 2026 01:42
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