carlos / platform Public

durability 3a: document escrow recovery and copier readiness

Apply the approved fleet-key refusal and instance escrow documentation.
Record spec rev 4.3 copier readiness and the controller's fail-closed
box-key-change ruling. Keep the accumulated census proposal current.

Copy DUR3A-C01..C02 approved by delegation (Luna)

Validation: console and docsite tests, targeted race checks, root-read
and record-write census checks, gofmt, and darwin/arm64, windows/amd64
and linux/arm64 cross-builds. The full console-package attempt reached
its default ten-minute timeout without an assertion failure; its complete
result is unproven and recorded in the Task 8 report.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 09858f4fe4dccca836cf043f87e3065282492187 parent 10ac50f
7 files changed, +98 −5
  • docs/site/cli.md +2 −0
  • docs/superpowers/notes/census-durability-3a-escrow-claims.md +2 −0
  • docs/superpowers/plans/2026-10-30-durability-step3-escrow-fence-restore.md +1 −1
  • docs/superpowers/plans/LUNA-COPY-BRIEF-DURABILITY-3A.md +75 −0
  • docs/superpowers/specs/2026-10-23-durability-design.md +16 −2
  • internal/console/fleetsecretskey.go +1 −1
  • internal/console/fleetsecretskey_test.go +1 −1

Intent

Human

