Repository navigation
Description
Destination
A spec for the Patchy MCP, written into docs/product.md, the glossaries and ADRs, sharp enough to file as build tickets with no further design conversation. Through one MCP connection per person, their worker agent (any client that follows the latest MCP spec) finds, reads and changes their company's tier 2 patches as them, through each patch's opt-in agent area, while the company's agent access is on. It is proven by the prototype (#727) and the tickets below. The acceptance journey runs in production after the build: a builder agent adds an agent area from the skills alone, and a person's worker agent in Claude.ai uses it, with ChatGPT tried where it can be (best effort, as decided on #736). The map ends with the spec and its build tickets, not the build, and both land before tier 3.
Notes
- Settled; do not re-decide. The prototype's decisions (2026-10-16) and both charting rounds (2026-10-17) are on the first closed ticket below. Later tickets sharpen them; none reopens them.
- Two pipelines are how we talk about it. The builder pipeline is the CLI: builder agents with
buildtokens. The worker pipeline is the MCP: worker agents withworktokens. Always say "worker agent" or "builder agent", never a bare "worker", which is workerd's word. - Not prescriptive. Patchy offers the agent area and enforces whatever rules the patch writes; the person and their builder agent decide what agents may do. No skill or platform feature steers patch design (drafts first, approvals human-only, agent areas by default), and confirmation before a change is the client's business.
- Latest MCP spec. Target the newest revision; serve older ones only while the clients we check still need them. The door is Patchy's server, so every worker agent gets the newest door on each deploy with nothing to install.
- Before tier 3. This map and its build land on tier 2, before tier 3. The tier 3 map (Tier 3 map — patches that run without a viewer present #623) treats Patchy MCP as a seam; when tier 3 resumes, its authority and run work build on this door, never a second one.
- The prototype is prototype: people's own agents use patches through Patchy's MCP #727 (
prototype/agent-mcp, never merged): what it built, what Allison's testing showed, and what it leaves out. Its code is a reference for the build tickets, not a branch to merge. - Research runs on two model families. Each research ticket gets two T3 Code subagents in parallel, Opus 5.5 and GPT 6.1 Sol (xhigh); the session merges both. Subagents run as T3 Code tasks, not external CLIs, unless T3 delegation is broken. Findings land in the ticket's resolution comment, never on a branch or in the tree (this overrides the wayfinder skill's branch step).
- UI starts as static mocks, several distinct versions published with
patchpageand picked before any component is touched. First-party pages compose the shell's shared components. - Every grilling question carries product context, consequences and a recommendation, so it can be answered from the ticket alone.
- Skills every session consults:
grillinganddomain-modelingon grilling tickets;researchon research tickets;prototypeon prototype tickets;effect-service-conventionsandnode_modules/effect/AGENTS.mdbefore Effect code; Hit every surface inCLAUDE.mdbefore calling anything done. The spec and its build tickets get a GPT 6.1 Sol xhigh review before they are filed.
Decisions so far
- The destination: a spec for the Patchy MCP, and what the prototype and charting settled: spec plus build tickets, launching on tier 2 before tier 3; builder pipeline = CLI with
buildtokens, worker pipeline = MCP withworktokens; one connection per person, four fixed tools, one grant as the person; opt-in agent area on tier 2+, an agent never exceeds its person,ctx.agent; agent access off until an admin turns it on; latest MCP spec, older revisions only while clients need them; confirmation is the client's; not prescriptive (no drafts feature or steering); log attribution "Person via Client"; agents poll; files out; OAuth server open (Patchy's or Clerk's). - Research: what a worker agent costs on tier 2: an agent's read or change binds the company task like a page's call; any poll under the 30-minute idle window costs the same as an open tab ($5.45/month per company for a working day, ten agents included; $20.97 ceiling for a loop left running); the cost that grows with polling is unsampled PostHog events (ten agents at 10 s ≈ $22–32/month) and rollup rows; quiet agent reads are invisible in the log; agent actions share the person's action slots; nothing sees or stops a loop.
- Research: the latest MCP revision and what clients implement today: 2026-07-28 (stateless,
server/discover,resultType, cache hints, per-request negotiation with HTTP statuses) suits a four-tool door; serve it beside 2025-11-25 (VS Code, Cursor, Claude Code's fallback) and 2025-06-18 (Codex default, Gemini CLI) on one endpoint, dropping each on production evidence; hosted Claude.ai/ChatGPT revisions andOriginare unknown until acceptance; clients prompt on everychange_patch; replayed changes need idempotency; only ChatGPT can hand files over; ChatGPT write access may be Business/Enterprise only. - Research: authorizing worker agents, and whether Clerk can be the authorization server: keep Patchy's own authorization server with Clerk for browser identity (Clerk can't list or revoke a grant, its JWTs live a day and its refresh tokens don't expire, no issuance hook for the switch, consent and dev loop suffer, OAuth price unstated); add CIMD and keep DCR (Cursor, Gemini CLI); a connection is the grant, not the client; rotating refresh with ~1 h opaque access tokens; CIMD fetches under SSRF rules; never HTTP 403 for policy refusals; prototype gaps include an open redirect before sign-in and exact-port loopback matching.
- The MCP surface on the latest revision: tools, results, refusals, retries and revisions: the four tools as prototyped, with paging and a
detaillevel on find; a read is a query or a read-only action that Patchy's callback gate holds to reads; one refusal shape, over HTTP 200; calls run on the served version; a required change key makes mutation retries write once (24 h, per connection and patch);Hostis the gate,Originis never allowlisted, CORS*without credentials; 2026-07-28, 2025-11-25 and 2025-06-18, each dropped after 30 days unused; limits onopen_patchand descriptions are checked at publish, and the door caps a read result at 100k characters. - Signing worker agents in and out: the authorization server, consent, lifetimes and reverse states: Patchy's own authorization server, Clerk only for sign-in; metadata documents only, no dynamic registration (Claude and Codex are key, ChatGPT best effort); each consent is a new agent connection, consent every time; one-hour access tokens checked per call, one rotating refresh chain with a one-minute retry, 30 days without a call, no absolute lifetime; ended connections get 401 and the client's reconnect, agent access off gets a tool-result refusal while refresh keeps working; Disconnect everything and deactivation also cancel uncollected consents and device logins; admins have only the switch and deactivation; ADR-0008 amended in place; dev persona switching refuses cross-site requests.
- Bounds for worker agents: rate limits, polling and what an agent keeps running: an agent's call keeps the company's server for a minute on its own clock, while a person's tab keeps it for thirty after use; a cold company is waited on for 40 s, then
busy; per-person buckets of 600 a minute at the door and 300 per patch, 16 in flight, the agent's own action slots; body 1 MiB + 64 KiB; refusals are tool results ontools/calland 429 elsewhere, never a log row, always a wide event; open endpoints are limited per address only where the person's browser calls and on failures where hosted clients call; quiet queries roll up like a person's and the consent line promises changes; one unsampled event per request. - The builder pipeline for agent areas: declaring, describing, testing and what the skills say: the agent area is a root
agent/folder, one level deep, each tool named after its export and unique across it, no refresh, tier 2+; agent tools are agents-only (the runtime refuses page calls), a re-export shares aserver/handler, a tool of its own can be stricter;action({ readOnly: true })with a typed read-only context; a described tool (2,000 characters),.describe()on values, undescribed arguments warn; one shared JSON Schema mapping, no uploads or file handles; the instance enforces at publish and the CLI checks earlier, refusals carry fixes, tools fit 60 KiB of the 64 KiB answer;patchy dev agentfor testing, no local MCP endpoint; publish's "Agent tools" line and an access-off warning, address stays/mcp; the card's "What agents can do" for everyone; skills state facts, never when to offer or ask. - The worker pipeline's pages, picked from static mocks: connecting an agent is a tab per agent on Your machines with plain steps; consent shows the agent "wants to act as" the person, then what it can and can't do; agent access is a quiet section under Company's people, no confirmation; Your machines lists agents then machines, a reconnect's leftover explaining itself; the card puts "What agents can do" in a side panel beside the Overview; the log says "Jordan Lee via Claude" in words; new shell pieces are an agent mark, the consent strip and a can/can't list.
- The Patchy MCP spec and its build: the spec is merged as docs: specify Patchy MCP, where people's agents use their company's patches #831 (
docs/product.md› Patchy MCP, the glossaries, a newpackages/mcpcontext); nothing is held back for launch, because the build is one stack merged and deployed together; the agent access section shows its latest change; the build is Build Patchy MCP #833, with 29 sub-issues: Check that Claude's and ChatGPT's client documents load from production's egress #834 a production check, Reserve themcpandoauthcompany handles #835–Deactivation and Disconnect everything end pending device logins and record when a person's credentials ended #838 shipping alone first so a rollback stays safe, the stack Builders describe handlers and declare read-only actions #839–Test the agent area's skill text with Sonnet and Opus builders on the real pipeline #860, acceptance Production acceptance: a builder agent adds an agent area and a person's agent uses it from Claude.ai #861 and the docs pass Docs pass: Patchy MCP is built #862; the skill text test's findings are on Write the Patchy MCP spec and file the build tickets #740, and its SDK finding is A handler argument can't be typed as a table's row id, so id-taking handlers cast #832.
Not yet specified
- A per-patch admin control over agent access, beyond the company switch and the owner's choice to add an agent area. Waits until an admin needs one.
- Limits tuned from real use. The bounds ticket set starting values; tuning follows launch data in PostHog. Known levers: folding quiet agent reads into per-minute events once MCP events weigh on the PostHog budget, reserving a spare task for people if agents empty the pool, and the agent idle window if pollers sit on its edge.
- Replay for actions that write. Change keys cover mutations; storing a finished action's reply under its key waits until agents need it.
- A local MCP endpoint on the dev daemon, so someone's own client can use unpublished agent tools.
patchy dev agentcovers builder agents; this waits until someone wants their own client on unpublished code.
Out of scope
- Tier 3 for agents: pushing changes to agents, or agents starting unattended work. On tier 2, agents loop and poll.
- Files across MCP: uploads and file handles. Builder agents learn the limit and design around it; upload methods may come later as their own effort.
- Tier 0 and tier 1 patches for agents. Agents reach only a tier 2 (or later) agent area.
- A connection per patch. Rejected: one connection per person.
- Patchy as an MCP client, connecting other MCP servers to patches.
docs/product.mdrules out bring-your-own sources. - Billing for agent use, and tier 4 sandboxes for agents.
- Signing out other browsers after a lost device: Disconnect everything ends credentials, not browser sessions. Filed separately as A lost laptop stays signed in to Patchy in its browser after Revoke all.
- Dev environments and parallel page publishes, found while deciding the builder pipeline: filed separately as A dev environment's agent makes new patches in your real ~/Patchy and Two agents publishing pages at once can put up the wrong page.
Activity
docs: specify Patchy MCP, where people's agents use their company's p…
allisonmahmood commentedon Oct 22, 2026
The map has reached its destination. The spec is merged as #831, and the build is Build Patchy MCP, with 29 sub-issues in landing order. Mid-build decisions go to Allison on #833.