Public: anyone can read this; the crew can change it.
A test that reads an /api/v1 answer disagreeing with openapi.json goes red #18013
Merged 16h 1m ago, live in production
The suite's /api/v1 contract check now fails a test by default. Any answer a test reads through fetch that disagrees with openapi.json throws, naming the field. Collect mode is still there, but only behind FORGECONTRACTCOLLECT=1, for the next schema audit.
-
Reviews
ApprovedStrict is now the default in the suite's fetch wrapper. Collect mode stays only behind FORGE_CONTRACT_COLLECT=1. The new first test in conforms.test.ts fails on the old default, and afterAll restores the starting mode. The doc line says what is now true, and the how-to stays in docs/features. This touches only the test harness and its doc, so there is no door to add. The forge's check is green. Two things to do next: (1) the audit covered 120 of 1163 files, so watch the next full-suite runs for a CONTRACT failure and fix it by declaring the served type in src/contract/openapi/schemas/*; (2) open an issue for test/mcp/forks.test.ts 'the private fork's owner sees it', which the builder says fails without this change too (a
wordsline the test's fixed value doesn't list). -
Checks
shipped production is serving it deploy a338207
-
History
- Rewrap the contract wrapper's comment (#17988) df1b922
- Direction: a test that reads an /api/v1 answer disagreeing with openapi.json goes red (#17988) f812e52
- The test files outside api-* read no answer that disagrees with openapi.json (#18001) d861d63
- Traces: every conversation and run kept as a trace, imported from outside agents, and explored in the forge (#17968) 35a5490
- Traces 3: one trace as a tree beside a time strip, with what it changed (#17996) 2902a64
- Merge pull request #17997 from sold/ssh-mlkem 05c87e1
- SSH: the hybrid's K has its own known answer, the client test skips the hybrid on OpenSSH before 9.9, one comment, the docs in their own paragraph 281e40c
- Merge pull request #17998 from sold/tab-start 7e39794
- The /tab fix serves #16840 4eed511
- /tab starts in Safari and Chrome: the worker sees its host page, and the page waits for activation a5d9dd7
- SSH offers the hybrid post-quantum key exchange first: mlkem768x25519-sha256 1124a92
- The api-* test files read no answer that disagrees with openapi.json (#17990) 2d01f4a
- 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
The suite's /api/v1 contract check now fails a test by default. Any answer a test reads through fetch that disagrees with openapi.json throws, naming the field. Collect mode is still there, but only behind FORGE_CONTRACT_COLLECT=1, for the next schema audit.
test/helpers/contract-fetch.ts: the mode a process starts in comes from the newSTRICT_BY_DEFAULT, which is strict unlessFORGE_CONTRACT_COLLECT=1.contractStrict(on)still switches the mode within a test file. The header comment now describes strict as the default.test/support/conforms.test.ts: a new first case in the block fetches theapprovedAt-as-object stub without callingcontractStrict, and expects the rejection$.approvedAt: is object, declared string|null. It would fail on the old collect default. It is skipped when the run setsFORGE_CONTRACT_COLLECT=1.afterAllnow puts back the starting mode instead of forcing collect.docs/features/api-shape-changes.md: "A route's tests add the same check as they gain samples" now says every/api/v1answer a test reads is checked by the preload's wrappedfetch, and namesFORGE_CONTRACT_COLLECT=1for audits.
No schema fixes are in this pull, because none turned up. Parts 2 and 3 (#18001 and the one before it) audited the suite. I ran 120 of the 1163 test files that read /api/v1 in collect mode, about 1061 tests, and none printed a CONTRACT line. One test in that run failed: test/mcp/forks.test.ts "the private fork's owner sees it". The fork answer has a words line the test's fixed value doesn't list. It fails the same way with this change stashed, so this pull doesn't cause it and doesn't fix it. If the forge's full check turns any test red on a contract disagreement, the fix is to declare the type the route already serves in src/contract/openapi/schemas/*, in this pull.
No production code or served shape changes. "No door" because this touches only the test harness and its doc.
Checks run: bun scripts/gate.ts is clean and bun x tsc --noEmit passes. test/support/conforms.test.ts and test/approval-base.test.ts pass: 7 of 7 conforms cases by default, and 6 plus 1 skipped under FORGE_CONTRACT_COLLECT=1.
To try it: bun test test/support/conforms.test.ts, then FORGE_CONTRACT_COLLECT=1 bun test <files> to list disagreements without failing.
🤖 Generated with Claude Code
The suite's
/api/v1contract check now fails a test by default. Any answer a test reads throughfetchthat disagrees withopenapi.jsonthrows, naming the field. Collect mode is still there, but only behindFORGE_CONTRACT_COLLECT=1, for the next schema audit.test/helpers/contract-fetch.ts: the mode a process starts in comes from the newSTRICT_BY_DEFAULT, which is strict unlessFORGE_CONTRACT_COLLECT=1.contractStrict(on)still switches the mode within a test file. The header comment now describes strict as the default.test/support/conforms.test.ts: a new first case in the block fetches theapprovedAt-as-object stub without callingcontractStrict, and expects the rejection$.approvedAt: is object, declared string|null. It would fail on the old collect default. It is skipped when the run setsFORGE_CONTRACT_COLLECT=1.afterAllnow puts back the starting mode instead of forcing collect.docs/features/api-shape-changes.md: "A route's tests add the same check as they gain samples" now says every/api/v1answer a test reads is checked by the preload's wrappedfetch, and namesFORGE_CONTRACT_COLLECT=1for audits.No schema fixes are in this pull, because none turned up. Parts 2 and 3 (#18001 and the one before it) audited the suite. I ran 120 of the 1163 test files that read
/api/v1in collect mode, about 1061 tests, and none printed aCONTRACTline. One test in that run failed:test/mcp/forks.test.ts"the private fork's owner sees it". The fork answer has awordsline the test's fixed value doesn't list. It fails the same way with this change stashed, so this pull doesn't cause it and doesn't fix it. If the forge's full check turns any test red on a contract disagreement, the fix is to declare the type the route already serves insrc/contract/openapi/schemas/*, in this pull.No production code or served shape changes. "No door" because this touches only the test harness and its doc.
Checks run:
bun scripts/gate.tsis clean andbun x tsc --noEmitpasses.test/support/conforms.test.tsandtest/approval-base.test.tspass: 7 of 7 conforms cases by default, and 6 plus 1 skipped underFORGE_CONTRACT_COLLECT=1.To try it:
bun test test/support/conforms.test.ts, thenFORGE_CONTRACT_COLLECT=1 bun test <files>to list disagreements without failing.🤖 Generated with Claude Code
Closes #17988