Repository navigation
feat(integrations): patches read Attio records, list entries and members - #968
Conversation
d420928 to
d747d0f
Compare
|
Review round 1 (GPT 6.1 Sol, xhigh, on
|
|
Review round 2 (GPT 6.1 Sol, xhigh, on
No P0 or P1 remain, which ends the review rounds. |
e5780a5 to
c42462d
Compare
Acceptance: PASS with notesChecked I read the previous acceptance (comment 6460726690 on Done means — checked myself on this head
CI on this head: CI run · Attio-live run · Failed Node 22 job Done means and golden journeys — relied on earlier acceptance evidence The previous verdict checked the summaries delta at
Retained evidence from full acceptance at c42462dPublished tier 1: Dev tier 1: Published tier 2: Dev tier 2: Rollback answers: Still match the diff and existing Not run again
Notes
The PR's code, branch, body and labels were left unchanged; nothing was merged. |
An Attio connection's generated client was empty. Patches now read the workspace through a client typed from the connection's snapshot, on a tier 1 page and in tier 2 actions: `objects.<slug>.list/get/getMany`, `lists.<slug>.list/get` and `members.list()`, as six runtime operations (`attio.listRecords`, `getRecord`, `getManyRecords`, `listEntries`, `getEntry`, `listMembers`). Patchy builds every request from typed arguments and the snapshot, per #963's filter table, and refuses before Attio sees anything what doesn't fit. One type table (`@patchy/api/attio-types`) drives the client's types, filter building and decoding. Every call reads the object's or list's current attributes beside its query and fails `shape_mismatch` naming a changed attribute before decoding anything; `null` is checked on every row returned. Cursors bind the call; `getMany` sends one chunked `$or` and answers in the order asked. Refusals carry Patchy's own details, never a supplied value or Attio's words, and narrow with `isPatchyError(error, code, "attio")`. `patchy dev` reads the real workspace through the instance's dev door, carrying the revision the repo was generated from. The `patchy-attio` skill, the docs and the `attio` scenario's Deal desk and Pipeline review patches follow. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ming @patchy/api The package's declarations keep @patchy/api external, so the client carries its own copy of Attio's type table; the generation test holds it to @patchy/api/attio-types. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… unknown codes, empty getMany - getMany counts each asked id's row, duplicates included, against the decoded bound before building the answer, so one large record asked 500 times is refused, not expanded. - Recent calls record only the object or list an operation names, shaped as a slug; members record none, and an email or a value is never kept. - invalid_query repeats only Attio codes Patchy knows; any other is "unknown", so nothing else from Attio's body reaches a refusal. - getMany with no ids still checks the connection, sending nothing. - A reference with no targets in the snapshot takes no bare id in the generated types, as the host refuses one. - A test holds a call's parallel requests to one 16 MiB raw budget. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- A reference whose record id isn't Attio's UUID fails shape_mismatch naming the attribute, not a generic source_unavailable at encoding. - The scenario's Deal desk resolves only the companies each page brings, so paging never asks getMany for more than a page's, and drops an older request's answer when the filters changed meanwhile. Co-Authored-By: Claude Opus 5.5 <[email protected]>
docs/product.md, GLOSSARY-MAP.md and ADR-0004 named Postgres, PostHog and Pidgeon where Attio now belongs: the tiers' connections, publish's accepted declarations, what reads live in dev and has no fixture, what counts as a read, and the handlers Integrations supplies. patchy dev's refusal for a missing machine key names Attio too, as readsLive counts it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ace key Co-Authored-By: Claude Opus 5.5 <[email protected]>
58cf60e to
c63e880
Compare
## 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]>




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/getandmembers.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 devreads 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 attionow publishes two scenario patches overattio/crm. Deal desk (tier 1), as Priya, a member: Lead deals sorted by value, each company resolved in onegetManyfor the page; choosing an owner filters byowner, More deals followscursor, and a deal opens withgetand its pipeline entries byparent.Pipeline review (tier 2) in
patchy dev: a read-only action pages every In Progress deal throughctx.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 ate5780a5, the same tree as the head before its rebase onto feat(integrations): Attio connections with a read-only workspace key #967's latest).attio-journey.mp4
Every row of integrations: Attio, so patches read a company's CRM #963's filter table is exact against Attio itself.
AttioReads.live.tsreads 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-insensitiveeq,$intoo,contains), number, rating, checkbox (falsematches 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 withnullwhere 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,getManywith a duplicate and a missing id, and an unknown option title refusedinvalid_requestwithreason: "option".The offline tests carry correctness (the live tier is never required):
Query.test.tspins the exact request for every row,Values.test.tsevery type decoded filled and empty with Attio's metadata dropped, and the schema check's refusals.Nothing is decoded until the schema matches, and
nullis verified. Beside its query, each call reads the object's or list's attributes withshow_archived=trueand failsshape_mismatchnaming 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.nullon 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 failssource_unavailable, never a wrong answer (Operations.test.ts).Typed errors and the sentinel.
invalid_request,invalid_query,shape_mismatch,not_foundandaccess_deniedcarry Attio's own details, narrowed withisPatchyError(error, code, "attio"); Postgres, PostHog and Pidgeon details narrow as before (Generate.test.tscompiles a consumer of each).Runtime.test.tsruns 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 reachesruntime_calls, a log line or a refusal, and nor does the key.How it was verified
pnpm verifyon the head,c42462d(rebased onto feat(integrations): Attio connections with a read-only workspace key #967's54ef343):PASS format, lint, typecheck, synth, test (239 files, 2,499 tests), postgres-concurrency, cli-smoke, install, tier2-smoke, browser (81). An earlier run failedcli-smokeonly: the packedpatchydeclarations 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 byGenerate.test.ts.attio-livepasses on the PR with the repo secret, runningAttio.live.tsandAttioReads.live.ts.pnpm test:attio(AttioReads.live.ts) against the probe workspace with the read key: 5 of 5 passed, as above. feat(integrations): Attio connections with a read-only workspace key #967'sAttio.live.tsruns in the same tier.Query,Values,Operations,Generate,Runtimetests, 70+ cases) cover the exact request per filter-table row; each refusal before upstream with zero requests (unknown slug, unsupported operator, refusednull, over 100 values, date-only timestamp, foreign cursor, over 500 ids, ambiguous bare id, undeclared, public, cross-company);getManywith 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 withRetry-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,busyandtimeout.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.merge_in_progressand 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(feat(integrations): Attio connections with a read-only workspace key #965's):"patches": []now lists the two patches, andscenarios/README.mdsays so.devPreparation.ts: an Attio declaration needs no fixture and counts in generation's metadata, as PostHog's and Pidgeon's do. Without itpatchy devasked forfixtures/shared-crm.sql.DevDoor.readtakesargs: unknown: the instance decodes them, and Attio's six dev reads share one generic sender.skills/patchy/SKILL.mdnames Attio among the integrations dev reads live;skills-lock.jsonis 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 feat(integrations): Attio connections with a read-only workspace key #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, andpatchy dev's missing-key refusal, sincereadsLivecounts Attio.Release impact
Additive: six runtime operations, the
@patchy/api/attio-typessubpath, three registry limits (runtime.attio.bytes256 KiB,attio.call.bytes16 MiB,attio.call.concurrent4), an optionalrevisionon a dev read's connection, a project skill and two scenario patches. Existing patches, connections and commands behave as before.attio.*. No schema, no rows, and nothing in Attio: nothing is ever written there.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 feat(integrations): Attio connections with a read-only workspace key #967 set up. Henceone-way. feat(integrations): Attio connections with a read-only workspace key #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 feat(integrations): Attio connections with a read-only workspace key #967 ship in one release.Made by Claude Opus 5.5 (
claude-opus-5-5) in Claude Code, running in T3 Code.