Skip to content

fix(source-control): read pr-merge's Dependabot config and policy at main's head too - #10114

Merged
kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-8858-40231265601-1
Oct 27, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-8858-40231265601-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #8858

Summary

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

The pr-merge gate now reads a Dependabot pull request's .github/dependabot.yml and standards Dependabot policy at the default branch head as well as at the base, so a tightening on main reaches pull requests opened earlier. dependabot.yml coverage uses the intersection of the (ecosystem, directory) pairs both sides list, since a union would loosen the gate; review-only entries use the union of both sides, and either side unreadable makes the policy unreadable. Main's head comes from the cached default-branch config read (once per run-cache window, never caching a failure), the pre-enqueue recheck reads it fresh, and any failed read refuses. The issue's third input, plugin HIGH-path declarations (merge_policy.declarations_at), no longer exists: source-control 2.6.0 removed the base-side declaration check (plugins/source-control/CHANGELOG.md:355), so nothing is left to do for it.

Not verified

  • The Python unit tests (test_babysit_merge_policy.py, test_babysit_merge_unattended.py) were not run: this lane allows no interpreter, so the new tests were only traced by hand (by me and the review subagent). Left to the PR's CI.
  • check-affected's skipped checks (typos not installed; validate-plugins sub-checks and changed-skills run checked-tree code) and its CI-only checks are left to the PR's CI.
  • The pr-unblock lane (.github/scripts/pr-unblock, dependency-classify.mjs) still reads dependabot.yml and the policy at the base only; the issue scoped the change to pr-merge, and the gate's stricter read applies at merge time regardless.
  • Changes left uncommitted in the working tree as the runner instructs (the runner turns them into a patch).

