Skip to content

refactor: remove dead routing-plane routes and gateway routing state - #8

Merged
Sebas1705 merged 1 commit into
mainfrom
refactor/remove-dead-routing-routes
Nov 14, 2026
Merged

Sebas1705 merged 1 commit into
mainfrom
refactor/remove-dead-routing-routes

Conversation

@Sebas1705

Copy link
Copy Markdown
Contributor

Summary

bff-backoffice PR #9 removed the routing plane from the BFF. This removes everything in the gateway that only existed to forward to it, plus the gateway's own routing code that nothing calls. The llama target path used by the Backoffice llama target card is untouched.

Removed routes and evidence

All evidence is a grep across every clone under axiomnode/ (Mobile-App, Backoffice, bff-backoffice, bff-mobile, ai-engine, microservice-*, shared-sdk-client, contracts-and-schemas, platform-infra, observability-platform, docs) on the current branch heads and origin/main.

Removed Callers found
GET /v1/backoffice/kubernetes/overview none; deleted from the BFF in #9
GET/PUT/DELETE /v1/backoffice/service-targets[/:service] none; deleted from the BFF in #9
GET /v1/backoffice/routing/history not present in the gateway route table at all (already gone), so nothing to remove; a 404 test now covers it
GET/POST /v1/backoffice/ai-engine/connections, PUT/DELETE .../connections/:presetId, POST .../connections/:presetId/activate none; deleted from the BFF in #9
GET/POST /v1/backoffice/ai-engine/presets, PUT/DELETE .../presets/:presetId none in code. The only hit is a Backoffice test asserting the URL is NOT fetched
GET/PUT/DELETE /internal/admin/ai-engine/target (gateway-owned) none in code. bff-backoffice syncAiEngineLlamaTarget calls ai-engine-api at /internal/admin/llama-target, not the gateway. The only other hit is platform-infra/scripts/smoke-stg-edge.sh, which asserts the path is NOT public (expects 404 with a bearer token), and that stays true after removal
routingStateStore.ts + GATEWAY_ROUTING_STATE_FILE only used by the admin target routes and the ai-engine base-URL lookup; upstreams now resolve from AI_ENGINE_API_URL / AI_ENGINE_STATS_URL only

Follow-on dead code removed with them: API_GATEWAY_ADMIN_TOKEN (no admin route left, so it is no longer a required credential at startup), ALLOWED_ROUTING_TARGET_HOSTS and isTargetHostAllowed/CIDR helpers, and the parseJsonBody opt-in of the raw JSON body parser (its only user was the admin PUT).

Kept on purpose

  • GET/PUT/DELETE /v1/backoffice/ai-engine/target, POST /v1/backoffice/ai-engine/probe, GET /v1/backoffice/ai-engine/plugin/capabilities (Backoffice llama target card).
  • All /internal/ai-engine/* routes and the ai-engine-api / ai-engine-stats upstreams.
  • The admin rate-limit category and RATE_LIMIT_ADMIN_MAX: now unreachable, but removing a public config knob is a separate decision.

LOC

158 added, 1528 deleted across 18 files (net -1370). Production code: 353 deleted, 10 added in src/app and .env.example (including the 111-line routingStateStore.ts); the rest is tests, fixture (62 -> 46 routes) and docs.

Fixture tests/fixtures/gatewayRoutes.json and the pinned counts in proxyRouteEquivalence.test.ts were updated together: 62 -> 46 routes, edge 44 -> 31, internal 7, none 8, backoffice routes 44 -> 31. A new test asserts every removed path now returns 404.

Verification

npm ci, npm run build, npm run lint clean; npm run test:coverage: 255 tests pass, branch coverage 92.98% (gate 90%).

Deploy note

platform-infra kubernetes/base/api-gateway/deployment.yaml still sets GATEWAY_ROUTING_STATE_FILE; the gateway now ignores it, so it is harmless and can be dropped in platform-infra (the chore/remove-routing-leftovers branch there is the natural place). If the runtime secrets define API_GATEWAY_ADMIN_TOKEN, it can be removed too.

@codecov

codecov Bot commented Nov 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Sebas1705
Sebas1705 merged commit 2a802f6 into main Nov 14, 2026
6 checks passed
@Sebas1705
Sebas1705 deleted the refactor/remove-dead-routing-routes branch November 14, 2026 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant