carlos / platform Public

copy: Luna round 2 wording for the stdin cap (#1056)

The 64 KiB cap counts the trailing newline, so the refusal and the docs
say input, not value. Census re-frozen; Astra R2 READY.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 20470abe62a4cb468067775831fb0cfa1b961473 parent f1f8334
6 files changed, +29 −7
  • appconfig_cli.go +1 −1
  • docs/site/cli.md +1 −1
  • docs/superpowers/notes/census-proposal-services-secret-scripts-1056.md +1 −1
  • docs/superpowers/reviews/CODEX-FINDINGS-SERVICES-SECRET-SCRIPTS-1056-R2.md +22 −0
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-services-secret-scripts-1056.tsv +3 −3

Intent

Human

<task-notification> <task-id>bf35dspyn</task-id> <tool-use-id>toolu_018MUtCFwKkPRQymRRefrgew</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/96a09f74-e398-48ed-a97f-140bd1f7e255/tasks/bf35dspyn.output</output-file> <status>completed</status> <summary>Background command "Run Astra round 2 and Luna on new strings" completed (exit code 0)</summary> </task-notification>

diff --git a/appconfig_cli.go b/appconfig_cli.go
index 83aaa4a06..3719241ad 100644
--- a/appconfig_cli.go
+++ b/appconfig_cli.go
@@ -536,7 +536,7 @@ const (
secretsCopyNamedValue = "%s: the value starts with %s=, so it includes the variable name: nothing stored. Give the value on its own, or add --literal if it really starts that way."
secretsCopyStdinTerminal = "%s: stdin is a terminal, so there is no value to read. Pipe the value in: ... | carlos secrets set --app <app> %s -"
secretsCopyStdinTwice = "%s and %s both read stdin: only one key can take its value from stdin."
- secretsCopyStdinTooLarge = "%s: the value on stdin is larger than 64 KiB: nothing stored."
+ secretsCopyStdinTooLarge = "%s: the input on stdin is larger than 64 KiB: nothing stored."
)
func runEnvSet(args []string) {
diff --git a/docs/site/cli.md b/docs/site/cli.md
index 2e0f14158..2b0ffbfaa 100644
--- a/docs/site/cli.md
+++ b/docs/site/cli.md
@@ -1068,7 +1068,7 @@ carlos secrets set --app hello STRIPE_KEY=sk_live_example
A lone `-` after a key reads that key’s value from stdin, so the value never
appears in the command line, where other people on the same machine can see it. One
trailing newline is dropped. Only one key per command can read stdin, and it
-must be a pipe or a file, not the terminal. The value can be up to 64 KiB.
+must be a pipe or a file, not the terminal. The input can be up to 64 KiB, including its trailing newline.
```sh
op read op://shop/stripe/key | carlos secrets set --app hello STRIPE_KEY -
diff --git a/docs/superpowers/notes/census-proposal-services-secret-scripts-1056.md b/docs/superpowers/notes/census-proposal-services-secret-scripts-1056.md
index 40ac6d1ee..e8e30ea5f 100644
--- a/docs/superpowers/notes/census-proposal-services-secret-scripts-1056.md
+++ b/docs/superpowers/notes/census-proposal-services-secret-scripts-1056.md
@@ -10,6 +10,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- new `appconfig_cli.go:parseSecretsArgs`: reads +file:ReadAll; written legacy, accepted-legacy, frozen
-Seal: `5603979dfa1a34a1b30784d1f9252f20b0ed95c114bde54e8b173f9262fe8f46` → `cebe0a0ad2a3f5093936e6a113a700a31afe7c76fb371af79030583ff5b02280`.
+Seal: `5603979dfa1a34a1b30784d1f9252f20b0ed95c114bde54e8b173f9262fe8f46` → `183a9ccd8e8bd29ba677833142ec79bf4a9055b6a39e8da2bf4baa1616793da2`.
Overlay: `internal/provision/testdata/plan14-root-reads-services-secret-scripts-1056.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/docs/superpowers/reviews/CODEX-FINDINGS-SERVICES-SECRET-SCRIPTS-1056-R2.md b/docs/superpowers/reviews/CODEX-FINDINGS-SERVICES-SECRET-SCRIPTS-1056-R2.md
new file mode 100644
index 000000000..deb5411d8
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-FINDINGS-SERVICES-SECRET-SCRIPTS-1056-R2.md
@@ -0,0 +1,22 @@
+1. **R1 P1 — Resolved:** JSON output isolation now starts before session and account resolution for both create and rotate.
+2. **R1 P2 — Resolved:** JSON write errors produce a nonzero exit and recovery instructions without the secret.
+3. **R1 P2 — Resolved:** Terminal detection includes both console and Cygwin/MSYS2 checks.
+4. **R1 P2 — Resolved:** Stdin reads at most 64 KiB plus one byte, refusing oversized input.
+5. **R1 P2 — Resolved:** `secrets set --literal` permits deliberate named values; `env set` remains unguarded, as directed.
+
+No new P1 or P2 findings.
+
+Census verdicts for `8479c42ce20b98efedcc022f40ad83d9f5aaaa7c`:
+
+| Unit or envelope | Verdict | Basis |
+|---|---|---|
+| `appconfig_cli.go:parseSecretsArgs` | **APPROVED** | [Lines 461–518](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/services-secret-scripts-1056/appconfig_cli.go:461): bounded reads from the invoking process’s stdin; no new pathname or privileged input. `legacy / accepted-legacy` remains appropriate. The body fingerprint, read offset and legacy fingerprint match the overlay. |
+| Root package envelope `.` | **APPROVED** | Reviewed parser integration, terminal detection, literal handling, and create/rotate JSON paths in [appconfig_cli.go](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/services-secret-scripts-1056/appconfig_cli.go:1114) and [services.go](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/services-secret-scripts-1056/services.go:171). Existing authorization, sealing and storage paths remain intact; no new root authority is granted. |
+
+Source inspection confirms literal `KEY=-`, mixed pairs, single-newline removal, empty-value refusal, existing value validation, and `--environment` propagation. JSON field types are stable, with empty arrays instead of null. The added regression tests exercise the round-one fixes. CLI documentation reflects the controller’s decisions.
+
+Targeted CLI and census tests **could not start** because the read-only sandbox refused Go’s temporary build directory; `GOCACHE` was unset. Runtime tests and cross-platform compilation remain unverified. Amadan networking was blocked, so census verdicts were not recorded on #280.
+
+HEAD differs from the requested commit only by the R2 brief. No files were changed. This review stops at round 2 under the no-P1 rule.
+
+**READY**
\ No newline at end of file
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 4d4f9aac3..32a02475e 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -217,4 +217,4 @@ plan14-root-reads-g6-pool.tsv 94ccbabaf19c3a449cec248a0c32fcc8593c82d3f7f433c6a4
plan14-root-reads-pdf-host-client-groups.tsv e8beda8fd31db92f742943be631e8d034bbb4880225e69a680d5a0be893807af
plan14-root-reads-log-retention-knobs.tsv e8beda8fd31db92f742943be631e8d034bbb4880225e69a680d5a0be893807af
plan14-root-reads-fleet-record-labels-m1.tsv 5603979dfa1a34a1b30784d1f9252f20b0ed95c114bde54e8b173f9262fe8f46
-plan14-root-reads-services-secret-scripts-1056.tsv cebe0a0ad2a3f5093936e6a113a700a31afe7c76fb371af79030583ff5b02280
+plan14-root-reads-services-secret-scripts-1056.tsv 183a9ccd8e8bd29ba677833142ec79bf4a9055b6a39e8da2bf4baa1616793da2
diff --git a/internal/provision/testdata/plan14-root-reads-services-secret-scripts-1056.tsv b/internal/provision/testdata/plan14-root-reads-services-secret-scripts-1056.tsv
index f1a6ddcf2..9746a3e72 100644
--- a/internal/provision/testdata/plan14-root-reads-services-secret-scripts-1056.tsv
+++ b/internal/provision/testdata/plan14-root-reads-services-secret-scripts-1056.tsv
@@ -1,6 +1,6 @@
# Census overlay services-secret-scripts-1056, written by census-propose (#369). census-ruling-services-secret-scripts-1056, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-services-secret-scripts-1056.md.
# 0 body, 0 sites, 1 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
# 1 new dispositions: 0 reads re-frozen at their disposition with the claim, 1 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other.
-@legacy b71953740514af0757c5513a8bbc79eecb41c005f2db9b48595f9c1ddaf2fb92 appconfig_cli.go parseSecretsArgs legacy accepted-legacy accepted-legacy;rev3=census-ruling-services-secret-scripts-1056;basis=body (#1056 review R1): stdin now read through io.LimitReader capped at secretsStdinMaxBytes+1 (64 KiB plaintext) and refused above the cap; the terminal check also asks isatty.IsCygwinTerminal; the variable-name refusal is now gated by a refuseNamed argument (on for secrets set unless --literal, off for env set via parseKV). Still reads only the CLI process's own stdin, no file and nothing root owns file:ReadAll@1107 354b5b69c709a629fa00d634f6ee26e8cd0f8091b9743509b7a49b27ca11a84e
-appconfig_cli.go parseSecretsArgs legacy accepted-legacy accepted-legacy;rev3=census-ruling-services-secret-scripts-1056;basis=body (#1056 review R1): stdin now read through io.LimitReader capped at secretsStdinMaxBytes+1 (64 KiB plaintext) and refused above the cap; the terminal check also asks isatty.IsCygwinTerminal; the variable-name refusal is now gated by a refuseNamed argument (on for secrets set unless --literal, off for env set via parseKV). Still reads only the CLI process's own stdin, no file and nothing root owns file:ReadAll@1107 354b5b69c709a629fa00d634f6ee26e8cd0f8091b9743509b7a49b27ca11a84e
-@coverage . 914809d98cc5d78f13bb10374cf3ef5878d747df68e45ee63ed7bcc3e5ca8dc8
+@legacy af56c9adddf41e5bf0cf273ca37f29035454da9fa5039f9945736aefca4f088a appconfig_cli.go parseSecretsArgs legacy accepted-legacy accepted-legacy;rev3=census-ruling-services-secret-scripts-1056;basis=Reads the value for KEY - from the invoking process stdin, at most 64 KiB plus one byte, after refusing a terminal (isatty or Cygwin pty); refuses a secrets value that starts with its own key and = unless --literal. No pathname, no privileged input, no new root authority. file:ReadAll@1107 354b5b69c709a629fa00d634f6ee26e8cd0f8091b9743509b7a49b27ca11a84e
+appconfig_cli.go parseSecretsArgs legacy accepted-legacy accepted-legacy;rev3=census-ruling-services-secret-scripts-1056;basis=Reads the value for KEY - from the invoking process stdin, at most 64 KiB plus one byte, after refusing a terminal (isatty or Cygwin pty); refuses a secrets value that starts with its own key and = unless --literal. No pathname, no privileged input, no new root authority. file:ReadAll@1107 354b5b69c709a629fa00d634f6ee26e8cd0f8091b9743509b7a49b27ca11a84e
+@coverage . 15193ec7a88a3e0b05949291d9ae114aeff815eacc113b675caf8c13ceb73f19