Skip to content

docs: Patchy MCP is built - #972

Merged
allisonmahmood merged 2 commits into
mainfrom
docs/mcp-is-built
Oct 29, 2026
Merged

allisonmahmood merged 2 commits into
mainfrom
docs/mcp-is-built

Conversation

@allisonmahmood

@allisonmahmood allisonmahmood commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

What changed

Patchy MCP has been live in production since release 17, but the product doc, the glossary map and the MCP glossary still called it specified or being built. They now describe what runs, and where the build settled a detail differently from the spec, the spec now says what the code does. Production acceptance (#861) hasn't run: the section says so, and claims about particular clients are framed as what the build was designed for.

Part of #862. This is everything in #862's "What to do" except "What remains takes acceptance's findings", which waits for #861.

Look at

Status and pointers. Each of these now reads as built:

Spec details the build settled differently. Each claim was checked against main:

Claim in the doc What main does Where
A forwarded host is trusted from Patchy's proxy The door never believes a forwarded host and refuses two Host fields packages/mcp/src/RequestTrust.ts:7-10
Host gates the OAuth endpoints too Only /mcp is Host-gated; a dev instance serves every route on 127.0.0.1 packages/mcp/src/Door.ts:372, packages/auth/src/OAuthEndpoints.ts:19-20
An unknown method is 404 404 on 2026-07-28, 200 on legacy, where 404 means session ended packages/mcp/src/Door.ts:356-363
An unknown_outcome always resolves on retry Only until a few minutes before 24 h; then key_expired packages/mcp/src/ChangeKeys.ts:116-123, Calls.ts:339-347
An action's key never runs again Unless Runtime refused the first try before it started packages/mcp/src/ChangeKeys.ts:60-64, Calls.ts:409-419
resource is bound through exchange and refresh Optional; must name the door wherever sent packages/auth/src/Consents.ts:203-205, 345-348
Consent re-asks after an account switch Also re-asks an Allow after the client's name changes packages/auth/src/OAuthEndpoints.ts:423-436
With agent access off, consent names the admins To members; an admin is told to turn it on packages/auth/src/OAuthEndpoints.ts:182-185
"logged as Jordan via Claude" The person's full name: "Jordan Lee via Claude" packages/auth/src/OAuthEndpoints.ts:151-162
The docs say how to reconnect by hand Not written; Connect an app gives first-time steps only no such doc in docs/, skills/, packages/sdk/skills
Publish's warning points at <instance>/company <instance>/company/agent-access packages/patches/src/PatchesApi.ts:454
The instance names a duplicated tool It can't: inspection drops the bundle's message; only the CLI names it packages/execution/src/inspection.ts:12-16
A read-only action's writes are type errors Table and file writes are; Pidgeon writes typecheck and the callback gate refuses them packages/patchy/src/server.ts:247-262, packages/runtime/src/CallbackGateway.ts:107-111
dev.log names the person It writes their id: usr_dev via patchy dev … packages/patchy/src/devLog.ts:23-27
New repos include agent Tier 1 and 2 repos do packages/patchy/src/initProject.ts:207
The MCP request event says whether its binding is agent-only Only the binding event carries agentOnly packages/analytics/src/WideEvents.ts:228
An in-flight slot is held after the client disconnects A client gone before dispatch gives it back packages/mcp/src/Admission.ts:13-17
The week-unused note opens "Not used since 2 Oct." It opens "If you reconnected …" packages/auth/src/MachinesPage.ts:178
"today a person types everything into them" Agents now find, read and change patches too the section itself
Pages "get phone checks when built" They were checked at 390 px in their PRs' screenshots (#871 #876 #882 #885 #931 #932) —

How it was verified

  • Four read-only passes went claim by claim through the Patchy MCP section against main at 2f9f7c1. I re-read the code for every finding before changing a line. The table lists each change.
  • Findings left as they are:
    • "the one secret Patchy keeps recoverable": the context is the connection's tokens.
    • "each change gets a fresh change key" in patchy dev agent: the code's own comment says the same.
    • The lists of which outside clients can connect: these are facts about those clients, and the code offers no dynamic registration.
  • pnpm check: format, lint, typecheck and synth passed. Two test files failed under load average 19, a 5 s timeout in PgliteCompanyDatabases.test.ts and a worker SIGKILL in devExecution.test.ts. Both passed when rerun alone. Neither touches docs.
  • Not done here: packages/sdk/skills/patchy-server/SKILL.md:415 and packages/sdk/src/sdkCapabilities.ts:107 say a patch's tools fit in 64 KiB, but the check allows 60 KiB of that answer. Those files belong to another lane, so they're left for a follow-up.

Release impact

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

Docs only.

  • What does a revert leave behind? Nothing; the docs go back to calling Patchy MCP specified.
  • 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).

