Repository navigation
feat(feedback): Patchy stores requests and feedback - #1217
Conversation
b4f5880 to
cc511db
Compare
…1264) Stacked on #1262 (reads), which is stacked on #1266 (#1251's connections and pages). Review only this PR's diff. Rebased onto #1266 at `f9897e7` with #1262 at `d05caa3`; the commit ids below are the rebased ones. Rebasing added `0ac096f`: #1266 gave each integration's recent calls an intro saying what its calls keep, and IMAP's now says a stage keeps its size, never its filename or upload token. ## What changed A patch could read a company mailbox (#1262), but not keep what came attached: invoices arrive as PDFs, and a patch had no way to save one. Now a tier 2 action stages a message's attachment and adopts it into the patch's own file store, byte for byte, in `patchy dev` and published. How it works: - **`stageAttachment({ ref, part })`** answers `{ upload, size, sha256, contentType, filename }`. The part is checked against the message's current `BODYSTRUCTURE`: the wire takes numbered sections only, never `HEADER`, `TEXT` or `.MIME`, and a forwarded message's container is refused while its own parts stage. Patchy downloads the part through the call's session, under its gates, recheck and destroy rules, decoded by `BINARY` where the server offers it, in 1 MiB chunks, with ImapFlow's byte bound one past 20 MiB, so a larger part answers `too_large` and is never staged cut. - **Host staging.** The bytes stage through a new internal Files entry point, `FileStaging`, which shares the page staging route's code: the same reservation, quotas (16 uploads and 100 MiB per viewer per patch), one-hour expiry and single-use adoption. Only the Upload crosses into workerd; the action adopts it with `ctx.files.<store>.put(name, upload)`. - **Bounds.** `imap.download.chunk` (1 MiB, held within `imap.parser.literal` by a test) and `imap.attachments.concurrent` (4 per process, from download to staging) join the limits registry. - **`patchy dev`.** The dev door gets a private byte transport: the instance downloads the part and answers its bytes, at most 20 MiB, with their size and sha256. The dev daemon stages them in its local store only once they match. JSON results keep their 8 MiB bound. - **Recent calls** record a stage's size, in a new nullable `bytes` column (migration 0035), never its filename or Upload. Wide events carry `stagedBytes`. - **The `patchy-imap` skill** covers staging, names by ref and part, and the refusals, and carries one complete reference importer. That importer is word for word the `imap` scenario's (a test holds the two equal), and the live tier runs it from the skill. Part of #1250 Closes #1253 ## Look at The screenshots, the `patchy dev` runs and the saved-file digests are fresh at `0ac096f`, on a new `pnpm dev up imap` that connected the mailbox through #1266's connect form. The flags table is from the earlier run at `2173289`; nothing since changes how a download opens or fetches. ### The saved files match the source, byte for byte The `imap` scenario's invoice inbox imported INBOX through `patchy dev` and saved its attachments. Each file's sha256, as staged and as read back from the store, against the sha256 of the attachment the scenario's mail server holds: | File | Size | Source sha256 | Staged | Stored | | --- | --- | --- | --- | --- | | `factura-2026-0412.pdf` | 61 | `001d1549…ebe551e0` | same | same | | `INV-88213.pdf` | 61 | `58a4e8da…81f29230` | same | same | | `Rechnung-7731.pdf` | 54 | `d77679de…3155fc10` | same | same | ```console $ patchy dev agent importAttachments '{"folder":"INBOX","since":"2026-10-01"}' { "result": { "imported": 4, "done": true, "stopped": null }, "version": 1 } $ patchy dev agent savedAttachments { "result": [ { "filename": "Rechnung-7731.pdf", "size": 54, "file": "INBOX.1794003292/4/2", "staged": "d77679decb18a011c06bfde1c4fc170ce6059eb696b5ad7fab8c76823155fc10", "stored": "d77679decb18a011c06bfde1c4fc170ce6059eb696b5ad7fab8c76823155fc10" }, … ] } $ patchy dev agent importAttachments '{"folder":"INBOX","since":"2026-10-01"}' # again { "result": { "imported": 0, "done": true, "stopped": null }, "version": 1 } ``` The second run starts from the stored checkpoint and finds nothing new. ### Published, as a member The published patch, opened by Priya Raman, a member, after **Save attachments**. A row shows its sha256 only when the stored bytes match the staged digest:  ### Recent calls record the size, nothing else Each stage appears with its duration and size ("54 B"), from the published patch as Priya and from `patchy dev`. No filename and no Upload is kept; the sentinel test checks recent calls, logs and wide events for both.  ### Nothing on the server changed Flags read from the scenario's mail server after every download, dev and published: | UID | Subject | Flags | | --- | --- | --- | | 1 | Factura nº 2026-0412 — papel reciclado | none | | 2 | Invoice INV-88213: October freight | `\Recent` | | 3 | Reminder: INV-87760 is overdue | `\Recent` | | 4 | Rechnung 7731 für Werkzeuge | `\Seen \Recent` | Messages 1 and 2 had their attachments downloaded and are still unread; message 4 was read before any of this. ## How it was verified - **Files contract, on Postgres and PGlite.** Host staging shares the page's quota count, refuses a tier 1 version or a call with no viewer, holds the staged-file bound, adopts once, and an Upload not adopted within the hour fails `not_found`. - **Offline, over a scripted mail server.** These run there: - every byte value under base64, quoted-printable and 8bit, with and without BINARY, in chunks; - exactly the bound staged, and one byte past refused with the session destroyed; - a container, a missing part, a gone message and another connection's ref, each refused with nothing staged; - an abandoned download destroying the session; - the attachment places answering `busy`; - a quota refusal handed on, keeping the session. - **Live, on Dovecot and GreenMail** (`pnpm test:imap`, 20 tests): a PDF in base64, a CSV in quoted-printable, a text file in 8bit and a PNG inside a forwarded message, compared by sha256. On Dovecot also: exactly 20 MiB staged and one byte more refused, and 20 MiB staged through a relay adding 100 ms of round trip in about 4 seconds. - **The reference importer, live.** The live tier takes it from the skill and runs it in real workerd over real tables and files against Dovecot, through each way a run can stop: a stage refused on quota, a message expunged as its page is read, an attachment past the bound kept by name and size, a row write that fails after its file was adopted, and a restart that imports only what arrived since. - **The dev transport.** A stub instance checks that a whole transfer stages, a short or differing one stages nothing, one past the bound is refused, and an instance refusal is handed on. The real door, over a scripted mailbox, streams a part that the daemon stages, and records its size. A client that stops reading a 19 MiB body keeps the process's place until it reads. - **The sentinel** now covers filenames and Upload tokens, through the generated client. - **`flock … pnpm verify`.** Format, lint, typecheck, synth, browser, cli-smoke, install, tier2-smoke and postgres-concurrency pass. The test lanes failed locally only on suites this PR doesn't touch, for CI to settle: - the CLI stub-server suites, where the editor's port probes on this machine reach the stub; - the `Supervisor` and `LocalTaskProvider` flakes; - `RequestEvents.test.ts`, which saw one extra event line in both full local runs and passes alone 5/5. It runs nothing this PR changes, and looks like the same stray probe request. - **Not checked:** a real company mailbox. Only Dovecot, GreenMail and the dev scenario's server. ## Review Grok 4.7 reviewed `feat/imap-attachments` at `2173289`: | Finding | What happened | | --- | --- | | P1: the dev door drops the attachment place while 20 MiB is still held. The place covered only the download, and the whole buffer then sat in the response until a slow `patchy dev` client read it, letting further downloads start past the limit. | **Fixed** in `e8f5396`. The door takes the place into the request's own scope, which the server closes only once the response is written or the client goes, and streams the body 64 KiB at a time as the socket drains. A new `placeIn` takes the place and registers its release in one step. A test holds a client that stops reading a 19 MiB body: the process's one place stays taken until the body is read, then comes back. With the old code it fails. The published path already held its place through staging. | | P2: the skill's description doesn't mention attachments, so agents choosing skills by description miss them. | **Fixed** in `4e17ec3`: it now names saving attachments into the patch's own files. | **After acceptance** (`7a64558`, `f51a365`, `ea713e1`, `58258c0`): - `stagedBytes` now sums a request's successful stages instead of keeping the last download's size. - The dev daemon checks its local staging quota before asking the door, so a full quota downloads nothing. - `58258c0`: host staging takes the call's binding as an argument, fixing the runtime build's Effect check. **After the acceptance re-check** (`11b2770`, `c81c1a9`): - Each part carries `attachment`, decided once in the structure reader. It replaces the `body` flag an earlier fix added. A part is an attachment when it is attached by disposition, or when it is named and isn't a resource the body embeds (inside `multipart/related` with a Content-ID, such as a signature logo). The body, its HTML twin, the part it's encrypted in and a forwarded message's container never count; a forwarded message's own files do. `hasAttachments` is now true exactly when a part is one, so it changes #1262's reader: a forward with no files, or an HTML body with only an embedded logo, says false. - The reference importer, in the skill and the scenario, saves exactly the parts marked `attachment`. Structure tests cover each edge of the rule, and the live tier now also imports a forward (only its PDF saved, not its text or HTML) and an HTML body with an embedded logo (only its PDF saved). The scenario's mail is plain attached PDFs, so the evidence above is unchanged. - A published stage checks staging's quota before it takes a place or logs in. A test holds a full quota to no session and no FETCH, and fails without the check. A quota that others fill during the download is still handed on. **After the second re-check** (`05b56e4`, `c2186ea`): - A signed message's signature never counts. That is the second part of a `multipart/signed`, an `application/pkcs7-signature`, `application/x-pkcs7-signature` or `application/pgp-signature`, a forwarded message's too. Mail programs show it as a badge, so a signed invoice says `hasAttachments` only for what it carries, and the importer no longer saves a `smime.p7s` or `.asc`. - A part of any type other than text counts even with no filename and no disposition, unless it's a resource the body embeds. A nameless text part that isn't the body still doesn't count, so a forward's own text and HTML stay out. A PDF a scanner sends with no name is saved, its `filename` null; storage names already come from the ref and part. - Structure tests add an S/MIME-signed message with a PDF, PGP-signed ones, a forwarded signed message and a nameless PDF in `multipart/mixed` and alone, each checking that `hasAttachments` agrees. Each fails with its half of the rule taken out. The live importer adds a signed message (only its PDF saved, not `smime.p7s`) and a nameless PDF (saved, filename null). - `c2186ea`: a `message/*` part other than a forwarded message's container counts only when attached by disposition, so a bounce's delivery status and a read receipt's notification never become files; a bounced message's own PDF still counts. Structure tests cover a bounce, an internationalized bounce and a read receipt, and fail without the change. - Release impact: this PR and #1262 ship in one release, and this PR is `one-way`; see below. #1262's body says so too. **After the stack acceptance** (`a53242c`): - The reference importer passed a whole scan page, up to 100 messages, to `getMessages`, which takes 25, so any window past 25 messages was refused `invalid_request` on its first page and never imported. It now reads each page 25 refs at a time, in the skill and the scenario alike, and the skill says why beside it. The live importer test adds a folder of 130 messages, past one scan page and past 25 refs, with a PDF on every tenth. A row write on the second page fails once, the next run imports only that page, and every message is kept once with no gaps. With the old importer that test fails. On a fresh `pnpm dev up imap`, the published invoice inbox saved all six files from 34 INBOX messages as Priya, reading 25 then 9. **After the scale acceptance** (`ff525ff`): - A batch of 25 refs is bounded in refs, not bytes, so long plain-text mail could pass `getMessages`' 8 MiB answer bound, and the importer then failed on that batch on every run. It now reads a refused batch again in halves. One ref always fits, since a message's answer is at most 1 MiB, so the common case stays one call per 25 refs. The live importer test adds 25 quote-heavy exports sized from `runtime.result.bytes` (they come to 9,185,458 bytes): the batch is refused once and read in halves, and all 30 UIDs are kept once. Against the previous importer the same test is refused on that batch run after run, keeping nothing. ## Decisions worth a look - **`imap.attachments.concurrent` (4 per process).** Without it, 32 calls at once could each buffer 20 MiB, about 640 MiB. It covers download through staging (or, in dev, until the body is sent); past it a call answers `busy`. - **A part past the bound destroys its session**, since a chunk may still be in flight. That costs one login. - **The skill's `isPatchyError` line was wrong for server code.** Server bundles refuse `patchy/client`, so an action reads a refusal's `code`; the page narrows with `isPatchyError`. - **The live importer test writes its manifest by hand**, mirroring the scenario's config: `executeConfig` can't resolve `patchy/config` in the scenario folder, which has no installed packages. - **GreenMail quirks.** It drops a text part's last line break from its section, and it answers NO with a ClassCastException of its own for parts inside a forwarded message. The live test stages nested parts on Dovecot, and on GreenMail holds Patchy to relaying the refusal. ## Release impact Tick exactly one. - [x] **Breaking** — requires action from anyone already running this - [ ] **Not breaking** — no action required Upgrading needs no action: one runtime operation, a dev door route, two registry limits, a wide-event field and a nullable column, all additive. The break is the way back, so this PR is `one-way`. **Ships in the same release as #1262, with no deploy between them.** #1262's parts have no `attachment` flag, so a release with #1262 alone serves importers written against this PR parts they skip. - **What does a revert leave behind?** - Migration 0035 adds a nullable `bytes` column to `runtime_calls`, with two checks that hold for rows that never set it. Older code names its columns, never writes `bytes` and never reads it, so its rows pass the checks. - Staged uploads and adopted files are the page's own shapes. - Rolled back past both PRs, to the release before the stack, a published patch that calls the reads or `stageAttachment` keeps serving, but each call fails `access_denied` at the callback gateway. The reference importer fails before its checkpoint, and rolling forward again resumes it without a republish. - Republishing such a repo means `patchy refresh` onto the older release, whose client has no `stageAttachment`, so its typecheck fails until the call comes out. - **Does the release before it still work with that?** Not if it has #1262 without this PR. Rolling back past #1264 to a release that has #1262 alone would break importers written against this PR, the skill's reference importer among them, because that release's parts have no `attachment` flag: `if (!part.attachment) continue` skips every part, each message's row is saved without its files and the checkpoint moves past them, so rolling forward never imports them and nothing says so; fix forward instead. - **Migration id.** 0035 collides with the open PRs #1204 and #1217, which both still need renumbering past main's 0034. Whichever lands later renumbers. Built by Claude Opus 5.5 in Claude Code, reviewed by Grok 4.7. --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…nts (#1293) ## What changed This adds release 39's What's new entry, written from `17b1ad8`. It covers everything merged since release 38's `through` (`1d59c40`), and sets the `patchy` release to `0.39.0` in `packages/patchy/package.json` and `CURRENT_RELEASE`. | Change | PRs | | --- | --- | | New: Patches can read a company mailbox | #1266, #1262 | | New: Patches can keep email attachments | #1264 | | Improved: Recent calls fit a connection's page | #1266 | | Behind the scenes: a refused mailbox password pauses the connection after one try | #1266, #1262 | #1247 is release 38's own entry. The range is exactly the Email (IMAP) stack, which ships as one release. ## Look at - **The entry**, at the top of `releases` in `packages/core/src/whatsNew.ts`. - **Rollback safety, from the live commit `cbbd767` (release 38) to this PR's merge:** - **#1266 is `one-way`.** It adds the `imap` integration kind. Release 38 can't decode a manifest that declares `imap`, so after a rollback, patches published with an Email (IMAP) connection would fail. No migration. - **#1264 is `one-way`.** Its parts carry an `attachment` flag that #1262 alone doesn't have. That only matters for a rollback to a release holding #1262 without #1264, and none exists, because the three ship together here. - **#1264 adds migration `0035_runtime_calls_bytes`,** a nullable column that release 38 ignores. Its `rollback-rehearsal` check passed. - **No new configuration or infrastructure.** Hosts already allow outbound connections, so mail servers on ports 993 and 143 are reachable. - **Open PRs #1204 and #1217 also claim migration id 35.** Whichever lands next must renumber to 36; the migration ledger test fails until it does. **Rollback line:** Rolling back past #1266 would break patches that declare an Email (IMAP) connection, because release 38 can't read a manifest that declares `imap`; fix forward instead. ## How it was verified - **Tests.** The `packages/core` What's new test and the `packages/api` suites pass (69 tests). - **The range.** Each of #1266, #1262 and #1264: - had Grok 4.7 reviews, with every finding fixed or answered in writing; - had acceptance verdicts (PASS with notes), the last run end to end across the stack, with 260 messages imported, resumed and saved byte for byte against a local mail server; - had all 18 required checks green on the head it was squash-merged from. - **The stacked merges.** #1262 and #1264 were rebased onto `main` between merges. Each rebased tree was identical to the head its verdict was given on. - **Deploy state.** The live commit, pinned from `/healthz/deep`, is `cbbd767` (release 38). The Deploy run updated last succeeded, and none is unfinished. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required Text and version numbers only. Like every release, the `0.39.0` bump tells CLIs and patch repos installed before this deploy to upgrade. The release it announces is `one-way`; see the rollback line. - **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]>
cc511db to
75e1f05
Compare
…e's form (#1400) ## What changed The `rollback-rehearsal` check failed at step 3 on every PR that changes a migration. In that step, the rehearsal confirms a deactivation on the live release by pressing `form.confirmation-form`, a class the UI overhaul removed (#1354). Production moved onto the overhauled release today, so the live page no longer has that form class. The rehearsal now presses the one form that posts to the action's own address. That form exists on releases from before and after the overhaul. ## Look at `scripts/rollback-rehearsal.ts`, one selector: ```diff - await press(page, 'form.confirmation-form button[type="submit"]', `Confirming ${act}`); + await press(page, `form[method="post"][action$="/${act}"] button[type="submit"]`, `Confirming ${act}`); ``` The failure it fixes, on #1217 against live 7f93b91: ``` Step 3 of 4, the live commit (7f93b91) comes back, failed while ending credentials on the live release. Confirming deactivate: /settings/people/users/usr_env_brightline_jordan/deactivate has no single form.confirmation-form button[type="submit"]. ``` ## How it was verified The rehearsal ran locally on this branch under Node 24.20, as CI runs it: ``` Rehearsing 7f93b91 → 37309f5 → 7f93b91 → 37309f5 on one set of data. ▶ Step 1: the live commit (7f93b91) seeds the data passed in 53s ▶ Step 2: HEAD (37309f5) upgrades it passed in 30s ▶ Step 3: the live commit (7f93b91) comes back passed in 16s ▶ Step 4: HEAD (37309f5) comes back passed in 11s ``` A release from before the overhaul drew `<form class="confirmation-form" method="post" action="/company/users/<id>/<act>">`. The overhauled release draws `<form method="post" action="/settings/people/users/<id>/<act>">` through `flowPage`. The new selector matches either one, and still matches exactly one form on the page. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required CI only: a test script changes, and nothing ships. - **What does a revert leave behind?** Nothing. - **Does the release before it still work with that?** Yes. Built by Claude Opus 5.5 (xhigh) in Claude Code, orchestrated from T3 Code. Co-authored-by: Claude Opus 5.5 <[email protected]>
Requests, links, feedback, a person's list and withdrawal for the CLI, with the refusals contains_secret, invalid_text, not_found and invalid_link. docs/API.md re-rendered. Co-Authored-By: Claude Opus 5.5 <[email protected]>
packages/feedback owns the feedback schema (0034_feedback), the one service the CLI, dashboard and Patchy MCP call with the sender they authenticated, the secret check, matching by shared words, links, withdrawal, the feedback.sends.perMinute limit and the CLI's API group. Business events and the request event carry ids, never text. The read role's SQL lives in read-role.sql and read-role-drop.sql, which a test runs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…and Slack app tokens A password in a URL with an empty user name (postgres://:secret@db) or as a password query parameter is refused, placeholders aside; so are Slack's xapp- and rotating xoxe.xapp- tokens. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A cursor's time beyond Postgres's bigint or timestamp range reached the query and failed there; it is now refused as an invalid cursor first. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The audit moves into read-role-audit.sql, which the read-role test runs. Readable relations are counted with has_any_column_privilege, and column grants to PUBLIC are listed, so a column opened to PUBLIC shows up; the test grants one, sees the audit name it, and revokes it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The secret check matched a password query parameter by its literal name and stopped at `#`, so `%70assword=`, `pass%77ord=` and `password=#...` were stored. It also exempted any value that began with a placeholder, so `password=<token>hunter2` passed, while an escaped `%3Ctoken%3E` was refused. Fields are now percent-decoded before the scan, a parameter's value runs to the next `&`, and a placeholder passes only as the whole value. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…error Postgres text never stores NUL, and a query carrying one fails with 22021 instead of matching nothing. A link target, or the id given to link, unlink or withdraw, holding NUL now answers invalid_link or not_found before any query. Text fields already refuse control characters. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nded first 0034 to 0036 went to beta links, runtime call bytes and terms acceptances while this waited; the ledger applies ids above its highest and never backfills, so the store takes the next free id. Co-Authored-By: Claude Opus 5.5 <[email protected]>
75e1f05 to
77631b6
Compare
Acceptance: PASS with notesChecked Rebase: passed. Range-diff evidenceRetained independent evidence The following evidence is carried forward from comment 6795619072, checked at Prior Done means, risks, focused checks and golden journeys — retained verbatimDone means
Migration on today's main: passed The server's composed record is shared by its startup, the dev runner and the test template. The fresh server started successfully, served the API above and had both feedback tables. Its actual ledger had 37 distinct consecutive ids, 1–37, with this tail: Six focused suites passed under Node 24, one worker: These are the complete feedback service/API/read-role/secrets suites, the whole-server request-event suite and the server migration suite. They cover matching transaction rollback, ranking/status, ownership, pagination/privacy, shared send limits, secret patterns and near misses, event canaries, role audit/undo and migration allocation. Golden journeys Explicitly retain the earlier passed evidence recorded in comment 6618222217 and its predecessors. The rebase preserves the feature patches; this run repeats the migration/API boundary that new main could affect. The full journeys were not repeated locally on this head; current CI results are listed below.
Rollback answers: The additive-state answers match the diff: revert leaves the feedback schema, its rows and ledger entry Current rollback rehearsal: passed; log read. Job 130523480174 completed successfully for head The previous verdict’s deterministic selector failure is resolved by #1400; no complete rehearsal gap remains for this head. CI on the checked head Snapshot 2026-11-11 12:47 UTC: 26 passed, 0 skipped, 0 failed, 0 pending (26 reported checks). All results belong to the checked head. Passed: Current-head logs additionally show Node 22: 315 suites passed; 3,464 tests passed, 3 skipped. Bun: 298 suites passed; 3,157 tests passed, 3 skipped. Both include all 57 focused feedback service/API/read-role/secrets, request-event and migration tests; these are CI evidence, separate from the retained manual checks. Not run
Notes
No code, branch, PR body or labels were changed, and nothing was pushed or merged. No local instance was started; production and the personal CLI state were not accessed. |
Stacked on #1217; merge after it. ## What changed When an agent finds Patchy can't do something the person needs, or Patchy behaves oddly, the signal dies in that session. #1217 gave Patchy a place to store requests and feedback; this gives agents the way in. `patchy request` and `patchy feedback` send them from the CLI in one call, without prompts, and read well under `--json`. The global `patchy` skill says when to use each, and `patchy-loop` points to it. Closes #1212 Part of #1210 **How it works** - `patchy request "<what Patchy should do>" [--why "<need>"]` stores the request and **exits 0 even with matches**, since a failure exit would invite a retry and a retry is a real duplicate. `--json` is `{ ok, id, similar: [{ id, title, status, note?, link }], next }`: each match's `link` is the exact `patchy request link <id> <match-id>` command, each id one shell word, quoted when it needs it, and `next` says nothing else is required, to link only a match that fully meets the need, and, when one has shipped, to tell the person using its note. Text prints the id, then the matches. - `request link <id> <match-id> [--why]`, `request unlink <id>`, `feedback "<text>"`, `request|feedback list [--cursor]` and `request|feedback withdraw <id>` print #1217's success documents. Any text, or `--why`, may be `-` to read stdin, one per call. - Inside a patch repo a send names `patchy.json`'s patch. It is read leniently: a missing or broken `patchy.json` names none and never stops the send. - `request` and `feedback` join `CliCommand`, so the `Patchy-Cli` header records them for every subcommand (#1213 reads this to keep its hint off `feedback`). - **Checked before sending**, exit 1 with nothing sent: a request outside 3–200 characters once whitespace collapses, a why or feedback over 4,000 (the store's bounds, now exported from `@patchy/api`), stdin that isn't UTF-8 or passes the bound (reading stops there), and a path id that isn't of the shape the store mints (`SubmissionId`: `req_`/`fbk_` and 24 lowercase letters and digits). A match id rides in the body, so a general request's id stays the instance's to judge. - **Refusals** are exit 2 in the instance's words, with their `code`: `contains_secret`, `invalid_text`, `rate_limited`, `not_found`, `invalid_link`. - **Version skew.** An instance from before #1217 answers these routes with the API's catch-all 404 (`{ ok: false, error: "Not found." }`, no code). The CLI turns that into exit 2, "<instance> doesn't take requests yet." The new routes' own 404 always carries `not_found`, and ids are checked locally first, so an overlong id can't reach the router's catch-all and pass for skew. Nothing is gated on an exact release, and an older CLI simply has no such commands. - **Lost answers.** Sends never retry. A dropped connection, a 5xx, an unreadable body, a refusal status whose body doesn't decode, or any answer that isn't a decoded refusal (such as an empty 403 from a proxy) stays exit 3, and its message says the submission may have been stored and to run `patchy request list` (or `feedback list`) before sending again, instead of the usual "run the same command again". **The skill text** (`skills/patchy/SKILL.md`; its `description:` gains "or tell Patchy's team what it lacks or got wrong"): > `patchy request` and `patchy feedback` reach Patchy's team, the people who build Patchy: not the company, a patch's owner or your harness's own feedback tool. A patch's own bug, or an agent tool it lacks, goes to that patch's owner. > > - **Request** when Patchy can't do what the person needs, such as an integration, a command or an SDK capability, even after a workaround. Name the capability, not a guessed command, and put the need and its constraints in `--why`: `patchy request "Gmail integration" --why "Sales tracks replies in the pipeline patch; reading is enough" --json`. It stores the request and exits 0 with up to three `similar` requests. Run a match's `link` command, with `--why`, only when it is the same need. A shipped match's `note` says how to use it now; `next` says what is left. > - **Feedback** when Patchy did something wrong, surprising or harder than it should be. Say what you ran, what you expected and what happened: `patchy feedback "Ran patchy publish --json; expected a URL; got exit 3, then the same publish worked" --json`. > > Send once per problem, when you finish or give up, and tell the person the id. Patchy attaches the person, company, agent and CLI version; the rest is your own words about the problem. Leave out keys, connection strings, rows, file contents, other people's personal details and pasted logs. `contains_secret` names the field to rewrite. Text or `--why` of `-` reads stdin. After exit 3 the send may have been stored: check `patchy request list` or `patchy feedback list` before sending again. `withdraw <id>` deletes one. It says nothing either way about asking the person first. `patchy-loop` gains one line: "When Patchy itself can't do what the person needs, or gets something wrong, follow Requests and feedback in the global `patchy` skill, or in `node_modules/patchy/skills/patchy/SKILL.md` where that skill isn't installed." The packed `patchy` tarball carries `package/skills/patchy/SKILL.md`, so that path exists in any installed repo, a fresh clone included. ## Look at **The commands on real instances.** Before is #1217's head, whose CLI has no such commands; after is this branch. The credential in the third line is `postgres://app:[email protected]/app`; the transcript's sanitizer redacted part of it as an email address. <!-- patchy-dev:transcript:requests-and-feedback --> #### Transcript `requests-and-feedback` Before is `b4f5880` (where this branch left feedback/store) and after is `db1f7e9` (feedback/cli), both on the `team` scenario, from `pnpm dev transcript`. Each line ran in its own `bash -c` from the side's agent workspace, as the scenario's signed-in CLI, with stdin closed. Each side's origin reads `<origin>`, its environment folder `<env>`, its checkout `<checkout>` and the home folder `~`; nothing else is normalized. Redacted before writing: email addresses outside the scenarios' example domains. 9 of 9 lines changed. ##### File a request, then a similar one: the second lists the first as a match **Changed.** Before, exit 1 in 0.2 s; after, exit 0 in 0.2 s. ```console $ patchy request "Postgres connection over TLS only" --why "Our auditors want encryption in transit" Sent request req_02h4wyjsgc6dwrx3yp6u5cid to Patchy's team. Nothing else is required. ``` ```diff -DESCRIPTION - Build patch repos and publish patches to a Patchy Cloud instance. - -USAGE - patchy <subcommand> [flags] - -GLOBAL FLAGS - --help, -h Show help information - --version, -v Show version information - --wizard Start wizard mode for a command - --completions <bash|zsh|fish|powershell|sh|pwsh> Print shell completion script (choices: bash, zsh, fish, powershell, sh, pwsh) - --log-level <all|trace|debug|info|warn|warning|error|fatal|none> Sets the minimum log level (choices: all, trace, debug, info, warn, warning, error, fatal, none) - --json Print the result as one JSON document on stdout - --api-url string The Patchy Cloud instance to talk to (its API base URL) - -SUBCOMMANDS - login Log this machine in; relay the URL and code, then use --complete [code]. - logout Forget this machine's publishing key, then revoke it as a courtesy. - auth Manage CLI authentication. - whoami Check the configured Patchy Cloud credentials. @@ 14 lines cut @@ - refresh Upgrade the pinned release and refresh the managed files as one transaction. - list Discover patches, their primitives and reads, and company connections. - look Show the company's look and its history; --json includes the files' contents. - add Add members, a Postgres, PostHog, Pidgeon or Attio connection, shared-table or shared-store declaration and generate its files. - remove Remove a declaration and its unused skill, preserving fixtures. Members requires no member columns. -[stderr] -Unknown subcommand "request" for "patchy" -Unrecognized flag: --why in command patchy +Sent request req_02h4wyjsgc6dwrx3yp6u5cid to Patchy's team. +Nothing else is required. ``` _14 of 44 lines are cut from the middle. `--json` has it all._ **Changed.** Before, exit 1 in 0.2 s; after, exit 0 in 0.2 s. ```console $ patchy request "Postgres connection encrypted with RSA" --why "Our auditors require RSA" --json {"ok":true,"id":"req_8ds6nrib4mz5lwz1xyv2opse","similar":[{"id":"req_02h4wyjsgc6dwrx3yp6u5cid","title":"Postgres connection over TLS only","status":"open","link":"patchy request link req_8ds6nrib4mz5lwz1xyv2opse req_02h4wyjsgc6dwrx3yp6u5cid"}],"next":"Nothing else is required. Link a match only when it fully meets the need: run its link command, with --why saying why it does."} ``` ```diff -[stderr] -{"ok":false,"error":"Unknown subcommand \"request\" for \"patchy\"\nUnrecognized flag: --why in command patchy","kind":"local"} +{"ok":true,"id":"req_8ds6nrib4mz5lwz1xyv2opse","similar":[{"id":"req_02h4wyjsgc6dwrx3yp6u5cid","title":"Postgres connection over TLS only","status":"open","link":"patchy request link req_8ds6nrib4mz5lwz1xyv2opse req_02h4wyjsgc6dwrx3yp6u5cid"}],"next":"Nothing else is required. Link a match only when it fully meets the need: run its link command, with --why saying why it does."} ``` ##### A credential is refused, naming the field and kind, and nothing is stored **Changed.** Before, exit 1 in 0.2 s; after, exit 2 in 0.2 s. ```console $ patchy request "Postgres connection encrypted with RSA" --why "Connect with postgres://app:[redacted]/app" --json [stderr] {"ok":false,"error":"Nothing was stored: `why` holds a password in a URL. Remove it, or replace it with <token>, and send it again.","kind":"rejected","code":"contains_secret"} ``` ```diff [stderr] -{"ok":false,"error":"Unknown subcommand \"request\" for \"patchy\"\nUnrecognized flag: --why in command patchy","kind":"local"} +{"ok":false,"error":"Nothing was stored: `why` holds a password in a URL. Remove it, or replace it with <token>, and send it again.","kind":"rejected","code":"contains_secret"} ``` ##### Feedback, and a long note from stdin **Changed.** Before, exit 1 in 0.2 s; after, exit 0 in 0.2 s. ```console $ patchy feedback "Ran patchy list connections --all; expected Gmail among the offered integrations; it isn't there" --json {"ok":true,"id":"fbk_4vuob676g1anz7d8rgbq2lxq"} ``` ```diff -[stderr] -{"ok":false,"error":"Unknown subcommand \"feedback\" for \"patchy\"","kind":"local"} +{"ok":true,"id":"fbk_4vuob676g1anz7d8rgbq2lxq"} ``` **Changed.** Before, exit 1 in 0.2 s; after, exit 0 in 0.2 s. ```console $ printf 'Ran patchy publish page.html.\nExpected its URL; it printed nothing and exited 0.\n' | patchy feedback - Sent feedback fbk_hckdvf4gwzkjsf69zvprymba to Patchy's team. ``` ```diff -DESCRIPTION - Build patch repos and publish patches to a Patchy Cloud instance. - -USAGE - patchy <subcommand> [flags] - -GLOBAL FLAGS - --help, -h Show help information - --version, -v Show version information - --wizard Start wizard mode for a command - --completions <bash|zsh|fish|powershell|sh|pwsh> Print shell completion script (choices: bash, zsh, fish, powershell, sh, pwsh) - --log-level <all|trace|debug|info|warn|warning|error|fatal|none> Sets the minimum log level (choices: all, trace, debug, info, warn, warning, error, fatal, none) - --json Print the result as one JSON document on stdout - --api-url string The Patchy Cloud instance to talk to (its API base URL) - -SUBCOMMANDS - login Log this machine in; relay the URL and code, then use --complete [code]. - logout Forget this machine's publishing key, then revoke it as a courtesy. - auth Manage CLI authentication. - whoami Check the configured Patchy Cloud credentials. @@ 12 lines cut @@ - pull Copy a patch's repo into a new folder, set up to run and change: the served version, or --version. - dev Start this patch repo's local runtime over fixtures (detached and idempotent). - refresh Upgrade the pinned release and refresh the managed files as one transaction. - list Discover patches, their primitives and reads, and company connections. - look Show the company's look and its history; --json includes the files' contents. - add Add members, a Postgres, PostHog, Pidgeon or Attio connection, shared-table or shared-store declaration and generate its files. - remove Remove a declaration and its unused skill, preserving fixtures. Members requires no member columns. -[stderr] -Unknown subcommand "feedback" for "patchy" +Sent feedback fbk_hckdvf4gwzkjsf69zvprymba to Patchy's team. ``` _12 of 42 lines are cut from the middle. `--json` has it all._ ##### Link a request to its match, then unlink it **Changed.** Before, exit 1 in 0.2 s; after, exit 0 in 0.9 s. ```console $ patchy request "Calendar integration" --why "Book customer calls from the CRM" >/dev/null && r=$(patchy request "Google Calendar integration" --json) && patchy request link $(echo "$r" | jq -r .id) $(echo "$r" | jq -r '.similar[0].id') --why "Same need: any Google calendar" && patchy request unlink $(echo "$r" | jq -r .id) Linked req_7s26vb2g5y3ua90paj9dp32k to req_l0buxugz2bpcvvo00j8wjthk open Calendar integration req_7s26vb2g5y3ua90paj9dp32k has no link. ``` ```diff -[stderr] -Unknown subcommand "request" for "patchy" -Unrecognized flag: --why in command patchy +Linked req_7s26vb2g5y3ua90paj9dp32k to req_l0buxugz2bpcvvo00j8wjthk open Calendar integration +req_7s26vb2g5y3ua90paj9dp32k has no link. ``` ##### What I sent, and withdrawing one **Changed.** Before, exit 1 in 0.2 s; after, exit 0 in 0.2 s. ```console $ patchy request list req_7s26vb2g5y3ua90paj9dp32k 2026-11-03T19:22:17.553Z open Google Calendar integration (cli, unknown) req_l0buxugz2bpcvvo00j8wjthk 2026-11-03T19:22:17.339Z open Calendar integration (cli, unknown) req_8ds6nrib4mz5lwz1xyv2opse 2026-11-03T19:22:16.488Z open Postgres connection encrypted with RSA (cli, unknown) req_02h4wyjsgc6dwrx3yp6u5cid 2026-11-03T19:22:16.273Z open Postgres connection over TLS only (cli, unknown) ``` ```diff -DESCRIPTION - Build patch repos and publish patches to a Patchy Cloud instance. - -USAGE - patchy <subcommand> [flags] - -GLOBAL FLAGS - --help, -h Show help information - --version, -v Show version information - --wizard Start wizard mode for a command - --completions <bash|zsh|fish|powershell|sh|pwsh> Print shell completion script (choices: bash, zsh, fish, powershell, sh, pwsh) - --log-level <all|trace|debug|info|warn|warning|error|fatal|none> Sets the minimum log level (choices: all, trace, debug, info, warn, warning, error, fatal, none) - --json Print the result as one JSON document on stdout - --api-url string The Patchy Cloud instance to talk to (its API base URL) - -SUBCOMMANDS - login Log this machine in; relay the URL and code, then use --complete [code]. - logout Forget this machine's publishing key, then revoke it as a courtesy. - auth Manage CLI authentication. - whoami Check the configured Patchy Cloud credentials. @@ 15 lines cut @@ - list Discover patches, their primitives and reads, and company connections. - look Show the company's look and its history; --json includes the files' contents. - add Add members, a Postgres, PostHog, Pidgeon or Attio connection, shared-table or shared-store declaration and generate its files. - remove Remove a declaration and its unused skill, preserving fixtures. Members requires no member columns. -[stderr] -Unknown subcommand "request" for "patchy" +req_7s26vb2g5y3ua90paj9dp32k 2026-11-03T19:22:17.553Z open Google Calendar integration (cli, unknown) +req_l0buxugz2bpcvvo00j8wjthk 2026-11-03T19:22:17.339Z open Calendar integration (cli, unknown) +req_8ds6nrib4mz5lwz1xyv2opse 2026-11-03T19:22:16.488Z open Postgres connection encrypted with RSA (cli, unknown) +req_02h4wyjsgc6dwrx3yp6u5cid 2026-11-03T19:22:16.273Z open Postgres connection over TLS only (cli, unknown) ``` _15 of 45 lines are cut from the middle. `--json` has it all._ **Changed.** Before, exit 1 in 0.2 s; after, exit 0 in 0.2 s. ```console $ patchy feedback list --json {"submissions":[{"id":"fbk_hckdvf4gwzkjsf69zvprymba","createdAt":"2026-11-03T19:22:17.129Z","surface":"cli","agent":"unknown","kind":"feedback"},{"id":"fbk_4vuob676g1anz7d8rgbq2lxq","createdAt":"2026-11-03T19:22:16.917Z","surface":"cli","agent":"unknown","kind":"feedback"}],"nextCursor":null} ``` ```diff -[stderr] -{"ok":false,"error":"Unknown subcommand \"feedback\" for \"patchy\"","kind":"local"} +{"submissions":[{"id":"fbk_hckdvf4gwzkjsf69zvprymba","createdAt":"2026-11-03T19:22:17.129Z","surface":"cli","agent":"unknown","kind":"feedback"},{"id":"fbk_4vuob676g1anz7d8rgbq2lxq","createdAt":"2026-11-03T19:22:16.917Z","surface":"cli","agent":"unknown","kind":"feedback"}],"nextCursor":null} ``` **Changed.** Before, exit 1 in 0.4 s; after, exit 0 in 0.6 s. ```console $ id=$(patchy request "Slack integration" --json | jq -r .id) && patchy request withdraw "$id" && patchy request list --json | jq -c '[.submissions[].title]' Withdrew req_u6bexxfzgn8mq197ppu4jv5b: it is deleted. ["Google Calendar integration","Calendar integration","Postgres connection encrypted with RSA","Postgres connection over TLS only"] ``` ```diff -DESCRIPTION - Build patch repos and publish patches to a Patchy Cloud instance. - -USAGE - patchy <subcommand> [flags] - -GLOBAL FLAGS - --help, -h Show help information - --version, -v Show version information - --wizard Start wizard mode for a command - --completions <bash|zsh|fish|powershell|sh|pwsh> Print shell completion script (choices: bash, zsh, fish, powershell, sh, pwsh) - --log-level <all|trace|debug|info|warn|warning|error|fatal|none> Sets the minimum log level (choices: all, trace, debug, info, warn, warning, error, fatal, none) - --json Print the result as one JSON document on stdout - --api-url string The Patchy Cloud instance to talk to (its API base URL) - -SUBCOMMANDS - login Log this machine in; relay the URL and code, then use --complete [code]. - logout Forget this machine's publishing key, then revoke it as a courtesy. - auth Manage CLI authentication. - whoami Check the configured Patchy Cloud credentials. @@ 14 lines cut @@ - refresh Upgrade the pinned release and refresh the managed files as one transaction. - list Discover patches, their primitives and reads, and company connections. - look Show the company's look and its history; --json includes the files' contents. - add Add members, a Postgres, PostHog, Pidgeon or Attio connection, shared-table or shared-store declaration and generate its files. - remove Remove a declaration and its unused skill, preserving fixtures. Members requires no member columns. -[stderr] -{"ok":false,"error":"Unknown subcommand \"request\" for \"patchy\"","kind":"local"} -Unknown subcommand "request" for "patchy" +Withdrew req_u6bexxfzgn8mq197ppu4jv5b: it is deleted. +["Google Calendar integration","Calendar integration","Postgres connection encrypted with RSA","Postgres connection over TLS only"] ``` _14 of 44 lines are cut from the middle. `--json` has it all._ <!-- /patchy-dev:transcript:requests-and-feedback --> **Version skew, on real instances.** This branch's CLI, copied out of the build, against an instance at `main` (before, no #1217) and at this branch (after): <!-- patchy-dev:transcript:request-version-skew --> #### Transcript `request-version-skew` Before is `5bbf22a` (--base origin/main) and after is `db1f7e9` (feedback/cli), both on the `team` scenario, from `pnpm dev transcript`. Each line ran in its own `bash -c` from the side's agent workspace, as the scenario's signed-in CLI, with stdin closed. Each side's origin reads `<origin>`, its environment folder `<env>`, its checkout `<checkout>` and the home folder `~`; nothing else is normalized. Nothing in it matched a collected secret (each side's CLI state, machine-token, login-code, API-key and access-token shapes, email addresses outside the scenarios' example domains, secret-named variables, and any accounts the run acts as). 3 of 3 lines changed. ##### This branch's CLI against each side's instance: before has no requests yet **Changed.** Before, exit 2 in 0.2 s; after, exit 0 in 0.2 s. ```console $ node /tmp/patchy-cli-head/index.js request "Gmail integration" --why "Sales tracks replies in the pipeline patch" Sent request req_jgw1ulmcpwp5ntt0294qpnej to Patchy's team. Nothing else is required. ``` ```diff -[stderr] -<origin> doesn't take requests yet. +Sent request req_jgw1ulmcpwp5ntt0294qpnej to Patchy's team. +Nothing else is required. ``` **Changed.** Before, exit 2 in 0.2 s; after, exit 0 in 0.2 s. ```console $ node /tmp/patchy-cli-head/index.js feedback "Ran patchy publish; expected a URL; it printed nothing" --json {"ok":true,"id":"fbk_9ikr48k8zhc8li4vnzcxmcaj"} ``` ```diff -[stderr] -{"ok":false,"error":"<origin> doesn't take feedback yet.","kind":"rejected"} +{"ok":true,"id":"fbk_9ikr48k8zhc8li4vnzcxmcaj"} ``` **Changed.** Before, exit 2 in 0.2 s; after, exit 0 in 0.2 s. ```console $ node /tmp/patchy-cli-head/index.js request list req_jgw1ulmcpwp5ntt0294qpnej 2026-11-03T19:22:41.024Z open Gmail integration (cli, unknown) ``` ```diff -[stderr] -<origin> doesn't take requests yet. +req_jgw1ulmcpwp5ntt0294qpnej 2026-11-03T19:22:41.024Z open Gmail integration (cli, unknown) ``` <!-- /patchy-dev:transcript:request-version-skew --> **Checked before sending.** Before is this PR's head before review, `d6b8507`, which sent each of these and left the instance to answer. <!-- patchy-dev:transcript:request-local-checks --> #### Transcript `request-local-checks` Before is `d6b8507` (--base) and after is `db1f7e9` (feedback/cli), both on the `team` scenario, from `pnpm dev transcript`. Each line ran in its own `bash -c` from the side's agent workspace, as the scenario's signed-in CLI, with stdin closed. Each side's origin reads `<origin>`, its environment folder `<env>`, its checkout `<checkout>` and the home folder `~`; nothing else is normalized. Nothing in it matched a collected secret (each side's CLI state, machine-token, login-code, API-key and access-token shapes, email addresses outside the scenarios' example domains, secret-named variables, and any accounts the run acts as). 5 of 5 lines changed. ##### Checked before anything is sent: an empty request from stdin, and one over 200 characters **Changed.** Before, exit 2 in 0.2 s; after, exit 1 in 0.2 s. ```console $ printf '' | patchy request - --json [stderr] {"ok":false,"error":"The request must be 3–200 characters; it is 0. Nothing was sent.","kind":"local"} ``` ```diff [stderr] -{"ok":false,"error":"Nothing was stored: `text` must be 3–200 characters, with no control characters.","kind":"rejected","code":"invalid_text"} +{"ok":false,"error":"The request must be 3–200 characters; it is 0. Nothing was sent.","kind":"local"} ``` **Changed.** Before, exit 2 in 0.2 s; after, exit 1 in 0.2 s. ```console $ patchy request "$(head -c 201 /dev/zero | tr '\0' x)" --json [stderr] {"ok":false,"error":"The request must be 3–200 characters; it is 201. Nothing was sent.","kind":"local"} ``` ```diff [stderr] -{"ok":false,"error":"Nothing was stored: `text` must be 3–200 characters, with no control characters.","kind":"rejected","code":"invalid_text"} +{"ok":false,"error":"The request must be 3–200 characters; it is 201. Nothing was sent.","kind":"local"} ``` ##### An id the store couldn't have minted, which an instance's router also turns away **Changed.** Before, exit 2 in 0.2 s; after, exit 1 in 0.2 s. ```console $ patchy request unlink "req_$(head -c 97 /dev/zero | tr '\0' a)" --json [stderr] {"ok":false,"error":"\"req_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\" isn't a request id: those are req_ and 24 lowercase letters and digits, as patchy request list shows them. Nothing was sent.","kind":"local"} ``` ```diff [stderr] -{"ok":false,"error":"<origin> doesn't take requests yet: it runs a Patchy release from before them.","kind":"rejected"} +{"ok":false,"error":"\"req_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\" isn't a request id: those are req_ and 24 lowercase letters and digits, as patchy request list shows them. Nothing was sent.","kind":"local"} ``` ##### stdin that isn't UTF-8, and stdin past the 4,000-character bound **Changed.** Before, exit 0 in 0.2 s; after, exit 1 in 0.2 s. ```console $ printf 'Publish failed in the caf\351 patch' | patchy feedback - --json [stderr] {"ok":false,"error":"stdin isn't valid UTF-8. Nothing was sent.","kind":"local"} ``` ```diff -{"ok":true,"id":"fbk_6bqzzstyzdeirtjyz9i2vvac"} +[stderr] +{"ok":false,"error":"stdin isn't valid UTF-8. Nothing was sent.","kind":"local"} ``` **Changed.** Before, exit 2 in 0.2 s; after, exit 1 in 0.2 s. ```console $ head -c 1000000 /dev/zero | tr '\0' y | patchy feedback - --json [stderr] {"ok":false,"error":"The feedback on stdin is longer than 4,000 characters. Nothing was sent.","kind":"local"} ``` ```diff [stderr] -{"ok":false,"error":"Request body is too large.","kind":"rejected"} +{"ok":false,"error":"The feedback on stdin is longer than 4,000 characters. Nothing was sent.","kind":"local"} ``` <!-- /patchy-dev:transcript:request-local-checks --> **A fresh agent blocked on a missing integration files one request from the skill alone.** Claude Code on Sonnet 5.5, through a `team` environment's `agent` launcher at this branch's CLI and skill (no personal instructions, settings or memory), was given only: "Make us a patch that shows the sales team the latest Gmail thread with each customer, read straight from our company Gmail." It finished in 6 turns and 22 seconds: ```console Skill: patchy $ patchy status --json; patchy whoami --json; patchy list connections --all --json # exit 0 $ patchy list --json; patchy list --state retired --json # exit 0 $ patchy request "Gmail integration (read-only company mailbox)" --why "Sales team needs a patch showing the latest Gmail thread with each customer, read live from the company Gmail. Reading threads is enough; no sending needed." --json # exit 0 {"ok":true,"id":"req_jm6jklkahjk186to7k2o2ph2","similar":[],"next":"Nothing else is required."} ``` Its answer to the person, in full: > I couldn't build this patch, because Patchy has no way to read your company Gmail. > > - **Connections:** Acme Co has none connected. The only integrations on offer are Postgres, PostHog, Pidgeon and Attio, and Gmail isn't one of them. > - **Existing patches:** I checked live and retired patches, and none expose Gmail data. > > I sent Patchy's team a request for a read-only Gmail integration, saying the sales team needs the latest thread per customer. The request ID is `req_jm6jklkahjk186to7k2o2ph2`. No similar requests were open. > > I didn't build a stand-in with made-up threads, because it would look real and show sales nothing true. A published page also can't make network calls, so it couldn't read Gmail itself. > > Two ways to move forward: > 1. **Wait for the integration.** Once Gmail is connected, I can build the patch right away. It would be a tier 2 patch, with one row per customer showing the latest thread's subject, sender, date and snippet. > 2. **Use a connection you already have.** If the sales team's email already reaches Pidgeon or Attio, I can build the same view from there. Tell me if that's the case. `patchy request list` afterwards held exactly that one request, `surface: "cli"`, `agent: "claude-code"`, as the environment's publisher. One run is a smell test, not a measurement. ## How it was verified - **`packages/patchy/src/cliFeedback.test.ts`**, 18 tests through the bundled CLI against a stub instance: a filed request's `--json` and text with matches, `link` commands and `next`; none similar; the repo's patch named, and none from a broken `patchy.json`; `-` from stdin for `--why` and feedback, and refused for both at once; link, unlink and withdraw; feedback's id; `list` paging by `--cursor` and a bad cursor; `contains_secret`, `invalid_text` and `rate_limited` as exit 2 in the instance's words; `not_found` and `invalid_link`; every command against an instance from before requests (exit 2); a dropped connection, a 502, an unreadable 201, a 422 whose body isn't JSON and an empty 403 on a send (exit 3, sent once, the `list` message), the same 403 on `list` staying exit 2; link commands quoting `gen_demo; printf injected` and an id with an apostrophe, each run through `sh` as one command with the id intact; every text bound, in characters (200 emoji pass); 4,001 characters into a stdin left open ending the CLI before EOF; Latin-1 stdin refused; malformed and wrong-kind ids refused before any request, while a shapeless `gen_` match id still links. - `packages/feedback`: a new test pins minted `req_`/`fbk_` ids to `SubmissionId`; all 41 of its tests pass with the bounds moved to `@patchy/api`. - `help.test.ts` walks the new subcommands and finds every argument and flag described; `skillLock.test.ts` passes with the refreshed hash. - The transcripts and the agent run above, on real instances. - **`pnpm check`** on Node 24 at `db1f7e9`: format, lint, typecheck and synth passed; `test` failed 12 tests, all in the CLI's stub-instance files and execution's `LocalTaskProvider`/`Supervisor`. Each is a local port probe's stray request reaching a test server (an extra `GET /` or host in the request log) or a load timeout, and a different test fails on each run: `cliPublish` alone failed two different tests on each of two reruns, and `cliLook` passed both times. None of them touches requests or feedback. The focused run of the request and feedback file, the store, the API package and the CLI's `Api`, help and skillLock tests passed (162), and the request and feedback file passes 18/18 in the Bun lane too. - **`pnpm verify`** on Node 24 at the first review fixes: every stage but `test` and `test (bun)` passed, and their failures were the same probe pattern. **Not as the ticket said:** its last Done means asks for a `pnpm dev eval` run. Eval tasks are graded on what the builder publishes (`Task.target` is a new repo, page or existing patch), and this outcome publishes nothing, so it doesn't fit without a target-less task kind. `pnpm dev trial` fits, but on this machine both of its agents stopped before their first turn with "Failed to authenticate: OAuth session expired and could not be refreshed", twice: the trial passes only `CLAUDE_CONFIG_DIR`, `ANTHROPIC_API_KEY` and `CLAUDE_CODE_OAUTH_TOKEN`, and the stored Claude Code login needs a browser sign-in. So the agent run above is the by-hand route the `patchy-dev-loop` skill describes: the environment's own `agent` launcher, started headless with a closed environment holding only `PATH`, `HOME` and this session's Claude credentials. It ran at an earlier commit of this branch. Since then #1217's five server commits and the review fixes below have landed, and neither changes what that run did: its title and why are well inside the bounds now checked locally. ## Review GPT 6.1 Sol reviewed `d6b8507`. Fixed in `fa24c11` (bounds and the minted id shape move to `@patchy/api`, pinned by a store test), `28594e6` (the CLI: quoted link ids, unreadable refusals as exit 3, local text, stdin and id checks, skew wording) and `7f06333` (README and ADR-0004): 1. Link commands interpolated ids unquoted: each id is now one shell word. 2. A 422 with malformed JSON read as a refusal, exit 2: a declared status plus its decode failure is now exit 3 with the list message. An undeclared status still reads by its code, so this changes nothing for other commands. 3. Texts weren't checked and stdin wasn't bounded: both are now checked against the store's bounds, and reading stops past them. 4. A code-less 404 from an overlong id read as an old instance: path ids are checked against the minted shape first, and the skew message names no release. 5. Invalid UTF-8 on stdin was replaced and sent: it is now refused locally. Sol re-checked at `a531081` and closed 1, 3, 4 and 5. Fixed in `db1f7e9`, after rebasing onto #1217's `b4f5880`: 6. An undeclared 4xx on a send, such as an empty 403, still read as a definite refusal. Inside the send path only, any answer that isn't a decoded refusal is now exit 3 with the storage warning. Decoded refusals, the missing-routes 404, the shared classifier and every other command are unchanged. 7. The stdin bound test didn't pin where reading stops. It now writes 4,001 characters into a stdin it leaves open and expects the CLI to exit; with the bound moved to 1,000,000 it times out, and with finding 6's fix reverted the 403 case exits 2 and fails. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required Additive: new CLI commands and skill text. No route, schema or existing command changes. Against an instance without #1217 they refuse with exit 2 and say so. - **What does a revert leave behind?** Requests and feedback already sent through these commands stay in #1217's `feedback` schema, as the person's own submissions. - **Does the release before it still work with that?** Yes. #1217's service and routes own those rows; nothing here changes their shape. **Hit every surface.** These applied: - **The CLI**: commands in `packages/patchy` with their tests, `packages/patchy/README.md`, ADR-0004 (commands, `--json` shapes, refusals, the exit 3 note, version skew, and the `Patchy-Cli` header now also feeding each submission's agent and release), the global `patchy` skill and its hash in `skills-lock.json`, and `patchy-loop` under `packages/sdk/skills`. - **The wire contract**: `CliCommand` in `packages/api/src/cli.ts` gains `request` and `feedback`, and `packages/api/src/schemas.ts` now holds the store's bounds and `SubmissionId`, which `packages/feedback` uses. No route or wire shape changed, so `docs/API.md` is unchanged (its render test passes). These did not apply: migrations, vocabulary (no new term beyond #1217's glossary), served pages, the dev loop, company resources, the repo layout. Reverse states: send has `withdraw`, `link` has `unlink`. Built by Claude Opus 5.5 (xhigh) in Claude Code, orchestrated from T3 Code. --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…ing (#1276) ## What changed Speech input can fire a patch's single-key shortcuts by accident (#1224), and Patchy had nowhere to keep a person's choice to turn them off. Now each person has that setting, on by default, and there's a route to change it. Nothing reads the setting yet. The SDK half is #1274, and the shell turns it on in #1275, so this PR is safe to ship alone. - **Storage.** Migration `0038_single_key_shortcuts` adds `single_key_shortcuts boolean not null default true` to `users`. The value flows through `User`, both SQL projections (`Users`, `Companies`) and the `RequireSession` viewer, so every signed-in viewer carries `singleKeyShortcuts`. A guest is a user of their own company, so they carry their own value. - **The route.** `POST /api/me/shortcuts` sits in a new `viewer` group, next to `GET /api/me`. It takes an explicit `value=on|off`, form-encoded, never a flip. It's guarded by `RequireSession.sameOrigin` and `withViewer`, as Patchy's own forms are. A request whose `Accept` names `application/json` gets `{ value }`. A form post gets a 303 to its `return` path, or to `/` when that isn't a path on this instance, with a receipt such as "Turned off single-key shortcuts". A declared form over 4096 bytes answers 413. - **The guard.** The API guard leaves the `viewer` group out of the per-address bearer-API limit, as it already does the runtime routes. Without that, colleagues' agents sharing one office address could make the setting answer 429. The guard reads the group's routes from `PatchyApi` rather than a path literal. **The migration id is `0038`,** the next free id above `main`'s `0037_feedback` (#1217). If another migration lands first, this one renumbers, since the migrator never backfills gaps. Closes #1273 ## Look at - **Where the route lives.** It's under `/api`, so its contract is in `packages/api` and `docs/API.md`, and the shell (#1275) and `patchy dev` can take its path and shapes from one place. Its refusals are the existing HTML pages: the sign-in door (401), Request refused (403) and the deactivated page (403). They're declared as `text/html` responses, and the docs renderer now prints form bodies and HTML pages instead of "no body". - **One test file outside this PR's packages.** Three fixtures in `packages/serving/src/render.test.ts` gain `singleKeyShortcuts: true`, because `Viewer` gained a required field. The field stays required rather than optional, so nothing has to guess what a missing value means. Against a local `pnpm dev` instance, signed in as the dev persona: ``` $ curl -X POST -H "Origin: http://127.0.0.1:22334" -H "Accept: application/json" -d value=off http://127.0.0.1:22334/api/me/shortcuts {"value":"off"} 200 $ psql … -c "SELECT email, single_key_shortcuts FROM users WHERE email = '[email protected]'" [email protected]|f $ curl -i -X POST -H "Origin: http://127.0.0.1:22334" -d value=on -d return=/patches http://127.0.0.1:22334/api/me/shortcuts # a form post HTTP/1.1 303 See Other location: /patches cache-control: private, no-store set-cookie: patchy_receipt=…; Max-Age=60; Path=/; HttpOnly; SameSite=Lax [email protected]|t $ curl -s -b jar http://127.0.0.1:22334/patches | grep app-receipt # after a form post of value=off <p class="note note-ok app-receipt" role="status">Turned off single-key shortcuts</p> $ curl -X POST -H "Origin: https://elsewhere.example" -d value=off http://127.0.0.1:22334/api/me/shortcuts # another origin 403 $ curl -X POST -H "Origin: http://127.0.0.1:22334" -d value=off http://127.0.0.1:22334/api/me/shortcuts # signed out 401 [email protected]|t ``` ## How it was verified - **The route** (`packages/auth/src/ViewerApi.test.ts`), through the `viewer` group's own router: - Off, on and on again over JSON, with the stored value following each time. - A form post lands on its `return` path with a receipt, and `//elsewhere.example/`, `https://elsewhere.example/` or no `return` lands on `/`. - A POST from another origin, or with neither `Origin` nor `Sec-Fetch-Site`, is refused 403. A signed-out POST gets the 401 door. Neither changes anything. - An empty, unknown, repeated or uppercase value is refused 400, and so is a JSON body. - **Guests.** A person in a second company turns theirs off, and the first company's person stays on. `resolveViewer`, which a patch's door uses for a guest, carries the second person's off. - **On a real socket** (`apps/server/src/ApiGuard.test.ts`): after the per-address API limit is exhausted, the route still sets off and on. A declared form past 4096 bytes answers 413. - **The upgrade** (`packages/companies/src/migrations.test.ts`): on a populated database, every existing user reads `true` after 0038, deactivated users included. - `docs/API.md` was regenerated, and its drift test passes. - `pnpm format:check`, `pnpm lint`, `pnpm typecheck` and the touched vitest files pass. - `pnpm verify` ran once on this shared machine and was stopped during `tier2-smoke`, so `tier2-smoke` and `browser` didn't finish inside it. What it did run: - format, lint, typecheck, synth and `postgres-concurrency` passed. - `test` had 13 failures across 6 files, and `test (bun)` had 1. - `cli-smoke` and `install` failed. - Every failure is outside this change. Five files timed out under load: `PatchesApi`, `csv`, `devLifecycle`, Postgres `Dev` and `PgliteCompanyDatabases`. Rerun alone, all five pass (112 tests). - `sdk/install.test.ts`, `cli-smoke` and `install` fail here with "npm is not on PATH". This machine's `node` has no npm beside it, and those tests narrow PATH to Node's own directory. CI's runners aren't affected. - `pnpm test:browser` then ran on its own, and all 85 passed. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required The change is an additive column with a default, plus a new route. Nothing reads either yet. - **What does a revert leave behind?** The `single_key_shortcuts` column and whatever people stored in it. Nothing reads it. - **Does the release before it still work with that?** Yes. It never selects the column, and the migrator lets an earlier build start when a higher id is already applied. 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]>
…h's sheet or the account menu (#1301) ## What changed Speech input can type a letter that fires a patch's single-key shortcut. #1224 lets each person turn those off. #1276 stores the choice and #1279 taught `patchy/hotkeys` to obey it, but nothing passed the choice to a patch yet. Now Patchy's shell does: - it names a viewer's patch frame with their setting; - the shortcuts sheet's row opens Patchy's own dialog to change it; - the account menu gets the same switch; - a version built before the setting tells a viewer who turned shortcuts off that its shortcuts still work. This is the top of the stack `main ← #1297 ← #1255 ← #1256 ← #1279 ← #1276 ← this`, and the six land together. #1302, CI's move to desktop Chromium, waits on #1402 and lands later. It's restacked onto `main` after the UI overhaul (#1332–#1354) and the switcher (#1298, #1304), and ported to both. The restack comment says what changed beyond conflict resolution. Closes #1275 Closes #1224 ## Look at **1. The frame is named in the shell's static markup, not by a script that creates it.** A parser-created iframe gets its `name` attribute before its browsing context exists. So the server renders `name="patchy:shortcuts=on|off"` on the existing static iframe, after `main`'s `data-waiting`, and only for a company or local shell rendered for its viewer (`shell.ts`, `Pages.ts`). A public shell is everyone's document, a member's included since #1339, so it never carries one, and `renderPatchWrapper` throws if asked to. Probed before choosing, in Chromium and Firefox: | Probe, a sandboxed frame whose `src` a deferred script sets | Chromium | Firefox | | --- | --- | --- | | Static markup with `name`: first load, a reload after the value changed, back after it changed | `off`, `on`, `on` | `off`, `on`, `on` | | A `<template>` cloned by script, as the ticket's creator would | same | same | In desktop Chromium, where the frame runs in its own process, the patch reads `window.name === "patchy:shortcuts=off"` on first load and after a new version's Reload re-creates the frame. Static markup keeps three things: - **No inline script and no CSP change.** The shell still admits only the switcher relay's hash. - **Both mixed-release pairings work.** The markup is `main`'s plus one attribute (and `data-shortcuts-note`), so an older broker mounts it unchanged, and this broker mounts an older unnamed shell as before. `render.test.ts` pins that the frame differs from the unnamed one only by its name. - **Every re-creation renders again.** A new-version reload is a fresh server render. **2. Patchy's dialog** (`packages/serving/src/shortcuts.ts`), from the mock's direction C. A running patch's shell keeps its own pinned style subset on `main` (`servedStyles`; the overhaul left patch shells alone). So the dialog stays a `shell-scrim` over one `note-info` `note-float`, with `glyph-sm`, the primary button and a quiet Cancel. The setting's On or Off is a served `tag` after the question. The old `pill` isn't in that subset, and `main`'s pin test would refuse it, so it's gone. | | Desktop | Phone | | --- | --- | --- | | The sheet's row |  |  | | Patchy's dialog |  |  | | A failed save |  |  | The sheet is the SDK's, drawn in the patch's own frame by #1279, and `main` hasn't touched it. The copy and the failure pattern are as reviewed: - The title says what the switch covers: "Turn off single-key shortcuts in every patch except public ones?", or "Turn on …". The buttons are **Turn off**, **Turn on** and **Cancel**. - A refused save, a 200 without `{ value }` and an empty 200 all turn the note `note-warn`, with the alert line "Couldn't save. Nothing changed." and **Try again**. The abuse rules, each a step of the browser spec: - One dialog at a time. - A question needs `navigator.userActivation.isActive` in the shell. - However the dialog closes, it arms a flag: Turn off or Turn on, Cancel, Escape, or the browser closing it, mid-save or not. The flag holds new dialogs off until a 250 ms poll reads the old activation as lapsed. So a request on the press that answered the last dialog gets the value with no dialog, and only a fresh press opens another. - Only an `isTrusted` click saves. - Dismissing never waits. Cancel or Escape mid-save closes the dialog at once and returns focus to the frame. The save keeps the one-dialog slot until the route answers, and the operation then resolves with what the route stored, or with the setting as it was if the save failed or timed out after 35 s. - While tier 2's tools are starting, a question gets the setting as it is. - **New with the switcher:** while Patchy's switcher is open, a question also gets the setting as it is, as the starting cover waits for it. If the switcher is open over the dialog when it closes, the dialog leaves focus with the switcher, which hands it back. **3. The account menu's switch**, a no-script form in `main`'s personal menu: name, Your agents, the switch, Sign out. It posts the value it switches to, with `return` set to the page. On the overhaul's component set, the item is the switch: a `menu-item` with `role="switch"` and `aria-checked`, the `keyboard` icon, and core's `switch` drawn at its end in the item's state. Core's `fields` and `menus` chunks gained the two selectors that draw it. The account menu is 248px wide, up from 220, so the label stays on one line beside the switch. | Before | Off | After the press: the receipt, and On | | --- | --- | --- | |  |  |  | |  |  |  | "Before" is this branch's page with the switch's form removed in the browser, which is exactly `main`'s account menu. `ViewerApi.ts` reads the form before the session, so a signed-out post that names `return` goes back to that page, whose own door signs in there. **4. D1's note.** The note shows to a viewer whose setting is Off, on a version from 0.33.0 on that doesn't claim `shortcutSetting`, unless its recorded imports leave out `patchy/hotkeys`. - **Only a repo build claims `shortcutSetting: 1`** (`MANIFEST_CAPABILITIES` in `@patchy/api`). A single HTML file may carry an older SDK bundled inline, so it claims nothing. - **Recorded imports refine D1's release rule.** A repo build without `patchy/hotkeys` in `sdkImports` gets no note. A single file records no imports, so the release rule decides: from 0.33.0 on, the note shows. - The note reuses the new-version bar in the shared bottom stack: "This patch's single-key shortcuts still work until it's updated." with a quiet **Dismiss**, kept per patch in the shell's `localStorage`. | Desktop | Phone | | --- | --- | |  |  | **5. The flow**, desktop then phone. The sheet's row leads to Patchy's dialog, Turn off brings the sheet back on its row reading Off, then the account menu turns them back on. https://github.com/user-attachments/assets/d604fe56-04cd-416c-83fa-42e4beebc2f0 https://github.com/user-attachments/assets/17f547e2-472b-4c2d-90ac-98884108c875 ## How it was verified - **Unit (vitest)**, with the rest of the stack's touched files: 35 files, 330 tests, plus core's style rules, gallery and served-style pin (358 with `render.test.ts`): - `render.test.ts`: the frame's name after `data-waiting` in static markup, and that it is the only difference from an unnamed frame. A public shell refuses a viewer's setting. `ignoresShortcutSetting`'s cases. - `html.test.ts`: the account menu's switch, its value, its `return`, and escaping. - `ViewerApi.test.ts`: a signed-out form post goes back to its page. - `devServer.test.ts`: each dev person's own setting, and the route, which writes the file before it changes what shells read. - `executeConfig.test.ts`: a repo build's manifest records `shortcutSetting`. - `served-styles.test.ts`: the served styles' digest moved on purpose, for the one rule that keeps the dialog's tag whole. - **The browser tier** (`test/browser-tier1/shortcut-setting.spec.ts`): thirteen tests on published patches through the real shell and broker, as reviewed. That includes the committed 0.38 bundle (`hotkeys-0.38.html`), whose shortcuts still fire under this shell with Off stored, with no row and with the note. | Engine | Result | | --- | --- | | Desktop Chromium, `channel: "chromium"`, frame isolated, from a local config | 13 passed | | Chromium headless shell, as CI runs it | 13 passed | `hotkeys.spec.ts` and `focus.spec.ts` pass in both as well. Company patches put the setting's row first in the sheet's Tab order. The unnamed-frame test opens a public patch. - **The whole tier 1 suite** at this stack's top (`06476fe`), as `pnpm verify` runs it in CI's headless shell: 168 of 168. At the previous push, with #1302's desktop project as well, it also passed 168 of 168. - **The rollback rehearsal**, against the live release 41 (`7f93b91`): `7f93b91 → 06476fe → 7f93b91 → 06476fe`, all four steps passed in 116 s. It covers #1276's migration, and the live release serving a repo build that this head's CLI wrote with `shortcutSetting`. - `pnpm verify` at this head: format, lint, typecheck, synth, postgres-concurrency, cli-smoke, install, tier2-smoke and browser pass. `test` and `test (bun)` had 15 timeouts while the machine's load average was near 30. All 11 files rerun alone pass (216 tests), as does Bun's `PatchesApi` (63). The previous push's `pnpm verify` passed every step. The served shell's page state is exempt from the page-markup rules in `.oxlintrc.json`, and `shortcuts.ts` joins `stream-status.ts` and `downloads.ts` there for the same reason. - **Hit every surface.** - Wire contract: `docs/API.md` is regenerated and current. - CLI: README, the `patchy-hotkeys` project skill and the capability catalogue. No command, flag or exit code changed. - Dev loop: `docs/DEVELOPMENT.md` and the `patchy-dev-loop` skill. - Vocabulary: the Companies and patchy glossaries, and `docs/product.md`. - Served pages: the `ui-consistency` spec names the menu's switch, the dialog and note in the shell's exception, and `shortcuts.ts` in the lint exemption. - Reverse states: the switch turns it back on from both places. - Not applicable: migrations (#1276's), company resources and the repo layout. - **Not run on this head:** Firefox and WebKit. Firefox passed 12 of 13 before the port, the tier 2 test being Chromium-only. WebKit can't launch here, and CI has no WebKit. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required The release that carries this carries the whole stack. Nothing needs action. A viewer's shortcuts stay on until they turn them off, and patches published before it behave as they did until rebuilt. Suggested `patchChanges` line for the release, beside #1279's: > patchy/hotkeys: a viewer can now turn single-key shortcuts off. Then a page-wide hotkey whose every step types a character, such as `A`, `G H` or `?`, fires nothing, while chords, named keys and hotkeys `within` an element still fire. Label those commands so the sheet keeps them as buttons, and write a key that belongs to one part of the page `within` it. `window.name` carries the setting and is Patchy's: don't set it. Landing note: #1276's migration is `0038_single_key_shortcuts`, above #1217's `0037_feedback`. If another migration lands first, it renumbers. - **What does a revert leave behind?** - `shortcutSetting: 1` in the manifests of repo builds published meanwhile. The release before reads stored manifests without refusing extra keys, and in the rehearsal it served a version that carried the field. - People's stored settings, from #1276. - Dismissed-note keys in browsers' `localStorage`. - A CLI of this release refuses to publish to an older instance before sending anything, as any mismatched release does. - **Does the release before it still work with that?** Yes. Its shell names no frame, so every shortcut is on, the sheet hides its row, and no note shows. 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]>
…ey shortcuts (#1421) ## What changed This adds release 42's What's new entry, written from `1cd6d12`. It covers everything merged since release 41's `through` (`a25a9c5`), and sets the `patchy` release to `0.42.0` in `packages/patchy/package.json` and `CURRENT_RELEASE`. | Change | PRs | | --- | --- | | New: Tell Patchy what it's missing | #1217, #1218, #1219, #1227, #1228 | | New: Turn off single-key shortcuts | #1276, #1279, #1301 | | Fixed: Typing reaches the patch again | #1407, #1412 | | Fixed: Dialogs in patches keep your place | #1420, #1255 | | Behind the scenes: plainer facts for agents building patches | #1249, #1256, #1297, #1418 | | Behind the scenes: Patchy stores teams and audiences ahead of teams | #1416 | | Patch changes: Mod+/ and `client.close()` in patchy/hotkeys; single-key shortcuts can be off; Tab wraps in plain modal dialogs | #1279, #1301, #1420 | #1376 is release 41's own entry. #1400, #1406, #1414, #1415, #1302, #1413 and #1419 are test, CI and dev tooling and need no line. The teams bridge (#1416) ships alone in this release so teams (#1417) can follow in the next one with a release to roll back to that reads its data closed. ## Look at - **The entry**, at the top of `releases` in `packages/core/src/whatsNew.ts`. - **Rollback safety, from the live commit `7f93b91` (release 41) to this PR's merge.** No PR in the range is labelled `one-way`, and every Release impact answer says release 41 still works: - **#1217** adds migration `0037_feedback`, a schema release 41 never reads. **#1227** and **#1228** write into it. - **#1276** adds migration `0038_single_key_shortcuts`, a column with a default that release 41 never selects. - **#1416** adds migrations `0039_company_teams` to `0041_connection_audiences`, which hold tables that stay empty until teams ship, and widens one scope check. Its CI rehearsal ran `7f93b91 → head → 7f93b91 → head` on one set of data, and all four steps passed. - **#1279**, **#1301**, **#1255** and **#1420** change the SDK and the shell. Patches built on this release carry a `shortcutSetting` manifest field that release 41 reads without refusing, and its shell names no frame, so every shortcut stays on. - **#1218** and **#1219** add CLI commands and an optional `feedbackHint` in `--json` failures. A CLI from this release refuses to publish to an older instance before sending anything, as any mismatched release does. - Everything else is skill text, docs, tests and CI. If this release misbehaves, roll back to `7f93b91` (release 41). Written by Claude Opus 5.5 in Claude Code, through T3 Code. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
What changed
Patchy has nowhere to hear what people and their agents need. When an agent finds that Patchy can't do something, or Patchy behaves oddly, that signal is lost with the session. This adds the one place requests and feedback land, whichever surface sends them: a
feedbackschema in the platform database, one service every surface calls, and the CLI's API group. The CLI commands (#1212), the dashboard (#1215) and Patchy MCP'stell_patchy(#1214) are follow-up PRs built on this service. Nothing calls it yet, so it ships alone.Closes #1211
Part of #1210
How it works
packages/feedbackowns migration0037_feedback(feedback.submissionsandfeedback.general_requests), theFeedbackservice, the secret check and thefeedbackAPI group. Each adapter passes in aSender(person, company, surface, agent, and for the CLI its release and patch). The service never reads who sent something from a body. The README documents the interface for the next PRs.contains_secret, which names the field and kind, never the value. Other codes:invalid_textfor a field out of bounds;rate_limitedwithretryAfterSecondsoncefeedback.sends.perMinute(10 per person) runs out;not_foundfor a foreign id and a missing one alike;invalid_link.request.sent,request.linkedandfeedback.sent, plussubmissionIdon the request's wide event. They carry ids, surface, agent and match counts, never text.packages/feedback/read-role.sql,read-role-audit.sqlandread-role-drop.sqlare the single source for the role, its audit and its undo, run with psql.docs/OPERATIONS.mdshows how to run each, and how the team writes general requests.Look at
The AES/RSA case and the rest of Done means, as tests (
packages/feedback, 36 pass):The read role test runs
read-role.sql, signs in as the role and readsfeedback.submissions,feedback.general_requestsand a table created after the grant.users,connections,machine_tokensandpatchesare refused with SQLSTATE 42501. The test then runsread-role-audit.sql, which finds only the feedback tables. Next it grantsusers.emailto PUBLIC: the role can now read emails, and the audit lists bothpublic.usersand the PUBLIC column grant. Finally it revokes the grant. The cleanup runsread-role-drop.sql. The canary test sends a distinctive string once accepted and once refused. A whole-server test inapps/serverthen checks that the string never reaches either event stream, or stdout.Every test in the package
The API on a local instance (
pnpm dev, the dev seed's token,Patchy-Cli: 0.34.0 publish claude-code). The general request was written with psql, as OPERATIONS.md shows. This instance has one company, so the cross-company case is the test above.The request events those calls wrote carry the id and the limit's peak, never text. A grep of the dev log for the why, the link's why and the password finds none of them.
How it was verified
pnpm verify(Node 24, as CI runs it). format, lint, typecheck, synth, postgres-concurrency, cli-smoke, install, tier2-smoke and browser (82) passed.testandtest (bun)failed only where a stray localGET /reaches a test server: the CLI's stub servers, execution'sLocalTaskProviderandSupervisor, andRequestEvents. Run alone,RequestEvents.test.tspasses 12/12 in both lanes and the execution files pass 41/41. The CLI files fail in a different test on each run, each with{ method: 'GET', url: '/' }in its request log. None of these files is touched here. One real failure,scripts/labeler.test.ts, is fixed:packages/feedbacknow takesarea:server.pnpm test:rollback-rehearsal:11dc68b → 2301c59 → 11dc68b → 2301c59passed in 109s on Node 24. On this machine's Node 26, the live commit's CLI install is refused by npm 12 (EALLOWREMOTE), so the run used Node 24, which CI pins.Review (GPT 6.1 Sol at
2301c59). Four findings, fixed in43696f7,f0ec277and0cfa799:has_any_column_privilege) and lists column grants to PUBLIC.postgres://:…@db) and one passed as apassword=query parameter.xapp-and rotatingxoxe.xapp-tokens. Both are now caught.Each fix has a test that fails on the old code. After the fixes, the package passes 36 tests. In
pnpm check, format, lint, typecheck and synth pass. Its tests fail only in the files a strayGET /reaches, and the two non-CLI ones,RequestEventsandLocalTaskProvider, pass when run alone (21/21).Release impact
Additive: a new
feedbackschema with two tables and new/apiroutes nothing calls yet. No existing table, route or wire shape changes.feedbackschema and its rows, plus migration0037_feedbackin the ledger.feedbackschema references it.Migration id. The store's migration is
0037_feedback:0034to0036went to beta links, runtime call bytes and terms acceptances while this waited, and the ledger never backfills. If another migration lands first, this one takes the next free id; the record test fails on a duplicate or skipped id.Hit every surface. These applied:
packages/apigroup and schemas, server handlers,docs/API.mdre-rendered.packages/feedback/GLOSSARY.md,GLOSSARY-MAP.md,docs/product.md.packages/feedback/src/migrations.ts, composed inapps/server/src/migrations.ts.docs/limits.mdre-rendered (kept out of the patchy-server skill's table, likemcp.*), the Analytics catalogue and wide events, OPERATIONS.These did not apply: the CLI and its skills (#1212), served pages (#1215), the dev loop, company resources.
Built by Claude Opus 5.5 (xhigh) in Claude Code, orchestrated from T3 Code.