carlos / platform Public

Rootfs apps Plan 3 Group R: the release process (#366). A rootfs app's declared release command (migrations) runs from the new image, in the rootfs cmd unit inside the instance's slice and tier, before the new web serves: before an overlap swap is admitted, and inside a wake (hold swaps, planned wakes, cold wakes, resident starts). The new web never serves unless this release passed for this build in this attempt; a failed, timed-out, cancelled or unproven release never stops the old web under overlap. One per-host release record outlives the entry, keeps the lease and blocks every transition until the release's unit is proven gone, and is reaped by the pass the sweep and Shutdown share; lease loss stops the release before the safety deadline. Only a proven release failure is the build's failure. An interrupted adoption recovers as a binary one does (a failure on restart, an explicit retry re-runs the release; stopping rule 2, overnight ruling for Paul). Copy RFS-3-C01..C07 and C29. Reviews: per-task Astra rounds (R1 2, R2 3, R3 2), whole-branch round 1 READY AFTER FIXES (P2 fixed), census census-ruling-rootfs-apps-3-release approved by Astra (#280). Dormant until a rootfs release declares a release process.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Prompts:

  <task-notification>
  <task-id>b2doonwyj</task-id>
  <tool-use-id>toolu_01HdF92N4pzhVkPa1nMM6vZZ</tool-use-id>
  <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/fc618670-579d-4b96-a3b9-686b6c074952/tasks/b2doonwyj.output</output-file>
  <status>completed</status>
  <summary>Background command "Wait until the app serves again after reboot" completed (exit code 0)</summary>
  </task-notification>

  <task-notification>
  <task-id>aece2f0eae5dad8de</task-id>
  <tool-use-id>toolu_01W8v5X3GSCWMzP1fMyCuZ54</tool-use-id>
  <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/fc618670-579d-4b96-a3b9-686b6c074952/tasks/aece2f0eae5dad8de.output</output-file>
  <status>completed</status>
  <summary>Agent "Implement Group R task R3" 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>Fix round 1 for findings 1 and 2 is DONE, committed as **2b551efc** on rootfs-apps-3-release (on top of R2's fix 03313767). Not pushed, and I left the lock file alone.
  
  **Finding 3 dropped, as you asked.** I had started the hold-phase work, and I took it out before committing: `swap.go`, `scheduler.go` and R2's two phase test files are exactly as in 03313767. Nothing in this commit relies on the Phase/Advance machinery, so removing it later won't touch this round.
  
  **Finding 1 (planned wake):** a release that ran now counts as B having run, whatever happens to the web: `w.bootRan = released || …`. A passed release followed by a refused web ends as GenCancelled with Executed, so a hold first wake leaves the hold-ran marker. Binary rows behave as before.
  
  **Finding 2 (hold):** a release that ran now records attempt evidence only (new `pinWebExec` field, `markPinReleaseExec`). `holdResult` and `wakeFailureEvent` treat a pinned error as the build's failure only for a `*ReleaseError`, or when the web ran or may have. So a web error before its exec abandons the hold with Executed=true: the marker is kept, no failure is recorded, and the member is not told "wake failed". A web that ran and failed is still SwapDown.
  
  **Tests:**
  - `TestPlannedReleaseCountsWhenTheWebIsRefused` (hold and overlap).
  - `TestHoldWebErrorBeforeExecIsNotABuildFailure`.
  - `TestAPlannedHoldReleaseThenRefusedWebKeepsTheMarker`, through the real planner, the on-disk failure book and `OnGen`: the marker is set and the next wake is refused, never booted on v1. Its control row (the old Executed=false) shows the bug, booting v1.
  - A new row in `TestReleaseOutcomesThroughTheScheduler` for a web refused after the release ran.
  
  All 6 mutations (F1 to F6) were caught by real test failures. F5 and F6 first failed only on an unused variable, so I re-ran both as behavioural mutations.
  
  **Checks, all passing:**
  - the guards, the activator families and the whole rollout package;
  - `-race` three times over both new test sets;
  - arm64 under qemu: 127 passed in the activator set with none skipped or failed, and the rollout package passed;
  - vet, gofmt, and the darwin and windows builds.
  
  The `internal/instancectl` diff is empty. No new test skipped locally.
  
  **One thing for the Phase removal:** the `plan.BeforeWeb` block in `spawnPlanned`, including its `w.bootRan = released` line, goes with that machinery. The finding 1 fix is on the web-start result line, outside the block, so it survives.
  
  The fix report is appended to `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/rootfs-apps-3r/.superpowers/sdd/2026-10-27-rootfs-apps-3-rw/task-R3-report.md`.</result>
  <usage><subagent_tokens>495098</subagent_tokens><tool_uses>25</tool_uses><duration_ms>4343273</duration_ms></usage>
  </task-notification>

  … and 1 more, on the branch's Prompts tab.

Squashed from rootfs-apps-3-release into main.
claude agent, operated by paul@keymail.dev 5e6ed9644ad1c5c74f355d8f96d898816c72a367 parent 9bcbab0
50 files changed, +8,268 −98
  • approved_rootfs_copy_test.go +6 −0
  • docs/superpowers/notes/census-proposal-rootfs-apps-3-release.md +89 −0
  • docs/superpowers/notes/census-rootfs-apps-3-release-claims.md +37 −0
  • docs/superpowers/notes/rootfs-first-boot-marker.md +4 −1
  • docs/superpowers/reviews/CODEX-REVIEW-BRIEF-census-rootfs-apps-3-release-R1.md +20 −0
  • docs/superpowers/reviews/CODEX-REVIEW-BRIEF-rootfs-apps-3-release-branch-R1.md +30 −0
  • internal/activator/activator.go +106 −12
  • internal/activator/activator_test.go +19 −1
  • internal/activator/backend_exec.go +9 −0
  • internal/activator/backend_rootfs.go +224 −10
  • internal/activator/backend_unit.go +24 −0
  • internal/activator/claimwake.go +5 −0
  • internal/activator/cmd.go +4 −1
  • internal/activator/cmdunit.go +10 −0
  • internal/activator/generations_file.go +8 −1
  • internal/activator/logsink.go +13 −0
  • internal/activator/maintenance.go +11 −1
  • internal/activator/opset.go +5 −2
  • internal/activator/production_backend_test.go +20 −0
  • internal/activator/rootfs_admission_test.go +9 −7
  • internal/activator/rootfs_ctl_harness_test.go +86 −3
  • internal/activator/rootfs_gate_test.go +24 −3
  • internal/activator/rootfs_invariants_test.go +126 −0
  • internal/activator/rootfs_processes_test.go +40 −27
  • internal/activator/rootfs_release_backend_test.go +518 −0
  • internal/activator/rootfs_resident_lease_test.go +1 −0
  • internal/activator/rootfs_resident_test.go +13 −0
  • internal/activator/rootfs_service.go +29 −3
  • internal/activator/rootfs_swap_release_harness_test.go +98 −0
  • internal/activator/rootfs_swap_release_test.go +1,250 −0
  • internal/activator/rootfs_wake_release_test.go +1,298 −0
  • internal/activator/rootfsenv.go +9 −0
  • internal/activator/rootfsenv_test.go +17 −0
  • internal/activator/rootfsrelease.go +1,020 −0
  • internal/activator/rootfsrelease_test.go +2,293 −0
  • internal/activator/swap.go +44 −4
  • internal/activator/swaphold.go +73 −2
  • internal/activator/wakeidentity_test.go +15 −2
  • internal/activator/wakeplan.go +60 −1
  • internal/provision/census_propose_test.go +3 −3
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −0
  • internal/provision/testdata/plan14-root-reads-rootfs-apps-3-release.tsv +68 −0
  • internal/rollout/events.go +7 −0
  • internal/rollout/rootfs_reason_test.go +64 −0
  • internal/rollout/rootfs_release_crash_test.go +133 −0
  • internal/rollout/rootfs_release_outcomes_test.go +270 −0
  • internal/rolloutwords/words.go +18 −0
  • internal/rolloutwords/words_test.go +18 −4
  • internal/status/snapshot.go +5 −0
  • plan3_groups_test.go +14 −10

CI passed — run details

landed from rootfs-apps-3-release

approved_rootfs_copy_test.go

Loading diff…

docs/superpowers/notes/census-proposal-rootfs-apps-3-release.md

Loading diff…

docs/superpowers/notes/census-rootfs-apps-3-release-claims.md

Loading diff…

docs/superpowers/notes/rootfs-first-boot-marker.md

Loading diff…

docs/superpowers/reviews/CODEX-REVIEW-BRIEF-census-rootfs-apps-3-release-R1.md

Loading diff…

docs/superpowers/reviews/CODEX-REVIEW-BRIEF-rootfs-apps-3-release-branch-R1.md

Loading diff…

internal/activator/activator.go

Loading diff…

internal/activator/activator_test.go

Loading diff…

internal/activator/backend_exec.go

Loading diff…

internal/activator/backend_rootfs.go

Loading diff…

internal/activator/backend_unit.go

Loading diff…

internal/activator/claimwake.go

Loading diff…

internal/activator/cmd.go

Loading diff…

internal/activator/cmdunit.go

Loading diff…

internal/activator/generations_file.go

Loading diff…

internal/activator/logsink.go

Loading diff…

internal/activator/maintenance.go

Loading diff…

internal/activator/opset.go

Loading diff…

internal/activator/production_backend_test.go

Loading diff…

internal/activator/rootfs_admission_test.go

Loading diff…

internal/activator/rootfs_ctl_harness_test.go

Loading diff…

internal/activator/rootfs_gate_test.go

Loading diff…

internal/activator/rootfs_invariants_test.go

Loading diff…

internal/activator/rootfs_processes_test.go

Loading diff…

internal/activator/rootfs_release_backend_test.go

Loading diff…

internal/activator/rootfs_resident_lease_test.go

Loading diff…

internal/activator/rootfs_resident_test.go

Loading diff…

internal/activator/rootfs_service.go

Loading diff…

internal/activator/rootfs_swap_release_harness_test.go

Loading diff…

internal/activator/rootfs_swap_release_test.go

Loading diff…

internal/activator/rootfs_wake_release_test.go

Loading diff…

internal/activator/rootfsenv.go

Loading diff…

internal/activator/rootfsenv_test.go

Loading diff…

internal/activator/rootfsrelease.go

Loading diff…

internal/activator/rootfsrelease_test.go

Loading diff…

internal/activator/swap.go

Loading diff…

internal/activator/swaphold.go

Loading diff…

internal/activator/wakeidentity_test.go

Loading diff…

internal/activator/wakeplan.go

Loading diff…

internal/provision/census_propose_test.go

Loading diff…

internal/provision/testdata/plan14-root-reads-chain.tsv

Loading diff…

internal/provision/testdata/plan14-root-reads-rootfs-apps-3-release.tsv

Loading diff…

internal/rollout/events.go

Loading diff…

internal/rollout/rootfs_reason_test.go

Loading diff…

internal/rollout/rootfs_release_crash_test.go

Loading diff…

internal/rollout/rootfs_release_outcomes_test.go

Loading diff…

internal/rolloutwords/words.go

Loading diff…

internal/rolloutwords/words_test.go

Loading diff…

internal/status/snapshot.go

Loading diff…

plan3_groups_test.go

Loading diff…