carlos / platform Public

design-config-receipts-522

Prompts

Human

<task-notification> <task-id>a769464283baf520a</task-id> <tool-use-id>toolu_01FMUYgy652Wrco6rffQpQVr</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/4c585ebb-d953-40f5-8f58-fbd337832024/tasks/a769464283baf520a.output</output-file> <status>completed</status> <summary>Agent "Recon box-side config delivery evidence" 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>I've mapped all six parts, and there's one headline finding. Nothing today records config delivery for a stamped named-unit route: that path writes no ack, so the #516 case can't be seen off-box. The ack that exists for other shapes is change-only, records only the instance overlay's version, and is tied to a file on disk, not to a running process. Paths below are relative to the repo root; lines marked `~` are approximate. ## 1. ConfigAck (`internal/appconfig/configack.go`) **Shape (`:64-116`):** - `Box`, `Host`. - `Schema int` (`ConfigAckSchema = 1`, `:44`). Schema 0 means an older agent wrote it. - `Shape`: `"unit" | "socket-exec" | "tcp-exec-file"`, set by `shapeOf` (`:309`). `"unit"` means a `carlos-app@` unit (`Backing == BackingUnit`), not a stamped named unit. - `At`. - `Restarted`, `RestartError`, `Hibernating`. - `RelaySuffixes`: region → `username_suffix`, parsed from `CARLOS_RELAY`. - `InstanceConfigETag`. - Moves only (written by `RenderHeld`): `MoveOp`, `FileSHA256`, `BundleETags{"default","environment"}`. **Where it's stored:** `control/config-ack/&lt;box&gt;/&lt;host&gt;.json` (`ConfigAckPrefix :120`, `ConfigAckKey :125`). It is rewritten in place with a compare-and-swap get-then-put and one retry (`WriteConfigAck :226`). **Who writes it:** | Writer | Process | Path | |---|---|---| | Root pass | `carlos adopt` and `carlos adopt --config-only` (`carlos-adopt.service`, `carlos-config-sync.service`), as root | `host/agent.go:5506` `SyncUnits(... configAckFunc(ctx, store, "adopt") ...)` → `sync.go` `finishHost :791`, ack built at `:797`. Covers `carlos-app@` unit routes only. | | Agent | `carlos agent` (`carlos-edge.service`, `User=carlos`) | `agent.go:1684` `SyncExec` → `syncExecHostClaimed`, ack at `syncexec.go:1505` (socket-exec and tcp-exec-file shapes) | | Agent, scheduler armed | same | `host/rollout.go:476` `m.DeferAck(configAckWriter(...))` holds the ack until the revision is active (see 5) | | Moves | moves code | `renderheld.go:136` | `configAckFunc` (`agent.go:1795`) stamps `Box = BoxLabel()`. Write errors are only logged ("best-effort telemetry"). **When:** only after the file actually changed and a restart was attempted. The "up to date" early returns write nothing (`sync.go:619-623, :635`; `syncexec.go` `if !r.changed`). Two other branches also write no ack: - the exec "manifest absent, removed its config file" branch; - the stamped named-unit path. `unitsync.go` has no ack anywhere, and `prepareStamped`/`applyStamped` never build one. **Field caveats:** - In an ordinary sync, `Restarted` means the restart call returned nil; the process isn't checked afterwards. - The socket-exec bounce result is carried into the ack, but the tcp-exec-file shape always leaves `Restarted` and `RestartError` empty. - Ordinary sync acks carry no default/environment bundle etags and no hash of the file. Only `RenderHeld` acks do. **`InstanceConfigETag` / `InstanceConfigDelivery` (`:164`):** the field is the etag of `apps/&lt;acct&gt;/&lt;app&gt;/instances-config/&lt;host&gt;.json` that the pass merged in. The function compares it with the etag the caller's own write returned: - nil ack → `not-yet-delivered` - `Schema &lt; 1` → `unknown-agent` - equal → `delivered` - otherwise → `stale` It covers the per-instance overlay only. An edit to the default or environment bundle can't be detected as stale this way. **Who reads acks:** - `console/relayops.go:1366` `relayConfigAcks` → `apirelay.go:327` `relayMatchingAck`, `:415-433` (`carlos relay status` delivery text; matches only on exact `RelaySuffixes`). - `host/movesoffline_land.go:938` (the moves "T3" check: `MoveOp` plus `FileSHA256`). - `host/movesrollback.go:1582`. - `host/movesfinal.go:662` copies the ack into the move report. - `LatestConfigAck` (`:186`) and `InstanceConfigDelivery` have no production callers, only tests. ## 2. RenderHeld and CheckRenderedIdentity **`renderedIdentity` (`claimsync.go:26`):** `"sha256:&lt;hex of rendered bytes&gt;;default=%t;environment=%t;instance=%t"`. It's a hash of the rendered file plus three "layer present" flags, not etags. Every writer computes it: `syncHostClaimed`, `renderExecConfig`, and the stamped path through `prepareHost`. **`CheckRenderedIdentity` (`claim_identity.go:13`):** read-only. It re-merges with `LoadMergedHostVersions` and re-renders: `RenderEnv`, plus `applyAgentVars` for a unit route or `execAddrConfigHeader` for an addr route. It then compares the result with a `hostwrite.Identity`. Its only caller is `host/claimproduction.go:308` `claimInputPolicy` (serving host-claim: "does this Work still name current inputs"). It answers "the bucket still renders to these bytes", not "the process has them". **`RenderHeld` (`renderheld.go:52`, variants `:68/:89/:109`):** for move-held exec rows only (`heldRenderable :152` refuses unit and `BackingUnit` rows). It records `FileSHA256`, `BundleETags` and `OverlayETag` in the ack on every call, changed or not. This is the only place the default/environment etags plus a file hash are written off-box. ## 3. Config PUT restart notice `console/apiconfig.go:613` → `configRestartNotice :745` opens the console's own box registry (one box only; the #145 blind spot). It calls `AwaitingRestart` (`syncexec.go:1163`) and returns `{Known, Hosts, Unresolved, Undelivered, Blocked}`. The answer comes only from registry rows plus bucket bundles (default, environment, overlay, `exec_delivery`). It reads no acks, no `named-units.json`, no systemd and no files. - `Blocked` comes from `BlockedStamps` (`:1106`), the rails knowable from the registry alone: shape, unit name, hostname, one route per unit. - A stamped route that passes those rails is assumed delivered by the root pass "within seconds" (`~:1268-1285`). So a #516 "not declared" route shows up as nothing to report. - `Hosts` are opted-in TCP-addr routes nobody bounces. `Undelivered` are un-opted addr routes. - The CLI's local path does the same (`appconfig_cli.go:78`, `localRestartAnswer`). ## 4. Silent blocks and skips (all `fmt.Printf` to that unit's journal) **Root pass, `unitsync.go`:** - Plan refusals: `:165` (declaration file unreadable), `:169` (`"not declared: ... Declare the unit ... in &lt;NamedUnitsPath&gt;"`), `:195/:204/:206` (probe, not loaded, alias), `:219`, `:225` (unmanaged `EnvironmentFiles`). - In `prepareStamped`: `:264` `"delivery blocked: not declared"`, `:276`, `:285`, `:289`, `:294`, `:299`, plus the not-ours drop-in. - In `applyStamped`: `:433`, `:447/:484` (`EnvironmentFiles` mismatch), `:456` (restart refused, not declared), restart failure "still owed". **Root pass, `sync.go` dispatch:** - `~:232` declarations unreadable, nothing delivered. - `~:256` declared-host refusal. - `~:358` "stamped — no unit ops, skipped". - `~:362`. - `~:382` exec-backed routes are handed to the agent. **Agent, `syncexec.go`:** - `:250/:293` `exec_delivery` unresolved. - `:309` unknown `exec_delivery` value. - `:592` namespace clash. - `:664` instance directory not made yet. - `:727` `exec_delivery` off but a stale file exists. - `:745`. - Un-opted addr routes are skipped with no line at all, unless a stale file exists. **Off-box:** nothing. No bucket object, registry column or ack records any blocked or skipped state. The only owner-visible echo is `AwaitingRestart`'s `Blocked`/`Undelivered` in the PUT response, which is computed from the registry rail only and not stored. Pending-restart markers are local files under the drop-in root. ## 5. Ties to a running process `ConfigAck` has none: no pid, `InvocationID`, unit start time or restart count. The root unit path uses `ops.Restart` (`systemctl restart`) and captures nothing. The `carlos-app@` path uses try-restart and only knows nil or error. The closest existing link is the armed rollout scheduler: - `syncexec.go:1464/:1491` call `Delivered(host, id.Config)`, which goes to `rollout.Manager.ConfigDelivered`. - The activator's `WakePlan.ConfigRev` (`activator/wakeplan.go:58`) and `GenEvent.ConfigRev` (`:219`), plus `Attempt{Build, ConfigRev}` (`activator/swap.go:45-56`), tag a generation with the rendered identity. - `configTrack.activate` (`rollout/config.go:62`, `manager.go:1542`) releases the held ack only when a generation started with exactly that revision. But it's all in memory, exec routes only, and the ack written afterwards doesn't record the revision or the generation. `instancectl` reads `InvocationID` and `MainPID` (`cmd.go:113`, `claimexec.go:157`, `server.go:869`), but only for start, claim and exec checks; nothing links them to config. There is also nothing linking an ack to a release build (#490). `adopt` runs config sync before release adoption (`agent.go:~5496`), but no record says which build ran with which config. ## 6. Packages part 3 would touch (census scope) All of these are root-binary packages: - **Direct root imports:** `internal/appconfig`, `internal/console`, `internal/host`, `internal/registry`, `internal/release`, `internal/activator`, `internal/relay`, `internal/fleetapi`, `internal/hostclaim`. - **Reached through `internal/host`:** `internal/rollout`, `internal/hostwrite`, `internal/instancectl`, `internal/hostbox`. - **Root package itself:** `appconfig_cli.go`, `apimode.go`. - **Explicit census scope:** `internal/host/units`, which matters if the root-pass or config-sync units change. The most likely to change are `appconfig` (ack shape, unit-path ack, blocked record), `host` (writers), `console` plus the root CLI (reader and owner surface), and `rollout`/`activator` (tying the revision to a generation). I read imports rather than running `go list`. ## Summary **Build from today:** 1. `renderedIdentity` (file hash plus layer flags) is computed by every writer. 2. `CheckRenderedIdentity` can recompute "what the bucket says now" read-only. 3. `ConfigAck` at `control/config-ack/&lt;box&gt;/&lt;host&gt;.json` already exists, is owner-readable through the console, and carries schema versioning. 4. `InstanceConfigDelivery` already has the delivered / stale / unknown-agent / not-yet-delivered vocabulary. 5. `RenderHeld` acks already carry `FileSHA256` plus `BundleETags`, which is the pattern ordinary sync acks lack. 6. The armed scheduler already holds an ack until a generation started with that rendered revision. **Missing:** 1. The stamped named-unit path writes no ack at all, so #516 is invisible off-box. 2. Ordinary acks carry neither the rendered identity nor the default/environment etags, so only overlay staleness is detectable. 3. Acks are change-only. "No ack" can't be told apart from "blocked", and a block never overwrites an older successful ack. 4. Blocked, skipped and refused states (not declared, unmanaged env files, `exec_delivery` off, unit not loaded, `EnvironmentFiles` drift) exist only as journal lines on the box. 5. The restart notice reads neither acks nor declarations, and sees only the console's own box. 6. Nothing ties an ack to a process (`InvocationID`, `MainPID`, start time) or to a release build (#490). `ConfigRev` lives only in memory in the activator and rollout. 7. `LatestConfigAck` and `InstanceConfigDelivery` are unused in production.</result> <usage><subagent_tokens>110673</subagent_tokens><tool_uses>35</tool_uses><duration_ms>261035</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>a0f3eaac8eaa12178</task-id> <tool-use-id>toolu_01QFAwFMRhTws9M5PqbHmCrB</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/4c585ebb-d953-40f5-8f58-fbd337832024/tasks/a0f3eaac8eaa12178.output</output-file> <status>completed</status> <summary>Agent "Builder check on #522 spec" 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>I'd need five questions answered before planning this well, plus one the spec already flags for review. Plan 1 (versions, digests, conditional writes, receipts) is clear enough to plan as written. All but the last question concern Plan 2, and the top two affect cost and scope. 1. **Where should the root pass remember the last ack it wrote?** §5.3 says the writer keeps it in memory and reads the bucket "only after a restart of the writer". But the root pass that writes acks for unit and named-unit routes is a oneshot process: `carlos adopt`, run hourly by `carlos-adopt.timer` and on request by `carlos-config-sync.service` (`internal/host/units/`). Every run is a restart, so each pass would read the bucket once per unit route. That breaks the "no new per-box bucket traffic" promise. - **Why it matters:** the options are a root-owned cache file on disk (new root state, which goes into the census section), accepting one read per route per pass, or a different way to detect change. Each gives a different plan and a different cost. 2. **Are customer-fleet boxes in scope for Plan 2?** Fleet boxes reach the bucket through the edge's store door. Its write rule (`aclWrite`, `internal/edge/storedoor.go:644`) allows only `fleets/&lt;fleet&gt;/**` and the app log, error and analytics families. Writes to `control/config-ack/...` are refused, and `configAckFunc` only logs the failure. - **Why it matters:** if fleet boxes are in scope, Plan 2 needs a new ack location, a change to the edge door's rules, and console reads from two places. If not, every fleet route reads `unknown` forever. That decides whether Oficina's six apps get proof of delivery at all, so I'd also need to know where those apps run. 3. **What should a sleeping (scale-to-zero) route, or one waiting for a restart, say?** - The ack states have no "hibernating" entry. - The verdict table has no row for an ack in `restart-pending`, or for the `delivered (file)` answer in §5.5. - The root pass can't see a wake, because the activator starts the unit and the root pass only runs hourly or on request. - As written, a sleeping route whose file is current turns `stale` after 2 minutes, and `--wait` times out on it. Related to this: - §5.5 sends any changed invocation to `restart-pending`. That would include a deploy, a wake or a crash restart, even when the new process started after the file was written, so it really does have the config. - Because `process` is part of the change test, every wake would also cost a bucket write. - **Why it matters:** this sets the core verdict logic, which states end `--wait`, and the write cost for apps that sleep. 4. **Who owns the ack object during a move?** `WriteConfigAck`'s comment says nothing else writes that key, but other code does: - `RenderHeld` writes the same key with `MoveOp` and `FileSHA256`. - Landing a move waits for the ack to name the move (`movesoffline_land.go:938`). - The source's final step copies the ack and then deletes it (`movesfinal.go:664`). - Rollback reads it (`movesrollback.go:1582`). Once the sync pass writes on refusals and on any state change, it could overwrite a held render's ack and stall a move. Another writer could also make its remembered last ack wrong. - **Why it matters:** does the new writer skip held routes, keep the move fields, or should held renders write schema 2 as well? 5. **When an ack moves to `blocked` after an earlier success, should it keep a record of the last delivery?** `carlos relay status` (`relayMatchingAck`, `apirelay.go`) reads `RelaySuffixes` and `RestartError` from the latest ack. A blocked ack that replaces the delivered one drops those fields, so relay status would fall back to "written, awaiting delivery" while the process is still running the old config. - **Why it matters:** the answer decides whether schema 2 needs a "last delivered" section (versions, process, relay suffixes) alongside the current state, and whether relay status is allowed to go backwards. 6. **Should `config/effective` and `config/delivery` be Admin-only?** §4.8 flags this as the one open question for review. It only changes how the two doors are registered, so it matters least, but it's a ruling rather than a builder call. I'd fix these spec errors myself; they don't need answers: - `LoadMergedHostVersions` returns etags, not raw bytes, and the box sync sweeps deliberately don't use it (see its comment in `instances.go`). Both `config/effective` and the box-side versions need a new loader that returns each layer's bytes. - The deferred ack is at `internal/host/rollout.go:476`, not `rollout.go`. I checked all of this against the code in the worktree without editing anything, and created no scratch files.</result> <usage><subagent_tokens>129873</subagent_tokens><tool_uses>35</tool_uses><duration_ms>365251</duration_ms></usage> </task-notification>

