fix(release): republish @mosaicstack/db 0.0.4 with BacklogService; mosaic 0.0.47 #668

Merged
jason.woltje merged 1 commits from fix/db-republish-backlog into main 2026-06-24 18:54:34 +00:00
Owner

Problem

mosaic 0.0.46 crashes on every CLI invocation:

SyntaxError: The requested module '@mosaicstack/db' does not provide an export named 'BacklogService'
  at dist/commands/fleet-backlog.js:19

Root cause

PR #657 added BacklogService + DEFAULT_CLAIM_TTL_SECONDS to @mosaicstack/db and a fleet-backlog command to mosaic that imports them — but never bumped db's version (stayed 0.0.3). The publish pipeline (.woodpecker/publish.yml) tolerates version already exists, so db's new code was silently never republished. The registry's db@0.0.3 is the stale pre-#657 artifact with no BacklogService export. mosaic 0.0.46 declares db as a regular (non-bundled) dependency resolved workspace:* → 0.0.3, so it installs the stale db and crashes at CLI entry.

Verified from registry tarballs:

  • npm pack @mosaicstack/mosaic@0.0.46dependencies["@mosaicstack/db"] = "0.0.3", bundledDependencies unset, no node_modules in tarball.
  • npm pack @mosaicstack/db@0.0.3 → barrel exports createDb/createPgliteDb/runMigrations/schema/... only; no BacklogService.

A mosaic-only republish would re-pin 0.0.3 and crash identically — the db bump is mandatory.

Fix

  • @mosaicstack/db 0.0.3 → 0.0.4 (forces republish with BacklogService past the version-exists gate)
  • @mosaicstack/mosaic 0.0.46 → 0.0.47 (so workspace:* resolves to db@0.0.4 at publish)
  • pnpm-lock.yaml unchanged (workspace deps link by path, not version; --frozen-lockfile passes — verified locally).

Post-publish verification gate (exit-code-safe, export-level)

npm pack @mosaicstack/db@0.0.4 && unpack && node --input-type=module \
  -e 'import("./pkg/dist/index.js").then(m=>{if(!m.BacklogService)process.exit(1)})'
npm pack @mosaicstack/mosaic@0.0.47 && unpack && \
  node -e 'console.log(require("./pkg/package.json").dependencies["@mosaicstack/db"])'  # must print 0.0.4

🤖 Generated with Claude Code

## Problem mosaic **0.0.46** crashes on every CLI invocation: ``` SyntaxError: The requested module '@mosaicstack/db' does not provide an export named 'BacklogService' at dist/commands/fleet-backlog.js:19 ``` ## Root cause PR #657 added `BacklogService` + `DEFAULT_CLAIM_TTL_SECONDS` to `@mosaicstack/db` and a `fleet-backlog` command to mosaic that imports them — but **never bumped db's version** (stayed `0.0.3`). The publish pipeline (`.woodpecker/publish.yml`) tolerates `version already exists`, so db's new code was **silently never republished**. The registry's `db@0.0.3` is the stale pre-#657 artifact with **no `BacklogService` export**. mosaic 0.0.46 declares db as a regular (non-bundled) dependency resolved `workspace:* → 0.0.3`, so it installs the stale db and crashes at CLI entry. Verified from registry tarballs: - `npm pack @mosaicstack/mosaic@0.0.46` → `dependencies["@mosaicstack/db"] = "0.0.3"`, `bundledDependencies` unset, no `node_modules` in tarball. - `npm pack @mosaicstack/db@0.0.3` → barrel exports `createDb/createPgliteDb/runMigrations/schema/...` only; **no `BacklogService`**. A mosaic-only republish would re-pin `0.0.3` and crash identically — **the db bump is mandatory**. ## Fix - `@mosaicstack/db` `0.0.3 → 0.0.4` (forces republish *with* `BacklogService` past the version-exists gate) - `@mosaicstack/mosaic` `0.0.46 → 0.0.47` (so `workspace:*` resolves to `db@0.0.4` at publish) - `pnpm-lock.yaml` unchanged (workspace deps link by path, not version; `--frozen-lockfile` passes — verified locally). ## Post-publish verification gate (exit-code-safe, export-level) ``` npm pack @mosaicstack/db@0.0.4 && unpack && node --input-type=module \ -e 'import("./pkg/dist/index.js").then(m=>{if(!m.BacklogService)process.exit(1)})' npm pack @mosaicstack/mosaic@0.0.47 && unpack && \ node -e 'console.log(require("./pkg/package.json").dependencies["@mosaicstack/db"])' # must print 0.0.4 ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jason.woltje added 1 commit 2026-06-24 18:45:01 +00:00
fix(release): republish @mosaicstack/db 0.0.4 with BacklogService; mosaic 0.0.47
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
3f85d574c8
mosaic 0.0.46 ships a fleet-backlog command that bare-imports
{ BacklogService, DEFAULT_CLAIM_TTL_SECONDS } from @mosaicstack/db, but
db's version was never bumped after #657 added backlog.ts. The publish
pipeline tolerates "version already exists", so db's new code was never
republished — the registry's db@0.0.3 is the stale pre-#657 artifact with
no BacklogService export. mosaic 0.0.46 (workspace:* -> 0.0.3) therefore
installs the stale db and crashes at CLI entry on every command:

  SyntaxError: The requested module '@mosaicstack/db' does not provide
  an export named 'BacklogService'  (dist/commands/fleet-backlog.js:19)

