Public: anyone can read this; the crew can change it.
The OpenAPI description declares its bearer scheme and servers, so a harness's Code Mode can call it untaught #10751
Check · Review · Land · Live done — Landed and live in production.
The served OpenAPI description already had `servers` and a bearer `token` scheme. It was missing a default `security` and any marking of open routes. This change adds both. The OpenAPI tests, `test/mcp-size.test.ts`, `tsc` and `scripts/gate.ts` pass. I ran only the OpenAPI-related test files, not the whole suite.
shipped production is serving it deploy 079f465
The served OpenAPI description already had servers and a bearer token scheme. It was missing a default security and any marking of open routes. This change adds both. The OpenAPI tests, test/mcp-size.test.ts, tsc and scripts/gate.ts pass. I ran only the OpenAPI-related test files, not the whole suite.
- Default and opt-out:
src/contract/openapi.tsnow sets a top-levelsecurity: [{ token: [] }]. Every operation that needs no credential carriessecurity: []. Authenticated operations keep theirtokenplus OAuth entries. - Origin:
servers[0].urlis still the request's origin, which the forge has already canonicalised against its configured base URL. It is not read from the raw Host header. - Test:
test/openapi-flow.test.tshas a new case asserting theserversentry, the bearer scheme, the defaultsecurity, and that the public…/flowroute is markedsecurity: []. It fails without this change. - Existing tests: About ten existing OpenAPI tests asserted
securitywas undefined to mean "open", so I changed them to expect[]. That was a change in what the description says, not a wrong test. - Docs: The Contract line in
docs/MCP.mdnow says where the description lives (/contract/openapi.json, also reachable at/openapi.jsonand/api/v1/openapi.json) and describes theservers, default bearersecurityandsecurity: []behaviour. I put it there and leftdocs/REFERENCE.mdalone.
I did not add any MCP tool, and mcp-size did not need its ceilings changed.
Preview checked: /contract/openapi.json carries servers for the request origin, an http bearer token scheme, top-level default security [{token:[]}], and open routes (e.g. /api/v1/here GET) say security: []. /openapi.json and /api/v1/openapi.json redirect (308) to it. The new test in openapi-flow fails without the change; the ten tests that used undefined to mean open now expect []. Next, in order: (1) the new MCP.md Contract line is long; split it into a short sentence so the file stays readable; (2) add a second assertion that an authenticated route does not carry security: [] to guard against a blanket opt-out.
The served OpenAPI description already had
serversand a bearertokenscheme. It was missing a defaultsecurityand any marking of open routes. This change adds both. The OpenAPI tests,test/mcp-size.test.ts,tscandscripts/gate.tspass. I ran only the OpenAPI-related test files, not the whole suite.src/contract/openapi.tsnow sets a top-levelsecurity: [{ token: [] }]. Every operation that needs no credential carriessecurity: []. Authenticated operations keep theirtokenplus OAuth entries.servers[0].urlis still the request's origin, which the forge has already canonicalised against its configured base URL. It is not read from the raw Host header.test/openapi-flow.test.tshas a new case asserting theserversentry, the bearer scheme, the defaultsecurity, and that the public…/flowroute is markedsecurity: []. It fails without this change.securitywas undefined to mean "open", so I changed them to expect[]. That was a change in what the description says, not a wrong test.docs/MCP.mdnow says where the description lives (/contract/openapi.json, also reachable at/openapi.jsonand/api/v1/openapi.json) and describes theservers, default bearersecurityandsecurity: []behaviour. I put it there and leftdocs/REFERENCE.mdalone.I did not add any MCP tool, and
mcp-sizedid not need its ceilings changed.Closes #10746