import json

def update():
    path = "/home/aryy/.hermes/profiles/finance/backtests/xauusd_2026/hybrid/reviews/manual_replay_progress.json"
    
    with open(path, 'r') as f:
        data = json.load(f)
        
    data['cursor']['next_index'] = 267
    data['cursor']['processed_count'] = 267
    data['cursor']['needs_more_context_count'] += 3
    data['cursor']['last_candidate_id'] = "candidate_2026-02-25T18-30-00Z_short_liquidity_sweep_reversal"
    data['cursor']['last_updated'] = "2026-07-17T23:01:00Z"
    
    # Check if the result file is already in the list
    new_result = "hybrid/reviews/manual_replay_results/replay_result_00264_00267.json"
    if new_result not in data['runs'][0]['result_files']:
        data['runs'][0]['result_files'].append(new_result)
        
    data['runs'][0]['decision_counts']['needs_more_context'] += 3
    
    with open(path, 'w') as f:
        json.dump(data, f, indent=2)

if __name__ == "__main__":
    update()
