Skip to content

chore: update tend workflows (0.2.0 → 0.2.5) - #4057

Merged
max-sixty merged 3 commits into
mainfrom
tend/update-workflows
Sep 9, 2026
Merged

max-sixty merged 3 commits into
mainfrom
tend/update-workflows

Conversation

@worktrunk-bot

@worktrunk-bot worktrunk-bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Collaborator

Regenerates the eight tend-*.yaml workflows 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 /tmp clone 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/claude step now takes checkout_mode (base, review, or mention) plus base_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-setup and its POST cleanup run against. Three hand-rolled steps disappear as a result: tend-review's refs/pull/N/merge probe and second actions/checkout, tend-mention's gh 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-setup in the runner tree any more.

tend-ci-fix now fires on cancelled runs, not just failures. The job condition becomes contains(fromJSON('["failure", "cancelled"]'), …) and the prompt carries Conclusion: so the session can tell the two apart. A watched workflow that ends cancelled on main previously produced no session at all.

Bundled skills move with the pin. review-runs no longer scopes its live-work default-branch CI check to ci-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 the claude harness.

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.mjs configures denyRead: [runnerHome, runnerWorkspace] and sandbox_setup.py runs the adopter block inside that boundary under bash -eo pipefail, so the two install -m755 /home/runner/.cargo-install/… lines every workflow carried would have aborted the lifecycle before the harness started — a red job and a tend-outage issue on every trigger, in all eight workflows. tend-setup now sudo installs both binaries into /usr/local/bin after building them, which is the system-location route nu and nix already take, and .config/tend.yaml keeps only the pre-commit line, 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 /tmp clone and the runner's tree under denyRead, a restored ~/.cargo and <runner checkout>/target are 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 warm target/ (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.

nix can no longer reach its daemon, which breaks the weekly flake.lock refresh. SRT blocks socket(AF_UNIX, …) with EPERM by default on Linux, and tend passes neither allowUnixSockets nor allowAllUnixSockets. The multi-user Nix client connects to /nix/var/nix/daemon-socket/socket, so nix flake update rust-overlay and nix eval in tend-weekly fail. Nothing here can fix it — it needs an upstream lever, max-sixty/tend#1197. The Install Nix step stays (it is the half of the route this repo owns, and nix still works for anything running as runner), 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.md said tend-ci-fix "does not fire on runs that end cancelled", 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 /tmp path. And its statusline cache-check justified a debug build by tend-setup's rust-cache step being save-if: false under a key no workflow writes — the step this PR removes; the conclusion survives on the simpler reason that tend-weekly restores no Rust cache at all. That last section is also trimmed back to the fact local to this repo, since the find recipe it had grown to restate is already in the bundled skills.

Verification

The regeneration is reproducible: uvx [email protected] init against the edited .config/tend.yaml produced the eight workflow files with no diff beyond the two removed install lines.

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/bin route is the first tend job on the new pin.

What was read, and what it establishes
  • shared/steps/[email protected] — denyRead: [runnerHome, runnerWorkspace], with runnerHome set from pwd.getpwuid(os.getuid()).pw_dir in proxy/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 unless TEND_INSIDE_SANDBOX=1, and execs the adopter block as bash -eo pipefail -c.
  • shared/steps/[email protected] — mkdtemp(prefix="tend-agent-workspace-", dir="/tmp"), "RUNNER_TEMP and the runner checkout are never handed to the agent".
  • @anthropic-ai/[email protected] README (the version claude/action.yaml pins) — reads are allowed everywhere except denyRead, which puts /usr/local/bin in the clear; Unix sockets are "blocked by default on both platforms", the Linux filter "blocks creation of AF_UNIX sockets by returning EPERM", and on Linux allowUnixSockets path allowlisting is ignored, so allowAllUnixSockets is the only lever.
  • Probed from a live 0.2.0 session: /usr/local/bin is on the sandbox PATH and world-writable on the runner image; CARGO_TERM_COLOR, CARGO_INCREMENTAL and RUSTFLAGS are all unset in the agent's environment, confirming that env block served the cache key alone.

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

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.
@worktrunk-bot

