carlos / platform Public

docs: 2b-2 ledger through Task 4 and Task 3 round 2

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev ad28b503d6fb782ec9cf37d3c2083c9e5631449a parent b454d88
1 file changed, +145 −0
  • docs/superpowers/notes/managed-fleets-2b2-ledger.md +145 −0

CI failed — run details

diff --git a/docs/superpowers/notes/managed-fleets-2b2-ledger.md b/docs/superpowers/notes/managed-fleets-2b2-ledger.md
index c2291f835..0c6a1f0c9 100644
--- a/docs/superpowers/notes/managed-fleets-2b2-ledger.md
+++ b/docs/superpowers/notes/managed-fleets-2b2-ledger.md
@@ -72,3 +72,148 @@ image's own sources they fail closed (no automatic package updates on managed bo
sources on the HTTPS mirror, an unattended-upgrades policy and needrestart behaviour (cf. #359). The drill card records
the effective sources and whether needrestart is installed — cost if wrong: drill boxes go without OS security updates
for the drill's ≤4 h.
+Task 1: Astra R1 NOT READY (P1-1 seed-door semaphore held indefinitely by stalled streams, no stream deadline;
+P2-1 verified seed not fsynced/dir-fsynced before the unit is enabled; P2-2 `-updates` rendered as a component, not a
+suite). Fix round 1 dispatched to the Task 1 implementer (concurrent with Task 2; explicit-path staging only).
+Task 1: fix round 1 committed 64f7b619 (5-min stream deadline incl. store reads and socket writes; one stream per box;
+fsynced seed + BootDir before unit install; separate base/updates/security sources). Astra R2 READY AFTER FIXES: all R1
+resolved, no P1; R2 P2-1 a deadline-truncated 200 (curl exit 18) is not retried by `curl --retry`, bootstrap dies.
+Ruling: stop at R2 (no P1, review rule); R2 P2-1 fixed without another round by a bounded script retry loop (403 stays
+terminal) — plan Step 3 item 6's `curl --retry 20` is amended accordingly — cost if wrong: the loop is unreviewed by a
+third round; Task 2's Astra + Fable review receives it as context.
+Task 1: R2 P2-1 fixed 49e78113 (script-owned bounded retry loop, 403 terminal, ≤600 s / token expiry; real-curl
+truncated-then-complete and refused witnesses; 2 mutations caught). Task 1: complete (6b7b0f81, 64f7b619, 49e78113);
+its final seam is reviewed again as context in Task 2's Astra + Fable review.
+Task 2: implemented 413f45cd (DONE_WITH_CONCERNS: no carlos.prev/applied.json written by the stable install — check
+first update/rollback on a managed box; cloud-init may rewrite the consumed token on later boots, scrub only on first;
+census overlay re-proposed at 49e78113 — unchanged, provision census tests pass). Deviations: DecodeBootInput for the
+scrubbed boot-input; stricter reply format checks; 500/502/504 retried like transport errors, other non-200 terminal;
+commit by rename (no second secret copy); extra injected seams. 10/10 mutations caught. Astra R1 + Fable R1 running.
+Task 2: Astra R1 NOT READY (P1-1 EXDEV install path: dest dir not synced before source shred, and a half-shredded
+source can overwrite a valid destination on restart → committed credentials lost after the token is consumed;
+P2-1 stable binary chmod 0755 not fsynced before the complete marker; P2-2 scrub not repeated after cloud-init rewrites
+user data (obj.pkl deletion triggers rediscovery) and files >16 MiB treated as token-free). Astra rules concern (a)
+fine: decidePrev/notePrev handle absent carlos.prev/applied.json. Waiting for Fable R1.
+Task 2: Fable R1 READY (8 P3: one-shot scrub vs cloud-init rewrites; post drops transport error; Expires wall-clock;
+IMDS barrier checks table not rules; spurious enrol_failed on SIGTERM; partial staging survives a firewall-less boot;
+test gaps; /dev/console without O_NONBLOCK). Fable concurs on (a); on (b) cloud-init rewrites user data every boot.
+Ruling: T2-F1 Astra P1-1 fixed by refusing (before the trade, token unspent) unless staging and every destination are
+on one filesystem; install by rename only, idempotent on restart — cost if wrong: an image with a split /var or /etc
+never enrols (bootstrap_failed, deadline cleanup); the drill card records the image's mount layout.
+Ruling: T2-F2 scrub repeats on every boot (best-effort on the complete path, fatal on first boot); obj.pkl is kept so
+cloud-init does not rediscover; the boot unit orders after cloud-init's user-data write; >16 MiB files are scanned by
+streaming. Cheap Fable P3s folded in (console O_NONBLOCK, no enrol_failed on SIGTERM, transport error class, wrong
+component case). Remaining Fable P3s deferred: Expires wall-clock, IMDS rule-content check, partial staging on a
+firewall-less boot — cost if wrong: hygiene/diagnostic only.
+Task 2: fix round 1 dispatched to the Task 2 implementer (concurrent with Task 3).
+Task 2: fix round 1 committed f0801639 (same-fs refusal before trade and on resume; rename-only install, committed/
+wins; fsync after chmod; per-path rescrub every boot, obj.pkl kept (token remains in that root-only file, accepted);
+streaming scan; boot unit After=cloud-init.service cloud-init-network.service; Fable P3s folded). 4/4 mutations caught.
+Ruling: census for Tasks 2-3 is proposed once, after Task 3 commits, with joined claims (census-propose writes one
+whole-tree overlay; proposing mid-Task-3 would freeze uncommitted units) — provision census tests are knowingly red
+between f0801639 and that commit — cost if wrong: none (no CI tip is called green in between).
+Astra R2 (scoped) running on f0801639.
+Task 2: Astra R2 READY AFTER FIXES — R1 P1-1/P2-1/P2-2 resolved (P2-2 under T2-F2's accepted exceptions), no P1, no
+recurrence of the credential-recovery family; R2 P2-1 streaming-scan witnesses don't straddle read boundaries and the
+large clean file sits outside the scanned trees. Stop at R2; test-only fix dispatched without another round.
+Task 2: R2 P2-1 fixed 5d36d2ce (tests only: TestManagedBootScanStraddles across reads 1/2/17, clean large file inside a
+scanned tree; 2 mutations caught). Task 2: complete (413f45cd, f0801639, 5d36d2ce; Astra R2 READY AFTER FIXES → fixed,
+Fable R1 READY). Census for Tasks 2-3 pending the joint proposal.
+Ruling: Task 4 is built in parallel with Task 3 in a separate worktree (/home/paulca/.cache/managed-fleets-2b2-t4,
+branch managed-fleets-2b2-t4 from 5d36d2ce) and rebased onto Task 3 afterwards; census proposed jointly after the
+rebase — cost if wrong: rebase conflicts in agent.go/server.go (small, listed by the implementer).
+Task 3: implemented e9eb6519 + census 2f64ba10 (DONE_WITH_CONCERNS; 10/10 mutations caught; systemd-analyze verify used
+locally; joint census for Tasks 2-3 proposed, seal 2b890007…, record-write re-pins managedPublishFresh/Reconcile/
+ReconcileSidecars; provision census green). COPY: "box is joining its fleet" (instancectl/managedadmit.go:24);
+"waiting for the console's release signing key to publish the ready record" (managedworker.go:802).
+Ruling: T3-Q1 root-runner.py runs a fixed `x.test -test.run` with no env, so rootrunner-tagged tests drop the
+CARLOS_MANAGED_ROOT_TEST=1 requirement; the build tag gates them and each still FAILS (never skips) unless euid 0, a
+second real uid and (where needed) systemd PID 1 are present — cost if wrong: none (the tag never builds in normal CI).
+Ruling: T3-Q2 a BYO box whose /etc or /etc/carlos is not root-owned or is group/other-writable is treated as
+managed-with-error and refuses workload starts (fail closed, logged) — bootstrap sets root 0755 — cost if wrong: a
+hand-loosened BYO box stops starting workloads until its permissions are fixed. Reviewers asked to confirm.
+Ruling: T3-Q3 a workload template added by a later binary gets its drop-in at the next root pass, not during system
+apply — accepted for 2b-2, carried to the branch review list — cost if wrong: a new template could start un-gated on a
+joining box between apply and the next root pass (no such template exists).
+Note: TestPlan14ActivationNamedUnitPreflight and TestClaimReviewControlEntryKeepsServiceLifetime fail locally with
+"lifecycle provider unavailable" on main 97c70feb too (controller reproduced) — pre-existing local-environment
+failures, not 2b-2.
+Task 3: Astra R1 + Fable R1 running.
+Task 3: Astra R1 NOT READY — P1-1 lost ManagedAdmit reply / follow-up GET leaves the agent joining and re-reading
+ready.json despite durable root admission (C08 family); P1-2 admission drop-ins are not a hard prerequisite of unit
+publication (errors logged and continued; declaration read error → empty set; bootstrap.go and systemapply publish
+units without the target binary's conditions; seed's template list installed before the stable bootstrap) — T3-Q3
+REJECTED (rule-12 family); P1-3 declaredNamedUnits/ensureDropIn trust carlos-writable files/dirs (root-read family);
+P2-1 declared prefix names (carlos-.service, carlos-instance-.service) gate maintenance units; P2-2 root tests still need
+the env var and TestManagedControlCommitStrict lacks /run/carlos-control; P2-3 GROUP_ADMISSION refusal ignored once
+admitted; P2-4 restart-only/rollback witnesses bypass production composition; P3-1 boot pass may dispatch twice.
+T3-Q2 confirmed. CENSUS REJECT for internal/host + internal/managedboot envelopes (approve ., appconfig, instancectl,
+provision; record-write re-pins approved). Waiting for Fable R1.
+Task 3: Fable R1 READY AFTER FIXES (P2-1 root tests still need the env var; P2-2 managed-with-error identity →
+log.Fatalf crash-loops carlos-edge; P2-3 start-surface witnesses assert hooks not surfaces, named-unit recovery gate
+untested; P3s: ready read while root door down at arming, T3-Q3 cheap closure, double boot pass, door maps I/O to 403).
+Ruling: T3-Q3 REVERSED (Astra P1-2): on managed boxes every unit publication path installs and reloads the target unit
+set's admission drop-ins first and fails on any error; classification is default-gated (maintenance list is the
+allowlist) — cost if wrong: a maintenance unit missing from the allowlist stays gated until admission (fails safe).
+Ruling: T3-Q2 restated (Fable P2-2): managed-with-error identity and GROUP_ADMISSION on a managed box take one refused
+path — agent/edge/heartbeat/probes keep running, every admission predicate closed; no Fatalf — cost if wrong: a
+hand-loosened BYO box serves nothing until its /etc permissions are fixed (visible in logs).
+Ruling: ready GET only in a tick where root has just answered managed+not-admitted (Astra P1-1 + Fable P3).
+Task 3: fix round 1 dispatched (8 items) to the Task 3 implementer.
+Task 4: implemented a5c0afa4 on managed-fleets-2b2-t4 (DONE_WITH_CONCERNS; 10/10 mutations caught; root-read census
+red until the joint proposal; claims in task-4-claims.tsv). Deviations: new agent-side code status_unreadable (fail
+closed); retry pacing in a boot method, 5-min key deadline; Task 2's fleetKey hook → fleetStore; managed door answers
+503 for any no-change outcome; status file written on success (managed_key=ok); no key retry on later boots (a failed
+key fails storage until deadline cleanup). Hunks in Task 3 files: agent.go statusTick one line; 2b-2 record-write
+layer entries. Astra R1 + Fable R1 running on the side branch.
+Task 4: Astra R1 NOT READY — P1-1 root reads the fleet-writable key object unbounded (S3Store.Get io.ReadAll) before
+the 4 KiB limit; P2-1 fleetIdentityOK folds registry lookup errors into a terminal 403; P2-2 fleetKeyNotRecorded
+(owner record written, registry write failed/ambiguous) is mis-classed as a no-change 503; P2-3 the first-writer race
+witness uses a simulated registry; P3-1 filtered claim-invariant run has a failing parent (CI evidence owed).
+Waiting for Fable R1.
+Task 4: Fable R1 READY AFTER FIXES (P2-1 a failed KeyStatusPath write is swallowed, so a keyless box reports
+managed_key="" and could reach ready; P2-2 the door's 503 contract is untested; P3s: heartbeat log noise, 5-min key
+deadline with no later retry, leak sweep gaps).
+Ruling: a failed first-boot status-file write fails the boot (Fable P2-1); ambiguous door outcomes are retryable 503
+and converge on retry, "no change" only where proven (Astra P2-2); lookup errors → 503 (Astra P2-1).
+Ruling: the 5-minute key deadline with no retry on later boots is accepted for 2b-2 — cost if wrong: a transient
+bucket/console blip at first boot costs that box (deadline cleanup, quota released) rather than a retry.
+Task 4: fix round 1 dispatched to the Task 4 implementer (t4 worktree).
+Task 4: fix round 1 committed ae1ba1fd (bounded 4 KiB+1 streaming read; fleetIdentityCheck exposes lookup errors →
+503; fleetKeyIncomplete → retryable 503 converging on retry; real-door concurrent race witness; status/host.env write
+failure fails first boot; 503 contract tests; log rate-limit, leak sweep). 6/6 mutations caught. New COPY: "the
+secrets key registration did not finish. try again shortly" (managedfleetkey.go:38). Open copy-review question: the
+owner door's "nothing was changed" sentence on an incomplete registration. Astra R2 running.
+Task 4: Astra R2 READY AFTER FIXES — R1 P1-1, P2-1, P2-3 and Fable P2-1/P2-2 resolved; R1 P2-2 partly: the owner door
+still says "nothing was changed" on fleetKeyIncomplete (R2 P2-1, response-truthfulness family, second round). Audit
+event after a committed-registry/lost-reply retry is not re-emitted (inherited best effort, noted). Claim-invariant CI
+evidence still owed.
+Ruling: stop at R2 (no P1). Two rounds in one family → the stopping rule's "invariant" option is taken by the
+controller (Astra's recommendation): one enforced outcome class from the core, both doors map text only from it,
+guard tests; the new owner-door sentence goes to Paul in copy review, where he can choose otherwise — cost if wrong:
+Paul prefers a different option (refuse up front/cut) and the change is redone at copy review.
+Task 4: R2 P2-1 fixed 2379f356 (fleetKeyErrClass: done / wrote-nothing / may-have-written; both doors map text from
+it; owner door incomplete → new COPY "the key registration for <fleet> did not finish. run carlos fleets secrets-key
+<fleet> <pubkey> again to complete it" (fleetsecretskey.go:159); unknown managed-door errors → retryable 503;
+key-in-use classed may-have-written, still terminal 409). Task 4: complete on managed-fleets-2b2-t4 (a5c0afa4,
+ae1ba1fd, 2379f356); rebase onto Task 3's fixed tip and joint census pending.
+Task 3: fix round 1 committed 82bade12 + census 2ab60ac0 (root-first ready leg; default-gated publication on every
+path, any failure publishes nothing; trusted descriptor-walk reads/writes; prefix-name refusal; env var dropped from
+root tests, /run/carlos-control fixture; one refused path, no Fatalf; production-composition witnesses; once-only
+boot pass; door 500 on I/O). 10/10 mutations caught. New root test TestManagedUnitTrustRoot. Test seam LoadIdentityAs
+(test-only, grep-witnessed). Census seal 2e19c2ce…, bootstrapWithGroup re-pinned. Every gate call daemon-reloads on
+managed boxes. Astra R2 running.
+Task 3: Astra R2 READY AFTER FIXES — all R1 P1s resolved (no recurrence); CENSUS APPROVED for the Tasks 2-3 overlay at
+2ab60ac0 (all six envelopes; record-write re-pins incl. bootstrapWithGroup). Remaining P2s: P2-1 a failed reload/
+try-restart loses the owed instance-control restart after its ReadWritePaths drop-in is repaired (reproduced);
+P2-2 RunAgent's group preflight log.Fatal runs before the managed refused path; P2-3 named-recovery witness calls
+refusedByGate, not passOption.
+Ruling: stop at R2. The liveness and recovery-witness families recurred across two rounds; the controller takes the
+stopping rule's "invariant" option (Astra's recommendation): one managed/BYO startup decision at the RunAgent entry,
+before any fatal group preflight, with guard tests through the production entry; an owed control restart persisted
+until it succeeds; named recovery witnessed through passOption. Paul is told in the branch report — cost if wrong:
+Paul prefers refuse/cut and the change is redone.
+Rebase: managed-fleets-2b2-t4 rebased onto 2ab60ac0 (one census-test conflict resolved by merging both layers);
+joint census for Tasks 2-4 proposed (seal 2a3c4f73, 51 claims, units the census does not see pruned) and committed
+b454d88a; provision census + Task 3/4 targeted host/managedboot/console selections green on the rebased tip;
+managed-fleets-2b2 fast-forwarded to b454d88a (Task 4 = 5eb12e44, d93dc701, b06b6fd1).