feat(fleet): native Mosaic backlog on @mosaicstack/db (atomic claim + TTL)
Add Mosaic's own backlog-of-record on the existing Postgres storage layer, replacing the former Hermes adapter (no Hermes dependency) and the earlier sqlite idea (no sqlite, no new client). - packages/db: `backlog` table (drizzle) + enum + migration 0011; BacklogService taking a Db handle so it runs on both createDb (server PG) and createPgliteDb (embedded). Atomic claim via SELECT ... FOR UPDATE SKIP LOCKED inside one tx, TTL claims + reclaim of expired, deps DAG gate, idempotency-key dedup, stats. - packages/mosaic: `mosaic fleet backlog <sub> --json` (create/list/claim/ reclaim/link/stats/block/complete). Embedded PGlite default at <mosaicHome>/fleet/backlog; full Postgres via DATABASE_URL — same code. Migrations run on first use. - install.sh: preserve fleet/backlog across `mosaic update`. - docs/fleet/backlog-conventions.md: schema, phase convention, atomic-claim + TTL semantics, PGlite-default/Postgres-by-config, Mosaic-native (no Hermes). - Tests (in-memory PGlite, real PG semantics): create/list, exactly-one-winner concurrency (and N-card no-double-claim), deps gate, reclaim of expired, stats. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -78,6 +78,13 @@
|
||||
"when": 1745366400000,
|
||||
"tag": "0010_federation_enrollment_tokens",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 11,
|
||||
"version": "7",
|
||||
"when": 1782310438919,
|
||||
"tag": "0011_bitter_gateway",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user