[claude] Fix cycle-metrics pipeline: seed issue= from queue so retro is never null (#1250) #1253
Reference in New Issue
Block a user
Delete Branch "claude/issue-1250"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #1250
Root cause
loop_guard.pysignals readiness (exit 0) when it finds work inqueue.json, but never recorded which issue it selected. Whenclaude-loop/gemini-loopdispatchers run without writingcycle_result.jsonthemselves,cycle_retro.pyhad no source for the issue number → all cycles loggedissue=null→summary.jsonshowed 0% meaningful success.Fix
scripts/loop_guard.py— two additions:seed_cycle_result(item)— pre-seeds.loop/cycle_result.jsonwith{"issue": N, "type": T}from the top ready queue item whenloop_guardfinds work, but only if the file does not already exist (agent-written results always win).--pickflag — prints the selected issue number to stdout so shell scripts can capture it (ISSUE=$(loop_guard.py --pick)).tests/loop/test_loop_guard_seed.py— 9 new unit tests covering:main()seeds on ready queue; does not create file when queue empty--pickprints issue; does not print anything on empty queueAll 435 tests pass (2 pre-existing failures in
test_three_strike_routes.pyare unrelated to this change).