Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions pdd/sync_orchestration.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from dataclasses import asdict

import click
from datetime import datetime, timezone

# --- Constants ---
MAX_CONSECUTIVE_TESTS = 3 # Allow up to 3 consecutive test attempts
Expand Down Expand Up @@ -58,11 +59,12 @@ def load_sync_log(basename: str, language: str) -> List[Dict[str, Any]]:

def create_sync_log_entry(decision, budget_remaining: float) -> Dict[str, Any]:
"""Create initial log entry from decision with all fields (actual results set to None initially)."""
details = decision.details if decision.details else {}
return {
"timestamp": datetime.datetime.now(datetime.timezone.utc).isoformat(),
"timestamp": datetime.now(timezone.utc).isoformat(),
"operation": decision.operation,
"reason": decision.reason,
"decision_type": decision.details.get("decision_type", "heuristic") if decision.details else "heuristic",
"decision_type": details.get("decision_type", "heuristic"),
"confidence": decision.confidence,
"estimated_cost": decision.estimated_cost,
"actual_cost": None,
Expand All @@ -71,7 +73,7 @@ def create_sync_log_entry(decision, budget_remaining: float) -> Dict[str, Any]:
"duration": None,
"error": None,
"details": {
**(decision.details if decision.details else {}),
**details,
"budget_remaining": budget_remaining
}
}
Expand Down