Public: anyone can read this; the crew can change it.
Health tells a stranger only ok and draining #16604
Check · Review · Land · Live done — Landed and live in production.
StrangerHealth in src/actions/health.ts is now { ok, draining }. Signed out, /api/v1/health and /health return only ok, draining, release and schedules. A caller sending the probe or signed in to an account still gets version and commit.
shipped production is serving it deploy 3256dd5
StrangerHealth in src/actions/health.ts is now { ok, draining }. Signed out, /api/v1/health and /health return only ok, draining, release and schedules. A caller sending the probe or signed in to an account still gets version and commit.
Probe callers checked first. Every caller that reads version or commit from health already sends x-forge-probe, so none needed changing:
- swap:
startRelease, called fromchecks/landing.ts,keeper/swapper.ts(throughkeeper/wire.ts) andrelease/rollback.ts - boot:
release/boot.ts - launch:
release/launch.ts, which has its own copy of the probe code - release proof:
release/prove.tsand the keeper's probes
Two other readers only use ok or release: snapshot/boot.ts and core/v1_proof.ts. release stays in the stranger's answer because the v1 proof reads it (#13263).
Other code that read version or commit off a stranger's answer:
forgeLinesinsrc/tui/screens/system.tsnow printsforge · servingfor a stranger instead of the version and commit.- The discovery check in
scripts/forge-compat-lab/driver.tsnow requires a booleanokfrom health, and takes the version from/api/v1/versionwhen health gives none.
Tests:
- New in
test/health.test.ts: a stranger, or a wrong probe value, gets exactly the four keys on both paths; the real probe gets the running version and commit. test/vitals.test.tsandtest/health-schedules.test.tsnow expect the stranger shape.- These tests were wrong under the new rule, because they expected a stranger to see version or commit. Each now reads them with the probe or a member token:
test/health-schedules.test.ts(#13263 case),test/version.test.ts,test/status-page.test.ts,test/app-release-15497.test.ts. test/tui-system.test.tsnow expects the stranger's lineforge · serving.
Not done:
- The commit is still public on
/statusand/llms.txt, so this change makes health say less but doesn't hide the commit. Making it secret would be a separate issue. - I didn't edit the OpenAPI text for the route ("a stranger is told little"); it's still accurate.
- No new functions, so there was nothing to check with
scripts/similar.tsor reuse. - I didn't update the plan on the issue: the
keep_planandestimatetools weren't available in this session.
Checks: bun scripts/gate.ts --fix and bun x tsc --noEmit are clean. scripts/fast.ts named 2754 test files, far too many to run here, so I ran the 89 test files that read health (822 tests, 0 failures, 1 skipped) and the release swap, boot, launch and rollback suites.
To try: curl $URL/api/v1/health signed out shows { ok, draining, release, schedules }. With a token, or the x-forge-probe header, it also includes version and commit.
🤖 Generated with Claude Code
Signed out, the preview's /api/v1/health and /health answer only ok, draining, release and schedules. The probe and signed-in paths keep version and commit, and the tests cover both. The TUI stranger line and the compat-lab driver were updated to match. Next two things: (1) the commit is still public on /status and /llms.txt, so decide in a follow-up whether that is intended; (2) add a short line to the OpenAPI health description saying version and commit go to the probe and signed-in callers only.
StrangerHealthinsrc/actions/health.tsis now{ ok, draining }. Signed out,/api/v1/healthand/healthreturn onlyok,draining,releaseandschedules. A caller sending the probe or signed in to an account still getsversionandcommit.Probe callers checked first. Every caller that reads version or commit from health already sends
x-forge-probe, so none needed changing:startRelease, called fromchecks/landing.ts,keeper/swapper.ts(throughkeeper/wire.ts) andrelease/rollback.tsrelease/boot.tsrelease/launch.ts, which has its own copy of the probe coderelease/prove.tsand the keeper's probesTwo other readers only use
okorrelease:snapshot/boot.tsandcore/v1_proof.ts.releasestays in the stranger's answer because the v1 proof reads it (#13263).Other code that read version or commit off a stranger's answer:
forgeLinesinsrc/tui/screens/system.tsnow printsforge · servingfor a stranger instead of the version and commit.scripts/forge-compat-lab/driver.tsnow requires a booleanokfrom health, and takes the version from/api/v1/versionwhen health gives none.Tests:
test/health.test.ts: a stranger, or a wrong probe value, gets exactly the four keys on both paths; the real probe gets the running version and commit.test/vitals.test.tsandtest/health-schedules.test.tsnow expect the stranger shape.test/health-schedules.test.ts(#13263 case),test/version.test.ts,test/status-page.test.ts,test/app-release-15497.test.ts.test/tui-system.test.tsnow expects the stranger's lineforge · serving.Not done:
/statusand/llms.txt, so this change makes health say less but doesn't hide the commit. Making it secret would be a separate issue.scripts/similar.tsor reuse.keep_planandestimatetools weren't available in this session.Checks:
bun scripts/gate.ts --fixandbun x tsc --noEmitare clean.scripts/fast.tsnamed 2754 test files, far too many to run here, so I ran the 89 test files that read health (822 tests, 0 failures, 1 skipped) and the release swap, boot, launch and rollback suites.To try:
curl $URL/api/v1/healthsigned out shows{ ok, draining, release, schedules }. With a token, or thex-forge-probeheader, it also includesversionandcommit.🤖 Generated with Claude Code
Closes #16262