carlos / platform Public

Direct secrets set: own copy rows for the two new refusals (branch review R1)

A terminal key that is not the deployment's published key now refuses with
FSK-C71, and a bucket with fleets but no published console record refuses
with FSK-C72, instead of reusing FSK-C49 and FSK-C50 whose text did not fit.
FSK-C50 stays for read and list errors. The deck gains the two approved rows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 349264196392d97c04e03e2b346f432c3ea29241 parent d87d201
4 files changed, +20 −11
  • appconfig_cli.go +6 −3
  • appconfig_cli_fleet_test.go +10 −7
  • approved_fleet_secrets_copy_test.go +2 −1
  • docs/superpowers/plans/2026-10-29-fleet-secrets-key-copy.md +2 −0

Intent

Human

<task-notification> <task-id>a7da7a2627be4c5f5</task-id> <tool-use-id>toolu_016LJY7iuZwaDRRfW6oBHrvh</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/2d812478-ae68-44f2-8075-b2330abd5939/tasks/a7da7a2627be4c5f5.output</output-file> <status>completed</status> <summary>Agent "Direct mode: prove deployment key" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>**Status:** done, with concerns. Direct-mode `secrets set` now seals only to a terminal key that matches the deployment key the console publishes. Nothing is pushed. **Commits:** `e53c854a` (the fix, tests and spec) and `d87d2011` (census). - **Publication changed:** `PublishMovesConsole` only ran with moves on, so I widened its gate. It now also runs at every start when the console has a secrets key. The record itself is unchanged, and a console with moves off and no key still publishes nothing. - **Direct mode:** it reads that record first. If the record names a key, the terminal key must match it. If there is no record, it refuses as soon as any fleet record exists, and a read error refuses. The two existing refusals stay as they were. - **Tests:** the 4 new direct-mode tests and 2 console tests failed first. Skipping the positive check makes the race and published-key tests seal; dropping the no-record refusal makes the no-record test seal. Two older tests needed the console record added under the new rule. Everything requested passes: the existing `TestDirectSecretsSet*` tests, `TestOnlySealKeyForBuildsSealers`, the console publication tests, the claim invariant, the provision census tests, the 4 cross-builds, vet and gofmt. - **Census:** `PublishMovesConsole` re-pinned in 9B8 (same class and kind). `census-propose` re-pinned the `.` and `internal/moves` envelopes; no unit claims changed. The census reviewer needs verdicts on these. - **Spec:** §5.3 has the two sentences. I also corrected §7's request list, which goes beyond the brief: direct mode now reads one more object. **Concerns:** - **Copy:** I added no new text. A wrong key gets FSK-C49, whose "is a fleet's key" may be untrue. Fleets without a console record get FSK-C50, whose "check your access" advice doesn't fit the cause. Two new copy rows may be needed. - **Rollout:** where fleets exist and the console runs with moves off, direct mode refuses until that console restarts on this build. - **Smaller gaps:** a console's very first start could still race in a bucket that has never had one. After a deployment key rotation, the old key stays in the record until the new start publishes. I did not check whether boxes can write `control/` in the bucket. Report: `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-fleet-secrets-key/.superpowers/sdd/2026-10-29-fleet-secrets-key/branch-r1-direct-fix-report.md`</result> <usage><subagent_tokens>146451</subagent_tokens><tool_uses>59</tool_uses><duration_ms>796663</duration_ms></usage> </task-notification>

