carlos / platform Public

Clone
git clone https://amadan.net/carlos/platform

Plain git — no account needed to clone.

Download

Download this file

1| Prior finding | Disposition at `d70f1109` |
2|---|---|
3| R1-1 | **Resolved for the reported attack.** Protected socket resolution and bearer authentication replace uid-only authorization. Retain the §5.4 ruling. |
4| R1-2 | **Resolved.** Log sockets move outside tenant mounts. |
5| R1-3 | **Resolved for the reported symlink attacks.** `nosymfollow`, confined opens and exclusive temporary files address them. The new recovery marker introduces separate authority exposure, R2-1. |
6| R1-4 | **Partially resolved.** EOF no longer means exit, and `Exited()` is nonblocking. Completion evidence and another blocking call under the activator mutex remain defective, R2-4–R2-6. |
7| R1-5 | **Partially resolved.** Timeout, cancellation and stop-before-cleanup are specified. Safe completion depends on R2-4/R2-5; seed preparation also regresses, R2-12. |
8| R1-6 | **Resolved.** Each role has its own log listener. |
9| R1-7 | **Resolved.** `BindsTo=` removes dependency-propagated restarts; the sweep includes activating units and pending jobs. |
10| R1-8 | **Partially resolved.** All roles share the tier. Whole-family OOM behavior remains incomplete: a sidecar OOM can leave the main process running, whereas the previous shared `memory.oom.group=1` killed both. |
11| R1-9 | **Resolved for per-host metrics.** Hierarchy, aggregation and published key are corrected. Moving the edge creates another discovery omission, R2-13. |
12| R1-10 | **Resolved.** The arbitrary split is withdrawn and the shared outer wall retained. |
13| R1-11 | **Resolved.** Migration excludes externally supervised and tunnel/unit-backed routes. |
14| R1-12 | **Partially resolved.** The fence covers the named consumers, but recovery mishandles optional artifacts, committed CAS operations and already-nested rows, R2-7. |
15| R1-13 | **Partially resolved.** Reverse migration replaces the incorrect restore story. The actual downgrade and recovery execution paths remain uncovered, R2-9. |
16| R1-14 | **Resolved.** Socket activation, installer changes and active-state checks are explicitly required. The new mount introduces a separate boot failure, R2-2. |
17| R1-15 | **Partially resolved.** The unsafe fallback is withdrawn. The replacement probe can report readiness without proving IMDS enforcement, R2-14. |
18| R1-16 | **Resolved.** Last-value-wins deduplication and an executed-child test are specified. |
19| R1-17 | **Resolved.** Nested discovery, registry filtering and hibernation exclusions are accurately described. |
20| R1-18 | **Partially resolved.** Remote status and CLI documentation are specified. Repair still uses the local-only `carlos route`; its prescribed `--db` flag does not exist ([cli.go:469](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/isolated-exec-spec/cli.go:469)). Pre-roll inspection also depends on a snapshot field that old boxes cannot publish. Define the remote repair operation and compatibility rollout. |
21| R1-19 | **Resolved.** The unsupported `UnitBackend` claim is removed. |
22
23**R2-1 — P1 — §§5.4, 3.1, 8.1: Retain the authenticated control service, but move authoritative recovery metadata outside tenant mounts.**
24
25The new `.migrating` file lives in the tenant’s writable directory. Recovery explicitly repeats filesystem operations using the paths recorded in that file. A tenant can forge a marker directing the agent to move a sibling’s database or env file. These are ordinary paths: `nosymfollow` does not prevent the operation. A later CAS refusal is too late because renames happen first.
26
27Evidence: [spec:242](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/isolated-exec-spec/docs/superpowers/specs/2026-09-11-isolated-exec-design.md:242), [spec:1008](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/isolated-exec-spec/docs/superpowers/specs/2026-09-11-isolated-exec-design.md:1008), [spec:1022](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/isolated-exec-spec/docs/superpowers/specs/2026-09-11-isolated-exec-design.md:1022).
28
29**Correction:** keep the authoritative transaction record outside every tenant mount. Treat a tenant-local marker only as an untrusted refusal signal. Validate every source and destination against trusted host-specific metadata before moving anything. Test a forged sibling path and assert that the victim remains untouched.
30
31**R2-2 — P1 — §3.2: The socket-tree mount creates a boot ordering cycle.**
32
33`run-carlos-instances.mount` declares `After=systemd-tmpfiles-setup.service`. A local mount receives a default ordering before `local-fs.target`, while tmpfiles starts after that target. The resulting cycle is:
34
35`mount → local-fs.target → tmpfiles → mount`
36
37systemd must break the boot transaction. Dropping the required mount blocks the control service and tenant starts. Installing the mount on an already-booted box does not exercise this failure.
38
39Evidence: [spec:331](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/isolated-exec-spec/docs/superpowers/specs/2026-09-11-isolated-exec-design.md:331), [systemd mount dependencies](https://raw.githubusercontent.com/systemd/systemd/v257/src/core/mount.c), [tmpfiles unit](https://raw.githubusercontent.com/systemd/systemd/v257/units/systemd-tmpfiles-setup.service).
40
41**Correction:** specify an acyclic directory-preparation and mount sequence, including shutdown ordering. Verify a cold boot with both mounts and the readiness probe.
42
43**R2-3 — P1 — §5.3: Moving property-setting to the slice makes the first service start fail at `reset-failed`.**
44
45The revised sequence sets properties on the host **slice**, then resets the **service**, then starts it. The first operation loads only the slice. systemd’s `ResetFailedUnit` deliberately does not load an unknown service, so a never-loaded template instance can fail before reaching `start`. The specified error handling returns 502.
46
47Evidence: [spec:661](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/isolated-exec-spec/docs/superpowers/specs/2026-09-11-isolated-exec-design.md:661); [`ResetFailedUnit` versus `SetUnitProperties`](https://raw.githubusercontent.com/systemd/systemd/v257/src/core/dbus-manager.c), lines 781–788.
48
49**Correction:** load and retain the service before resetting it, or tolerate precisely the missing-unit reset outcome. Test a first wake with neither the service nor slice previously loaded.
50
51**R2-4 — P1 — §§5.3, 6.5: Invocation polling can lose the completion record permanently.**
52
53systemd unloads unreferenced inactive units and discards their execution state. Nothing specified pins these services or retains their results. A clean exit can disappear before the next `show`, leaving the original invocation permanently unmatched and `done` open. Successful seeds are particularly exposed: `/seed` reads their invocation only after the oneshot finishes.
54
55A replacement invocation has the same unresolved outcome. The observer ignores it forever; `Restart=no` does not prohibit an explicit restart by another authorized actor.
56
57Evidence: [spec:862](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/isolated-exec-spec/docs/superpowers/specs/2026-09-11-isolated-exec-design.md:862), [systemd unit garbage collection](https://raw.githubusercontent.com/systemd/systemd/v257/man/systemd.unit.xml), [unit reference operations](https://raw.githubusercontent.com/systemd/systemd/v257/src/core/dbus-manager.c).
58
59**Correction:** retain invocation identity and completion evidence until the agent acknowledges them, using a persistent unit reference or broker-owned records. Define recovery for a replaced invocation. Test immediate successful exit, delayed observation and an external restart.
60
61**R2-5 — P1 — §6.5: `failed` does not prove that every writer has stopped.**
62
63The fallback poll accepts a matching invocation in `inactive` or `failed` without requiring an empty cgroup. systemd explicitly enters failed state when processes remain after its final SIGKILL timeout. The proposed observer can therefore close `done`, permitting seed cleanup or lease release while a process remains.
64
65Evidence: [spec:869](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/isolated-exec-spec/docs/superpowers/specs/2026-09-11-isolated-exec-design.md:869); [systemd service implementation](https://raw.githubusercontent.com/systemd/systemd/v257/src/core/service.c), lines 4020–4022.
66
67**Correction:** require proven cgroup emptiness as a completion condition, including on the fallback path. Define what a vanished cgroup proves and keep uncertainty from authorizing cleanup or lease release.
68
69**R2-6 — P1 — §§6, 6.2: Sidecar restart introduces blocking systemd work under the global activator mutex.**
70
71`sweepOnce` calls `StartSidecar(context.Background(), ...)` while holding `a.mu`. Its existing justification is that spawning is quick. The replacement performs synchronous HTTP and systemctl operations, with no specified deadline. A stalled control operation now prevents unrelated hosts from waking or stopping.
72
73Making `Exited()` nonblocking does not address this second call site, and the statement that `activator.go` remains unchanged is untenable.
74
75Evidence: [activator.go:1170](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/isolated-exec-spec/internal/activator/activator.go:1170), [activator.go:1196](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/isolated-exec-spec/internal/activator/activator.go:1196), [spec:812](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/isolated-exec-spec/docs/superpowers/specs/2026-09-11-isolated-exec-design.md:812).
76
77**Correction:** reserve the sidecar start under the mutex, perform bounded control work outside it, then reconcile completion with any intervening stop. Test a stalled sidecar start while another host wakes and stops.
78
79**R2-7 — P1 — §8.1: The new recovery algorithm cannot complete common restart states.**
80
81Three specified branches fail:
82
83- Migration moves only artifacts that exist, but recovery treats an artifact absent at both source and destination as an error. Ordinary hosts lack several optional artifacts, including sidecar env and quarantined DB files.
84- A crash after the row CAS but before marker removal retries the original CAS against an already-updated row, producing a permanent conflict.
85- A clean subsequent startup sends an already-nested row through the “not flat defaults” branch into the hand-set-path refusal.
86
87Evidence: [spec:1001](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/isolated-exec-spec/docs/superpowers/specs/2026-09-11-isolated-exec-design.md:1001), [spec:1013](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/isolated-exec-spec/docs/superpowers/specs/2026-09-11-isolated-exec-design.md:1013), [spec:1022](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/isolated-exec-spec/docs/superpowers/specs/2026-09-11-isolated-exec-design.md:1022).
88
89**Correction:** record artifact presence and migration direction, recognize a committed destination row, and classify settled nested rows before testing legacy defaults. Test every crash boundary and a second clean agent restart.
90
91**R2-8 — P1 — §8.1: Migration ignores existing flat-file ownership collisions.**
92
93For routes `x` and `x.config`, `/data/x.config.env` belongs to the latter’s instance env. Config sync already refuses to write that pathname for `x`. Migration nevertheless moves every existing `<host>.config.env` into that host’s directory. Processing `x` first places the sibling’s credentials in `x`’s config layer and removes them from their owner.
94
95Preserving the reaper’s ambiguity guard does not protect migration.
96
97Evidence: [syncexec.go:389](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/isolated-exec-spec/internal/appconfig/syncexec.go:389), [spec:1013](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/isolated-exec-spec/docs/superpowers/specs/2026-09-11-isolated-exec-design.md:1013).
98
99**Correction:** preflight ownership of every source pathname against the complete registry before renaming. Refuse ambiguous transactions or preserve the established owner. Apply equivalent checks when reversing into a flat directory containing excluded routes.
100
101**R2-9 — P1 — §8.3: The first upgrade’s rollback executes the old binary, which cannot invoke the new reverse migration.**
102
103The installed binary starts `system apply`. That running process installs the candidate, restarts the edge and gates it. If the new edge migrates data and then fails its gate, the **old process** executes its existing `rollback` → `restoreFiles`, restoring the old executable without reversing the layout. Boot recovery deliberately executes `carlos.prev` when an update journal exists.
104
105Furthermore, `carlos system rollback` repoints a channel through the console API. Its resulting downgrade follows ordinary box-side installation; adding a leg only to a local failure handler does not cover it.
106
107Evidence: [systemapply.go:366](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/isolated-exec-spec/internal/host/systemapply.go:366), [systemapply.go:743](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/isolated-exec-spec/internal/host/systemapply.go:743), [recovery unit:17](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/isolated-exec-spec/internal/host/units/carlos-system-recover.service:17), [system.go:466](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/isolated-exec-spec/system.go:466).
108
109**Correction:** specify a compatibility release or an explicit transition protocol understood by the updater and recovery executable before enabling migration. Cover channel downgrade, failed-gate rollback and interrupted recovery. Reverse migration must also quiesce activation and replication, rather than merely stop tenant units.
110
111**R2-10 — P2 — §§3.1, 6.1, 9: The new socket directories exclude enrolled cross-user consumers.**
112
113Existing instances deliberately expose their listening sockets to members of `carlos-sockets`: `/run/carlos` supplies the inherited group, and the backend normalizes sockets to 0660. The new layout assigns `carlos:carlos` to the parent and 0700 to each host directory. An enrolled router cannot traverse the host directory; preserving the socket chmod does not help.
114
115Evidence: [bootstrap.go:41](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/isolated-exec-spec/internal/host/bootstrap.go:41), [backend_exec.go:744](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/isolated-exec-spec/internal/activator/backend_exec.go:744), [spec:244](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/isolated-exec-spec/docs/superpowers/specs/2026-09-11-isolated-exec-design.md:244).
116
117**Correction:** preserve the explicit socket-consumer contract through directory traversal and socket-group permissions, while retaining tenant namespace isolation. Test a migrated instance through an enrolled non-`carlos` router.
118
119**R2-11 — P2 — §§4.3, 6.6: The slice configuration drops the existing swap ceiling.**
120
121The current cgroup code sets `memory.swap.max` equal to the memory tier. Its comment records a real allocator escaping the intended limit through zram before that setting was added. The proposed slice receives only `MemoryMax` and `MemoryHigh`.
122
123Evidence: [cgroup.go:313](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/isolated-exec-spec/internal/cgroup/cgroup.go:313), [spec:578](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/isolated-exec-spec/docs/superpowers/specs/2026-09-11-isolated-exec-design.md:578), [systemd `MemorySwapMax` documentation](https://raw.githubusercontent.com/systemd/systemd/v257/man/systemd.resource-control.xml).
124
125**Correction:** set `MemorySwapMax` to the tier limit on the shared host slice. Verify the delivered limit under swap pressure.
126
127**R2-12 — P2 — §§6.1–6.2: First-boot seeds lose admin-token preparation.**
128
129The new preparation sequence calls `EnsureAdminToken` only for `run`. Today `Seed` explicitly creates the token before reading its environment so that initialization receives the same credential as the serving process. Under the proposed sequence, the first seed runs before that credential exists.
130
131Evidence: [backend_exec.go:346](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/isolated-exec-spec/internal/activator/backend_exec.go:346), [spec:733](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/isolated-exec-spec/docs/superpowers/specs/2026-09-11-isolated-exec-design.md:733).
132
133**Correction:** prepare the admin token and merged environment for both seed and run, retaining the seed’s removal of control-channel variables. Verify that seed and subsequent run receive the same token.
134
135**R2-13 — P2 — §§4.3, 6.6, 9: Moving the edge into `carlos.slice` removes it from metrics discovery.**
136
137Current platform-unit discovery scans `system.slice` and its immediate template slices. The new scan root covers `carlos-instances.slice`, but the relocated `carlos-edge.service` is its sibling. Neither scan finds the edge.
138
139The prior accounting design also defines the edge reading as the hierarchical total including children. Relocating discovery alone would change that meaning.
140
141Evidence: [metrics_probes.go:49](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/isolated-exec-spec/internal/host/metrics_probes.go:49), [metrics_loop.go:659](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/isolated-exec-spec/internal/host/metrics_loop.go:659), [accounting design §4](/home/paulca/github.com/carlosframework/platform-infrastructure/platform-design/superpowers/specs/2026-08-07-exec-child-accounting-design.md), [spec:569](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/isolated-exec-spec/docs/superpowers/specs/2026-09-11-isolated-exec-design.md:569).
142
143**Correction:** explicitly discover the relocated edge and define how the previous aggregate reading is preserved or replaced. Test platform metrics as well as member per-host metrics.
144
145**R2-14 — P2 — §8.4: The readiness probe can pass without proving IMDS isolation.**
146
147The probe accepts any failed IPv4 connection to IMDS. A routing failure or timeout also satisfies that assertion when the systemd IP filter is ineffective. It never tests the separately denied IPv6 metadata address. systemd documents that IP filtering depends on kernel/BPF support.
148
149Thus the recorded `ready` verdict is stronger than the test establishes.
150
151Evidence: [spec:1079](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/isolated-exec-spec/docs/superpowers/specs/2026-09-11-isolated-exec-design.md:1079), [systemd IP filtering documentation](https://raw.githubusercontent.com/systemd/systemd/v257/man/systemd.resource-control.xml).
152
153**Correction:** distinguish enforced denial from unrelated network failure, test both address families, and keep unavailable evidence from producing `ready`. Include a negative test where filtering is disabled while the destination is unreachable.
154
155**Verdict: request changes.**