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

Defect on the v1.0.0 path: production's /api/v1/changelog still says check null on commit f16369b, which already contains the #15529 fix #15538

Merged opened this

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

Merged

Production's changelog now carries the running commit's check verdict by asking the host forge, and when it can't get one it says unknown instead of null. The covering tests pass; the v1 probe will only show PASS once this is deployed. Cause.

Notes

shipped production is serving it deploy 3fede26

opened this

Production's changelog now carries the running commit's check verdict by asking the host forge, and when it can't get one it says unknown instead of null. The covering tests pass; the v1 probe will only show PASS once this is deployed.

Cause. Production (lab--forge-trevato-apps) is this forge running as an app of forge.open-platform.sh, with its own empty database. The host never passes FORGE_REPO to an app, so forgeRepo() found nothing and runningCheck returned null. The verdict wasn't missing because of a squash or a cache. It lives only on the host, which ran the check. You can see the empty database in production's own answer: live: [] and releases: [].

Fix.

  • The host names the repository: it now passes FORGE_APP_REPO=owner/name to every app it starts or wakes (src/apps/process.ts, runtime_bringup.ts, runtime_sleep.ts).
  • The app asks the host: a new module, src/release/host_check.ts, calls GET $FORGE_API_URL/repos/<repo>/commits/<commit>/check with the read-only FORGE_TOKEN the app already gets. It gives up after 2 s, refuses redirects, and keeps only state and a validated runId; the summary, log and looks are dropped. The host's own address is already reachable from an app, so forge.json egress doesn't change.
  • When it's asked: runningCheck only asks the host when this forge holds no FORGE_REPO of its own. An ok or failed answer is kept for good. A running one is kept for 60 s, so the changelog doesn't wait on the host each time.
  • unknown instead of null: when there's a valid commit but no host to ask, or the host doesn't answer, the result is {commit, state: "unknown", runId: null}. null now only means there is no running commit. The probe already reports unknown as UNKNOWN ("check is unknown"), so it can tell "not known here" from broken. I kept the existing running for a check still in progress rather than adding pending.

Tests. test/running-check-hosted.test.ts sets up production's case: an app with no FORGE_REPO and an empty database. It covers:

  • the host's verdict, with exactly three fields;
  • unknown in shippedAnswer;
  • the 60 s window for a running check;
  • the URL and token sent to the host;
  • dropping the summary;
  • refusing bad repository names (it caught .. getting through, now fixed).

It fails without the running_check.ts change. gate --fix and tsc --noEmit are clean.

Not run here. scripts/fast.ts named 2,922 files (over its budget), so I ran the 13 that cover this change instead (app env, app token, running-check, changelog, MCP changelog, keeper pulse, v1-probe, redteam doors). All 177 tests pass; the forge's full check covers the rest. I couldn't record the keep_plan or estimate updates the issue asks for, because those tools weren't available to me.

To try it. After merge and deploy, run curl …/api/v1/changelog on production. It should show "check": {"commit": "<sha>", "state": "ok", "runId": "…"} once the host's check of that commit has finished. Then bun scripts/v1-probe.ts should print PASS for the stranger-journey line; until then the issue should stay open. If it shows unknown instead, the host isn't passing FORGE_APP_REPO or FORGE_TOKEN yet: the app has to be restarted by a deploy running this code.

🤖 Generated with Claude Code

Closes #15537

2 earlier comments · 1 event
commented

Production's changelog now carries the running commit's check verdict by asking the host forge, and when it can't get one it says unknown instead of null. The covering tests pass; the v1 probe will only show PASS once this is deployed.

Cause. Production (lab--forge-trevato-apps) is this forge running as an app of forge.open-platform.sh, with its own empty database. The host never passes FORGE_REPO to an app, so forgeRepo() found nothing and runningCheck returned null. The verdict wasn't missing because of a squash or a cache. It lives only on the host, which ran the check. You can see the empty database in production's own answer: live: [] and releases: [].

Fix.

  • The host names the repository: it now passes FORGE_APP_REPO=owner/name to every app it starts or wakes (src/apps/process.ts, runtime_bringup.ts, runtime_sleep.ts).
  • The app asks the host: a new module, src/release/host_check.ts, calls GET $FORGE_API_URL/repos/<repo>/commits/<commit>/check with the read-only FORGE_TOKEN the app already gets. It gives up after 2 s, refuses redirects, and keeps only state and a validated runId; the summary, log and looks are dropped. The host's own address is already reachable from an app, so forge.json egress doesn't change.
  • When it's asked: runningCheck only asks the host when this forge holds no FORGE_REPO of its own. An ok or failed answer is kept for good. A running one is kept for 60 s, so the changelog doesn't wait on the host each time.
  • unknown instead of null: when there's a valid commit but no host to ask, or the host doesn't answer, the result is {commit, state: "unknown", runId: null}. null now only means there is no running commit. The probe already reports unknown as UNKNOWN ("check is unknown"), so it can tell "not known here" from broken. I kept the existing running for a check still in progress rather than adding pending.

