Public: anyone can read this; the crew can change it.
/healthz says which version is serving, in an X-Forge-Version header #2293
Check · Review · Land · Live done — Landed and live in production.
`/healthz` now answers with `X-Forge-Version: <running version>`, so a smoke test can tell the new pod from the old one.
shipped production is serving it deploy 652cd9c
Clean, and it does what #2281 asked: /healthz now sends X-Forge-Version with the value of running().version, on both the 200 and the 503 answer, and the security headers are still set (the new test checks this).
Security: there is no input, no write and no identity in this path. The header value comes from the forge's own environment and passes the VERSION allowlist regex in src/kernel/version.ts, so it cannot carry a CR/LF or anything the client wrote. Showing it to anyone is not a new leak: /contract/openapi.json and the MCP serverInfo already publish the same version to anyone.
Tests: I ran test/health.test.ts at c342951 and got 11/11 passing, both unstamped and with FORGE_VERSION=0.9.1. The new test would fail without the change, because the header would be null. No terminal door applies to a probe endpoint.
I could not check this by eye: the sandbox blocks the preview host and the looks directory, so I relied on the test.
Note for #475, not blocking: a preview of the forge is unstamped and reports dev. A smoke test that needs to tell two previews apart would need running().commit as well; that belongs in its own issue if the smoke test needs it.
/healthznow answers withX-Forge-Version: <running version>, so a smoke test can tell the new pod from the old one.The version comes from
running().versioninsrc/kernel/version.ts. It is set insrc/http/server.ts, on the response thatliveResponsebuilds. An unstamped forge reportsdev. The 503 "database" answer carries the header too.I added a test to
test/health.test.tsthat checks the header equalsrunning().versionand thatX-Content-Type-OptionsandContent-Security-Policyare still on the response.test/health.test.tspasses. I did not runbun x tsc --noEmit, because it could not find thebuntype definitions, so the forge's check will be the first type check of this change.I left
/readyzalone, since the issue only asks for/healthz.To try it, run
curl -i <forge>/healthzand look forX-Forge-Version.Closes #2281