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

Defect on the v1.0.0 path: the v1 probe's stranger-journey line is UNKNOWN against production, so v1.0.0 cannot be proven live #15541

Merged opened this

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

Merged

Production's changelog now gets the running release's check verdict from the host forge even when the host doesn't name the repository, so the v1 probe's stranger-journey line can read PASS or FAIL. It still prints UNKNOWN against production until this pull lands and deploys, so the issue's last box stays open.

Notes

shipped production is serving it deploy 496afdb

opened this

Production's changelog now gets the running release's check verdict from the host forge even when the host doesn't name the repository, so the v1 probe's stranger-journey line can read PASS or FAIL. It still prints UNKNOWN against production until this pull lands and deploys, so the issue's last box stays open.

Why it was UNKNOWN: production's /api/v1/changelog answered "check":{"state":"unknown"}. The host forge runs 0.7.629 (cab90cf, from 2026-11-20), which is older than #15538 and never sets FORGE_APP_REPO. Without it, hostCheckUrl gave up before asking the host anything. Older hosts do set FORGE_API_URL, FORGE_TOKEN and FORGE_APP_URL.

What changed (src/release/host_check.ts):

  • When FORGE_APP_REPO is unset, the app reads the host's GET /api/v1/apps with its read-only token. It picks the app whose production or environment URL has the same origin as FORGE_APP_URL, takes that app's repo.owner/name, and asks …/repos/<repo>/commits/<commit>/check as before.
  • Only the state and run id are kept, as before. No summary or log.
  • If the app isn't in the list, or the list can't be read, the answer stays unknown and the check API is never called with a guessed repository.
  • FORGE_APP_REPO still wins when a newer host sets it.
  • The host is the forge itself, which egress already allows, so forge.json is unchanged.

What I chose not to do: I left scripts/v1-probe.ts alone. It already reads the verdict the changelog states and prints PASS, FAIL or UNKNOWN, and test/v1-probe.test.ts covers ok, failed and unknown. I did not touch the release workflow or the chart.

Tests: a new test in test/running-check-hosted.test.ts covers a host with no FORGE_APP_REPO answering green, red and no check. It also checks that a URL not in the list never reaches the check API, and that bad repository names and odd list shapes are refused. It fails without the change. The gate, tsc --noEmit, and the 127 files scripts/fast.ts named all pass (1765 tests).

How to try it: once this is live, run bun scripts/v1-probe.ts https://lab--forge-trevato-apps.open-platform.sh --repo trevato/forge. stranger journey green on a release should read PASS … full check ok, and curl …/api/v1/changelog should show "check":{"state":"ok",…}.

🤖 Generated with Claude Code

Closes #15540

2 earlier comments · 2 events
commented

Production's changelog now gets the running release's check verdict from the host forge even when the host doesn't name the repository, so the v1 probe's stranger-journey line can read PASS or FAIL. It still prints UNKNOWN against production until this pull lands and deploys, so the issue's last box stays open.

Why it was UNKNOWN: production's /api/v1/changelog answered "check":{"state":"unknown"}. The host forge runs 0.7.629 (cab90cf, from 2026-11-20), which is older than #15538 and never sets FORGE_APP_REPO. Without it, hostCheckUrl gave up before asking the host anything. Older hosts do set FORGE_API_URL, FORGE_TOKEN and FORGE_APP_URL.

What changed (src/release/host_check.ts):

  • When FORGE_APP_REPO is unset, the app reads the host's GET /api/v1/apps with its read-only token. It picks the app whose production or environment URL has the same origin as FORGE_APP_URL, takes that app's repo.owner/name, and asks …/repos/<repo>/commits/<commit>/check as before.
  • Only the state and run id are kept, as before. No summary or log.
  • If the app isn't in the list, or the list can't be read, the answer stays unknown and the check API is never called with a guessed repository.
  • FORGE_APP_REPO still wins when a newer host sets it.
  • The host is the forge itself, which egress already allows, so forge.json is unchanged.

What I chose not to do: I left scripts/v1-probe.ts alone. It already reads the verdict the changelog states and prints PASS, FAIL or UNKNOWN, and test/v1-probe.test.ts covers ok, failed and unknown. I did not touch the release workflow or the chart.

Tests: a new test in test/running-check-hosted.test.ts covers a host with no FORGE_APP_REPO answering green, red and no check. It also checks that a URL not in the list never reaches the check API, and that bad repository names and odd list shapes are refused. It fails without the change. The gate, tsc --noEmit, and the 127 files scripts/fast.ts named all pass (1765 tests).

