Skip to content

fix(ci): let release-audit branches edit changeset text - #8879

Merged
bokelley merged 6 commits into
adcontextprotocol:mainfrom
Synaeve:fix/8371-release-audit-changeset-scope
Nov 23, 2026
Merged

bokelley merged 6 commits into
adcontextprotocol:mainfrom
Synaeve:fix/8371-release-audit-changeset-scope

Conversation

@Synaeve

@Synaeve Synaeve commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Summary

The Check for changeset scope check rejected release-audit PRs that reword or escalate existing protocol changesets without touching protocol files, which .agents/shortcuts/cut-beta.md asks the release manager to do before each cut (#8360 had to be admin-merged). Changeset-only PRs from a release-audit/ head branch may now edit changeset text and escalate a misclassified bump. Every other PR keeps the existing delete-only and downgrade/removal guards.

Changes

  • scripts/check-changeset-protocol-scope.cjs: add isReleaseAuditChangesetMaintenance, true only when the head ref starts with release-audit/ and the whole diff is modifications/deletions of .changeset/*.md. The head ref is read from CHANGESET_SCOPE_HEAD_REF or GITHUB_HEAD_REF on pull_request events, mirroring how the base ref is resolved. No workflow change needed.
  • tests/changeset-protocol-scope.test.cjs: cover text edits and escalations on release-audit branches, plus the guards (prefix must be at the start, mixed diffs, new changesets, renames, other branches, empty diff).
  • .agents/shortcuts/cut-beta.md: tell the release manager to open the correction PR from a release-audit/<version> branch.

Testing

  • node tests/changeset-protocol-scope.test.cjs: passed
  • node scripts/check-changeset-protocol-scope.cjs origin/main: passed
  • Manual run against a scratch commit escalating a pending changeset from patch to major: fails with no head ref and with fix/foo, passes with GITHUB_HEAD_REF=release-audit/3.3.0-beta.6.

The head ref is author-controlled (a fork can name its branch release-audit/…). It only relaxes a hygiene check for diffs that edit or delete existing changesets, and the PR still needs maintainer review.

No changeset: CI and script tooling only.

Closes #8371

🤖 Generated with Claude Code

Changeset-only PRs from release-audit/ branches may reword or escalate
existing changesets, matching the cut-beta audit runbook. Other PRs keep
the existing delete and downgrade guards. Closes adcontextprotocol#8371.
@mintlify

mintlify Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit 0a1ed79.

Approve preview

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ladon verdict: Escalate to human review

Escalate — gated path touched without required approval.

This PR modifies .agents/shortcuts/cut-beta.md, which matches the gated glob .agents/** (gated_paths: true), while review_decision is REVIEW_REQUIRED (not APPROVED). Per decision rule row 2, the hard approval gate is not satisfied and the outcome must be escalate.

The reviewer surfaced no Critical/High/Medium findings: the change adds a tightly-scoped, fail-closed release-audit/-branch exemption to the changeset protocol-scope gate (admits only M/D edits on changeset-only diffs; new changesets, renames, non-changeset paths, and empty diffs all fall through to the normal check), with matching cut-beta.md guidance and tests. Doc matches code and no changeset is required. The diff is mechanically clean — but the gated-path gate requires a human/CODEOWNERS approval before merge.

Escalation reasons

  • .agents/shortcuts/cut-beta.md is under a hard approval gate (.agents/**) and review_decision is REVIEW_REQUIRED — human/CODEOWNERS review required before this can merge.

Why human review

  • Modifies .agents/shortcuts/cut-beta.md (matches gated path .agents/**) while review_decision is REVIEW_REQUIRED — requires human/CODEOWNERS approval before merge
  • This PR touches a path under a hard, non-overridable approval gate (.agents/shortcuts/cut-beta.md (modified) matches .agents/**) and the current GitHub review decision is 'REVIEW_REQUIRED', not APPROVED. This is a hard gate enforced in code — Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.

@aao-secretariat aao-secretariat Bot added the ladon/needs-human-review Ladon has escalated this PR for human review. label Nov 10, 2026
@aao-secretariat
aao-secretariat Bot requested a review from bokelley November 10, 2026 11:22

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ladon verdict: Escalate to human review

Escalate — gated path requires human/CODEOWNERS approval.

This PR modifies .agents/shortcuts/cut-beta.md, which matches the hard, path-based approval gate .agents/** (gated_paths: true). The current GitHub review decision is REVIEW_REQUIRED, not APPROVED, so decision-table row 2 fires: the gate is not satisfied and the PR cannot be auto-approved regardless of how clean the diff is.

No blocking or medium findings exist in this run. The reviewer confirmed the delta — a single fail-closed git rev-parse --abbrev-ref HEAD fallback in defaultHeadRef() wrapped in try/catch returning '' on failure — is clean: the scope gate stays active on git error and the release-audit relaxation remains narrow (M/D on .changeset/*.md only). This is consistent with the prior escalate, which was purely gate-driven (no code concerns then either).

Escalation reasons

  • .agents/shortcuts/cut-beta.md (modified) matches gated path .agents/** while review_decision is REVIEW_REQUIRED — a human/CODEOWNERS approval must be recorded before merge.

Once a human/CODEOWNERS approval lands (review_decision: APPROVED), this PR would fall through to a clean approve.

Why human review

  • Modifies .agents/shortcuts/cut-beta.md (matches gated path .agents/**) while review_decision is REVIEW_REQUIRED — requires human/CODEOWNERS approval before merge
  • This PR touches a path under a hard, non-overridable approval gate (.agents/shortcuts/cut-beta.md (modified) matches .agents/**) and the current GitHub review decision is 'REVIEW_REQUIRED', not APPROVED. This is a hard gate enforced in code — Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.

bokelley and others added 2 commits November 23, 2026 11:09
Changesets moves each changeset a prerelease cut consumes into
.changeset/pre/, and the stable cut after `changeset pre exit` consumes
that archive again into the GA changelog. The scope check only matched
root .changeset/*.md, so any PR could add, edit, delete or rename an
archived entry and pass.

Treat .changeset/pre/*.md as release history:
- ordinary branches fail on any change to an archived changeset, even
  alongside protocol files;
- release-audit/ branches may edit or delete archived changesets, on the
  same footing as root changesets, when the diff touches nothing else;
- changeset-release/ (Version Packages) keeps moving changesets into the
  archive and deleting it at the stable cut.

Update the beta, GA and major runbooks and the playbook to route archive
corrections through release-audit/ branches. Found during the 3.3.0 GA
changeset audit (adcontextprotocol#9187).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Encode the .changeset/pre/ rule table: ordinary branches fail on any
add, edit, delete or rename of an archived changeset, even alongside
protocol files; release-audit/ branches may edit or delete archived and
root changesets but not add, rename, or mix in non-changeset files;
changeset-release/ Version Packages cuts may move changesets into the
archive and delete it. pre.json stays outside this check.

Co-Authored-By: Claude Sonnet <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ladon verdict: Escalate to human review

Escalate — gated path requires human/CODEOWNERS approval.

This PR modifies files under .agents/**, which the repo declares as a hard, deterministic approval gate (gated_paths: true). The current review_decision is REVIEW_REQUIRED, not APPROVED, so the gate is not satisfied. Per decision-table row 2, the outcome must be escalate until a human/CODEOWNERS approval is recorded.

Blocking findings

  • None.

Escalation reasons

  • .agents/playbook.md, .agents/shortcuts/cut-beta.md, .agents/shortcuts/cut-major.md, .agents/shortcuts/cut-minor-ga.md (all modified) match the gated path .agents/**; review_decision is REVIEW_REQUIRED. Human/CODEOWNERS approval is required before merge.

Note: The reviewer pass was clean — no Critical/High/Medium findings. The scope-check script additions (archive immutability for .changeset/pre/*.md, release-audit lane, changeset-release exemption) and the ~261-line test file were traced across load-bearing branches with no issues. This remains an escalate solely due to the unsatisfied gated-path approval gate, consistent with the prior decision.

Why human review

  • Modifies .agents/playbook.md, .agents/shortcuts/cut-beta.md, .agents/shortcuts/cut-major.md, and .agents/shortcuts/cut-minor-ga.md (all match gated path .agents/**) while review_decision is REVIEW_REQUIRED — requires human/CODEOWNERS approval before merge.
  • This PR touches a path under a hard, non-overridable approval gate (.agents/playbook.md (modified) matches .agents/**; .agents/shortcuts/cut-beta.md (modified) matches .agents/**; .agents/shortcuts/cut-major.md (modified) matches .agents/**; .agents/shortcuts/cut-minor-ga.md (modified) matches .agents/**) and the current GitHub review decision is 'REVIEW_REQUIRED', not APPROVED. This is a hard gate enforced in code — Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.

bokelley and others added 2 commits November 23, 2026 11:20
Review of the .changeset/pre/ guard found three gaps:
- git quotes non-ASCII, quote and tab file names in --name-status output,
  and the parser read the quoted text, so .changeset/pre/café.md passed.
  Parse NUL-delimited -z output, and guard the whole .changeset/pre/
  subtree so a literal backslash cannot turn an archive file into a
  nested path either.
- The release-audit/ and changeset-release/ exemptions, and the
  workflow's release-machinery job skips, trusted any branch name,
  including a fork's. Grant them only to heads in this repository: the
  workflow passes an empty CHANGESET_SCOPE_HEAD_REF for fork heads, and
  the script now honours an explicitly empty value.
- A test comment overstated the release-audit mixed-diff rule; root
  changesets in a mixed diff follow the ordinary rules, as adcontextprotocol#8879 designed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The fixture ran git and the scope CLI with the caller's environment, so
an inherited GIT_DIR, GIT_WORK_TREE or GIT_INDEX_FILE (a hook or a
Git-aware wrapper) routed its commits into the caller's repository, and
caller signing or hook config could fail it. Run every fixture git child
and the CLI, now a subprocess, with fixtureEnv(), and assert that a
parent repository's HEAD, branch, index and untracked files stay
unchanged under inherited GIT_* variables.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ladon verdict: Escalate to human review

Escalate — gated paths touched without an APPROVED review.

This PR modifies files under hard approval gates (.agents/** and .github/workflows/**) while review_decision is REVIEW_REQUIRED, not APPROVED. Per decision rule row 2, the gate is not satisfied and the PR cannot auto-approve until a human/CODEOWNERS approval is recorded.

Escalation reasons

  • .agents/playbook.md, .agents/shortcuts/cut-beta.md, .agents/shortcuts/cut-major.md, .agents/shortcuts/cut-minor-ga.md (all match gated path .agents/**) and .github/workflows/changeset-check.yml (matches .github/workflows/**) require human/CODEOWNERS review before merge.

The reviewer reported a clean pass on the delta — the changeset-check hardening against fork-branch spoofing (forced empty CHANGESET_SCOPE_HEAD_REF, broadened /^\.changeset\/pre\// guard, NUL-delimited parsing) traced end-to-end with test coverage. No critical/high/medium findings. The escalation is purely the unsatisfied hard approval gate, not a code defect.

Blocking findings: none.

Why human review

  • Touches gated paths .agents/playbook.md, .agents/shortcuts/cut-beta.md, .agents/shortcuts/cut-major.md, .agents/shortcuts/cut-minor-ga.md (match .agents/) and .github/workflows/changeset-check.yml (match .github/workflows/) while review_decision is REVIEW_REQUIRED, not APPROVED — requires human/CODEOWNERS approval before merge.
  • This PR touches a path under a hard, non-overridable approval gate (.agents/playbook.md (modified) matches .agents/**; .agents/shortcuts/cut-beta.md (modified) matches .agents/**; .agents/shortcuts/cut-major.md (modified) matches .agents/**; .agents/shortcuts/cut-minor-ga.md (modified) matches .agents/**; .github/workflows/changeset-check.yml (modified) matches .github/workflows/**) and the current GitHub review decision is 'REVIEW_REQUIRED', not APPROVED. This is a hard gate enforced in code — Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.

@bokelley

Copy link
Copy Markdown
Contributor

Maintainer note: we pushed four commits on top of @Synaeve's change to extend it to the archived prerelease changesets in .changeset/pre/. The original release-audit/ carve-out is kept as is. Thanks for it; it was the right primitive to build on.

Why. Each prerelease cut moves the changesets it consumes into .changeset/pre/. The stable cut after changeset pre exit consumes that archive again into the GA changelog. The scope check only matched root .changeset/*.md, so any PR could add, edit, delete or rename an archived entry and still pass. We found this during the 3.3.0 GA changeset audit (#9187).

Head branch Change under .changeset/pre/ Result
ordinary add / edit / delete / rename fail, even alongside protocol files
release-audit/*, changeset-only diff edit / delete, bump changes included pass
release-audit/* add / rename, or mixed with any non-changeset file fail
changeset-release/* (Version Packages) move into the archive, delete it at GA pass
pre-exit / pre-enter PRs .changeset/pre.json only pass (pre.json is unchanged and unguarded)

The cold review also led to two hardening changes:

  • The check parses git diff --name-status -z and guards the whole pre/ subtree. Before, git's quoting of names with non-ASCII, quote or tab characters let a file like pre/café.md through.
  • Branch-name exemptions apply only to heads in this repository. That covers the workflow's changeset-release/, forward-merge/ and auto/docs-v job skips, and the script's release-audit/ and changeset-release/ carve-outs. A fork PR always runs the full check.

Tests cover the table, plus a real-Git end-to-end fixture. cut-beta, cut-minor-ga, cut-major and the playbook now route archive corrections through release-audit/ branches. One consequence: protocol PRs that also reword archived entries, as #8866 and #8526 did, now need a separate release-audit/ PR for those edits.

@bokelley
bokelley merged commit c55ad24 into adcontextprotocol:main Nov 23, 2026
29 checks passed
KonstantinMirin added a commit to KonstantinMirin/adcp that referenced this pull request Nov 25, 2026
…, certification retry (adcontextprotocol#9196), release-audit changesets (adcontextprotocol#8879), reporting subscriber suspend and resume (adcontextprotocol#9199), inventory goal forecast refusal (adcontextprotocol#9206), enum hoisting annotations (adcontextprotocol#9167), format_option_ref (adcontextprotocol#8876), claim-priority indexes (adcontextprotocol#9219)

Two conflicts.

Resolution ledger:
- semantic: package.json `test` -> union: this branch's chain (the
  suites it added and the build-cache and git-env steps) plus main's
  test:build-schemas-hoist-enum-annotations and
  test:build-schemas-hoist-inside-definitions, after
  test:build-schemas-exit-status. Every script main's chain runs is in
  the merged chain. Dependencies auto-merged to main's versions.
- semantic: server/src/training-agent/gcs-reporting.ts imports -> union:
  this branch's narrow `@adcp/sdk/utils` import of canonicalize; main's
  randomUUID import and its added `@adcp/sdk/server` names. The rest of
  the file auto-merged.
- mechanical: package-lock.json -> main's (auto-merged; this branch
  does not change it).

Checks: npm ci on main's lockfile (SDK 17.0.0-beta.40), npm run
typecheck, and the pre-commit hook's full run.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ladon/needs-human-review Ladon has escalated this PR for human review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Changeset scope check blocks release-audit PRs that edit changesets

2 participants