Skip to content

fix(release): v1.4.0 gate followups - live-index pin bumps, armv7a NDK linker, crates re-run tolerance, current-wizard journey answers - #327

Merged
caomengxuan666 merged 2 commits into
masterfrom
fix/release-325-followups
Oct 13, 2026
Merged

caomengxuan666 merged 2 commits into
masterfrom
fix/release-325-followups

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

fix(release): v1.4.0 gate followups — live-index pin bumps, armv7a NDK linker, crates re-run tolerance, current-wizard journey answers

Four jobs of release run 38393464202 (tag v1.4.0 @ d3ed3a8) went red; this repairs each root cause on top of origin/master so the release can be re-run green.

1. build-windows (x64) — stale ecosystem pins + verify step asserting the wrong exe names

Log evidence: preinstall pin mismatch for 'niugit' (windows-x64): manifest pins 71db2476… but the live index resolves b3700097… → fail-open skip → the verify step then threw pre-install reported 'gawk,ripgrep,fd' installed but …\usr\bin\niugit.exe is missing.

Two real defects:

  • Stale pins. The wpm index moved on main since the pins were recorded: niugit 2.55.0.3 @ 71db2476… → 2.55.0.4 @ b3700097… (wpm-source set -eu 后提示符每个命令刷 5+ 条 unbound variable(oh-my-niu hooks.winux 未加保护) #77), and WinuxCmd v1.1.6 → v1.1.7 (wpm-source 691cfba0 回归: 多行数组赋值被拆成命令执行(plugins=(...) 逐元素 command not found) #78). Updated:
    • scripts/release/winuxcmd-pin.json — tag v1.1.7, x64 817e7f8f…, arm64 d3881a0e…, v1.1.7 record line in notes.
    • scripts/release/preinstall.json — niugit 2.55.0.4 @ b3700097…; pins/commands for gawk/ripgrep/fd re-verified unchanged against the same index revision.
  • Verify step vs package layout. wpm materializes a usr\bin shim per registered command (niugit ships git.exe, ripgrep ships rg.exe) — never per package name. The old loop checked package names, so the x64 leg would have thrown on niugit.exe even after a clean install (ripgrep's layout proves the rule: the failed run's staged zip lists rg.exe, not ripgrep.exe). The step now hard-asserts exactly what the pre-install step reported installed: each installed package's commands from the manifest (new field, mirroring the wpm index; package name as fallback) plus each manifest shim whose target installed — the documented niubash#312 fail-open contract, previously not what the code did.

Pin ↔ index field-by-field (unixwin/wpm-source main @ dbf971d, official-2026.10.13)

field winuxcmd-pin.json (this PR) wpm index winuxcmd match
tag / version v1.1.7 1.1.7 OK
windows-x64 sha256 817e7f8f0e4656eb519e582c2675885a5eb4f4275f81ecdbe33e1f361419bda5 same OK
windows-arm64 sha256 d3881a0ee4cc5d619b9350bf772860367a17794198f80c7cc970c3b0714bd718 same OK
asset type / urls zip WinuxCmd-1.1.7-win-<arch>.zip (assets confirmed live on unixwin/WinuxCmd v1.1.7) same OK
field preinstall.json niugit (this PR) wpm index niugit match
version 2.55.0.4 2.55.0.4 OK
windows-x64 sha256 b37000979ab6be21435270ab8c0da8a229a945946454dd78840929503eab296f same OK
commands ["git"] ["git"] OK

(gawk 25373ae8…, ripgrep 71b2fef8…/e4abca10…, fd b2816e50…/4f9110c2… and their commands all match the same index revision — verified, unchanged.)

2. build-android (armv7) — NDK wrapper name missing the trailing "a"

error: linker …/bin/armv7-linux-androideabi24-clang not found. NDK r27c's armv7 clang driver is armv7a-linux-androideabi24-clang (<triple><api>-clang, triple armv7a-linux-androideabi); the rust target name armv7-linux-androideabi had been pasted onto the wrapper. release.yml now points CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER at the real name (aarch64's line was already correct and stays), and the (so far unused) ndk_triple matrix field is corrected to armv7a-linux-androideabi.

3. publish to crates.io — re-run dies on "already uploaded"

