Files
restic-manager/internal/api/version.go
T
steve ac9d7b92ed
CI / Test (linux/amd64) (pull_request) Failing after 1m16s
CI / Lint (pull_request) Successful in 23s
CI / Build (windows/amd64) (pull_request) Successful in 23s
CI / Build (linux/amd64) (pull_request) Successful in 25s
CI / Build (linux/arm64) (pull_request) Successful in 22s
api+agent: document protocol-version stability and forget back-compat decisions
version.go: add a comment block explaining why Phase 5's wire changes
(CommandRunPayload, ConfigUpdatePayload, RepoStatsPayload reshapes) did
not bump CurrentProtocolVersion — lockstep deploy, no rolling-upgrade
path, smoke env restage enforces it. Notes where a version bump to 2
would be required if a multi-version path is ever introduced.

cmd/agent/main.go: document why the JobForget handler hard-errors on
empty ForgetGroups rather than falling back to a single-policy form.
The maintenance ticker is the only writer and always populates the
field; the fallback was specced but skipped given lockstep deploy.
2026-05-04 00:33:51 +01:00

27 lines
1.3 KiB
Go

package api
// CurrentProtocolVersion is the wire-format version this build speaks.
//
// Bump this only when an incompatible wire-format change lands —
// adding a new optional field does NOT count, removing or repurposing
// one does. The server enforces MinAgentProtocolVersion against this
// value at hello time. See spec.md §6.2 ("Protocol versioning").
const CurrentProtocolVersion = 1
// MinAgentProtocolVersion is the lowest agent protocol_version this
// server accepts in a hello. Agents below this are disconnected with
// a structured error pointing at the upgrade docs.
const MinAgentProtocolVersion = 1
// Phase 5 (P2R-03..P2R-08, branch p2r-phase5-maintenance, 2026-05) reshaped
// CommandRunPayload (RetentionPolicy removed, ForgetGroups added, RequiresAdminCreds added),
// ConfigUpdatePayload (Slot added), and RepoStatsPayload (full reshape).
// The protocol version was deliberately NOT bumped because:
// 1. This project deploys agent and server in lockstep from the same release.
// 2. There is no supported "rolling upgrade" path with mixed agent/server versions.
// 3. The smoke env restage block in CLAUDE.md restages the agent binary on
// every server build for exactly this reason.
//
// If a multi-version protocol path is ever introduced, every Phase 5 wire
// change is a breaking change and the version must bump to 2 at that time.