carlos / platform Public

Merge main into fix-dbforward-reuse-1032

# Conflicts:
#	internal/provision/testdata/plan14-root-reads-chain.tsv
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 976b8c1e56eaffff03d1218702dccfbd4c58d7b0 parent d6db3bbparent cffb24b
61 files changed, +305 −95
  • deploy.go +1 −1
  • docs/superpowers/notes/census-proposal-fix-dbforward-reuse-1032.md +1 −1
  • docs/superpowers/notes/census-proposal-staticcheck-sa4006.md +27 −0
  • docs/superpowers/reviews/FINDINGS-staticcheck-sa4006-R1.md +58 −0
  • docs/superpowers/reviews/REVIEW-BRIEF-staticcheck-sa4006.md +46 −0
  • domains_cli_test.go +3 −0
  • internal/activator/replica_reconcile_wake_test.go +1 −1
  • internal/activator/rootfsrelease.go +2 −2
  • internal/console/apiinstancemove_home_test.go +3 −0
  • internal/console/apiinstancemove_test.go +0 −1
  • internal/console/apiinteractive_test.go +1 −0
  • internal/console/apirunsbox_test.go +1 −1
  • internal/console/billingusage_test.go +8 −1
  • internal/console/demo_claim_dev_test.go +1 −1
  • internal/console/domainbuy_fix_test.go +2 −2
  • internal/console/managedbudget_test.go +2 −2
  • internal/console/managedenrol_test.go +2 −2
  • internal/console/managedrecovery_test.go +1 −1
  • internal/console/managedworker.go +2 −2
  • internal/console/managedworker_test.go +6 −6
  • internal/console/overview_test.go +1 −1
  • internal/domains/freshdns_test.go +2 −2
  • internal/domains/reconcile.go +1 −1
  • internal/host/claimmoveaccess_test.go +1 −1
  • internal/host/claimservingpark_linux_test.go +2 −1
  • internal/host/claimstop_writers_rev4_linux_test.go +0 −1
  • internal/host/group_names_test.go +7 −3
  • internal/host/link_sim_test.go +1 −1
  • internal/host/movesbuildstatepark_test.go +1 −0
  • internal/host/movesfileslive_test.go +2 −2
  • internal/host/movesinstall_test.go +1 −0
  • internal/host/movesland_test.go +5 −5
  • internal/host/movesloss_test.go +3 −3
  • internal/host/movesrecover_test.go +1 −1
  • internal/host/movesrecoveryowners_test.go +1 −1
  • internal/host/movesrollback_test.go +5 −5
  • internal/host/movesrollback_witness_test.go +1 −1
  • internal/host/moveswakesource_linux_test.go +1 −1
  • internal/host/plan14_fix5_live_linux_test.go +1 −1
  • internal/host/plan14_root_failures_root_linux_test.go +1 −1
  • internal/host/replicaplacement.go +3 −1
  • internal/host/runs_test.go +3 −3
  • internal/hostops/mail_reconcile.go +3 −1
  • internal/hostrelocate/participant.go +1 −1
  • internal/instancectl/gen.go +2 −1
  • internal/instancectl/rootfs.go +1 −1
  • internal/lease/tombstone_test.go +3 −0
  • internal/mail/walk_environment_test.go +2 −2
  • internal/maintenanceguard/guard_test.go +2 −2
  • internal/objstore/queue_test.go +1 −2
  • internal/provision/census_propose_internal_test.go +2 −2
  • internal/provision/plan9_b8_census_test.go +1 −1
  • internal/provision/replicaassignment_test.go +6 −6
  • internal/provision/replicadeploy_test.go +3 −3
  • internal/provision/staticcheck_sa4006_census_test.go +32 −0
  • internal/provision/testdata/plan14-root-reads-chain.tsv +2 −1
  • internal/provision/testdata/plan14-root-reads-staticcheck-sa4006.tsv +18 −0
  • internal/registry/ha_duties_test.go +2 −2
  • internal/registry/links_writers_test.go +1 −1
  • internal/relay/record_test.go +3 −3
  • staticcheck.conf +8 −6

CI passed — run details

