Skip to content

The fit-exemption gate's ${coordinator_fit_report_json:-{}} default appends a stray brace, so requirements 34e (fourth refusal), 3x (trimmed exemption) and 17g are all dead code on every fitted cycle

Id: TD-PPagop-26082816 · Status: resolved · Filed: 2026-08-28 · Resolved: 2026-08-29 · Ref: https://github.com/Poetic-Poems/agent-ops/pull/940

What. agent-cycle.sh (currently line 1767) gates the fit-exemption set on:

Terminal window
if jq -e '.applied == true' <<<"${coordinator_fit_report_json:-{}}" >/dev/null 2>&1; then

In bash, the } that closes ${parameter:-word} is the first unquoted }, so the expansion is ${coordinator_fit_report_json:-{} (default word {) followed by a literal }. When the variable is unset or empty that happens to compose {} and behave; but on every cycle the fit actually ran, the variable is non-empty and the expansion appends the stray brace to the value — jq receives {"applied":true,…}}, fails to parse, and the guard reads as “fit did not run”. Verified empirically: x='{"applied":true}'; jq -e '.applied == true' <<<"${x:-{}}" fails to parse. The guard therefore fires on no input whatsoever.

Consequences. coordinator_fit_trimmed_json is permanently [] and coordinator_fit_rung permanently 0, which kills three requirements at once, silently:

  • Requirement 34e’s fourth refusal (issue #683, shipped in PR #775) — the refusal of a needs_refinement block whose stated reason is the Script’s own trimming — never fires. This is the guard that would have refused the 2026-08-26T22:23Z Co-Ordinator run that re-blocked #769 and nine sibling already-refined items (#684, #692, #695, #696, #714, #756, #757, #794, #822), the incident escalations #844/#847/#848 were raised for.
  • Requirement 3x’s trimmed exemption (issue #683): coordinator_unassessable_items always receives an empty trimmed set, so coordinator-input-fit-unassessable has appeared in no fleet log across the ~60 fitted cycles since the guard shipped — while the same functions run by hand against a live cycle’s bands (image build 2911275f, PR #835) detect 32 trimmed eligible candidates.
  • Requirement 17g’s fabrication check (issue #821, PR #825): item_text_fault (lib/candidate-select.sh:679) returns clean immediately for any candidate not listed in the trimmed set, so with the set permanently empty the check inspects nothing — claim-skipped with cause: "fabricated" is unreachable, and item_text_supply’s live-text append is likewise never reached for a trimmed candidate.

Suggested fix. Use a brace-free default the expansion cannot truncate — initialise coordinator_fit_report_json='{}' where it is declared (the pattern the neighbouring coordinator_fit_terms_json handling already survives on), or gate on <<<"${coordinator_fit_report_json:-null}" (jq parses null, and .applied == true is false). Add a regression test that feeds a non-empty fit report through the gate — every existing pass worked on the empty case, which is the one case the bug leaves working — e.g. in test/coordinator-input-wiring.test.sh, asserting coordinator_fit_trimmed_json is non-empty after a fitted cycle whose bands carry an elision marker. Sweep the repo for other :-{}/:-[] brace-defaults with the same shape while there (grep -rnE ':-\{\}\}|:-\[\]\]' agent-cycle.sh lib/ scripts/).

Noticed by an interactive Claude Code session resolving escalation #844 (the #769 decision), verifying the escalation body’s own report of the defect; that cycle (20260827T173558Z-poetic-1-665874) stated a record “is being filed” but none reached the register.