Skip to content

Ledger: GAP-13 bookkeeping recount + unrecorded Session faces (rubash#2833) - #2844

Merged
caomengxuan666 merged 1 commit into
masterfrom
gap13-ledger-bookkeeping
Nov 5, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
gap13-ledger-bookkeeping

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

本 PR 删除了什么

  • 11 条漂移的 §2.2 计数行归零(迁移早已落地、行数从未清零):set_env 10→0、export_env 1→0、set_shopt_option 2→0、take_exit_jump_pending 2→0、bind_registry_snapshot 1→0、bind_registry_generation 2→0、execute_command 1→0、last_command_inverted 1→0、has_function 1→0、has_compspec 2→0、call_function_with_env 1→0。净行数:docs/api-ledger.md +166/−18(账本行数净 +148,内含 5 条新增 §2.3 行与 4 条新增 §6 方法条目);scripts/check-api-ledger.py +206/−0。无产品代码改动。

内容

GAP-13 记账部(rubash#2833 记账部;实体引擎棒另行):

  • §2.2 retained recount:以 niubash master 413847b7 为接收方复核(receiver grep,生产口径),声称存活 21 行 → 真实存活 10 行:execute_ast 4、take_parse_error 3(4→3)、take_signal_discard_pending 2、alias_expansion_enabled 1(4→1)、run_bind_x_command 1、bind_readline_variable 1、script_fd0_line 1、last_exit_code 1、builtin_command_names 1、find_script_on_path 2(1→2,第二处为 main.rs:1164 的裸 Executor 调用)。漂移机制记入 §2.2 recount 段:行数写于迁移时、之后从未重读;canary 的 completeness 半区只扫 rubash::… 路径 token,看不见 receiver-form 方法调用,故陈旧计数不触发任何门。
  • §2.1 修正:CommandNode 14→11、pretty_print_command 1→0、tracked 脚本驱动臂 1→0、bytes_to_script_text 1→3。
  • 四张已消费未入账 Session 面(§2.3 行 + §6 方法条目):Session::glob_filename(completer.rs:540)、Session::notify_terminal_size(shell.rs:2944)、Session::expand_shell_words(shell.rs:3360)、Session::environment(repl.rs:1131;由 census 本身抓出,人审漏掉了);另补 Session::call_function_with_env 的 §2.3 行(shell.rs:3462;§6 条目早已存在)。
  • §2.3 set_history_provider 0→1:GAP-10 宿主 adoption 已随 niu perf(env): gate the process-env mirror on special names (#916) #917(merge 413847b7)落地,交互入口经面安装(shell.rs:1125)。
  • Session 方法 census 落地(§5.5 + scripts/check-api-ledger.py):枚举引擎 impl Session 全部 pub fn(61 个),扫 niubash 的 receiver-form 调用(.name( + Session::name(),已消费未入账即失败;AMBIGUOUS_SESSION_METHODS curated 清单(首项 parse——宿主 15 处皆为 FromStr::parse,已人手核实)只警告不失败。附 self-test(三段:bogus symbol / completeness / census 含 ambiguous 路径)。
  • §4 一处散文修正:inherit_process_stdin 目标家由“builder stream binding”改为契约方法(§2.3 行早已如此写)。
  • Q-G:两动词(Session::register_binding、Session::initialize_readline)本波不在任何处记录,随实体引擎 PR 入账。

验证(本棒自测,UNVERIFIED-BY-CAPTAIN)

  • python3 scripts/check-api-ledger.py --self-test:三段全绿。
  • python3 scripts/check-api-ledger.py:279 个账本符号全存在(275 + 4 新增)。
  • python3 scripts/check-api-ledger.py --niu <niubash master 413847b7>:101 条已消费路径全已记录;Session census:61 个已声明方法、44 个被宿主调用;ambiguous parse 15 处仅警告(已人手核实全为 FromStr::parse)。
  • 全量 lib 套件正在跑(账本 + 检查脚本改动,产品代码零改动;结果见 REPORT)。

Refs rubash#2833, niubash#863

…#2833)

Re-count the retained-seam table (§2.2) against niubash master
413847b7 by receiver grep: claimed-live 21 -> true live 10.
Eleven rows are drift (migrations landed, rows never zeroed):
set_env, export_env, set_shopt_option, take_exit_jump_pending,
bind_registry_snapshot, bind_registry_generation, execute_command,
last_command_inverted, has_function, has_compspec,
call_function_with_env. Three rows corrected, not zeroed:
take_parse_error 4 -> 3, alias_expansion_enabled 4 -> 1,
find_script_on_path 1 -> 2. Same wave corrects §2.1
(CommandNode 14 -> 11, pretty_print_command 1 -> 0, the tracked
script-driver arm 1 -> 0, bytes_to_script_text 1 -> 3) and
records four Session faces consumed but nowhere in the ledger
(glob_filename, notify_terminal_size, expand_shell_words,
environment) plus the call_function_with_env §2.3 row.
Session::set_history_provider reads 1 now (GAP-10 host adoption
landed with niu #917). The Session-method census lands in the
tripwire (§5.5) with a self-test; it is what caught
Session::environment. The bind/readline assembly verbs enter
NOWHERE here, per the GAP-13 ruling Q-G.

Refs rubash#2833, niubash#863
@caomengxuan666
caomengxuan666 marked this pull request as ready for review November 5, 2026 17:09
@caomengxuan666
caomengxuan666 merged commit 1404e59 into master Nov 5, 2026
10 of 11 checks passed
@caomengxuan666
caomengxuan666 deleted the gap13-ledger-bookkeeping branch November 5, 2026 17:09
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