diff --git a/appconfig_cli.go b/appconfig_cli.go
index cefa6a28e..e3985a8bd 100644
--- a/appconfig_cli.go
+++ b/appconfig_cli.go
@@ -1086,10 +1086,10 @@ func directSealRefusal(ctx context.Context, st release.Store, acct string, pub *
switch {
case deploymentFP != "":
if fp != deploymentFP {
- return errors.New(directRefuseFleetKey)
+ return errors.New(directRefuseNotDeploymentKey)
}
case len(records) > 0:
- return errors.New(directRefuseNoCheck)
+ return errors.New(directRefuseNoPublishedKey)
}
return nil
}
@@ -1113,11 +1113,14 @@ func directDeploymentFP(ctx context.Context, st release.Store) (string, error) {
return rec.SecretsKeyFP, nil
}
-// Fleet secrets key copy rows FSK-C48 to FSK-C50.
+// Fleet secrets key copy rows FSK-C48 to FSK-C50, FSK-C71 and FSK-C72.
const (
directRefuseOwnsFleet = "this account owns a fleet, and a direct write cannot tell which key <app> needs. unset CARLOS_DEPLOYMENT_BUCKET and CARLOS_DEPLOYMENT_DIR in your terminal and run carlos secrets set through a signed-in console"
directRefuseFleetKey = "the CARLOS_SECRETS_PUBKEY in your terminal is a fleet's key, and a direct write must not seal to one. set it to the deployment's public key and run the command again"
directRefuseNoCheck = "cannot check this bucket for fleet keys, so nothing was set. check your access to the bucket and run the command again"
+
+ directRefuseNotDeploymentKey = "the CARLOS_SECRETS_PUBKEY in your terminal is not this deployment's secrets key, so nothing was set. set it to the deployment's public key and run carlos secrets set again, or unset CARLOS_DEPLOYMENT_BUCKET and CARLOS_DEPLOYMENT_DIR and run carlos secrets set through a signed-in console"
+ directRefuseNoPublishedKey = "this deployment has fleets, but its console has not published its secrets key yet, so nothing was set. run systemctl restart console.service, then run carlos secrets set again, or unset CARLOS_DEPLOYMENT_BUCKET and CARLOS_DEPLOYMENT_DIR and run carlos secrets set through a signed-in console"
)
func runSecretsUnset(args []string) {
diff --git a/appconfig_cli_fleet_test.go b/appconfig_cli_fleet_test.go
index d55fcb0e8..180b399a4 100644
--- a/appconfig_cli_fleet_test.go
+++ b/appconfig_cli_fleet_test.go
@@ -17,12 +17,15 @@ import (
"github.com/carlosframework/platform/internal/release"
)
-// The approved rows FSK-C48 to FSK-C50, spelled out so a change to the
+// The approved rows FSK-C48 to FSK-C50, FSK-C71 and FSK-C72, spelled out so a change to the
// constants in appconfig_cli.go cannot pass unnoticed.
const (
wantDirectRefuseOwnsFleet = "this account owns a fleet, and a direct write cannot tell which key <app> needs. unset CARLOS_DEPLOYMENT_BUCKET and CARLOS_DEPLOYMENT_DIR in your terminal and run carlos secrets set through a signed-in console"
wantDirectRefuseFleetKey = "the CARLOS_SECRETS_PUBKEY in your terminal is a fleet's key, and a direct write must not seal to one. set it to the deployment's public key and run the command again"
wantDirectRefuseNoCheck = "cannot check this bucket for fleet keys, so nothing was set. check your access to the bucket and run the command again"
+
+ wantDirectRefuseNotDeploymentKey = "the CARLOS_SECRETS_PUBKEY in your terminal is not this deployment's secrets key, so nothing was set. set it to the deployment's public key and run carlos secrets set again, or unset CARLOS_DEPLOYMENT_BUCKET and CARLOS_DEPLOYMENT_DIR and run carlos secrets set through a signed-in console"
+ wantDirectRefuseNoPublishedKey = "this deployment has fleets, but its console has not published its secrets key yet, so nothing was set. run systemctl restart console.service, then run carlos secrets set again, or unset CARLOS_DEPLOYMENT_BUCKET and CARLOS_DEPLOYMENT_DIR and run carlos secrets set through a signed-in console"
)
// Direct-bucket mode has no console to say which key an app needs, so it
@@ -324,8 +327,8 @@ func TestDirectSecretsSetRequiresThePublishedDeploymentKey(t *testing.T) {
directConsoleRecord(t, release.NewDirStore(dir), deployFP)
otherB64, _ := directKey(t)
out := directSetInChild(t, "TestDirectSecretsSetRequiresThePublishedDeploymentKey", dir, otherB64)
- if !strings.Contains(out, wantDirectRefuseFleetKey) {
- t.Fatalf("output = %q, want %q", out, wantDirectRefuseFleetKey)
+ if !strings.Contains(out, wantDirectRefuseNotDeploymentKey) {
+ t.Fatalf("output = %q, want %q", out, wantDirectRefuseNotDeploymentKey)
}
}
@@ -380,8 +383,8 @@ func TestDirectSecretsSetRaceRegistrationAfterCheck(t *testing.T) {
if !strings.Contains(string(body), kFP) {
t.Fatalf("away's record does not list K after the registration: %s", body)
}
- if err == nil || err.Error() != wantDirectRefuseFleetKey {
- t.Fatalf("a key registered to a fleet after the check was not refused: err = %v, want %q", err, wantDirectRefuseFleetKey)
+ if err == nil || err.Error() != wantDirectRefuseNotDeploymentKey {
+ t.Fatalf("a key registered to a fleet after the check was not refused: err = %v, want %q", err, wantDirectRefuseNotDeploymentKey)
}
}
@@ -401,7 +404,7 @@ func TestDirectSecretsSetNoConsoleRecordButFleets(t *testing.T) {
directFleetRecord(t, release.NewDirStore(dir), "xyz", "away", otherFP)
b64, _ := directKey(t)
out := directSetInChild(t, "TestDirectSecretsSetNoConsoleRecordButFleets", dir, b64)
- if !strings.Contains(out, wantDirectRefuseNoCheck) {
- t.Fatalf("output = %q, want %q", out, wantDirectRefuseNoCheck)
+ if !strings.Contains(out, wantDirectRefuseNoPublishedKey) {
+ t.Fatalf("output = %q, want %q", out, wantDirectRefuseNoPublishedKey)
}
}
diff --git a/approved_fleet_secrets_copy_test.go b/approved_fleet_secrets_copy_test.go
index 313fe1708..2d4a9eb06 100644
--- a/approved_fleet_secrets_copy_test.go
+++ b/approved_fleet_secrets_copy_test.go
@@ -45,7 +45,7 @@ var fleetSecretsCopyIDs = []string{
"FSK-C57", "FSK-C58", "FSK-C59", "FSK-C60",
"FSK-C61", "FSK-C62", "FSK-C63", "FSK-C64",
"FSK-C65", "FSK-C66", "FSK-C67", "FSK-C68",
- "FSK-C69", "FSK-C70",
+ "FSK-C69", "FSK-C70", "FSK-C71", "FSK-C72",
}
// fleetSecretsCopyStatuses are the statuses the deck may carry: the rootfs
@@ -74,6 +74,7 @@ var fleetSecretsCopyBuilt = []string{
"FSK-C56", "FSK-C57", "FSK-C58", "FSK-C59", "FSK-C60",
"FSK-C61", "FSK-C62", "FSK-C63", "FSK-C64", "FSK-C65",
"FSK-C66", "FSK-C67", "FSK-C68", "FSK-C69", "FSK-C70",
+ "FSK-C71", "FSK-C72",
}
func mustParseFleetSecretsRecord(t *testing.T) []copyRow {
diff --git a/docs/superpowers/plans/2026-10-29-fleet-secrets-key-copy.md b/docs/superpowers/plans/2026-10-29-fleet-secrets-key-copy.md
index 35b023b3b..543faa151 100644
--- a/docs/superpowers/plans/2026-10-29-fleet-secrets-key-copy.md
+++ b/docs/superpowers/plans/2026-10-29-fleet-secrets-key-copy.md
@@ -126,6 +126,8 @@ console-minted names on their own line.
| FSK-C48 | appconfig_cli.go (Task 8) | this account owns a fleet, and a direct write cannot tell which key <app> needs. unset CARLOS_DEPLOYMENT_BUCKET and CARLOS_DEPLOYMENT_DIR in your terminal and run carlos secrets set through a signed-in console | approved |
| FSK-C49 | appconfig_cli.go (Task 8) | the CARLOS_SECRETS_PUBKEY in your terminal is a fleet's key, and a direct write must not seal to one. set it to the deployment's public key and run the command again | approved |
| FSK-C50 | appconfig_cli.go (Task 8) | cannot check this bucket for fleet keys, so nothing was set. check your access to the bucket and run the command again | approved |
+| FSK-C71 | appconfig_cli.go (branch review R1, direct mode) | the CARLOS_SECRETS_PUBKEY in your terminal is not this deployment's secrets key, so nothing was set. set it to the deployment's public key and run carlos secrets set again, or unset CARLOS_DEPLOYMENT_BUCKET and CARLOS_DEPLOYMENT_DIR and run carlos secrets set through a signed-in console | approved |
+| FSK-C72 | appconfig_cli.go (branch review R1, direct mode) | this deployment has fleets, but its console has not published its secrets key yet, so nothing was set. run systemctl restart console.service, then run carlos secrets set again, or unset CARLOS_DEPLOYMENT_BUCKET and CARLOS_DEPLOYMENT_DIR and run carlos secrets set through a signed-in console | approved |
## Task 9: refusals on instances list