Repository navigation
sweep(api): a finalize pass closes a ticket whose PR merged at the reviewed head - #182
Conversation
… head closes its ticket
… of review-recover, re-read before the write, sync the seat, bump the version
…ide gh's FINALIZE
|
[trail] PR #182 / board ticket #74 — review in progress; escalation awaiting plan precedence. |
A session that died mid-turn leaves status=working in its registry record; finalize read that field without _liveness's verdict and stalled the merged ticket behind an owner no agent will ever speak for. A dead seat now skips the mid-turn check and the close is written as its run, as the spec's step 3d intends.
_metas_for_ticket runs through a process substitution, which hides a dead scan; finalize read the empty result as no owner and fell to the automation write, whose override passes the local fence and whose principal skips the server's by-this-run trail gate. The pass now checks _scan_ok like every other scan consumer and skips the ticket, and reads the scan to its end so the status is written before it is checked.
The pass reads GitHub and the board serially for every in-review ticket, and that scan can fill the tick budget, which is the lease's own length, after the tick's one renewal. Every live run is now renewed again ahead of a candidate once the last renewal pass began BOARD_FINALIZE_RENEW_SEC (default 300) ago. On a clock rather than per item as relay and resume do, because a per-candidate renewal would cost runs x candidates calls every tick.
|
[trail] PR #182 / board ticket #74 — round 2 hand-up, second plan-precedence question. |
|
[trail] PR #182 / API ticket #74 — parked confidence, local fixes continue; level medium, auto-merge on. |
…ll active An idle live owner may still have its QA child reviewing under subagents/; any done ends the run out from under it. Apply review-recover's whole-tree quiet gate against REVIEW_STALL_MIN before writing; no transcript is no signal, and a dead owner bypasses the gate. Fixture ticket 91 is now the pinned live+idle owner with a fresh tree; the dead-owner coverage moves to ticket 92 (fresh file, still closes as run).
… fork _liveness reads status=error + pending_short as forked: not dead, but its record is not working/blocked either, so finalize wrote done as the run while the fork may still be live on it (and the tree gate only sees the superseded turn's transcript). Hold and surface it on stderr, as relay and resume already do. Fixture ticket 93 (forked owner, stale old transcript, accepting by-id row and transition) proves no write.
|
[trail] PR #182 / ticket #74 — review progress; level medium, auto-merge on; HUMAN PARK remains active. |
…a tick took A budget spent mid-list re-read the list from its head every tick, so the same first candidates took the budget each time and a merged ticket behind them was never examined. The last ticket taken is kept in a per-binding store and the next tick starts past it, wrapping at the end.
… names its ranges Every PR trail carries the head the latest engine round reviewed, the trail so far before a hand-up included. A scale run has no PR and no merge, and may have no aggregate head, so its trail names the ranges it reviewed instead.
A stalled gh pr view held the per-board lock with no renewal until GitHub answered: the budget is checked before the read and renewal runs between candidates, so neither can end a read in flight. _gh_read_bounded runs gh in its own process group under BOARD_GH_TIMEOUT (60s, clamped >=5) and kills the group on expiry; the existing could-not-read log and continue stand. Test: a PR read hanging 147s in a grandchild ends at the 5s bound, 80 is logged and skipped, 88 still closes, runs renew after it, the helper is dead and the lock released. Red on the unbounded call (took 72s at a 47s hang, 80 closed off the late answer) and on a child-only kill (helper left).
…he open park Outcomes & Retrospective predated every QA wave. It now names the live-tree gate, dead owner, unresolved-fork hold, failed-scan hold, clocked renewal, round-robin fairness, the bounded GitHub read and the PR-only head line, and states the remote-owner automation fallback as the open human park with no merge. A living-plan retrospective only: no re-pin, no pinned-section edit. Checks: test-sweep-finalize.sh PASS (drills 91-93, scan, renew, rotate, hung read) and test-qa-loop-agent.sh all passed at this head.
|
[trail] Final QA review of PR #182 / API ticket #74 — PARKED for human remote-owner decision, NOT mergeable under the current park. |
…-null remote owner_run is left for its home host (R3-F2, human's second re-pin)
…a remote owner run is left for its home host A non-null owner_run with no seat in this registry is a lease-live owner elsewhere, whose QA child this host cannot see; a done from here would end that run under it. Skip it with the 'another registry' line; the automation override reason now names the only case that reaches it. Ticket 94 drills the skip.
…of it Slow GitHub reads across the in-review list could spend the whole tick budget on every `all` tick, starving review-recover, relay, resume and dispatch indefinitely. The `all` arm now gives finalize half of what the tick has left: a later candidate is taken only if a read run to its bound still ends inside the share, and the first candidate's read is cut at the share's end, so even a budget-long read cannot outlast it. The whole-tick _budget_left ceiling, the cursor rotation, and a standalone `finalize` (no share) are unchanged. Drills: two slow-read `all` ticks (20s budget, 3s reads) stop finalize at its share, keep the rotation, and reach dispatch's claims; two `all` ticks whose first read is as long as the budget (8s/8s) cut that read and still reach dispatch.
|
[trail] Fresh QA pass for PR #182 / API ticket #74. Review level high (plan medium, operator floor medium; terminal board-write stakes raised one rung); auto-merge on. Engine rounds (each a lens-free whole-range doperpowers:reviewer-high sweep; no lensed runs):
Compliance audit: no PROTOCOL BLOCKER. Original ticket ready; remote-owner decision was parked, answered by human, and re-pinned before this pass. SPEC FINDING S1 (same substance as R1-F1) fixed. Claimed closing evidence: exact finalize suite, QA-agent test, both shell-lint invocations, version check, and standalone retire-finished regression passed; other sweep suites passed in the broad run. The broad Triage and wave outcomes:
No findings deferred or dismissed. No CI checks currently exist; PR is open and mergeable, but verdict needs-attention: R3-F1 and evidence E1 remain unresolved. No merge or terminal board transition is authorized while the spec conflict is unanswered. Worktree remains at pushed 4f346f5, clean; review scratch remains in /var/folders/c1/l4z5k02n2779byvnymzxsvth0000gn/T/qa-loop.GtkXON pending dispatcher answer. |
…losed as its run (R3-F1: dead-run close leaks the seat slot)
…d of closing as its run A done written as a dead run ends it server-side, but a dead session is never renewed, so no 409 strips the run from its meta and the seat keeps its run and dispatch slot. The dead owner is now skipped with the spec's dead-session line; its lease lapses, the reclaim clears owner_run, and a later tick closes as automation. Ticket 92's drill is inverted in place (R3-F1).
|
[trail] Fresh QA pass continued after R3-F1 re-pin — PR #182, API ticket #74. Level high (pinned plan medium and operator floor medium; terminal board-write stakes raised one rung); auto-merge on. Engine dispatches: all five were lens-free whole-range doperpowers:reviewer-high sweeps (no panel, no failed lens).
Compliance audit: ticket ready; no PROTOCOL BLOCKER. Human's remote-owner decision and the owner's later re-pin are scoped to their forks. SPEC S1 remote owner and SPEC S2 dead-owner skip resolved by graded fixes; E1 full-suite evidence resolved by exact re-verification on d49dd50. The exact Finding dispositions and wave outcomes:
|
…cket to the recovery lifecycle (R5-F1: automation close leaked the reclaimed dead seat)
|
[trail] PR #182 / board ticket #74 — review in progress, hand-up for a pinned-plan conflict. |
…, R1-F3); pre-existing dead-session slot gap filed as #75
…d finalize (W2-1) An 8s budget handed review-recover, relay and resume roughly half of it after finalize's cut read; those phases take ~2s here on their own, so dispatch's budget gate raced them (observed: dispatch started at ~8.2s of an 8s tick). A 30s budget with a 30s read keeps the proof (an uncut read would spend the whole tick) and leaves the phases ~13s.
BOARD_GH_TIMEOUT clamped only from below, so an override of 901 let a standalone finalize read wait past the 15-minute lease with no renewal while the tick held the lock. Capped at 300: a read on top of a renewal interval and a candidate's 30s board calls still ends inside the lease.
BOARD_FINALIZE_RENEW_SEC accepted any integer, so an interval of 1000 let a standalone scan of slow PRs go past the 15-minute lease between renewals with the lock held. Capped at 300 alongside the read bound. The tests that held renewal off with an over-lease interval now let it run: the scan-fail stub dies only after GitHub is read, and u-90's native wake lands only after its PR is read, so finalize's own sync is still the one pinned.
Report the BOARD_GH_TIMEOUT decimal normalization, the 300s caps on the GitHub read bound and the renewal interval, and the budget-long drill's resizing, with the aggregate test evidence as it happened. State the tree-quiet gate as a best-effort proxy and the dead-seat cleanup as the pre-existing #75 gap, matching the re-pinned Decision Log.
|
[trail] PR #182 / board ticket #74 — continued after re-pin; earlier round-1 trail: #182 (comment). |
sminos 1.43.1: quote a frame's alias that could pass for the owner label (#182)
Problem
Board ticket 74: an API-bound ticket remains
in-reviewafter its QA agent returns with auto-merge armed and GitHub later merges the PR. Unlike the gh binding's FINALIZE pass, the API tick could only wait for a stalled-owner recovery nudge to discover the merge.Change
finalizepass before review-recover, so a merged ticket closes before an asynchronous owner nudge can be spent. It also runs before relay, resume and dispatch.headRefOidwith the latest post-entry review trail'sreviewed head: <sha>line; re-read the ticket's state, PR pin, owning run and plan immediately before writing. This reduces, but cannot eliminate, the read/write race without a conditional server transition.This is one API/gh parity change; direct automation calls would bypass the transition wrapper's local fence, seat stamp and map rerender. The existing reviewer-fold PR (#180) supplies the server gate this pass respects. No GitHub closing keyword is included: ticket 74 belongs to the board service, not the GitHub issue tracker.
Validation Evidence
bash tests/claude-code/board-api/test-sweep-finalize.sh→PASS test-sweep-finalize.sh(34 hermetic assertions: run and automation closes, refusal, off-head merge, missing/stale trail, mid-turn seats, moved ticket, whole-tick order, gh binding). Against pre-implementation1d9ccae0, the suite failed on the old usage line and 19 assertions.tests/claude-code/board-api/test-sweep-*.shplustest-sweep-renew-relay.sh→ PASS. The renew/resume fixture cleanup emits harmless mock-server shutdown messages.bash tests/issue-tracker/test-qa-loop-agent.sh→all tests passed, before and after the new trail assertion.scripts/lint-shell.sh skills/issue-tracker/scripts/_sweep_api.sh skills/issue-tracker/scripts/board-transition.shandscripts/lint-shell.sh tests/claude-code/board-api/test-sweep-finalize.sh→ clean.scripts/bump-version.sh --check→ all four declared manifests at 7.119.0, no drift; its audit also notices this design spec's intentional version references.tests/claude-code/run-skill-tests.sh→STATUS: PASSED(26 passed, 0 failed, 9 skipped; integration suites skip withoutARKHO_DIR).Human review
The complete diff is awaiting the board's PR review loop; no human review is claimed here.
Residue
None. The remaining non-atomic window between the fresh ticket read and an automation transition is an explicitly scoped server-interface limitation, not work silently left from this ticket.