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

A deploy records the moment it started serving, and the studio says how long that took #30

Merged opened this

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

Merged

Already up to date (the commit was pushed earlier before the budget cutoff). Work is landed.

shipped production is serving it deploy e61e234

opened this

Already up to date (the commit was pushed earlier before the budget cutoff). Work is landed.

A deploy run now gains servingAt, stamped once at the swap-in — the same instant the runtime writes serving <url> — never at the moment its tests finish beside it.

Done:

  • Migration 22 adds run.serving_at (nullable, set once); core/runs.ts exposes it on Run and adds markServing.
  • apps/runtime.ts stamps it at the swap-in and the log line now reads serving <url> — 3.4s after the deploy started.
  • The studio page's app head and a pull's preview block say live 3.4s after the push, starting before it has served, and nothing (no zero) if it never did.
  • A deploy whose tests then fail keeps its failed run and red check exactly as before; only the words changed, to serving · tests failed instead of anything readable as "not up".
  • servingAt rides along on the run wherever the full Run/EnvStatus objects already serialize to JSON (/runs, /runs/:id, the app's environments) — no api.ts change was needed since nothing there hand-picks fields.
  • docs/APPS.md documents the new field and its relationship to startedAt/finishedAt.
  • Two new assertions in test/apps.test.ts: the existing "slow test step" deploy now also checks servingAt is set and earlier than finishedAt; a new test drives a deploy that never answers and checks servingAt stays null (and closes its pull so it doesn't leak into the later restart-count test).

Verified: bun x tsc --noEmit is clean; the full forge.json check suite ran 182 tests, 177 passed. The 5 failures are all the same pre-existing sandbox limitation — local git pushes over HTTP failing with 128/auth required — in tests untouched by this change (apps-adversarial.test.ts, cross-repo-pull.test.ts, web.test.ts, pulls.test.ts, and the same known failure inside apps.test.ts itself); this reproduces identically on main before this change.

Worth a look: the exact wording choices — "live 3.4s after the push" and "serving · tests failed" — are judgment calls where the issue gave an example rather than a literal string; the reference instant used is the deploy run's own startedAt, per the issue's risk note, not the push event itself.

Budget reached at $4.26; this is where it stopped.

Closes #26

commented

Pushed. Merged main into this branch, resolving both conflicts:

  • src/core/schema.ts: main added migration 22 (the decision ledger); mine added a migration for run.serving_at. Kept main's 22 as-is and renumbered mine to migration 23, so both land in sequence.
  • test/apps.test.ts: same test had grown two independent tails — my servingAt/finishedAt ordering assertions, and main's added pull-merge cleanup (so a later test only sees the preview it opens itself). Kept both, in that order.

bun x tsc --noEmit passes clean, and the full forge.json check suite runs with only pre-existing failures (git-push-over-HTTP fails with "auth required" in this sandbox) — verified identical on origin/main alone, so unrelated to this merge.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs