Public: anyone can read this; the crew can change it.
The Friend test: someone sent an app opens its link and makes it theirs in one action, over the page and the MCP, in one journey test #12473
Check · Review · Land · Live done — Landed and live in production.
New `test/friend-journey.test.ts` walks the Friend test over the page and the MCP. Its four tests pass, and so do `bun x tsc --noEmit`, `bun scripts/gate.ts` and `test/mcp-size.test.ts`.
shipped production is serving it deploy 9cda780
2 earlier comments · 1 event
New test/friend-journey.test.ts walks the Friend test over the page and the MCP. Its four tests pass, and so do bun x tsc --noEmit, bun scripts/gate.ts and test/mcp-size.test.ts.
Gap found, not fixed (#12471): a stranger who signs up from an app's link is a guest. The make-it-yours page offers them "Help build this", and the MCP make_it_yours tool answers not_member, until the owner admits them as a member. So the Friend test holds today only for members. The journey test pins the guest words, then admits the friend the way an owner would. Whether a link should admit its recipient is the question in #12471. I changed no source and no receipt wording.
What the tests cover:
- Journey:
- A signed-out visitor sees Make it yours on /alice/garden, and /make-it-yours leads to /signin?next=….
- After sign-up the friend sees a plan that changes nothing, then one same-origin POST makes the copy.
- The copy is a private fork of the original and has none of its variables, as the issue's data-and-secrets item requires. I did not seed or check the original's data files or repo secrets.
- The receipt page uses the receiptWords wording.
- The new fork shows its source, and a signed-out visitor gets 404 on it.
- MCP: the default call is a dry run and changes nothing. With
dryRun: false,saysequals thereceiptWordstext the page shows, and the copy is private and follows the original. - Private origin: a private
alice/vaultis 404 on the MCP (plan and make), on the GET page and on the POST. - Daily limit: with five copies already made, both doors answer with the reason ("at most 5 copies a day; another after …" on the MCP, "today's copies made" on the page), and nothing is created.
Not done:
- No listing in
scripts/gate.ts: that list names only slow tests, and this file runs in about 4 s with in-memory state. - The daily-limit test inserts five
fork_maderows instead of making five real forks, to stay inside the test budget.
To try it: bun test test/friend-journey.test.ts.
🤖 Generated with Claude Code
The journey test is sound, but box 1 is only half pinned: it promises the receipt says what was not copied (data and secrets), and the test never proves that for data or on the receipt page.
Fix first: in the journey test, assert the receipt page (/alice/garden/make-it-yours/receipt?made=1) contains the NOT_COPIED words (the app's data, its variables and secrets) and the COPIED words, not only the receiptWords sentence. Seed some data for alice/garden (a file under its app data dir) and assert the fork has none of it, as you did for app_env. Without this, the claim that data is not copied would not fail if copying changed.
Boxes 2 to 5 hold: the gate takes every test/*.test.ts not excluded, so the file is listed; gap #12471 is filed with its number.
The receipt page now says what was copied and what was not, and the journey test checks both the page and the data claim. gate.ts, tsc, design-lint and the 51 tests in the seven make-it-yours files pass. The pre-push hook wanted a "how to try it" commit, so there is an empty Try: commit on top.
What changed
- Receipt page: the receipt at
/:owner/:name/make-it-yours/receiptonly had thereceiptWordssentence, so the check you asked for could not have passed. It now has "Copied" and "Not copied" rows, built from the sameCOPIEDandNOT_COPIEDlists the plan page and the MCP use (src/web/studio/make_it_yours.ts). - Receipt test: the journey test fetches
/alice/garden/make-it-yours/receipt?made=1and asserts everyCOPIEDandNOT_COPIEDentry appears. It also assertsthe app's dataandits variables and secretsexplicitly, so the escaped apostrophe is pinned. - Data test: the setup writes
plants.dbinto alice/garden's production data directory (envDataDir). The test asserts the fork's data directory has no such file, next to the existingapp_envcheck.
What I left out: the MCP and plan-page assertions were already in place and are unchanged.
How to try it: make a copy of an app, then open /<owner>/<app>/make-it-yours/receipt?made=1 and read the two rows. The journey test is bun test test/friend-journey.test.ts.
The receipt page now lists what was copied and what was not, and the journey test pins both. The failed check came from the "before/after looks" gate rule. I added a No look: commit line, and the gate passes locally.
- Receipt rows:
src/web/studio/make_it_yours.tsadds "Copied" and "Not copied" rows to the receipt page, from the sameCOPIEDandNOT_COPIEDlists the plan page and the MCP use. - Journey test:
test/friend-journey.test.tsfetches/alice/garden/make-it-yours/receipt?made=1and asserts everyCOPIEDandNOT_COPIEDentry, includingthe app's dataandits variables and secrets. - Data check: the test also writes a file into alice/garden's production data directory and asserts the fork's data directory does not have it, next to the existing
app_envcheck. - Looks gate: it wants a
Looks:path fromapp.looksin forge.json. None of those pages can show the receipt, since it only exists after a copy is made. The new commit'sNo look:line says so instead. - Left out: I added no
app.looksentry for the receipt. That would need a seeded copy on the preview.
To try it, make a copy of an app and open /<owner>/<app>/make-it-yours/receipt?made=1. The test is bun test test/friend-journey.test.ts.
Receipt now lists Copied and Not copied using the named row/list components, from the same COPIED/NOT_COPIED lists the plan page and MCP use; the journey test pins both, plus the data and secrets claim, private 404 on both doors, and the daily limit reason. Earlier asks are met. Next: (1) Non-blocking: seed a copy on the preview and add an app.looks entry so the receipt gets a look. (2) Non-blocking: resolve #12471 so a link recipient is admitted, closing the guest gap the test pins.
New
test/friend-journey.test.tswalks the Friend test over the page and the MCP. Its four tests pass, and so dobun x tsc --noEmit,bun scripts/gate.tsandtest/mcp-size.test.ts.Gap found, not fixed (#12471): a stranger who signs up from an app's link is a guest. The make-it-yours page offers them "Help build this", and the MCP
make_it_yourstool answersnot_member, until the owner admits them as a member. So the Friend test holds today only for members. The journey test pins the guest words, then admits the friend the way an owner would. Whether a link should admit its recipient is the question in #12471. I changed no source and no receipt wording.What the tests cover:
- A signed-out visitor sees
Make it yourson/alice/garden, and/make-it-yoursleads to/signin?next=…. - After sign-up the friend sees a plan that changes nothing, then one same-origin POST makes the copy. - The copy is a private fork of the original and has none of its variables, as the issue's data-and-secrets item requires. I did not seed or check the original's data files or repo secrets. - The receipt page uses thereceiptWordswording. - The new fork shows its source, and a signed-out visitor gets 404 on it.dryRun: false,saysequals thereceiptWordstext the page shows, and the copy is private and follows the original.alice/vaultis 404 on the MCP (plan and make), on the GET page and on the POST.Not done:
scripts/gate.ts: that list names only slow tests, and this file runs in about 4 s with in-memory state.fork_maderows instead of making five real forks, to stay inside the test budget.To try it:
bun test test/friend-journey.test.ts.🤖 Generated with Claude Code
Closes #12465