Skip to content

ci(tend-setup): install Nix so the weekly bot can refresh flake.lock - #3891

Merged
max-sixty merged 6 commits into
mainfrom
tend-nix-setup
Aug 24, 2026
Merged

max-sixty merged 6 commits into
mainfrom
tend-nix-setup

Conversation

@max-sixty

@max-sixty max-sixty commented Aug 23, 2026 •

Copy link
Copy Markdown
Owner

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.

Why the sandbox agent sees nix without a sandbox_path: entry

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.

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

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

max-sixty and others added 2 commits August 23, 2026 16:03
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 can 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. The last weekly run hit the wall and wrote hand-computed
narHash guidance into the skill as a workaround.

Provision Nix in the layer that does have root. `tend-setup` runs as
`runner` before the tend action starts, so `cachix/install-nix-action`
succeeds there and puts `/nix/var/nix/profiles/default/bin` on
`$GITHUB_PATH`. tend derives the sandbox `PATH` from the runner's,
rewriting only runner-home entries, so a system path carries across
verbatim and the agent inherits `nix` with no `sandbox_path:` entry. The
installer makes every component of that path world-traversable
(`install -dv -m 0755 /nix …`, `-m 1775 /nix/store`) and the daemon
socket 0666, so the unprivileged sandbox user can reach it. Flake input
fetching runs in the evaluating client, not the daemon, so it picks up
the sandbox's `https_proxy` and `SSL_CERT_FILE`; tend's proxy then
injects the bot's real token for api.github.com and codeload.

Same action as `nightly.yaml`'s `nix-flake` job, minus its
`access-tokens` line — that value lands in world-readable
`/etc/nix/nix.conf`, which would hand the sandboxed agent a real token.

The skill now just runs `nix flake update` and `nix eval`. Its codecov
section loses the parenthetical blessing single-script installers, which
pointed at the recipe this removes.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
`cachix/install-nix-action` writes `access-tokens = github.com=<job
token>` into `/etc/nix/nix.conf` whenever it can see one, and its
`action.yml` passes `GITHUB_TOKEN: ${{ github.token }}` unconditionally,
so `github_access_token: ""` does not suppress it — `install-nix.sh`
falls through to the job token. The installer creates `/etc/nix` at 0555
and `nix.conf` at 0644, so the sandboxed agent could read a token
carrying `contents: write` and `pull-requests: write`. The previous
commit's comment claimed the opposite.

Delete the line right after the install, while `runner` is still the
only unprivileged user on the box, and fail the step if one survives.
Nix loses nothing: tend's proxy overwrites `Authorization` on every
sandbox request to github.com, codeload.github.com, and api.github.com
with the bot's token, whether or not nix sends one.

Assert the multi-user branch in the same step. Only that branch puts
`/nix/var/nix/profiles/default/bin` on `$GITHUB_PATH`; without systemd
the installer falls back to single-user, whose one PATH entry is the
runner's `~/.nix-profile/bin` — a runner-home path tend rewrites to a
nonexistent sandbox path and drops. That would leave a green setup step
and no `nix` in the session, found a week later mid-run. A
`sandbox_path:` entry was considered and rejected: it would not rescue a
single-user install, whose store the sandbox cannot write either way, so
it insures against nothing this assertion doesn't catch earlier.

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

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I started this review on 43ff76e and had one substantive finding: the comment claiming no access-tokens line would be written was the opposite of what install-nix-action@v31 does — it hardcodes GITHUB_TOKEN: ${{ github.token }} in its own composite step's env:, and install-nix.sh falls through to it when the input is empty, landing a contents: write / pull-requests: write token in /etc/nix/nix.conf at mode 0644. 57b617b landed while I was writing that up and fixes it. I verified the fix rather than assuming it, and it holds:

  • sed -i '/^access-tokens/d' matches the line add_config writes, which is unanchored-flush at column 0. The follow-up grep -q 'access-tokens' is unanchored, so it's strictly stricter than the sed — an indented variant the delete missed would still fail the step rather than pass it. Right direction on a guard.
  • The multi-user assertion is a better answer than the sandbox_path: entry the commit message says it displaced, and than the prose fallback I was going to suggest for the skill. install-nix.sh#L177-L182 writes /nix/var/nix/profiles/default/bin to $GITHUB_PATH only inside if use_daemon, so [ -x /nix/var/nix/profiles/default/bin/nix ] is a faithful proxy for that branch having been taken — a single-user fallback fails the setup step instead of surfacing a week later as a weekly run with no nix.

Two things left, neither a defect in the code as it now stands:

#3880 makes the same change to both files. It adds its own cachix/install-nix-action@v31 step to .github/actions/tend-setup/action.yaml and rewrites the same Weekly Maintenance: MSRV & Toolchain block in the skill, including its own token scrub and an if: github.workflow == 'tend-weekly' gate. These will conflict in both files, and after this PR its setup step is redundant rather than just conflicting. The PR body scopes the narHash workaround as its author's to drop, which is right, but the setup step is now the same change twice — worth deciding which one carries it before either merges.

One inline suggestion on the skill's nix flake update line — see below.

Sources for the original finding

Kept for the record, since the fix commit's reasoning and mine were derived independently and agree:

  • action.yml#L38 at v31 (b85815f) — GITHUB_TOKEN: ${{ github.token }}
  • install-nix.sh#L43-L55 — the elif fallback
  • install-multi-user.sh#L1003 at 2.35.2, the version install-nix.sh pins — install -m 0644 "$SCRATCH/nix.conf" /etc/nix/nix.conf
  • contents: write, pull-requests: write, issues: write in every tend-*.yaml job; tend-review.yaml triggers on pull_request_target

The ~4 s figure also checks out — Install Nix in nightly run 32592923294 ran 19:12:00Z → 19:12:04Z. With the token scrubbed I don't think the ungated install is worth gating on security grounds: the sandbox user isn't in trusted-users (the action's default is root ${USER}, i.e. runner), and tend's own model already treats the agent as able to execute arbitrary code inside the runner VM, so a Nix daemon it can drive adds no capability it lacked.

Comment thread .claude/skills/running-tend/SKILL.md Resolved
A bare `nix flake update` also relocks nixpkgs, flake-utils, and crane,
landing an unrelated bump in a PR scoped to the toolchain and handing
nightly's `nix-flake` job a nixpkgs nobody chose to move. `nix flake
update <input>` has taken input names positionally since 2.19
(`CmdFlakeUpdate`'s `expectArgs({.label = "inputs"})`), so name the one
the channel bump actually needs.

Also state what to do when `nix` is absent: that means `tend-setup`
regressed, so the PR should say so and leave `flake.lock` alone. Without
the line the next bot to find no `nix` writes a hand-computed lock entry
instead, which is how this recipe failed in the first place.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
worktrunk-bot added a commit that referenced this pull request Aug 24, 2026
#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.
The assertion guarded a systemd-less runner, where the installer falls
back to single-user and its one `$GITHUB_PATH` entry is the runner's
`~/.nix-profile/bin` — rewritten to a nonexistent sandbox path and
dropped, leaving a green step and no `nix`.

`running-tend` already covers that failure: it tells the bot to report
`tend-setup` as regressed and leave `flake.lock` alone when `nix` is
missing. Two mechanisms for one guarantee, so keep the one that reaches
the reader who hits it.

The scrub stays. It closes a leak this branch introduces, and the
property it defends is that the sandboxed agent never *holds* a
credential — the proxy lends it the bot's identity per-request, but a
token sitting in a world-readable file can be carried to any host,
since nothing blocks egress.

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

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Dropping the assertion in 4265551 is right, and for a stronger reason than my earlier review gave it credit for the other way round. I endorsed the assertion, but the install step is ungated, so [ ! -x /nix/var/nix/profiles/default/bin/nix ] failing would have turned every tend workflow red — review, triage, mention, ci-fix — over a capability only the weekly bump consumes. Degrading to "no nix in the sandbox, weekly says tend-setup regressed" charges the one job that cares and leaves the rest working. I re-checked that the scrub still covers its whole surface once a single-user install is a tolerated outcome rather than a hard stop, and it does (details below).

One thing worth fixing before merge, in the description rather than the code: the "Overlaps #3880 — one of the two should land, not both" section no longer describes either PR. #3880 was updated after this branch wrote that section and has dropped its own install-nix-action step — its head (6504e6d) touches SKILL.md, coverage.yaml, nightly.yaml, Cargo.toml, flake.lock, rust-toolchain.toml, tests/CLAUDE.md and wt-perf/Cargo.toml, and no action.yaml. Its skill text now reads "tend-setup installs Nix", so it depends on this PR rather than competing with it. Separately, the comparison table's "Single-user install — asserted; the step fails" row was invalidated by 4265551, and the "gated vs. ungated" row it was weighed against is now the only real difference left. What actually remains between them is a textual conflict in the same SKILL.md block, which whichever lands second rebases through. Left as-is, the section asks for a choose-one decision on grounds that have gone away — and closing this one in favour of #3880 would leave #3880 with no step to install the Nix its own recipe now assumes.

What I re-verified on the scrub, and why the guard's removal doesn't widen it

Checked against the pinned sources rather than carried over from the previous review, since the removed assertion was the thing that used to make a non-daemon install unreachable:

  • sed -i can't fail on a missing path. The non-daemon branch writes the file too — install-nix.sh at v31 (b85815f) does sudo mkdir -p /etc/nix / sudo cp "$workdir/nix.conf" /etc/nix/nix.conf in the else of if use_daemon. So the step behaves the same on the branch the assertion used to reject, rather than failing the whole workflow on a missing file.
  • No second copy of the token outlives the step. install-nix.sh builds its config in workdir=$(mktemp -d) under trap 'rm -rf "$workdir"' EXIT; install-multi-user.sh at the pinned 2.35.2 builds its own in SCRATCH=$(mktemp -d) under finish_cleanup. And 2.35.2's place_nix_configuration writes the whole config to /etc/nix/nix.conf — there is no nix.custom.conf split that would route access-tokens past a grep scoped to /etc/nix/nix.conf.
  • The scrub doesn't take experimental-features with it. add_config emits it flush at column 0 as its own line, and the delete is /^access-tokens/, so flakes survive for the sandbox.
  • Re-entrancy is fine. install-nix.sh exits 0 with "Aborting: Nix is already installed" if nix is on PATH, so the step is a no-op on a runner that somehow already has it.

nix flake update rust-overlay also checks out against the flake: rust-overlay is a real root input in flake.lock, and it carries inputs.nixpkgs.follows = "nixpkgs", so naming it can't drag nixpkgs along.

Both comments stated things twice or argued for the change rather than
describing it. The scrub comment opened and closed on the same fact —
that the sandbox user doesn't exist yet — and the install comment
carried a `sandbox_path:` aside answering a question the mechanism
above it already answers. `mode 0555 and nix.conf at 0644` becomes
"world-readable", which is the part that matters.

Drop `sudo` from the verification `grep`. The file is world-readable —
that is the whole reason this step exists — so needing sudo to read it
would contradict the leak it guards against.

In the skill, the reason for naming the flake input moves into the code
block beside the command, and the "if `nix` is missing" line moves ahead
of the commit step, so the procedure reads in order.

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

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

8d6e1fb is mostly comment trimming, and the trimmed comments still carry what they need to. One functional change came along with it that I'd put back: dropping sudo from the scrub's verification grep turns a fail-closed guard into a fail-open one.

grep -q exits 2 — not 1 — when it can't read the file, and a composite action's shell: bash runs under bash --noprofile --norc -eo pipefail, where a non-zero exit in an if condition isn't fatal; it just takes the else branch. So a step whose entire job is to prove the token is gone can report "proved" without ever having read the file. The asymmetry with the line above it is the tell: the delete still needs root, the check that the delete worked no longer does.

Being straight about the exposure: I can't name a case where this actually leaks a token today. The file is 0644, and any permission change that hid it from runner would hide it from the sandbox user too — the guard's blind spot is correlated with the threat going away. So this is about the shape, not a live hole. It costs one word to keep the property that a check which can't run fails the step instead of passing it.

Nothing else in the increment: nix flake update rust-overlay, nix eval without --extra-experimental-features (the install step writes experimental-features = nix-command flakes system-wide), and the "if nix isn't on the PATH, tend-setup regressed" fallback all still hold after the rewrite, and moving that fallback above the Commit flake.lock line reads better than it did.

Comment thread .github/actions/tend-setup/action.yaml Resolved
Dropping it in 8d6e1fb turned a fail-closed guard into a fail-open one.
`grep` exits 2 when it can't read a file, and an `if` condition treats
any non-zero as "no match", so a step whose only job is to prove the
token is gone would report success without having read the file.

`sudo` is also what makes the check fail-closed rather than merely
symmetrical with the `sed`: once `sed -i` has succeeded, root can read
the file by construction, so exit 2 is unreachable. Plain `grep` had a
reachable path to it — root can write a file that `runner` cannot read.

The reasoning for dropping it was that the file is world-readable, which
is true today and is what makes this a shape problem rather than a live
leak. Noted inline so the next trim doesn't repeat it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 2960bfb into main Aug 24, 2026
42 checks passed
@max-sixty
max-sixty deleted the tend-nix-setup branch August 24, 2026 15:39
max-sixty added a commit that referenced this pull request Aug 24, 2026
#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]>
max-sixty added a commit that referenced this pull request Aug 24, 2026
…3897)

The agent tend runs as, `tend-sandbox`, could not reach `cargo-insta`,
`cargo-nextest`, or `pre-commit` — all three of the tools `cargo run --
hook pre-merge --yes` invokes. That command is what `CLAUDE.md` and
`.claude/skills/running-tend/SKILL.md` tell the bot to verify its work
with, and in the sandbox it died at `✗ pre-merge command failed:
pre-commit: exit status: 127`.

Tend derives the sandbox's PATH from the runner's, rewriting a leading
`/home/runner` to `/home/tend-sandbox` and keeping an entry only where
the rewritten directory exists. `useradd -m` seeds the sandbox home from
`/etc/skel`, so a toolchain baked into the runner image has a sibling
there and survives; anything `tend-setup` installs at runtime into the
runner's home has none and is dropped, with nothing logged.
`baptiste0928/cargo-install` forces `--root
$HOME/.cargo-install/<crate>` and `uv tool install` writes to the
runner's `~/.local/bin`, so all three went the second way. `uv` itself
stayed reachable only because `astral-sh/setup-uv` puts it under
`/opt/hostedtoolcache`, a system path the rewrite leaves alone.

`sandbox_setup:` runs as the sandbox user once its PATH is built, with
`~/.local/bin` already first on it. `pre-commit` installs into the
sandbox's own home so uv's shim shebang resolves there; the cargo
binaries are copied from where `tend-setup` already built them, at the
versions pinned there. The closing probe is the assertion —
`sandbox-setup.sh` runs the block under `bash -eo pipefail`, so a tool
that goes missing again fails the job and files a `tend-outage` issue
naming it, rather than degrading quietly.

A fourth tool needed the same treatment by a different route. The gate's
`insta` step runs `--all-features`, which turns on
`shell-integration-tests`; that needs `nu` as much as zsh and fish, and
two tests `.expect()` it outright. `tend-setup` apt-installed only zsh
and fish, so the probe would have cleared the agent to run a gate that
then died on a missing shell. `hustcer/setup-nu` installs under
`/opt/hostedtoolcache`, a system path the derivation carries across
verbatim, so `nu` needs no `sandbox_setup:` line — it just needed
installing. Pinned at 0.115.0, level with `test-setup` and
`dev/codex.sh`; `running-tend`'s weekly pin-bump recipe enumerates the
`setup-nu` call sites, so it gains the fifth.

The remaining `shell-integration-tests` prerequisites — bash, zsh, fish,
pwsh, jq — all resolve from `/usr/bin`, which the derivation keeps, so
they were never affected. The probe deliberately covers only the four
tools `tend-setup` provisions for the agent rather than everything the
gate touches.

The generated `tend-*.yaml` files are `uvx tend@latest init` output
(still 0.1.18); the only change in each is the `sandbox_setup:` block.

#3891 landed mid-review and appended its Nix steps at the same
end-of-file anchor as the nushell step, so this branch carries a merge
resolving that — keeping both, nushell next to the shells it belongs
with. Its Nix comment restated the "system PATH entries carry into the
sandbox verbatim" rule that this PR centralizes in `.github/CLAUDE.md`,
which would have left the rule written three times in one file, so it
now points there and keeps only what's specific to Nix. Every #3891 step
is unchanged.

<details><summary>Evidence, and what it cost</summary>

Sandbox PATH, captured from the agent's own launch env in tend-weekly
run 32630901712:

```
/home/tend-sandbox/.local/bin:/opt/hostedtoolcache/uv/0.12.5/x86_64:/opt/pipx_bin:/home/tend-sandbox/.cargo/bin:/usr/local/.ghcup/bin:/home/tend-sandbox/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
```

`error: no such command: insta` appears in runs 31332910927, 31465475753
and 32436240803; `pre-commit: command not found` in 32662391023. Across
3,057 captured Bash calls the bot never once invoked `cargo nextest`,
and substituted `cargo test` with `INSTA_UPDATE=always` or
`INSTA_FORCE_UPDATE=1` fifteen times — which writes snapshots rather
than checking them, and never runs `--check` or `--unreferenced reject`.

Since 2026-06-18, when #3122 moved the repo to tend 0.1.6 and the agent
first ran sandboxed, 16 of 197 bot PRs pushed a first commit with the
`lint` job red. Over the same window 4 of 350 of the maintainer's own
PRs did. #3845 is the shape: a closure `cargo fmt` wanted on one line,
caught by CI rather than locally.

Verified by simulating the block under `bash -eo pipefail` against a
fake runner home, in both directions: all three tools land on PATH and
it exits 0; remove one and it prints the `::error::` naming it and exits
1. Two things changed after that test — `install -D` is GNU-only, so the
parent directory is created explicitly, and `command -v a b c` exits 0
when any one resolves, so the assertion is a loop rather than a single
call.

</details>

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

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
max-sixty added a commit that referenced this pull request Aug 24, 2026
## 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.

- **Pinned nightly: `nightly-2026-03-01` → `nightly-2026-08-01`** —
`nightly.yaml` ×2. Not drift: the MSRV bump *broke* these two jobs, see
below.
- **The skill's `flake.lock` recipe** — the in-session Nix install it
pointed at can never run. The setup step that fixes that lives in #3891,
not here; see below.

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.

<details><summary>How the hash was computed</summary>

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)
```

</details>

## 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 — 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.

<details><summary>Verification</summary>

- `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.

</details>



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

---------

Co-authored-by: worktrunk-bot <[email protected]>
Co-authored-by: Maximilian Roos <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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