spec: config receipts (#522) rev 6, APPROVED with Paul's Plan 2 cut
Delivery verdicts describe the launch that took the config: overrides from that launch's environment, UnsetEnvironment checked for named units, later box-side edits not tracked (R3-1, R3-2).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+49
−15
docs/superpowers/specs/2026-11-02-config-receipts-design.md+49 −15
CI cancelled — superseded by a newer push — run details
diff --git a/docs/superpowers/specs/2026-11-02-config-receipts-design.md b/docs/superpowers/specs/2026-11-02-config-receipts-design.md| index ebda4567d..05f7f4d8b 100644 |
| --- a/docs/superpowers/specs/2026-11-02-config-receipts-design.md |
| +++ b/docs/superpowers/specs/2026-11-02-config-receipts-design.md |
| @@ -1,6 +1,9 @@ |
| # Config versions, digests and receipts: proving what a config change touched |
| -Status: DRAFT rev 5, 2026-11-03. |
| +Status: APPROVED rev 6, 2026-11-03 (Paul). Discussion: amadan carlos/platform #522 |
| +(filed by the Oficina Home agent; its consumer is oficina/home #103). |
| +Branch `design-config-receipts-522`, cut from main `5394c7f9`. Every |
| +file:line below is on that commit. |
| Revisions: |
| - Rev 1 (148c56d5, eff06f96): first draft. |
| @@ -15,10 +18,13 @@ Revisions: |
| Paul chose (2026-11-03) to refuse the names carlos sets at launch, keep them |
| in one list pinned by one guard test, and report `<host>.env` overrides by |
| name (§5.5, "Overrides"). |
| -- Rev 5: Paul's choice for R2-1 written into §5.5 "Overrides". Discussion: amadan carlos/platform #522 |
| -(filed by the Oficina Home agent; its consumer is oficina/home #103). |
| -Branch `design-config-receipts-522`, cut from main `5394c7f9`. Every |
| -file:line below is on that commit. |
| +- Rev 5: Paul's choice for R2-1 written into §5.5 "Overrides". |
| +- Rev 6: Astra round 3 (`CODEX-FINDINGS-config-receipts-R3.md`, NOT READY, |
| + 2 P1 and 1 P2; R2-2, R2-3, R2-4 resolved, R2-1 partly). R3-3 taken. R3-1 |
| + and R3-2 are the same launch-evidence family a third time; round 3 was the |
| + last, so Paul chose the cut (2026-11-03): Plan 2's verdict states what was |
| + true **at the launch that took the config** and no more (§5.5, "What the |
| + verdict claims"). Marked **(R3-n)**. Approved by Paul with this cut. |
| ## 0. Status and shape |
| @@ -680,8 +686,9 @@ inequality: the process that will read the config starts after `written`. |
| the process that restart started. If the restart fails, `restart-failed`; |
| the pending marker stays and the next pass tries again, as today. Inactivity |
| alone never counts as delivery. |
| -- **Later restarts** (a deploy, a crash, a wake) start after `written` too, so |
| - they never make a delivered route undelivered and never rewrite the ack. |
| +- **Later restarts** (a deploy, a crash, a wake) do not rewrite the ack. The |
| + ack describes the launch that took the config and nothing after it (see |
| + "What the verdict claims" below, **R3-2**). |
| `restart-pending` is only for a pass that wrote the file and deliberately did |
| not restart (a unit carlos may not restart yet, such as one held for a |
| swap); the builder lists those cases from `sync.go` and `unitsync.go`. |
| @@ -724,15 +731,23 @@ inequality: the process that will read the config starts after `written`. |
| What remains is the host-local layer, which is the box's, not the bucket's: |
| - **Exec routes:** the instance's own `<host>.env` wins over the rendered |
| - config (`instanceEnv`, `backend_exec.go:2995`). The agent records the names |
| - `LaunchLayers` (`backend_exec.go:3076`) reports as shadowed, which are |
| - exactly the names present in both files. |
| + config (`instanceEnv`, `backend_exec.go:2995`). The override names are taken |
| + from the **actual launch environment of the generation that took the |
| + config**, which the backend already retains (`backend_exec.go:2797`), not by |
| + re-reading the files later (`LaunchLayers` reads them afresh, |
| + `backend_exec.go:3076`, so it describes the next launch, not this one) |
| + **(R3-2)**. The names recorded are the stored keys whose value in that |
| + environment is not the stored one. |
| - **Unit routes:** a declared named unit with an unmanaged EnvironmentFile is |
| already refused (`unmanaged-env-file`), and systemd lets EnvironmentFile |
| - values override `Environment=` lines, so the managed file wins. For |
| - `carlos-app@` units carlos writes the unit itself; the builder confirms in |
| - the plan that its template loads no other environment file after the |
| - managed one. |
| + values override `Environment=` lines, so the managed file wins. But |
| + systemd applies `UnsetEnvironment=` after all of that and can remove a |
| + stored key **(R3-1)**. The root pass's unit probe (`unitops.go:139`, today |
| + `Id`, `LoadState`, `EnvironmentFiles`) also reads `UnsetEnvironment`, and |
| + every stored key it names (as a bare name or as `NAME=value`) is recorded |
| + as overridden. For `carlos-app@` units carlos writes the unit itself; the |
| + builder confirms in the plan that its template loads no other environment |
| + file after the managed one and sets no `UnsetEnvironment`. |
| So for a route, `overridden` = (stored names on `LaunchOwnedNames`) plus (for |
| exec routes) the `<host>.env` shadowed names. Names only. A route with any |
| @@ -742,6 +757,19 @@ inequality: the process that will read the config starts after `written`. |
| `ExecStart` wrapper or the program itself does with it afterwards is the |
| app's, and the docs say so. |
| +**What the verdict claims (R3-1, R3-2; Paul's cut, 2026-11-03).** A delivery |
| +verdict is evidence about **the launch that took the config**, recorded at that |
| +launch, and nothing later. `delivered` means: the stored versions were rendered, |
| +a process started after they were written, and at that start no stored key was |
| +overridden (by the launch-owned list, `<host>.env` as it then stood, or |
| +`UnsetEnvironment`). It does not track the box afterwards. If someone later |
| +edits `<host>.env` or a unit's `UnsetEnvironment` and the process restarts, |
| +the verdict does not change until the next config delivery. The console and |
| +CLI therefore show it as `delivered at <time>` (the process start), and the |
| +docs say in one sentence that later changes made on the box itself are not |
| +tracked. This is the cut Astra named in round 3: no claim about the current |
| +process beyond that launch. |
| + |
| Liveness of the box itself is not this record's job. The console already reads |
| box heartbeats (`freshHeartbeats`, `apiplacements.go:294`); an ack from a box whose heartbeat is stale is reported as |
| `unknown (box not reporting)`, never as delivered. |
| @@ -767,7 +795,7 @@ Verdicts: |
| | Verdict | When | |
| |---|---| |
| -| `delivered` | ack `delivered`, versions equal stored, and either a process started after `written` or the unit was asleep (shown as `delivered (asleep)`) | |
| +| `delivered` | ack `delivered`, versions equal stored, and either a process started after `written` or the unit was asleep. Shown as `delivered at <time>` or `delivered (asleep)`; evidence as of that launch only (§5.5, **R3-2**) | |
| | `delivered (file)` | ack `delivered`, versions equal stored, exec route with no process record (§5.5) | |
| | `restart-pending` | ack `restart-pending`, versions equal stored: the file is current and the process has not been restarted onto it | |
| | `overridden` | as `delivered`, but `overridden` names keys whose value the process gets from a host-local layer instead **(R1-2)** | |
| @@ -816,6 +844,10 @@ no box-side traffic. |
| | PUT setting `CARLOS_HOST` (or any listed name), any writer | 400 naming the key; nothing written **(R2-1)** | |
| | bundle already holding `CARLOS_HOST` | route reads `overridden` naming it; unset allowed **(R2-1)** | |
| | guard: each launch composer only changes listed names | fails if a composer sets or removes an unlisted name **(R2-1)** | |
| +| named unit with `UnsetEnvironment=AGENT_TEAM`, stored `AGENT_TEAM` | `overridden`, naming `AGENT_TEAM` **(R3-1)** | |
| +| exec override taken from the launching generation's environment | names match that launch even if `<host>.env` changes before the ack is written **(R3-2)** | |
| +| `<host>.env` gains a stored key after delivery, then a crash restart | verdict unchanged, shown `delivered at <time>`; the documented limit **(R3-2)** | |
| +| guard covers `ttyVars` and `rootfsTTYVars` (`TERM`) | listed **(R3-3)** | |
| | scheduler holds success for revision B, then a pass is refused, then B activates | refusal published at once; the held success is dropped; final ack is the refusal **(R1-4)** | |
| | team PUT with a stale `if_version` racing another team write | 412, nothing written **(R1-3)** | |
| | team PUT with `if_version: none` | 400 **(R1-3)** | |
| @@ -901,5 +933,7 @@ next platform release; no roll ordering beyond the usual dev first. |
| 14. Writes refuse every name carlos sets at launch; unset of one stays |
| allowed; stored ones are reported, not rewritten (§5.5, R2-1, Paul's |
| choice of approach). |
| +15. Delivery verdicts describe the launch that took the config, not the box |
| + afterwards (§5.5, R3-1/R3-2, Paul's cut). |
| 12. Routes held by a move keep their ack owned by the move; held renders gain |
| the schema 2 fields (§5.3). |