Skip to content

Issue #248's pickup-latency acceptance is unmeasured, and its stage 3 has no record once the issue closes

Id: TD-PPagop-26080808 · Status: resolved · Filed: 2026-08-08 · Resolved: 2026-08-14 · Ref: https://github.com/Poetic-Poems/agent-ops/pull/350

PR #268 delivers stages 1 and 2 of issue #248 — finish-then-continue (lib/chain.sh, agent-cycle.sh’s chain gate, requirement 39) and the sub-hourly cycle interval (schedule.cycle_interval_minutes, requirement 2.6’s crontab) — and closes the issue. Three of the issue’s own acceptance items do not travel with it.

The two metrics cannot be checked before deployment, and nothing asks for them afterwards. Acceptance 4 is “median claimed time under 20 min measured across fleet with >1 active node” and acceptance 5 is “no increase in duplicate-work incidents relative to before this feature”. Both are properties of the running fleet, not of the diff, so no test or CI job can stand in for them. The Closes #248 keyword retires the only place they are written down the moment the PR merges, which leaves the change’s stated success criteria unowned rather than unmet.

The data to answer both already exists in the event stream: selection events carry race_losses (requirement 17d, new in the same PR) and every claim failure logs claim-lost with its cause, so acceptance 5 is a ratio over the union log rather than new instrumentation. Acceptance 4 needs the gap between an item first appearing in a gathered source and the selection that claims it, which is not currently recorded as a pair.

Stage 3 loses its record too. The issue defers event-driven dispatch — GitHub webhooks, or a poller on the state repo, waking an idle node when a source-relevant event lands — to Phase 2, gated on WI-2’s PR-level claim exclusion. docs/ROADMAP.md’s Phase 2 section does not name it, so once #248 closes the only description of stage 3 is in a closed issue’s body.

There is also a cost the change makes and does not measure, which D14 in docs/ROADMAP.md asks to be a recorded decision rather than a surprise on a bill. chain_sources_remain counts enabled source categories, not items, and back-pressure narrows .sources to the three finishing sources rather than emptying it (agent-cycle.sh, the ordered_repos_json narrowing), so the “sources remain” half of the gate is non-zero in essentially every reachable state and max_chained_cycles is the only bound that fires in practice. A productive cycle raises a pull request, which moves the no-op fingerprint, so each chained cycle pays a full Co-Ordinator run rather than short-circuiting on lib/noop-skip.sh — at the default of 3, two extra Co-Ordinator calls per productive cycle whether or not anything was left to pick up.

Where: lib/chain.sh, agent-cycle.sh (the chain gate and the race_losses counter), requirements 39 and 17d in docs/IMPLEMENTATION-PIPELINE-SPEC.md, docs/ROADMAP.md (Phase 2), and issue #248.

Suggested fix: three separable pieces, in increasing size.

  1. Record stage 3 where it will still be read — a Phase 2 line in docs/ROADMAP.md, or a fresh issue carrying the deferred text — before #248 closes.
  2. Answer acceptance 5 from the union log as it stands: the rate of claim-lost with cause: "held" per selection, before and after this change, which needs no new events.
  3. Answer acceptance 4, which does need a new one: the timestamp at which an item first became visible in a gathered source, so the interval to its selection is computable. That is the piece worth designing rather than bolting on, since “first visible” has to mean the same thing across sources that are gathered on very different cadences.

Run 2026-08-14 via scripts/pickup-metrics.sh (no arguments — the whole log, no --since bound), against the live union log: this node’s own state_dir/log.jsonl plus every peer’s, ~15,900 lines after defensive parsing dropped one malformed trailing line (the log was being appended to while this ran, exactly the condition the script’s line-at-a-time parsing exists for). Window covered: 2026-07-13T04:44:34Z – 2026-08-13T14:37:23Z, split per node at that node’s own first chained event — all four fleet nodes at the time (ockham-2, ockham-container, poetic-1, poetic-2) first chained within a few hours of each other on 2026-08-08, the day #268 merged.

  • Before finish-then-continue, summed per node: 295 selections, 28 contended claim-lost (held or pr-held) — ratio 0.095 (about 1 contended loss per 10.5 selections).
  • After: 117 selections, 118 contended claim-lost — ratio 1.009 (about 1 contended loss per selection) — roughly a 10.6× increase.

Method: scripts/pickup-metrics.sh’s own definition (component 21, docs/IMPLEMENTATION-PIPELINE-SPEC.md) — a claim-lost counts as contended only when its cause is held or pr-held; every other cause, and a line carrying no cause at all, is excluded rather than guessed at.

Verdict: by the operational measure this item’s own suggested fix set — contended claim-lost per selection — acceptance 5 as literally measured does not hold: contention rose about tenfold once nodes started chaining. Read carefully, though: a held/pr-held loss is requirement 17d’s own healthy, recovered contention, not duplicate completed work — the atomic claim (17a) is what actually prevents that, and a lost race never reaches the Implementer — so this is evidence that nodes now race for the same item far more often, which is the expected side effect of running many more selection attempts per unit wall-clock time, not evidence that any work was ever duplicated. Whether that higher contention rate is itself worth reducing — every lost race still spends a claim call — is a question this measurement raises but does not answer.

Acceptance 4 (median pickup latency) is not answered here — it needs a new event this item deliberately does not add. Filed as tech-debt/TD-PPagop-26081405.md.