Skip to content

WIP: test(history): re-verify #2006/#2007 — session faces GNU-true; provider faces pinned as ignored GNU assertions (contract gap) - #2021

Merged
caomengxuan666 merged 2 commits into
masterfrom
fix/2006-2007-history-faces
Oct 29, 2026
Merged

caomengxuan666 merged 2 commits into
masterfrom
fix/2006-2007-history-faces

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

What this is

Re-verification of the two niubash#670 audit shapes on current master (16a42d7), driven through BOTH engine history-consumption paths against the GNU bash 5.3.20 oracle with identical input lines. Tests only — no product code changes. Full adjudication in the cluster REPORT (workspace fix-history-batch/REPORT.md).

#2006 — fc -l lists the fc command itself

  • Session path (standalone binary, pipe-driven -i): CORRECT. fc -l after two commands lists entries 1,2 and excludes itself — the engine's SessionHistory path computes GNU's range (builtins/fc.def:334-335, last_hist = i - rh - hist_last_line_added). Live pin: session_path_fc_list_excludes_itself.
  • Provider path (host HistoryProvider — the niubash REPL shape): DIVERGES. The host records the submitted line before the engine executes it (as bashhist.c does), so the fc line is the list's last entry; the executor's provider call site (src/executor/job_builtins.rs, execute_fc provider branch) hard-codes last_line_added=false, remember_on_history=false, so fc -l prints the fc line itself as entry 3 (verified output: 1 echo alpha / 2 echo beta / 3 fc -l).

#2007 — history numbering resets after HISTSIZE trimming

  • Session path: CORRECT. HISTSIZE=3 + four commands + history shows the global numbers 4, 5, 6 — SessionHistory::stifle advances history_base (lib/readline/history.c stifle_history) and the session display prints base + index. Live pins: session_path_history_numbering_survives_histsize_trim, session_path_history_plain_numbering.
  • Provider path: DIVERGES. The display renumbers the stifled tail from 1 (verified: 1 echo h3 / 2 echo h4 / 3 history): builtins/history.rs numbers the provider's bare entry strings from 1, and the HistoryProvider contract carries no history_base channel.

Why no engine fix in this PR

Both divergences reduce to state the HistoryProvider contract does not carry — for fc, whether the host recorded the in-flight line (hist_last_line_added); for the display, history_base. The contract was deliberately re-exported unchanged in the 1.5.0 Session API, so extending it is a contract adjudication (same class as #2001), not a cluster-level fix; host-side workarounds would corrupt faces the host owns (the store must remain the true list for its file/ledger accounting). The two provider pins therefore carry the GNU assertions under #[ignore] with the gap named inline, ready to un-ignore when the contract lands a channel.

Gates

  • Local (foreground, artifact-verified): cargo test --test issue2006_2007_history_faces → 3 passed, 2 ignored. cargo check --test issue2006_2007_history_faces with -D warnings → clean. rustfmt clean, CR=0.
  • CI: this target is not one of the CI-run integration targets; lib/regression/goldens/canary adjudication is the merge gate (diff is tests-only, one new file).

Refs #2006
Refs #2007

… provider path ignored on a contract gap

Re-verification of niubash#670 D2 on master 16a42d7, both engine
consumption paths driven against the GNU bash 5.3.20 oracle:

- Session path (standalone binary, pipe-driven -i): fc -l lists the
  two prior commands and excludes the fc line itself, matching GNU
  (builtins/fc.def:334-335 last_hist = i - rh -
  hist_last_line_added). Pin is live.
- Provider path (host HistoryProvider, the niubash REPL shape; the
  host records the submitted line before the engine executes it, as
  bashhist.c does): fc -l prints the fc line itself as entry 3.
  The executor's provider call site hard-codes last_line_added=false
  and remember_on_history=false, and the HistoryProvider contract
  carries no channel for either fact, so the GNU range cannot be
  computed. Pin carries the GNU assertion under #[ignore] pending
  the contract adjudication recorded in #2006.

Refs #2006
…th GNU-true, provider path ignored on a contract gap

Re-verification of niubash#670 D3 on master 16a42d7 against the
GNU bash 5.3.20 oracle (HISTSIZE=3, echo h1..h4, history):

- Session path: the display shows the global numbers 4, 5, 6 —
  SessionHistory::stifle advances history_base as entries drop
  (lib/readline/history.c stifle_history) and history_exec prints
  base + index. Both the trimmed and the plain numbering pins are
  live.
- Provider path: the display renumbers the stifled tail from 1.
  builtins/history.rs numbers the provider's bare entry strings
  from 1 because the HistoryProvider contract carries no
  history_base channel. Pin carries the GNU assertion (4, 5, 6)
  under #[ignore] pending the contract adjudication in #2007.

Refs #2007
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