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>
1.8 KiB
1.8 KiB