Public: anyone can read this; the crew can change it.

The release tick's last beat is readable without a token: when and whether it passed, never its reason, so the v1 probe can prove it through the app proxy #15526

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Anyone can now read the release tick's last beat without a token, and the v1 probe uses that to print PASS or FAIL on its keeper's last beat line. The forge still strips authorization at the app proxy; stripForgeCredentials in src/apps/proxy.ts is unchanged.

Notes

shipped production is serving it deploy 3fede26

opened this

Anyone can now read the release tick's last beat without a token, and the v1 probe uses that to print PASS or FAIL on its keeper's last beat line. The forge still strips authorization at the app proxy; stripForgeCredentials in src/apps/proxy.ts is unchanged.

  • New route: GET /api/v1/keeper/pulse in src/http/api/keeper.ts reads the newest beat the same way /api/v1/keeper does (heartbeatOf). It answers {at, outcome, silent} with those three fields named one by one, so a field added to the heartbeat later cannot leak through. Before the first beat it answers {at: null}. The reason and the history stay behind mayReadKeeper, and /api/v1/keeper still answers 403 to anonymous and read-only callers. The route records its session phase like the keeper route, so it is timed like every other route.
  • Probe: scripts/v1-probe.ts reads the pulse first, with no token. It prints FAIL when the outcome is failed or the beat is silent, PASS otherwise, and UNKNOWN when there is no beat yet. Only when the pulse is absent (a release from before this change) and FORGE_TOKEN is set does it fall back to the old /api/v1/keeper read. Against such a release with no token it prints no keeper line, as before.
  • Docs: an OpenAPI route entry, getApiV1KeeperPulse.ts, and one sentence in docs/REFERENCE.md.
  • Test: test/keeper-pulse.test.ts checks that an anonymous caller gets 200 with exactly the three fields and no reason, and {at: null} before any beat. It checks that /api/v1/keeper stays 403 to anonymous and to an ro token. It runs the probe against a live server: FAIL after a failed beat with no reason text in the evidence, then PASS after a cut. It also covers parsing, stripping control characters and the silent case. The gate finds the file by discovery. Run against the code from before this change, it fails.

Checks run here: bun x tsc --noEmit and bun scripts/gate.ts --fix are clean (the gate rewrapped nothing). scripts/fast.ts named 3,306 files, too many to run here, so I ran the ones that cover this change by hand: the keeper, probe, contract and OpenAPI suites, the route-timing, router, security-sweep and standards suites, and test/check-list.test.ts. All pass.

Left out:

  • I did not record a plan with keep_plan or an estimate with estimate; neither tool was available in this run.
  • The last box on the issue is still open. It can only be ticked once this is live, by running bun scripts/v1-probe.ts https://lab--forge-trevato-apps.open-platform.sh from the crew's shell and seeing PASS or FAIL on the keeper line. Keep the issue open until then.

To try it: curl <preview>/api/v1/keeper/pulse with no token, then bun scripts/v1-probe.ts <preview> and look at the keeper's last beat line.

🤖 Generated with Claude Code

Closes #15524

2 earlier comments · 1 event
commented

Anyone can now read the release tick's last beat without a token, and the v1 probe uses that to print PASS or FAIL on its keeper's last beat line. The forge still strips authorization at the app proxy; stripForgeCredentials in src/apps/proxy.ts is unchanged.

  • New route: GET /api/v1/keeper/pulse in src/http/api/keeper.ts reads the newest beat the same way /api/v1/keeper does (heartbeatOf). It answers {at, outcome, silent} with those three fields named one by one, so a field added to the heartbeat later cannot leak through. Before the first beat it answers {at: null}. The reason and the history stay behind mayReadKeeper, and /api/v1/keeper still answers 403 to anonymous and read-only callers. The route records its session phase like the keeper route, so it is timed like every other route.
  • Probe: scripts/v1-probe.ts reads the pulse first, with no token. It prints FAIL when the outcome is failed or the beat is silent, PASS otherwise, and UNKNOWN when there is no beat yet. Only when the pulse is absent (a release from before this change) and FORGE_TOKEN is set does it fall back to the old /api/v1/keeper read. Against such a release with no token it prints no keeper line, as before.
  • Docs: an OpenAPI route entry, getApiV1KeeperPulse.ts, and one sentence in docs/REFERENCE.md.
  • Test: test/keeper-pulse.test.ts checks that an anonymous caller gets 200 with exactly the three fields and no reason, and {at: null} before any beat. It checks that /api/v1/keeper stays 403 to anonymous and to an ro token. It runs the probe against a live server: FAIL after a failed beat with no reason text in the evidence, then PASS after a cut. It also covers parsing, stripping control characters and the silent case. The gate finds the file by discovery. Run against the code from before this change, it fails.