@github-actions github-actions Bot added area:server Touches the server area area:docs Touches the docs area labels Oct 28, 2026
@github-actions github-actions Bot added the size:m 100-500 changed lines label Oct 28, 2026
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Review: GPT-6.1-Sol (xhigh), one round

Round 1 on 66ff26d found nothing blocking. It checked the PR table's corrections against main and found no leftover "specified" or "unbuilt" labels on shipped surfaces. Nothing claims that acceptance ran or that a client was verified.

  • Should-fix. docs/product.md › Patchy MCP opened "today a person types everything into them", which describes the product before MCP. Fixed in b98ebf9: "Patches are made for people to look at and type into."
  • Nit. The new consent sentence said any answer after the client's name changed is refused and asked again. In fact Deny returns before that check, and only Allow is re-asked (packages/auth/src/OAuthEndpoints.ts:428-435). Fixed in b98ebf9: an account switch re-asks any answer, and a name change re-asks an Allow.

Round 1 had no blocking findings, so review stops there. Acceptance on b98ebf9 covers the two changed lines.

allisonmahmood and others added 2 commits October 29, 2026 20:47
The product doc, glossaries, README, AGENTS.md and operations notes now
describe Patchy MCP as it runs in production since release 17, and
correct the spec's details the build settled differently. Production
acceptance (#861) has not run, and the docs say so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Acceptance: PASS with notes

Checked f8099f601dafb077bb4de3081b383ae7427d9ca6 (base 0aa8d48ae60aacbc4b089d45e9754809a72e203a) on the docs-only, claim-by-claim scenario, by GPT-6.1-Sol (xhigh) in the Codex harness on T3 Code. No production access or dev instance. This verdict supersedes the one on b98ebf9 and checks the code at this head, including the intervening main changes.

Done means

Changed claims checked against f8099f6

All source links below are pinned to the full checked head.

Changed claim Result and evidence
MCP is built, including Auth's connections, client documents, consent and authorization server; release 17 introduced it. Passed. Server.ts:361–378 installs OAuth metadata, OAuth endpoints and the MCP door; release 17 records the shipped features. Consents.ts:197–219 loads client documents, and OAuthEndpoints.ts:480–503 implements exchange and refresh. This supports the README, AGENTS, glossary map and MCP glossary status changes. It verifies the implementation and release record, without a fresh live deployment probe.
People's agents find, read and change a tier 2 patch's marked agent/ tools through /mcp, as their person; new patches use the same connection. Passed. Door.ts:305–318 dispatches all four fixed tools; Calls.ts:136–176 resolves current patches and marked tools; Invocation.ts:1104–1125 supplies the person and agent to execution. There is no per-patch connection registration. The revised introduction and worker-agent present tense match this.
Agent calls admit work without an open page and retain the initiating viewer and existing resource-authority rules. Passed. Calls.ts:250–270 invokes Runtime directly with the person and live recheck; CallbackGateway.ts:312–333 chooses patch versus viewer authority and reauthorizes company callbacks.
Admins control agent access; MCP tools need it on. Passed. CompanyPage.ts:395–410 enforces the admin role; Door.ts:308–316 checks access before tool dispatch.
Deactivation ends agent connections transactionally; reactivation restores none. Passed. Users.ts:280–309 stamps credentials_ended_at in the transaction and retains it on reactivation; AgentConnections.ts:201–216 refuses connections made before that stamp.
New tier 1 and 2 repos include agent in TypeScript inputs; older repos warn when it is omitted. Passed. initProject.ts:203–211 conditions the inputs on tier >= 1 and names the agent area in generated AGENTS; serverModules.ts:102–130 checks the repo compiler's file list and emits the warning.
Read-only action types prohibit table/file writes but retain full connection types; the callback gate also prohibits Pidgeon writes. Passed. server.ts:247–258 keeps Connections intact and limits run to queries. CallbackGateway.ts:107–111 classifies writes, including Pidgeon, and 242–243 refuses them for read-only capabilities.
Publish validation names files locally and tools on the instance, with whole-folder size and duplicate-inspection exceptions. Passed. serverModules.ts:176–213 adds file names except for whole-area refusals. handlerDescriptors.ts:19–53 names duplicate exports and both files; repoBuild.ts:345–359 exposes the inspection problem locally. Content.ts:180–201 inspects stored bytes and applies shared checks before recording; InspectionError omits the bundle's own problem from its message.
Local agent logs identify the person by id. Passed. devLog.ts:23–30 formats initiatingViewerId via agent.name.
Publish's access-off warning points to /company/agent-access. Passed. PatchesApi.ts:445–455 constructs that URL.
Unknown methods are -32601, over 404 for modern requests and 200 for legacy; 2025-03-26 remains unserved. Passed. Door.ts:358–365 selects the status; Revisions.ts:18–22 lists the three served revisions.
The MCP door rejects wrong/duplicated Host, trusts no forwarded host, and OAuth endpoints remain available on the dev listener's alias. Passed. RequestTrust.ts:26–64 checks request authority and raw Host duplicates, without forwarded headers; Door.ts:369–379 applies the gate. OAuth has no such gate and shares the server's route registration; OAuthEndpoints.ts:15–20 records the alias behavior.
Retrying an unresolved mutation becomes key_expired shortly before 24 hours. Passed. ChangeKeys.ts:105–124 subtracts the run/cleanup/start/skew allowance, and 204–226 permits retry only within that window. Calls.ts:343–348 and 478–488 map TooLate to key_expired.
An action key is unused again after a recognized refusal before the handler starts. Passed. Calls.ts:409–419 identifies the before-dispatch errors; 516–525 discards those action claims. ChangeKeys.ts:141–147 deletes the record.
OAuth resource is optional but must name the door wherever supplied. Passed. Consents.ts:187–209, 351–353, and OAuthEndpoints.ts:492–499 enforce authorize, exchange and refresh respectively.
An account switch re-asks any answer; a client-name change re-asks only Allow. Passed. OAuthEndpoints.ts:423–435 checks the account before Deny and the client name after Deny.
Consent says the person's full name, asks “Connect client to company?”, and names admins to members while telling an admin to turn access on. Passed. OAuthEndpoints.ts:148–165 uses the full name, with email fallback, and the documented heading; 173–185 branches on the person's role. This covers both changed consent paragraphs.
Manual MCP reconnect instructions are not yet written; Connect an app has initial setup steps. Passed. MachinesPage.ts:77–130 contains the first-time setup instructions. A search of docs/, skills/ and packages/sdk/skills/ found no manual MCP reconnect guide.
A disconnected client returns its in-flight slot before dispatch; dispatched work retains it until settlement. Passed. Admission.ts:58–79 tracks holds; 181–185 releases the request's hold. Invocation.ts:1085–1090 defines the retain hook for dispatched work.
MCP request events attribute the person and include the documented MCP fields; agentOnly is a binding-event field. Passed. Authorization.ts:81–86 attributes the person; Door.ts:397–404 adds connection/client fields. WideEvents.ts:112–150 defines MCP fields, 322–334 includes them in requests, and 223–228/370–375 reserve agentOnly for bindings. RequestEvents.ts:99–124 wraps each request, with sampleProbability 1. This also verifies Operations' added attribution and Events pointer.
A week-unused connection note begins “If you reconnected …”. Passed. MachinesPage.ts:173–180 has the condition and exact text.
The implementation pages were checked at phone width, 390 px. Passed against historical evidence, not code. Re-read the 390 px evidence in #871 (agent access), #876 (cards), #882 (consent), #885 (machines), #931 (company page) and #932 (Your agents). No new screenshots are claimed by this run.
Rebase-specific checks: current code and main's added prose
  • git range-diff b98ebf9~2..b98ebf9 0aa8d48..f8099f6 shows the second commit as =. The first commit's only range-diff discrepancy is the inherited cost-promise context in docs/product.md, including main's updated cost estimates and prewarm paragraph.
  • Cryptography: ChangeKeys.ts:160–184 now obtains hashes, attempt ids and mutation keys through the service, with the same retry/expiry decisions. AgentConnections.ts:174–198 retains the same token-keyed retry encryption; 384–409 still checks revocation before serving retries or rotating. NodeCryptography.ts:57–95 preserves SHA-256, HKDF and AES-GCM behavior. The callback and stored-bundle validation paths cited above retain their authority and refusal checks. Main's new Cryptography guidance in AGENTS and the glossary map is compatible with these descriptions.
  • Prewarm versus admission: PortalPages.ts:969–989 ranks live tier 2 candidates; Prewarm.ts:59–89 caps them at three and holds them for the configured window. fleet.ts:789–830 and fleetStore.ts:185–197 preserve a ready spare and replacement budget. fleetStore.ts:265–290 runs neither idle clock for prewarm; 305–354 defers release while the hold exists and releases an unused binding afterward. That speculative loading does not admit an unattended handler, so it does not clash with the PR's present-tense tier 2 admission rule. The inherited cost figures are estimates from main, not new measurements here.
  • Prewarm and standby events: WideEvents.ts:278–286 and 388–395 put prewarm outcomes on their own event. fleetStore.ts:370–377 leaves agentOnly unset for an entirely unused prewarm binding. supervisor.ts:596–608 adopts standby processes without attributing a version to an unused standby; 800–855 measures startMs from version bind, matching main's revised Operations wording. These changes do not put agentOnly on MCP request events.
  • Generated repos: main's TypeScript 7/Oxlint changes preserve the tier-conditioned agent input shown above. No conflict with the PR's more precise “new tier 1 and 2 repos” wording.

Golden journeys

  • No journey's executable behavior changes in this diff: routes, CLI, runtime, migrations, scenarios and served HTML/CSS are identical to the base. The discovery/read/change, consent, access-off/on and deactivation descriptions were checked against the code and focused offline suites. No end-to-end journey is counted as executed here.
  • Applicable surface checks: vocabulary/product shape and repository-layout descriptions. No wire/CLI contract, dev-runner, migration, company-resource, served-page or reverse-state implementation changed.

Verification

pnpm exec vitest run packages/mcp/src/RequestTrust.test.ts packages/mcp/src/Revisions.test.ts packages/mcp/src/Door.test.ts packages/mcp/src/Admission.test.ts packages/mcp/src/ChangeKeys.test.ts packages/mcp/src/Calls.test.ts packages/auth/src/AgentConnections.test.ts packages/auth/src/Consents.test.ts packages/auth/src/OAuthEndpoints.test.ts packages/runtime/src/CallbackGateway.test.ts packages/runtime/src/Prewarm.test.ts packages/execution/src/PrewarmResidency.test.ts packages/analytics/src/WideEvents.test.ts packages/patchy/src/initProject.test.ts packages/api/src/agentTools.test.ts
Test Files  15 passed (15)
Tests       182 passed (182)

pnpm exec vitest run packages/mcp/src/Calls.workerd.test.ts packages/mcp/src/ChangeKeys.workerd.test.ts packages/execution/src/Fleet.test.ts
Test Files  3 passed (3)
Tests       45 passed (45)

pnpm exec prettier --check AGENTS.md GLOSSARY-MAP.md README.md docs/OPERATIONS.md docs/product.md packages/mcp/GLOSSARY.md
All matched files use Prettier code style!

git diff --check 0aa8d48...HEAD
(no errors)

Total: 18 suites, 227 tests passed, including real workerd calls and fleet behavior. The task checkout started clean at the requested head and stayed clean after verification. No PR code, branch, body or labels were changed.

Rollback answers: They match the diff. Reverting changes only documentation and leaves no schema, data, mail, infrastructure or new executable contract behind. No one-way label is needed; no migration is changed.

Not run

Notes

@allisonmahmood
allisonmahmood merged commit 6a80dd6 into main Oct 29, 2026
24 checks passed
@allisonmahmood
allisonmahmood deleted the docs/mcp-is-built branch October 29, 2026 20:04
allisonmahmood added a commit that referenced this pull request Oct 29, 2026
## What changed

This adds release 24's What's new entry, written from `9ee90e3`. It
covers everything merged since release 23's `through` (`ed80fc7`) and
sets the `patchy` release to `0.24.0` in `packages/patchy/package.json`
and `CURRENT_RELEASE`. This is the first of three releases for #986. In
it, tier 1 stops reaching anything outside its own patch, and the shell
stops requiring Patchy's code on a page.

| Change | PRs |
| --- | --- |
| Improved: Company data goes through a patch's own rules. Company
connections, other patches' shared data and the member directory are
read from server code (tier 2) only. A browser-only patch reaches its
own tables and files. One that already read these stops getting that
data until it moves to tier 2, and the CLI's refusal names the fix. |
#1047 |
| Fixed: Plain pages no longer say they could not start. A page that
never loads the SDK isn't covered by "This patch could not start" after
ten seconds any more. | #1044 |

Two merged PRs get no line, because nobody using Patchy would notice
them. #972 is the Patchy MCP docs pass and #1051 is live Pidgeon test
churn. #1050 is release 23's own entry.

## Look at

- **The entry**, at the top of `releases` in
`packages/core/src/whatsNew.ts`.
- **Rollback safety, from the live commit `0aa8d48` (release 23) to
`9ee90e3`:**
  - No PR in the range is labelled `one-way`, and none adds a migration.
- #1047 changes no stored data. A revert puts tier 1's direct
connection, shared and member reads back. Repos that moved to tier 2
meanwhile stay valid on release 23.
- #1044 is broker-only. Release 23's shell shows a page without the SDK
the way it did before.

**Rollback line:** If this release misbehaves, roll back to `0aa8d48`
(release 23).

## How it was verified

- **Tests.** `whatsNew.test.ts`, `WhatsNewPages.test.ts` and
`schemas.test.ts` pass (21 tests), and prettier passes on the changed
files.
- **The range.** #1047 and #1044 each had GPT 6.1 Sol reviews with every
finding resolved and an acceptance PASS with notes. They landed with all
12 required checks green on their rebased heads, `rollback-rehearsal`
against release 23 included. Their conflict resolutions got a separate
Sol review with no findings.
- **Deploy state.** The live commit, pinned from `/healthz/deep`, is
`0aa8d48` (release 23). The Deploy run updated last (#25) succeeded, and
none is unfinished.
- **Known effect.** One patch in production is a tier 1 patch that reads
the member directory. Its member reads stop until it's republished at
tier 2. Its owner has been told.

## Release impact

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

Text and version numbers only. The `0.24.0` bump tells CLIs and patch
repos installed before this deploy to upgrade, as every release does.

- **What does a revert leave behind?** Nothing.
- **Does the release before it still work with that?** Yes.

Built by Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, through 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:docs Touches the docs area area:server Touches the server area size:m 100-500 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant