feat(agent): report running semver on the control channel (VA-94) #94
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/VA-94-report-running-semver"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Reports the agent's running release version (semver) on the mTLS control channel so the server can detect agents behind the configured release channel (VA-94). The existing server-pushed chunked update (verify + swap) is unchanged and confirmed end to end.
Why
The only version on the wire was the hardcoded numeric
DEFAULT_AGENT_VERSION(194) in theAuthInfohandshake. That is a constant unrelated to the release, so the server cannot compare it to a channel's latest SemVer. The realversion::VERSION(e.g.0.1.0-3-g1b66909, baked in bybuild.rs) was never put on the wire.Changes
DispatchContextcarriesagent_semver, defaulted toversion::VERSIONinfrom_host, so both productionfrom_hostcall sites innet.rsget it automatically (AC1).coreinforeply gains asemverfield; the numericagentversionis retained for back-compat (AC2).coreinforeport (actioncoreinfo, carryingsemver+commitdate) right afterAuthInfo, over the JSON channel, so the server records the version without polling. Newdispatch::coreinfo_reportreuses the exactcoreinfopayload shape (noresponseid). The packedAuthInfostruct is unchanged - it mirrors the upstream C wire layout, so the semver rides an additive JSON frame (AC3).Trust model (unchanged, matches VA-87)
The chunked push verifies streamed bytes only against the SHA-384 the authenticated server declares in the
AgentUpdateEnd frame; the agent trusts the mTLS-authenticated server to have verified the minisign signature server-side (VS-20). No second signature check is added on this path. TheoobupdateURL path keeps its signature check.Tests / checks
update::chunked_push_verifies_and_swaps_against_temp_exe: drivesAgentUpdateBegin /AgentUpdateBlockchunks /AgentUpdateEnd against a tempexe_paththrough the samehandle_update_frame/handle_blockpathnet.rsuses, assertsEndOutcome::Verifiedand thatswap_in_placereplaces the target. The production apply (execv/ Windowsspawn_updater) is never hit, gated by theexe_pathoverride (AC4).dispatch::coreinfo_report_carries_semver_without_responseid; updatedcoreinfo_includes_host_metadatato assertsemver.just check(fmt, clippy--deny warnings, test) passes; the authoritativeoci-build/check.Dockerfilebuild passes (also runs as the pre-commit hook on commit), including the Windows cross-check and swtpm TPM test (AC5).Acceptance criteria
DispatchContextcarriesagent_semver(fromversion::VERSION), set at both productionfrom_hostsites.coreinforeply includes asemverfield; numericagentversionretained.AuthInfostruct is unchanged.AgentUpdate/AgentUpdateBlockpush against a tempexe_pathand asserts verify + swap; the production apply path is unchanged.just checkpasses.