Update API Codex for Velocity proxy lifecycle

This commit is contained in:
jester 2026-04-25 20:34:47 +00:00
parent 76d5ead0d3
commit e51ef18828

View File

@ -24,6 +24,7 @@ This file records what is believed to be implemented now.
- `/ready` for semantic readiness
- `/status` for detailed state snapshot
- Portal should rely on API-normalized state, not direct agent state.
- Proxy lifecycle is now tracked separately from agent readiness under `ContainerInstance.payload.proxy`.
## Readiness cleanup already done
- `agentClient.js` centralizes non-streaming agent transport.
@ -41,6 +42,18 @@ This file records what is believed to be implemented now.
- Post-provision edge publishing is still active.
- Post-provision behavior has been adjusted away from legacy port-allocation commits and should be understood as request-driven / payload-driven.
## Velocity / Minecraft edge lifecycle
- Minecraft edge publish uses Velocity instead of Traefik TCP config.
- API registers Minecraft backends with the Velocity bridge using `POST /zpack/register` and unregisters with `POST /zpack/unregister`.
- Velocity registration verification now uses the bridge's real `GET /zpack/status` route instead of the nonexistent `/zpack/list` route.
- `/zpack/status` is expected to expose a `servers` array containing `{ name, address, port }` entries.
- If `/zpack/status` exists but does not expose registered backends, API treats the register response as acknowledged but unverifiable instead of falsely failing the registration.
- API exposes `POST /internal/velocity/proxy-status` for bridge lifecycle callbacks using the same hashed `X-Zpack-Secret` shared-secret auth style.
- Accepted proxy lifecycle statuses are `registered_with_proxy`, `proxy_ping_ok`, and `proxy_ping_failed`.
- Proxy lifecycle callbacks are stored under `ContainerInstance.payload.proxy` with source, status, server name, address, port, duplicate flag, timestamps, latency, detail, and last event time.
- `GET /api/servers/:id/status` now includes the stored `proxy` object beside agent-derived live status.
- The bridge should set `ZPACK_PROXY_STATUS_ENDPOINT` to the API internal callback URL, for example `http://<api-host>:4000/internal/velocity/proxy-status`.
## Backup support
- API forwards game backup operations.
- Current API route shape: