Skip to content

Pin action to release tag; remove the v1 floating branch - #515

Merged
max-sixty merged 2 commits into
mainfrom
v1-deploy-lock
May 15, 2026
Merged

max-sixty merged 2 commits into
mainfrom
v1-deploy-lock

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Problem

max-sixty/tend@v1 was a branch force-pushed to match main on every merge by update-action-branch.yaml. A ruleset was then added protecting v1 like main, so the force-push failed with GH013: Cannot update this protected ref, freezing every consumer at the last successful commit. Protecting v1 and auto-force-pushing it are contradictory requirements.

Fix

Remove the floating ref entirely instead of working around it with a bypass credential.

The generator pins each generated workflow's uses: to its own release version (max-sixty/[email protected], an immutable tag). The PyPI package version and the git tag are the same commit, so a workflow's # Generated by tend X.Y.Z header and its action ref are guaranteed to match. Consumers move forward through the existing nightly uvx tend@latest init regen pulling a newer generator — a reviewable workflow-file diff in their own repo, not an invisible shared-branch force-push.

This is also the standard GitHub Actions supply-chain posture (pin a third-party action to an immutable ref).

What reviewers should look at

  • generator/src/tend/workflows.py — _action_ref() now returns max-sixty/tend@{version('tend')} (/codex@… for the Codex harness). The docstring documents the provenance guarantee and the in-tree-version hazard.
  • Deleted .github/workflows/update-action-branch.yaml.
  • .config/tend.yaml — dropped protected_branches: ["v1"]. The generic protected_branches mechanism (and its tests) is retained; only tend's own use of it for v1 is removed.
  • generator/tests/conftest.py / tests/__init__.py — the regtest scrubber now normalizes the pinned version in the action ref as well as the header, so release bumps don't churn snapshots; ACTION_VERSION is shared for the literal assertions. The 31 snapshot updates are all the single ref line.
  • docs/security-model.md — new "Action distribution integrity" boundary: release tags on max-sixty/tend must be immutable (a tag ruleset restricting update/deletion, no bypass). This ruleset is created out of band; it is not part of this diff.
  • .claude/skills/running-tend/SKILL.md — consumer discovery searched max-sixty/tend@v1, which post-change matches nothing. Now a version-agnostic bare-token gh search code 'max-sixty/tend' bounded by the existing path filter (also catches Codex consumers, which the @v1 query silently missed).

Follow-up (not in this PR)

  1. Create the tag-immutability ruleset on max-sixty/tend.
  2. After a release ships with this generator, remove refs/heads/v1 from the existing branch ruleset and delete the stale v1 branch and v1 tag.

Consumers auto-migrate on their next nightly regen after the next release; no consumer action required.

Testing

230 tests pass, 0 snapshot failures, pre-commit clean. Code-reviewer iterated to convergence (clean design; it caught and I fixed a consumer-discovery regression).

🤖 Generated with Claude Code

Protecting the `v1` branch like `main` conflicted with the
update-action-branch workflow force-pushing it on every merge (GH013:
"Cannot update this protected ref"), freezing all consumers. Rather
than add a bypass credential, remove the floating ref entirely.

The generator now pins each generated workflow's `uses:` to its own
release version (`max-sixty/[email protected]`), an immutable tag. The
package version and git tag are the same commit, so a workflow's
"generated by tend X.Y.Z" header and its action ref match exactly.
Consumers move forward via the existing nightly `uvx tend@latest init`
regen pulling a newer generator — a reviewable diff in their own repo,
not an invisible shared-branch force-push.

- delete .github/workflows/update-action-branch.yaml (the v1 mirror)
- drop v1 from .config/tend.yaml protected_branches; the generic
  protected_branches mechanism is retained
- conftest scrubber normalizes the pinned version in snapshots so
  release bumps don't churn them; shared ACTION_VERSION for assertions
- security-model.md: tag immutability is the new supply-chain boundary
  (a tag ruleset on max-sixty/tend, created out of band)
