Public: anyone can read this; the crew can change it.
A tab-forge app leaves as one spec file and comes back in, with or without its records #18399
Merged 2h 25m ago, live in production
A tab-forge app now saves as one JSON file and opens from one, with or without its records. Tests: the new tests pass, and so do the existing tab-, tabforge-, feature-doc and door suites, 153 passed and 6 skipped. tsc is clean and gate --fix changed nothing.
-
Reviews
Changes requested — before the latest pushSave and open work as the issue asks, with script off and no model call, and the tests are real. Two things to fix before it lands.
- Fix first: the forge can write a file it refuses to read back.
saveFiletakes up to 1000 records and does not check the result againstFILE_MAX(200,000), whichopenFileenforces. An app with many long entries downloads fine and then cannot be opened ('too large'). Round trip is box 3, so this is a miss. MakesaveFiledrop records from the end until the text fitsFILE_MAX, and add a test that a large export opens again. Alternatively refuse the export in words, but the first is the better fix. - The doc contradicts itself. The paragraph just above the new section still says 'Left out: importing or exporting the file.' Delete that sentence in the same change.
Not blocking: the Open form is on the tab forge's home page, which fits 'on /tab'. The terminal side is only the
TAB_MOVEsentence, which is consistent with 'making an app is page-only'.ApprovedBoth earlier asks are met. The oversized export is fixed: saveFile now binary-searches how many entries fit under FILE_MAX, so a save with entries always opens again, and a test covers it with 900 long entries. The doc contradiction is fixed: the 'Left out: importing or exporting' line is gone and the new section says the newest entries are dropped to fit. The save links are plain anchors and the open form is a plain multipart form, so both work with script off. A bad file is refused in words with 'Nothing was added.'. I read the diff and did not exercise the preview.
Next two things, both non-blocking:
- Non-blocking: say on the page when a save with entries dropped some. Today the person gets a shorter file and no word of it.
- Non-blocking: the open form's textarea and file input have no visible hint of the 200,000 character cap. Name the cap in the label so a refusal is not the first they hear of it.
- Fix first: the forge can write a file it refuses to read back.
-
Checks
shipped production is serving it deploy be10e7a
-
History
- A save with entries drops the ones that would not fit under the size this forge opens (#18397) 4809f94
- A tab-forge app saves as one spec file and opens from one, with or without its entries (#18397) 41bc711
- A person shares one imported session by a link that hides what the forge redacts (#18391) 080d52c
- Full suite red: test/data-browser.test.ts (#18394) b4310c7
- Red after landing: #18373 broke test/data-browser.test.ts (#18393) ab53312
- An imported session opens by reading its stored gzip line by line, not as one decoded string (#18387) a3b5b3e
- A big session is stored without holding the whole file twice: the import writes it to gzip in chunks and checks UTF-8 as it goes (#18385) 8ceefc1
- A person imports a Claude Code or Codex session from /traces in the browser (#18382) d8b1b2b
- A person saves a /traces search by name and reopens it from the list and the palette (#18381) db6a2d2
- small: an imported session's row in /traces opens its page (#18379) 067798c
- Full suite red: test/talk-build-no-crew.test.ts (#18380) fc3efe0
- /traces narrows by the tool a run used and the file it touched, on the page, the API and the terminal (#18373) ee241ef
- An imported session's steps carry their tokens and the page shows them, where the file holds them (#18372) 5739158
- An imported session opens at /traces/<id> as the same tree and time strip a crew run has (#18366) 90fb1bc
- /traces lists Talk and imported traces with a kind facet, and the terminal's kind key is tested (#18365) c5e780a
- Issues: a route to assign an issue to a person or an agent (#18285) 69ce311
- The loopback-only look test stops failing checks: the missing prerequisite is named and provided, or the check skips by name (#18362) be7c1a3
- A Codex rollout file imports as a trace, beside Claude Code sessions (#18360) 8900ff3
- Every bare "No …" empty state is drawn from src/core/empty_words.ts, and the OWN_WORDS count table is deleted (#18355) e036110
- A map file over 600 KB is served in parts instead of failing the whole 3D view (#18350) b6d2692
A tab-forge app now saves as one JSON file and opens from one, with or without its records.
Tests: the new tests pass, and so do the existing tab-, tabforge-, feature-doc and door suites, 153 passed and 6 skipped. tsc is clean and gate --fix changed nothing. The four rules you named (dead code, duplicate import, first-view budget, process-wide state) were checked only through the 16 tests I found by file name, so they are covered only to that extent. I did not run the full suite or bun scripts/design-lint.ts; the forge's check runs the full suite on push.
What changed
- New module
src/tab/file.ts. It hassaveFile,openFileandfileName. The file is the Blocks JSON ofblocks.ts, plus an optionalrecords: [{block, text, n, col, day}]. - Save. An app's page has two plain links, Save as file and Save as file with its entries, served by
GET /apps/:id/file[?records=1]insrc/tab/apps.ts. They work with script off, and no model is called. - Open. The tab forge's home page, which lists the apps, has an Open an app file form: choose a file or paste its text. It is
POST /apps/open, a plain multipart form. - Checks on a file: it is refused above 200,000 characters before any parsing.
decodeAppandLIMITSthen check the app, as they do a model's answer. A bad file is refused in words ("Nothing was added.") and adds nothing. - Records. At most 1000 are read, and one that doesn't fit its block (block index, column, day, number) is dropped. The app and its records go in as one transaction. Every field is escaped when drawn.
- Docs.
docs/features/tab.mdhas a new section, "An app as a file (#18397)", that names the format as the one shared with forge-apple. The terminal'sTAB_MOVEline inwords.tsnow says the same. - Tests.
test/tab-file.test.tscovers the download, the round trip with and without records, pasted text, dropped bad records and escaping. It also checks that empty, non-JSON, wrong-shape, newer-version and oversized files each add nothing.
Reuse: I reused decodeApp, LIMITS, entryText, readForm and the multipart path from #18045, replyOf's file reply, shell, and refuse/back in apps.ts. I did not run scripts/similar.ts.
Left out: the Apple app's side (it lives in another repo), and an export larger than 200,000 characters, since that size cap applies on the way in. No dependency was added.
Try it: open /tab, press Start it and make an app. Use Save as file with its entries on its page, then choose that file in Open an app file on the home page.
[
{"go":"/tab","look":"Start the forge, make an app (\"track my water\"), tap it a few times, open its page","expect":"Links 'Save as file' and 'Save as file with its entries' appear under the link/keep controls"},
{"go":"/tab","look":"Click 'Save as file with its entries', then on the forge home choose that file in 'Open an app file'","expect":"A second app with the same title and entries opens"},
{"go":"/tab","look":"Paste 'not json' in 'or paste its text' and press Open file","expect":"A refusal in words ending 'Nothing was added.' and no new app"}
]Both of juniper's points are fixed and pushed. test/tab-file.test.ts passes (5 tests), tsc is clean and gate --fix changed nothing. I did not re-run the wider suites or the four rules you named for this follow-up.
- Oversized export:
saveFileinsrc/tab/file.tsnow keeps the oldest entries and drops the rest until the text is withinFILE_MAX. It finds the cut by binary search, so a save with entries always opens again here. A new test saves an app with 900 long entries, checks the file is within 200,000 characters, and opens it. - Doc contradiction: I deleted "Left out: importing or exporting the file." from
docs/features/tab.md. I also added a clause to the new section saying that a save with entries drops the entries that would not fit under that cap.
I chose to drop entries silently rather than refuse the export in words, as juniper suggested. A person who saves an app with more than about 200,000 characters of entries gets a file without the newest ones, and the page does not say so. I can add a note to the page if you want one.
A tab-forge app now saves as one JSON file and opens from one, with or without its records.
Tests: the new tests pass, and so do the existing
tab-,tabforge-, feature-doc and door suites, 153 passed and 6 skipped.tscis clean andgate --fixchanged nothing. The four rules you named (dead code, duplicate import, first-view budget, process-wide state) were checked only through the 16 tests I found by file name, so they are covered only to that extent. I did not run the full suite orbun scripts/design-lint.ts; the forge's check runs the full suite on push.What changed
src/tab/file.ts. It hassaveFile,openFileandfileName. The file is the Blocks JSON ofblocks.ts, plus an optionalrecords: [{block, text, n, col, day}].GET /apps/:id/file[?records=1]insrc/tab/apps.ts. They work with script off, and no model is called.POST /apps/open, a plain multipart form.decodeAppandLIMITSthen check the app, as they do a model's answer. A bad file is refused in words ("Nothing was added.") and adds nothing.docs/features/tab.mdhas a new section, "An app as a file (#18397)", that names the format as the one shared with forge-apple. The terminal'sTAB_MOVEline inwords.tsnow says the same.test/tab-file.test.tscovers the download, the round trip with and without records, pasted text, dropped bad records and escaping. It also checks that empty, non-JSON, wrong-shape, newer-version and oversized files each add nothing.Reuse: I reused
decodeApp,LIMITS,entryText,readFormand the multipart path from #18045,replyOf's file reply,shell, andrefuse/backinapps.ts. I did not runscripts/similar.ts.Left out: the Apple app's side (it lives in another repo), and an export larger than 200,000 characters, since that size cap applies on the way in. No dependency was added.
Try it: open
/tab, press Start it and make an app. Use Save as file with its entries on its page, then choose that file in Open an app file on the home page.Closes #18397