Skip to content

fix(codegen): read Attio's description and sample what its fake must answer - #642

Merged
leemour merged 3 commits into
mainfrom
fix/attio-pilot-gaps
Nov 17, 2026
Merged

leemour merged 3 commits into
mainfrom
fix/attio-pilot-gaps

Conversation

@leemour

@leemour leemour commented Nov 17, 2026

Copy link
Copy Markdown
Member

Task

The Attio pilot (attio-cli, the first CLI built only from wirecat.config.ts) could not generate from Attio's OpenAPI description, and its tests failed against fakeApi.

Why

  • Generation stopped on prefixItems, an allOf of two unions and minProperties/maxProperties, and on a name clash between a PUT on a collection and a PUT on its item.
  • sampleOf took a union's first branch: Attio's GET /v2/self answers { active: false } first, so a sign-in check against the fake found no workspace id.
  • A string with a pattern of groups (^https:\/\/.*, ISO 8601 durations) sampled as xxxxxx, which the strict fake then refused.

What

  • sampleOf takes the union branch with the most required fields (Changed — may break callers: Notion's description samples 92 of 609 definitions differently; HubSpot, ydisk, Drive and Calendar sample as before).
  • A pattern's sample is the first of its own, common guesses and the plain string that the pattern and minLength/maxLength take.
  • The adapter reads prefixItems as a list of its places, an allOf of unions of plain values as its first member (one with an object branch is still refused), and skips the property counts.
  • A PUT on a collection beside a PUT on its item is named -upsert.

Started by the coordinator's agent (stopped on its weekly limit), finished and reviewed by the Attio pilot session. Reviewed by a fresh agent; its findings (object unions, length bounds, the . atom test, the changelog heading) are fixed in ed42864.

Testing

  • pnpm test: 1256 passed; lint, typecheck, docs:check clean.
  • Attio's description, unpatched, generates 108 operations with no problem.
  • attio-cli on this branch plus the matching cli-core branch: 17 failing tests → 0.

🤖 Generated with Claude Code

leemour added a commit that referenced this pull request Nov 17, 2026
…token on another host (#643)

## Why

The WordPress foundation in the CLI factory plan: WordPress application
passwords sign in by HTTP Basic. `signInPlace` returned `undefined` for
a `basic` scheme, so:

- cli-core kept its own `basicPlace` in `service-api-manifest.ts`
(cli-core #3094);
- a CLI's `fakeApi` could not check Basic, and refused every correctly
signed request with 401;
- `fakeApi`'s leak check looked for the raw token only, and a Basic
header carries it in base64, so the token sent to another host went
unnoticed.

## What

- `signInPlace` returns `Authorization: Basic <base64 of user:password>`
for a `basic` scheme and marks the place `basic: true`. Digest stays
`undefined`.
- `fakeApi` also looks for each scheme's signed value when it checks
that the token did not go to another host.
- A changelog entry under "Changed — may break callers": cli-core told
Basic apart by `undefined`. When it bumps to this version, it drops
`basicPlace` and reads `place.basic`, so that a token scheme stays first
when a call offers both.

No overlap with #642: that PR changes `sampleOf` in `fake.ts` (lines
232–280); this one changes the sign-in check (lines 360–410).

## Testing

- A new `fakeApi` test: a Basic sign-in passes, a wrong password gets
401, and the Basic header sent to another host is refused. Without the
change the first check fails with 401, and without the leak fix the
third passes through.
- Locally: typecheck, lint, docs:check, the full suite (1252 tests) and
the coverage floors pass.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
leemour and others added 3 commits November 18, 2026 00:29
…answer

- sampleOf takes the union branch with the most required fields: Attio's /v2/self
  answered { active: false } first, so a sign-in check found no workspace id
- a pattern of groups, alternatives or a wildcard gets a sample it takes
- prefixItems as a list of its places, an allOf of unions as its first member,
  and min/maxProperties skipped: each stopped generation
- a PUT on a collection beside a PUT on its item is named -upsert

Started by the coordinator's agent, finished by the Attio pilot session
(FIND-2749, FIND-2750, FIND-2751, FIND-2752).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…amples keep length bounds

- the allOf-of-unions shortcut applies only when no branch holds an object, a ref or
  an allOf: a value may need fields from two unions, which the first alone refuses
- a pattern's sample is the first of the pattern's own, common guesses and the plain
  string that the pattern and minLength/maxLength take
- a test for the . atom and for length bounds; the union choice moves to Changed, with
  its reach on Notion's description

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@leemour
leemour force-pushed the fix/attio-pilot-gaps branch from ed42864 to 56a7830 Compare November 17, 2026 23:37
@leemour
leemour merged commit ac15d9c into main Nov 17, 2026
10 checks passed
@leemour
leemour deleted the fix/attio-pilot-gaps branch November 17, 2026 23:39
@leemour leemour mentioned this pull request Nov 17, 2026
leemour added a commit that referenced this pull request Nov 17, 2026
Carries #642 (Attio: union samples, pattern samples, prefixItems, allOf
of unions, upsert), #643 (Basic sign-in) and #644 (tracker nouns).
Minor: the Unreleased section has Added and Changed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant