Skip to content

ci(release): open a PR pinning the flagship's published hashes on main - #5447

Merged
kovtcharov-amd merged 2 commits into
mainfrom
ci/3949-commit-agent-lock
Oct 21, 2026
Merged

kovtcharov-amd merged 2 commits into
mainfrom
ci/3949-commit-agent-lock

Conversation

@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

Every flagship agent release left binaries.lock.json on main stale, because the release only shipped the real hashes inside the npm tarball. The installer build and the final core-release check read the committed copy, so both broke until someone pinned the hashes by hand (#3932, #5341). Now the release opens that PR itself once it publishes, so cutting agent 0.3.1 ahead of v0.25.1 needs a merge, not a hand edit.

Re-running a release is safe: it never opens a second PR, does nothing when main already matches, and refuses a placeholder lock or one for a different flagship version. A token that can't push or open PRs fails the job and names the missing permission. The installer and release-check errors now point at that PR, and the release docs describe it.

Closes #3949

Test plan

  • python -m pytest tests/unit/test_open_flagship_lock_pr.py tests/unit/test_fetch_sidecar.py tests/unit/test_check_flagship_release.py (56 passed). The new tests cover a re-run with the PR already open, hashes already on main, placeholder and wrong-version locks, main on another flagship version, and tokens without push or PR permission.
  • Release-workflow suites (test_agent_npm_publish_workflow, test_flagship_rc_assets, test_installer_artifacts, test_eval_tag_gate, test_gen_binaries_lock) pass
  • actionlint on release_agent_gaia.yml, python util/lint.py --all (workflow trigger and ancestor-skip checks pass)
  • First real run: agent-pkg-gaia-v0.3.1 opens chore(release): pin flagship agent 0.3.1's published hashes

The flagship release recomputed the real binary hashes but only shipped them
inside the npm tarball, so the committed binaries.lock.json stayed stale and
the installer build and the final core-release check failed after every
flagship release until someone pinned the hashes by hand (#3932, #5341).

release_agent_gaia.yml now ends with a pin-lock job that commits the verified
lock to release/flagship-lock-v<version> and opens a PR against main. Re-runs
never open a second PR, do nothing when main already matches, and refuse a
placeholder lock or one for a different flagship version. A token that cannot
push or open PRs fails the job naming the missing permission. The installer
and release-check errors now name that PR as the fix, and the release docs
describe it instead of the manual step.

Closes #3949
@github-actions github-actions Bot added documentation Documentation changes installer Installer changes devops DevOps/infrastructure changes tests Test changes labels Oct 21, 2026
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Skill audit

Skill Verdict Claimed tier Cleared tiers Findings Rules
.claude/skills/agent-hub-release ✅ ALLOW experimental experimental, community none —
.claude/skills/gaia-release ✅ ALLOW experimental experimental, community none —

✅ All audited skills cleared the tier they claim.

Per-finding detail is withheld here on purpose. Read it in the Security > Code scanning tab, or download the skill-audit-reports artifact from this run. Offending source text is withheld from CI everywhere — reproduce it locally with gaia skill audit <dir> --show-snippets.

@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Approve with suggestions

After every flagship agent release, someone had to hand-commit the published hashes to main before the installer build and the final core release would pass. This PR has the release open that PR itself. The re-run guards look right: it never opens a second PR, does nothing once main already matches, and refuses a placeholder lock or one built for another version. I found nothing blocking.

One optional fix: the bot PR asks nobody to review it, so it can sit unnoticed while the next core release waits on it. The Lemonade bump workflow requests reviewers on its bot PR; doing the same here would close that gap.

Real-world evidence

N/A: CI/release tooling only. No evidence bundle was produced, and the new job only runs inside a real agent-pkg-gaia-v* release. This verdict rests on static review and the unit tests the author reports. The PR's own unchecked item (the first real run on agent-pkg-gaia-v0.3.1) is the end-to-end proof still to come.

🔍 Technical details

Issues

🟢 The lock PR requests no reviewer or label (util/open_flagship_lock_pr.py, the gh pr create call). A GITHUB_TOKEN PR triggers no CI and notifies nobody. lemonade-version-bump.yml passes --reviewer kovtcharov-amd,itomek-amd and labels its bot PR. Adding a reviewer (and e.g. --label devops) here makes the PR show up in someone's queue. If you do this, update the argv assertions in tests/unit/test_open_flagship_lock_pr.py to match.

🟢 Merge-queue assumption is unverified. The PR body and the generated PR text say "the merge queue runs them". That only holds if the queue accepts a PR whose required checks never ran on its pull_request event. If it doesn't, a maintainer has to push to the branch, or close and reopen the PR, before it can be queued. The first real run (0.3.1) will show which is true. Worth checking then, and correcting the PR-body text if needed.

Checked and fine

  • The refusal when main's agentVersion differs won't fire on a normal release. stamp_version.py bumps the lock's agentVersion in the version-bump PR, and the workflow checks that it matches the tag before freezing.
  • pin-lock keeps the write token out of the npm OIDC job. It is gated on needs.publish.result == 'success' and uses a per-version concurrency group. overwrite: true on the artifact upload keeps a re-run of publish working.
  • A force-push to a branch only this job writes, rebuilt from origin/main each time, is safe. A branch with an unreadable lock counts as stale and gets rebuilt rather than trusted.

Strengths

  • The failure paths follow fail-loudly: a permission error names the exact missing permissions: key or repo setting, and every other failure exits non-zero and says what to do next.
  • The installer and release-check error messages now point at the actual fix (merge the lock PR) instead of "regenerate the lock". The tests pin that wording, so it won't drift back.
  • The re-run tests cover the cases that matter: PR already open, hashes already on main, wrong version, and placeholder hashes.

A PR opened with the GITHUB_TOKEN notifies nobody and starts no CI, so it could sit unnoticed while the next core release waits on it. It now carries the release label and requests the same reviewers as the Lemonade bump PR.
@kovtcharov-amd

Copy link
Copy Markdown
Collaborator Author

Both suggestions are handled.

  • Nobody is notified: the lock PR now carries the release label and requests review from @kovtcharov-amd and @itomek-amd, the same reviewers as the Lemonade bump PR.
  • Merge-queue assumption: checked. Branch protection on main requires no status checks, so the queue accepts a PR that ran no pull_request checks, and the queue's merge_group run still tests it. The 0.3.1 release will be the first real run.

@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Oct 21, 2026
Merged via the queue into main with commit 419dbf0 Oct 21, 2026
73 checks passed
@kovtcharov-amd
kovtcharov-amd deleted the ci/3949-commit-agent-lock branch October 21, 2026 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devops DevOps/infrastructure changes documentation Documentation changes installer Installer changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The release never commits the regenerated binaries.lock.json, so the installer build breaks after every flagship release

1 participant