Skip to content

feat(patchy): setup ends on a live welcome page and the agent's own suggestion - #914

Merged
allisonmahmood merged 4 commits into
mainfrom
feat/setup-ends-on-welcome-page
Oct 24, 2026
Merged

allisonmahmood merged 4 commits into
mainfrom
feat/setup-ends-on-welcome-page

Conversation

@allisonmahmood

@allisonmahmood allisonmahmood commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Stacked on #913, so the onboarding stack shares one app shell. This PR could ship alone: merge #913 first.

What changed

The portal's setup line (Set up Patchy using <instance>/llms.txt) logged the machine in, handled Claude Code's auto mode and the company look, then signed off without publishing anything. So a person finished setup with nothing live and a blank page to fill.

Now setup ends with their welcome page live in the company look, unless they say they don't want one. Then their agent suggests a first patch drawn from what it knows about them: what they've told it, its memory of them, the files in the folder it's working in, and what their company already has. Patchy keeps no list of suggestions, and the agent doesn't offer generic ones. When it knows too little, it asks one question about their work and suggests from the answer.

Closes #908. Part of #906.

Look at

  • skills/patchy/references/onboarding.md:
    • every onboarding trigger now runs the whole conversation;
    • step 6 is "Suggest a first patch";
    • each step, the welcome page included, can be skipped.
  • /llms.txt (packages/sdk/src/FrontDoor.ts) gets a Finish setup section: logging in isn't the end, and onboarding takes it from there. Before this, an agent told to skip the welcome page stopped at logged_in without suggesting anything (run 2 below).
  • Real agents following the setup line on throwaway machines, from the final commit:
Ben, a member, reruns the setup line on a machine that already had a welcome page: the welcome page is updated, and the suggestion comes from his notes

Patchy is set up, and this machine is logged in to Acme Co as Ben Ortiz ([email protected], member) under the machine name "<hostname>". […]

  • Welcome page: you already had a welcome page, so I updated it instead of making a second one. It's now version 2, at http://<instance>/acme/welcome. Its scope is company, so signed-in colleagues at Acme can open it and people outside the company can't. […]
  • Look: Acme has no company look yet, so your pages use the Patchy look. Only admins can publish a company look.
  • Auto mode: I skipped the Claude Code auto mode step because this instance is on localhost.

A first patch to build: your notes.md says five of you share weekend on-call. Every Friday someone asks in Slack who has Saturday, and swaps happen in DMs where nobody can see them. I'd build an on-call board. It would show who's primary and backup this week and next, using the rota in oncall.csv, and let people swap shifts where everyone can see them. Do you want me to build that, or something else?

Cleo, a member, says "I don't want a welcome page": none is published, and the suggestion comes from her pipeline notes

Patchy is set up. I skipped the welcome page, as you asked. […]

A first patch to try: a deal tracker built from leads.csv. Your notes in pipeline.md say Ben and Dev keep asking where a deal stands before customer calls. The tracker would list each deal's stage, next step and owner in one place, so they can look it up themselves. The file has three deals now (Northwind, Globex, Initech). Do you want me to build it?

How it was verified

Five supervised runs: Claude Code on Sonnet, a fresh HOME, npm prefix and CLI state per machine, none of my instructions or memory (checked with a sentinel probe), against a team dev environment built from this branch. I confirmed each login in a browser as the persona. Each run changed something:

  1. The first commit. The welcome page was published. But the agent ignored the notes in its folder and offered generic examples ("a tracker or a small team dashboard"). Step 6 now says to look first, and never to offer stock examples.
  2. Told "no welcome page". The agent stopped at logged_in and never opened onboarding. /llms.txt now has Finish setup.
  3. Opt-out again. It followed onboarding and skipped the welcome page, but asked a question instead of reading its folder. Step 6 now says to list the folder and skim it before suggesting.
  4. Ben, above.
  5. Cleo, above.

pnpm dev trial refuses setup prompts by design, so it wasn't used.

