Public: anyone can read this; the crew can change it.
/status and /api/v1/health name the same running commit #14224
Check · Review · Land · Live done — Landed and live in production.
This change adds a test that checks /status (JSON) and /api/v1/health report the same running commit and release. There was no split to fix in the code: on main both answers already get the commit from running() in src/kernel/version.ts.
shipped production is serving it deploy 501b993
1 earlier comment · 1 event
This change adds a test that checks /status (JSON) and /api/v1/health report the same running commit and release. There was no split to fix in the code: on main both answers already get the commit from running() in src/kernel/version.ts. The status page goes through runningFields, and health goes through forgeHealth() in src/kernel/guard.ts. Neither one reads a release record. So two parts of the issue's "done when" can't be met as written: the test passes on main, and I left running() in src/kernel/version.ts instead of moving it into src/core.
The new test in test/status-page.test.ts sets a known build stamp (FORGE_COMMIT, FORGE_VERSION=v9.8.7), starts the app and asks both endpoints. It checks they return the same full commit, and that /status's version matches health's release (both 9.8.7). If someone later points one of them at a different source, it fails.
Production now: at 13:52 UTC both endpoints returned commit e997b1cb3328b5665b72e200c76f440dd3eac522. Health returned "version":"dev","release":null and /status returned "version":null, so the release fields agree too. The 13:49 mismatch in the issue fell in the same few minutes as two releases (83079e5 → 2af6df6 → e997b1c). It is most likely the old and new processes both answering during the swap. /status's cache-control: public, max-age=10 could also have served a slightly stale answer. Neither of those is a code split.
Not changed: the field names still differ. In /status JSON, version means the release number (or null). In health, version is the raw build stamp (dev on production) and release is the release number. The issue's risks note says the production-behind-main alarms read one of these, so I didn't rename anything. The test pins /status.version to health.release.
Also: production's health reports version: "dev", which means FORGE_VERSION isn't stamped in the running image. That's separate from this issue and I left it alone.
Checks: bun test test/status-page.test.ts (17 pass), bun scripts/gate.ts --fix (nothing to rewrap) and bun x tsc --noEmit all came back clean.
🤖 Generated with Claude Code
Honest and small: a regression test pinning that /status JSON and /api/v1/health report the same commit and that status.version equals health.release. Both already read running() in src/kernel/version.ts, so no code split exists; the test is correct and cleanly restores env. Production now agrees (both e7b06d6, release null). Two next steps: (1) make health's version stop reporting dev by stamping FORGE_VERSION in the image; (2) consider one shared field-name mapping so status.version/health.release cannot drift. Note: the test passes on main, so it is a guard, not a fix.
Left #14220 open: 2 unticked items remain (both answers read one function for the running commit and version (the release record when present, the build stamp otherwise), named once in src/core; a test starts the app with a known stamp and asserts /status JSON and /api/v1/health carry the same commit; it fails on main).
This change adds a test that checks
/status(JSON) and/api/v1/healthreport the same running commit and release. There was no split to fix in the code: on main both answers already get the commit fromrunning()insrc/kernel/version.ts. The status page goes throughrunningFields, and health goes throughforgeHealth()insrc/kernel/guard.ts. Neither one reads a release record. So two parts of the issue's "done when" can't be met as written: the test passes on main, and I leftrunning()insrc/kernel/version.tsinstead of moving it intosrc/core.The new test in
test/status-page.test.tssets a known build stamp (FORGE_COMMIT,FORGE_VERSION=v9.8.7), starts the app and asks both endpoints. It checks they return the same full commit, and that/status'sversionmatches health'srelease(both9.8.7). If someone later points one of them at a different source, it fails.Production now: at 13:52 UTC both endpoints returned commit
e997b1cb3328b5665b72e200c76f440dd3eac522. Health returned"version":"dev","release":nulland/statusreturned"version":null, so the release fields agree too. The 13:49 mismatch in the issue fell in the same few minutes as two releases (83079e5→2af6df6→e997b1c). It is most likely the old and new processes both answering during the swap./status'scache-control: public, max-age=10could also have served a slightly stale answer. Neither of those is a code split.Not changed: the field names still differ. In
/statusJSON,versionmeans the release number (or null). In health,versionis the raw build stamp (devon production) andreleaseis the release number. The issue's risks note says the production-behind-main alarms read one of these, so I didn't rename anything. The test pins/status.versiontohealth.release.Also: production's health reports
version: "dev", which meansFORGE_VERSIONisn't stamped in the running image. That's separate from this issue and I left it alone.Checks:
bun test test/status-page.test.ts(17 pass),bun scripts/gate.ts --fix(nothing to rewrap) andbun x tsc --noEmitall came back clean.🤖 Generated with Claude Code
Closes #14220