Usage
.codaph mirror to Mubit, then republishing shared session and diff artifacts.
Use Cases
When to Use Repair
- Interrupted sync - Network failure during initial push
- Missing events - Cloud out of sync with local mirror
- Artifact corruption - Session summaries or diffs not published
- Migration - Moving to new Mubit project ID
When NOT to Use Repair
Do not use repair if:- Cloud and local are already in sync (check with
codaph status) - You haven’t run
codaph pushyet (run push first) - Mubit API key is not configured
Options
Working directory path. Defaults to current directory.
Repair specific session ID only instead of all sessions.
Output results in JSON format.
Mubit API key. Can also be set via
MUBIT_API_KEY environment variable.Mubit project ID to sync to. Auto-detected if not specified.
Preview what would be repaired without making changes.
Repair Process
The repair command:- Reads local mirror - Loads all events from
.codaph/ - Replays to Mubit - Sends events to cloud with deduplication
- Publishes artifacts - Regenerates session summaries and diff artifacts
- Verifies sync - Confirms cloud state matches local
Examples
Repair all sessions
Repair specific session
Preview repair (dry run)
Repair with JSON output
Repair for specific project
Output Format
Repair provides progress updates:JSON Output Example
Safety Features
Deduplication
Repair uses event IDs to deduplicate:- Skips events already in Mubit
- Prevents duplicate writes
- Idempotent operation (safe to run multiple times)
Validation
Before replay:- Verifies local mirror integrity
- Checks Mubit API connectivity
- Validates event schemas
Rollback
Repair does not modify local mirror:- Local data remains unchanged
- Only cloud state is updated
- Can be safely retried
Performance
- Batch writes - Events sent in batches of 24
- Concurrency - Up to 2 concurrent writes
- Timeout - 15 second timeout per batch
- 100 events: ~5 seconds
- 1000 events: ~30 seconds
- 10000 events: ~5 minutes
Troubleshooting
Repair fails with “Mubit disabled”
Problem: Mubit API key not configured Solution:Repair hangs
Problem: Network timeout or large dataset Solution: Check network and increase timeout:Some events not replayed
Problem: Events already in cloud Explanation: This is expected - repair deduplicates by event IDArtifacts not publishing
Problem: Artifact generation failure Solution: Check logs and retry:Recovery Scenarios
Scenario 1: Interrupted Initial Push
Scenario 2: Missing Artifacts
Scenario 3: Project Migration
Related Commands
- codaph push - Initial sync of local history
- codaph pull - Pull remote updates
- codaph status - Check sync status
- codaph doctor - Diagnose sync issues