fix(installer): require provider in quick-start (#1) + local-tier gateway Redis gate (#2) #676

Closed
jason.woltje wants to merge 2 commits from fix/installer-provider-gate-and-local-gateway-redis into main
Owner

Closes #675

Fixes two greenfield-test (0.0.48, fresh Debian 13) installer defects.

Bug #1 — quick-start provider gate (packages/mosaic)

Quick Start let the user skip the LLM provider/API key and then falsely reported "Mosaic is ready".

  • provider-setup.ts: interactive path now REQUIRES a provider select (Anthropic/OpenAI) + a validated key (rejects empty, wrong-prefix, and sk-ant- for OpenAI).
  • quick-start.ts: belt-and-suspenders guard; headless/scripted installs warn-and-continue (no false-green — finalize gates the "ready" message).
  • finalize.ts: emits a Provider status line and will not print "Mosaic is ready" without a configured provider.
  • errors.ts: WizardCancelledError accepts an optional diagnostic message.
  • Removed references to the non-existent mosaic configure subcommand.

Bug #2 — local-tier gateway Redis gate (apps/gateway)

On the local storage tier the gateway opened ioredis/BullMQ connections at bootstrap (ECONNREFUSED → never healthy), ignoring { queue: { type: 'local' } }.
Every Redis consumer is now tier-aware and degrades gracefully on local tier; Standalone/Federated unaffected:

  • queue.service.ts (enabled flag gates all BullMQ ops), gc.module.ts + session-gc.service.ts, commands.module.ts + command-executor.service.ts, preferences/system-override.service.ts (in-memory fallback), log/cron.service.ts, admin/admin-health.controller.ts.
  • Also fixed a pre-existing SystemOverrideService ioredis handle leak (added OnApplicationShutdown).

Verification

  • Typecheck (mosaic + gateway): clean
  • provider-setup.spec.ts 6/6, unified-wizard.test.ts 3/3, gateway service specs 38/38
  • Independent code review passed (author ≠ reviewer); all flagged issues resolved
  • Pre-existing unrelated fleet.spec.ts failures (missing framework/fleet/examples/ fixture) confirmed present without this diff

Merge note

Per the dev-install plan, this branch is intended to be dev-installed off HEAD on the test VM and verified healthy before merge + the 0.0.49 release cut.

🤖 Generated with Claude Code

Closes #675 Fixes two greenfield-test (0.0.48, fresh Debian 13) installer defects. ## Bug #1 — quick-start provider gate (`packages/mosaic`) Quick Start let the user skip the LLM provider/API key and then falsely reported "Mosaic is ready". - `provider-setup.ts`: interactive path now REQUIRES a provider **select** (Anthropic/OpenAI) + a validated key (rejects empty, wrong-prefix, and `sk-ant-` for OpenAI). - `quick-start.ts`: belt-and-suspenders guard; headless/scripted installs warn-and-continue (no false-green — finalize gates the "ready" message). - `finalize.ts`: emits a Provider status line and will not print "Mosaic is ready" without a configured provider. - `errors.ts`: `WizardCancelledError` accepts an optional diagnostic message. - Removed references to the non-existent `mosaic configure` subcommand. ## Bug #2 — local-tier gateway Redis gate (`apps/gateway`) On the `local` storage tier the gateway opened ioredis/BullMQ connections at bootstrap (ECONNREFUSED → never healthy), ignoring `{ queue: { type: 'local' } }`. Every Redis consumer is now tier-aware and degrades gracefully on local tier; Standalone/Federated unaffected: - `queue.service.ts` (enabled flag gates all BullMQ ops), `gc.module.ts` + `session-gc.service.ts`, `commands.module.ts` + `command-executor.service.ts`, `preferences/system-override.service.ts` (in-memory fallback), `log/cron.service.ts`, `admin/admin-health.controller.ts`. - Also fixed a pre-existing `SystemOverrideService` ioredis handle leak (added `OnApplicationShutdown`). ## Verification - Typecheck (mosaic + gateway): clean - `provider-setup.spec.ts` 6/6, `unified-wizard.test.ts` 3/3, gateway service specs 38/38 - Independent code review passed (author ≠ reviewer); all flagged issues resolved - Pre-existing unrelated `fleet.spec.ts` failures (missing `framework/fleet/examples/` fixture) confirmed present without this diff ## Merge note Per the dev-install plan, this branch is intended to be dev-installed off HEAD on the test VM and verified healthy **before** merge + the 0.0.49 release cut. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jason.woltje added 1 commit 2026-06-24 21:37:55 +00:00
fix(installer): require provider in quick-start (#1) + local-tier gateway Redis gate (#2)
Some checks failed
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline failed
d604d31676
Bug #1 — quick-start wizard let users skip the LLM provider/API key yet
reported "Mosaic is ready". provider-setup now requires an interactive
provider select + a validated key; quick-start guards the headless path;
finalize won't print "Mosaic is ready" without a configured provider;
removed references to the non-existent `mosaic configure` command.

Bug #2 — the "local" storage tier still opened ioredis/BullMQ
connections at bootstrap (ECONNREFUSED, gateway never healthy). Every
Redis consumer (queue.service, gc.module, session-gc.service,
commands.module, command-executor.service, system-override.service,
cron.service, admin-health.controller) is now tier-aware and degrades
gracefully on local tier. Standalone/Federated unaffected. Also fixed a
pre-existing SystemOverrideService ioredis handle leak (added shutdown hook).

Refs #675

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RMoEx7hfdFGjUiCHuN1RRi
jason.woltje added 1 commit 2026-06-24 21:48:34 +00:00
feat(gateway): honor MOSAIC_GATEWAY_SKIP_NPM_INSTALL to skip registry reinstall
Some checks failed
ci/woodpecker/push/ci Pipeline failed
ci/woodpecker/pr/ci Pipeline was successful
0ef682e053
Lets dev/offline installs keep an already-present global @mosaicstack/gateway
(e.g. a build-from-source `install.sh --dev`) instead of overwriting it with
the registry @latest build during `mosaic wizard` / `mosaic gateway install`.

Refs #675

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RMoEx7hfdFGjUiCHuN1RRi
Author
Owner

REVIEW-OF-RECORD — REQUEST CHANGES (#676). BLOCKER: the Redis/local-tier gateway behavior is source-changing bootstrap logic across QueueService, GCModule/SessionGCService, CommandsModule/CommandExecutorService, SystemOverrideService, CronService, and AdminHealthController, but this PR does not add/update gateway tests for the local-tier no-Redis contract. Existing command/preferences specs still pass, but they do not prove the bug fix: a local config with queue.type=local should not instantiate BullMQ/ioredis/createQueue, should report cache healthy, should no-op queue workers/repeatable jobs, and should preserve SystemOverrideService set/get/clear via the in-memory fallback. Please add focused tests that would fail on main for at least QueueService local disabled behavior plus one or more direct Redis consumers (admin health, GC/commands module factory, SystemOverrideService local fallback).

Also recommended: add a small installer test for the no-provider false-green path (finalize does not call outro "Mosaic is ready" when providerType is none / no key), since that is the explicit quick-start bug being fixed.

Reviewer evidence: provider setup + unified wizard scoped tests pass (9/9); existing gateway command/preferences scoped tests pass (66/66); gateway typecheck/lint pass; mosaic lint pass. Mosaic package typecheck could not be used as reviewer evidence in this worktree because of pre-existing fleet-backlog/@mosaicstack/db export errors unrelated to this diff. No implementation defect found in the reviewed local-tier guards themselves; the blocker is missing regression coverage for the main gateway Redis bug.

REVIEW-OF-RECORD — REQUEST CHANGES (#676). BLOCKER: the Redis/local-tier gateway behavior is source-changing bootstrap logic across QueueService, GCModule/SessionGCService, CommandsModule/CommandExecutorService, SystemOverrideService, CronService, and AdminHealthController, but this PR does not add/update gateway tests for the local-tier no-Redis contract. Existing command/preferences specs still pass, but they do not prove the bug fix: a local config with queue.type=local should not instantiate BullMQ/ioredis/createQueue, should report cache healthy, should no-op queue workers/repeatable jobs, and should preserve SystemOverrideService set/get/clear via the in-memory fallback. Please add focused tests that would fail on main for at least QueueService local disabled behavior plus one or more direct Redis consumers (admin health, GC/commands module factory, SystemOverrideService local fallback). Also recommended: add a small installer test for the no-provider false-green path (finalize does not call outro "Mosaic is ready" when providerType is none / no key), since that is the explicit quick-start bug being fixed. Reviewer evidence: provider setup + unified wizard scoped tests pass (9/9); existing gateway command/preferences scoped tests pass (66/66); gateway typecheck/lint pass; mosaic lint pass. Mosaic package typecheck could not be used as reviewer evidence in this worktree because of pre-existing fleet-backlog/@mosaicstack/db export errors unrelated to this diff. No implementation defect found in the reviewed local-tier guards themselves; the blocker is missing regression coverage for the main gateway Redis bug.
Author
Owner

Closing as superseded / deferred — disposition per orchestrator coordination after the 0.0.49 RC blocker pass:

  • Redis local-tier gate (the actual 0.0.49 blocker, B1) was SPLIT out of this PR into #689 (gateway-only, base=next) and has landed on next (sha 56787fab). That part of #676 is done.
  • Provider-gate + quick-start changes are behavior changes that overlap/preempt the planned 0.0.50 provider-first + OAuth + multi-provider redesign. They are deferred to the 0.0.50 onboarding epic (currently HELD until 0.0.49 cuts) rather than landed now.
  • This PR is base=main, which is FROZEN at 86e106fc pending jetrich's greenfield HEAD blessing — it cannot merge here regardless.

No code is lost: the redis gate shipped via #689; the provider/quick-start work is captured in the 0.0.50 epic backlog. Closing to keep the queue clean. Reopen/rebuild against next when the 0.0.50 provider work is scheduled.

Closing as **superseded / deferred** — disposition per orchestrator coordination after the 0.0.49 RC blocker pass: - **Redis local-tier gate** (the actual 0.0.49 blocker, B1) was SPLIT out of this PR into #689 (gateway-only, base=next) and has landed on `next` (sha 56787fab). That part of #676 is done. - **Provider-gate + quick-start changes** are behavior changes that overlap/preempt the planned 0.0.50 provider-first + OAuth + multi-provider redesign. They are deferred to the **0.0.50 onboarding epic** (currently HELD until 0.0.49 cuts) rather than landed now. - This PR is base=`main`, which is **FROZEN** at 86e106fc pending jetrich's greenfield HEAD blessing — it cannot merge here regardless. No code is lost: the redis gate shipped via #689; the provider/quick-start work is captured in the 0.0.50 epic backlog. Closing to keep the queue clean. Reopen/rebuild against `next` when the 0.0.50 provider work is scheduled.
jason.woltje closed this pull request 2026-06-25 18:45:44 +00:00
Some checks failed
ci/woodpecker/push/ci Pipeline failed
ci/woodpecker/pr/ci Pipeline was successful

Pull request closed

Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#676