The first v1.4.0 attempt actually published niubash-runtime 1.4.0 and niubash 1.4.0 (live on crates.io since 11:56 UTC); a re-run dies with HTTP 400 crate version '1.4.0' is already uploaded before reaching the second package. Both publish steps now capture cargo's output and treat exactly that server verdict as a successful publish (loud note, exit 0); any other failure still exits 1 under the job's continue-on-error. The already-published versions are untouched.

4. golden user journey — J2/P4 never answer the 2026-10-12 wizard questions

The wizard's question order at the tag (crates/niubash-runtime/src/setup_wizard.rs): gallery (Q1) → plugin collection (Q2.5) → Q2.6 "TAB completion style?" (added 2026-10-12) → Q3 niu-git → Q4 "External completion providers (carapace-bin)?" (reworked by #278) → Apply gate. #322 fixed only the d3 smoke journey; scripts/journey/golden-journey.py (which the release gate runs from origin/master) still stopped answering after the collection menu, so J2 timed out waiting for "niu-git" while the wizard sat at Q2.6 — and every later step was BLOCKED.

Walkthrough of the full wizard question set vs the fixed drivers:

wizard question (tag d3ed3a8) asked when J2 (fresh install) wizard_rerun (P4-S1/S2/S4) J7
Q1 theme gallery external themes exist skipped (empty-ecosystem print) answered (Skip row / walk) + Enter answered, then Esc
Q2.5 plugin collection source registry empty 4 = full skipped silently (registry non-empty) Esc defaults
Q2.6 TAB completion style always Enter (gnu pre-highlighted — no-op pick) NEW Enter NEW Esc defaults
Q3 niu-git (Windows-only, silent when a bundled niugit is detected) no lasting answer recorded Enter = Skip Enter = Skip Esc defaults
Q4 external completion providers always Enter = Skip NEW Enter = Skip NEW Esc defaults
Apply gate always Enter = Apply Enter = Apply 2 = Cancel (after Esc fast-forward)

J7 is immune: its Esc fast-forwards every remaining question to the Apply gate by design. The audit found no other interactive niu setup driver in the file.

Verification

  • Pins cross-checked field-by-field against wpm-source main @ dbf971d (tables above); both WinuxCmd v1.1.7 zip assets confirmed live on the release.
  • cargo test --locked --test preinstall_manifest — 7/7 pass (schema, pin shape, notes contracts).
  • Golden journey base gate (J1–J7) run locally against a fresh-CI-like environment (bundled winuxcmd hidden: WINUXCMD_PATH cleared, Niubash removed from PATH, Git for Windows supplied) — see the results comment.
  • Verify-step selection logic exercised against the real manifest for four outcomes (all four installed / only rg+fd / niugit failed / nothing installed) — asserts exactly the right exe names in each.
  • release.yml YAML-parses; the three edited pwsh blocks pass the PowerShell parser; golden-journey.py byte-compiles; both JSON files validate.

Manual verification for the release workflows (PR CI runs ci.yml only — build-and-test + cross-target checks; release.yml is not executed on a PR)

