Repository navigation
fix(skills): correct run-tend's list of restored instruction paths and events - #1311
Conversation
…d events The Instruction paths section omitted `.agents/`, which pin-instruction-paths.sh pins alongside `.claude/`, and claimed that tend-mention's relayed repository_dispatch restores nothing. The dispatch carries client_payload[pr], so prepare_agent_workspace takes the checkout_mention path and pins config to the PR's base. Both errors point the same way: a session told a path or an event is unpinned trusts the restored worktree as the PR's own version, and the never-stage rule doesn't reach it. test_run_tend_names_every_pinned_instruction_path pairs the section against INSTRUCTION_PATHSPECS.
tend-agent
left a comment
There was a problem hiding this comment.
Two accuracy points on the new text and its guard, plus one adjacent observation. Pushing the first two as a fix commit.
The guard's membership test is a prefix match — a backtick followed by the name — so .claude is satisfied by any backticked token that merely starts with those characters, `.claude.json` among them. That one sits in restore-sensitive-config.sh's own SENSITIVE list, so it is a plausible thing for this paragraph to grow. Replacing `.claude/` with `.claude.json` in the section leaves the test green while a pinned path goes unlisted, which is precisely the failure it exists to catch. Anchoring on the closing backtick, accepting either the bare name or the name plus a slash, keeps `.claude/` matching and closes it.
"every event whose checkout is a PR head" doesn't describe the main case. checkout_review fetches refs/pull/N/merge first and only falls back to refs/pull/N/head, so a pull_request_target session sits on the merge commit, not the head. A session that tests the stated condition against its own detached checkout can conclude the restore didn't run — the same direction the section is being corrected away from.
Adjacent, outside the diff: shared/steps/pin-instruction-files.sh is no longer reachable. Both claude/action.yaml and codex/action.yaml run prepare_agent_workspace.py, and nothing else in the tree names the script outside generator/tests/test_shared_steps.py and the changelog. Its header still describes a Codex-only fork pin against the default branch, which is the split this PR's "both harnesses" sentence corrects — so the stale second story survives the fix. Deleting it along with its two parametrized test cases is a maintainer call rather than this PR's scope, so it is not in the fix commit.
The guard matched a backtick plus the name as a prefix, so `.claude` was satisfied by any backticked token starting with those characters — `.claude.json`, which restore-sensitive-config.sh also pins, among them. Anchor on the closing backtick, accepting the name or the name plus a slash, so dropping `.claude/` from the list fails the test. checkout_review fetches refs/pull/N/merge before falling back to the head, so 'whose checkout is a PR head' excluded the pull_request_target case it was meant to name.
Regenerates the nine `tend-*` workflows against tend 0.2.13 (from 0.2.11). The committed diff is only the pinned action ref and the `uv` setup version (`0.12.13` → `0.12.17`); everything below rides in the action and the plugin it loads. ## What changes for this repo **A cancelled gating check no longer reads as green.** `poll_pr_checks.py` now treats only `SUCCESS`, `NEUTRAL`, and `SKIPPED` as green and exits 2 — unverified — on anything else ([max-sixty/tend#1323](max-sixty/tend#1323)). Cancelled runs are routine here: main serializes the complete suite, so a newer commit replaces the one waiting for its turn, and `running-tend` already carries a rule for reading that shape. Under 0.2.11 a session polling its own push could report such a check as verified; it now has to say it could not verify. **CI sessions ignore the bot's claude.ai account.** Skills, plugins, and MCP connectors enabled on the `leaf-agent` account no longer load into sessions that push and post as it ([max-sixty/tend#1328](max-sixty/tend#1328)). Sessions run with this repo's skills and tend's own, and nothing else. **`/tmp` is writable inside the sandbox**, as scratch private to the run ([max-sixty/tend#1324](max-sixty/tend#1324)). A tool that hard-codes a `/tmp` path no longer needs an override; `$TMPDIR` stays the documented place to write. **The sandbox launch retries a transient bridge-socket failure**, up to three attempts ([max-sixty/tend#1327](max-sixty/tend#1327)). SRT gives socat 600 ms to bind, and a slow runner previously lost the whole job before the agent started. Three plugin-side fixes also land: `review-runs` can now cancel a run parked in GitHub's `waiting` state that holds its concurrency group without ever concluding ([#1320](max-sixty/tend#1320)); `ground-claims` reads a past run's code at that run's commit rather than at the current default branch ([#1319](max-sixty/tend#1319)); and `run-tend` corrects its list of instruction paths restored to the base version on a PR ([#1311](max-sixty/tend#1311)). ## No configuration change needed 0.2.12 moved the agent into the job's own checkout through a copy-on-write view, which would have changed where dependency setup belongs. 0.2.13 reverts it ([#1339](max-sixty/tend#1339)): `setup:` and `sandbox_setup:` behave as they did at 0.2.11, so `.config/tend.yaml` is unchanged here. This repo pins no `model:`, so the harness default applies as before. Full comparison: [0.2.11...0.2.13](max-sixty/tend@0.2.11...0.2.13). Co-authored-by: leaf-agent <318509791+leaf-agent@users.noreply.github.com>
Regenerates the `tend-*` workflows with tend 0.2.13 (from 0.2.11). Mechanically the diff is the action pin `max-sixty/tend/claude@0.2.11` → `@0.2.13` in the eight workflows that run the agent, the `astral-sh/setup-uv` pin `0.12.13` → `0.12.17` in the two that install uv directly (`tend-mention`, `tend-notifications`), and a regenerated header comment in all nine. The upgrade that matters for this repo is in CI polling. `poll_pr_checks.py` previously treated any gating check that settled without a red conclusion as green — so a required check belonging to a **cancelled** or **stale** run, or a `COMPLETED` check carrying no conclusion at all, let the bot report a PR as green when nothing had actually verified it. 0.2.13 splits those out as `unverified` and gives `poll` a distinct exit code for them (max-sixty/tend#1323). Practically: fewer "checks went green" claims on PRs whose required jobs were cancelled, at the cost of some polls ending unverified rather than green. The rest, in rough order of how visible it is here: - **Sandbox reliability** — the sandbox runtime now retries past a transient bridge-socket failure at launch (max-sixty/tend#1327). That failure is one of the shapes that produces a `tend-outage` issue, so it should show up as fewer of those. - **Sandbox environment** — root `/tmp` is writable inside the sandbox (max-sixty/tend#1324); the `run-tend` skill's note that it was read-only is gone. This repo's `running-tend` skill still restates that note, so it goes stale when this merges — I'll follow up separately rather than mix a skill edit into the generated-workflow diff. - **Instruction-path pinning** — the `run-tend` skill's description of which paths get restored from the PR base, and on which events, was wrong in 0.2.11; `.agents/` is now named alongside `.claude/`, and the event list is corrected (max-sixty/tend#1311). The restore behavior itself is unchanged. - **Auth hygiene** — the bot's claude.ai account is kept out of CI sessions (max-sixty/tend#1328). - **Harness pins** — claude-code 2.1.278 (max-sixty/tend#1330), uv 0.12.17 (max-sixty/tend#1331). `.config/tend.yaml` pins no model, so the harness-default check found nothing to adjust. Full comparison: max-sixty/tend@0.2.11...0.2.13 <details><summary>Copy-on-write sandbox view: landed and reverted within this range</summary> max-sixty/tend#1333 and max-sixty/tend#1334 moved the agent into the job's own checkout and home through a copy-on-write view; max-sixty/tend#1339 reverted both before 0.2.13. Nothing from that work is in this diff — noted so a later reader doesn't chase it out of the commit list. </details> Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
run-tend's Instruction paths read as the base version on a PR section is wrong in two ways about what the pre-session restore actually does, and both errors point the same direction: they tell a session a path or an event is unpinned when it is pinned. That is the direction that loses work — the section's own rule is "never stage one of these paths from the PR checkout", becausegit addcopies the restored base content over the PR's edit, and a path the section doesn't list is a path the rule doesn't reach..agents/is missing from the list.pin-instruction-paths.shpins**/.agentsand**/.agents/**alongside the.claudepair — Codex discovers repo-local skills there — and bothREADME.mdanddocs/security-model.mdname it. Only the skill omits it. A PR that edits.agents/therefore reads as unpinned to the session handling it.A relayed review event does restore. The section says
tend-mention's relayedrepository_dispatch"carries no PR payload and restores nothing". It carriesclient_payload[pr], which is a PR payload for the purpose that matters:event_targets_pull_requestreturns true for anyclient_payloaddict, so the run takes thecheckout_mentionpath, checks out the PR head, and returns the PR's base SHA asconfig_base_sha— which is exactly what makesrestore_sensitive_configrun. The sentence was accurate when it was written; the mention path grew its PR-head checkout afterwards and the prose stayed put.So a session woken by a review on a PR that edits
CLAUDE.mdor a skill currently reads the restored worktree as the PR's own version, reports the PR's additions as absent, and readsgit status's phantom modification as a contributor mistake — the three failures the section exists to prevent.The rewritten paragraph states the condition structurally (restore happens where the checkout is a PR head) and names the cases that genuinely restore nothing: a schedule, an
issuesevent, a mention on an issue thread, and a mention on a closed PR, where the fallback is the default branch and there is nothing to pin away.test_run_tend_names_every_pinned_instruction_pathcovers the path half: it readsINSTRUCTION_PATHSPECSout of the shell and asserts the section names every root. It fails on['.agents']against the current text. The event half isn't mechanically checkable — the restore's trigger is a Python branch, not a list — so it stays prose, and the paragraph now phrases it as a condition on the checkout rather than an enumeration of event names that a later topology change can silently invalidate.