Public: anyone can read this; the crew can change it.
The api-* test files read no answer that disagrees with openapi.json #17990
Merged 12h 17m ago, live in production
I ran all 91 test/api-.test.ts files in two halves. They printed 13 CONTRACT lines before this change (5 + 8) and 0 after, with 186 + 143 tests passing.
-
Reviews
ApprovedThe two route declarations now say what the routes serve (search: docs array, note string; telemetry/home: live, main and behind as object|null). The ?fields= disagreement is recorded as a known bend and the suite's check holds the kept keys' types. Tests fail without each change, and the before and after counts (13 to 0) are in the pull. No served type was changed. Two things I would do next: (1) the leftover
GET /api/v1/repos/issues/search$: is array, declared objectoutside the api-* files: find which route it is matched to and fix the declaration; (2) givedocsin the search reply its item shape ({title, path, snippet}) in the schema rather than only indetail, so generated clients see it. -
Checks
shipped production is serving it deploy 5ce50ab
-
History
- The api-* test files read no answer that disagrees with openapi.json (#17986) c36d70b
- The suite's fetch reports each /api/v1 answer that disagrees with openapi.json, without failing yet (#17989) 3a1266c
- Anonymous, opt-in app telemetry: a route to receive daily summaries, and an owner view (#17967) 973052e
- Runner jobs' git-upload-pack: count the work per job, then cut it so the serving thread is not held (#17984) ee5308f
- A `[loop]` stall line names what the serving thread was doing: the route or duty in flight (#17982) bb47d9a
- takeLook's loopback-only test stops failing checks for a missing prerequisite (56 reds last week) (#17979) 87f7f1b
- A Talk turn that reaches its limit says so and offers one tap to go on (#17981) 7ada34c
- Talk logs one line per model call: account, model, seconds, how it ended (#17980) 353f588
- Sentinel: The lane has stopped: nothing has merged and nothing said so (#17973) 010904c
- Full suite red: test/traffic-truth.test.ts (#17972) 13460d3
- Infrastructure: a game box container opens on its live log, with Restart, Stop and Start (#17946) db96b4c
- Full suite red: test/api-security-floor.test.ts (#17965) 091b8a0
- Public /privacy and /support pages (needed for the App Store listing) (#17948) 638aa4f
- A container in the cloud tree has a Logs tab with its recent lines (#17958) 07d8c64
- A join that freezes a lent job is recorded with how long the freeze took (#17956) 80543a4
- A lent job on a game box keeps the server's tps and mspt from before it and during it (#17957) a357207
- The /infra first page shows the costliest resources as a sortable table (#17955) e08c778
- Push to Apple devices (APNs): device registration and a sender (#17928) 19eaf78
- A machine's containers in the cloud tree read as a table: name, state, CPU, memory, started (#17954) ccd2925
- API shapes: no silent type changes (approvedAt became an object); contract-test responses against openapi.json (#17945) 1b196c6
I ran all 91 test/api-*.test.ts files in two halves. They printed 13 CONTRACT lines before this change (5 + 8) and 0 after, with 186 + 143 tests passing.
What changed
/api/v1/search(src/contract/openapi/routes/getApiV1Search.ts): thedocsandnotefields had a description written where their type belongs ("array of { title, path, snippet }…", "string, only when q is blank…"). No real value could match a type like that. They now say"array"and"string", and the description moved to the route'sdetail./api/v1/telemetry/home(getApiV1TelemetryHome.ts):live,mainandbehindwere declared as objects, but the route sends null for them until the forge has stamped its build and read its own main branch. They are now declared"object|null". The route's owndetailalready said this.?fields=on/repos/{o}/{r}/pulls: this answer keeps only the keys it names, whilePullItemlists every key as required. I didn't relaxPullItemto fit, because then generated clients couldn't count on any key being there. Instead it's a new line under "Known bends" indocs/features/api-shape-changes.md, andtest/helpers/contract-fetch.tsno longer reports item keys missing from afields=answer. It still checks the types of the keys that are kept.docs/features/api-shape-changes.mdalso gets a line under "Changes clients follow" for the two route declarations. What the routes send did not change.
Tests: test/support/conforms.test.ts gains two tests:
- One checks the two corrected route declarations; it fails without the route changes.
- One checks the
fields=rule: a trimmed answer passes, a kept key of the wrong type still fails, and a full list still fails on a missing key.
Nothing else is new: the fixes use the existing declared, disagreements and reply type strings.
Checks: bun x tsc --noEmit and bun scripts/gate.ts --explain (32 of 32 rules) pass. scripts/fast.ts said the change touches too much to name the tests, because the shared test preload reaches every file. So I picked 108 files covering openapi, contract, search, telemetry, features, swift, dead code and module-level state: 1119 pass, 0 fail.
Left for the next part: outside the api-* files, GET /api/v1/repos/issues/search prints $: is array, declared object twice. I haven't checked which route that answer is being matched to.
To try it: bun test test/support/conforms.test.ts, then bun test $(ls test/api-*.test.ts | head -50) and the rest; neither prints a CONTRACT line.
🤖 Generated with Claude Code
I ran all 91
test/api-*.test.tsfiles in two halves. They printed 13CONTRACTlines before this change (5 + 8) and 0 after, with 186 + 143 tests passing.What changed
/api/v1/search(src/contract/openapi/routes/getApiV1Search.ts): thedocsandnotefields had a description written where their type belongs ("array of { title, path, snippet }…", "string, only when q is blank…"). No real value could match a type like that. They now say"array"and"string", and the description moved to the route'sdetail./api/v1/telemetry/home(getApiV1TelemetryHome.ts):live,mainandbehindwere declared as objects, but the route sends null for them until the forge has stamped its build and read its own main branch. They are now declared"object|null". The route's owndetailalready said this.?fields=on/repos/{o}/{r}/pulls: this answer keeps only the keys it names, whilePullItemlists every key as required. I didn't relaxPullItemto fit, because then generated clients couldn't count on any key being there. Instead it's a new line under "Known bends" indocs/features/api-shape-changes.md, andtest/helpers/contract-fetch.tsno longer reports item keys missing from afields=answer. It still checks the types of the keys that are kept.docs/features/api-shape-changes.mdalso gets a line under "Changes clients follow" for the two route declarations. What the routes send did not change.Tests:
test/support/conforms.test.tsgains two tests:fields=rule: a trimmed answer passes, a kept key of the wrong type still fails, and a full list still fails on a missing key.Nothing else is new: the fixes use the existing
declared,disagreementsandreplytype strings.Checks:
bun x tsc --noEmitandbun scripts/gate.ts --explain(32 of 32 rules) pass.scripts/fast.tssaid the change touches too much to name the tests, because the shared test preload reaches every file. So I picked 108 files covering openapi, contract, search, telemetry, features, swift, dead code and module-level state: 1119 pass, 0 fail.Left for the next part: outside the api-* files,
GET /api/v1/repos/issues/searchprints$: is array, declared objecttwice. I haven't checked which route that answer is being matched to.To try it:
bun test test/support/conforms.test.ts, thenbun test $(ls test/api-*.test.ts | head -50)and the rest; neither prints aCONTRACTline.🤖 Generated with Claude Code
Closes #17986