carlos / platform Public

activator: a release waits for either role's start window, never for a started session (rootfs plan 6 task 9 fix round 2)

Ruling on Astra re-review 1: release admission refuses while a run's or
a session's start is in flight (cmdStartInFlightLocked), a short bounded
window, so the refusal is not executed and takes the ordinary retry; an
executed release followed by a refused swap could strand a halted
cohort. The busy check still counts established cmd holds only: a
started session never holds a release (PF-17). Census overlay
re-proposed (releaseAdmitLocked's claim back to its Task 9 meaning).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev fa303fff6d4d189f6d38b85579dd9bf1d0466317 parent 5aa80f3
7 files changed, +59 −26
  • docs/superpowers/notes/census-proposal-rootfs-apps-6.md +2 −2
  • internal/activator/cmd.go +2 −4
  • internal/activator/cmd_test.go +16 −12
  • internal/activator/rootfsrelease.go +11 −4
  • internal/activator/rootfsrelease_test.go +24 −0
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-rootfs-apps-6.tsv +3 −3

Intent

Human

<task-notification> <task-id>a5f785381244b0779</task-id> <tool-use-id>toolu_01RRpdwdQExZqfCUdLgzYxCG</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ba9fa944-a429-4788-9b3c-f2b2f42617f3/tasks/a5f785381244b0779.output</output-file> <status>completed</status> <summary>Agent "Plan 6 Task 9: session writer lifecycle" 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>Status: DONE Commit: `5aa80f3a` (on top of `e4c45512`). Not pushed. Tests: the new release test failed before the fix and passes now. The two lease witnesses and the release test pass `-race -count=20`. The activator, provision census and instancectl guard runs pass, and the darwin/arm64, windows/amd64 and linux/arm64 builds are clean. What changed: - **P2 1, release vs a session starting:** release admission now checks only the run's start in flight. Swap admission and the switch still check both. - **P2 2, the lease witness:** the test now waits for both holds to read as interrupted and for each first settle attempt to finish before it checks ordering. The hibernating "watched" subtest had the same race and got the same wait. Mutations: the reviewer's mutation (release admission counting both starts again) is killed by the new test. A second one, swap admission counting the run's start only, is killed too. Census: the census card changed (one claim, `releaseAdmitLocked`), so I re-proposed the overlay. The seal went from `1dca4fb5` to `9272ccd3`. That claim is reworded because its old text said a session start refuses a release. The other 46 are carried over unchanged, and the overlay diff touches only that unit and the activator envelope. No approval requested. The fix report is appended to `task-9-report.md`. Concerns: 1. Removing release admission's start-in-flight check entirely does not fail any test. Its busy check already refuses whenever a run is attached, so the line only duplicates it. I kept it to mirror swap admission. 2. A release can now be admitted while a session is still starting. The swap that follows may then be refused for that start and have to wait, so the release may run before a swap that can't go ahead yet. That is the trade the review asked for: a session never holds up a release.</result> <usage><subagent_tokens>369543</subagent_tokens><tool_uses>14</tool_uses><duration_ms>358138</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>bbsr6m0ck</task-id> <tool-use-id>toolu_013eBjLfWP3KS14TsZkovEuJ</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ba9fa944-a429-4788-9b3c-f2b2f42617f3/tasks/bbsr6m0ck.output</output-file> <status>completed</status> <summary>Background command "Run Astra re-review of Task 9 fix" completed (exit code 0)</summary> </task-notification>

Attributed to this commit: 13.2 g CO₂e (1,625,202 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on rootfs-apps-6-interactive, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.

diff --git a/docs/superpowers/notes/census-proposal-rootfs-apps-6.md b/docs/superpowers/notes/census-proposal-rootfs-apps-6.md
index 2c003ce0e..50b4641a1 100644
--- a/docs/superpowers/notes/census-proposal-rootfs-apps-6.md
+++ b/docs/superpowers/notes/census-proposal-rootfs-apps-6.md
@@ -12,7 +12,7 @@ Ruling `census-ruling-rootfs-apps-6`. The independent reviewer approves or rejec
| `internal/activator/cmdunit.go` `type CmdSpec` | body | unchanged (1) | rootfs Plan 6 Task 7a: declaration only: gains AfterSettled, a callback field the caller sets (the box's run pass removes the run's directory in it), called once when no unit of the run can be running; reads nothing; fix round 2: comment only: AfterSettled is called once, after the proof, never while a lock is held, in the settle's goroutine without the stop waiting for it, and must not call Stop or Shutdown; Plan 6 Task 8: declaration only: gains Process (a declared process name, "" or console; StartCmd refuses it except for a session on a rootfs row) and TTY (*TTYSpec: Term, Cols, Rows; set, the command is a session in the tty unit), fields the box sets; reads nothing |
| `internal/activator/prepare.go` `ExecBackend.prepareKeyedAt` | body | unchanged (13) | rootfs Plan 6 Task 8: the cmd role three exceptions (no env read, the replica gate left to StartCmd, no app-log listener) now cover every one-shot role, instancectl.OneShot(role): cmd and tty; before, the tty role fell to the sidecar env-file read and an app-log listener on its handoff socket path; no read added, one removed for tty |
| `internal/activator/rootfs_service.go` `Service.residentLeaseLost` | body | unchanged (2) | rootfs Plan 6 Task 7a (Call A1): residentLeaseLostLocked also returns one kill func per one-shot unit that may run; each runs off a.mu in the same WaitGroup as stopRootfsWorkersAtLoss and killResidentGens, which still run only for a resident (gens non-nil); the kills go to root's existing /stop through KillOneShot; no read added |
-| `internal/activator/rootfsrelease.go` `Service.releaseAdmitLocked` | body | unchanged (3) | rootfs Plan 6 Task 9 (PF-17): the busy check is holdBusyLocked(e, RoleCmd) where it was cmdBusyLocked(e): only cmd-unit holds and cmd-unit lease stops refuse a release command, never a session, whose tty unit is its own; fix round 1 (Astra P2 1): the start-in-flight check is holdStartInFlightLocked(e, RoleCmd), the cmd unit's start alone, so a session's start in flight does not refuse a release either (swap admission and the switch still count both roles through cmdStartInFlightLocked); no read added, read sites unchanged |
+| `internal/activator/rootfsrelease.go` `Service.releaseAdmitLocked` | body | unchanged (3) | rootfs Plan 6 Task 9 (PF-17): the busy check is holdBusyLocked(e, RoleCmd) where it was cmdBusyLocked(e): only established cmd-unit holds and cmd-unit lease stops refuse a release command, never a started session, whose tty unit is its own; cmdStartInFlightLocked now also counts a session's start in flight (merge ruling M2), so a release is refused during either role's start window, short and bounded, as swap admission is (fix round 2 ruling: a refusal at admission is not executed and takes the ordinary retry); no read added, read sites unchanged |
| `internal/activator/rootfsrelease.go` `Service.runRelease` | body | unchanged (12) | rootfs Plan 6 Task 9: newCmdHold takes the hold's role; a release command's hold is instancectl.RoleCmd, the unit it runs in; nothing else changed, no read added |
| `internal/host/runexec.go` `runsWorker.execute` | body | unchanged (2) | rootfs Plan 6 Task 7a (INV-2): sets CmdSpec.AfterSettled to remove the run's directory (runs.RemoveRunDir under the instance's own directory, as cleanUp did) once the activator has proven no unit of the run runs; finish and cleanUp take removeDir, true only on the incarnation refusal before RunCmd; the directory goes later or at the same point, never earlier; no read added |
| `internal/host/units/carlos-instance-cmd@.service` `external` | body | unchanged (1) | rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else |
@@ -98,6 +98,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- new `internal/instanceexec/tty_linux.go:receivePTY`: reads +file:Fstat; written legacy, accepted-legacy, frozen
- reads `internal/activator/cmdunit.go:cmdUnit.StopAndSettle`: +registry:Host, +whole:Route; keeps legacy, task accepted-legacy
-Seal: `1379d066c8dd2335d95d5f6e9c7bce65ff57f00b2b287a308d9b3f47911ae5e7` → `9272ccd377b4f4aa0e0d43cf58c246db99203afd6a856cfcfe279c5a4402553f`.
+Seal: `1379d066c8dd2335d95d5f6e9c7bce65ff57f00b2b287a308d9b3f47911ae5e7` → `f02fd204e9316044a993e8c66318a8429555366b3e1a7b5a0388ed4376d334ad`.
Overlay: `internal/provision/testdata/plan14-root-reads-rootfs-apps-6.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/activator/cmd.go b/internal/activator/cmd.go
index ef4657376..842f06b8e 100644
--- a/internal/activator/cmd.go
+++ b/internal/activator/cmd.go
@@ -414,10 +414,8 @@ func cmdStartInFlightLocked(e *actEntry) bool {
return holdStartInFlightLocked(e, instancectl.RoleCmd) || holdStartInFlightLocked(e, instancectl.RoleTTY)
}
-// holdStartInFlightLocked is cmdStartInFlightLocked for role's slot alone.
-// A release command's admission asks it for the cmd unit only: a
-// session's start, in its own tty unit, never refuses a release (rootfs
-// apps Plan 6 Task 9 fix round 1, PF-17). The caller holds a.mu.
+// holdStartInFlightLocked is cmdStartInFlightLocked for role's slot
+// alone. The caller holds a.mu.
func holdStartInFlightLocked(e *actEntry, role instancectl.Role) bool {
h := *holdSlot(e, role)
if h == nil || !h.starting {
diff --git a/internal/activator/cmd_test.go b/internal/activator/cmd_test.go
index f45f188d9..9f954038a 100644
--- a/internal/activator/cmd_test.go
+++ b/internal/activator/cmd_test.go
@@ -1193,10 +1193,12 @@ func TestASessionIsNotRefusedForARelease(t *testing.T) {
}
}
-// Fix round 1 (Astra P2 1): a session whose start is still in flight does
-// not refuse a release command's admission either: the release counts the
-// cmd unit alone. A run whose start is in flight still refuses it.
-func TestAReleaseIsAdmittedBesideASessionStartInFlight(t *testing.T) {
+// Fix round 2 (ruling on Astra re-review 1): a release command waits for
+// the start window of either role's command, which is short and bounded:
+// a refusal at release admission is not executed and takes the ordinary
+// retry. Once a session has started, it never holds a release; a run that
+// has started (attached) still does.
+func TestAReleaseWaitsForAStartButNotForAStartedSession(t *testing.T) {
t.Parallel()
for _, session := range []bool{true, false} {
t.Run(map[bool]string{true: "session", false: "run"}[session], func(t *testing.T) {
@@ -1220,26 +1222,28 @@ func TestAReleaseIsAdmittedBesideASessionStartInFlight(t *testing.T) {
<-cb.entered
a.mu.Lock()
e := a.entries[rt.Host]
- inFlight := cmdStartInFlightLocked(e)
- admit := a.releaseAdmitLocked(e)
+ inFlight := a.releaseAdmitLocked(e)
a.mu.Unlock()
close(cb.gate)
r := <-done
if r.err != nil {
t.Fatal(r.err)
}
+ a.mu.Lock()
+ started := a.releaseAdmitLocked(e)
+ a.mu.Unlock()
if err := r.h.Stop(context.Background()); err != nil {
t.Fatal(err)
}
r.h.Release()
- if !inFlight {
- t.Fatal("the start was not in flight for the swap's check")
+ if !errors.Is(inFlight, errSwapBusy) {
+ t.Fatalf("a release beside a start in flight: %v, want errSwapBusy", inFlight)
}
- if session && admit != nil {
- t.Fatalf("a release beside a session's start in flight: %v, want admitted", admit)
+ if session && started != nil {
+ t.Fatalf("a release beside a started session: %v, want admitted", started)
}
- if !session && !errors.Is(admit, errSwapBusy) {
- t.Fatalf("a release beside a run's start in flight: %v, want errSwapBusy", admit)
+ if !session && !errors.Is(started, errSwapBusy) {
+ t.Fatalf("a release beside a started run: %v, want errSwapBusy", started)
}
})
}
diff --git a/internal/activator/rootfsrelease.go b/internal/activator/rootfsrelease.go
index 11fcd29df..73293aaaa 100644
--- a/internal/activator/rootfsrelease.go
+++ b/internal/activator/rootfsrelease.go
@@ -589,10 +589,17 @@ func (a *Service) releaseAdmitLocked(e *actEntry) error {
if len(e.ops.members) > 0 || e.ops.raised || e.ops.resizing {
return errSwapBusy
}
- // The cmd unit's start only, as the busy check above (PF-17): a
- // session starting in its tty unit does not refuse a release. Swap
- // admission and the switch still count both (cmdStartInFlightLocked).
- if holdStartInFlightLocked(e, instancectl.RoleCmd) {
+ // The start window of either role's command (cmdStartInFlightLocked),
+ // as swap admission counts it: a run's or a session's unit may be
+ // starting against the incumbent right now, and the swap this release
+ // precedes would then be refused. That window is short and bounded
+ // (cmdStartBound), and a refusal here is not executed, so the attempt
+ // takes the ordinary retry; a release that ran and was then followed
+ // by a refused swap would count as executed and could strand a halted
+ // cohort's rollout (Task 9 fix round 2 ruling). The busy check above
+ // counts established holds, cmd only: once started, a session never
+ // holds a release (PF-17).
+ if cmdStartInFlightLocked(e) {
return errSwapBusy
}
return nil
diff --git a/internal/activator/rootfsrelease_test.go b/internal/activator/rootfsrelease_test.go
index 469dfd807..0f2b75d69 100644
--- a/internal/activator/rootfsrelease_test.go
+++ b/internal/activator/rootfsrelease_test.go
@@ -883,6 +883,30 @@ func TestReleaseRefusedWhileARunHoldsTheUnit(t *testing.T) {
}
}
+// Fix round 2: a session whose start is in flight refuses the release at
+// its admission, before anything runs (not executed, no record, no
+// start), so the attempt takes the ordinary retry; once the session's
+// start has returned, the same release runs beside it.
+func TestReleaseRefusedWhileASessionStarts(t *testing.T) {
+ r := newReleaseRig(t)
+ ses := newCmdHold("ses_a", instancectl.RoleTTY, func() {}, r.a.now)
+ ses.starting = true
+ r.a.mu.Lock()
+ r.e.tty = ses
+ r.a.mu.Unlock()
+ r.b.unit.done("1", "0", "success") // a release that ran would pass at once
+ ex, err := r.runNow(t)
+ if ex || !errors.Is(err, errSwapBusy) || r.b.startCount() != 0 {
+ t.Fatalf("runRelease = %v, %v (starts %d); want errSwapBusy, not executed, nothing started", ex, err, r.b.startCount())
+ }
+ r.noRecord(t, "beside a session's start")
+ close(ses.started) // the start returned (no unit: nothing of it runs)
+ ex, err = r.runNow(t)
+ if !ex || err != nil {
+ t.Fatalf("runRelease beside a started session = %v, %v; want executed and passed", ex, err)
+ }
+}
+
func TestReleaseRefusedBesideALiveResize(t *testing.T) {
for name, c := range map[string]struct {
set func(e *actEntry)
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 4fffd9ff4..ac85d82f1 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -43,4 +43,4 @@ plan14-root-reads-region-ha-dead-holder-backoff.tsv 8f6a1865b0abcea9d4fb68232cc2
plan14-root-reads-managed-fleets-1c-451.tsv af326671321edda76c7e6217a47892605a9e3b886fa880ad6d049c2f28f63873
plan14-root-reads-fleet-public-routes.tsv bca6ef741a96b72767b1747789cd01b3111d61b68548cbe368258c31f3d53a2e
plan14-root-reads-fleet-routes-followups.tsv 1379d066c8dd2335d95d5f6e9c7bce65ff57f00b2b287a308d9b3f47911ae5e7
-plan14-root-reads-rootfs-apps-6.tsv 9272ccd377b4f4aa0e0d43cf58c246db99203afd6a856cfcfe279c5a4402553f
+plan14-root-reads-rootfs-apps-6.tsv f02fd204e9316044a993e8c66318a8429555366b3e1a7b5a0388ed4376d334ad
diff --git a/internal/provision/testdata/plan14-root-reads-rootfs-apps-6.tsv b/internal/provision/testdata/plan14-root-reads-rootfs-apps-6.tsv
index d02c23591..de8675138 100644
--- a/internal/provision/testdata/plan14-root-reads-rootfs-apps-6.tsv
+++ b/internal/provision/testdata/plan14-root-reads-rootfs-apps-6.tsv
@@ -9,7 +9,7 @@
@legacy cc1eabf2c1d89a0a96b8bfcfaa1f76b2b0beb39474d5e53fe526de11733da8fa internal/activator/cmdunit.go type CmdSpec legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): declaration only; Prepare is a callback field, not a prepared statement;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 7a: declaration only: gains AfterSettled, a callback field the caller sets (the box's run pass removes the run's directory in it), called once when no unit of the run can be running; reads nothing; fix round 2: comment only: AfterSettled is called once, after the proof, never while a lock is held, in the settle's goroutine without the stop waiting for it, and must not call Stop or Shutdown; Plan 6 Task 8: declaration only: gains Process (a declared process name, "" or console; StartCmd refuses it except for a session on a rootfs row) and TTY (*TTYSpec: Term, Cols, Rows; set, the command is a session in the tty unit), fields the box sets; reads nothing file:Prepare@1305 f71a97113e7d5583d7b38bdf4883b1bb379ad7111a2550be0bc4e7bcbcc2fac6
@legacy 81be2be248ab3838d49b6a9502dfcbc905bc97da48487aba00fe094d53077c83 internal/activator/prepare.go ExecBackend.prepareKeyedAt legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=Re-digested at the pre-land merge: the body includes main's own change under census ruling zddr4, with no further change from this branch beyond carrying main's new early return into the six-value signature. the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): body of the frozen prepareAt, which is now its wrapper; it also returns the instance key's layer and reads no env for the cmd role; same reads, same nested launch paths;rev3=census-ruling-wake-latency-2;basis=takes an optional timer and marks its steps with time.Now() (dirs, admin token, instance key, env, control socket, key gate, logs); no read added or moved;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos, run and seed roles only, under a 30 s context (haSecretsBudget): the token producer is ensureAdminTokenFor(hctx, rt, p) (on this nested path the same beneath producer, EnsureAdminTokenBeneath's, plus the HA mint decision inside it); ensureInstanceKeyFor now gets hctx instead of context.Background(), so the key's bucket read is bounded by 30 s as well as configReadTimeout; the env is launchEnvLayer(hctx, rt) (instanceEnvLayer for a non-HA host; for an HA host one capture, published and acknowledged); a test seam (haLaunchHooks.afterGate, nil in production) is called before the producers. The separate haMintGate and haSecretsReady calls are gone (final fix F2). Sites against main: -registry:Host (the rt.Host+".env" argument EnsureAdminTokenBeneath took) and +whole:Route (rt to launchEnvLayer); the cmd role and a non-HA host are unchanged;rev3=census-ruling-rootfs-fleet-followups;basis=names the process for the role log listener: release.ProcessWeb when rt.Rootfs() and the role is run, else none, passed to logEmitter; reads rt.Runtime through Rootfs(); no file, path or env read added or moved;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 8: the cmd role three exceptions (no env read, the replica gate left to StartCmd, no app-log listener) now cover every one-shot role, instancectl.OneShot(role): cmd and tty; before, the tty role fell to the sidecar env-file read and an app-log listener on its handoff socket path; no read added, one removed for tty file:ReadDir@2965,registry:Host@1783,registry:Host@1995,registry:Host@5886,registry:Host@6084,registry:Host@612,whole:Route@1674,whole:Route@1885,whole:Route@2116,whole:Route@320,whole:Route@4678,whole:Route@5227,whole:Route@5920 0fce84024e1c33a8f8db76231106e7b962627f294dd6429038b479d25274a5b2
@legacy 2d9c727dee13d2655dcd898f0f5aecaa20902fa217ea6cf20a3ecce21e657388 internal/activator/rootfs_service.go Service.residentLeaseLost legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 8 (C7): a resident's lost lease marks it and then kills its generations off a.mu (killResidentGens);rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W, W1.10: a resident's lost lease stops its workers (stopRootfsWorkersAtLoss, proven gone) in parallel with killResidentGens; rt is taken under the lock and passed to killResidentGens in place of e.route (the same route); site +whole:Route (that local rt); no file read;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 7a (Call A1): residentLeaseLostLocked also returns one kill func per one-shot unit that may run; each runs off a.mu in the same WaitGroup as stopRootfsWorkersAtLoss and killResidentGens, which still run only for a resident (gens non-nil); the kills go to root's existing /stop through KillOneShot; no read added whole:Route@137,whole:Route@394 64ce2f74e65941ea2a731518c773cb9b27456f2db298c69ed4e02de375b1777f
-@legacy dbc61ce97d4a5f6ee44f437bbeafd9445c2ae5712ce703af95fb5e225f6acb4d internal/activator/rootfsrelease.go Service.releaseAdmitLocked legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R, R1 [pf R1.10]: new; the owner's half of a release's admission under a.mu: refuses while a run holds the cmd unit, and for an awake owner mirrors Swap's exclusions (worker or non-instance kind, a layout other than flat or nested through the existing swapLayout, members, a raised parent, a resize, a cmd start in flight); in-memory only; refusals only;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 9 (PF-17): the busy check is holdBusyLocked(e, RoleCmd) where it was cmdBusyLocked(e): only cmd-unit holds and cmd-unit lease stops refuse a release command, never a session, whose tty unit is its own; fix round 1 (Astra P2 1): the start-in-flight check is holdStartInFlightLocked(e, RoleCmd), the cmd unit's start alone, so a session's start in flight does not refuse a release either (swap admission and the switch still count both roles through cmdStartInFlightLocked); no read added, read sites unchanged registry:Kind@309,whole:Route@311,whole:Route@390 6391aa0cdd8e5a5656f3fc6c6724ac82250f949a832e0ad86a9068c44e2dba50
+@legacy a55981c78ecf7e6cc533e2ca1f8732773fc68d8382a17bc34d7c7fc81297aadb internal/activator/rootfsrelease.go Service.releaseAdmitLocked legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R, R1 [pf R1.10]: new; the owner's half of a release's admission under a.mu: refuses while a run holds the cmd unit, and for an awake owner mirrors Swap's exclusions (worker or non-instance kind, a layout other than flat or nested through the existing swapLayout, members, a raised parent, a resize, a cmd start in flight); in-memory only; refusals only;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 9 (PF-17): the busy check is holdBusyLocked(e, RoleCmd) where it was cmdBusyLocked(e): only established cmd-unit holds and cmd-unit lease stops refuse a release command, never a started session, whose tty unit is its own; cmdStartInFlightLocked now also counts a session's start in flight (merge ruling M2), so a release is refused during either role's start window, short and bounded, as swap admission is (fix round 2 ruling: a refusal at admission is not executed and takes the ordinary retry); no read added, read sites unchanged registry:Kind@309,whole:Route@311,whole:Route@390 d1f6ba85b88b217e9d82caa7f033f20f61429bc319f48099e60e3aea37234916
@legacy 674cf44c939f32e93617eb9f0c9653554b4d22d81bc0d09454fe5df8ba61c793 internal/activator/rootfsrelease.go Service.runRelease legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R, R1: new; the one place a release command runs. Refuses while any record of the host is open; skips the row's good build (releaseRan); reads the declared processes (declaredProcesses: the existing staged-manifest read) and refuses on a read error, never treating it as no release; runs only when releaseDue; needs a lease watch and a ReleaseBackend; its gate is the caller's plus the lease's Err and its safety deadline more than releaseStopLead (cmdStopBound, 2 min) away; creates the record under a.mu after releaseAdmitLocked; publishes the generations file and the build state (recordBuild) before anything runs; times out at the manifest's timeout_sec (default, capped at runs.MaxTimeout); ReleaseEnv; a supervisor stops the unit ahead of the lease's safety deadline; StartRelease under the exec gate; polls the unit (root's existing cmd status); stops and settles it (the existing cmd hold's stop, cmdStopBound); only a non-zero exit, a signal or the timeout with the unit proven gone is the build's failure (*ReleaseError); registry:Host sites are the record key and log lines;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 9: newCmdHold takes the hold's role; a release command's hold is instancectl.RoleCmd, the unit it runs in; nothing else changed, no read added registry:Host@184,whole:Route@2955,whole:Route@3184,whole:Route@3672,whole:Route@3701,whole:Route@5749,whole:Route@589,whole:Route@6217,whole:Route@6494,whole:Route@6924,whole:Route@817,whole:Route@902 442d93ec958dea41fe2eb1c49b1600e77450fc54c79a236c9cdd7c613d48f972
@legacy 6d257f47ef6aac75f3139d8e0ea689774fb9bd3bfca50c0f321573a483ded5e9 internal/host/runexec.go runsWorker.execute legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): runs one picked run to its result in the bucket; every root action goes through instance control;rev3=PROPOSED-325;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=emits the run's start and end as member log events through the agent's EventSink; reads unchanged;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 7a (INV-2): sets CmdSpec.AfterSettled to remove the run's directory (runs.RemoveRunDir under the instance's own directory, as cleanUp did) once the activator has proven no unit of the run runs; finish and cleanUp take removeDir, true only on the incarnation refusal before RunCmd; the directory goes later or at the same point, never earlier; no read added file:Prepare@1905,whole:Route@2916 43bd160066b4d3e7aef00e3891001bc5ffa9a40f597cb6e5cc7215eae2814df9
@legacy ee96c9cf9e4e6b0dea8325a3eaf0053773b3a20d3940afe881a0db8aa71b2d23 internal/host/units/carlos-instance-cmd@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=the cmd unit template (applied by PID 1 as root; its process runs as carlos): extends the J4 seed pattern to the run role. The template equals the seed template outside named lines, and the template-equality test pins that. Root lays out a staged executable validated by the same refuseStagedExe the seed and generation paths use, then starts this unit, which runs as carlos with the instance's own reach. No new trust of registry, /data or agent-asserted content beyond the seed path;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else file:external@0 925113f4c51c091f0da65c2c67c5902aa35ab37abbe6491ca935820517e8149d
@@ -55,7 +55,7 @@ internal/activator/backend_rootfs.go ExecBackend.StartRelease legacy accepted-le
internal/activator/cmdunit.go type CmdSpec legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): declaration only; Prepare is a callback field, not a prepared statement;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 7a: declaration only: gains AfterSettled, a callback field the caller sets (the box's run pass removes the run's directory in it), called once when no unit of the run can be running; reads nothing; fix round 2: comment only: AfterSettled is called once, after the proof, never while a lock is held, in the settle's goroutine without the stop waiting for it, and must not call Stop or Shutdown; Plan 6 Task 8: declaration only: gains Process (a declared process name, "" or console; StartCmd refuses it except for a session on a rootfs row) and TTY (*TTYSpec: Term, Cols, Rows; set, the command is a session in the tty unit), fields the box sets; reads nothing file:Prepare@1305 f71a97113e7d5583d7b38bdf4883b1bb379ad7111a2550be0bc4e7bcbcc2fac6
internal/activator/prepare.go ExecBackend.prepareKeyedAt legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=Re-digested at the pre-land merge: the body includes main's own change under census ruling zddr4, with no further change from this branch beyond carrying main's new early return into the six-value signature. the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): body of the frozen prepareAt, which is now its wrapper; it also returns the instance key's layer and reads no env for the cmd role; same reads, same nested launch paths;rev3=census-ruling-wake-latency-2;basis=takes an optional timer and marks its steps with time.Now() (dirs, admin token, instance key, env, control socket, key gate, logs); no read added or moved;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos, run and seed roles only, under a 30 s context (haSecretsBudget): the token producer is ensureAdminTokenFor(hctx, rt, p) (on this nested path the same beneath producer, EnsureAdminTokenBeneath's, plus the HA mint decision inside it); ensureInstanceKeyFor now gets hctx instead of context.Background(), so the key's bucket read is bounded by 30 s as well as configReadTimeout; the env is launchEnvLayer(hctx, rt) (instanceEnvLayer for a non-HA host; for an HA host one capture, published and acknowledged); a test seam (haLaunchHooks.afterGate, nil in production) is called before the producers. The separate haMintGate and haSecretsReady calls are gone (final fix F2). Sites against main: -registry:Host (the rt.Host+".env" argument EnsureAdminTokenBeneath took) and +whole:Route (rt to launchEnvLayer); the cmd role and a non-HA host are unchanged;rev3=census-ruling-rootfs-fleet-followups;basis=names the process for the role log listener: release.ProcessWeb when rt.Rootfs() and the role is run, else none, passed to logEmitter; reads rt.Runtime through Rootfs(); no file, path or env read added or moved;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 8: the cmd role three exceptions (no env read, the replica gate left to StartCmd, no app-log listener) now cover every one-shot role, instancectl.OneShot(role): cmd and tty; before, the tty role fell to the sidecar env-file read and an app-log listener on its handoff socket path; no read added, one removed for tty file:ReadDir@2965,registry:Host@1783,registry:Host@1995,registry:Host@5886,registry:Host@6084,registry:Host@612,whole:Route@1674,whole:Route@1885,whole:Route@2116,whole:Route@320,whole:Route@4678,whole:Route@5227,whole:Route@5920 0fce84024e1c33a8f8db76231106e7b962627f294dd6429038b479d25274a5b2
internal/activator/rootfs_service.go Service.residentLeaseLost legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 8 (C7): a resident's lost lease marks it and then kills its generations off a.mu (killResidentGens);rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W, W1.10: a resident's lost lease stops its workers (stopRootfsWorkersAtLoss, proven gone) in parallel with killResidentGens; rt is taken under the lock and passed to killResidentGens in place of e.route (the same route); site +whole:Route (that local rt); no file read;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 7a (Call A1): residentLeaseLostLocked also returns one kill func per one-shot unit that may run; each runs off a.mu in the same WaitGroup as stopRootfsWorkersAtLoss and killResidentGens, which still run only for a resident (gens non-nil); the kills go to root's existing /stop through KillOneShot; no read added whole:Route@137,whole:Route@394 64ce2f74e65941ea2a731518c773cb9b27456f2db298c69ed4e02de375b1777f
-internal/activator/rootfsrelease.go Service.releaseAdmitLocked legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R, R1 [pf R1.10]: new; the owner's half of a release's admission under a.mu: refuses while a run holds the cmd unit, and for an awake owner mirrors Swap's exclusions (worker or non-instance kind, a layout other than flat or nested through the existing swapLayout, members, a raised parent, a resize, a cmd start in flight); in-memory only; refusals only;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 9 (PF-17): the busy check is holdBusyLocked(e, RoleCmd) where it was cmdBusyLocked(e): only cmd-unit holds and cmd-unit lease stops refuse a release command, never a session, whose tty unit is its own; fix round 1 (Astra P2 1): the start-in-flight check is holdStartInFlightLocked(e, RoleCmd), the cmd unit's start alone, so a session's start in flight does not refuse a release either (swap admission and the switch still count both roles through cmdStartInFlightLocked); no read added, read sites unchanged registry:Kind@309,whole:Route@311,whole:Route@390 6391aa0cdd8e5a5656f3fc6c6724ac82250f949a832e0ad86a9068c44e2dba50
+internal/activator/rootfsrelease.go Service.releaseAdmitLocked legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R, R1 [pf R1.10]: new; the owner's half of a release's admission under a.mu: refuses while a run holds the cmd unit, and for an awake owner mirrors Swap's exclusions (worker or non-instance kind, a layout other than flat or nested through the existing swapLayout, members, a raised parent, a resize, a cmd start in flight); in-memory only; refusals only;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 9 (PF-17): the busy check is holdBusyLocked(e, RoleCmd) where it was cmdBusyLocked(e): only established cmd-unit holds and cmd-unit lease stops refuse a release command, never a started session, whose tty unit is its own; cmdStartInFlightLocked now also counts a session's start in flight (merge ruling M2), so a release is refused during either role's start window, short and bounded, as swap admission is (fix round 2 ruling: a refusal at admission is not executed and takes the ordinary retry); no read added, read sites unchanged registry:Kind@309,whole:Route@311,whole:Route@390 d1f6ba85b88b217e9d82caa7f033f20f61429bc319f48099e60e3aea37234916
internal/activator/rootfsrelease.go Service.runRelease legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R, R1: new; the one place a release command runs. Refuses while any record of the host is open; skips the row's good build (releaseRan); reads the declared processes (declaredProcesses: the existing staged-manifest read) and refuses on a read error, never treating it as no release; runs only when releaseDue; needs a lease watch and a ReleaseBackend; its gate is the caller's plus the lease's Err and its safety deadline more than releaseStopLead (cmdStopBound, 2 min) away; creates the record under a.mu after releaseAdmitLocked; publishes the generations file and the build state (recordBuild) before anything runs; times out at the manifest's timeout_sec (default, capped at runs.MaxTimeout); ReleaseEnv; a supervisor stops the unit ahead of the lease's safety deadline; StartRelease under the exec gate; polls the unit (root's existing cmd status); stops and settles it (the existing cmd hold's stop, cmdStopBound); only a non-zero exit, a signal or the timeout with the unit proven gone is the build's failure (*ReleaseError); registry:Host sites are the record key and log lines;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 9: newCmdHold takes the hold's role; a release command's hold is instancectl.RoleCmd, the unit it runs in; nothing else changed, no read added registry:Host@184,whole:Route@2955,whole:Route@3184,whole:Route@3672,whole:Route@3701,whole:Route@5749,whole:Route@589,whole:Route@6217,whole:Route@6494,whole:Route@6924,whole:Route@817,whole:Route@902 442d93ec958dea41fe2eb1c49b1600e77450fc54c79a236c9cdd7c613d48f972
internal/host/runexec.go runsWorker.execute legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): runs one picked run to its result in the bucket; every root action goes through instance control;rev3=PROPOSED-325;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=emits the run's start and end as member log events through the agent's EventSink; reads unchanged;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 7a (INV-2): sets CmdSpec.AfterSettled to remove the run's directory (runs.RemoveRunDir under the instance's own directory, as cleanUp did) once the activator has proven no unit of the run runs; finish and cleanUp take removeDir, true only on the incarnation refusal before RunCmd; the directory goes later or at the same point, never earlier; no read added file:Prepare@1905,whole:Route@2916 43bd160066b4d3e7aef00e3891001bc5ffa9a40f597cb6e5cc7215eae2814df9
internal/host/units/carlos-instance-cmd@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=the cmd unit template (applied by PID 1 as root; its process runs as carlos): extends the J4 seed pattern to the run role. The template equals the seed template outside named lines, and the template-equality test pins that. Root lays out a staged executable validated by the same refuseStagedExe the seed and generation paths use, then starts this unit, which runs as carlos with the instance's own reach. No new trust of registry, /data or agent-asserted content beyond the seed path;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else file:external@0 925113f4c51c091f0da65c2c67c5902aa35ab37abbe6491ca935820517e8149d
@@ -96,7 +96,7 @@ internal/activator/rootfs_service.go Service.rootfsTick legacy accepted-legacy a
@remove internal/instancectl/cmd.go Server.handleCmdStatus
@removed internal/instancectl/cmd.go Server.handleCmdStatus H3 census-ruling-rootfs-apps-6;absent;basis=rootfs Plan 6 Task 6: moved whole to Server.oneShotStatus (role-aware; see its claim), not deleted: no check, refusal or validation is lost
@coverage . fbc28f10f89cd03cac31bae0d798ae7f707eb7671284a6115abd8c1c214369b6
-@coverage internal/activator 59f23fcd48a8690cc862cf5314bac93bec1ff51c7d88dae252bdf19636335d7c
+@coverage internal/activator 57739010c191b3e5674925faaea8263d1709f64bb1868766bedb51229a9a94ff
@coverage internal/appconfig cac8d8ef7538a456d034801c95ce6508a4983e5516b3bbbd302bec0fbafdd479
@coverage internal/host 69c09eff5b3b87756182f001086b391c02b867e82e8d21ea40722c992fec43a7
@coverage internal/host/units c3cc4f3b917fdb938f20d406b1704ec54e24553851c298e312056d397d10b0e1