Repository navigation
feat(server): add GetCompatibilityInfo, the feature registry, and --deployment-id - #823
Merged
Merged
Conversation
samuv
force-pushed
the
sdk/01-server-info
branch
from
August 28, 2026 13:23
9d85041 to
c337931
Compare
samuv
force-pushed
the
sdk/01-server-info
branch
from
August 28, 2026 13:50
c337931 to
51bea00
Compare
This was referenced Aug 28, 2026
samuv
force-pushed
the
sdk/01-server-info
branch
from
August 28, 2026 14:16
51bea00 to
7a05966
Compare
This was referenced Aug 28, 2026
jhrozek
approved these changes
Aug 30, 2026
jhrozek
left a comment
Contributor
There was a problem hiding this comment.
Reviewed with four parallel specialist passes (proto shape, security, architecture, library-reuse) plus verified the generated-code claim myself (task generate reproduces contracts/gen/ byte-for-byte). Everything checks out — auth is enforced structurally with no exemption path, deployment-id validation bounds are correct, capabilities/features are genuinely single-source, no hand-rolled logic that stdlib already covers. One question below, nothing blocking either way — approving.
samuv
added a commit
that referenced
this pull request
Aug 31, 2026
Addresses the #823 review: Config.BuildVersion had no writer anywhere outside server_info_test.go — no flag, no app.Config field, no linker var — so every real deployment reported build_version: "" while ADR 0244 presented it as a real affordance. Wired rather than deferred, because an affordance that is always empty is worse than an absent one: a client cannot tell "this server has no version" from "this field is broken". Derived, not operator-set. That is the opposite call from --deployment-id two commits earlier, and deliberately so: a deployment label names infrastructure topology an authenticated caller is not owed, whereas a build version names the software that caller is already talking to. There is nothing to leak. The source is the build info the Go toolchain already embeds, so an ordinary `task build` reports something useful with no build-system changes — which matters here because the repo has no ldflags infrastructure and no goreleaser to hook into. A released module reports its version; a source checkout reports the abbreviated VCS revision, suffixed -dirty when the toolchain recorded uncommitted changes. The dirty marker is the point of that arm: an operator reading a bug report most needs to know the binary corresponded to no commit precisely when the revision alone would mislead them into thinking it did. Verified against a real binary — bin/mecated reports v0.0.22-0.20260831075615-e7ceef15a515+dirty. app.Config.BuildVersion remains as an override, which is the -ldflags seam for a release build that knows better than the toolchain. THE POLICY IS SPLIT FROM THE READ, and the split is what makes the test real rather than decorative. debug.ReadBuildInfo() is not injectable and reports something DIFFERENT under `go test` than in a shipped binary: a test binary carries no vcs.* settings at all. A test calling the reader directly skipped — I wrote that version first and it passed while proving nothing about the case that actually broke. buildVersionFrom takes the *debug.BuildInfo as a parameter, so all four arms (released, checkout, dirty, genuinely-unknown) are exercised. The value is bounded and rejected outright if non-printable. It lands in a proto string on every GetServerInfo, and the override arm is arbitrary bytes chosen at link time — a newline there would inject a second line into anything that logs it. Rejecting beats sanitising for a diagnostic field: a mangled version string is worse than none, because it still looks like data. Gates: task lint 0 issues all modules; go test green on internal/app and internal/adapter/server. Refs #821. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Samuele Verzi <[email protected]>
samuv
force-pushed
the
sdk/01-server-info
branch
from
August 31, 2026 08:11
7a05966 to
4eb977a
Compare
samuv
force-pushed
the
sdk/01-server-info
branch
from
August 31, 2026 08:50
4eb977a to
5d7c7e0
Compare
samuv
force-pushed
the
sdk/01-server-info
branch
from
August 31, 2026 08:52
5d7c7e0 to
2b60e4e
Compare
samuv
force-pushed
the
sdk/01-server-info
branch
2 times, most recently
from
August 31, 2026 09:16
fa83226 to
3ab5581
Compare
…eployment-id PR 1 of the #821 server-enabler stack. Implements Scenario 1 of docs/acceptance/sdk-server-enablers.md (AC1.1-AC1.7) per ADR 0248. An SDK's first question is "what may I do with this server?" and today the only way to ask is to create a probe session and read the ServerCapabilities echo off CreateSessionResponse. GetCompatibilityInfo answers it directly: api_major, the operator-enabled capabilities, the build's feature identifiers, and an optional deployment label. Authenticated like every other RPC, with a GET /v1/compatibility peer reading the SAME projection so the two transports cannot disagree. SEPARATE FROM GetServerInfo, WHICH IS NOT A NAMING PREFERENCE. This scenario was written proposing the name GetServerInfo. While the stack was open, ADR 0245 (safe build diagnostics) shipped an RPC by that name for build identity — build_id, server_implementation, an optional sanitized provider display endpoint — behind an explicit privacy boundary: that response "must never carry ... capabilities, authentication or TLS details, arbitrary configuration". capabilities and features are exactly what the boundary excludes, so folding this descriptor into that message would have meant superseding a shipped privacy contract to save one round trip. Overloading the name the other way is worse: one message answering both "which build is this?" and "what may I do here?" has two audiences and two change cadences. So identity stays on GetServerInfo // /v1/info and negotiation lives on GetCompatibilityInfo // /v1/compatibility. A client wanting both makes both calls — the honest cost of the boundary. NO BUILD IDENTITY HERE. An earlier revision carried build_version derived from debug.ReadBuildInfo(). ADR 0245's ldflags-stamped internal/buildinfo.BuildID (wired in Taskfile.yml and .ko.yaml) is the single build-identity mechanism, and a second field derived a second way is the drift the single-source discipline exists to prevent. Dropped, including the field number, since the message has never shipped. CAPABILITIES AND FEATURES ARE TWO VOCABULARIES, NOT ONE. capabilities answers "what has this operator enabled?" and moves with config; features answers "what does this build implement?" and moves on upgrade. Collapsing them makes a --no-bash deployment indistinguishable from version skew — a client would reject a correctly-configured server as too old, or call an RPC this build has never heard of. AC1.5 pins the independence. features are OPEN STRINGS, not an enum: the EvNoProgress/StopBudget string-passthrough discipline. An unrecognised identifier is ignored by an older client, so publishing one is a minor release rather than a wire-compat event. The registry is the single source for both transports (AC1.4). capabilities reuses the EXISTING composition-computed intersection verbatim rather than recomputing — the AGENTS.md invariant that capability truth is ONE intersection. Media stays session-authoritative: the image/audio hint here is UI chrome, and the per-session CreateSessionResponse echo remains the authority (AC1.7). --deployment-id is opaque, bounded (128 bytes), printable single-line, and empty by default. It is NEVER inferred from hostname, pod name, or environment: infrastructure topology is not something an authenticated caller is owed, and a label the operator did not choose is a leak with no consenting author. Gates: task lint 0 issues all modules; task generate reproduces contracts/gen byte-for-byte; go test green; docs/lint + matlatl --strict green. Refs #821. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Samuele Verzi <[email protected]>
samuv
force-pushed
the
sdk/01-server-info
branch
from
August 31, 2026 10:18
3ab5581 to
d4d9bf0
Compare
kantord
added a commit
that referenced
this pull request
Aug 31, 2026
Per samuv's review: fix the promoted-run wedge (drain via the same approve-handler REHYDRATE precedent instead of handing back a bare run_id), carry multimodal parts in the request contract (ADR 0251), add a feature-registry row instead of discover-by-404ing (PR #823), and rename steer-cancel to cancel-steer to match the cancel-child verb-first convention. Fully or partially written by an AI agent. Co-Authored-By: Claude <[email protected]>
kantord
added a commit
that referenced
this pull request
Aug 31, 2026
* docs: ADR 0252 — HTTP steer endpoint
Extends ADR 0232's named deferral: POST /v1/sessions/{id}/steer +
steer-cancel, mirroring approve/cancel, reusing the RFC 9457 registry
for stale-control rejection. No engine change — pure transport
addition over the existing Service.Steer/Service.CancelSteer calls.
Docs only; implementation tracked separately.
Refs #873, #821.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
* docs: address review feedback on ADR 0252
Per samuv's review: fix the promoted-run wedge (drain via the same
approve-handler REHYDRATE precedent instead of handing back a bare
run_id), carry multimodal parts in the request contract (ADR 0251),
add a feature-registry row instead of discover-by-404ing (PR #823),
and rename steer-cancel to cancel-steer to match the cancel-child
verb-first convention.
Fully or partially written by an AI agent.
Co-Authored-By: Claude <[email protected]>
* docs: regenerate llms.txt after rebase
* docs: spell out the two distinct stale-run-control refusals
Per samuv's review thread on the 409 bullet: name both refusal
paths funneling through stale_run_control explicitly (an
expected_run_id naming a non-current run, and strict steer's
deliberate non-promotion on a terminal named run) rather than
leaving the second implicit.
Fully or partially written by an AI agent.
Co-Authored-By: Claude <[email protected]>
* docs: name the shared media validation/capability path for steer parts
Per samuv's review thread: state explicitly that steer parts reuse
toContentParts/session.NewContent/ValidateMediaParts and the same
ProviderCapabilities() gate as the ACP prompt path, not a second
validation path.
Fully or partially written by an AI agent.
Co-Authored-By: Claude <[email protected]>
---------
Co-authored-by: Claude Sonnet 5 <[email protected]>
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
PR 1 of 9 in the #821 server-enabler stack. Implements Scenario 1 of
docs/acceptance/sdk-server-enablers.md— AC1.1 through AC1.7 — per ADR 0248.Adds
GetCompatibilityInfo(gRPC +GET /v1/compatibility), the build's feature registry, andmecated --deployment-id.GetServerInfo→GetCompatibilityInfoThis PR was originally
GetServerInfo+GET /v1/server-info, and was approved under that name. While the stack was open,mainshipped its ownGetServerInfo— ADR 0245 "Safe build diagnostics" (Accepted), carryingbuild_id/server_implementation/ an optional sanitized provider display endpoint onGET /v1/info, already consumed by mecatui's diagnostics pane.That is a hard collision (identical RPC and message names) and a semantic one. ADR 0245 draws an explicit privacy boundary around its response: it "must never carry … capabilities, authentication or TLS details, arbitrary configuration".
capabilitiesandfeaturesare precisely what that excludes.So the two are now separate resources:
GetServerInfoGET /v1/infoGetCompatibilityInfoGET /v1/compatibilityWhy not fold them. Merging would have meant superseding a shipped privacy contract to save one round trip. Overloading the name the other way is worse — one message answering both questions has two audiences and two change cadences. A client wanting both makes both calls; that is the honest cost of the boundary.
build_versionis gone. An earlier revision derived it fromdebug.ReadBuildInfo(). ADR 0245's ldflags-stampedinternal/buildinfo.BuildID(wired inTaskfile.ymland.ko.yaml) is the single build-identity mechanism, and a second field derived a second way is exactly the drift the single-source discipline exists to prevent. Dropped, field number included, since the message never shipped. This reverts thebuildversion.gowork added in response to @jhrozek's review comment — that comment was right, andmainhas since answered it better; details on that thread.The ADRs also renumbered 0244–0246 → 0248–0250, because
maintook 0244/0245/0246.Why
A client could not ask "what may I do with this server?" without side effects.
ServerCapabilitiesridesCreateSessionResponseonly, so discovery cost a probe session that then had to be cleaned up.GetCompatibilityInfoanswers it directly on both transports.The load-bearing decision
The response carries two vocabularies side by side, not one merged set:
capabilitiesfeaturesConflating them is a bug in both directions: a client reading a disabled capability as version skew rejects a correctly-configured
--no-bashdeployment; one inferring protocol support from an operator toggle calls an RPC the server has never heard of.TestADR_0248_CapabilitiesAreNotFeaturespins the independence by toggling a capability and asserting the feature set does not move.capabilitiesreusesService.capabilities()verbatim rather than building a parallel projection — a second projection would drift from theCreateSessionecho and let the server contradict itself about its own configuration. AC1.1 assertsproto.Equalbetween the two.Notable choices
featuresare open strings, not a proto enum — theEvNoProgress/StopBudgetstring-passthrough discipline AGENTS.md already records. Each PR in this stack appends its identifier as it lands, so a partially-deployed stack (which will exist — these land inmainincrementally) describes itself honestly.serverFeatures()returns a clone; the test mutates a returned slice to prove the registry can't be corrupted through a response the gRPC layer may retain.api_majorstarts at 1 and stays there for this entire stack. Being able to add capability without bumping the major is the whole point offeatures.--deployment-idis empty by default and never inferred from hostname, pod name, or environment. Infrastructure topology isn't something an authenticated caller is owed, and a label the operator didn't choose is a leak with no consenting author. It's validated at startup — printable, single-line, valid UTF-8, ≤128 bytes — because the value is echoed verbatim to every caller and rendered by clients we don't control:Rejecting while the operator is present beats sanitising at every render site.
Auth failure must not look like version skew.
GetCompatibilityInfois authenticated like every other RPC, and the test pins that a missing or wrong token yieldsUNAUTHENTICATED, neverUNIMPLEMENTED— the SDK readsUNIMPLEMENTEDas "below the compatibility floor" and stops probing, so a credentials problem presenting as a version problem would send an operator hunting the wrong thing.Acceptance criteria
TestSDKServerEnablers_Scenario1_CompatibilityInfoMatchesCapabilitiesTestSDKServerEnablers_Scenario1_CompatibilityInfoTransportParityTestSDKServerEnablers_Scenario1_CompatibilityInfoRequiresAuthTestADR_0248_FeatureRegistryIsSingleSourceTestADR_0248_CapabilitiesAreNotFeaturesTestADR_0248_DeploymentIdentityIsOperatorSetOnly+TestValidateDeploymentIDTestInvariant_capability_truth_single_intersectionVerification
task lint— 0 issues across all modules.task api:check— green.task test— green across root,engine,authn/oidc, all fourprovider/*modules,test:engine-standalone, andtest:provider-standalone.go run ./cmd/mecademo— full offline session still prints.task generatereproducescontracts/gen/byte-for-byte; no hand-edits.docs/lint+matlatl check --strictgreen.main, not from this PRtest:authn-standalone:authn/oidc/fixture_test.go:12importsinternal/adapter/server, breaking theGOWORK=offstandalone hygiene proof. Verified present onorigin/main.jsonlstore's durability check (fix(jsonlstore): finish durability guarantees #786) rejects the defaultTMPDIRbecause it sits under/var, a symlink to/private/var. Local runs needTMPDIRoverridden; CI on Linux is unaffected.Both left alone — each deserves its own fix, and folding them in would hide them.
Refs #821.
🤖 Generated with Claude Code