Skip to content

feat(mcp): a tier 2 patch's agent area is its agent/ folder - #870

Merged
allisonmahmood merged 6 commits into
mainfrom
mcp/840-agent-folder
Oct 23, 2026
Merged

allisonmahmood merged 6 commits into
mainfrom
mcp/840-agent-folder

Conversation

@allisonmahmood

@allisonmahmood allisonmahmood commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Stacked on #869 (ticket #839); merges with the rest of #833's stack, not alone.

What changed

A tier 2 patch can now have tools for people's agents: every export of a root agent/*.ts file publishes as an agent tool named after its export, with no refresh. The page can't import or call them. #837's readers already refuse page calls to them; this PR is what first writes the mark.

Closes #840

Look at

1. The build folds agent/ into one module named agent. The generated entry in packages/patchy/src/serverBuild.ts passes agent/ files by name to createGuest. foldAgentArea in handlerDescriptors.ts merges them, and extractHandlerDescriptors marks each agent.<export> descriptor agentTool: true. A re-export is one handler under two names, unmarked for the page. Published on a dev instance, from a fresh patchy init --tier 2 plus this file, with no refresh:

// agent/deals.ts
export { list } from "../server/notes.js";
export const addNote = mutation({ description: "Adds a note with a title. Refuses a blank title.", … });
$ patchy publish --json | jq -c '[.handlers[].name]'
["agent.addNote","agent.list","notes.create","notes.list"]

Inspection returns agent.list with "agentTool": true and notes.list without it.

2. Duplicate names are refused naming both files, export * included. The guest's fold reads the real module namespaces, so it knows exactly which two files export a name. Inside workerd, though, a throw while loading loses its message. So createGuest answers every request with its refusal instead of throwing (guest.ts). packages/execution/src/inspection.ts reports that answer as reason refused, carrying its text as problem, and the CLI's publish and dev builds show it. The instance keeps its generic invalid_manifest and never echoes text from a bundle, and a refused bundle never binds. Statically following export * was tried and dropped after review (see the review comment). The build reads each file's own export statements only to name a tool's file in #839's description refusals, or agent/*.ts when there is none. The four refusals and the warning, from the same dev repo:

$ patchy publish --json   # agent/crm.ts re-exports addNote from agent/deals.ts
{"ok":false,"error":"addNote is exported by agent/crm.ts and agent/deals.ts; each tool needs its own name.","kind":"local","code":"invalid_manifest"}
$ patchy publish --json   # with server/agent.ts
{"ok":false,"error":"server/agent.ts: Agent tools live in agent/; move these exports there.","kind":"local","code":"invalid_manifest"}
$ patchy publish --json   # src/App.tsx imports ../agent/deals.js
{"ok":false,"error":"src/App.tsx imports \"../agent/deals.js\", but the page can't import agent/ at runtime. Agent tools are for people's agents only; call server/ handlers through patchy.server.","kind":"local","code":"import_refused"}
$ patchy publish --json | jq -c '{ok, warnings}'   # tsconfig.json include without agent
{"ok":true,"warnings":["tsconfig.json doesn't include agent/, so pnpm typecheck skips your agent tools. Add \"agent\" to its include list."]}

agent/ below tier 2 is tier_mismatch (agent/ requires tier 2. Change the tier and run \patchy refresh`, or remove agent/.), from the same check as server/ (repoBuild.test.ts). Page imports from server/` now get the same kind of fix-it message instead of the generic package one.

3. The dev watcher watches agent/ beside server/. devServerWatch.ts keeps one directory watch per folder and restarts the Vite watcher when either file list changes. A new agent file rebinds with no refresh reminder. The tsconfig check runs whenever the agent file list changes.

How it was verified

Release impact

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

Today the build ignores agent/. Now it builds it, and only tier 2 repos that have the folder change. A repo with a server/agent.ts is refused; only the unmerged prototype (#727) used that file.

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:ci CI, shared testing infrastructure, development scripts and tooling area:cli Touches the cli area area:docs Touches the docs area size:l 501-1,000 changed lines labels Oct 22, 2026
@allisonmahmood
allisonmahmood force-pushed the mcp/839-descriptions-readonly branch from 6914bda to ba74d58 Compare October 22, 2026 09:02
@allisonmahmood
allisonmahmood force-pushed the mcp/839-descriptions-readonly branch from ba74d58 to 2a4b34e Compare October 22, 2026 09:24
@github-actions github-actions Bot added area:primitives Patch tables and files area:integrations Company connections and integration implementations size:xl Over 1,000 changed lines; review in multiple passes and removed size:l 501-1,000 changed lines labels Oct 22, 2026
@github-actions github-actions Bot added size:l 501-1,000 changed lines and removed area:primitives Patch tables and files area:integrations Company connections and integration implementations size:xl Over 1,000 changed lines; review in multiple passes labels Oct 22, 2026
@allisonmahmood

allisonmahmood commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner Author

Review by GPT-6.1-Sol (xhigh), five rounds

Round 1 (f76fecf): nothing blocking.

  • Should-fix: a tool or agent/ file named __proto__ silently dropped tools, because assigning that key sets an object's prototype. Fixed (6b4ba5d): the fold builds on a null prototype, and the build entry uses computed keys. That also covers a server/__proto__.ts module, an older form of the same bug.
  • Should-fix: the duplicate check counted names that export * makes ambiguous, which ES modules leave out. Fixed, then reworked in later rounds (below).
  • Nit: the tsconfig warning can fire when included code type-imports an agent file, or when exclude lists agent. Dismissed: the spec defines the warning on include and gives its exact text. Being exact would mean building a full TypeScript program on every check, and both cases are deliberate builder choices. Sol agreed.
  • Nit: after the dev builder failed to start, a new server module lost its refresh reminder. Fixed.
  • Instance-side refusal of unmarked agent.* handlers (the spec's server/agent.ts check at the instance): belongs to Agent tools get client schemas and a publish check, and publish lists them #842, which owns the shared instance checks. Sol agreed.

Round 2 (6b4ba5d):

Round 3 (cec9b2d):

  • Blocking: memoized results from a star-export cycle that had been cut short caused a false duplicate. Fixed (c86425c), then superseded.

Round 4 (c86425c):

  • Blocking: names rolldown infers from CommonJS star sources can vanish at runtime, causing a false duplicate. Fixed by dropping the star walk (8584fe3). The check exists only for the message, since the guest refuses any real duplicate at load. It now counts only the names each agent file's own export statements declare, which are always in its namespace. A duplicate that only export * creates gets the guest's plainer invalid_manifest.
  • Should-fix: a __proto__ tool with no known file resolved through Object.prototype in description refusals. Fixed: an own-property lookup gives agent/*.ts.

Round 5 (8584fe3, unchanged by the rebase to 7f93c31): no findings, nothing blocking. Sol's probes covered erased TypeScript declarations, export =, CommonJS agent files, default aliases, string export names, multiple aliases and nested destructuring.

Acceptance at 814cd9c: FAIL (verdict). A duplicate made by export * got the generic inspection message, not the two files #840 requires. Fixed (bde24e7): the guest's fold already names both files for every duplicate, but it threw while the bundle loaded, and workerd loses that message. The guest now answers every request with its refusal instead of throwing. Inspection reports that as reason refused, carrying its text as problem, and the CLI's publish and dev builds show it. The instance keeps its generic invalid_manifest, and a refused bundle never binds. The build's static duplicate check goes.

Round 6 (bde24e7): no findings, nothing blocking. Sol checked that refused guests can't bind or invoke (422 load_failed from workerd), that cross-release handling is unchanged, that recognising 200 plus invalid_request only picks diagnostic text, and that the instance never echoes bundle text.

@allisonmahmood
allisonmahmood force-pushed the mcp/839-descriptions-readonly branch from 2a4b34e to 0cec8f4 Compare October 22, 2026 09:40
@github-actions github-actions Bot added size:xl Over 1,000 changed lines; review in multiple passes and removed size:l 501-1,000 changed lines labels Oct 22, 2026
@allisonmahmood

allisonmahmood commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner Author

Acceptance: PASS with notes

Checked bde24e7567fe48caab30a4b18ea24395d8fac580 (base 0cec8f4ebe158cf23aa5ea0da11fa1639267358b, mcp/839-descriptions-readonly) on fresh team data, by GPT-6.1-Sol (xhigh) in Codex / T3 Code.

All four Done means lines pass. The star-export diagnostic that failed acceptance at 814cd9c is fixed.

Done means

  • Add agent/deals.ts and publish without refresh: passed. A freshly initialized tier 2 repo published a query, mutation, action and server re-export as agent.count, agent.addDeal, agent.report and agent.listDeals, beside notes.create and notes.list. The stored manifest marks all four tools agentTool: true, leaving both page handlers unmarked. Moving the file to agent/intake.ts preserved every handler name. Generated page/client/server code required no refresh.
  • A page cannot import or call tools: passed. A runtime import returns import_refused with the agent-only explanation and the direction to call server handlers through patchy.server. Typechecking patchy.server.agent.count({}) returns TS2339, Property 'agent' does not exist. As Ben, direct page-runtime calls to all four tools, including the server re-export, return 403 access_denied; notes.list returns 200 and the saved note.
  • Refusals with a fix: passed, including the previously failing case below. Both named and star-export duplicates name the two files and require distinct tool names. server/agent.ts says Agent tools live in agent/; move these exports there. A fresh tier 1 repo with an empty agent/ returns tier_mismatch: agent/ requires tier 2. Change the tier and run `patchy refresh`, or remove agent/.
  • Older tsconfig warning: passed. Removing agent from include still permits publishing and returns the exact warning: tsconfig.json doesn't include agent/, so pnpm typecheck skips your agent tools. Add "agent" to its include list. The running dev session logs the same warning at startup and when its agent file list changes.

Previously failing reproduction

With valid exports in agent/deals.ts, add:

// agent/repeated.ts
export * from "./deals.js";

The repo's pinned CLI, node node_modules/patchy/dist/index.js publish --json, scoped to the throwaway environment, exits 1 with:

{"ok":false,"error":"addDeal is exported by agent/deals.ts and agent/repeated.ts; each tool needs its own name.","kind":"local","code":"invalid_manifest"}

The running dev watcher also names both files, ending with The last successful binding stays served. While refused, notes.list still returns 200 and the handler stream retains its previous binding. Removing the duplicate recovers.

Golden journeys

  • Publish a page, find/open it, and the way back: passed directly. Ada published the patch; Ben found it on Home, opened Notes and added Acceptance at bde24e7 through the page. Retire replaced its frame with the retired notice; restore returned Notes and the saved note.
  • Use a tier 2 tool: passed directly for the page read/write flow and agent/page isolation. The broader two-viewer and handler-rule journeys pass in the PR's browser and tier2-smoke checks.
  • Use a tier 1 tool live: passed in the PR's browser and CLI smoke checks; not repeated manually.

Additional evidence and surfaces

  • Eight focused suites passed locally with two workers: 119 tests across devServerWatch, server, serverModules, pageImports, repoBuild, initProject, guest and execution Inspection.
  • Direct dev session: adding an agent file updated the stream's handlers without refresh; renaming retained its tool name; deleting removed it. A browser sentinel survived all changes and duplicate refusal/recovery, confirming no shell reload. No agent-file refresh reminder appeared. Non-handler exports and nested folders were refused with fixes.
  • New repo tsconfig.json includes agent, and generated AGENTS.md contains the requested line. The server/loop skills, CLI README, ADR-0004, development/product docs and existing Publishing glossary cover the contract; the global skill hash matches skills-lock.json. Descriptor writing and both inspection consumers were exercised. No HTTP route/schema, migration, company-resource caller, served-page source or package-layout change needs another mirrored surface.
  • All 14 current PR checks pass on this head, including the three Node test lanes, both CLI smoke lanes and live Clerk.

Rollback answers: Match the diff and the stated stack release order. A revert leaves versions with marked agent descriptors; the stacked base already reads that field and rejects page calls to it. No schema or infrastructure migration is introduced. The latest rollback-rehearsal check passes all three stages, reporting e4243ff → 1e2e064 → e4243ff in 187 seconds (1e2e064 is the PR merge-test commit).

Not run / notes

  • Actual MCP tool invocation needs Runtime runs agent tools for agents, as their person #843 and the later agent door; it is outside A tier 2 patch's agent area is its agent/ folder #840.
  • Full local pnpm verify, live Clerk and a separate local rollback rehearsal were not repeated: this run uses the green PR CI results plus the independent focused suites and direct checks above.
  • Tier 2 publishes used each repo's pinned CLI as requested; the known environment CLI/workerd packaging gap is outside this PR.
  • Cleanup completed with pnpm dev down. The owned patch daemon and all three recorded instance processes stopped; the environment and dev state were removed. ~/Patchy gained nothing, and the checkout remains clean. PR source, branch, body and labels were left unchanged.

@allisonmahmood
allisonmahmood force-pushed the mcp/839-descriptions-readonly branch from 0cec8f4 to 8434931 Compare October 23, 2026 02:08
@allisonmahmood allisonmahmood mentioned this pull request Oct 23, 2026
@allisonmahmood
allisonmahmood force-pushed the mcp/839-descriptions-readonly branch from 8434931 to 706e730 Compare October 23, 2026 11:34
Base automatically changed from mcp/839-descriptions-readonly to main October 23, 2026 11:49
Every export of agent/*.ts is an agent tool named after its export. The
server build folds the folder into the one module named agent, so a
tool's handler is agent.<export>, and the guest marks each of those
descriptors agentTool, which #837's readers already enforce. A re-export
from server/ is one handler under both names, unmarked for the page.

Nothing generated lists agent files: publish and the dev watcher discover
them on every build, so adding one needs no refresh. The build refuses a
name two files export, naming both files (following export * as the
bundle links it), server/agent.ts, and a nested agent/ folder. agent/
below tier 2 is tier_mismatch and page imports from it are refused, as
for server/. A tsconfig.json that leaves out agent/ gets a warning in
dev builds and publish, and description refusals for a tool name its
file under agent/.

New repos include agent in tsconfig.json and eslint, and AGENTS.md names
the folder. patchy-server gains "The agent area", patchy-loop names
agent/, and the global skill's tier line says agents reach only a tier 2
agent area.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t * is no duplicate

The fold builds its exports on a null prototype, and the server entry
passes modules and agent files under computed keys, so an export or a
file named __proto__ is a key rather than an object's prototype.

The build's duplicate check now reads export * as ES modules link it: a
name two star sources give, which the module doesn't export itself, is
ambiguous and left out of the namespace, so another file's export of it
is no duplicate.

After the dev builder fails to start, a new server module still gets its
refresh reminder.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nts only names it is sure of

The guest refuses a server module named agent only beside an agent
area, where the names would clash, and otherwise keeps its handlers.
An older version built from server/agent.ts loads as before, and the
CLI still refuses server/agent.ts outright.

The duplicate check's export * walk is conservative: a name two star
sources give may be one binding or an ambiguity ES modules leave out,
so it counts as maybe and never causes a refusal. The guest still
refuses a real duplicate when the bundle loads.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A walk that meets a module it is still visiting cuts the cycle, and what
it found then depends on where the walk started. Such a result makes
every name its module gets through export * a maybe, and it is never
reused for another agent file. Explicit exports stay certain.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Working out at build time which names export * gives kept finding new
ways to be wrong: ambiguous names, shared bindings, cycles, and CommonJS
names that only exist until runtime. The check is only for the message,
since the guest refuses any duplicate when the bundle loads. It now
counts the names each agent file's own export statements declare, which
are always in its namespace; a duplicate only export * creates is left
to the guest's plainer refusal, and such a tool to no file.

A description refusal for a tool the build found no file for names
agent/*.ts, never a name inherited from Object.prototype.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… export * included

Acceptance found that a duplicate made by export * got only "Could not
inspect the server bundle". The guest's fold already names both files
for every duplicate, since it reads the real module namespaces, but it
threw while the bundle loaded, and inside workerd that message is lost.

The guest now answers every request with its refusal instead of
throwing. Inspection reports a guest's own refusal as reason refused,
carrying its text as problem, and the CLI's publish and dev builds show
it. The instance keeps its generic invalid_manifest and never echoes
text from a bundle. A refused bundle still never binds.

The build's own duplicate check goes; its reading of each file's own
exports stays only to name a tool's file in description refusals. A
non-handler export now gets its own message in the CLI too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@allisonmahmood
allisonmahmood merged commit da22a17 into main Oct 23, 2026
25 of 26 checks passed
@allisonmahmood
allisonmahmood deleted the mcp/840-agent-folder branch October 23, 2026 12:05
allisonmahmood added a commit that referenced this pull request Oct 23, 2026
Stacked on #870 (ticket #840); merges with the rest of #833's stack, not
alone.

## What changed

Every Patchy MCP call will need the company's agent access on, and until
now there was no switch. Company now ends with an **Agent access**
section: an On or Off tag, who made the latest change and when ("Turned
off by Priya Shah on 12 Oct 2026"), a paragraph, and for admins one
button, Turn on or Turn off, with no confirmation. Members see the same
state and stamp without a button: "Connect yours on Your machines" when
it's on, the admins' names when it's off. It starts off for every
company, new or existing.

Closes #841

## Look at

**1. The switch lives on the company row** (`0020_agent_access`):
`agent_access_on` defaults to false, and `agent_access_changed_by`/`_at`
hold the latest change, null together for the starting Off. `Companies`
gains `agentAccess`, `setAgentAccess` and `holdAgentAccess`. A change is
one `UPDATE … WHERE agent_access_on <> $on`, so asking for the state it
already has changes nothing and reports nothing. Each real change
reports `agent_access.changed` with `on`, after it commits.

**2. The lock #849 shares.** `holdAgentAccess` reads whether the switch
is on, `FOR SHARE` of the company row. Inside a transaction, a change
waits for the holder, and the holder waits for a change in flight and
then reads what it committed. It returns the switch alone: a read that
waited re-reads only the locked row, so a joined stamp could come back
stale (Sol's round 1). Code issuance and the code exchange call it, so
an exchange never acts on an "on" an "off" already replaced. The same
row lock serializes it with deactivation, which locks the company row
`FOR UPDATE`. `Companies.test.ts` › "makes a change wait for a holder of
agent access, and a holder wait for a change" shows both directions on
Postgres, waiting for a session the holder blocks; without the `FOR
SHARE` it times out.

**3. The page and route.** `POST /company/agent-access` with
`state=on|off`, same-origin, admins only. A member's POST is the page's
existing 403, and a malformed state is a 422 alert. It redirects to
`/company#agent-access`, so the admin lands back on the section at the
foot of the page. Screenshots and a short film:

**The admin's Company page, before and after** (Ada, `team`):

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

#### Before and after, as Ada Park (admin)

Before is `f76fecf` (where this branch left mcp/840-agent-folder) and
after is `7eeba59` (mcp/841-agent-access-switch), both on the `team`
scenario, from `pnpm dev compare`.

Every page answered 200 with no browser errors.

##### `/company`

**1280px, after**

![After: /company at
1280px](https://github.com/user-attachments/assets/db3da537-a177-443a-827f-159a22998f30)

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

![Before: /company at
1280px](https://github.com/user-attachments/assets/59f98c30-be56-4467-b236-8e289f53f775)

</details>

| Width | Before | After |
| --- | --- | --- |
| 390px | ![Before: /company at
390px](https://github.com/user-attachments/assets/3297d567-f55e-45b4-ac0c-d0f04512e2ca)
| ![After: /company at
390px](https://github.com/user-attachments/assets/1ebfcec8-5405-47a9-953a-d2957212bf65)
|

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

**A member's** (Ben):

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

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

Before is `f76fecf` (where this branch left mcp/840-agent-folder) and
after is `7eeba59` (mcp/841-agent-access-switch), both on the `team`
scenario, from `pnpm dev compare`.

Every page answered 200 with no browser errors.

##### `/company`

**1280px, after**

![After: /company at
1280px](https://github.com/user-attachments/assets/08a441aa-03ed-433d-a235-c46c4a71db6e)

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

![Before: /company at
1280px](https://github.com/user-attachments/assets/0eca66e5-f09b-4957-b894-b779fab1c68f)

</details>

| Width | Before | After |
| --- | --- | --- |
| 390px | ![Before: /company at
390px](https://github.com/user-attachments/assets/79af8ce7-e31b-45e1-8ec6-2e95634e18c1)
| ![After: /company at
390px](https://github.com/user-attachments/assets/c99c6983-c9f1-477d-8f1d-aac7e19078d1)
|

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

**Turning it on and off** as the admin, head only:

<!-- patchy-dev:film:agent-access -->

#### Flow `agent-access`, as Ada Park (admin)

After is `7eeba59` (mcp/841-agent-access-switch), on the `team`
scenario, from `pnpm dev film`.

- After: finished in 9.6s


https://github.com/user-attachments/assets/72a61412-4a7a-4de1-a4b5-ace15e541024

<!-- /patchy-dev:film:agent-access -->

## How it was verified

- `vitest`: `Companies.test.ts` covers a new company starting Off with
no stamp, on and off stamped with who and when (under `TestClock`), a
repeated state leaving the stamp alone, unknown companies, and the hold
in both directions. `CompanyPage.test.ts` covers the four page states,
the redirect, the events, a stale Turn on from a second admin, the 422,
and `/company/agent-access` in the member-refusal and Origin cases. Also
`apps/server/src/migrations.test.ts`, the companies suite, `AuthPages`,
`DevicePages` and serving's `Pages`.
- Typecheck (build plus `tsconfig.test.json`) and lint.
- `pnpm verify` on e3ecce3: 8 of 9 steps passed. The `test` step had 14
timeouts in 9 files this PR doesn't touch (CLI repo builds, SDK, fleet,
PGlite) while the machine's load was above 30. Rerun alone, all 9 passed
(137 tests), and CI's three `test` jobs passed.
- Rollback rehearsal against `main` dd3f41f, which has #837 and #838:
`pnpm test:rollback-rehearsal --live dd3f41f` gives `Exercised rollback
paths passed: dd3f41f → e3ecce3 → dd3f41f, in 470s.` CI's run against
production's d77baaf fails only in step 3, on the agent-area patch
production can't serve, the gate #833 documents. Its upgrade step, which
applies `0020_agent_access`, passes.

## Release impact

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

An additive migration: three columns on `companies`, defaulted or null.
Nothing reads the switch yet; the door and consent (#849 onward) will.

- **What does a revert leave behind?** The three columns, and a latest
change on companies an admin switched.
- **Does the release before it still work with that?** Yes. It never
selects the columns, and every insert it makes takes their defaults.

Built by Claude Opus 5.5 (xhigh) in Claude Code on T3 Code; reviewed and
accepted by GPT-6.1-Sol (xhigh).
allisonmahmood added a commit that referenced this pull request Oct 23, 2026
## What changed

This PR adds release 17's What's new entry, written from `5dd94f3`. It
covers everything merged since release 16's `through` (`dd3f41f`), and
it sets the `patchy` release to `0.17.0` in
`packages/patchy/package.json` and `CURRENT_RELEASE`. With this release,
people's agents can use their company's patches through Patchy MCP
(#833).

| Change | PRs |
| --- | --- |
| New: Your AI agent can use your company's tools | #873, #878, #880,
#881, #882, #883, #884, #886, #887 |
| New: Admins choose whether agents can use the company's tools | #871 |
| Improved: Your machines shows your agents too (Revoke all machines is
now Disconnect everything) | #885, #879 |
| New: See what agents can do with a tool | #876 |
| New: The log says when an agent made a change | #888 |
| New: Your agent can make a tool ready for agents | #869, #870, #872,
#875, #896 |
| Behind the scenes: agents' calls have their own limits, and a server
only an agent uses rests a minute after its last call | #889, #892 |
| Behind the scenes: New and Improved changes are public, for
patchyhq.com | #893 |
| Behind the scenes: library updates | #899 |

Five merged PRs get no line:
- #874 is release 16's own entry.
- #894 is dev tooling: worker agent launchers and scenario data. Its one
CLI fix lets a `patchy` installed outside a tier 2 repo publish it. The
skills have agents use the repo's pinned `pnpm patchy` instead, so that
path is off the documented one.
- #900 is CI.
- #901 rewords an internal skill.

## Look at

- **The entry**, at the top of `releases` in
`packages/core/src/whatsNew.ts`.
- It names only Claude Code and Codex. Both have connected through real
consent against dev instances. Hosted clients (Claude.ai, ChatGPT) are
checked in production only (`docs/product.md` › Patchy MCP ›
Acceptance).
- Its labels are the pages' own: Agent access on Company, Your machines,
What agents can do, Disconnect everything, and "Jordan Lee via Claude".
- **Rollback safety, from the live commit `e4243ff` to `5dd94f3`.**
- No PR in the range is labelled `one-way`, and every PR answers both
Release impact questions with "Yes".
  - Migrations 0020–0025 are all additive:
    - three defaulted or nullable columns on `companies`;
- `agent_name` on the runtime log, with a widened `credential_kind`
check;
    - the agent connection tables, `agent_consents` and `change_keys`;
    - two columns on execution bindings.

The new tables reference `users` without a cascade, but no release
deletes users or companies. Release 16 reads the runtime log only for
credential kinds it knows, so rows from agents can't break it.
- `rollback-rehearsal` on #892 rehearsed the whole stack, since #892
adds the last migration and the rest of the stack sits below it:
`Exercised rollback paths passed: e4243ff → c8bede4 → e4243ff → c8bede4,
in 238s.` #896's run skipped, because it changes no migration or handler
descriptor.
- #883 turns on the load balancer's host header preservation, which the
Deploy workflow's app stack deploy applies. A rollback leaves it on.
That's harmless, because release 16's server never reads `Host`.
- A rollback takes `/mcp` and `/whats-new.json` away. Connected agents
get a 404 until this release returns, and then their connections work
again, unless one ended in between. Agent tools published in between
stay refused to pages, because #837 already shipped in release 16.

## How it was verified

- `pnpm check` on `2d528b1`: format, lint, typecheck and synth passed.
In the test step, 2,300 of 2,301 tests passed. The one failure was
`packages/sdk/src/install.test.ts` › "says how to reach patchy when the
prefix's bin is not on PATH", which timed out at 180 s while the shared
machine was loaded. Rerun alone, that file passes all 7 tests in 62 s.
The release's own tests pass too: `whatsNew.test.ts`, `schemas.test.ts`
and `WhatsNewPages.test.ts`.
- The live commit was pinned from `/healthz/deep`: `e4243ff`, release
16. The Deploy run updated last succeeded, and none is unfinished.
- Each PR in the range was read with `gh pr view`, including its Release
impact answers.

## 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 17 would just see no new release.
- **Does the release before it still work with that?** Yes.

If this release misbehaves, roll back to
`e4243ff54d2acbbc88b60eeb0cf9b82a26dc9d5d` (release 16).

Prepared 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: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:xl Over 1,000 changed lines; review in multiple passes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A tier 2 patch's agent area is its agent/ folder

1 participant