diff --git a/deploy.go b/deploy.go
index 801f188f7..1ef7d5b35 100644
--- a/deploy.go
+++ b/deploy.go
@@ -485,7 +485,7 @@ func runDeploy(args []string) {
}
if len(envSet) > 0 {
if staticDeploy && *hostFlag != "" {
- recs, truncated, total, err = sess.instanceList(ctx, acct, *app, "", "")
+ recs, truncated, _, err = sess.instanceList(ctx, acct, *app, "", "")
if err != nil {
log.Fatalf("deploy: list instances: %v", err)
}
diff --git a/docs/superpowers/notes/census-proposal-fix-dbforward-reuse-1032.md b/docs/superpowers/notes/census-proposal-fix-dbforward-reuse-1032.md
index 947e1a94f..22ec31434 100644
--- a/docs/superpowers/notes/census-proposal-fix-dbforward-reuse-1032.md
+++ b/docs/superpowers/notes/census-proposal-fix-dbforward-reuse-1032.md
@@ -18,6 +18,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- new `internal/edge/edge.go:declaredBody.Read`: reads +file:Read ×2; written legacy, accepted-legacy, frozen
-Seal: `c9cd3c8fdf31240b83affa0b2798422f3a99e1d0d400dbaf68665c1127996448` → `72771689d131a1baeabf32439316ea924e595ab29d13bd7d8c664f1a71da9921`.
+Seal: `33e5eaaa9b2d80f6f8f5de8d04e908e39ecfc820c5fe7b44c870e671565e1063` → `ec3c40098ec0a652c735d54925f334b9b9680c9e2b6cd0c3d9497b8a615fb86f`.
Overlay: `internal/provision/testdata/plan14-root-reads-fix-dbforward-reuse-1032.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/docs/superpowers/notes/census-proposal-staticcheck-sa4006.md b/docs/superpowers/notes/census-proposal-staticcheck-sa4006.md
new file mode 100644
index 000000000..1f1bed028
--- /dev/null
+++ b/docs/superpowers/notes/census-proposal-staticcheck-sa4006.md
@@ -0,0 +1,27 @@
+# Census approval: staticcheck-sa4006
+
+Ruling `census-ruling-staticcheck-sa4006`. The independent reviewer approves or rejects every change below, 0 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
+
+| unit | change | read sites | what changed |
+|---|---|---|---|
+| `deploy.go` `runDeploy` | body | unchanged (1) | SA4006 dead store: the static-deploy re-list after attaching --host discards the instance total (third result), which nothing after it read; recs, truncated and err are kept and checked as before. No read added, read site unchanged (1). |
+| `internal/domains/reconcile.go` `Reconcile` | body | unchanged (95) | SA4006 dead store: the canary loop no longer keeps the app from appKeyOwner, which canaryPointer (itself built on appKeyOwner for the same key) overwrote straight away; acctOfKey and ok are unchanged. No read added, read sites unchanged (95). |
+| `internal/host/replicaplacement.go` `replicaPlacementWorker.run` | body | unchanged (6) | SA4006 dead store: publishCurrent's error is discarded explicitly (done, _ =) with a comment; it was assigned to err and never read, and publishCurrent returns false with every error, so done and the retry backoff are exactly as before. No read added, read sites unchanged (6). |
+| `internal/hostrelocate/participant.go` `Participant.Step` | body | unchanged (4) | SA4006 dead store: after counting the probe attempt only obs is updated (obs = counted); c (counted.Claim) was assigned and never read again in that case. The probe still runs on the counted observation. No read added, read sites unchanged (4). |
+| `staticcheck.conf` `external` | body | unchanged (1) | Turns SA4006 on (drops -SA4006 from checks) and rewrites its comment. Read only by staticcheck; nothing in the root binary reads it. No read added. |
+
+Envelopes re-pinned: `.`, `internal/activator`, `internal/domains`, `internal/host`, `internal/hostops`, `internal/hostrelocate`, `internal/instancectl`.
+
+Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner.
+
+Recorded dispositions, which each change must still satisfy:
+
+- `deploy.go` `runDeploy`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-edge-asset-cache-1;basis=takes --assets and --no-assets, refuses both together and bad folders before anything runs (deployAssets), reads the folders saved in .carlos/config for the session's console through configAssets (the config walk the CLI already makes), and saves a new list there as it saves the other deploy settings; read site unchanged (1), none added;rev3=census-ruling-gated-deploy-watch-164;basis=the static-deploy branch passes its watch targets through passGatedTargets (a console POST for a gate pass per gated host) and passes the gated-host set to watchDeployed; no new local read, read site unchanged (1), none added;rev3=census-ruling-region-labels;basis=builds a host-to-label map (hostPlaces) from the instance list it already read and passes it to the static watch targets and watchDeployed, so the watch lines say where; no read added;rev3=census-ruling-first-deploy-493;basis=Sequences existing console APIs for confirmed-missing app and first instance creation, with repeatable environment values; local artifact preflight before these new writes. Existing config artifact stat read retained.;rev3=census-ruling-account-subdomains;basis=builds its watch targets with watchTargetsFor (host, watchOrigin(host), the instance list's public_host as Display, place, probe) from the instance list it already read, and passes them to watchDeployed; deployingLine prints the public host from that same list; the watch still dials and matches host; no read added, read site unchanged (1); fix round 1: a first static deploy keeps the create answer mintPlatformHost now returns (the whole record, not its host) and carries its public_host into the record it appends, for printing only; mintPlatformHost makes the same two console requests as before;rev3=census-ruling-mail-submission-followups;basis=takes --mail and refuses a value but submit before the console is asked anything (the git reads for the version and the dirty-tree check run earlier, as before) (validShipMail, joined with the existing --swap check), and sets the session's shipMail, which the existing ship request sends to the console and checks the echo of (checkMailEcho); its usage text moves to the deployUsage const; no read added, read site unchanged (1)
+- `internal/domains/reconcile.go` `Reconcile`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos), from its domains loop: the seeded-instances body (a trashed app's route kept while an import on its host is journaled, deleted only if the row is still the one listed); self-serve moves 1 Task 4 removes the claims-off 1d auto-purge, so a claims-off box destroys no app objects and a host-claim box only requests the claim's purge as before; the registry reads are unchanged;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 7: the whole-app trash loop keeps every forward row (keptLive = append(keptLive, rt), +whole:Route x3) ahead of DeleteIfUnchanged, so a trashed fleet app's forward row is retired by the forward phase alone. Deletes less, never more.
+- `internal/host/replicaplacement.go` `replicaPlacementWorker.run`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-stateless-replicas-2;basis=Final fix I3: retain completed lifetime/revision observations and skip their work; only confirmed current binding publication after coordinator acquisition, or existing successful/fenced retirement ACK, completes work. Existing local registry read, authority and retirement checks, and 30-second request deadline remain. No new reads or polling.
+- `internal/hostrelocate/participant.go` `Participant.Step`: authority, task C,D. Basis: Participant re-reads claim and installation identity around effects; root stop receipts and fresh participation bound probes, with generic orchestration retained.
+- `staticcheck.conf` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-audit-gate-vet-staticcheck;basis=new: staticcheck configuration at the module root (which SA checks run). Read only by the staticcheck tool in CI and make staticcheck; nothing in the root binary reads it. No read added.
+
+Seal: `c9cd3c8fdf31240b83affa0b2798422f3a99e1d0d400dbaf68665c1127996448` → `33e5eaaa9b2d80f6f8f5de8d04e908e39ecfc820c5fe7b44c870e671565e1063`.
+
+Overlay: `internal/provision/testdata/plan14-root-reads-staticcheck-sa4006.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/docs/superpowers/reviews/FINDINGS-staticcheck-sa4006-R1.md b/docs/superpowers/reviews/FINDINGS-staticcheck-sa4006-R1.md
new file mode 100644
index 000000000..3a2cd0722
--- /dev/null
+++ b/docs/superpowers/reviews/FINDINGS-staticcheck-sa4006-R1.md
@@ -0,0 +1,58 @@
+Reviewed round 1 at `03eaf0a3d7a090ab4db39edb8792b40a30ae3cea`, against merge base `a23423b7c8b5f5c4105e7a797feaf4d88061054b` of the amadan `origin/main`. The requested commit adds only the brief to its named code revision, `7bce5f83`.
+
+P1: none.
+P2: none.
+P3: none.
+
+All nine production changes remove unused assignments while preserving calls, arguments, ordering and error checks. I found no discarded value that should instead have affected behavior:
+
+- Publication errors always accompany `done=false`, preserving retry backoff.
+- Mail settlement re-reads the gate and its tag before the final conditional write.
+- Canary parsing obtains the same app through `canaryPointer`.
+- Managed fleet processing re-reads boxes after preparation, preserving newly allocated boxes.
+- Release settlement reads the deadline again after each failed stop.
+- Both instance-control paths retain the fresh slice value used to explain a failed post-reload check.
+
+The seven restored assertions check the intended behavior:
+
+| Evidence | Assessment |
+|---|---|
+| [domains_cli_test.go:829](/home/paulca/amadan.net/carlos/platform-staticcheck-sa4006/domains_cli_test.go:829) | Checks the detach confirmation using the newly captured output. |
+| [apiinstancemove_home_test.go:216](/home/paulca/amadan.net/carlos/platform-staticcheck-sa4006/internal/console/apiinstancemove_home_test.go:216) | Checks that the accepted home-region move creates exactly one registration. |
+| [apiinteractive_test.go:371](/home/paulca/amadan.net/carlos/platform-staticcheck-sa4006/internal/console/apiinteractive_test.go:371) | Checks that the stranger’s refusal preserves the record and serial and creates no grants or audit events. |
+| [domainbuy_fix_test.go:219](/home/paulca/amadan.net/carlos/platform-staticcheck-sa4006/internal/console/domainbuy_fix_test.go:219) | Checks the browser’s rate-limit response text alongside HTTP 429. |
+| [tombstone_test.go:671](/home/paulca/amadan.net/carlos/platform-staticcheck-sa4006/internal/lease/tombstone_test.go:671) | Checks that repeated lifts of an already-lifted tombstone perform no writes. |
+| [ha_duties_test.go:262](/home/paulca/amadan.net/carlos/platform-staticcheck-sa4006/internal/registry/ha_duties_test.go:262) | Distinguishes the expected adoption refusal from an unexpected database error. |
+| [record_test.go:32](/home/paulca/amadan.net/carlos/platform-staticcheck-sa4006/internal/relay/record_test.go:32) | Checks read success, record contents and preservation of the successful write’s ETag after a rejected stale write. |
+
+Both lint suppression reasons are accurate. The residue is planted before landing and consumed by later assertions in [movesbuildstatepark_test.go:30](/home/paulca/amadan.net/carlos/platform-staticcheck-sa4006/internal/host/movesbuildstatepark_test.go:30). The pinned inputs are captured before installation and passed to its verification in [movesinstall_test.go:483](/home/paulca/amadan.net/carlos/platform-staticcheck-sa4006/internal/host/movesinstall_test.go:483). Those uses remain behind existing unconditional skips.
+
+Moving context creation past the skips preserves behavior when the skips are removed. The removed `rollbackUnitRestart` initialization only constructed a closure; both branches still assign the closure ultimately used. No required side effect was removed.
+
+Census unit verdicts:
+
+| Unit | Verdict and evidence |
+|---|---|
+| `runDeploy` | **APPROVE**, retaining `legacy / accepted-legacy`. [deploy.go:488](/home/paulca/amadan.net/carlos/platform-staticcheck-sa4006/deploy.go:488) discards only the unused total; records, truncation and errors remain checked. No new read or authority. |
+| `Reconcile` | **APPROVE**, retaining `legacy / accepted-legacy`. [reconcile.go:349](/home/paulca/amadan.net/carlos/platform-staticcheck-sa4006/internal/domains/reconcile.go:349) retains account validation; `canaryPointer` supplies the app through the same parser at line 1003. Minting and removal conditions are unchanged. |
+| `replicaPlacementWorker.run` | **APPROVE**, retaining `legacy / accepted-legacy`. [replicaplacement.go:128](/home/paulca/amadan.net/carlos/platform-staticcheck-sa4006/internal/host/replicaplacement.go:128) retains completion and backoff behavior. Every error return in [fleetbind.go:491](/home/paulca/amadan.net/carlos/platform-staticcheck-sa4006/internal/host/fleetbind.go:491) returns false. |
+| `Participant.Step` | **APPROVE**, retaining `authority / C,D`. [participant.go:264](/home/paulca/amadan.net/carlos/platform-staticcheck-sa4006/internal/hostrelocate/participant.go:264) still counts the attempt before probing and passes the updated observation into both the probe and result recording. The removed `c` assignment has no subsequent use on that path. |
+| `staticcheck.conf:external` | **APPROVE**, retaining `legacy / accepted-legacy`. [staticcheck.conf:34](/home/paulca/amadan.net/carlos/platform-staticcheck-sa4006/staticcheck.conf:34) enables SA4006 without disabling another check or changing root runtime behavior. |
+
+Census envelope verdicts:
+
+| Envelope | Verdict and evidence |
+|---|---|
+| `.` | **APPROVE** — [deploy.go:488](/home/paulca/amadan.net/carlos/platform-staticcheck-sa4006/deploy.go:488) and [staticcheck.conf:34](/home/paulca/amadan.net/carlos/platform-staticcheck-sa4006/staticcheck.conf:34) preserve runtime authority and strengthen lint coverage. |
+| `internal/activator` | **APPROVE** — [rootfsrelease.go:663](/home/paulca/amadan.net/carlos/platform-staticcheck-sa4006/internal/activator/rootfsrelease.go:663) preserves stop reasons, timeout, retry timing and deadline checks. |
+| `internal/domains` | **APPROVE** — [reconcile.go:349](/home/paulca/amadan.net/carlos/platform-staticcheck-sa4006/internal/domains/reconcile.go:349) preserves account/app selection and route mutation conditions. |
+| `internal/host` | **APPROVE** — [replicaplacement.go:89](/home/paulca/amadan.net/carlos/platform-staticcheck-sa4006/internal/host/replicaplacement.go:89) preserves registry reads, retirement proof, coordinator checks and publication retries. |
+| `internal/hostops` | **APPROVE** — [mail_reconcile.go:152](/home/paulca/amadan.net/carlos/platform-staticcheck-sa4006/internal/hostops/mail_reconcile.go:152) retains the fence write and error handling; the read at line 251 supplies the tag for settlement after identity and revision validation. |
+| `internal/hostrelocate` | **APPROVE** — [participant.go:264](/home/paulca/amadan.net/carlos/platform-staticcheck-sa4006/internal/hostrelocate/participant.go:264) preserves attempt accounting, observation freshness and probe authority. |
+| `internal/instancectl` | **APPROVE** — [gen.go:425](/home/paulca/amadan.net/carlos/platform-staticcheck-sa4006/internal/instancectl/gen.go:425) and [rootfs.go:748](/home/paulca/amadan.net/carlos/platform-staticcheck-sa4006/internal/instancectl/rootfs.go:748) retain both view calls, reload decisions, tier checks and start refusals. |
+
+The record-write re-pin for `ControlWriter.ReconcileMailGate` is **APPROVED** as `nonrecord / sel:Put`. Its write arguments and conditional-write checks are unchanged. [staticcheck_sa4006_census_test.go:12](/home/paulca/amadan.net/carlos/platform-staticcheck-sa4006/internal/provision/staticcheck_sa4006_census_test.go:12) preserves the prior inventory and rejects changes to classification or write kinds.
+
+Independent byte-hash checks matched all five proposed unit fingerprints and the mail-gate record-write fingerprint. Formatting of every changed Go file and `git diff --check` passed. Targeted tests could not start because the read-only sandbox prevented Go from creating its work directory; executable census checks and staticcheck were not independently verified. No files were changed, reviewers spawned or full suites run.
+
+READY
\ No newline at end of file
diff --git a/docs/superpowers/reviews/REVIEW-BRIEF-staticcheck-sa4006.md b/docs/superpowers/reviews/REVIEW-BRIEF-staticcheck-sa4006.md
new file mode 100644
index 000000000..55ac77829
--- /dev/null
+++ b/docs/superpowers/reviews/REVIEW-BRIEF-staticcheck-sa4006.md
@@ -0,0 +1,46 @@
+# Review brief: branch staticcheck-sa4006, round 1 of 3
+
+Repo carlos/platform, branch `staticcheck-sa4006`, commit 7bce5f831166f5dac9b34e2843bc27a371f4114c.
+Under review: the diff `origin/main...7bce5f831166f5dac9b34e2843bc27a371f4114c` (base a23423b7).
+Authorities: the Go code-health plan (batch 3), AGENTS.md ("The census",
+"Stopping rules").
+
+You are the independent reviewer and census reviewer (root-read card:
+`docs/superpowers/notes/census-proposal-staticcheck-sa4006.md`: units
+runDeploy, Reconcile, replicaPlacementWorker.run, Participant.Step, plus
+staticcheck.conf and seven envelopes; record-write re-pin of
+ControlWriter.ReconcileMailGate in
+internal/provision/staticcheck_sa4006_census_test.go). Verdict per unit
+and envelope, citing lines read.
+
+The branch fixes all 70 SA4006 findings (9 production, all classed dead
+code; 61 tests: 52 dead, 7 lost assertions restored, 2 lint:ignore) and
+switches SA4006 on.
+
+## What to check
+
+1. Each of the 9 production removals: truly dead, or was the unread value
+ a bug (the value should have been used)? In particular
+ host/replicaplacement.go:126 (publishCurrent's error discarded,
+ retries via done=false), hostops/mail_reconcile.go:150 (fence write's
+ tag unused because step 4 re-reads the gate), domains/reconcile.go:349,
+ console/managedworker.go:163, activator/rootfsrelease.go:669.
+2. Behaviour unchanged everywhere (no reordering, no dropped side effect
+ hidden in a removed call)?
+3. The 7 restored test assertions: correct, and do they test what the
+ test name says? The 2 lint:ignore reasons true?
+4. Moves tests: contexts now created after a skip; still correct when the
+ skip is removed?
+5. Census verdicts.
+
+## Severity
+
+- **P1**: unsafe, would not compile, a test fails, or it would not work.
+- **P2**: wrong or missing. Fixed without reopening this review.
+- **P3**: clarity or polish. Follow-up list only.
+
+## Output
+
+Findings ranked P1, P2, P3 with file:line, failure scenario and fix. Then
+census verdicts. End with exactly one verdict: READY, READY AFTER FIXES,
+or NOT READY. Do not edit files, spawn reviewers or run full suites.
diff --git a/domains_cli_test.go b/domains_cli_test.go
index fec921a8a..a672161e2 100644
--- a/domains_cli_test.go
+++ b/domains_cli_test.go
@@ -826,6 +826,9 @@ func TestRunDomainsInstanceCatchall(t *testing.T) {
if !strings.HasSuffix(fc.lastDetachPath, "/domains/*.teams.example.com") {
t.Fatalf("detach path = %s", fc.lastDetachPath)
}
+ if !strings.Contains(buf.String(), "detached *.teams.example.com") {
+ t.Fatalf("stdout = %q, want the detached confirmation", buf.String())
+ }
}
// TestAPISessionDomainPlacements: domainPlacements GETs the placements door
diff --git a/internal/activator/replica_reconcile_wake_test.go b/internal/activator/replica_reconcile_wake_test.go
index 51c43578e..f7ee5ed1c 100644
--- a/internal/activator/replica_reconcile_wake_test.go
+++ b/internal/activator/replica_reconcile_wake_test.go
@@ -111,7 +111,7 @@ func TestReplicaReconcileMemberWakeVerifiesGeneration(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- recp, err = provision.ClearRecordReplicaAssignment(writeCtx, store, id, replicas.Expect{Incarnation: inc, Region: recp.Region, RecordSeq: recp.RecordSeq, Revision: recp.ReplicaAssignment.Revision})
+ _, err = provision.ClearRecordReplicaAssignment(writeCtx, store, id, replicas.Expect{Incarnation: inc, Region: recp.Region, RecordSeq: recp.RecordSeq, Revision: recp.ReplicaAssignment.Revision})
if err != nil {
t.Fatal(err)
}
diff --git a/internal/activator/rootfsrelease.go b/internal/activator/rootfsrelease.go
index ae8280aeb..d064282e4 100644
--- a/internal/activator/rootfsrelease.go
+++ b/internal/activator/rootfsrelease.go
@@ -666,14 +666,14 @@ func (a *Service) settleRelease(op *releaseOp) error {
defer cancel()
return op.hold.stop(sctx, reason)
}
- tripped, deadline := op.trippedAt()
+ tripped, _ := op.trippedAt()
reason := ""
if tripped {
reason = StopLeaseLost
}
err := attempt(reason)
for err != nil {
- tripped, deadline = op.trippedAt()
+ tripped, deadline := op.trippedAt()
if !tripped || deadline.IsZero() || !time.Now().Add(releaseSettleRetry).Before(deadline) {
return err
}
diff --git a/internal/console/apiinstancemove_home_test.go b/internal/console/apiinstancemove_home_test.go
index a04de01c5..eb44310d2 100644
--- a/internal/console/apiinstancemove_home_test.go
+++ b/internal/console/apiinstancemove_home_test.go
@@ -213,6 +213,9 @@ func TestMoveDoorHomeStagingFromItsEdgesFile(t *testing.T) {
if code, _, out := rawReq(t, http.MethodPost, moveURL, token, `{"region":"ie"}`); code != http.StatusAccepted {
t.Fatalf("home with a data bucket = %d %s, want 202", code, out)
}
+ if n := homeMoveRegistrations(t, fx); n != 1 {
+ t.Fatalf("an accepted move registered %d moves, want 1", n)
+ }
// The list names the home by its name, and never as an empty code.
caps := map[string]placementCapability{
diff --git a/internal/console/apiinstancemove_test.go b/internal/console/apiinstancemove_test.go
index 29fd5a3bb..c5e20daac 100644
--- a/internal/console/apiinstancemove_test.go
+++ b/internal/console/apiinstancemove_test.go
@@ -1384,7 +1384,6 @@ func TestMoveDoorGateSentences(t *testing.T) {
check("instance GET, ambiguous account", http.MethodGet, u+"/st.go.tito.io", "", http.StatusConflict, ambiguousLegacy)
check("channels GET, ambiguous account", http.MethodGet, fx.ts.URL+"/api/cli/apps/bab/titogo/channels", "", http.StatusConflict, ambiguousLegacy)
check("app create, ambiguous account", http.MethodPost, fx.ts.URL+"/api/cli/apps/bab/new", `{"name":"other"}`, http.StatusConflict, ambiguousLegacy)
- u = u + "?exact=sqid"
// The shared instance gate: the rate limit, spent last.
for i := 0; i < cliInstanceBurst; i++ {
fx.srv.cli.instances.allow(hashToken(token), time.Now())
diff --git a/internal/console/apiinteractive_test.go b/internal/console/apiinteractive_test.go
index ec2d0cfa3..69c28f009 100644
--- a/internal/console/apiinteractive_test.go
+++ b/internal/console/apiinteractive_test.go
@@ -368,6 +368,7 @@ func TestInteractiveRefusalsInOrder(t *testing.T) {
s.cli.instances.allow(hashToken(fx.alice), time.Now())
code, h, out := ixGet(t, fx, ixHost, stranger)
assertNotFound(t, "2 a stranger", canonicalNotFound(t), code, h, out)
+ ixNothingWritten(t, fx, ixHost, snap)
steps := []step{
{"3 host claims", fx.alice, ixHost, http.StatusConflict, claimInteractiveUnsupportedMsg, func() { s.cfg.HostClaim = false }},
diff --git a/internal/console/apirunsbox_test.go b/internal/console/apirunsbox_test.go
index 52674eef5..2f9ce045f 100644
--- a/internal/console/apirunsbox_test.go
+++ b/internal/console/apirunsbox_test.go
@@ -689,7 +689,7 @@ func TestRunRelayRequestBudget(t *testing.T) {
runChunk(t, ws, 2, runs.StreamOut, []byte("two\n"))
runEndAck(t, ws, runs.Result{Box: "box-a", LastSeq: 2})
fx.srv.runRelays.relays.Wait()
- got := counts{}
+ var got counts
stable := time.Now().Add(5 * time.Second)
for {
mu.Lock()
diff --git a/internal/console/billingusage_test.go b/internal/console/billingusage_test.go
index b071d2ec4..7a3b17176 100644
--- a/internal/console/billingusage_test.go
+++ b/internal/console/billingusage_test.go
@@ -49,6 +49,9 @@ func changeRow(t *testing.T, body, name string) string {
return m[1]
}
+// markupTags matches every tag, attributes and all, to read a row's text.
+var markupTags = regexp.MustCompile(`<[^>]*>`)
+
// useSpan is the usage element a row or card carries, "" for none.
var useSpan = regexp.MustCompile(`<(?:span|dd) class="[^"]*\buse\b[^"]*">[^<]*</(?:span|dd)>`)
@@ -138,7 +141,11 @@ func TestBillingPageUsageStalePeriodUnknown(t *testing.T) {
if got := useOf(t, row); got != unknown {
t.Errorf("%s: usage %q, want %q", pack, got, unknown)
}
- if strings.Contains(row, "999") || strings.Contains(row, "70 GB") || strings.Contains(row, esc(fmt.Sprintf(billingCopy["usage.of_today"], "0", "1,000"))) {
+ // The row's visible text, not its markup: a form's CSRF token or an
+ // attribute value contains "999" now and then, which failed this
+ // test by chance on CI (main at a23423b7).
+ text := markupTags.ReplaceAllString(row, " ")
+ if strings.Contains(text, "999") || strings.Contains(text, "70 GB") || strings.Contains(text, esc(fmt.Sprintf(billingCopy["usage.of_today"], "0", "1,000"))) {
t.Errorf("%s: a stale row shows as a figure:\n%s", pack, row)
}
}
diff --git a/internal/console/demo_claim_dev_test.go b/internal/console/demo_claim_dev_test.go
index c607a284e..38bd02f29 100644
--- a/internal/console/demo_claim_dev_test.go
+++ b/internal/console/demo_claim_dev_test.go
@@ -113,7 +113,7 @@ func TestDemoClaimDevAcceptance(t *testing.T) {
if cfg.AccountID == "" {
t.Fatal("fixture requires exact account selection")
}
- code, body, _ = request("POST", cfg.Console+"/api/demo/claims/select", "", map[string]string{"flowToken": flow, "accountId": cfg.AccountID})
+ code, _, _ = request("POST", cfg.Console+"/api/demo/claims/select", "", map[string]string{"flowToken": flow, "accountId": cfg.AccountID})
}
if code != 202 {
t.Fatal("dev reservation refused")
diff --git a/internal/console/domainbuy_fix_test.go b/internal/console/domainbuy_fix_test.go
index 7dbca6960..dfa2b0633 100644
--- a/internal/console/domainbuy_fix_test.go
+++ b/internal/console/domainbuy_fix_test.go
@@ -216,8 +216,8 @@ func TestCheckLimiterPerAccountAndDeployment(t *testing.T) {
f.setUser("owner" + f.acct.Sqid + "@example.com")
signUp(t, f.consoleFixture, browser, "limited")
status, _, body = postForm(t, browser, f.ts.URL+"/a/"+f.acct.Sqid+"/apps/kass/domains/check", map[string][]string{"csrf": {sessionToken(t, f.consoleFixture, browser)}, "name": {"shop.com"}})
- if status != 429 {
- t.Errorf("browser budget: status %d", status)
+ if status != 429 || !strings.Contains(body, domainBuyCopy["rate"]) {
+ t.Errorf("browser budget: %d %s", status, body)
}
// Six independent paid accounts can spend at most 120 deployment tokens.
for i := 0; i < 6; i++ {
diff --git a/internal/console/managedbudget_test.go b/internal/console/managedbudget_test.go
index 2552efb86..73aca57ba 100644
--- a/internal/console/managedbudget_test.go
+++ b/internal/console/managedbudget_test.go
@@ -252,10 +252,10 @@ func TestManagedPublicationRefreshBudget(t *testing.T) {
}
})
t.Run("crash-after-attempt", func(t *testing.T) {
- s, b, now := readyFixture(t)
+ s, _, now := readyFixture(t)
st := countReadiness(s)
st.failPut = true
- b = workerStep(t, s, now)
+ b := workerStep(t, s, now)
st.failPut = false
// The attempt stamp was written, then the process died before any
// observation: the old passing checks must not authorize a PUT.
diff --git a/internal/console/managedenrol_test.go b/internal/console/managedenrol_test.go
index ec8576939..af094d4e6 100644
--- a/internal/console/managedenrol_test.go
+++ b/internal/console/managedenrol_test.go
@@ -25,8 +25,8 @@ import (
func enrolFixture(t *testing.T) (*Server, managedBox, string, time.Time) {
t.Helper()
- s, _, _, now := managedWorkerFixture(t)
- now = time.Now().UTC()
+ s, _, _, _ := managedWorkerFixture(t)
+ now := time.Now().UTC()
b := workerStep(t, s, now)
key, _, err := openManagedEnrolKey(s.cfg.AlertSealKeyPath)
if err != nil {
diff --git a/internal/console/managedrecovery_test.go b/internal/console/managedrecovery_test.go
index 05a563c05..af11928ff 100644
--- a/internal/console/managedrecovery_test.go
+++ b/internal/console/managedrecovery_test.go
@@ -363,7 +363,7 @@ func TestManagedDeadlineBeforeBackoff(t *testing.T) {
t.Run(state, func(t *testing.T) {
s, p, _, now := managedWorkerFixture(t)
b := workerStep(t, s, now)
- b = workerAdvance(t, s, b, func(b *managedBox) {
+ workerAdvance(t, s, b, func(b *managedBox) {
b.State = state
b.ReadyAt = now.Add(time.Minute)
if state == "publishing" {
diff --git a/internal/console/managedworker.go b/internal/console/managedworker.go
index 6f4059ac3..b0811d062 100644
--- a/internal/console/managedworker.go
+++ b/internal/console/managedworker.go
@@ -160,7 +160,7 @@ func (s *Server) managedFleetsPass(ctx context.Context, now time.Time) error {
ctx = context.WithValue(ctx, managedReadinessPassKey{}, &managedReadinessPass{})
ctx = s.managedPassClock(ctx, now)
unprepared := map[string]bool{}
- ops, boxes, err := s.store.ManagedWork(ctx)
+ ops, _, err := s.store.ManagedWork(ctx)
if err != nil {
return errManagedWorker
}
@@ -215,7 +215,7 @@ func (s *Server) managedFleetsPass(ctx context.Context, now time.Time) error {
unlock()
}
}
- _, boxes, err = s.store.ManagedWork(ctx)
+ _, boxes, err := s.store.ManagedWork(ctx)
if err != nil {
return errManagedWorker
}
diff --git a/internal/console/managedworker_test.go b/internal/console/managedworker_test.go
index 5fbd93fe0..bc50e7555 100644
--- a/internal/console/managedworker_test.go
+++ b/internal/console/managedworker_test.go
@@ -143,7 +143,7 @@ func TestManagedDeadline(t *testing.T) {
t.Run(state, func(t *testing.T) {
s, p, _, now := managedWorkerFixture(t)
b := workerStep(t, s, now)
- b = workerAdvance(t, s, b, func(b *managedBox) { b.State = state })
+ workerAdvance(t, s, b, func(b *managedBox) { b.State = state })
workerStep(t, s, now.Add(20*time.Minute-time.Second))
if got := workerBox(t, s); got.State == "failed" || got.State == "terminating" {
t.Fatal("early failure")
@@ -276,8 +276,8 @@ func TestManagedAcceptedTerminateAbsent(t *testing.T) {
for _, kind := range []string{"lost-response", "notfound", "crash-before-dispatch", "no-attempt", "different-id", "identity-empty", "stopped", "shutting-down"} {
t.Run(kind, func(t *testing.T) {
s, p, _, now := managedWorkerFixture(t)
- b := workerStep(t, s, now)
- b = workerStep(t, s, now.Add(20*time.Minute))
+ workerStep(t, s, now)
+ b := workerStep(t, s, now.Add(20*time.Minute))
spy := &managedComputeScript{Fake: p}
s.cfg.ManagedCompute = spy
switch kind {
@@ -843,9 +843,9 @@ func TestManagedFailedEnrolledBeforeTerminate(t *testing.T) {
}
func TestManagedWorkerClearsRetrySchedule(t *testing.T) {
- s, _, b, now := managedWorkerFixture(t)
- b = workerStep(t, s, now)
- b = workerAdvance(t, s, b, func(b *managedBox) { b.NextCleanupAt = now.Add(time.Second) })
+ s, _, _, now := managedWorkerFixture(t)
+ b := workerStep(t, s, now)
+ workerAdvance(t, s, b, func(b *managedBox) { b.NextCleanupAt = now.Add(time.Second) })
b = workerStep(t, s, now.Add(time.Second))
if !b.NextCleanupAt.IsZero() {
t.Fatal("successful observation retained an expired retry time")
diff --git a/internal/console/overview_test.go b/internal/console/overview_test.go
index 42abeaab0..66094834a 100644
--- a/internal/console/overview_test.go
+++ b/internal/console/overview_test.go
@@ -537,7 +537,7 @@ func TestInstancesPageFilters(t *testing.T) {
if status != http.StatusOK || !strings.Contains(body, "No addresses match.") {
t.Fatalf("filtered-empty state missing (%d):\n%s", status, body)
}
- status, _, body = get(t, c, fx.u("/apps/kass/instances?health=running"))
+ status, _, _ = get(t, c, fx.u("/apps/kass/instances?health=running"))
if status != http.StatusOK {
t.Fatalf("health filter = %d", status)
}
diff --git a/internal/domains/freshdns_test.go b/internal/domains/freshdns_test.go
index 8af6496f1..9f7047404 100644
--- a/internal/domains/freshdns_test.go
+++ b/internal/domains/freshdns_test.go
@@ -1283,7 +1283,7 @@ func TestFreshResolverForgetEndsTheBackoff(t *testing.T) {
// cost) to the zone, as main did. A new name never climbs: the cache
// hears nothing below the registrable domain.
func TestFreshResolverUpgradeClimbsPastNonZoneLabels(t *testing.T) {
- w, last := deepWorld(t)
+ w, _ := deepWorld(t)
ips, err := w.resolver(clock()).ResolveUpgrade(deepGapName)
if err != nil || len(ips) != 1 || ips[0] != edgeIP {
t.Fatalf("ResolveUpgrade = %v, %v; want [%s] from a.b.c.d.example.com", ips, err, edgeIP)
@@ -1292,7 +1292,7 @@ func TestFreshResolverUpgradeClimbsPastNonZoneLabels(t *testing.T) {
if got := strings.Join(w.cached, ","); got != want {
t.Fatalf("cached queries = %s, want %s", got, want)
}
- w, last = deepWorld(t)
+ w, last := deepWorld(t)
if ips, err := w.resolver(clock()).Resolve(deepGapName); err == nil {
t.Fatalf("Resolve = %v, want the new name's walk refused at the referral bound", ips)
}
diff --git a/internal/domains/reconcile.go b/internal/domains/reconcile.go
index d17181c09..6a6cd1f3a 100644
--- a/internal/domains/reconcile.go
+++ b/internal/domains/reconcile.go
@@ -346,7 +346,7 @@ func Reconcile(ctx context.Context, s release.Store, reg *registry.Registry, cfg
// --- 3. canary hosts: mint for hostless pointers, remove for retired ----
canaryChannels := map[appKey]map[string]bool{} // (account, app) -> live canary/<name> channels
for _, key := range keys {
- acctOfKey, app, _, ok := appKeyOwner(key, known)
+ acctOfKey, _, _, ok := appKeyOwner(key, known)
if !ok {
continue
}
diff --git a/internal/host/claimmoveaccess_test.go b/internal/host/claimmoveaccess_test.go
index 7c6b72d40..a38269c22 100644
--- a/internal/host/claimmoveaccess_test.go
+++ b/internal/host/claimmoveaccess_test.go
@@ -32,7 +32,7 @@ func TestPlan10G2ReadAccess(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- o, err = hostclaim.Update(ctx, f.claims, o, func(c *hostclaim.Claim) error {
+ _, err = hostclaim.Update(ctx, f.claims, o, func(c *hostclaim.Claim) error {
c.Op = hostclaim.Op{Kind: hostclaim.KindLanding, ID: "m1", Phase: hostclaim.PhaseProbing, Exec: "box-1", Participants: []string{"box-0", "box-1"}, Intent: map[string]string{"source": "box-0", "target": "box-1", "to": "ie"}}
return nil
})
diff --git a/internal/host/claimservingpark_linux_test.go b/internal/host/claimservingpark_linux_test.go
index ad3d2d3fb..a1f0d5fcb 100644
--- a/internal/host/claimservingpark_linux_test.go
+++ b/internal/host/claimservingpark_linux_test.go
@@ -603,7 +603,8 @@ func TestServingParkLedgerDurableWriteFailures(t *testing.T) {
}
if err == nil {
f.now = r.ReapAfter
- err = f.ledger.withNamespace(t.Context(), func() error { return f.ledger.reapLocked(t.Context(), a.ID) })
+ // The reap is the last write; whether its fault landed or not, the replay below must finish it.
+ _ = f.ledger.withNamespace(t.Context(), func() error { return f.ledger.reapLocked(t.Context(), a.ID) })
}
f.ledger.state, f.fs.state = f.disk, f.disk
if _, readErr := f.disk.Read("namespace.json"); os.IsNotExist(readErr) {
diff --git a/internal/host/claimstop_writers_rev4_linux_test.go b/internal/host/claimstop_writers_rev4_linux_test.go
index 756b61849..506c04da5 100644
--- a/internal/host/claimstop_writers_rev4_linux_test.go
+++ b/internal/host/claimstop_writers_rev4_linux_test.go
@@ -38,7 +38,6 @@ func TestRev4WritersPrefixCoverage(t *testing.T) {
if err := os.Remove(target); err != nil {
t.Fatal(err)
}
- target += " (deleted)"
}
if shape == "empty-directory" {
if err := os.Remove(fx.db); err != nil {
diff --git a/internal/host/group_names_test.go b/internal/host/group_names_test.go
index 207a499be..3c28690c6 100644
--- a/internal/host/group_names_test.go
+++ b/internal/host/group_names_test.go
@@ -473,9 +473,13 @@ var groupNameProducerInventory = map[string]string{
"../domains/namespacealiases.go:deriveNamespaceAliases": "b4066d58cc5618c1323dadfc885d940143ba3abbcee0287df9639578e45fb67d",
"../domains/namespacealiases.go:repairNamespaceStatus": "1b9bae5baa6aeb724e484f17edaaafecc1df9d249f7c8723e9581be83b0536c0",
"../domains/aliases.go:deriveRegional": "79fd7c432e6b0a9ffd945312851e52af2c450769416ef44ff9a4bea681b44cde",
- "../domains/reconcile.go:Reconcile": "8b2848535d0a15117d578ac28c7486997c6ad8960b58b6dca5d4b35cde14eed0",
- "../domains/reconcile.go:mintedRoute": "dbd2211f62fc606661c6d8258ecfbf18f0b3c865e775522c5b363d01c442fca9",
- "../edge/assetcatch.go:*Edge.AssetOwners": "2b9ce5620a6defa16f12cb38d389ac59aa594049d37d84746f0a76419ab05b5f",
+ // staticcheck SA4006: the canary pass drops appKeyOwner's app, which
+ // canaryPointer (built on appKeyOwner for the same key) replaced before
+ // any read; every canary name is minted from the same values; no name
+ // class.
+ "../domains/reconcile.go:Reconcile": "99411971c4ecde7c00124e78e87f4231a06b174bea31826eb7a88eccdb98b560",
+ "../domains/reconcile.go:mintedRoute": "dbd2211f62fc606661c6d8258ecfbf18f0b3c865e775522c5b363d01c442fca9",
+ "../edge/assetcatch.go:*Edge.AssetOwners": "2b9ce5620a6defa16f12cb38d389ac59aa594049d37d84746f0a76419ab05b5f",
// Name resolution and owner binding unchanged in class; farForward now resolves owner and destination from one snapshot via backhaul; no new name class produced.
"../edge/assetcatch.go:*Edge.serveAssetFar": "775ee62d683e07fbcee8a9ea21e03b0b364a5d07aadef8f333da37985c2eaa9b",
// Demo protections wrap existing proxies and retain refusal-only names.
diff --git a/internal/host/link_sim_test.go b/internal/host/link_sim_test.go
index 99ba672de..39819def4 100644
--- a/internal/host/link_sim_test.go
+++ b/internal/host/link_sim_test.go
@@ -518,7 +518,7 @@ func (s *homeSim) openWS(name string) {
}
buf := make([]byte, 4)
if _, err := conn.Write([]byte("ping")); err == nil {
- _, err = io.ReadFull(br, buf)
+ io.ReadFull(br, buf) // a short read fails the echo check below
}
conn.SetDeadline(time.Time{})
got := s.reached(id, "a WebSocket open")
diff --git a/internal/host/movesbuildstatepark_test.go b/internal/host/movesbuildstatepark_test.go
index d69594361..c92789520 100644
--- a/internal/host/movesbuildstatepark_test.go
+++ b/internal/host/movesbuildstatepark_test.go
@@ -27,6 +27,7 @@ func TestALandingOntoALocationHoldingABuildStateCompletes(t *testing.T) {
h := newLandingHarness(t)
storeState(h.phase1Harness, "data-ie", cutRoot+"/build-state.json", "v6")
h.flip(t)
+ //lint:ignore SA4006 the residue is planted here, before the landing; keys is read after the parked flow's skip comes off
keys := h.residue(t)
dst := cutRoot + "/build-state.json"
if _, err := h.vs.PutIfAbsent(context.Background(), "data-uk", dst, []byte(p1StateBody("v3"))); err != nil {
diff --git a/internal/host/movesfileslive_test.go b/internal/host/movesfileslive_test.go
index fc98f002f..db317c31a 100644
--- a/internal/host/movesfileslive_test.go
+++ b/internal/host/movesfileslive_test.go
@@ -494,8 +494,8 @@ func admitTarget(t *testing.T, h *landingHarness) {
// parked/.
func TestSourceCleanupKeepsTheFilesLiveSetUntilTheCommit(t *testing.T) {
t.Parallel()
- ctx := context.Background()
skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)")
+ ctx := context.Background()
h := newFinalHarness(t)
h.advanceToProbed(t)
admitTarget(t, h.landingHarness)
@@ -554,8 +554,8 @@ func TestSourceCleanupKeepsTheFilesLiveSetUntilTheCommit(t *testing.T) {
// back, the target's cleaning runs it and the files are retired.
func TestRollbackReturnCleanupKeepsTheFilesLiveSet(t *testing.T) {
t.Parallel()
- ctx := context.Background()
skipParkedSecretFlow(t, "its flow carries <host>.env and stops at one of the parked refusals")
+ ctx := context.Background()
h := newRollbackHarness(t)
admitTarget(t, h.landingHarness)
location := strings.TrimSuffix(h.claim(t).Holder.Location, "/")
diff --git a/internal/host/movesinstall_test.go b/internal/host/movesinstall_test.go
index 5053d31d4..fb832f43a 100644
--- a/internal/host/movesinstall_test.go
+++ b/internal/host/movesinstall_test.go
@@ -480,6 +480,7 @@ func TestDirtyReturnInstallsUnderTheSourceStamp(t *testing.T) {
func TestDirtyReturnParksAnUnregisteredSource(t *testing.T) {
t.Parallel()
h := newReturnHarness(t, false)
+ //lint:ignore SA4006 the inputs are pinned before the install; pinned is read after the parked flow's skip comes off
pinned := h.read(t, p1Host).Move.Inputs
skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)")
if refused, err := h.install(t); err != nil || refused != "" {
diff --git a/internal/host/movesland_test.go b/internal/host/movesland_test.go
index 70de4c216..df0df1600 100644
--- a/internal/host/movesland_test.go
+++ b/internal/host/movesland_test.go
@@ -617,7 +617,6 @@ func (h *landingHarness) installed(t *testing.T) moves.InstallManifest {
// <dbPath>.gen written, installed_db_sha256 recorded, the lease released.
func TestLandingBuildsInstallsAndRestores(t *testing.T) {
t.Parallel()
- ctx := context.Background()
h := newLandingHarness(t)
h.timers = []registry.Timer{{Host: p1Host, Name: "nightly", Kind: "cron", Spec: "0 3 * * *", NextAt: 1000, Attempts: 2, Registration: "reg-1"},
{Host: p1Host, Name: "once", Kind: "once", NextAt: 2000, DueAt: 2000, Registration: "reg-2"}}
@@ -625,6 +624,7 @@ func TestLandingBuildsInstallsAndRestores(t *testing.T) {
h.route.Replication = ""
h.land(t)
skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)")
+ ctx := context.Background()
im := h.installed(t)
// The generation holds exactly the build's four objects, at usable
// versions, in this box's own bucket.
@@ -843,7 +843,6 @@ func (h *landingHarness) residue(t *testing.T) []string {
// live here, Engine.Run on them acknowledges rather than refusing.
func TestLandingParkingWaitsForTheManifest(t *testing.T) {
t.Parallel()
- ctx := context.Background()
h := newLandingHarness(t)
h.flip(t)
keys := h.residue(t)
@@ -899,6 +898,7 @@ func TestLandingParkingWaitsForTheManifest(t *testing.T) {
h.vs.skipDelete = nil
h.land(t)
skipParkedSecretFlow(t, "its flow carries <host>.env and stops at one of the parked refusals")
+ ctx := context.Background()
h.installed(t)
c = h.claim(t)
var retirements []string
@@ -1002,7 +1002,6 @@ func TestLandingParkingWaitsForTheManifest(t *testing.T) {
// walked step by step, with each transition written separately.
func TestLandingPhaseCatchUp(t *testing.T) {
t.Parallel()
- ctx := context.Background()
h := newLandingHarness(t)
h.flip(t)
h.landAt = "after-record-parking"
@@ -1018,6 +1017,7 @@ func TestLandingPhaseCatchUp(t *testing.T) {
h.landDone = false
h.land(t)
skipParkedSecretFlow(t, "its flow carries <host>.env and stops at one of the parked refusals")
+ ctx := context.Background()
h.installed(t)
// A claim left at checking with the record at restored.
@@ -1194,8 +1194,8 @@ func TestLandingConfiguredPinsInputs(t *testing.T) {
return appconfig.HeldRender{BundleETags: map[string]string{"default": "e2", "environment": ""}}, nil
}
h.land(t)
- m := h.read(t, p1Host).Move
skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)")
+ m := h.read(t, p1Host).Move
if m.Reason != provision.RollbackConfigChanged || m.LandingPhase != provision.LandConfigured || m.State != provision.MoveLanding {
t.Fatalf("after the render: %+v", m)
}
@@ -1961,11 +1961,11 @@ func TestLandingCorruptBuildMarksRollback(t *testing.T) {
// at the next generation write, and the replay completes.
func TestLandingRebuildNeedsTheLease(t *testing.T) {
t.Parallel()
- ctx := context.Background()
h := newLandingHarness(t)
h.flip(t)
h.landAt = "after-record-configured"
skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)")
+ ctx := context.Background()
h.crashLand(t)
if err := os.RemoveAll(filepath.Join(h.tdir, ".moves", p1Host, p1ID, "build")); err != nil {
t.Fatal(err)
diff --git a/internal/host/movesloss_test.go b/internal/host/movesloss_test.go
index c3c5a0fea..5c3595afd 100644
--- a/internal/host/movesloss_test.go
+++ b/internal/host/movesloss_test.go
@@ -628,8 +628,8 @@ func (failingList) ListVersions(context.Context, string, string) ([]lease.Object
// or that is not the source baseline, waits (hostbox.ErrChanged), which the
// probe adapter turns into another pass.
func TestLossSourcesReadOnlyTheRestorePlan(t *testing.T) {
- ctx := context.Background()
skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)")
+ ctx := context.Background()
f := newRCFixture(t, rcClean)
pub := f.declare(false, []hostclaim.WriteSource{rcCutSource()}, rcBeforeTarget)
o := f.read()
@@ -663,8 +663,8 @@ func TestLossSourcesReadOnlyTheRestorePlan(t *testing.T) {
// lineage link and the source baseline before the CAS, as every recovery
// admission does.
func TestRecoveryAdmissionEvidenceAcceptsTheFrozenMaximum(t *testing.T) {
- ctx := context.Background()
skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)")
+ ctx := context.Background()
f := newRCFixture(t, rcClean)
pub := f.declare(false, []hostclaim.WriteSource{rcCutSource()}, rcBeforeTarget)
o := f.read()
@@ -838,8 +838,8 @@ func TestLostTargetReturnDeclaresEverySessionOnce(t *testing.T) {
// mv's generation) is declared lost. The validated source carries the same
// 0, which the claim compares (lost.go:194).
func TestLostTargetGenerationOutsideTheRestoreDeclaresAllItsWrites(t *testing.T) {
- ctx := context.Background()
skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)")
+ ctx := context.Background()
f := newRCFixture(t, rcClean)
// The target's own bucket, which the source never reads: t2 restarted
// at [1, 1] and holds TXID 2.
diff --git a/internal/host/movesrecover_test.go b/internal/host/movesrecover_test.go
index aa1a72e60..fa54894cf 100644
--- a/internal/host/movesrecover_test.go
+++ b/internal/host/movesrecover_test.go
@@ -661,8 +661,8 @@ func TestSourceRecoveryNeverReverifiesAfterProbing(t *testing.T) {
// (TestBoxClosesAreRecordFirst).
func TestRolledBackFinalizationReleasesTheClaim(t *testing.T) {
t.Parallel()
- ctx := context.Background()
skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)")
+ ctx := context.Background()
h := newRecoverHarness(t, false)
h.released(t)
h.srcPass(t)
diff --git a/internal/host/movesrecoveryowners_test.go b/internal/host/movesrecoveryowners_test.go
index 7ae245322..adcf021f8 100644
--- a/internal/host/movesrecoveryowners_test.go
+++ b/internal/host/movesrecoveryowners_test.go
@@ -688,13 +688,13 @@ func TestRevertProbeAdmitsUncovered(t *testing.T) {
// the recovery owners, and the moving kind nothing; without C8 the
// recovery kinds refuse, typed, while the landing is unchanged.
func TestMovesOwnersDispatchByKind(t *testing.T) {
+ skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)")
ctx := t.Context()
dispatch := func(m *movesProbeOwners) ClaimOwnerDispatch {
owners := m.MovesOwners(&movesProbeAttempts{}).ClaimKindOwners
return ClaimOwnerDispatch{Moves: &owners}
}
- skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)")
landing := newPOFixture(t)
landing.owners.Files = &rcFiles{f: landing}
in, err := dispatch(landing.owners).Select(ctx, landing.route, landing.read(), poProbe)
diff --git a/internal/host/movesrollback_test.go b/internal/host/movesrollback_test.go
index 273f93de2..b3bf454ec 100644
--- a/internal/host/movesrollback_test.go
+++ b/internal/host/movesrollback_test.go
@@ -327,8 +327,8 @@ func TestRollbackDecisionConvertsTheMark(t *testing.T) {
// they were. The open is the commit's path (Plan 3 Task 7).
func TestRollbackCASLosesToCommit(t *testing.T) {
t.Parallel()
- ctx := context.Background()
skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)")
+ ctx := context.Background()
h := newRollbackHarness(t)
h.step(t, provision.LandProbing, provision.LandProbed)
stale := h.read(t, p1Host)
@@ -375,8 +375,8 @@ func TestRollbackCASLosesToCommit(t *testing.T) {
// park-local, and the target region's predecessors are covered.
func TestReleaseIsCleanWhenNothingChanged(t *testing.T) {
t.Parallel()
- ctx := context.Background()
skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)")
+ ctx := context.Background()
h := newRollbackHarness(t)
rewriteP1Claim(t, h.s, func(c *hostclaim.Claim) {
c.Holder.Admissions = append(c.Holder.Admissions, hostclaim.AdmissionRecord{Region: "uk", PredecessorRegion: "uk", Session: 3,
@@ -473,8 +473,8 @@ func TestReleaseBeforeProbingNeedsNoDigests(t *testing.T) {
// return lane gets the staged seal's exact versions, as given.
func TestReleaseIsDirtyWithoutSrcCovered(t *testing.T) {
t.Parallel()
- ctx := context.Background()
skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)")
+ ctx := context.Background()
h := newRollbackHarness(t)
h.uncover(t)
staged := h.seal(t)
@@ -585,8 +585,8 @@ func decodeLTXDatabase(t *testing.T, body []byte, path string) ltx.Header {
// the return seal names exactly it.
func TestDirtyReturnSnapshotsTheStoppedDatabase(t *testing.T) {
t.Parallel()
- ctx := context.Background()
skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)")
+ ctx := context.Background()
h := newRollbackHarness(t)
dbPath := provision.DefaultDBPath(h.tdir, p1Host)
d, err := sql.Open("sqlite", dbPath)
@@ -679,8 +679,8 @@ func TestDirtyReturnSnapshotsTheStoppedDatabase(t *testing.T) {
// LeaseUntil + H, not before.
func TestReturnLaneWriterIsGuarded(t *testing.T) {
t.Parallel()
- ctx := context.Background()
skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)")
+ ctx := context.Background()
h := newRollbackHarness(t)
h.uncover(t)
h.rollBack(t)
diff --git a/internal/host/movesrollback_witness_test.go b/internal/host/movesrollback_witness_test.go
index 10010fdca..31c2a5364 100644
--- a/internal/host/movesrollback_witness_test.go
+++ b/internal/host/movesrollback_witness_test.go
@@ -43,8 +43,8 @@ func sourceGenerationObjects(h *recoverHarness) map[string]fakeMoveObject {
// Commit covers the record (hostclaim's half of the witness).
func TestRollbackBaselineSurvivesTheCleanReturn(t *testing.T) {
t.Parallel()
- ctx := context.Background()
skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)")
+ ctx := context.Background()
h := newRecoverHarness(t, false)
baseline := sourceGenerationObjects(h)
if len(baseline) == 0 {
diff --git a/internal/host/moveswakesource_linux_test.go b/internal/host/moveswakesource_linux_test.go
index 89634a622..70d54fb35 100644
--- a/internal/host/moveswakesource_linux_test.go
+++ b/internal/host/moveswakesource_linux_test.go
@@ -760,8 +760,8 @@ func mwDeclare(t *testing.T, f *rcFixture) (ed25519.PublicKey, string, string) {
// restore does not contain the move id's generation) and the uncovered cut
// at the seal's maximum; the source restores its own baseline.
func TestLostTargetRecoveryRunsAgainstARealDeclaration(t *testing.T) {
- ctx := t.Context()
skipParkedSecretFlow(t, "the move's install places <host>.env, so its prepared manifest is refused (BuildPrepared, wantEnv)")
+ ctx := t.Context()
f := newRCFixture(t, rcClean)
pub, lossID, rb := mwDeclare(t, f)
o := f.read()
diff --git a/internal/host/plan14_fix5_live_linux_test.go b/internal/host/plan14_fix5_live_linux_test.go
index b55be925a..ce05e0bdb 100644
--- a/internal/host/plan14_fix5_live_linux_test.go
+++ b/internal/host/plan14_fix5_live_linux_test.go
@@ -167,7 +167,7 @@ func fix5Run(t *testing.T, kind, history string, main bool) []fix5Result {
pr := f.e.root
pr.obs = observer
restart := rootRestartRouteWith(f.e.root.reg, u, f.u.opt, getenv, observer.recordSettled(f.e.bake), f.c)
- rollback := rollbackUnitRestart(f.e.root.reg, u, f.u.opt, getenv, f.c)
+ var rollback func(string) error
startChecks := f.c
startChecks.legacyStart = u.Start
start := rollbackUnitRestart(f.e.root.reg, u, f.u.opt, getenv, startChecks)
diff --git a/internal/host/plan14_root_failures_root_linux_test.go b/internal/host/plan14_root_failures_root_linux_test.go
index dcc9844aa..b5de4627d 100644
--- a/internal/host/plan14_root_failures_root_linux_test.go
+++ b/internal/host/plan14_root_failures_root_linux_test.go
@@ -88,7 +88,7 @@ func TestPlan14SwapFailureHostileRootRunner(t *testing.T) {
}
return op()
})
- b, err = rollout.OpenRootFailures(fault, "box/en/1")
+ _, err = rollout.OpenRootFailures(fault, "box/en/1")
if err == nil {
t.Fatal("owed directory sync admitted")
}
diff --git a/internal/host/replicaplacement.go b/internal/host/replicaplacement.go
index ea901d089..ad40559be 100644
--- a/internal/host/replicaplacement.go
+++ b/internal/host/replicaplacement.go
@@ -123,7 +123,9 @@ func (w *replicaPlacementWorker) run(ctx context.Context, now time.Time) {
} else if err == nil && a.Contains(w.box) && rt != nil && rt.ReplicaIncarnation == inc && rt.ReplicaRevision == a.Revision && provision.ReplicaCoordinatorBox(&rec, now) == w.box && w.coordinator != nil {
if _, err = w.coordinator.Acquire(rctx, id); err == nil && w.publisher != nil {
// Acquire's new term reaches the publisher through the next record pass.
- done, err = w.publisher.publishCurrent(rctx, rec, *rt)
+ // publishCurrent answers false with every error, so done alone
+ // decides the retry. Like Acquire's, the error is not logged.
+ done, _ = w.publisher.publishCurrent(rctx, rec, *rt)
}
}
cancel()
diff --git a/internal/host/runs_test.go b/internal/host/runs_test.go
index aa8cce854..65f4592c7 100644
--- a/internal/host/runs_test.go
+++ b/internal/host/runs_test.go
@@ -179,11 +179,11 @@ func TestRunsWorkerForwardsACancelToItsRun(t *testing.T) {
w := testWorker(s, runOwnedRoute(runHost), "box-1", "boot-1", &l)
h := newRunHandle()
w.active[id] = h
- got, err := provision.SetRecordRun(context.Background(), s, "bab", "shop", runHost, provision.RunPick(id, "box-1", "boot-1", time.Now().Add(time.Hour)))
- if err != nil {
+ if _, err := provision.SetRecordRun(context.Background(), s, "bab", "shop", runHost, provision.RunPick(id, "box-1", "boot-1", time.Now().Add(time.Hour))); err != nil {
t.Fatal(err)
}
- if got, err = provision.SetRecordRun(context.Background(), s, "bab", "shop", runHost, provision.RunCancelTransition(id)); err != nil {
+ got, err := provision.SetRecordRun(context.Background(), s, "bab", "shop", runHost, provision.RunCancelTransition(id))
+ if err != nil {
t.Fatal(err)
}
w.consider(context.Background(), *got)
diff --git a/internal/hostops/mail_reconcile.go b/internal/hostops/mail_reconcile.go
index 350f04372..0b81361ac 100644
--- a/internal/hostops/mail_reconcile.go
+++ b/internal/hostops/mail_reconcile.go
@@ -147,7 +147,9 @@ func (w *ControlWriter) ReconcileMailGate(ctx context.Context, gateID string, mi
if err != nil {
return MailGateReconciliation{}, err
}
- if tag, err = w.raw.Put(ctx, MailGateKey, body, tag); err != nil {
+ // The fenced revision is what step 4 checks: it re-reads the gate
+ // and its tag, so this write's tag is not kept.
+ if _, err = w.raw.Put(ctx, MailGateKey, body, tag); err != nil {
return MailGateReconciliation{}, err
}
}
diff --git a/internal/hostrelocate/participant.go b/internal/hostrelocate/participant.go
index 09fd47149..d6e11d403 100644
--- a/internal/hostrelocate/participant.go
+++ b/internal/hostrelocate/participant.go
@@ -268,7 +268,7 @@ func (p Participant) Step(ctx context.Context, host string) (hostclaim.Observed,
if err != nil {
return obs, err
}
- obs, c = counted, counted.Claim
+ obs = counted
session, passed, err := p.Effects.Probe(ctx, obs, certified)
if err != nil || !passed {
return obs, errors.Join(ErrNotYet, err)
diff --git a/internal/instancectl/gen.go b/internal/instancectl/gen.go
index 29e683ffa..f77fb0ccd 100644
--- a/internal/instancectl/gen.go
+++ b/internal/instancectl/gen.go
@@ -422,13 +422,14 @@ func (s *Server) startGen(w http.ResponseWriter, r *http.Request, req request) {
// straight away, so the next reference reads the drop-in fresh: the
// common case needs no reload, which on a small box was a third of the
// whole wake. The check is the same either way (genDropInApplied).
- slice, applied, tierSet := s.genView(ctx, req.host, unit, req.tier)
+ _, applied, tierSet := s.genView(ctx, req.host, unit, req.tier)
if !applied {
reloadStart := time.Now()
if out, err := s.Systemctl(ctx, "daemon-reload"); err != nil {
fail(http.StatusBadGateway, "daemon-reload: "+strings.TrimSpace(out+" "+err.Error()))
return
}
+ var slice string
if slice, applied, tierSet = s.genView(ctx, req.host, unit, req.tier); !applied {
fail(http.StatusBadGateway, "not starting "+unit+": its drop-in did not apply (slice "+strconv.Quote(slice)+")")
return
diff --git a/internal/instancectl/rootfs.go b/internal/instancectl/rootfs.go
index 68a08e8ee..82ff66ce5 100644
--- a/internal/instancectl/rootfs.go
+++ b/internal/instancectl/rootfs.go
@@ -745,7 +745,7 @@ func (s *Server) startRootfs(w http.ResponseWriter, r *http.Request, req request
var slice string
applied, tierSet := true, false
if perStart {
- slice, applied, tierSet = s.rootfsView(ctx, req.host, unit, image, req.tier, withTier)
+ _, applied, tierSet = s.rootfsView(ctx, req.host, unit, image, req.tier, withTier)
}
reload := "skipped"
if !applied || changed || s.jitReloadOwed() {
diff --git a/internal/lease/tombstone_test.go b/internal/lease/tombstone_test.go
index 7ff69f51e..1ba75b0e9 100644
--- a/internal/lease/tombstone_test.go
+++ b/internal/lease/tombstone_test.go
@@ -668,6 +668,9 @@ func TestLiftTombstoneAlreadyLifted(t *testing.T) {
t.Fatalf("already lifted: lifted %v err %v", lifted, err)
}
}
+ if s.writeCount() != writes {
+ t.Fatal("lifting a lifted tombstone again wrote")
+ }
// An own tombstone that simply ran out is lifted too.
s.putLock(t, tombLoc, tombMove, 4, time.Now().Add(-48*time.Hour))
writes = s.writeCount()
diff --git a/internal/mail/walk_environment_test.go b/internal/mail/walk_environment_test.go
index 105c23ca8..5168cfa0b 100644
--- a/internal/mail/walk_environment_test.go
+++ b/internal/mail/walk_environment_test.go
@@ -43,7 +43,7 @@ func TestEnvironmentUserNameAndCallerParsing(t *testing.T) {
func TestEnableEnvironmentMintsADistinctCredentialIntoTheOwnedBundle(t *testing.T) {
ctx, s, p, pub, now := enableFixture(t)
- rec, err := Enable(ctx, s, p, mailTestSealer(pub, "bag", "harbourmail"), testDeployment(), "bag", "harbourmail", now)
+ _, err := Enable(ctx, s, p, mailTestSealer(pub, "bag", "harbourmail"), testDeployment(), "bag", "harbourmail", now)
if err != nil {
t.Fatal(err)
}
@@ -61,7 +61,7 @@ func TestEnableEnvironmentMintsADistinctCredentialIntoTheOwnedBundle(t *testing.
t.Fatal(err)
}
before, _ := appconfig.Get(ctx, s, "bag", "harbourmail")
- rec, err = EnableEnvironment(ctx, s, p, mailTestSealer(pub, "bag", "harbourmail"), testDeployment(), "bag", "harbourmail", "team", now)
+ rec, err := EnableEnvironment(ctx, s, p, mailTestSealer(pub, "bag", "harbourmail"), testDeployment(), "bag", "harbourmail", "team", now)
if err != nil {
t.Fatalf("EnableEnvironment: %v", err)
}
diff --git a/internal/maintenanceguard/guard_test.go b/internal/maintenanceguard/guard_test.go
index 92a8712ce..d638f2ff6 100644
--- a/internal/maintenanceguard/guard_test.go
+++ b/internal/maintenanceguard/guard_test.go
@@ -132,7 +132,7 @@ func TestGuardResumeCrashProjectionAndContracts(t *testing.T) {
denied(t, f, &p, []string{"home.operator.v1"})
}
oldProjection, _ := s.Projection()
- s = f.step(t, c, s, guard.Resumed)
+ f.step(t, c, s, guard.Resumed)
// Durable guard publication without the record CAS must not open admission.
denied(t, f, &oldProjection, []string{"home.operator.v1"})
denied(t, f, nil, []string{"home.operator.v1"})
@@ -177,7 +177,7 @@ func TestGuardStaleWorkersAndExecutingRecovery(t *testing.T) {
t.Fatal("stale write did not preserve CAS conflict", e)
}
s := f.step(t, c, second, guard.Fenced)
- s = f.step(t, c, s, guard.Executing)
+ f.step(t, c, s, guard.Executing)
afterCrash, e := f.repo.ReadGuard(ctx, f.identity.Host)
if e != nil {
t.Fatal(e)
diff --git a/internal/objstore/queue_test.go b/internal/objstore/queue_test.go
index 4d0dc8a11..0e5c534b9 100644
--- a/internal/objstore/queue_test.go
+++ b/internal/objstore/queue_test.go
@@ -1245,13 +1245,12 @@ func TestReusedVerdictCarriesNoProvenance(t *testing.T) {
s, sc, idx, bucket := queueFixture(t, 1)
// Pre-tag the object at its current version, as a sweep would have.
- obj := ScanObject{Key: objectName(0), ETag: "etag-" + objectName(0), Size: 10}
status, seen, err := sc.Status(ctx, bucket, objectName(0))
if err != nil {
t.Fatal(err)
}
_ = status
- obj = seen
+ obj := seen
sc.Put(bucket, objectName(0), obj.Version(), VerdictClean)
enqueueN(t, s, idx, 1)
diff --git a/internal/provision/census_propose_internal_test.go b/internal/provision/census_propose_internal_test.go
index cdd3a2519..63f1002e2 100644
--- a/internal/provision/census_propose_internal_test.go
+++ b/internal/provision/census_propose_internal_test.go
@@ -343,12 +343,12 @@ func TestCensusNamesWholeKeys(t *testing.T) {
// A body change to a unit whose key has a space is still an approval.
func TestCensusClassifiesAKeyWithASpace(t *testing.T) {
- got, inv, seal := proposeFixture(t)
+ got, inv, _ := proposeFixture(t)
key := "internal/a/t.go:type gen"
e := classifiedRootRead{rootReadEntry: rootReadEntry{File: "internal/a/t.go", Unit: "type gen", Kinds: "registry:Host@3", Digest: strings.Repeat("7", 64)}, Class: "legacy", Task: "accepted-legacy", Basis: "accepted-legacy;rev3=J1;basis=root-route"}
inv.Entries[key], inv.Frozen[key] = e, e
inv.Legacy[rootReadLegacyFingerprint(e)] = true
- seal = rootReadLegacySeal(inv)
+ seal := rootReadLegacySeal(inv)
got.Entries = append(got.Entries, e.rootReadEntry)
got.Declarations[key] = e.Digest
change(&got, key, "registry:Host@4", strings.Repeat("8", 64))
diff --git a/internal/provision/plan9_b8_census_test.go b/internal/provision/plan9_b8_census_test.go
index 9a7c36ecf..8b06d91df 100644
--- a/internal/provision/plan9_b8_census_test.go
+++ b/internal/provision/plan9_b8_census_test.go
@@ -366,7 +366,7 @@ func TestPlan9B8RecordWriteCensus(t *testing.T) {
if len(got) < 100 {
t.Fatalf("census found only %d units under %s; the walk is broken", len(got), root)
}
- inventory := boundedSystemctlWriteCensusInventory()
+ inventory := staticcheckSA4006WriteCensusInventory()
problems := append(censusDiff(inventory, got), censusPolicy(inventory)...)
if len(problems) > 0 {
t.Fatalf("record-write census rejected %d site(s); update the explicit inventory only after reviewing the source:\n %s", len(problems), strings.Join(problems, "\n "))
diff --git a/internal/provision/replicaassignment_test.go b/internal/provision/replicaassignment_test.go
index 7613d4f39..9ff49f08a 100644
--- a/internal/provision/replicaassignment_test.go
+++ b/internal/provision/replicaassignment_test.go
@@ -345,7 +345,7 @@ func TestReplicaAssignmentManifestEvidence(t *testing.T) {
if _, err := SetRecordReplicaAssignment(ctx, s, id, want, replicas.Assignment{Desired: 2, Boxes: []string{"a", "b"}}); err == nil || !bytes.Equal(before, assignmentBytes(t, s, id)) {
t.Fatal("bootstrap lost the old copy")
}
- got, err := SetRecordReplicaAssignment(ctx, s, id, want, replicas.Assignment{Desired: 2, Boxes: []string{"a", "b"}, Retiring: []string{"old"}})
+ _, err := SetRecordReplicaAssignment(ctx, s, id, want, replicas.Assignment{Desired: 2, Boxes: []string{"a", "b"}, Retiring: []string{"old"}})
if err != nil {
t.Fatal(err)
}
@@ -360,7 +360,7 @@ func TestReplicaAssignmentManifestEvidence(t *testing.T) {
ctx, s, _, id, want = assignmentFixture(t)
assignmentReplace(t, s, id, func(r *Record) { r.RecordSeq = 0 })
want.RecordSeq = 0
- got, err = SetRecordReplicaAssignment(ctx, s, id, want, replicas.Assignment{Desired: 1, Boxes: []string{"a"}})
+ got, err := SetRecordReplicaAssignment(ctx, s, id, want, replicas.Assignment{Desired: 1, Boxes: []string{"a"}})
if err != nil || got.RecordSeq != 1 {
t.Fatalf("legacy counter: %+v %v", got, err)
}
@@ -419,10 +419,10 @@ func (s *assignmentCountingStore) Put(ctx context.Context, key string, body []by
func TestReplicaAssignmentLegacyWriterReadBudget(t *testing.T) {
for _, region := range []bool{false, true} {
- ctx, base, rec, id, _ := assignmentFixture(t)
+ _, base, rec, id, _ := assignmentFixture(t)
// A legacy stateful record has no manifest evidence or assignment.
assignmentReplace(t, base, id, func(r *Record) { r.Hibernate = nil })
- ctx = context.Background()
+ ctx := context.Background()
s := &assignmentCountingStore{Store: base}
var err error
if region {
@@ -488,12 +488,12 @@ func TestReplicaAssignmentUnknownMembersSurviveOrdinaryWrite(t *testing.T) {
func TestReplicaCoordinatorTransferAfterExpiry(t *testing.T) {
ctx, s, _, id, want := assignmentFixture(t)
- rec, err := SetRecordReplicaAssignment(ctx, s, id, want, replicas.Assignment{Desired: 2, Boxes: []string{"a", "b"}})
+ _, err := SetRecordReplicaAssignment(ctx, s, id, want, replicas.Assignment{Desired: 2, Boxes: []string{"a", "b"}})
if err != nil {
t.Fatal(err)
}
now := time.Now()
- rec, err = SetRecordCoordinator(ctx, s, id, replicas.CoordinatorChange{Op: "acquire", Box: "a", BootID: "boot"}, now)
+ rec, err := SetRecordCoordinator(ctx, s, id, replicas.CoordinatorChange{Op: "acquire", Box: "a", BootID: "boot"}, now)
if err != nil {
t.Fatal(err)
}
diff --git a/internal/provision/replicadeploy_test.go b/internal/provision/replicadeploy_test.go
index eac581c44..35ccd4f8d 100644
--- a/internal/provision/replicadeploy_test.go
+++ b/internal/provision/replicadeploy_test.go
@@ -236,7 +236,7 @@ func TestReplicaReleaseLegalTransitions(t *testing.T) {
t.Fatalf("begin replay: %+v %v", replay, err)
}
d.Phase = "releasing"
- r, err = SetRecordReplicaRelease(ctx, s, id, 1, d)
+ _, err = SetRecordReplicaRelease(ctx, s, id, 1, d)
if err != nil {
t.Fatal(err)
}
@@ -386,11 +386,11 @@ var swapTarget = replicas.Build{Version: "v2", Digest: "canonical-2"}
func newSwapWorld(t *testing.T, phases ...string) *swapWorld {
t.Helper()
ctx, s, _, id, want := assignmentFixture(t)
- rec, err := SetRecordReplicaAssignment(ctx, s, id, want, replicas.Assignment{Desired: 2, Boxes: []string{"a", "b"}})
+ _, err := SetRecordReplicaAssignment(ctx, s, id, want, replicas.Assignment{Desired: 2, Boxes: []string{"a", "b"}})
if err != nil {
t.Fatal(err)
}
- rec, err = SetRecordCoordinator(ctx, s, id, replicas.CoordinatorChange{Op: "acquire", Box: "a", BootID: "boot"}, time.Now())
+ rec, err := SetRecordCoordinator(ctx, s, id, replicas.CoordinatorChange{Op: "acquire", Box: "a", BootID: "boot"}, time.Now())
if err != nil {
t.Fatal(err)
}
diff --git a/internal/provision/staticcheck_sa4006_census_test.go b/internal/provision/staticcheck_sa4006_census_test.go
new file mode 100644
index 000000000..4f47abd70
--- /dev/null
+++ b/internal/provision/staticcheck_sa4006_census_test.go
@@ -0,0 +1,32 @@
+package provision
+
+// Record-write census re-pin for staticcheck SA4006 (code-health batch 3,
+// branch staticcheck-sa4006), layered on boundedSystemctlWriteCensusInventory.
+// No record write is added, moved or reclassified, and no unit writes
+// anything new. One unit changed only in a value it discarded:
+// - ControlWriter.ReconcileMailGate (hostops): the fence's Put of the
+// mail gate is the same call with the same key, body and tag; only the
+// new tag it returns is discarded (_, err =) instead of assigned to
+// tag, which nothing read: step 4 re-reads the gate and its tag before
+// its own Put. A two-line comment says so. Kinds unchanged: sel:Put.
+func staticcheckSA4006WriteCensusInventory() []censusEntry {
+ entries := append([]censusEntry(nil), boundedSystemctlWriteCensusInventory()...)
+ repins := []censusEntry{
+ {"internal/hostops/mail_reconcile.go", "ControlWriter.ReconcileMailGate", "nonrecord", "sel:Put", "6e11c8d7e2e7214a2470f96c8722aacf466b99ae5406622972d77c01aa3c6740"},
+ }
+ for _, r := range repins {
+ found := false
+ for i, e := range entries {
+ if e.File == r.File && e.Unit == r.Unit {
+ if e.Class != r.Class || e.Kinds != r.Kinds {
+ panic("staticcheck-sa4006 re-pin changes the class or kinds of " + r.File + ":" + r.Unit)
+ }
+ entries[i], found = r, true
+ }
+ }
+ if !found {
+ panic("staticcheck-sa4006 re-pin of an unlisted unit " + r.File + ":" + r.Unit)
+ }
+ }
+ return entries
+}
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 1f548b006..651de2235 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -245,4 +245,5 @@ plan14-root-reads-ha-1192.tsv 8df52839a0c961d3721f3a5c3247d06202dae4e00d011844b7
plan14-root-reads-audit-bugs-2.tsv 1610abfc476fe45d259494242243756dac9cfec49cdd7f7f7b238329392241a1
plan14-root-reads-bounded-systemctl.tsv 16cae3931aadfa57a5293d69becf318645681400777cc08972cf08eb449c2457
plan14-root-reads-mail-submission-followups.tsv c9cd3c8fdf31240b83affa0b2798422f3a99e1d0d400dbaf68665c1127996448
-plan14-root-reads-fix-dbforward-reuse-1032.tsv 72771689d131a1baeabf32439316ea924e595ab29d13bd7d8c664f1a71da9921
+plan14-root-reads-staticcheck-sa4006.tsv 33e5eaaa9b2d80f6f8f5de8d04e908e39ecfc820c5fe7b44c870e671565e1063
+plan14-root-reads-fix-dbforward-reuse-1032.tsv ec3c40098ec0a652c735d54925f334b9b9680c9e2b6cd0c3d9497b8a615fb86f
diff --git a/internal/provision/testdata/plan14-root-reads-staticcheck-sa4006.tsv b/internal/provision/testdata/plan14-root-reads-staticcheck-sa4006.tsv
new file mode 100644
index 000000000..5a50b35dc
--- /dev/null
+++ b/internal/provision/testdata/plan14-root-reads-staticcheck-sa4006.tsv
@@ -0,0 +1,18 @@
+# Census overlay staticcheck-sa4006, written by census-propose (#369). census-ruling-staticcheck-sa4006, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-staticcheck-sa4006.md.
+# 5 body, 0 sites, 7 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+@legacy 04f0c29ce69ce0e38b96e504658db5a5ed003f6d71938fd081d224842b7802e3 deploy.go runDeploy legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-edge-asset-cache-1;basis=takes --assets and --no-assets, refuses both together and bad folders before anything runs (deployAssets), reads the folders saved in .carlos/config for the session's console through configAssets (the config walk the CLI already makes), and saves a new list there as it saves the other deploy settings; read site unchanged (1), none added;rev3=census-ruling-gated-deploy-watch-164;basis=the static-deploy branch passes its watch targets through passGatedTargets (a console POST for a gate pass per gated host) and passes the gated-host set to watchDeployed; no new local read, read site unchanged (1), none added;rev3=census-ruling-region-labels;basis=builds a host-to-label map (hostPlaces) from the instance list it already read and passes it to the static watch targets and watchDeployed, so the watch lines say where; no read added;rev3=census-ruling-first-deploy-493;basis=Sequences existing console APIs for confirmed-missing app and first instance creation, with repeatable environment values; local artifact preflight before these new writes. Existing config artifact stat read retained.;rev3=census-ruling-account-subdomains;basis=builds its watch targets with watchTargetsFor (host, watchOrigin(host), the instance list's public_host as Display, place, probe) from the instance list it already read, and passes them to watchDeployed; deployingLine prints the public host from that same list; the watch still dials and matches host; no read added, read site unchanged (1); fix round 1: a first static deploy keeps the create answer mintPlatformHost now returns (the whole record, not its host) and carries its public_host into the record it appends, for printing only; mintPlatformHost makes the same two console requests as before;rev3=census-ruling-mail-submission-followups;basis=takes --mail and refuses a value but submit before the console is asked anything (the git reads for the version and the dirty-tree check run earlier, as before) (validShipMail, joined with the existing --swap check), and sets the session's shipMail, which the existing ship request sends to the console and checks the echo of (checkMailEcho); its usage text moves to the deployUsage const; no read added, read site unchanged (1);rev3=census-ruling-staticcheck-sa4006;basis=SA4006 dead store: the static-deploy re-list after attaching --host discards the instance total (third result), which nothing after it read; recs, truncated and err are kept and checked as before. No read added, read site unchanged (1). file:Stat@8743 2754d6758a1af4a072e51e4544a2f05e3419d905bf97dd10d30f4da5f6162b92
+@legacy 42acb0c7eb3fb9d9b1658906de233ae6456cd86489e9099c8d4636b2bcd98953 internal/domains/reconcile.go Reconcile legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos), from its domains loop: the seeded-instances body (a trashed app's route kept while an import on its host is journaled, deleted only if the row is still the one listed); self-serve moves 1 Task 4 removes the claims-off 1d auto-purge, so a claims-off box destroys no app objects and a host-claim box only requests the claim's purge as before; the registry reads are unchanged;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 7: the whole-app trash loop keeps every forward row (keptLive = append(keptLive, rt), +whole:Route x3) ahead of DeleteIfUnchanged, so a trashed fleet app's forward row is retired by the forward phase alone. Deletes less, never more.;rev3=census-ruling-staticcheck-sa4006;basis=SA4006 dead store: the canary loop no longer keeps the app from appKeyOwner, which canaryPointer (itself built on appKeyOwner for the same key) overwrote straight away; acctOfKey and ok are unchanged. No read added, read sites unchanged (95). registry:Account@5579,registry:Account@5775,registry:App@10407,registry:App@11741,registry:App@13980,registry:App@5380,registry:App@5528,registry:App@7482,registry:App@7539,registry:App@7740,registry:App@7953,registry:App@8191,registry:App@8381,registry:Canary@10351,registry:Canary@13027,registry:Canary@13871,registry:Channel@11796,registry:Channel@13004,registry:Channel@13902,registry:Channel@13989,registry:Channel@14292,registry:Host@10314,registry:Host@10993,registry:Host@14027,registry:Host@14112,registry:Host@14283,registry:Host@5650,registry:Host@5736,registry:Host@7589,registry:Host@7731,registry:Host@7944,registry:Host@8182,registry:Host@8372,registry:Kind@12670,registry:Platform@10335,registry:Platform@13856,whole:Route@10296,whole:Route@10402,whole:Route@10463,whole:Route@10669,whole:Route@10685,whole:Route@10811,whole:Route@10839,whole:Route@11005,whole:Route@11021,whole:Route@11029,whole:Route@11726,whole:Route@11779,whole:Route@11936,whole:Route@11952,whole:Route@12997,whole:Route@13067,whole:Route@13236,whole:Route@13252,whole:Route@13260,whole:Route@13811,whole:Route@13842,whole:Route@13975,whole:Route@14130,whole:Route@14144,whole:Route@14150,whole:Route@14322,whole:Route@14336,whole:Route@14342,whole:Route@14350,whole:Route@14359,whole:Route@5366,whole:Route@5380,whole:Route@5510,whole:Route@5528,whole:Route@5579,whole:Route@5650,whole:Route@5736,whole:Route@5775,whole:Route@7144,whole:Route@7176,whole:Route@7426,whole:Route@7444,whole:Route@7454,whole:Route@7534,whole:Route@7760,whole:Route@7778,whole:Route@7788,whole:Route@7854,whole:Route@7971,whole:Route@7989,whole:Route@7999,whole:Route@8204,whole:Route@8222,whole:Route@8232,whole:Route@8410,whole:Route@8428,whole:Route@8438,whole:Route@8448,whole:Route@8457 14c44db6e1531c93a565f38f0f8a3d1ff3e1ab0f0d8164283aceb46c148f6d7d
+@legacy 2776cf119e9348e87f14f5afa149e174dacd3282eccf539c5c7f6fdb1342b263 internal/host/replicaplacement.go replicaPlacementWorker.run legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-2;basis=Final fix I3: retain completed lifetime/revision observations and skip their work; only confirmed current binding publication after coordinator acquisition, or existing successful/fenced retirement ACK, completes work. Existing local registry read, authority and retirement checks, and 30-second request deadline remain. No new reads or polling.;rev3=census-ruling-staticcheck-sa4006;basis=SA4006 dead store: publishCurrent's error is discarded explicitly (done, _ =) with a comment; it was assigned to err and never read, and publishCurrent returns false with every error, so done and the retry backoff are exactly as before. No read added, read sites unchanged (6). registry:ReplicaIncarnation@1246,registry:ReplicaRevision@1278,whole:Route@1011,whole:Route@1233,whole:Route@1741,whole:Route@859 08cf1cf77c344739d1e5ac72f4d96b76ab2c5ae51be51b25e35accc9c14ad24d
+@legacy 9b803de4eb1f2d3f7476e28198fee9688929c69e7f738ac140a52ff90488e003 staticcheck.conf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-audit-gate-vet-staticcheck;basis=new: staticcheck configuration at the module root (which SA checks run). Read only by the staticcheck tool in CI and make staticcheck; nothing in the root binary reads it. No read added.;rev3=census-ruling-staticcheck-sa4006;basis=Turns SA4006 on (drops -SA4006 from checks) and rewrites its comment. Read only by staticcheck; nothing in the root binary reads it. No read added. file:external@0 cfabaf82e72edcbe6b8c72e883cfd0eb306981726e9c7ecdc3bb66740006e327
+deploy.go runDeploy legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-edge-asset-cache-1;basis=takes --assets and --no-assets, refuses both together and bad folders before anything runs (deployAssets), reads the folders saved in .carlos/config for the session's console through configAssets (the config walk the CLI already makes), and saves a new list there as it saves the other deploy settings; read site unchanged (1), none added;rev3=census-ruling-gated-deploy-watch-164;basis=the static-deploy branch passes its watch targets through passGatedTargets (a console POST for a gate pass per gated host) and passes the gated-host set to watchDeployed; no new local read, read site unchanged (1), none added;rev3=census-ruling-region-labels;basis=builds a host-to-label map (hostPlaces) from the instance list it already read and passes it to the static watch targets and watchDeployed, so the watch lines say where; no read added;rev3=census-ruling-first-deploy-493;basis=Sequences existing console APIs for confirmed-missing app and first instance creation, with repeatable environment values; local artifact preflight before these new writes. Existing config artifact stat read retained.;rev3=census-ruling-account-subdomains;basis=builds its watch targets with watchTargetsFor (host, watchOrigin(host), the instance list's public_host as Display, place, probe) from the instance list it already read, and passes them to watchDeployed; deployingLine prints the public host from that same list; the watch still dials and matches host; no read added, read site unchanged (1); fix round 1: a first static deploy keeps the create answer mintPlatformHost now returns (the whole record, not its host) and carries its public_host into the record it appends, for printing only; mintPlatformHost makes the same two console requests as before;rev3=census-ruling-mail-submission-followups;basis=takes --mail and refuses a value but submit before the console is asked anything (the git reads for the version and the dirty-tree check run earlier, as before) (validShipMail, joined with the existing --swap check), and sets the session's shipMail, which the existing ship request sends to the console and checks the echo of (checkMailEcho); its usage text moves to the deployUsage const; no read added, read site unchanged (1);rev3=census-ruling-staticcheck-sa4006;basis=SA4006 dead store: the static-deploy re-list after attaching --host discards the instance total (third result), which nothing after it read; recs, truncated and err are kept and checked as before. No read added, read site unchanged (1). file:Stat@8743 2754d6758a1af4a072e51e4544a2f05e3419d905bf97dd10d30f4da5f6162b92
+internal/domains/reconcile.go Reconcile legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos), from its domains loop: the seeded-instances body (a trashed app's route kept while an import on its host is journaled, deleted only if the row is still the one listed); self-serve moves 1 Task 4 removes the claims-off 1d auto-purge, so a claims-off box destroys no app objects and a host-claim box only requests the claim's purge as before; the registry reads are unchanged;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 7: the whole-app trash loop keeps every forward row (keptLive = append(keptLive, rt), +whole:Route x3) ahead of DeleteIfUnchanged, so a trashed fleet app's forward row is retired by the forward phase alone. Deletes less, never more.;rev3=census-ruling-staticcheck-sa4006;basis=SA4006 dead store: the canary loop no longer keeps the app from appKeyOwner, which canaryPointer (itself built on appKeyOwner for the same key) overwrote straight away; acctOfKey and ok are unchanged. No read added, read sites unchanged (95). registry:Account@5579,registry:Account@5775,registry:App@10407,registry:App@11741,registry:App@13980,registry:App@5380,registry:App@5528,registry:App@7482,registry:App@7539,registry:App@7740,registry:App@7953,registry:App@8191,registry:App@8381,registry:Canary@10351,registry:Canary@13027,registry:Canary@13871,registry:Channel@11796,registry:Channel@13004,registry:Channel@13902,registry:Channel@13989,registry:Channel@14292,registry:Host@10314,registry:Host@10993,registry:Host@14027,registry:Host@14112,registry:Host@14283,registry:Host@5650,registry:Host@5736,registry:Host@7589,registry:Host@7731,registry:Host@7944,registry:Host@8182,registry:Host@8372,registry:Kind@12670,registry:Platform@10335,registry:Platform@13856,whole:Route@10296,whole:Route@10402,whole:Route@10463,whole:Route@10669,whole:Route@10685,whole:Route@10811,whole:Route@10839,whole:Route@11005,whole:Route@11021,whole:Route@11029,whole:Route@11726,whole:Route@11779,whole:Route@11936,whole:Route@11952,whole:Route@12997,whole:Route@13067,whole:Route@13236,whole:Route@13252,whole:Route@13260,whole:Route@13811,whole:Route@13842,whole:Route@13975,whole:Route@14130,whole:Route@14144,whole:Route@14150,whole:Route@14322,whole:Route@14336,whole:Route@14342,whole:Route@14350,whole:Route@14359,whole:Route@5366,whole:Route@5380,whole:Route@5510,whole:Route@5528,whole:Route@5579,whole:Route@5650,whole:Route@5736,whole:Route@5775,whole:Route@7144,whole:Route@7176,whole:Route@7426,whole:Route@7444,whole:Route@7454,whole:Route@7534,whole:Route@7760,whole:Route@7778,whole:Route@7788,whole:Route@7854,whole:Route@7971,whole:Route@7989,whole:Route@7999,whole:Route@8204,whole:Route@8222,whole:Route@8232,whole:Route@8410,whole:Route@8428,whole:Route@8438,whole:Route@8448,whole:Route@8457 14c44db6e1531c93a565f38f0f8a3d1ff3e1ab0f0d8164283aceb46c148f6d7d
+internal/host/replicaplacement.go replicaPlacementWorker.run legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-2;basis=Final fix I3: retain completed lifetime/revision observations and skip their work; only confirmed current binding publication after coordinator acquisition, or existing successful/fenced retirement ACK, completes work. Existing local registry read, authority and retirement checks, and 30-second request deadline remain. No new reads or polling.;rev3=census-ruling-staticcheck-sa4006;basis=SA4006 dead store: publishCurrent's error is discarded explicitly (done, _ =) with a comment; it was assigned to err and never read, and publishCurrent returns false with every error, so done and the retry backoff are exactly as before. No read added, read sites unchanged (6). registry:ReplicaIncarnation@1246,registry:ReplicaRevision@1278,whole:Route@1011,whole:Route@1233,whole:Route@1741,whole:Route@859 08cf1cf77c344739d1e5ac72f4d96b76ab2c5ae51be51b25e35accc9c14ad24d
+internal/hostrelocate/participant.go Participant.Step authority C,D Participant re-reads claim and installation identity around effects; root stop receipts and fresh participation bound probes, with generic orchestration retained.;rev3=census-ruling-staticcheck-sa4006;basis=SA4006 dead store: after counting the probe attempt only obs is updated (obs = counted); c (counted.Claim) was assigned and never read again in that case. The probe still runs on the counted observation. No read added, read sites unchanged (4). file:Exec@1181,file:Read@1612,file:Read@247,file:Read@6513 7dc910bc4ad42cb86d53a4cee8c9549ba02b1ceb645e108705044074a2843c32
+staticcheck.conf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-audit-gate-vet-staticcheck;basis=new: staticcheck configuration at the module root (which SA checks run). Read only by the staticcheck tool in CI and make staticcheck; nothing in the root binary reads it. No read added.;rev3=census-ruling-staticcheck-sa4006;basis=Turns SA4006 on (drops -SA4006 from checks) and rewrites its comment. Read only by staticcheck; nothing in the root binary reads it. No read added. file:external@0 cfabaf82e72edcbe6b8c72e883cfd0eb306981726e9c7ecdc3bb66740006e327
+@coverage . f8fb04e67ad550ceeee3e3737a0d096626a339bb57d6042ef02f757e12dc18f6
+@coverage internal/activator 9892fca3feaf4d382d209033f6e2347a7403911f00a606c79f33be7cc2f62aeb
+@coverage internal/domains 466cdafa49404a745afca6536fcbe807b8810fa8b1922b439d72cececcc6b43a
+@coverage internal/host 9ec4216e2570923187c1525238ad4db55e2c9471364d7eee42bcc76b65e22091
+@coverage internal/hostops 578802e0476ee3fc1fcb72a41d87efcc44047e5ba8070b3d34a1c56fbaf84729
+@coverage internal/hostrelocate 99527352a6d4adf92d4c6f2da860c88892b0e1a5695bdcc056c35abd7dd94060
+@coverage internal/instancectl dc00b58e1c3a57b4d0aeee207647148978f3857024fbb2afeee754a3767c3536
diff --git a/internal/registry/ha_duties_test.go b/internal/registry/ha_duties_test.go
index 654fc541b..9bfddb863 100644
--- a/internal/registry/ha_duties_test.go
+++ b/internal/registry/ha_duties_test.go
@@ -259,8 +259,8 @@ func TestHAAdoptDutyPersistence(t *testing.T) {
ctx := context.Background()
s := adoptState(t, r)
ok, err := r.CompareDuty(ctx, "shop.example.com", "life", s.Revision, DutyState{Basis: "adopted"})
- if ok {
- t.Fatal("minted adoption without receipt")
+ if ok || err != nil {
+ t.Fatalf("adoption without a receipt = %v %v, want a refusal that is not an error", ok, err)
}
ok, err = r.CompareDuty(ctx, "shop.example.com", "life", s.Revision, DutyState{Basis: "local-release", HolderRef: "peer", HolderIID: "i-peer"})
if err != nil || !ok {
diff --git a/internal/registry/links_writers_test.go b/internal/registry/links_writers_test.go
index 5a347510b..dc1b6b03c 100644
--- a/internal/registry/links_writers_test.go
+++ b/internal/registry/links_writers_test.go
@@ -147,7 +147,7 @@ func TestPutLinkChannelPrunesOnlyItsLink(t *testing.T) {
// L1 moves to acct2: its acct1 rows go; L2's acct1 row, L3's acct2 row,
// the acct1 fleet row and both ordinary rows stay.
putLink(t, reg, activeLink(testLinkA, "acct2", 3))
- snap = assertOnlyChanged(t, "account change", snap, reg, hostL1Shop, hostL1Blog)
+ assertOnlyChanged(t, "account change", snap, reg, hostL1Shop, hostL1Blog)
assertGone(t, reg, hostL1Shop, hostL1Blog)
// An acct2 row on L1, then a write that revokes L1: only that row goes.
diff --git a/internal/relay/record_test.go b/internal/relay/record_test.go
index de6345014..1e8704707 100644
--- a/internal/relay/record_test.go
+++ b/internal/relay/record_test.go
@@ -29,8 +29,8 @@ func TestRecordRoundTrip(t *testing.T) {
if _, err := PutRecord(ctx, s, "abc", "meet", &Record{}, "stale-etag"); !errors.Is(err, release.ErrCASConflict) {
t.Fatalf("stale put = %v, want CAS conflict", err)
}
- r, _, _ = GetRecord(ctx, s, "abc", "meet")
- if !r.Enabled || r.Op != 1 {
- t.Fatalf("record = %+v", r)
+ r, got, err := GetRecord(ctx, s, "abc", "meet")
+ if err != nil || !r.Enabled || r.Op != 1 || got != etag {
+ t.Fatalf("record = %+v etag %q %v, want the put's etag %q", r, got, err, etag)
}
}
diff --git a/staticcheck.conf b/staticcheck.conf
index a66272fd2..f21e89621 100644
--- a/staticcheck.conf
+++ b/staticcheck.conf
@@ -7,7 +7,7 @@
# them: ST1005 118, U1000 68, ST1013 35, S1038 26. Turning one on is its
# own branch, with the tree cleaned first, so the gate stays green.
#
-# Three SA checks are off too, each a family too large to fix safely in
+# Two SA checks are off too, each a family too large to fix safely in
# the branch that added this file. Counts are from that branch's run on
# 15b1ee6b, with -tags rootrunner,carlos_cutover_witness. A follow-up owns each one:
# fix the sites, then delete the line here.
@@ -21,12 +21,14 @@
# (moved into net/http), then go/parser.ParseDir,
# httputil.ReverseProxy's Director and ecdsa's raw key
# coordinates. Each needs a real migration, not a rename.
-# SA4006 70 sites (10 outside tests): a value assigned and never
-# read. Most are test leftovers, but some outside tests hide a
-# real error that is never looked at, so each wants reading,
-# not deleting.
+#
+# SA4006 (a value assigned and never read) was off here too, with 70
+# sites. Branch staticcheck-sa4006 read every one, removed the dead
+# stores, restored seven test checks that had lost their assertion, and
+# turned it on; it found no production bug this time (#1141 was the one
+# it had found before).
#
# Deliberate cases of an enabled check carry a `//lint:ignore <check>
# <reason>` on the line above them (the empty critical sections that are
# barriers, for instance). staticcheck ignores `//nolint` comments.
-checks = ["SA*", "-SA1012", "-SA1019", "-SA4006"]
+checks = ["SA*", "-SA1012", "-SA1019"]