After merge, re-run the release via workflow_dispatch of "Niubash Release" on master (the dispatch path restores CURRENT pins/gates over the tag's copies by design):

tag: v1.4.0
winuxcmd_tag: v1.1.7
winuxcmd_sha256: {"windows-x64":"817e7f8f0e4656eb519e582c2675885a5eb4f4275f81ecdbe33e1f361419bda5","windows-arm64":"d3881a0ee4cc5d619b9350bf772860367a17794198f80c7cc970c3b0714bd718"}

Then watch:

  1. build-windows (x64) — pre-install logs pin verified: niugit 2.55.0.4 windows-x64 sha256 match and installs niugit; the verify step prints git --version / rg --version / fd --version / gawk --version / awk --version from the staged package and passes; step summary shows installed: gawk, niugit, ripgrep, fd, failed: none. (arm64 leg: niugit/gawk skipped by design, rg/fd installed, verify green.)
  2. build-android (armv7) — build links (no linker … not found); "Verify ELF shape" prints an ARM ELF32 for armv7.
  3. publish to crates.io — both steps end green; expect the loud already on crates.io … treating as success line (the versions are already live).
  4. golden user journey — J2 passes completion-style question answered with the pre-highlighted default and providers question answered with Skip, then proceeds into the clones; P4 wizard re-runs pass as well.

Note for a tag-push re-release instead: the workflow file, pins, and journey gate are all read from the re-cut tag's commit, so re-point v1.4.0 at the merge of this PR (or re-tag) for the same effect.

… NDK linker, crates re-run tolerance, current-wizard journey answers

Run 38393464202 (tag v1.4.0 @ d3ed3a8) red four jobs; each root cause:

1. build-windows (x64): the pre-install pin for niugit no longer matched
   the live wpm index (manifest 2.55.0.3 @ 71db2476... vs index 2.55.0.4
   @ b3700097..., wpm-source #77), so the fail-open path skipped niugit
   and the staged-release verify step threw on the missing shim. And the
   verify step compared PACKAGE names while wpm materializes shims per
   REGISTERED COMMAND (niugit ships git.exe, ripgrep ships rg.exe) - it
   would have thrown even on a clean install. Now:
   - scripts/release/winuxcmd-pin.json -> v1.1.7 with both per-arch zip
     digests cross-checked field-by-field against wpm-source main @
     dbf971d (official-2026.10.13); v1.1.7 record line in notes.
   - scripts/release/preinstall.json: niugit -> 2.55.0.4 @ b3700097...
     plus a `commands` mirror of the wpm index per package; notes updated.
   - release.yml verify step asserts each INSTALLED package's registered
     commands (+ manifest shims whose target installed), exactly the
     niubash#312 fail-open contract ("hard-asserts only what the
     pre-install step reports as installed") it always documented.
2. build-android (armv7): NDK r27c has no armv7-linux-androideabi24-clang;
   the armv7 triple is armv7a-linux-androideabi (the rust target name had
   been pasted onto the NDK wrapper name). The linker env now points at
   armv7a-linux-androideabi24-clang; the unused ndk_triple matrix field
   corrected too. aarch64's line was already the real name.
3. publish to crates.io: the first v1.4.0 attempt published
   niubash-runtime/niubash 1.4.0; a re-run dies on HTTP 400 "crate
   version is already uploaded". Both publish steps now treat exactly
   that server verdict as a successful publish; any other failure still
   exits 1 (loudly, under the job's continue-on-error).
4. golden user journey: J2 (and the wizard_rerun helper behind
   P4-S1/S2/S4) never answered the 2026-10-12 wizard questions - Q2.6
   "TAB completion style?" and Q4 "External completion providers
   (carapace-bin)?" - so J2 timed out waiting for niu-git while the
   wizard sat at Q2.6 (niubash#322 fixed only the d3 smoke journey).
   Both drivers now press Enter at each new step (pre-highlighted
   defaults; a no-op pick for the style), matching setup_wizard.rs's
   order: gallery -> collection -> Q2.6 -> niu-git -> Q4 -> Apply.

Verification: pins field-by-field vs the index (winuxcmd 1.1.7 x64/arm64
and niugit 2.55.0.4 identical both sides); cargo test --test
preinstall_manifest 7/7; golden journey base gate locally in a
fresh-CI-like env (bundled winuxcmd hidden) - the whole fixed sequence
passes (collection, Q2.6, niu-git, Q4, Apply, clones, trust, gallery);
verify-step logic exercised against the real manifest for four install
outcomes; release.yml YAML-parses and the edited pwsh blocks pass the
PowerShell parser; golden-journey.py byte-compiles; both JSONs validate.
@caomengxuan666

Copy link
Copy Markdown
Member Author

Local golden-journey validation of the journey fix (J1–J7 base gate, fresh-CI-like env)

Environment: local Windows 11, niu rebuilt from this branch (cargo build --locked --release), gate = python scripts/journey/golden-journey.py target/release/niu.exe --phases base. Fresh-CI-like isolation: WINUXCMD_PATH cleared, every Niubash-installed dir removed from PATH, Git for Windows supplied — without this, the wizard's documented bundled-niugit contract (silent niu-git question when probe.bundled carries niugit, #230 follow-up) silences Q3 on a dev machine that has niubash installed.

J2 checks after the fix:

[PASS] J1 fresh-install first contact: v-banner + wizard
[FAIL] J2 wizard full run: full -> trust now -> powerline-multiline
    ok   collection menu answered with 'full'
    ok   completion-style question answered with the pre-highlighted default   <- NEW (Q2.6)
    ok   niu-git question answered with Skip                                    <- question now appears (fresh-CI env)
    ok   providers question answered with Skip                                  <- NEW (Q4)
    ok   Apply gate confirmed
    ok   clone progress visible on the terminal
    ok   multiple sources cloned (>=2 clone progress lines) — counted 9 'Cloning into' lines
    ok   trust-now chosen (现在信任)
    ok   gallery navigation reached powerline-multiline
    ok   finish screen listed undo receipts
    ok   REPL alive after the wizard (first run continues)
    ok   ~/.niubashrc written with the picked theme active — rc exists: True
    ok   plugin spec declares bash-completion
    ok   spec carries the picked theme
    ok   setup journal records collection = 'full'
    ok   finish screen undo receipts captured
    BAD  every collection entry installed (no 'failed' lines) — failed oh-my-bash: git clone of 'https://github.com/ohmybash/oh-my-bash.git' timed out after 120s (fetch budget)
    BAD  theme gallery lists >60 themes — powerline-multiline sits at gallery position #58

The two remaining BADs are this sandbox's network, not the script: the wizard's own 120s per-entry fetch budget (deliberate, #296) expired on the oh-my-bash clone from this machine (GitHub asset/clone traffic is throttled here — the same reason gh release asset downloads time out), and the gallery-size proof (>60 themes) fails as a direct consequence of oh-my-bash's ~40 themes missing. Both checks pass on the release runner's network — they are unchanged from the pre-existing gate and ran green on earlier releases. Every check the journey fix touches passes, including the full pre-fix failure point (Q2.6 → niu-git → Q4 → Apply).

Also verified locally:

  • Verify-step selection logic against the real preinstall.json for four install outcomes (all four installed / rg+fd only / niugit failed / nothing installed) — asserts exactly gawk git rg fd awk in case 1, rg fd in case 2, skips the failed package in case 3, asserts nothing in case 4.
  • cargo test --locked --test preinstall_manifest: 7/7 pass.
  • release.yml YAML parse + PowerShell parser over the three edited pwsh blocks; both JSONs validate; golden-journey.py byte-compiles.

@caomengxuan666
caomengxuan666 merged commit 496f6f8 into master Oct 13, 2026
9 checks passed
@caomengxuan666
caomengxuan666 deleted the fix/release-325-followups branch October 13, 2026 13:24
caomengxuan666 added a commit that referenced this pull request Oct 13, 2026
…runner-budget recalibration, undo-receipt claim-owner resolution (#328)

Release run 38404767765 (tag v1.4.0 @ 496f6f8) red three jobs. Each root
cause, with the evidence:

1. publish to crates.io - the #327 re-run tolerance matched only the HTTP
   400 upload phrasing ("crate version `x.y.z` is already uploaded"), but
   cargo's sparse-index pre-flight refuses EARLIER with "crate
   [email protected] already exists on crates.io index" (job log
   r2-job-115321407555) - the HTTP-400 text never appears. Both publish
   steps now tolerate either phrasing; anything else still fails the
   step. The -match structure (the ForEach-Object stringification) is
   unchanged.

2. per-asset timing budget (perfbudget) - NOT a code regression: a
   machine mismatch. budgets.toml was ratified from the 2026-10-02
   baseline rig (Win10 19044); the gate runs on windows-2025 runners,
   which measure 1.1-1.9x source / 1.6-2.1x first-prompt / 1.6-3.5x
   rerender vs that baseline (same pins, same driver, run
   38404767765). 264/437 assets went over with zero local regression,
   and the 5s phase cap turned the runner's 4.1-4.8s ConPTY first-prompt
   window into "timeout (no completed rep)" cascades (55 omb.theme
   assets lost fp+rerender entirely - powerline-wizard among them).
   Local cross-check (same script/pins/N, dev box, quiet): omb.theme
   powerline-wizard src 3082ms / 90210 2876 / sirup 2210 - the dev box
   is 2-3x SLOWER than CI on source wall while CI is slower on fp;
   the committed baseline rig measured 1052/1041/868. Three machines,
   three answers: the budget must bind to the machine family that runs
   the gate. Recalibrated defaults = runner p90 rounded up ~15%
   (details in budgets.toml), phase_timeout 5s -> 12s, per-asset
   overrides refreshed for dulcie (both frameworks) and added for
   hawaii50/emperor/liquidprompt at their runner medians. The KNOWN-RED
   fix-lane list stays deliberately unratified (git completions 7.2s,
   liquidprompt, the re-render family) - the gate keeps holding it up;
   the runner data is appended to the budgets note.

3. golden journey - five failing scenarios (J6, P3-S4, P4-S1, P4-S3,
   P8-S4), ALL labeled known-fails, zero network failures: four are
   wt56-bash-completion-syntax (the engine's parser rejects
   scop/bash-completion - real defect, tracked in rubash; two lexer
   layers fixed and pushed there as rubash fix/wt56-single-quote-
   backslash @ 95b2fcc6, one deeper layer documented), one is
   wt80-undo-receipt-ambiguous-theme - the wizard's undo receipt runs
   `niu plugin disable <bare-theme-name>`, and resolution refuses bare
   names that ship from two frameworks ("pick one:
   oh-my-bash/powerline-multiline, bash-it/powerline-multiline") - the
   undo contract breaks in exactly the dual-framework state the 'full'
   collection creates (niu#168 same-name family).

   Fix (wt80): resolve_target now resolves an ambiguous bare THEME name
   to the match that owns the spec's theme claim - the claim is recorded
   intent (the pick that created the ambiguity), not a guess; with no
   claim (or a claim matching several candidates) the honest ambiguity
   error stands. Regression test:
   plugins::assets::tests::ambiguous_theme_disable_resolves_to_the_
   claim_owner (no-claim refuses, qualified enable claims, bare disable
   resolves to the owner and clears theme = '', cleared claim refuses
   again). Full niubash-runtime suite: 506 passed / 0 failed.

Self-checks: cargo fmt --clean, YAML parses (10 jobs), the pwsh
tolerance predicate exercised against all three phrasings (two
TOLERATED, unrelated error FAIL-THROUGH), rubash cli_tests failure set
identical to pristine f69e7900 (the 28 pre-existing/environmental
failures are untouched by the lexer fix).
caomengxuan666 added a commit that referenced this pull request Oct 14, 2026
… to end (run 38481728706) (#333)

Release run 38481728706 (tag v1.4.0 @ c7b9ae2, pushed) died in the
journey job's verdict self-check: FileNotFoundError on
scripts\journey\golden-journey.py while test_verdict_exit.py itself was
found. Root cause: the RUNNER_TEMP/Copy-Item gate-delivery relay nested
the directory at BOTH hops, and #330's single-file self-check delivery
masked the misdelivery for exactly one file.

1. The Preserve hop (deleted here) pre-created RUNNER_TEMP\journey with
   New-Item, so Copy-Item -Recurse copied scripts/journey INTO the
   existing destination: RUNNER_TEMP\journey\journey\*. The same
   Copy-Item semantics #327's remove-then-copy comment documented for
   the restore hop alone (release runs 2-5) - hitting from the other
   end, silently (Copy-Item exits 0).
2. The restore hop then copied the ALREADY-NESTED parent: after
   Remove-Item, `Copy-Item -Recurse RUNNER_TEMP\journey scripts/journey`
   lands the tree as scripts\journey\journey\*. (The perfbudget job
   escapes this because its restore grabs the nested child explicitly -
   RUNNER_TEMP\perf\perf, release.yml "Checkout release tag".)
3. The self-check (#330) restored exactly test_verdict_exit.py to the
   correct path - which is why the test was "found" - and its
   load_module() (test_verdict_exit.py:21, MODULE_PATH = HERE /
   "golden-journey.py") then found no module beside it.

Fix: one delivery mechanism, the one the gate body has used since
72b1f10 and #330 extended to the self-check - `git checkout
origin/master -- scripts/journey` - used at all three points:

- "Preserve current journey gate" is deleted (redundant since 72b1f10,
  and the source of the nested relay).
- "Checkout release tag" now ends with Remove-Item + git pathspec
  checkout of scripts/journey: the tag tree cannot leak files master
  deleted (pathspec checkout overlays, never deletes), and no
  Copy-Item semantics exist anywhere in the chain anymore.
- "Verdict-exit contract self-check" delivers the WHOLE current
  directory, not one file - the self-check loads golden-journey.py
  from beside itself, so a single-file delivery hands it a test with
  no module. The re-assert is idempotent and keeps the step
  self-contained against reordering.

origin/master is present in every trigger mode: checkout@v4 with
fetch-depth 0 fetches refs/remotes/origin/* (run log), and the job
checks out unixwin/niubash unconditionally.

Verified locally: release.yml YAML-parses (10 jobs, Preserve gone);
the four edited pwsh blocks pass the PowerShell language parser (with
${{ }} templating substituted); the new delivery chain was exercised
in a scratch repo with a stale-tag tree carrying a master-deleted file
- exact current-gate delivery, no nesting, idempotent re-assert;
test_verdict_exit.py / golden-journey.py / asset-timing.py byte-compile.

perfbudget: NO gate change in this commit - runs 38462805309 (6 over /
0 hard-fail) and 38481728706 (9 over / 0 hard-fail) are recorded in
the budgets.toml ledger as measured: class medians stable across four
windows-2025 runs, the over-set moves between runs, fp overs cluster
alphabetically (= temporally) with the fp tail growing 6.0 -> 7.4 ->
9.9s - transient runner contention, not per-asset regressions.
mairan / helm / elixr stay deliberately unratified (unexplained vs
baseline). A class-default bump would push omb.theme first_prompt_ms
over the 12s phase cap - the residual is a gate-semantics decision
(hard-fail-only blocking, soft-over warning; optionally a
reproducibility re-measure) and goes to owner adjudication in the PR
description; until then the gate keeps its teeth exactly as ratified.
caomengxuan666 added a commit that referenced this pull request Oct 19, 2026
Conclusion B of the rubash#827 forensics: the niubash release pipeline
never pinned rubash at all. Every job cloned rubash master at build time
into ../rubash, where the committed [patch] path override deterministically
wins over the git dependency -- so the released engine was "whatever rubash
master HEAD was when the pipeline ran". v1.4.0 (run 38506862578) compiled
e785c3c8f610 while the release era declared rubash v1.4.0 (f69e7900) and
faithfully shipped the pre-#819 stale-HOME behavior of rubash#754.

The "Pin rubash revision" steps only recorded and dirty-checked the clone;
nothing compared it to an expectation, and no pin file existed -- a double
standard next to winuxcmd-pin.json (niubash#312/#327), which hard-verifies
the bundled WinuxCmd zip bytes.

- scripts/release/rubash-pin.json: the source twin of winuxcmd-pin.json.
  rubash_rev (full 40-char sha; abbreviated forms cannot be fetched) +
  rubash_version (the Cargo.toml version AT that rev) + the bump flow.
  Initial pin: 992d5c5e6fa6 (v1.4.0), the master HEAD niubash CI is green
  against.
- release.yml: every rubash clone (8 jobs) is now "Checkout pinned rubash
  revision" -- init, fetch --depth 1 the pinned sha, checkout, submodules,
  then rev-parse HEAD must equal the pin or the job dies. The build jobs'
  "Pin rubash revision" steps additionally cross-check the clone step's
  output. The windows job preserves/restores the pin file like the other
  #312 pins (a dispatch of an old tag runs today's pin). The release body
  discloses the pin. ci.yml's dev line stays floating on rubash master on
  purpose: development should keep testing tomorrow's engine.
- build.rs: a dirty worktree now stamps `-dirty-<8 hex>`, a sha256 digest
  over `git diff HEAD --binary` (#488/#827 recommendation 3 -- a bare HEAD
  hash does not guarantee content, and two different dirty trees must not
  print the same banner). Clean trees are unchanged: the `-dirty` rule and
  the untracked-files exemption keep their exact semantics, so the release
  smoke greps (`Niubash <version> `, `rubash   git <rev>`) and the banner
  tests are untouched -- verified by tests/rubash_revision_banner.rs.
- tests/build_rs_dirty.rs: build.rs included via #[path]; fixture repos
  cover clean/dirty/staged/untracked/restore, digest stability, and digest
  sensitivity to content.
- scripts/release/verify-rubash-pin.py: the standalone auditor (used by the
  release captain and pin-freshness). --fetch dry-runs the exact fetch
  recipe into a temp dir; --self-test proves a tampered rev / wrong
  version / dirty tree / missing checkout all fail; --fetch-self-test does
  both against the real remote (wired into pin-freshness.yml, plus the
  self-test on every PR in ci.yml).

Choice note (rubash#827 recommendation 2): the pinned clone feeds the
existing [patch] path dependency (option i) instead of CI-injecting a patch
into Cargo.toml (option ii) -- the patch already applies on release CI (the
committed Cargo.lock is in path form; --locked would fail otherwise), so
pinning the tree it resolves to is the minimal, no-manifest-churn fix and
keeps `cargo build --locked` semantics identical on every job.

The current pin names rubash 992d5c5e6fa6 (v1.4.0). Bumping it is one
commit to scripts/release/rubash-pin.json; see its notes.
caomengxuan666 added a commit that referenced this pull request Oct 19, 2026
Conclusion B of the rubash#827 forensics: the niubash release pipeline
never pinned rubash at all. Every job cloned rubash master at build time
into ../rubash, where the committed [patch] path override deterministically
wins over the git dependency -- so the released engine was "whatever rubash
master HEAD was when the pipeline ran". v1.4.0 (run 38506862578) compiled
e785c3c8f610 while the release era declared rubash v1.4.0 (f69e7900) and
faithfully shipped the pre-#819 stale-HOME behavior of rubash#754.

The "Pin rubash revision" steps only recorded and dirty-checked the clone;
nothing compared it to an expectation, and no pin file existed -- a double
standard next to winuxcmd-pin.json (niubash#312/#327), which hard-verifies
the bundled WinuxCmd zip bytes.

- scripts/release/rubash-pin.json: the source twin of winuxcmd-pin.json.
  rubash_rev (full 40-char sha; abbreviated forms cannot be fetched) +
  rubash_version (the Cargo.toml version AT that rev) + the bump flow.
  Initial pin: 992d5c5e6fa6 (v1.4.0), the master HEAD niubash CI is green
  against.
- release.yml: every rubash clone (8 jobs) is now "Checkout pinned rubash
  revision" -- init, fetch --depth 1 the pinned sha, checkout, submodules,
  then rev-parse HEAD must equal the pin or the job dies. The build jobs'
  "Pin rubash revision" steps additionally cross-check the clone step's
  output. The windows job preserves/restores the pin file like the other
  #312 pins (a dispatch of an old tag runs today's pin). The release body
  discloses the pin. ci.yml's dev line stays floating on rubash master on
  purpose: development should keep testing tomorrow's engine.
- build.rs: a dirty worktree now stamps `-dirty-<8 hex>`, a sha256 digest
  over `git diff HEAD --binary` (#488/#827 recommendation 3 -- a bare HEAD
  hash does not guarantee content, and two different dirty trees must not
  print the same banner). Clean trees are unchanged: the `-dirty` rule and
  the untracked-files exemption keep their exact semantics, so the release
  smoke greps (`Niubash <version> `, `rubash   git <rev>`) and the banner
  tests are untouched -- verified by tests/rubash_revision_banner.rs.
- tests/build_rs_dirty.rs: build.rs included via #[path]; fixture repos
  cover clean/dirty/staged/untracked/restore, digest stability, and digest
  sensitivity to content.
- scripts/release/verify-rubash-pin.py: the standalone auditor (used by the
  release captain and pin-freshness). --fetch dry-runs the exact fetch
  recipe into a temp dir; --self-test proves a tampered rev / wrong
  version / dirty tree / missing checkout all fail; --fetch-self-test does
  both against the real remote (wired into pin-freshness.yml, plus the
  self-test on every PR in ci.yml).

Choice note (rubash#827 recommendation 2): the pinned clone feeds the
existing [patch] path dependency (option i) instead of CI-injecting a patch
into Cargo.toml (option ii) -- the patch already applies on release CI (the
committed Cargo.lock is in path form; --locked would fail otherwise), so
pinning the tree it resolves to is the minimal, no-manifest-churn fix and
keeps `cargo build --locked` semantics identical on every job.

The current pin names rubash 992d5c5e6fa6 (v1.4.0). Bumping it is one
commit to scripts/release/rubash-pin.json; see its notes.
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