Also passing: pnpm exec vitest run packages/sdk/src/FrontDoor.test.ts packages/patchy/src/Setup.test.ts packages/patchy/src/skillLock.test.ts. The skill's lock hash is refreshed.

Release impact

  • Breaking — requires action from anyone already running this
  • Not breaking — no action required

Skill and llms.txt text only. They ship with the release, and agents pick them up on their next install or upgrade.

  • What does a revert leave behind? Welcome pages published by setup runs, which are ordinary patches the person owns.
  • Does the release before it still work with that? Yes.

Made by Claude Opus 5.5 in Claude Code, running in T3 Code.

@github-actions github-actions Bot added area:server Touches the server area area:ci CI, shared testing infrastructure, development scripts and tooling area:cli Touches the cli area area:docs Touches the docs area size:s Under 100 changed lines labels Oct 23, 2026
@allisonmahmood

allisonmahmood commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner Author

GPT 6.1 Sol (xhigh) reviewed this. Two should-fixes, both fixed:

  1. When the agent knew too little, it handed the blank page back by asking what the person's tools should do. Step 6 now looks at the person's own work first, then asks one question about their work and suggests from the answer. The sample transcript shows that continuation (62cc5db, then bb0fd60 after the supervised runs).
  2. /llms.txt left out the company look and the opt-out. Its new Finish setup section states both (62cc5db, then 11f7ac4).

@allisonmahmood
allisonmahmood force-pushed the feat/setup-ends-on-welcome-page branch from 15a32c4 to bb0fd60 Compare October 23, 2026 21:49
@allisonmahmood
allisonmahmood changed the base branch from main to fix/nav-logo-home October 23, 2026 21:49
Base automatically changed from fix/nav-logo-home to main October 24, 2026 00:35
allisonmahmood and others added 4 commits October 24, 2026 02:35
…uggestion

The portal's setup line ran login, auto mode and the company look, then
signed off without publishing anything, so a person finished setup with
nothing live and a blank page to fill. Every onboarding trigger now runs
the whole conversation: the welcome page goes live in the company look
unless the person says not to, then the agent suggests a first patch from
what it knows about them. Patchy keeps no list of suggestions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…and asks about it rather than offering stock examples

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…agent to onboarding

A supervised run showed an agent that was told to skip the welcome page
stop at logged_in without suggesting anything: onboarding was only a
Next note. Finishing setup is now its own step.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@allisonmahmood
allisonmahmood force-pushed the feat/setup-ends-on-welcome-page branch from bb0fd60 to 6fa3191 Compare October 24, 2026 00:35
@allisonmahmood
allisonmahmood merged commit 1c3485e into main Oct 24, 2026
14 checks passed
@allisonmahmood
allisonmahmood deleted the feat/setup-ends-on-welcome-page branch October 24, 2026 00:45
allisonmahmood added a commit that referenced this pull request Oct 24, 2026
…#916)

Stacked on #914, which is stacked on #913. Merge those first; the
onboarding stack ships together.

## What changed

The first-patch guide didn't convert:
- It was Home itself in an empty company and a separate page everywhere
else.
- On a phone it read as seven steps.
- It asked people to invent a first patch.
- It never moved on without a reload.

Now, until someone has a live machine token, their real Home sits
blurred behind one panel headed **Final step**: connecting an agent is
the last step between them and Patchy. It has two steps, giving the
agent the line and confirming it's you.

The panel follows along on Patchy's own records. It says **You're set**
when the computer connects and lets go. Home then shows the first
publication after that without a reload. There's no close button:
**Later** puts the panel off for the rest of a sign-in. It comes back at
each sign-in for the person's first week or first three sign-ins,
whichever lasts longer. On a phone it's a bottom sheet that sends the
address to their computer.

Closes #909. Part of #906.

## Look at

