ADR-0030: The merge receipt and the three outcomes of verification¶
- Status: Accepted
- Date: 2026-11-13
Context¶
Milestone v0.5.0 has one goal: Succeeded means the merged revision is applied and the symptom is gone. Today nothing sets a phase after Merged. Issue #248 asks for the contract first, before the build tasks of epic #19: states after approval (#94), checks with stableFor and timeout (#93), the revert proposal (#96) and the ways a change fails to land (#95). The audit of 2026-11-04 that filed #248 found two gaps: no merged revision was persisted, and the checks did not require workload health, so a deleted, scaled-to-zero or unschedulable workload, or a missing metric, could look like recovery.
Four decisions were taken on 2026-11-13 and are not reopened here:
- Three outcomes are kept apart: rolled out (the merged revision is applied and the rollout reached the pods), configured (the live object holds the new value) and cleared (the symptom is gone for the stated window).
- In v0.5.0 "cleared" is read from container status only: no OOM kill after the rollout and a flat restart count, on a workload that exists with the same UID and is available. The executor gets no metrics source; metrics as evidence follow with #508 and #506.
- Missing or stale data gives an inconclusive result, never success.
- A revert after a failed verification is a new request through the same policy and pull request path, never a direct change.
A fifth decision of the same day, that a new component is acceptable where it helps the later stages, settles where container status is read (section 7). It replaces the decision, also of 2026-11-13, to grant the executor list on pods.
What is built already¶
Since the audit, part of the gap closed. The code at e2abcd9 has:
- The merge commit.
recordMerge(internal/controller/merge.go) writesstatus.pullRequest.mergeCommitSHAin the status write that setsMerged, on all three paths that observe a merge: the recorded pull request (watchStep), a pull request found by its marker after a lost write (endMerged, the adopt path, only aftercheckMergedfound exactly the planned change) and the replacement of a handoff (handoff.go). A CEL rule on the object keeps it set once.status.pullRequest.mergedAtis set with the phase. - Delivery. The Flux adapter of
DeliveryVerifier(internal/providers/delivery/flux, throughinternal/fluxstatus) answersPending,AppliedorFailedfor a merge commit on a branch. A later commit of the branch counts when the Git host says it holds the merge commit (AncestryChecker).DeliveryStatuscarriesAttemptedCommitandSuspended. - The rollout report (#532,
internal/controller/rollout.go,internal/verification/rollout). On aMergedrequest whose target is a Deployment or StatefulSet, the executor waits up to an hour (paused time excluded) for the delivery, recordsstatus.pullRequest.appliedObservedAtandstatus.rollout(applied commit, generation, template hash, template revision, all set once), and sets the conditionRolledOut. The phase staysMerged. It reads only the target and the Kustomization with thegetit holds. OnceRolledOuthas its verdict, the check reads nothing more (rolloutEnded). - The API. The phases
WaitingForDelivery,VerifyingandSucceeded, theVerificationstruct (timeout10m,stableFor3m,checks, with CEL bounds) and theVerificationCheckenum exist. The condition typesDeliveredandVerifiedare declared and never set.
What is missing is a receipt that binds the merge to its repository, branch and head, the phase moves after Merged, the configured and cleared outcomes, a result for the cases where nothing can be shown, and a reader of container status.
Decision¶
1. The merge receipt¶
A new status field, status.mergeReceipt, written once in the same status write that sets Merged, on the three paths above, and never changed after:
| Field | Value | Source |
|---|---|---|
repository.url, repository.installationID |
The repository the plan was made for | status.planRepository |
targetBranch |
The branch the pull request merged into | status.source.targetBranch, or the target branch the settings name after a change for a pull request moved there (amendment of 2026-11-16) |
pullRequest |
The pull request number | the merged change request |
headSHA |
The head that was merged: the commit Shadewright pushed, or the replacement's commit after a handoff | the merged change request, checked equal to status.pullRequest.headSHA |
mergeCommitSHA |
The commit the Git host reports for the merge | the merged change request, equal to status.pullRequest.mergeCommitSHA |
mergedAt |
When the executor recorded the merge | the phase write |
Rules:
- A CEL rule on the object keeps the whole receipt equal to its first value once set, in the same form as the existing rules for
mergeCommitSHAandappliedObservedAt, so neither removingstatus.mergeReceiptnor removing the whole status can change it. A second rule requiresmergeReceipt.mergeCommitSHAto equalstatus.pullRequest.mergeCommitSHA. - The receipt is written only for a merge that holds exactly the planned change.
MergedWithForeignChange,MergeContentUnreadableandMergeNotCheckable(phaseNeedsIntervention) get none. - When the Git host reports no merge commit, or one that is not a full commit ID, the request is still
Mergedbut gets no receipt; the next reconcile ends itInconclusivewith reasonNoMergeReceipt(section 5). The executor first waits five minutes for the commit, on its own clock (amendment of 2026-11-13). - Restart and lost writes. The receipt is part of the write that sets
Merged. If that write is lost, the request is still in its earlier phase and the next reconcile looks for the merged pull request again. Before #94a (#678) a recorded pull request was looked up by its branch, not its number:watchStepcalledFindChangeRequest(branch), which returns the most recent Shadewright pull request of that branch, and a pull request with another number ends the requestNeedsIntervention(HeadMoved). A branch can carry a second pull request after the first merged, for instance in a supersede chain of ADR-0028, where the branch name derives from the chain's first request; the merge of the recorded pull request would then never be recorded. #94a adds a lookup by number toGitProvider(GetChangeRequest(number), in the repository ofstatus.planRepository) and uses it for every request withstatus.pullRequest.numberset, checking that the pull request found has the recorded head branch, target branch and head commit. The lookup by branch and marker stays for the adopt path, where no number was recorded. The lookup by number answers a pull request on every base branch of the repository, so one a person moved off the target branch is open on another base or merged into another base, never gone (amendment of 2026-11-19). The host's answer for a merged pull request does not change, so the repeated write has the same values. A status wiped by hand cannot drop the receipt (CEL), and a request whose status was never written goes through the policy check again and adopts the merged pull request by its marker. - Requests merged before the receipt existed keep
Merged. The executor setsVerifiedtoUnknownwith reasonMergedBeforeVerificationonce and starts no verification, so the circuit breaker, which countsMergedas a success, reads the same history after the upgrade.
Every later check uses the receipt, not the live settings: delivery is asked about mergeCommitSHA on targetBranch, and the ancestry question goes to repository. A settings entry changed after the merge cannot point the check at another repository.
2. Delivery against the receipt¶
The executor moves a Merged request with a receipt to WaitingForDelivery on the next reconcile, with status.deadline set to the end of the delivery window: one hour after mergedAt, extended by paused time as today. The existing delivery check then runs. Each case of #248:
| Case | What the executor sees | Outcome |
|---|---|---|
| The merge commit is applied | Flux reports it applied and Ready for its current generation | Delivered True, phase Verifying in the same write as appliedObservedAt |
| A descendant revision is applied | Flux reports a later commit of targetBranch; the host says it holds the merge commit |
Same as above; status.rollout.appliedRevision names the later commit and the template it produced is judged |
| A skipped revision | Flux never applied the merge commit itself and went straight to a later one | Same as a descendant: only ancestry counts |
| A later commit overwrote the field | Delivered as a descendant, but the live field does not hold the desired value | Configured False, reason ValueChanged; the request ends Inconclusive (our value never ran, so there is nothing to judge or revert) |
| The applied revision does not hold the merge commit (another branch, history rewritten) | Never Applied |
At the end of the window: Inconclusive, reason DeliveryNotObserved |
| Flux failed on exactly the merge commit | Failed with AttemptedCommit equal to the merge commit, at the end of the window |
Failed, reason DeliveryFailed; leads to #96 |
| Flux failed on a later commit | Failed with another AttemptedCommit |
At the end of the window: Inconclusive, reason DeliveryBlocked (the failure cannot be pinned on this change) |
| The Kustomization is suspended | Suspended true |
At the end of the window: Inconclusive, reason DeliverySuspended |
| The target is recreated | The live object has another UID | Inconclusive, reason TargetReplaced, at once, in any phase after Merged |
| The target is deleted | Not found | Inconclusive, reason TargetGone, at once |
| The delivery cannot be read to the end | Read errors past the window and its grace | Inconclusive, reason DeliveryNotChecked |
Flux retries a failed attempt, so a failure inside the window is not final: the executor keeps asking and decides at the end. A failure of the merge commit itself is the one delivery result that counts against the change, because a broken commit at the head of the branch also blocks every later commit until it is reverted.
A later commit that keeps our value but changes something else in the template (an image tag, say) and arrives before the rollout is recorded is judged together with our change, and the verdict says which commit was applied. A template change after the rollout was recorded ends verification RolloutSuperseded (section 4).
3. The three outcomes¶
Each outcome has its own condition, so kubectl shadewright explain can show three lines. Verified sums them up and decides the phase.
| Outcome | Condition | Evidence | Read by |
|---|---|---|---|
| Rolled out | Delivered and RolledOut |
Flux reports the merge commit or a descendant applied (Delivered); every desired replica runs the applied template (RolledOut, built, with the partition rule below), and the target still names that template on every sample |
the executor: get on the Kustomization and the target (held), the host's ancestry answer (held) |
| Configured | Configured (new type) |
The live target's field equals the desired value, read with the same field accessor the duplicate rule uses (sourcemap.FieldFor, changeInEffect in duplicates.go) |
the executor: get on the target (held) |
| Cleared | Cleared (new type) |
Container status of the target's pods: no OOM kill of the action's container on a pod of the rollout, restart counts flat against durable baselines, every desired replica covered | the verifier lists the pods and writes a VerificationReport; the executor reads the report as its evidence and writes the condition (section 7) |
A partitioned StatefulSet. The rollout evaluator (statefulSet in internal/verification/rollout) calls a rolling update with partition above 0 complete when only the pods above the partition run the update revision: three replicas, partition 2 and one updated pod give Complete, while two pods keep the old template. The owner chose that, so RolledOut keeps saying the rollout did what the strategy asks, with its own reason RolloutPartitioned and a message that names the pods left on the old revision, instead of "every pod runs the current template". It is not evidence for the change: cleared needs every desired replica on the applied revision, so a sample with pods left below the partition is not good (reason PartialRollout, no evidence class). If the owner lowers the partition inside the timeout, the window can still complete; otherwise the request ends Inconclusive with PartialRollout.
For a ScaledObject (AdjustKedaMaxReplicas), "rolled out" is Delivered plus KedaReady for the ScaledObject's current generation, since there are no pods of its own. Its symptom (scaling held at the maximum, a growing backlog) is not visible in container status, so in v0.5.0 Cleared stays Unknown with reason ClearingNotChecked, and such a request ends Inconclusive once rolled out and configured held for stableFor. It cannot end Succeeded until metrics arrive. A request whose spec.verification.checks names QueueBacklogDecreasing ends the same way, reason CheckNotAvailable.
Who reads the outcomes:
- the executor writes all of them,
Clearedincluded, and is the only writer of request status (invariant 6, unchanged); forClearedthe verifier's report is its evidence, and the verifier writes only its reports; kubectl shadewright explainshows rolled out, configured and cleared as three lines (exit criterion 5);- the circuit breaker reads only the phase;
- the analyzer reads
FailedwithVerifiedFalse to propose a revert (#96), and an Incident whose request ended without success moves toEscalatedas it does today (design 3).
4. The stable window¶
The window is kept in two places. The verifier samples the pods every 30 seconds and keeps the pod-level window, its baselines and its resets in the request's VerificationReport (section 7). The executor reconciles every 30 seconds while the request is Verifying, makes its own reads, checks the report, and keeps its window in status.verification (windowStart, lastReset, resets). Success needs both windows to be long enough, each measured on its own writer's clock.
Clocks. Three clocks write the times this design reads. No rule compares a time of the executor's clock with one of the verifier's, and the only comparison across clocks is the node's against the verifier's, which can only add resets:
- The verifier's clock writes the report's
sampledAt,windowStart,lastResetandlastTroubleReset, and decides the gap rule below. The span of the report's window issampledAt - windowStart, both written by the verifier. - The executor's clock writes
appliedObservedAt,status.deadlineand the executor's ownwindowStartandlastReset, and measures the delivery window, the timeout, the executor's own span and the age of the report. - The node's clock writes container termination times. They are compared only with the report's
windowStart, with one poll interval of margin, and only to add resets (below), which are never recorded as trouble, so a node clock cannot end a requestFailed.
The executor never reads the age of the report from sampledAt. The report carries status.sample, a counter the verifier raises by one with every sample it writes (forward only by CEL). At each check the executor keeps in memory the counter it read and the time by its own clock taken before that read (amendment of 2026-11-13, #683); the age is judged at the time taken after it. For the success decision the report must be no older than one poll interval by the executor's clock: its counter is higher than the one read at a check made at most 30 seconds earlier, so it was written after that check. A report whose counter has not risen for more than three poll intervals by the executor's clock is StaleReport. Once both spans are long enough the executor checks every 15 seconds, so a sample that lands just after a check delays success by one short interval. A restart of the executor forgets the counter and delays success by one check. Skew between any two clocks can therefore only delay or deny success: each span is measured on one clock, the age on the executor's, and node times can only add resets, since every restart inside the window also shows as a count above its baseline; only that count is recorded as trouble.
The pods of the rollout are the pods in the target's namespace that its selector matches, that are not terminating, and whose ownership the verifier proves the way the analyzer's collector does (ownerResolver in internal/analyzer/collector/owners.go), since owner references are untrusted input:
- for a Deployment: the pod's controller reference names a ReplicaSet that exists with that UID (
get), whose selector matches the pod's labels, whose controller reference names the target with the target's UID, whose labels the target's selector matches, and whose revision annotation (deployment.kubernetes.io/revision) equalsstatus.rollout.templateRevision; - for a StatefulSet: the pod's controller reference has the target's UID, and its
controller-revision-hashlabel equalsstatus.rollout.templateRevision; - for
SetContainerMemoryLimit, the action's container exists in the pod with the desired limit.
A pod the selector matches whose chain does not verify is not counted; it cannot add coverage. The verifier lists with the API reader, in pages of 100, at most 2 pages; more pods than that make the sample incomplete.
A verifier sample is good when all of these hold:
- the target exists with the report's target UID and names the report's template revision;
spec.replicasis at least 1, and the pods of the rollout number exactlyspec.replicas: every desired replica is on the applied revision (the partition rule of section 3), with no pod of the target on another revision;- every pod of the rollout reports a status for every container and native sidecar (an init container with
restartPolicy: Always; ordinary init containers do not count), no current termination without a finish time, and itsReadycondition is True; - no container restarted since the window started, against the baselines below.
An executor check is good when the target exists with the request's UID; RolledOut and Configured are True; the target, read in this reconcile, still has the generation's template hash and names status.rollout.templateRevision (otherwise the request ends Inconclusive with RolloutSuperseded at once); its available replicas equal spec.replicas; and the report passes the trust contract of section 7. The template check runs on every reconcile in Verifying, the last one included: the RolledOut verdict is not taken as still true, and rolloutEnded no longer stops the reads once the request is Verifying.
Baselines live in the report. At the first good sample the verifier records windowStart and, per pod of the rollout, its UID and the sum of its containers' and native sidecars' restart counts (at most 200 entries, matching the pod bound). Restart counts of a pod never decrease, so the sum works per pod. On every later sample, including the first one after the verifier restarted or lost its lease, it compares against the stored baselines, so a restart count raised while nobody watched is a Restarted reset and never becomes a silent new baseline. A container whose current or last termination finished at or after windowStart minus one poll interval (the margin absorbs clock skew between the node and the verifier) is a Restarted reset as well; it makes the first sample of a window stricter and never replaces the count. With no count above its baseline it is not recorded as trouble (below): a node clock running ahead could make an old termination look recent. After a gap (the stored sampledAt more than two poll intervals old by the verifier's clock) every pod not in the baselines may have replaced a pod whose history went with it: ObservationGap reset, without comparing its creation time, which the API server's clock writes. Without a gap, a new pod (a scale-out or a replacement) gets a baseline of 0, so any restart it shows later is a Restarted reset.
Deleted pods. A baseline whose pod UID is no longer in the list is pruned in the same status write as the sample. Pruning moves no window: a restart of that pod seen at an earlier sample already reset the window then and stays in resets and lastReset; a restart between the last sample that saw the pod and its deletion is not seen, the limit stated under "What a quiet window proves". Until a replacement is a pod of the rollout, the sample is PartialRollout.
More than 200 pods. When the selector matches more pods than the two pages hold, or the pods of the rollout would need more than 200 baselines, the sample is not good with EvidenceMissing, unless a returned pod of the rollout shows an OOM kill of the action's container: that is checked first and ends the request by the OOM rule below. The verifier never drops a pod or a baseline to fit the bound, so a target with more than 200 desired replicas cannot succeed and ends Inconclusive with EvidenceMissing at the timeout.
Reset. A sample or check that is not good moves windowStart forward to the next good one and records why (lastReset, resets). The reasons fall into two classes:
| Reason | Set by | Class |
|---|---|---|
Restarted: a container or native sidecar restarted above its baseline, or terminated after windowStart |
verifier | trouble (recorded only for a count above its baseline after the window first opened) |
PodNotReady: a pod of the rollout is not Ready and did not restart |
verifier | no evidence |
PartialRollout: fewer pods on the applied revision than spec.replicas |
verifier | no evidence |
EvidenceMissing: a pod without a status for every container, or more pods than the bound |
verifier | no evidence |
ScaledToZero: spec.replicas is 0 |
verifier | no evidence |
ObservationGap: no sample for more than two poll intervals and a pod not in the baselines after it |
verifier | no evidence |
NotAvailable: the target reports other available replicas than spec.replicas |
executor | no evidence |
StaleReport, ReportMismatch: the report fails the trust contract (section 7) |
executor | no evidence |
ExecutorRestarted: a new executor process found the window open, opened by no check of its own (amendment of 2026-11-20) |
executor | no evidence |
A pod that is not Ready is no evidence, not trouble, because a node that stopped reporting and a probe that fails look the same without a read of Nodes. A crash loop still shows as Restarted. Since each sample takes the raised count as the new baseline, a crash loop shows one Restarted reset per restart and PodNotReady resets in between, so the report also records trouble durably: troubleResets counts the Restarted resets recorded as trouble and lastTroubleReset keeps the last one, and a later no-evidence reset changes neither. Two Restarted resets still reset the window but are not recorded: one before the window first opened (the report's first good sample), such as a new pod restarting during a slow rollout, since it resets nothing the window had shown; and one that only a termination time shows, with no restart count above its baseline, since node clock skew may only delay or deny success. A crash loop from the start never opens the window; it ends Failed as RolloutStuck, not by this record. A failed read is retried and is not a sample. windowStart and the time of lastReset only move forward (CEL, in the report and in request status), the time of lastTroubleReset only moves forward and troubleResets never decreases (CEL, in the report, the only object with trouble fields), and resets never decreases.
Node freshness. Container status is only as fresh as the kubelet's last report. When a node stops reporting, the node lifecycle controller marks the pods on it not Ready once the cluster's node monitor grace period (--node-monitor-grace-period of kube-controller-manager, under a minute by default) has passed, and a pod still on the node is evicted (terminating) after its toleration of the unreachable taint, 300 seconds by default. Both show in the pod list. The verifier therefore needs no Node or Lease read, and the verdict waits for them: success needs good samples until windowStart + stableFor + nodeGrace, where nodeGrace is an executor setting (flag --node-grace, chart value executor.verification.nodeGrace, default 1 minute, which the chart documents must be at least the cluster's node monitor grace period). The verifier needs no copy of it: it records the window, and the executor judges its span. A node that went silent inside the window has had its pods marked not Ready before the verdict, which resets the window. A pod that turns terminating drops out of the count and makes the sample PartialRollout.
Final at once. An OOM kill of the action's container on a pod of the rollout, with lastState.terminated.reason OOMKilled, is recorded once in the report (oomKill: pod UID, container name, finish time) and ends the request Failed with reason OOMKilled, whatever the window. No time decides it: a pod of the rollout is proven to run the applied template with the desired limit, so every kill it records happened under the new value. An OOM kill of another container is a Restarted reset. A revert (section 8) is exempt: the verifier writes no report for it, so this rule never applies to it. Configured False, TargetGone, TargetReplaced and RolloutSuperseded end the request Inconclusive at once.
Success. A good executor check ends the request Succeeded when all of these hold: the report is good and no older than one poll interval by the executor's clock (the counter rule above); the report's span, sampledAt - windowStart, is at least stableFor + nodeGrace, both times written by the verifier; and the executor's own span, now - windowStart on its clock, is at least stableFor + nodeGrace. The same status write sets Cleared True (reason NoRecurrence) and Verified True. The executor is the only writer of Cleared (it writes request status) and the verifier's report is its evidence; #95b only changes the reason the executor writes, to ResolvedBeforeRollout instead of NoRecurrence, when two readings of the Incident's occurrence counter show the symptom had stopped before the rollout (built, #684; the rule is the next subsection).
Resolved before the rollout (built, #684; amendment of 2026-11-13). The window above starts at appliedObservedAt, so it cannot say whether the symptom was already gone when the change arrived. Nothing the executor reads today shows that: the Incident's times (lastSeen, resolvedTime, the occurrence times) are on the analyzer's or the cluster's clock, and no decision may compare them with appliedObservedAt. The executor therefore compares counts, not times:
- It reads the Incident of the request (
spec.incidentRef) with thegetit already holds, at two moments, and recordsstatus.counttwice instatus.verification.incidentCount:atMergeandatApplied. Each reading is{uid, count, readAt}: the Incident's UID, its count, and the executor's own time of the read. A reading once set is never changed, but it may be removed (CEL),atAppliedonly withatMerge, andcountis at most 1000000, the value at which the Incident's count saturates. atMergeis taken only in the reconcile that writes the merge receipt and setsMerged(a retry of that write after a conflict reads again). If that read fails,atMergestays absent for good and the reason staysNoRecurrence: a reading taken later, possibly after the change was already applied, could describe a quiet period that came after the fix.atAppliedis written in the same status write asappliedObservedAt. A failed read never holds back the merge, the delivery or the phase: the reading stays absent and the reason staysNoRecurrence.atAppliedis never filled in after the write ofappliedObservedAt, and it is taken only by the executor process that tookatMerge(kept in its memory with the reading), so bothreadAtcome from one clock. A reading may be removed, because an executor that predates the field drops it in its typed status write after a rollback; sinceatMergeis taken only in the write that setsMergedandatAppliedonly withappliedObservedAt, a removed reading is never taken again and the reason staysNoRecurrence. The read of the Incident is optional and never shortens the status write it rides with: it is skipped unless the step's deadline leaves its own timeout (5 seconds by default) plus one minute, the API server's default request timeout. On a cluster whose API server allows requests longer than a minute, a write slower than that minute can still lose up to the read's timeout.ClearedTrue gets reasonResolvedBeforeRolloutinstead ofNoRecurrence, in the same status write asSucceeded, only when all of these hold: both readings exist; both UIDs equalspec.incidentRef.uid; the two counts are equal; neither is at the saturation value; andatApplied.readAt - atMerge.readAt, two times of the executor's clock, is at least the effectivestableForof the request plus twice the analyzer's aggregation window (DefaultWindowininternal/incidents, 5 minutes, so 10 minutes more thanstableFor; an open question, point 6 of the maintainer list). Twice, because the analyzer writesstatus.countat most once per window per Incident (one window of batching), and an OOM crash loop backs off up to 5 minutes between kills (a second window of silence that is no recovery). A shorter span proves nothing: equal counts over it may only mean no write fell in it.- In every other case, the reason stays
NoRecurrence: a missing reading, an Incident that cannot be read or is gone, another UID, a count that went down (the Incident was rebuilt or its status reset), a saturated count, or too short a span. The phase, the other conditions and the circuit breaker's reading ofSucceededdo not change. A revert (spec.reverts) is not affected: itsClearedstaysUnknown.
What the counter can and cannot show. It counts what the analyzer recorded: occurrences of the symptom that its collector saw and wrote. Equal counts over a span of at least stableFor plus two windows mean the analyzer wrote no new occurrence in that span; a count is written at most once per window and a crash loop can back off for a window, so a shorter span could not show even that. They do not mean the symptom did not happen. A symptom the analyzer missed, or an analyzer that was stopped or behind, looks quiet. Known limit: appliedObservedAt can be later than the real apply (the executor was down or backing off), so the quiet span can include time after the fix took effect, and the reason can then wrongly say the change was not the cause. Most deliveries are faster than the minimum span, so the reason will usually stay NoRecurrence. Known limit: after a restart of the executor or a change of leader between the merge and the applied time, the reason is always NoRecurrence, since the new process did not take atMerge. The same holds when the step that writes the receipt or appliedObservedAt has less than about a minute of its deadline left. The reason is therefore an attribution for the people reading the request ("the symptom had already stopped when the change arrived, so this change is not shown to be the cause"), and it is worded that way in the condition message. It is no evidence that the change worked, and it adds no authority: nothing branches on it (not the phase, the circuit breaker or the revert), and Succeeded still needs everything above, from the verifier's report as before.
Stopped before the merge (built, #715; amendment of 2026-11-15). The deadline of the pull request step covers only the wait for the pull request to open. After that a request stays AwaitingApproval (WaitingForReview) until a person merges or closes the pull request, whatever the Incident does. While it waits, the executor also looks at the Incident, with the same get and the same read as above (no new grant), at each full recheck of the waiting pull request (every five minutes; the looks at the pull request in between read nothing more), and only when that recheck read the pull request open with the recorded head, found the plan fresh and its step did not stop at a pause (WritesPaused). The Incident has no recorded state that says it stopped while a request is active: its closure rules keep an Incident that an active request names where it is, so it never becomes Resolved by the quiet rule during the review. The executor therefore uses the count again, measured on one clock:
- The executor process keeps in memory the count it read and its own time right after the first read of that count. A read of another count, of another Incident UID, or a first read by this process starts the wait again. A later read of the same count at least one hour after it (
QuietBeforeResolved, the quiet time of the Incident's closure rules, far above the two aggregation windows a count may lag) marks the request:status.pullRequest.incidentStopped({uid, count, readAt}, the reading that found it, shown and never compared) and conditionIncidentStoppedTrue with reasonIncidentCountUnchanged, in one status patch. The field is the source, which a restarted executor reads so that it marks once; the condition is derived from it, and no CEL rule ties the two, since a rule over conditions would refuse the status of an object an older executor wrote. At most one Normal EventIncidentStoppedfollows per mark, recorded only after that status write answered: a write that went through with its answer lost records none, and the condition stays the signal. Both times come from one process's clock and none from the Incident; after a restart or a change of leader the wait starts again. - A later read of another count removes the condition and the field in one write, with no Event. The decision of 2026-11-15 has one Event, for the mark. A read of the same count changes nothing, so the mark is written once and not on every look. A condition without the field, which an executor that predates the field drops in its typed status write after a rollback, is removed at the next look too, and the wait starts again.
- An Incident that is gone (
NotFound), or made again under the same name with another UID thanspec.incidentRef.uid, is the end of the request's Incident: a mark is removed and none is set. Nothing is decided on a failed read, a paused executor or a request outsideAwaitingApproval: a mark that is there stays, and none is set. A conflict on the status write of the mark or its removal reads the request again and tries once more in the same reconcile; a second conflict and any other failed write are tried again at the next full recheck. The requeue of the recheck's step stands in every case, so a wait the Git host asked for (Retry-After) is never cut short. A saturated count and an Incident whose newest occurrence is a lasting symptom state (a module's state read from an object's status, such as KEDA'sReplicaCeiling) are never marked: such a state is counted once while it lasts, so an unchanged count says nothing about its end. - Nothing is closed and nothing else changes: the phase stays
AwaitingApproval, the pull request stays open with no comment, and the request keeps the lock on its target. A person still decides whether to merge or close it. The mark stays as it was once the request leavesAwaitingApproval.
Not chosen (decided 2026-11-15): closing the pull request and ending the request with a reason of its own. A fix for a fault that stopped by itself may still be the right fix (a leak that needs load to show), and a Git write nobody asked for is not worth it. The same limits as above apply: the count shows what the analyzer recorded, so a symptom it missed, or an analyzer that was stopped, looks quiet.
What a quiet window proves. Cleared means no OOM kill and no restart were observed over the window, with the pod set covered at every sample. Container status keeps only the last termination of a container, so history that went with a pod deleted between two samples (at most 30 seconds, longer across a gap) is lost; a gap with a new pod resets the window instead of trusting the new pod, and a restart while nobody watched still shows as a raised count. An OOM kill whose record was overwritten by a later termination is not reported as OOMKilled, but that later termination resets the window as Restarted.
Minimums and timeout. The controller derives the effective values; a request can only make them stricter (design 5.1):
stableForis the larger ofspec.verification.stableFor(default 3m, at least 1m by CEL) and the action's minimum: 10 minutes forSetContainerMemoryLimit, 3 minutes forAdjustKedaMaxReplicas. #93 may raise the memory minimum after measuring in the lab how soon the oom scenario is killed again under the old limit.- The timeout runs from
appliedObservedAtand is the larger ofspec.verification.timeout(default 10m, at most 24h) and the rollout deadline (RolloutDeadline, 10 minutes by default) plus the effectivestableForplusnodeGrace. For a memory fix with defaults that is 21 minutes. It is written tostatus.deadlinewhen the request entersVerifying. - At the timeout without a success:
FailedwhenRolledOutis False (RolloutStuck), when a ScaledObject'sKedaReadydoes not hold (KedaNotReady), or when the report recorded trouble (troubleResetsandlastTroubleReset: a restart count above its baseline after the window first opened), whatever its last reset; otherwiseInconclusivewith the last reset reason. Recorded trouble counts in a report that passes the spec check, even one no longer fresh: like the OOM record it is affirmative evidence and cannot move back. A revert has no report, so only the executor's own reads can fail it (section 8). A memory fix that does not help therefore endsFailedby the OOM rule well before the timeout, and a crash loop endsFailedat it. A change that makes pods fail their readiness probe without restarting endsInconclusive(PodNotReady).
The kill switch does not gate verification: it makes no Git write. While writes are paused it still reads, and the delivery window keeps its pause rule.
5. Inconclusive is a new terminal phase¶
The enum RemediationPhase gets one value, Inconclusive: the change was merged, and neither success nor failure could be shown. The condition Verified is Unknown and carries the reason (TargetGone, TargetReplaced, ValueChanged, RolloutSuperseded, PartialRollout, DeliveryNotObserved, DeliveryBlocked, DeliverySuspended, DeliveryNotChecked, NoMergeReceipt, EvidenceMissing, PodNotReady, NotAvailable, ScaledToZero, ObservationGap, StaleReport, ReportMismatch, ClearingNotChecked, CheckNotAvailable, RevertApplied, StalePlanMerged).
Three ways to express it were weighed:
- A reason under
Failed. Rejected: #96 proposes a revert forFailed, and reverting a change on a deleted workload, or one that a later commit already overwrote, is wrong. - A reason under
NeedsIntervention. No API change, but the circuit breaker countsNeedsInterventionas a failure. Every KEDA request in v0.5.0 ends inconclusive by design (section 3), so three of them would trip the breaker on no evidence of harm. It also mixes with the pre-merge stops of #95 (merge conflicts). - A new phase. Chosen. The enum change is additive (
feat(api), not breaking inv1alpha1) and user visible:kubectl get rr, the plugin'sstatusandexplain, troubleshooting and the phases diagram all show it. Nothing sets any phase afterMergedtoday, so every switch over phases that must learn it (breaker, duplicates, target lock, plugin) is touched by #94a anyway.
For the circuit breaker Inconclusive is treated like Expired: not a failure outside a probe, a probe that ends Inconclusive opens the breaker again for a full cool-down, never a success, and breakerCounts follows the existing rule for "any other end". Failed after the merge stays a failure, and only Succeeded clears outcomes, as today. A stale plan a person merged (StalePlanMerged), also one moved to the target branch the settings name now and merged there (#771), which is recorded only when it carries the planned change alone: its success is capped at Inconclusive with StalePlanMerged and counts for neither side, while a failed verification of it stays Failed, counts as a failure and gets a revert proposed (clarified 2026-11-18, fourth decision on #771; the code already did this).
6. States after approval¶
stateDiagram-v2
classDef planned stroke-dasharray: 5 5
[*] --> Merged: a person merged, receipt written in the same status write
Merged --> WaitingForDelivery: next reconcile, deadline is the delivery window
Merged --> Inconclusive: no merge receipt, NoMergeReceipt
Merged --> Inconclusive: a stale plan merged, once its rollout check is over, --verify-outcomes off, StalePlanMerged
WaitingForDelivery --> Verifying: Flux applied the merge commit or a descendant, Delivered True
WaitingForDelivery --> Failed: Flux failed on the merge commit at the end of the window, DeliveryFailed
WaitingForDelivery --> Inconclusive: not observed, blocked, suspended, target gone or replaced
Verifying --> Verifying: a bad sample or a stale report resets windowStart
Verifying --> Succeeded: rolled out, configured and a fresh report of a quiet window for stableFor plus nodeGrace
Verifying --> Inconclusive: what would end Succeeded, for a plan merged after it was known stale, StalePlanMerged
Verifying --> Failed: at the timeout rollout stuck, an OOM kill (not for a revert) or restarts
Verifying --> Inconclusive: value changed, template superseded, target gone, or at the timeout no evidence, or a revert applied
Failed --> [*]: Verified False, the analyzer proposes a revert request
Succeeded --> [*]
Inconclusive --> [*]
Merged and the end Inconclusive with NoMergeReceipt are built (#678); WaitingForDelivery, Verifying and the ends Failed and Inconclusive from the executor's own reads are built (#681); Succeeded and the ends that need the verifier's report (OOM kill, restarts, the no-evidence resets) are built (#683). The receiving side of the revert is built (#96, first part: spec.reverts, the executor's link check, no report and the end Inconclusive with RevertApplied); the analyzer creating it is built too (#96, second part: the revert proposer, see the amendments). The deadline of a step after the merge never ends a request Expired: past the merge, the evidence decides between Failed and Inconclusive. Expired stays for steps before the merge, which narrows the "Expired on deadline" of #94 to those steps.
Also before the merge: a pull request closed without a merge keeps ending NeedsIntervention with ChangeRequestClosed (decided 2026-11-13), because a person rejecting a proposal is a signal the circuit breaker counts as a failure, and the fix for #643 reads that phase and reason.
7. The verifier and its report¶
Container status lives on Pods, which no Shadewright identity that writes request status can read today. A third component reads it: shadewright-verifier, its own binary (cmd/verifier), Deployment and ServiceAccount. It is deterministic code, has no model access, holds no Git App credentials and never writes request status. Later evidence sources (metrics for the KEDA backlog with #508 and #506, Argo CD health) attach to this identity, so each widens the grants of a component that can only withhold or report evidence, not of the one that writes to Git.
Grants.
- In each namespace of the chart value
verifier.watchNamespaces:listonpods(noget, nowatch);getonreplicasets,deploymentsandstatefulsetsin theappsgroup (nolist, nowatch). The value follows the rules ofanalyzer.watchNamespaces(unique names, at most 256,*refused); left unset (null, the default) the chart usesanalyzer.watchNamespaces, and a list,[]included, is used as it is. The rules are one ClusterRole,verifier-watch-role(templatedist/chart/templates/rbac/verifier-watch-role.clusterrole.yaml), bound by one RoleBindingverifier-watchin each listed namespace (verifier-watch-rolebindings.yaml), never by a ClusterRoleBinding, the pattern ofanalyzer-watch-roleandanalyzer-watchtoday. The chart passes the same list as--watch-namespaces. With kustomize the ClusterRole isconfig/rbac/verifier/watch/role.yaml, and its RoleBindings are listed per namespace inconfig/watch/(role_binding_verifier_demo.yaml, next to the analyzer's), whichtest/rbacchecks against the verifier's flag inconfig/manager/verifier.yaml. - In the operator namespace:
get,listandwatchonremediationrequests(read only, to learn which requests areVerifying);getandcreateonverificationreports;updateonverificationreports/status; its own leader election Lease and core Events. The chart renders them as the Roleverifier-roleand its RoleBinding (verifier-role.role.yaml,verifier-rolebinding.rolebinding.yaml) and the leader election pair, as for the executor; kustomize asconfig/rbac/verifier/(role.yaml,role_binding.yaml,leader_election.yaml,service_account.yaml). - Cluster-wide, only the metrics authentication grant the executor and the analyzer have:
createontokenreviewsandsubjectaccessreviews, through the shared metrics-auth ClusterRoleBinding (metrics-auth-rolebinding,config/rbac/metrics_auth_role_binding.yaml), so its metrics endpoint checks the token and the permission of whoever scrapes it. No other ClusterRoleBinding names it.
It uses the pod list only with the target's namespace and selector, keeps only pod UID, owner references, labels, the Ready and PodScheduled conditions, creation and deletion times, container names, the action's container's memory limit, restart counts and the reason and finish time of the last and current termination, and never stores, logs or puts into an Event any other pod field. The termination message is never read.
The executor's cluster reads do not change. It gains get on verificationreports in the operator namespace, a Shadewright object.
How evidence reaches the executor. Two carriers were weighed:
- A field of an existing object. Request status is written only by the executor (invariant 6), so the verifier cannot write there. Incident status is written by the analyzer, the identity that talks to the model, and mixing a second writer into it would make the executor trust an object the analyzer can also change. A ConfigMap has no schema and no CEL. Rejected.
- A new namespaced object owned by the verifier. Chosen:
VerificationReportinremediation.shadewright.io/v1alpha1, one per request, in the operator namespace, written only by the verifier, with typed fields and CEL.
The report:
- Its name derives from the request UID; it carries an owner reference to the request (
blockOwnerDeletionfalse, so it needs no permission on the request) and is deleted with it. spec, set at create and immutable by CEL:requestUID,mergeCommitSHA(from the receipt),targetUID,templateRevision(fromstatus.rollout) and the action's container name. It holds no time of the executor's clock.- The verifier creates no report for a request with
spec.reverts(section 8). status, written by the verifier:sample(a counter raised by one per sample, forward only),sampledAt(the last sample),windowStart(forward only),desiredReplicas,podsCovered,resetsandlastReset(reason, time; the class follows from the reason),troubleResetsandlastTroubleReset(forward only),oomKill(set once),baselines(pod UID and restart sum, at most 200). Typed fields only: no messages copied from the cluster, so its size is bounded by the baseline list (about 15 KB at the limit).
The trust contract. On each reconcile in Verifying the executor reads the report and treats it as no evidence (a reset of its own window) when:
- it is missing (
StaleReport); - its
samplecounter has not risen for more than three poll intervals by the executor's clock (StaleReport; section 4, where the success decision asks for a report no older than one poll interval); - any
specfield differs from what the executor holds: the request UID, the receipt's merge commit, the target UID it reads itself,status.rollout.templateRevision(ReportMismatch); - it is incomplete:
podsCovereddiffers fromdesiredReplicas, ordesiredReplicasdiffers from thespec.replicasthe executor reads itself (PartialRollout).
A stopped or broken verifier therefore leaves the request without evidence, never Succeeded: without recorded trouble or an OOM record in a matching report it ends Inconclusive at the timeout; with one, that record stands (section 4). The durable baselines (section 4) and the node freshness rule live in the report, so a restart of the verifier does not reset what it knew, and the executor's own window is in request status, but a restart or a leader change does not carry it over whole: no window counts time from before the executor process began reconciling, so every open window needs a full effective stableFor again, and the first check of the new process records that as a reset, ExecutorRestarted (see the #96 entry on the executor's window after a restart and the #895 entry of 2026-11-20).
What the verifier can cause. The executor writes Cleared and takes only its evidence from the report; it is the only outcome whose evidence comes from the report. Delivery, the rollout, the template's freshness, the live value, availability and the target's UID come from the executor's own reads. An honest verifier can withhold success (no report, a reset) or report an OOM kill or a restart. A compromised verifier can do both falsely: a forged OOM record ends a request Failed at once, and a forged troubleResets (or lastTroubleReset) ends it Failed at the timeout; either leads to a revert proposal, which needs a person's approval (approvalRequired: true) and passes policy.
Accepted risk: a forged success. A compromised verifier can forge a quiet window and so a Succeeded, which clears older outcomes in the circuit breaker. This risk is accepted. It is bounded: the request must really be merged, delivered, rolled out on every desired replica, configured and available, by the executor's own reads; the forged report must carry the request's UID, merge commit, target UID and template revision; and the verifier makes no Git write, holds no Git App credentials and cannot change policy. A forged success therefore authorizes no change: it only lets the breaker allow more proposals, each still going through policy and a person's merge where policy asks for it. Writing the evidence from the analyzer instead would remove the third identity but put the verdict with the identity that talks to the model and reads untrusted cluster text (logs, events, messages) to build its prompt. The verifier has no model access and reads typed fields only, so it is the smaller and harder target, and this design keeps the evidence there.
8. A failed verification leads to #96¶
A request that ends Failed after the merge has Verified False with one of OOMKilled, Restarted, RolloutStuck, DeliveryFailed or KedaNotReady. That is the input of #96. Its shape, built in #96 (the receiving side in its first part, the analyzer's proposer in its second; see the amendments):
- The analyzer creates the revert, in deterministic code with no model call. It already holds
createon RemediationRequests in the operator namespace and reads request status; the executor cannot create requests, and gets no such grant. - The revert is a new RemediationRequest with the same Incident and target, the same action type with
previousanddesiredswapped,approvalRequired: true, and a new link fieldspec.reverts(name and UID of the failed request). CEL requiresapprovalRequired: truewheneverrevertsis set. - Its name derives from the failed request's UID, so a retried or repeated create finds the existing one: one revert per failure at a time. The name only prevents two at the same time: once a revert is deleted, a new one with the same name can be created, so the proposer records its decision for each failed request in the Incident's
status.revertsProposed(statePendingbefore the create,Createdafter it, orAbandonedwhen a check before the create says no) and never takes a second one (amendments of 2026-11-13 and 2026-11-14). - The executor checks the link before the policy check, with the
getit holds on RemediationRequests in the operator namespace: the named request exists with the UID inspec.reverts; it endedFailedwithVerifiedFalse; it has the same target (kind, namespace and name), the same action type and, where the action names one, the same container; the revert'spreviousequals itsdesiredand the revert'sdesiredequals itsprevious, exactly; and the revert's name is the one derived from its UID. Otherwise the request endsDeniedwith reasonInvalidRevert, before any Git write, and is never treated as a revert. - Only the analyzer's deterministic revert proposer may create a request with
spec.reverts. The analysis loop builds a request from the model's typed proposal, which has norevertsfield, and copies none, with a test that a model proposal cannot produce one. Both paths run as the analyzer, so RBAC cannot tell them apart; the executor's check is the control. A request that carriesspec.revertswithout being exactly the inverse of a failed request isDenied, and a valid one can only undo a change that already failed, through policy and a person's approval, so a model cannot use the link to skipClearedor gain an authorization (invariant 1). CEL keepsspec.revertsunchanged after create. - A revert is exempt from the OOM rule and from
Cleared: the verifier creates no report for it and the executor reads none;ClearedstaysUnknownwith reasonRevertApplied. A revert of a memory increase is expected to be OOM killed again, so an OOM kill neither fails it nor counts in the breaker. - It goes through the same policy check, freshness check, target lock and pull request path as any request. Its
previousmust still match the file in Git; if someone already changed the field, it endsSupersededlike any stale plan. - A revert is never reverted: a request with
spec.revertsnever triggers #96. - A revert never ends
Succeeded. It requires rolled out, configured and available only, since the original symptom is expected to come back, and once these held forstableForon the executor's clock it endsInconclusivewith reasonRevertApplied. The circuit breaker reads that like anyInconclusive: not a failure outside a probe, and it clears nothing, so the failure it reverts stays counted. A revert that does not roll out endsFailed(RolloutStuckorDeliveryFailed) and counts as a failure. The Incident stays escalated for a person. Inconclusivenever leads to a revert.
A revert of a memory increase is a decrease, and policies refuse decreases by default (maxDecreasePercent 0, design 5.3). Without a policy rule for reverts, the revert ends Denied with DecreaseNotAllowed and the person reverts by hand. Whether a policy may allow exactly the inverse of a failed request's change (and nothing wider) is a change to the policy decision; #96 decides it with an amendment and a red team, and it is the fourth point for the maintainer.
9. Invariants¶
- Model output is never authorization. Every verdict comes from deterministic code over typed fields; no model is asked, and the verifier has no model access.
Succeededauthorizes nothing new: it only lets the breaker clear older outcomes, as today. The revert is a proposal that goes through policy. - Actions are a closed catalog. Verification only reads; it never deletes, restarts or patches a pod or a workload. The revert reuses the existing action types; no value is added.
- Changes go through Git only. Verification makes no Git write and asks the host only the ancestry question it asks today. The verifier holds no Git credentials. A revert is a new request and a new pull request, never a direct change and never an automatic merge (
approvalRequired: true). - Everything from the cluster is untrusted input. Pod and Flux status are read as typed fields: integers, timestamps, owner references verified by UID and selector up to the target, and the termination reason compared with the constant
OOMKilled. Flux messages and termination messages are not copied into status or reports. The pod list is bounded in pages and count, and the report in size. The executor treats the report as input too, bound by UID and commit and checked for age and coverage. - Reconciliation is idempotent. The receipt is written with the phase and set once; a lost write is repeated with the same values, and a recorded pull request is found again by its number.
windowStartmoves forward only, in request status and in the report. Restart baselines are durable in the report, so a restart of the verifier or the executor never sets a silent new baseline: a raised restart count is aRestartedreset, a pod created during a gap is anObservationGapreset, and a gap can delay a verdict but never turns an observed failure into a success. Every terminal verdict is one status write. The revert's name and the report's name derive from request UIDs. - Separate identities. A third identity,
shadewright-verifier, holds the grants of section 7:listonpodsandgetonreplicasets,deploymentsandstatefulsetsin the namespaces of the chart valueverifier.watchNamespaces(unset: those ofanalyzer.watchNamespaces), through the ClusterRoleverifier-watch-roleand one RoleBindingverifier-watchper namespace, never a ClusterRoleBinding; with kustomize,config/rbac/verifier/watch/role.yamlbound by the RoleBindings inconfig/watch/;get,listandwatchonremediationrequests,getandcreateonverificationreportsandupdateonverificationreports/statusin the operator namespace (verifier-role,config/rbac/verifier/role.yaml), besides its own Lease and Events; no model access, no Git App. The executor's grants are unchanged exceptgetonverificationreportsin the operator namespace, and it stays the only writer of request status and the only component that sets phases. The analyzer gains nothing: it already creates requests and reads their status.
10. Current code and this design¶
| File | Exists at e2abcd9 |
Missing for this design |
|---|---|---|
api/v1alpha1/remediationrequest_types.go |
Phases up to Succeeded; Verification with CEL bounds; VerificationCheck enum; pullRequest.mergeCommitSHA, appliedObservedAt (set once by CEL), mergedAt; RolloutStatus with set-once rules; condition constants Delivered and Verified |
status.mergeReceipt with its CEL rules; phase Inconclusive; status.verification (windowStart, lastReset, resets) with forward-only rules; condition constants Configured and Cleared; status.verification.incidentCount (atMerge, atApplied; never changed, removable, #95b); spec.reverts (#96) |
api/v1alpha1/verificationreport_types.go |
Nothing | The VerificationReport type, its set-once spec, forward-only sample and windowStart, set-once oomKill, bounded baselines |
internal/controller/merge.go |
recordMerge (merge commit), recordApplied |
Writing the receipt next to the merge commit |
internal/controller/pullrequest.go, internal/providers/git.go, internal/providers/github |
watchStep finds the recorded pull request by branch (FindChangeRequest, most recent match) and stops on another number (headMoved); endMerged (adopt path) ends in Merged with recordMerge; a person's close ends NeedsIntervention (rejected) |
GetChangeRequest(number) in the interface and the GitHub adapter, used for a recorded pull request; receipt on both paths; its own reason for a merge conflict (#95a) |
internal/controller/handoff.go |
The replacement's merge records the merge commit | Receipt on this path |
internal/controller/rollout.go |
afterMerge on Merged only; the delivery window with pause; delivered with the second Flux read; judgeRollout and RolledOut; reads stop once rolloutEnded |
Phase moves to WaitingForDelivery and Verifying; Delivered; telling DeliveryFailed of the merge commit from a later one (delivered maps every non-Applied outcome to false today); ancestry against the receipt's repository; the template and revision read again on every reconcile in Verifying, ending RolloutSuperseded on a change |
internal/controller/remediationrequest_controller.go |
Calls afterMerge for Merged |
Dispatch for WaitingForDelivery and Verifying; status.deadline per step; MergedBeforeVerification for old requests; reading and checking the report |
internal/controller/limits.go, breakercounts.go |
setPhase sets mergedAt; the breaker classifies phases; only Succeeded clears |
Inconclusive classified like Expired (which covers RevertApplied) |
internal/controller/duplicates.go |
changeInEffect reads the live field; "Merged or a later phase" is a merge |
The same read reused for Configured; the later phases listed explicitly, Inconclusive and Failed included |
internal/providers/delivery.go, internal/providers/delivery/flux, internal/fluxstatus |
Outcomes Pending, Applied, Failed; AttemptedCommit; Suspended |
Nothing |
internal/verification/rollout |
Evaluate from workload status only; template hash and revision; a partitioned StatefulSet is Complete with "every pod runs the current template" |
Reason RolloutPartitioned with the old pods named |
internal/verification/clearing |
Nothing | The pod sample, ownership checks over typed objects, baselines, resets and the window as pure functions |
cmd/verifier, internal/verifier |
Nothing | The verifier's manager, its reconciler of Verifying requests and the report writer |
internal/analyzer/collector/owners.go |
ownerResolver verifies Pod to ReplicaSet to Deployment by UID and selector |
Its chain check moved to a shared package the verifier also uses, or copied with the same tests |
cmd/kubectl-shadewright/explain.go |
A section for RolledOut |
Three lines: rolled out, configured, cleared |
internal/controller/cache.go, chart RBAC |
get on the target kinds and Flux objects |
Executor: get on verificationreports; the verifier's ServiceAccount, Roles and RoleBindings (section 7) |
Dockerfile, images.yml, images-build.yml, chart.yml, trivy.yml |
Targets and images executor and analyzer |
A verifier target and image, built, signed, scanned and listed with digests in the release body |
docs/design/2-architecture.md, identity.svg, architecture.svg, AGENTS.md |
Two identities; the verifier is described as part of the executor | Three identities; invariant 6 text with the verifier's grants |
internal/analysis |
Creates requests by a deterministic name | The revert proposer (#96) |
11. The build tasks¶
| Task | Changes | Size | Order |
|---|---|---|---|
| #94a (split from #94) Merge receipt | status.mergeReceipt and CEL; written on the three merge paths; GetChangeRequest(number) for a recorded pull request; phase Inconclusive, classified in the breaker like Expired and learned by duplicates, target lock and plugin status (every phase of the API must be classified, TestEveryPhaseIsClassified); NoMergeReceipt; MergedBeforeVerification; envtest for a lost write, a reused branch, the adopt path, the handoff and CEL refusals |
L | 1 |
| #93a (#679, split from #93) Window and report logic | The VerificationReport API type with its CEL rules and refusal tests (the pure checks below take it as input); internal/verification/clearing: ownership over typed objects, coverage, durable baselines with pruning and the 200 bound, the gap rule, resets, the spans on one clock each, the timeout verdict; the report's trust contract and the counter rule as pure checks; unit tests: a partitioned StatefulSet is not covered, a forged owner reference is not counted, a restart during a gap resets as Restarted, a new pod after a gap resets as ObservationGap, a stale or mismatched report is no evidence, a skewed sampledAt changes no verdict, an OOM kill fails at once |
L | 1, pure code |
| #95a (split from #95) Before the merge | A merge conflict ends NeedsIntervention with its own reason |
S | 1, parallel with everything: it touches only the steps before the merge |
| #94b (rest of #94) Phases after the merge | Merged to WaitingForDelivery to Verifying with status.deadline; Delivered; Configured (needed for ValueChanged); every delivery case of section 2 with its outcome; the template read on every reconcile in Verifying (RolloutSuperseded); RolloutPartitioned; the timeout verdict from the executor's own reads, so that until #93b a request ends Inconclusive with ClearingNotChecked instead of staying Verifying; executor.verification.nodeGrace; phases.svg, executor.svg and the phase lists in the docs |
L | 2, after #94a |
| #93c (#682, new) The verifier component | cmd/verifier and its reconciler, which skips requests with spec.reverts; the grants of section 7 in the chart and config/; the Dockerfile target, the image build, signing, Trivy scan and release digests; identity.svg, architecture.svg, design 2 and invariant 6 in AGENTS.md |
L | 2, after #93a and #94a (the report's spec takes the receipt's merge commit), parallel with #94b |
| #93b (#683, rest of #93) Executor wiring | get on verificationreports; status.verification; Cleared; the trust contract and the counter rule; Verifying to Succeeded, Failed (OOMKilled, Restarted) and Inconclusive; explain with three lines; design 9 and 10.11 |
L | 3, after #94b and #93c |
| #96 Revert proposal | spec.reverts with CEL; the analyzer's deterministic proposer and the test that a model proposal cannot set the link; the executor's link check and InvalidRevert; one revert per failure; no revert of a revert; the exemption from the OOM rule and Cleared; RevertApplied; the policy question of section 8 |
L | 4, after #93b, which builds the Verifying verdicts that RevertApplied and the exemption change |
| #95b (#684, rest of #95, built) Resolved before the rollout | The executor stays the only writer of Cleared, with the report as its evidence; this task only changes the reason it writes, to ResolvedBeforeRollout instead of NoRecurrence, when two readings of the Incident's status.count (status.verification.incidentCount, section 4) show no new occurrence recorded between the merge and the rollout over a long enough span, so the attribution is visible. It adds a read of the Incident, with the merge receipt and with appliedObservedAt, with the existing get, one status field with CEL, and the executor's grant text in AGENTS.md invariant 6 and design 2 (what the get on the Incident is for); no new grant, no analyzer change |
S | 4, after #93b, parallel with #96 |
Order: #94a, #679 and #95a first; then #94b and #682 side by side; then #683; then #96 and #95b side by side. #93 and #96 both list #94 under "Depends on"; with the split #682 depends on #679 and #94a, #683 on #94b and #682, and #96 on #683. #682 adds one L task to the milestone, #94a grows from M to L with the lookup by number and the new phase, and #679 from M to L with the report type; #683 no longer carries the pod grant or Configured.
A close without a merge keeps ending NeedsIntervention with ChangeRequestClosed; the decision and its reason are in section 6.
Consequences¶
Succeedednow needs a receipt, delivery of the merge commit or a descendant, the live value, an available workload with every desired replica on the applied revision, and a quiet window of at least 10 minutes plus the node grace for a memory fix, reported fresh by the verifier. A request that cannot show this endsInconclusivewith a reason a person can act on.- KEDA requests cannot succeed in v0.5.0. That is accepted until metrics are evidence (#508, #506), which attach to the verifier.
- The phase enum grows by one value, and every place that lists phases (breaker, duplicates, target lock, plugin) learns it in #94a, the docs and
phases.svgin #94b. - A third Deployment, ServiceAccount, image and signed release artifact. The install and the lab run one more pod; its requests are small (one list of the target's pods every 30 seconds per
Verifyingrequest). - The verifier reads Pods in the chart's namespaces, which also exposes their specs (environment values included) to that identity. It holds no Git App credentials and no model access, so the exposure stays with an identity that cannot write to Git or send pod data to a model.
- A stopped verifier, or one that restarts often, leaves verification without fresh reports and ends it
Inconclusive. That is the intended direction of the error. - A partitioned StatefulSet rollout, or a change that makes pods fail readiness without restarting, ends
Inconclusive. - A combined later commit is judged with our change when it arrives before the rollout is recorded; after that it supersedes the verification (section 2). A pod deleted between two samples takes an OOM kill of its last run with it; the 30 second poll bounds that gap, and a longer gap with a new pod resets the window.
- A forged report from a compromised verifier can end a delivered, rolled out and configured request
Succeeded(section 7).
Alternatives considered¶
- Freeze the existing fields instead of a receipt (CEL on
status.source,status.planRepositoryandstatus.pullRequest.headSHAoncemergeCommitSHAis set). No new field, butheadSHAmoves before the merge by design (handoff, reviewer hints), and requests merged before the rule would look like they have a receipt. Rejected. Inconclusiveas a reason underFailedorNeedsIntervention. See section 5.- The executor lists pods (
listonpodsfor the executor, decided on 2026-11-13 and replaced the same day). Rejected: the identity that holds the Git App would read every pod spec in the chart's namespaces, and every later evidence source (metrics, Argo CD health) would widen that same identity. - Evidence from the analyzer through the Incident. The analyzer already watches pods and could write OOM evidence into the Incident status, which the executor reads with its
geton Incidents. The verdict would then depend on the identity that talks to the model, a stopped analyzer would leave no new evidence that looks like no OOM kill (against decision 3), and aSucceededcloses the circuit breaker, so a forged clear would weaken a safety control. Rejected. - Pod ownership by name and count, without reading ReplicaSets. Requiring one ReplicaSet UID across the sample and a pod count equal to the Deployment's replicas would catch most forged owner references with no
getonreplicasets, but it rests on the Deployment status and the pod list agreeing at the same moment. With a separate identity thegetis cheap and matches the collector's proven chain. Rejected. - A metrics source for the executor in v0.5.0. Ruled out by decision 2.
- Count restarts as a single total. Simpler, but a replaced pod lowers the total and hides a restart elsewhere; per-pod baselines with new pods at 0 avoid it.
- Keep baselines in memory only. Smaller, but a restart of the reader would take the next sample as a new baseline and lose a restart that happened while nobody watched. Rejected for durable baselines in the report.
Points for the maintainer¶
- The third component,
shadewright-verifier, and its grants (section 7), replacing the decision of 2026-11-13 to grant the executorlistonpods; with it the executor's newgetonverificationreports. Needed before #682 is built. - The accepted risk of a forged quiet window (section 7): a compromised verifier can forge a
Succeededfor a request that is really merged, delivered, rolled out, configured and available, which lets the circuit breaker clear older outcomes. It authorizes no change. - KEDA requests cannot reach
Succeededin v0.5.0 (section 3):ClearedstaysUnknownwith reasonClearingNotCheckedand they endInconclusive, until metrics are evidence (#508, #506). - The policy rule for reverts (section 8), left to #96: whether a policy may allow exactly the inverse of a failed request's change. Without it a revert of a memory increase ends
DeniedwithDecreaseNotAllowed. - The new values and intervals, each with the default its section defines:
- chart value
verifier.watchNamespaces, defaultnull(the chart usesanalyzer.watchNamespaces), section 7; - flag
--node-grace, chart valueexecutor.verification.nodeGrace, default 1 minute, to be at least the cluster's node monitor grace period, section 4; - sampling and reconcile interval of 30 seconds while
Verifying, 15 seconds once both spans are long enough, fixed, not settings, section 4; spec.verification.stableFor, default 3m, at least 1m, raised to the action's minimum (10 minutes forSetContainerMemoryLimit, 3 forAdjustKedaMaxReplicas), andspec.verification.timeout, default 10m, at most 24h, with the rollout deadline of 10 minutes, section 4;- the delivery window of one hour after
mergedAt, section 2.
- chart value
- The minimum span between the two counter readings for
ResolvedBeforeRollout(section 4, #684). Decided 2026-11-13: the effectivestableForplus twice the analyzer's aggregation window (DefaultWindow, 5 minutes): 13 minutes by default, 20 for a memory fix. The count is written at most once per window and an OOM crash loop backs off up to 5 minutes, so one window of batching and one of backoff must fit in the span. The alternatives are a fixed value, for example 10 minutes, for every action (simpler to explain, not tied to the request), andstableForalone, rejected: it can be shorter than one window, and equal counts over it prove nothing. Most deliveries (seconds after the merge) give a span below the minimum, so the reason will usually stayNoRecurrence; it shows mainly when the GitOps controller is slow to deliver.
Amendments¶
- 2026-11-13: building #93a (#679) changed four rules of sections 4 and 7. Native sidecars (init containers with
restartPolicy: Always) count like containers for statuses, restarts and terminations. A current termination without a finish time makes a sample incomplete. An OOM kill of the action's container in a returned pod is judged before the 200 pod bound givesEvidenceMissing. Trouble is recorded durably in the report (troubleResets,lastTroubleReset), so a crash loop after the window opened endsFailedat the timeout even when its last reset wasPodNotReady, and recorded trouble counts in a matching report that is no longer fresh. Only a restart count above its baseline after the window first opened is recorded: aRestartedreset before the first good sample, or one shown only by a termination time, resets the window and nothing more. Theclassof a reset left the report: it follows from the reason. TheVerificationReporttype andinternal/verification/clearingare built; nothing writes or reads a report yet. - 2026-11-13: #94a (#678) is built:
status.mergeReceiptwith its two CEL rules,GetChangeRequest(number)inGitProvider, the GitHub adapter and the fake, used bywatchStepfor a recorded pull request, the phaseInconclusivewith reasonNoMergeReceipt,MergedBeforeVerificationfor requests merged before receipts existed, and the Incident closure reasonRequestInconclusive. The arrowMerged --> Inconclusivein section 6 is no longer planned. Section 10 describes the code ate2abcd9, before this. - 2026-11-13: #94a (#678), what is built differs from section 1 in four points. A merge without a full merge commit ID ends
NoMergeReceiptonly after the executor waited five minutes for the commit, measured on its own clock from when it first saw that state (status.mergeCommitAwaitedSince, set once); the GitHub adapter returns such a merge without one instead of an error. Two more CEL rules tie the receipt's pull request, head andmergedAttostatus.pullRequestand allow a receipt only inMergedor a later phase. AMergedrequest carrying theNoMergeReceiptmark is read by the circuit breaker likeInconclusive. An answer of the host for another number than the one asked for isChangeRequestGone, like a pull request from another branch. - 2026-11-13: #94b (#681) is built:
MergedtoWaitingForDeliverytoVerifyingwithstatus.deadline, delivery asked against the receipt (its merge commit and target branch, and the ancestry of the receipt's repository, opened by the receipt's URL and installation and not gated by the kill switch, which gates writes only),Deliveredand the new condition typeConfigured, every case of the table in section 2, the template and revision read on every reconcile inVerifying(RolloutSuperseded),RolloutPartitioned, and the flag--node-gracewith the chart valueexecutor.verification.nodeGrace. These points differ from the text. The phases afterMergedrun only with the executor flag--verify-outcomes(chart valueexecutor.verification.enabled, kustomize default off), off by default until the executor reads the verifier's report (#683): until then no request can endSucceeded, so with the path always on every merge would endInconclusiveorFailed, the circuit breaker would never close again once tripped, and every Incident would end Escalated. Off, aMergedrequest keeps the rollout report of #532, and a request found inWaitingForDeliveryorVerifying(the flag was turned off while it was there) endsInconclusiveat its next reconcile with a reason section 5 does not list,VerificationDisabled, whose message says the executor runs without--verify-outcomes: nothing moves such a request on with the flag off, and a half-open probe left there would make every other request wait (CircuitHalfOpen) for ever. It ends through the same status write as every otherInconclusiveend, so the breaker reads it as section 5 says (a probe that ends so opens the breaker again for a full cool-down, after which the next request goes through as the new probe). The circuit breaker readsWaitingForDeliveryandVerifyingas undecided, neither a success nor a failure, and a half-open probe in one of them stays the probe until it ends: the move to them refresheslastPhaseTransitionTime, so read as a success an old merge would close a breaker tripped by later failures. With the flag on, aMergedrequest with a merge receipt is undecided too: it staysMergedfromrecordMergeuntil its next reconcile moves it toWaitingForDelivery, and read as a success in that gap a probe that has just merged would close the breaker and let another request through as an ordinary one before its outcome is known. With the flag offMergedis a success, as before #681. AMergedrequest without a receipt is read as #678 decided: likeInconclusivewith theNoMergeReceiptmark, as a success otherwise (MergedBeforeVerification).status.breakerCountsdoes not depend on the flag:Mergedsets it as a success, so such a request stays read when the flag changes. Until #683 the timeout verdict isFailedwithRolloutStuckwhenRolledOutisFalsewith that reason,FailedwithKedaNotReadywhen a ScaledObject target is not ready by the KedaReady rule, andInconclusivewithClearingNotCheckedotherwise. A clock that went back by more than a minute past a time the executor recorded (the merge, the applied time) ends the wait at once,InconclusivewithDeliveryNotCheckedorClearingNotChecked, neverFailed; one less than a minute behind (a leader on a node whose clock lags) does not. Known limit: backward movement is measured against the step's start only, so a clock that repeatedly moves forward and back by many minutes inside one step can postpone the timeout. A target that cannot be read until the end of the timeout plus 10 minutes endsFailedwithRolloutStuckwhen that was recorded, and otherwiseInconclusivewith the new reasonTargetNotChecked(the executor's own evidence on the target was not read), which also ends a request whose action field cannot be read on the target;ClearingNotCheckedstays for evidence that the symptom cleared not read. A delivery read that keeps failing, Flux moving between applied commits included, is retried within the window and its grace, then endsDeliveryNotChecked; a cause that does not clear by itself (the receipt's repository gone from the settings or unusable, no ancestry check, no delivery verifier) is named inDeliveredand in the final message. Two more CEL rules:WaitingForDeliveryandVerifyingrequirestatus.mergeReceipt, andVerifyingrequiresstatus.pullRequest.appliedObservedAt, which the executor writes in the same status write. A receipt withoutmergedAtis refused by the schema; read anyway, it endsInconclusivewithNoMergeReceipt. A request merged before receipts existed (MergedBeforeVerification) keeps the rollout report of #532 inMerged; a request whose rollout report ran inMerged(before #681, or with the flag off) moves toVerifyingfrom its recorded applied time without reading the delivery again, and endsInconclusivewithClearingNotCheckedwhen the timeout measured from that time has already passed. - 2026-11-13: #682 is built: the third identity
shadewright-verifierof section 7 (binarycmd/verifier, imageghcr.io/pkalin/shadewright-verifier, its own Deployment, ServiceAccount, Roles and RoleBindings, chart valuesverifier.*). It samples the pods of each request inVerifyingthat has a merge receipt and a template revision, every 30 seconds, throughinternal/verification/clearing, and writes the reportvr-<request UID>and its status. Invariant 6 inAGENTS.md,docs/design/2-architecture.md,identity.svgandarchitecture.svgnow show three identities. Not built in #682: the executor reading the report (#683), and skipping requests withspec.reverts, which waits for #96 (the verifier has a hook for it). No decision of this ADR changed. - 2026-11-13: section 7 names the verifier's metrics authentication grant (decided 2026-11-13): cluster-wide
createontokenreviewsandsubjectaccessreviewsthrough the shared metrics-auth ClusterRoleBinding, as the executor and the analyzer have. The chart and RBAC tests assert the verifier's complete set of bindings, this one included. - 2026-11-13: #682, three points of how the verifier samples. The chart deploys the verifier (and every object of it, its metrics-auth subject included) only when
verifier.watchNamespaces, after the fallback toanalyzer.watchNamespaces, is not empty; the binary does not start with an empty--watch-namespaces. Without a verifier no request gets a report, so a merged request can end onlyInconclusive. The report is created together with its first sample, after every read of that sample succeeded, so a read that keeps failing leaves no report (the executor reads that asStaleReport) instead of one with an empty status. A report without a sample can still exist when its create ran past the 20 second bound or the status write after it failed: it has nosampledAt, the executor reads it as stale, and the next reconcile writes its first sample. A request being deleted is not sampled. The sample time is taken after the reads, and a sample whose reads took more than 20 seconds by the verifier's clock (a third of the gap threshold) is discarded, with no write and no raised counter. - 2026-11-13: #95a (#680) is built: a merge conflict before the merge ends
NeedsInterventionwith reasonChangeRequestConflict(decided 2026-11-13). The executor reads the conflict from the Git host's answer for the recorded pull request (Conflictedon theGitProviderchange request; on GitHubmergeablefalsewithmergeable_statedirty), only after the freshness check found the plan fresh, so a stale plan still endsSuperseded. GitHub computes mergeability lazily and one answer can be stale, so a conflict ends the request only when confirmed: the first conflicted look recordsstatus.pullRequest.conflictSeen(the executor's clock, the recorded head, the target branch head the freshness check read), and the request ends only on a conflicted look at least two minutes later on the same recorded head. A look without a conflict removes the mark, and a clock that went back more than a minute records it anew; a move of the target branch that leaves the plan fresh does not, so a busy branch cannot postpone the end. Known limit: a clock that keeps going back restarts the wait each time and no deadline covers an open pull request, so such a request does not end (it holds the lock and writes nothing to Git). The pull request is left open for a person and the request keeps the lock on its target until it is merged or closed. No decision of this ADR changed. - 2026-11-13: #683 is built: the executor reads the request's
VerificationReportwithgetin the operator namespace (granted whatever--verify-outcomessays), keeps its own window instatus.verification(windowStart,lastResetwith the reasonsNotAvailable,StaleReport,ReportMismatchandPartialRollout,resets; four CEL rules: kept once set,windowStartand the time oflastResetforward only,resetsnever lower), writes the conditionCleared, and endsVerifyinginSucceeded(ClearedandVerifiedTrue, reasonNoRecurrence, one status write),FailedorInconclusive.--verify-outcomesstays off by default; its default is decided after a lab run with a release candidate. The memory minimum stays 10 minutes: no lab measurement is recorded. Decided beyond the text: (1) A report withoutsampledAt(created, its first sample never written) is read as missing,StaleReport. (2) UntilRolledOutis True a check neither opens nor resets the executor's window; the OOM rule applies from the first check. (3) A failed read of the report is retried, never read as missing; one that fails until the timeout plus 10 minutes is decided by the timeout verdict without a report, and the message says so. (4) The timeout verdict of #679 took the executor's own last reset first; that hid the cause of the usual case, since the first check inVerifyingfinds no report yet (StaleReport) and a pod that is not Ready also makes the target not available (NotAvailable). It now takes, in order: the executor's reset while its window is closed byStaleReportorReportMismatch(the report is no evidence); the report's reset while the report's window is closed (the verifier's pod-level cause, such asPodNotReady); the executor's reset of its closed window; then, with both windows open, the report's last reset and the executor's. No time is compared across clocks. (5) A ScaledObject's executor window is good while it is ready by the KedaReady rule and reset withNotAvailableotherwise, and it endsInconclusive(ClearingNotChecked, orCheckNotAvailablewhen the request namesQueueBacklogDecreasing) once that window spans the effectivestableFor, without the node grace, which covers pods only. (6) A Deployment or StatefulSet request namingQueueBacklogDecreasingendsInconclusivewithCheckNotAvailableat the check that would otherwise end itSucceeded, so an OOM kill or recorded restarts still fail it. (7) Every end fromVerifyingwritesCleared:FalseforOOMKilledandRestarted,Unknownwith the end's reason otherwise; while the window runs it isUnknownwith reasonObserving(ClearingNotCheckedfor a ScaledObject). (8) The executor's report counter is memory only and is not dropped on every reconcile of a request after the merge, only when the request ends, is being deleted or is gone. - 2026-11-13: #683, four points of the executor's window and its end. (1) A bad check counts as a reset of the executor's window only when it closes an open window or names another reason than
lastReset; the same reason again on a closed window changes nothing and writes no status. Before this, every bad check raisedresets, and the status write queued the request again at once, so a request without a verifier spun until the timeout. A CEL rule now requiresresetsof at least 1 whilelastResetis set. (2) Freshness of the report, both spans and the timeout are judged on the executor's clock taken again after the report read, while each check's counter is remembered at the time taken before its read, a lower bound of when the counter it read was true. A rise therefore counts as fresh only when the time after this read minus the time before the earlier read is at most one poll interval, so a slow read, this one or an earlier one, can make a report look older but never fresher, and cannot let a report older than one poll interval decideSucceeded. (3) A check is good only when the target's available replicas equalspec.replicas, as this section says; the build refused only fewer, and theNotAvailablerow of the reset table now says "other" instead of "fewer". (4)ClearedisFalseonly when the request endsFailedwithOOMKilledorRestarted; a timeout that endsInconclusivewith the report'sRestartedreset (one not recorded as trouble) leavesClearedUnknown. - 2026-11-13: #688 is built: the other reads of a recorded pull request use
GetChangeRequest(number)too, as section 1 says ("a recorded pull request is found again by its number"): the handoff of ADR-0028 (the predecessor's number, before and after the branch update), the target lock of a stopped request (checkHeld), the close of a request's pull request (stale plan, deadline, deletion) and the look after a close that a merge refused (by the number the close tried). All of them go through one function,changeOf(internal/controller/change.go), which binds the answer to the number asked for, the request's branch and the target branch, and answers with a closed verdict: open, merged, closed, gone (confirmed) or unknown (a failed, conflicting or untrusted read). No other function of the controller reads a pull request (a test over the package source checks it), and unknown is retried on every path: it ends nothing, releases no lock and removes no finalizer, and its error class (ErrConflictincluded) is never taken for a merge. The read by number decides which pull request is the recorded one, but a 404 alone, or another pull request open on the branch, never leads to a step that cannot be taken back.GitProviderhas a new read,ListChangeRequests, which lists every pull request of a branch to the target branch (open ones only, or all), bounded at 100 with an error past that, and refuses the whole answer when an entry is from another branch, repository or base branch. A 404 for a recorded number is believed only when that listing of the branch, in all states, has no pull request with the number either; otherwise it is a failed read and is retried, on the watch (findRecorded, so a predecessor whose handoff intent stands only requeues), the close paths and the finalizer; the handoff believes a 404 only on the same confirmation and retries it otherwise until its deadline (ADR-0028). The finalizer is removed only when the recorded pull request is not open, or open without this request's marker, and no open pull request of the branch carries this request's marker: one that does is this request's change whatever its number, and is closed. An answer about another pull request is retried there, never taken as finished. The target lock is released on a closed recorded pull request only through the rule of the ADR-0028 amendment of the same day. No single read ends anything (decided 2026-11-13): a 404, an empty answer, a JSONnullor an answer about another pull request is a failed read and is retried with backoff, on every path, and an answer about another number never stands in for the recorded pull request. This changes what the #678 entry above decided for the watch: an answer of the host for another number is no longerChangeRequestGonebut a failed read, retried; the same holds for the close of a stale plan, at the deadline and after a render refusal, which no longer end the requestForeignChangeRequest(or with the pull request left open) on a 404 the branch does not confirm or on such an answer, and for the handoff. On GitHub the listing of a branch refuses an answer that is not a JSON array (nullincluded) instead of reading it as no pull request. A request with no recorded pull request (the status write after the open was lost) reads the listing of its branch in all states and looks at every pull request with its marker: the cleanup closes each open one and ends merged when one is merged, the finalizer does the same, and the target lock records an open one first, then a merged one. The open step does the same before it cuts a branch, so it adopts an open pull request of its own, else ends on a merged one, else on a closed one. At the deadline, a merge found that way ends the requestMerged(orMergedWithForeignChange), as the stale plan's cleanup does, instead of retrying the close for ever. The finalizer retries a close the host refuses as a conflict and reads again, rather than take it for a merge. So a newer closed pull request no longer hides an older open or merged one, and the earlier known limit (after a close that a merge refused and a lost status write, a newer pull request could hide the original merge) is gone. Decided the same day, after review: no caller releases the target lock on its own. The deadline's and the stale plan's cleanup close only the pull requests with the request's marker, so they no longer clearstatus.holdsTargetwhen none is recorded; the look-up of the branch after the stop releases it, through the one rule of the ADR-0028 amendment (openHolding), and anExpiredorSupersededrequest with no recorded pull request keeps the lock until then. One function writes the field false, and a test over the package source checks that only the lock rule calls it on a pull request's account. A read of a pull request that the host refuses (403, 422) is an unknown verdict, never a refused write: the open step and the recovery of a handoff retry it until their own deadline, and the deadline's and the stale plan's cleanup, whose deadline has passed, end with their refused reasons, a message that says the read was refused, and the lock kept. Decided the same day, after review: a refused read is never silent. Whenever a read of a request's pull requests is refused (403, 422), conditionPullRequestUnreadableis set on the request whose pull request was read (reasonGitForbiddenorGitRejected, a fixed message that names the read and never the host's answer,lastTransitionTimefor since when), on every path, the watch of a phase without a deadline and the look-up of a stopped holder included, with one Warning EventPullRequestUnreadableper transition, not per retry; the next read that works removes it, with one Normal EventPullRequestReadable. A repository of the plan that left the settings sets it with reasonRepositoryUnavailable, at the deadline's expiry in the status write that ends the request and on the stopped holder's look-ups, until the repository can be opened again; on those look-ups an entry that names another target branch sets reasonTargetBranchChangedand one that cannot be usedRepositoryUnusable, so the condition says what holds as the settings stand. Retrying and the lock are unchanged. A pull request read as closed by its number is checked against the open listing of its branch for every caller (one more read, on closed only), so a stale closed answer no longer cancels a handoff or ends a request while the pull request is open. On GitHub a listing whose pages answer differently about one number (state or head) is an error, retried, never the first answer. Gone is confirmed like a merge conflict (#680), decided the same day beyond the text of section 1: a 404 by number that the listing of the branch in all states confirms is believed only on a second such look at least two minutes after the first, on the executor's clock. Decided 2026-11-14: the first look is evidence about the Git host as one executor process saw it, so it lives in that process's memory, as the reading at the merge does (section 4), and not instatus. The first look keeps the number and the time on the process's clock, bound to the request's UID, and answers unknown, with the time left as the delay; gone is answered only by a later look of the same process, at least two minutes and less than 30 minutes after the first, that finds the same number missing with no listing showing it or another pull request of the request. Any other outcome of a read drops the first look: a read that shows the number or a pull request of the request (by its number, in the listing in all states, or in the open listing, conflicting reads included), a failed read, and any verdict but gone. A look for another number replaces it, and the request's end, its removal, an age of 30 minutes or a time ahead of the clock start the wait again. The first look is decided in one place (settleGone), once per read, and nothing about it is written, so no status write, cache or early return can keep an old one alive. The earlier design kept it in a status field, and two reviews found it out of step with the reads: through a cached copy that predated it, and through a return for conflicting reads before the read that showed the pull request was taken into account; both let a later single 404 answer gone at once. The field was never released and is removed. The cost: after a restart or a change of leader every wait starts again, so a deletion or a stop can take two minutes longer. A 404 whose listing shows a pull request with the request's marker is never gone: it answers unknown, retried. A caller that puts back a saved status for a retry keeps conditionPullRequestUnreadableas the read wrote it, so a later status write never undoes it. A pull request read open by its number without the request's marker does not conflict with an open listing that shows it: both say it is open, so it is gone for the lack of the marker, and the finalizer of a request whose marker a person removed from its open pull request goes and leaves that pull request open. A request that ends without the lock on its target has its pull requests read no more, so the status write that ends it removesPullRequestUnreadable, asTargetHeldgoes with the lock; a request that keeps the lock keeps the condition, which its look-ups keep in line. Known limit, decided the same day: a recorded pull request that the host really lost while another pull request with the request's marker stays on the branch is never taken for gone, so that request keeps retrying, and keeps its lock, until a person acts. The open listing of the branch counts too: a confirmed 404 is not gone when that listing shows a pull request with the marker. Decided 2026-11-14: such a request is shown to a person: conditionPullRequestUnreadableis set with reasonRecordedMissingOtherListed, a message that names both numbers and what ends it (delete the request, or remove the marker from the listed pull request when that one is not the request's change), and one Warning Event per transition; the next read that answers removes it. Deletion is the exception, decided the same day: a person deleted the holder, so the finalizer closes every open pull request of the branch with the request's marker, whatever the read of the recorded number says, and goes; a close the host refuses (403, 422) keeps the finalizer and is retried, as before. Without such a pull request on the branch the wait for gone holds on every path throughchangeOf, the finalizer included, so the deletion of a request whose pull request is really gone takes at least two minutes. Deletion is outside the rule that no release happens while an open pull request may deliver the change: the finalizer closes the pull requests with the request's marker and then goes, and the lock goes with the request even when a pull request without the marker is open on the branch, because a person deleted the holder. Known limits: the marker is the only sign of ownership on a branch, so a person who removes it from a pull request's body leaves that pull request to themselves, and one who copies it into another pull request of the same branch makes that one eligible for closing; a branch with more than 100 pull requests in its history keeps a request with no recorded pull request from ending or being deleted on its own. No other decision of this ADR changed. - 2026-11-13: how the executor knows the symptom stopped before the rollout (#684, planned, not built; decided 2026-11-13). Section 4 gains the subsection "Resolved before the rollout": the executor reads the request's Incident with its existing
getand records the Incident'sstatus.counttwice, with the merge receipt (atMerge) and withappliedObservedAt(atApplied), in the newstatus.verification.incidentCount, each reading set once with the executor's own time of the read.ClearedTrue carriesResolvedBeforeRolloutinstead ofNoRecurrenceonly when both readings exist, belong tospec.incidentRef.uid, are equal and below the saturation value, and their span on the executor's clock is at least the request'sstableForplus twice the analyzer's aggregation window (point 6 of the maintainer list). Otherwise the reason staysNoRecurrence. The Incident cannot beResolvedwhile its request is active, and its times are on other clocks, which is why counts are compared and times are not. Invariants: (1) the reason is an attribution, it decides no phase and authorizes nothing; the counter is plain deterministic data, no model is asked. (5) Both readings are set once and a reading is set once and a restart finds the recorded ones; a write that did not land takes the reading again at the next reconcile (atMerge) or, foratApplied, together with the retriedappliedObservedAt, and nothing else sets it. (6) No new grant, no new writer and no analyzer change: the executor stays the only writer of request status, the analyzer the only writer of the count, and a compromised analyzer that freezes the count can at most put the labelResolvedBeforeRollouton a request that still needs the verifier's report to succeed. Options 2 (a quiet marker written by the analyzer) and 3 (no such reason in v0.5.0) of the issue are not taken: the first adds a writer of evidence that the executor must then trust, the second leaves the attribution invisible. The counter counts what the analyzer recorded, so a symptom it missed looks quiet, andappliedObservedAtcan be later than the real apply, so the quiet span can include time after the fix; the section says both. - 2026-11-13: #96, first part, is built: the receiving side of a revert (section 8).
spec.reverts(name and UID of the failed request) with two CEL rules,approvalRequired: truerequired while it is set and nospec.replaceswith it (a revert never replaces a request), and kept unchanged by the rule that makes the spec immutable. The executor checks the link before the policy check, after the chain link of ADR-0028, with agetthrough the API reader; a failed read is retried, never a refusal. The revert's name isRevertNameof the failed UID:revert-and 24 hex characters of the SHA-256 ofrevert/and the UID. Every failed check endsDeniedwith the one reasonInvalidRevert, and the message names the cause. Read in the fail-closed way where the text leaves room: the link also requires the same Incident (the shape names it), the wholetargetRef(API version and UID too, not only kind, namespace and name), and an action with no other member set; quantities compare by value, so384Miand402653184are the same limit. An allowed revert keeps approval required in the executor as well, even if a policy would lower it. The verifier skips a revert through its hook. InVerifyinga revert reads no report: the executor's window is good whileRolledOutis True (else it is reset withPartialRollout, so the span of an earlier window does not carry over) and the available replicas equalspec.replicas, at least one (elseNotAvailable: a target scaled to zero shows no availability), and once it spans the effectivestableForon the executor's clock, without the node grace, the request endsInconclusivewithRevertApplied; a ScaledObject revert does the same on its KedaReady window. At the timeout a stuck rollout ends itFailed(RolloutStuck,KedaNotReadyfor a ScaledObject), anything elseInconclusivewith the executor's last reset, orEvidenceMissingwithout one (ClearingNotCheckedfor a ScaledObject).ClearedisUnknownwithRevertAppliedwhile it runs and on every end of a revert fromVerifying,Failedincluded. With--verify-outcomesoff theVerificationDisabledend applies to a revert as to any request. The analysis loop never takes a request that carriesspec.revertsas the request of its own plan. The circuit breaker never reads a revert as a success, in any phase, with--verify-outcomeson or off (decided 2026-11-13): with the flag off a merged revert staysMerged, which would otherwise count as a success against this section's "it clears nothing, so the failure it reverts stays counted". A revert that fails still counts as a failure. Not built here: the analyzer's revert proposer (#96, second part), and a policy rule for the decrease of a revert, so a revert of a memory increase still endsDeniedwithDecreaseNotAllowed(the fourth point for the maintainer, open). Decided beyond the text: (1) A merged revert is never a success for the circuit breaker, also with--verify-outcomesoff, where until nowMergedcounted as one. (2) A revert's window is reset whileRolledOutis not True (PartialRollout), which differs from point (2) of the #683 entry, where a check neither opens nor resets the window untilRolledOutis True. (3) The name derived from the failed UID prevents two reverts at the same time only, not a new one after a revert is deleted; the proposer (second part) must cover it. Section 7 changed too: a restart of the executor no longer "loses nothing" (see the next entry). - 2026-11-13: #96, first part, the executor's window after a restart (decided 2026-11-13, no API change). A check whose status write fails keeps its reset in memory and the next check applies it again, but a restart or a leader change between the two loses it, and the stored window could then end a request across the bad interval. So no window counts time from before the executor process began reconciling: the span of the executor's window runs from the later of the stored
windowStartand that moment, taken once on the executor's clock when the manager wins leader election (on a standby that becomes leader later, that moment, not its start; a check that runs first takes its own time, which is later). This holds for every end fromVerifyingthat a window decides:SucceededandCheckNotAvailableof a Deployment or StatefulSet, theClearingNotCheckedandCheckNotAvailableends of a ScaledObject, andRevertApplied; so it also changes theClearedpath built in #683, and replaces section 4's "a restart of the executor forgets the counter and delays success by one check" with a full window. The storedwindowStartis never rewritten for it (CEL keeps it forward only, and no write is made), and a closed window stays closed. Cost: after a restart or a leader change every open window needs a full effectivestableFor(plus--node-gracefor pods) again, so a request whose timeout comes sooner ends at the timeoutInconclusivewith the last reset of its windows (EvidenceMissingwithout one,ClearingNotCheckedfor a ScaledObject), neverSucceededand neverFailedfor this; an executor that keeps restarting ends no verification before the timeout, which is the fail-closed side. Both times are the executor's; one written by an earlier leader on another node is compared with this process's clock as the span already did before, and taking the later of the two can only shorten a span. The kept reset is bound to the request's UID and dropped when the request is seen ended, so a request that reuses a name never inherits it. Known limit: the kept reset lives in one process, so two executors reconciling at once without leader election can end a window across a reset whose write one of them lost; the chart runs the executor with leader election, and running it without is not supported. - 2026-11-13: rollback from v0.5.0 (#705, decided 2026-11-13). The CEL rules on
status.mergeReceipt,status.mergeCommitAwaitedSince,status.verificationandstatus.queuedBehindstay, and so does the rule that onlystatus.verification.incidentCountmay be removed. They reject a status write that omits a stored value, so a v0.4.x executor image cannot write request status against the v0.5.0 CRD, and an older executor drops fields it does not know. v0.5.0 is therefore marked as a breaking change for rollback (aBREAKING CHANGE:footer for the release notes), which does not make it a major release before 1.0. A rollback goes through the whole chart, CRDs included, which prunes those fields from the stored requests; the steps are in upgrade and uninstall. No API or code change. - 2026-11-13: #684 is built:
status.verification.incidentCount(atMerge,atApplied, each{uid, count, readAt}, set once by CEL,atAppliedonly withatMerge), the two readings with the executor's existinggeton the Incident, andResolvedBeforeRolloutonClearedby the rule of section 4, with the minimum span of point 6. Decided beyond the text: (1)atMergetakes its time after the read, rounded up to the second, andatAppliedbefore the read, rounded down, so the recorded span is never longer than the span the two counts cover. (2)atMergeis taken only in the reconcile that writes the merge receipt and setsMerged; when that read fails no later reconcile takes it (decided 2026-11-13), since a late reading could follow the change and make the quiet span include time after the fix. This also keeps the Incident read out of the reconciles inWaitingForDelivery, so it never adds a status write before the delivery check. (3) A count outside 0 to 1000000 or an Incident without a UID gives no reading, since the schema would refuse the status write that carries it; a reading of another UID is recorded as read and refused by the rule. (4) The readings are also taken where the rollout report of #532 recordsappliedObservedAt(--verify-outcomesoff). (5)Verifiedand the Normal Event keepNoRecurrence; onlyClearedcarries the new reason, and its message says the change is not shown to be the cause. (6) The aggregation window is shared throughinternal/incidents/aggregation(DefaultWindow), whichinternal/incidentsuses too; the executor does not importinternal/incidents, whose init registers the analyzer's metrics. Phase, circuit breaker and the window logic are unchanged. - 2026-11-13: #684, decided beyond the text after review (decided 2026-11-13). (1) A reading of
status.verification.incidentCountmay be removed but never changed: the rules no longer reject a status write without it, so an executor rolled back to a release that predates the field, which drops it in its typed status write, can still deliver and end the request. Safe becauseatMergeis taken only in the write that setsMergedandatAppliedonly withappliedObservedAt, so a removed reading is never taken again and the reason staysNoRecurrence. (2)atAppliedis taken only by the process that tookatMerge, which keeps that fact in memory, so the span is measured on one clock; two leaders with clocks that disagree could otherwise show a span that proves nothing. Cost: after a restart or a change of leader between the merge and the applied time the reason is alwaysNoRecurrence. (3) The read of the Incident is taken only when the step's deadline leaves the read's own timeout plus one minute (the API server's default request timeout), so it never shortens the status write it rides with; with less left the reading stays absent. - 2026-11-13: #96, second part, is built: the analyzer's deterministic revert proposer (section 8), package
internal/analyzer/revert, which calls no model and imports nothing of the analysis loop or the model providers, while the analysis loop imports nothing of it (tests check both). For a request in the operator namespace that endedFailedwithVerifiedFalse, is not a revert and is not being deleted, it reads the request, its Incident and its target live, records its decision in the new Incident status fieldstatus.revertsProposed, and creates the revert namedRevertNameof the failed UID. The revert's action comes fromInverseActioninapi/v1alpha1, which the executor's link check now compares against too (IsInverseAction), so the two cannot drift. The record is on the Incident because the analyzer already holdsupdateonincidents/statusand the request's status belongs to the executor alone; no grant is added, and the proposer watches requests through the informer the analyzer already has. Its Warning events use the core Events grant the analyzer's leader election Role already holds in the operator namespace. No revert is made for any other phase or condition (Inconclusiveincluded), for a revert, when the Incident is gone or has another UID (a Warning eventRevertNotProposedon the failed request says so), when the target is not found, has another UID, is being deleted, is of a kind the action cannot target (it is not read then) or the analyzer may not read it (Forbidden, logged, no retry; changed on 2026-11-14: retried until the age bound, see the last entry), or when the action cannot be inverted (an unknown type, a missing member, values missing, not positive or equal). A create whose name exists is success only when the existing request'sspec.revertsnames the same request and UID; any other is a terminal error (no retry with backoff) with a Warning eventRevertNameTaken, and the object is left as it is (changed on 2026-11-14: the entry moves toAbandoned, see the next entry). Any other failed read or write is an error retried with backoff, never "gone". The Incident is left as the closure rules put it (design 3.2:EscalatedwithRequestFailedonce the failed request is the newest); the revert names the same Incident, keeps it where it is while active, and starts no analysis (anEscalatedIncident is never claimed). Decided beyond the text: (1) two steps in the record: an entry{name, uid, state: Pending}is written before the create, and moved toCreatedafter it; an entry in either state means no new decision:Pendingleads to the (idempotent) create and the move, also when the request has since passed the age bound or the list filled up (changed on 2026-11-14: only the full list still does not stop it, see the next entry), andCreatedleads to nothing, also after the revert was deleted (one revert per failure for good). CEL keeps the list append-only (no entry removed, matched by name and UID (the UID is the list's map key)) and lets a state move only fromPendingtoCreated, while the status has any other field, as every Incident status the analyzer writes has (changed on 2026-11-14: also toAbandoned, and the status cannot be removed). Known limits: (a) the create succeeded, the move toCreatedwas not written (a crash or a failed write), and a person deleted the revert before the retry; the retry findsPendingand creates the revert once more. (b) Two analyzers running at once without leader election: one reads the entry asPendingright before its create, the other creates the revert and moves the entry toCreated, and the revert is deleted, all between that read and that create; the first then creates the revert once more. © A create that returns an error although the API server goes on to store the revert (a timeout on the way back): if the failed request is deleted before the retry, the settlement finds neither the request nor the revert and moves the entry toAbandonedwithRequestGone, and the revert appears afterwards. The executor refuses that revert, because the request it reverts is gone, and a person closes it. The chart always runs the analyzer with leader election, so only an install that turns it off and runs more than one replica meets this. (2) At most 20 entries. When no entry can be added, no revert is created (the check comes before the create, in thePendingwrite), the Incident gets the conditionRevertsStopped(True, reasonRevertListFull) and one Warning eventRevertListFull, and nothing is retried; a person decides on that Incident's other failed requests. (3) A revert is proposed only when the request'sVerifiedcondition moved to False at most 24 hours ago, so a start-up (or an upgrade to this version) does not revert every old failure; an older one is logged and left to a person, with no event. That time is written by the executor's clock and compared with the analyzer's, so the bound is coarse on purpose. (4) No revert without its Incident, since the record lives there. (5) The revert copies the failed request'stimeoutandstableForand none of its extra checks (a revert is never checked for clearing), and its mode isGitOps, its policy the failed request's. (6) The proposer runs whether a triage model is set or not: it needs no model. (7) The other writers of Incident status in the analyzer (the analysis controller and the Incident controller) write the whole status withUpdateon the resourceVersion they read; a write from a copy read before the proposer's gets a conflict and is done again from a fresh read (tests check both controllers), and one that dropped entries on the current resourceVersion is refused by CEL. (8)kubectl shadewright explainshowsReverted byon a failed request its Incident records asCreated. Still open: the policy rule for the decrease of a revert (the fourth point for the maintainer), so a revert of a memory increase still endsDeniedwithDecreaseNotAllowedand the person reverts by hand. - 2026-11-14: #96, second part, after review (decided 2026-11-14). (1) A
Pendingentry keeps the decision that no second revert is proposed for that failure, not the decision that this revert must be created. Every create, the first or a retried one, runs the same checks first: the age bound, the Incident not being deleted, and the target there (not found, another UID, being deleted, a kind the API server no longer serves such as a KEDAScaledObjectafter KEDA was removed, orForbidden, which the next entry changes to a retry). A full list is checked only for a new decision, since aPendingentry is already in it. (2) When a check says no, the entry moves to a third state,Abandoned, which is final: no revert is made for that failure, and one Warning eventRevertAbandonedon the failed request says why. The same happens when the revert's name is taken by a request with another link (no longer a terminal error withRevertNameTaken), when the API server refuses the create as invalid (no longer retried for ever), and when the failed request is deleted after thePendingwrite or is being deleted (the event is then on the Incident when the request is gone; the proposer watches failed requests also while and after they are deleted, and lists the Incidents live with the analyzer's existinglistto find the entry). SoPendingalways means that a create is still coming. (3) CEL: a state moves only fromPendingtoCreatedorAbandoned;CreatedandAbandonednever move. A rule on the Incident's root refuses removing the whole status whilestatus.revertsProposedhas entries, which the rule on the optional status object cannot see; no writer of Incident status removes it (each reads, changes and writes it back), and an upgrade keeps it. (4) Right before the create the proposer reads the Incident again and creates nothing when the entry is no longerPending, so a pass that readPendingwhile another one finished and the revert was deleted does not make a second one; what remains needs two analyzers without leader election (known limit (b) above). (5) AVerifiedtransition time more than five minutes ahead of the analyzer's clock gives no revert and one log line, so a clock far ahead cannot pass the age bound. (6) A terminating Incident gets no revert, as the package says. - 2026-11-14: #96, second part, after a second review (decided 2026-11-14). (1) A
Pendingentry is settled from the Incident's side too. A second controller of the proposer watches the Incidents of the operator namespace that have aPendingentry, so it runs for each of them when the analyzer starts leading (the informer's first list) and whenever one changes. It reads each such entry's request live: gone, or its name now held by a request with another UID, settles the entry as in point (2). This covers a request deleted while no analyzer was leading, and a name reused by a new request, for which no event about the old request comes again. No grant is added: the watch uses thelistandwatchon Incidents the analyzer already holds, and the requests are read with itsget. (2) What exists decides before the checks. For aPendingentry the proposer first reads the revert's name: a revert there whosespec.revertsnames the failed request by name and UID is a create that happened while its move toCreatedwas lost, and the entry moves toCreatedwhatever the checks say now (target gone, age bound passed, request deleted). The checks guard only a create that has not happened. The last read of the Incident before the create also stops at a deletion: the entry moves toAbandoned. (3) A target read refused asForbiddenis no longer final. On AKS with Azure RBAC an authorization webhook that fails also answers 403, so the read is retried with the controller's backoff while the 24 hour bound lasts; then the age check moves aPendingentry toAbandoned(OutsideAgeBound), and a new decision records nothing. Not found and a kind no longer served stay final at once. (4) AnAbandonedentry records why in areason, a closed enum:TargetGone,TargetKindUnsupported,OutsideAgeBound,IncidentDeleting,RequestGone,NameTaken,CreateInvalid. CEL sets it exactly withAbandonedand never lets it change, and accepts a new entry only asPending(a rule on the root, so the first status write is covered too). The Warning event, which expires after about an hour, names the reason; for a create refused as invalid it carries a fixed sentence and the API server's error goes to the log only.kubectl shadewright explainshows the state, reason and revert name of a failed request's entry, and lists every entry of an Incident, also those of requests that no longer exist; this replaces the Reverted by line of the first entry. - 2026-11-14: #96, second part, after a third review (decided 2026-11-14). (1) The proposer's two controllers share one lock per Incident (by namespaced name). The create path holds it from its last read of the Incident through the create and the move to
Created; the settlement from the Incident's side holds it for its whole pass over that Incident. Before, a settlement could run between that last read and the create: it found neither the deleted request nor a revert and wroteAbandoned(RequestGone), and the create then made a revert whose entry saidAbandonedfor good. No lock is held across a requeue or the controller's backoff, and a lock is dropped once no pass holds or waits for it. A move toCreatedthat finds the entryAbandonedwhile the revert exists is not repaired (Abandonedis final) but logged as an error, with a Warning eventRevertAbandonedButMadeon the Incident. (2) APendingentry whose request is there with its UID but no longer endedFailedwithVerifiedFalse, or whose action can no longer be inverted, is settled from the Incident's side asAbandonedwith the new reasonNotRevertible; the request's own pass returns without a revert for such a request and settled nothing. A request being deleted is settled there too, withRequestGone. (3) A read or write error on one entry, or one Incident, of a settlement no longer stops the others: they are settled, and the first error is returned for a retry. Known limits: the lock lives in one process and does not help two analyzers running without leader election (known limit (b) above); and a read or a write that fails for ever (the API server unavailable, a conflict that does not settle) keeps an entryPending, retried with backoff and named in the analyzer's log. - 2026-11-14: #199 adds the reason
StalePlanMergedto section 5 (decided 2026-11-14). When the Git host refuses for good to close a stale plan's recorded pull request, the request keeps watching it, and a merge by a person recordsMergedwithPlanFreshFalseand the stale reason kept; so does a merge before the close (the mark, once written, is removed only by the request's end as a closed stale plan). That request goes through delivery and verification like any merge, so a bad effect is still seen:FailedstaysFailed, counts for the circuit breaker and gets a revert proposed (section 8). The rule: where a plan that is not stale would end in a state the circuit breaker counts as a success, a stale one endsInconclusivewithStalePlanMerged; every other end is the same. So where it would endSucceeded, or, with--verify-outcomesoff, keepMergedonce its rollout report of #532 is final, good or bad, or the check does not run (RolledOutkeeps saying what the rollout did), it endsInconclusivewithStalePlanMerged, and the breaker and the Incident's closure read it like any otherInconclusive(no new breaker rule). One function decides the cap where the final outcome is written, fromPlanFreshon the request alone. The circuit breaker reads aMergedrequest that carries the stale mark as no outcome at once (as a merge without a receipt), so the time from the merge until the cap is written never counts as a success. - 2026-11-14: #720, a revert's pull request says what it is (section 8). Its title is
revert: set <what> of <namespace>/<name> back to <value>. Its body names the failed request (name and UID fromspec.reverts), that request's pull request (the number only, which the code host links; the URL in its status is left out) and the reason of itsVerifiedcondition, all read from the API server with the UID inspec.reverts, and no model text; a request that is gone or has another UID is named fromspec.revertsalone. Its Rollback line says that reverting it applies the failed value again, and that closing it unmerged keeps the current value. The revert's ownnamespace/nameis kept out of the redactor only when its name isRevertNameof the UID in its ownspec.reverts(revert-and 24 hex digits of a SHA-256 ofrevert/and that UID), a value no author of cluster content can steer, and with a namespace the redactor leaves unchanged; the request it reverts is kept by the rule for any request. The read of the reverted request has its own deadline (the executor's Incident read timeout, at most half of what the step has left), and a failed read, that deadline included, is retried: no pull request is opened or rewritten without the paragraph on what it reverts. The branch and the marker do not change. - 2026-11-14: sections 2 and 3 and the consequences say that KEDA requests cannot succeed "until metrics are evidence (#508, #506)". Those two issues now cover sizing from metrics and the evidence in the pull request only (ADR-0040, Accepted). Metrics as verification evidence moved to #741, which is what "until metrics are evidence" now waits for. No decision of this ADR changes.
- 2026-11-15: #715 is built: section 4 gains "Stopped before the merge". A request whose pull request waits for review is marked when its Incident's count has not changed for an hour on one executor process's clock: condition
IncidentStopped(reasonIncidentCountUnchanged),status.pullRequest.incidentStopped(the source of the mark) and at most one EventIncidentStopped. A later read of another count, or an Incident that is gone or made again with another UID, removes the mark. Nothing is closed, the phase staysAwaitingApprovaland the pull request stays open (decided 2026-11-15). A failed read and a paused executor decide nothing; a lasting symptom state is never marked. The quiet time and the rule for lasting states moved tointernal/incidents/quiet, shared by the analyzer's closure rules and the executor, with no change to either. No new RBAC. No other decision of this ADR changed. - 2026-11-16: #771, decided on the issue the same day. After the target branch of the plan's repository changed in the settings, a person may move the open pull request to the new branch and merge it there. The executor then reads the recorded pull request by its number on the branch the settings name now as well as on the recorded one, and a merge into the newly configured branch counts when it has the recorded number, the head Shadewright pushed and the request's marker. It is recorded
Mergedwith a receipt whosetargetBranchis that branch, the branch the pull request merged into, notstatus.source.targetBranch, so delivery is asked about the branch the merge went into, with--verify-outcomeson or off. The plan is stale (SettingsChanged), so the request endsInconclusivewithStalePlanMergedat best and the circuit breaker counts no failure. A merge into the recorded branch is recorded as since #754 and ends the same way, with a receipt naming that branch. Only a merge into a third branch, neither the recorded nor the newly configured one, is not recorded, and the request stops inNeedsInterventionwithTargetBranchChangedas before. No other decision of this ADR changed. - 2026-11-16: #771, an addition decided on the issue the same day: the merge is recorded whenever it happens, and only when it carries the planned change alone. A request stopped in
NeedsInterventionwithTargetBranchChangedkeeps the target lock while its pull request is open on the recorded or the newly configured branch; the look that settles the lock reads the pull request by its number on both, and a merge that counts moves the request fromNeedsInterventiontoMergedwith its receipt and on toInconclusivewithStalePlanMerged. A close without a merge releases the lock and the request stays as it is. A merge into the newly configured branch counts only when the merge commit, compared with its first parent on that branch, changes the plan's file alone and exactly as planned, with the head Shadewright pushed as its second parent or holding only Shadewright's commits over that branch. Otherwise the request endsNeedsInterventionwithMergedWithForeignChange: no receipt (section 1), so no verification, no circuit breaker outcome and no revert proposal. With--verify-outcomesoff, a receipt whose repository entry is gone names that cause in conditionDeliveredwhile the check waits and in its final message, as with the flag on. No other decision of this ADR changed. - 2026-11-17: #771, final rule of the retargeted merge, replacing the 2026-11-16 additions where they differ. (1) The merge into the newly configured branch is compared as a whole with that branch's head right before the merge, for every merge method, not the merge result with its own parent: a rebase merge replays every commit the head carries, so its last commit alone could hold the planned change on top of a replayed commit of the old branch that changes the plan's own file. The head before the merge is the first parent of a merge commit (whose second parent must be the head Shadewright pushed). For a squash or rebase merge it is the commit as many first parents back from the merge result as the head carries commits the merge result's history lacks, and each commit the walk passes must replay the head's commit at the same depth. A squash merge of several commits is refused at the walk when its real parent is no such replay; when the walk passes a commit of the branch that does replay the head's file (an old-branch commit picked onto the new branch), the comparison starts below the merge and covers that commit too, and the comparison as a whole refuses unless it is part of the planned change, so a squash fails closed either way. A shape that does not show it fails closed (
MergedWithForeignChange). (2) Reads of what the merge brought get their own wait of five minutes, an entry of kindMergeContentinstatus.gitWaitsthat names the pull request it reads (third decision of 2026-11-17); a successful content read removes it, and a later failure starts a fresh window. Reads that still fail at its end giveNeedsInterventionwithMergeContentUnreadable: no receipt, no circuit breaker outcome, no revert proposal. This replaces the earlier "set once" clock and the release of the lock "as forMergedWithForeignChange": for these two stops and every other,settleTargetLockdecides the lock. It lists the recorded and the configured branch and releases a stopped request, after verification or a foreign merge too, only when no other open pull request of its branch can still deliver the change; one that can keeps the lock. The release is enforced by structure:releasetakes a settlement verdict that only its proving read can build (the merge recorded, the pull request proven closed or gone with the #688 confirmation, or no pull request ever opened, proven by the marker search), and nothing else frees the lock. A merge found before the status records it, for any stop, is recorded first as a stale plan's merge, except on a request handing its pull request over, where the handoff decides. A pull request found by its marker after a lost status write gets a receipt only when a read of the recorded branch shows its head is the commit Shadewright pushed (the planned change on the planned parent); the marker alone proves nothing, and any other head givesMergedWithForeignChange. (3) A failed Git read is turned into a wait where it happens: the path that made the read callsretryGitReadwith a bound of its own type (the kind of wait, a time to pace by, or no bound with its reason). The wait is recorded state: a set of entries,status.gitWaits, one per kind, each with its start on the executor's clock and whole (the content wait with its pull request), so starting or ending one kind never touches another; the merge wait's clockstatus.mergeCommitAwaitedSince; andGitReadRetry, a summary for people with the reason of the entry that ends first. One check at the start of every reconcile computes each kind's end from that state and ends every entry past it before any read or step runs, so no timeout or early return in a step skips the end; an entry past its end always ends, as a failure with its reason when something its end needs is missing (the content wait records the pull request it names), never as an error that repeats; call sites only start or continue a wait. The wait is the poll interval, or a longerRetry-After, never past the end; a wait whose status write fails is retried as a Kubernetes error. The delivery check's reads are bounded by the end of its window, then of its grace, with--verify-outcomeson and off, and the content reads bymergeContentWait.GitReadRetrynames the operation, the kind of wait and its start. A Kubernetes error, also right after a failed read, goes to the error backoff unchanged. A request stopped withTargetBranchChangedby a step (reason onApproved) is treated as one stopped by the freshness check (reason onPlanFresh). The cancel side is in ADR-0039 points 21 and 22. Strongest alternative not taken: record a retargeted merge only asNeedsInterventionevidence with no receipt, and let a new request plan against the new branch. It is simpler and cannot record a wrong merge, but the person who merged the planned change would see no outcome, no verification of that change and no circuit breaker input, and the executor would ask for a second request for a change already delivered. No other decision of this ADR changed. - 2026-11-18: #771, fourth decision on the issue the same day. (1) Every status clock that bounds a Git wait is an entry of
status.gitWaits, and the entry records its own end (ends) when it is built: the deadline forRequestDeadline, the deadline plus the grace forHandoffGrace, five minutes after its own start forMergeCheck(not afterstatus.mergeCommitAwaitedSince, when the merge was first seen, as this entry first said; corrected with the ninth decision below), which now names its pull request, base branch and merge commit asMergeContentdoes, and five minutes after its start forMergeContent. The API server refuses a bounded entry without its end, aPacedone with one, and an end that moves. A test lists the time fields of the status and fails on one that is neither an entry nor listed with the test that proves its wait ends, or why it bounds none. (2) Ending a wait that passed reads nothing from the Git host and cannot be retried: the check at the merge records the merge from the entry (with a receipt only when it names a full merge commit), and a deadline whose cleanup cannot reach the Git host endsExpiredwithPullRequestDeadline, keeping the lock, with a message that a pull request may have been left open. (3) A write of the entries never leaves the caller with a copy that is part newer read, part older cache. (4) The operation an entry names is cut to the schema's bound where the entry is built, so a wait for the longest branch name and path is always recorded. (5) A recorded merge with its receipt releases the lock inMergedorInconclusivewithout a read of the branch (widened by the ninth decision below, point 5, to every merge the status records, and narrowed again by the tenth); the release verdict is a sealed type in its own package, and a nil or empty verdict is an error. Known limits: a Git host outage longer thanmergeContentWaitendsMergeContentUnreadablefor good, also for a merge that brought the planned change alone; and a squash merge of a head of several commits (as a head moved by reviewer-hint fast-forwards carries) into the newly configured branch endsMergedWithForeignChange: the walk refuses it when its real parent is no replay of the head's commit, and when the walk passes a branch commit that replays the head's file (an old-branch commit picked onto the new branch), the comparison as a whole refuses it. Alternative not taken: keep the merge wait's end computed fromstatus.mergeCommitAwaitedSinceand the content wait's from its start at each reconcile. It needs no schema change, but the end then depends on which fields a reconcile happens to read, and the sequences the decision names (a deadline passing while the repository cannot be opened, a merge without its commit while reads fail, a receipt with the repository gone, a stale copy written back, a long branch name) each kept a wait or the lock past its bound. No other decision of this ADR changed. - 2026-11-18: #771, fifth and sixth decisions on the issue the same day (the sixth withdrew the fifth decision's points 1 and 2, a pause that stops Git writes only and a passed wait that ends under a pause). (1) A pause of the kill switch stops what it stops on
main. ADR-0021 says an amendment never widens what is allowed, granted or refused on its own authority; the comparison withmain, path by path, is how this entry shows that it widens nothing: what the branch does differently under a pause only holds more, and it holds more thanmainin two places, both reads of the Git host new on this branch: the cancel watch after a change of the target branch, and the look of a stopped holder on two branches (the complete list after the eighth decision is in its entry below). Both wait for the pause and showWritesPaused. Every Git write, the look at a recorded pull request and the end of every Git wait (the request deadline among them) wait for it, and nothing is read from the Git host for a request before its merge. (2) The end of a wait past its bound reads nothing from the Git host: a request past its deadline endsExpiredin one status write, and the close of a pull request it may have opened is the step after it, which records a merge it finds as the request's own merge, never as a stale plan's. A close there that keeps failing is bounded as the cleanup of a deleted request is (conditionCleanupFailing, 24 hours, thenPullRequestDeadlineCleanupFailed), and anExpiredrequest whose merge cannot be checked at the merge yet keeps its phase: it leavesExpiredonly for the record of the merge, never back toPRCreated. (3) A cancel on a request whose target branch changed settles like any other stop: the cancel watch reads the pull request, read-only, on the recorded and the configured branch; closed or gone ends itCancelledand releases the lock, merged is recorded as decided on 2026-11-16, open keeps the watch. The cancel side is in the 2026-11-18 entry of ADR-0039. (4) A merge whose file before it the typed patcher refuses is not reported asMergedWithForeignChange: it endsMergeNotCheckable, with the same consequences (no receipt, no verification, no circuit breaker outcome, no revert proposal). (5) The generated test of 2026-11-17 has the pause as an event: while paused no call reaches the Git host and no phase of a request before its merge changes. (6) Seventh decision, the same day: (a) as onmain, the pause does not hold the release of a lock that the recorded status proves (a merge with its receipt), and a request past its merge goes on to its delivery check; (b) (replaced by the eighth decision below, which was replaced in turn by the ninth) time paused counts against the request deadline and the handoff grace, as onmain, and against nothing else: a wait for a read (MergeCheck,MergeContent) that a pause overlapped starts again at the first reconcile after the lift, with its full window (the entry is removed and recorded again, so its end never moves; aMergeCheckentry counts from its own start, no longer fromstatus.mergeCommitAwaitedSince), so it never ends without a read after the pause and its message never blames reads that were not made; © after a lift, settlement may take more than one reconcile, but every reconcile that leaves a stopped holder with its lock asks to run again at a time, and the generated test asserts that and that the lock is free within three reconciles of a lift with reads working; (d) the 24 hour cutoff of the cleanup afterExpiredis checked before any read, so failing reads cannot keep the cleanup from endingPullRequestDeadlineCleanupFailed(since the ninth decision, past the cutoff one more close is tried first). Alternative not taken: a pause that stops Git writes only, with reads, settlement, merge records,Expiredends and verification going on (built as the fifth decision and withdrawn). It would settle a stopped holder's target a few minutes sooner, but an operator pulls the pause when the executor settles or records something wrongly, so a pause that lets those go on does not stop what it was pulled for, and the only full stop left would be removing the App or scaling the executor to zero. While writes are paused no request can open a pull request, so a target that stays locked for the pause blocks nobody. No other decision of this ADR changed. - 2026-11-18: #771, eighth decision on the issue the same day, replacing point (6)(b) of the entry above. Its points (1) and (2) and its list of what the branch holds more than
mainare replaced by the ninth decision below, and its point (3) is restated there (point 5);status.pauseSeenand the paused-time baselines it added were removed before any release. (1) Paused time stretches the bound of a wait for a read of the Git host instead of starting it again. The request records the paused time its reconciles saw instatus.pauseSeen, in the shape of the delivery window'sstatus.rollout.pausedSinceandpausedSeconds: the first reconcile that sees writes paused recordspausedSince, the first that sees them resumed adds the seconds topausedSecondsand clears it, in one patch. AMergeCheckorMergeContententry ofstatus.gitWaitsrecords the paused time seen at its start (pausedSecondsAtStart) and ends at its recorded end plus the paused time seen since; the cleanup afterExpiredrecords it with conditionCleanupFailingand ends 24 hours after that condition plus the paused time seen since. The entry is never dropped and recorded again for a pause, and the validation rule still keeps its start, its end (and now its paused time at the start) while it stands, so there is one write and nothing to lose, and a wait ends after its bound of time not paused however often a pause comes and goes. The request deadline and the handoff grace count paused time, as onmain. A pause that begins and ends between two reconciles of the request took no read away and stretches nothing. (2) Nothing new ends during a pause: the cutoff of the cleanup afterExpiredwaits for the pause like the close it bounds, and a pause still running keeps stretching it and the read waits. (3) A recorded merge releases the target lock from recorded status, assettleLockdid onmain: inMerged,Succeeded,Inconclusive, andFailedwith its receipt, with or without a receipt, through a verdict built from that status alone (lockverdict.RecordedMerge), in the status write that records the merge or ends the verification, under a pause and with the repository gone from the settings too. A merged request held for its verification keeps the lock as onmainuntil the verification ends. (4) The generated test loses or applies and reports failed a status write at a pause and at a lift, lets the pause come and go at every event while a merge waits for its commit or for reads of its content, and checks that a recorded merge holds no lock; each defect of this decision fails it in the short seed range on the build before the fix, and named tests cover a pause that comes and goes every half minute for an hour, a pause longer than the wait, and the cutoff of the cleanup under a pause. The complete list of what the branch holds more thanmainunder a pause, after this decision: the cancel watch after a change of the target branch and the look of a stopped holder on two branches (reads new on this branch), theMergeCheckwait (paused time counts against the wait for the merge commit onmain; here it stretches it), and theMergeContentwait and the cutoff of the cleanup afterExpired(both new on this branch, both stretched, the cutoff also waiting for the pause). Nothing is released or ended under a pause thatmainholds. Alternative not taken: dropping a read wait at the lift and recording it again with its full window (point (6)(b) above, built and replaced): the second of its two writes could be lost, which left no wait and a merge never recorded, and a pause that came and went faster than the wait kept it open without end. No other decision of this ADR changed. - 2026-11-18: #771, ninth decision on the issue the same day, replacing points (1) and (2) of the eighth. (1) A wait for a read of the Git host (
MergeCheck,MergeContentinstatus.gitWaits) ends only after one read made after its end has passed. At the reconcile that finds the end passed, the reads are made once more as in any other reconcile: an answer goes on as after any read (a merge commit reported records the merge with its receipt), and a failure ends the wait there, as a failure, with no retry:MergeCheckrecords the merge with the plan not shown fresh and without a receipt when no merge commit was seen,MergeContentendsNeedsInterventionwithMergeContentUnreadable, each with a message that says the read after the wait failed. One end makes no last Git read, as onmain: a check at the merge that fails for a reason other than a Git read (the target cannot be read from the cluster, for example) past the end of the wait records the merge with the plan marked not shown fresh (mergeCheckFailed). A read that cannot start (the repository left the settings or cannot be opened) is a failed last read; a failed read or write of the Kubernetes API is no Git read and goes to the error backoff, so the next reconcile reads once more. Under a pause no read is made and nothing ends. This holds whatever kept the executor from reading: a pause, a restart, a leader change, an executor scaled to zero. AMergeCheckentry counts from its own start, never fromstatus.mergeCommitAwaitedSince. (2) The cleanup afterExpiredends the same way: past its 24 hours one more close is tried, not during a pause; if it fails (the close, or the read of the branch it starts with), the cleanup ends withPullRequestDeadlineCleanupFailed; if it works, conditionCleanupFailinggoes and the next look settles the lock. (3) The request deadline and the handoff grace end with no read, as the fourth decision (point 2) decided: they bound waiting for a person or another executor, not a read, and count paused time as onmain. (4)status.pauseSeen,pausedSecondsAtStartof the entries andcleanupPausedSecondsAtStartare removed; they were never onmainor in a release. (5) (Narrowed by the tenth decision below: the two stops named here keep the rule of 2026-11-17.) A recorded merge releases the target lock from recorded status by what is recorded, asmain'ssettleLocktold it (prMayBeOpen,closedOnly): a phase after the merge (Merged,WaitingForDelivery,Verifying,Succeeded,Inconclusive),Failedwith its receipt, or, in any phase butSuperseded, the recorded pull request marked merged (PullRequestOpenedwith reasonChangeRequestMerged), so a request that endedNeedsInterventionwithMergedWithForeignChangeorMergeContentUnreadablefrees its target too, under a pause and with the repository gone from the settings. A test compares the verdict (lockverdict.RecordedMerge) withmain's rule over the phases, recorded pull request, reasons, receipt, plan and verification it lists. A request held for its verification keeps the lock until the verification ends, as onmain: a recorded merge frees its target in the write that records it, or, with--verify-outcomeson, in the write that ends its verification. (6) The generated test stops the executor for longer than a wait (no reconcile at all, then a new process) as an event, next to the pause, and checks that a reconcile not paused that starts with a read wait past its end leaves none standing and called the Git host when it ended one; its short seed range fails when the last read is removed (the wait ends with no read) and when a failed last read is turned into a retry. What the branch holds more thanmainunder a pause, complete after this decision: the cancel watch after a change of the target branch and the look of a stopped holder on two branches (reads new on this branch), and theMergeContentwait and the cutoff of the cleanup afterExpired(both new on this branch); each waits for the pause and showsWritesPaused. TheMergeCheckwait holds as onmain, where the wait for the merge commit ended only in the look at the pull request, which a pause holds. Nothing is released or ended under a pause thatmainholds. Alternative not taken: keep the recorded paused time of the eighth decision. It covers only a pause that a reconcile of the request saw: an executor that was down, a leader change or an executor scaled to zero still let a read wait end at the first reconcile without any read, wheremainread first; it added a status field for good and two writes per pause and request; and counting in whole seconds drifts over many short pauses. The last read needs no new state and covers every cause. No other decision of this ADR changed. - 2026-11-18: #771, tenth decision on the issue the same day, narrowing point (5) of the ninth; the rest of the ninth stands. (1) A wait for a read (
MergeCheck,MergeContent) ends only on evidence about its last read, gathered in the reconcile that made it: the read failed (retryGitReadnotes it and records no retry; a read answered with a rate limit is a failed last read), it provably could not start (the repository of the plan is not in the settings or its entry there cannot be used:setUnreadable,planEntry; amended 2026-11-19, #884: also the close of a cancel and of a stale plan's cleanup,closeOwn, where the missing note left a wait standing without end; amended 2026-11-19, #923: also the recovery of a cancelled replacement's handoff once the plan's repository entry names another target branch,cancelRecoveryFailed, where no read is started by design (the recovery reads only through the entry), for the same reason; alternative not taken: let the recovery read the pull request through the recorded target branch, read-only, as the cancel look does, so that a merge seen there is recorded with its receipt. That would add a second path that decides the recovery of a handoff, through a provider the recovery does not open today, for a sequence that needs a handoff, a merge without a merge commit ID, a pause, a cancel and a change of the target branch together; the note bounds the wait, and the merge stays visible asNeedsInterventionwithout a receipt), or it answered with answers that agree and settled nothing. The message of the end says which of the three it was. A reconcile that met a pause at any point (waitWhilePausedmarks it, and the settings are read once more after the reads), whose answers disagreed (a pull request missing by its number that its branch does not confirm; past the end of the wait this ends it since the eleventh decision below), or whose path read nothing keeps the wait and runs again after at least a second and at most the poll interval. From the recorded end of a wait to its actual end it therefore takes, at worst, until the next reconcile not under a pause (the requeue is never later than the end, so that is the end itself unless the executor is down or paused) plus that reconcile's read, and then one more reconcile per poll interval for as long as the answers disagree or a pause meets the reconcile; the entry and conditionGitReadRetryshow the wait meanwhile. (2) Every stopped request with an open wait for a read makes that read, whether or not it still holds its lock (checkHeld), so a merge commit reported in the meantime still gets its receipt. (3) The lock by kind of merge. A merge the status records as delivering the plan (a phase after the merge,Failedwith its receipt, or the pull request marked merged, with or without a receipt, verification excepted) releases from recorded status, as onmainand as the ninth decision said. A merge that did not deliver the plan as shown (MergedWithForeignChange,MergeContentUnreadable, andMergeNotCheckablesince the eleventh decision below), and a merge marked merged whose wait for a read is still open, are left out of that verdict: they release only after a read shows that no other open pull request of the branch can still deliver the change, the rule of 2026-11-17, whose sentence onsettleTargetLockstands for these stops. Under a pause that read waits. With the repository gone from the settings the read cannot start and the lock is released (lockverdict.UndeliveredRepositoryGone); what that gives up is a second open pull request of the branch that Shadewright can no longer see, which may still merge into the target after another request took the lock. (4) A superseded request whose handoff completed (handoff.to.phaseDone) and whose pull request is marked merged releases as onmain, whereclosedOnlylet it through; the comparison test withmain's rule varies the handoff too, and statesmain's rule less the two stops by name. (5) What a pause holds. Before the merge nothing ends during a pause. After a merge, delivery and verification go on during a pause as onmainand can end a request; only the delivery window is extended by the paused time. What the branch holds more thanmainunder a pause, complete after this decision: the cancel watch after a change of the target branch and the look of a stopped holder on two branches (reads new on this branch), theMergeContentwait and the cutoff of the cleanup afterExpired(waits new on this branch), and the lock of a merge that did not deliver the plan as shown, whichmainreleased from status. The third costs no request anything: while writes are paused no request can open a pull request, so nothing is waiting for that target, and the lock settles at the reads after the lift. The generated test has a focus for this decision (a stopped request whose pull request a person moves to the configured branch and merges there, with or without its commit, then a pause that comes and goes inside one reconcile, answers that disagree, or the commit reported) and checks that a wait never ends in a reconcile that met a pause or answers that disagree, that a kept wait comes back within the poll interval and not at once, and that the message of an end matches its evidence. Alternative not taken: keep the release of the ninth decision for the two stops. It reads nothing, but it frees the target while another open pull request of the branch may still bring the change the request stopped for, which is what the rule of 2026-11-17 prevents. No other decision of this ADR changed. - 2026-11-18: #771, eleventh decision on the issue the same day: three corrections to the tenth; no rule changes. (1) Answers that disagree end a passed wait. Before the end of a wait for a read (
MergeCheck,MergeContent), answers of the Git host that disagree (a pull request missing by its number while its branch still lists it) keep it, and the bound gives them time to agree. Once the end has passed, a read whose answers disagree is evidence that the read was made: the wait ends as a failure (MergeCheckrecords the merge without a receipt,MergeContentendsNeedsInterventionwithMergeContentUnreadable), and the message says the answers disagreed. Only a pause, or a reconcile that made no read, keeps a passed wait. Point (1) of the tenth kept it on a disagreement with no end: a request whose retargeted merge kept answering 404 by number while its branch listed it stood for 48 hours of reconciles with its wait and its lock unchanged. The lock then settles by its rule; answers that disagree still keep a lock, as onmain. The generated test draws answers that disagree for ever as an event. (2)MergeNotCheckableis a merge that did not show what it delivered, likeMergedWithForeignChangeandMergeContentUnreadable: its lock is released only after a read shows no other open pull request of the branch, or with the repository gone from the settings. The stop is new on this branch, somainhas no rule for it. (3) A settings object that is missing is not "the repository is gone from the settings". With noRemediationSettingsobject the executor keeps the lock of a merge that did not deliver the plan as shown and every wait for a read, setsPullRequestUnreadablewith reasonSettingsNotFoundon a stopped holder, and comes back at the pace of its looks; every path that decided on a missing object onmaindecides as before. Only a repository absent from settings that exist releases such a lock or ends a wait as a read that could not start. No other decision of this ADR changed. - 2026-11-18: #786, decisions of 2026-11-16 to 2026-11-19, recorded with their trade-off and the alternatives not taken in the matching entry of ADR-0028. It changes one sentence of the #688 entry above: a refused read of a pull request (403, 422) during the recovery of a handoff is no longer retried until the request's deadline and its grace. The set of wait kinds in
status.gitWaitshas a sixth,HandoffRecovery: recorded at the first refusal (or settings that cannot reach the repository) met by the recovery, it ends 24 hours later and never moves. That refusal aborts the handoff, and the write that records the entry removes theHandoffGraceentry (still the deadline plus 15 minutes for a recovery that meets no refusal), so each entry ends at its own end and none is computed from another. At most five entries stand at once though there are six kinds:RequestDeadlineapplies only to a request that recovers no handoff and the two handoff kinds only to one that does, and every write that adds an entry first removes those whose kind no longer applies, somaxItemsstays 5. The enum grows by one value; objects stored before hold none and stay valid, and a status that holds both handoff kinds stays valid (the next reconcile removes the grace). A merge whose head is exactly the replacement's commit, during the watch or at any time after its end, is recorded on the replacement with the receipt of section 1 (or asPRCreatedwhile the merge commit or the check at the merge is awaited), also when the predecessor object is gone, and also when the takeover's status write was lost after it stored the wait for the check at the merge and that wait ends with no read that answers (2026-11-19, seed 3506 of the model), so the delivery check, the verification and the circuit breaker see it. The predecessor never records that merge as its own: it endsSupersededwithMergedForReplacement, which the circuit breaker does not count, so the merge is counted once; when the replacement is deleted while the handoff was not completed, the predecessor records it once asMergedWithForeignChange; after a completed takeover nobody records it, as for any request deleted before it records its merge (#875). A merge whose head is the replacement's commit with further commits on top is not recorded as the replacement's own merge; it was a known gap here, closed by the ADR-0028 entry of 2026-11-20 (#870): the replacement holding the lock records it as a foreign change, with the existingMergeContentwait kind for the read of what it brought. The two handoff waits end when the request is deleted. No other decision of this ADR changed. - 2026-11-19: #892, section 1 ("Restart and lost writes"). The read of the request's own pull request goes beyond the target branch, and the finalizer closes it there; ADR-0043 decides that, with what is read and closed, the verdicts and the limits. This entry records what it does to section 1:
GetChangeRequest(number)no longer answers "not found" for a pull request a person moved to another base, since the executor took that for gone and released the lock while it could still merge. Besides open, merged, closed and gone, the read has two verdicts, open on another base and merged on another base, which the callers handle as ADR-0043 says. Open on another base stops the requestNeedsInterventionwithChangeRequestOnOtherBaseand keeps the lock (a cancel endsCancelled); merged on another base stops it the same way and keeps no lock. Gone is left for a pull request that does not exist or is not the request's. A request with no number recorded lists the pull requests of its branch on every base (ListChangeRequestsAnyBase), and the finalizer closes its own marked ones there (CloseChangeRequestAnyBase). ADR-0032 maps the two methods and the wider read for Azure DevOps. - 2026-11-20: #895, section 4, the executor's window after a restart is recorded (decided 2026-11-20). The lab run of v0.6.0-rc.1 showed the cost of the #96 entry of 2026-11-13 without a trace: after a restart of the executor during
Verifyingthe request ended 2 minutes later thanstatus.verification.windowStartplus the window, and the status showed no reset. The window was counted from the start of reconciling, held only in the new process's memory, while the storedwindowStartwas kept. Now the first check of a new process resets every open window that opened before that process began reconciling, with the new executor reasonExecutorRestarted(no-evidence class, added to the enum ofstatus.verification.lastReset.reason), and stores that reset like any other:lastResetnames it,resetsgoes up by one, and the same check opens the window again when it is good, so the storedwindowStartis where the window that decides starts. The reset's time is the second before the start of reconciling, so a good check in that second still opens the window; a window that opened in that same second is kept, which can count less than a second from before it, the precision the API keeps for these times. A closed window is left as it is. The reset is computed from the stored window and the start of reconciling, so a lost write is computed again the same by the next check, and the restart comes before a reset kept in memory (unwrittenResets), which is always of this process. Both times are the executor's, as before; the cost is unchanged (a full effectivestableForafter a restart), and a request whose timeout comes sooner now endsInconclusivewithExecutorRestartedwhen nothing reset its window after the restart, instead of the reset before it orEvidenceMissing. Alternative not taken: continue the window from the storedwindowStart. A reset whose status write failed lives only in the memory of the process that saw it, and an API server outage that fails that write also stops the lease renewal and ends the process, so the stored window cannot show that it holds no bad check; nor does it show that some executor checked the target while no process ran. Continuing would need a durable record of every check, a status write each poll interval, which this entry does not add. No grant, read or write is widened: the reset is one more status write of fields the executor already writes, once per open window and restart. Corrected the same day (second decision of 2026-11-20 on #895): (a) the check compared the storedwindowStart, written on the clock of the process that opened the window, with the start of reconciling on the new one, two clocks; a new leader whose clock is behind kept a window the old one opened. The process now keeps in memory the start of the open window its own last check left, and resets every open window that is not that one, whatever its times; the reset is never earlier than the storedwindowStart, so an old clock ahead keeps the window closed until this clock passes that start, which only delays an end. The sentence above on a window opened in the same second no longer applies. (b) At the timeout the newest reset gives the reason:ExecutorRestartedwins when it is the executor's last reset and the report counted no reset since the check that recorded the restart, by the report's ownresets(and UID) as that check read it, kept in memory; a reset the report counted after it gives the report's reason, and without that read (an earlier process recorded the restart) the order of this section applies. No time of the report is compared with one of the executor. Recorded trouble still endsFailed. © A CustomResourceDefinition older than the executor refusesExecutorRestartedwith 422 Invalid; the executor classes that like a pruned field (#866), with the Warning EventCustomResourceDefinitionOutdatedand the error backoff, and writes nothing without the reset, so the request stays inVerifyinguntil the CRDs are applied. - 2026-11-21: #970, section 4, a process owns every window it opened (decided 2026-11-21). This replaces the memory of correction (a) of 2026-11-20, which kept only the start of the open window the process's last check left. With status writes lost, stored, or stored but returned as an error, the window status holds can be any window the same process opened earlier: a bad check's lost write leaves the window before it, and a write that was stored can be read back after later lost ones. Remembering one start, or one start and one pending start (the first fix on #970), left the stored window owned by neither in some of these orders, and a later check recorded
ExecutorRestartedin a process that never restarted. The process now keeps the start of every window a check of its own opened for the request, whatever became of the write that carried it, at most 16 per request, the oldest forgotten first; a check resets withExecutorRestartedonly an open window whose start is not among them. The rest of correction (a) stands: only starts this process wrote are compared, never a storedwindowStartwith this process's clock, and the reset is never earlier than the storedwindowStart. Past the bound a check that reads a forgotten window records a restart that did not happen: the window closes and needs a fullstableForagain, a longer wait and never a shorter one. The memory is dropped when the request ends, is being deleted or is gone, as before. A generated test runs every order of up to 8 checks, each good or bad with its write lost, stored or stored with an error, and finds no restart; on the first fix it found several. No read, write or grant is added.