Human

Go

Human

<task-notification> <task-id>b3835gmbd</task-id> <tool-use-id>toolu_015Sh8Ez4SkrxUtQa9xDttKY</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/4c585ebb-d953-40f5-8f58-fbd337832024/tasks/b3835gmbd.output</output-file> <status>completed</status> <summary>Background command "Wait for Astra round-1 review to finish" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>bvjgs9uvf</task-id> <tool-use-id>toolu_018QdCPriZfYiyVfH5zgXugW</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/4c585ebb-d953-40f5-8f58-fbd337832024/tasks/bvjgs9uvf.output</output-file> <status>completed</status> <summary>Background command "Wait for Astra round-2 review to finish" completed (exit code 0)</summary> </task-notification>

Human

<paseo-system version="1" kind="agent-message" source-agent-id="0f39318c-0ba2-460c-9717-b97d0d681e91" message-id="3c6929d1-8886-4a8a-acee-c8daa4d1b51d"> Release heads-up from platform-6e: I&apos;m cutting v0.33.9 from main f54ed7a2 (dev, then flagship) in about 15 minutes, so I can switch on domain buying on dev. Since v0.33.8 it carries 5394c7f9 (#432 first heartbeat fix), adda5541 (#519 a post-activation fleet recorded at its first box) and f54ed7a2 (the domain zone host&apos;s own AWS credentials, dormant). If one of these is yours and needs holding, a flagship step or a specific check, or if a dev roll in the next hour would break a drill you&apos;re running, reply to platform-6e (paseo send 0f39318c) within 15 minutes. If it isn&apos;t yours, no reply needed. </paseo-system>

Human

<paseo-system version="1" kind="agent-message" source-agent-id="0f39318c-0ba2-460c-9717-b97d0d681e91" message-id="3602408d-bd9a-42ad-839b-6a7e687aa05f"> From platform-6e: the dev console box sophie (i-05498eada6f0afd23, kass) is unreachable since about 06:41Z. TLS to platform.dev.carlosframework.com times out, and SSM commands sit Pending. The serial console shows the kernel OOM-killed carlos-edge&apos;s supervise process, which held 452 MB RSS plus about 370 MB swap on a 1 GB t4g.micro. CPU climbed from 06:21Z. There are two stuck SSM commands at 06:46:21Z and 06:46:43Z (&apos;classic-inspect&apos;), which aren&apos;t mine. Is this yours, and is anyone already on it? I&apos;m not restarting anything. Reply to platform-6e (paseo send 0f39318c). </paseo-system>

Human

<task-notification> <task-id>buxrdnpe4</task-id> <tool-use-id>toolu_01VjxHtRQYMQ6tQQMKMLHZDY</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/4c585ebb-d953-40f5-8f58-fbd337832024/tasks/buxrdnpe4.output</output-file> <status>completed</status> <summary>Background command "Wait for Astra round-3 review to finish" completed (exit code 0)</summary> </task-notification>

Human

Subagents. We have plenty of Claude and Astra now.