feat: report the server's own software version on both surfaces#7
Merged
Conversation
Add api_version + build to VersionInfo (distinct from the IDC data version), so callers can confirm which build of idc-api is running, not just which IDC release it serves. - core/version.py: shared package_version()/build_stamp()/server_version() helpers -- one source of truth for the software/build version. - VersionInfo gains api_version (package version) and build (the IDC_API_BUILD stamp, nullable); DiscoveryService.version() populates them. - REST: /v3/version returns the new fields; GET / adds server_version; OpenAPI info.version is now driven by server_version() instead of a hardcoded "3.0.0" literal. - MCP: get_idc_version returns the fields (so an agent can retrieve the server version via a tool call, not only the initialize handshake); _server_version() delegates to the shared helper. - Tests: version parity (core == REST == MCP), root + OpenAPI assertions. - Docs: user-guide /v3/version row + BUILD config row; deployment.md "which build is live?" note now covers the REST path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The MCP deploy step already set it; without it the hosted REST service reports build: null at /v3/version. Set it (short git SHA / image tag) on the REST step as well, and document it next to the REST deploy command in deployment.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Makes the server's own software/build version queryable — distinct from the IDC data version (
idc_version/idc_index_data_version). Motivated by the question "can I tell which build of the server is running?", which previously had no answer on the REST side and no tool-reachable answer on the MCP side (it lived only in the MCPinitializehandshake'sserverInfo.version, which the client consumes but the agent never sees).Changes
core/version.py(new): sharedpackage_version()/build_stamp()/server_version()— one source of truth for the software/build version.VersionInfogainsapi_version(theidc-apipackage version) andbuild(theIDC_API_BUILDstamp, nullable).DiscoveryService.version()populates them./v3/versionreturns the new fields;GET /addsserver_version; OpenAPIinfo.versionis now driven byserver_version()instead of a hardcoded"3.0.0"literal (also resolves the prior3.0.0vs3.0.0.dev0mismatch).get_idc_versionreturns the fields, so an agent can retrieve the server version via a tool call (not only the handshake);_server_version()now delegates to the shared helper./v3/versionrow +BUILDconfig row; deployment.md "which build is live?" note now covers the REST path.Behavior (with
IDC_API_BUILD=abc1234)The MCP
serverInfo.versionreports the identical string (shared helper).Verification
ruffclean; the REST/parity/MCP/guard suites pass offline (46 passed, 1 skipped = clinical parity, expected in a bundled-only build).🤖 Generated with Claude Code