feat(config): add federated tier + rename team→standalone (FED-M1-01) #470

Merged
jason.woltje merged 1 commits from feat/federation-m1-tier-config into main 2026-04-19 23:11:12 +00:00
Owner

Summary

FED-M1-01 — extend mosaic.config.json schema with federated tier and align tier vocabulary with the federation PRD.

Tier reconciliation:

The existing code used local | team while docs/federation/PRD.md line 247 defines the canonical vocabulary as local | standalone | federated. team was conceptually identical to PRD standalone (Postgres + Valkey, no pgvector). This PR renames teamstandalone and adds federated as the third tier value. team continues to validate via a deprecated alias path that warns to stderr, so existing 0.0.x headless installs keep working without modification.

What ships:

  • StorageTier / GatewayStorageTier unions: local | standalone | federated
  • DEFAULT_STANDALONE_CONFIG (renamed from DEFAULT_TEAM_CONFIG) — Postgres on 5432, keyword memory (corrected to match PRD; the old team default had pgvector which contradicted the spec)
  • DEFAULT_FEDERATED_CONFIG — Postgres on 5433, pgvector memory
  • Wizard interactive promptTier() now offers all three with hint copy
  • Wizard headless MOSAIC_STORAGE_TIER: accepts standalone / federated directly, accepts team with a deprecation warning, hard-rejects unknown values with a message naming all three valid tiers (was a silent fallback to local before; pre-review fix-up)
  • Wizard interactive DATABASE_URL pre-fill is tier-aware: standalone → 5432, federated → 5433
  • 10 new unit tests (packages/config/src/mosaic-config.spec.ts) + 3 new wizard headless tests

What does NOT ship (deferred per FED-M1 plan):

  • pgvector enforcement / extension creation → FED-M1-03
  • tier-detector with fail-fast → FED-M1-04
  • docker-compose.federated.yml overlay → FED-M1-02
  • Migration script local/standalonefederated → FED-M1-05

This is enum + types + defaults + alias only. No federation runtime behavior is gated on the new value yet.

Review chain (orchestrator-driven):

  • Implementation: sonnet subagent on feat/federation-m1-tier-config
  • Independent review: feature-dev:code-reviewer (sonnet) — verdict ship-with-followup, raised four issues
  • Independent verification: separate sonnet subagent verified all 9 implementation claims against the diff and PRD
  • Two of the four review issues directly caused by this PR (silent unknown-value fallback, wrong DB port pre-fill) were fixed pre-merge; haiku verifier confirmed the fixes
  • Two pre-existing issues (hardcoded tier: 'local' in stage resume branches; dist/ tracking hygiene) tracked as follow-ups, not blocking this PR

Refs #460

Test plan

  • pnpm --filter @mosaicstack/config typecheck + test (10/10)
  • pnpm --filter @mosaicstack/mosaic typecheck + test (279/279)
  • pnpm typecheck (38/38 tasks)
  • pnpm lint (21/21 tasks)
  • pnpm format:check
  • CI green on merge

Generated with Claude Code

## Summary FED-M1-01 — extend `mosaic.config.json` schema with `federated` tier and align tier vocabulary with the federation PRD. **Tier reconciliation:** The existing code used `local | team` while `docs/federation/PRD.md` line 247 defines the canonical vocabulary as `local | standalone | federated`. `team` was conceptually identical to PRD `standalone` (Postgres + Valkey, no pgvector). This PR renames `team` → `standalone` and adds `federated` as the third tier value. `team` continues to validate via a deprecated alias path that warns to stderr, so existing 0.0.x headless installs keep working without modification. **What ships:** - `StorageTier` / `GatewayStorageTier` unions: `local | standalone | federated` - `DEFAULT_STANDALONE_CONFIG` (renamed from `DEFAULT_TEAM_CONFIG`) — Postgres on 5432, **keyword** memory (corrected to match PRD; the old `team` default had `pgvector` which contradicted the spec) - `DEFAULT_FEDERATED_CONFIG` — Postgres on 5433, pgvector memory - Wizard interactive `promptTier()` now offers all three with hint copy - Wizard headless `MOSAIC_STORAGE_TIER`: accepts `standalone` / `federated` directly, accepts `team` with a deprecation warning, **hard-rejects unknown values** with a message naming all three valid tiers (was a silent fallback to `local` before; pre-review fix-up) - Wizard interactive DATABASE_URL pre-fill is tier-aware: `standalone` → 5432, `federated` → 5433 - 10 new unit tests (`packages/config/src/mosaic-config.spec.ts`) + 3 new wizard headless tests **What does NOT ship (deferred per FED-M1 plan):** - pgvector enforcement / extension creation → FED-M1-03 - tier-detector with fail-fast → FED-M1-04 - `docker-compose.federated.yml` overlay → FED-M1-02 - Migration script `local`/`standalone` → `federated` → FED-M1-05 This is enum + types + defaults + alias only. No federation runtime behavior is gated on the new value yet. **Review chain (orchestrator-driven):** - Implementation: sonnet subagent on `feat/federation-m1-tier-config` - Independent review: `feature-dev:code-reviewer` (sonnet) — verdict `ship-with-followup`, raised four issues - Independent verification: separate sonnet subagent verified all 9 implementation claims against the diff and PRD - Two of the four review issues directly caused by this PR (silent unknown-value fallback, wrong DB port pre-fill) were fixed pre-merge; haiku verifier confirmed the fixes - Two pre-existing issues (hardcoded `tier: 'local'` in stage resume branches; `dist/` tracking hygiene) tracked as follow-ups, not blocking this PR **Refs** #460 ## Test plan - [x] `pnpm --filter @mosaicstack/config typecheck` + `test` (10/10) - [x] `pnpm --filter @mosaicstack/mosaic typecheck` + `test` (279/279) - [x] `pnpm typecheck` (38/38 tasks) - [x] `pnpm lint` (21/21 tasks) - [x] `pnpm format:check` - [ ] CI green on merge Generated with Claude Code
jason.woltje added 1 commit 2026-04-19 23:07:29 +00:00
feat(config): add federated tier and rename team→standalone (FED-M1-01)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
86edb16947
Aligns mosaic.config tier vocabulary with the federation PRD:
- Adds `federated` to the tier enum (Postgres + Valkey + pgvector)
- Renames `team` → `standalone` in StorageTier / GatewayStorageTier
- Keeps `team` as a deprecated alias that warns to stderr and maps to standalone
- Adds DEFAULT_FEDERATED_CONFIG (port 5433, pgvector memory)
- Corrects DEFAULT_STANDALONE_CONFIG.memory to keyword (PRD line 247)
- Wizard interactive promptTier offers local/standalone/federated
- Wizard headless env path now hard-rejects unknown MOSAIC_STORAGE_TIER
  values with a message naming all three valid tiers
- Interactive DATABASE_URL pre-fill is tier-aware: standalone→5432, federated→5433
- 10 new unit tests for the validator + 3 new wizard headless tests

No new behavior beyond the enum and defaults — pgvector enforcement,
tier-detector, and docker-compose overlays land in FED-M1-02..04.

Refs #460

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
jason.woltje merged commit 9c89c32684 into main 2026-04-19 23:11:12 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#470