Skip to content

[Phase 4] Reconciliation: State Checker Engine #404

Description

@frankbria

Summary

Create a reconciliation engine that checks the current state of tasks against external sources and reports discrepancies.

Parent issue: #403

Scope

New module: core/reconciler.py

  1. ReconciliationResult dataclass:

    @dataclass
    class ReconciliationResult:
        task_id: str
        current_status: TaskStatus
        external_status: TaskStatus | None
        action: ReconcileAction  # SKIP, KILL, REQUEUE, NONE
        reason: str
  2. Reconciler class:

    class Reconciler:
        def __init__(self, workspace_path: Path, check_interval_ms: int = 30_000):
            ...
        
        def check_tasks(self, task_ids: list[str]) -> list[ReconciliationResult]:
            """Check current state of given tasks against stored state."""
            ...
        
        def check_blockers(self, task_ids: list[str]) -> list[ReconciliationResult]:
            """Check if any blocked tasks have had their blockers resolved."""
            ...
  3. State check logic:

    • Read task status from durable state (SQLite/filesystem)
    • Compare against in-memory batch state
    • If task externally transitioned to DONE/FAILED → recommend SKIP
    • If task externally transitioned to BLOCKED → recommend KILL
    • If blocked task has all blockers resolved → recommend REQUEUE

Acceptance Criteria

  • Reconciler checks task state from durable storage
  • Detects external status transitions (DONE, FAILED, BLOCKED)
  • Detects blocker resolutions for blocked tasks
  • Returns structured ReconciliationResult with recommended action
  • Unit tests for all state transition scenarios

Dependencies

  • None — standalone module using existing core/tasks.py and core/blockers.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestphase-4.4Phase 4.4: Batch Execution & Reconciliationsymphony-inspiredInspired by OpenAI Symphony spec analysis

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions