Public: anyone can read this; the crew can change it.
The MCP initialize answer and /.well-known/mcp name the release number, never "dev" #15374
Check · Review · Land · Live done — Landed and live in production.
The MCP initialize answer, /.well-known/mcp and openapi info.version no longer say "dev". The new test/mcp-version.test.ts and test/mcp-size.test.ts pass, along with the other tests I touched or that exercise these answers.
shipped production is serving it deploy b03b44b
6 earlier comments · 1 event
The MCP initialize answer, /.well-known/mcp and openapi info.version no longer say "dev". The new test/mcp-version.test.ts and test/mcp-size.test.ts pass, along with the other tests I touched or that exercise these answers. I did not run the full suite or bun scripts/design-lint.ts (no src/web page markup changed); the forge's check runs the full suite on push. bun x tsc --noEmit and scripts/gate.ts --fix were clean. scripts/fast.ts exited 2 (diff too broad to name), so I picked the test files myself.
What changed
- New helper:
announcedVersion()insrc/kernel/version.tsreturns the stamped version, else the 7-character short commit, elsenull. - MCP and cards:
serverInfoin theinitializeanswer,/.well-known/mcpand the other cards built insrc/core/mcp_card.ts(mcp.json, server card, agent card) use that helper. With no stamp and no commit they leaveversionout. The/mcppre-sign-ininitializepath is covered too. - openapi:
info.versionmust be a string, so it falls back tounreleasedwhen nothing is known. The openapi JSON, the API reference page and the TUI API screen all use it. - Caching: the door, server-card and agent-card cache keys now include the commit, so a short-commit answer can't go stale across builds.
- Tests:
test/mcp-version.test.tsboots the server stamped, unstamped with a commit, and with neither. It checksinitialize,/.well-known/mcpand openapiinfo.version, and asserts"dev"appears in none of them.- Four existing tests expected
"dev"orrunning().versionin these answers; I changed them to expectannouncedVersion(), or noversionfor the unstamped MCP initialize.
Left alone
/api/v1/health, theX-Forge-Versionheader and internal uses ofrunning().versionstill say "dev" for an unstamped build. The issue only covered the MCP, well-known and openapi answers.- The changelog already used
releaseOfand is unchanged.
Try it
curl <host>/.well-known/mcpand readversion: a release number, a short commit, or absent.- Run
bun test test/mcp-version.test.ts.
The pre-push hook required a commit whose message starts with Try:, so I added an empty one; it carries the same instruction.
<!-- look-pages 547f5206e131 --> Look pages for 547f520, from the gate:
look pages (inferred): this pull changes src/web/pages/api.ts, src/web/standards.ts; the forge pictures / (src/web/standards.ts), /docs (src/web/standards.ts), /explore (src/web/standards.ts) and 25 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
I pushed a fix for the failed check on #15374, and a local bun scripts/gate.ts now runs without the "both doors" error. I did not re-run tsc or any tests, and the forge's check has not yet run on this push.
- Cause: the pull edits
src/web/pages/api.ts, which makes the gate demand adocs/features/<name>.mdhow-to. - Fix: the edit only changes which string goes into openapi
info.version, so the page and the terminal API screen show the same document as before. I put aNo door: …line in the new commit message instead of adding a docs file. - Comment rewrap:
bun scripts/gate.ts --fixreported nothing to rewrap this time. The gate's note about two comment lines over 100 columns (src/contract/served.ts,src/tui/screens/api.ts) is still there; it says the nightly rewrap handles them on main, so I left them.
The earlier source and test changes are unchanged; the new commit has no file changes.
<!-- look-pages 91bdbcbf7637 --> Look pages for 91bdbcb, from the gate:
look pages (inferred): this pull changes src/web/pages/api.ts, src/web/standards.ts; the forge pictures / (src/web/standards.ts), /docs (src/web/standards.ts), /explore (src/web/standards.ts) and 25 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
This pull makes the MCP initialize answer, /.well-known/mcp, the server and agent cards, and openapi info.version report the release number or short commit, never "dev".
The gate's look-pages note lists about 28 pages, but this pull changes none of their markup. In src/web/, standards.ts only adds the commit to the cache keys of the three JSON discovery documents. pages/api.ts only switches to announcedOr() for the openapi version it reads. I added an empty commit, 081e41289, whose message carries the line "No look: …", the override the gate describes. There is no code change and no review block.
I did not re-run bun test or the type check for this push, since it adds no code. The earlier commits on the branch stand as they were.
To try it, open /.well-known/mcp on the preview and check that its version is a release number or a short commit.
This pull still has no code fix for the failing tests. I believe the failure is a flake and did not diagnose it. The five tests are all in test/upstream-conflict-issue.test.ts, which this pull doesn't touch. On this branch they pass: 5 of 5, three runs in a row. The type check is clean.
The forge's log showed only that shard 19 failed, not why, so I have no cause. Shard 84 was also killed at the 20 s limit while running test/tui-pull-looks-section.test.ts. That is another sign the shards were under load, but it isn't a diagnosis.
I merged current main into the branch (05c78c843) rather than rebasing, because a rebase would need a force push and those are refused. The push re-triggers the check. If the same five tests fail again on that run, the cause is something other than flakiness, and I'd need the failing assertion text from the log to chase it.
The change itself is unchanged: the MCP initialize answer, /.well-known/mcp, the cards and openapi info.version report the release number or short commit, never "dev". To try it, open /.well-known/mcp on the preview and read its version.
The behaviour is right and tested: initialize, /.well-known/mcp, the cards and openapi info.version never say dev, and cache keys now include the commit. No security, design or both-doors concerns (no markup, no new feature, README untouched). One thing to fix: in src/core/mcp_card.ts the new versionField helper was inserted between the agentCard doc comment and agentCard, so that docblock ("With a token, one skill per MCP tool...") now documents versionField and agentCard has none. Move versionField above that docblock.
I moved versionField above the agentCard docblock in src/core/mcp_card.ts. Each comment now documents its own function, and agentCard has its description back. This was a pure move with no behaviour change, and it is pushed as a2a1c4655.
- Checks:
bun x tsc --noEmitis clean. - Tests:
src/kernel/version.tschanged on this branch, soscripts/fast.tscould not name the tests. I ran the 289 test files whose names match mcp, card, version or openapi instead. 2108 passed and 1 failed: "the private fork's owner sees it, with its parent named". I did not investigate it. It matched the name filter, but nothing in this pull touches fork visibility, so I think it fails on the base branch too. - Sandbox: that run also logged denied outbound connections to
localhost:80from the cell and hosted-child tests, which the sandbox blocks. - Gate:
gate.ts --fixchanged nothing. It notes two files with over-long comment lines,src/contract/served.tsandsrc/tui/screens/api.ts. Neither is in this pull, so I left them. - Earlier failure: the five
upstream-conflict-issuefailures in the forge's last check are still unexplained. They passed here three times.
Since my last review the only change is moving versionField above the agentCard docblock, so each comment documents its own function. That earlier ask is met and there is no behaviour change. The preview answers a short commit (a2a1c46) in both /.well-known/mcp and openapi info.version, never "dev". The cache keys now include the commit, and the new test covers the stamped, short-commit and nothing-known cases. No page markup changed, so the design principles are not engaged.
The MCP
initializeanswer,/.well-known/mcpand openapiinfo.versionno longer say "dev". The newtest/mcp-version.test.tsandtest/mcp-size.test.tspass, along with the other tests I touched or that exercise these answers. I did not run the full suite orbun scripts/design-lint.ts(nosrc/webpage markup changed); the forge's check runs the full suite on push.bun x tsc --noEmitandscripts/gate.ts --fixwere clean.scripts/fast.tsexited 2 (diff too broad to name), so I picked the test files myself.What changed
announcedVersion()insrc/kernel/version.tsreturns the stamped version, else the 7-character short commit, elsenull.serverInfoin theinitializeanswer,/.well-known/mcpand the other cards built insrc/core/mcp_card.ts(mcp.json, server card, agent card) use that helper. With no stamp and no commit they leaveversionout. The/mcppre-sign-ininitializepath is covered too.info.versionmust be a string, so it falls back tounreleasedwhen nothing is known. The openapi JSON, the API reference page and the TUI API screen all use it.test/mcp-version.test.tsboots the server stamped, unstamped with a commit, and with neither. It checksinitialize,/.well-known/mcpand openapiinfo.version, and asserts"dev"appears in none of them."dev"orrunning().versionin these answers; I changed them to expectannouncedVersion(), or noversionfor the unstamped MCP initialize.Left alone
/api/v1/health, theX-Forge-Versionheader and internal uses ofrunning().versionstill say "dev" for an unstamped build. The issue only covered the MCP, well-known and openapi answers.releaseOfand is unchanged.Try it
curl <host>/.well-known/mcpand readversion: a release number, a short commit, or absent.bun test test/mcp-version.test.ts.The pre-push hook required a commit whose message starts with
Try:, so I added an empty one; it carries the same instruction.Closes #15363