Core Infrastructure
Triple-Write Orchestrator
The Saga-pattern engine: Convex, SQLite, and AlarmManager in sequence.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
The Saga-pattern engine: Convex, SQLite, and AlarmManager in sequence.
| Step | Target | Timeout | Compensating Function |
|---|---|---|---|
| 1 | Convex Cloud Mutation | 15s | Convex rollback mutation |
| 2 | Local SQLite Write | 15s | SQLite delete |
| 3 | Hardware Alarm Sync | 15s | None (idempotent) |
const saga = new TripleWriteOrchestrator(context);
saga
.addStep("Convex Mutation",
async (ctx) => await convexMutation(ctx),
async (ctx, result) => await convexRollback(result)
)
.addStep("Local SQLite Write",
async (ctx, prev) => await sqliteInsert(prev),
async (ctx, result) => await sqliteDelete(result)
)
.addStep("Hardware Alarm Sync",
async (ctx) => await scheduleNextAlarm()
);
const { success, error, rollbackFailed } = await saga.execute();
[Saga:X7K2M1] Initiating 3-stage sequence...
[Saga:X7K2M1] Phase: Convex Mutation (timeout: 15000ms)
[Saga:X7K2M1] Phase: Local SQLite Write (timeout: 15000ms)
[Saga:X7K2M1] SUCCESS: All layers committed.