plan: config receipts plan 1, versions digests conditional writes (#522)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+231
−0
docs/superpowers/plans/2026-11-03-config-receipts-plan-1.md+231 −0
CI passed — run details
Intent
Attributed to this commit: 64.9 g CO₂e (7,511,332 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on design-config-receipts-522, 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/plans/2026-11-03-config-receipts-plan-1.md b/docs/superpowers/plans/2026-11-03-config-receipts-plan-1.md| new file mode 100644 |
| index 000000000..3517c4b67 |
| --- /dev/null |
| +++ b/docs/superpowers/plans/2026-11-03-config-receipts-plan-1.md |
| @@ -0,0 +1,231 @@ |
| +# Config receipts, Plan 1: versions, digests, conditional writes: implementation plan |
| + |
| +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. |
| + |
| +**Goal:** Config reads carry a version per layer and a digest per key; config writes accept `if_version`, refuse stale ones with 412, and answer with a receipt; `config/effective` shows where each key of one instance comes from. |
| + |
| +**Architecture:** Pure functions for version and digest in `internal/appconfig`; the existing single write path (`applyAt`, and `claimRawApplyEnvironmentOwned` for team writes) gains an expected-version argument and builds the receipt from the same read whose etag guards the `Put`. The console doors expose both; the CLI prints them. No box change. |
| + |
| +**Tech Stack:** Go, `internal/appconfig`, `internal/release` store, `internal/console` CLI doors, root `carlos` CLI (`appconfig_cli.go`, `apimode.go`). |
| + |
| +**Spec:** `docs/superpowers/specs/2026-11-02-config-receipts-design.md` (APPROVED rev 6), §4. Plan 2 (§5) is a separate plan. |
| + |
| +## Global Constraints |
| + |
| +- Version: `"cv1:" + lowercase hex SHA-256(raw object bytes as stored)`; an absent layer is `"none"` (spec §4.2). |
| +- Digest: `"vd1:" + lowercase hex SHA-256("carlos.config.var.v1" 0x00 kind 0x00 value 0x00 envelope 0x00 sealed_to)` over the stored `Var` fields, empty strings for absent fields (spec §4.3). |
| +- No envelope, plaintext, version or digest in any log line or audit row; audit rows unchanged (counts and bundle only) (spec §4.6, R1-1). |
| +- A secret's envelope never appears in any response (existing rule, `apiconfig.go:171`). |
| +- `if_version` only on a store with a cross-process atomic conditional write; otherwise 400 before any read (R2-2). |
| +- `if_version` with `exec_delivery` in one request: 400. Team write with `if_version: "none"`: 400 (R1-3). |
| +- Every door keeps its gate: other accounts, unknown apps and unknown hosts get the gate's byte-identical 404. `config/effective` is never reachable by a team credential. |
| +- Every new user-facing string (CLI output, door errors, docs) goes through the `copy-review` skill before it is written into a file. House style: no em dashes; CLI and door strings lower case, no final full stop. |
| +- Local verification: only the touched packages, `go test ./internal/appconfig/ ./internal/console/ -run '<names>'` and `go test . -run '<names>'`; full suite runs in CI. Leave `GOCACHE` at its default. |
| + |
| +## Review Focus |
| + |
| +1. **Default bundle never created, then conditional write with `if_version: "none"`** → creates it; the same call on an existing bundle → 412. Pinned in Task 2. |
| +2. **A write that changes nothing** (set a plain var to its current value) → 200, `changed: false`, `version_before == version_after`. Pinned in Task 2. |
| +3. **`If-Match` header and body `if_version` disagree** → 400, nothing read. Pinned in Task 4. |
| +4. **Unset of a key that is absent alongside a set** → `unset_absent` names it, `unset` does not. Pinned in Task 2. |
| +5. **`config/effective` for a host whose record names an owned environment** → no `default` layer, no `from: "default"`. Pinned in Task 3. |
| + |
| +--- |
| + |
| +### Task 1: Version, digest and the raw-bytes layer loader |
| + |
| +**Files:** |
| +- Create: `internal/appconfig/observe.go` |
| +- Test: `internal/appconfig/observe_test.go` |
| + |
| +**Interfaces:** |
| +- Produces: |
| + - `const VersionNone = "none"` |
| + - `func Version(raw []byte, found bool) string` |
| + - `func Digest(v Var) string` |
| + - `func Digests(m *Manifest) map[string]string` (nil-safe; empty map for nil) |
| + - `type Layer struct { Version string; Found bool; Manifest *Manifest }` (Manifest empty-but-non-nil when absent) |
| + - `func LoadLayer(ctx context.Context, s release.Store, key, app string) (Layer, error)` — reads raw bytes once, versions them, unmarshals with the same newer-schema refusal as `getIfExistsAtETag` (`store.go:65`). |
| + - `func BundleKey(acct, app, envName string) string` — `Key` for `""`, `EnvironmentKey` otherwise. |
| + |
| +- [ ] **Step 1: Write the failing tests** in `observe_test.go`: |
| + - `TestVersionAbsentIsNone`: `Version(nil, false) == "none"`. |
| + - `TestVersionIsHashOfBytes`: `Version([]byte("abc"), true) == "cv1:ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"`. |
| + - `TestVersionEmptyObjectIsNotNone`: `Version([]byte{}, true) != "none"` and starts with `"cv1:"`. |
| + - `TestDigestPinned`: `Digest(Var{Kind:"env", Value:"info"})` equals the hex SHA-256 of `"carlos.config.var.v1\x00env\x00info\x00\x00"` prefixed `"vd1:"` (compute expected in the test with `crypto/sha256`, not by calling `Digest`). |
| + - `TestDigestSecretUsesEnvelope`: two `Seal`s of the same plaintext (use the package's existing test keypair helper) give different digests; `Digest` never equals a digest built from the plaintext as `Value`. |
| + - `TestDigestKindMatters`: same string as env `Value` vs secret `Envelope` → different digests. |
| + - `TestLoadLayerStableAcrossReads`: on a `release.DirStore` in `t.TempDir()`, `Apply` a bundle, `LoadLayer` twice → same `Version`; `Apply` one more var → different `Version`. |
| + - `TestLoadLayerAbsent`: `LoadLayer` on a missing key → `Version == "none"`, `Found == false`, `Manifest` non-nil with empty `Vars`. |
| + |
| +- [ ] **Step 2: Run** `go test ./internal/appconfig/ -run 'TestVersion|TestDigest|TestLoadLayer'` — Expected: FAIL (undefined). |
| + |
| +- [ ] **Step 3: Implement** in `observe.go` per Interfaces. `Version` and `Digest` use `crypto/sha256` + `encoding/hex`. `LoadLayer` calls `s.Get`; `os.ErrNotExist` → absent layer. |
| + |
| +- [ ] **Step 4: Run** the same command — Expected: PASS. |
| + |
| +- [ ] **Step 5: Commit** `appconfig: config versions and digests (#522 plan 1 task 1)`. |
| + |
| +--- |
| + |
| +### Task 2: Conditional apply and receipts in appconfig |
| + |
| +**Files:** |
| +- Modify: `internal/appconfig/store.go` (`applyAt`, `:162`), `internal/appconfig/environments.go` (`applyEnvironment`, `:109`), `internal/appconfig/generation.go` (`claimRawApply*`, `Apply*` wrappers, `:119-140`), `internal/appconfig/owned.go` (`claimRawApplyEnvironmentOwned`, `:99`; `ApplyEnvironmentOwned`, `:271`) |
| +- Modify: `internal/release/store.go` (capability marker on `S3Store`) |
| +- Test: `internal/appconfig/observe_apply_test.go`, `internal/release/store_test.go` |
| + |
| +**Interfaces:** |
| +- Consumes: Task 1's `Version`, `Digest`, `VersionNone`, `BundleKey`. |
| +- Produces: |
| + - `var ErrVersionMismatch = errors.New("config: version mismatch")` — returned for a stale `ifVersion` at read **and** for a CAS conflict when `ifVersion != ""`. |
| + - `var ErrConditionalCreateOwned = errors.New("config: a conditional write cannot create an owned environment")` |
| + - `type Receipt struct { VersionBefore, VersionAfter string; Changed bool; Set, Unset, UnsetAbsent []string; Digests map[string]string }` (slices sorted, never nil). |
| + - `func ApplyIf(ctx context.Context, s release.Store, acct, app, envName, ifVersion string, sets map[string]Var, unsets []string) (Receipt, error)` — `envName == ""` is the default bundle; `ifVersion == ""` is unconditional. Wrapped in `release.WithAppMutation` like `Apply` (follow the `claimRaw*` wrapper pattern in `generation.go`). |
| + - `func ApplyEnvironmentOwnedIf(ctx context.Context, s release.Store, acct, app, envName, scope, ifVersion string, sets map[string]Var, unsets []string) (Receipt, error)` — same, owned path; ownership refusal (`ErrNotOwnedBy`) is checked before the version compare. |
| + - Existing `Apply`, `ApplyEnvironment`, `ApplyEnvironmentOwned` keep their signatures and behaviour (they call the new internals with `ifVersion == ""`). |
| + - In `internal/release`: `type AtomicConditionalStore interface { AtomicConditionalPut() }`; `func (s *S3Store) AtomicConditionalPut() {}`; `func HasAtomicConditionalPut(s Store) bool` (true when `s` implements the interface; any wrapper type in `internal/release` that embeds a `Store` forwards it). |
| + |
| +- [ ] **Step 1: Write the failing tests** in `observe_apply_test.go` (DirStore in `t.TempDir()`; single process, so its mutex makes CAS sound here): |
| + - `TestApplyIfReceiptExactNames`: existing bundle `{A, B}`; `ApplyIf(... sets {C, D}, unsets {B, Z})` → `Set == [C D]`, `Unset == [B]`, `UnsetAbsent == [Z]`, `Digests` has exactly `C`, `D` equal to `Digest` of what was sent, `VersionBefore` = `LoadLayer` before, `VersionAfter` = `LoadLayer` after, `Changed == true`. |
| + - `TestApplyIfStaleRefusedNothingWritten`: `ifVersion` = an old version → `errors.Is(err, ErrVersionMismatch)`; stored bytes byte-identical to before. |
| + - `TestApplyIfRaceBetweenReadAndPut`: wrap the store so `Put` first writes competing bytes to the same key then delegates → `ErrVersionMismatch`; the competing bytes are what is stored. |
| + - `TestApplyIfNoneCreates` / `TestApplyIfNoneOnExisting`: `"none"` on absent → creates; on existing → `ErrVersionMismatch`. |
| + - `TestApplyIfUnchangedWrite`: set a plain var to its current value → `Changed == false`, `VersionBefore == VersionAfter`. |
| + - `TestApplyEnvironmentOwnedIfStale`: owned env, stale `ifVersion` → `ErrVersionMismatch`, nothing written; wrong scope → `ErrNotOwnedBy` (not mismatch). |
| + - `TestApplyEnvironmentOwnedIfNoneRefused`: `ifVersion == "none"` → `ErrConditionalCreateOwned`, nothing written. |
| + - `TestApplyUnchangedSignatures`: existing `Apply` on a CAS conflict still returns `release.ErrCASConflict` (not `ErrVersionMismatch`). |
| + - In `internal/release/store_test.go`: `TestHasAtomicConditionalPut`: `S3Store` true, `DirStore` false. |
| + |
| +- [ ] **Step 2: Run** `go test ./internal/appconfig/ ./internal/release/ -run 'TestApplyIf|TestApplyEnvironmentOwnedIf|TestApplyUnchanged|TestHasAtomicConditionalPut'` — Expected: FAIL. |
| + |
| +- [ ] **Step 3: Implement.** `applyAt` gains `expect string` and returns `(Receipt, error)` (callers that want `removed` use `len(Receipt.Unset)`). One `s.Get`: raw bytes → `Version`; if `expect != ""` and it differs → `ErrVersionMismatch` before any change; apply in memory; `putManifestAt` at the read's etag; on `release.ErrCASConflict` with `expect != ""` → `ErrVersionMismatch`; `VersionAfter` = `Version` of the bytes `putManifestAt` marshalled (return them from it). Same shape inside `claimRawApplyEnvironmentOwned`; its mint step for a new owned environment is never reached with `expect != ""` (refused first). `touchLogged` unchanged. |
| + |
| +- [ ] **Step 4: Run** Step 2's command, then `go test ./internal/appconfig/ ./internal/release/` — Expected: PASS (existing tests unchanged). |
| + |
| +- [ ] **Step 5: Commit** `appconfig: conditional apply with receipts (#522 plan 1 task 2)`. |
| + |
| +--- |
| + |
| +### Task 3: Console reads — versions, digests, `config/effective` |
| + |
| +**Files:** |
| +- Modify: `internal/console/apiconfig.go` (`handleAPIConfigGet`, `:184`) |
| +- Create: `internal/console/apiconfigeffective.go` |
| +- Modify: `internal/console/authcli.go` (route registration beside `:957-962`) |
| +- Modify: `internal/appconfig/observe.go` (add host loader) |
| +- Test: `internal/console/apiconfig_observe_test.go`, `internal/appconfig/observe_test.go` |
| + |
| +**Interfaces:** |
| +- Consumes: Task 1. |
| +- Produces: |
| + - `type HostLayers struct { EnvName string; Owned bool; Default, Environment, Overlay Layer; Vars []EffectiveVar }` |
| + - `type EffectiveVar struct { Key, Kind, Digest, From, Value string; Shadows []string }` — `From` is `"default" | "environment" | "overlay"`; `Value` set only for kind `env` from `default` or `environment` (overlay plain values are digest-only, spec §4.4, builder call taken here); `Shadows` lists lower layers that also set the key, nearest first. |
| + - `func LoadHostLayers(ctx context.Context, s release.Store, acct, app, envName, host string) (*HostLayers, error)` — reads each layer with `LoadLayer`, merges with the same functions boxes use (`loadMergedETags`' merge rules, `applyInstanceOverlay`, owned = standalone); for an owned environment `Default` is the zero `Layer` and never consulted. |
| + - Wire: GET `/config` adds `"version"` and per-row `"digest"`. New `GET /api/cli/apps/{account}/{app}/config/effective?host=<host>` → spec §4.4 JSON (`host`, `environment`, `owned`, `layers` with `version` per layer, `default` omitted when owned, `vars`). |
| + - Registration: `s.cliRoute("GET /api/cli/apps/{account}/{app}/config/effective", svcrole.Allow(svcrole.Operate), s.handleAPIConfigEffective)` (plain `cliRoute`, so team credentials are refused as on every non-scoped door). |
| + |
| +- [ ] **Step 1: Write the failing tests.** |
| + - appconfig `TestLoadHostLayersFromAndShadows`: default sets `A,B`; env `prod` sets `B,C`; overlay for `shop.example.com` sets `C` → `A from default`, `B from environment shadows [default]`, `C from overlay shadows [environment]`; versions equal `LoadLayer` of each key. |
| + - appconfig `TestLoadHostLayersOwned`: owned env → `Owned`, no var `From == "default"` even if default sets the key, `Default.Version == ""`. |
| + - appconfig `TestLoadHostLayersMatchesBoxMerge`: for the fixture above, the merged key/value set equals `LoadMergedHost`'s (`instances.go:203`) — guards drift from the box merge. |
| + - console `TestAPIConfigGetVersionAndDigests` (use `configFixture`, `putJSON`, `getJSON`, `varsByKey`): after a PUT, GET `version` equals `appconfig.Version` of the stored bytes (`fx.rel.Get`); each row's `digest` equals `appconfig.Digest` of the stored var; a secret row still has no `value` and no `envelope` key. |
| + - console `TestAPIConfigGetVersionNone`: never-configured app → `"version": "none"`. |
| + - console `TestAPIConfigEffective`: provisioned instance record with `Environment: "prod"` (use the instance-record helper the rate-limit tests use) → JSON per spec §4.4; overlay env var has `digest` and no `value`. |
| + - console `TestAPIConfigEffectiveGate`: unknown host, another app's host, another account → body byte-identical to `http.NotFound`; missing `host` → 400. |
| + - console `TestAPIConfigEffectiveTeamRefused`: team token (`teamToken`, `svcfixture_test.go:31`) → same status and body as the same token gets on `POST .../config/sync`. |
| + - console `TestAPIConfigTeamGetOwnedVersion`: team GET of its owned environment carries `version` and digests; response has no `default` information. |
| + |
| +- [ ] **Step 2: Run** `go test ./internal/appconfig/ ./internal/console/ -run 'TestLoadHostLayers|TestAPIConfigGetVersion|TestAPIConfigEffective|TestAPIConfigTeamGetOwnedVersion'` — Expected: FAIL. |
| + |
| +- [ ] **Step 3: Implement.** GET: replace the `appconfig.Get` / `LoadEnvironment` read with `LoadLayer(BundleKey(...))`, keep every existing field. Effective: gate via `apiAccountApp`; `host` shape-checked with `provision.ValidHostShape`; record via `s.readRecord` (`lifetimes_read.go:23`), `os.ErrNotExist` → `http.NotFound`; environment from the record's `Environment`; then `LoadHostLayers`. Store errors: log, 502 "could not read the config — try again" (existing sentence, no new copy). |
| + |
| +- [ ] **Step 4: Run** Step 2's command — Expected: PASS. |
| + |
| +- [ ] **Step 5: Commit** `console: config versions, digests and the effective view (#522 plan 1 task 3)`. |
| + |
| +--- |
| + |
| +### Task 4: Console writes — `if_version`, 412, receipts |
| + |
| +**Files:** |
| +- Modify: `internal/console/apiconfig.go` (`handleAPIConfigPut`, `:335`; `teamApplyEnvironment`, `:849`; `configStoreError`) |
| +- Test: `internal/console/apiconfig_conditional_test.go` |
| + |
| +**Interfaces:** |
| +- Consumes: Task 2's `ApplyIf`, `ApplyEnvironmentOwnedIf`, `ErrVersionMismatch`, `ErrConditionalCreateOwned`, `Receipt`, `release.HasAtomicConditionalPut`; Task 1's `LoadLayer`. |
| +- Produces (wire): request body field `if_version` (string); header `If-Match` accepted as a synonym. Response adds `"receipt": {bundle, version_before, version_after, changed, set, unset, unset_absent, digests, others?}` per spec §4.6; `"removed"` kept (`len(unset)`). 412 body `{"error": "<copy-reviewed sentence>", "version": "<current>"}`. |
| + |
| +- [ ] **Step 1: Write the failing tests** (a test-only `atomicDirStore` that embeds `*release.DirStore` and implements `AtomicConditionalPut()`, installed as the fixture's store for conditional cases): |
| + - `TestAPIConfigPutReceipt`: unconditional PUT → receipt names and versions match `fx.rel` before/after; `removed` still present. |
| + - `TestAPIConfigPutIfVersionStale`: 412, body `version` equals current; stored bytes unchanged; generation etag (`genEtag`) unchanged. |
| + - `TestAPIConfigPutIfVersionRace`: store wrapper writes competing bytes inside `Put` → 412, competing bytes intact (R2-4). |
| + - `TestAPIConfigPutIfVersionWithExecDelivery`: 400, nothing read (assert via a store wrapper counting `Get`s). |
| + - `TestAPIConfigPutIfMatchHeaderConflict`: header and body differ → 400; header alone works like the body field. |
| + - `TestAPIConfigPutIfVersionOnDirStore`: plain DirStore fixture → 400 before any `Get` (R2-2). |
| + - `TestAPIConfigPutOthersForNamedEnv`: PUT to a non-owned env → `receipt.others.default.before/after` present and equal when nothing else wrote. |
| + - `TestAPIConfigTeamPutIfVersion`: team PUT with stale `if_version` → 412; with `"none"` → 400 (R1-3). |
| + - `TestAPIConfigPutNoContentInLogsOrAudit`: capture `log` output and the activity rows for a PUT that sets a secret and a plain var → none contains the envelope, the plain value, any `cv1:` or `vd1:` string; audit `Detail` matches today's format exactly. |
| + |
| +- [ ] **Step 2: Run** `go test ./internal/console/ -run 'TestAPIConfigPut|TestAPIConfigTeamPutIfVersion'` — Expected: new tests FAIL, existing PUT tests PASS. |
| + |
| +- [ ] **Step 3: Implement.** Parse `if_version` and `If-Match` after the existing body checks; refusals in this order, all before the first store call: header/body mismatch (400), `if_version` + `exec_delivery` (400), store lacks `HasAtomicConditionalPut` (400), team + `"none"` (400). Replace the `Apply`/`ApplyEnvironment`/`teamApplyEnvironment` calls with the `…If` forms (thread `ifVersion` through `teamApplyEnvironment`). `ErrVersionMismatch` → read the layer once more for its current version, answer 412. For a non-owned named environment, read the default layer's version immediately before and after the write for `others`. All new door sentences go through `copy-review` first. |
| + |
| +- [ ] **Step 4: Run** `go test ./internal/console/ -run 'TestAPIConfig|TestTeamConfigDoors'` — Expected: PASS. |
| + |
| +- [ ] **Step 5: Commit** `console: conditional config writes and receipts (#522 plan 1 task 4)`. |
| + |
| +--- |
| + |
| +### Task 5: CLI — versions, receipts, `--if-version`, `effective`, `digest` |
| + |
| +**Files:** |
| +- Modify: `apimode.go` (`apiConfig`, `configGet`, `apiConfigApply`, `configApply`, `apiConfigApplyResult`, `:2870-3030`) |
| +- Modify: `appconfig_cli.go` (`RunEnv` dispatch `:236`, `runEnvSet` `:370`, `runEnvUnset`, `runEnvList` `:490`, `runSecretsSet` `:937`, `runSecretsUnset`, `runSecretsList`, `envUsage`) |
| +- Test: `apimode_test.go`, `appconfig_cli_test.go` (or the file where `runEnvList` is tested today) |
| + |
| +**Interfaces:** |
| +- Consumes: wire from Tasks 3-4; `appconfig.Digest`. |
| +- Produces: |
| + - `apiConfig.Version string`; `apiConfigVar.Digest string`. |
| + - `apiConfigApply.IfVersion string \`json:"if_version,omitempty"\``. |
| + - `apiConfigApplyResult.Receipt *apiConfigReceipt` (nil from an older console); `type apiConfigReceipt struct { Bundle, VersionBefore, VersionAfter string; Changed bool; Set, Unset, UnsetAbsent []string; Digests map[string]string }`. |
| + - `func (s *apiSession) configEffective(ctx context.Context, a apiAcct, app, host string) (apiConfigEffective, error)`. |
| + - `const exitVersionMismatch = 4` — process exit code when a set/unset is refused with 412. |
| + - Commands: `carlos env list|secrets list [--digests] [--json]`; `carlos env set|unset|secrets set|unset [--if-version <v>]`; `carlos env effective --app <a> --host <h> [--json]`; `carlos env digest --kind env --value <v>` / `--kind secret --envelope-file <path>`. |
| + |
| +- [ ] **Step 1: Write the failing tests** against an `httptest` console stub (pattern at `apimode_test.go:2653`): |
| + - `TestConfigGetParsesVersionAndDigest`; `TestConfigApplySendsIfVersion` (body has `if_version`); `TestConfigApplyParsesReceipt`; `TestConfigApplyOlderConsoleNoReceipt` (nil, no crash). |
| + - `TestEnvSet412ExitsWithVersionMismatch`: stub answers 412 → exit code 4 and the printed current version (run via the existing subprocess/exit-capture helper the CLI tests use). |
| + - `TestEnvListPrintsVersion`; `TestEnvListDigestsColumn`; `TestEnvListJSON` (has `version` and per-var `digest`). |
| + - `TestEnvEffectiveTable` and `--json`. |
| + - `TestEnvDigestMatchesAppconfig`: `carlos env digest --kind env --value info` prints exactly `appconfig.Digest(Var{Kind:"env",Value:"info"})`. |
| + - `TestEnvSetUnchangedSaysSo`: receipt `changed: false` → output says nothing changed. |
| + |
| +- [ ] **Step 2: Run** `go test . -run 'TestConfigGet|TestConfigApply|TestEnvSet412|TestEnvList|TestEnvEffective|TestEnvDigest|TestEnvSetUnchanged'` — Expected: FAIL. |
| + |
| +- [ ] **Step 3: Copy review.** Collect every new CLI string (help lines in `envUsage`, list header, receipt lines, 412 message, effective table headers, digest errors) and the Task 4 door sentences not yet reviewed; run the `copy-review` skill; apply Paul's edits verbatim. |
| + |
| +- [ ] **Step 4: Implement** per Interfaces. Bucket mode (no console session): `--if-version` is refused with a one-line error (conditional writes go through a console); `list` in bucket mode prints the version from `appconfig.LoadLayer`. |
| + |
| +- [ ] **Step 5: Run** Step 2's command plus `go test . -run 'TestEnv|TestSecrets|TestConfig'` — Expected: PASS. |
| + |
| +- [ ] **Step 6: Commit** `cli: config versions, receipts, --if-version, env effective and digest (#522 plan 1 task 5)`. |
| + |
| +--- |
| + |
| +### Task 6: Docs, census, branch review |
| + |
| +**Files:** |
| +- Modify: `docs/site/cli.md` (the `carlos env` / `carlos secrets` section) |
| +- Create: census card output per `AGENTS.md` (`make census-card`) |
| + |
| +- [ ] **Step 1: Write the docs** (through `copy-review`): what a version and a digest are; that a plain var's digest is as sensitive as its value (spec §4.3); the §4.7 adoption recipe as a worked example with `--if-version`, including all five step-4 branches. |
| + |
| +- [ ] **Step 2: Census.** Run `make census-card`; brief Astra from `docs/superpowers/reviews/REVIEW-BRIEF-TEMPLATE.md` with the diff (Plan 1 touches `internal/appconfig`, `internal/release`, root CLI: root binary packages); record the verdict on amadan #280. |
| + |
| +- [ ] **Step 3: Whole-branch review** (cross-model: Astra if Claude built it, Opus if Codex built it), max three rounds per AGENTS.md stopping rules. |
| + |
| +- [ ] **Step 4: Verify CI** on the branch tip with `amadan ci status -branch <branch>`; Expected: passed (linux, darwin, windows cross-builds included). |
| + |
| +- [ ] **Step 5: Commit** `docs: config versions, digests and the adoption recipe (#522 plan 1 task 6)`. |