Skip to content

chore(ci): weekly renovation 2026-08-23 - #3880

Merged
max-sixty merged 15 commits into
mainfrom
chore/weekly-renovation-2026-08-23
Aug 24, 2026
Merged

max-sixty merged 15 commits into
mainfrom
chore/weekly-renovation-2026-08-23

Conversation

@worktrunk-bot

@worktrunk-bot worktrunk-bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Weekly CI renovation. Rust stable moved to 1.98.0 on 2026-08-20, so MSRV and the development toolchain go to 1.97 (latest stable − 1); one cargo-install pin had drifted. Everything else is already current.

  • MSRV + toolchain: 1.96 → 1.97 — Cargo.toml, tests/helpers/wt-perf/Cargo.toml, rust-toolchain.toml (1.97.0), plus the flake.lock refresh the channel bump requires.
  • cargo-llvm-cov: 0.8.7 → 0.9.0 — coverage.yaml. MSRV 1.87, well under the pinned toolchain.

Toolchain compatibility for every other pinned crate against 1.97.0: cargo-affected 0.4.0 (1.94), cargo-insta 1.48.0 (1.66.0), cargo-nextest 0.9.143 (1.91), cargo-llvm-cov 0.9.0 (1.87), cargo-msrv 0.19.3 (1.91.1), lychee 0.24.2 (1.88.0), worktrunk 0.74.0 (1.96), cargo-udeps 0.1.61 (unspecified). All build under 1.97.0.

The remaining commits are fallout from the same sweep: cargo-llvm-cov 0.9.0 changes the shape of the --show-missing-lines column tests/CLAUDE.md sends you to during a codecov investigation, and the weekly statusline cache-check has been reporting two duplicates that are artifacts of its own -vv flag.

The MSRV bump broke two nightly jobs; that is fixed here

check-unused-dependencies and minimal-versions each pin their own toolchain, and nightly-2026-03-01 is 1.96.0-nightly — so raising rust-version to 1.97 made cargo refuse the workspace outright, before either job ran its actual check:

error: rustc 1.96.0-nightly is not supported by the following packages:
  [email protected] requires rustc 1.97

Both are now on nightly-2026-08-01 (1.99.0-nightly), which clears the new MSRV with headroom rather than landing on it. Reproduced locally in both directions: cargo +nightly-2026-03-01 check fails with the error above, cargo +nightly-2026-08-01 check passes. The coupling is easy to miss because neither failure mentions udeps or minimal versions, so both lines now say so, and the weekly MSRV file table gained a row for the pins. The rule on that row is a date, not a version: bump only when the pinned date is more than three months old. Nightly runs two channels ahead of stable and MSRV tracks stable − 1, so a pin that recent is still a release above the new MSRV — which makes staleness checkable from the pinned date alone, where reading it off the rustc version means fetching that day's channel-rust-nightly.toml. nightly-2026-03-01 was five and a half months old, which is exactly what the rule catches.

The flake.lock bump was computed by hand — and the recipe that forced that is fixed here

rust-toolchain.toml moving to 1.97.0 forces a lock refresh: the locked rust-overlay (4a408e1f, 2026-06-02) carries stable manifests only up to 1.96.0, so nix flake check cannot resolve the new channel. rust-overlay is bumped to f60c1b57 (2026-08-23), which has 1.97.0.nix. nixpkgs and crane are left alone — only rust-overlay has to know about the new channel, and a full nix flake update is a wider change than this PR needs.

This session could not run nix flake update: the weekly runner has no Nix, and the agent runs as a sandbox user with no sudo, so the installer the skill pointed at stops at sudo: a password is required. The lock entry was therefore computed directly from the NAR serialisation, and the method was validated first by recomputing the existing rust-overlay entry from its own revision and getting sha256-7mDa7OBAaf7MU6ZovT9ENfD62kH911SsSazBb4KTDF0= back byte-for-byte — the value already in flake.lock. The same script then produced the new entry.

That should not have been the answer, and it no longer is. #3891 has merged (2960bfb), so tend-setup installs Nix and next week's refresh runs nix flake update rust-overlay for real. This branch briefly carried its own cachix/install-nix-action@v31 step in the same file; adbeb76 dropped it in favour of #3891's, which asserts the multi-user install branch directly and doesn't couple to github.workflow == 'tend-weekly', a gate that stops firing if the generated workflow is renamed. .github/actions/tend-setup/action.yaml on this branch is byte-identical to main.

What stays here is the skill side: the in-session install recipe and the NAR-serialisation fallback are both deleted, because the Determinate installer they rest on cannot run in the sandbox. Both PRs rewrote that section and converged on nearly the same wording, so they merged clean while both were open — but #3891's squash collapsed its five commits into one, and its last two had moved the "if nix isn't on the PATH" line and folded the flake-input rationale into the code block. That turned the section into the merge's one conflict, resolved by taking main's wording wholesale; the section is now byte-identical to main's, and this branch's own additions to that file are untouched by it.

That is a strong check but not the real one. nightly's nix-flake job runs nix flake check and fires on this PR (the paths filter matches rust-toolchain.toml, Cargo.toml, and flake.lock), so it is the gate that actually proves the lock evaluates. It has now run on this head and passed, so the computed lock resolves the 1.97.0 channel and the flake's checks build under it. Flagging the provenance anyway, since a hand-written lock entry deserves a second look on review.

How the hash was computed

Nix serialises the unpacked flake input as a NAR and reports SHA-256 of that stream in SRI form. The format is length-prefixed strings padded to 8 bytes, with directory entries in bytewise-sorted order; a ~90-line Python script reproduces it from the GitHub tarball with the top-level <repo>-<rev> directory stripped, which is the same tree Nix hashes.

rust-overlay 4a408e1fc99ad517b4cb402fd0de7464f40c05e1 (currently locked)
  computed  sha256-7mDa7OBAaf7MU6ZovT9ENfD62kH911SsSazBb4KTDF0=
  in lock   sha256-7mDa7OBAaf7MU6ZovT9ENfD62kH911SsSazBb4KTDF0=   ✓

