fix(gateway): mount OAuth routers before API fallback
The persistent gateway registered native/device OAuth and MCP routers from unawaited dynamic imports. Express registered the terminal /api/v1 fallback first, so public native and device discovery returned 401.
This change mounts the existing routers deterministically before the fallback and listener, makes required-router startup failures fatal, preserves existing auth/provider behavior, and adds real bootstrap regression coverage. It also records the already-completed production deployment outside sealed W4 evidence.
Validation:
- focused bootstrap: 14 passed
- narrow OAuth/CORS/MCP: 192 passed
- broader gateway/auth: 1,433 passed
- full tracked suite: 4,641 passed, 0 failed, 0 skipped
- production-baseline relevant suite: 193 passed, 0 failed
- no dependency or lockfile change
Production currently returns 200 for health and root/native/device discovery, and 401 for unauthenticated /mcp. This source integration performs no deployment or configuration change and makes no W4 qualification claim.
Symbol Delta
20 symbolsdocs/release-production/2026-09-26-oauth-routing-repair.md
8
hub/gateway/README.md
3
test/gateway-oauth-bootstrap.test.mjs
4
test/helpers/gateway-bootstrap-loader.mjs
1
Files Changed
6 of 1,392docs/release-production/2026-09-26-oauth-routing-repair.md
test/gateway-oauth-bootstrap.test.mjs
test/helpers/gateway-bootstrap-child.mjs
test/helpers/gateway-bootstrap-loader.mjs
hub/gateway/README.md
hub/gateway/server.mjs
Commits
1Divergence Analysis
fix/oauth-routing-startup-order → mainReview comments
0No review comments yet
Be the first to leave a review comment on this merge proposal.
Muse CLI
muse hub proposal comment create sha256:4800a2b1e67200fecef5f454bb500706601de7e27973ca3f009802f5a8d3f2ad --body "…"
muse hub proposal review submit sha256:4800a2b1e67200fecef5f454bb500706601de7e27973ca3f009802f5a8d3f2ad --verdict approve
muse hub proposal review submit sha256:4800a2b1e67200fecef5f454bb500706601de7e27973ca3f009802f5a8d3f2ad --verdict request_changes --body "…"
muse hub proposal close sha256:4800a2b1e67200fecef5f454bb500706601de7e27973ca3f009802f5a8d3f2ad