Skip to content

Fleet-state JSON still travels to jq in argv outside the sites TD-PPagop-26081301 enumerated

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

TD-PPagop-26081301 converted every --argjson delivery site it enumerated to requirement 4g’s stdin delivery. The sites below were not on its list and are still in argv, and each carries fleet state rather than the configuration-bounded values requirement 4g permits there (a model name, a config object, a prompt sha, one repo’s register ids). None is near MAX_ARG_STRLEN (131072 bytes) today; they are recorded here because TD-PPagop-26081301 is now resolved, so without this record the residue is not written down anywhere.

They are listed loudest-failure-first, since that is the order in which they are worth converting:

  • scripts/gather-merge-conflicts.sh’s per-candidate array append (--argjson c "$cand") is the one whose input is genuinely unbounded rather than merely growing: the candidate carries body: ($pr.body // ""), a whole pull-request body, which nothing in this system caps. The append is unguarded, so past the cap the script dies under set -e and the repo’s whole merge_conflicts band is lost — loud, at least, unlike most of this list.
  • agent-cycle.sh’s per-repo claims fold (--argjson items "$repo_claimed_json", requirement 3o) delivers the claims array — one of the five aggregates requirement 4g names by name as growing with the fleet’s history — in argv. Unguarded, so it fails the cycle loudly rather than silently, which is the only reason it is not first here.
  • agent-cycle.sh’s verdict-contradiction logging (requirement 3v) passes --argjson items "$unaccounted_json" at four call sites — the unaccounted eligible items, carried whole out of the pre-fetched bands. Past the cap the Script would lose the very event that records a Co-Ordinator contradiction, which is the record the crash-loop ladder and the dashboard read.
  • scripts/gather-hand-flagged-refinements.sh’s per-item array append (--argjson e "$entry") is the exact shape TD-PPagop-26081301 converted in scripts/gather-tech-debt.sh, left behind only because it was not on that item’s list.
  • lib/work-gone.sh work_gone_clearances still takes --argjson register, --argjson review and --argjson plan. TD-PPagop-26081301 converted this function’s blocked and states arguments and named only those two, so these three side-channel status maps stayed in argv; each holds one short entry per blocked item of its class, so they are the smallest thing on this list, but they still grow with the blocked set rather than with configuration.
  • agent-cycle.sh’s Enabler and Refiner claim accumulators (--argjson e "$entry", the loops that build claimed_json) deliver one blocked entry each, evidence payload included.
  • agent-cycle.sh’s two unparseable-verdict warnings (--argjson items "$items_named_json") deliver a list trimmed to {repo, item} — the most bounded of this list, and included only so the sweep is complete.

The fix is the same mechanical conversion at each: concatenate the documents (docs="$a"$'\n'"$b"), deliver with a here-string, bind positionally with input as $name in the printed order. Convert a site together with a test that pins its fail-safe direction past the cap, as requirement 4g’s own acceptance check now requires and as test/work-gone.test.sh, test/pr-claim-exclusion.test.sh and their siblings do for the sites TD-PPagop-26081301 converted.

On the four sites whose fail-safe direction did change

Section titled “On the four sites whose fail-safe direction did change”

Three sites in the two gatherers and one in agent-cycle.sh gained a guard they did not have, which the review of PR #366 raised against the rule above. They are kept, for a reason the rule’s own premise gets wrong at those sites: neither gatherer runs under set -e (both are set -uo pipefail), so the pre-conversion behaviour was not the clean death the rule assumes but an empty $out cascading through every later append until the repo’s whole band came out empty. A per-candidate skip is strictly better than that, and retry_work_order_filtered_json’s fallback to the unfiltered work order is a safe superset — at worst some redundant processing for an item attempt 1 already accounted for.

What was not kept is the 2>/dev/null those guards arrived with. Fail-open is a judgement; fail-open silently is not, least of all in merge_conflicts, the band whose whole job is visibility, where it let a candidate leave with no stderr, no event and nothing in the output — indistinguishable from a candidate that was never there. Both gatherers now report a dropped candidate on stderr, per issue and per pull request rather than per band, and let jq’s own message through with it: the direction scripts/gather-tech-debt.sh and scripts/gather-issues.sh already take with || degrade "array assembly failed at …". Pinned by test/merge-conflicts.test.sh and test/needs-refinement.test.sh, in the direction each fails.