feat(#462): add federation query source routing #673

Merged
jason.woltje merged 1 commits from feat/federation-m3-query-source into main 2026-06-24 21:39:46 +00:00
Owner

Summary

  • add QuerySourceService for local, federated:<host>, and all list routing
  • fan out all to local + active outbound peers in parallel, merge rows, and tag _source
  • return _partial: true for per-peer failures; mark all-source cursor responses partial/truncated
  • export/register QuerySourceService in FederationModule

Refs #462

Verification

  • pnpm typecheck — PASS
  • pnpm lint — PASS
  • pnpm format:check — PASS
  • pnpm --filter @mosaicstack/gateway test -- query-source.service.spec.ts — PASS (7 tests)
  • ~/.config/mosaic/tools/codex/codex-code-review.sh --uncommitted — PASS after remediation
  • ~/.config/mosaic/tools/codex/codex-security-review.sh --uncommitted — PASS

Note

  • pnpm test currently fails locally in apps/gateway/src/__tests__/cross-user-isolation.test.ts because local PostgreSQL is reachable but missing the messages table during cleanup; changed query-source tests pass.
## Summary - add QuerySourceService for `local`, `federated:<host>`, and `all` list routing - fan out `all` to local + active outbound peers in parallel, merge rows, and tag `_source` - return `_partial: true` for per-peer failures; mark all-source cursor responses partial/truncated - export/register QuerySourceService in FederationModule Refs #462 ## Verification - `pnpm typecheck` — PASS - `pnpm lint` — PASS - `pnpm format:check` — PASS - `pnpm --filter @mosaicstack/gateway test -- query-source.service.spec.ts` — PASS (7 tests) - `~/.config/mosaic/tools/codex/codex-code-review.sh --uncommitted` — PASS after remediation - `~/.config/mosaic/tools/codex/codex-security-review.sh --uncommitted` — PASS ## Note - `pnpm test` currently fails locally in `apps/gateway/src/__tests__/cross-user-isolation.test.ts` because local PostgreSQL is reachable but missing the `messages` table during cleanup; changed query-source tests pass.
jason.woltje added 1 commit 2026-06-24 21:05:18 +00:00
feat(#462): add federation query source routing
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/push/ci Pipeline was successful
4bf12d9990
jason.woltje merged commit 838c44086c into main 2026-06-24 21:39:46 +00:00
Author
Owner

RETROACTIVE REVIEW-OF-RECORD — APPROVE ON MERITS (#673 FED-M3-09 query-source). Verified source=all fan-out routes remote calls by peer.id, local rows are tagged _source=local, remote rows are tagged with peer commonName, per-peer failures return _partial:true without hard-failing successful sources, and cursor/truncation becomes partial/truncated rather than a misleading single cursor. Reviewer verification: query-source.service.spec 7/7 pass; gateway typecheck/lint pass; formatting check pass; PR CI was green at review time.

RETROACTIVE REVIEW-OF-RECORD — APPROVE ON MERITS (#673 FED-M3-09 query-source). Verified source=all fan-out routes remote calls by peer.id, local rows are tagged _source=local, remote rows are tagged with peer commonName, per-peer failures return _partial:true without hard-failing successful sources, and cursor/truncation becomes partial/truncated rather than a misleading single cursor. Reviewer verification: query-source.service.spec 7/7 pass; gateway typecheck/lint pass; formatting check pass; PR CI was green at review time.
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#673