Repository navigation
feat: Dependabot auto-merge shadow step in pr-triage.yml - #225
Merged
Merged
Conversation
On a Dependabot pull request that is patch or minor (S1), changes only manifest and lock files (S2), has a computed level of L3 or L4 (S3) and a base branch with required status checks (S4), the new shadow step writes 1 marker comment for each head: auto-merge would be enabled. It never enables auto-merge, approves, merges or labels (ADR-0019). - scripts/lib/pr-triage.mjs: runShadowStep, checkS1 to checkS4, parseVersion, the marker and comment; main accepts PR_TRIAGE_STEP=shadow. - scripts/lib/risk-paths.mjs: read-only listBranchRules. - pr-triage.yml: dependabot/fetch-metadata v2.5.0 (SHA-pinned, continue-on-error) and the shadow step; embedded copies re-synced. - docs/specs/pr-triage.md section G; docs/design/dependabot-shadow.md with the measurement and what a go-live decision needs.
…removes its own duplicate - Read the pull request head before the criteria and again before the comment; write nothing when it is not the event head (a delayed or re-run job must not judge the files of a newer head). - Compare version parts as BigInt, so that versions that differ only above 2^53 are not equal. - After the write, list the comments again; when an earlier marker for the same head has a lower id, delete this run's own comment, so 2 concurrent runs keep 1 comment. - Tests for each point, a test that L1 and L2 fail S3, and 1 line in .memory/corrections.jsonl.
A call comment is a github-actions[bot] comment with the marker for the head; the lowest id is the call. Both the early path and the write path delete every other call comment for that head, so a retry after a failed cleanup removes the duplicate. Comments by other authors are never counted or deleted. Test and .memory/corrections.jsonl line.
bketelsen
approved these changes
Nov 9, 2026
This was referenced Nov 9, 2026
Merged
Merged
Merged
Merged
Merged
Merged
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the Dependabot auto-merge shadow step to
pr-triage.yml. It gathers evidence for a later decision on a narrow auto-merge class, and changes nothing else: it never enables auto-merge, approves, merges or labels (ADR-0019 holds). Idea from Airlock's go-live (shadow first) and GitHub'sdependabot/fetch-metadatapattern. Builds on #220 (pr-triage.yml), #223 (levels, ADR-0078) and #221 (required checks, ADR-0076).On a Dependabot PR (
opened,synchronize,reopened, not a draft, caller inputdependabot-shadowtrue), the step writes 1 comment for each head when all 4 criteria hold:updated-dependencies-jsonissemver-patchorsemver-minor, both versions parse asv?N.N(.N)*, the first number is the same, and for0.xthe second number too. A grouped PR (ADR-0075) passes only when every entry passes.go.mod,go.sum,package.json, the lock files,requirements*.txt, ...). 0 files or a truncated list fails.levelOfPullRequeston the list at the base SHA gives L3 or L4. It reads no label: a kept stricter label does not count. Any error fails S3.GET rules/branches/{base}has at least 1 required status check; the marker records them for the later measurement.Marker (first line of the comment):
<!-- frostyard:dependabot-shadow v1 head=<sha> level=<L3|L4> checks=<JSON> -->. The JSON escapes<,>and&, so a check name cannot end the HTML comment. A re-run finds the marker for its head and writes nothing.scripts/lib/pr-triage.mjs:runShadowStep,checkS1tocheckS4,parseVersion,shadowMarker,shadowComment;mainacceptsPR_TRIAGE_STEP=shadow. 1 privateheadShaOfserves readiness and shadow.scripts/lib/risk-paths.mjs: 1 read-only API method,listBranchRules. The vendored exports keep their names and results..github/workflows/pr-triage.yml:dependabot/fetch-metadata@21025c705c08248db411dc16f3619e6b5f9ea21a # v2.5.0(the newest v2; v3 needs the Node 24 runtime) withcontinue-on-error: true, so a metadata failure fails S1 and does not turn the triage check red; then the shadow step. Both use the sameif:. The 2 embedded copies are re-synced.docs/specs/pr-triage.mdsection G (the step contract), newdocs/design/dependabot-shadow.md(how the calls are measured over 2 weeks, the false-call classes F1 to F4, and what a go-live decision needs: at least 10 calls, F2 = F3 = 0, F1 + F4 ≤ 2, and a new ADR amending ADR-0019, ADR-0042 and ADR-0040), index line, risk-paths spec derived-artifacts row.Out of scope: the measurement script (a later change), any go-live.
Risk tier
Risk tier: 3 — highest. The PR touches these paths of the base
.github/risk-paths.json(L2):.github/workflows/pr-triage.yml: 2 new steps, header comments, input description, re-synced embedded copies. No permission, trigger or existingif:changes. The new action is SHA-pinned; the job permissions staycontents: readandpull-requests: write; no secret.scripts/lib/pr-triage.mjs: the shadow step. Its only write isPOST issues/{n}/comments; a test asserts the step calls only 5 read/comment methods and that its fake API has no label or merge method.scripts/lib/risk-paths.mjs: 1 read-only GET method. No change to other exports.Under
pull_request_target, core's local caller resolves to the base branch, so this PR's run uses the old steps; the shadow runs on core's Dependabot PRs after the merge.Docs housekeeping
TEMPLATE.mddocs/README.mdVerification
make check: docs, organization, risk-paths ("workflow in sync"), 662 tests, 0 failuresactionlint .github/workflows/pr-triage.ymlcleanPR_TRIAGE_STEP=shadowon a non-Dependabot event exits 0 with "the pull request author is notdependabot[bot]. No comment."Review fixes (after the first push)
stale).BigInt(exact, no size limit).github-actions[bot]comment with the marker for the head; the lowest id is the call; every run, on both paths, deletes the other call comments for that head, so a retry repairs a failed cleanup. Comments by other authors are never counted or deleted. The step's writes are thereforePOSTof its comment andDELETEof its own duplicate call comments; still no label, approve, merge or auto-merge call..memory/corrections.jsonl.Cross-review
deepseek/deepseek-flash(parent edits to docs and tests). Reviewer:openai/gpt-6.1-sol.1c62146877c2b8df1af923415e5dc5d5c849968b. Initial review atb9cdb34: Not ready (3 blockers: concurrent duplicate, stale head,Numberprecision). Re-review 1 at2b51827: Not ready (cleanup not recoverable after a failed delete). Re-review 2 at41e44b65163d26b533aa142d06ab5357465bd768: Ready, Blocking: none. Generated heredoc bodies excluded from line-by-line review (checked by test andnpm run check:risk-paths).node --test test/pr-triage.test.mjs): no per-head dedupe → "the shadow step writes 1 comment for each head" fails; no0.xrule → "checkS1 passes patch and minor updates only" fails; S3 accepts L2 → "checkS3 wants the computed level at L3 or L4 and fails on any error" fails; no draft check and no>escape → their tests fail; no live-head checks → 3 stale tests fail;Numberinstead ofBigInt→ "checkS1 compares version numbers exactly, with no size limit" fails; no early-path cleanup → "a retry after a failed cleanup removes the duplicate" fails.make checkat the head: 678 tests, 0 failures; CI green at the head.