fix: count unread copies as unknown; hold copies lock across restart
Task 3 fix round 1 (Astra review, controller ruling). - Overview: when any copy has no live reading, the Running tile says "<unknown> of <desired> copies unknown; <running> known running" (SR-4-C54, provisional) instead of a false "0 of 2 copies running". The CLI copy rows and the API carry per-copy state only, no count. - Restart: lockRestartCopies takes beginCopiesMutation's exclusion (the app lock and app-name lock every copies change takes) across the copies check and the restart publication, on the CLI app-wide door, the --environment door and the app page's restart. A copies change arriving in between waits; a witness test proves it. - Socket: a console running as root may read the snapshot socket when the directory, socket and SO_PEERCRED peer are all the agent user's uid (carlos, looked up by name); a non-root console still needs its own uid. Seams for both uids make the root path testable. - Record-write census: handleBrowserRestart re-digested.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/superpowers/plans/2026-11-01-stateless-replicas-copy.md+1 −0internal/console/apicli.go+3 −1internal/console/apirestartscope.go+5 −1internal/console/browserrestart.go+5 −1internal/console/replicaview.go+21 −0internal/console/replicaview_linux.go+48 −4internal/console/replicaview_linux_test.go+66 −0internal/console/replicaview_test.go+58 −2internal/console/server.go+5 −1internal/console/templates/app_overview.html+5 −4internal/provision/stateless_replicas_4_task3_census_test.go+6 −1
CI failed — run details
Intent
<task-notification> <task-id>ac96b33e1c2a440a1</task-id> <tool-use-id>toolu_018NWiVNwCeKuW8UxGFtr2fu</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/72128d15-58b8-452f-9f7e-8e864e8854d2/tasks/ac96b33e1c2a440a1.output</output-file> <status>completed</status> <summary>Agent "Implement Plan 4 Task 3 (trimmed)" 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>- Status: DONE_WITH_CONCERNS - Commit: fb1d0904 `feat: expose replica health and command targeting`. The subject is the brief's, but no command targeting was added; the commit body says so. - Tests: 10 new tests pass. Six failed before the code was wired; three pass from the start because they pin existing behaviour (copies=1 output, a run and a TTY each start once). 3 of 3 mutations caught. Census card clean. Docsite tests and the three cross-compiles pass. HA guards not needed: no edge or activator code was touched. - F2: `carlos restart --host` already refused, but `--app` restarted every copy at once, and so does `--environment` when a route on the console's box matches. Both, and the app page's restart button, now refuse when an app has more than one copy (SR-4-C47/C48). - Socket access: modes stay 0700/0600. The console only reads the socket after checking that it runs as the same user as the agent, verified by file ownership and `SO_PEERCRED`. Otherwise every copy shows unknown. - Concerns: - The console unit's `User=carlos` is not in any repo; I took it from memory notes. If dev runs it as another user or hides `/run`, the copy view goes blind, showing unknown, never a false healthy. Smoke should check this first. - With no reading from the router, the overview says "0 of 2 copies running" next to "Can't tell right now". This is worth a look in Paul's copy review. - Restart now reads the app's copies setting first, so if that setting can't be read the restart refuses (502) instead of going through. - The restart refusal message on the app page has no test of its own. - Copy rows SR-4-C47 to C53 are provisional, pending Paul's review. - Report: /home/paulca/amadan.net/carlos/platform/.claude/worktrees/stateless-replicas-4/.superpowers/sdd/2026-11-01-stateless-replicas-4-deploy-and-drill/task-3-report.md</result> <usage><subagent_tokens>362765</subagent_tokens><tool_uses>165</tool_uses><duration_ms>1837823</duration_ms></usage> </task-notification>
<task-notification> <task-id>bf82wx2pn</task-id> <tool-use-id>toolu_01UQ7pwfiyRcsTtQCLqw4148</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/72128d15-58b8-452f-9f7e-8e864e8854d2/tasks/bf82wx2pn.output</output-file> <status>completed</status> <summary>Background command "Astra review of Task 3" completed (exit code 0)</summary> </task-notification>
Attributed to this commit: 38.1 g CO₂e (4,842,990 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on stateless-replicas-4, 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/docs/superpowers/plans/2026-11-01-stateless-replicas-copy.md b/docs/superpowers/plans/2026-11-01-stateless-replicas-copy.md| index fdb4d3f7e..03821e689 100644 |
| --- a/docs/superpowers/plans/2026-11-01-stateless-replicas-copy.md |
| +++ b/docs/superpowers/plans/2026-11-01-stateless-replicas-copy.md |
| @@ -125,3 +125,4 @@ copy too. Internal wire enums are not an excuse to expose unreviewed text. |
| | SR-4-C51 | docs/site/cli.md | For an instance with more than one copy, `carlos instances list` prints a second table with one row per copy: its box, build, state, health and workers. These come from the router's live check of each copy, not from the boxes' five-minute reports. A copy with no live reading shows as unknown, and a copy that no box holds yet shows as missing. The app's overview page counts the copies running out of the copies wanted. | pending (added by Plan 4 Task 3; the view-only part of SR-4-C28, whose --box sentence is deferred with --box; awaiting Paul's copy review) | |
| | SR-4-C52 | docs/site/cli.md | An instance with more than one copy keeps a separate page cache on each copy's box. A purge clears only the cache of the copy that sent it, so another copy can serve its own saved page until it expires or that copy purges it too. | pending (added by Plan 4 Task 3 per ruling D6; awaiting Paul's copy review) | |
| | SR-4-C53 | docs/site/cli.md | An app that runs more than one copy of an instance refuses `carlos restart --app` and `--environment`, because every copy would restart at the same time. Deploy a new build instead: its copies switch one box at a time. | pending (added by Plan 4 Task 3 for the F2 restart refusal; awaiting Paul's copy review) | |
| +| SR-4-C54 | internal/console/templates/app_overview.html | <unknown> of <desired> copies unknown; <running> known running | pending (added by Plan 4 Task 3 fix round 1: the overview count when any copy has no live reading, so an unread copy is never counted as stopped; awaiting Paul's copy review) | |
diff --git a/internal/console/apicli.go b/internal/console/apicli.go| index 88be6aa72..f0892462d 100644 |
| --- a/internal/console/apicli.go |
| +++ b/internal/console/apicli.go |
| @@ -1578,10 +1578,12 @@ func (s *Server) handleAPIRestart(w http.ResponseWriter, r *http.Request) { |
| } |
| ctx, cancel := context.WithTimeout(r.Context(), 15*time.Second) |
| defer cancel() |
| - if ref := s.restartCopies(ctx, acct.Sqid, app); ref != nil { |
| + ctx, unlock, ref := s.lockRestartCopies(ctx, acct, app) |
| + if ref != nil { |
| writeDoorRefusalJSON(w, r, ref) |
| return |
| } |
| + defer unlock() |
| if err := s.requestAppRestart(ctx, acct.Sqid, app); err != nil { |
| // Logged, not returned: a store error carries bucket names, endpoints |
| // and request ids. The caller gets the fixed sentence every other |
diff --git a/internal/console/apirestartscope.go b/internal/console/apirestartscope.go| index 4e4fafeb1..626ed18e8 100644 |
| --- a/internal/console/apirestartscope.go |
| +++ b/internal/console/apirestartscope.go |
| @@ -238,10 +238,14 @@ func (s *Server) handleAPIRestartScope(w http.ResponseWriter, r *http.Request) { |
| // boxes included, all on one serial move. A host here is one of this |
| // box's own routes, never a replicated one (no copy runs on the hub). |
| if scope.Kind == release.RestartScopeEnvironment { |
| - if ref := s.restartCopies(ctx, acct.Sqid, app); ref != nil { |
| + var unlock func() |
| + var ref *doorRefusal |
| + ctx, unlock, ref = s.lockRestartCopies(ctx, acct, app) |
| + if ref != nil { |
| writeDoorRefusalJSON(w, r, ref) |
| return |
| } |
| + defer unlock() |
| } |
| if err := s.writeRestartScope(ctx, acct.Sqid, app, scope); err != nil { |
| // Logged, not returned: a store error carries bucket names, endpoints |
diff --git a/internal/console/browserrestart.go b/internal/console/browserrestart.go| index 2b0b90af2..6f39f3e55 100644 |
| --- a/internal/console/browserrestart.go |
| +++ b/internal/console/browserrestart.go |
| @@ -123,7 +123,10 @@ func (s *Server) handleBrowserRestart(w http.ResponseWriter, r *http.Request, ho |
| defer cancel() |
| var restartErr error |
| if host == "" { |
| - if ref := s.restartCopies(ctx, acct.Sqid, app); ref != nil { |
| + var unlock func() |
| + var ref *doorRefusal |
| + ctx, unlock, ref = s.lockRestartCopies(ctx, acct, app) |
| + if ref != nil { |
| msg := words.Failed |
| if ref.Status == http.StatusConflict { |
| msg = restartCopiesRefusalPage |
| @@ -132,6 +135,7 @@ func (s *Server) handleBrowserRestart(w http.ResponseWriter, r *http.Request, ho |
| http.Redirect(w, r, "/a/"+url.PathEscape(acct.Sqid)+"/apps/"+url.PathEscape(app)+"/instances", http.StatusSeeOther) |
| return |
| } |
| + defer unlock() |
| restartErr = s.requestAppRestart(ctx, acct.Sqid, app) |
| } else { |
| restartErr = s.writeRestartScope(ctx, acct.Sqid, app, scope) |
diff --git a/internal/console/replicaview.go b/internal/console/replicaview.go| index 8ae5bf32c..6d927c1f8 100644 |
| --- a/internal/console/replicaview.go |
| +++ b/internal/console/replicaview.go |
| @@ -80,6 +80,27 @@ func (s *Server) restartCopies(ctx context.Context, acct, app string) *doorRefus |
| return nil |
| } |
| +// lockRestartCopies takes the exclusion every copies change takes |
| +// (beginCopiesMutation: the app lock and the app-name lock), then asks |
| +// restartCopies under it. On nil the caller holds the exclusion until it has |
| +// published the restart, and must call unlock after: a copies change waits |
| +// for it, so a count raised between the check and the publication cannot |
| +// let every copy consume the restart. On a refusal nothing is held. |
| +func (s *Server) lockRestartCopies(ctx context.Context, acct *Account, app string) (context.Context, func(), *doorRefusal) { |
| + ctx, unlock, ref := s.beginCopiesMutation(ctx, acct, app) |
| + if ref != nil { |
| + return ctx, func() {}, ref |
| + } |
| + if ref := s.restartCopies(ctx, acct.Sqid, app); ref != nil { |
| + unlock() |
| + return ctx, func() {}, ref |
| + } |
| + if s.restartHeld != nil { |
| + s.restartHeld() |
| + } |
| + return ctx, unlock, nil |
| +} |
| + |
| // replicaHealthSocket is Plan 3's snapshot socket on the hub, the agent's |
| // (internal/host replicaHealthSocket). Only its path is shared: the console |
| // dials it and never chooses a path from data. |
diff --git a/internal/console/replicaview_linux.go b/internal/console/replicaview_linux.go| index 201408ed9..33e94175f 100644 |
| --- a/internal/console/replicaview_linux.go |
| +++ b/internal/console/replicaview_linux.go |
| @@ -14,6 +14,11 @@ package console |
| // group or other access, and the process at the other end of the connection |
| // must be that uid too (SO_PEERCRED). A console that runs as any other user |
| // gets no reading, and every copy then shows as unknown, never healthy. |
| +// |
| +// A console running as root (controller ruling, fix round 1) may read it |
| +// too. Root's own uid owns nothing here, so the expected owner is then the |
| +// agent's user, carlos, looked up by name: the directory, the socket and |
| +// the SO_PEERCRED peer must all be that uid, exactly as above. |
| import ( |
| "context" |
| @@ -23,7 +28,9 @@ import ( |
| "net" |
| "net/http" |
| "os" |
| + "os/user" |
| "path/filepath" |
| + "strconv" |
| "syscall" |
| "time" |
| @@ -37,12 +44,49 @@ const replicaHealthTimeout = time.Second |
| // bytes per copy; a reply this large is not one. |
| const replicaHealthMaxBytes = 8 << 20 |
| +// replicaAgentUser is the agent's user (units/carlos-edge.service). |
| +const replicaAgentUser = "carlos" |
| + |
| +// Seams for the uid rule: the console's own euid, and the agent user's uid |
| +// as the system resolves it. Tests replace both. |
| +var ( |
| + consoleEUID = os.Geteuid |
| + replicaAgentUIDOf = func(name string) (uint32, error) { |
| + u, err := user.Lookup(name) |
| + if err != nil { |
| + return 0, err |
| + } |
| + id, err := strconv.ParseUint(u.Uid, 10, 32) |
| + return uint32(id), err |
| + } |
| +) |
| + |
| +// replicaSocketOwner is the uid the socket, its directory and its peer must |
| +// have: the console's own, or for a root console the agent user's. |
| +func replicaSocketOwner() (uint32, error) { |
| + euid := consoleEUID() |
| + if euid != 0 { |
| + return uint32(euid), nil |
| + } |
| + uid, err := replicaAgentUIDOf(replicaAgentUser) |
| + if err != nil { |
| + return 0, errors.Join(errNoHubReading, err) |
| + } |
| + if uid == 0 { |
| + return 0, errors.Join(errNoHubReading, errors.New("the agent user resolves to root")) |
| + } |
| + return uid, nil |
| +} |
| + |
| func readReplicaHealthSocket(ctx context.Context, path string) (map[string]replicas.Snapshot, error) { |
| - euid := uint32(os.Geteuid()) |
| - if err := ownedPrivate(filepath.Dir(path), euid, true); err != nil { |
| + owner, err := replicaSocketOwner() |
| + if err != nil { |
| + return nil, err |
| + } |
| + if err := ownedPrivate(filepath.Dir(path), owner, true); err != nil { |
| return nil, err |
| } |
| - if err := ownedPrivate(path, euid, false); err != nil { |
| + if err := ownedPrivate(path, owner, false); err != nil { |
| return nil, err |
| } |
| ctx, cancel := context.WithTimeout(ctx, replicaHealthTimeout) |
| @@ -55,7 +99,7 @@ func readReplicaHealthSocket(ctx context.Context, path string) (map[string]repli |
| if err != nil { |
| return nil, errors.Join(errNoHubReading, err) |
| } |
| - if err := peerIs(conn, euid); err != nil { |
| + if err := peerIs(conn, owner); err != nil { |
| conn.Close() |
| return nil, err |
| } |
diff --git a/internal/console/replicaview_linux_test.go b/internal/console/replicaview_linux_test.go| index 6257f0491..2215a3c1e 100644 |
| --- a/internal/console/replicaview_linux_test.go |
| +++ b/internal/console/replicaview_linux_test.go |
| @@ -73,3 +73,69 @@ func TestReplicaVisibilityReadsThePrivateSocket(t *testing.T) { |
| t.Fatalf("no socket: %v, want no hub reading", err) |
| } |
| } |
| + |
| +// serveHubSocket serves want at <TMPDIR>/rvNNN/.replicas/health.sock, in a |
| +// 0700 directory, as this process's user. The directory goes at cleanup. |
| +func serveHubSocket(t *testing.T, want map[string]replicas.Snapshot) string { |
| + t.Helper() |
| + base, err := os.MkdirTemp(os.Getenv("TMPDIR"), "rv") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + t.Cleanup(func() { os.RemoveAll(base) }) |
| + dir := filepath.Join(base, ".replicas") |
| + if err := os.Mkdir(dir, 0o700); err != nil { |
| + t.Fatal(err) |
| + } |
| + path := filepath.Join(dir, "health.sock") |
| + ln, err := net.Listen("unix", path) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if err := os.Chmod(path, 0o600); err != nil { |
| + t.Fatal(err) |
| + } |
| + srv := &http.Server{Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| + _ = json.NewEncoder(w).Encode(want) |
| + })} |
| + go srv.Serve(ln) |
| + t.Cleanup(func() { srv.Close() }) |
| + return path |
| +} |
| + |
| +// A console running as root reads the socket when the directory, the |
| +// socket and the peer are all the agent user's uid (here, this test's own |
| +// uid stands in for carlos). It refuses when the agent user cannot be |
| +// resolved, resolves to root, or is a uid that owns nothing here. |
| +func TestReplicaVisibilityRootConsoleReadsTheAgentSocket(t *testing.T) { |
| + me := uint32(os.Geteuid()) |
| + if me == 0 { |
| + t.Skip("needs a non-root test user to stand in for the agent") |
| + } |
| + path := serveHubSocket(t, map[string]replicas.Snapshot{"shop.example.com": {Host: "shop.example.com", Desired: 2}}) |
| + oldEUID, oldAgent := consoleEUID, replicaAgentUIDOf |
| + t.Cleanup(func() { consoleEUID, replicaAgentUIDOf = oldEUID, oldAgent }) |
| + consoleEUID = func() int { return 0 } |
| + var asked string |
| + replicaAgentUIDOf = func(name string) (uint32, error) { asked = name; return me, nil } |
| + got, err := readReplicaHealthSocket(context.Background(), path) |
| + if err != nil || got["shop.example.com"].Desired != 2 || asked != "carlos" { |
| + t.Fatalf("root console: %+v %v (asked for %q), want the hub's table via the carlos uid", got, err, asked) |
| + } |
| + for name, agent := range map[string]func(string) (uint32, error){ |
| + "no such user": func(string) (uint32, error) { return 0, errors.New("unknown user carlos") }, |
| + "agent user is root": func(string) (uint32, error) { return 0, nil }, |
| + "another uid": func(string) (uint32, error) { return me + 1, nil }, |
| + } { |
| + replicaAgentUIDOf = agent |
| + if _, err := readReplicaHealthSocket(context.Background(), path); !errors.Is(err, errNoHubReading) { |
| + t.Fatalf("root console, %s: %v, want no hub reading", name, err) |
| + } |
| + } |
| + // A non-root console never consults the agent user: its own uid rules. |
| + consoleEUID = func() int { return int(me) + 1 } |
| + replicaAgentUIDOf = func(string) (uint32, error) { return me, nil } |
| + if _, err := readReplicaHealthSocket(context.Background(), path); !errors.Is(err, errNoHubReading) { |
| + t.Fatalf("a console of another non-root uid: %v, want no hub reading", err) |
| + } |
| +} |
diff --git a/internal/console/replicaview_test.go b/internal/console/replicaview_test.go| index 409671de9..421fa0c3e 100644 |
| --- a/internal/console/replicaview_test.go |
| +++ b/internal/console/replicaview_test.go |
| @@ -192,8 +192,14 @@ func TestReplicaVisibilityPrefersLiveHealth(t *testing.T) { |
| t.Fatalf("health %q with no hub reading, want %q", got.Health, healthUnknown) |
| } |
| tile := copiesLine(t, fx, browser) |
| - if strings.Contains(tile, "2 of 2") || !strings.Contains(tile, "0 of 2 copies running") { |
| - t.Fatalf("overview tile with no hub reading:\n%s", tile) |
| + if strings.Contains(tile, "copies running") || !strings.Contains(tile, "2 of 2 copies unknown; 0 known running") { |
| + t.Fatalf("overview tile with no hub reading, want every copy unknown and no running count:\n%s", tile) |
| + } |
| + |
| + // One copy read, one not: the known one is counted, the other unknown. |
| + hubSays(fx, rec, nil, hubCopy(rec, "b1", "running", true, "v2", 2, 2)) |
| + if tile := copiesLine(t, fx, browser); strings.Contains(tile, "copies running") || !strings.Contains(tile, "1 of 2 copies unknown; 1 known running") { |
| + t.Fatalf("overview tile with one copy unread:\n%s", tile) |
| } |
| // A reading for another lifetime, revision, account or fleet is not |
| @@ -421,3 +427,53 @@ func TestReplicaRestartRefusesCopies(t *testing.T) { |
| t.Fatal("the restart was not requested") |
| } |
| } |
| + |
| +// Fix round 1: a restart holds the copies exclusion from its copies check |
| +// to its publication. A copies change that arrives in between waits until |
| +// the restart is published, so the check it passed still describes the app |
| +// when the restart lands; a restart arriving after the change sees it. |
| +func TestReplicaRestartHoldsTheCopiesExclusion(t *testing.T) { |
| + fx := newIxFx(t, "code-rv-restart-lock") |
| + ixFleetWorld(t, fx, fx.acct) |
| + held, release := make(chan struct{}), make(chan struct{}) |
| + // Released at the latest when the test ends, so a failure never leaves |
| + // the restart parked and the server's close waiting on it. |
| + free := sync.OnceFunc(func() { close(release) }) |
| + t.Cleanup(free) |
| + fx.srv.restartHeld = func() { |
| + close(held) |
| + <-release |
| + } |
| + restarted := make(chan int, 1) |
| + go func() { |
| + code, _, _ := rawReq(t, http.MethodPost, fx.ts.URL+"/api/cli/apps/"+fx.acct+"/shop/restart", fx.alice, "") |
| + restarted <- code |
| + }() |
| + <-held |
| + fx.srv.restartHeld = nil |
| + copiesDone := make(chan int, 1) |
| + go func() { |
| + code, _, _ := rawReq(t, http.MethodPut, fx.ts.URL+"/api/cli/apps/"+fx.acct+"/shop/copies", fx.owner, `{"copies":2}`) |
| + copiesDone <- code |
| + }() |
| + select { |
| + case code := <-copiesDone: |
| + t.Fatalf("a copies change finished (%d) while a restart held its check", code) |
| + case <-time.After(300 * time.Millisecond): |
| + } |
| + if restartTouched(t, fx) { |
| + t.Fatal("the restart published before its hold ended") |
| + } |
| + free() |
| + if code := <-restarted; code != http.StatusOK { |
| + t.Fatalf("restart = %d, want 200", code) |
| + } |
| + if !restartTouched(t, fx) { |
| + t.Fatal("the restart was not published") |
| + } |
| + select { |
| + case <-copiesDone: |
| + case <-time.After(10 * time.Second): |
| + t.Fatal("the copies change never ran after the restart released the exclusion") |
| + } |
| +} |
diff --git a/internal/console/server.go b/internal/console/server.go| index 9836aa896..3840fe516 100644 |
| --- a/internal/console/server.go |
| +++ b/internal/console/server.go |
| @@ -1186,7 +1186,11 @@ type Server struct { |
| // replicaHealth reads the hub's live copy table (replicaview.go). nil is |
| // the agent's private snapshot socket; tests set a fixed table. |
| replicaHealth func(ctx context.Context) (map[string]replicas.Snapshot, error) |
| - dbClients dbReplicaCache |
| + // restartHeld, when set, runs inside a restart's copies exclusion, |
| + // after its copies check and before it publishes (lockRestartCopies). |
| + // Tests only. |
| + restartHeld func() |
| + dbClients dbReplicaCache |
| // dbStreams bounds the db door's active file streams, and dbStreamIdle |
| // is how long one may go without moving a byte (apidb.go). |
| dbStreams *dbStreamLimits |
diff --git a/internal/console/templates/app_overview.html b/internal/console/templates/app_overview.html| index 0efeba245..e493f2ed0 100644 |
| --- a/internal/console/templates/app_overview.html |
| +++ b/internal/console/templates/app_overview.html |
| @@ -33,10 +33,11 @@ |
| <h2>Running</h2> |
| <p class="tile-value">{{if eq .InstanceTotal 0}}—{{else if and (eq .InstanceExpected 0) (eq .InstanceUnknown 0)}}Served{{else if .MetricsUnavailable}}?{{else if eq .InstanceCounted 0}}?{{else}}{{.InstanceReporting}} of {{.InstanceCounted}}{{end}}</p> |
| <p class="tile-detail">{{if eq .InstanceTotal 0}}nothing running yet{{else if and (eq .InstanceExpected 0) (eq .InstanceUnknown 0)}}static — the platform serves it, nothing to run{{else if or .MetricsUnavailable (and (eq .InstanceCounted 0) .InstanceUnknown)}}no data right now{{else if eq .InstanceCounted 0}}no readings for {{.InstanceNoReadings}} copies — stamp their units to see health{{else}}copies reporting{{if .InstanceAsleep}} · {{.InstanceAsleep}} asleep{{end}}{{if .InstanceNoReadings}} · {{.InstanceNoReadings}} no readings{{end}}{{end}}</p> |
| - {{/* SR-4-C01 (provisional): the hub's live count of an app whose |
| - instances run more than one copy. A copy with no live reading is |
| - not counted as running. */}} |
| - {{if .CopiesDesired}}<p class="tile-detail">{{.CopiesRunning}} of {{.CopiesDesired}} copies running</p>{{end}} |
| + {{/* The hub's live count of an app whose instances run more than one |
| + copy: SR-4-C01 when every copy has a reading, SR-4-C54 when any |
| + does not, so a copy nobody can vouch for is never counted as |
| + stopped (both provisional). */}} |
| + {{if .CopiesDesired}}<p class="tile-detail">{{if .CopiesUnknown}}{{.CopiesUnknown}} of {{.CopiesDesired}} copies unknown; {{.CopiesRunning}} known running{{else}}{{.CopiesRunning}} of {{.CopiesDesired}} copies running{{end}}</p>{{end}} |
| </a> |
| <a class="tile" href="{{$.Nav}}/apps/{{$.AppName}}/instances"> |
| <h2>Resources</h2> |
diff --git a/internal/provision/stateless_replicas_4_task3_census_test.go b/internal/provision/stateless_replicas_4_task3_census_test.go| index f0df23045..a25cbf221 100644 |
| --- a/internal/provision/stateless_replicas_4_task3_census_test.go |
| +++ b/internal/provision/stateless_replicas_4_task3_census_test.go |
| @@ -14,13 +14,18 @@ package provision |
| // set one, lists the app's records (listRecordsComplete, a read) and |
| // refuses while any holds more than one box. No record write; the |
| // reference is the unchanged instances literal of its redirects. |
| +// - Fix round 1, self-review: Server.handleBrowserRestart now takes the |
| +// copies exclusion (lockRestartCopies: the app lock and app-name lock |
| +// that copies changes take) across the check and the restart |
| +// publication. Same reads, still no record write; the reference is |
| +// unchanged. |
| // - No new record writer. The deferred run and session target writes are |
| // not part of the trimmed task. |
| func statelessReplicas4Task3WriteCensusInventory() []censusEntry { |
| entries := append([]censusEntry(nil), statelessReplicas4Task2WriteCensusInventory()...) |
| for _, r := range []censusEntry{ |
| {"internal/console/apiinstances.go", "Server.handleAPIInstanceList", "key-site", "lit:instances", "5fc085b0bf1ff6fed54ceb3efd04c2ed1b819b937324a487fdd54c06d8e14f96"}, |
| - {"internal/console/browserrestart.go", "Server.handleBrowserRestart", "key-site", "lit:instances", "f06faf4afd6c437a3211a2b32084fd34aa7d9ba942ea3424bc7cb9e950abef55"}, |
| + {"internal/console/browserrestart.go", "Server.handleBrowserRestart", "key-site", "lit:instances", "cbfc195e4c2bd73142ce48c361dbb9bbc01b0f76a22632e1ed8d7da170f7d000"}, |
| } { |
| replaced := false |
| for i, e := range entries { |