
import json
import datetime
import shutil

progress_path = '/home/aryy/.hermes/profiles/finance/backtests/xauusd_2026/hybrid/reviews/manual_replay_progress.json'

with open(progress_path) as f:
    progress = json.load(f)

# The instructions say process exactly 3 items starting at index 57.
# Then update the cursor atomically.

progress['cursor']['next_index'] = 60
progress['cursor']['processed_count'] = 60
progress['cursor']['needs_more_context_count'] += 1
progress['cursor']['shadow_count'] += 2
progress['cursor']['last_candidate_id'] = 'candidate_2026-01-13T16-00-00Z_short_liquidity_sweep_reversal'
progress['cursor']['last_updated'] = datetime.datetime.now(datetime.timezone.utc).isoformat()

temp_path = progress_path + '.tmp'
with open(temp_path, 'w') as f:
    json.dump(progress, f, indent=2)

shutil.move(temp_path, progress_path)
print("Updated cursor.")