Fix

  • plugins/source-control/skills/babysit-prs/scripts/babysit_merge_policy.py: new _dependabot_config (intersection of base and main dependabot.yml pairs), _review_only (union of review-only reasons from the base and main policies), _dependabot_main_sha (main's head via _default_branch_config); dependab
  • plugins/source-control/skills/babysit-prs/scripts/babysit_merge.py: the pre-enqueue Dependabot recheck reads the default branch head fresh and passes it as main_sha; a failed read holds and records optIn
  • plugins/source-control/skills/babysit-prs/scripts/babysit_dependabot.py: in_fix_scope docstring no longer says the pairs are the base's alone
  • plugins/source-control/skills/babysit-prs/scripts/tests/test_babysit_merge_policy.py: DependabotEligibility helper defaults main_sha to the base; moved_main fixture plus 8 tests (main dropping or adding a directory, main config with no entry, a review-only entry on either side, an unreadable main po
  • plugins/source-control/skills/babysit-prs/scripts/tests/test_babysit_merge_unattended.py: the enqueue-recheck test asserts the gate passes branch and the recheck passes the freshly read head
  • docs/conventions/pr-pipeline/README.md: the default-branch-head paragraph, the Dependabot content rule, the fix-scope note and Review-only dependencies now describe the main-head reads and their tightening rules
  • .changes/source-control/fix-8858-dependabot-inputs-at-main-head-5b1e9c73.md: patch fragment (Fixed)
  • .changes/pr-pipeline/fix-8858-dependabot-inputs-at-main-head-2f7a40d8.md: patch fragment (Fixed) for the convention

Verification

The runner ran each check from the base copy against b9e63cf:

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

The run reports:

  • .lane/checks/bin/check-changelog-fragments: All 35 changelog fragment(s) under .changes/ are valid
  • .lane/checks/bin/check-affected: 10 passed, 6 skipped over 8 changed files (ruff on the changed .py among the passes; shellcheck, typos, validate-plugins sub-checks and changed-skills skipped by the check itself)
  • fresh-context review subagent over the whole diff: no bugs; nits fixed (head wording in docstring/docs/fragment, fix-scope doc clause, test helper parameter names, fragment wording, optIn recorded on the early hold)
  • git-read show/CHANGELOG read: declarations_at and the base-side declaration check were removed in source-control 2.6.0 (CHANGELOG.md:355); no .py under babysit-prs references them
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/40231265601

Left out: the items under Not verified.

Related

#8858

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

Copy link
Copy Markdown
Contributor

claude-review reviewed b9e63cfae24d91f33953985647bcfe09bfcfe846: 1 finding(s), 0 as inline comments.

Review of PR #10114 (pr-merge reads Dependabot config and policy at main's head). I read the whole diff, _default_branch_config, dependabot_eligibility, the enqueue recheck in babysit_merge.py, and the unattended tests. I ran nothing: no interpreter is available in this lane, and the PR's own test results are author-claimed and unverified.

Logic checks that held up

  • StopReadError subclasses PolicyReadError (babysit_merge_policy.py:145-156). A parse failure on main's config at babysit_merge_policy.py:3014 is caught by the except PolicyReadError at :3134 and refuses, so it fails closed.
  • The intersection rule for dependabot.yml pairs and the union rule for review-only reasons both tighten the gate, as the issue asks.
  • main_sha == base_sha short-circuits correctly, so there is no extra read when main hasn't moved.
  • The head comes from the cached _default_branch_config at the gate and from a fresh _default_branch_head at the recheck. That matches the issue's "once per run-cache window, never caching a failure".

Closing issue #8858

  • Dependabot config and policy at main's head: met.
  • Declarations: the PR says declarations_at was removed in source-control 2.6.0, so nothing is left to do. I did not check this beyond the PR's own account.
  • Fail closed: met, but one path has no test (finding below).

Spend: none beyond existing prepaid lane usage.

Not reviewed: the pr-unblock lane still reads these inputs at the base only. The PR states this and the issue scoped the change to pr-merge.

critical-findings: 1

Findings not posted inline (their path, line or side is malformed):

  • plugins/source-control/skills/babysit-prs/scripts/babysit_merge.py:4263: Fail-closed path has no test (issue fix(source-control): read pr-merge's plugin declarations and Dependabot policy at main's head too #8858: "failing closed"). This new branch holds when the fresh default-branch head read raises PolicyReadError, so the pre-enqueue recheck refuses. test_babysit_merge_unattended.py has no test that makes _default_branch_head fail on the Dependabot recheck. The fake at :899 always answers 200 {sha: main_head}, and the only new assertion (:1769) covers the success path. Deleting this try/except would let the exception propagate out of unattended_enqueue, and nothing in the PR would fail. Add a case where the head read fails and assert hold returns ineligible:unreadable: ... with step["optIn"] recorded.

@github-actions

Copy link
Copy Markdown
Contributor

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

No security findings in this change.

critical-findings: 0

This PR makes the pr-merge gate read a Dependabot pull request's .github/dependabot.yml and standards Dependabot policy at the default branch head as well as at the base. I read the whole diff, babysit_merge_policy.py around the changed functions, and _default_branch_config, PolicyReadError and StopReadError. I did not run the tests, and the PR says they were not run either.

  • Direction of the change. It only tightens. _dependabot_config (babysit_merge_policy.py) keeps only the (ecosystem, directory) pairs both sides list, so main cannot widen the base's coverage. A lanes App fix has to fit those pairs too. _review_only unions the review-only reasons from both policies, so an entry on either side sends the update to review. A stale or older cached main head can only shrink coverage or add review-only reasons. It cannot loosen the base-only behaviour.
  • Read failures. Each failure path refuses or reports unreadable, and none falls through to auto-merge.
    • A failed dependabot.yml or policy read at main raises PolicyReadError, which dependabot_eligibility already turns into a refusal. StopReadError is a subclass, so a main config that cannot be parsed is covered the same way.
    • A dependabot.yml at main with no entry makes _dependabot_config return None, which becomes dependabot-config-unreadable.
    • An unreadable main policy becomes dependabot-policy-unreadable for every update.
  • Enqueue recheck. unattended_enqueue now reads the head fresh with _default_branch_head. A failed read holds the entry and records optIn, so an unreadable head cannot enqueue.
  • Argument defaults. The new main_sha and branch arguments default to None. When main_sha is None, dependabot_eligibility resolves it from the default-branch config, so callers that omit it still get the main-head read.
  • Trusted paths. No changed file matches the trusted-path globs. The manifest checks do not apply, because the PR changes no plugin or marketplace manifest. The diff does not delete or soften any standing instruction.
  • PR description. It contains no embedded instructions aimed at the review.
  • Not covered. The pr-unblock lane (.github/scripts/pr-unblock) still reads dependabot.yml and the policy at the base only. The PR says this is out of scope for fix(source-control): read pr-merge's plugin declarations and Dependabot policy at main's head too #8858, and the pr-merge gate applies the stricter read at merge time. I judge it not a vulnerability.
  • Spend. None. The change adds a couple of REST content reads per Dependabot pull request check. It has no billing impact.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head b9e63cfae24d91f33953985647bcfe09bfcfe846. The lanes clear this reason on their own; the next scheduled run judges it again.

pr-merge's gate refuses its verifier verdict (verify:missing)

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head b9e63cfae24d91f33953985647bcfe09bfcfe846. A person must clear this reason, so the pr-merge lane added the needs-human label: fix the reason, then remove the label, and the next scheduled run judges it again.

it changes plugins/source-control/skills/babysit-prs/scripts/babysit_dependabot.py, a hold path

@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 26, 2026
@kyle-sexton kyle-sexton removed the needs-human Human-in-the-loop required; autonomous sessions must not resolve items carrying this. label Oct 26, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 26, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 26, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 26, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 26, 2026

@kyle-sexton kyle-sexton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Owner decision 2026-10-26 ~22:3xZ in the hub session: merge the PRs currently held for the owner, security-flagged or otherwise. Approving head b9e63cf under that decision, which lifts its hold path (babysit_dependabot.py) per merge-holds.mjs; the merge queue removed it at 23:58Z on that hold.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 27, 2026
Merged via the queue into main with commit 41b3b2c Oct 27, 2026
68 of 69 checks passed
@kyle-sexton
kyle-sexton deleted the work-resolve-issue/issue-8858-40231265601-1 branch October 27, 2026 00:43
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.

fix(source-control): read pr-merge's plugin declarations and Dependabot policy at main's head too

1 participant