carlos / platform Public

review: config receipts plan 1 branch R2 findings + Luna 1b

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 33397adf3ad3db5f6dfc680b0d65d23b46ffddbb parent 13b3a18
2 files changed, +72 −0
  • docs/superpowers/reviews/CODEX-FINDINGS-config-receipts-branch-2.md +50 −0
  • docs/superpowers/reviews/LUNA-COPY-RESULT-config-receipts-1b.md +22 −0

Intent

Human

<task-notification> <task-id>biaex3iot</task-id> <tool-use-id>toolu_01CEc5WUzaTdCww7iiCdN5oS</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/4c585ebb-d953-40f5-8f58-fbd337832024/tasks/biaex3iot.output</output-file> <status>completed</status> <summary>Background command "Wait for Astra round 2 and Luna's small pass" completed (exit code 0)</summary> </task-notification>

Attributed to this commit: 20.1 g CO₂e (2,536,263 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on config-receipts-1, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.

diff --git a/docs/superpowers/reviews/CODEX-FINDINGS-config-receipts-branch-2.md b/docs/superpowers/reviews/CODEX-FINDINGS-config-receipts-branch-2.md
new file mode 100644
index 000000000..faf7d1be7
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-FINDINGS-config-receipts-branch-2.md
@@ -0,0 +1,50 @@
+Reviewed `13b3a187e83d10fd1ab085f3972b336566fc4f2f`, branch review round 2.
+
+| Round-one item | Disposition |
+|---|---|
+| P1-1: supplied precondition disappears | **Partly resolved.** Empty strings and headers are refused; JSON `null` still becomes an unconditional write. |
+| P1-2: team GET ownership race | **Resolved.** Ownership is checked on the response snapshot at `apiconfig.go:221`; release and transfer witnesses are present. |
+| P2-3: intermediate receipt version | **Resolved under the fixed rulings.** Combined writes and team creation reread the completed request’s version; failed or unauthorized rereads omit the receipt. |
+| P2-4: failed default observations disappear | **Resolved.** `others.default.unavailable` preserves successful observations, and the CLI prints a warning. |
+| P2-5: retry combines different snapshots | **Resolved.** `env list --json` includes both kinds from one bundle read; retries retain the original baseline digests. |
+| P2-6: documentation overclaims | **Partly resolved.** Typed JSON and receipt exceptions are documented, but the no-intervening-writer guarantee remains. |
+| P2-7: missing negative coverage | **Resolved by inspection.** All five requested door witnesses are present in `apiconfig_witness_test.go`. |
+| P2 triage: wildcard/weak `If-Match` | **Resolved.** Unsupported forms return 400 before applying changes. |
+
+1. **P1 — JSON `null` still removes a supplied precondition.**
+
+ **Evidence:** [apiconfig.go:391](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/config-receipts-1/internal/console/apiconfig.go:391) decodes `if_version` into `*string`. Go decodes JSON `null` as a nil pointer. [configIfVersion:1032](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/config-receipts-1/internal/console/apiconfig.go:1032) treats that pointer as absence and returns `""`; the handler skips its conditional checks and passes an unconditional version to `ApplyIf`.
+
+ **Failure scenario:** `{"if_version":null,"set":{"A":{"kind":"env","value":"old"}}}` can overwrite another writer’s value instead of refusing the unusable precondition. The pointer change also introduces a regression for duplicate members: `"if_version":"cv1:stale","if_version":null` now clears the supplied stale version. Previously, decoding null into the string left that stale version intact.
+
+ **Fix:** distinguish field presence from its value and reject present null or otherwise unusable preconditions. Add door witnesses asserting 400, unchanged bytes, and no generation bump for null and a version followed by null.
+
+ **Fault family:** a supplied precondition must never disappear during parsing; recurrence of R1 P1-1.
+
+2. **P2 — The conditional-write documentation still promises no intervening writer.**
+
+ **Evidence:** [cli.md:1064](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/config-receipts-1/docs/site/cli.md:1064) still says callers can “be sure nobody wrote in between.” The added explanation at line 1000 correctly states the opposite.
+
+ **Failure scenario:** another writer changes A → B → A. The original version matches and the conditional write succeeds, despite intervening writes.
+
+ **Fix:** describe equality with the observed stored bytes, without promising that no writer intervened.
+
+ **Fault family:** documented guarantees must match observable behavior; recurrence of R1 P2-6.
+
+No new P3 findings. Previously deferred P3 items remain deferred.
+
+The precondition fault has now appeared in two consecutive rounds. Stopping rule 2 applies before another fix: choose upfront refusal of the unsupported cases, remove conditional writes, or enforce the presence invariant in one place with a guard test. I recommend the third option.
+
+Census decisions below apply to this tip, against the amadan merge base `5394c7f958e4c10f93c94f923211c0814680ff4d`.
+
+| Unit or envelope | Verdict and evidence |
+|---|---|
+| `appconfig_cli.go:const envUsage` | **APPROVE.** [Line 176](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/config-receipts-1/appconfig_cli.go:176): printed help only; no added read or authority. Existing `legacy / accepted-legacy` remains appropriate. |
+| `appconfig_cli.go:envDigest` | **APPROVE.** [Line 1745](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/config-receipts-1/appconfig_cli.go:1745): reads the explicitly supplied envelope file through the local CLI command. No new tenant-selected automated root read. The proposed `legacy / accepted-legacy` disposition is appropriate. |
+| Envelope `.` | **APPROVE.** Reviewed CLI dispatch, listing, precondition handling, receipt printing, effective view, and digest command (`appconfig_cli.go:264,329,381,517,648,1174,1381,1644,1745`), plus API handling (`apimode.go:2915,3008,3173`). Existing path validation and explicit operator invocation remain intact. |
+| Envelope `internal/appconfig` | **APPROVE.** Reviewed versioned reads and writes (`store.go:106,183,242`), owned writes (`owned.go:120`), mutation wrappers (`generation.go:142`; `instances.go:135`), and shared merge/observation (`environments.go:240`; `observe.go:91,166,236`). Ownership, schema refusal, key validation, CAS protection, and owned-environment isolation remain intact. |
+| Envelope `internal/release` | **APPROVE.** [Line 133](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/config-receipts-1/internal/release/store.go:133) forwards capability discovery through prefix stores; line 1002 marks S3. Conditional headers remain enforced at lines 1019–1023. No expanded root authority or weakened storage check. |
+
+Changed Go files pass `gofmt`. Focused tests could not start because the read-only sandbox prevented creation of Go’s work directory; the executable census gate was not verified. No files were edited.
+
+**NOT READY**
\ No newline at end of file
diff --git a/docs/superpowers/reviews/LUNA-COPY-RESULT-config-receipts-1b.md b/docs/superpowers/reviews/LUNA-COPY-RESULT-config-receipts-1b.md
new file mode 100644
index 000000000..f4c54972a
--- /dev/null
+++ b/docs/superpowers/reviews/LUNA-COPY-RESULT-config-receipts-1b.md
@@ -0,0 +1,22 @@
+### Console door 400s
+
+| file:line | current | proposed | why |
+|---|---|---|---|
+| `internal/console/apiconfig.go:1075` | `if_version is empty. send the version to write against, or leave if_version out` | `if_version is empty. send the version to write against, or leave the field out` | “The field” is clearer than repeating the JSON name. |
+| `internal/console/apiconfig.go:1076` | `If-Match must name one version, quoted or not. an empty tag, "*", a weak tag and a list are not accepted` | `if-match must name one version, quoted or not. empty tags, "*", weak tags and lists are not accepted` | Matches the lower-case console style and makes the categories parallel. |
+| `internal/console/apiconfig.go:1077` | `if_version and the If-Match header name different versions. send one, or send the same version in both` | `the if_version field and if-match header name different versions. send one, or send the same version in both` | Fixes the awkward grammar and identifies both inputs plainly. |
+
+### CLI lines
+
+| file:line | current | proposed | why |
+|---|---|---|---|
+| `appconfig_cli.go:415` | `the default bundle could not be read either side of this write, so whether it changed meanwhile is not known` | `the default bundle could not be read before or after this write, so it is not known whether it changed` | “Before or after” is clearer than “either side,” and the ending is shorter. |
+| `appconfig_cli.go:416` | `--if-version is empty, so nothing was written. pass the version to write against, or leave the flag out` | `--if-version is empty, so nothing was written. pass the version to write against, or omit the flag` | “Omit the flag” is more direct. |
+| `apimode.go:3179` | `or %s is not one of this app's routes (check --host), or this console predates carlos env effective and needs updating` | `or %s is not one of this app's routes (check --host), or this console needs updating before carlos env effective can be used` | Removes the internal-sounding “predates” and states the required action. |
+
+### Flags
+
+- Confirm that displaying `if-match` in lower case is acceptable even though the HTTP header is conventionally written as `If-Match`.
+- Confirm that the default bundle is always the intended bundle for the “before or after” diagnostic, rather than the bundle being written.
+
+COPY PASS DONE
\ No newline at end of file