feat(fleet): native Mosaic backlog on @mosaicstack/db (atomic claim + TTL) #657
Reference in New Issue
Block a user
Delete Branch "feat/a4-mosaic-backlog"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Card A4 — native Mosaic Backlog of record
Builds Mosaic's OWN backlog-of-record on the existing Postgres storage layer. REPLACES the former Hermes adapter (no Hermes dependency) and the earlier sqlite idea (no sqlite, no new db client).
packages/db
backlogtable (drizzle) +backlog_statusenum + generated migration0011_bitter_gateway.sql.depends_onis jsonbstring[](matches existing jsonb-array style).BacklogServicetakes aDbhandle — identical code oncreateDb(server PG) andcreatePgliteDb(embedded). Ops: create (idempotency dedup), list (status/phase/ready-only DAG gate), claim, reclaim, link, stats, block, complete.SELECT ... FOR UPDATE SKIP LOCKEDin one tx — two concurrent claimers can never both win. TTL claims (default 900s) + reclaim of expired.packages/mosaic
mosaic fleet backlog <sub> --json. Embedded PGlite default at<mosaicHome>/fleet/backlog; full Postgres viaDATABASE_URL— same code. Migrations run on first use. Added@mosaicstack/dbworkspace dep.install.sh
fleet/backlogtoPRESERVE_PATHSsomosaic updatedoes not wipe the backlog.docs
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)
Gates green: mosaic typecheck/lint/vitest (554), db typecheck/vitest (backlog 14), prettier, plus end-to-end CLI smoke.
🤖 Generated with Claude Code
791d6b7c51toaac4e51f14