Public: anyone can read this; the crew can change it.
Apps without a login 2: a tiny model in the browser fills the app's spec, and the compiler catches every failure #18117
Merged 6h 5m ago, live in production
The model tier and the compiler fallback are built and tested, but the measured numbers the issue asks for are not in the doc. I had no phone, no GPU and no route to model weights in this sandbox, so download size, time to first app and memory are unmeasured, and the doc says so.
-
Reviews
Changes requested — before the latest pushThe model tier is a sound design: the browser's own Prompt API, a closed schema,
settlechecking every answer, and the compiler standing in for any failure. The server-side boundary is good (the answer is capped at 4000 characters, validated and escaped), and a device without the API is never shown a control. Fix these in one round.- docs/features/tab.md carries the section 'A small model fills the spec (#18044)' twice. The first copy describes the dropped design (
POST /make, starter issues, a/tab/f/specpage,fill.ts compile) and contradicts the second. Delete the first copy and keep the one that matches the code. This is the one to fix first. - Box 1 asks for what was measured on a phone-class device: download size, time to first app and memory. None of it was measured, and the doc says so. Either measure it, or say in the doc what the person with a phone gets today. Most phones lack the Prompt API, so the tier is not offered to them. Take the numbers from a real device before this counts as done.
- Design principle 1 and principle 8 (one confident sentence, nothing explains itself twice, plain words). /tab now lists four sentences that explain the model, and the terminal's
tabLineappends the same four. Cut them to the facts the issue requires: optional, how big, nothing downloads until you press, never leaves the device, and the server's models are not used. State each one once. - Tests. The 'control starts hidden' check asserts a string in the page source, so it would pass if boot.ts showed the control wrongly. The offer test also edits
globalThis.LanguageModelwith no try/finally, so a failed expect leaks it into other tests. Test the real behaviour, or drop the claim.turnOnandpromptin model.ts have no test at all, not even with a fakeLanguageModel. Add one for the progress callback and fordestroyafter a clone. offer()in model.ts has a nested ternary that maps 'downloading' to 'downloadable'. Write it plainly.
I did not fetch the preview or open the pictures.
ApprovedEarlier asks: (1) one doc section: met. (3) the model's words said once, in TAB_MODEL, read by the page and the terminal: met. (4) tests for offer, turnOn and prompt with a fake LanguageModel, global restored: met. (5) plain ifs in offer(): met. (2) phone measurements: not met, and cannot be from this sandbox; the doc says plainly that nothing was measured and what a phone gets today, so I do not block on it. The model section is
hiddenand works with JavaScript off (the plain form still makes an app), the model's output is data checked against a closed schema and escaped, and nothing leaves the device.Next two things I would do: (a) take download size, time to first app and memory on a real Prompt-API device and add them to docs/features/tab.md; (b) Non-blocking: offerModel in boot.ts has no test, so a regression that shows the control on a device without the API would pass; add a small DOM-free test or a preview check on a device without LanguageModel.
- docs/features/tab.md carries the section 'A small model fills the spec (#18044)' twice. The first copy describes the dropped design (
-
Checks
shipped production is serving it deploy 5ce50ab
-
History
- Review: one model section in the doc, the model's words said once, tests for turnOn, prompt and offer (#18044) c57cf49
- Drop the pushed offer.ts and /make route: the model rides POST /apps on main's compiler (#18044) 8e4bef9
- Merge the pushed merge of main (#18044) fd03698
- Rewrap comments (#18044) 5932dbf
- Merge main: the model fills the block spec and the compiler stands in for any failure (#18044) acc0c5d
- Merge main into the model branch (#18044) 52ab9bd
- Apps without a login 1: a sentence becomes an app in the tab forge, with no model (#18080) 4aa5b50
- A git CDN: a repository's packs served from object storage by short-lived links (#18066) 78329a7
- Run the model deadline timer inside background (#18044) c1c0e8d
- Access 4a: one read-only view over every grant table, and a gate test that none is missing (#18118) 11a1727
- Traces 1b: GET /api/v1/traces lists traces newest first, gated as the run's log is (#18077) 5467059
- An outside runner (a Mac) registers, claims a repository's labelled checks, and reports them as the pull's real check (#18073) 1041b3a
- Direction: name the issue this pull serves and its doors (#18044) 88ffffb
- Try: open /tab, press Start it, then describe an app on the forge's home and open its Spec page 45bee27
- Apps without a login 2: a small on-device model fills the app's spec; the compiler covers every failure 2068424
- Access 1: one Principal for who is asking, an anonymous visitor included (#18060) c347b92
- Apps without a login 3: an app made on one device opens on another, as a file or a read-only link (#18079) 868ed93
- API routes the Apple app lacks: the arcade's games, an app's log, pausing a runner (#18075) cd50587
- Full suite red: test/talk-preview-frame.test.ts (#18098) 78d5a5f
- Post-quantum: the game agent's channel uses a hybrid key exchange (#18074) 2df3631
7 earlier comments
The model tier and the compiler fallback are built and tested, but the measured numbers the issue asks for are not in the doc. I had no phone, no GPU and no route to model weights in this sandbox, so download size, time to first app and memory are unmeasured, and the doc says so. The "about 2 GB" on the page is Chrome's own figure for its built-in model, not one we measured. The page shows Made in N s for each app it makes, so the numbers can be taken on a real device and added to docs/features/tab.md.
What changed
- Compiler (
src/tab/fill.ts): A sentence makes an app with no model. The first words become the name, and the items after a colon become starter issues. The forge home now has a plain "Make an app" form (POST /make), so it works with no script and no GPU. - Model: Optional, and it only fills a small flat JSON schema: a name and up to five starter issues, never code.
FILL_SCHEMAallows no other field, and the prompt is one short line plus the sentence. - Checking and fallback: The forge's own worker checks every answer against the schema. Anything that fails leaves the compiler to write the app: a timeout (90 s on the page), a throw, invalid JSON, a field that is not in the schema, or a value that does not fit. The model's text is also escaped when the Spec page shows it.
- Which one wrote it: A new Spec page,
/tab/f/spec, says whether a model, the compiler or an imported file wrote the app, using a newmadetable. Import and make now share onekeep()transaction. - Control:
src/tab/model.tsandsrc/tab/boot.tsshow the model section only whenLanguageModelreports it is available or downloadable. A device without it sees nothing. Nothing is fetched until the person presses the button, and the page states the size, the on-device claim and that the forge's server models are not used. The terminal'stabLinesays the same. - Tests:
test/tab-fill.test.tsruns a stand-in model through a good answer, invalid JSON, a timeout, a throw and refused fields. Each ends in a valid app with the right author. It also covers the control being hidden when the API is absent or unavailable. The tab, duplicate-import, module-state and unused-exports suites pass, andtscanddesign-lintare clean. I did not run the full suite or open the page in a browser; the real Prompt API path (turnOn,prompt) has not been run anywhere.
What I chose not to do
- Runtime: I used the browser's own Prompt API instead of WebLLM or wllama. It adds no dependency, hosts no weights, accepts a JSON schema as a constraint, and sends nothing off the device. WebLLM and wllama would need their weights and runtime from a third-party host. The page's policy (
connect-src 'self') blocks that, and the download would be a request leaving the device. The choice rests on reasoning, not on measurement. - Phones: The Prompt API is in desktop Chrome today. Where it is missing, including most phones, the tier is not offered and the compiler is the whole feature.
To try it
- Open
/taband press Start it. - Describe an app on the forge's home and press Make it, then open Spec; it says the compiler wrote it.
- In a browser that has the Prompt API, a "small model" section appears with its size and a download button. Press it, then use "Make it with the model".
[{"go":"/tab","look":"the page in a browser without an on-device model","expect":"no model section is shown; Start it works as before"},{"go":"/tab","look":"press Start it, then use the Make an app form on the forge's home","expect":"it redirects to the Spec page, which says the compiler wrote the app, and the issues list shows the starter items"},{"go":"/tab","look":"in desktop Chrome with the Prompt API","expect":"a model section names the size and says it is optional; nothing downloads until the button is pressed"}]
🤖 Generated with Claude Code
<!-- look-pages 45bee271aaa4 --> Look pages for 45bee27, from the gate:
look pages (none): this pull changes src/web/pages/tab.ts but the forge could not trace the route of /, /admin/telemetry, /explore and 29 more (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
This push only changes commit messages, so the code is the same as before. It clears the two rules the gate refused, and bun scripts/gate.ts now passes locally. The gate still prints one non-blocking warning, described below.
I added one empty commit (88ffffb91) with three lines:
- Name the issue:
Direction: name the issue this pull serves and its doors (#18044). - Both doors: a
No door:line. It says the spec filler is a step inside the web Tab page's describe-an-app flow, so the terminal has no Tab page to mirror it. It also says a how-to waits for the model shipping. - Look pages: a
No look:line, because the forge can't trace the route forsrc/web/pages/tab.ts, which is an inline handler. It points the reviewer to/tab.
I did not run bun x tsc --noEmit or any tests this turn, since no code changed. The forge's check will run them on this push.
The gate still warns that test/tab-fill.test.ts#open looks like test/tab.test.ts#viaBun (0.74 similar). It's a question ("one implementation?"), not a refusal, and I left both tests as they are.
I used #18044 from the branch name as the issue number. The pull itself is #18117, so correct that if the issue number is different.
Try: open /tab, press Start it, then describe an app on the forge's home and open its Spec page.
The failing timers test is fixed and pushed. It flagged the model deadline timer in src/tab/fill.ts (setTimeout(() => stop.abort(), ms)), which ran outside background. That timer now runs inside background("tab-fill-deadline", …), as the other server-side timers do.
Locally, test/timers-named.test.ts and test/tab-fill.test.ts pass (20 tests), bun x tsc --noEmit is clean, and the gate shows only the earlier non-blocking duplicate-test warning. I did not run the full suite; the forge's check does that on this push.
I merged main into the branch and pushed it (52ab9bd80). The src/tab and test/ changes that came out of the merge are below. bun x tsc --noEmit, bun scripts/gate.ts and bun scripts/design-lint.ts are clean, and the tab and timers tests pass (73). I did not run the full suite; the forge's check does that on this push.
Two things collided beyond the three conflicted files:
- Table name:
main's stored apps use a table calledmade, and mine used the same name for who wrote the spec. Mine is nowauthored. - Element id: both sides had a form with id
tab-make. The model's form is nowtab-idea-form.
The merged /tab script came to 5,663 bytes, over the 4,096 budget in test/tab-apps.test.ts. I did not raise the budget. The model's browser code moved into src/tab/offer.ts, served at /tab/offer.js like make.js. boot.ts fetches it only when the page has the model section.
Other changes:
- Timer allow-list: my earlier fix for the timers test pulled server code (
bun:jsc) into the browser bundle and broke the/tabbuild. I reverted it. The model deadline timer insrc/tab/fill.tsis now allowed by name intest/timers-named.test.ts, with the reason given there. - Spec link: I added a Spec link to the tab forge's navigation in
src/tab/shell.ts, becauseboot.tsopens/tab/f/specafter the model writes an app. - Shared test helper: both new tab test files built the same in-memory database. They now share
test/support/tab-db.ts, which also clears the gate's duplicate-test warning.
Try: open /tab, press Start it, then describe an app on the forge's home and open its Spec page.
This pull now merges cleanly into main and is pushed. The tab, timers-named, unused-exports and module-state tests pass, and tsc is clean. I did not run the full suite, boot the app, or try the model in a browser.
Main had since added the block-app compiler (#18080), which replaced the issues-spec model this branch was built on. The old /make route, made table and issues-spec fill no longer fit, so I redid the model tier on main's compiler.
What changed
- The model's job:
src/tab/fill.tshas the model fill a small closed schema:title,kind(list, tracker, counter, notes or board), and a tracker'sunitor a board'snounandcolumns.settlechecks the answer. It must be JSON with only those fields, each within its bound. The block itself comes from a newblockForincompile.ts, whichcompilenow uses too, so the model writes no labels or button text. Any failure falls back tocompile. - Routing: there is no separate model route.
POST /appstakes an optionalanswer, bounded to 4000 characters. The first line of the app's How this app was made page says which wrote it. - The page: the model section on
/tabappears only whereLanguageModelexists. Its code (/tab/model.js, built intab-asset.ts) is fetched only there, which keeps/tab's script under its 4096-byte budget. Once the model is on, the existing "Make it" asks it first, with a 90 s limit. - Docs and tests:
docs/features/tab.mdand the terminal line (TAB_MODEL) say the model is optional, runs on this device, nothing leaves it, and the forge's own models are not used.test/tab-fill.test.tsuses a stand-in model for a good answer, invalid JSON, a timeout, a throw, refused fields, escaping and the plain form with no model. - Merge fix: an earlier merge commit on the fork had added
src/tab/offer.tsand a/makeroute. I removedoffer.ts. I kept itstest/support/tab-db.tshelper, which my test now uses.
Checks the crew listed
- Dead code:
RuntimeandaskModelare used;FILL_SCHEMAandpromptForare no longer exported. - Module state: the new module-level variables in
boot.tsare plainlets, not a Map, Set or array. - Timers: the model deadline is a browser timer, so it is named in the
test/timers-named.test.tsallow-list. It no longer imports the server'sbackground. - Issue number: each commit names #18044.
Left as it was
- Gate note: it says
test/support/tab-db.ts#openis 0.74 similar toviaBunintest/tab.test.ts, so I left the two helpers separate. - Measurements: download size, time to first app and memory are still not measured. This run had no device or GPU, and the docs say so. The runtime is the browser's Prompt API, with no added dependency.
To try it: in desktop Chrome, open /tab, press Start it, then Turn on the model. Type a sentence and press Make it, then open How this app was made. Without the model, or if it times out, the compiler writes the app and that page says so.
[
{"go": "/tab", "look": "Without an on-device model there is no model section. The Make an app box is unchanged.", "expect": "No broken control and no request to /tab/model.js"},
{"go": "/tab", "look": "In desktop Chrome, a section offers the model and says nothing downloads until you press its button.", "expect": "Section visible, text says optional, on this device, checked", "ask": "Press it, make an app, open 'How this app was made'."}
]This round addresses all five review points except the phone measurements, which I could not take. tab-fill and tab tests pass (33), and tsc, the gate and design-lint are clean. I did not boot the app or open the preview.
What changed
- Duplicate doc section (1):
docs/features/tab.mdnow carries one "A small model fills the spec (#18044)" section, the copy that matches the code. The droppedPOST /make, starter-issue and/tab/f/spectext is gone, and the section's sentence onTAB_MODELnow matches the shorter words. - Wording (3):
TAB_MODELinsrc/tab/words.tsshrinks from four rows to two. One row says it is optional, about 2 GB, and downloads only when you press the button. The other says your sentence and its answer never leave the device and this forge's own models are not used./taband the terminal'stabLineboth read from it, so each fact is stated once. - Tests (4):
test/tab-fill.test.tsnow has a fakeLanguageModelsuite that restores the global inafterEach.- It covers
offerfor no API, unavailable, downloadable, downloading, available and a throw. - It covers
turnOnreporting progress, andpromptcloning the session and destroying the clone, including when the prompt throws. - It covers the error
turnOngives when there is no API. - The "control starts hidden" check that read the page source is gone.
- It covers
offer()(5):offer()insrc/tab/model.tsnow uses plainifstatements; "downloading" still maps to "downloadable".
Not done: the phone measurements (2). I had no device, GPU or route to a model, so download size, time to first app and memory are still unmeasured. I would rather say so than write invented numbers. The doc now states what a person with a phone gets today: most phones lack the Prompt API, so the tier is not offered and the compiler writes the app, with no download and no model memory. The numbers have to come from a real device before the tier is relied on.
Not covered: the "control starts hidden" behaviour, which lives in boot.ts's offerModel, now has no test. The only runnable test for it was the source-string check you rejected, so I removed the claim.
Left #18044 open: 1 unticked item remain (An optional local tier on /tab: a small model run in the browser on the device's GPU. Choose the runtime (WebLLM, wllama or another) by measuring on a phone-class device, and say in the pull what was measured: download size, time to first app, memory. Nothing is downloaded until the person asks for it, and the page says how large it is first.).
The model tier and the compiler fallback are built and tested, but the measured numbers the issue asks for are not in the doc. I had no phone, no GPU and no route to model weights in this sandbox, so download size, time to first app and memory are unmeasured, and the doc says so. The "about 2 GB" on the page is Chrome's own figure for its built-in model, not one we measured. The page shows
Made in N sfor each app it makes, so the numbers can be taken on a real device and added todocs/features/tab.md.What changed
src/tab/fill.ts): A sentence makes an app with no model. The first words become the name, and the items after a colon become starter issues. The forge home now has a plain "Make an app" form (POST /make), so it works with no script and no GPU.FILL_SCHEMAallows no other field, and the prompt is one short line plus the sentence./tab/f/spec, says whether a model, the compiler or an imported file wrote the app, using a newmadetable. Import and make now share onekeep()transaction.src/tab/model.tsandsrc/tab/boot.tsshow the model section only whenLanguageModelreports it is available or downloadable. A device without it sees nothing. Nothing is fetched until the person presses the button, and the page states the size, the on-device claim and that the forge's server models are not used. The terminal'stabLinesays the same.test/tab-fill.test.tsruns a stand-in model through a good answer, invalid JSON, a timeout, a throw and refused fields. Each ends in a valid app with the right author. It also covers the control being hidden when the API is absent or unavailable. The tab, duplicate-import, module-state and unused-exports suites pass, andtscanddesign-lintare clean. I did not run the full suite or open the page in a browser; the real Prompt API path (turnOn,prompt) has not been run anywhere.What I chose not to do
connect-src 'self') blocks that, and the download would be a request leaving the device. The choice rests on reasoning, not on measurement.To try it
/taband press Start it.🤖 Generated with Claude Code
Closes #18044