[triage-generated] [bug] [P0] Cycle recorder never reads cycle_result.json — 300+ cycles with null data #603

Closed
opened 2026-03-20 16:38:30 +00:00 by Timmy · 1 comment
Owner

Problem

The cycle recorder has been broken for 300+ cycles (since ~cycle 939). Every cycle records:

  • issue: null
  • type: "unknown"
  • success: false
  • main_green: false
  • tests_passed: 0
  • lines_added: 0

Despite real work happening: PRs merged (#589, #595, #597, #600), issues closed, 2106 tests passing.

Root Cause Analysis

The cycle_result.json file exists and contains valid data (e.g. {"issue": 525, "type": "bug", "pr": 530, "tests_passed": 2114}), but the cycle recorder in the tmux loop wrapper never reads it. The recorder appears to write default empty values instead of reading the result file the agent produces.

Impact

  • 0% recorded success rate makes all metrics meaningless
  • Deep triage cannot identify which issues are failing vs succeeding
  • Insights/recommendations are based on garbage data
  • 3 consecutive deep triages have flagged this same issue

Acceptance Criteria

  • Cycle recorder reads .loop/cycle_result.json after each cycle
  • issue, type, pr, tests_passed fields populated from result file
  • success computed from: issue != null AND (pr merged OR tests pass)
  • main_green computed from actual test run (tox -e py exit code)
  • If cycle_result.json is missing/malformed, record reason: "no result file"
  • After fix, run 5 cycles and verify non-null issue numbers in cycles.jsonl

Files

  • The tmux loop wrapper script (wherever cycles.jsonl is written to)
  • .loop/cycle_result.json (read path)
  • .loop/retro/cycles.jsonl (write path)

Tags

[triage-generated] [bug] [P0]

## Problem The cycle recorder has been broken for 300+ cycles (since ~cycle 939). Every cycle records: - `issue: null` - `type: "unknown"` - `success: false` - `main_green: false` - `tests_passed: 0` - `lines_added: 0` Despite real work happening: PRs merged (#589, #595, #597, #600), issues closed, 2106 tests passing. ## Root Cause Analysis The `cycle_result.json` file exists and contains valid data (e.g. `{"issue": 525, "type": "bug", "pr": 530, "tests_passed": 2114}`), but the cycle recorder in the tmux loop wrapper never reads it. The recorder appears to write default empty values instead of reading the result file the agent produces. ## Impact - 0% recorded success rate makes all metrics meaningless - Deep triage cannot identify which issues are failing vs succeeding - Insights/recommendations are based on garbage data - 3 consecutive deep triages have flagged this same issue ## Acceptance Criteria - [ ] Cycle recorder reads `.loop/cycle_result.json` after each cycle - [ ] `issue`, `type`, `pr`, `tests_passed` fields populated from result file - [ ] `success` computed from: issue != null AND (pr merged OR tests pass) - [ ] `main_green` computed from actual test run (`tox -e py` exit code) - [ ] If cycle_result.json is missing/malformed, record `reason: "no result file"` - [ ] After fix, run 5 cycles and verify non-null issue numbers in cycles.jsonl ## Files - The tmux loop wrapper script (wherever `cycles.jsonl` is written to) - `.loop/cycle_result.json` (read path) - `.loop/retro/cycles.jsonl` (write path) ## Tags [triage-generated] [bug] [P0]
Author
Owner

Fixed in ~/.hermes/bin/timmy-loop.sh (infrastructure, not repo code).

Root cause: The cycle_result.json file contained hermes fence markers (EOF; __hermes_rc=$?; printf __HERMES_FENCE_a9f7b3__; exit $__hermes_rc) appended after the JSON. json.load() choked on this garbage, the exception was silently swallowed (print(, file=sys.stderr)), and every cycle recorded null data.

Fix:

  1. Read raw text instead of json.load()
  2. Strip everything after the last } before parsing
  3. Log parse errors instead of silencing them

The fix is live — next cycle will record properly.

Fixed in `~/.hermes/bin/timmy-loop.sh` (infrastructure, not repo code). **Root cause:** The `cycle_result.json` file contained hermes fence markers (`EOF; __hermes_rc=$?; printf __HERMES_FENCE_a9f7b3__; exit $__hermes_rc`) appended after the JSON. `json.load()` choked on this garbage, the exception was silently swallowed (`print(, file=sys.stderr)`), and every cycle recorded null data. **Fix:** 1. Read raw text instead of `json.load()` 2. Strip everything after the last `}` before parsing 3. Log parse errors instead of silencing them The fix is live — next cycle will record properly.
Timmy closed this issue 2026-03-20 16:46:29 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#603