- running-tend: consumer discovery searched `@v1`; now version-agnostic
  bare-token search (also catches Codex consumers, which @v1 missed)

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

@tend-agent tend-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid cutover — pinning to the released version("tend") makes the action ref and the header version provenance match the package on PyPI, and the test scrubber + literal-assertion split is clean. One observation about the security doc landing slightly ahead of the enforcement step it describes.

Comment thread docs/security-model.md Resolved
The "Action distribution integrity" paragraph described the tag-immutability
ruleset in present tense, but it's created out of band after this lands. Note
that the boundary holds by convention until the ruleset is applied.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 202c3d9 into main May 15, 2026
6 checks passed
@max-sixty
max-sixty deleted the v1-deploy-lock branch May 15, 2026 23:24
@max-sixty max-sixty mentioned this pull request May 15, 2026
max-sixty added a commit that referenced this pull request May 15, 2026
Bumps the generator to 0.0.20 and syncs the lockfile.

This is the release that switches consumers from the `@v1` floating
branch to the version-pinned `max-sixty/[email protected]` ref (#515). On
their next nightly `uvx tend@latest init`, consumer workflows regenerate
with the pinned tag.

Follow-up after this lands and tags: create the tag-immutability ruleset
on `max-sixty/tend`, then remove `refs/heads/v1` from the existing
branch ruleset and delete the stale `v1` branch and tag.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
max-sixty added a commit that referenced this pull request May 16, 2026
## Summary

`review-reviewers` is the only custom (non-generated) tend workflow and
was the last one still on the Claude harness — every generated
`tend-*.yaml` flipped to Codex in #520. This also retires the last `@v1`
floating-ref consumer in this repo; everything else now pins immutable
`@X.Y.Z` after #515.

Once this lands, `CLAUDE_CODE_OAUTH_TOKEN` is no longer referenced by
any workflow on `main` and can be removed (separate decision — flagged
below).

## Workflow changes

- `max-sixty/tend@v1` → `max-sixty/tend/[email protected]`
- `claude_code_oauth_token` → `codex_auth_json: ${{
secrets.CODEX_AUTH_JSON }}`
- Added `model: gpt-5.5`; prompt switched to `$review-reviewers ${{
matrix.repo }}`
- Matrix now mirrors `data/consumers.json` (5 repos: `PRQL/prql`,
`max-sixty/cargo-affected`, `max-sixty/tend`, `max-sixty/worktrunk`,
`numbagg/numbagg`). The previous hand-list was missing `cargo-affected`
and `numbagg`.

The existing `# TODO: Move repo list to a config file` is still live —
`consumers.json` is that file; a follow-up could have the workflow
generate the matrix dynamically via `fromJSON` and a setup job, retiring
the TODO. Out of scope here.

## Skill changes

`plugins/tend-ci-runner/skills/review-reviewers/SKILL.md` generalizes
the cost-discipline section so the same prose works under either
harness:

- "Haiku subagents" → "cheap subagent (e.g. Haiku / gpt-mini)"
- "main Opus agent" → "main agent"

The concrete subagent call is left to each harness's native mechanism
(Claude: `Agent` tool with `model: "haiku"`; Codex: subagent spawn with
a gpt-mini-class model). Pattern, gates, and outputs are unchanged.

## Test plan

- [ ] CI green (test, test-worker, lint)
- [ ] After merge: trigger `review-reviewers.yaml` via
`workflow_dispatch` and watch all 5 matrix entries (`fail-fast: false`)
- [ ] Eyeball token usage on the first run — openai/codex#16548 reports
the subagent model selection being ignored at codex 0.118.0; the action
installs 0.128.0 and we want to confirm the cheap subagent actually runs
on the requested model, not silently on gpt-5.5
- [ ] After a clean run, decide whether to drop
`CLAUDE_CODE_OAUTH_TOKEN` from repo secrets (now unreferenced)

---------

Co-authored-by: Claude <[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