ADR-0139: A merged pull request's pass reaches its push as an artifact of its run
Status: Accepted Date: 2026-11-09 Amends: 0005: rule 5, where a pushed commit reads a merged pull request's pass, what a verdict that used its own scope's proofs is trusted for, and a tree that differs; 0049: decision 6, where a merge group reads it
Context
ADR-0005 rule 5 spares a commit on the default branch a re-check where
ci.trustMergedPullRequests is true (false by default): its tree is the tree
of the head of a pull request merged into the default branch, the latest
check-run under ci.check on that head concluded in success, and the pull
request's own ledger records that head as passed with no proof of its own
scope used (src/Adapter/GitHub/MergedHeads.php:23-35). Where the run cannot
read the pull request's ledger, it proves nothing, and the range is mutated
in full. The setting decides how the gate runs
(src/Core/Config/Definition/CiKeys.php:34), and turning it on reads each
pull request's ledger from the run's proof store
(src/Cli/Flow/Wiring.php:342-351).
Under the package's reusable workflow that ledger is out of reach. With the default directory store, a pull request's ledger lives in its own Actions cache scope, and a push to the default branch restores only its own ref's entries and the default branch's (ADR-0013). With a remote store, a pull request's run holds no key to write it (ADR-0007, ADR-0029). The setting therefore takes effect in no setup the package ships.
What the push re-judges, measured over a window of the gate's own CI and the companion's:
- the gate: 58 of 144 pushes had their pull request head's exact tree, and spent 15,708 shard-minutes, about 7,450 a week;
- the companion: 41 of 51 pushes had the exact tree, 3,435 shard-minutes.
Pull request run 42485819353 took 641 shard-minutes; the push of the same tree, run 42493050329, ran its 19 shards again, 561 shard-minutes.
Decision
- A pull request's verdict leaves its pass as an artifact of its run. On
pull_request, the reusable workflow's verdict job uploadsmutation-gate-passed, holding thepassedrecord the verdict wrote into its scope's ledger (ADR-0007: the head, its tree, the check,at,ownScopeProofsandownScopeCoverage), where the verdict passed, with the units the verdict took from its own scope's proofs (decision 6), and the scope's ledger as the verdict wrote it (decisions 6 and 7). It is kept for the repository's own artifact retention. - A push reads it through the REST API. On a push to the default branch
with
ci.trustMergedPullRequeststrueordelta,MergedHeadsfinds, for each pull request merged into the default branch whose head tree is the pushed commit's, or underdeltaeach one the pushed range merged, the newest completedpull_requestrun of the workflow that runs the gate at that head, and reads itsmutation-gate-passed. The record stands only where it names that head and its tree and passes every check of ADR-0005 rule 5, the equal tree excepted underdelta. The plan job asks foractions: read, which only reads. - A merge group reads the same artifact in place of its pull request's ledger, under the same setting (ADR-0049 decision 6).
- The proof store stays as it is. A pull request's ledger is still written to its own scope alone. The default branch reads it only from the run's artifact, where a push carries some of the pull request's results (decisions 6 and 7), and takes from it only the results those decisions allow.
- The gate's own config turns it on.
mutation-gate.jsonsetsci.trustMergedPullRequests: true. For every other project it staysfalseby default.trueloosens: the push does not judge the tree the pull request's verdict passed on. It is an opt-in under ADR-0142's rules, so the gate's own runs note it unlesssuggest.looseValuesis off. ci.mergedOwnScopeProofssays what a verdict that used its own scope's proofs is trusted for:reach, the default,refuseortrust.proofs.ownScopeistrueby default (ADR-0081), so a pull request pushed more than once usually ends with such a verdict.reach: the push carries the pull request's results for the units its verdict computed itself or took from the default branch, and reaches the units the record lists as taken from its own scope, which an earlier commit of the pull request's may have written. A record that lists none spares its whole tree, as ADR-0005 rule 5 does today.refuse: ADR-0005 rule 5's guard as it stands: a verdict that used any own-scope proof spares nothing.trust: the record is taken whole, own-scope proofs included.trustloosens: a result an earlier commit's code wrote, which no reviewer of the head may have seen, reaches the default branch. It is an opt-in under ADR-0142's rules: set in bold in the reference, marked byconfig:show, and noted where in force unlesssuggest.looseValuesis off.
ci.trustMergedPullRequeststakes a third value,delta. It isfalse, the default,trueordelta. Underdelta, where the landed tree differs from the tree the pull request's verdict passed on, the push reads its change from the pull request's judged commit to the landed one, and a unit that change does not reach carries the pull request's result from the ledger in its artifact, asci.mergedOwnScopeProofsallows.deltaloosens: an interaction between two merged pull requests that reach does not see is left to the scheduled full run, as reach already leaves it within one change. It is an opt-in under ADR-0142's rules. The gate's own config keepstrueuntildelta's effect is measured.ci.mergedOwnScopeProofsdecides how the gate runs and is in no key, asci.trustMergedPullRequestsis.
Settings
A loose value is in bold (ADR-0142).
| Setting | Values | Default | Effect |
|---|---|---|---|
ci.trustMergedPullRequests | false, true, delta | false; true in the gate's own config | decides how the gate runs |
ci.mergedOwnScopeProofs | reach, refuse, trust | reach | decides how the gate runs |
The trade
Turning the setting on trusts a pull request's own computed result, as ADR-0005 rule 5 already says. Anyone who can open a pull request whose run writes the record can make the default branch skip re-checking its tree once it is merged. The artifact moves that record where a push can read it; it does not widen whose record is read, nor what it must say.
- The check-run is still a hint: the record must also name the head and its
tree, and come from a
pull_requestrun of the workflow that runs the gate. - The guards are the nightly
unprovenrun, which takes no proof (ADR-0084), and the scheduled full run ADR-0005 rule 6 requires. - Under
reach, the default, nothing an earlier commit of the pull request wrote is carried onto the default branch: the units it proved are reached and run. Onlytrustanddeltacarry more. Each oftrue,deltaandtrustis noted wherever it is in force, as ADR-0142 says.
Proof before it ships
- A contract test of the workflow: a pull request's run uploads the record, a push of its tree with the setting on reaches nothing and says which pull request proved it, and a push of another tree runs its range.
- A record whose head or tree differs from the run it came from, or that a failed later run at that head outweighs, proves nothing.
- A pull request pushed twice, whose last verdict took units from its own
scope: under
reachthe push runs exactly those units, underrefuseits whole range, undertrustnone. - Under
delta, a merge behind the default branch: the push runs what the change from the judged commit reaches, and carries the rest.
Where today's path stays
- With
ci.trustMergedPullRequests: false, the default, every merged range is mutated in full. - A record that cannot be found, read or matched, an expired artifact among them, proves nothing, and the range is mutated in full.
Alternatives considered
| Alternative | Why not |
|---|---|
| Read the pull request's cache scope | GitHub lets a push restore only its own ref's entries and the default branch's. |
| Give pull request runs a store key to write their scope | A key that writes, in a job that runs the pull request's code. |
| Trust the check-run alone | Any workflow at that commit can make a check-run under any name (ADR-0005). |
| Keep refusing a verdict that used own-scope proofs | With own-scope proofs on by default, it spares mostly pull requests pushed once; refuse keeps it selectable. |
| Skip the push's jobs in the caller's workflow | The gate's verdict is the check the default branch's next runs read passed from. |
Consequences
- A tree-equal merge costs its push one plan and one verdict, in the gate's own CI and in any project that turns the setting on.
- The plan job of a push holds
actions: read. - The pull request's ledger is read through its run's artifact; the store holds nothing new.
- A pull request pushed many times still spares its push all but the units it took from its own scope.
Related
- ADR-0005: rule 5, the trust and its checks; rule 6, the scheduled full run
- ADR-0007: the
passedrecord - ADR-0013: cache scopes
- ADR-0029: a pull request's run holds no store key
- ADR-0049: merge groups
- ADR-0081: own-scope proofs
- ADR-0084: the nightly
unprovenrun - ADR-0142: how a loose value is offered and named