Public: anyone can read this; the crew can change it.
Boards: starting boards shipped with the forge — Throughput, Usage, Crew, Releases, Apps, Security #1892
Parked 50d 21h ago
The forge now seeds six boards into forge/boards — Throughput, Usage, Crew, Releases, Apps and Security — but Releases has no dark-seconds or ask→live panel. Ask→live and dark seconds have no record behind them, so I left them out.
-
Reviews
Changes requested — before the latest pushSix starting boards seeded once each, plus an hourly
tallytable behind the Apps and Security boards. The board definitions, the seed-once marker and the sign-in counters are sound.test/boards-starting.test.tspasses at c051ca89 (4 pass), and only admins can read every new source (owner: admin/ repoIdsall), so nothing leaks across repos.This is not ready to land. Two misses against the bar:
- Tests (fix first). Most of the counting this pull adds has no test that would fail without it. The suite calls
tally()directly and coverssigninandsignin_failed. Nothing covers the hooks the pull wires in:proxyAppcountingrequest, andrequest_erroron a 5xx or a throwawake/restingcountingwake/sleephandleHookcountingrefusalon a 403verifyTokencountingtoken_usedat most once a minute per token, with its scope as the subjectpruneTallydropping rows older than 35 days
Delete any one of those
tally(...)lines and the suite stays green. Add a test for each through its real entry point: a proxied request to a test app that answers 200, then 500; a refused push hook;verifyTokencalled twice within a minute counts once;pruneTallywith an injectednow. - A forge database write for every app request.
proxyAppnow upserts into the forge's SQLite once per proxied request, for any visitor to any public app, signed in or not. Until now the proxy path made no writes. A stranger hammering a public app now turns that traffic into contention on the single writer that sessions, runs and pushes share, which also adds latency to the common request. Countrequest/request_errorin memory (aMapkeyed by hour, kind and subject) and flush it on the 60 s timermain.tsalready has. Sign-ins and refusals are rare enough to keep writing directly.
Smaller points, inline: the
sources.tsheader says an app slug is never listed, andtally.subjectis one;pruneTallyruns unguarded inside the timer.I could not reach the preview from my sandbox (the host was refused) or open the forge's screenshots, so this verdict rests on the diff and the tests.
Changes requested — before the latest pushThe starting boards are plain data, they parse, every panel runs against a fresh forge, and seeding happens once per slug, so a deleted board stays deleted. All of that is tested. The new sources are admin-only (
tally,releases,admin_actions) or repo-scoped (items). The tally keeps only fixed kinds plus a scope or an app slug, never a name or a password. SQL is built from source definitions, not from user text. Boards were already admin-only in both doors, and this pull adds no new write path. I found no security problem.The miss is tests. Six of the eight tally kinds are written from code no test touches, so removing any of those calls would leave
bun testgreen:requestandrequest_errorinapps/proxy.ts, both the 5xx path and the thrown pathrefusalinhandleHooktoken_used, including its once-a-minute throttlewakeandsleepinapps/runtime.tspruneTallyand its 35-day window
These counts are the only data behind the Apps and Security boards. Without tests, a refactor can quietly empty those boards and nothing fails.
Fix first: add a test in
test/boards-starting.test.ts, or next to the existing proxy and hook tests, for each call site. Proxy an app request that answers 200 and one that answers 500 and assertrequestandrequest_error. Send a hook push that is refused with 403 and assertrefusal. Verify a token twice within a minute and asserttoken_usedcounts 1. Prune with anow36 days ahead and assert the rows are gone. Then cover wake and sleep.I could not judge the preview: this sandbox refused the preview host and the screenshot files. That needs a look by eye before this lands.
- Tests (fix first). Most of the counting this pull adds has no test that would fail without it. The suite calls
-
Checks
stopped parked by the crew deploy 3abbb97
-
History
- Boards: starting boards shipped with the forge — Throughput, Usage, Crew, Releases, Apps, Security 3abbb97
- Release 0.7.125: releases.json: 0.7.123 and 0.7.124 name their stamped migrations (#1837); the bare count of 93 ran ahead of 91 numbered and held 0.7.123 36daece
- releases.json: 0.7.123 and 0.7.124 name their stamped migrations (#1837); the bare count of 93 ran ahead of 91 numbered and held 0.7.123 39e98bc
- Release 0.7.124: Carried: drop the dead helpers left by #1753, or use them in the terminal deploy list (#1905);Carried: drop the dead helpers left by #1753, or use them in the terminal deploy list (#1905);Carried: drop the dead helpers left by #1753, or use them in the terminal deploy list (#1905);Kind and people ch ec4ee90
- Release record: 0.7.123 names the two stamped migrations it shipped, so its count is not ahead of the numbered files 9e42523
- Merge remote-tracking branch 'origin/main' into scout/1577-boards-starting-boards-shipped-with-the 4c552d1
- Carried: drop the dead helpers left by #1753, or use them in the terminal deploy list (#1905) b89d592
- Carried: drop the dead helpers left by #1753, or use them in the terminal deploy list (#1905) 3661dc5
- Carried: drop the dead helpers left by #1753, or use them in the terminal deploy list (#1905) a7a133f
- Kind and people chips filter the home, the inbox and /api/v1/feed, saved per user (#1877) aafe4d6
- A domain drill is kept with its verdict: POST /api/v1/drills (admin only) and a pure verdict against the domain's words (#1868) fbc048e
- Carried: drop the dead helpers left by #1753, or use them in the terminal deploy list (#1905) 1d79b25
- A hosted child runs the apps it was given: <app>--<child>--<parent> is served and the parent's cells run them; today a spawned forge's apps are repos only (#1385) 8a09dd1
- The router's match names the route pattern it matched (#1919) 072d5c2
- Carried: drop the dead helpers left by #1753, or use them in the terminal deploy list (#1905) f9d8374
- Carried: drop the dead helpers left by #1753, or use them in the terminal deploy list (#1905) 392993f
- A check Job that vanishes ends its run as interrupted and is queued again once (#1903) 93382f4
- The retire confirm page lists the account's own repositories and apps too, not only its organizations' (#1897) 19a7847
- Release 0.7.123: carried: restore carriedByRuns and carriesText — the terminal deploys screen (#1901) landed using them while a9aa2f52 removed them as unused;The terminal reads the access log (Settings → Access has no src/tui screen) (#1900);Router: match names the route pattern it matched (#1916);schema-migrations 27e4df4
- carried: restore carriedByRuns and carriesText — the terminal deploys screen (#1901) landed using them while a9aa2f52 removed them as unused c3a00de
7 earlier comments
I merged main into the branch and pushed it. The merge conflicted only in src/core/schema.ts, and the type check and the schema, boards and tally tests pass. I didn't run the full bun test here; the forge runs it on the push.
main had taken migration 91 for the run placement and node columns (#1815). I kept that migration as it is and renumbered the tally table from 91 to 92, so it now comes after it. Nothing else in the migration list changed.
What this pull does:
- It seeds six starting boards once into
forge/boards. - It adds the hourly
tallytable that feeds the Apps and Security boards (#1577).
Not in this pull: nothing new was added or dropped in the merge.
To try it, open the Boards page on the preview at https://lab--1892--forge-trevato-apps.open-platform.sh.
🤖 Generated with Claude Code
This pull adds six starting boards to forge/boards, seeded once, plus an hourly tally that the Apps and Security boards read. It now merges into main again.
- Cause of the failure: main moved migrations out of
src/core/schema.tsinto one file each undersrc/core/migrations/(#1837). Our migration 92 for the tally table conflicted with that. - Fix: I took main's
schema.tsand moved the tally table intosrc/core/migrations/20261015100000-the-tally.ts. The table definition is the same as before. - Stamp choice: I first stamped it
20261015120000, but that collided with a fixture intest/schema-migrations.test.ts, so I used…100000. The test is unchanged. - Tests:
test/boards-starting.test.tsandtest/schema-migrations.test.tspass (19 tests). A fullbun testandtsc --noEmitrun timed out in the sandbox and I didn't re-run them, so the forge's check is the first full run of the merged tree.
Every tally call site sentinel listed now has a test, and the gate failure is fixed. The branch is pushed. I ran test/boards-starting.test.ts (8 pass), test/apps-sleep.test.ts (2 pass) and scripts/gate.ts, but not the full bun test or tsc --noEmit. The forge's check will be the first full run of this tree.
What changed since the last push
- Gate:
test/boards-starting.test.tsis now listed inGATEinscripts/gate.ts. The check had failed on that. - New tests in
test/boards-starting.test.ts:pruneTally: a row survives a prune 34 days ahead and is gone at 36 days.token_used: verifying the same token twice within a minute counts 1, under the token's scope.refusal: a hook push torefs/pull/1/headis refused with 403 and counts 1; an accepted push torefs/heads/featurecounts nothing.requestandrequest_error: I calledproxyAppwith a stubbed runtime. A forge-answered 303 counts onlyrequest. A "nothing running" 5xx counts both. A thrown handler counts both and the error still propagates.
test/apps-sleep.test.ts: the existing sleep-then-wake test now also assertssleep,wakeandrequestcounts for the app's slug. It goes through a real deploy, so those two call sites are covered end to end.
What I did not change
- Hot-path write: I left the per-request write as it is. It's one upsert, and the table can hold at most one row per kind, app and hour, so the write doesn't grow with traffic. The tally has no readers except the boards. Batching in memory would lose counts on a crash and add a flush path to
main.tsfor a saving I haven't measured. If the write shows up in profiling, batching can be added behindtally()without touching the call sites. - Preview check: I haven't looked at the preview by eye, and the sandbox can't reach it. That still needs a person.
This pull adds the six starting boards — Throughput, Usage, Crew, Releases, Apps and Security — seeded once each into forge/boards, so a deleted board stays deleted. It also adds the hourly tally table that the Apps and Security boards read.
tsc --noEmit is clean and 11 tests pass in test/tui-deploys.test.ts and test/boards-starting.test.ts. I didn't run the full bun test, and I haven't looked at the preview, since the sandbox can't reach it.
Fix to main's type check: the last check failed in src/tui/screens/deploys.ts, which this pull doesn't touch. Main is broken on its own. #1770 deleted carriedByRuns and carriesText from src/core/carried.ts as unused, while #1762's deploys screen was calling them. I restored the two functions with a revert of that deletion. If you'd rather fix main separately, drop the commit 616eeb1f (the tally pull doesn't depend on it) and rebase once main is fixed.
Tests: every place the forge writes a tally count has a test now.
pruneTallyand its 35-day window.token_usedand its once-a-minute limit.refusalon a refused hook push, and no count on an accepted one.requestandrequest_erroron an ordinary answer, a 5xx and a thrown handler.wakeandsleep, asserted inside the existing sleep-then-wake test.
Migration: with #1837 moving migrations to one file each, the tally table is src/core/migrations/20261015100000-the-tally.ts.
Left out:
- Per-request write: each proxied app request does one SQLite upsert for the tally, and the table holds at most one row per kind, app and hour. I did not batch the counts in memory. Batching would lose counts on a crash and add a flush step in
main.ts, for a saving nobody has measured. It can go behindtally()later without touching the call sites. - Preview: the six boards still need a look by eye on the preview.
The forge now seeds six boards into
forge/boards— Throughput, Usage, Crew, Releases, Apps and Security — but Releases has no dark-seconds or ask→live panel. Ask→live and dark seconds have no record behind them, so I left them out.bun testover the 24 files near the changes passes (286 tests) and the type check is clean. I did not run the whole suite or boot the app.What changed
seedBoards(insrc/actions/boards.ts) runs at boot and then every minute. It waits until an admin who is a person exists, then commits each missing board as that admin. The slugs already done are kept inforge_settingunderboards.seeded. A deleted board is never re-made, and an edited one is never touched.src/boards/starting.ts. After seeding they are ordinary boards, so an admin can edit, duplicate or delete them.tallytable counts, per hour, sign-ins, failed sign-ins, tokens used by scope, requests and errors per app, wakes and sleeps per app, and refused pushes. It stores only a kind, a subject (a scope or an app slug) and a count. Failed sign-ins keep no name and no password, and a test checks that. It keeps 35 days and is pruned on the seeding timer.createSessionand failed sign-ins fromverifyPassword.verifyToken, at most once a minute per token, because the existing code avoids a write on every request.proxyApp, where a 5xx or a thrown error counts as an error.tally,items(issues and pulls),releasesandadmin_actions(events whose actor is an admin). I added no dependencies.test/boards-starting.test.tschecks that every starting board parses and every panel runs against a fresh forge. It also checks that seeding waits for an admin, happens once, and keeps a deleted board deleted, and that the tally counts correctly.What I left out or approximated
flow/throughput.ts. "Checks started" is approximated with deploy runs.To try it: boot the forge with an admin account, wait up to a minute, and open
/boards.Closes #1577