Skip to content

WIP: feat(executor): Executor::bind_readline_variable host read probe (#2183) - #2185

Merged
caomengxuan666 merged 1 commit into
masterfrom
fix/2183-bind-readline-variable-accessor
Oct 30, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
fix/2183-bind-readline-variable-accessor

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Refs #2183

What

Adds Executor::bind_readline_variable(&self, name: &str) -> Option<String>, the host read probe niubash's REPL already calls in niubash#704:

let raw = shell.executor().bind_readline_variable("keyseq-timeout")?;

The method did not exist on the engine side — that absence is the single E0599 failing all eight of niubash#704's CI jobs (run 40998846835), and #704 blocks #710. The state and its getter were already here: the accessor is a thin delegation to BindRegistry::variable_value (src/shell/bind_registry.rs), reached through the same shell_state.bind_registry.borrow() path as its sibling probes bind_registry_snapshot / bind_registry_generation / bind_editing_mode in src/executor/bind_builtins.rs. No new state, no caching, no side effects.

Ledger

Recorded in docs/api-ledger.md: header addendum, the §2.2 retained-set row (bind_readline_variable, 1 call), and the §6 entry method rubash::executor::Executor::bind_readline_variable. Tier: C, via the §4 executor seam, alongside the other bind-registry faces. scripts/check-api-ledger.py passes (159 symbols present).

Merge-order note (for the main session): the matching niubash-side ledger line goes in a separate niubash PR that the main session merges FIRST; this PR merges second. Until the niu mirror lands, the pairing job's same-source cmp is expected to flag the one-line ledger delta; that is the staged-record flow, not a defect in this PR.

Pins

Lib-level, in src/executor/bind_builtins.rs tests:

  • issue2183_bind_readline_variable_reads_back_bind_set_value — fresh registry reads the GNU default (keyseq-timeout = 500); bind 'set keyseq-timeout 250' through the engine's own bind path reads back 250; a later set to 125 is what the accessor reports.
  • issue2183_bind_readline_variable_unknown_name_is_none — a name outside the readline variable table returns None.

Red on master by construction: the method does not exist at 786e121 (only unbind_readline_variables comment hits), so the pins cannot compile there — the same E0599 niubash#704's CI shows. Post-fix: cargo test --lib bind_builtins = 10 passed / 0 failed.

Acceptance (verify-only, separate report in the cluster REPORT)

niubash feat/bind-mode-toggle (PR #704 head) checked against this rubash tree via its [patch] sibling layout: see the cluster REPORT.md for whether the E0599 is gone and whether any further missing-engine-method errors surface behind it.

Refs #2183

niubash's REPL (niubash#704) reads the keyseq-timeout readline
variable through shell.executor().bind_readline_variable(...),
but the Executor had no such method: the registry getter
BindRegistry::variable_value existed all along, with no
host-facing probe beside bind_registry_snapshot /
bind_registry_generation / bind_editing_mode. That absence is
the single E0599 failing all eight of niubash#704's CI jobs.

Add the probe delegating to variable_value (no new state, no
caching), record it in the API ledger (header addendum, the
SS2.2 retained-set row, the SS6 method entry), and pin it at
lib level: bind 'set keyseq-timeout ...' reads back through
the accessor, the fresh-registry default is 500, a changed
value is reported, and an unknown name returns None.
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