<task-notification> <task-id>b93vd4ghf</task-id> <tool-use-id>toolu_013YpMsakcGE5TVXbSve3jQf</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/aab63774-dfe6-44a4-9cd9-230e6f4c3d13/tasks/b93vd4ghf.output</output-file> <status>completed</status> <summary>Background command "Run Task 6 round 2 and Task 7 fixes on Astra" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>a6f56f7e09b96dd84</task-id> <tool-use-id>toolu_01D5atmHpEgSfapaiXMZnbT2</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/aab63774-dfe6-44a4-9cd9-230e6f4c3d13/tasks/a6f56f7e09b96dd84.output</output-file> <status>completed</status> <summary>Agent "Re-review 3a Task 6 and 7 fixes" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>## Task 6 (fix rounds 1-2, 984fadb7..863c35a0) | Finding | Verdict | Evidence file:line | |---|---|---| | I1 trashed unpurged apps skip the gate | Fixed | `internal/console/store.go:1850` (`AppsIncludingTrashIn` reads by account only, with no `deleted_at` filter). `fleetsecretskey.go:190` and `:221` both call `fleetPlacedAppsIn(..., true)` (`:365`). `AppPlacement` (`store.go:1948`) ignores `deleted_at`, so a trashed app keeps its placement. The witness at `fleetsecretskey_test.go:521` uses the real `/delete`, key and `/restore` doors, for an instance and for sealed values. It checks the 409, an unchanged row, unchanged owner bytes, zero owner writes, and that key A still opens after restore. I ran it: ok. | | I2 (as re-ruled: the box fails closed) | Fixed | `internal/activator/escrow_test.go:1108`. `restartEscrow` → `backendLike` (`:84-108`) builds a new backend with no escrow or publisher memory. It reuses the same DataDir (so the ledger), files store and registry. The test sets `EscrowKey = keyB`, rewires the Service with a new activator, runs the production `EscrowSweep`, and wakes through `beginRequest`. All four cases check the exact error or ALERT and marker, zero PUTs, an identical bucket and ledger, no spawn, no minted env, and that A opens while B does not. No production code changed. I ran it once: 4/4 pass. | | M3 body GETs under the lock | Fixed | `fleetsecretskey.go:200-208` calls `ListPage(prefix, "", 1)` when the store has it, otherwise a key-only `List`. Any key gives 409; a list error gives 502. Witnesses: `fleetsecretskey_test.go:897` (limit 1, no continuation) and `:714` (no body GET on the fallback path). Every production store answers `ListPage`. | | M4 hostname-lock witness | Fixed | `lifetimes_create_test.go:734-758`: the second app is in account `cdef`, and the test waits on `hostLocks` for `ltOne`. | | M5 guard pins one level | Fixed | `recordcreators_guard_test.go:34-41` pins the chain up to `handleAPIInstanceCreate`, with method-value negative fixtures at `:79-81`. | The named risks check out: - **Account scoping and purge:** the new store read is scoped to the account. Purge deletes the row (`store.go:2009`), so "until purged" is true. `AppsIn` still means live apps only. - **Key-only list:** the only thing written under `instances/` is `RecordKey`, so "any key" means "any record". A stray non-record key would also refuse, which is conservative. A store without `PageLister` gets the same answer from a full key list, with no GETs. - **9B8 census layer:** the new entry is `key-site`, which is right for a list-only site. I ran the census test: ok. - **The fail-closed witness:** it does drive a fresh backend, the real sweep and the real wake. New issues: - Critical: none. - Important: none. - Minor: **the 409 advice cannot be followed for a trashed app.** The I1 fix makes both refusal messages reachable for an app in the trash, and both name it. But the instance delete door (`instanceGate`, `apiinstances.go:118`) and the config door (`apiAccountApp`, `apicli.go:47`) both 404 for a trashed app. The user has to restore the app first, or wait for the purge, and the text doesn't say so. It still fails closed, so this is copy work for Task 8. **Verdict: Approved.** ## Task 7 (fix round 1, 863c35a0..10ac50fe) | Finding | Verdict | Evidence file:line | |---|---|---| | I1 unmapped `Of(l,host,x)` then `Stage(x)` accepted | Fixed | `publication_guard_test.go:601`: the bare-identity acceptance is removed, so only the `host+"/"+x` form passes. clean.go's cases are rewritten. The new `unmapped.go` uses `x := "instance.key"` and expects two reports, one for `Publisher.Stage` and one for `Prepared.Stage`. | | I2 refusal root reassignable | Fixed | `publication_guard_test.go:648-652`: `refused` now uses `singleLocal`, and the position-only `unchanged` check is deleted. The loop, closure and pointer cases in `refusalwrites.go` are all reported. The production rebind is at `claimfilesseed_stage.go:140`. | | M1 loose fixture assertions | Fixed | `:927`: leftover diagnostics now fail. This surfaced two genuine diagnostics, now expected, and two syntax-only false positives, now excluded at `:833`. | | M2 embedded publisher not seen | Fixed | `:254-271` scans whole declarations, including signatures and local anonymous structs. Package hostfiles stays exempt (`:358`). `embedding.go` covers each form. Production has no embeddings. | The named risks check out: - **The rebind changes no production behaviour.** `dir := root` copies the pointer, so `Stat`, `RefuseSecretsAt` and `Seed` get the same `*os.File` as before. `defer root.Close()` and the `SameFile` check are untouched, so the descriptor's lifetime and its single close are unchanged. - **No new false negative from singleLocal.** Every root the new rule accepts, the old rule also accepted. The refusal is still tied to the same object and must still come first on every path (dominance). Parameters count as a single definition, so the clean refusal fixture still passes. - **The fixtures can now fail.** The clean fixture fails on any report, each expectation consumes exactly one diagnostic, leftovers fail, and the fixture count must match. The two new escape exclusions skip only declarations and struct-literal field keys, which are never uses. I ran the guard once: 12/12 fixtures pass. The report's evidence (the buildPrepared mutation failing as `host.buildPrepared`, the census output, and the 21 known host failures reproduced at the parent source) is shown. New issues: - Critical: none. - Important: none. - Minor: **embedding `hostfiles.Publisher` by value is not reported.** The check at `:264` only matches pointer embedding. Real misuse is unlikely, because `Publisher` holds a `sync.Mutex` (`publisher.go:30`) and filling such a field needs a copy that vet's copylocks check flags. One extra non-pointer check would close it. **Verdict: Approved.** ## Out-of-Scope Observations - **Two stale "reseal" references.** `internal/hostfiles/sealed_test.go:181` says "A box whose key changed reseals". That is true of the library function, but contradicts the ruling at the box level, so it should be reworded. The plan (`docs/superpowers/plans/2026-10-30-durability-step3-escrow-fence-restore.md:771`) still names the withdrawn reseal witness; Task 8 should fix it. - **The key-change alert says the wrong thing.** With instance.key/report.token present, a key change leaves a conflict marker, and the alert says local secrets differ from the escrow, when really the key changed. Putting key A back does not clear the marker. Removing the marker while still on key B just recreates it on the next sweep, which is safe. The Task 8 docs, and maybe the alert, should name this case. - **Still unverified from the first review:** whether deleting an instance or purging an app removes its `&lt;host&gt;/files/0/` escrow. If it doesn't, a later create on that hostname under the new key fails closed. This belongs to the branch review. - **Sandbox note for reviewers:** the `go/packages` guards and the `TMPDIR=/tmp/g` activator tests fail inside the agent sandbox, because the Go cache and `/tmp/g` are read-only there. I re-ran those two tests outside it. This is not a code fault. The review is saved at `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/durability-3a/.superpowers/sdd/2026-10-30-durability-step3-escrow-fence-restore/task-67-rereview-opus.md`.</result> <usage><subagent_tokens>190617</subagent_tokens><tool_uses>46</tool_uses><duration_ms>472224</duration_ms></usage> </task-notification>

