Skip to content

Board client reads the paged surface (read-surface program, patch 2) - #74

Merged
SSFSKIM merged 23 commits into
mainfrom
board-client-paged-reads
Aug 19, 2026
Merged

SSFSKIM merged 23 commits into
mainfrom
board-client-paged-reads

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Aug 18, 2026

Copy link
Copy Markdown
Owner

What this is

Patch 2 of the read-surface program (parent: arkho#10 / arkho PR #11, live on production 2026-08-18). Migrates every production board read in skills/issue-tracker/ off whole-board bare-array reads onto arkho's paged surface, through the single choke point _board_api.py. Spec: docs/doperpowers/specs/2026-08-18-board-client-paged-reads-design.md (v1.1 + finish-time tail). Releases as v7.55.0.

The shape

  • Four paged helpers — ticket() (by-id; 404 authoritative, with a rollback probe that re-asks the by-id read once the surface is proven), tickets_by_ids() (ids= chunks of ≤200), tickets_all() / queue_decisions_all() (materialized cursor walks; no partial board can escape — a failed page dies before anything returns).
  • 11 sites migrated (sweep lift/escalate/duplicate-recovery, show, transition --plan gate, list, lint, reconcile ×2, map, answer). 5 flat-route sites (unrelayed ×2, needing-resume ×2, timeline) carry cap-awareness comments naming their documented bounds — no paged form exists server-side.
  • Walk-absence semantics: report-grade by contract; the four action-taking sites each carry their own action-grade evidence rule (lint's by-id absence-confirm, answer's re-walk-once, show/transition's authoritative 404).
  • Legacy tickets() / queue_decisions() deleted; integration drill-lib reads by id with byte-identical output contracts.

Review trail

  • 7 SDE task reviews, every one running a mutation battery in a disposable copy (dozens of mutants killed across the epic; several vacuous-assertion classes caught and fixed).
  • 4 codex whole-branch rounds (gpt-5.6-sol, base 64967f7): rounds 1–3 each found fail-closed edges against malformed/version-skewed servers (half-envelope probe, empty-string cursor, cursor cycle, probe-dated 404) — all fixed at the choke point with bounded drills; round 4 clean.
  • Tests: 13 board-api unit suites green (847 assertions); integration tier green against a local docker board (8/8, including escalation's live owner=[None] contract); acceptance walked item-by-item with measured wire evidence.

Rollout

Merging starts the soak: days of clean live sweep/cron operation on this client is the gate for patch 3 (arkho's bare-array retirement). Two follow-up ticket candidates recorded in the ledger: the test runner counts integration exit-77 skips as failures; board-transition junk-ref without --plan surfaces a raw ValueError.

🤖 Generated with Claude Code

https://claude.ai/code/session_01R8uGu8nAKgDauJcD3CM6PK

SSFSKIM added 23 commits August 18, 2026 21:12
…old a partial board

The dedupe drill asserted `title3=c` by substring against a fixture whose
page-1 copy was titled `c-early`, so the first-wins mutant it exists to catch
matched it. The two titles are now disjoint (`stale` vs `c`) and the printed
value is bracketed. The same hazard ran through every request-count assertion
(`reqs=3` is inside `reqs=30`), so `reqs()` prints `reqs=[N]`.

The /tickets cursor fixtures were pairs; that route keys on
(priority, created_at, id), so the cursor arkho issues is a triple and
decodeCursor refuses the wrong arity for a route. Regenerated against
encodeCursor's convention — the queue cursor Q1 recomputes byte-for-byte,
which is what proves the convention. Q1 is a pair and stays one.

The empty-states drill asserted only that `states=` never reached the wire,
which a call that died before requesting also satisfies; its positive partner
now says the unfiltered read happened.

_walk returns a list rather than yielding: a failed page dies inside request()
before the return, so a partial board is unrepresentable rather than merely
unconsumed by today's callers. die() gains NoReturn, which is what clears
pyright's two reportOptionalSubscript reports at the walk.
…s only board read

The acceptance walk for the board-client-paged-reads spec ran green: no
production script calls a bare list form; board-show answers by id and dies
`no ticket #N` on a 404 against the live docker board with no whole-board
listing on either path; the mid-walk interruption drills refuse to hand back
a partial board; every unit suite and all eight board-api integration suites
pass.

The spec's acceptance item 2 said the paged surface was board-show's "only
read". Measured, it is three — by-id, the documented flat timeline route, and
the one-shot rollback probe on an unproven server. Item 2 now names all three;
the claim that carries the design (no bare listing) is unchanged, and so is
the shipped code.
… cursor is malformed

Two ways the paged read surface could be trusted on evidence that did not
support it.

The rollback probe checked only that the answer was an object carrying
`items`. A partially rolled-back or version-skewed server answers that and
nothing else — no `next`, no `as_of` — and the probe marked the surface
proven anyway, which promotes the 404 that triggered it to an authoritative
absence. board-lint retires live daemons on that answer. The probe now goes
through the same `_envelope` validation every page does, and carries its
rollback diagnosis into the die as context so the operator still reads why
the not-found was route-level rather than a missing ticket.

`next: ""` passed the envelope check (it is a str) and then walked forever:
the walk appends a cursor on truthiness, so an empty one refetches page 1
and `next is None` never arrives. `next` is now null or a NON-EMPTY cursor,
rejected at the choke point rather than defended against in the walk.

Drills: a page whose next is empty dies with nothing escaping (bounded, so a
regression fails instead of hanging), and a probe answering half an envelope
neither proves the surface nor reports absence. Reverting the empty-cursor
check hangs the first to a TIMEOUT; reverting the probe validation fails two
assertions of the second. 38 -> 43 ok.
The DOPEN drill was an `nt` alone: it says no retire FAIL is printed for a
daemon whose ticket the walk serves as open, which a lint that bailed before
reaching any verdict in that world also satisfies. Pair it with the report
line, as the DMOVER block above already does. 78 -> 79 ok.
…en claim says how

Item 2's revision already named the rollback probe as one of board-show's
three reads; item 1 still said every /tickets read was by-id, ids= or a
walk. Item 1 now names the probe as the fourth read kind. Item 2's revision
gains its measurement method — a logging reverse proxy in front of the
harness board service — so the inventory is reproducible rather than
asserted.

A third note records how item 4's "suites green" is discharged: every
deterministic suite green, integration green separately under ARKHO_DIR.
The repo runner disagrees (18 passed / 7 failed, STATUS: FAILED) because it
counts the integration tier's exit-77 skip gate as a failure — accounting
that came in on main with d52eee6, a runner follow-up, not a branch defect.

The task-7 report's "29 assertions" for test-paged-reads.sh was corrected to
the measured 43 in the same pass, and the fix report written beside it, but
.doperpowers/ is gitignored so neither rides in this commit.
… hang the walk

`_walk` followed `page["next"]` verbatim with no memory of where it had
already been. The empty-cursor fix closed the shape a type check let through;
this is its sibling in a shape nothing validates: a well-formed, non-empty
cursor the server hands back a second time — the same token again, or a cycle
A→B→A. Every page is a complete envelope, every page validates, and the walk
still never ends. A version-skewed server or an intermediary answering from a
stale plan turns every migrated board and queue read into a hang or an
exhausted heap, which is not the fail-closed death this module owes its
callers.

The walk now remembers the cursors it has followed and dies on a repeat,
naming the page that served it. The first request carries no cursor and cannot
collide with one, since a cursor is a non-empty string, so the set of followed
tokens is the whole guard.

Drill: page 1 answers a cursor whose own page answers that same cursor again;
the walk dies naming the repeat, no rows escape, and the request count proves
it followed the token exactly once. Reverting the guard turns that drill into a
bounded TIMEOUT with 263,473 requests spent. 43 -> 46 ok.
…re it

An authoritative absence has to rest on a 404 observed with the paged
surface proven. When the probe runs, the 404 preceded the proof: across a
service version transition the two requests can land on different
instances — the old one answering a route-level 404, the new one the
envelope — and taking the probe as proof would report a live ticket as
gone. ticket() now re-issues the by-id read once the probe validates and
returns that answer: a row rescues the false absence, a second 404 is the
authoritative one. The already-proven path still costs exactly one read.
# Conflicts:
#	.claude-plugin/marketplace.json
#	.claude-plugin/plugin.json
#	.codex-plugin/plugin.json
#	package.json
@SSFSKIM
SSFSKIM merged commit 57421db into main Aug 19, 2026
@SSFSKIM
SSFSKIM deleted the board-client-paged-reads branch August 19, 2026 10:41
SSFSKIM added a commit that referenced this pull request Aug 19, 2026
Post-merge follow-ups from PR #74: gated exit-77 accounting + junk transition ref refusal
SSFSKIM added a commit that referenced this pull request Sep 24, 2026
… of review-recover, re-read before the write, sync the seat, bump the version
SSFSKIM added a commit that referenced this pull request Sep 24, 2026
SSFSKIM added a commit that referenced this pull request Sep 24, 2026
SSFSKIM added a commit that referenced this pull request Sep 24, 2026
…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.
SSFSKIM added a commit that referenced this pull request Sep 24, 2026
…-null remote owner_run is left for its home host (R3-F2, human's second re-pin)
SSFSKIM added a commit that referenced this pull request Sep 24, 2026
…losed as its run (R3-F1: dead-run close leaks the seat slot)
SSFSKIM added a commit that referenced this pull request Sep 24, 2026
…cket to the recovery lifecycle (R5-F1: automation close leaked the reclaimed dead seat)
SSFSKIM added a commit that referenced this pull request Sep 24, 2026
…, R1-F3); pre-existing dead-session slot gap filed as #75
SSFSKIM added a commit that referenced this pull request Sep 24, 2026
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.
SSFSKIM added a commit that referenced this pull request Sep 24, 2026
…viewed head (#182)

* spec(#74): the API tick's finalize pass — a merged PR at the reviewed head closes its ticket

* spec(#74): second revision after the adversarial review — order ahead of review-recover, re-read before the write, sync the seat, bump the version

* sweep(api): a finalize pass closes a ticket whose PR merged at the reviewed head

* tests: the api finalize pass, hermetic

* qa-loop: the trail names the reviewed head; the API finalize pass beside gh's FINALIZE

* spec(#74): record full-tier verification

* spec(#74): record the PR and handback constraint

* sweep(api): finalize treats a dead owner as not mid-turn

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.

* sweep(api): finalize writes nothing when the registry scan fails

_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.

* sweep(api): finalize renews live leases on a clock across its scan

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.

* spec(#74): re-pin — finalize leaves a live owner whose QA child still reviews (R2-F1)

* sweep(api): finalize leaves a live owner whose transcript tree is still 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).

* sweep(api): finalize holds a ticket whose owner carries an unresolved 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.

* sweep(api): finalize takes its list round-robin past the last ticket 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.

* qa-loop: the reviewed-head trail line is a PR review's; a scale trail 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.

* sweep(api): finalize bounds its GitHub read under the tick lock

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).

* spec(#74): the retrospective reflects the review loop's changes and the 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.

* spec(#74): re-pin — automation close only for a null owner_run; a non-null remote owner_run is left for its home host (R3-F2, human's second re-pin)

* sweep(api): finalize closes as automation only for a null owner_run; 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.

* sweep(api): under `all`, finalize takes a share of the tick, not all 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.

* spec(#74): re-pin — a dead local owner is left for the reclaim, not closed as its run (R3-F1: dead-run close leaks the seat slot)

* sweep(api): finalize leaves a dead local owner for the reclaim instead 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).

* spec(#74): re-cut — finalize leaves any lingering-predecessor-seat ticket to the recovery lifecycle (R5-F1: automation close leaked the reclaimed dead seat)

* fix(api): leave reclaimed tickets with lingering owner seats for recovery

* spec(#74): re-pin — state finalize's liveness/cleanup honestly (R1-F2, R1-F3); pre-existing dead-session slot gap filed as #75

* fix(api): read BOARD_GH_TIMEOUT as decimal before finalize's share arithmetic (W1-1)

* test(api): size the budget-long first-read ticks for the phases behind 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.

* fix(api): cap finalize's GitHub read bound below the run lease (W2-2)

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.

* fix(api): cap finalize's renewal interval below the run lease (W2-3)

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.

* spec(#74): refresh Outcomes after the QA fix waves (WC-1)

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.
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