Expand description
Pure-function module for reconciling PR gate state against branch protection requirements.
This module has zero dependency on orchestrator runtime state and performs no I/O.
It reads a PrGateSnapshot capturing the current state of a PR head and produces
a deterministic PrGateDecision indicating what action the reconciler should take.
See .docs/design-adf-pr-merge-progress-2026-05-01.md for the full design.
Structs§
- Commit
Status Summary - One commit status entry posted against a SHA.
- PrGate
Snapshot - Snapshot of everything the reconciler needs to classify a PR head.
Enums§
- Commit
Status State - Terminal state of a single commit status context.
- PrGate
Decision - Deterministic classification of a PR head’s gate state.
Constants§
- STALE_
PENDING_ TIMEOUT_ SECS - Default stale pending timeout in seconds (60 minutes).
Functions§
- failed_
required_ contexts - Compute which required contexts have reached a failed/error terminal state.
Returns
(context_name, state_label)pairs. - missing_
required_ contexts - Compute which required contexts have no status posted at all on the head SHA.
- pending_
required_ contexts - Compute which required contexts are posted but still pending.
- reconcile_
pr_ gate - Reconcile the PR gate state from a snapshot. Pure function.
- remediation_
key - Deterministic dedup key for remediation issues.
- stale_
pending_ contexts - Compute which required contexts have been pending longer than the timeout.
Uses
created_at_unixfrom the status entry andnow_unixfrom the snapshot.