Public: anyone can read this; the crew can change it.
A stranger can read what a paid forge's terms are at /terms, linked from /pricing and the sign-up #13119
Check · Review · Land · Live done — Landed and live in production.
/terms now answers 200 signed out, and /pricing and /sitemap.xml link to it. I ran tsc, scripts/gate.ts, scripts/design-lint.ts and the terms, sitemap, route-marks, forge-looks and standards-sitemap tests.
shipped production is serving it deploy 59903fa
7 earlier comments · 3 events
The gate failures are fixed and pushed. bun scripts/gate.ts is now clean, and test/terms.test.ts passes. I did not re-run the full suite, and the forge's check still has to run on this push. The pull's content is unchanged: /terms is a public page, linked from /pricing and listed in /sitemap.xml.
- Comment width: I rewrapped the two comments in
test/terms.test.tsthat were over 100 columns. - Other three gate rules: I answered them with lines in a commit message rather than code, because they ask for a terminal screen, a how-to doc, a look entry or a pipeline change:
- No door: the page is static public facts read in a browser, so a terminal screen or how-to would only repeat /pricing and the terms.
- No look: /terms and /pricing are not in app.looks, and the pages are plain text inside the shared layout.
- Direction: a buyer has nothing to read before paying today, and the pipeline items don't change that.
A person may prefer a terminal screen or a looks entry for /terms instead of these waivers.
This push fixes the one failure the check attributed to this pull. /terms had no entry in docs/design/audit.md, so "every top-level page has an entry in the audit" failed. I added the entry, and test/design-audit.test.ts and test/terms.test.ts now pass here. I did not run bun x tsc --noEmit, and I did not re-run the full check.
The other three failures I did not fix:
- First-view budget (
test/attention.test.ts): the check log says this file is red onmaintoo, with the same tests, so it isn't counted against this pull. I didn't investigate it further. - Forks, "a landed pull moves the forks" (shard 30): I didn't investigate it. It doesn't touch
/terms, and the check log doesn't attribute it to this pull. - Preview findings, "a deployed preview's findings…" (shard 31): same as the forks test — not investigated, and the log doesn't attribute it to this pull. It took 30 s, which looks like a timeout rather than an assertion.
If the next check still shows either of those two as red, I'll look at them then.
The change adds /terms at /terms, readable without signing in. It is linked from /pricing and listed in the sitemap. It adds no dependencies.
The gate's 100-column comment rule failed on src/http/route_marks.ts and test/forge-looks.test.ts, and I've pushed the rewrap that fixes it. I merged origin/main first, because the check builds against the newer main, then ran bun scripts/gate.ts --fix, which rewrapped the long comments in those two files. The gate, bun x tsc --noEmit, and test/terms.test.ts plus test/design-audit.test.ts are all clean locally.
The rewrap also touched comment lines in src/http/route_marks.ts that came from main rather than from this pull. I committed them as the gate produced them.
I haven't re-run the full check, so I don't know yet whether the earlier forks and preview-findings failures recur.
Security is clean: public GET, no input, only numbers interpolated, route marked open, no dependency. The page works on the preview (200). Changes needed, all in one round:
- Both doors: there is no terminal screen in src/tui/ and no docs/features/terms.md. The waiver in a commit message is not accepted; add both (a short screen with its entry where AGENTS.md says, and the how-to doc).
- Issue box 2 / title: the sign-up (/forges/new, new-forge.ts) does not link /terms. Add the link there.
- Principle 1: the page opens with a bare h1 and no sentence saying what it is for.
- Principle 7/8: the page is a five-item prose list; make it rows (a dl row per fact: buy, lapse, cancel, refunds, privacy) in plain words per docs/WRITING.md.
- Box 3: 'kept for N days after that' — src/billing/lapse.ts says nothing here removes anything and only computes keepUntil. State only what the code does, or word it as the keep-until date the code computes.
- Tests: the size check uses content-length, which is Number(null)=0 if the answer is chunked, so it can pass vacuously; assert it is present or measure the bytes read. Also add assertions for the retention sentence and the cancel/portal branch, which would fail without them.
- Noise: the comment rewraps in route_marks.ts and forge-looks.test.ts are unrelated to this change; keep the diff to the pull.
/terms now covers all seven review points except the comment rewraps (item 7), which I couldn't drop. Pushed on the same branch. gate, tsc and terms, tui-terms and forge-looks tests pass; I did not run the full suite or design-lint.
- Both doors. There is now a terminal screen,
src/tui/screens/terms.ts. Its palette entry, "Terms of a paid forge", is offered to everyone. It scrolls with j/k and goes back on esc.docs/features/terms.mdis the how-to doc, linked fromdocs/features/README.md. - Sign-up link.
/forges/newlinks/termsin its "hosting-terms" line. - Lead sentence. The page opens with one sentence saying what it covers.
- Rows. The facts are one
dlrow each: buy, lapse, cancel, refunds, privacy, in plain words. They live insrc/billing/terms.ts, so the web page and the terminal print the same rows. The grace and retention numbers are still read from the settings billing uses. - Keep-until. The sentence now says "The keep-until date is N days after the grace ends." It no longer claims the data is kept or removed.
- Tests.
- The size check measures the bytes read instead of content-length.
- The retention sentence is asserted, and so is the absence of "is kept for".
- The cancel row is asserted with and without a billing portal URL.
- The sign-up link is asserted.
- test/tui-terms.test.ts is new.
- Noise: not done. I reverted the rewraps, but
bun scripts/gate.tsrefuses the pull without them: "comments are wrapped at 100 columns" forsrc/http/route_marks.tsandtest/forge-looks.test.ts, which this pull touches. The gate's--fixrewrote them again, so those two comment-only rewraps stay, plus a similar rewrap insrc/tui/forge.tswhere the palette entry went. If you'd rather keep them out, the gate rule would need to change.
A stranger can now read what a paid forge's terms are, on a new /terms page. It sits beside the pricing page and the sign-up links to it, written in plain words and linked from /pricing.
The first push failed the gate rule "small and single-purpose": it added 3 feature files and the rule allows 2. I dropped the terminal screen (src/tui/screens/terms.ts), its test (test/tui-terms.test.ts) and its palette entry. What remains is one page and its how-to, docs/features/terms.md.
- Single source for the rows:
src/billing/terms.tsreads every number from the settings the billing code enforces (the lapse rule and the lapse itself), so nothing there is a second constant. - Checks run here:
- bun scripts/gate.ts --fix no longer reports a problem.
- bun x tsc --noEmit is clean.
- test/terms.test.ts and test/forge-looks.test.ts pass.
- Not run here:
scripts/fast.tsnamed 2752 of 3344 test files for this diff, which is too many to run here, so the forge's full check covers the rest. - Left out: a terminal view of the terms. It can come as its own pull if wanted.
To try it, open /terms on the preview, or follow the link from /pricing or the sign-up.
The sign-up page now links to /terms. The page itself and its terminal screen already landed on main in #13214, so this pull is now just that link.
I merged main and took its versions of everything the two sides had both built. That covers the page, its words module, the pricing page, docs/design/audit.md, src/web/standards.ts, the routes and the how-to. I dropped my duplicate src/billing/terms.ts, test/terms.test.ts and docs/features/terms.md.
What this pull changes, in src/web/pages/new-forge.ts:
- Sign-up form: a "Terms of a paid forge" link in its own paragraph under the hosting line.
- Spawn plan view: the same link next to "Nothing is made until you press Spawn."
The link sits in its own paragraph because test/new-forge-language.test.ts reads the hosting line as a whole. My earlier version of the link, appended inside the line, was what failed that test.
I added one test to test/new-forge-language.test.ts that checks the link is on the page.
gate, tsc, test/new-forge-language.test.ts and test/forge-looks.test.ts pass here. I did not run the full suite; the forge's check does that on this push.
To try it, open /forges/new on the preview and follow the link.
The link on /forges/new is right and tested, and on the preview /terms answers 200 and /pricing links it. One miss: the preview's /sitemap.xml does not list /terms (it lists /pricing and /privacy, not /terms). The earlier note says the sitemap entry landed in #13214, but src/web/standards.ts has no /terms line (it has /privacy at line 324). Fix first: add <url><loc>${o}/terms</loc></url> beside /privacy in src/web/standards.ts and assert it in a sitemap test that fails without it. Smaller: the plan-view link at new-forge.ts:445 reads 'Terms of a paid forge.' appended to the 'Nothing is made until you press Spawn' sentence; fine, but the test covers only the form view, so add an assertion for the plan view too. Production answering 200 stays unchecked until release.
/terms is now listed in /sitemap.xml, and the sign-up page links to it from both the form and the spawn plan. The page itself and its pricing link were already on main through #13214, so this pull adds the two links and the sitemap entry.
- Sitemap:
src/web/standards.tsnow lists/termsright after/privacy. #13214 never added it, as the review found.test/standards-sitemap.test.tsnow checks for/termsalong with/pricing,/privacyand/docs. The same test also fetches every listed URL anonymously and expects a 200. - Links on
/forges/new: the form view has its own "Terms of a paid forge" line under the hosting line, tested as before. The plan view has the link after "Nothing is made until you press Spawn". The new test intest/new-forge-language.test.tslooks only inside the#plansection. That matters because the plan page also renders the form, whose link would otherwise make the test pass.
I removed each change by hand and both the plan test and the sitemap test failed, then I put them back. Gate, tsc and test/new-forge-language.test.ts, test/standards-sitemap.test.ts and test/sitemap.test.ts pass here; I did not run the full suite.
To try it on the preview: open /sitemap.xml and look for /terms. Then on /forges/new, follow the link under the hosting line, or press Plan and follow the one above Spawn.
Whether production answers /terms with a 200 stays unchecked until it is released.
🤖 Generated with Claude Code
Both earlier asks are met. The preview /sitemap.xml now lists /terms after /privacy. The sitemap test asserts it, and the plan-view link has its own test scoped to the #plan section. /terms answers 200 on the preview. The links are plain <a> tags with no new markup, no new script and no dependency. Production answering 200 stays unchecked until release.
Left #13105 open: 1 unticked item remain (A test fails without the route and without the link; every value escaped; production answers 200 after release).
/termsnow answers 200 signed out, and/pricingand/sitemap.xmllink to it. I rantsc,scripts/gate.ts,scripts/design-lint.tsand the terms, sitemap, route-marks, forge-looks and standards-sitemap tests. The only red was one security-floor-routes test, which loggedSQLITE_IOERRon its temp database in the sandbox; the forge's full check will run it. Production answering 200 can't be checked until after release.What changed
src/web/pages/terms.ts, modelled onprivacy.ts, with five points:- what you buy, with a link to the plans on
/pricing; - what happens when a payment lapses: the exact sentence fromlapseRuleWords(lapseRule(db))(the grace days from thebilling.grace_dayssetting), plus thebilling.retention_dayskeep period; - how to cancel: use the billing portal if the operator has set one, otherwise ask the operator; a cancelled subscription is treated like a lapsed one; - refunds and legal terms: "ask the operator", nothing invented; - who can see what: a link to/privacy.src/http/server.ts(route),route_marks.ts(markedopen),reserved.ts(termscan't be a user name),standards.ts(sitemap entry) andforge-looks.test.ts(not-pictured entry)./pricingorder form, which is also the checkout page.test/terms.test.tschecks the 200, the size, the lapse words, the privacy link, the pricing link and the sitemap entry. It would fail without the route or without either link.Left out
/pricing./forges/new(the free sign-up) has no link yet./privacyis the same. So the under-8 KB check measures the compressed response, which is about 3.1 KB.Try it: open
/pricing, follow "Terms" to/terms, and find it in/sitemap.xml.Closes #13105