Verified from registry tarballs: mosaic@0.0.46 declares db as a regular
(non-bundled) dependency at 0.0.3; db@0.0.3 dist exports no BacklogService.
A mosaic-only republish would re-pin 0.0.3 and crash identically, so the
db version bump is mandatory.

Fix: bump @mosaicstack/db 0.0.3 -> 0.0.4 (forces republish WITH
BacklogService past the version-exists gate) and bump mosaic 0.0.46 ->
0.0.47 so workspace:* resolves to db@0.0.4 at publish. pnpm-lock.yaml is
unchanged (workspace deps link by path, not version).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Author
Owner

Independent review — APPROVE

Reviewer: mos-claude-1 (separate session; author≠reviewer at the agent/perspective level. NB: gitea-native approve is blocked because this host shares one git account between both agents — "approve your own pull is not allowed" — so this comment is the review of record.)

Verified from ground truth at head 3f85d574:

Check Result
Diff scope Exactly 2 version fields — @mosaicstack/db 0.0.3→0.0.4, @mosaicstack/mosaic 0.0.46→0.0.47; no other files
mosaic→db dep workspace:* → publish resolves to bumped 0.0.4 (bump is load-bearing, not a hardcoded pin)
db source exports BacklogService Yes — re-exported in packages/db/src/index.ts, defined in packages/db/src/backlog.ts → republished db@0.0.4 will carry the export db@0.0.3 lacked
Lockfile Unchanged (workspace:* needs no lock edit) → --frozen-lockfile holds

Root cause = publish skew, not a code defect: db source already had BacklogService (post-#657), but registry db@0.0.3 was a stale pre-export build and the tolerate-version-exists gate skipped republishing at an unchanged version. This minimal bump forces the correct source to republish.

Post-publish gate to run before any mosaic update retry:

  • npm pack @mosaicstack/db@0.0.4 → assert import(...).then(m=>m.BacklogService) truthy
  • npm pack @mosaicstack/mosaic@0.0.47 → assert dependencies["@mosaicstack/db"] === "0.0.4"
## Independent review — APPROVE ✅ **Reviewer:** mos-claude-1 (separate session; author≠reviewer at the agent/perspective level. NB: gitea-native approve is blocked because this host shares one git account between both agents — "approve your own pull is not allowed" — so this comment is the review of record.) Verified from ground truth at head `3f85d574`: | Check | Result | |---|---| | Diff scope | Exactly 2 version fields — `@mosaicstack/db` 0.0.3→0.0.4, `@mosaicstack/mosaic` 0.0.46→0.0.47; no other files | | mosaic→db dep | `workspace:*` → publish resolves to bumped **0.0.4** (bump is load-bearing, not a hardcoded pin) | | db source exports `BacklogService` | **Yes** — re-exported in `packages/db/src/index.ts`, defined in `packages/db/src/backlog.ts` → republished `db@0.0.4` will carry the export `db@0.0.3` lacked | | Lockfile | Unchanged (`workspace:*` needs no lock edit) → `--frozen-lockfile` holds | **Root cause = publish skew, not a code defect:** db *source* already had `BacklogService` (post-#657), but registry `db@0.0.3` was a stale pre-export build and the tolerate-version-exists gate skipped republishing at an unchanged version. This minimal bump forces the correct source to republish. **Post-publish gate to run before any `mosaic update` retry:** - `npm pack @mosaicstack/db@0.0.4` → assert `import(...).then(m=>m.BacklogService)` truthy - `npm pack @mosaicstack/mosaic@0.0.47` → assert `dependencies["@mosaicstack/db"] === "0.0.4"`
jason.woltje merged commit a9857c5043 into main 2026-06-24 18:54:34 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#668