Skip to content

feat: add bridge reconciliation demo with migration and replay#17

Merged
simonovic86 merged 1 commit intomainfrom
claude/trusting-khayyam
Mar 5, 2026
Merged

feat: add bridge reconciliation demo with migration and replay#17
simonovic86 merged 1 commit intomainfrom
claude/trusting-khayyam

Conversation

@simonovic86
Copy link
Owner

Overview

Adds a comprehensive bridge reconciliation demonstration that showcases Igor's core capabilities: agent migration, checkpoint recovery, and replay-based verification.

Changes

New Components

  • agents/reconciliation/: Reconciliation agent implementation

    • State machine: DetectedPendingTransfer → WaitingConfirmations → ReadyToFinalize → Finalized → Completed
    • Idempotency tracking to prevent duplicate finalize execution
    • Serialization/deserialization for checkpointing
    • Manifest with migration policy enabled
  • cmd/demo-reconciliation/: Demo orchestrator

    • Creates two in-process libp2p nodes
    • Loads agent on node-a and runs 9 ticks
    • Injects crash after checkpoint save
    • Migrates agent to node-b
    • Resumes execution and verifies replay determinism
    • Generates human-readable incident timeline
  • internal/timeline/: Incident report generator

    • Renders formatted timeline with timestamps and event categorization
    • Safety summary with verification checks
    • Side-by-side comparison: naive worker vs Igor approach

Build Updates

  • Added agent-reconciliation and demo targets to root Makefile
  • Agent Makefile for tinygo WASM compilation

Key Demo Flow

  1. Detection: Agent detects pending cross-chain transfer
  2. Confirmation: Accumulates 6 block confirmations
  3. Finalization: Records idempotency key, executes finalize side effect
  4. Crash: Host failure injected after tick 9
  5. Recovery: Agent migrated, checkpoint restored on node-b
  6. Verification: Replay engine verifies determinism (>6 ticks)
  7. Completion: No duplicate execution despite migration
  8. Proof: Timeline proves exactly-once semantics

Testing

  • Timeline rendering tests (header, timestamps, crash markers, safety checks)
  • Event filtering and log extraction from eventlog history
  • Replay verification against stored state hashes

…rove

Implements the reconciliation demo spec (docs/DEMO_RECONCILIATION.md):

- Reconciliation agent (agents/reconciliation/) with 5-state machine,
  idempotency key tracking, and duplicate execution detection
- Timeline formatter (internal/timeline/) for human-readable incident
  reports with safety summaries and naive-vs-Igor comparison
- Demo runner (cmd/demo-reconciliation/) orchestrating two in-process
  libp2p nodes with failure injection, migration, replay verification,
  and timeline generation
- Makefile targets: agent-reconciliation, demo

Run with: make demo

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@simonovic86 simonovic86 merged commit c91bfb4 into main Mar 5, 2026
1 check passed
@simonovic86 simonovic86 deleted the claude/trusting-khayyam branch March 5, 2026 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant