Skip to content

fix(ci): compare check-plugins' stale-version step against the merge base - #8744

Merged
kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-8507-39492992637-1
Oct 21, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-8507-39492992637-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #8507

Summary

Opened by the work-resolve-issue lane. The run's own summary:

The stale-version gates diffed the working tree against the tip of origin/main, so a branch behind main was charged for main's later shared-file syncs. They now resolve git merge-base <base> HEAD and compare, read base manifests and look for added fragments at that fork point; messages still print the base ref name.

Not verified

  • I could not run scripts/sync-shared-copies.test.sh or check-standards-contract-bump.test.sh directly: this run allows only the named wrappers in Bash. The new test cases are therefore unexecuted here (check-affected ran, but I did not confirm it runs those suites).
  • scripts/check-vendor-version-bump.sh, a separate step, has not been changed; it passes the base ref to changed_files::into and bump_delivered, which likely has the same behind-main behavior. Left for a follow-up.
  • No plugin changed, so no changelog fragment was added.

Fix

  • scripts/sync-shared-copies.sh: --check-bump compares canonical/copy diffs, base manifest versions and fragment lookup against the merge base; exits 2 if the merge base cannot be computed
  • scripts/check-standards-contract-bump.sh: same merge-base comparison for the contract/schema diff, base contract version, carrier manifests and fragments (the other STALE VERSION line in the same check-plugins job)
  • scripts/sync-shared-copies.test.sh: adds a behind-main case that passes when main synced a shared file the branch did not touch, and a case that still fails when the branch changes the shared file itself

Verification

The runner ran each check from the base copy against 61be202:

  • scripts/check-changelog-fragments.sh --check: passed

The run reports:

Left out: the items under Not verified.

Related

#8507

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 61be20210dce30b68cf43ed94d1d8915ac592ed2: 0 finding(s), 0 as inline comments.

Security review: PR #8744 (head 61be202)

No security issues found.

The PR changes three files: scripts/check-standards-contract-bump.sh, scripts/sync-shared-copies.sh and scripts/sync-shared-copies.test.sh. The two gate scripts now compare against git merge-base "$base" HEAD instead of the tip of the base ref.

  • Fail-closed: if git merge-base fails, both scripts exit 2 with an error. They do not pass without checking, so a shallow checkout or missing history cannot silently disable the gate.
  • No new injection surface: $mb is a commit hash from git merge-base. It is always quoted and only passed as an argument to git diff, git show and changelog_fragments::bump_delivered. No shell evaluation of external input was added.
  • No weakened gate: a branch can still be charged only for what differs from its fork point. The fork point is an ancestor of HEAD, so a branch cannot move it to hide its own changes to the shared files, and the new test covers that case: a branch that changes a shared file itself still fails the gate.
  • No instruction-surface deletions: the diff touches no CLAUDE.md, AGENTS.md, rules file, skill or agent body, hook allowlist or workflow permissions, so the instruction-exception register lens does not apply.

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 61be20210dce30b68cf43ed94d1d8915ac592ed2: 0 finding(s), 0 as inline comments.

No findings. The change does what #8507 asks, and I found nothing that should block it.

What I checked

  • Both stale-version gates, scripts/sync-shared-copies.sh and scripts/check-standards-contract-bump.sh, now resolve git merge-base <base> HEAD. They use that fork point for every "what did this change set change" read: the canonical and copy diff, the base manifest and contract version, and the bump_delivered fragment lookup (scripts/lib/changelog-fragments.sh:241).
  • $base is still what the messages print, so the existing assertions on changed vs $base still hold. Those tests pass a SHA that is HEAD or an ancestor of it, so the merge base equals that SHA.
  • A failed git merge-base exits 2 with an explicit message instead of passing unchecked. That is fail-closed, and CI deepens history before these steps (the download-full-history action in .github/workflows/pr-require-checks.yml), so it should not trip there.
  • The two new tests meet both acceptance criteria in fix(ci): compare check-plugins' stale-version step against the merge base #8507. A branch that is behind and changed no shared file passes. A branch that changes the shared file itself still fails with the STALE VERSION line. The first would have failed before the fix, because the diff against the main-ahead tip includes main's later esc.mjs change. I traced the fixture by reading it and did not run the suite.

Not verified (I did not run any of this)

  • I did not run sync-shared-copies.test.sh or check-standards-contract-bump.test.sh. The PR body says the author did not run them either.
  • check-standards-contract-bump.sh gets the same change but no test of its own.

Related, not in this diff

@melodic-automation-lanes

melodic-automation-lanes Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor Author

Unattended merge: risk HIGH at head 61be20210dce30b68cf43ed94d1d8915ac592ed2. Only LOW merges without a human. A floor path or capability change holds it: a human merges it in person, never an agent or a lane.

HIGH high-path:scripts/**: scripts/check-standards-contract-bump.sh, scripts/sync-shared-copies.sh, scripts/sync-shared-copies.test.sh

This refusal has stood unchanged at this head, so a person is needed: the pr-merge lane added the human-gated label.

@melodic-automation-lanes melodic-automation-lanes Bot added the needs-human Human-in-the-loop required; autonomous sessions must not resolve items carrying this. label Oct 20, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 21, 2026
Merged via the queue into main with commit 59f795e Oct 21, 2026
52 checks passed
@kyle-sexton
kyle-sexton deleted the work-resolve-issue/issue-8507-39492992637-1 branch October 21, 2026 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-human Human-in-the-loop required; autonomous sessions must not resolve items carrying this.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ci): compare check-plugins' stale-version step against the merge base

1 participant