- **The show rule** (`packages/auth/src/SetupPrompts.ts` with migration
0026): one small table of the sign-ins (Clerk session ids) that reached
Home. Rows are kept for everyone's first four and any in their first
week, so someone who connected and later revoked every key never
re-enters the window. Later is stored per sign-in.
- **Following along** (`packages/portal/src/guide.ts`, `/guide/steps`,
`/assets/guide.js`):
- The steps come back as HTML from the same renderer as the page.
They're swapped only when their state changes, every 3 s while the tab
is visible.
- Polling stops at the end or after 30 minutes, which offers Check
again.
- It reads machine tokens and the person's own patches directly, never
`DeviceLogins.lookup`'s budget.
  - There's no spinner.
- **The shell's modal slot** (`AppShell.overlay` in
`packages/core/src/html.ts`): the app card goes `inert` and blurs
statically, with no animation. On a phone the panel is a bottom sheet.
- **Each state in a real browser**, as Ben on a dev instance: a device
login confirmed in a second tab, collected by its poll, then a publish
with that key. The panel moved on by itself each time.

| Copied | Device page's new ending | Connected, no reload |
| --- | --- | --- |
|
![copied](https://github.com/user-attachments/assets/f1d61ba2-e6be-42c1-b3f2-0c3879ab7541)
| ![device
confirmed](https://github.com/user-attachments/assets/b7f484b3-c249-4e95-a188-eaad2b25d5d2)
|
![connected](https://github.com/user-attachments/assets/613aab4e-df77-4beb-9517-6ad39c0eee3b)
|

| Welcome page live, in the panel | Panel closed before publishing: Home
takes the note itself | Phone |
| --- | --- | --- |
| ![live in the
panel](https://github.com/user-attachments/assets/f847ec1b-2c87-40be-b897-619cf21b3dfa)
| ![home
watch](https://github.com/user-attachments/assets/1b609091-b28e-426b-a679-30d4a67305ab)
|
![phone](https://github.com/user-attachments/assets/ac433d9c-4a9b-4366-a9cc-78667d991bdb)
|

## How it was verified

- `pnpm exec vitest run packages/portal
packages/auth/src/DevicePages.test.ts packages/core
apps/server/src/migrations.test.ts`: 204 tests pass. New tests cover:
- the panel over Home, with Later per sign-in, a cross-site POST
refused, and a form from another account refused;
- the first-week and first-three-sign-ins rule, including a connected
person's sign-ins counting;
- `/guide` and `/guide/steps` going waiting, then connected, then live,
plus the watch mode;
  - the first-patch note's Open it.
- `pnpm typecheck` and `pnpm lint` pass.
- Not run locally: `pnpm verify` and the rollback rehearsal. CI runs
both.

## Release impact

- [ ] **Breaking** — requires action from anyone already running this
- [x] **Not breaking** — no action required

Additive migration (one new table), new routes, and portal pages.

- **What does a revert leave behind?** The `setup_prompt_sign_ins` table
and its rows: sign-in ids and times for people's first few sign-ins.
- **Does the release before it still work with that?** Yes. Nothing
before this reads the table.

<!-- patchy-dev:compare:ben -->

#### Before and after, as Ben Ortiz (member)

Before is `bb0fd60` (where this branch left
feat/setup-ends-on-welcome-page) and after is `8c388de`
(feat/final-step-panel), both on the `team` scenario, from `pnpm dev
compare`.

Every page answered 200 with no browser errors.

##### `/`

**1280px, after**

![After: / at
1280px](https://github.com/user-attachments/assets/08080f4b-6a5f-4c9b-a87b-8e6a1392e020)

<details><summary>1280px, before</summary>

![Before: / at
1280px](https://github.com/user-attachments/assets/baf277ef-ed27-40ea-8a93-5ec770be01a2)

</details>

| Width | Before | After |
| --- | --- | --- |
| 390px | ![Before: / at
390px](https://github.com/user-attachments/assets/e3121fc2-dc8f-4738-af1b-1f411b7b231d)
| ![After: / at
390px](https://github.com/user-attachments/assets/d0aa3cb5-4a3a-4450-b486-b9123eee909d)
|

<!-- /patchy-dev:compare:ben -->

Made by Claude Opus 5.5 in Claude Code, running in T3 Code.

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
allisonmahmood added a commit that referenced this pull request Oct 24, 2026
…erson's Final step panel (#917)

Stacked on #916 (then #914, #913). Merge those first; the onboarding
stack ships together.

## What changed

The Final step panel could only notice the end of each step: any new
computer of the person's, then a patch of theirs. Nothing moved for
about a minute after the paste, and any old laptop counted.

The panel's line now carries a one-time **setup link**: `Set up Patchy
using <instance>/llms.txt?s=<link>`.
- The agent's fetch marks the line picked up, within seconds of the
paste.
- `/llms.txt` prints `patchy login --setup <link>`.
- The first login that line starts binds to it; a second contests it.
- The mint records which key it made and who confirmed it.

The panel follows those facts. When a setup can't finish, it says why
and offers **Get a new line**. Events carry a separate setup id, so one
person's setup reads as a single funnel in PostHog.

Closes #910. Part of #906.

## Look at

- **`packages/auth/src/SetupLinks.ts` and migration 0027.**
- A link is 128 random bits as 26 base32 characters, one live per person
for 30 minutes, reused across reloads.
- It keeps how its login ended: pending, denied, expired, contested,
connected, or confirmed by another account. Device logins are deleted
when they finish, so the outcome has to live here. A login that mints
after its line ran out ends expired.
  - `device_logins.setup_link_id` is nullable and `ON DELETE SET NULL`.
- **`DeviceLogins`.** `start` binds, `deny` marks denied, a login that
runs out marks expired before it is deleted, and the mint records the
key and the confirming user in its own transaction. `token.minted` gains
`setupId`.
- **The front door.** A narrow `SetupPickup` port, which
`apps/server/src/SetupPickup.ts` provides. The SDK gains no Auth
dependency. Pickups spend a per-address minute's budget
(`rate.setupPickup.perMinute`) before reaching the database. An unknown,
expired, over-budget or failing link serves the plain `/llms.txt`, so
setup never breaks.
- **The CLI.**
  - `patchy login --setup <link>` keeps the link in its pending login.
- A rerun with the same link resumes. A rerun with a different link (or
a link when none was pending) starts afresh and says the earlier code no
longer applies.
  - `--setup` with `--complete` is refused.
  - ADR-0004 and the README record this.
- **The panel's states, in a real browser.** Each moved on by itself on
a dev instance: the agent's fetch, then a login started with the link,
confirmed in another tab, then its key collected.

| Picked up | Login waiting | Confirmed, key not yet collected |
| --- | --- | --- |
| ![picked
up](https://github.com/user-attachments/assets/4fd0dec5-db9c-4c72-a746-5b2f22395887)
| ![login
pending](https://github.com/user-attachments/assets/995636cc-74e3-4647-a282-c6f89adc2ad9)
|
![confirming](https://github.com/user-attachments/assets/8fac1058-ed0d-40ee-b719-fb7abdee736f)
|

| Connected: this setup's key | Two logins used one line |
| --- | --- |
|
![connected](https://github.com/user-attachments/assets/bd9317de-11b7-4997-a218-14c03d1a3f5c)
|
![contested](https://github.com/user-attachments/assets/9cef85f9-7160-4342-a5e5-f53042d918b8)
|

## How it was verified

- `pnpm exec vitest run` across `packages/portal`, `packages/auth`, the
front door, the CLI's login, `packages/api`, `packages/limits`,
`packages/core`, Patches and the server's migration record: 1,121 tests
pass. New ones cover:
  - links: one live per person, pickup once, retire;
- binding, contested, denied, expired (by poll, and by a mint after the
line ran out), a contested line's mint, and the owner's mint against
another account's;
  - `token.minted`'s `setupId`;
- the front door's live, unknown and failing links, and the pickup
budget per address;
  - the CLI's same-link, new-link and legacy reruns;
- the panel following a line through every state, including a login that
runs out with nothing polling, plus Get a new line's origin and
stale-account refusals.
- `pnpm typecheck` and `pnpm lint` pass. `docs/API.md` and
`docs/limits.md` are regenerated, and the skill's lock hash is
refreshed.
- Not run locally: `pnpm verify` and the rollback rehearsal. CI runs
both.

## Release impact

- [ ] **Breaking** — requires action from anyone already running this
- [x] **Not breaking** — no action required

The API field and the CLI flag are optional and additive. The migration
adds a table and a nullable column.

- **What does a revert leave behind?** The `setup_links` table and
`device_logins.setup_link_id`. Old code never reads them.
- **Does the release before it still work with that?** Yes. Agents
holding the new `--setup` command would need the matching CLI, but
`/llms.txt` installs the instance's own release first.

Made by Claude Opus 5.5 in Claude Code, running in T3 Code.

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
allisonmahmood added a commit that referenced this pull request Oct 24, 2026
## What changed

This PR adds release 18's What's new entry, written from `b23e6ad`. It
covers everything merged since release 17's `through` (`5dd94f3`), and
it sets the `patchy` release to `0.18.0` in
`packages/patchy/package.json` and `CURRENT_RELEASE`. With this release,
onboarding ends in a Final step on Home that follows the person's agent
through setup and lets them confirm it right there (#906).

| Change | PRs |
| --- | --- |
| New: A Final step to connect your AI agent | #916, #917 |
| New: Confirm your computer without leaving Home | #918 |
| Improved: Setting up ends with your first page | #914 |
| Improved: The logo takes you Home | #913 |
| Behind the scenes: the first time someone opens a colleague's tool is
counted, for activation | #915 |

One merged PR gets no line: #905 is release 17's own entry.

## Look at

- **The entry**, at the top of `releases` in
`packages/core/src/whatsNew.ts`. Its labels are the pages' own: Final
step, Later, Not me, Home, Patches.
- **Rollback safety, from the live commit `a049a3c` to `b23e6ad`.**
- No PR in the range is labelled `one-way`, and every PR answers both
Release impact questions with "Yes".
- Migrations 0026 and 0027 are additive: the `setup_prompt_sign_ins` and
`setup_links` tables, and a nullable `device_logins.setup_link_id` with
`ON DELETE SET NULL`. Release 17 never reads them.
  - `rollback-rehearsal` exercised both migrations on the landed heads:
- #916: `Exercised rollback paths passed: a049a3c → 6037d86 → a049a3c →
6037d86, in 234s.`
- #917: `Exercised rollback paths passed: a049a3c → d03a5bf → a049a3c →
d03a5bf, in 217s.`
- #918 and #915 change no migration or handler descriptor, so they had
nothing to rehearse.
- A rollback takes the Final step panel and setup links away. Home goes
back to the old guide, and a CLI at `0.18.0` stays usable against
release 17: `--setup` is only sent when `/llms.txt` prints it, and
release 17's `/llms.txt` doesn't.

## How it was verified

- `pnpm typecheck` and `pnpm lint` pass, and so do `packages/core`,
`packages/api`, `packages/portal` and the skill lock test (245 tests),
including `whatsNew.test.ts`, `schemas.test.ts` and
`WhatsNewPages.test.ts`.
- The live commit was pinned from `/healthz/deep`: `a049a3c`, release
17. The Deploy run updated last succeeded, and none is unfinished.
- Each PR in the range was read, including its Release impact answers.
All six landed with the reviewed trees: each squash left `main`'s tree
identical to its PR's reviewed head.

## Release impact

- [ ] **Breaking** — requires action from anyone already running this
- [x] **Not breaking** — no action required

This PR changes only the changelog text and the `patchy` version. As
with every release, a CLI installed before this deploy is told to
upgrade.

- **What does a revert leave behind?** Nothing. People whose seen marker
reached 18 would just see no new release.
- **Does the release before it still work with that?** Yes.

If this release misbehaves, roll back to
`a049a3cf544ae89691eec547dea46773febfdf05` (release 17).

Made by Claude Opus 5.5 in Claude Code, running in T3 Code.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci CI, shared testing infrastructure, development scripts and tooling area:cli Touches the cli area area:docs Touches the docs area area:server Touches the server area size:s Under 100 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(patchy): setup ends on a live welcome page and the agent's own suggestion

1 participant