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
New backlog table (drizzle) + backlog_status enum + generated migration 0011_bitter_gateway.sql. depends_on is jsonb string[] (matches existing jsonb-array style).
BacklogService takes a Db handle — identical code on createDb (server PG) and createPgliteDb (embedded). Ops: create (idempotency dedup), list (status/phase/ready-only DAG gate), claim, reclaim, link, stats, block, complete.
Atomic claim: SELECT ... FOR UPDATE SKIP LOCKED in 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 via DATABASE_URL — same code. Migrations run on first use. Added @mosaicstack/db workspace dep.
install.sh
Added fleet/backlog to PRESERVE_PATHS so mosaic update does not wipe the backlog.
## 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
- New `backlog` table (drizzle) + `backlog_status` enum + generated migration `0011_bitter_gateway.sql`. `depends_on` is jsonb `string[]` (matches existing jsonb-array style).
- `BacklogService` takes a `Db` handle — identical code on `createDb` (server PG) and `createPgliteDb` (embedded). Ops: create (idempotency dedup), list (status/phase/ready-only DAG gate), claim, reclaim, link, stats, block, complete.
- Atomic claim: `SELECT ... FOR UPDATE SKIP LOCKED` in 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 via `DATABASE_URL` — same code. Migrations run on first use. Added `@mosaicstack/db` workspace dep.
### install.sh
- Added `fleet/backlog` to `PRESERVE_PATHS` so `mosaic update` does 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)
- create/list; idempotency dedup; filters
- atomic claim exactly-one-winner + N-card no-double-claim
- deps DAG gate; link edge; reclaim of expired (+ --id, fresh untouched); stats math
Gates green: mosaic typecheck/lint/vitest (554), db typecheck/vitest (backlog 14), prettier, plus end-to-end CLI smoke.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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