2.9 KiB
2.9 KiB
API — Decisions
Settled
- API is the heartbeat authority by polling agents.
- Agent does not push heartbeat/state into API.
- Semantic readiness uses
/ready, not plain HTTP 200. - Portal should consume API-normalized state, not call agents directly for normal state/actions.
/api/instancesand/api/containersare distinct contracts: instances is the active list/create surface, while containers is the cleanup/delete/orphan-remediation surface.- there is no API-native
/api/agent/:serverId/:actionroute inzpack-api; any route with that shape is Portal-owned compatibility behavior rather than an API feature. - streaming upload proxy behavior should remain separate from generic non-streaming
agentClient.jstransport. - websocket console proxy behavior should remain separate from generic non-streaming
agentClient.jstransport. - API is now tracked on a Node 24 baseline with repo-local version pinning.
- built-in global
fetchis the intended fetch implementation; directnode-fetchdependency is no longer the preferred pattern. - duplicated game file proxy behavior should be folded into shared helper paths while preserving compatibility for both canonical and compatibility routes.
- Prisma config should live in dedicated Prisma config, not deprecated
package.json#prismaconfig. - JWT verification hardening is allowed to be contract-sensitive; access, refresh, and IDE proxy tokens may use distinct audience expectations.
- hosted IDE proxy cookies should default to hardened behavior appropriate for public HTTPS deployments.
- proxy logging should avoid exposing cookies or detailed forwarded-header values in routine logs.
- legacy worker-based provisioning is no longer a live API path and should stay archived unless intentionally revived.
- legacy port allocation / slot reservation is no longer part of the active provisioning model and should stay retired unless intentionally revived end to end.
- Minecraft edge routing uses Velocity; API should call the bridge's real HTTP routes:
POST /zpack/register,POST /zpack/unregister, andGET /zpack/status. - API must not depend on a nonexistent Velocity
/zpack/listroute for registration verification. registered_with_proxymeans Velocity accepted the backend into its routing table; it does not mean the Minecraft backend is confirmed playable.proxy_ping_ok/proxy_ping_failedare the stronger proxy-side readiness signals because they come from Velocity pinging the registered backend.- Proxy lifecycle state belongs under
ContainerInstance.payload.proxy, separate from agent readiness andagentState. - The Velocity bridge should report proxy lifecycle events to
POST /internal/velocity/proxy-statususing the same hashedX-Zpack-Secretauth style.
Tracking rule
- when API work completes, remove it from
OPEN_ITEMS.md - if it changes the long-lived architecture, update
CURRENT_STATE.mdor this file