import json

progress_file = '/home/aryy/.hermes/profiles/finance/backtests/xauusd_2026/hybrid/reviews/manual_replay_progress.json'
with open(progress_file, 'r') as f:
    progress = json.load(f)

# Fix double counting from accidental update_cursor.py execution in the beginning
# We meant to add 2 needs_more_context and 1 shadow, from 22 needs_more_context and 4 shadow
# We had 22 NMC, 4 shadow. 
# update_cursor.py ran: +3 NMC (made it 25 NMC).
# Then update_cursor_00030_00033 ran: +2 NMC (made it 27 NMC), +1 shadow (made it 5 shadow).
# Correct NMC should be 22 + 2 = 24.
# Correct shadow is 4 + 1 = 5.
progress['cursor']['needs_more_context_count'] = 24
progress['runs'][0]['decision_counts']['needs_more_context'] = 24

# Remove duplicate replay_result_00015_00018.json
progress['runs'][0]['result_files'] = [f for f in progress['runs'][0]['result_files'] if f != 'hybrid/reviews/manual_replay_results/replay_result_00015_00018.json']

# It actually seems it was added *again*. Let's make the list exactly what it should be.
files = [
    "hybrid/reviews/manual_replay_results/replay_result_00000_00003.json",
    "hybrid/reviews/manual_replay_results/replay_result_00003_00006.json",
    "hybrid/reviews/manual_replay_results/replay_result_00006_00009.json",
    "hybrid/reviews/manual_replay_results/replay_result_00009_00012.json",
    "hybrid/reviews/manual_replay_results/replay_result_00012_00015.json",
    "hybrid/reviews/manual_replay_results/replay_result_00015_00018.json",
    "hybrid/reviews/manual_replay_results/replay_result_00018_00021.json",
    "hybrid/reviews/manual_replay_results/replay_result_00021_00024.json",
    "hybrid/reviews/manual_replay_results/replay_result_00024_00027.json",
    "hybrid/reviews/manual_replay_results/replay_result_00027_00030.json",
    "hybrid/reviews/manual_replay_results/replay_result_00030_00033.json"
]
progress['runs'][0]['result_files'] = files

with open(progress_file, 'w') as f:
    json.dump(progress, f, indent=2)
