Repository navigation
fix: use tend: plugin prefix for skill invocations - #7
Merged
Merged
Conversation
Replace the runtime skill-copying step in action.yaml with a proper Claude Code plugin structure. Skills are now distributed via the plugin marketplace instead of being copied into .claude/skills/ at action runtime. - Add .claude-plugin/plugin.json manifest - Add .claude-plugin/marketplace.json for marketplace registration - Remove "Install CI skills" step from action.yaml - Update README.md and DESIGN.md to reflect plugin-based architecture Co-Authored-By: Claude <[email protected]>
# Conflicts: # DESIGN.md # README.md
- Rename plugin/marketplace from continuous to tend - Fix tend→continuous regressions from merge conflict resolution - Add --plugin-dir to claude_args so CI loads the plugin from the action checkout instead of copying skills - Update action name and description Co-Authored-By: Claude <[email protected]>
Consistent with worktrunk's environment naming. Co-authored-by: Claude <[email protected]>
# Conflicts: # DESIGN.md # README.md
Plugin skills require the plugin-name: prefix for invocation. Update all skill references from /tend-* to /tend:tend-* across: - action.yaml system_prompt_append - generator workflow prompts - skill cross-references in SKILL.md files - review-reviewers.yaml prompt - docs/security-model.md Co-Authored-By: Claude <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Mar 25, 2026
* feat: convert skills to Claude Code plugin Replace the runtime skill-copying step in action.yaml with a proper Claude Code plugin structure. Skills are now distributed via the plugin marketplace instead of being copied into .claude/skills/ at action runtime. - Add .claude-plugin/plugin.json manifest - Add .claude-plugin/marketplace.json for marketplace registration - Remove "Install CI skills" step from action.yaml - Update README.md and DESIGN.md to reflect plugin-based architecture Co-Authored-By: Claude <[email protected]> * fix: use tend naming, load plugin via --plugin-dir in CI - Rename plugin/marketplace from continuous to tend - Fix tend→continuous regressions from merge conflict resolution - Add --plugin-dir to claude_args so CI loads the plugin from the action checkout instead of copying skills - Update action name and description Co-Authored-By: Claude <[email protected]> * fix: use 'release' environment for PyPI publishing (#4) Consistent with worktrunk's environment naming. Co-authored-by: Claude <[email protected]> * fix: use tend: plugin prefix for all skill invocations Plugin skills require the plugin-name: prefix for invocation. Update all skill references from /tend-* to /tend:tend-* across: - action.yaml system_prompt_append - generator workflow prompts - skill cross-references in SKILL.md files - review-reviewers.yaml prompt - docs/security-model.md Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Mar 25, 2026
* fix: distinguish 404 from 403 in bot check, add check to README, fix types - check_bot_permission now surfaces "not found as a collaborator" on 404, catching bot_name typos instead of the generic "may require admin access" - Add `uvx continuous check` to Quick Start Step 5 - Fix monkeypatch type annotations across all test files (object → pytest.MonkeyPatch, remove type: ignore comments) Co-Authored-By: Claude <[email protected]> * Rename to tend, add PyPI publishing (#3) * feat: publish generator to PyPI as `tend` `continuous` was taken on PyPI, so the package is named `tend`. The Python import remains `continuous`; only the PyPI distribution name and CLI entry point change (`uvx tend init`). Adds trusted-publisher workflow for tag-triggered PyPI releases via OIDC. Co-Authored-By: Claude <[email protected]> * rename: max-sixty/continuous → max-sixty/tend Update all action references, URLs, workflow headers, and pyproject homepage to match the renamed GitHub repo. Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]> * fix: use 'release' environment for PyPI publishing (#4) Consistent with worktrunk's environment naming. Co-authored-by: Claude <[email protected]> * feat: convert skills to Claude Code plugin (#5) * feat: convert skills to Claude Code plugin Replace the runtime skill-copying step in action.yaml with a proper Claude Code plugin structure. Skills are now distributed via the plugin marketplace instead of being copied into .claude/skills/ at action runtime. - Add .claude-plugin/plugin.json manifest - Add .claude-plugin/marketplace.json for marketplace registration - Remove "Install CI skills" step from action.yaml - Update README.md and DESIGN.md to reflect plugin-based architecture Co-Authored-By: Claude <[email protected]> * fix: use tend naming, load plugin via --plugin-dir in CI - Rename plugin/marketplace from continuous to tend - Fix tend→continuous regressions from merge conflict resolution - Add --plugin-dir to claude_args so CI loads the plugin from the action checkout instead of copying skills - Update action name and description Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]> * rename: continuous → tend throughout codebase (#6) Complete the rename started in eebbc0c. Renames Python module (continuous → tend), skill directories, generated workflow names, config filename (.config/tend.toml), all cross-references in docs, skills, and tests. Co-authored-by: Claude <[email protected]> * fix: use tend: plugin prefix for skill invocations (#7) * feat: convert skills to Claude Code plugin Replace the runtime skill-copying step in action.yaml with a proper Claude Code plugin structure. Skills are now distributed via the plugin marketplace instead of being copied into .claude/skills/ at action runtime. - Add .claude-plugin/plugin.json manifest - Add .claude-plugin/marketplace.json for marketplace registration - Remove "Install CI skills" step from action.yaml - Update README.md and DESIGN.md to reflect plugin-based architecture Co-Authored-By: Claude <[email protected]> * fix: use tend naming, load plugin via --plugin-dir in CI - Rename plugin/marketplace from continuous to tend - Fix tend→continuous regressions from merge conflict resolution - Add --plugin-dir to claude_args so CI loads the plugin from the action checkout instead of copying skills - Update action name and description Co-Authored-By: Claude <[email protected]> * fix: use 'release' environment for PyPI publishing (#4) Consistent with worktrunk's environment naming. Co-authored-by: Claude <[email protected]> * fix: use tend: plugin prefix for all skill invocations Plugin skills require the plugin-name: prefix for invocation. Update all skill references from /tend-* to /tend:tend-* across: - action.yaml system_prompt_append - generator workflow prompts - skill cross-references in SKILL.md files - review-reviewers.yaml prompt - docs/security-model.md Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]> * Set up tend for tend, add install-tend skill (#8) * feat: set up continuous for self, add install-continuous skill - Add .config/continuous.toml with bot_name = "continuous-bot" - Generate 6 workflow files via `uvx continuous init` - Add install-continuous skill with step-by-step setup guide - Add oauth-token.sh script for standalone Claude OAuth PKCE flow (extracts just the token without /install-github-app side effects) Co-Authored-By: Claude <[email protected]> * refactor: rename continuous → tend, fix branch protection model - Rename config, workflows, and skill to match tend rename on main - Fix branch protection: use "Restrict updates" ruleset (not "Require PR reviews") — the merge restriction is the security boundary, not approvals. Matches worktrunk's security model. - Use bypass_mode: exempt (silent) instead of always (checkbox) Co-Authored-By: Claude <[email protected]> * chore: add TODOs for remaining setup steps - Bot PAT generation and BOT_TOKEN secret - Collaborator invitation acceptance - OAuth token exchange end-to-end verification Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]> * fix: jq pipe precedence bug in review duplicate detection `.body | length > 0 or .state == "APPROVED"` evaluates `.state` against the body string (not the review object) when body is empty, because jq `|` has lower precedence than `or`. Parenthesize as `(.body | length)`. Ported from worktrunk fix in max-sixty/worktrunk#1681. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> * feat: review-reviewers targets multiple repos via matrix strategy (#9) The hourly review-reviewers workflow now checks out the tend repo (for creating improvement PRs/issues) and reads CI data from target repos using a separate TARGET_REPO_TOKEN. This decouples "where findings go" (tend) from "where CI data comes from" (adopter repos). Changes: - Workflow uses matrix strategy with hardcoded repo list (worktrunk) - list-recent-runs.sh accepts TARGET_REPO and TARGET_REPO_TOKEN env vars - Skill documents two-token model and uses -R/GH_TOKEN override for target repo commands - Default workflow prefix changed from cd- to tend- Co-authored-by: Claude <[email protected]> * fix: acknowledge PR author responses to bot review concerns Add guidance to the non-mention fallback prompt: "A comment that responds to concerns you raised in a review is directed at you — briefly acknowledge that the concerns are resolved." Ported from worktrunk fix in max-sixty/worktrunk#1688. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> * feat: add tend self-analysis, support multiple script prefixes (#10) Add max-sixty/tend to the review-reviewers matrix so it analyzes its own CI runs. The script now accepts multiple prefix arguments (e.g., `tend- review-reviewers`) to discover non-`tend-` prefixed workflows. Co-authored-by: Claude <[email protected]> * simplify: remove TARGET_REPO_TOKEN, use GH_TOKEN for all repos (#11) BOT_TOKEN is already set as GH_TOKEN by claude-code-action and can read public repos. The per-repo token override was premature — a flat list of repos in the matrix is sufficient. Co-authored-by: Claude <[email protected]> * fix: unique artifact names for matrix workflow jobs (#13) The upload-artifact action rejects duplicate names within a single workflow run. Since #9 added matrix strategy to review-reviewers, the worktrunk job consistently fails with a 409 Conflict because both matrix jobs try to upload 'claude-session-logs'. Append a truncated INVOCATION_ID suffix (unique per job) to the artifact name. Update download commands in skills to use --pattern glob matching. Co-authored-by: continuous-bot <[email protected]> Co-authored-by: Claude Opus 4.6 <[email protected]> * Set up tend-agent for this repo (#14) * rename: continuous-bot → tend-bot Update bot_name in config and regenerate all workflows. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> * set up tend-agent: config, secrets, collaborator, improved skill - Rename bot from continuous-bot/tend-bot to tend-agent - Regenerate all workflows for tend-agent - Remove stale TODOs from config - Improve install-tend skill: - Add Chrome automation section for browser steps - Document PAT creation flow (verify login, no-expiry, read token) - Use /invitations URL instead of /notifications for accepting - Add jean-claude integration for verification codes Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]> * fix: ban --watch flags in CI skills to prevent hangs (#17) * rename: continuous-bot → tend-bot Update bot_name in config and regenerate all workflows. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> * set up tend-agent: config, secrets, collaborator, improved skill - Rename bot from continuous-bot/tend-bot to tend-agent - Regenerate all workflows for tend-agent - Remove stale TODOs from config - Improve install-tend skill: - Add Chrome automation section for browser steps - Document PAT creation flow (verify login, no-expiry, read token) - Use /invitations URL instead of /notifications for accepting - Add jean-claude integration for verification codes Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> * fix: ban --watch flags in CI skills to prevent job hangs The review job hung for 60 minutes because Claude used `gh pr checks --watch` which blocks indefinitely — especially when the only check is the review job watching itself. Strengthened "Avoid" to "NEVER use" in tend-running-in-ci, and added explicit ban in tend-review's CI monitoring step. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]> * feat: check merge restriction and org secrets in `tend check` (#16) `check_branch_protection` now verifies the bot can't actually merge PRs, not just that the branch is "protected". Checks for a restrict-updates ruleset or required reviews > 0. Caught a real gap on prql/prql where branch was protected but 0 reviews required. `check_secrets` falls back to org-level secrets when repo-level lookup misses. Requires `admin:org` scope; degrades gracefully without it. `tend check --fix` creates a "Merge access" ruleset (restrict-updates, admin-only bypass) when the branch protection check fails. `install-tend` skill now includes step 9 for creating the skill overlay, with guidance to avoid duplicating CLAUDE.md content. Co-authored-by: Claude <[email protected]> * fix: port missing review guidance from worktrunk fixes #1585 and #1624 (#15) Three sentences were not carried over when the review skill was generalized: - Self-authored PR reviews: add "(lint failures, edge cases) and is intentionally valuable" to prevent bots from skipping self-review (#1624) - Thread resolution: add "Different wording is not addressed when less accurate" to close loophole where bots resolve threads on any change (#1585) - Self-authored thread resolution: add "read the code and verify independently" to make extra-skepticism guidance actionable (#1585) Co-authored-by: Claude <[email protected]> * feat: hint admin:org scope when org secret lookup returns 403 (#19) When the gh token lacks admin:org scope, _list_org_secrets gets a 403 and returns None — check_secrets then reports secrets as missing with no explanation. Now _list_org_secrets distinguishes 403 from other failures, and check_secrets appends a remediation hint (gh auth refresh -h github.com -s admin:org) when secrets are missing and the org lookup was forbidden. The hint only appears when secrets are actually missing (not when all are found at repo level). Co-authored-by: Claude <[email protected]> * docs: improve README and install-tend based on first real setup (#21) Fixes discovered during PRQL repo onboarding: - Fix plugin install command: marketplace add + plugin install - Add secret name override guidance for repos with existing bot PATs - Add migration section for repos using claude-code-action - Document composite-action pattern for setup steps needing `with:` params - Clarify CLAUDE.md vs skill overlay responsibilities - Note that tend-renovate covers Dependabot, Renovate, and labeled PRs - Fix OAuth token description (PKCE flow, not console.anthropic.com) install-tend SKILL.md: - Check for existing bot PAT secrets and suggest [secrets] override - Add step 2b to detect/remove claude-code-action workflows - Add `uvx tend check` to step 2 - Fix checklist: push requires explicit permission Co-authored-by: Claude <[email protected]> * feat: add `setup.raw` for injecting arbitrary YAML steps (#22) Adds a `raw` field to the `[setup]` config section — a multiline TOML string injected verbatim into workflow steps with correct indentation. This avoids needing a local composite action just to pass `with:` parameters to actions like rust-cache or setup-node. Also renames `setup_raw` local variable to `setup_section` to avoid confusion with the new `setup_raw` Config field. Co-authored-by: Claude <[email protected]> * fix: use double-quoted cron strings for prettier compatibility (#20) Prettier reformats single-quoted YAML strings to double-quoted. This was the only incompatibility between generated workflows and prettier — all other patterns (block scalars, long expressions, multi-line conditions) are already preserved by prettier. Co-authored-by: Claude <[email protected]> * fix: handle non-dict response from branch protection API (#28) The GitHub API can return a boolean (e.g., `true`) instead of a dict for the branch protection endpoint. This caused an `AttributeError` when calling `.get()` on the parsed JSON. Treat non-dict responses like the "can't read details" case — branch is protected, assume OK. Also fix Config constructor calls in tests (missing `setup_raw` arg). Co-authored-by: Claude <[email protected]> * test: verify raw setup steps come after uses and run steps (#27) Co-authored-by: Claude <[email protected]> * refactor: split into two plugins (install-tend + tend) (#31) Users install the marketplace to get `install-tend` for setup, while CI loads the `tend` plugin via `--plugin-dir` in the composite action. This avoids loading 7 CI-only skills into users' local Claude Code. - `plugins/install-tend/` — user-facing setup skill - `plugins/tend/` — CI skills (review, triage, ci-fix, nightly, etc.) - marketplace.json lists both plugins with separate source paths - action.yaml --plugin-dir now points to plugins/tend - All /tend:* cross-references remain valid Co-authored-by: Claude <[email protected]> * docs: deduplicate README and install-tend skill (#32) Symlink README.md into the skill directory so SKILL.md can `@README.md` for config reference. Trim README's quick-start from 7 detailed steps to a pointer to the skill. SKILL.md now references README for config options instead of re-explaining them. Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]> * simplify: flatten setup config, remove default_branch (#18) * simplify: flatten setup config, remove default_branch Setup steps are now a top-level ordered array: setup = [ {uses = "./.github/actions/setup-node"}, {run = "echo NODE_ENV=test >> $GITHUB_ENV"}, {uses = "./.github/actions/setup-cache"}, ] This replaces the old [setup] table with separate uses/run arrays, which couldn't express interleaved ordering. Removed default_branch from config — workflows now derive it at runtime: checkout omits ref: (defaults to repo's default branch), ci-fix uses github.event.repository.default_branch in the if: condition, and tend check detects it via the GitHub API. Co-Authored-By: Claude <[email protected]> * fix: update install-tend skill for new setup format Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]> * docs: align PAT guidance between README and install-tend skill (#29) Classic PATs are the default recommendation in both files. Fine-grained PATs noted as a supported alternative with the required permissions. Co-authored-by: Claude <[email protected]> * docs: add CLAUDE.md with dev commands and project structure (#30) Move the architecture tree from README.md into CLAUDE.md with more detail (file-level breakdown of the generator package). Add test/build commands and note that tend-*.yaml workflows are generated from config. Co-authored-by: Claude <[email protected]> * nightly: default to PRs over issues, prompt for repo-specific overlay (#36) Two changes to generic tend skills: **tend-nightly**: Step 5 now defaults to creating a PR for each finding instead of an issue. Issues are the fallback for findings with no obvious fix (design questions, maintainer input needed). This avoids filling the issue tracker with actionable items that could just be PRs. **tend-running-in-ci**: New "First Steps" section prompts the agent to check for and load a project-specific overlay skill (typically `running-tend`) before doing anything else. Without this, project conventions like labels, survey scripts, and test commands were silently skipped. Co-authored-by: Claude <[email protected]> * fix: nightly skips closing stale issues on quiet days Step 2 said "skip to Step 4" when no recent commits, which skipped Step 3 (close resolved issues). Step 3 doesn't depend on recent commits — issues can be resolved by older changes. Co-Authored-By: Claude <[email protected]> * fix: use relative skip instead of step number "Skip this step" is resilient to reordering. Co-Authored-By: Claude <[email protected]> * simplify: fold setup_raw into setup array, detect default branch at init (#37) Setup entries now support three types: {uses}, {run}, and {raw}. Raw YAML entries can be interleaved with structured steps instead of always appending at the end via a separate setup_raw key. The default branch for ci-fix's branches filter is detected from git at init time (git rev-parse --abbrev-ref origin/HEAD), falling back to "main". Override with branches config: [workflows.ci-fix] branches = ["main", "release"] Co-authored-by: Claude <[email protected]> * fix: require watched_workflows for ci-fix, add CI workflow (#33) The generator silently defaulted watched_workflows to ["ci"], producing a tend-ci-fix.yaml that watched a nonexistent workflow. This meant tend-ci-fix never triggered on any repo that didn't happen to have a workflow named "ci". - generate_ci_fix now errors when watched_workflows is missing - generate_all skips ci-fix with a warning instead of generating a broken workflow - install-tend skill now discovers existing CI workflows and configures watched_workflows explicitly - Added a ci workflow for this repo (runs pytest) - Configured .config/tend.toml with watched_workflows = ["ci"] Co-authored-by: Claude <[email protected]> * docs: document fork PR inline comment limitation (#38) GitHub has no secrets-safe event for inline review comments on fork PRs — `pull_request_review_comment` runs in fork context without secrets, and unlike `pull_request` there is no `_target` variant. Document this in both the README (new Limitations section) and the security model (inline with the event type reference). Co-authored-by: Claude <[email protected]> * rename CI plugin to tend-ci-runner, install via marketplace (#39) The CI plugin was named `tend`, which was confusing — users might install it thinking it's the main plugin. Renamed to `tend-ci-runner` with a description that says "not for manual installation." Also dropped the `tend-` prefix from individual skill names since the plugin name already provides the namespace (e.g. `/tend-ci-runner:review` instead of `/tend:tend-review`). The action now installs the plugin via `claude plugin marketplace add` + `claude plugin install` instead of `--plugin-dir`. Co-authored-by: Claude <[email protected]> * chore: regenerate workflows with latest generator (#40) * fix: require watched_workflows for ci-fix, add CI workflow The generator silently defaulted watched_workflows to ["ci"], producing a tend-ci-fix.yaml that watched a nonexistent workflow. This meant tend-ci-fix never triggered on any repo that didn't happen to have a workflow named "ci". - generate_ci_fix now errors when watched_workflows is missing - generate_all skips ci-fix with a warning instead of generating a broken workflow - install-tend skill now discovers existing CI workflows and configures watched_workflows explicitly - Added a ci workflow for this repo (runs pytest) - Configured .config/tend.toml with watched_workflows = ["ci"] Co-Authored-By: Claude <[email protected]> * chore: regenerate workflows with latest generator Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]> * docs: add fork limitation comment to pull_request_review_comment trigger (#41) * docs: document fork PR inline comment limitation GitHub has no secrets-safe event for inline review comments on fork PRs — `pull_request_review_comment` runs in fork context without secrets, and unlike `pull_request` there is no `_target` variant. Document this in both the README (new Limitations section) and the security model (inline with the event type reference). Co-Authored-By: Claude <[email protected]> * fix: require watched_workflows for ci-fix, add CI workflow (#33) The generator silently defaulted watched_workflows to ["ci"], producing a tend-ci-fix.yaml that watched a nonexistent workflow. This meant tend-ci-fix never triggered on any repo that didn't happen to have a workflow named "ci". - generate_ci_fix now errors when watched_workflows is missing - generate_all skips ci-fix with a warning instead of generating a broken workflow - install-tend skill now discovers existing CI workflows and configures watched_workflows explicitly - Added a ci workflow for this repo (runs pytest) - Configured .config/tend.toml with watched_workflows = ["ci"] Co-authored-by: Claude <[email protected]> * remove pull_request_review_comment from tend-mention This event silently fails on fork PRs (no secret access) and GitHub has no _target variant. Remove it from the workflow trigger, verify conditions, prompt branches, and all associated dead code (concurrency group fallback, pulls/comments reaction API, EVENT_PR_NUMBER env var). Simplify the engagement-check shell script now that only issues and issue_comment remain. Co-Authored-By: Claude <[email protected]> * docs: add fork limitation comment to pull_request_review_comment trigger Keep the event for same-repo PRs where it works fine; add a comment noting secrets are unavailable on fork PRs (no _target variant exists). This reverts the removal in c207dc6 — the event is useful for non-fork PRs, the limitation only affects forks and is documented in README. Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]> * fix: exclude own workflow from CI polling to prevent deadlock (#42) * simplify: fold setup_raw into setup array, detect default branch at init Setup entries now support three types: {uses}, {run}, and {raw}. Raw YAML entries can be interleaved with structured steps instead of always appending at the end via a separate setup_raw key. The default branch for ci-fix's branches filter is detected from git at init time (git rev-parse --abbrev-ref origin/HEAD), falling back to "main". Override with branches config: [workflows.ci-fix] branches = ["main", "release"] Co-Authored-By: Claude <[email protected]> * nightly: default to PRs over issues, prompt for repo-specific overlay (#36) Two changes to generic tend skills: **tend-nightly**: Step 5 now defaults to creating a PR for each finding instead of an issue. Issues are the fallback for findings with no obvious fix (design questions, maintainer input needed). This avoids filling the issue tracker with actionable items that could just be PRs. **tend-running-in-ci**: New "First Steps" section prompts the agent to check for and load a project-specific overlay skill (typically `running-tend`) before doing anything else. Without this, project conventions like labels, survey scripts, and test commands were silently skipped. Co-authored-by: Claude <[email protected]> * fix: nightly skips closing stale issues on quiet days Step 2 said "skip to Step 4" when no recent commits, which skipped Step 3 (close resolved issues). Step 3 doesn't depend on recent commits — issues can be resolved by older changes. Co-Authored-By: Claude <[email protected]> * fix: use relative skip instead of step number "Skip this step" is resilient to reordering. Co-Authored-By: Claude <[email protected]> * fix: remove CI monitoring from tend-review to fix self-referential deadlock The review workflow polls `gh pr checks` after submitting, but sees itself as a pending check — waiting forever until the 60-minute timeout kills it. Confirmed in session logs from multiple repos. Branch protection already prevents merging with failing CI, making the approval-dismissal mechanism redundant. Removes stale references in review-reviewers and security-model.md. Co-Authored-By: Claude <[email protected]> * Revert "fix: remove CI monitoring from tend-review to fix self-referential deadlock" This reverts commit 5e1b4c0. * fix: exclude own workflow from CI polling to prevent deadlock The tend-review workflow polls `gh pr checks` in Step 6, but sees itself as a pending check — waiting forever until the 60-minute timeout kills it. Fix: filter out `$GITHUB_WORKFLOW` from the polling loop in tend-running-in-ci, and reinforce the self-exclusion in tend-review's Step 6. This is always safe — a workflow can never complete its own check. Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]> * docs: require source evidence for user-facing comments (#43) CI bot comments are permanent and public — a hallucinated detail (wrong syntax, invented API) misleads users and erodes trust. Add guidance that specific claims in comments must be verified against source text (docs, help output, tests) before posting, not just inferred from internal code. Also encourage linking to project documentation where available — finding the link forces verifying the claim. Motivated by worktrunk-bot posting a `$WT_TARGET` environment variable that doesn't exist (hooks use `{{ target }}` Jinja templates). The bot read internal Rust code showing a "target" variable but never checked the user-facing docs for the actual syntax. Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]> * feat: add debug-ci-session skill for investigating CI bot behavior (#44) Extracts session log parsing into a canonical user-facing skill in install-tend. CI skills (running-in-ci, review-reviewers) now reference it instead of duplicating jq recipes. action.yaml installs install-tend in CI so bots can load the skill too. Co-authored-by: Claude <[email protected]> * fix: correct jq queries in debug-ci-session against real session logs (#45) Tested all queries against 3 real JSONL artifacts (worktrunk reviews, tend reviews). Two fixes: - Type documentation: real sessions have user, assistant, progress, queue-operation, last-prompt, system — updated to document the main message types (user/assistant with .message.content) and note the rest as metadata. - gh commands query: \bgh\b regex replaces startswith/contains filter that missed gh calls inside variable assignments and multi-line scripts (caught 14/14 vs 5/14 on a real review session). Co-authored-by: Claude <[email protected]> * fix: replace hand-rolled OAuth flow with `claude setup-token` (#46) The previous script reimplemented the OAuth 2.0 PKCE flow in bash (localhost callback server, curl token exchange). The token exchange endpoint aggressively rate-limits curl requests, making the script unusable — it failed on first use and never recovered. `claude setup-token` does the same OAuth flow using Claude Code's own Node.js implementation, which isn't rate-limited. The script now wraps that command and extracts the token from its output. Co-authored-by: Claude <[email protected]> * docs: add triage+fork privilege model to DESIGN.md Auth section Document two privilege models for bot authentication: - **Triage + fork** (proposed default): bot has triage access on target repo, pushes to its own fork. The collaborator level is the security boundary — no branch protection required. - **Write + branch protection** (current model): bot has write access, merge restriction is the security boundary. Key insight: classic PATs are all-or-nothing, and fine-grained PATs don't support outside collaborators (GitHub roadmap #601). The collaborator level is the only lever for restricting what the token can do on a specific repo. Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]> Co-authored-by: tend-agent <[email protected]> Co-authored-by: continuous-bot <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Oct 12, 2026
#1544) With `workflows.review.await_ci: false` under `merge: yolo`, a review still waited for CI on a head the bot pushed itself, because under yolo it lands those, and it polled any fix it pushed. In Leaf that was 28 of the last 40 merged PRs, each holding a runner for the ~50-minute suite. This hands those landings to the completion of CI: the review records the head and ends. When CI finishes green, a short event-started session lands it. **Design.** Each fact is recorded or judged where it is known. Code decides only what is crisp. - **Who pushed: recorded by the session that pushed.** Under yolo, a bot session that pushes to a PR branch runs `land_pr.py pushed <sha>` (**After the push** in `push-commits`). That sets a `tend/land/pushed` status, which only the bot's token can create. Commit metadata doesn't establish who pushed, so it is no longer read. A missing record errs safe: that head's landing waits for a maintainer. - **The landing record: written by the review.** A review settles everything `merge-pr` asks of a head except its CI: reviewed head, no draft, no hold, no unresolved finding, no owning run. It then runs `land_pr.py intend <pr> <sha> <reviewed-base> [--skip ...]`, which sets a `tend/land/<pr>` status on that exact head. The description is JSON naming the base the review read and the checks its CI policy skips. - `review_preflight.py start` now writes `$TMPDIR/reviewed-base` beside `reviewed-head`. - `intend` refuses, with exit 3 and no record, when the head has no `tend/land/pushed` record, when the PR has moved off that head or that base, or when the policy is too long for a description. - A check may finish between the review's read and the record. The record is itself a commit status, so its creation wakes tend-land like any other status, and the check reads every check again. - **What CI completion decides: agentless code.** A generated `tend-land` workflow wakes on whatever its gate reads: every workflow but Tend's own (`workflow_run` with `["**", "!tend-*"]`), a commit `status`, or another app's `check_suite`. A narrower wake-up would strand a recorded head whose last check comes from outside it. Its `check` job skips workflow runs on this repository's default branch, though a fork's own `main` is still a PR head. It runs a new composite action, `max-sixty/tend/[email protected]` (`land_pr.py check`), with no agent and no checkout of the PR, and decides only two crisp things: whether a PR at that commit carries the bot's `tend/land/<pr>` record for that head and base, and whether every check except the recorded skips finished green. It names every eligible PR at the commit, not just the first. The wake-up is near-free. Events that can't land or repair anything are dropped by the job's `if:` before a runner is allocated: pending statuses, Tend's own `tend/land/pushed` and `tend/land/repair` markers, and workflow runs or check suites with no PR in this repository. Only one check runs per commit at a time (`cancel-in-progress: false`, so a burst collapses to the running check plus the newest). - **The landing decision: an agent.** Green with a record starts `land`, a short `merge-pr` session. It reads the PR afresh for holds in prose, findings, the approval and ownership, then makes the pinned merge. Earlier rounds of this PR tried to code these as timestamp and metadata gates. Each review round found another hole, which is the accretion tend's Code-vs-Agent guidance warns about, so they're judged here instead. The cost is one session of a few minutes, and only when a recorded head goes green, against the ~50-minute wait it replaces. - **Repair: an agent.** A red on a PR with no human author starts `repair`, a `continue-pr` session, whether or not the head was recorded. This matches what the review that waited used to repair, including Dependabot and Renovate PRs, which `continue-pr` now covers. The first event to see the red starts it, even while sibling checks still run, and marks the head with a `tend/land/repair` status. Every later event on that head finds the mark and starts nothing more, whichever event came first. Red is the rollup's own classification, so a timed-out run and a status's `error` count. `continue-pr` defers to an owning run that is still active. A red on a human's PR stands beside the approval for its author. - **No session waits after a push.** A repair or landing that pushes records the push and ends, as the review does. A landing session that finds checks running again (a rerun) ends too, since their completion starts another landing. Each session first checks that its head is still the PR's, before `setup:` or the agent. A session queued behind one that already moved the head (another repair's push) ends at that step, and `continue-pr` with the wait off polls no head. - **Sessions.** `land` and `repair` run one job per PR (a matrix over the check's output). Each runs in the review's concurrency group for that PR (`tend-review-<pr>`, `queue: max`), so it never runs beside a review of the same PR. Each job is named for its PR (`land #7`), and `active_subject_runs.py` reads tend-land runs' active job names, so a notifications poll or `continue-pr` sees the session as the PR's owner. Both run on the review's harness, model, effort and arguments, whose credentials the install already provisions. **What the review does now.** Under the option, the review no longer waits on a bot-pushed head or polls a fix it pushed, including an accepted fix on a human's PR: it records the push, and the queued review records the head. A head a human pushed is left for a maintainer while its checks run, as before. **Option for you (not in this PR).** The landing record could cover human-pushed heads too. Under yolo, a human's approved PR whose checks are still running would then land through the same session when CI completes, instead of waiting for a maintainer. That widens what yolo lands without a person present, so it's left as a choice. It would be one change to `intend`'s `tend/land/pushed` requirement. **Why not GitHub auto-merge.** `merge-pr` forbids it (#124, #1172). Auto-merge stays enabled across pushes by anyone with write access, so it can land a head no review read. The landing session's merge passes the recorded SHA, which GitHub refuses once the head moves. **Cost per landing (estimate, not yet measured live).** A bot-pushed head in Leaf wakes the check about twice: the review's own landing record (a status) and the `ci` run completing. Pending statuses, the push marker and Tend's own workflows are filtered out. Each check is a sub-minute job that GitHub bills as one runner-minute, so a landing costs about 2–3 runner-minutes of checks plus one landing session. That session checks out the default branch with no `setup:` and runs a short `merge-pr` agent, a few minutes. Together that is roughly 5–8 runner-minutes per landing, against the ~50 a waiting review held. A repair costs one check plus the repair session, which runs `setup:` as before. The first live adoption should measure both from the runs' timing data. **Limits** - The wake-up uses `workflow_run`'s documented glob support with a `!tend-*` negation. GitHub documents negation for branch and path filters, not explicitly for `workflows`, so the first live adoption should confirm that Tend's own runs don't wake it. If they do, it only means extra agentless check runs. - Consumers whose `setup:` keys a secret on `github.event_name == 'workflow_run'` hand it to the new `repair` job too. That job continues a bot PR and so runs PR code. Leaf's Cloudflare token export is one such expression, and it should check `github.workflow` when Leaf adopts this. The `land` job runs no `setup:`. **Key files** - `plugins/tend-ci-runner/scripts/land_pr.py`: the three records and the check, in its header. - `land/action.yaml` - `generator/src/tend/templates/land.yaml.j2` and `generate_land` - **Without the CI wait** in `plugins/tend-ci-runner/skills/review/references/approving.md` - **After the push** in `push-commits` - `merge-pr`'s **Reviewed head**: the record stands for the review - `continue-pr`'s ownership - `docs/security-model.md` and `docs/tend.example.yaml` **Eval** (`review-without-ci-wait`, updated for the records and given an eighth session, a human PR the review pushed an accepted fix to; Claude executor, 3 repeats per arm; historical = main at ea2ed4a). The old guidance failed 3 of 3 in every run: it polled the bot-pushed heads (`pending-self`, `pending-bot-push-on-human`) to a terminal result and merged them itself, and polled both of its own pushes (`own-push`, `own-push-human`). The new guidance passed 2 of 3 on each of the last three versions, the final one included. Every new-guidance run made the decisions the case targets: it recorded both bot-pushed heads with their base, recorded its pushes and ended, and left `pending-human` for a maintainer. Each failure was the grounding rubric objecting to closing lines that described a proposed offline command (`land_pr.py pushed`, a merge) in the past tense. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plugin skills require the
plugin-name:prefix. Update all skill references from/tend-*to/tend:tend-*so Claude Code resolves them through the plugin.Updated: action.yaml system prompt, generator workflow prompts, skill cross-references, review-reviewers workflow, security docs.
All 64 generator tests pass.