How to try it: once this is live, run bun scripts/v1-probe.ts https://lab--forge-trevato-apps.open-platform.sh --repo trevato/forge. stranger journey green on a release should read PASS … full check ok, and curl …/api/v1/changelog should show "check":{"state":"ok",…}.

🤖 Generated with Claude Code

Changes requested — before the latest push

The fix rests on an endpoint I cannot find. The preview at this head answers /api/v1/changelog with check.state "unknown", and the forge's own API answers GET /api/v1/apps with 404 not_found, even with a token.

Fix first: prove that GET <FORGE_API_URL>/apps exists on the host that serves production (0.7.629), that a read-only app token may read it, and that its items carry url, environments[].url and repo.{owner,name}. Cite the route in this repo or the host's contract. If it does not exist, use a lookup that does, for example a route keyed by app URL or one that already carries the check verdict. As written, production would most likely still print UNKNOWN.

Also needed:

  1. Add a test that drives createApp or the real appEnv with no FORGE_APP_REPO, so the shape of the apps answer is pinned to what the host really serves. The new test only feeds a hand-written fixture.
  2. Show the preview or production changelog reading ok or failed, not unknown, then run bun scripts/v1-probe.ts <production> --repo trevato/forge and report the PASS line.
  3. In hostCheck, the hostApi and commit checks are now duplicated in hostCheckUrl. Drop one.

No README or docs change is needed, there is no page or TUI surface, and the security shape is fine: the token goes only to the host, redirects are refused, and the repo name is validated.

commented

I reworked the change after the review. Production still prints UNKNOWN on the probe until this merges and deploys. The new route-pinned test passes 1 of 3 against main's code and 3 of 3 with the change.

The route exists on the 0.7.629 host. GET /api/v1/apps is registered in src/http/api.ts at cab90cf, line 3865, the commit the host runs. It has been there since #406, and items are built by appJson: repo: { owner, name }, url (the production URL) and environments[].url. Read without a token, the host already lists lab with repo: trevato/forge, url: https://lab--forge-trevato-apps.open-platform.sh and every pull-N preview URL.

The 404 came from the run gate, not a missing route. src/http/run_gate.ts closes every route outside the run's own repository to tokens bound to one repository. That includes crew-run tokens and preview tokens (mintAppToken, since c56413994). Production's app token has no binding, so it reads the list as its owner.

What changed in src/release/host_check.ts:

  • Preview fallback: when the token is refused the list (a preview's), the list is read once without a token. The check is still asked with the token, which the gate allows for the preview's own repository.
  • Point 3: hostCheckUrl is gone, along with its duplicated checks. hostCheck checks the host and commit once and builds the URL with checkUrl. Its old tests now go through hostCheck and assert that nothing is fetched.

Point 1: new test/host-check-apps.test.ts serves a real forge with an AppsRuntime and builds the env with the real appEnv and a real minted token, with no FORGE_APP_REPO. It pins three things:

  • Production's token reads /api/v1/apps, finds its private repository at its own URL, and asks that check.
  • A preview's token gets 404 on the list, and the read without a token names each public app's repo and url.
  • An app the list doesn't serve at its URL asks no check at all.

Point 2, measured:

  • At 732b375 the preview's /api/v1/changelog now says "check":{"state":"none"}, not "unknown". That is exactly what the host says for that commit (…/commits/732b375b2…/check → none), because no check has run on it yet.
  • The host says state: "ok" (run 01m81qeq870b922k7ybqfrqse8) for 356be4e, production's running commit. Once production runs this code its changelog should read ok, and bun scripts/v1-probe.ts https://lab--forge-trevato-apps.open-platform.sh --repo trevato/forge should print PASS for stranger journey green on a release. Leave the issue open until it does.

The gate and tsc --noEmit are clean, and the 128 test files scripts/fast.ts named all pass (1768 tests).

🤖 Generated with Claude Code

Approved

Earlier asks are met: the route is pinned by a test against a real served forge (production token reads /apps, preview token refused then read anonymously), hostCheckUrl duplication is gone, and the preview changelog now says check state none (the host's real answer for that commit) instead of unknown. Only state and run id are kept; an app not in the list never reaches the check API; FORGE_APP_REPO still wins. No page change, no new dependency, no README edit. Next: (1) once deployed, run bun scripts/v1-probe.ts against production and confirm PASS; (2) Non-blocking: drop the FORGE_APP_REPO fallback once production's host is past #15538.

commented

Left #15540 open: 1 unticked item remain (bun scripts/v1-probe.ts <production> --repo trevato/forge prints PASS for that line; do not close until it does.).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs