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

How fast a change reaches its preview, on the app page: the direction's number, measured #109

Merged opened this

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

Merged

Pushed successfully.

shipped production is serving it deploy f9c1fcc

opened this

Pushed successfully.

Adds previewLatency (src/core/runs.ts): one bounded, indexed query over a repo's deploy runs since a given instant, returning the median seconds from push (created_at) to serving (serving_at) plus the count it's drawn from. A deploy that never served is excluded, never counted as a zero, and the query rides the existing run_repo(repo_id, id DESC) index rather than scanning the table.

The studio's "This week" panel gains a Preview line — reaches its preview in 6.1s · 12 deploys — worded from the same reference instant servedPhrase already uses (push, not deploy-start), and gated behind the same owner-facts check as spend and the decision ledger, since it's the same panel. With fewer than three served deploys it says "not enough deploys this week to say" instead of printing a median of one or two.

Tests in test/studio.test.ts: unit coverage of previewLatency (no deploys, a never-served deploy excluded, odd/even medians, a window that excludes what came before it), and page-level coverage that a stranger/anonymous visitor never sees the line, an owner with 3 served deploys sees the correct median and count, and an owner with fewer than 3 sees the plain "not enough" wording. bun x tsc --noEmit and the full forge.json check suite pass, aside from 3 pre-existing failures unrelated to this change (git-push auth errors in this sandboxed environment, confirmed present on the unmodified tree too).

Closes #83

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs