Skip to content

the pre-flight already-done check still pays a register read for a tech-debt item whose ref is now an issue number

Id: TD-PPagop-26082921 · Status: resolved · Filed: 2026-08-29 · Resolved: 2026-09-30 · Ref: https://github.com/Pullwright/agent-ops/pull/1952

Noticed while reviewing PR #923 (agent-ops#875, D15 as revised #869), which moved the tech-debt band’s store from the in-repo register to pw::type:tech-debt-labelled issues, making a tech_debt entry’s ref a bare issue number instead of a TD-<scope>-<date><nn> register id.

agent-cycle.sh’s pre-flight already-done check (requirement 34m) still special-cases the band on the old shape:

Terminal window
if [[ "$selected_source" == "tech-debt" ]]; then
preflight_register_json="$(jq -nc --arg s "$selected_repo" \
--argjson m "$(gather_register_status "$selected_repo" "$selected_default_branch" selected "$selected_item")" \
'{($s): $m}')"
fi

scripts/gather-register-status.sh resolves an id only when exactly one tech-debt/*.md file claims it by id or legacy-id. A bare issue number never will, so from #923 onward this read is guaranteed to resolve nothing on every tech-debt claim.

It is harmless — “unknown is never gone” (requirement 34i), so an unresolved id decides nothing and the item proceeds — and the done-signal it used to provide is not lost: work_gone_clearances keys on the item ref’s shape, so a bare number now takes the issue branch of that dispatch and is answered from source_states_json’s open-issue digest, exactly as an issues item is. That is why #923 did not need to touch this to be correct, and requirement 34m’s text still describes what the code does, so the as-built rule is satisfied either way.

What is left is a read that costs a gh call per tech-debt claim and can no longer contribute an answer, plus a requirement whose stated rationale for that read (“a freshly claimed item was never a member of the blocked set register_status_json is otherwise scoped to”) no longer applies to this band.

Removing the block means editing requirement 34m, acceptance check 8n and test/preflight.test.sh — which asserts, deliberately, that “a tech-debt item whose register row pre-flight never fetched” decides nothing — in a pull request whose subject is the gatherer. It is also adjacent to agent-ops#879 (“claim, resolve, and defer debt as issues”), which drops lib/claim.sh’s tech-debt special case for the same reason, but #879’s stated scope does not name this call site, so it would be easy for both to leave it standing.

Drop the selected_source == "tech-debt" block and pass {} as preflight_done_reason’s register map for every source, keeping gather_register_status itself (requirement 34i’s blocked-set pass still uses it, and register-shaped refs still exist as history and in unmigrated repositories). Reword requirement 34m and acceptance check 8n so the register read is described as what it becomes — a shape that no longer arises from a live band — rather than as a per-claim cost. Keep test/preflight.test.sh’s “passing no register map must decide nothing” assertion; it stops being about tech-debt and starts being about a caller that has nothing to pass.

Best done with, or immediately after, agent-ops#879.

Migrated to https://github.com/Poetic-Poems/agent-ops/issues/1034.