feat: record stateless release results through the fleet API
Persist fenced one-copy release phases with revision checks and exact committed-success recovery. Add fleet-authenticated coordinator and release doors using the existing lifetime judge and app record lock. Cover fleet isolation, CAS races, terminal release outcomes and lost replies; refresh the census and apply approved SR-1-C04 and SR-1-C12 copy. Activator clients and runtime integration remain in Task 2c.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
approved_stateless_replicas_copy_test.go+1 −1internal/console/authcli.go+2 −0internal/console/replicacoordinator.go+161 −0internal/console/replicacoordinator_test.go+237 −0internal/provision/plan9_b8_census_test.go+1 −1internal/provision/replicadeploy.go+67 −0internal/provision/replicadeploy_test.go+251 −0internal/provision/stateless_replicas_census_test.go+9 −0internal/provision/testdata/plan14-root-reads-stateless-replicas-1.tsv+1 −1
Intent
<task-notification> <task-id>b0cerh322</task-id> <tool-use-id>toolu_01NZcmwrt285zLypmznWutuA</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/412bbef6-9468-4e8d-b9fe-5343bad21de8/tasks/b0cerh322.output</output-file> <status>completed</status> <summary>Background command "Wait for Task 1 fix round 1" completed (exit code 0)</summary> </task-notification>
<task-notification> <task-id>af4940aeb9d4cdf42</task-id> <tool-use-id>toolu_01YQJLQG4jufCQk6vs6SnyRt</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/412bbef6-9468-4e8d-b9fe-5343bad21de8/tasks/af4940aeb9d4cdf42.output</output-file> <status>completed</status> <summary>Agent "Re-review Task 1 fix round 1" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>**F1: ADDRESSED.** - The unconditional manifest GET is gone from both `claimRawShip` and `claimRawShipSpooled`. They now publish through `putImmutableManifest` (internal/release/release.go:792, internal/release/rootfs_ship.go:418). - On success, `putImmutableManifest` returns as soon as the create-only `putImmutable` succeeds, with no read (internal/release/stateless.go:22-26). `GetManifestRaw` only runs after a failed publication. That puts a normal first ship back at 32 requests. - The budget lock is not raised. The diff does not touch the perf test or its lock. - A changed declaration is still refused with the exact SR-1-C03 text: - **Console:** the existing pre-ship read returns 409 with the C03 text at internal/console/apicli.go:2478-2480 and internal/console/apiship_rootfs.go:276-278. - **Release layer (direct CLI ships and races):** the manifest put fails because the bytes differ, the stored manifest is read, and `ErrStorageDeclarationConflict` comes back wrapped as "ship: manifest: …" (stateless.go:27-29). `errors.Is` still matches through that wrapping. - **No artifact is served under a conflicting declaration:** artifacts are create-only, keyed by version, and the manifest is published last. A conflicting re-ship leaves the stored manifest byte-identical (TestStatelessShipConflictKeepsManifest, stateless_test.go:191-197). A changed declaration therefore never becomes the served one. - I did not re-run the perf test. The report shows `TestPerfWriteRoutesMeetTheBudget|Stateless` passing (report lines 238-239), and nothing in the code gave me a specific doubt. **F2: ADDRESSED.** - internal/release/stateless_test.go:95 now asserts `errors.Is(err, ErrStorageDeclarationConflict)`. - A new test at stateless_test.go:162-200 covers both spooled and non-spooled ships, in both directions, and checks the sentinel and the unchanged manifest bytes. - The console tests now require 409 and `out["error"] == release.ErrStorageDeclarationConflict.Error()` (internal/console/stateless_ship_test.go:30, :65). **New breakage: none at Critical or Important.** - The four paths still refuse: - **Binary/API and rootfs/API:** the console's existing read, unchanged. - **Binary direct (`cli.go:2693`) and rootfs direct (`ship_rootfs.go:349`):** the manifest publication fails and `putImmutableManifest` refuses. - No error is swallowed. If the follow-up read fails or the declaration matches, the original publication error is returned (stateless.go:30). - **Race check:** two concurrent first ships with different declarations write identical artifact bytes. Only one manifest can win the create-only put, and the loser gets the sentinel. A conflicting declaration therefore never publishes a manifest. **Out of scope (minor):** 1. **Message on a direct re-ship with rebuilt bytes:** the check now runs after the artifacts are written. If a direct-mode re-ship changes the declaration and the rebuilt artifact bytes also differ, the person gets the artifact "already exists with different content" refusal instead of the C03 text. It is still refused. 2. **Console race maps to 502:** in a console race (two first ships of the same version, past the pre-read), the wrapped sentinel is not matched by `shipImmutableConflict` (apicli.go:1870, a string match on "already exists with different content"). The person would get a 502 store-failed answer, not a 409 with the C03 text. This predates the fix (5855faab returned the bare sentinel, which was also unmapped) and only shows up in that race. It could be fixed with an `errors.Is` branch beside `shipKindRefusedAtPublication`. 3. **C03 text gains a prefix in direct mode:** direct CLI output now reads "ship: manifest: this version was already shipped…", with a prefix the old bare sentinel did not have. The C03 text itself is intact. 4. **Extra read on the failure path:** a failed publication reads the manifest twice (once inside `putImmutable`, once in `GetManifestRaw`). This is on the failure path only and has no effect on the budget. **Census: approve.** No read unit's disposition changed. The only census change is the internal/release coverage fingerprint (plan14-root-reads-stateless-replicas-1.tsv). The new read on the error path is `GetManifestRaw` of the same `ManifestKey(acct, app, version)` that the ship is already writing. Its app and version come from a manifest that was validated a few lines earlier, and the bytes are parsed and validated before use. It runs in the console or the person's CLI, not in a box unit as root. It does not open, run, follow or query any path or input that a tenant, app or box agent can create, write or name beyond the release key the shipper is already writing. **Verdict: all addressed.**</result> <usage><subagent_tokens>59809</subagent_tokens><tool_uses>8</tool_uses><duration_ms>82449</duration_ms></usage> </task-notification>
Attributed to this commit: 5.91 g CO₂e (672,911 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on stateless-replicas-1-runtime, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.
diff --git a/approved_stateless_replicas_copy_test.go b/approved_stateless_replicas_copy_test.go| index 15a0d6295..52a9268ab 100644 |
| --- a/approved_stateless_replicas_copy_test.go |
| +++ b/approved_stateless_replicas_copy_test.go |
| @@ -9,7 +9,7 @@ import ( |
| const statelessReplicaCopyDeck = "docs/superpowers/plans/2026-11-01-stateless-replicas-copy.md" |
| -var statelessReplicaBuiltCopy = []string{"SR-1-C01", "SR-1-C02", "SR-1-C03", "SR-1-C09", "SR-1-C10", "SR-1-C13"} |
| +var statelessReplicaBuiltCopy = []string{"SR-1-C01", "SR-1-C02", "SR-1-C03", "SR-1-C04", "SR-1-C12", "SR-1-C09", "SR-1-C10", "SR-1-C13"} |
| func statelessReplicaCopyRows(t *testing.T) []copyRow { |
| t.Helper() |
diff --git a/internal/console/authcli.go b/internal/console/authcli.go| index c1376804f..6113e23de 100644 |
| --- a/internal/console/authcli.go |
| +++ b/internal/console/authcli.go |
| @@ -528,6 +528,8 @@ func (s *Server) cliGateRefused(allow svcrole.Set, h http.HandlerFunc, refused f |
| // Every /api/cli/ door goes through cliRoute and names its roles. Pinned by |
| // TestEveryCLIDoorNamesItsRoles. |
| func (s *Server) registerCLIRoutes() { |
| + s.registerRoute("POST /api/fleet/replicas/{account}/{app}/{host}/coordinator", s.handleReplicaCoordinator) |
| + s.registerRoute("POST /api/fleet/replicas/{account}/{app}/{host}/release", s.handleReplicaRelease) |
| s.registerRoute("POST /auth/cli/start", s.handleCLIStart) |
| s.registerRoute("POST /auth/cli/poll", s.handleCLIPoll) |
| s.registerRoute("GET /auth/cli", s.handleCLIApprovePage) |
diff --git a/internal/console/replicacoordinator.go b/internal/console/replicacoordinator.go| new file mode 100644 |
| index 000000000..030f3e155 |
| --- /dev/null |
| +++ b/internal/console/replicacoordinator.go |
| @@ -0,0 +1,161 @@ |
| +package console |
| + |
| +import ( |
| + "encoding/json" |
| + "errors" |
| + "io" |
| + "net/http" |
| + "strings" |
| + "time" |
| + |
| + "github.com/carlosframework/platform/internal/provision" |
| + "github.com/carlosframework/platform/internal/release" |
| + "github.com/carlosframework/platform/internal/replicas" |
| +) |
| + |
| +const replicaReleaseChanged = "this instance changed before the operation finished. the app keeps serving" |
| +const replicaCoordinatorChanged = "this instance changed before the coordination update finished. try again" |
| + |
| +// replicaFleetRecord authenticates before exposing any record information. The |
| +// same check runs again under the app lock immediately before the typed writer. |
| +func (s *Server) replicaFleetRecord(r *http.Request) (*provision.Record, string, bool) { |
| + account, app, host := r.PathValue("account"), r.PathValue("app"), r.PathValue("host") |
| + if !release.ValidAccount(account) || !release.ValidApp(app) || !provision.ValidHostShape(host) { |
| + return nil, "", false |
| + } |
| + name := r.Header.Get("Carlos-Tunnel-Name") |
| + fleet, box, ok := strings.Cut(name, "/") |
| + if !ok { |
| + return nil, "", false |
| + } |
| + token, bearer := strings.CutPrefix(r.Header.Get("Authorization"), "Bearer ") |
| + reg, err := openRegistry(s.cfg.Registry) |
| + if err != nil || !bearer || !fleetIdentityOK(reg, name, token, fleet, account) { |
| + return nil, "", false |
| + } |
| + rec, _, err := s.readRecord(r.Context(), account, app, host) |
| + if err != nil || rec == nil || rec.Retired || rec.Region != "fleet/"+fleet || rec.FleetBox != box { |
| + return nil, "", false |
| + } |
| + return rec, box, true |
| +} |
| + |
| +func replicaPayload(r *http.Request, dst any) bool { |
| + d := json.NewDecoder(io.LimitReader(r.Body, 8193)) |
| + d.DisallowUnknownFields() |
| + if d.Decode(dst) != nil { |
| + return false |
| + } |
| + return d.Decode(new(any)) == io.EOF |
| +} |
| + |
| +func (s *Server) handleReplicaCoordinator(w http.ResponseWriter, r *http.Request) { |
| + rec, box, ok := s.replicaFleetRecord(r) |
| + if !ok { |
| + http.NotFound(w, r) |
| + return |
| + } |
| + var req struct { |
| + Incarnation string `json:"incarnation"` |
| + replicas.CoordinatorChange |
| + } |
| + if !replicaPayload(r, &req) || req.Box != "" && req.Box != box { |
| + http.NotFound(w, r) |
| + return |
| + } |
| + req.Box = box |
| + id := replicas.Identity{Account: rec.Account, App: rec.App, Host: rec.Host, Incarnation: req.Incarnation} |
| + var result *provision.Record |
| + unauthorized := false |
| + err := s.withRecordLock(id.Account, id.App, func() error { |
| + if _, _, ok := s.replicaFleetRecord(r); !ok { |
| + unauthorized = true |
| + return replicas.ErrFenced |
| + } |
| + var err error |
| + result, err = provision.SetRecordCoordinator(r.Context(), s.cfg.Releases, id, req.CoordinatorChange, time.Now()) |
| + return err |
| + }) |
| + if unauthorized { |
| + http.NotFound(w, r) |
| + return |
| + } |
| + var held *replicas.CoordinatorHeldError |
| + if errors.As(err, &held) { |
| + w.Header().Set("Content-Type", "application/json") |
| + w.WriteHeader(http.StatusConflict) |
| + _ = json.NewEncoder(w).Encode(struct { |
| + RetryAt time.Time `json:"retry_at"` |
| + }{held.RetryAt}) |
| + return |
| + } |
| + if err != nil { |
| + jsonError(w, http.StatusConflict, replicaCoordinatorChanged) |
| + return |
| + } |
| + if req.Op != "renew" { |
| + s.bumpSerial(r.Context()) |
| + } |
| + remaining := time.Until(result.Coordinator.ExpiresAt).Milliseconds() |
| + if remaining < 0 { |
| + remaining = 0 |
| + } |
| + w.Header().Set("Content-Type", "application/json") |
| + _ = json.NewEncoder(w).Encode(replicas.CoordinatorReply{Lease: *result.Coordinator, RemainingMS: remaining}) |
| +} |
| + |
| +func (s *Server) handleReplicaRelease(w http.ResponseWriter, r *http.Request) { |
| + rec, box, ok := s.replicaFleetRecord(r) |
| + if !ok { |
| + http.NotFound(w, r) |
| + return |
| + } |
| + var req struct { |
| + Incarnation string `json:"incarnation"` |
| + replicas.ReleaseChange |
| + } |
| + if !replicaPayload(r, &req) { |
| + http.NotFound(w, r) |
| + return |
| + } |
| + id := replicas.Identity{Account: rec.Account, App: rec.App, Host: rec.Host, Incarnation: req.Incarnation} |
| + var result *provision.Record |
| + unauthorized := false |
| + changed := false |
| + err := s.withRecordLock(id.Account, id.App, func() error { |
| + current, _, ok := s.replicaFleetRecord(r) |
| + if !ok { |
| + unauthorized = true |
| + return replicas.ErrFenced |
| + } |
| + if current.Coordinator == nil || current.Coordinator.Box != box || current.Coordinator.Term != req.Term { |
| + return replicas.ErrFenced |
| + } |
| + next := replicas.Deploy{ID: req.ID, Incarnation: req.Incarnation, Term: req.Term, Target: req.Target, Phase: req.Op} |
| + if next.Phase == "begin" { |
| + next.Phase = "pending" |
| + } |
| + if current.ReplicaDeploy != nil && current.ReplicaDeploy.ID == req.ID { |
| + next.Previous = current.ReplicaDeploy.Previous |
| + } |
| + var err error |
| + result, err = provision.SetRecordReplicaRelease(r.Context(), s.cfg.Releases, id, req.Revision, next) |
| + if err == nil { |
| + changed = result.RecordSeq != current.RecordSeq |
| + } |
| + return err |
| + }) |
| + if unauthorized { |
| + http.NotFound(w, r) |
| + return |
| + } |
| + if err != nil { |
| + jsonError(w, http.StatusConflict, replicaReleaseChanged) |
| + return |
| + } |
| + if changed { |
| + s.bumpSerial(r.Context()) |
| + } |
| + w.Header().Set("Content-Type", "application/json") |
| + _ = json.NewEncoder(w).Encode(result.ReplicaDeploy) |
| +} |
diff --git a/internal/console/replicacoordinator_test.go b/internal/console/replicacoordinator_test.go| new file mode 100644 |
| index 000000000..e78359499 |
| --- /dev/null |
| +++ b/internal/console/replicacoordinator_test.go |
| @@ -0,0 +1,237 @@ |
| +package console |
| + |
| +import ( |
| + "bytes" |
| + "context" |
| + "encoding/json" |
| + "io" |
| + "net/http" |
| + "strings" |
| + "testing" |
| + "time" |
| + |
| + "github.com/carlosframework/platform/internal/provision" |
| + "github.com/carlosframework/platform/internal/registry" |
| + "github.com/carlosframework/platform/internal/replicas" |
| +) |
| + |
| +func replicaAPIFixture(t *testing.T) (*interactiveFx, string, string) { |
| + t.Helper() |
| + fx := newIxFx(t, "replica-api") |
| + token, _, _ := ixFleetWorld(t, fx, fx.acct) |
| + rec, _ := ixRecord(t, fx, ixHost) |
| + if err := provision.SetRecordFleetBox(context.Background(), fx.rel, fx.acct, "shop", ixHost, provision.FleetBoxExpect{Region: rec.Region, CreatedAt: rec.CreatedAt}, "b1", time.Now()); err != nil { |
| + t.Fatal(err) |
| + } |
| + inc, err := provision.Incarnation(rec.Account, rec.App, rec.Host, rec.CreatedAt) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + return fx, token, inc |
| +} |
| + |
| +func replicaPost(t *testing.T, fx *interactiveFx, path, name, token string, payload any) (int, []byte) { |
| + t.Helper() |
| + body, err := json.Marshal(payload) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + req, err := http.NewRequest(http.MethodPost, fx.ts.URL+path, bytes.NewReader(body)) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + req.Header.Set("Authorization", "Bearer "+token) |
| + req.Header.Set("Carlos-Tunnel-Name", name) |
| + res, err := http.DefaultClient.Do(req) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + defer res.Body.Close() |
| + raw, err := io.ReadAll(res.Body) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + return res.StatusCode, raw |
| +} |
| + |
| +func TestReplicaCoordinatorFleetIsolation(t *testing.T) { |
| + fx, token, inc := replicaAPIFixture(t) |
| + base := "/api/fleet/replicas/" + fx.acct + "/shop/" + ixHost |
| + for _, door := range []string{"coordinator", "release"} { |
| + for _, tc := range []struct{ name, path, identity, token, extra string }{ |
| + {"other fleet", base, "away/a1", token, ""}, |
| + {"other account", strings.Replace(base, fx.acct, "baj", 1), "home/b1", token, ""}, |
| + {"other box", base, "home/b2", token, ""}, |
| + {"unregistered", base, "home/missing", token, ""}, |
| + {"revoked", base, "home/b1", "revoked", ""}, |
| + {"malformed", strings.Replace(base, "/shop/", "/bad!/", 1), "home/b1", token, ""}, |
| + {"payload account", base, "home/b1", token, "account"}, |
| + {"payload host", base, "home/b1", token, "host"}, |
| + {"payload box", base, "home/b1", token, "box"}, |
| + } { |
| + t.Run(door+"/"+tc.name, func(t *testing.T) { |
| + p := map[string]any{"incarnation": inc, "op": "acquire", "boot_id": "boot"} |
| + if door == "release" { |
| + p = map[string]any{"incarnation": inc, "op": "begin"} |
| + } |
| + if tc.extra != "" { |
| + p[tc.extra] = "spoofed" |
| + } |
| + code, raw := replicaPost(t, fx, tc.path+"/"+door, tc.identity, tc.token, p) |
| + if code != 404 || string(raw) != "404 page not found\n" { |
| + t.Fatalf("%d %q", code, raw) |
| + } |
| + }) |
| + } |
| + } |
| + // An active but unassigned box must be refused too. |
| + reg, _ := openRegistry(fx.regPath) |
| + if err := reg.SetFleetBoxStatus("home", "b2", "active"); err != nil { |
| + t.Fatal(err) |
| + } |
| + unassignedToken, hash, err := mintFleetToken() |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if err := reg.AddFleetBox(registry.FleetBox{Fleet: "home", Label: "b3", TokenHash: hash}); err != nil { |
| + t.Fatal(err) |
| + } |
| + code, raw := replicaPost(t, fx, base+"/coordinator", "home/b3", unassignedToken, map[string]any{"incarnation": inc, "op": "acquire", "boot_id": "boot"}) |
| + if code != 404 || string(raw) != "404 page not found\n" { |
| + t.Fatalf("unassigned: %d %q", code, raw) |
| + } |
| +} |
| + |
| +func TestReplicaReleaseFleetAPIConsole(t *testing.T) { |
| + fx, token, inc := replicaAPIFixture(t) |
| + base := "/api/fleet/replicas/" + fx.acct + "/shop/" + ixHost |
| + code, raw := replicaPost(t, fx, base+"/coordinator", "home/b1", token, map[string]any{"incarnation": inc, "op": "acquire", "boot_id": "boot"}) |
| + if code != 200 { |
| + t.Fatalf("acquire %d %s", code, raw) |
| + } |
| + var reply replicas.CoordinatorReply |
| + if err := json.Unmarshal(raw, &reply); err != nil { |
| + t.Fatal(err) |
| + } |
| + if reply.RemainingMS <= 0 || reply.RemainingMS > int64((15*time.Minute).Milliseconds()) { |
| + t.Fatal(reply) |
| + } |
| + var d replicas.Deploy |
| + for _, op := range []string{"begin", "releasing", "released"} { |
| + code, raw = replicaPost(t, fx, base+"/release", "home/b1", token, map[string]any{"incarnation": inc, "op": op, "id": "deploy-1", "term": reply.Lease.Term, "revision": d.Revision, "target": replicas.Build{Version: "v1", Digest: "digest"}}) |
| + if code != 200 { |
| + t.Fatalf("%s %d %s", op, code, raw) |
| + } |
| + previous := d.Revision |
| + if err := json.Unmarshal(raw, &d); err != nil { |
| + t.Fatal(err) |
| + } |
| + if d.Revision != previous+1 { |
| + t.Fatal(d) |
| + } |
| + } |
| + rec, _ := ixRecord(t, fx, ixHost) |
| + if rec.ReplicaDeploy == nil || rec.ReplicaDeploy.Phase != "released" { |
| + t.Fatal(rec.ReplicaDeploy) |
| + } |
| +} |
| + |
| +func TestReplicaReleaseLostSuccessReplyConsole(t *testing.T) { |
| + fx, token, inc := replicaAPIFixture(t) |
| + base := "/api/fleet/replicas/" + fx.acct + "/shop/" + ixHost |
| + code, raw := replicaPost(t, fx, base+"/coordinator", "home/b1", token, map[string]any{"incarnation": inc, "op": "acquire", "boot_id": "boot"}) |
| + if code != 200 { |
| + t.Fatalf("%d %s", code, raw) |
| + } |
| + var reply replicas.CoordinatorReply |
| + _ = json.Unmarshal(raw, &reply) |
| + p := map[string]any{"incarnation": inc, "op": "begin", "id": "deploy-1", "term": reply.Lease.Term, "revision": 0, "target": replicas.Build{Version: "v1", Digest: "digest"}} |
| + code, raw = replicaPost(t, fx, base+"/release", "home/b1", token, p) |
| + if code != 200 { |
| + t.Fatalf("%d %s", code, raw) |
| + } |
| + p["revision"] = 1 |
| + p["op"] = "released" |
| + code, raw = replicaPost(t, fx, base+"/release", "home/b1", token, p) |
| + if code != 200 { |
| + t.Fatalf("%d %s", code, raw) |
| + } |
| + before, _ := ixRecord(t, fx, ixHost) |
| + code, raw = replicaPost(t, fx, base+"/release", "home/b1", token, p) |
| + if code != 200 { |
| + t.Fatalf("replay %d %s", code, raw) |
| + } |
| + after, _ := ixRecord(t, fx, ixHost) |
| + if before.RecordSeq != after.RecordSeq || before.ReplicaDeploy.Revision != after.ReplicaDeploy.Revision { |
| + t.Fatal("replay rewrote success") |
| + } |
| +} |
| + |
| +func TestReplicaCoordinatorRevocationAndOwnerIsolation(t *testing.T) { |
| + for _, kind := range []string{"revoked", "owner"} { |
| + t.Run(kind, func(t *testing.T) { |
| + fx := newIxFx(t, "replica-"+kind) |
| + owner := fx.acct |
| + if kind == "owner" { |
| + owner = "baj" |
| + } |
| + token, _, _ := ixFleetWorld(t, fx, owner) |
| + rec, _ := ixRecord(t, fx, ixHost) |
| + if err := provision.SetRecordFleetBox(context.Background(), fx.rel, fx.acct, "shop", ixHost, provision.FleetBoxExpect{Region: rec.Region, CreatedAt: rec.CreatedAt}, "b1", time.Now()); err != nil { |
| + t.Fatal(err) |
| + } |
| + reg, _ := openRegistry(fx.regPath) |
| + if kind == "revoked" { |
| + _, hash, err := mintFleetToken() |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if err := reg.SetFleetBoxToken("home", "b1", hash); err != nil { |
| + t.Fatal(err) |
| + } |
| + } |
| + for _, door := range []string{"coordinator", "release"} { |
| + code, raw := replicaPost(t, fx, "/api/fleet/replicas/"+fx.acct+"/shop/"+ixHost+"/"+door, "home/b1", token, map[string]any{"op": "acquire"}) |
| + if code != 404 || string(raw) != "404 page not found\n" { |
| + t.Fatalf("%s %d %q", door, code, raw) |
| + } |
| + } |
| + }) |
| + } |
| +} |
| + |
| +func TestReplicaCoordinatorHeldAndRenew(t *testing.T) { |
| + fx, token, inc := replicaAPIFixture(t) |
| + path := "/api/fleet/replicas/" + fx.acct + "/shop/" + ixHost + "/coordinator" |
| + p := map[string]any{"incarnation": inc, "op": "acquire", "boot_id": "boot"} |
| + code, raw := replicaPost(t, fx, path, "home/b1", token, p) |
| + if code != 200 { |
| + t.Fatalf("%d %s", code, raw) |
| + } |
| + var first replicas.CoordinatorReply |
| + if err := json.Unmarshal(raw, &first); err != nil { |
| + t.Fatal(err) |
| + } |
| + p["boot_id"] = "new-boot" |
| + code, raw = replicaPost(t, fx, path, "home/b1", token, p) |
| + if code != 409 { |
| + t.Fatalf("early boot takeover %d %s", code, raw) |
| + } |
| + var held struct { |
| + RetryAt time.Time `json:"retry_at"` |
| + } |
| + if err := json.Unmarshal(raw, &held); err != nil || !held.RetryAt.Equal(first.Lease.ExpiresAt) { |
| + t.Fatalf("held reply %s %v", raw, err) |
| + } |
| + p["boot_id"] = "boot" |
| + p["term"] = first.Lease.Term |
| + p["op"] = "renew" |
| + code, raw = replicaPost(t, fx, path, "home/b1", token, p) |
| + if code != 200 { |
| + t.Fatalf("renew %d %s", code, raw) |
| + } |
| + var next replicas.CoordinatorReply |
| + if err := json.Unmarshal(raw, &next); err != nil || next.Lease.Term != first.Lease.Term || next.RemainingMS <= 0 { |
| + t.Fatalf("renew %s %v", raw, err) |
| + } |
| +} |
diff --git a/internal/provision/plan9_b8_census_test.go b/internal/provision/plan9_b8_census_test.go| index b8d25cd0a..e32e1bcec 100644 |
| --- a/internal/provision/plan9_b8_census_test.go |
| +++ b/internal/provision/plan9_b8_census_test.go |
| @@ -53,7 +53,7 @@ var censusMethods = map[string]bool{ |
| // typed-record-writer touchpoint. Keep these names aligned with the APIs above. |
| var ( |
| censusKeySuffixes = []string{"recordkey", "recordsprefix", "sidecarsprefix", "sidecarkey", "sidecarmanifestkey", "writerecord", "sequencedrecord"} |
| - censusKeyExact = map[string]bool{"createrecord": true, "updaterecord": true, "setrecordregion": true, "setrecordmove": true, "setrecordrun": true, "setrecordinteractive": true, "setrecordseed": true, "setrecordfleetbox": true, "setrecordcoordinator": true, "setrecordassetgen": true, "mintrecordassetgen": true, "createsidecarrecord": true, "claimrawupdaterecord": true} |
| + censusKeyExact = map[string]bool{"createrecord": true, "updaterecord": true, "setrecordregion": true, "setrecordmove": true, "setrecordrun": true, "setrecordinteractive": true, "setrecordseed": true, "setrecordfleetbox": true, "setrecordcoordinator": true, "setrecordreplicarelease": true, "setrecordassetgen": true, "mintrecordassetgen": true, "createsidecarrecord": true, "claimrawupdaterecord": true} |
| censusLitWords = []string{"instances", "sidecars"} |
| ) |
diff --git a/internal/provision/replicadeploy.go b/internal/provision/replicadeploy.go| new file mode 100644 |
| index 000000000..f7df4662b |
| --- /dev/null |
| +++ b/internal/provision/replicadeploy.go |
| @@ -0,0 +1,67 @@ |
| +package provision |
| + |
| +import ( |
| + "context" |
| + "math" |
| + "time" |
| + |
| + "github.com/carlosframework/platform/internal/release" |
| + "github.com/carlosframework/platform/internal/replicas" |
| +) |
| + |
| +// SetRecordReplicaRelease persists one-copy release evidence through the judged |
| +// record CAS. Every retry checks the lifetime, current term and pinned build. |
| +func SetRecordReplicaRelease(ctx context.Context, s release.Store, id replicas.Identity, expectedRevision uint64, next replicas.Deploy) (*Record, error) { |
| + var result *Record |
| + err := release.WithAppMutation(ctx, s, id.Account, id.App, "provision.SetRecordReplicaRelease", func(ctx context.Context) error { |
| + ctx = context.WithValue(ctx, replicaWriteKey{}, "replica_deploy") |
| + var err error |
| + result, err = updateRecord(ctx, s, id.Account, id.App, id.Host, func(rec *Record) error { |
| + if err := replicaIdentity(rec, id); err != nil { |
| + return err |
| + } |
| + if next.Incarnation != id.Incarnation || next.ID == "" || next.Term == "" || next.Target.Version == "" || next.Target.Digest == "" || len(next.Order) != 0 || len(next.Completed) != 0 || next.ActiveBox != "" { |
| + return replicas.ErrInvalid |
| + } |
| + old := rec.ReplicaDeploy |
| + // A committed success is evidence even when its reply was lost. Do not |
| + // advance either revision or record sequence on this exact replay. |
| + if old != nil && old.Phase == "released" && next.Phase == "released" && old.ID == next.ID && old.Incarnation == next.Incarnation && old.Term == next.Term && old.Target == next.Target && old.Previous == next.Previous { |
| + return errRecordUnchanged |
| + } |
| + c := rec.Coordinator |
| + if c == nil || c.Term != next.Term || !time.Now().Before(c.ExpiresAt) || (rec.FleetBox != "" && rec.FleetBox != c.Box) || (rec.FleetBox == "" && len(rec.Region) >= 6 && rec.Region[:6] == "fleet/") { |
| + return replicas.ErrFenced |
| + } |
| + revision := uint64(0) |
| + if old != nil { |
| + revision = old.Revision |
| + } |
| + if revision != expectedRevision || revision == math.MaxUint64 { |
| + return replicas.ErrFenced |
| + } |
| + if old == nil || old.ID != next.ID { |
| + if next.Phase != "pending" || (old != nil && old.Phase != "released" && old.Phase != "failed" && old.Phase != "unknown") { |
| + return replicas.ErrInvalid |
| + } |
| + } else { |
| + if old.Incarnation != next.Incarnation || old.Target != next.Target || old.Previous != next.Previous { |
| + return replicas.ErrFenced |
| + } |
| + // A new coordinator can close uncertain work, but cannot rerun it. |
| + if old.Term != next.Term && !(old.Phase == "releasing" && next.Phase == "unknown") { |
| + return replicas.ErrFenced |
| + } |
| + legal := old.Phase == "pending" && (next.Phase == "releasing" || next.Phase == "released" || next.Phase == "failed") || old.Phase == "releasing" && (next.Phase == "released" || next.Phase == "failed" || next.Phase == "unknown") |
| + if !legal { |
| + return replicas.ErrInvalid |
| + } |
| + } |
| + next.Revision = revision + 1 |
| + rec.ReplicaDeploy = &next |
| + return nil |
| + }) |
| + return err |
| + }) |
| + return result, err |
| +} |
diff --git a/internal/provision/replicadeploy_test.go b/internal/provision/replicadeploy_test.go| new file mode 100644 |
| index 000000000..b007cd741 |
| --- /dev/null |
| +++ b/internal/provision/replicadeploy_test.go |
| @@ -0,0 +1,251 @@ |
| +package provision |
| + |
| +import ( |
| + "context" |
| + "encoding/json" |
| + "github.com/carlosframework/platform/internal/replicas" |
| + "testing" |
| + "time" |
| +) |
| + |
| +func TestReplicaReleaseTermFencesLateResults(t *testing.T) { |
| + ctx, id := replicaFixture(t) |
| + s, rec := fleetBoxFixture(t) |
| + id.Incarnation, _ = Incarnation(rec.Account, rec.App, rec.Host, rec.CreatedAt) |
| + if err := SetRecordFleetBox(ctx, s, id.Account, id.App, id.Host, FleetBoxExpect{Region: rec.Region, CreatedAt: rec.CreatedAt}, "local", time.Now()); err != nil { |
| + t.Fatal(err) |
| + } |
| + r, err := SetRecordCoordinator(ctx, s, id, replicas.CoordinatorChange{Op: "acquire", Box: "local", BootID: "boot"}, time.Now()) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + d := replicas.Deploy{ID: "deploy-1", Incarnation: id.Incarnation, Target: replicas.Build{Version: "v1", Digest: "digest"}, Term: r.Coordinator.Term, Phase: "pending"} |
| + r, err = SetRecordReplicaRelease(ctx, s, id, 0, d) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + d.Phase = "releasing" |
| + r, err = SetRecordReplicaRelease(ctx, s, id, r.ReplicaDeploy.Revision, d) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + |
| + // Keep the deploy term unchanged while the coordinator changes. This |
| + // isolates the current-term fence from the pinned deploy-term check. |
| + key := RecordKey(id.Account, id.App, id.Host) |
| + original, etag, err := s.Get(ctx, key) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + var successor Record |
| + if err := json.Unmarshal(original, &successor); err != nil { |
| + t.Fatal(err) |
| + } |
| + successor.Coordinator.Term = "successor-term" |
| + raw, err := json.Marshal(successor) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + tag, err := s.Put(ctx, key, raw, etag) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + d.Phase = "released" |
| + if _, err := SetRecordReplicaRelease(ctx, s, id, r.ReplicaDeploy.Revision, d); err == nil { |
| + t.Fatal("expired term remained authoritative") |
| + } |
| + if _, err := s.Put(ctx, key, original, tag); err != nil { |
| + t.Fatal(err) |
| + } |
| + d.Term = "late-term" |
| + d.Phase = "released" |
| + if _, err = SetRecordReplicaRelease(ctx, s, id, r.ReplicaDeploy.Revision, d); err == nil { |
| + t.Fatal("late term accepted") |
| + } |
| + d.Term = r.Coordinator.Term |
| + d.Target.Version = "other" |
| + if _, err = SetRecordReplicaRelease(ctx, s, id, r.ReplicaDeploy.Revision, d); err == nil { |
| + t.Fatal("target changed") |
| + } |
| + d.Target = r.ReplicaDeploy.Target |
| + stale := id |
| + stale.Incarnation = "recreated" |
| + if _, err = SetRecordReplicaRelease(ctx, s, stale, r.ReplicaDeploy.Revision, d); err == nil { |
| + t.Fatal("stale lifetime accepted") |
| + } |
| + r, err = SetRecordReplicaRelease(ctx, s, id, r.ReplicaDeploy.Revision, d) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + seq := r.RecordSeq |
| + r, err = SetRecordReplicaRelease(ctx, s, id, 1, d) |
| + if err != nil || r.RecordSeq != seq { |
| + t.Fatalf("lost success reply: %v %+v", err, r) |
| + } |
| +} |
| + |
| +func TestReplicaReleaseCASRechecksLifetime(t *testing.T) { |
| + ctx, id := replicaFixture(t) |
| + s, rec := fleetBoxFixture(t) |
| + id.Incarnation, _ = Incarnation(rec.Account, rec.App, rec.Host, rec.CreatedAt) |
| + _ = SetRecordFleetBox(ctx, s, id.Account, id.App, id.Host, FleetBoxExpect{Region: rec.Region, CreatedAt: rec.CreatedAt}, "local", time.Now()) |
| + r, err := SetRecordCoordinator(ctx, s, id, replicas.CoordinatorChange{Op: "acquire", Box: "local", BootID: "boot"}, time.Now()) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + id.Incarnation = "recreated" |
| + d := replicas.Deploy{ID: "deploy", Incarnation: id.Incarnation, Term: r.Coordinator.Term, Target: replicas.Build{Version: "v1", Digest: "digest"}, Phase: "pending"} |
| + if _, err = SetRecordReplicaRelease(ctx, s, id, 0, d); err == nil { |
| + t.Fatal("stale lifetime accepted") |
| + } |
| +} |
| + |
| +func TestReplicaReleaseCASRetryRejudges(t *testing.T) { |
| + for _, kind := range []string{"lifetime", "term", "expiry", "revision", "assignment"} { |
| + t.Run(kind, func(t *testing.T) { |
| + ctx, id := replicaFixture(t) |
| + base, rec := fleetBoxFixture(t) |
| + id.Incarnation, _ = Incarnation(rec.Account, rec.App, rec.Host, rec.CreatedAt) |
| + if err := SetRecordFleetBox(ctx, base, id.Account, id.App, id.Host, FleetBoxExpect{Region: rec.Region, CreatedAt: rec.CreatedAt}, "local", time.Now()); err != nil { |
| + t.Fatal(err) |
| + } |
| + r, err := SetRecordCoordinator(ctx, base, id, replicas.CoordinatorChange{Op: "acquire", Box: "local", BootID: "boot"}, time.Now()) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + d := replicas.Deploy{ID: "deploy", Incarnation: id.Incarnation, Term: r.Coordinator.Term, Target: replicas.Build{Version: "v1", Digest: "digest"}, Phase: "pending"} |
| + r, err = SetRecordReplicaRelease(ctx, base, id, 0, d) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + s := &replicaConflictStore{Store: base} |
| + var raced []byte |
| + s.hook = func(ctx context.Context, key string, body []byte, etag string) { |
| + raw, tag, err := base.Get(ctx, key) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + var current Record |
| + if err := json.Unmarshal(raw, ¤t); err != nil { |
| + t.Fatal(err) |
| + } |
| + switch kind { |
| + case "lifetime": |
| + current.CreatedAt = current.CreatedAt.Add(time.Second) |
| + case "term": |
| + current.Coordinator.Term = "successor" |
| + case "expiry": |
| + current.Coordinator.ExpiresAt = time.Now().Add(-time.Second) |
| + case "revision": |
| + current.ReplicaDeploy.Revision++ |
| + case "assignment": |
| + current.FleetBox = "other" |
| + } |
| + raced, err = json.Marshal(current) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if _, err := base.Put(ctx, key, raced, tag); err != nil { |
| + t.Fatal(err) |
| + } |
| + } |
| + d.Phase = "releasing" |
| + if _, err := SetRecordReplicaRelease(ctx, s, id, r.ReplicaDeploy.Revision, d); err == nil { |
| + t.Fatal("CAS retry accepted fenced state") |
| + } |
| + raw, _, err := base.Get(ctx, RecordKey(id.Account, id.App, id.Host)) |
| + if err != nil || string(raw) != string(raced) { |
| + t.Fatalf("retry wrote: %v", err) |
| + } |
| + }) |
| + } |
| +} |
| + |
| +func TestReplicaReleaseUnknownStopsDeployProvision(t *testing.T) { |
| + ctx, id := replicaFixture(t) |
| + s, rec := fleetBoxFixture(t) |
| + id.Incarnation, _ = Incarnation(rec.Account, rec.App, rec.Host, rec.CreatedAt) |
| + if err := SetRecordFleetBox(ctx, s, id.Account, id.App, id.Host, FleetBoxExpect{Region: rec.Region, CreatedAt: rec.CreatedAt}, "local", time.Now()); err != nil { |
| + t.Fatal(err) |
| + } |
| + r, err := SetRecordCoordinator(ctx, s, id, replicas.CoordinatorChange{Op: "acquire", Box: "local", BootID: "boot"}, time.Now()) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + d := replicas.Deploy{ID: "deploy", Incarnation: id.Incarnation, Term: r.Coordinator.Term, Target: replicas.Build{Version: "v1", Digest: "digest"}, Phase: "pending"} |
| + for _, phase := range []string{"pending", "releasing", "unknown"} { |
| + d.Phase = phase |
| + revision := uint64(0) |
| + if r.ReplicaDeploy != nil { |
| + revision = r.ReplicaDeploy.Revision |
| + } |
| + r, err = SetRecordReplicaRelease(ctx, s, id, revision, d) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + } |
| + for _, phase := range []string{"pending", "releasing", "released"} { |
| + d.Phase = phase |
| + if _, err := SetRecordReplicaRelease(ctx, s, id, r.ReplicaDeploy.Revision, d); err == nil { |
| + t.Fatalf("unknown resumed as %s", phase) |
| + } |
| + } |
| + d.ID = "explicit-retry" |
| + d.Phase = "pending" |
| + if _, err := SetRecordReplicaRelease(ctx, s, id, r.ReplicaDeploy.Revision, d); err != nil { |
| + t.Fatal(err) |
| + } |
| +} |
| + |
| +func TestReplicaReleaseLegalTransitions(t *testing.T) { |
| + for _, terminal := range []string{"released", "failed", "unknown"} { |
| + t.Run(terminal, func(t *testing.T) { |
| + ctx, id := replicaFixture(t) |
| + s, rec := fleetBoxFixture(t) |
| + id.Incarnation, _ = Incarnation(rec.Account, rec.App, rec.Host, rec.CreatedAt) |
| + if err := SetRecordFleetBox(ctx, s, id.Account, id.App, id.Host, FleetBoxExpect{Region: rec.Region, CreatedAt: rec.CreatedAt}, "local", time.Now()); err != nil { |
| + t.Fatal(err) |
| + } |
| + r, err := SetRecordCoordinator(ctx, s, id, replicas.CoordinatorChange{Op: "acquire", Box: "local", BootID: "boot"}, time.Now()) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + d := replicas.Deploy{ID: "deploy", Incarnation: id.Incarnation, Term: r.Coordinator.Term, Target: replicas.Build{Version: "v1", Digest: "digest"}, Phase: "released"} |
| + if _, err := SetRecordReplicaRelease(ctx, s, id, 0, d); err == nil { |
| + t.Fatal("success without begin") |
| + } |
| + d.Phase = "pending" |
| + r, err = SetRecordReplicaRelease(ctx, s, id, 0, d) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if _, err := SetRecordReplicaRelease(ctx, s, id, 0, d); err == nil { |
| + t.Fatal("stale revision accepted") |
| + } |
| + d.Phase = "releasing" |
| + r, err = SetRecordReplicaRelease(ctx, s, id, 1, d) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + attempt := d |
| + attempt.ID = "other" |
| + attempt.Phase = "pending" |
| + if _, err := SetRecordReplicaRelease(ctx, s, id, 2, attempt); err == nil { |
| + t.Fatal("outstanding release overwritten") |
| + } |
| + d.Phase = terminal |
| + r, err = SetRecordReplicaRelease(ctx, s, id, 2, d) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + d.Phase = "releasing" |
| + if _, err := SetRecordReplicaRelease(ctx, s, id, 3, d); err == nil { |
| + t.Fatal("terminal deploy rerun") |
| + } |
| + attempt.ID = "explicit-retry" |
| + if _, err := SetRecordReplicaRelease(ctx, s, id, 3, attempt); err != nil { |
| + t.Fatal(err) |
| + } |
| + }) |
| + } |
| +} |
diff --git a/internal/provision/stateless_replicas_census_test.go b/internal/provision/stateless_replicas_census_test.go| index fb49cffb8..50405662a 100644 |
| --- a/internal/provision/stateless_replicas_census_test.go |
| +++ b/internal/provision/stateless_replicas_census_test.go |
| @@ -5,7 +5,16 @@ package provision |
| // The controller still needs an independent verdict before landing. |
| func statelessReplicasWriteCensusInventory() []censusEntry { |
| entries := append([]censusEntry(nil), consoleFiestaWriteCensusInventory()...) |
| + // Self-review: release writes stay under the judged CAS and app mutation |
| + // lock; both API callsites hold withRecordLock after fleet ownership, |
| + // credential, assignment and payload identity checks. No direct Put added. |
| for _, next := range []censusEntry{ |
| + // Registration adds only the two fleet routes; the existing literal-only |
| + // instances/sidecars classification and all existing route handlers stay fixed. |
| + {"internal/console/authcli.go", "Server.registerCLIRoutes", "key-site", "lit:instances,lit:sidecars", "89c700b1b939a8c8bbd478a548efeabfa4fc888f1509b7e3c76ad91472219a29"}, |
| + {"internal/provision/replicadeploy.go", "SetRecordReplicaRelease", "record-writer", "key:SetRecordReplicaRelease,key:updateRecord", "63d5985d8e05c174a34d13db6735c23307e0c241a70f8fd411eee7c333abea55"}, |
| + {"internal/console/replicacoordinator.go", "Server.handleReplicaCoordinator", "record-writer", "key:SetRecordCoordinator", "8c36451d5cb57887117b346293b4deb46b8ec3aa06ffb9f8a8b97594c64133c8"}, |
| + {"internal/console/replicacoordinator.go", "Server.handleReplicaRelease", "record-writer", "key:SetRecordReplicaRelease", "6cc4eb4a564d3419b48928091d082d5e83c6159f37b8373f78eb07931e0ee39c"}, |
| {"internal/provision/record_sequence.go", "WriteRecord", "record-primitive", "key:IsRecordKey,key:WriteRecord,key:preparedRecordKey,sel:Put", "6bcdf4c07e3c583c013c396c5d02770eab83459b0eb5256a1e8c68c4240f31e8"}, |
| {"internal/provision/replicacoordinator.go", "SetRecordCoordinator", "record-writer", "key:SetRecordCoordinator,key:updateRecord", "096a002b9fd3a81955c571831a51f5690f7b272db8ec356dd0364d7e2aecc7db"}, |
| } { |
diff --git a/internal/provision/testdata/plan14-root-reads-stateless-replicas-1.tsv b/internal/provision/testdata/plan14-root-reads-stateless-replicas-1.tsv| index 0da56c30f..8c8c4c80f 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-stateless-replicas-1.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-stateless-replicas-1.tsv |
| @@ -8,6 +8,6 @@ cli.go runShip legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;r |
| ship_check.go rootfsCheck.runArgs legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-1;basis=root-input (J4, as main's db.go units); the carlos CLI on a person's machine, as the person (no box unit): new (rootfs Plan 1), builds the docker or podman run argv for one check container; the scanner matches the word Command, here a field of release.Process (a process's argv), not os/exec; reads no file; decides nothing for root;rev3=census-ruling-rootfs-check-volumes;basis=R2 P1: the data and run volume mounts (-v) now carry :nocopy through rootfsCheck.volumeMount, so Docker and Podman never fill an empty check volume from the image directory at the mount point (which would reset the prepared owner and mode); same volumes, same paths, same probe mount, nothing else in the argv changed. Runs on the person's machine as the person; no box unit; no read added.;rev3=census-ruling-stateless-replicas-1;basis=Stateless local checks mount only the run volume and omit the database mount; same probe read, no new read. file:Command@887,file:Command@971 e684fd3273527a209460ed81e5bcd472a4282f46830fe580e5f07f0b0d876684 |
| internal/replicas/coordinator.go ChangeCoordinator legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Generate a fresh 128-bit coordinator term using crypto/rand.Read; no file path or process input added. file:Read@472 e50ce5a352b3022a1ee6375fbfee315a5d2fcaeb4f4a25f4e33a5a10e3000a67 |
| @coverage . d8abf32baa39f05d1e9d4e9b8a24e7113c58f42f8735e7a62e217eb39e7a4bf7 |
| -@coverage internal/provision 0de8deb0811673f6c9223d0cca375435326dc8bb1fa077afd6a305d61c0f0acb |
| +@coverage internal/provision 974d05f290939ef4e4eb8af398b230b1df780357c3077988a35054ce52109626 |
| @coverage internal/release 261fde7e6e53d2b4d944df966be3f00208d4d7153aed2d19148cbfd403af9d52 |
| @coverage internal/replicas 53b94eb040154539a0a977498b4b8bc1d53d82f67c1c6233667a0b823dd30d8a |