diff --git a/docs/site/cli.md b/docs/site/cli.md
index 7554e1071..7cc9c6694 100644
--- a/docs/site/cli.md
+++ b/docs/site/cli.md
@@ -1087,6 +1087,8 @@ no bundle can override:
| `CARLOS_PURGE` | `header` when the edge honours a `Carlos-Purge` response header |
| `CARLOS_ADMIN_TOKEN` | a secret shared with this one instance: the platform presents it when it calls your app, and your app presents it on `CARLOS_CONTROL_SOCKET` |
+The box keeps a sealed copy of each instance's `<host>.env`. It also keeps sealed copies of the `instance.key` and `report.token` files an app keeps at the top of its own directory. These copies are stored in the region's data bucket. Each copy is sealed to the box's secrets key and bound to your app. Only a box that can already read your app's secrets can open it. When a box starts an instance whose `<host>.env` is missing, it puts the sealed copy back first. This keeps the instance's `CARLOS_ADMIN_TOKEN` and `CARLOS_INSTANCE_KEY` instead of giving it new ones. A file that is there is never replaced. You can edit other values in `<host>.env`. The box seals the new contents within a minute. `CARLOS_ADMIN_TOKEN`, `CARLOS_INSTANCE_KEY`, `instance.key` and `report.token` cannot change once sealed. If the box finds a different value, it refuses to start the instance and raises an alert. Deleting the file does not reset it. A box without the secrets key a copy was sealed to will not start that instance. This includes a box whose key was changed. Put the old key back.
+
A seed (the `--seed` command of `carlos instances enable`) runs with the same
environment, `CARLOS_HOST` included, and no control socket.
diff --git a/docs/superpowers/notes/census-durability-3a-escrow-claims.md b/docs/superpowers/notes/census-durability-3a-escrow-claims.md
index 27ad63656..6b16ca001 100644
--- a/docs/superpowers/notes/census-durability-3a-escrow-claims.md
+++ b/docs/superpowers/notes/census-durability-3a-escrow-claims.md
@@ -72,3 +72,5 @@ internal/host/movesfiles.go:claimEnvPresent Durability 3a Task 5: new: whether t
internal/host/movesfiles.go:buildPrepared Durability 3a Task 5 (parked path, CARLOS_MOVES_PHASE1 only): wantEnv refuses with pubclass.ErrSecretPath before anything is read or written; the env presence check for !wantEnv is os.Stat instead of os.ReadFile (the secret is no longer read into memory); hostfiles.RefuseSecretsAt over root.Open(".") (+file:Open, a descriptor of the os.Root it already opened, never a pathname) before NewPrepared; the walk checks pubclass.Of(...) == App before each Stage; the env file is never staged. Only refuses more, and reads less.
internal/host/relocationflush.go:ReleaseFlushFiles.Flush Durability 3a Task 5 (parked path, host claims only): the env file's presence is decided first with instancefs.OpenBeneathOrAbsent (the bytes are never read, replacing readInstanceFile of the env): present refuses with pubclass.ErrSecretPath before the manifest is read; hostfiles.RefuseSecretsAt over the root it opened, after the tenant seam and before hostfiles.Seed; absent still stages the env item's delete. Only refuses more, and reads less.
internal/host/claimfilesseed_stage.go:filesSeedOperation.stage Durability 3a Task 5 (parked path, host claims with origins only): hostfiles.RefuseSecretsAt over the root it opened, before hostfiles.Seed: any path the classifier does not call App refuses the seed before its first write, with pubclass.ErrSecretPath. No read added; the walk is the descriptor walk Seed itself makes. Task 7 fix round 1: bind the descriptor returned through work.With once as dir; stat, RefuseSecretsAt and Seed use that same descriptor. No path, read, authority, refusal or production behavior changes; the account/host identity and descriptor lifetime are unchanged.
+
+# Task 8: approved console copy and documentation only; no root-binary source unit changed, no root read added. Earlier Tasks 1-7 claims above remain the whole-branch proposal.
diff --git a/docs/superpowers/plans/2026-10-30-durability-step3-escrow-fence-restore.md b/docs/superpowers/plans/2026-10-30-durability-step3-escrow-fence-restore.md
index 7042aa05a..f25e17dd4 100644
--- a/docs/superpowers/plans/2026-10-30-durability-step3-escrow-fence-restore.md
+++ b/docs/superpowers/plans/2026-10-30-durability-step3-escrow-fence-restore.md
@@ -740,7 +740,7 @@ Per-task Opus review.
```
A non-empty answer refuses the replacement with 409 before any write. The text (user-facing, Task 8 copy list): `"%s already has a different secrets key, and these apps have instances on it: %s. their sealed copies open only with the current key, so it cannot be replaced while they exist. keep the current key, or delete those instances first"`. An error answers `notRecorded(http.StatusBadGateway)`. A first key (`row.SecretsKeyFP == ""`) is unaffected.
-**A box that changes key** (an owner who installs a new key on a box despite the console): an escrow sealed to the old key no longer opens. Restore and mint fail closed (Task 4); a box with the local files reseals them under the new key on its next sweep, because the keyed digest no longer matches.
+**A box that changes key** (an owner who installs a new key on a box despite the console): an escrow sealed to the old key no longer opens. Restore and mint fail closed (Task 4); even with the local files present, it never reseals them under the new key, and the operator must put the old key back and remove any trio conflict marker at `<data>/.escrow/<host>.conflict` (`TestABoxThatChangesKeyFailsClosed`; controller ruling, 2026-11-01).
- [ ] **Step 1: Write the failing tests**
diff --git a/docs/superpowers/plans/LUNA-COPY-BRIEF-DURABILITY-3A.md b/docs/superpowers/plans/LUNA-COPY-BRIEF-DURABILITY-3A.md
new file mode 100644
index 000000000..3145399a4
--- /dev/null
+++ b/docs/superpowers/plans/LUNA-COPY-BRIEF-DURABILITY-3A.md
@@ -0,0 +1,75 @@
+# Copy review brief: durability plan 3a (delegated by Paul, 2026-10-25 standing rule)
+
+Paul delegated copy review for plan copy to you. You are the copy editor, and
+your edits will be applied as approved copy. There are two rows.
+
+## What the change is
+
+Each instance (one running copy of an app, at its own hostname) has secrets on
+its box: a `<host>.env` file holding `CARLOS_ADMIN_TOKEN` and
+`CARLOS_INSTANCE_KEY`, and sometimes `instance.key` and `report.token` files
+that the app keeps at the top of its own directory. Until now, if the box
+lost those files, the instance got fresh secrets, which broke anything that
+held the old ones.
+
+This change makes the box keep an encrypted ("sealed") copy of those files in
+the region's storage bucket. It is sealed to the box's secrets key and bound
+to the app, so only a box that can already read the app's secrets can open
+it. When the env file is missing, the box puts the sealed copy back before
+starting the instance. Rules:
+
+- A file that is there is never replaced from the copy.
+- Ordinary values in `<host>.env` can be edited. The box seals the new
+ contents within a minute.
+- `CARLOS_ADMIN_TOKEN`, `CARLOS_INSTANCE_KEY`, `instance.key` and
+ `report.token` cannot be changed once sealed. If the box finds a different
+ value, it refuses to start the instance and raises an alert.
+- Deleting the file does not reset it: the sealed copy comes back.
+- A box without the secrets key the copy was sealed to will not start an
+ instance that has a sealed copy. That includes a box whose secrets key was
+ changed: the copy stays sealed to the old key, so the old key has to go
+ back.
+
+A fleet is a group of boxes an account runs, with its own secrets key. The
+console now refuses to replace a fleet's key while the fleet has instances,
+because their sealed copies open only with the current key.
+
+## House rules (Paul's, all binding)
+
+- No em dashes or en dashes, ever. Use a full stop and a new sentence.
+- Plain words, short sentences. Say what to do next.
+- Neutral names only (shop, example.com).
+- Keep every placeholder (`%s`, `<host>`, `<app>`), every backticked name and
+ every command exactly.
+- Do not change meaning or the facts a string states. If a fact looks wrong,
+ flag it.
+- DUR3A-C01 is an API error shown by the CLI after `error:`. Like its
+ neighbours it is lower case, with sentences joined by ". " and no full stop
+ at the end. Keep that form.
+
+## The rows
+
+DUR3A-C01, the console's refusal when an owner tries to replace a fleet's
+secrets key and apps on the fleet still have instances (including apps in the
+trash). First `%s` is the fleet's name, second is a comma-separated app list.
+Its neighbours, for tone:
+
+- `%s already has a different secrets key, and these apps hold sealed values: %s. replacing the key would leave them unreadable. unset each app's secrets with carlos secrets unset --app <app> <var>, then run this again`
+- `another fleet already uses this secrets key, and every fleet needs its own. mint a new pair with carlos secrets genkey and register its public half`
+
+Current: `%s already has a different secrets key, and these apps have instances on it: %s. their sealed copies open only with the current key, so it cannot be replaced while they exist. keep the current key, or delete those instances first`
+
+DUR3A-C02, a paragraph in `docs/site/cli.md`, right after the table of
+variables an instance is started with (that table lists `CARLOS_ADMIN_TOKEN`).
+Readers are developers running apps on the platform, and people running their
+own boxes.
+
+Current:
+
+> The box keeps a sealed copy of each instance's `<host>.env`, and of the `instance.key` and `report.token` an app keeps at the top of its own directory, in the region's data bucket. It is sealed to the box's secrets key and bound to your app, so only a box that can already read your app's secrets can open it. When a box starts an instance whose `<host>.env` is missing, it puts the sealed copy back first, so the instance keeps its `CARLOS_ADMIN_TOKEN` and `CARLOS_INSTANCE_KEY` instead of getting new ones. A file that is there is never replaced. You can edit other values in `<host>.env`, and the box seals the new contents within a minute. `CARLOS_ADMIN_TOKEN`, `CARLOS_INSTANCE_KEY`, `instance.key` and `report.token` cannot change once sealed: a box that finds a different value refuses to start the instance and raises an alert. Deleting the file does not reset it. A box without the secrets key a copy was sealed to will not start that instance, and that includes a box whose key was changed, so put the old key back.
+
+## Output
+
+Markdown:
+1. A table `ID | current | new | why` with both rows.
+2. A `Flags` list: any fact that looks wrong or unclear, or "none".
diff --git a/docs/superpowers/specs/2026-10-23-durability-design.md b/docs/superpowers/specs/2026-10-23-durability-design.md
index 71f878ff4..b39dfbea6 100644
--- a/docs/superpowers/specs/2026-10-23-durability-design.md
+++ b/docs/superpowers/specs/2026-10-23-durability-design.md
@@ -1,6 +1,6 @@
# Durability: every byte off the box, every box rebuildable
-Status: rev 4.2, 2026-10-30: rulings R1-R8 recorded; ready for plans.
+Status: rev 4.3, 2026-11-01: copier readiness and fail-closed box key changes recorded; ready for plans.
Astra round 1 was
NOT READY (6 P1, 7 P2, `CODEX-FINDINGS-durability-R1.md`), and round 2 was
NOT READY (P1-2, P1-6, P1-14; P2-9, P2-10, P2-15;
@@ -19,6 +19,18 @@ whose whole set verifies; the drill never claims "current"; and file
publication refuses every platform-named path by one classification. Round
3 is the last.
+**Rev 4.3 (2026-11-01).** Paul's 2026-10-31 ruling: the off-account
+copier refuses every object a files manifest version names through a raw
+secret item (`pubclass.IsRawSecretItem`), with its own test over the
+predicate's table; until the operator migration has run, every historical
+raw object is refused (§5.5; §6 step 7).
+
+Controller ruling, 2026-11-01: a box whose secrets key changes outside the
+console fails closed for escrows sealed to the old key and never reseals
+them under the new key. The operator puts the old key back and removes any
+trio conflict marker the box left at `<data>/.escrow/<host>.conflict`.
+`TestABoxThatChangesKeyFailsClosed` pins this behaviour.
+
**What rev 4 changes**
- A recovery create carries one durable hold, the seed state
`recovering`, honoured at the one gate every launch and mint passes: the
@@ -753,6 +765,8 @@ same server.
destination. **It never copies `lock.json`** (§3.1 item 4):
lease state belongs to the deployment that wrote it, and a restore
installs its own (§8).
+ It never copies an object a files manifest version names through a raw
+ secret item (`pubclass.IsRawSecretItem`; Paul, 2026-10-31).
- **Discovery is complete within the RPO.** A rotating full scan lists
every eligible bucket (one `ListBuckets` per scan finds new store
buckets) and every prefix, and completes every 45 minutes. Prefixes that
@@ -969,7 +983,7 @@ Each slice delivers usable behaviour with its prerequisites inside it.
| 4 | §5.1 replication set: inventories, multi-DB routes, whole-set restore, self-running generator, Litestream on every fixed box; then the IE cutover to 0.5.15 | platform | large | **Not started.** #284 slice A must merge first |
| 5 | §5.2 proof: drills reporting integrity, age and proved staleness, published verdicts, new alert rules, the archive check | platform | medium | **Partly done.** restore-verify armed by hand on IE and passing daily; nothing published, no new rules, lag rule still nil. Includes the embedded proof sync (R6) |
| 6 | §5.3 widened: app files, sibling trees, box-level sets, uncovered reports | platform | medium | **Not started** beyond born-HA hosts (P1a) |
-| 7 | §5.5 `carlos ops offsite`: development may start at any time; it is **ready** to replace the interim only after step 3 (sealed `.env`, so no plaintext secret reaches the copy) and step 4 (the `boxes/<ref>/` scheme and inventories it copies). The drill host comes with it, and so do the UK, US and AU destinations: the plan picks each provider and Paul approves it (R3) | platform | large | **Not started.** The interim covers eu-west-1 (step 2a) |
+| 7 | §5.5 `carlos ops offsite`: development may start at any time; it is **ready** to replace the interim only after step 3 (sealed `.env`, so no plaintext secret reaches the copy) and step 4 (the `boxes/<ref>/` scheme and inventories it copies). Readiness also requires refusing every object that a files manifest version names through an item for which `pubclass.IsRawSecretItem` holds, with the copier's own test over that predicate's table; until the operator migration has run, every historical raw object is refused (Paul, 2026-10-31). The drill host comes with it, and so do the UK, US and AU destinations: the plan picks each provider and Paul approves it (R3) | platform | large | **Not started.** The interim covers eu-west-1 (step 2a) |
| 8 | `restore-box` widened to the full order; the recovery hold and `recovery release` with their guard tests and simulation; the runbook; the region-loss rehearsal (§8) | platform + carloku | medium | **Not started.** README lists the hand-built state |
| 9 | §5.7 smaller fixes | both | small | **Partly done.** Data-bucket noncurrent lifecycle done 2026-10-25 |
diff --git a/internal/console/fleetsecretskey.go b/internal/console/fleetsecretskey.go
index 51d6d04f4..55b7dcb4a 100644
--- a/internal/console/fleetsecretskey.go
+++ b/internal/console/fleetsecretskey.go
@@ -144,7 +144,7 @@ func (s *Server) handleAPIFleetSecretsKey(w http.ResponseWriter, r *http.Request
return
}
if len(apps) > 0 {
- jsonError(w, http.StatusConflict, fmt.Sprintf("%s already has a different secrets key, and these apps have instances on it: %s. their sealed copies open only with the current key, so it cannot be replaced while they exist. keep the current key, or delete those instances first", row.Name, strings.Join(apps, ", ")))
+ jsonError(w, http.StatusConflict, fmt.Sprintf("%s already has a different secrets key, and these apps still have instances on it: %s. their sealed copies open only with the current key, so replacing it would make them unreadable. keep the current key, or delete those instances first. an app in the trash counts until it is purged", row.Name, strings.Join(apps, ", ")))
return
}
}
diff --git a/internal/console/fleetsecretskey_test.go b/internal/console/fleetsecretskey_test.go
index 87336926b..b54f121fe 100644
--- a/internal/console/fleetsecretskey_test.go
+++ b/internal/console/fleetsecretskey_test.go
@@ -439,7 +439,7 @@ func fskRegister(t *testing.T, fx *consoleFixture, token, pub string) {
}
func fskInstanceRefusal(apps string) string {
- return fmt.Sprintf("home already has a different secrets key, and these apps have instances on it: %s. their sealed copies open only with the current key, so it cannot be replaced while they exist. keep the current key, or delete those instances first", apps)
+ return fmt.Sprintf("home already has a different secrets key, and these apps still have instances on it: %s. their sealed copies open only with the current key, so replacing it would make them unreadable. keep the current key, or delete those instances first. an app in the trash counts until it is purged", apps)
}
func fskEscrow(t *testing.T, fx *consoleFixture, privateKey string) *hostfiles.ItemSealer {