Repository navigation
feat(integrations): Attio connections with a read-only workspace key - #967
Conversation
…empty client The contract #966 builds on. `AttioSnapshot` keeps a workspace's objects and lists by slug and id, each attribute's type, cardinality, reference targets and active options, and what discovery left out and why. `attio` joins the integrations, the declaration and generated-metadata schemas, publish's declaration checks and the CLI (`attio(handle)`, `patchy add attio/<handle>`, `patchy list connections`). Generation writes an empty client and a context naming every object, list and attribute. Discovery's bounds and Attio's admission join the limits registry. The connection pages and admin actions for Attio are placeholders until the key check, discovery and the picked page design land. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ycle The Attio source checks a key at `/v2/self` and fails closed: it must be active, a workspace token, hold every read scope Patchy needs and no `:read-write` scope. Discovery reads every object, list and attribute, then select and status options while it has budget, marking the rest. Every bound refuses the moment it's passed; one gate per workspace sits inside one for all of Attio. In the store, connect, Test, Refresh, Replace key and Reconnect run the check. A check that finds the stored key can write disconnects the connection as Disconnect does, naming the scopes and the admin, unless a newer key replaced it meanwhile. Replace key refuses another workspace's key and saves its key and snapshot together or not at all. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`pnpm test:attio` reads Patchy's probe workspace with its read-only key (`ATTIO_TEST_READ_KEY`): the key check, discovery within its bounds and deadline, and Replace key with the same key through the store. A case about a custom object skips when the workspace's plan has none. The harness paces itself to about 20 requests a second and sits out a 429 outside the call's deadline. It only reads, so it sweeps nothing. The `Attio live` workflow runs it on main and on this repository's pull requests that touch Attio, one run at a time and never cancelled, with Pidgeon's fork and Dependabot exclusions. `attio-live` is never a required check: offline tests carry correctness, and this tier only catches Attio drifting. Pidgeon's live config and harness now name only Pidgeon's files. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The connect page is the shared form inside its walkthrough: which scopes to set to Read, never Read-write, that every member reads what the key reads, and that builders' agents read the CRM while building. One submit runs the key check, which refuses under the key within a second, then discovery; a second submit by the same name while one runs is refused rather than run beside it. No script, nothing animates. The connection page names the workspace and the key's scopes, then opens with the options discovery skipped and what it left out, then each object and list as a counted row that opens to its attributes, ten of each before the rest fold. A key a check found writable stays named, with whose Test, Refresh or Reconnect found it and the way back, until Replace key or Reconnect clears it. Replace key names the workspace the new key must read. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…read key The attio scenario's connection pastes ATTIO_TEST_READ_KEY, from the environment or dev.env, into the connect page as an admin would, and skips the connection without it. It only reads, so down has nothing to take down in Attio. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…act and dev loop Connecting Attio in docs/product.md: the key check, discovery, lifecycle and admission. The Integrations glossary gains the workspace snapshot, the key check and the workspace gate. ADR-0004, the CLI README and the global patchy skill name attio/<handle>; DEVELOPMENT, the dev-loop skill and scenarios/README cover pnpm dev up attio and the live tier, which is never a required check. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each Attio discovery bound now has its own sentence, naming the object or list where it applies, rather than the registry's measure text. The attributes bound counts what a snapshot keeps; its measure no longer claims archived attributes count. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…kill Co-Authored-By: Claude Opus 5.5 <[email protected]>
…exclusions - Once a check finds the stored key can write, the disconnect runs to its end even if the request that asked goes away, so a writable key is never left connected. Asking Attio stays interruptible. - A call's byte budget is spent chunk by chunk as answers arrive, so requests collecting at once share it rather than each seeing all of it. - Discovery counts every kept object and list, every exclusion and every option list toward the snapshot's bytes as it reads them, so an archive-heavy object is refused before its next page is asked for. - An attribute exclusion names its owner by kind and slug, since an object and a list may share a slug. - Write-scope handling catches with `catchTags`, as the service conventions ask. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Independent review, round 1 (GPT 6.1 Sol, xhigh): 1 P0, 2 P1, 1 P2, 1 P3. Each finding was checked against the code; all five are real and fixed in d09bbf2.
Opus 5.5 (Claude Code) |
…es, list exclusions
- docs/API.md renders the exclusion's `in` as `{ kind, slug }`.
- Discovery's running count of the snapshot's bytes never counts more
than the snapshot holds, so a workspace that fits the 8 MiB bound is
never refused; the exact size is still checked at the end.
- The page's Left out note and `patchy list connections` mark an
attribute left out of a list, so it's never taken for an object's.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Independent review, round 2 (GPT 6.1 Sol, xhigh): 0 P0, 1 P1, 2 P2. Each was checked against the code; all three are real and fixed in 9625884.
Opus 5.5 (Claude Code) |
…connect guard - A slot is taken as Semaphore's own withPermits takes one: only the waiting can be interrupted, never the taking, so an interrupted caller never holds a workspace's or Attio's slot it won't release. - A connect claims and releases its name in one acquireUseRelease, so an interrupted connect never leaves its name reading connect_in_progress. - The Options skipped note marks a list's attributes, as Left out does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Independent review, round 3 (GPT 6.1 Sol, xhigh): 0 P0, 2 P1, 1 P2. Each was checked against the code; all three are real and fixed in 54ef343.
Both interruption races sit at a single step boundary. The new tests, "never leaves a slot held by a caller interrupted as one frees up" and "releases a connect's name however the connect is interrupted", interrupt around those boundaries many times and guard the behaviour, but neither failed on the previous code in two runs. The fixes rest on Effect's documented patterns rather than a red test. Opus 5.5 (Claude Code) |
|
Independent review, round 4 (GPT 6.1 Sol, xhigh) on 54ef343: no findings, 0 P0, 0 P1, 0 P2, 0 P3. Round 3's fixes hold, and the targeted tests, including the generated-doc and skill-lock checks, pass. Opus 5.5 (Claude Code) |
Acceptance: PASS with notesChecked Done means
{"ok":true,"alias":"crm","declaration":{"kind":"attio","handle":"crm"},"generated":["patchy/_generated/client.ts","patchy/_generated/index.json","patchy/_generated/manifest.json","patchy/_generated/context/crm.md","patchy/_generated/uses/crm.ts"],"skills":["patchy-attio"],"addedCapabilities":[],"warnings":[]}Golden journeys
Additional risks checked The focused local run covered malformed/inactive/user-level/missing/write-scope keys, discovery paging and every bound, skipped options and exclusions, deadlines, error classes and redirects, workspace/host admission and cancellation, writable-key disconnection and attribution, concurrent key replacement, failed replacement preserving the old state, and older-release/older-CLI filtering. Shared connection pages and CLI repo commands were included. Rollback answers: match the diff, and Not run
Notes
All browser tabs and the throwaway dev instance started for this run were closed/removed. The tracked checkout is unchanged. |
|
On the acceptance note: Opus 5.5 (Claude Code) |
…ers (#968) ## What changed An Attio connection gave a patch a workspace it couldn't read: the generated client was empty. Now a tier 1 page, or a tier 2 action through `ctx.connections`, reads the workspace's records, list entries and members through a client typed from the connection's snapshot: `objects.<slug>.list/get/getMany`, `lists.<slug>.list/get` and `members.list()`. Patchy builds every request from typed arguments, checks the workspace's current attributes on every call before decoding anything, and nothing can write to Attio. `patchy dev` reads the real workspace through the instance, by the snapshot the repo was generated from. Closes #966. Part of #963. Stacked on #967 (#965, Attio connections); they ship in one release. ## Look at - **The parent's journey, published and in `patchy dev`, against Patchy's probe workspace.** `pnpm dev up attio` now publishes two scenario patches over `attio/crm`. **Deal desk** (tier 1), as Priya, a member: Lead deals sorted by value, each company resolved in one `getMany` for the page; choosing an owner filters by `owner`, More deals follows `cursor`, and a deal opens with `get` and its pipeline entries by `parent`.  **Pipeline review** (tier 2) in `patchy dev`: a read-only action pages every In Progress deal through `ctx.connections` (1,219 deals, three pages of 500, read through the instance's dev door), totals them by owner and resolves the five largest deals' companies.  Probe data is synthetic ("Probe deal 0350", "Probe Co 0322"). The whole journey on a fresh instance at the head, from `pnpm dev film --after-only` (the base has no reads to film): Lead deals, then In Progress, the largest opened with its pipeline entry, the next page, then the tier 2 review (filmed at `e5780a5`, the same tree as the head before its rebase onto #967's latest). https://github.com/user-attachments/assets/e0d837af-d430-4a4b-a44f-ccbe542c4c48 - **Every row of #963's filter table is exact against Attio itself.** `AttioReads.live.ts` reads every deal, person and company unfiltered, then sends each filter as Patchy builds it, pages it to its end, and compares the ids Attio answers with the same filter evaluated locally: text (case-insensitive `eq`, `$in` too, `contains`), number, rating, checkbox (`false` matches unset), currency, date, timestamp (full ISO only), select, multiselect (has / has any), status with emoji, phone, location, record references with one target, many and several targets, actor references, personal name, email, domain and interaction, each with `null` where the table allows it. Plus option-order and descending-value sorts with empties placed as the probe says, paging with heavy ties (every deal once), the journey, `getMany` with a duplicate and a missing id, and an unknown option title refused `invalid_request` with `reason: "option"`. ``` ✓ every row of the filter table, exactly > matches deals as evaluated here, for every type, empty included ✓ every row of the filter table, exactly > matches people and companies on names, emails, domains and interactions ✓ order, paging, gets and the journey > orders by option, amount and name with empties lowest, repeating and skipping nothing ✓ order, paging, gets and the journey > walks the parent's journey: deals by stage and owner, a deal, its companies, its pipeline ✓ order, paging, gets and the journey > reads a custom object while the workspace's plan keeps them Attio live run: 733 requests, 0 rate-limited and sat out. Test Files 1 passed (1) Tests 5 passed (5) ``` The offline tests carry correctness (the live tier is never required): `Query.test.ts` pins the exact request for every row, `Values.test.ts` every type decoded filled and empty with Attio's metadata dropped, and the schema check's refusals. - **Nothing is decoded until the schema matches, and `null` is verified.** Beside its query, each call reads the object's or list's attributes with `show_archived=true` and fails `shape_mismatch` naming a snapshot attribute that's gone, archived, renamed (`renamedTo`, by id), retyped or changed between single and multi, a reference whose targets lost a snapshot object, a reference value naming an unknown object slug, or an entry under another parent. `null` on a select, status or reference reads the current options or targets first and excludes them; every returned row is then checked empty, and one that isn't fails `source_unavailable`, never a wrong answer (`Operations.test.ts`). - **Typed errors and the sentinel.** `invalid_request`, `invalid_query`, `shape_mismatch`, `not_found` and `access_denied` carry Attio's own details, narrowed with `isPatchyError(error, code, "attio")`; Postgres, PostHog and Pidgeon details narrow as before (`Generate.test.ts` compiles a consumer of each). `Runtime.test.ts` runs the journey through the runtime wire and a tier 2 action in workerd, with a sentinel in a filter value, a record value, a member email, Attio's error message and a garbled answer: none reaches `runtime_calls`, a log line or a refusal, and nor does the key. ## How it was verified - `pnpm verify` on the head, `c42462d` (rebased onto #967's `54ef343`): `PASS format, lint, typecheck, synth, test (239 files, 2,499 tests), postgres-concurrency, cli-smoke, install, tier2-smoke, browser (81)`. An earlier run failed `cli-smoke` only: the packed `patchy` declarations named `@patchy/api/attio-types`, which a patch can't resolve, so the client now carries its own copy of the type table, held to the host's by `Generate.test.ts`. - CI's `attio-live` passes on the PR with the repo secret, running `Attio.live.ts` and `AttioReads.live.ts`. - `pnpm test:attio` (`AttioReads.live.ts`) against the probe workspace with the read key: 5 of 5 passed, as above. #967's `Attio.live.ts` runs in the same tier. - Offline: the Attio files (`Query`, `Values`, `Operations`, `Generate`, `Runtime` tests, 70+ cases) cover the exact request per filter-table row; each refusal before upstream with zero requests (unknown slug, unsupported operator, refused `null`, over 100 values, date-only timestamp, foreign cursor, over 500 ids, ambiguous bare id, undeclared, public, cross-company); `getMany` with duplicates, missing ids and none (no request); every Attio refusal class (401, 403 with scope, 404, `merge_in_progress`, `standard_object_disabled`, `unknown_filter_*`, `validation_type`, malformed-query codes, 429 with `Retry-After`, 5xx, HTML 4xx/5xx, unreadable bodies); the 16 MiB raw and 8 MiB decoded bounds; a queued call whose viewer was deactivated or whose connection was disconnected sending nothing, `busy` and `timeout`. - The gateway allows Attio in actions, read-only ones included, refuses queries and mutations, and caps arguments at `runtime.attio.bytes`. The dev door decodes an older revision by its own snapshot after a Refresh, refuses a revision of another connection, and refuses a dev read without one. `patchy dev`'s tier 2 test sends the declaration's revision to the door. - Not checked here: Attio's `merge_in_progress` and interaction values are docs-only (the probe workspace has none), so they're offline only. ## Changes outside this PR's own files - `scenarios/attio/scenario.json` (#965's): `"patches": []` now lists the two patches, and `scenarios/README.md` says so. - `devPreparation.ts`: an Attio declaration needs no fixture and counts in generation's metadata, as PostHog's and Pidgeon's do. Without it `patchy dev` asked for `fixtures/shared-crm.sql`. - `DevDoor.read` takes `args: unknown`: the instance decodes them, and Attio's six dev reads share one generic sender. - `skills/patchy/SKILL.md` names Attio among the integrations dev reads live; `skills-lock.json` is refreshed. - Every integration summary that listed Postgres, PostHog and Pidgeon now names Attio where it's true (`ae01484`): `docs/product.md` (the tiers' connections, publish's accepted declarations at line 69, which is #967's behaviour, what reads live in dev and has no fixture, what counts as a read), `GLOSSARY-MAP.md`, ADR-0004's dev-read paragraph, and `patchy dev`'s missing-key refusal, since `readsLive` counts Attio. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required Additive: six runtime operations, the `@patchy/api/attio-types` subpath, three registry limits (`runtime.attio.bytes` 256 KiB, `attio.call.bytes` 16 MiB, `attio.call.concurrent` 4), an optional `revision` on a dev read's connection, a project skill and two scenario patches. Existing patches, connections and commands behave as before. - **What does a revert leave behind?** Patch versions whose generated client calls `attio.*`. No schema, no rows, and nothing in Attio: nothing is ever written there. - **Does the release before it still work with that?** No, for a patch whose current version calls `attio.*`: the release before has no Attio operations, so that patch fails until we roll forward. It ignores everything else, and it hides Attio connections, as #967 set up. Hence `one-way`. #967 is the same boundary (the release before can't read an Attio connection or its declarations) and should carry the label too; this PR and #967 ship in one release. Made by Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, running in T3 Code. --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
## What changed This PR adds release 21's What's new entry, written from `f30d8fe`. It covers everything merged since release 20's `through` (`c5175bd`), and sets the `patchy` release to `0.21.0` in `packages/patchy/package.json` and `CURRENT_RELEASE`. With this release, patches can read a company's Attio CRM through a read-only connection. | Change | PRs | | --- | --- | | New: Patches can read your Attio CRM | #967, #968 | | Behind the scenes: Patchy refuses an Attio key that can change anything, and stops using a connected key that later gains that power | #967 | One merged PR gets no line: #962 is release 20's own entry. ## Look at - **The entry**, at the top of `releases` in `packages/core/src/whatsNew.ts`. "Integrations" is the sidebar's own label. "Read-only key" matches the connect page's walkthrough. - **Rollback safety, from the live commit `a4df431` (release 20) to `f30d8fe`.** Both PRs in the range are labelled `one-way`: - **#967 (connections).** Release 20 hides Attio connections, as #657 set up. But it can't decode a patch version that declares `kind: "attio"`, so such a patch needs this release to serve. - **#968 (reads).** Release 20 has no `attio.*` operations, so a patch whose version calls them fails until we roll forward. - Neither PR has a migration or infrastructure change. `rollback-rehearsal` passed on both landed heads. **Rollback line:** Rolling back past #967 would break any patch whose current version declares or reads Attio, because release 20 can't read an Attio declaration or serve its reads, so fix forward instead. Until a published patch version declares Attio, rolling back to `a4df431` (release 20) is safe. ## How it was verified - **Tests.** `whatsNew.test.ts`, `WhatsNewPages.test.ts` and `schemas.test.ts` pass (21 tests). Typecheck passes for core, api and the CLI, and prettier passes on the changed files. - **The stack.** - #967 had four GPT 6.1 Sol review rounds, the last clean, and #968 had two. - Each got an acceptance verdict of PASS with notes on its accepted head, and landed with all 23 checks passing, `attio-live` and `rollback-rehearsal` included. - #968's rebase onto main left its tree byte-identical to the accepted head, and `main`'s tree at `f30d8fe` is identical to it. - **Deploy state.** The live commit, pinned from `/healthz/deep`, is `a4df431` (release 20). 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. The `0.21.0` bump tells CLIs and patch repos installed before this deploy to upgrade, as every release does. - **What does a revert leave behind?** Nothing: no rows, no schema. - **Does the release before it still work with that?** Yes. Made by Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, running in T3 Code. Co-authored-by: Claude Opus 5.5 <[email protected]>
…1266) ## What changed Plenty of companies keep their mail with a plain hosting provider: an IMAP mailbox with a username and password, and no Google or Microsoft API. Patchy had no way to connect one. Now an admin connects a mailbox by its server, port, username and password. Patchy logs in once on a fresh session to check it, keeps the mailbox's folders, and refuses a mailbox that falls short by naming the requirement it misses. A builder runs `patchy add imap/<handle>` and gets the declaration and a context listing the folders. Patches can't read mail through it yet. That's #1262 (reads) and #1264 (attachments), stacked on this branch; all three ship in one release. Part of #1250. Closes #1251. ## Look at **The pages: mock A, trimmed to match the other integrations** (Allison's pick from the [mocks](https://post.patchyhq.com/d/b7f3rv4gdtx0)). They are the shared connect frame and the shared connection page that Postgres, PostHog and Attio use, with IMAP filling in only its own words and fields. There's no new layout and no new component. The connect page is the shared walkthrough. It shows what a mailbox needs, then the login, then how to use it. Port and security are one choice, because the security follows the port. A short Company-wide access note sits beside the fields:  A failed Test re-renders the form with the refusal under its field, keeping everything typed except the password. A certificate that doesn't name the host lists the names it does carry:  The connected page shows the server and username, the folder count and first folders, and recent calls:  **A refused password pauses the connection.** The page keeps a notice with the two ways out, Replace password and Test again, and a Paused tag. The connection counts under Needs attention on the index:   <details><summary>The way out: the shared Replace password page, then the resumed connection</summary>   </details> **Two fixes on the shared connection page, for every integration.** - The recent-calls table clipped its Outcome column at desktop width: six columns with a 720px minimum sat in the roughly 620px beside the facts. Recent calls now span the page below the reads and the facts. Before and after, on the same page at 1280px:  - The intro above recent calls was Postgres's wording on every page. Each integration now says what its calls keep and never keep. IMAP's: "Each call keeps its operation, who made it, when, how long it took and how much it read; subjects, bodies, addresses and search values are never logged." **The transport** (`imap/Source.ts`, `imap/Network.ts`): - The host resolves, and every address must be public. - The session dials only the checked address. - TLS 1.2 or later is verified against the typed host, with SNI. - Port 993 is TLS and 143 requires STARTTLS; any other port is refused. - CAPABILITY must name IMAP4rev1 or IMAP4rev2 and allow a password login before the password is sent. - A `PREAUTH` greeting is refused, since the password would never be checked. - Referrals are never followed. Test names each failure: the name doesn't resolve, a private address, the port, TLS, an untrusted certificate, a certificate for another name, no STARTTLS, not IMAP4, login disabled, no password asked, the credentials refused, or no INBOX. **The login pause** (`SqlConnectionStore.ts`): - Only a `NO` to `LOGIN` or `AUTHENTICATE` pauses, coded `AUTHENTICATIONFAILED`, `AUTHORIZATIONFAILED`, `EXPIRED` or uncoded. ImapFlow's `authenticationFailed` is never read. - The pause is recorded on the connection's row, so no host process logs in with it until an admin's Test, Replace password or Reconnect works. - A refusal that lands after a later login of the same password worked and was saved pauses nothing. - `patchy list connections` marks a paused mailbox, with the way out instead of an add hint. **Loopback mailboxes are a layer, never configuration.** `apps/server/src/start.ts` launches with production's network. The dev runner's own entrypoint, `scripts/dev/src/server.ts`, launches with the loopback one for its local mailboxes. ## How it was verified | Done means (#1251) | Shown by | | --- | --- | | An admin connects a mailbox on Dovecot or GreenMail by host, port, security, username and password | `pnpm test:imap` connects, tests, refreshes and deletes a mailbox on Dovecot over TLS and STARTTLS, and on GreenMail (5 passed, about 18 s). `pnpm dev up imap` connects one through the connect page above, in a browser | | A mailbox that misses a requirement fails its Test, which names it | Offline over a scripted IMAP server on loopback (`imap/Source.test.ts`, Node and Bun): every refusal before login with nothing sent, DNS rebinding, a certificate for another name with its names listed, an untrusted CA, a TLS 1.1 server, 143 without STARTTLS, `PREAUTH`, no IMAP4, login disabled, no INBOX, parser and byte bounds. Live: 143 on GreenMail, a certificate for another name, and a wrong password on both servers | | A wrong password pauses the connection until it's replaced, without further logins | `imap/Connections.test.ts`: a refused login pauses, and a second process neither hands out the password nor logs in. Replace password and Test unpause it. `NO [UNAVAILABLE]`, `NO [REFERRAL]`, `BAD` and a throttle don't pause. A stale refusal after another admin's successful Test doesn't pause (red without the fix, green with it) | | `pnpm dev up imap` gives a connected local mailbox | Shown in the screenshots, which are of that environment | - `pnpm build`, `pnpm typecheck` (uncached) and `pnpm lint` passed. `pnpm check` passed format, lint, typecheck and synth; its offline tests passed except suites that fail only on this machine: - the CLI's stub-server tests, which fail from a stray `GET /` probe; - the installer tests, which can't find npm beside this machine's `node`; - one execution test under load. Each passed rerun alone except the installer's, whose files this PR doesn't touch. - The connections API lists an IMAP row only to a caller that decodes IMAP, so CLIs from before never see one. The release before IMAP's store hides IMAP rows. - The screenshots are `pnpm dev shot` and Playwright captures of this worktree's `imap` environment, which holds scenario data only. `pnpm dev compare` can't show them, because main has no IMAP pages and the pause needs a refused login. Before and after for the calls table are the same page before and after the fix commit. At phone width the table scrolls inside its wrapper, as before. - `pnpm verify` ran locally at `0084d76`: format, lint, typecheck, synth, postgres-concurrency, tier2-smoke and browser passed. test, test (bun), cli-smoke and install failed for this machine's reasons: - the CLI suites hit the stray `GET /` probe, and a Supervisor test timed out under load; - test (bun) passed all 2,596 tests, and its 3 errors are that probe's empty body; - cli-smoke and install fail because this machine's `node` has no npm beside it. CI passes all four on its runners. - Not checked: a real public mail host, and a pause on a real server (the test servers keep one password). - Locally, `pnpm dev up` fails to install the environment's CLI because the repo-pinned npm 12 refuses the instance's tarball (`EALLOWREMOTE`). I ran the runner directly with Bun. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required This is a new integration with no migration. The connections API adds `imap` rows only for callers that ask for them, and the new `paused` fields are optional. `DeclarationMetadata.imap` defaults to empty for older generations. **One-way: production can't roll back past this release while any patch version declares an IMAP connection.** The release before can't decode a manifest that declares `kind: "imap"`, so it can't serve those versions. The only recovery is rolling forward, as with Attio's #967. - **What does a revert leave behind?** IMAP connection and snapshot rows in the existing `connections` and `connection_snapshots` tables, each password sealed under the keyring, and any patch version that declares `imap`. Nothing in anyone's mailbox is changed. - **Does the release before it still work with that?** No, for patches whose version declares IMAP: they need this release to serve. Everything else works: the release before reads only the integrations it ships (#657), so IMAP rows stay hidden from its pages, CLI and lookups. Rolling back past this PR would break any patch version that declares `imap`, so fix forward instead. ## Review Grok 4.7 reviewed the backend at `a4deaa8` and found no P1s. Its three P2s are fixed in `08626e4`: a stale refusal could re-pause after a success, the CLI hid a pause, and `PREAUTH` skipped the login. Grok then reviewed the pages at `0084d76`: no P1s and no UI-consistency findings. Its one P2 is fixed in `f9897e7`: a posted security that disagreed with the port answered 422 with no visible error, because the form has no security control. The refusal now sits under Port, and a page test covers it (red without the fix). Built by Claude Opus 5.5 in Claude Code, reviewed by Grok 4.7. --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
What changed
Companies keep their customers, deals and pipelines in Attio, and Patchy had no way to connect it. Now an admin pastes a read-only Attio access token and Patchy checks it, reads the workspace's objects, lists and attributes, and keeps that shape. A key that can write is refused, naming the scope. A builder runs
patchy add attio/crmand gets the declaration and a context listing every object, list and attribute. Patches can't read records yet: that's #966, built on this branch's first commit, and the two ship in one release.Closes #965. Part of #963.
Look at
The connection page, direction A (Allison's pick from the mocks). It opens with the options discovery skipped and what it left out, then each object and list as a counted row that opens to its attributes. Ten rows show per group and the rest fold behind "N more". Captured over the offline Attio double with synthetic data, the
dealsrow opened:A key that gained a write scope. Test, Refresh and Reconnect each run the key check. When it finds the stored key can write, the connection is disconnected exactly as Disconnect does it, unless a concurrent Replace key already saved a newer key. The page keeps naming the scope, whose check found it and when, and the way back:
Refusals at the key field: a write scope on connect, a key from another workspace on Replace key
The key check fails closed (
attio/Source.ts).GET /v2/selfmust answer an active workspace token holding Records, Object configuration, List entries, List configuration and User management at Read, with no:read-writescope and a workspace id. Extra read scopes are accepted. Each refusal names what to change. A deleted key answers like an unknown one (#964's last checks), so both read as "Attio doesn't know this key".Discovery reads every object, list and attribute (
show_archived=true, so archived attributes can be named), then select and status options while it has budget: 45 s or 2,000 requests. It marks the attributes it skipped and never drops one. Every bound in the limits registry refuses the moment it's passed, saving nothing. Connect is one submit: the check refuses within a second, then discovery runs for at most 60 s. A second submit by the same name while one runs is refused,connect_in_progress.Admission. At most 4 calls and discoveries per workspace per process, shared by every connection to it, inside 6 for all of Attio.
AttioSource.sendandwithSlotare what #966's runtime calls use. Peak memory with all 6 slots at their worst (five calls each collecting and decoding a 16 MiB answer, beside a discovery producing a 7 MiB, 50,000-attribute snapshot) was 292, 353 and 293 MiB above baseline over three runs. That's under the 512 MiB the parent sets, so the host bound stays at 6.The live tier never blocks a merge.
pnpm test:attioreads Patchy's probe workspace with the read-only key. TheAttio liveworkflow runs it on main and on this repository's PRs that touch Attio, queued and never cancelled, with Pidgeon's fork and Dependabot exclusions.attio-liveis informational and not meant to be required. The case about a custom object skips once the workspace drops to Attio's Free plan. Pidgeon's live config and harness now name only Pidgeon's files (harness.ts→pidgeonHarness.ts).patchy add attio/crmin apnpm dev up attioenvironmentHow it was verified
attio/crmwithPatchy readand sees its objects and listspnpm dev up attioconnected it through the connect page in a browser: 7 objects, 7 lists, 373 attributes, one archived attribute named. Live: "replaces a connection's key with the same key"Patchy setupandPatchy bareare refused, naming the scopesattio/Source.test.ts,attio/Connections.test.ts). The setup key never ran anywherepatchy add attio/crmand gets the declaration and context filecliRepo.test.ts"adds an Attio declaration with its context and skill, and removes them again"pnpm verify: all passed (format, lint, typecheck, synth, 2,438 tests, postgres-concurrency, cli-smoke, install, tier2-smoke, browser).pnpm test:attiowith the read key: 4 passed in 19 s, 234 requests, none rate-limited. Making the custom-object case look for a missing object skips it rather than failing.test/attio.ts, hand-written in the probe's shapes):busyacross two keys to one workspace;/v2/selfwithin seconds; a deleted key reads as unknown).Release impact
New integration, no migration. The
connectionsAPI addsattiorows only for callers that ask for them, andDeclarationMetadata.attiodefaults to empty for older generations. It ships in one release with #966 and isn't deployed alone.One-way: production can't roll back past this release while any patch version declares an Attio connection. The release before can't decode a manifest that declares
kind: "attio", so it can't serve those patch versions. The only recovery is rolling forward to this release or later (docs/OPERATIONS.md› Rolling back), as with Pidgeon's #921.connectionsandconnection_snapshotstables, each connection's read-only key encrypted under the keyring, and any patch version that declares an Attio connection. Nothing is created or changed in anyone's Attio workspace.patchy list connections, lookups and deletion checks, and its CLIs never ask for them. Tests run that release's integration list against an Attio row, and an older CLI's integration filter against the API. Rolling back is safe only while no published patch version declares Attio.Built by Claude Opus 5.5 (
claude-opus-5-5) in Claude Code, through T3 Code.Before and after, as Ada Park (admin)
Before is
a4df431(where this branch left main) and after is61594b0(feat/attio-connections), both on theteamscenario, frompnpm dev compare./company/connections/connect1280px, after
1280px, before
/company/connections/connect/attio1280px, after
1280px, before
Failed to load resource: the server responded with a status of 404 (Not Found).Failed to load resource: the server responded with a status of 404 (Not Found).