Skip to content

Move node transport to /api/v1 and stop forwarding it through Web - #119

Merged
SaladDay merged 2 commits into
mainfrom
codex/machine-transport-api
Sep 25, 2026
Merged

SaladDay merged 2 commits into
mainfrom
codex/machine-transport-api

Conversation

@SaladDay

@SaladDay SaladDay commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Move node transport out of /core into the machine namespace /api/v1. The Web console stops forwarding any machine traffic.

Why

This follows the approved Core/Web boundary:

  • /v1: applications, Project API key.
  • /core/v1: Core Web and operator scripts, Core key.
  • /api/v1: machine connections only.

The TLS proxy sends /v1 and /api/v1 straight to Core, and everything else to Web.

Change

  • Routes: POST /core/v1/sandbox/enroll, GET /core/v1/sandbox/node/{configuration,identity} and WebSocket /core/v1/sandbox/node/connect move to /api/v1/sandbox-node/{enroll,configuration,identity,connect}. Authentication is unchanged (enrollment token or node credential). There is no compatibility layer for the old paths; a node must come from the same distribution as its Core.
  • Clients: the node binary and the installer use the new paths. The installer gives separate messages for 404 (route /api/v1 to Core), 409 (maintenance or deployment conflict), other HTTP errors, and connection errors.
  • Console: node and daemon forwarding is removed. The console returns 404 for /v1 and /api/v1, including WebSocket upgrades. /node-install/* is still served.
  • Contracts: scripts/openapi-split writes /api/v1 paths to a new contracts/agents-api/runtime.openapi.yaml and prunes the security schemes each document doesn't use. The public openapi.yaml is unchanged.
  • Docs:

Validation

  • Tests: directed tests for node, cmd/server, api (PostgreSQL), core-console and openapi-split, plus 130 installer tests.
  • Real check: a real Core, console and Docker node from this branch, behind a routing proxy. Enrollment, configuration, identity recovery and the WebSocket connection work on the new paths, and the node is online and provider-ready. The old paths return 404 with the Core key. The console returns 404 for the /api/v1 node and daemon routes and for WebSocket upgrades. Evidence is in ~/.parsar/acceptance/machine-transport-api/evidence/.
  • Gate: full make check (server mode) passed on dfbe7d7f. Playwright browser cases were skipped on the server (Chrome unavailable; user-approved skip).
  • Review: an independent blind review by a fresh Claude subagent found no code defects. The P1 upgrade-doc gap, the P2 doc gaps and the P3 nits were fixed in dfbe7d7f. Those were small, local fixes, verified by tests and the gate without a second review round.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith with what you need. Autofix is disabled.

…rough Web

Sandbox node enrollment, configuration, identity and the node WebSocket move
from /core/v1/sandbox/{enroll,node/*} to /api/v1/sandbox-node/*, beside the
existing /api/v1/agent-daemon routes. Authentication is unchanged: an
enrollment token or the node credential. The old paths are removed.

The console no longer forwards node or daemon transport and returns 404 for
/v1 and /api/v1 whatever the credential; the TLS reverse proxy sends both
directly to Core. make openapi now writes /api/v1 routes to
contracts/agents-api/runtime.openapi.yaml; the public openapi.yaml is
unchanged. Docs describe the routing table and that older nodes cannot
connect to this Core, so upgrades follow the drain and re-enrollment workflow.
Address the blind review of the /api/v1 node transport move:

- The upgrade steps now say to route /api/v1/*, including WebSocket upgrades,
  directly to Core when the release goes live; the old routing breaks every
  Runtime daemon connection, not only node enrollment.
- The pre-specification drain needs a Core built from a commit with #114 that
  still serves the old node paths (for example 7b66be2); drain there, then
  upgrade. Re-enrollment stops the old node service and moves its identity
  directory aside first.
- CONTRIBUTING notes the executor-credential routes that still go to Core.
- The node installer reports 404 as a routing problem, 409 as maintenance or a
  deployment conflict and keeps the proxy hint for connection errors; the
  self-hosted connection check reports 404 as a routing problem.
- openapi-split keeps only the security schemes each non-public document uses;
  the public openapi.yaml is unchanged.
- Console tests cover encoded and doubled separators toward /api/v1.
@SaladDay
SaladDay merged commit 2c97e3e into main Sep 25, 2026
3 of 4 checks passed
@SaladDay
SaladDay deleted the codex/machine-transport-api branch October 7, 2026 06:38
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