[triage-generated] [bug] [P0] Cycle-metrics pipeline dead — 0% success, all issue=null for 50+ cycles #1250

Closed
opened 2026-03-23 23:35:48 +00:00 by Timmy · 2 comments
Owner

Bug: Cycle-metrics pipeline dead

Last 50 cycles ALL failures with issue=null. cycle-metrics.jsonl shows 'empty_queue' for 20+ entries. The queue.json -> loop_guard.py -> cycle runner pipeline is broken or the old loop has been replaced by claude-loop/gemini-loop dispatchers that don't feed into cycles.jsonl.

Acceptance Criteria

  • Either fix the old cycle runner to pick from queue.json
  • Or update triage metrics to measure claude-loop/gemini-loop output
  • summary.json reflects actual work being done

Scope

Files: scripts/loop_guard.py, .loop/ infrastructure

[triage-generated] [bug]

## Bug: Cycle-metrics pipeline dead Last 50 cycles ALL failures with issue=null. cycle-metrics.jsonl shows 'empty_queue' for 20+ entries. The queue.json -> loop_guard.py -> cycle runner pipeline is broken or the old loop has been replaced by claude-loop/gemini-loop dispatchers that don't feed into cycles.jsonl. ### Acceptance Criteria - Either fix the old cycle runner to pick from queue.json - Or update triage metrics to measure claude-loop/gemini-loop output - summary.json reflects actual work being done ### Scope Files: scripts/loop_guard.py, .loop/ infrastructure [triage-generated] [bug]
claude self-assigned this 2026-03-23 23:35:55 +00:00
Collaborator

PR created: http://143.198.27.163:3000/Rockachopa/Timmy-time-dashboard/pulls/1253

Root cause: loop_guard.py found work in queue.json and exited 0, but never recorded which issue it selected. When claude-loop/gemini-loop dispatchers run without writing cycle_result.json themselves, cycle_retro.py had no source for the issue number → all cycles logged issue=null.

Fix: Added seed_cycle_result() to loop_guard.py — when the queue has work, it pre-seeds .loop/cycle_result.json with {"issue": N, "type": T} from the top ready item, but only if the file does not already exist (so agent-written results always win). Also added --pick flag for shell scripts to capture the selected issue number.

Tests: 9 new unit tests in tests/loop/test_loop_guard_seed.py.

PR created: http://143.198.27.163:3000/Rockachopa/Timmy-time-dashboard/pulls/1253 **Root cause:** `loop_guard.py` found work in `queue.json` and exited 0, but never recorded which issue it selected. When claude-loop/gemini-loop dispatchers run without writing `cycle_result.json` themselves, `cycle_retro.py` had no source for the issue number → all cycles logged `issue=null`. **Fix:** Added `seed_cycle_result()` to `loop_guard.py` — when the queue has work, it pre-seeds `.loop/cycle_result.json` with `{"issue": N, "type": T}` from the top ready item, but only if the file does not already exist (so agent-written results always win). Also added `--pick` flag for shell scripts to capture the selected issue number. **Tests:** 9 new unit tests in `tests/loop/test_loop_guard_seed.py`.
Author
Owner

Diagnosis (hermes cycle)

Root cause identified. Two metrics systems exist, both broken:

  1. .loop/cycle-metrics.jsonl — old format, always reports empty_queue because the old loop guard runs but no cycle runner consumes the queue
  2. .loop/retro/cycles.jsonl — new format via scripts/cycle_retro.py, gets called but always receives null data because nothing writes .loop/cycle_result.json

Evidence: Last 50+ entries in cycles.jsonl show issue: null, type: unknown, tests_passed: 0, main_green: false, success: false — hermes_clean is often true (hermes DID work), but the results are never fed back.

Fix required:

  1. The tmux loop runner must write .loop/cycle_result.json after each hermes session with: {"issue": N, "type": "bug", "tests_passed": 435, "pr": N, "notes": "..."}
  2. cycle_retro.py already reads this file (line 270-281) — the consumer side works.
  3. The --main-green flag needs a real smoke test (tox -e unit on main after merge).
  4. cycle-metrics.jsonl (old format) should be deprecated — retro/cycles.jsonl is the canonical source.

Scope: The fix is in the loop runner script (bash script in tmux timmy-loop session), not in cycle_retro.py itself. Need to find and patch that script to write cycle_result.json before calling cycle_retro.py.

Will implement in next cycle.

## Diagnosis (hermes cycle) **Root cause identified.** Two metrics systems exist, both broken: 1. `.loop/cycle-metrics.jsonl` — old format, always reports `empty_queue` because the old loop guard runs but no cycle runner consumes the queue 2. `.loop/retro/cycles.jsonl` — new format via `scripts/cycle_retro.py`, gets called but **always receives null data** because nothing writes `.loop/cycle_result.json` **Evidence:** Last 50+ entries in `cycles.jsonl` show `issue: null, type: unknown, tests_passed: 0, main_green: false, success: false` — hermes_clean is often true (hermes DID work), but the results are never fed back. **Fix required:** 1. The tmux loop runner must write `.loop/cycle_result.json` after each hermes session with: `{"issue": N, "type": "bug", "tests_passed": 435, "pr": N, "notes": "..."}` 2. `cycle_retro.py` already reads this file (line 270-281) — the consumer side works. 3. The `--main-green` flag needs a real smoke test (`tox -e unit` on main after merge). 4. `cycle-metrics.jsonl` (old format) should be deprecated — `retro/cycles.jsonl` is the canonical source. **Scope:** The fix is in the loop runner script (bash script in tmux timmy-loop session), not in cycle_retro.py itself. Need to find and patch that script to write cycle_result.json before calling cycle_retro.py. Will implement in next cycle.
Sign in to join this conversation.
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1250