Checks run here: bun x tsc --noEmit and bun scripts/gate.ts --fix are clean (the gate rewrapped nothing). scripts/fast.ts named 3,306 files, too many to run here, so I ran the ones that cover this change by hand: the keeper, probe, contract and OpenAPI suites, the route-timing, router, security-sweep and standards suites, and test/check-list.test.ts. All pass.

Left out:

  • I did not record a plan with keep_plan or an estimate with estimate; neither tool was available in this run.
  • The last box on the issue is still open. It can only be ticked once this is live, by running bun scripts/v1-probe.ts https://lab--forge-trevato-apps.open-platform.sh from the crew's shell and seeing PASS or FAIL on the keeper line. Keep the issue open until then.

To try it: curl <preview>/api/v1/keeper/pulse with no token, then bun scripts/v1-probe.ts <preview> and look at the keeper's last beat line.

🤖 Generated with Claude Code

commented

Anyone can now read the release tick's last beat without a token, and the v1 probe uses that to print PASS or FAIL on its keeper's last beat line. The forge still strips authorization at the app proxy; stripForgeCredentials in src/apps/proxy.ts is unchanged.

  • New route: GET /api/v1/keeper/pulse in src/http/api/keeper.ts reads the newest beat the same way /api/v1/keeper does (heartbeatOf). It answers {at, outcome, silent} with those three fields named one by one, so a field added to the heartbeat later cannot leak through. Before the first beat it answers {at: null}. The reason and the history stay behind mayReadKeeper, and /api/v1/keeper still answers 403 to anonymous and read-only callers. The route records its session phase like the keeper route, so it is timed like every other route.
  • Probe: scripts/v1-probe.ts reads the pulse first, with no token. It prints FAIL when the outcome is failed or the beat is silent, PASS otherwise, and UNKNOWN when there is no beat yet. Only when the pulse is absent (a release from before this change) and FORGE_TOKEN is set does it fall back to the old /api/v1/keeper read. Against such a release with no token it prints no keeper line, as before.
  • Docs: an OpenAPI route entry, getApiV1KeeperPulse.ts, a sentence in docs/REFERENCE.md, and a bullet in docs/features/release-heartbeat.md.
  • Terminal: no new screen. The Release keeper screen already shows the whole beat, reason included, to anyone allowed to read it. A commit says so in a No door: line, which is what the gate's both-doors rule accepts.
  • Test: test/keeper-pulse.test.ts checks that an anonymous caller gets 200 with exactly the three fields and no reason, and {at: null} before any beat. It checks that /api/v1/keeper stays 403 to anonymous and to an ro token. It runs the probe against a live server: FAIL after a failed beat with no reason text in the evidence, then PASS after a cut. It also covers parsing, stripping control characters and the silent case. The gate finds the file by discovery. Run against the code from before this change, it fails.

Checks run here: bun scripts/gate.ts and bun x tsc --noEmit pass. scripts/fast.ts named 3,306 files, too many to run here, so I ran the ones that cover this change by hand: the keeper, probe, contract and OpenAPI suites, the both-doors and feature-doc suites, the route-timing, router, security-sweep and standards suites, and test/check-list.test.ts. All pass.

Left out:

  • I did not record a plan with keep_plan or an estimate with estimate; neither tool was available in this run.
  • The last box on the issue is still open. It can only be ticked once this is live, by running bun scripts/v1-probe.ts https://lab--forge-trevato-apps.open-platform.sh from the crew's shell and seeing PASS or FAIL on the keeper line. Keep the issue open until then.

To try it: curl <preview>/api/v1/keeper/pulse with no token, then bun scripts/v1-probe.ts <preview> and look at the keeper's last beat line.

🤖 Generated with Claude Code

Approved

Clean. The pulse route names its three fields one by one, so no reason leaks. /api/v1/keeper stays 403 on the preview. The preview answers 200 anonymously with the security headers. Tests cover the exact keys, the 403s and the probe PASS/FAIL. The probe sends no token to the pulse. The docs are in docs/features and REFERENCE, not README.

commented

Left #15524 open: 1 unticked item remain (After it is live, bun scripts/v1-probe.ts https://lab--forge-trevato-apps.open-platform.sh prints PASS or FAIL on the keeper line from the crew's shell. Do not close the issue until it does.).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs