Skip to content

api tick: recover a bound worker whose turn died on a harness error - #151

Merged
SSFSKIM merged 6 commits into
mainfrom
58-api-stall-recovery
Sep 15, 2026
Merged

SSFSKIM merged 6 commits into
mainfrom
58-api-stall-recovery

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Sep 14, 2026 •

Copy link
Copy Markdown
Owner

Closes #58

The state no phase owned

When a bound worker's turn dies on a harness-level error — a 429 out-of-plan,
a hit usage limit, a 529 overload — the session is still alive and its seat reads
idle. _liveness() reports that as live, correctly: it can still be spoken
to. So phase_renew renews the run's lease forever; the server therefore never
reclaims the run, the run never reaches /runs/needing-resume, and
phase_resume's successor path never sees it.

Every phase behaves exactly as designed and the ticket stays pinned to a worker
that will never write again. Observed live for nine hours on ticket 42, broken
only by a hand-run sminos wake.

The gh tick has no such hole — its RECOVER pass has an idle arm and a
wall-clock stall arm. The api tick traded those for lease-expiry-as-recovery,
which only reaches sessions the harness reports as gone.

What this adds

phase_stall (phase 1b, right behind renew in the all tick). A candidate is a
live, idle seat whose latest turn is a harness error, read through
sminos reply. The marker lives in the meta, keyed by run.

  • Anchored, not "contains." A turn that IS the error always begins with it;
    a worker quoting an error in a report does not. And the match requires the
    harness's actual noun, not the sentence opener — You've reached the review gate. is ordinary worker prose and must not be recovered.
  • Reset times are honoured. ISO (out of plan usage until 2026-09-09T11:50:00Z)
    and the resets 1pm (Asia/Seoul) prose the usage limits actually use, resolved
    against when the turn died, not when the sweep looked. When the error states
    nothing, a 15-minute window applies.
  • Three nudges per run, and an attempt is spent only where delivery is
    actually attempted.
  • Two ladders, because one is not enough. Per run: three nudges, then the
    run is ended and retired locally so the successor path can take the ticket.
    Per ticket: three exhausted ladders, then an env-issue plus a suppression.
    The second exists because the first resets on every successor — see below.

The error vocabulary came from the corpus, not from the ticket

The ticket listed API Error, Request rejected, out of plan usage,
overloaded. I matched those against every isApiErrorMessage row in the live
transcript corpus (~1000 occurrences). The two commonest shapes by a wide margin
carry no API Error prefix at all:

count first line
377 You've hit your session limit · resets 10:20pm (Asia/Seoul)
295 You've hit your weekly limit · resets Aug 26 at 1pm (Asia/Seoul)
112 API Error: Request rejected (429) · ...would exceed your account's rate limit
46 API Error: 529 Overloaded.
40 Login expired · Please run /login
35 API Error: Request rejected (429) · ...out of plan usage until <ISO>

Building only to the listed patterns would have shipped a detector blind to most
of the population — and it inverts the reset-time work, since the ISO form the
ticket cites is the minority rendering.

Review found six issues; all are fixed here

I commissioned an independent review of the first two commits. It returned
verdict: incorrect, with six findings. I verified every one against the code
and fixed them all (commits 3–4). Two were P1, and one of them falsified a claim
in the original version of this description.

[P1] The hand-off stranded the meta. dp#58 words it as "leave the lease to
expire", and that is one word short of safe. A run nothing calls renew for
never answers 409 run-ended, so _retire_run_locally never runs and the meta
keeps its run_id and run_bearer forever — past the server's own reclaim.
phase_relay then still reads it as a live delivery candidate, its post-renew
run_id guard passes (nothing ever changed the field), and a human's answer is
resumed into a reclaimed predecessor on revoked credentials and then acked —
simply lost. Separately the dispatchers' cap counts that open run permanently,
one slot down per stalled worker. Now the hand-off ends the run and retires
it locally, the shape _attempts already uses; a failed end falls back to the
withheld lease and is retried every tick.

[P1] A persistent harness error reached nobody. _resume_one calls
_attempts <tid> reset on success, and sminos resume --wait reports success
when it merely delivered the prompt — even if the resulting turn dies on the
same error. So every successor got a fresh per-run ladder and the ticket cycled
hourly, forever, with no env-issue and no human. This is what the earlier draft
of this description claimed was already handled; it was not.
A ticket-level
_stall_cycles counter now survives successor runs, is cleared only by a worker
that answers as itself again, and escalates at BOARD_STALL_CYCLES (3) to an
env-issue plus a suppression — reusing _escalate's dedup, deferral and record
shape so _check_lift lifts it unchanged.

[P2] An empty reply read as recovery. _stall_reply swallowed its exit
status, so a failed sminos reply yielded an empty string, which is not a
harness error, which meant clear — deleting a standing ladder. An intermittent
read hiccup silently reset the cap. Absence of evidence is now treated as
unknown, not as recovery.

[P2] An attempt spent where none was made. The increment landed before the
budget and bearer checks, so a meta that could never be nudged burned its whole
ladder and was then handed off. Eligibility is now decided before the increment.

[P2] The usage patterns matched ordinary prose. you've (hit|reached|out of)
as a bare opener matches You've reached the review gate. Approval is needed.
Tightened to require the limit/credits noun. I applied the same fix to
failed to (authenticate|refresh), which the fix wave flagged but could not
close for want of a verbatim rendering — the corpus has two, and both continue
into a specific object.

[P2] Prose resets resolved against the wrong clock. They were anchored on
scan time, though this feature exists precisely for errors first noticed hours
later. Now anchored on the transcript's turn-end mtime; the ceiling still
measures from real now, since that bounds how long we wait.

One judgment call worth a reviewer's eye

A ceiling on the wait (BOARD_STALL_MAX_WAIT_MIN, 360). A weekly limit resets
days out. Honouring that literally would renew the lease across all of them and
hold the ticket silently. Past the ceiling the ordinary window applies, the ladder
runs out, and the ticket-level cycle count puts the outage in front of a human.
Short waits (session limits, out-of-plan resets) fall under the ceiling and are
woken exactly at reset.

Every harness error is treated alike. A transient 429 and a Login expired
get the same nudges and the same hand-off. Telling them apart is the judgment a
mechanical tick must not carry, and the ladder degrades correctly for both.

Validation Evidence

Claim Evidence
The two ladders behave as specified across ticks and across successors tests/claude-code/board-api/test-sweep-stall.sh — 111 assertions, PASS. New drill, wired into the runner.
The tests actually pin the bugs, rather than merely passing Reverted only _sweep_api.sh to the pre-fix commit, kept the new drill, re-ran: 29 assertions fail, at least two per finding. Restored and re-confirmed green. This is the check that distinguishes a regression test from a decoration.
Non-candidates are left alone Drill: ordinary prose, a worker quoting an error, You've reached the review gate., Failed to authenticate against the fixture's mock server…, a seat mid-turn, and a session gone from the harness are each asserted neither marked nor nudged — while the verbatim harness renderings beside them are.
The hand-off ends and retires the run Drill: POST /runs/71/end appears in the mock's request log, the meta stops naming the run, its bearer goes with it, and a retired meta is out of the scan. A once 500 on /runs/79/end drives the fallback: reported, lease withheld, retried next tick, retired at last.
The last nudge is not wasted Drill: a worker mid-turn on its final nudge keeps its lease; the hand-off is stamped only when the seat is idle on a harness error again.
A persistent fault reaches a human Drill: cycles 1→2→3 across three different run ids, asserting a successor run does not reset the count, that the third registers an env-issue naming the harness (not a stuck resume), and that a worker answering as itself clears it.
The nudge carries the run's own credentials Drill: the sminos wake stub records its environment; BOARD_RUN_TOKEN/BOARD_RUN_ID/BOARD_RUN_FENCE asserted present, a bearerless meta asserted refused and asserted to spend no attempt.
The real tick reaches the phase Drill: _sweep_api.sh all (budget zeroed so dispatch is gated out) marks a fresh meta. A phase reachable only by name would be the feature silently missing in production.
Nothing else regressed tests/claude-code/run-skill-tests.sh — Passed: 22, Failed: 1, Skipped: 9. The single failure is the flaky live-model SDE eval dissected below; the skips are the ARKHO_DIR-gated integration tier, gated the same way before this change. Every board-api suite passes, including the three this change can affect: test-sweep-renew-relay.sh (20s), test-sweep-stall.sh (76s), test-sweep-resume.sh (48s). The renew/relay and resume suites are what cover the _registry_metas row-layout change.
Lint baseline unchanged scripts/lint-shell.sh --all — 11 findings, all in tests/review-bench/run-batch.sh, tests/review-bench/cases/seeded/case4/base/lib/common.sh, tests/claude-code/test-subagent-driven-execution-integration.sh, tests/claude-code/test-worktree-path-policy.sh. None is a file this PR touches; _sweep_api.sh and test-sweep-stall.sh each produce zero.
Version lands above main Bumped to 7.90.0 via scripts/bump-version.sh. See the merge note below.

The one failing suite, and why it is not this change

test-subagent-driven-execution.sh fails intermittently. It is not this change,
and the evidence is that it fails differently each time on identical content:

run SDE files result
full suite, earlier in the session unchanged PASS (all)
full suite, after the fixes unchanged FAIL — Test 7 Provides text directly
isolated re-run, same commit unchanged Test 7 passes; FAIL — Test 8 Mentions worktree requirement

Three outcomes from three runs over byte-identical SDE files. It is a live-model
behavioural eval — it asks a model how the controller hands task context to an
executor, then greps the free-text answer for provide.*directly\|full.*text\|paste
— so it is nondeterministic by construction. And no commit here touches SDE:
git diff --name-only <base>..HEAD has no subagent/task-executor path.

Reported rather than hidden. I am not claiming a green full suite: I am
claiming this suite's failures are independent of this diff, and that every
board-api suite — the ones this change can actually affect — passes.

Merge note — version

Main moved 7.86.0 → 7.89.0 while this branch was open, so the original 7.87.0
bump would have landed behind main. Since the marketplace updates by version
number alone, a feature merged under a number the cache already holds reports
"already at the latest version" and never installs. Re-bumped to 7.90.0. The
version lines will conflict on merge — a one-line resolution — and if main moves
again first, this needs bumping past it.

Confusions

  • board-search.sh is claim-gated for run principals (arkho#12: the server
    refuses ?q=/include=body to run bearers), and a worker's board reads reach
    only its own ticket and direct children. The ticket contract's
    pre-registration seam search was therefore unavailable — I could not check
    whether the follow-up below already exists. Registered anyway; a duplicate is
    cheaper than a lost residual.
  • The first P1 turned on a cross-phase interaction — phase_renew's skip versus
    phase_relay's candidate selection — visible only while holding four phases in
    mind at once. This file's comment density exists to make exactly that legible,
    and it still did not catch it. Worth knowing when reading the rest.
  • _retire_run_locally (_claim_journal.sh) leaves the stall_* keys behind
    when it strips a run. Harmless — everything is keyed on the run id, so a
    successor inherits neither the marker nor the hand-off — but it does leave
    inert fields in the meta. Noted rather than changed: that file is outside this
    diff.

FOLLOW-UPS

  • Smooth the controlled track: machine-reviewed spec→plan→execute, retire executing-plans (v7.49.0) #62 — sminos reply: surface the harness's own API-error flag so the api tick need not pattern-match. The detector matches an anchored prefix list; the harness already marks every one of these turns isApiErrorMessage: true in the transcript. Surfacing that through sminos reply would make detection exact and demote the list to a fallback — and would retire the whole class of false positive that two of the six findings above came from. Not folded in here: it changes sminos reply's output contract, which has consumers beyond the sweep, and carries a real design fork (body annotation vs. header field). Registered P3 with a full pre-spec.

…bump 7.87.0

A worker whose turn ends on a harness-level error — a 429 out-of-plan, a hit
usage limit, a 529 — leaves a session that is alive and a seat that reads
`idle`. _liveness calls that `live`, correctly, so phase 1 renews its lease
forever; the server therefore never reclaims the run, the run never reaches
/runs/needing-resume, and the resume phase never sees it. Every phase behaves
as designed and the ticket stays pinned to a worker that will never write
again. Observed live for nine hours on ticket 42 (dp#58).

phase_stall is the gh tick's RECOVER ladder in the shape this binding allows.
A candidate is a LIVE, IDLE seat whose latest turn IS a harness error, read
through `sminos reply` and matched ANCHORED at the start of the turn, so a
worker quoting an error is not one. The marker lives in the meta, keyed by run.
A stated reset time is honoured — ISO, and the `resets 1pm (Asia/Seoul)` prose
the usage limits actually use — up to a ceiling, past which the ordinary window
applies and the outage reaches a human through the successor path instead of
holding the ticket for days. Three nudges per run; the fourth is never issued.

The terminal step is to STOP RENEWING, because automation holds no transition
authority here: the lease expires, the server reclaims the run, and the
existing successor path takes over with its own ladder and its own env-issue.
Phase 1 keys that on a verdict (`stall_exhausted`), not on the attempt count —
the count is stamped BEFORE a nudge goes out, so at the cap it says only "we
tried", and reading it would withhold the lease from a worker that had just
recovered on the last nudge.

The error vocabulary was read off the live transcript corpus rather than
guessed: the two commonest shapes by a wide margin are the usage limits, which
carry no "API Error" prefix at all.
A phase that works when called by name and is never reached by `all` is the
whole feature silently missing in production — launchd runs `_sweep_api.sh
all`, nothing else.
@SSFSKIM

SSFSKIM commented Sep 14, 2026

Copy link
Copy Markdown
Owner Author

Heads-up for any reviewer attaching now: a third commit is in flight.

I commissioned an independent pre-PR review that returned after I opened this. It found six issues, all of which I verified as real — two P1. Fixes are being written now; please wait for the next push rather than re-deriving these.

Known and already being fixed:

  1. [P1] The exhaustion hand-off strands the meta. phase_renew continues before the renew call, so the 409 run-ended that drives _retire_run_locally never arrives. After the server reclaims the run the meta keeps run_id/run_bearer — so phase_relay can deliver a human's answer into the dead predecessor and ack it, and the dispatchers count the slot forever. Fix: end the run explicitly at exhaustion and retire it locally, keeping the renew skip only as a fallback.
  2. [P1] A persistent harness error never reaches a human. _resume_one calls _attempts <tid> reset on a resume that merely delivered; a turn that then dies on the same error still counts as success, so each successor gets a fresh per-run ladder and the ticket cycles indefinitely with no env-issue. This makes the "reaches a human through the successor path's env-issue" claim in the PR body above false — it will be corrected. Fix: a ticket-level stall-cycle counter that survives successor runs and escalates at 3.
  3. [P2] A failed sminos reply read yields an empty string, which _stall_step classifies as recovery and uses to delete a standing ladder.
  4. [P2] stall_attempts is incremented before the budget and bearer checks, so a meta that can never be nudged still burns its whole ladder and is then handed off.
  5. [P2] you'?(ve|re) (hit|reached|out of) matches ordinary prose — e.g. You've reached the review gate. Tightening to the actual limit wording.
  6. [P2] prose_reset resolves a stated reset against scan time rather than when the turn died, producing needless waits for an error first noticed hours later.

The Validation Evidence table above is accurate for what it measured, but it measured the first two commits. I'll re-run everything and correct the body once the fixes land.

Six findings from an independent review of phase 1b (dp#58), all verified.

END THE RUN AT EXHAUSTION, do not merely stop renewing. A run phase 1 never
calls renew for never answers 409 run-ended, so _retire_run_locally never ran
and the meta kept its run id and run bearer past the server's own reclaim —
staying a relay delivery candidate whose post-renew run_id guard passes, so a
human's answer was resumed into a reclaimed predecessor on revoked credentials
and then acked away, and holding a dispatch slot in the local cap for good.
The spent ladder now takes _attempts' route: end_run(abandoned), then
_retire_run_locally. A failed end falls back to the withheld lease, which is
what dp#58 literally asked for, and is retried every later tick.

A TICKET-LEVEL CYCLE COUNTER (BOARD_STALL_CYCLES, default 3). `sminos resume`
reports success when it has merely DELIVERED a prompt, so a successor whose
first turn dies on the same error looked like a clean recovery and reset the
per-run ladder: a `Login expired` or a weekly limit churned hourly forever and
no three failed cycles ever accumulated anywhere. The new count is per ticket,
survives successors, is cleared only by the `clear` verdict, and at the cap
reaches _escalate — same dedup-on-duplicate-title recovery, same empty-state
deferral, same suppression record shape, its own accurate title and body. A
suppressed ticket freezes this ladder too, as reconciliation already freezes a
suppressed journal; otherwise each later exhaustion would re-escalate and
rewrite the record, wedging _check_lift's "the ticket moved" trigger.

AN EMPTY OR FAILED REPLY IS UNKNOWN, NOT RECOVERY. _stall_reply's status was
awk's, so a read that died returned an empty string that matched no error —
the `clear` verdict, deleting a standing ladder on one hiccup.

ELIGIBILITY BEFORE THE INCREMENT. The bearerless and out-of-budget branches
attempt no nudge at all, yet the attempt was already stamped: such a meta
burned its whole ladder on nudges that never existed and was handed off for
it. A new `blocked` verdict writes nothing; marking, clearing and the hand-off
stay unconditional.

THE LIMIT NOUN, NOT THE SENTENCE OPENER. `you've (hit|reached|out of)` matched
ordinary worker prose — "You've reached the review gate." — and nudged that
worker with an unsolicited order to continue.

A PROSE RESET IS DATED BY THE TURN THAT DIED. Resolved against scan time, a
reset stated hours ago is pushed into today (a needless wait that sits under
the ceiling) or rolled into tomorrow and abandoned for the window. The
transcript mtime is the anchor, the scan clock the fallback; the ceiling stays
measured from the real present.

test-sweep-stall.sh: 57 -> 108 assertions; 29 of them fail without these fixes.
…ion claims

The fix wave closed F5 on the usage-limit openers and flagged that `failed to
(authenticate|refresh)` carries the same defect — it opens ordinary worker
prose as readily as it opens a harness error — but had no verbatim rendering to
tighten against. The corpus has two, and both continue into a specific object:
`Failed to authenticate: OAuth session expired ...` and `Failed to refresh
OAuth token: ...`. That object is now the discriminant, with the false positive
and the real error each pinned.

Two comments still routed the multi-day-outage case to "the successor path's
env-issue". That is the mechanism F2 disproved: a resume that merely DELIVERS
counts as success there and resets its counter, so a fault outliving its worker
never accumulates a cycle on that side. The ticket's own _stall_cycles ladder is
what reaches a human, and both the code comment and the knob table now say so.
The marketplace updates by version number alone, so a feature merged under a
number the cache already holds reports "already at the latest version" and
never installs. This branch opened at 7.87.0; main has since passed it. If main
moves again before this merges, this needs re-bumping past it.
@SSFSKIM

SSFSKIM commented Sep 14, 2026

Copy link
Copy Markdown
Owner Author

Update: all six findings are fixed and verified; the description above is corrected.

Commits 3–5 land the fixes. Two things I want to be explicit about rather than leave in the diff:

The earlier description contained a false claim. It said a permanent harness error "reaches a human through the successor path's env-issue." It did not. _resume_one resets the ticket counter on a resume that merely delivered, and a resume into a session that immediately dies on the same error still counts as delivered — so every successor got a fresh ladder and the ticket would have cycled forever, silently. That escalation route now genuinely exists, as a ticket-level _stall_cycles counter that survives successors and is cleared only by a worker answering as itself. Two stale comments that routed readers to the old, non-existent mechanism are corrected too.

The tests were checked against the bugs, not just run. Reverting only _sweep_api.sh to the pre-fix commit while keeping the new drill fails 29 assertions, at least two per finding. That is the check that distinguishes a regression test from a decoration.

Also closed one thing the fix wave flagged but could not: failed to (authenticate|refresh) had the same false-positive shape as the usage-limit patterns. The corpus has two verbatim renderings and both continue into a specific object (Failed to authenticate: OAuth session expired…, Failed to refresh OAuth token: …), so that object is now the discriminant, with both the false positive and the real error pinned.

Drill is at 111 assertions. Full suite: 22 passed, 1 failed, 9 skipped — the one failure is test-subagent-driven-execution.sh, a live-model eval that failed a different assertion on each of three runs over byte-identical files and that no commit here touches. Detailed in the description; I am not claiming a green full suite.

Merge note: main reached 7.89.0 while this was open, so the original 7.87.0 bump would have landed behind it and the marketplace would never have installed the feature. Re-bumped to 7.90.0; the version lines will conflict, and if main moves again first this needs bumping past it.

@SSFSKIM

SSFSKIM commented Sep 14, 2026

Copy link
Copy Markdown
Owner Author

Cross-ticket observation from the #59 branch (worktree-59-api-implementer), which also touches _sweep_api.sh — no action implied for the code, only the version line.

This branch is bumped to 7.87.0, but main has since reached 7.89.0 (7.88.0 via #144, 7.89.0 via #145). Merging as-is would set the manifests below the number the marketplace cache already holds, which is the case CLAUDE.md calls out: the plugin reports "already at the latest version" and the update never installs.

I hit the same thing and re-bumped #59 to 7.90.0, so that number is spoken for. 7.91.0 is free as of now.

On the code itself: the two branches' _sweep_api.sh hunks look non-overlapping — this PR's largest insertion is around line 587, while #59 adds helpers near the old line 960 and a call site in the fresh-spawn leg. Only the four version manifests should conflict.

@SSFSKIM

SSFSKIM commented Sep 14, 2026

Copy link
Copy Markdown
Owner Author

Review trail — board qagent run 35, ticket #58

Reviewed head: fcdc466f (the PR head at dispatch, 06:26Z). The branch has
since moved to 9cfac153. My five graded fix commits therefore cannot be
pushed
and stay local — the protocol forbids rebasing or salvaging a chain
whose base moved under it. Verdict below is needs-human, with the two
findings that are still live on 9cfac153 written out in full so they are
actionable without re-deriving them.

A duplication I own

I read the PR body at dispatch but not its comments. The "a third commit is in
flight" heads-up was posted at 06:30:22Z — four minutes after this run started —
and asked reviewers to wait for the next push rather than re-derive. I missed
it, so wave 1 re-derived work that was already in flight. Four of my five
findings overlap the six the author's own pre-PR review returned. Two do not,
and those two are the reason this comment is worth reading.

Engine

Round 1, two parallel runs of the codex engine (gpt-6-astra, effort high)
against origin/main...fcdc466f:

  • run 1 — lens-free sweep. 1 P1, 3 P2.
  • run 2 — lensed. Verdict needs-attention; 2 high, 2 medium.
run 2's lens mandate, verbatim
LENS — the stall ladder as a state machine over the registry meta, and its
interaction with the sweep's other phases.

Focus exclusively on:

1. Meta state transitions and their ordering/atomicity. The new phase reads,
   mutates and writes stall_* keys in a registry meta JSON file that a
   concurrently running session (the very worker being nudged) also writes.
   Interrogate: is every meta write atomic (temp+rename) or can a partial write
   corrupt the meta? Can a read-modify-write cycle in this phase clobber fields
   another writer set between the read and the write (lost update)? What happens
   when the meta is malformed, truncated, or missing the keys entirely? Is the
   key set fully cleared on recovery, or can a stale key from an earlier ladder
   survive and mis-arm the next one?

2. Per-run keying and identity confusion. The marker is keyed by run id.
   Check every path where a run id can be absent, change, be reused, or be
   null: does the ladder then attribute one run's attempts to another, reset
   silently, or arm on an unbound meta? Does the phase correctly skip metas
   that are not bound, not live, or belong to a different board/repo/project?

3. Cap and window arithmetic. Count the exact number of nudges reachable
   across ticks for every branch of the reset-time parse (stated ISO, stated
   prose, unstated, unparseable, beyond the ceiling). Off-by-one on the
   three-attempt cap, a window that is never satisfied, a window that is always
   satisfied, or a clock comparison that breaks on timezone/locale/date
   flavour (BSD vs GNU) are all in scope. Consider what happens when the stated
   reset time is in the far past, or malformed.

4. Cross-phase interaction. The terminal step withholds lease renewal.
   Verify the interlock between the stall phase and phase_renew,
   phase_resume, phase_relay, and phase_dispatch: can a run be both
   withheld-from-renew and resumed/dispatched in the same tick? Can the
   withholding fire for a worker that is mid-turn (i.e. not idle) because the
   verdict was computed from a stale read? Can a reclaimed-and-respawned run
   inherit the previous run's exhausted verdict?

5. Detector correctness. The error detection is an anchored prefix match on
   text returned by an external command. Examine quoting, word splitting, glob
   expansion, regex-vs-literal handling, multi-line replies, empty replies, and
   the failure mode when the reply command itself errors or times out — does a
   command failure read as "no error" (safe) or "error present" (arms the
   ladder wrongly)?

Report defects in the shell implementation and in the assumptions the design
rests on. Do not evaluate whether the feature matches any ticket or spec.

The two runs' findings collapsed to five items. No re-review round ran: the
head this review is anchored to was superseded before one could be useful.

Compliance audit

Ticket #58 ran DIRECT (plan=None), authorized by [board:361]
[gate] pass — claude/DIRECT. The base is main; my manifest snapshots came
from the same ref, and neither manifest exists in this repo.

No PROTOCOL BLOCKER. No SPEC FINDING from the audit itself (one engine
finding was reclassified as one — W1-1 below). The ticket was substantively
ready: Problem with a dated observed incident, Intent, a four-bullet Shape
naming file, phase position, marker home, cap, window, terminal step and the
non-candidate rule, and four checkable Acceptance items. Every Shape bullet is
implemented. The choices that went beyond the ticket's letter — the widened
error vocabulary, BOARD_STALL_MAX_WAIT_MIN, keying the hand-off on a verdict
rather than a count — are all means-level and were disclosed in the PR body.
No human-grade fork was silently assumed; the one adjacent to this work
(surfacing the harness's own isApiErrorMessage flag, which changes sminos reply's output contract) was correctly deferred to #62 rather than decided.

Validation Evidence, verified rather than taken on trust:

Claim Result
test-sweep-stall.sh passes verified — PASS at fcdc466f
run-skill-tests.sh 23 / 0 / 9 verified — 23 passed, 0 failed, 9 skipped, on a clean run at the graded head. (An earlier run of mine showed 22/1/9; that run overlapped the fixer's edits and is discarded. test-subagent-driven-execution.sh, the live-model eval, passed here.)
lint baseline: findings only in files this PR does not touch verified — four files, all pre-existing: test-subagent-driven-execution-integration.sh, test-worktree-path-policy.sh, review-bench/cases/seeded/case4/base/lib/common.sh, review-bench/run-batch.sh. _sweep_api.sh and test-sweep-stall.sh produce zero, before and after wave 1.
_registry_metas row-layout change is covered verified by inspection — the two awk consumers (_metas_for_ticket, _lane_for_ticket) index $1..$7 only, and both while IFS=$'\x1f' read consumers were updated. No consumer reads path positionally from a stale-width row.
version bumped with bump-version.sh in the same commit met as written (7.87.0 in a89c9311) — but see the merge note below

AUDIT NOTE 1 — timestamp-drift check unavailable on this binding. The
protocol anchors on comparing the issue body's last-edited time against the gate
timestamp, reconstructing the at-gate body from GitHub edit history. The API
board exposes no userContentEdits equivalent and the body is claim-served, not
queryable. The event timeline shows register (board:352, actor dp-human)
and no body field-change before the gate, which is as far as this binding
goes. Recorded as a limit, not a finding.

AUDIT NOTE 2 — the follow-up's pre-registration seam search could not run.
board-search.sh is claim-gated for run principals, so the executor could not
check whether #62 already existed. Disclosed in the PR's Confusions. Also
environmental.

Findings, bins, dispositions

Every new finding defaults to WAVE; severity orders the wave, it does not pick
the bin.

id severity finding bin disposition
W1-1 high, SPEC FINDING a seat merely blocked on a human prompt reads as a dead turn WAVE FIXED, graded, accepted — unpushable; still live on 9cfac153
W1-2 high the hand-off's promised escalation is unreachable — the successor path resets the ladder on delivery WAVE FIXED, graded, accepted — superseded: 9cfac153 fixes the same defect as _stall_cycles
W1-3 high exhaustion can be stamped on, or survive into, an actively working run WAVE FIXED, graded, accepted — unpushable; still live on 9cfac153, with a larger blast radius there
W1-4 medium a failed or empty reply read clears the whole ladder, hand-off included WAVE FIXED, graded, accepted — superseded by 9cfac153
W1-5 medium the attempt is charged before the budget and bearer gates decide there will be no nudge WAVE FIXED, graded, accepted — superseded by 9cfac153

W1-1 is classified a SPEC FINDING as well as an engine finding: dp#58's Shape
names this exact case as one the phase must leave alone — "A worker that is
idle for a non-error reason (waiting on a permission prompt, a park it already
recorded) is not touched."

No TOO BIG item; no ticket registered. No LOG-by-departure during the loop.

Wave 1

Five items, one fixer, five commits on fcdc466f, each touching only
_sweep_api.sh and test-sweep-stall.sh, each claimed by exactly one item.
Quiescence confirmed on two matching content fingerprints; graded from a
read-only submitted snapshot; all five accepted into the ledger. Drill went
57 → 113 assertions, PASS; full suite 23/0/9; lint baseline unchanged.

714cacf7 W1-1 · 038f7bce W1-3 · 48e2d9e1 W1-4 · b1fceca8 W1-5 ·
2603b793 W1-2

The push gate refused. origin/58-api-stall-recovery had moved from
fcdc466f to 9cfac153 while the wave ran (three commits at 06:58, 07:05,
07:07Z). Per the reviewer protocol's authority clause, a moved head is never
rebased or salvaged — the commits stay local and unpublished. They are a
reference implementation for the two findings below, not something to cherry-pick
blind.


Still live on 9cfac153 — the actionable part

Both verified against git show origin/58-api-stall-recovery:skills/issue-tracker/scripts/_sweep_api.sh.

1. A seat blocked on a human prompt is still read as a dead turn (was W1-1)

_stall_reply's comment at line 745 still asserts that sminos reply owns "the
two renderings that must NOT read as errors (a pending AskUserQuestion, the
harness-prompt marker)"
. That assertion is false, and nothing on this head
compensates for it:

  • sminos.py:1008 transcript_reply() builds its output as the last assistant
    message carrying text, scanning backward, and then appends
    \n[pending AskUserQuestion — …]. record_reply() (:1042) appends
    [blocked on a harness prompt — …] the same way for a blocked /
    done-blocked turn with no pending question.
  • Both markers are a suffix. An anchored first-line match reads straight
    past them to whatever text preceded.
  • sync_one() (:2231) maps harness state done-blocked to seat
    status: "idle", and _liveness returns live for it — so such a seat is
    a full stall-phase candidate.

Reachable sequence: a turn dies on a 429 (that error is the last assistant
text); the worker is woken — by this phase's own first nudge, by the relay, or
natively — and its next turn stops at a permission prompt or an
AskUserQuestion before emitting any text. The rendered reply then begins with
API Error: …. The phase nudges, which interrupts the pending call, spends a
ladder the worker was never on, and ends with the hand-off.

There is no BLOCKED_RE or equivalent anywhere on this head. The local fix
(714cacf7) matches either marker line-anchored over the whole turn and decides
it before the metalock, as a distinct blocked verdict that marks, clears and
charges nothing — so a standing ladder neither advances nor resets while the
seat waits on a human. Drill fixtures u-askq and u-hprompt pin it, plus a
case that puts the marker on a seat mid-ladder.

2. The hand-off still rests on an unlocked idle reading — and now ends the run (was W1-3)

Two halves of the gap between observing idle and acting on it, both still open:

  • phase_stall's candidate gate (:1069) checks status = idle outside the
    registry lock, and _stall_step re-validates only run_id under it
    (:964-965). A wake landing in that window — the relay, an operator, a native
    SendMessage — leaves the seat working while the step charges a ladder, or
    stamps the hand-off, from the stale reading.
  • phase_renew's hand-off arm (:613) is
    if [ -n "$sexhausted" ] && [ "$sexhausted" = "$run" ] with no re-check
    that the seat still reads idle. A worker revived after the stamp is not
    reconsidered.

The comment above that arm states the safety property the code does not enforce:
"this arm would take the run from a worker that just recovered and is mid-turn.
stall_exhausted is written only where phase 1b sees the other half: the
attempts are gone AND the seat is idle on a harness error again."
True at the
moment of writing; nothing re-checks it at the moment of acting, and the write
itself rests on an unlocked read.

This got sharper on this head, not softer. 9cfac153's hand-off no longer
merely withholds the lease — it calls end_run(abandoned) and
_retire_run_locally. That change is right on its own terms (the stranded-meta
P1 it fixes is real and was not in my findings). But it converts a stale stamp
from "a lease decays somewhat early" into "the run is ended and the meta
stripped, immediately, under a worker that is mid-turn
". The two changes
compound: the more decisive terminal step needs the tighter idle check, and the
tighter check is the one that is missing.

The local fix (038f7bce) re-reads status under the lock alongside run_id,
and moves phase_renew's liveness call — which is also the sync that promotes a
natively woken seat — ahead of the hand-off arm, which then binds only while the
seat still reads idle. The stamp itself is deliberately not cleared there;
phase 1b re-reads the turn the moment the seat is idle again, and clearing on
recovery stays the one place that decision belongs. Drill fixtures u-gap
(a wake in the window) and u-revived pin both.

3. Version collision with #59 — 7.90.0 is taken twice

9cfac153 bumps this branch to 7.90.0. The cross-ticket note posted at
07:14:53Z — seven minutes after that commit — records that #59 already took
7.90.0
and that 7.91.0 was free at the time. Whichever of the two merges
second lands under a number the marketplace cache already holds, which is
exactly the failure CLAUDE.md documents: the plugin reports "already at the
latest version" and the update never installs. Someone has to arbitrate the two
branches' numbers, and re-check against main at merge time.

The four version manifests remain the only files that conflict with main;
git merge-tree confirms every other path merges clean. That conflict cannot be
resolved by taking either side verbatim.


Deferred findings

TECH_DEBT_ISSUE is none, so these are recorded here rather than on a tracker.

  • A permanently bearerless bound meta no longer has any exit. Surfaced by the
    fixer while closing W1-5, on my local chain; the same shape exists on
    9cfac153, which made the equivalent eligibility change. Before it, such a
    meta burned three attempts it could never spend and was handed off; now it
    never advances the ladder at all and waits indefinitely for phase 1's bind
    repair — which cannot authenticate without the bearer either. The old escape
    was accidental rather than designed, and the state should be unreachable
    (the dispatcher writes run_bearer at claim time), so this is noted, not
    fixed.
  • The ticket-level lap counter clears on an ordinary turn from a run that never
    stalled
    , not only on a turn that clears a standing marker. Deliberate on both
    lines of work: without it, a stale count would escalate a much later, unrelated
    outage early. Worth knowing it is a choice.

Environmental friction

ENV_TRACKER_ISSUE is none, so recorded here.

  • board-search.sh refuses ?q= / include=body to run bearers, and a worker's
    board reads reach only its own ticket and its direct children. I could not read
    Smooth the controlled track: machine-reviewed spec→plan→execute, retire executing-plans (v7.49.0) #62 to confirm the follow-up registered (GET /tickets/62 refused: forbidden),
    and the executor could not run the ticket contract's pre-registration seam
    search for the same reason. This is the second run to hit it; it is the same
    gap the PR's Confusions section reports (arkho#12).
  • The API board has no route to a ticket body's edit history, so the compliance
    audit's timestamp-drift check has no binding-native equivalent. See AUDIT NOTE 1.

Tier

PARKED. Not the merge tier and not observation mode. The merge verdict's
three clauses cannot even be evaluated against a head this review never saw, and
the reviewed head is superseded. Auto-merge is off on this binding in any case.
Ticket #58 goes to needs-human:

  • reviewed head fcdc466f; current remote head 9cfac153
  • five graded fixes are local and unpushable; three of the five are superseded by
    work already on the branch
  • two findings are still live on the current head, written out above
  • one merge-blocking version collision needs a human to arbitrate

<review-tmp> and the dispatcher control directory are preserved for a resumed
turn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant