carlos / platform Public

activator: a session's start in flight does not refuse a release; the lease witness waits for both interruptions (rootfs plan 6 task 9 fix round 1)

Astra P2 1: release admission asks holdStartInFlightLocked(e, RoleCmd),
the cmd unit's start alone, as its busy check counts cmd holds only
(PF-17); swap admission and the switch still count both roles through
cmdStartInFlightLocked. Astra P2 2: the lease-loss witnesses wait for
both holds' interruption and first settle before their ordering checks.
Census overlay re-proposed (releaseAdmitLocked's claim).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 5aa80f3a70d16539d6726dfda0a537ac150d26ab parent e4c4551
7 files changed, +99 −17
  • docs/superpowers/notes/census-proposal-rootfs-apps-6.md +2 −2
  • internal/activator/cmd.go +17 −10
  • internal/activator/cmd_test.go +52 −0
  • internal/activator/rootfs_cmd_lease_test.go +20 −0
  • internal/activator/rootfsrelease.go +4 −1
  • 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>bae5v17kq</task-id> <tool-use-id>toolu_01TEJse82LNRjYk1vvc6iGUw</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ba9fa944-a429-4788-9b3c-f2b2f42617f3/tasks/bae5v17kq.output</output-file> <status>completed</status> <summary>Background command "Wait for CI on the #471 rerun commit" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>a2ffac1fc9286a733</task-id> <tool-use-id>toolu_01HVRsWWMHSdYEtBciuGatYc</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ba9fa944-a429-4788-9b3c-f2b2f42617f3/tasks/a2ffac1fc9286a733.output</output-file> <status>completed</status> <summary>Agent "Release v0.32.1 to dev" is waiting on its own background work</summary> <note>This agent stopped with background work of its own still running. It may resume on its own when that work completes or reports, and the same task-id notifies again if it does; the result below may be interim.</note> <result>Waiting on the build and Luna pass 2.</result> <usage><subagent_tokens>120362</subagent_tokens><tool_uses>35</tool_uses><duration_ms>197840</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>a2ffac1fc9286a733</task-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ba9fa944-a429-4788-9b3c-f2b2f42617f3/tasks/a2ffac1fc9286a733.output</output-file> <status>completed</status> <summary>Agent "Release v0.32.1 to dev" is waiting on its own background work</summary> <note>This agent stopped with background work of its own still running. It may resume on its own when that work completes or reports, and the same task-id notifies again if it does; the result below may be interim.</note> <result>Waiting on the build and Luna pass 3.</result> <usage><subagent_tokens>122309</subagent_tokens><tool_uses>38</tool_uses><duration_ms>208074</duration_ms></usage> </task-notification>

Attributed to this commit: 15.3 g CO₂e (1,904,697 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 7e95a150b..2c003ce0e 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; cmdStartInFlightLocked now also counts a session's start in flight (merge ruling M2), so a release is refused while one is; 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 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.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` → `1dca4fb512d2fae76fd23a4a36fbf50402eaa6a9223a025ad17d91c5cbedb682`.
+Seal: `1379d066c8dd2335d95d5f6e9c7bce65ff57f00b2b287a308d9b3f47911ae5e7` → `9272ccd377b4f4aa0e0d43cf58c246db99203afd6a856cfcfe279c5a4402553f`.
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 a2b8a64ca..ef4657376 100644
--- a/internal/activator/cmd.go
+++ b/internal/activator/cmd.go
@@ -411,17 +411,24 @@ func holdsLocked(e *actEntry) []*cmdHold {
// session execs its generation's build as a run does. The caller holds
// a.mu.
func cmdStartInFlightLocked(e *actEntry) bool {
- for _, h := range []*cmdHold{e.cmd, e.tty} {
- if h == nil || !h.starting {
- continue
- }
- select {
- case <-h.started:
- default:
- return true
- }
+ 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.
+func holdStartInFlightLocked(e *actEntry, role instancectl.Role) bool {
+ h := *holdSlot(e, role)
+ if h == nil || !h.starting {
+ return false
+ }
+ select {
+ case <-h.started:
+ return false
+ default:
+ return true
}
- return false
}
// switchPendingLocked is a live overlap successor of e: a member spawning
diff --git a/internal/activator/cmd_test.go b/internal/activator/cmd_test.go
index 83bc7f899..f45f188d9 100644
--- a/internal/activator/cmd_test.go
+++ b/internal/activator/cmd_test.go
@@ -1193,6 +1193,58 @@ 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) {
+ t.Parallel()
+ for _, session := range []bool{true, false} {
+ t.Run(map[bool]string{true: "session", false: "run"}[session], func(t *testing.T) {
+ a, cb, _ := testCmdActivator(t, Config{})
+ rt := testRoute("c.example.com")
+ arrangeAwake(t, a, rt)
+ cb.gate, cb.entered = make(chan struct{}), make(chan struct{})
+ spec := CmdSpec{RunID: "run_a"}
+ if session {
+ spec = sessionSpec("ses_a")
+ }
+ type ran struct {
+ h CmdHandle
+ err error
+ }
+ done := make(chan ran, 1)
+ go func() {
+ h, err := a.RunCmd(context.Background(), rt, spec)
+ done <- ran{h, err}
+ }()
+ <-cb.entered
+ a.mu.Lock()
+ e := a.entries[rt.Host]
+ inFlight := cmdStartInFlightLocked(e)
+ admit := a.releaseAdmitLocked(e)
+ a.mu.Unlock()
+ close(cb.gate)
+ r := <-done
+ if r.err != nil {
+ t.Fatal(r.err)
+ }
+ 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 session && admit != nil {
+ t.Fatalf("a release beside a session's start in flight: %v, want admitted", admit)
+ }
+ if !session && !errors.Is(admit, errSwapBusy) {
+ t.Fatalf("a release beside a run's start in flight: %v, want errSwapBusy", admit)
+ }
+ })
+ }
+}
+
// PF-18: with only a session attached (e.tty), each idle and stop check
// leaves the entry as it is: the idle sleep, the plans awake ceiling, the
// plan-disabled stop of a route, and the no-restart of a worker a lapse
diff --git a/internal/activator/rootfs_cmd_lease_test.go b/internal/activator/rootfs_cmd_lease_test.go
index 4b73775c8..730f11aee 100644
--- a/internal/activator/rootfs_cmd_lease_test.go
+++ b/internal/activator/rootfs_cmd_lease_test.go
@@ -992,6 +992,21 @@ func TestResidentLeaseLossKillsTheSessionBesideTheRun(t *testing.T) {
}
}
waitFor(t, "the generation's kill", func() bool { return len(b.killTimes()) > 0 })
+ // killsOf is published as a kill is asked, before its event is
+ // recorded, and each hold's stop records its reason after its kill
+ // returns (fix round 1, Astra P2 2): wait for both holds to read as
+ // interrupted and for each one's first settle attempt to have ended.
+ waitFor(t, "both holds interrupted and their first settles over", func() bool {
+ for _, c := range []struct {
+ h CmdHandle
+ unit *leaseCmdUnit
+ }{{run, b.unit}, {ses, b.ttyUnit}} {
+ if why, _ := c.h.Interrupted(); why == "" || c.unit.settleCount() < 1 || !c.h.(*cmdRun).h.settlingDone() {
+ return false
+ }
+ }
+ return true
+ })
// Each lease stop kills its own unit before it settles it; the two
// run at once, so one's settle may come before the other's kill.
ev := b.events()
@@ -1198,6 +1213,11 @@ func TestHibernatingRootfsLeaseLossKillsItsSession(t *testing.T) {
t.Fatalf("the %s unit was killed %s after the loss", role, d)
}
}
+ waitFor(t, "both holds interrupted", func() bool {
+ r, _ := run.Interrupted()
+ s, _ := ses.Interrupted()
+ return r != "" && s != ""
+ })
time.Sleep(50 * time.Millisecond)
if n := len(b.killTimes()); n != 0 {
t.Fatalf("a hibernating row's generation was killed %d times at the loss", n)
diff --git a/internal/activator/rootfsrelease.go b/internal/activator/rootfsrelease.go
index 53f2c8b66..11fcd29df 100644
--- a/internal/activator/rootfsrelease.go
+++ b/internal/activator/rootfsrelease.go
@@ -589,7 +589,10 @@ func (a *Service) releaseAdmitLocked(e *actEntry) error {
if len(e.ops.members) > 0 || e.ops.raised || e.ops.resizing {
return errSwapBusy
}
- if cmdStartInFlightLocked(e) {
+ // 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) {
return errSwapBusy
}
return nil
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 24c10f11e..4fffd9ff4 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 1dca4fb512d2fae76fd23a4a36fbf50402eaa6a9223a025ad17d91c5cbedb682
+plan14-root-reads-rootfs-apps-6.tsv 9272ccd377b4f4aa0e0d43cf58c246db99203afd6a856cfcfe279c5a4402553f
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 c7984fddc..d02c23591 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 74f64f4524a22200b784d5dd4cb4506d4eef3e9b9d95376cc80c2bddeb5ca182 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; cmdStartInFlightLocked now also counts a session's start in flight (merge ruling M2), so a release is refused while one is; no read added, read sites unchanged registry:Kind@309,whole:Route@311,whole:Route@390 34030a95c61049ed6a25bd9b3e24690d72e9532aa4d6ce58e237ff085e15dc18
+@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 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; cmdStartInFlightLocked now also counts a session's start in flight (merge ruling M2), so a release is refused while one is; no read added, read sites unchanged registry:Kind@309,whole:Route@311,whole:Route@390 34030a95c61049ed6a25bd9b3e24690d72e9532aa4d6ce58e237ff085e15dc18
+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.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 b050e60f27b14ee5a75d64603bcbce3a0b23e5af4c9d562c64992477f0bae345
+@coverage internal/activator 59f23fcd48a8690cc862cf5314bac93bec1ff51c7d88dae252bdf19636335d7c
@coverage internal/appconfig cac8d8ef7538a456d034801c95ce6508a4983e5516b3bbbd302bec0fbafdd479
@coverage internal/host 69c09eff5b3b87756182f001086b391c02b867e82e8d21ea40722c992fec43a7
@coverage internal/host/units c3cc4f3b917fdb938f20d406b1704ec54e24553851c298e312056d397d10b0e1