Repository navigation
chore: update tend workflows (0.2.0 → 0.2.5) - #4057
Conversation
worktrunk-bot
left a comment
There was a problem hiding this comment.
Pinning 0.2.5 also pulls in the Sandbox Runtime boundary that landed in 0.2.1, and that boundary cuts the agent off from everything .github/actions/tend-setup prepares. sandbox_runtime.mjs in the pinned action configures denyRead: [runnerHome, runnerWorkspace] — runnerHome is pwd.getpwuid(os.getuid()).pw_dir, i.e. /home/runner — and sandbox_setup.py now runs the adopter block inside that boundary as bash -eo pipefail -c. Green CI here is not evidence against this: nothing in this repo's checks exercises a tend job's sandbox.
This breaks every tend workflow before the agent starts. All eight regenerated files carry this repo's sandbox_setup block, which reads two paths under the runner's home:
install -m755 /home/runner/.cargo-install/cargo-insta/bin/cargo-insta ~/.local/bin/
install -m755 /home/runner/.cargo-install/cargo-nextest/bin/cargo-nextest ~/.local/bin/
Under denyRead those reads fail, -e aborts the lifecycle, and the harness never runs — a red job and a tend-outage issue on every trigger. The block's own closing probe (command -v cargo-insta … || exit 1) is a second gate on the same thing. Upstream hit this shape itself: 0.2.3 and 0.2.4 exist to stop tend's own installer traversing /home/runner/work/_actions for the same reason, so the denial is real rather than theoretical.
The route this repo already documents for nu and nix is the fix: land the binaries in a system location from setup:, which runs as runner with sudo, instead of copying them across in sandbox_setup:. Concretely, add sudo install -m755 "$HOME/.cargo-install/<crate>/bin/<crate>" /usr/local/bin/ to .github/actions/tend-setup for both crates, drop the two install lines from .config/tend.yaml, and regenerate. That keeps the pins tend-setup already owns and needs no network install. .github/CLAUDE.md's "Sandbox toolchain" section describes the copy route as one of the two supported paths, so it changes with them; the probe line stays as-is and still covers both routes.
tend-setup's Rust cache restore stops reaching the agent. With the agent in a disposable /tmp/tend-agent-workspace-*/checkout clone and the runner checkout under denyRead, the Swatinem/rust-cache step — whose cache path a recent tend-review run reports as /home/runner/work/worktrunk/worktrunk/target, restored on a hit — now warms a tree the agent cannot read. Every tend session that builds compiles cold, and the restore itself becomes pure download time in eight workflows. The step's comment in tend-setup explains at length how its key is matched to what main's test-setup jobs publish; that reasoning no longer buys anything. Worth deciding deliberately: drop the step, or raise the gap upstream, but not leave it as-is on the assumption it still works.
Two doc claims in this repo become false on merge. The PR body flags nightly-cleaner.md's "It does not fire on runs that end cancelled" and defers it — but that sentence describes exactly the behavior this PR changes, and the nightly agent reads it every night to decide whether to record repo-wide breakage. It belongs in this PR rather than a follow-up. running-tend's "Session Log Paths: -home-runner-work-worktrunk-worktrunk/<session-id>.jsonl" goes stale for the same root cause: the artifact directory is slugified from the agent's cwd, which is now a per-run /tmp path, so the entry can't name a literal at all and should point at locating the .jsonl instead.
One to check before the weekly job runs. tend-setup documents nix reaching the store "through the daemon", which is an AF_UNIX connection — and the pinned action's own boundary probe asserts that creating an AF_UNIX socket inside the sandbox raises PermissionError. If that holds, tend-weekly's nix flake update rust-overlay / nix eval step fails even after the sandbox_setup fix, and the toolchain bump loses its flake.lock refresh. I could not confirm it from here — the seccomp policy is a vendored binary in the SRT package — so it needs one weekly run, or a workflow_dispatch, to settle.
tend 0.2.5 runs the agent inside the Sandbox Runtime, which denies reads across the runner's home and checkout. Every workflow's sandbox_setup block copied cargo-insta and cargo-nextest out of /home/runner/.cargo-install, so all eight would have failed under bash -eo pipefail before the harness started. tend-setup now sudo-installs both binaries into /usr/local/bin, the same system-location route nu and nix already take, and .config/tend.yaml keeps only the pre-commit line, which reads nothing runner-owned. The probe still asserts all five tools. Drops the rust-cache restore and the CARGO*/RUST* env block that existed only to match its key: the agent now builds in a disposable /tmp clone, so a cache restored into the runner's checkout is unreachable and at the wrong path (max-sixty/tend#1198). Records what the boundary also takes away: nix resolves on the agent's PATH but cannot reach its daemon socket, since the sandbox blocks socket(AF_UNIX) (max-sixty/tend#1197). Updates the two skill claims this bump falsifies -- ci-fix's cancelled trigger and the session-log path.
|
All four points confirmed against the pinned sources; The The cache: removed rather than left. Confirmed the restore is doubly dead — the agent's tree is The doc claims: both in this PR. Deferring the The nix question: settled, and it's a real loss. That last one is a degradation this PR ships rather than fixes, so it is a merge decision rather than a review finding — the alternative is holding the bump until #1197 lands. The cache removal is likewise reversible if you'd rather keep the step in place while #1198 is open. |
worktrunk-bot
left a comment
There was a problem hiding this comment.
The three adaptations hold up against the pinned sources. I re-derived the two that would break silently: checkout_review in [email protected] loops for kind in ("merge", "head") and only raises when neither ref exists, so dropping tend-review's own probe keeps the conflicting-PR fallback; and baptiste0928/cargo-install's README pins the cache root at ~/.cargo-install/<crate-name>, so the sudo install path the publish step hardcodes is the one the install steps write.
One claim the bump falsifies is still in the tree. running-tend's statusline cache-check explains its debug build by tend-weekly's cache step:
tend-weeklyinstalls nowt, and its rust-cache step issave-if: falseunder a key no workflow writes
That step is exactly what this PR deletes from tend-setup, so the sentence describes machinery that won't exist on merge — the same shape as the two claims the PR does correct, and the reason it names is now both wrong and more complicated than the truth. It's outside the diff, at SKILL.md#L360-L361; the conclusion survives once the reason is replaced with the simpler one:
# Debug build on purpose. `tend-weekly` installs no `wt` and restores no Rust
# cache, so `--release` means a cold optimized build of the whole dependency
# graph before the first render. The duplicate `(command, context)` pairs this
# check reads are profile-independent; only the timing columns, which this
# section doesn't triage, would be worth a release build.
Separately, worth a decision rather than a change: Session Log Paths grew from a one-line path to twelve lines whose operative content is find "$DEST" -name '*.jsonl' — which is already the recipe in the bundled running-in-ci ("Recalling Prior Context on This Thread") and in debug-tend-run. Every tend session pays for the section, and what it now adds over the bundled skills is the negative fact that the old prefix is gone. Two or three lines saying that, or deleting the section outright, would carry the same information.
The nix degradation reads as a merge decision rather than a review finding, and I don't think it should hold the bump: the boundary is live at 0.2.5 whenever it lands, and holding for max-sixty/tend#1197 keeps all eight workflows on a pin whose sandbox_setup block this PR is what fixes.
The statusline cache-check explains its debug build by tend-setup's rust-cache step being `save-if: false` under a key no workflow writes. This PR deletes that step, so the reason describes machinery that won't exist on merge. Replace it with the simpler true one: tend-weekly restores no Rust cache at all. Also trim Session Log Paths back to the fact that is local to this repo — the old `-home-runner-...` prefix is gone — and point at the `find` recipe the bundled skills already carry instead of restating it.
|
Both in-tree points are fixed in The stale rationale is a real one and I took the suggested replacement verbatim. Session Log Paths: trimmed rather than deleted. The section is down to one paragraph that keeps the fact local to this repo — the old The The description now says three falsified claims rather than two, and names this one. |
…/tmp (#4063) Two CI-facing recipes in this repo write scratch files to a path the agent sandbox no longer allows, so each fails at its first redirect. This points them at `${TMPDIR:-/tmp}` — writable inside the sandbox, and still `/tmp` for a local run. Since tend 0.2.3 the agent runs inside a sandbox with an allowlisted write set, and root `/tmp` is not in it. This repo picked that up with the 0.2.5 regeneration in #4057, merged yesterday at 10:37. Verified from inside a tend session on this repo: ``` $ sh -c 'echo x > /tmp/codecov.json' sh: 1: cannot create /tmp/codecov.json: Read-only file system ``` The affected recipes: - **`tests/CLAUDE.md` → Coverage Investigation** — `curl … > /tmp/codecov.json` plus the two `jq` reads of it. This block exists for exactly the case that now breaks: it names "running in CI, where `task coverage` isn't installed" as one of its two reasons to query Codecov directly, and `.claude/skills/running-tend/SKILL.md` sends every CI session investigating a `codecov/patch` failure here. - **`.claude/skills/running-tend/SKILL.md`** — the `code-coverage-report` artifact download (`/tmp/coverage.zip`, `unzip -d /tmp/coverage`) and the weekly statusline cache-check's stdin fixture (`/tmp/statusline-input.json`). Both rewritten forms were run in this session before committing: the codecov query against `#4058`'s base→head pair returns the real per-file patch table, and `jq -n … > "${TMPDIR:-/tmp}/statusline-input.json"` plus the `<` redirect back out both work. **This is not the upstream bug.** The same `/tmp` assumption in tend's own bundled scripts and skills is [max-sixty/tend#1192](max-sixty/tend#1192), fixed by [max-sixty/tend#1199](max-sixty/tend#1199) and merged 2026-09-09T08:23Z — about two hours after 0.2.5 tagged, so it reaches this repo at the next release plus regeneration. That fix covers bundled files only, and its own test asserts that root `/tmp` **stays** read-only, so these repo-local recipes stay broken until they change here. One sentence was added next to the existing "don't `cargo install` in the sandbox" note, so the next author editing these recipes knows why the paths look like that. <details><summary>Evidence and gate assessment</summary> Found by the daily review-runs sweep, run [34451797174](https://github.com/max-sixty/worktrunk/actions/runs/34451797174). **Confidence** — structural, not stochastic: the write fails on the same syscall every time, for every session, and it is reproduced above rather than projected. Thirteen sessions in this window hit read-only `/tmp` on other paths; the nightly [34446121464](https://github.com/max-sixty/worktrunk/actions/runs/34446121464) hit it eight times, including `tee: /tmp/tend-check.txt: Read-only file system` and an `OSError: [Errno 30] Read-only file system` traceback out of `nightly_workflow_update.py`. Neither of the two recipes changed here was exercised in this window — no `tend-weekly` run, and no coverage dispute — so the specific sites are unfired rather than observed failing. **Magnitude** — targeted fix: seven path substitutions and one sentence, no new section and no new machinery. **Cost** — waste-class, with a false-claim edge. A session whose codecov recipe dies mid-investigation either improvises or, per `running-in-ci`'s rule on unrun gates, has to report the gate as unrun; the weekly statusline check is the one that could otherwise read as clean. The remedy is a literal swap in existing lines, which clears the bar a waste-class finding sets. </details> Co-authored-by: worktrunk-bot <[email protected]>
Regenerates the eight
tend-*.yamlworkflows with tend 0.2.5, up from 0.2.0, and adapts this repo's setup to the sandbox boundary that comes with it. The substantive upstream change is where the agent's code lives: the action now builds its own disposable/tmpclone instead of the workflow rewriting the runner's checkout, and the Anthropic Sandbox Runtime fences the agent off from the runner's home and checkout for the whole lifecycle.That fence is why this PR is more than a regeneration. Three things this repo does stopped working across it, all of them silently; each is handled below.
Upstream changes
Agent sessions get an isolated workspace. Each
max-sixty/tend/claudestep now takescheckout_mode(base,review, ormention) plusbase_branch, and creates the tree it works in itself (max-sixty/tend#1173). The runner's own checkout stays on the base branch, which is what.github/actions/tend-setupand its POST cleanup run against. Three hand-rolled steps disappear as a result:tend-review'srefs/pull/N/mergeprobe and secondactions/checkout,tend-mention'sgh pr checkout(which also picks up the upstream fix for a mention on an issue or a closed PR, max-sixty/tend#1175), and both workflows' "Restore local setup actions for POST cleanup" step — nothing overwrites.github/actions/tend-setupin the runner tree any more.tend-ci-fixnow fires on cancelled runs, not just failures. The job condition becomescontains(fromJSON('["failure", "cancelled"]'), …)and the prompt carriesConclusion:so the session can tell the two apart. A watched workflow that endscancelledonmainpreviously produced no session at all.Bundled skills move with the pin.
review-runsno longer scopes its live-work default-branch CI check toci-fix's watched workflows (max-sixty/tend#1170), outage-row enrichment reads the failing attempt so a rerun-green run keeps its diagnosis (max-sixty/tend#1166), and the guidance text is now harness-portable (max-sixty/tend#1188). Codex-harness work in this range does not reach this repo, which runs theclaudeharness.Full comparison: 0.2.0…0.2.5.
What this repo had to change
The cargo tools move to
/usr/local/bin. This was a merge blocker, not a cleanup.sandbox_runtime.mjsconfiguresdenyRead: [runnerHome, runnerWorkspace]andsandbox_setup.pyruns the adopter block inside that boundary underbash -eo pipefail, so the twoinstall -m755 /home/runner/.cargo-install/…lines every workflow carried would have aborted the lifecycle before the harness started — a red job and atend-outageissue on every trigger, in all eight workflows.tend-setupnowsudo installs both binaries into/usr/local/binafter building them, which is the system-location routenuandnixalready take, and.config/tend.yamlkeeps only thepre-commitline, which installs into the sandbox's own home and reads nothing runner-owned. The closing probe still asserts all five tools.The rust-cache restore is removed, along with the
CARGO*/RUST*env block that existed only to match its key. With the agent in a/tmpclone and the runner's tree underdenyRead, a restored~/.cargoand<runner checkout>/targetare unreachable and at the wrong path — the restore warmed nothing and cost the download in eight workflows. The capability loss is real and is not caused by this removal: tend sessions that compile now compile cold, where a 0.2.0 session inherited a 5.1 GB warmtarget/(measured in a live session on the current pin). I've asked upstream for a supported hand-off into the agent's own tree, max-sixty/tend#1198; this step comes back if that lands. Happy to restore it now instead if you'd rather keep the machinery in place while that's open.nixcan no longer reach its daemon, which breaks the weeklyflake.lockrefresh. SRT blockssocket(AF_UNIX, …)withEPERMby default on Linux, and tend passes neitherallowUnixSocketsnorallowAllUnixSockets. The multi-user Nix client connects to/nix/var/nix/daemon-socket/socket, sonix flake update rust-overlayandnix evalintend-weeklyfail. Nothing here can fix it — it needs an upstream lever, max-sixty/tend#1197. TheInstall Nixstep stays (it is the half of the route this repo owns, andnixstill works for anything running asrunner), and the weekly skill now tells that session to report the failure and carry the rest of the toolchain bump rather than treat it as a broken bump. This is the one degradation this PR ships rather than fixes.Three skill claims the bump falsifies are corrected here rather than deferred.
nightly-cleaner.mdsaidtend-ci-fix"does not fire on runs that endcancelled", which is exactly what changes above.running-tend's session-log path can no longer name a literal now that the artifact directory is slugified from a per-run/tmppath. And its statusline cache-check justified a debug build bytend-setup's rust-cache step beingsave-if: falseunder a key no workflow writes — the step this PR removes; the conclusion survives on the simpler reason thattend-weeklyrestores no Rust cache at all. That last section is also trimmed back to the fact local to this repo, since thefindrecipe it had grown to restate is already in the bundled skills.Verification
The regeneration is reproducible:
uvx [email protected] initagainst the edited.config/tend.yamlproduced the eight workflow files with no diff beyond the two removedinstalllines.Everything else was read out of the pinned sources rather than run, because no check in this repo exercises a tend job's sandbox — green CI here is not evidence either way. The first real test of the
/usr/local/binroute is the first tend job on the new pin.What was read, and what it establishes
shared/steps/[email protected]—denyRead: [runnerHome, runnerWorkspace], withrunnerHomeset frompwd.getpwuid(os.getuid()).pw_dirinproxy/setup_sandbox.py(i.e./home/runner). The file does not exist at 0.2.0 and first appears at 0.2.1, so the boundary genuinely arrives with this bump.shared/steps/[email protected]— refuses to run unlessTEND_INSIDE_SANDBOX=1, and execs the adopter block asbash -eo pipefail -c.shared/steps/[email protected]—mkdtemp(prefix="tend-agent-workspace-", dir="/tmp"), "RUNNER_TEMPand the runner checkout are never handed to the agent".@anthropic-ai/[email protected]README (the versionclaude/action.yamlpins) — reads are allowed everywhere exceptdenyRead, which puts/usr/local/binin the clear; Unix sockets are "blocked by default on both platforms", the Linux filter "blocks creation ofAF_UNIXsockets by returningEPERM", and on LinuxallowUnixSocketspath allowlisting is ignored, soallowAllUnixSocketsis the only lever./usr/local/binis on the sandbox PATH and world-writable on the runner image;CARGO_TERM_COLOR,CARGO_INCREMENTALandRUSTFLAGSare all unset in the agent's environment, confirming that env block served the cache key alone.