Copy link
Copy Markdown
Collaborator Author

All four points confirmed against the pinned sources; 50bfd1f430c69186139cfde849f063ae1f0c4520 acts on them. The PR description now carries the result — this is what changed per point.

The sandbox_setup break: confirmed and fixed. sandbox_runtime.mjs first appears at 0.2.1 and is absent at 0.2.0, so the boundary does arrive with this bump rather than already being live. tend-setup now sudo installs both binaries into /usr/local/bin and .config/tend.yaml keeps only the pre-commit line — the route suggested, and the SRT README confirms it works: reads are allowed everywhere except denyRead, so /usr/local/bin is in the clear. I checked from a live 0.2.0 session that it is also on the sandbox PATH.

The cache: removed rather than left. Confirmed the restore is doubly dead — the agent's tree is mkdtemp(prefix="tend-agent-workspace-", dir="/tmp"), so a restored target/ is at the wrong path even before denyRead makes it unreadable. The CARGO*/RUST* env block went with it: those three vars are unset in the agent's environment today, so they only ever fed the cache key. Filed max-sixty/tend#1198 for a supported way to warm the agent's own tree. Worth being explicit that removal doesn't recover the loss: sessions that compile now compile cold against the 5.1 GB target/ a 0.2.0 session inherited.

The doc claims: both in this PR. Deferring the cancelled sentence was the wrong call — it is the one the nightly agent reads to decide whether to record repo-wide breakage, and it is false the moment this merges.

The nix question: settled, and it's a real loss. @anthropic-ai/[email protected]'s README documents the answer directly — the Linux seccomp filter "blocks creation of AF_UNIX sockets by returning EPERM", sockets are blocked by default, and allowUnixSockets path allowlisting is ignored on Linux because seccomp can't filter by path. tend passes neither lever, so the multi-user client's connection to /nix/var/nix/daemon-socket/socket fails and tend-weekly loses its flake.lock refresh. Nothing in this repo can fix it: filed max-sixty/tend#1197, and the weekly skill now tells that session to report the failure and carry the rest of the toolchain bump instead of reading it as a broken bump.

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 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 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-weekly installs no wt, and its rust-cache step is save-if: false under 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.
@worktrunk-bot

Copy link
Copy Markdown
Collaborator Author

Both in-tree points are fixed in d24198babebc0e07c17eecccc8e62c079f54b0cd; the nix one I've left alone, for the reason the review gives.

The stale rationale is a real one and I took the suggested replacement verbatim. tend-weekly gets its Rust setup from ./.github/actions/tend-setup (tend-weekly.yaml#L103), and after this PR that action has no Swatinem/rust-cache step at all — grep -rn Swatinem .github/workflows/tend-*.yaml .github/actions/tend-setup/action.yaml returns nothing on the head. So the sentence didn't just describe machinery that won't exist; it also named a mechanism (save-if: false against an unwritten key) that was never the reason the build is cold. "Restores no Rust cache" is both true and the whole of it.

Session Log Paths: trimmed rather than deleted. The section is down to one paragraph that keeps the fact local to this repo — the old -home-runner-work-worktrunk-worktrunk/ prefix is gone and dates a run rather than locating one — and points at the bundled find recipe instead of restating it. I kept the heading because that prefix is what a session recalling an older thread will still find in its own prior logs, and a negative fact needs somewhere to live; the eleven lines and the duplicated code block were the part that wasn't earning its place.

The nix degradation stays. Agreed it's a merge decision and shouldn't hold the bump: the socket boundary is live at 0.2.5 whenever it lands, and the alternative is keeping all eight workflows on a pin whose sandbox_setup block aborts before the harness starts — a strictly worse position than one weekly job losing flake.lock refresh until max-sixty/tend#1197. It's called out as the one shipped degradation in the description, which is where a maintainer should get to overrule it.

The description now says three falsified claims rather than two, and names this one.

@max-sixty
max-sixty merged commit c308b20 into main Sep 9, 2026
37 checks passed
@max-sixty
max-sixty deleted the tend/update-workflows branch September 9, 2026 10:37
max-sixty pushed a commit that referenced this pull request Sep 10, 2026
…/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]>
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