Bumping Usage-Verified Harness CLI Versions
Three harness CLIs — Antigravity (agy), Grok Build (grok), and Muse Code (muse) — have usage decoders or normalizers whose wire schema and token semantics are verified against live captures of specific CLI releases. Upgrading one of these CLIs without refreshing its fixtures and re-verifying decoding can silently corrupt or drop token telemetry.
Policy: Pinned vs Floating Images
Section titled “Policy: Pinned vs Floating Images”- Grok Build (
grok) is pinned inharnesses/grok-build/Dockerfile(ARG GROK_VERSION=1.0.92, overridable with--build-arg GROK_VERSION=latestfor ad-hoc testing).TestGrokBuildDockerfilePinsVerifiedVersionincmd/dockerfile_contract_test.gofails CI ifGROK_VERSIONis left unpinned, set tolatest, unused, or out of sync withGrokBuildVerifiedVersions. As a runtime safety net when overridden,UsageDeriverlogs a one-time warning if the OTLPHarnessVersiondiffers fromGrokBuildVerifiedVersions. - Antigravity (
agy) and Muse Code (muse) intentionally float via their upstream installers (https://antigravity.google/cli/install.shandhttps://dev.meta.ai/install.sh, perGoogleCloudPlatform/scion#4820andTestAntigravityDockerfileUsesInstaller). Both rely on runtime version checks as their safety net:agy:agydecode.IsVerifiedVersionmarks any version outsideagydecode.VerifiedVersionsasStatusUnverified, degrading usage reporting tocalls_onlyinstead of trusting unverified protobuf fields.muse:TelemetryHandlerprobesmuse --versiononce per installed version across short-lived hook processes (bounded by timeout +WaitDelay, no shell, viarootexec+procreapwithMUSE_NO_AUTO_UPDATE=1, killing the probe process group on timeout orWaitDelayexpiry), atomically records the result via same-directory0600temp file + rename (~/.scion/muse-version-check.jsonalongside~/.scion/muse-turn-usage.json, refusing leaf symlinks), and logs a warning when the installed version differs fromMuseCodeVerifiedVersions. No lock is taken around the probe or marker write so a hook never waits on another hook process; on a rare first-run race before the marker is in place, up to N concurrently racing hook processes may probe and emit the warning (not strictly one), after which the atomic marker suppresses further probes. Failed or unparseable probes are memoized in a negative marker with a 5-minute TTL (timestamps in the future are treated as expired) and re-probed after TTL expiry or binary replacement. When the marker cannot be read or written (symlink, directory, or read-only~/.scion), a bounded per-process memo caps probing at one probe per process.
Verified Versions and Source-of-Truth Records
Section titled “Verified Versions and Source-of-Truth Records”| Harness | CLI | Image Policy | Verified Version | Go Verified-Version Record | Fixtures & Tests | Image Recipe |
|---|---|---|---|---|---|---|
antigravity |
agy |
Floating + runtime StatusUnverified gate |
1.5.18 |
pkg/trajectory/agydecode/version.go (VerifiedVersions) |
pkg/trajectory/agydecode/testdata/ (decoder_test.go, fixture_test.go) |
harnesses/antigravity/Dockerfile |
grok-build |
grok |
Pinned (ARG GROK_VERSION) + runtime warning |
1.0.92 |
pkg/sciontool/telemetry/usage.go (GrokBuildVerifiedVersions) |
pkg/sciontool/telemetry/testdata/usage/grok-build-1.0.92.pb.json (usage_grok_test.go) |
harnesses/grok-build/Dockerfile |
muse-code |
muse |
Floating + runtime one-time warning | 1.4.25 (1.4.25-R9361.1) |
pkg/sciontool/hooks/handlers/muse_turn_delta.go (MuseCodeVerifiedVersions) |
pkg/sciontool/hooks/dialects/testdata/muse-code/session-usage-1.4.25.jsonl (muse_dialect_test.go) |
harnesses/muse-code/Dockerfile |
What Degradation Looks Like If a Bump Is Skipped
Section titled “What Degradation Looks Like If a Bump Is Skipped”Each harness fails differently when a newer CLI diverges from the verified version:
- Antigravity (
agy):agydecode.DecodeFilechecks the detectedagy --versionagainstagydecode.VerifiedVersions. Any unlisted version is markedStatusUnverified, which suppresses token attribution and degrades Hub usage reporting for those agents tocalls_only(onlyPreInvocation/PostInvocationhook call counts remain). If the SQLite schema (gen_metadata,steps,trajectory_metadata_blob) or protobuf field tags change, decoding may also reportStatusMalformed. - Grok Build (
grok):grokBuildUsageRuleexpectsgrok_code.api_request/grok_code.api_errorOTLP log events whereinput_tokensis inclusive ofcache_read_tokens(and assumed inclusive ofcache_creation_tokens, unverified live on1.0.92) andoutput_tokensis exclusive ofreasoning_tokens. If a newergrokrelease renames event names, changes attribute keys, or flips inclusivity (for example makingoutput_tokensinclusive ofreasoning_tokensorinput_tokensexclusive ofcache_read_tokens), token counts silently double-count, under-count, or drop to zero. WhenGROK_VERSIONis overridden to an unverified release,UsageDeriverlogs a one-time warning per process. - Muse Code (
muse):normalizeMuseTurnUsagesubtracts a monotonic per-(session_id, turn_id)high-water mark becausemuse 1.4.25emits turn-cumulative totals inPostLLMCall.usage. If a newermuserelease switchesPostLLMCall.usageto per-step counts, high-water subtraction silently under-counts steps after step 0 (dropping any step whose token counts do not exceed the prior step). When the floating image picks up a newermuserelease,TelemetryHandlerprobesmuse --versiononce per installed version across hook processes (recording the result in~/.scion/muse-version-check.json; a first-run race may emit up to one warning per concurrently racing hook process) and logs a warning.
Bump Process
Section titled “Bump Process”Follow these steps whenever moving one of these CLIs to a newer release (or when a floating agy/muse rebuild triggers the runtime version warning):
1. Build or Install the Candidate CLI Version
Section titled “1. Build or Install the Candidate CLI Version”- Grok Build: pass
--build-arg GROK_VERSION=<new-version>(or=latest) when buildingharnesses/grok-build/Dockerfile, or install directly in a throwaway environment viahttps://x.ai/cli/install.shwith<new-version>as the positional argument. - Antigravity: build
harnesses/antigravity/Dockerfile(which runshttps://antigravity.google/cli/install.sh) and record the exactagy --versionoutput printed in the build log. - Muse Code: build
harnesses/muse-code/Dockerfile(which runshttps://dev.meta.ai/install.sh) and record the exactmuse --versionoutput printed in the build log.
2. Capture and Scrub Fresh Usage Fixtures
Section titled “2. Capture and Scrub Fresh Usage Fixtures”Capture live outputs against a local mock or test endpoint (scrubbing host paths, UUIDs, timestamps, and any credentials):
- Antigravity (
agy): inspect a real conversation SQLite database (gen_metadata,steps,trajectory_metadata_blob) from the newagyrelease and confirm the protobuf wire layout matchespkg/trajectory/agydecode/testdata/README.md. Updatepkg/trajectory/agydecode/fixture_test.goif wire fields changed, then regenerate goldens:Terminal window UPDATE_GOLDEN=1 go test -buildvcs=false ./pkg/trajectory/agydecode/... - Grok Build (
grok): run a multi-step tool-calling turn plus a terminal error turn (e.g. invalid model HTTP 404) withGROK_EXTERNAL_OTEL=trueexporting to a local OTLP/gRPC receiver. Verifygrok_code.api_requestandgrok_code.api_errorevent names,input_tokens/cache_read_tokens/cache_creation_tokensinclusivity, andoutput_tokens/reasoning_tokensexclusivity. Save the scrubbed capture aspkg/sciontool/telemetry/testdata/usage/grok-build-<version>.pb.jsonand updategrokBuildUsageFixturePathinpkg/sciontool/telemetry/usage_grok_test.go. - Muse Code (
muse): run the four scenarios documented inpkg/sciontool/hooks/dialects/testdata/muse-code/README.md(single call with cache+reasoning, multi-step tool loop on oneturn_id, failed step 1 after successful step 0, and subagent call) against a local mock endpoint. Confirm whetherPostLLMCall.usageis still turn-cumulative or has switched to per-step. Save the scrubbed capture aspkg/sciontool/hooks/dialects/testdata/muse-code/session-usage-<version>.jsonl, updateREADME.md, and updateloadMuseUsagePayloadsinpkg/sciontool/hooks/handlers/muse_dialect_test.go.
3. Update the Verified-Version Record and Image Pin
Section titled “3. Update the Verified-Version Record and Image Pin”- Add (or update) the new version in the corresponding Go slice:
pkg/trajectory/agydecode/version.go(VerifiedVersions)pkg/sciontool/telemetry/usage.go(GrokBuildVerifiedVersions)pkg/sciontool/hooks/handlers/muse_turn_delta.go(MuseCodeVerifiedVersions)
- For Grok Build, update
ARG GROK_VERSIONinharnesses/grok-build/Dockerfileto matchGrokBuildVerifiedVersionsexactly. - For Muse Code, updating
MuseCodeVerifiedVersions(or rebuilding the image with a new/usr/local/bin/musebinary) automatically invalidates~/.scion/muse-version-check.jsonon the nextPostLLMCallhook; to force a fresh local probe without changing either, delete~/.scion/muse-version-check.json. - Update any version notes in
harnesses/<name>/usage.yamland (where present)harnesses/<name>/README.md.
4. Re-Verify Tests and Contract Guards
Section titled “4. Re-Verify Tests and Contract Guards”Run the decoder tests, rootexec guard, and Dockerfile contract guards:
go test -buildvcs=false ./pkg/trajectory/agydecode/...go test -buildvcs=false ./pkg/sciontool/telemetry/...go test -buildvcs=false ./pkg/sciontool/hooks/handlers/...go test -buildvcs=false ./pkg/sciontool/rootexec/...go test -buildvcs=false -tags no_sqlite -run 'Test.*Dockerfile' ./cmdIf decoder logic or verified-version lists changed in sciontool, rebuild scion-base first and then the affected harness images (image-build/README.md, “Build provenance and stale sciontool”).