Skip to content

Add loopback runtime process identity endpoint - #267

Open
HaileyStorm wants to merge 1 commit into
FlashML-org:mainfrom
HaileyStorm:codex/runtime-identity-endpoint
Open

Add loopback runtime process identity endpoint#267
HaileyStorm wants to merge 1 commit into
FlashML-org:mainfrom
HaileyStorm:codex/runtime-identity-endpoint

Conversation

@HaileyStorm

Copy link
Copy Markdown

Problem

A local process supervisor can discover a FreeToken HTTP responder through /health, but it cannot correlate that responder with the exact frontend and worker processes it launched. This leaves stale-responder and PID-reuse checks entirely outside the runtime.

Solution

  • Add an optional validated, non-secret --launch-nonce for supervisor correlation.
  • Add versioned, loopback-only GET /v1/runtime/identity reporting the runtime-generated instance ID plus frontend and worker PID, PGID, and Linux starttime facts.
  • Bind process facts after worker spawn and atomically refresh shell-worker PGIDs at the ready boundary after setpgrp().
  • Pin forwarded-header trust to loopback proxy peers so environment configuration cannot broaden trust, while preserving the real remote client address for loopback-proxied admin requests.
  • Make ready, stop, failure, and rebuild transitions terminal-safe, including rejected-request cleanup.
  • Keep the schema privacy-narrow: it exposes no argv, environment, executable/model paths, or caller-supplied source/model/profile/backend claims.

Evidence

CPU/static only:

pytest -q tests/server/test_runtime_identity.py \
  tests/server/test_rebuild_maintenance.py \
  tests/server/test_prepare_stop_accounting.py \
  tests/server/test_parser_auto_selection.py \
  tests/server/test_minimax_m3_parsers.py
104 passed, 1 non-failing Starlette/httpx deprecation warning

py_compile passed for all five changed Python/test files. git diff --check passed. Independent review is CLEAN; focused regression coverage includes proxy authorization, shell PGID publication, concurrent identity reads, terminal accounting failure, and rejected rebuild cleanup.

Scope and residuals

The nonce is correlation data, not authentication. The endpoint is not source, model, profile, or effective-backend attestation; supervisors must still bind its process facts to their owned child and independently verify /proc. Linux /proc starttime is best-effort and nullable off Linux or after process exit. No GPU, model load, provider, live listener/reverse proxy, or real shell-child acceptance was exercised.

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