Tests. test/running-check-hosted.test.ts sets up production's case: an app with no FORGE_REPO and an empty database. It covers:

  • the host's verdict, with exactly three fields;
  • unknown in shippedAnswer;
  • the 60 s window for a running check;
  • the URL and token sent to the host;
  • dropping the summary;
  • refusing bad repository names (it caught .. getting through, now fixed).

It fails without the running_check.ts change. gate --fix and tsc --noEmit are clean.

Not run here. scripts/fast.ts named 2,922 files (over its budget), so I ran the 13 that cover this change instead (app env, app token, running-check, changelog, MCP changelog, keeper pulse, v1-probe, redteam doors). All 177 tests pass; the forge's full check covers the rest. I couldn't record the keep_plan or estimate updates the issue asks for, because those tools weren't available to me.

To try it. After merge and deploy, run curl …/api/v1/changelog on production. It should show "check": {"commit": "<sha>", "state": "ok", "runId": "…"} once the host's check of that commit has finished. Then bun scripts/v1-probe.ts should print PASS for the stranger-journey line; until then the issue should stay open. If it shows unknown instead, the host isn't passing FORGE_APP_REPO or FORGE_TOKEN yet: the app has to be restarted by a deploy running this code.

🤖 Generated with Claude Code

commented

Production's /api/v1/changelog now asks the host forge for the running commit's check instead of answering check: null. When no verdict can be had, it says unknown. The probe change in this push fixes the failed check: the gate now passes with no "pipeline first" refusal.

Cause. Production (lab--forge-trevato-apps) is this forge run as an app of forge.open-platform.sh, and it keeps its own empty database. The host never passes FORGE_REPO to an app, and the check runs are all on the host. So forgeRepo() found nothing and runningCheck returned null. It was not a squash, a rebuilt head or a cache.

Fix.

  • Host side (src/apps/process.ts, runtime_bringup.ts, runtime_sleep.ts): every app is now told FORGE_APP_REPO=owner/name when it starts or wakes.
  • New src/release/host_check.ts: asks GET $FORGE_API_URL/repos/<repo>/commits/<commit>/check with the app's existing read-only FORGE_TOKEN. It waits at most 2 s and refuses redirects. It keeps only state and a validated runId, never the summary, log or looks. The host is already reachable from an app, so forge.json egress is unchanged.
  • src/release/running_check.ts: asks the host when this forge holds no FORGE_REPO. An ok or failed answer is kept for good; a running one is kept for 60 s, so the changelog never waits on the host twice in a row. A valid commit with no answer gives {commit, state: "unknown", runId: null}; null now only means there is no running commit.
  • scripts/v1-probe.ts: treats unknown like none, as no verdict. It falls back to the check API, and the line says the release could not tell because its host did not answer.

Tests. test/running-check-hosted.test.ts builds production's case: a forge with no FORGE_REPO and an empty database. It fails without the running_check.ts change. It covers:

  • the host's verdict, in exactly three fields;
  • unknown in the public answer;
  • the 60 s cache for a running check;
  • the URL and token sent to the host, and the summary being dropped;
  • repository names like .. being refused.

test/v1-probe.test.ts gains the unknown case. gate, tsc --noEmit and 13 covering test files pass. scripts/fast.ts named 2,922 files, too many to run here, so the forge's check covers the rest.

To try it. After merge and deploy, curl https://lab--forge-trevato-apps.open-platform.sh/api/v1/changelog should show "check": {"commit": …, "state": "ok", "runId": …} once the host's check of that commit has finished. Then bun scripts/v1-probe.ts should print PASS for the stranger-journey line. The issue stays open until it does.

  • unknown after the deploy: the app was started by a host running the older code, without FORGE_APP_REPO. The next deploy fixes that.
  • pending / none: I kept the existing running for a check still in progress rather than adding pending; none still means never checked.
  • Gate warning left as is: the new test's setup is 0.88 similar to test/no-signup-admin.test.ts. It is a warning only, and I did not merge the two.
  • Plan and estimate: the keep_plan and estimate tools the issue mentions were not available in this run, so neither was recorded.

🤖 Generated with Claude Code

Approved

Cause is named (the host never passes FORGE_REPO to an app, so forgeRepo() found nothing and the verdict lives only on the host). The fix is small and safe: host_check.ts has a 2 s timeout, refuses redirects, validates repo and commit, keeps only state and a validated runId, and sends the token only to FORGE_API_URL. Tests would fail without the change. Preview /api/v1/changelog now answers check {state:"unknown"} instead of null, as expected, because the host that started it runs the old code and sets no FORGE_APP_REPO. Next two things: (1) after deploy, confirm production shows state ok and run bun scripts/v1-probe.ts; (2) the new test setup is 0.88 similar to test/no-signup-admin.test.ts, so share the helper when next touched.

commented

Left #15537 open: 1 unticked item remain (Do not close until bun scripts/v1-probe.ts prints PASS for that line against production.).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs