[triage-generated] [bug] [P0] cycle_result.json consume-once fix from #660 never landed on main — loop metrics still poisoned #897

Closed
opened 2026-03-22 01:32:41 +00:00 by Timmy · 0 comments
Owner

Problem

Issue #660 was closed on 2026-03-20 with a comment claiming the consume-once fix was already on main. This is incorrect. Verification shows main's scripts/cycle_retro.py has NO unlink/delete/consume logic for cycle_result.json.

Meanwhile .loop/cycle_result.json still contains {"issue": 603, ...} — a stale result from a long-closed issue. Every cycle reads this file, backfills issue=603, and records a failure. This has been happening for 1000+ cycles.

Root Cause

_load_cycle_result() in scripts/cycle_retro.py reads the file but never deletes it after successful consumption.

Fix Required

In scripts/cycle_retro.py, after the cr = _load_cycle_result() block (~line 270-278), add:

    # Consume-once: delete after reading
    if cr:
        CYCLE_RESULT_FILE.unlink(missing_ok=True)

Also add a guard: if the issue from cycle_result.json is closed, skip it.

Acceptance Criteria

  1. After a cycle runs, cycle_result.json is deleted (not just read)
  2. retro/summary.json stops showing 0% success rate within 50 cycles
  3. Closed issues are never backfilled from stale cycle_result.json

Files

  • scripts/cycle_retro.py (lines 250-278)

Immediate Mitigation

Delete the stale file now: rm .loop/cycle_result.json

## Problem Issue #660 was closed on 2026-03-20 with a comment claiming the consume-once fix was already on main. **This is incorrect.** Verification shows main's `scripts/cycle_retro.py` has NO unlink/delete/consume logic for cycle_result.json. Meanwhile `.loop/cycle_result.json` still contains `{"issue": 603, ...}` — a stale result from a long-closed issue. Every cycle reads this file, backfills issue=603, and records a failure. This has been happening for 1000+ cycles. ## Root Cause `_load_cycle_result()` in `scripts/cycle_retro.py` reads the file but never deletes it after successful consumption. ## Fix Required In `scripts/cycle_retro.py`, after the `cr = _load_cycle_result()` block (~line 270-278), add: ```python # Consume-once: delete after reading if cr: CYCLE_RESULT_FILE.unlink(missing_ok=True) ``` Also add a guard: if the issue from cycle_result.json is closed, skip it. ## Acceptance Criteria 1. After a cycle runs, `cycle_result.json` is deleted (not just read) 2. `retro/summary.json` stops showing 0% success rate within 50 cycles 3. Closed issues are never backfilled from stale cycle_result.json ## Files - `scripts/cycle_retro.py` (lines 250-278) ## Immediate Mitigation Delete the stale file now: `rm .loop/cycle_result.json`
Timmy closed this issue 2026-03-22 01:38:08 +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#897