rust-overlay f60c1b57ff805a46b5175c76fc981fb4f81efbcc (new)
  computed  sha256-r4LDUF+zmJnkftvCVkCrUhSJazsf6EVJF+V2l4/MYbI=
  lastModified 1787454509 (committer date 2026-08-23T03:08:29Z)

Already up to date

  • cargo-affected 0.4.0, cargo-insta 1.48.0, cargo-nextest 0.9.143, cargo-msrv 0.19.3, cargo-udeps 0.1.61, lychee 0.24.2, worktrunk 0.74.0 (matches the newest crates.io release)
  • Nushell 0.115.0 — all four call sites, and dev/codex.sh
  • Codex Cloud pins in dev/codex.sh: pre-commit 4.6.2, cargo-insta 1.48.0, cargo-nextest 0.9.143, PowerShell 7.6.5; setup-web's own Nushell and PowerShell pins agree
  • Runner images ubuntu-24.04 and windows-2022 (the latter deliberately pinned — Windows-latest workflows will use Windows Server 2025 image in GH actions/runner-images#12677)

Found, not bumped: macos-15 is no longer what macos-latest resolves to

ci.yaml's header comment says ubuntu-24.04, macos-15 are "pinned to current -latest equivalents". That is still true of Ubuntu but no longer of macOS: macos-latest now resolves to macOS 26 arm64, and macos-15 has become the older of the two GA images — which, under the runner-images deprecation policy ("deprecation of the oldest image label begins once the newest OS image label has been released to GA"), is the one that starts aging out next. macos-14 already carries the deprecated badge.

Not bumped here, because it is an OS upgrade rather than a version pin, and this repo drives PTY and shell-integration snapshots on macOS that a new image and Xcode can move. There is also nothing this session can do to check it — the only macOS available to it is the test (macos) job on a PR, and a red macOS matrix would have blocked the MSRV bump alongside it. Flagging rather than guessing at the timing: whether to take macOS 26 now or wait for the deprecation announcement is a call about this repo's snapshot surface. Happy to open it as its own PR if you want the signal.

CI

Fully green on 7940a97, the first merge of main: all 33 non-skipped checks, including msrv, all three test legs, full-tests on every platform, nix-flake, minimal-versions, check-unused-dependencies, check-docs, link-check, feature-powerset, and codecov/patch. That head is where the hand-written lock entry and the nightly pins were proven against the current main.

main has since moved four commits (#3886, #3893, #3895, #3897) and is merged in again at d8d1553, alongside the nightly-pin rule above. #3895 touches nightly.yaml, so the pins were re-checked after that merge: still exactly two sites, minimal-versions and check-unused-dependencies, both on nightly-2026-08-01. Locally pre-commit run --all-files and test_docs_are_in_sync pass on this head.

Weekly checks that produced no change

  • LLM model pins — no drift. gpt-5.6-luna is still how OpenAI's models page positions the "fast and affordable … lowest cost in the family" 5.6 variant; gpt-5.3-codex-spark is a Pro-only research preview, not a default. haiku / claude-haiku-4.5 is still the smallest current Anthropic model.
  • Statusline cache-check — clean. command_count was 27, which includes the three calls the -vv diagnostic collector makes after the render, so the render itself is ~24 against a ~29 baseline measured before the recipe used -vv. The two duplicates the report flagged (gh --version, git worktree list --porcelain) are that same collector, not the render. Both the baseline arithmetic and the trap are now written down in the skill.
  • Agent app integration surfaces — nothing that changes what Worktrunk consumes. Claude Code 2.1.239 fixed metadata.pluginRoot resolution, but .claude-plugin/marketplace.json names an explicit ./plugins/worktrunk source rather than a bare name, so it is unaffected; the WorktreeCreate/WorktreeRemove hooks and the statusline stdin schema are unchanged (workspace.git_worktree and workspace.repo exist but predate this window by several hundred releases). Codex, Gemini CLI, and OpenCode shipped only routine releases.
  • README month — already "August 2026".
  • Dependency PRs — none open.
Verification
  • rustup resolves the new channel: cargo 1.97.0 (c980f4866 2026-06-30), rustc 1.97.0 (2d8144b78 2026-07-07), clippy 0.1.97.
  • cargo clippy --all-targets --all-features -- -D warnings passes on 1.97.0 — the check that matters most for a toolchain bump, since it compiles every target and feature under the new rustc and holds the new clippy to zero warnings. Doctests passed too.
  • Unit tests pass on 1.97.0: 979 + 11 + 1, zero failures.
  • Integration tests: 2000 passed, 1 failed — test_copy_ignored_preserves_file_executable_permissions, which expects 0644 and got 0664. That is this sandbox's umask 0002, not the toolchain; the test (linux|macos|windows) matrix is the real gate.
  • cargo run -- hook pre-merge --yes is not a clean local signal on this runner: it ends on pre-commit: exit status: 127 because pre-commit isn't installed in the tend sandbox, unrelated to the bump.
  • cargo msrv verify was not run locally (it rebuilds the graph per candidate); ci.yaml's msrv job covers it.
  • Every version above was read from its upstream source of truth: cargo info / crates.io for the cargo tools, static.rust-lang.org/dist/channel-rust-stable.toml for Rust stable (1.98.0, 2026-08-20), the nushell/nushell and PowerShell/PowerShell release APIs, PyPI for pre-commit, actions/runner-images README for the image labels, and the vendors' own model pages for the LLM pins.
  • rust-overlay at the currently-locked revision was confirmed to stop at 1.96.0.nix, and at the new revision to contain 1.97.0.nix — this is why the lock has to move at all.

This was written by Claude Code on behalf of max-sixty

Rust stable reached 1.98.0 on 2026-08-20, so MSRV and the development
toolchain move to 1.97 (latest stable - 1). The channel bump forces a
flake.lock refresh: the locked rust-overlay (4a408e1f, 2026-06-02) carries
stable manifests only up to 1.96.0, so nix flake check cannot resolve
1.97.0 without it. Only rust-overlay moves -- nixpkgs and crane do not need
to know about the new channel.

Also bumps cargo-llvm-cov 0.8.7 -> 0.9.0, the one cargo-install pin that
had drifted. Every other pinned crate, the Nushell and PowerShell pins, and
the Codex Cloud tools in dev/codex.sh are already current.
0.9.0 collapses consecutive misses into ranges, so the column the coverage
investigation recipe sends you to no longer lists one line per miss. Say so
where the recipe compares it against a codecov line list.
The statusline cache-check reads a trace that only exists because of -vv,
and the diagnostic collector that writes the bundle runs its own
git --version, git worktree list --porcelain, and gh --version after the
render. Those land in the same trace, so the .cache report flags two
same-context duplicates on an otherwise clean render -- which costs a fresh
investigation every week. Name them, and say where in trace.log to confirm.

@worktrunk-bot worktrunk-bot left a comment •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the whole sweep against upstream: stable is 1.98.0 (2026-08-20), so 1.97 is the right MSRV; cargo-llvm-cov 0.9.0 is the only drifted pin and it is the only cargo-llvm-cov pin site in the repo; every other pinned crate matches its newest crates.io release and every rust-version clears 1.97.0. The rust-overlay entry checks out on everything reachable without Nix — f60c1b57 exists, lastModified 1787454509 is its committer date to the second, manifests/stable/1.97.0.nix is present there and 404s at the currently-locked revision. The nix-flake job does fire on this PR (the gate paths filter matches Cargo.toml, rust-toolchain.toml, and flake.lock), so the narHash gets the real check.

Three findings — I've pushed fixes for all three rather than leaving inline suggestions, since this is a bot-authored PR with no human author to apply them.

Two nightly jobs are red because of this PR, and it isn't a flake

nightly.yaml pins its own toolchain twice — minimal-versions and check-unused-dependencies both do rustup override set nightly-2026-03-01, which resolves to 1.96.0-nightly. With rust-version now 1.97, cargo refuses before either check runs:

error: rustc 1.96.0-nightly is not supported by the following packages:
  [email protected] requires rustc 1.97
  [email protected] requires rustc 1.97

Both jobs failed with that identical error. This is deterministic and PR-caused: the last two nightly runs on main failed only on link-check, with both of these green. It would also follow the PR onto main — nightly's push trigger lists **/Cargo.toml, so the post-merge run fails the same way.

The pin is stale rather than newly wrong. It was set on 2026-05-07 in #2636 and never moved; the previous MSRV of 1.96 was the last one it could satisfy, so this bump is where it runs out. The reason nothing caught it is that the weekly MSRV task's file table lists only Cargo.toml, tests/helpers/wt-perf/Cargo.toml, and rust-toolchain.toml — a fourth place in the repo pins a toolchain and isn't on the list.

Pushed as 7d1b466: both pins move to nightly-2026-08-01 (1.99.0-nightly), which clears the MSRV with two release cycles of headroom instead of landing exactly on it, plus a comment stating the constraint on each and a row in the skill's MSRV table so the weekly pass owns them from here.

command_count counts the collector's calls, against a baseline that predates them

The new bullet is right that the -vv collector's git worktree list --porcelain, gh --version, and git --version land in the same trace — but the sentence added just below it points at command_count as "the number to read" against the ~29 baseline, and command_count is every subprocess record in the trace, so it includes those same three calls.

The baseline is collector-free. It was measured in #2211 with RUST_LOG=debug … | grep wt-trace | wt-perf cache-check — no -vv, no bundle. #3825 switched the recipe to -vv plus config state logs profile without re-measuring it. So command_count runs about three high against 29, which is the entire width of the ~32 investigate threshold. Nothing was misread this week (27 is under it either way), but a render that genuinely drifted to 30 would read as 33 and draw an investigation, and one at 32 reads as clean at 29.

Pushed: the sentence now says command_count includes the collector's three calls and that the baseline predates them, so a comparison subtracts them first.

.git/wt/logs/trace.log is the path shape this skill warns about

The confirmation step sends you to .git/wt/logs/trace.log, and the recipe above it says "Run from any worktree of this repo." In a linked worktree .git is a gitdir file, so that read fails with ENOTDIR — which is exactly what the Issue Triage section of this same file already tells us not to hand people, with $(git rev-parse --git-common-dir)/wt/logs/ as the form that resolves from anywhere. Pushed the same substitution here.

Not blocking

cargo-llvm-cov 0.9.0 also stops emitting build scripts under Cargo's new build-dir layout. coverage.yaml uses --cobertura, not --show-missing-lines, and build.rs sits outside the src/-only report, so I don't expect movement — but this PR's own code-coverage run is the first one on the new version, so it's the place to notice if the project number shifts.

On the macos-15 note: agreed it's a separate PR, and worth taking before the deprecation lands rather than after, given how much of the snapshot surface is macOS-specific.


After the fix — where CI landed

The nightly run on bc35d51 (which carries 7d1b466) has minimal-versions and check-unused-dependencies both green, so the pin bump is confirmed rather than assumed. nix-flake also passed there — that is the real check on the hand-computed narHash, so the one part of this PR that couldn't be verified without Nix now has been. Required checks, msrv, codecov/patch and codecov/project are all green.

Two reds remain, and neither is this PR's: check-docs and link-check both die in npm ci with the @astrojs/check peer conflict against [email protected], before either reaches its actual work. That is already red on this PR's merge base (be2c088a) and is what #3877 fixes. Worth knowing that my push is why they are visible here at all — .github/workflows/nightly.yaml is in ci.yaml's docs paths filter, so touching it flipped check-docs from skipped to running. Merging #3877 first should clear both.

The MSRV bump to 1.97 in this PR fails both nightly jobs that pin their own
toolchain: `rustup override set nightly-2026-03-01` resolves to
1.96.0-nightly, and cargo refuses a workspace whose `rust-version` exceeds the
toolchain, so `minimal-versions` and `check-unused-dependencies` both die with
"rustc 1.96.0-nightly is not supported" before running their checks. It would
follow the merge onto main too -- nightly's push trigger lists `**/Cargo.toml`.

The pin was set in #2636 and never moved; 1.96 was the last MSRV it could
satisfy. Move both to nightly-2026-08-01 (1.99.0-nightly), which clears the
new MSRV with two release cycles of headroom instead of landing on it, and
say so on the line so the constraint isn't rediscovered.

Add the pins to the weekly MSRV file table, which listed only the three
manifests -- the reason nothing caught this before the bump landed.

Also fixes two things in the statusline cache-check the previous commit
touched: `command_count` includes the -vv collector's three calls, against a
baseline measured in #2211 before the recipe used -vv (#3825 switched it
without re-measuring), so it reads ~3 high against a threshold only 3 wide;
and `.git/wt/logs/trace.log` is the gitdir-file path shape this same skill
warns about, since the recipe says to run from any worktree.
The MSRV section assumes the Determinate installer works, but it escalates
via sudo and the weekly runner has none, so this week's bump hit a dead end
with the lock refresh non-optional: nix flake check can't resolve a channel
the locked rust-overlay predates. Write down the fallback that worked --
compute the narHash from the NAR serialisation, and validate the script
against the entry already in the lock before trusting it on a new revision.
@worktrunk-bot

Copy link
Copy Markdown
Collaborator Author

All three review findings were pushed before the review was submitted, so there's nothing outstanding to apply — but none of them had actually been verified by CI at that point, and one of the checks that matters most had never run. It has now.

The nightly-pin fix is confirmed. minimal-versions and check-unused-dependencies — the two jobs that failed on f9292b41 with rustc 1.96.0-nightly is not supported — both pass on bc35d518 with the nightly-2026-08-01 pin.

nix-flake passed, and this run is the first time it actually completed here. It was cancelled on both earlier heads: nightly sets cancel-in-progress for PR events, so each push killed the run mid-job. Reading back through the earlier runs shows nix-flake: cancelled twice, which would leave the hand-computed narHash looking unchecked — it isn't any more. nix flake check resolved the 1.97.0 channel against the hand-written rust-overlay entry, which is the gate the description asked to watch before merging.

check-docs and link-check are red for a cause outside this PR. Both die at the same npm ci step with ERESOLVE: docs/package.json carries typescript@^7.0.2 (from #3870) while @astrojs/[email protected] peers on typescript@^5.0.0 || ^6.0.0. link-check never reaches lychee — it fails in 🕷️ Check and build docs with Install lychee and 🔗 Check links skipped. That file is byte-identical to main on this branch and the PR touches nothing under docs/; main's own ci has been red on check-docs since #3870 merged, including at this PR's merge base be2c088a. #3877 already fixes it, and #3879 is the same root cause.

Also clears the not-blocking note from the review: code-coverage passed on cargo-llvm-cov 0.9.0 and both codecov/patch and codecov/project are green, so the version bump didn't move the project number.

Full check state on bc35d518

Green: test (linux), test (macos), test (windows), msrv, lint, fast-checks, feature-check, changes, gate, code-coverage, codecov/patch, codecov/project, crate-build, nix-flake, minimal-versions, check-unused-dependencies, full-tests on all three platforms, release-target for both musl triples.

Red: check-docs, link-check — both #3870, fix in flight at #3877.

Still running when this was written: feature-powerset, release-target (x86_64-apple-darwin).

Nightly history on this branch, showing why nix-flake had no result until now:

head nix-flake minimal-versions check-unused-dependencies
f9292b41 (pre-fix) cancelled failure failure
7d1b466c (fix) cancelled cancelled cancelled
bc35d518 (current) success success success

@max-sixty

Copy link
Copy Markdown
Owner

flake.lock needs no hand-computed hash here — the Nix install just has to happen one layer out.

.claude/skills/running-tend/SKILL.md tells the session to install Nix itself:

sh /tmp/nix-installer.sh install --no-confirm --determinate

tend runs the agent as a sandbox user that proxy/setup-sandbox.sh creates with sudo useradd -m and never adds to sudoers, so that installer stops at sudo: a password is required on every run. The recipe points at a layer that has no root.

.github/actions/tend-setup/action.yaml does. It runs as runner before the tend action starts, and already calls sudo apt-get install -y zsh fish. A Nix install step there makes nix flake update an ordinary command for the weekly pass, and both the NAR-serialisation script and the "When the installer can't run" section added here stop being needed. The in-session install should come out of the recipe either way, since it describes something that cannot succeed.

This was written by Claude Code on behalf of max-sixty

The MSRV recipe told the session to run the Determinate installer itself,
which cannot succeed: tend runs the agent as a sandbox user with no sudo,
so the installer stops at `sudo: a password is required`. That is what
pushed this PR's lock entry onto a hand-computed NAR hash.

`tend-setup` runs as `runner`, one layer out, where sudo works. Installing
Nix there makes `nix flake update` an ordinary command for the weekly pass:
the multi-user install puts `/nix/var/nix/profiles/default/bin` on the
runner PATH, which tend's sandbox PATH derivation carries across, with
flakes enabled system-wide in `/etc/nix/nix.conf`.

Gated to `tend-weekly` so the other tend workflows don't pay for it, and no
GitHub token is passed — the action would write it into world-readable
`/etc/nix/nix.conf`, and the credential proxy already authenticates the
sandbox's github.com traffic.

The skill's in-session install recipe and the NAR-serialisation fallback
both come out.

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving the install one layer out is the right shape, and the mechanics check out: tend-weekly's name: is tend-weekly, so the github.workflow gate matches; ubuntu-24.04 has systemd, so the action takes its daemon branch and appends /nix/var/nix/profiles/default/bin to $GITHUB_PATH; setup-sandbox.sh derives the sandbox PATH from the runner's and drops only entries under the runner home, so that dir survives the rewrite while a ~/.nix-profile single-user install wouldn't have. experimental-features = nix-command flakes lands system-wide because extra_nix_config is empty, which is what lets the recipe drop --extra-experimental-features. Two corrections below — pushing both rather than leaving suggestions, since this is a bot PR with no author to apply them.

GITHUB_TOKEN: "" does not block the fallback it names

The comment says the empty env var closes the path that would otherwise write the job token into /etc/nix/nix.conf. It doesn't. cachix/install-nix-action is a composite action, and the step that runs install-nix.sh declares its own env: block, ending in:

        GITHUB_TOKEN: ${{ github.token }}

A composite step's own env: is the innermost scope and overrides whatever the calling step set — that hardcoded assignment is precisely why the fallback fires for callers who never pass a token. install-nix.sh then takes its second branch:

elif [[ -n "${GITHUB_TOKEN:-}" && $GITHUB_SERVER_URL == "https://github.com" ]]; then
  add_config "access-tokens = github.com=$GITHUB_TOKEN"

and the multi-user installer places the result with install -m 0644 "$SCRATCH/nix.conf" /etc/nix/nix.conf. tend-weekly's job token carries contents: write, pull-requests: write, issues: write — so the sandbox user ends up able to read a real credential, which is the exact outcome the comment claims to have prevented.

Pushed a scrub step that runs after the install, deletes the access-tokens line and then asserts it's gone, and dropped the env: block that was standing in for it. That makes the property enforced rather than asserted: if I have the precedence rule backwards, the sed is a no-op and the assertion still passes, so the invariant holds after the step either way instead of resting on a reading of the runner's env-merge order.

nix flake update isn't scoped to rust-overlay

The block this commit deletes said "Move only rust-overlay". What replaces it is a bare nix flake update, which relocks every input — nixpkgs included — inside a PR whose stated scope is the toolchain and the pins, and whose nix-flake job is then checking a nixpkgs nobody chose to move. Pushed nix flake update rust-overlay. Bumping nixpkgs is a reasonable thing to do; it just shouldn't arrive as a side effect of the MSRV row.

Not blocking

The apt step above this one carries a timeout(1) wrapper and a comment about five jobs sitting there until GitHub's 360-minute cap killed them, "because this step runs before the tend action, so nothing else caps it". That reasoning covers the Nix install equally — it curls an installer with retries and no --max-time. There's no fix to apply: timeout-minutes isn't accepted on a composite-action step (as that same comment notes), and this one is a uses:, so it can't be wrapped either. Recording the gap rather than acting on it.

The rest of the sweep still reads clean against the earlier pass — the nightly-pin rows, the MSRV table entry for nightly.yaml, the command_count correction, and the --git-common-dir substitution all landed as described, and nix-flake, minimal-versions and check-unused-dependencies went green on bc35d518.

….conf

`GITHUB_TOKEN: ""` on the calling step didn't close the fallback it named.
`install-nix-action` is a composite action and its own step hardcodes
`GITHUB_TOKEN: ${{ github.token }}` in `env:`; a composite step's own `env:`
is the innermost scope, so the caller can't override it — that assignment is
what makes the fallback fire for callers who pass no token at all.
`install-nix.sh` then writes `access-tokens = github.com=<token>` and the
multi-user installer places the file 0644, so the sandbox could read a token
carrying contents/pull-requests/issues write.

Delete the line after the install and fail the step if it survives, so the
invariant is enforced rather than resting on a reading of the runner's
env-merge order. If the precedence reading is wrong the sed is a no-op and
the check still passes.

Also scope the skill's refresh recipe to `nix flake update rust-overlay`: a
bare update relocks nixpkgs too, which is an unrelated bump inside a PR
scoped to the toolchain and the pins.
@worktrunk-bot

worktrunk-bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Collaborator Author

Done — the install moved to .github/actions/tend-setup/action.yaml (cachix/install-nix-action@v31, matching the pin nightly.yaml's nix-flake job already uses), and the in-session recipe and the whole NAR-serialisation section are gone. The refresh step is now nix flake update rust-overlay plus nix eval .#devShells.x86_64-linux.default.name, with no --extra-experimental-features on either, since the daemon install writes experimental-features = nix-command flakes to /etc/nix/nix.conf system-wide.

I confirmed the premise from inside the sandbox before changing anything: whoami is tend-sandbox, and sudo -n true gives sudo: a password is required — so the recipe was describing something that cannot succeed, as you said.

The step is gated if: github.workflow == 'tend-weekly' so the other seven tend workflows don't pay for the install. An input would have been the nicer knob, but the generated tend-*.yaml files are overwritten by uvx tend@latest init, so it wouldn't survive a regen; the workflow name would.

One thing the first draft got wrong, caught by the review pass on that push and already fixed on the branch: I claimed GITHUB_TOKEN: "" on the calling step closed the path that writes the job token into world-readable /etc/nix/nix.conf. It doesn't — install-nix-action's own composite step hardcodes GITHUB_TOKEN: ${{ github.token }}, which is the innermost scope. edcb459 replaces the assertion with a scrub-and-check step, which holds either way.

On flake.lock: this PR's entry stays as it is. nix-flake ran nix flake check against it on bc35d518 and passed, and the file hasn't moved since, so it is verified rather than merely computed — regenerating it isn't something this session can do anyway (the gate is tend-weekly; this is tend-mention). From the next weekly pass on, it's generated.

What is not verified: the install step has never executed. Nothing on this PR runs it, since ci.yaml doesn't invoke tend-setup — the first tend-weekly run is the proof, or a workflow_dispatch of it if you'd rather not wait for Sunday. What I could check, I checked by reading the sources rather than running them: the daemon branch, the $GITHUB_PATH entry, and tend's PATH derivation are all traced below.

Why nix should reach the sandbox — the chain, as read from source

Four links, each verified against the code rather than assumed:

  1. Daemon, not single-user. install-nix.sh takes the daemon branch when /run/systemd/system exists, which it does on ubuntu-24.04. That matters: the single-user path installs into $HOME/.nix-profile — under the runner home, which the sandbox can't use.
  2. On the runner's PATH for later steps. The daemon branch appends /nix/var/nix/profiles/default/bin to $GITHUB_PATH, so the tend action's step (which runs after tend-setup) sees it.
  3. Carried across the user boundary. proxy/setup-sandbox.sh derives the sandbox PATH from the runner's, rewriting or dropping every entry under the runner home and keeping the rest if the sandbox UID can traverse it. /nix/var/nix/profiles/default/bin is neither under the runner home nor unreadable, so it survives verbatim. (This is also why link 1 matters — ~/.nix-profile/bin would be rewritten to /home/tend-sandbox/.nix-profile/bin and dropped as nonexistent.)
  4. Fetches still authenticate, with no token on disk. The proxy injects the bot PAT for github.com, codeload.github.com, and api.github.com — exactly the hosts a flake fetch of github:oxalica/rust-overlay uses — so dropping access-tokens from nix.conf costs nothing. Non-allowlisted hosts (cache.nixos.org) pass through untouched, and the daemon does store writes with its own unproxied network anyway.

Residual unknowns, in the order they'd bite: whether sudo's env_reset or a nix.conf permission detail behaves differently in practice than it reads, and whether flake fetching through mitmproxy needs a CA hint beyond the SSL_CERT_FILE the sandbox env already sets (nix honours it, but that's from the docs, not from a run here).

Check state

check-docs and link-check are no longer failing for the @astrojs/check peer conflict: #3877 merged, and pull_request checks run on the merge commit, so this PR now builds docs against a main that has the fix. check-docs passed in 32s on edcb459.

All four required checks are green on edcb459 — test (linux), test (macos), test (windows), fast-checks — along with lint, msrv, check-docs, link-check, feature-check, code-coverage, codecov/patch, codecov/project, check-unused-dependencies, pre-commit.ci, changes, gate, plan, and the affected tests linux/macos legs.

Still running when I stopped watching, so unverified rather than green — all advisory: nix-flake, minimal-versions, crate-build, feature-powerset, the linux/windows full-tests legs, and release-target (x86_64-apple-darwin). Neither of the two commits touches a Rust source file, Cargo.toml, or flake.lock — they're .claude/skills/running-tend/SKILL.md and .github/actions/tend-setup/action.yaml only — so the inputs to those jobs are identical to bc35d518, where every one of them passed.

…ot prose

The two duplicates the weekly cache-check keeps reporting are the diagnostic
collector measuring itself. `diagnostic::write_if_verbose` runs after the
command finishes, and `DiagnosticReport::collect` then shells out to
`git --version`, `gh --version`, and `git worktree list --porcelain` — into
the same trace `Profile::from_entries` reads. So `command_count` counts the
collector alongside the render, and the duplicate bucketing pairs its calls
with the render's.

Documenting how to discount that leaves the profiler wrong and asks every
future run to redo the arithmetic. The fix belongs in `from_entries`: give
the collector's subprocesses a reserved context and exclude it from both
`command_count` and duplicate bucketing, so the number means the render
again and the ~29 baseline stays comparable.

@worktrunk-bot worktrunk-bot left a comment •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two things since f1ccd16 — one in the new commits, one that landed around them.

091be731 deletes the note but not the arithmetic it was compensating for

The commit message makes the right call — "Documenting how to discount that leaves the profiler wrong and asks every future run to redo the arithmetic. The fix belongs in from_entries." But the commit only removes the prose; the code half isn't in this PR. gh pr diff --name-only lists no Rust file, and Profile::from_entries in src/trace/profile.rs still does an unconditional command_count += 1 in its TraceEntryKind::Command arm, with no reserved context and no filter — grep -rn "command_count" --include=*.rs finds nothing else that could be doing the exclusion.

So the merged state is worse than either endpoint. diagnostic::write_if_verbose still shells out to git --version, gh --version, and git worktree list --porcelain after the render, into the same trace; the skill now says "command_count in the same JSON report is the number to read" directly under a ~29/~32 baseline that predates -vv, and the Measurement artifact triage bullet that told the next run those two duplicates are the collector rather than a cache miss is gone too. Next weekly pass reads ~32 as ~29-clean, or chases gh --version as a regression.

Either land the from_entries change here, or keep the note until it lands — inline suggestion for the second, since it's the one-line version.

#3891 arrived after the last review and makes the same change

@max-sixty opened #3891 at 23:08Z with a cachix/install-nix-action@v31 step in the same action.yaml, its own access-tokens scrub, and a rewrite of the same skill section. Its body already lays out the comparison and asks which should land, so I'll only add what's changed since it was written and my own read.

One row of that table is now stale: #3880 also carries a line telling the weekly run that if nix isn't on the PATH, the install step regressed — say so in the PR and leave flake.lock alone rather than hand-computing an entry. So the gate's silent-failure mode isn't fully silent here — a rename of the generated workflow surfaces as a missing nix with an instruction attached, which is the failure this PR's own history came from. Still weaker than not coupling to the name at all, but not the same shape as the original.

The remaining difference I'd weigh is the single-user branch. #3891 asserts it ([ -x /nix/var/nix/profiles/default/bin/nix ]); #3880 catches it only incidentally — /etc/nix/nix.conf doesn't exist after a single-user install, so sudo sed -i exits 2 under shell: bash's -eo pipefail and the step fails. Fail-closed, so not a hole, but the operator sees a sed: can't read rather than the reason.

My read: land #3891's action.yaml and reduce this PR to the weekly work it was scoped for — the MSRV bump, the two nightly pins, flake.lock, tests/CLAUDE.md, and the skill's recipe rewording. That takes the better-guarded, uncoupled setup step and keeps the ~4 s on seven workflows as the price, which reads cheap next to a step that stops running when a generated file is regenerated. It also needs the skill edits deconflicted either way: both PRs rewrite the same Weekly Maintenance: MSRV & Toolchain block, so whichever lands second rebases that section regardless of which action.yaml wins.

Nothing else in the sweep changed since the last pass. cargo-llvm-cov 0.9.0's changelog confirms the tests/CLAUDE.md note — "Change --show-missing-lines reporting to aggregate consecutive line numbers", flagged there as a breaking change for programmatic parsers, which is exactly the comparison that section describes.

Comment thread .claude/skills/running-tend/SKILL.md Resolved
…fix lands

091be73 removed the note that `command_count` counts the diagnostic
collector's three subprocesses alongside the render, on the grounds that the
fix belongs in `Profile::from_entries`. That fix isn't in this PR — no Rust
file is touched, and `from_entries` still increments `command_count` for
every `TraceEntryKind::Command` entry with no reserved context.

So the skill was left pointing at `command_count` against a ~29 baseline
measured without `-vv`, and without the triage bullet naming the two
duplicates that show up on every clean render. Restore both, and record the
code fix as the thing that retires them.
#3891 adds the same `cachix/install-nix-action@v31` step to the same
`.github/actions/tend-setup/action.yaml`, with the same `access-tokens`
scrub and a rewrite of the same skill section, so the two branches
conflict and whichever lands second leaves the other's step redundant.
It is the better-guarded of the two: it asserts the multi-user branch
directly (`[ -x /nix/var/nix/profiles/default/bin/nix ]`) instead of
catching a single-user fallback incidentally through `sed` exiting 2,
and it installs unconditionally rather than coupling to
`github.workflow == 'tend-weekly'` — a gate that stops firing if the
generated workflow is ever renamed, which is the same silent-failure
shape both changes exist to remove. The ~4 s on seven tend workflows is
the price.

So this PR goes back to the weekly work it was scoped for: the MSRV
bump, the two nightly `rustup` pins, `flake.lock`, the pin sweep, and
the skill's own weekly-maintenance edits.

The skill's flake.lock recipe stays rewritten here, because the
Determinate installer it replaces cannot run in the sandbox either way
— but it now matches #3891's text byte for byte, including the removal
of the codecov section's parenthetical blessing of that installer,
which this PR had otherwise left pointing at a recipe it deleted. Both
branches making the same edit means whichever merges second takes no
conflict in that section.
@worktrunk-bot

Copy link
Copy Markdown
Collaborator Author

Taking my own review's second finding: adbeb76 drops this PR's Nix setup step and reduces the branch to the weekly work it was scoped for — the MSRV bump, the two nightly rustup pins, flake.lock, the cargo-llvm-cov pin, and the skill's weekly-maintenance edits. #3891 carries the action.yaml change.

That's the call the review argued for, and it's one git revert adbeb76 away if you'd rather keep this PR's gated version and close #3891 instead. The substantive difference is the one #3891's own body names: it asserts the multi-user install branch directly, and doesn't couple to github.workflow == 'tend-weekly' — a gate that stops firing if the generated workflow is ever renamed, which is the silent-failure shape both changes exist to remove. ~4 s on seven workflows is the price.

The skill's flake.lock recipe stays rewritten here, since the Determinate installer it replaces can't run in the sandbox whichever PR lands — but it's now byte-identical to #3891's text, including the codecov section's parenthetical blessing of that installer. That parenthetical is a dangling reference this PR had otherwise left pointing at a recipe it deleted; #3891 caught it and this branch now removes it the same way. Both sides making the same edit means whichever merges second takes no conflict in that section: git merge origin/tend-nix-setup against this head is clean in both files.

Merge order matters for one week only. If this lands first, the recipe names a nix that tend-setup doesn't install yet. The recipe already covers that case — report that tend-setup regressed, leave flake.lock alone rather than hand-computing an entry — so the worst case is a skipped refresh, not a bad lock.

The review's first finding was already applied in 5333427 before this run started; replied inline there. Nothing else in the sweep changed.

What moved, and what didn't

adbeb76 restores .github/actions/tend-setup/action.yaml to its state on main — git diff be2c088a -- .github/actions/tend-setup/action.yaml is empty at this head — and rewrites two spans of .claude/skills/running-tend/SKILL.md to match tend-nix-setup verbatim: the codecov section's installer parenthetical, and the flake.lock refresh recipe with its nix flake update rust-overlay / nix eval block.

The skill hunks this PR still owns are the ones #3891 doesn't touch: the nightly.yaml row in the MSRV file table plus the paragraph explaining why a stale nightly pin breaks the bump, and the statusline cache-check's collector notes.

No Rust source, Cargo.toml, or flake.lock has moved since bc35d518, where nix-flake, minimal-versions and check-unused-dependencies all passed — so the hand-written lock entry and the nightly pins are still verified by that run rather than by inference.

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The two findings from the last pass are both applied — 5333427 keeps the collector discount until the profiler fix lands, and adbeb76 drops the setup step. One thing in the new stopgap paragraph, inline below.

Re-verified at the current heads rather than the ones the earlier comment checked: .github/actions/tend-setup/action.yaml at adbeb76 is byte-identical to main (git diff origin/main adbeb76 -- .github/actions/tend-setup/action.yaml is empty), and the two SKILL.md spans this PR shares with #3891 are byte-identical between adbeb76 and c2e95b2, so merge order is free in both files.

Comment thread .claude/skills/running-tend/SKILL.md Resolved
"the two notes above it" reads as the baseline paragraph plus the triage bullet, so a future run following it wholesale takes the ~29/~32 thresholds with it. Those outlive the from_entries fix — it changes what you compare against them, not whether they exist. Name the three spans instead.
max-sixty added a commit that referenced this pull request Aug 24, 2026
…3891)

The weekly MSRV/toolchain bump has to refresh `flake.lock` after moving
`rust-toolchain.toml`, and `running-tend` told the bot to install Nix
inside its own session with the Determinate installer. That could never
work: tend runs the agent as a sandbox user created with plain `useradd`
and never granted sudo, so an installer that has to create `/nix` fails
on every run. The `nix eval` check below it was downstream of the same
dead installer.

Nix now gets provisioned in the layer that does have root.
`.github/actions/tend-setup` runs as `runner` before the tend action
starts, so `cachix/install-nix-action` succeeds there — the same action
`nightly.yaml`'s `nix-flake` job already uses. The skill's recipe
becomes `nix flake update` plus `nix eval`.

The codecov section also loses its parenthetical blessing "pre-built
single-script installers like Determinate Nix's", which pointed at the
recipe this removes.

<details>
<summary>Why the sandbox agent sees <code>nix</code> without a
<code>sandbox_path:</code> entry</summary>

Installing as `runner` is necessary but not sufficient — the agent runs
as a different UID with a `PATH` tend derives from the runner's. Each
link was checked against a source or a live run rather than assumed:

| Link | Evidence |
|------|----------|
| The action performs a multi-user install and appends
`/nix/var/nix/profiles/default/bin` to `$GITHUB_PATH` | `install-nix.sh`
takes the daemon branch when `/run/systemd/system` exists, then `echo
"/nix/var/nix/profiles/default/bin" >> "$GITHUB_PATH"`. The nightly
`nix-flake` job's log shows `installer options: … --daemon
--daemon-user-count 8` |
| tend keeps that entry verbatim | `proxy/setup-sandbox.sh` rewrites
only PATH entries under the runner's home to the sandbox's own copy;
other entries survive if they exist and `sudo -u <sandbox> test -x`
passes |
| …and it does so in practice | A live sandbox `PATH` captured in
tend-weekly run `32630901712` keeps `/opt/pipx_bin`,
`/opt/hostedtoolcache/uv/0.12.5/x86_64`, `/usr/local/.ghcup/bin` and
`/usr/local/bin` verbatim, while rewriting `.cargo/bin` and
`.dotnet/tools` to `/home/tend-sandbox/…`.
`/nix/var/nix/profiles/default/bin` is the first shape, not the second |
| The sandbox UID can traverse it | Nix's `install-multi-user.sh`
creates `/nix`, `/nix/var`, `/nix/var/nix`, `/nix/var/nix/profiles` with
`install -dv -m 0755`, and `/nix/store` with `-m 1775` |
| An unprivileged, non-trusted user can drive the daemon | The daemon's
listening socket is created with `.socketMode = 0666` |
| Fetching works through tend's MITM proxy | `libfetchers/tarball.cc`
fetches in the evaluating client, not the daemon, so it inherits the
sandbox's `https_proxy`. `FileTransferSettings::getDefaultSSLCertFile()`
honours `SSL_CERT_FILE`, which the sandbox sets to the bundle
`update-ca-certificates` put the proxy CA into |

`.config/tend.yaml` is untouched. The first weekly run after this merges
is what confirms the chain end to end.

</details>

A second step then strips a credential the install would otherwise leave
lying around, while `runner` is still the only unprivileged user on the
machine — tend does not create the sandbox user until its own action
starts.

`install-nix.sh` writes `access-tokens = github.com=<job token>` into
`/etc/nix/nix.conf` whenever it can see one, and the action's
`action.yml` passes `GITHUB_TOKEN: ${{ github.token }}` unconditionally,
so `github_access_token: ""` does not suppress it — the script falls
through to the job token. The installer creates `/etc/nix` at `0555` and
`nix.conf` at `0644`, so a sandboxed agent could `cat` a token carrying
`contents: write` and `pull-requests: write`.

That matters more than it first appears. The agent already wields the
bot's identity on GitHub, because the proxy injects it per-request — but
it never *holds* a secret, and nothing blocks egress, so a token in a
readable file could be carried to any host through the CONNECT tunnel.
The step deletes the line and fails if one survives. Nix loses nothing
by it, since the proxy overwrites `Authorization` on every sandbox
request to `github.com`, `codeload.github.com`, and `api.github.com`
regardless of what nix sends.

`DeterminateSystems/nix-installer-action` would avoid the write instead
of undoing it — `github-token: ""` maps to `null` and the
`access-tokens` line is then never appended. That was weighed against a
second Nix installer in the repo, with its own pin for the weekly bump
pass to track, and against `nightly.yaml`'s `nix-flake` job wanting the
opposite (it passes `access-tokens` deliberately, for the rate limit).
One installer plus an explicit scrub won.

Cost is ~4 s, measured off the `Install Nix` step in nightly run
`32592923294`, so every tend workflow pays it rather than gating on
which one is running.

The recipe names the input — `nix flake update rust-overlay` — so a
toolchain-scoped PR doesn't also relock nixpkgs, and says what to do
when `nix` is absent (report that `tend-setup` regressed; don't
hand-compute a lock entry, which is how this failed the first time).

### Overlaps [#3880](#3880)

That PR arrived at the same fix independently while this branch was in
flight, then dropped its own `install-nix-action` step; it no longer
touches `.github/actions/tend-setup/action.yaml` at all. Both still edit
the same section of `running-tend`, and they merge without conflict
(`git merge-tree --write-tree`, zero markers) because the wording
converged. #3880 carries the weekly work this unblocks — the MSRV bump,
`flake.lock`, and nightly's `rustup` pins — and its recipe now calls a
`nix` only this PR installs, so it wants this to land first.

> _This was written by Claude Code on behalf of max-sixty_

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
max-sixty and others added 4 commits August 24, 2026 08:45
#3891 squash-landed the same rewrite of the Nix part of "Weekly
Maintenance: MSRV & Toolchain" that this branch carries, plus two later
refinements: the flake-input rationale moved into the code block, and the
"if `nix` isn't on the PATH" line moved ahead of the commit paragraph.
Take main's wording for that section; this branch's own additions (the
nightly `rustup` pin row and its paragraph, the statusline-profiler
collector notes) are untouched by #3891 and carry through.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…ookup

The pin only has to stay at or above the MSRV, and MSRV tracks stable − 1,
so a nightly from the last three months always clears it — nightly runs two
channels ahead of stable, and three months is two release cycles. That makes
staleness checkable from the pinned date alone, where the old wording sent
the reader to that day's `channel-rust-nightly.toml` for a version to
compare. It also stops the row reading as a weekly edit: today's
`nightly-2026-08-01` is three weeks old and wants nothing.
…st the MSRV

The pin is a fixed date; it's the MSRV bump that overtakes it.
@max-sixty
max-sixty merged commit f2ae1c5 into main Aug 24, 2026
41 checks passed
@max-sixty
max-sixty deleted the chore/weekly-renovation-2026-08-23 branch August 24, 2026 20:54
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.

2 participants