Public: anyone can read this; the crew can change it.
The test files outside api-* read no answer that disagrees with openapi.json #18001
Merged 12h ago, live in production
The suite's contract check now only checks /api/v1 answers that this forge's own server wrote. Answers from stub servers inside the tests are no longer checked. All 1037 test files outside api- that read /api/v1/ now print no CONTRACT line.
-
Reviews
ApprovedApproved. The listed disagreements came from stub origins inside tests, not from this forge's routes. Holding only answers that carry securityFloor's headers (permissions-policy, cross-origin-opener-policy, both confirmed set there in src/http/respond.ts) is a small, honest fix, and it drops no served-type check. The new test fails without the guard, and the wrapper's own server now goes through the floor. Next: (1) name the two marker headers in one shared constant if another helper ever needs the same test; (2) fix test/mcp/forks.test.ts, which the author says is red on the base (the
wordsfield), so it does not sit red on main. -
Checks
shipped production is serving it deploy 5ce50ab
-
History
- The suite's contract check holds only answers this forge wrote, not a test's canned origin (#17987) 8525239
- 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
- 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
The suite's contract check now only checks /api/v1 answers that this forge's own server wrote. Answers from stub servers inside the tests are no longer checked. All 1037 test files outside api-* that read /api/v1/ now print no CONTRACT line.
What the 430 lines were. None came from a route in this forge. They came from stub servers in the tests that answer under the same /api/v1/ prefix:
- Fake Forgejo origins (
origins*,fork-flow,propose-via-fork,view-sourceand others): theirGET /api/v1/repos/{o}/{r}answers an integerid, and their/api/v1/repos/issues/searchanswers a bare array. - Minimal stub pull and review bodies (
cli-pulls,cli-ship,mirror-pulls,thanks,origin-verdicts-counted,talk-bring).
Declaring those shapes in openapi.json would describe some other forge, not this one. So no schema changes, no served type changes, and nothing goes under "Known bends" in docs/features/api-shape-changes.md.
What changed.
test/helpers/contract-fetch.ts: before checking an answer, the wrapper looks for two headers that onlysecurityFloor(src/http/respond.ts) sets:permissions-policyandcross-origin-opener-policy. Every answer this forge writes carries them; a test'sResponse.jsonstub doesn't. An answer without them is passed through unchecked.test/support/conforms.test.ts: the wrapper's own test server now sends its answers throughsecurityFloor, as the forge does. That test changed because the behaviour it tests changed. A new test adds a second stub with no floor headers and checks that its wrong-typed answer is not checked. It fails if the new check is removed.- No new function looks like an existing one: the gate's "duplicate functions" rule passes. I didn't run
scripts/similar.tsseparately.
To confirm real answers are still checked, I temporarily declared /api/v1/search's moreCode as a string. test/search.test.ts then printed 37 CONTRACT lines, and I reverted the change.
Before → after, CONTRACT lines per batch of 50 files:
| batch | 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| before | 0 | 0 | 6 | 59 | 2 | 4 | 3 | 45 | 0 | 0 | 0 | 36 | 12 | 93 | 47 | 8 | 0 | 2 | 3 | 1 | 109 |
| after | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Batches are the sorted output of grep -rl /api/v1/ test/ --include=*.test.ts | grep -v ^test/api-, cut every 50 lines.
Not done here: one test, test/mcp/forks.test.ts ("the private fork's owner sees it, with its parent named"), fails the same way on the base without this change. The MCP answer now has a words field that the test's expected value doesn't list, so I left it alone.
To try it: run bun test test/support/conforms.test.ts. Then run bun test on any batch above (for example test/view-source.test.ts test/fork-flow.test.ts) and grep ^CONTRACT the output: it finds nothing.
Checks run: bun scripts/gate.ts --explain (32 of 32 rules pass), bun x tsc --noEmit, and the 155 files scripts/fast.ts names, in three batches, all passing.
🤖 Generated with Claude Code
The suite's contract check now only checks
/api/v1answers that this forge's own server wrote. Answers from stub servers inside the tests are no longer checked. All 1037 test files outsideapi-*that read/api/v1/now print noCONTRACTline.What the 430 lines were. None came from a route in this forge. They came from stub servers in the tests that answer under the same
/api/v1/prefix:origins*,fork-flow,propose-via-fork,view-sourceand others): theirGET /api/v1/repos/{o}/{r}answers an integerid, and their/api/v1/repos/issues/searchanswers a bare array.cli-pulls,cli-ship,mirror-pulls,thanks,origin-verdicts-counted,talk-bring).Declaring those shapes in openapi.json would describe some other forge, not this one. So no schema changes, no served type changes, and nothing goes under "Known bends" in
docs/features/api-shape-changes.md.What changed.
test/helpers/contract-fetch.ts: before checking an answer, the wrapper looks for two headers that onlysecurityFloor(src/http/respond.ts) sets:permissions-policyandcross-origin-opener-policy. Every answer this forge writes carries them; a test'sResponse.jsonstub doesn't. An answer without them is passed through unchecked.test/support/conforms.test.ts: the wrapper's own test server now sends its answers throughsecurityFloor, as the forge does. That test changed because the behaviour it tests changed. A new test adds a second stub with no floor headers and checks that its wrong-typed answer is not checked. It fails if the new check is removed.scripts/similar.tsseparately.To confirm real answers are still checked, I temporarily declared
/api/v1/search'smoreCodeas a string.test/search.test.tsthen printed 37CONTRACTlines, and I reverted the change.Before → after,
CONTRACTlines per batch of 50 files:Batches are the sorted output of
grep -rl /api/v1/ test/ --include=*.test.ts | grep -v ^test/api-, cut every 50 lines.Not done here: one test,
test/mcp/forks.test.ts("the private fork's owner sees it, with its parent named"), fails the same way on the base without this change. The MCP answer now has awordsfield that the test's expected value doesn't list, so I left it alone.To try it: run
bun test test/support/conforms.test.ts. Then runbun teston any batch above (for exampletest/view-source.test.ts test/fork-flow.test.ts) andgrep ^CONTRACTthe output: it finds nothing.Checks run:
bun scripts/gate.ts --explain(32 of 32 rules pass),bun x tsc --noEmit, and the 155 filesscripts/fast.tsnames, in three batches, all passing.🤖 Generated with Claude Code
Closes #17987