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

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

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

opened this

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, says equals the receiptWords text the page shows, and the copy is private and follows the original.
  • Private origin: a private alice/vault is 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_made rows 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

2 earlier comments · 1 event
commented

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, says equals the receiptWords text the page shows, and the copy is private and follows the original.
  • Private origin: a private alice/vault is 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_made rows 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

Changes requested — before the latest push

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.

commented

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/receipt only had the receiptWords sentence, so the check you asked for could not have passed. It now has "Copied" and "Not copied" rows, built from the same COPIED and NOT_COPIED lists 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=1 and asserts every COPIED and NOT_COPIED entry appears. It also asserts the app's data and its variables and secrets explicitly, so the escaped apostrophe is pinned.
  • Data test: the setup writes plants.db into alice/garden's production data directory (envDataDir). The test asserts the fork's data directory has no such file, next to the existing app_env check.

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.

commented

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.ts adds "Copied" and "Not copied" rows to the receipt page, from the same COPIED and NOT_COPIED lists the plan page and the MCP use.
  • Journey test: test/friend-journey.test.ts fetches /alice/garden/make-it-yours/receipt?made=1 and asserts every COPIED and NOT_COPIED entry, including the app&#39;s data and its 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_env check.
  • Looks gate: it wants a Looks: path from app.looks in forge.json. None of those pages can show the receipt, since it only exists after a copy is made. The new commit's No look: line says so instead.
  • Left out: I added no app.looks entry 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.

Approved

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.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs