Repository navigation
chore(loop): terminalise the task of a non-loop PR when it closes - #40
Merged
Merged
Conversation
D33. `pull_request_target` returned `noop` for any PR without `loop-task:`, which is right about the **metric** (not loop-produced ⇒ never in the acceptance rate) but wrong about the **task**: ops.md maps "(none, merged) -> accepted" and "(none, closed unmerged) -> rejected" regardless of provenance. Every owner or dependabot PR gets a task from `pull_request` triage, so each merged PR left a zombie in `waiting-human` — observed live on #39, the very PR that fixed D30. It shows up under "Inbox" in SUMMARY.md forever, and sweep cannot repair it: sweep lists *open* GitHub items, so it cannot see a closure. The router now emits a `terminal` decision for that case, and entry handles it through the same `markTaskTerminal` as the metrics path — one definition of "what terminal means" — while still never writing an acceptance row for a non-loop PR. Verified: owner PR merged -> accepted and owner PR closed-unmerged -> rejected, neither writing a metric; a loop PR still does both (new row + transition); duplicate events add no row and re-transition nothing; a PR with no task does not throw; plus the 19-case route table and the CLI/orchestrator suite.
Contributor
Coverage
|
Alex1990
added a commit
that referenced
this pull request
Sep 11, 2026
The D33 entry claimed "every owner or dependabot PR gets a task from `pull_request` triage". Dependabot is not one of them: the credential guard (D28) skips the whole job before triage, because a Dependabot-triggered `pull_request` run gets a read-only token and no secrets. So the new `terminal` branch is a no-op for them. The code was always right — `markTaskTerminal` treats a missing task as "no transition needed" — only the reasoning was wrong. Still worth fixing: the note is what the next reader trusts, and a wrong premise there invites a wrong change later. Also fold in what the 2026-09-11 daily sweep established, since it changes how D33 reads: the #39 drift was self-healed by r-20260911-080231-zja0, but only because the #40 triage report had mentioned it in passing. sweep cannot see closures, which is the accidental path D30/D33 exist to remove.
Alex1990
added a commit
that referenced
this pull request
Sep 11, 2026
A clean observation week proves the loop is *safe*, not that it is *complete*. Several capabilities cannot run at the report boundary however long A1 lasts, and the checklist did not distinguish them from items that are merely unsampled. Conflating the two would let a clean week be read as "everything verified". Decision (2026-09-11): accept the metrics write path as unverified and make it the first item after the L2 switchover. A1 produces no loop PR, so `handleMetrics` never fires — all 3 existing acceptance rows are A0-era (`manual-local` x2, `workflow-backfill`). D30/D33 cover the shared machinery (`markTaskTerminal`, the `taskId|event|pr` dedup key) and D33 verified the no-write half live twice; the write half (`planActions`) has never executed in any host. Validating it needs `LOOP_GH_TOKEN` plus `execute_writes=true`, i.e. leaving the report boundary, which is exactly what the observation week is for avoiding. Also corrected while auditing the same list, because a stale checklist is worse than an incomplete one: - `pr-review` is unreachable too — it needs a loop PR, which A1 never produces. #39/#40/#41 were loop-*related* but not loop-*produced* (head `chore/loop-*`), so they routed to `triage`. Recorded run ids for the routes that did run. - Engine stability: 18 runs with no hang, but every one exited 0 — so the failure-classification table has never been exercised by a real failure. - D33's live verification is now recorded as the two independent instances it is (#40, #41), both with no metric row.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the third face of the same underlying gap: a task with no path to a terminal state.
D33 — a non-loop PR closing left its task stranded
pull_request_targetreturnednoopfor any PR withoutloop-task::That is right about the metric — a PR the loop did not produce must never enter the acceptance rate. It is wrong about the task.
ops.mdmaps closure by outcome, not by provenance:acceptedrejectedEvery owner or dependabot PR gets a task from
pull_requesttriage, so every merged PR left a zombie sitting inwaiting-human— showing up under "Inbox" inSUMMARY.mdforever. Sweep cannot repair it either, for the same reason as D30: sweep reconciles by listing open GitHub items, so it cannot see a closure.Observed live on #39 — the PR that fixed D30 was itself the next instance:
The fix
The router emits a
terminaldecision for that case:entry.mjshandles it through the samemarkTaskTerminalthe metrics path uses, so "what terminal means" has one definition rather than two. The acceptance row is still never written for a non-loop PR.Verified
accepted, no metric rowrejected, no metric rowacceptedand a metric rowPlus the 19-case route table (all decision types, including the new
terminal), CLI guards, and the orchestrator paths.The pattern worth naming
D30, D33, and the still-open D26 are one problem seen from three angles: a task can enter a wait, and only some paths lead out.
waiting-mergewaiting-humanwaiting-human/waiting-mergesynchronizeD26 remains open on purpose: its fix is a design choice (re-open PR tasks on
synchronize, or a bounded re-triage), and A1's week should quantify the cost first. Worth noting it was the reason this PR's own re-push loggedskip: task #39 not claimableinstead of re-analysing.The deeper repair is in sweep, which only lists open items and so misses this entire direction. That is a norms-layer change and belongs in a proposal PR after A1's observation week — recorded as such, not smuggled in here.