Skip to content

feat(companies): no company can take the mcp or oauth handle - #863

Merged
allisonmahmood merged 1 commit into
mainfrom
mcp/835-reserve-handles
Oct 22, 2026
Merged

allisonmahmood merged 1 commit into
mainfrom
mcp/835-reserve-handles

Conversation

@allisonmahmood

@allisonmahmood allisonmahmood commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

What changed

Patchy MCP's door will answer at <instance>/mcp and its authorization server at <instance>/oauth/… (The door). Until now a company could claim either name as its handle, and its addresses would then collide with those paths. mcp and oauth now join the reserved handles, so create-or-join refuses them with the existing "is reserved" message.

This ships alone, before the rest of #833's stack. That way, even a production rolled back to a release without the door keeps both handles free.

Part of #835, which stays open until the post-deploy second check is posted on #833.

Look at

  • No production company holds either handle. Read-only query of production's companies, 2026-10-22: no company holds either handle.

  • The two handles are refused. packages/companies/src/Companies.test.ts › "keeps the MCP door's and its authorization server's paths off company handles". It fails on main and passes here:

    main + new test:  Tests  1 failed | 10 passed (11)
    this branch:      Tests  11 passed (11)
    

How it was verified

  • vitest run for @patchy/companies, with the new test red first and then green, as shown above.
  • pnpm verify on the head: 8 of its 9 suites passed. In the offline test suite, one unrelated test timed out at 5 s while the shared machine's load average was about 40: PgliteCompanyDatabases › "meters retained local authority once and stops on disposal". It passed when rerun alone (3/3).
  • CI is green on the head.
  • Not covered here: the second production check after the reservation is live. That is Build Patchy MCP #833's release gate.

Release impact

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

Two entries are added to an in-code list. There is no schema, API or CLI change, and no existing company holds either handle.

  • What does a revert leave behind? Nothing. A revert only reopens both handles to new companies.
  • Does the release before it still work with that? Yes.

Built by Claude Opus 5.5 (xhigh) in Claude Code on T3 Code; reviewed and accepted by GPT-6.1-Sol (xhigh).

The Patchy MCP door answers at <instance>/mcp and its authorization
server at <instance>/oauth/..., so neither may ever be a company's
handle (docs/product.md, The door). Create-or-join now refuses both with
the existing "is reserved" message.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added area:server Touches the server area size:s Under 100 changed lines labels Oct 22, 2026
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Review: GPT-6.1-Sol (xhigh), one round on 6365c62. No findings: nothing blocking, nothing non-blocking, no nits.

What it checked:

  • Both handles go through the existing creation guard. Create-or-join keeps the "is reserved" refusal, and Join.ts's suggestions already skip the shared list.
  • The new test pins the two names on their own. The existing list-driven test wouldn't catch either one being removed.
  • No mirrored surface is missing: the glossary, API docs, CLI, skills, seeds, scenarios and fixtures need nothing. There are no migrations and no breaks of Build Patchy MCP #833's invariants.
  • No other root path needs reserving. oauth covers /oauth/…, /.well-known/… can never be a valid handle, and a single-segment endpoint can't collide with /<company>/<patch>.

Its only note was the post-deploy second check on #833, a release gate outside this PR.

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Acceptance: PASS with notes

Checked 6365c623a335ad442479fe1accc7a81b1628ed2d (base e8382275c9846503670499564c10dc70a8e89802) on a fresh team instance, by GPT-6.1-Sol (xhigh) in the Codex harness on T3 Code.

Done means

  • A new company cannot take mcp or oauth: passed. Both service-level reservations and actual create-or-join HTTP refusals passed; each returned 422 with its existing “is reserved” message.
  • The PR says no production company held either handle and how it was checked: passed as documentation. The body records a read-only query of production companies on 2026-10-22, with neither handle present. I did not independently access production.
  • The second production check after deployment: not run. This remains the explicit #833 release gate, rather than a claim made by this pre-deployment verdict.

Golden journeys

  • Sign in: passed, as Ben: /company returned 401 with the sign-in door and private, no-store, then 200 at Acme Co after persona sign-in, then 401 after logout.
  • Invite and join: passed, as Ada and a fresh scenario address: invite appeared on create-or-join; revoking it made consumption return 409; a replacement invitation joined Acme Co and opened Home. Deactivation returned 403 for that member, and reactivation restored 200.

Evidence and risks checked

pnpm exec vitest run packages/companies/src/Companies.test.ts packages/auth/src/AuthPages.test.ts packages/auth/src/CompanyPage.test.ts
Test Files  3 passed (3)
     Tests  46 passed (46)

Direct HTTP checks on the fresh head instance:

mcp / oauth: 422; entered name and handle retained; handle marked invalid.
MCP / OAUTH: 422; no suggestion of either reserved lowercase handle.
Same person retries each reserved handle, then creates mcp-app / oauth-app:
  422, then 303 -> /company 200, with the expected company and founder.
Invite -> revoke -> consume: 409.
Reinvite -> join: 303; Home 200; /company 200 as an Acme member.
Deactivate -> member /company 403; reactivate -> member /company 200.

CI is green on the checked head, including browser, live Clerk, packed CLI, tier 2, and Postgres concurrency suites. The PR head was unchanged immediately before posting.

Rollback answers: match the diff. Only the reservation list and its test change. A revert reopens the names; it leaves no new schema, changed data shape, infrastructure, or wire/CLI contract that an earlier release could not read. No one-way label is needed. The successful rollback job explicitly reports “No migration changed, so there is no rollback to rehearse.”

Surface audit: company creation and the shared Join validation apply. No mirrored API/CLI, dev-loop, glossary, migration, resource, HTML policy fixture, skill, or package-layout update is needed.

Not run

  • Independent production queries, including the post-deploy query: this run is confined to disposable local data. The second query must still be run with Allison's go-ahead and posted on Build Patchy MCP #833 after the reservation is live.

Notes

  • No behavioral failures found. This accepts the reservation PR for landing; it does not satisfy Build Patchy MCP #833's post-deployment release gate.

@allisonmahmood
allisonmahmood merged commit b780944 into main Oct 22, 2026
14 checks passed
@allisonmahmood
allisonmahmood deleted the mcp/835-reserve-handles branch October 22, 2026 07:30
allisonmahmood added a commit that referenced this pull request Oct 22, 2026
…874)

## What changed

Release 16's What's new entry, written from `dd3f41f`. It covers
everything merged since release 15's `through` (`9e4b0df`), and sets the
`patchy` release to `0.16.0` (`packages/patchy/package.json` and
`CURRENT_RELEASE`).

| Change | PRs |
| --- | --- |
| Fixed: Revoke all machines stops logins still on their way | #867 |
| Behind the scenes: `mcp` and `oauth` kept off company addresses | #863
|
| Behind the scenes: read-only actions and agent tools understood and
enforced before anything writes them | #868 |
| Behind the scenes: logs record how long a tool's server takes to start
| #865 |

#814 is release 15's own entry, so it's left out. #818 and #831 are docs
(Patchy is live; the Patchy MCP spec) and #864 is dev tooling, so none
of them gets a line.

## Look at

- **The entry**, at the top of `releases` in
`packages/core/src/whatsNew.ts`. #867 is the only change a person could
notice. The page's button is still labelled "Revoke all machines"
(Disconnect everything is the spec's future name), so the entry uses
that label.
- **Rollback safety, from the live commit `d77baaf` to `dd3f41f`.** No
PR in the range is labelled `one-way`, and every PR answers both Release
impact questions with "Yes".
- #867 is the only migration: `0019_credentials_ended` adds two nullable
columns, `users.credentials_ended_at` and `device_logins.confirmed_at`.
At `d77baaf`, every insert into `users` and `device_logins` lists its
columns, and nothing reads either table with `SELECT *`.
- `rollback-rehearsal` passed on #863, #865, #867 and #868. #868's run
covered #867's migration already on main: `Exercised rollback paths
passed: d77baaf → ffe9988 → d77baaf`.
- A rollback would reopen what #867 closes: an approved login that
hasn't finished could again get past Revoke all machines. It would also
let new companies take the `mcp` and `oauth` addresses (#863). No
release that writes read-only actions or agent tools has shipped, so
going back past #868 leaves nothing behind.

## How it was verified

- `vitest run packages/core/src/whatsNew.test.ts
packages/api/src/schemas.test.ts`: 14 passed.
- `pnpm typecheck`: 23 of 23 tasks pass. Prettier and eslint are clean
on the changed files.
- The live commit was pinned from `/healthz/deep` (`d77baaf`, release
15). The Deploy run updated last succeeded, and none is unfinished.

## Release impact

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

The changelog text plus the `patchy` version bump. A CLI installed
before this deploy is told to upgrade, as with every release.

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

If this release misbehaves, roll back to
`d77baafcf10c7cdf28c71bd65ea1a0009aa99ced` (release 15).

Built by Claude Opus 5.5 (xhigh) in Claude Code on 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:server Touches the server area size:s Under 100 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant