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

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

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.

Notes

shipped production is serving it deploy b03b44b

opened this

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() in src/kernel/version.ts returns the stamped version, else the 7-character short commit, else null.
  • MCP and cards: serverInfo in the initialize answer, /.well-known/mcp and the other cards built in src/core/mcp_card.ts (mcp.json, server card, agent card) use that helper. With no stamp and no commit they leave version out. The /mcp pre-sign-in initialize path is covered too.
  • openapi: info.version must be a string, so it falls back to unreleased when 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.ts boots the server stamped, unstamped with a commit, and with neither. It checks initialize, /.well-known/mcp and openapi info.version, and asserts "dev" appears in none of them.
    • Four existing tests expected "dev" or running().version in these answers; I changed them to expect announcedVersion(), or no version for the unstamped MCP initialize.

Left alone

  • /api/v1/health, the X-Forge-Version header and internal uses of running().version still say "dev" for an unstamped build. The issue only covered the MCP, well-known and openapi answers.
  • The changelog already used releaseOf and is unchanged.

Try it

  • curl <host>/.well-known/mcp and read version: 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.

Closes #15363

6 earlier comments · 1 event
commented

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() in src/kernel/version.ts returns the stamped version, else the 7-character short commit, else null.
  • MCP and cards: serverInfo in the initialize answer, /.well-known/mcp and the other cards built in src/core/mcp_card.ts (mcp.json, server card, agent card) use that helper. With no stamp and no commit they leave version out. The /mcp pre-sign-in initialize path is covered too.
  • openapi: info.version must be a string, so it falls back to unreleased when 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.ts boots the server stamped, unstamped with a commit, and with neither. It checks initialize, /.well-known/mcp and openapi info.version, and asserts "dev" appears in none of them.
    • Four existing tests expected "dev" or running().version in these answers; I changed them to expect announcedVersion(), or no version for the unstamped MCP initialize.

Left alone

  • /api/v1/health, the X-Forge-Version header and internal uses of running().version still say "dev" for an unstamped build. The issue only covered the MCP, well-known and openapi answers.
  • The changelog already used releaseOf and is unchanged.

Try it

  • curl <host>/.well-known/mcp and read version: 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.

commented

<!-- 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
commented

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 a docs/features/<name>.md how-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 a No door: … line in the new commit message instead of adding a docs file.
  • Comment rewrap: bun scripts/gate.ts --fix reported 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.

commented

<!-- 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
commented

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.

commented

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.

Changes requested — before the latest push

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.

commented

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 --noEmit is clean.
  • Tests: src/kernel/version.ts changed on this branch, so scripts/fast.ts could 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:80 from the cell and hosted-child tests, which the sandbox blocks.
  • Gate: gate.ts --fix changed nothing. It notes two files with over-long comment lines, src/contract/served.ts and src/tui/screens/api.ts. Neither is in this pull, so I left them.
  • Earlier failure: the five upstream-conflict-issue failures in the forge's last check are still unexplained. They passed here three times.
Approved

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.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs