Skip to content

feat(api): add GET /routes machine-readable endpoint registry (#1289) - #1291

Merged
ajianaz merged 1 commit into
developfrom
feat/1289-routes-introspection
Sep 28, 2026
Merged

ajianaz merged 1 commit into
developfrom
feat/1289-routes-introspection

Conversation

@ajianaz

@ajianaz ajianaz commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

What

  • GET /routes on uteke-serve returns the endpoint registry as JSON: for every route — method, path, tier (CORE/LAB), description, request/response type names, related issues. The payload is serialized directly from api_registry::ENDPOINTS, the same single source of truth that docgen renders into docs/api-reference.md.
  • mod api_registry is un-gated from the docgen feature on both the bin and the lib target: the registry is runtime data now (served over HTTP), in addition to its docgen role.
  • The /routes registry entry is LAB tier — the CORE list in docs/core-contract.json (uteke-cloud contract) is unchanged; docgen groups /routes under Health & Info; uteke-serve usage text updated; CHANGELOG entry added under [Unreleased].
  • Tests: 3 new server-level tests — payload shape/count vs the registry, auth roles (401 anonymous / 200 read-only token), and the catch-all 404 on POST.

Why

#1289: the server exposed no machine-readable API description, so every consumer integration tripped over contract mismatches that live only in source code — GET vs POST confusion (/room/stats and /doc/list are POST-only), room_id vs room, body-vs-query parameter placement. Two false "missing feature" reports this week alone came from that class. A spec endpoint lets typed clients, MCP tool descriptions, and agent skill notes validate against the real contract instead of stale notes (issue option 2 — smallest lift, biggest payoff).

Testing

  • cargo fmt --all -- --check ✅
  • cargo clippy --workspace --all-targets -- -D warnings — exit 0 ✅
  • cargo test --workspace — exit 0, no failures (572 passed in uteke-server, including the 3 new tests) ✅
  • Feature matrix: check -p uteke-core --no-default-features --features vecq / --features onnx,vecq, build -p uteke-server --no-default-features --features vecq ✅
  • cargo run -p docgen regenerated docs (committed) ✅
  • Live E2E against the built server (auth + read-only token configured): anonymous → 401; GET /routes with read-only token → 200, 78 entries, self-listing with tier lab; POST /routes → 404; CORE list in core-contract.json unchanged ✅
  • Pre-commit hooks: fmt + clippy + cora review (No issues found) ✅

Closes #1289

@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

uteke-serve now serves the endpoint registry as JSON — method, path, tier, description, request/response types, and issues per route — serialized straight from api_registry::ENDPOINTS, the same single source of truth that generates docs/api-reference.md, so consumers can validate against the real contract instead of stale notes (GET vs POST, room_id vs room, body-vs-query params). mod api_registry is un-gated from the docgen feature (it is runtime data now); the registry entry is LAB tier so the CORE contract list is untouched; usage text, docgen grouping, and CHANGELOG updated; 3 new server tests cover payload shape, auth roles, and the 404 catch-all.
@ajianaz
ajianaz force-pushed the feat/1289-routes-introspection branch from 074f8fe to f3a076f Compare September 28, 2026 22:32
@ajianaz
ajianaz merged commit fbfed5f into develop Sep 28, 2026
15 checks passed
@ajianaz
ajianaz deleted the feat/1289-routes-introspection branch September 28, 2026 22:37
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.

api: expose machine-readable API spec (OpenAPI route or minimal /routes introspection)

1 participant