
Testing TypeScript SDK Generators for Vendor Independence After the Reported Stainless Deal
What's publicly known about the reported Anthropic–Stainless acquisition is thin. Two secondary items dated 26 November 2026 cover it: one describes the deal, the other notes that OpenAI and Google had also relied on Stainless tooling. Neither says anything about contracts, service continuity, or which generated SDKs actually exist in the wild. This is exactly the situation where teams either shrug and assume nothing changed, or panic and rewrite everything.
The defensible middle: stop arguing about ownership and start measuring how hard it would be to walk away. This guide walks you through building a small, honest test rig for TypeScript SDK generators — an OpenAPI fixture, two locally runnable generators, a loopback contract harness, a TypeScript compilation suite, an offline rebuild drill, and a replacement rehearsal driven by a real spec change. Output is a vendor-independence scorecard with pass, fail, untested, and conditional in separate columns, never rolled into an aggregate score.
The supplied material is two secondary news items. Anything below describing contracts, entitlements, or hosted-service behavior is flagged as inference or left untested on purpose.
On this page
Vendor ownership risk becomes an engineering problem when you cannot ship independently
The position: test regeneration, maintenance, and release control
A reported acquisition justifies a dependency review, not a migration. The observable facts: Wisevoter reports Anthropic acquired Stainless; The Economic Times reports OpenAI and Google also relied on the startup to connect developers to their AI services. Both dated 26 November 2026. What those reports do not establish: whether generation access changes, whether licenses change, whether support obligations transfer, whether data-handling terms change, or whether any specific customer's release pipeline is affected.
The question worth spending engineering time on is narrower and answerable: if generation stopped tomorrow, could we still build, test, patch, and publish the client we already depend on, and could we regenerate it from our own spec with an alternative tool? That splits into regeneration, maintenance, and release control — three things you can actually test on a laptop.
The evidence boundary
Worth being blunt about confirmed versus inferred here, because this topic attracts confident speculation dressed up as reporting.
| Claim | Status |
|---|---|
| Anthropic acquired Stainless | Reported by Wisevoter, 26 Nov 2026 (secondary) |
| OpenAI and Google relied on Stainless for developer integrations | Reported by The Economic Times, 26 Nov 2026 (secondary) |
| Contract terms, service continuity, license changes | Not established by supplied material |
| Affected SDK versions or generator releases | Not established |
| Data-handling or telemetry changes | Not established |
| Any customer has lost access | Not established |
No primary announcement URL was available in the supplied material. Until one is, the right engineering response is a drill, not a migration.
The walkthrough deliverable
By the end you'll have:
- a small OpenAPI 3.1 fixture that deliberately exercises the gaps generators disagree about,
- at least one locally runnable TypeScript generator producing a checked-in client,
- a loopback HTTP harness that records wire traffic and asserts behavior without depending on generated method names,
- a strict TypeScript consumer suite plus a packed-tarball install test,
- an offline rebuild drill and a regeneration-without-vendor test,
- a scorecard template where the hosted baseline can legitimately read
untested.
Separate the five vendor-independence questions before comparing generators
Five different properties get collapsed into the word "lock-in." They fail independently, so they need independent scores.
| Property | Question it answers | How you test it |
|---|---|---|
| Runtime independence | Does the shipped client need the vendor at request time? | Loopback harness with no vendor network |
| Build independence | Can you install, compile, and pack without vendor services? | Network-isolated build |
| Regeneration independence | Can you produce the next client from your spec without the vendor? | Regenerate against an alternative generator |
| Maintenance rights | May you legally modify what you have? | License inventory of generated code and transitives |
| Release control | Can you publish a version on your own schedule? | Pack and dry-run publish in team CI |
A team can have all five or two of five. The dangerous case is having runtime and build independence, feeling safe, and discovering at the next API change that regeneration depends on a hosted dashboard nobody can log into.
Map the pipeline
OpenAPI spec (you own)
-> generator configuration (you may or may not own)
-> generated source (checked in or not)
-> runtime dependencies (npm packages, some of them generator-vendored)
-> package publication (your registry, your tokens)
-> downstream applications (your adapters)
Each arrow is a potential dependency. The mistake is evaluating only the middle one.
Why owning the generated source is not enough
Three distinct traps:
- Reproduction. You can read the generated file, but reproducing it byte-for-byte may require a specific generator version, a template pack, and configuration that lives in a hosted dashboard. Without those, a "small patch" has no baseline to re-apply against.
- Modification rights. Generated source may be yours, while a runtime helper package it imports carries a different license with its own obligations and versioning.
- Next release. Even a perfectly reproducible pipeline produces nothing for a new API version if the generator that understands your new schema feature is only reachable through a vendor account.
Build a controlled workspace for evaluating TypeScript SDK generators
Repository layout
sdk-independence-lab/
spec/
jobs.openapi.yaml # the fixture, vendored and hashed
generators/
local-a/ # openapi-typescript + openapi-fetch config
local-b/ # orval config
hosted-baseline/ # placeholder; only populated with authorized access
packages/
client-a/ # generated output, checked in
client-b/
harness/
server.mjs # loopback record/replay server
fixtures.json # deterministic responses
adapters/
port.ts # application-owned interface
adapter-a.ts
adapter-b.ts
consumers/
strict-app/ # compiles against adapters, strict TS
evidence/
runs/<timestamp>/
versions.txt
The adapters/ directory is the piece most teams skip. It's also what makes cross-generator comparison meaningful, because it normalizes away generated naming.
Pin everything, including what you cannot pin
set -euo pipefail
mkdir -p evidence/runs/"$(date -u +%Y%m%dT%H%M%SZ)"
{
node --version
npm --version
echo "--- generator versions ---"
npm ls --depth=0 --json | node -e 'let s="";process.stdin.on("data",d=>s+=d).on("end",()=>{
const p=JSON.parse(s).dependencies||{};
for (const [k,v] of Object.entries(p)) console.log(k, v.version);
})'
} | tee evidence/runs/latest/versions.txtFor the hosted baseline, record whatever identifier the service exposes — tenant id, project id, generator version string, generation timestamp. If no version string exists, record that fact. "Version unknown" is a finding, not a gap to paper over.
Don't resolve versions lazily. openapi-typescript@^7 and [email protected] are different claims about reproducibility.
Compare a baseline you are allowed to compare
If your organization has an authorized Stainless tenant and a contract that permits it, generate the same fixture there and store the output under packages/client-baseline/ with the captured identifiers. If not, mark that column untested in every row and say so in the write-up. Do not reconstruct a "typical" Stainless output from blog posts and treat it as a measurement — that produces a comparison that looks empirical and isn't.
For local candidates I'm using two structurally different tools:
openapi-typescript+openapi-fetch— the first generates TypeScript types only, no runtime HTTP layer; the second is a small fetch-based client that consumes those types. Two packages, one thin runtime.orval— generates a full client from the spec with a configurable HTTP backend, so the runtime surface depends on which backend you select.
Neither choice is a recommendation. They're different enough that the harness has to work against both, which is the point.
Hosted generators frequently require uploading your OpenAPI spec. A spec is not inert: it can name internal hostnames, unreleased endpoints, auth schemes, and error taxonomies. Read the workflow before uploading, redact servers, and keep the lab fixture on loopback only.
Design an OpenAPI fixture that exposes real portability gaps
The OpenAPI fixture
Targeting OpenAPI 3.1.0 because nullable-via-type-arrays and oneOf discriminators are exactly where generators diverge.
openapi: 3.1.0
info:
title: Jobs API (lab fixture)
version: 1.0.0
servers:
- url: http://127.0.0.1:8787
security:
- bearerAuth: []
paths:
/v1/jobs:
post:
operationId: createJob
requestBody:
required: true
content:
application/json:
schema: { $ref: '#/components/schemas/CreateJobRequest' }
responses:
'201':
description: Created
content:
application/json:
schema: { $ref: '#/components/schemas/Job' }
'409': { $ref: '#/components/responses/Error' }
'429': { $ref: '#/components/responses/Error' }
get:
operationId: listJobs
parameters:
- { name: cursor, in: query, schema: { type: string } }
- { name: limit, in: query, schema: { type: integer, minimum: 1, maximum: 100, default: 20 } }
responses:
'200':
description: Page
content:
application/json:
schema: { $ref: '#/components/schemas/JobPage' }
/v1/jobs/{jobId}:
get:
operationId: getJob
parameters:
- name: jobId
in: path
required: true
schema: { type: string, format: uuid }
responses:
'200':
description: Job
content:
application/json:
schema: { $ref: '#/components/schemas/Job' }
'404': { $ref: '#/components/responses/Error' }
/v1/jobs/{jobId}/events:
get:
operationId: streamJobEvents
parameters:
- name: jobId
in: path
required: true
schema: { type: string, format: uuid }
responses:
'200':
description: Server-sent event stream
content:
text/event-stream:
schema: { type: string }
components:
securitySchemes:
bearerAuth: { type: http, scheme: bearer }
responses:
Error:
description: Structured error
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
schemas:
CreateJobRequest:
type: object
required: [name]
properties:
name: { type: string, minLength: 1 }
note: { type: string } # optional, not nullable
tags: { type: array, items: { type: string } }
Job:
type: object
required: [id, status, result]
properties:
id: { type: string, format: uuid }
status: { type: string, enum: [queued, running, done] }
note: { type: ['string', 'null'] } # nullable, always present
result:
oneOf:
- $ref: '#/components/schemas/CompletedResult'
- $ref: '#/components/schemas/FailedResult'
discriminator:
propertyName: kind
mapping:
completed: '#/components/schemas/CompletedResult'
failed: '#/components/schemas/FailedResult'
CompletedResult:
type: object
required: [kind, outputUrl]
properties:
kind: { const: completed }
outputUrl: { type: string, format: uri }
FailedResult:
type: object
required: [kind, reason]
properties:
kind: { const: failed }
reason: { type: string }
JobPage:
type: object
required: [items, nextCursor]
properties:
items: { type: array, items: { $ref: '#/components/schemas/Job' } }
nextCursor: { type: ['string', 'null'] }
Error:
type: object
required: [code, message, requestId]
properties:
code: { type: string }
message: { type: string }
requestId: { type: string }
details: { type: ['object', 'null'] }
The deliberate pressure points: note appears twice with different nullability (optional-and-not-nullable on the request, required-and-nullable on the response); result is a discriminated union with const discriminators; nextCursor is required-but-nullable, the pagination shape most often generated as string | undefined that silently breaks a "keep paging until falsy" loop.
Where OpenAPI stops and configuration begins
The streaming endpoint describes a text/event-stream response and nothing else. OpenAPI 3.1 has no vocabulary for SSE framing, event names, id: fields, reconnection semantics, or Last-Event-ID replay. Everything about turning a byte stream into discrete events lives outside the spec and therefore outside portability: some generators produce nothing at all for text/event-stream, some produce an AsyncIterable behind a non-default option, some require a handwritten helper over the raw response.
That's a real finding, not an annoyance. A capability that requires generator-specific configuration is a migration cost. Record it in the scorecard as capability: streaming with the exact mechanism.
Freeze semantics, not signatures
Write the expected HTTP behavior down before looking at any generated code:
| ID | Expectation |
|---|---|
| W1 | POST /v1/jobs sends Authorization: Bearer <dummy> and content-type: application/json |
| W2 | GET /v1/jobs sends cursor only when provided, limit as decimal integer |
| W3 | GET /v1/jobs/{id} percent-encodes the path segment |
| W4 | 429 response body is parseable by the caller without an unhandled exception |
| W5 | nextCursor: null terminates pagination; nextCursor: "c2" continues |
| S1 | Stream delivers two completed events then closes cleanly |
| S2 | Aborting mid-stream rejects or ends iteration, not hangs |
Application-visible semantics (W1–W5, S1–S2) hold across generators. Method names, Promise<Response> vs Promise<Data>, and file layout do not.
Generate TypeScript clients and capture a reproducible baseline
Commands and hashes
set -euo pipefail
RUN="evidence/runs/$(date -u +%Y%m%dT%H%M%SZ)"
mkdir -p "$RUN"
sha256sum spec/jobs.openapi.yaml | tee "$RUN/spec.sha256"
sha256sum generators/local-a/*.json generators/local-b/*.ts | tee "$RUN/config.sha256"
rm -rf packages/client-a packages/client-b
npx --no-install openapi-typescript spec/jobs.openapi.yaml -o packages/client-a/schema.d.ts
echo "exit=$?" | tee "$RUN/gen-a.exit"
Expected first-line output shape from sha256sum (illustrative — rerun on your pinned versions, your hashes will differ):
## illustrative output
4b1d0f2b9f6f7c0d2f9b8f2f5a0e4c9d3d7c1a8e2b5f4c6d9e0a1b2c3d4e5f6a spec/jobs.openapi.yaml
Then generate twice into clean directories:
rm -rf /tmp/gen-a-run1 /tmp/gen-a-run2
mkdir -p /tmp/gen-a-run1 /tmp/gen-a-run2
npx --no-install openapi-typescript spec/jobs.openapi.yaml -o /tmp/gen-a-run1/schema.d.ts
npx --no-install openapi-typescript spec/jobs.openapi.yaml -o /tmp/gen-a-run2/schema.d.ts
diff -ru /tmp/gen-a-run1 /tmp/gen-a-run2 | tee "$RUN/regen-diff.txt"
echo "diff-exit=$?" | tee "$RUN/regen-diff.exit"
diff-exit=0 means byte-identical output from identical input. A non-zero exit with differences limited to header comments containing timestamps or versions is an incidental difference — record it, keep it out of the score. Any difference in exported names, optionality, or union shape is functional and disqualifies the pipeline as reproducible until explained.
Record output manifests, not screenshots
find packages/client-a -type f | sort | tee "$RUN/manifest-a.txt"
find packages/client-a -type f -exec sh -c 'echo "$1 $(wc -l < "$1")"' _ {} \; \
| sort | tee "$RUN/linecounts-a.txt"
Now the hosted baseline: with authorized access, run the same fixture through it, capture the generator identifier and version string, and store the manifest. Without that access, write this into the evidence directory and move on:
evidence/runs/<ts>/hosted-baseline.status
untested: no authorized tenant / no contract permission to generate this fixture
That line is worth more than a fabricated comparison.
Test runtime independence with a local HTTP contract harness
The recording server
import http from "node:http";
const LOG = process.env.HARNESS_LOG ?? "evidence/wire.jsonl";
const MODE = process.env.HARNESS_MODE ?? "ok"; // ok | throttle-then-ok | slow | sse
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
const server = http.createServer(async (req, res) => {
let body = "";
for await (const chunk of req) body += chunk;
appendFileSync(LOG, JSON.stringify({
method: req.method,
url: req.url,
headers: { authorization: req.headers.authorization ? "Bearer <redacted>" : undefined,
"content-type": req.headers["content-type"] },
body,
at: Date.now()
}) + "\n");
const send = (status, payload, extra = {}) => {
res.writeHead(status, { "content-type": "application/json", ...extra });
res.end(JSON.stringify(payload));
};
if (req.url.startsWith("/v1/jobs/") && req.url.endsWith("/events")) {
res.writeHead(200, { "content-type": "text/event-stream", "cache-control": "no-cache" });
const parts = [
": keep-alive\n\n",
"event: completed\ndata: {\"kind\":\"completed\",\"outputUrl\":\"http://127.0.0.1:8787/o/1\"}\n\n",
"event: completed\ndata: {\"kind\":\"completed\",\"outputUrl\":\"http://127.0.0.1:8787/o/2\"}\n\n"
];
for (const p of parts) { res.write(p); await sleep(15); }
res.end();
return;
}
if (MODE === "throttle-then-ok") {
if (!server.hits) server.hits = 0;
if (server.hits++ === 0) {
return send(429, { code: "rate_limited", message: "slow down", requestId: "req_1" },
{ "retry-after": "0" });
}
}
if (MODE === "slow") { await sleep(5000); }
if (req.method === "POST" && req.url === "/v1/jobs") {
return send(201, { id: "3f1c9d2e-0000-4000-8000-000000000001", status: "done",
note: null, result: { kind: "completed", outputUrl: "http://127.0.0.1:8787/o/1" } });
}
if (req.method === "GET" && req.url.startsWith("/v1/jobs?")) {
const hasCursor = req.url.includes("cursor=c1");
return send(200, {
items: [],
nextCursor: hasCursor ? null : "c1"
});
}
return send(404, { code: "not_found", message: "no route", requestId: "req_2" });
});
server.listen(8787, "127.0.0.1", () => console.log("harness on http://127.0.0.1:8787"));The server logs to wire.jsonl so assertions run against recorded requests rather than the generated client's internals. That's what lets one test file cover two generators with completely different ergonomics.
The adapter and the shared test suite
// adapters/port.ts — application-owned, generator-agnostic
export interface CompletedResult { kind: "completed"; outputUrl: string }
export interface FailedResult { kind: "failed"; reason: string }
export interface JobsPort {
createJob(input: { name: string; note?: string; tags?: string[] }): Promise<{ id: string }>;
getJob(id: string): Promise<{ id: string; note: string | null;
result: CompletedResult | FailedResult }>;
listJobs(opts: { cursor?: string; limit?: number }):
Promise<{ items: unknown[]; nextCursor: string | null }>;
streamEvents(id: string, signal: AbortSignal): AsyncIterable<unknown>;
}
Two things happen here. note: string | null in getJob forces each adapter to prove the generator produced required-and-nullable, not string | undefined. signal: AbortSignal in streamEvents forces each adapter to prove cancellation is actually plumbed through, not faked by ignoring the signal.
A shared test, run against whichever adapter is built:
// harness/contract.test.mjs
const wire = () => readFileSync("evidence/wire.jsonl", "utf8")
.trim().split("\n").map(JSON.parse);
test("W1: createJob sends bearer + json", async () => {
const port = await globalThis.__port();
await port.createJob({ name: "lab-1" });
const last = wire().at(-1);
assert.equal(last.method, "POST");
assert.equal(last.url, "/v1/jobs");
assert.equal(last.headers.authorization, "Bearer <redacted>");
assert.equal(last.headers["content-type"], "application/json");
});
test("W5: null nextCursor terminates paging", async () => {
const port = await globalThis.__port();
const p1 = await port.listJobs({});
assert.equal(p1.nextCursor, "c1");
const p2 = await port.listJobs({ cursor: p1.nextCursor });
assert.equal(p2.nextCursor, null);
});
test("S2: abort ends iteration", async () => {
const port = await globalThis.__port();
const ac = new AbortController();
const it = port.streamEvents("3f1c9d2e-0000-4000-8000-000000000001", ac.signal)[Symbol.asyncIterator]();
await it.next();
ac.abort();
await assert.rejects(async () => { while (!(await it.next()).done) {} });
});
Illustrative run output from node --test harness/:
## illustrative output — rerun to confirm on your pinned versions
✔ W1: createJob sends bearer + json (14.2ms)
✔ W5: null nextCursor terminates paging (9.8ms)
✖ S2: abort ends iteration (5012.6ms)
Error: Promise resolution is still pending but the event loop has cleared
ℹ tests 3
ℹ pass 2
ℹ fail 1
An S2 failure like that is the most common real result: the generated client exposes a stream, but the adapter's cancellation path is a no-op, so abort leaves iteration hanging. It's also a perfect conditional finding — the generator may be fine and the adapter wrong, or the generator may not surface the signal at all. Check the manifest and the generated source before blaming either.
The tests worth writing
- Base URL override. Point the client at
http://127.0.0.1:8787. If the only way to do that is a module-level constant, that's a portability defect for multi-region and test environments alike. - Transport injection. Does the generator let you supply a
fetchimplementation? Withundici'sMockAgentyou can intercept at thefetchlevel without any generator cooperation — but only if the client usesfetchrather than a bundled HTTP stack. - Auth boundary. Assert the
Authorizationheader on every call and assert no request leaks it to a redirect target. Note in the scorecard whether auth is per-client or per-call; per-client instances make multi-tenant services awkward. - Timeouts. With
HARNESS_MODE=slow, measure whether the client aborts, how long it waits, and whether the rejection is typed or a bareAbortError. - Error-body preservation. The 404 fixture returns
{code, message, requestId}. Assert the caller can readrequestId. Generators that throw a generic error and discard the body make incident debugging materially harder. - Retry accounting. With
HARNESS_MODE=throttle-then-ok, count requests inwire.jsonl. Then do the same for a POST that gets a 429 after the server already created the job. If the client retries the write without an idempotency key, you have a duplicate-work risk that is independent of vendor — but the retry default is a generator choice, so it belongs in the comparison. - Pagination edge cases.
nextCursor: nullmust not be confused withnextCursor: ""or missing. Sweep all three. - Fragmented streaming. The harness writes events in separate
res.writecalls with delays, so a client that assumes one chunk equals one event fails. Then test a truncated stream (res.destroy()mid-event) and a malformed payload (data: {not json}). Both should surface as errors, not silent truncation.
Test strict TypeScript compatibility instead of trusting a clean generation
Strict compilation of a real consumer
{
"compilerOptions": {
"strict": true,
"exactOptionalPropertyTypes": true,
"noUncheckedIndexedAccess": true,
"module": "nodenext",
"moduleResolution": "nodenext",
"target": "es2022",
"noEmit": true,
"skipLibCheck": false
},
"include": ["src/**/*.ts"]
}
exactOptionalPropertyTypes: true earns its keep here. Under plain strict, { note?: string } accepts { note: undefined }, so a generator that conflates optional with nullable compiles cleanly and then sends "note": null where the API expects omission. Turning it on converts an invisible semantic bug into a compile error.
skipLibCheck: false is uncomfortable but honest: it type-checks the generated declarations themselves, catching emitted .d.ts files that reference types not exported from the package entry.
npx --no-install tsc -p consumers/strict-app/tsconfig.json
echo "tsc-exit=$?" | tee evidence/runs/latest/tsc.exit
Illustrative failure you should see at least once across candidates:
## illustrative output
consumers/strict-app/src/use-jobs.ts(22,7): error TS2375: Type '{ note: undefined; }' is not
assignable to type 'CreateJobRequest' with 'exactOptionalPropertyTypes: true'. Consider
adding 'undefined' to the type of the property.
That's a real portability gap: the request type says optional, the wire behavior says omit, and the compiler now enforces the difference.
Adapter cost versus raw capability
Keep two counts per candidate:
- Adapter lines — how much code the application-owned
JobsPortimplementation needs. This measures migration cost. - Lost capabilities — things the generator does that the adapter can't faithfully express, such as a typed streaming helper, automatic pagination iterators, or a typed retry hook.
The first number makes the alternative look appealing. The second is what you actually lose by normalizing through the port. Both belong in the write-up; 40 adapter lines with two lost capabilities is not obviously better than 120 lines with none.
Pack and install into clean consumers
cd packages/client-a
npm pack --json | tee ../../evidence/runs/latest/pack-a.json
cd ../../consumers/strict-app
rm -rf node_modules package-lock.json
npm init -y >/dev/null
npm install --save ../../packages/client-a/client-a-0.0.0.tgz
npx --no-install tsc -p tsconfig.json
Then check the artifact itself, not the source tree:
npx --no-install publint packages/client-a
npx --no-install attw --pack packages/client-a
publint catches exports maps that break under a specific resolution mode. attw catches the classic "ESM-only types, CJS-only runtime" mismatch — exactly what happens when a generator emits one module format and your monorepo consumes another. If your application is CommonJS and the generated package is ESM-only, that's a fail on build independence regardless of how good the generated code is.
Disconnect the SDK generator and test what still builds and ships
Three experiments that are frequently conflated:
| Experiment | Setup | What a pass proves |
|---|---|---|
| A. Online clean install | Normal network, fresh node_modules | Baseline reproducibility |
| B. Offline rebuild | Network namespace with no route | Dependencies are cached/mirrored |
| C. Regeneration offline | No vendor credentials, no vendor network | You control regeneration |
Experiment A isn't optional; if it fails, B and C are meaningless.
Experiment B, in a container with no network:
docker run --rm --network none -v "$PWD":/w -w /w node:22-bookworm-slim \
sh -c 'npm ci --offline && npm run build && npm pack --dry-run'
Prerequisites: the npm cache (or your registry mirror) must be pre-populated with every transitive dependency, including optional platform-specific ones. npm ci --offline fails loudly if anything is missing, which is the behavior you want. Record the failure — a missing optional dependency in an offline environment is a real deployment constraint.
What experiment B does not prove: that your registry access exists tomorrow, that the licenses permit the mirroring you did, or that some postinstall step in a transitive dependency didn't make a network call you didn't notice.
Experiment C is the interesting one. Remove the vendor credentials, clear the generator config that references a hosted endpoint, and try to reproduce the client:
## no GENERATOR_API_KEY, no vendor CLI login
env -u GENERATOR_API_KEY -u VENDOR_TOKEN npm run generate:baseline
echo "regen-exit=$?" | tee evidence/runs/latest/regen-offline.exit
Illustrative failure:
## illustrative output
Error: 401 Unauthorized — generator request rejected
at HostedGenerator.generate (generators/hosted-baseline/runner.mjs:41:11)
regen-exit=1
Classify that as a regeneration dependency, not runtime lock-in. The distinction matters operationally: a regeneration dependency means a future schema change blocks on account access; it says nothing about whether the shipped client keeps working.
Inventory the runtime surface
npm ls --all --json > evidence/runs/latest/deps.json
node -e '
const d=require("./evidence/runs/latest/deps.json");
const walk=(n,depth=0)=>{for(const [k,v] of Object.entries(n.dependencies||{})){
console.log(" ".repeat(depth*2)+k+"@"+v.version);walk(v,depth+1);}};
walk(d);' | tee evidence/runs/latest/deps-tree.txt
grep -R '"preinstall"\|"install"\|"postinstall"' node_modules/*/package.json \
| tee evidence/runs/latest/install-scripts.txt
npx --no-install license-checker --summary | tee evidence/runs/latest/licenses.txt
For outbound connections, don't guess from package names. Observe: run the client's test suite under a network namespace with no route and see what breaks, or route through a local proxy and log destinations. A package called telemetry-utils in the dependency tree is not evidence of anything; a DNS lookup during getJob is.
Rehearse an SDK generator replacement with a real specification change
The change
Add one optional request field and one new response variant — small enough to be a normal sprint task, large enough to break assumptions.
CreateJobRequest:
type: object
required: [name]
properties:
name: { type: string, minLength: 1 }
note: { type: string }
tags: { type: array, items: { type: string } }
priority: { type: integer, minimum: 0, maximum: 9 } # NEW, optional
RetryableResult:
type: object
required: [kind, afterSeconds]
properties:
kind: { const: retryable }
afterSeconds: { type: integer }
## plus: add RetryableResult to the Job.result oneOf and discriminator mapping
Regenerate with each candidate, then rerun the same suites:
for c in local-a local-b; do
npm run generate:$c
node --test harness/ 2>&1 | tee "evidence/runs/latest/contract-$c.txt"
npx --no-install tsc -p consumers/strict-app/tsconfig.json 2>&1 \
| tee "evidence/runs/latest/tsc-$c.txt"
done
The measurement isn't "does it compile." It's:
- Changed application files. Count files under
consumers/that needed edits. A newoneOfvariant should force a compile error in any exhaustiveswitchonresult.kind. That error is the tool working correctly — record how many places it flagged. - Adapter lines changed. A new variant may need a new mapping in the adapter. Unavoidable, and the same cost for both candidates if the adapter is well designed.
- Missing capabilities. If
prioritylands in the type but the generated serializer drops unknown fields, the optional field silently does nothing. Test it: create a job withpriority: 7and assertwire.jsonlcontains it. - Manual maintenance work. Anything a human had to hand-write to make the change land.
Illustrative scorecard delta:
| Metric | local-a | local-b |
|---|---|---|
| Consumer files changed | 2 | 2 |
| Adapter lines changed | 6 | 11 |
| New capability gaps | 0 | 1 (stream helper signature changed) |
| Hand-written patches | 0 | 0 |
Again: illustrative shape, your numbers will differ.
Patch the generated source, deliberately
Sometimes the right move is a two-line patch to checked-in generated code. To do that safely, you need to know whether regeneration preserves or overwrites it.
## make a narrow, marked patch
sed -i 's/nextCursor: string | null/nextCursor: string | null/' packages/client-a/schema.d.ts
git add -A && git commit -q -m "lab: baseline before patch test"
## apply a real patch and note the file+line
printf '\n// HACKYJS-PATCH(expires 2027-03-01): see ADR-142\n' >> packages/client-a/schema.d.ts
npm run generate:local-a
git diff --stat packages/client-a/schema.d.ts
Two possible outcomes, both informative:
- The regenerated file overwrites the patch. The patch must live in a post-generation script that runs after
generate, and that script is itself a maintenance artifact you must version. - The regenerated file preserves the patch. That almost certainly means generation didn't rewrite that region — and the next schema change may delete it without warning.
Either way, the safe pattern is the same: never patch generated output by hand; encode the patch as a deterministic post-processing step with a test that fails when the patch stops applying. The printf marker above is for the experiment, not for production.
Release control without publishing
cd packages/client-a
npm pack --dry-run --json > ../../evidence/runs/latest/pack-dryrun.json
npm publish --dry-run --access restricted 2>&1 | tee ../../evidence/runs/latest/publish-dryrun.txt
--dry-run doesn't publish. What you're verifying is the permission story, not the artifact: who holds the registry token, whether CI can produce a tarball without a human, whether 2FA or a trusted-publisher binding exists, whether provenance attestation is configured. If the only person who can publish is the one who set up the hosted generator account, you have a release-control finding independent of the acquisition.
Turn test evidence into mitigations and an exit plan
The scorecard
| Dimension | Criterion | local-a | local-b | hosted baseline |
|---|---|---|---|---|
| Runtime | Client works with no vendor network | pass | pass | untested |
| Runtime | Auth per-call, no credential leak on redirect | pass | pass | untested |
| Runtime | Retries writes only with idempotency key | conditional | fail | untested |
| Build | npm ci + build + pack offline | pass | conditional | untested |
| Build | Module format matches consumer | pass | pass | untested |
| Regen | Reproducible byte-identical on repeat | pass | pass | untested |
| Regen | Works without vendor credentials | pass | pass | fail (expected) |
| Maintenance | License permits vendoring and modification | pass | pass | untested |
| Maintenance | Patchable with a reproducible post-step | pass | pass | untested |
| Publication | Team-controlled tarball in CI | pass | pass | untested |
hosted baseline reads untested because I have neither an authorized tenant nor permission to generate this fixture. That's the correct result, and much more useful than a fabricated pass. Note that the report about OpenAI and Google relying on Stainless says nothing about their entitlements — it doesn't tell you what your contract says.
Findings to defenses
| Finding | Consequence if triggered | Defense |
|---|---|---|
| Regeneration needs vendor credentials | Schema change blocks on account access | Keep spec + generator config + version pins under source control |
| Runtime dep tree includes generator-vendored helpers | Cannot patch or mirror an abandoned helper | Mirror allowed dependencies; record license of each |
| Offline build fails on optional transitive | CI breaks during registry outage | Pre-populate cache; test the offline path in CI nightly |
| Generated client leaked into app code | Migration cost is unknowable | Enforce the adapter boundary with a lint rule |
| Single individual can publish | Release stalls on availability | Trusted publisher / CI token with documented rotation |
untested hosted column | You cannot compare alternatives | Get contractual clarity, or accept the risk explicitly |
Each of these is cheap before the trigger and expensive after.
Replacement triggers
Set triggers on measured capability and documented terms, not on ownership:
- A schema change can't be regenerated within one business day from team-controlled assets.
- A generated client's runtime dependency becomes unmaintained or its license changes.
- Offline build fails two consecutive nightly runs.
- Published terms or a primary announcement remove an entitlement you currently rely on.
- A contract test that passed on the previous generator fails and can't be fixed in the adapter.
"If the company is acquired" is not a trigger. "We lost the ability to ship a compatible client on our schedule" is.
Residual limits
State these out loud in the write-up, because they're the parts a lab drill can't touch:
- A successful local drill doesn't prove future vendor support or continued access.
- It doesn't establish contractual rights. License files are not contracts.
- It covers a fixture, not your full production API surface. Real clients have hundreds of operations, polymorphic edges, and undocumented behaviors.
- It doesn't test every runtime your services run on — Bun, Deno, edge workers, and older Node LTS lines all have different
fetchsemantics. - It can't detect a hosted service change that happens after your test run.
What to verify about the reported Stainless deal
Seek primary confirmation
Before changing anything, look for a primary announcement — the acquirer's own newsroom or the acquired company's own statement — and read it for:
- announcement date, and whether the transaction is closed or pending,
- what exactly transfers: technology, team, or the customer service itself,
- any statement about existing customers, generation access, or support,
- changes to licensing, data-handling, or storage of uploaded specifications,
- whether third-party customer arrangements are addressed at all.
The two supplied items — Wisevoter's report of the acquisition and The Economic Times' report that OpenAI and Google also relied on Stainless, both dated 26 November 2026 — answer none of those questions.
Separate reporting from inference
Confirmed from the supplied material: the acquisition is reported, and competing providers are reported to have depended on the same tooling. Inferred, and worth saying so: a shared tooling supplier owned by one competitor creates an incentive for review. An incentive, not a demonstrated behavior. Nothing in the supplied material establishes preferential treatment, disrupted releases, revoked access, or changes to any generated SDK.
"Competing providers depend on the same vendor" is a reason to review. "The vendor changed something" is what you must verify. Don't let the first sentence stand in for the second.
The technical decision
Keep the generator that passes the capabilities you measured and whose contractual terms you've actually read. Keep a tested path to maintain and release the client independently — the adapter boundary, the checked-in spec and configuration, the mirrored dependencies, the CI tarball, and the post-generation patch script.
That combination is what vendor independence actually looks like in a repository: not a migration, not a rewrite, not a confident opinion about an acquisition, but a drill you've already run once, so the second time takes an afternoon instead of a quarter.
Further reading and verification sources
Supplied secondary reporting
- Wisevoter, "Anthropic Acquires Developer Tools Firm Stainless", 26 November 2026 — supplied as a Google News RSS pointer: reference.
- The Economic Times, "OpenAI and Google relied on the same small startup to connect developers to their AI. Then Anthropic bought it", 26 November 2026 — supplied as a Google News RSS pointer: reference.
- No primary announcement, policy notice, or customer communication was included in the supplied material; add one only if you can verify it directly.
Walkthrough references
- OpenAPI Specification 3.1.0 — the version used by the fixture, including
typearrays for nullability anddiscriminator. openapi-typescripton npm — type-only generation, documented as producing no runtime client.openapi-fetchon npm — the small fetch-based client used alongside those types.@hey-api/openapi-tsdocumentation — an alternative full-client generator with its own runtime options.orvaldocumentation — the configurable full-client generator used as the second candidate.- Node.js
node:testdocumentation — the test runner used for the contract suite. - Node.js
node:httpdocumentation — the loopback harness. - undici
MockAgentdocumentation —fetch-level interception. - TypeScript
tsconfigreference —strict,exactOptionalPropertyTypes,noUncheckedIndexedAccess,moduleResolution. npm packdocumentation andnpm publishdocumentation — tarball creation and--dry-run.publintand@arethetypeswrong/cli— packageexportsand module-format validation.
More posts

Diffing OpenAPI Specs in CI with TypeScript to Block Breaking Changes
A practical walkthrough of using TypeScript and OpenAPI spec diffing in CI pipelines to catch contract-breaking API changes before they reach consumers.

Testing Backup Restores and IaC Portability Before Leaving Rackspace Spot
Rackspace's reported Spot shutdown after a breach turns cloud exit into an operational drill: inventory workloads, test backup restores, validate IaC portability, rotate credentials, and verify a replacement provider before migrating.

A Sandbox Is Not an Egress Policy: Testing Coding Agents in Node.js
A deep technical walkthrough of why sandboxing coding agents in Node.js doesn't prevent data exfiltration, using Anthropic's sandbox-risk research and NordLayer's secret-leak incident to build a threat model and test harness for egress, secrets, and tool permissions.
Loading comments…