Repository navigation
feat(dev): environments come with worker agents, and brightline's tier 2 patches have agent areas - #894
Conversation
Review: GPT-6.1-Sol (xhigh), two roundsRound 1 (on 33b5445): 1 blocking, 2 should-fix, 1 qualification.
Round 2 (on 50f3ab9): nothing blocking; round 1's fixes confirmed; 2 should-fix.
Round 2 also confirmed, for the standing questions: the door and the minting stay on this checkout's instance and database; only |
Acceptance: PASS with notesChecked Done means
Golden journeys
Additional risks checked
Rollback answers: match the diff. No migration, wire-format change or destructive data operation is introduced. Existing launcher files and Claude authentication are the documented leftovers; the previous code can still read the data. The rollback rehearsal passed. No additional Not run
Notes
|
fbc2de3 to
80f172a
Compare
1019d93 to
b4dba65
Compare
80f172a to
113db7f
Compare
… it with the repo's workerd The CLI resolved workerd beside its own install, so any patchy that isn't the repo's pinned one, such as a dev environment's or a global install, failed every tier 2 publish and `patchy dev` with invalid_manifest "Could not inspect the server bundle". A tier 2 repo pins the exact workerd the CLI checks for, so publish and the dev runtime now run the repo's own, as they already run its vite and tsc. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…r 2 patches have agent areas `pnpm dev up` writes two worker agent launchers beside the builder `agent`: `worker-claude`, Claude Code connecting through consent, and `worker-codex <person>`, Codex with a connection minted by `pnpm dev mcp-token`. Both start in the environment's own `workers/` folder behind the builder's guard, with a CLI state that never logs in, a temp folder per session and only the environment's door as their MCP server. Neither loads the developer's instructions, skills, plugins or config: Claude Code runs on project settings only, with ancestor instruction files excluded; Codex runs on the environment's CODEX_HOME, with the account's apps and plugins off, and the session's temp folder as HOME, its login linked in. brightline turns its company's agent access on in its seed, once, and New Business and Spend Requests gain agent areas that keep their rules: list deals, add leads that say what happens next, move deals and add notes; list spend requests, submit ones that need no receipt, approve and reject. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…line lists continue past 50 Codex 0.163 hands token-named variables to the commands it runs and snapshots their shell to disk, so the worker's PATCHY_MCP_TOKEN reached its shell and a snapshot under CODEX_HOME for the session's life. The worker's config now excludes the variable from shell environments and turns shell snapshots off. Starting worker-codex from a shell already on the environment's CODEX_HOME no longer links its login onto itself. listDeals and listRequests read every row, count every match and return `next`, which `from` continues. The docs say Claude Code keys its sign-in by the server's name and address. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tup files An inherited SHELLOPTS=xtrace made bash print the minted token on stderr, and BASH_ENV, ENV and ZDOTDIR point shells at the developer's startup files past the session's own HOME. The launcher turns tracing off before minting and clears those variables before it starts Codex. Co-Authored-By: Claude Opus 5.5 <[email protected]>
b4dba65 to
9375347
Compare
…896) Stacked on #894 (ticket #859); merges with the rest of #833's stack, not alone. ## What changed The [skill test on the prototype](#740 (comment)) shaped `patchy-server`'s "The agent area", but it couldn't exercise the `agent/` folder, read-only actions, change keys, `patchy dev agent` or the result caps. This repeats it on the stack's own build. There were six builder runs, Claude Sonnet 5.5 and Opus 5.5 on the same three requests, and a Sonnet 5.5 worker agent used each published patch through `/mcp`. Every builder made a working agent area from the skills alone, and every worker task succeeded. Three things in the text were wrong or missing, and the skill now fixes them: - It never said publish warns when agent access is off. All six builders told their person an admin still had to turn it on, though it was already on. - The result-size facts sat at the end of a long section. One Sonnet builder read the section in pieces, stopped before them, and shipped an unpaged read. - It had dropped the spec's fact that clients decide whether to ask before a change. Closes #860 ## Look at **1. The three edits**, all in `packages/sdk/skills/patchy-server/SKILL.md` › The agent area. The section goes from 708 to 825 words. The last two rows came after acceptance (see below). The global skill and `patchy-loop` are unchanged, so `skills-lock.json` is too. | Was | Now | Why | |---|---|---| | "Agent access is a company switch, off until an admin turns it on at `<instance>/company`." | "Agent access is a company switch an admin turns on at `<instance>/company`; a publish with agent tools warns while it is off, and says nothing when it is on." | All six builders told their person that an admin had to turn agent access on, and all three Sonnet builders wrote a literal `<instance>/company`. Access was already on, and publish (`PatchesApi.agentAccessWarnings`) warns only while it is off. The fact they were missing was how to tell. | | The limits paragraph opened with "300 calls a minute … Read results over 100,000 characters are refused, so large reads need paging. The agent reads every result in full; a row result carries `id`, `createdAt` and `updatedAt` …" | Those facts now follow "The ids it holds come from earlier results or from the person." in the descriptions-and-schemas paragraph, now reading "A read result over 100,000 characters is refused, counting every row's text in full: 50 rows holding 2,000 characters of text each reach it. A read that grows with its table, in rows or in text, needs paging." The limits paragraph keeps in-flight calls, the first call's wait, `retryAfterSeconds` and change keys. | Claude Code saves a long `cat` to a file and shows only a preview. Opus read the saved file whole, but Sonnet read line ranges. `sonnet-r1` read lines 340–400 of the skill and stopped at the end of the descriptions paragraph, one paragraph before the result facts. Its `listCalls` returns up to 1,000 whole rows with no paging, at about 370 characters a row. That passes 100,000 characters at around 270 logged calls. In the prototype, a facts-only Sonnet run also returned whole rows. | | (none) | "A refusal reaches the agent with its code and details only as a `HandlerError` whose code is in `errors`; anything else a tool throws is `handler_failed`, with its message left in the patch's log." | The second acceptance's Sonnet validated with a plain `throw new Error(...)`. Its worker got a bare `handler_failed` with a correlation id instead of the entry-by-entry refusal its description promised. "Results and failures" says undeclared codes become `handler_failed`, but the agent area never said a plain throw hides its message from the agent. The other five Sonnet builds, four of mine and the first acceptance's, all used a declared `HandlerError`. The descriptions paragraph is now split in two: what an agent knows, then the build rules. | | (none) | "To agents, a query or read-only action is a read and anything else is a change, so Postgres and PostHog reads count as reads only from a read-only action. Clients decide whether to ask the person before a change, and most ask every time." | The spec's "What the skills say" lists both facts for this section, and the stack's text had dropped them; the connection-read fact survived only in "Choose a kind", where both sales builders found it. No builder tripped on their absence. It restores facts the spec requires (the connection-read half came from Sol's review). | **2. The runs.** Each run records the ticket's list. Kinds are what `open_patch` reports. Sizes are UTF-8 characters of the door's answers. | Run | Tier | Agent tools (kind) | Says what it does / changes / when it refuses | List tool | Stricter than the page, in the schema | Result sizes | `patchy dev agent` before publish | Turns · min · $ | |---|---|---|---|---|---|---|---|---| | sonnet-r1, call log | 2 from `init` | `listCalls` (read), `logCalls` (change), both re-exported from `server/` | Yes / yes / yes (`invalid_calls`: all or nothing, by position; duplicates skipped) | `logCalls`, up to 100 calls | No | `open_patch` 3.1 K; `logCalls` 57. **`listCalls` returns up to 1,000 whole rows, unpaged** | Yes: listed tools, logged a batch, sent a bad date, filtered | 34 · 2.2 · 0.46 | | sonnet-r2, loans | 2 from `init` | `listAvailableEquipment` (read), `lendEquipment` (change), its own | Yes / yes / mostly (`already_out` and the date are said; `no_such_item` isn't) | No | **Due date required**, as `YYYY-MM-DD` text; the page's is optional | `open_patch` 2.7 K; list 866 (5 whole rows); loan 296 | Yes: missing, invalid and blank dates | 35 · 2.4 · 0.52 | | sonnet-r3, sales | 2 from `init` | `salesSummary` (read), a **read-only action** re-exported from `server/` | Yes / reads only / declares `bad_range` but doesn't say when | n/a | n/a | `open_patch` 2.6 K; summary 1.5 K (top 10, fixed) | Yes: last month, last quarter, a reversed range | 33 · 3.3 · 0.56 | | opus-r1, call log | 2 from `init` | `findCustomerCalls` (read), `logCustomerCalls` (change), `updateFollowUp` (change), its own | Yes / yes / yes, with codes | `logCustomerCalls`, up to 200 calls | No | `open_patch` 7.1 K; log 506; **reads page 50 rows with a cursor**, about 23 K a page | Yes, as both viewers: a batch, its resend, bad entries, 200 calls | 64 · 5.8 · 2.64 | | opus-r2, loans | 2 from `init` | `listFreeEquipment` (read), `recordLoan` (change), its own | Yes / yes / yes, every code | No | **Due date required**, as `YYYY-MM-DD` text; also refused for agents in the shared helper | `open_patch` 2.1 K; list 471 (compact); loan 180 | Yes, as both viewers: no date, 2026-02-30, an item already out | 45 · 5.4 · 1.74 | | opus-r3, sales | 2 from `init` | `salesSummary` (read), its own **read-only action** beside the page's | Yes / "Read-only." / yes (`invalid_range`) | n/a | n/a | `open_patch` 5.9 K; summary 2.0 K (top 1–50) | Yes, as both viewers: periods, edges, bad ranges | 45 · 4.6 · 2.17 | Across runs: - **Tier.** All six ran `patchy init --tier 2` first. The prototype's Sonnet started the call log at tier 1, before the global tier line said agents need tier 2. - **`patchy dev agent`.** Every builder called its own tools before publishing. The three Opus runs also called them as the colleague. - **Asking.** No builder asked first. All six built, then listed their choices in the report. - **Change keys.** Both call logs also skip duplicate calls themselves, so a resent day is safe even with a new key. - **`ctx.agent`.** Builders tag agent writes (sonnet-r1, sonnet-r2, opus-r1, opus-r2) and log agent reads with `ctx.log` (both sales runs). - Two runs (sonnet-r2, opus-r2) also refuse `ctx.agent` in page handlers no tool exports. No agent reaches those, and Opus called it a backup. It does no harm, so I left the text alone. - opus-r1 also `ctx.log`s its own changes, which Patchy logs already. That's one run in six, against two of eight in the prototype; no edit. - **Outside this text:** - opus-r1 cast a call id read as `t.text()`; that's #832. - sonnet-r2 couldn't add rows in dev without a browser, so it never tested a successful loan. opus-r2 drove its dev page instead. **3. The worker checks.** Each was a Sonnet 5.5 worker from the environment's `worker-claude`, signed in as Ben (a member) through consent, with no built-in tools. The task named the patch. | Run | Task | Door calls | Result | |---|---|---|---| | sonnet-r1 | Log a day of 8 pasted calls | `find_patches`, `open_patch`, `change_patch` | All 8 in one `logCalls`, relative follow-ups resolved | | opus-r1 | Same | `find_patches`, `open_patch`, `change_patch` | All 8 in one `logCustomerCalls` | | sonnet-r2 | Borrow the camera until Friday; which laptops are free? | `find_patches`, `open_patch`, `read_patch`, `change_patch` | Loan due 2026-10-30, using the id from the list; three laptops named | | sonnet-r2 | Mark my camera returned | `find_patches`, `open_patch` | Declined: no tool for it, so it pointed to the page and the owner | | opus-r2 | Borrow the camera until Friday; which laptops are free? | `find_patches`, `open_patch`, `read_patch`, `change_patch` | Same as Sonnet's | | opus-r2 | Mark my camera returned | `find_patches`, `open_patch` | Declined, same as Sonnet's | | sonnet-r3 | Revenue by region in September 2026 and the top three customers | `open_patch`, `read_patch` | Matches SQL over the source exactly: $313,425.00, five regions, top three | | opus-r3 | Same | `open_patch`, `read_patch` | Same figures; also reported the refunds it left out and the pending orders it counted | Every worker needed nothing outside the door. The ids it used came from the patch's own list. It said how it read "Friday" (the 30th, a week out). Twice, Claude Code itself answered the first `open_patch` with "No such tool available" before loading the tool; that was the client, not Patchy. ## After acceptance The [first acceptance run](#896 (comment)), at df79c67, was a **FAIL**. Acceptance's Sonnet built the call log's read as up to 200 whole rows with no cursor, and its handler accepts summaries of up to 2,000 characters. With 58 such valid calls the read was `too_large` (120,012 characters). 95ea886 then made two facts concrete: that the cap counts every row's text, with 50 rows of 2,000 characters reaching it, and that publish says nothing when access is on. Sonnet ran request 1 twice more on that text: - **retest-a** stopped before building. It saw the signed-in account's email, which Claude Code puts in its context, differ from the CLI's login, and started a login handoff. That came from the launcher's environment, not the text. - **retest-b** read the whole agent area and built `findCalls`: the newest 100 whole rows with no cursor, summaries capped at 1,000 characters, and "Returns at most 100." in its description. After 300 realistic calls (about 100-character summaries), the read returned 100 rows in 38,684 characters. At 100 summaries near their 1,000-character maximum it would pass 100,000. On access, it said publish gave no warning, "so it may already be on". Stating the facts doesn't get Sonnet to size a read for its longest valid rows. The chief of staff's call, which Allison can overturn, is that the text stays facts with no recipe sentence. Builder reads that pass the cap under worst-case rows are a known limitation tracked in #897, with the candidate fixes listed there. The [second acceptance](#896 (comment)), at 95ea886, was also a **FAIL**, on a different defect in its Sonnet call log. Validation used a plain `throw`, so a worker sending an impossible date got `handler_failed` and a correlation id, not the refusal the description promised. The `too_large` check passed as the #897 limitation: the refusal named the cap and the owner, and said paging is the fix. Everything else passed, including the worker tasks, change keys, consent and endings, the access switch and the rehearsal. The refusal fact above is the fix. The [third acceptance](#896 (comment)), at 0ce7c1c, is a **PASS with notes**. It classified each defect in a generated patch as a fact gap in the text or a builder slip despite the fact. It found no fact gap and no Patchy defect. Sonnet's batch mutation now refuses a bad date with its declared code (`invalid_call`, `from: patch`, with the entry's index and reason). The builder slips it noted: - Sonnet's read is still unpaged, which is #897. Patchy's `too_large` names the cap and the owner, and says paging is the fix. - Sonnet's batch mutation returns every inserted row. Sixty calls with 2,000-character summaries passed the 64 KiB mutation-result limit the skill states, and failed as `handler_failed`. Batches of 20 succeeded. - Sonnet still told its person an admin had to turn access on, though its publish showed no warning. ## How it was verified **Method.** Both phases ran on this branch at 33b5445, with each model on a fresh `pnpm dev up` (`team`, so no other company's patches beside them). Ada (admin) turned agent access on and connected `postgres/orders`. That's a throwaway database in a non-production Neon project: 40 invented customers and 1,500 invented orders, read through a new read-only role. The instance accepts only public TLS sources, so a local Postgres couldn't stand in. - **Builders.** `<env>/agent -p --model claude-{sonnet,opus}-5-5 --no-session-persistence "<request>"`. That's the launcher's isolation from #829 (no ancestor instruction files, no memory, `--strict-mcp-config`). A probe found only the workspace's `CLAUDE.md`, the Patchy skill and Claude Code's built-in skills. To match the prototype, I added its extra allowed commands: `cd`, `cp`, `mv`, `curl`, `echo`, `sleep`, `timeout`, `chromium`, `python3` and `sed`. Two builders ran at a time, R1 and R2 together, then R3. - **Requests**, the prototype's own minus "in this folder", since the workspace's `CLAUDE.md` says where: 1. "Make a patch where our team logs customer calls: who called, the customer company, a short summary and a follow-up date. People's agents should be able to log calls for them; they'll often paste in a whole day of call notes at once. Publish it when it works." 2. "Make a small patch for equipment loans. People borrow laptops, cameras and mics and give them back. Our agents should be able to see what's free and record a loan for their person, but an agent must always give a due date, which people can leave blank. Only a person can mark something returned. Publish it when it works." 3. "Make a patch that summarises our sales from the company's order database: revenue by region and by product for a date range, and the top customers. People's agents should be able to get the same summary for their person, say for last month or a quarter. Publish it when it works." - **Seeding.** Before each loans worker check, I added the prototype's five items through the patch's own page as Ada. - **Sizes.** `open_patch` was recorded through the door with a minted connection. - **Aborted run.** The first sonnet-r3 run was stopped partway when the machine was needed for a demo, then rerun from scratch. The aborted run published nothing. **Safety.** - Every publish went to the local instance. - **`~/Patchy` and `~/.patchy`.** I checked both before the first run and around each run. Each run's before and after listing of `~/Patchy` (outside `node_modules`) matched. - Over the whole session, one new repo bound to production appeared, and `~/.patchy`'s skill copy was rewritten. Both happened at 01:10–01:14, during the pause for the demo, while none of my runs was going. - TypeScript's files inside `~/Patchy`'s `node_modules` changed size during one run. They are hard links into the shared pnpm store, which another install's Effect language-service patch rewrote. - **Neon.** The Neon database and role were dropped at the end, and the catalogue shows neither. - **Transcripts.** Claude Code put the signed-in account's email in builders' and workers' context, and several repeated it. Nothing here quotes a transcript unscrubbed. **Tests.** - `vitest run packages/limits/src/limits-md.test.ts packages/patchy/src/skillLock.test.ts` passed (the generated limits block and the global skill's lock), and so did `vitest run packages/sdk/src`, which includes generation. - Prettier passes. - `pnpm verify` passed at 50d7d63: format, lint, typecheck, synth, test, postgres-concurrency, cli-smoke, tier2-smoke and browser. 05c35d5 adds one sentence to the skill. I re-checked it with the limits and lock tests and Prettier, and CI is green on it. **Not done.** The edited text wasn't put through a second round of builders; the ticket's scale is two models × three requests. All three edits add or move facts the runs showed were missing; none removes one. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required Skill text only: the project skill a tier 2 repo gets at `init`, `refresh` and dev start. - **What does a revert leave behind?** Repos that refreshed in between keep the new text until their next refresh. - **Does the release before it still work with that?** Yes. Nothing reads the skill but agents. Built by Claude Opus 5.5 (xhigh) in Claude Code on T3 Code; reviewed and accepted by GPT-6.1-Sol (xhigh).
## 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]>
Stacked on #892 (ticket #858); merges with the rest of #833's stack, not alone.
What changed
A dev environment had only a builder agent, so trying a patch's agent area meant hand-building a client config each time, and the environment's own CLI couldn't publish a tier 2 repo at all. Now
pnpm dev upputs two worker agent launchers besideagent:worker-claude(Claude Code, connecting through consent) andworker-codex <person>(Codex, with a connection minted bypnpm dev mcp-token). Neither loads your instructions, skills, plugins or config, and both reach Patchy only through/mcp.brightlinestarts with agent access on, and New Business and Spend Requests have agent areas that keep their rules.Closes #859
Look at
1. The launchers' isolation, in
scripts/dev/src/environment.ts(writeWorkers). Both start in the environment's ownworkers/folder behind the builder's guard (PATCHY_API_URLis the instance, the shell'sPATCHY_API_TOKENis cleared) with a CLI state that never logs in and a temp folder per session.--setting-sources project, the builder'sclaudeMdExcludesfor every folder above the environment,--strict-mcp-configwith one server, auto memory off,--permission-mode default. Its sign-in can only live in your~/.claude/.credentials.json, keyed by the server's name and address, so the server name ispatchy-dev-<hash of the worktree path>: one entry per worktree address, replaced by the next sign-in there.downleaves it, because your running Claude Code sessions rewrite that file when they refresh and a second writer could drop a refresh and sign you out. DEVELOPMENT says so and how to clear it (/mcp› Clear authentication).CODEX_HOMEis the environment's, with aconfig.tomlnaming only the door and turning off the account'sapps,pluginsandremote_plugin(without that, the TUI listed my ChatGPT connectors, 217 tools, and a plugin from my account).HOMEis the session's temp folder, because Codex reads skills from~/.agents/skillswhateverCODEX_HOMEsays. Your login is linked in; Codex writesauth.jsonin place through the link (checked withcodex login --with-api-keyon a throwaway home), so a refresh lands in your one file as another session's would. The token reaches Codex's environment only: the config excludesPATCHY_MCP_TOKENfrom the commands Codex runs and turns shell snapshots off (Sol's round 1 found both leaking it; a command inside Codex printedenv | grep -c '^PATCHY_MCP_TOKEN='→ 1 before, 0 after, with no snapshot underCODEX_HOME).What Codex sees, from
worker-codex jordan debug prompt-input, which renders the model's prompt without a model call:What the Claude worker reports,
worker-claude -p --model haiku:2. The env CLI publishes tier 2, a separate commit (
fix(cli)). The CLI resolved workerd beside its own install, so the environment'sbin/patchy(and any globalpatchy) failed every tier 2 publish andpatchy dev. A tier 2 repo pins the exact workerd the CLI checks for, so publish and the dev runtime now run the repo's own, as they already run its vite and tsc.startWorkerd/Inspectiontake an optionalworkerdFrom; the server never passes it.3. brightline's agent areas reuse the patches' rules rather than restating them:
move,addNote,team.people,approveandrejectare re-exported fromserver/with descriptions added there;addLeadandsubmitRequestare tools of their own, with the shared insert moved tohelpers/leads.tsandhelpers/requests.ts.addLeadrequires a next step, which the page leaves optional;submitRequesttakes no receipt, so the patch's ownreceipt_requiredstops anything from $500.listDealsandlistRequestsanswer 50 at a time withtotalandnext, whichfromcontinues (checked with 55 requests: 50 +next50, then 5 +nextnull). The seed turns agent access on as the publisher only while nobody has touched the switch, so turning it off at Company survives restarts.Done means: Codex adds a lead to New Business through
/mcppnpm dev up brightline, then<env>/worker-codex jordan exec --skip-git-repo-check --json -c '…change_patch.approval_mode="approve"' "Add a lead to New Business: Lumen Labs wants a website refresh, a referral from their CEO. Next step: intro call on Tuesday. Leave the value and owner empty." < /dev/null. Results cut.The patch's log, as its owner (
patchy logs --limit 2in the repo):A patch rule, met through the door (Codex as Jordan, "move the Lumen Labs website refresh to Proposal"):
Interactive too:
worker-codex marcus, then "Which deals are in Negotiation in New Business?" calledfind_patches,open_patchandread_patch, and/mcplisted onlypatchy-dev-04bc0nand Codex's built-incodex_worktrees.Done means: the Claude Code launcher connects through consent
<env>/worker-claude --model haikuin a terminal,/mcp›patchy-dev-04bc0n› Authenticate. Its browser URL was answered as Jordan in a throwaway Playwright browser (personas sign-in, then Allow):How it was verified
~/Patchy. Over all the runs above:~/Patchy's listing is unchanged;~/.codex/config.tomland~/.codex/AGENTS.mdhash the same and~/.claude/settings.jsonand~/.claude/CLAUDE.mdkeep their mtimes; no token-shaped string (pw[ar]_…) appears anywhere in the environment folder or.local/dev,dev.logincluded; no Codex or Claude process with the environment's paths outlived its session. What the runs did add outside the environment: Claude Code'spatchy-dev-04bc0nsign-in in~/.claude/.credentials.json, and its trust of<env>/workersin~/.claude.json, both Claude Code's own writes.scripts/dev/src/environment.test.ts: the Claude launcher's guard, worker CLI state, its one server and the excludes; the Codex launcher mints for the named person in this worktree, hands the token only to Codex (the launcher prints nothing of it), runs on its ownCODEX_HOMEandHOME, links your login, drops a stale link when you have none and leaves the login alone when started from a shell already on that home, writes the door, the apps/plugins switches, the snapshot switch and the token's shell exclusion intoconfig.toml, and starts no Codex when minting fails.scripts/dev/src/scenario.test.ts: seeding brightline turns agent access on as the publisher, and a later off survives a reseed. Red without each half of the seed change.packages/execution/src/Inspection.test.ts: inspection runs the workerd where it's told, and refuses one of another version found there. Red with the resolver reverted.handlers.pnpm verifyon 33b5445: everything passed excepttest/browser-tier1/csv.spec.ts(instance-side inspection timed out at load ~15); it passed alone, and CI'sbrowserjob passed on the same head.vitest run scripts/dev packages/execution/src/Inspection.test.ts packages/patchy/src/devServerWatch.test.ts, 104 passed; turbo typecheck of execution, the CLI and the dev runner;tsc -p tsconfig.test.json; eslint and prettier on the changed files.applyDevSeed, which this doesn't touch; the scenario seed isn't part of it.Release impact
Dev tooling, scenario data and docs, plus one CLI fix: a
patchyinstalled outside a tier 2 repo now builds it with the repo's pinned workerd instead of failing. No schema, API or wire change.up; Claude Code sign-ins already made stay in that developer's credentials file, harmless. A global CLI goes back to refusing tier 2 repos.Built by Claude Opus 5.5 (xhigh) in Claude Code on T3 Code; reviewed and accepted by GPT-6.1-Sol (xhigh).