Skip to content

check: refuse a job that names the environment and files a deployment - #853

Merged
max-sixty merged 1 commit into
mainfrom
maintain
Aug 5, 2026
Merged

max-sixty merged 1 commit into
mainfrom
maintain

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Follow-up to #852, which added deployment: false to the generated workflows. That left it a per-call-site opt-in, and the omission is invisible to whoever makes it: the gate still holds, the secrets still arrive, and the only symptom is a <bot> deployed to tend line on someone else's pull request. Generated workflows take the block from one macro that a generator test pins; nothing covered the workflows tend did not write, which is where a repo's own hand-maintained jobs live.

There is no environment-level lever to reach for instead. The environment object accepts wait_timer, prevent_self_review, reviewers and deployment_branch_policy, and none of them suppress the record or hide the environment from the UI — deployment: false is workflow-side only. So the invariant has to be enforced where workflows are written.

tend check already parses every workflow on the default branch for the credential sweep, so this rides the same fetch: a job naming the operational-secret environment must set deployment: false, and the bare environment: tend and an explicit deployment: true are the same mistake. It is that environment's check rather than every job's — a release environment deploys something, so its record is the point.

Against live repos

On both max-sixty/tend and max-sixty/worktrunk it names the nine generated jobs still carrying the string form:

FAIL  environment-deployments — Jobs name the 'tend' environment without `deployment: false`,
so GitHub files a deployment record for every run and posts it on the pull request:
tend-ci-fix.yaml job 'fix-ci', tend-mention.yaml job 'handle', tend-mention.yaml job 'verify',
tend-nightly.yaml job 'nightly', tend-notifications.yaml job 'notifications',
tend-review-runs.yaml job 'review-runs', tend-review.yaml job 'review',
tend-triage.yaml job 'triage', tend-weekly.yaml job 'weekly'.

Those nine clear on the regeneration that follows the next release. The two hand-maintained workflows converted in #852 (review-reviewers.yaml, integration-secrets.yaml) pass, which is also what confirms the parser reads the mapping form.

The failure message routes each case to its own fix, since a generated tend-*.yaml must not be hand-edited — it points those at uvx tend@latest init.

This was written by Claude Code on behalf of max-sixty

`deployment: false` was a per-call-site opt-in, and the omission is
invisible to whoever makes it: the gate still holds, the secrets still
arrive, and the only symptom is a "<bot> deployed to tend" line on
someone else's pull request. Generated workflows take the block from
one macro that a generator test pins; nothing covered the workflows
tend did not write, which is where a repo's own hand-maintained jobs
live.

There is no environment-level lever to reach for instead — the
environment object accepts `wait_timer`, `prevent_self_review`,
`reviewers` and `deployment_branch_policy`, and none of them suppress
the record — so the invariant has to be enforced where workflows are
written. `tend check` already parses every workflow on the default
branch for the credential sweep, so this rides the same fetch: each job
naming the operational-secret environment must set `deployment: false`,
and the shorthand and an explicit `deployment: true` are the same
mistake.

It is the tend environment's check, not every job's. A release
environment deploys something and its record is the point.

Against live repos it names the nine generated jobs in max-sixty/tend
and in max-sixty/worktrunk that still carry the string form, and passes
the two hand-maintained workflows already converted. Those nine clear
on the regeneration that follows the next release.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit f3e309a into main Aug 5, 2026
4 of 5 checks passed
@max-sixty
max-sixty deleted the maintain branch August 5, 2026 22:43
@max-sixty max-sixty mentioned this pull request Aug 6, 2026
max-sixty added a commit that referenced this pull request Aug 6, 2026
Bumps the generator to 0.1.14, syncs the lockfile, and adds the CHANGELOG section the release workflow publishes verbatim as the GitHub Release notes.

12 commits since 0.1.13. The release's substance is the deployment-record fix and the environment checks around it. Generated workflows now name the environment as `{name: tend, deployment: false}`, so a job stops filing a deployment record against whatever run it belongs to — under `pull_request_target` that record landed on the PR's own head, so every push to every PR grew a `<bot> deployed to tend` line in its timeline. The branch policy that gates the operational secrets is untouched, and `tend check` grows an `environment-deployments` check that refuses a job naming the environment without the property (#852, #853). Separately, `tend check` widens its environment sweep from secret-holding to credential-holding: an environment counts if it stores a secret or a job requesting `id-token: write` deploys to it, and a ref policy no longer counts as a gate under a trigger a write-scoped actor can steer (#815).

Four silent failures on the agent's own paths are fixed. `tend-mention` reduced its engagement counts inside a `--paginate`d `--jq`, so past one page the numeric guard errored and the bot went quiet on the threads it had engaged with most (#840). The `review` skill counted synthetic reply containers as reviews, which advanced the incremental past unreviewed commits and discarded formed reviews at the close-out (#835). The review's second pass returned a tool-use error because the built-in `/code-review` carries `disable-model-invocation`, and now runs a tend-owned skill that the Codex harness resolves too (#819). And `mark-notification-read` turned a successful run red on a transient API error (#843).

After this tags, adopters pick the changes up on their next nightly regen; tend's own workflows are regenerated in the follow-up PR the release runbook's last step calls for.

Testing: 336 tests pass, `pre-commit run --all-files` is clean, and the release workflow's `awk` extraction was run against the new `## 0.1.14` section locally to confirm the GitHub Release job will find its notes.

> _This was written by Claude Code on behalf of max-sixty_
max-sixty pushed a commit to max-sixty/worktrunk that referenced this pull request Aug 7, 2026
Automated nightly regeneration of tend's workflow files.

**tend version:** 0.1.13 → 0.1.14

## Notable changes

- **Jobs now name the `tend` environment with `deployment: false`**
(max-sixty/tend#852), so GitHub stops filing a deployment record per run
and posting it on the pull request. This is what the current `tend
check` flags as `environment-deployments` (#3729) — regenerating clears
it, and max-sixty/tend#853 makes `check` refuse the old shape going
forward.
- **`id-token: write` dropped from every tend job** — a side effect of
removing the claude-smoke workflow and its `tend-manual` environment
(max-sixty/tend#820). None of the remaining jobs use OIDC, so the
permission was unused.
- **`tend-mention` counts bot engagement outside `jq`**
(max-sixty/tend#840). `gh api --paginate` applies `--jq` once per page,
so `| length` emitted one count per page; past 100 comments the shell
variable held `100\n7`, the numeric test errored, and the bot fell
through to `should_run=false` — going quiet on exactly its most-engaged
threads.
- **Review and triage skill fixes** — the review-record guards now
ignore synthetic reply containers (max-sixty/tend#835), `/code-review`
is ported into a tend-owned skill (max-sixty/tend#819), and triage
substitutes the real issue number into its PR-body templates instead of
leaving a placeholder (max-sixty/tend#844).
- **Outage reporting is more robust** — a stranded outage row now names
the trigger it points at (max-sixty/tend#823), and marking a
notification read tolerates a transient run-metadata fetch failure
(max-sixty/tend#843).

Full compare: max-sixty/tend@0.1.13...0.1.14

Co-authored-by: worktrunk-bot <[email protected]>

This branch had an error being deployed

1 failed deployment
tend — 591cee9a Deployed Aug 5, 2026 by max-sixty via review #1097
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.

1 participant