carlos / platform Public

cli: the stdin reader cannot block past its stop (rootfs plan 6 task 13 fix round 2)

Astra's remaining P2: readiness can vanish between select and read(2)
(a restore to canonical mode, a Ctrl-C flush), and a blocking read then
waited for the next line while cleanup joined it.
- fdInput puts stdin in O_NONBLOCK at its first read and Close puts the
  flags back after the reader has returned; EAGAIN and EINTR go back to
  the stop-aware select.
- The session tells its reader to stop before it restores the terminal.
- unixTerm takes each descriptor once: os.File.Fd clears O_NONBLOCK on
  the open file description stdin and stdout usually share.
- stdout and stderr go through fdOutput, which waits through EAGAIN
  instead of failing a write on that shared description.
Tested on a real PTY (/dev/ptmx).

Census: overlay rootfs-apps-6 re-proposed (openSession's and
fdInput.Read's claims extended), seal 977d75ba -> 3e6d53be; the
record-write census re-pins openSession.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 04b064439774e113e9d977fa5b6e9362116c6cd6 parent 0fb1693
9 files changed, +314 −33
  • docs/superpowers/notes/census-proposal-rootfs-apps-6.md +1 −1
  • interactive_cli.go +12 −5
  • interactive_cli_test.go +29 −1
  • interactive_term_linux_test.go +148 −0
  • interactive_term_other.go +5 −0
  • interactive_term_unix.go +110 −19
  • internal/provision/rootfs_apps_6_census_test.go +3 −1
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-rootfs-apps-6.tsv +5 −5

Intent

Human

<task-notification> <task-id>aebb31b964a387a07</task-id> <tool-use-id>toolu_01VdXHWsdHtwvRQwN7p17xMU</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ba9fa944-a429-4788-9b3c-f2b2f42617f3/tasks/aebb31b964a387a07.output</output-file> <status>completed</status> <summary>Agent "Plan 6 Task 13: CLI run -it, console" 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. I fixed P2s 1, 2, 3 and 5 from Astra's review, then applied Paul's five approved copy-gap strings in a second commit. **Commits** - 51d03d8a: fix round 1. - P2 1: a terminal restore now counts only once it succeeds. A failed restore is tried again and prints the one diagnostic line you specified. - P2 2: the stdin reader can be stopped, and the session's cleanup waits for it to exit. - P2 3: before the upgrade, the dial reads at most 80 KiB of a refusal, so a huge or endless body ends by size. - P2 5: a failed or short write to the terminal ends the session with exit 1. It prints no line, because there is no approved string for it. - The census overlay was re-proposed with the earlier claims carried over. Four claims gained a fix-round sentence and one unit is new (`fdInput.Read`). The seal moves from e1618040 to 977d75ba, and the record-write census re-pins `openSession`. - 0fb16932: RFS-6-C70 to C74. - C70 is the `console` line in `carlos help`, after `run`. - C71 to C73 are the reasons for a hangup, an interruption with no detail, and an unknown end code. - C74 is the line printed when carlos gets SIGTERM, SIGHUP or an outside SIGINT after the session has started; the exit code stays 128+n. - The five rows are added to the deck (C70's file cell marks it as a fragment of the usage text), to `copy-approved.json`, and to `rootfsCopyIDs` and `rootfsCopyBuilt`. - The root envelope was re-pinned in the overlay; the seal stays 977d75ba. **Tests:** new and touched tests pass, run once (`-race` once on the fix round). All 5 mutations were caught, the copy, docsite and census gates pass, and the darwin/arm64, windows/amd64 and linux/arm64 builds are clean. The fix report is appended to `task-13-report.md`.</result> <usage><subagent_tokens>367104</subagent_tokens><tool_uses>43</tool_uses><duration_ms>760521</duration_ms></usage> </task-notification>

Human

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

Human

<task-notification> <task-id>b2k8joepj</task-id> <tool-use-id>toolu_014UUCkr8jQVL69Yy9RmLj5F</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ba9fa944-a429-4788-9b3c-f2b2f42617f3/tasks/b2k8joepj.output</output-file> <status>completed</status> <summary>Background command "Wait for the copy review result" completed (exit code 0)</summary> </task-notification>

diff --git a/docs/superpowers/notes/census-proposal-rootfs-apps-6.md b/docs/superpowers/notes/census-proposal-rootfs-apps-6.md
index 789624505..6735f0059 100644
--- a/docs/superpowers/notes/census-proposal-rootfs-apps-6.md
+++ b/docs/superpowers/notes/census-proposal-rootfs-apps-6.md
@@ -121,6 +121,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- new `run.go:runRun`: reads +file:Open; written legacy, accepted-legacy, frozen
- reads `internal/activator/cmdunit.go:cmdUnit.StopAndSettle`: +registry:Host, +whole:Route; keeps legacy, task accepted-legacy
-Seal: `1379d066c8dd2335d95d5f6e9c7bce65ff57f00b2b287a308d9b3f47911ae5e7` → `977d75ba26008adb69ada0897ea5cdc37efa7b1019ccfd1c56ad4f0f9795f7b1`.
+Seal: `1379d066c8dd2335d95d5f6e9c7bce65ff57f00b2b287a308d9b3f47911ae5e7` → `3e6d53be6bcf12f9d186f3157262a895a5c59b7c13f15012ac296c5e80ff8b12`.
Overlay: `internal/provision/testdata/plan14-root-reads-rootfs-apps-6.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/interactive_cli.go b/interactive_cli.go
index 0f2f314e2..82c830f24 100644
--- a/interactive_cli.go
+++ b/interactive_cli.go
@@ -110,6 +110,9 @@ type terminal interface {
type sessionInput interface {
io.Reader
Stop()
+ // Close undoes what reading set up (fdInput's O_NONBLOCK), once the
+ // reader has returned.
+ Close() error
}
// errInputStopped is a sessionInput's Read after Stop.
@@ -413,23 +416,27 @@ func (s *session) keepalive() {
}
}
-// end is every way out's first step: the terminal restored, then the
-// session's goroutines stopped, its connection closed and the stdin copier
-// waited for. A send stuck on a console that stopped reading is cut off by
+// end is every way out's first step: the stdin reader told to stop, the
+// terminal restored, then the session's goroutines stopped, its connection
+// closed, the stdin copier waited for and the input closed. A send stuck on a console that stopped reading is cut off by
// the write deadline, so neither the close nor the wait hangs on it.
func (s *session) end() {
+ // The reader is told first: restoring the terminal can take back input
+ // it was about to read, and a Stop that comes after could find it in a
+ // read waiting for the next line.
+ s.c.in.Stop()
s.restoreTerminal()
s.stopOnce.Do(func() {
close(s.stop)
if s.resizes != nil {
s.resizes()
}
- s.c.in.Stop()
_ = s.ws.SetWriteDeadline(time.Now().Add(time.Second))
_ = s.ws.Close()
if s.copier != nil {
<-s.copier
}
+ _ = s.c.in.Close()
})
}
@@ -566,7 +573,7 @@ func openSession(sess *apiSession, acct apiAcct, app, host string, open interact
signal.Notify(sig, os.Interrupt, syscall.SIGTERM, syscall.SIGHUP)
defer signal.Stop(sig)
c := sessionClient{dial: interactive.Dial, term: newTerminal(os.Stdin, os.Stdout),
- in: newInput(os.Stdin), out: os.Stdout, errw: os.Stderr, signals: sig}
+ in: newInput(os.Stdin), out: newOutput(os.Stdout), errw: newOutput(os.Stderr), signals: sig}
door := sess.c.base + apiPath(acct, app, "/instances/"+url.PathEscape(host)+"/interactive")
return runSession(context.Background(), c, door, sess.c.base, sess.c.token, host, app, open)
}
diff --git a/interactive_cli_test.go b/interactive_cli_test.go
index 44d9d85c2..588419c76 100644
--- a/interactive_cli_test.go
+++ b/interactive_cli_test.go
@@ -234,7 +234,9 @@ func nextFrame(ws *websocket.Conn) (byte, []byte, error) {
// delay, and returned records that a Read has returned since.
type pipeInput struct {
*io.PipeReader
+ log *eventLog // "stop", when set
delay time.Duration
+ closed []string // "after its reader" or "while reading", per Close
returned chan struct{}
once sync.Once
}
@@ -251,7 +253,22 @@ func (p *pipeInput) Read(b []byte) (int, error) {
return n, err
}
+// Close records that the session closed its input, and whether its reader
+// had returned by then.
+func (p *pipeInput) Close() error {
+ select {
+ case <-p.returned:
+ p.closed = append(p.closed, "after its reader")
+ default:
+ p.closed = append(p.closed, "while reading")
+ }
+ return nil
+}
+
func (p *pipeInput) Stop() {
+ if p.log != nil {
+ p.log.add("stop")
+ }
go func() {
time.Sleep(p.delay)
p.PipeReader.CloseWithError(errInputStopped)
@@ -275,7 +292,9 @@ func newRig(t *testing.T) *sessionRig {
inR, inW := io.Pipe()
t.Cleanup(func() { inW.Close() })
r := &sessionRig{log: l, term: newFakeTerm(l, 120, 40), inW: inW, out: &lockedBuffer{}, sig: make(chan os.Signal, 1)}
- r.c = sessionClient{dial: interactive.Dial, term: r.term, in: newPipeInput(inR), out: r.out, errw: stderrLog{l}, signals: r.sig}
+ in := newPipeInput(inR)
+ in.log = l
+ r.c = sessionClient{dial: interactive.Dial, term: r.term, in: in, out: r.out, errw: stderrLog{l}, signals: r.sig}
return r
}
@@ -456,6 +475,8 @@ func (panicReader) Read([]byte) (int, error) { panic("copier fault") }
func (panicReader) Stop() {}
+func (panicReader) Close() error { return nil }
+
// TestSessionRestoresTheTerminalOnEveryExit (Review Focus 1): whichever way
// a started session ends, the terminal is restored exactly once, and before
// the last line.
@@ -881,6 +902,13 @@ func TestSessionJoinsItsStdinReader(t *testing.T) {
default:
t.Fatal("runSession returned with its stdin reader still in Read")
}
+ // Fix round 2: the reader is told to stop before the terminal is
+ // restored, and the input is closed only after the reader returned.
+ ev := r.log.all()
+ stop, restore := slices.Index(ev, "stop"), slices.Index(ev, "restore")
+ if stop < 0 || restore < 0 || stop > restore || !slices.Equal(in.closed, []string{"after its reader"}) {
+ t.Fatalf("events %q, input closed %q; want stop, then restore, then the input closed once after its reader", ev, in.closed)
+ }
}
// failWriter fails every write.
diff --git a/interactive_term_linux_test.go b/interactive_term_linux_test.go
new file mode 100644
index 000000000..b78c99924
--- /dev/null
+++ b/interactive_term_linux_test.go
@@ -0,0 +1,148 @@
+package main
+
+import (
+ "bytes"
+ "errors"
+ "fmt"
+ "os"
+ "testing"
+ "time"
+
+ "golang.org/x/sys/unix"
+)
+
+// openPTY is a pseudo-terminal pair from /dev/ptmx (posix_openpt).
+func openPTY(t *testing.T) (master, slave *os.File) {
+ t.Helper()
+ m, err := os.OpenFile("/dev/ptmx", os.O_RDWR|unix.O_NOCTTY, 0)
+ if err != nil {
+ t.Skipf("no /dev/ptmx: %v", err)
+ }
+ if err := unix.IoctlSetPointerInt(int(m.Fd()), unix.TIOCSPTLCK, 0); err != nil {
+ m.Close()
+ t.Fatal(err)
+ }
+ n, err := unix.IoctlGetInt(int(m.Fd()), unix.TIOCGPTN)
+ if err != nil {
+ m.Close()
+ t.Fatal(err)
+ }
+ s, err := os.OpenFile(fmt.Sprintf("/dev/pts/%d", n), os.O_RDWR|unix.O_NOCTTY, 0)
+ if err != nil {
+ m.Close()
+ t.Fatal(err)
+ }
+ t.Cleanup(func() { s.Close(); m.Close() })
+ return m, s
+}
+
+// TestFdInputStopsOnAPTYWhoseInputVanishes (fix round 2): on a real PTY in
+// raw mode, a keystroke makes stdin ready; between the select and the read
+// the terminal goes back to canonical mode and its input is flushed (as a
+// cleanup's restore and a Ctrl-C do). The read finds nothing: EAGAIN, not a
+// wait for the next line, so when the reader is stopped while it is in
+// there, Read returns errInputStopped within a second. Close puts the
+// descriptor's flags back.
+func TestFdInputStopsOnAPTYWhoseInputVanishes(t *testing.T) {
+ master, slave := openPTY(t)
+ // The descriptor, taken once: os.File.Fd would clear O_NONBLOCK again.
+ fd := int(slave.Fd())
+ term := newTerminal(slave, slave)
+ restore, err := term.MakeRaw()
+ if err != nil {
+ t.Fatal(err)
+ }
+ before, err := unix.FcntlInt(uintptr(fd), unix.F_GETFL, 0)
+ if err != nil {
+ t.Fatal(err)
+ }
+ in := newInput(slave).(*fdInput)
+ if before&unix.O_NONBLOCK != 0 {
+ t.Fatalf("the slave starts in O_NONBLOCK (%#x): the test cannot tell", before)
+ }
+ vanished := make(chan struct{})
+ in.afterReady = func() {
+ select {
+ case <-vanished:
+ return
+ default:
+ }
+ if err := restore(); err != nil {
+ t.Error(err)
+ }
+ if err := unix.IoctlSetInt(fd, unix.TCFLSH, unix.TCIFLUSH); err != nil {
+ t.Error(err)
+ }
+ close(vanished)
+ }
+ if _, err := master.Write([]byte("a")); err != nil {
+ t.Fatal(err)
+ }
+ done := make(chan error, 1)
+ go func() {
+ _, err := in.Read(make([]byte, 16))
+ done <- err
+ }()
+ <-vanished
+ time.Sleep(50 * time.Millisecond) // the reader is past its stop check
+ in.Stop()
+ select {
+ case err := <-done:
+ if !errors.Is(err, errInputStopped) {
+ t.Fatalf("Read = %v, want errInputStopped", err)
+ }
+ case <-time.After(time.Second):
+ // Free the blocked read before failing, so the test ends.
+ master.Write([]byte("\n"))
+ t.Fatal("Read still blocked 1s after the restore, the flush and Stop")
+ }
+ if got, err := unix.FcntlInt(uintptr(fd), unix.F_GETFL, 0); err != nil || got&unix.O_NONBLOCK == 0 {
+ t.Fatalf("flags while reading = %#x, %v; want O_NONBLOCK set", got, err)
+ }
+ if err := in.Close(); err != nil {
+ t.Fatal(err)
+ }
+ if after, err := unix.FcntlInt(uintptr(fd), unix.F_GETFL, 0); err != nil || after != before {
+ t.Fatalf("flags after Close = %#x, %v; want %#x as before", after, err, before)
+ }
+}
+
+// TestFdOutputWaitsOnAFullTerminal (fix round 2): with the terminal's open
+// file description in O_NONBLOCK (fdInput's, for the session), a write
+// larger than the terminal's buffer is not cut short by EAGAIN: it waits
+// for the reader and writes all of it.
+func TestFdOutputWaitsOnAFullTerminal(t *testing.T) {
+ master, slave := openPTY(t)
+ fd := int(slave.Fd())
+ flags, err := unix.FcntlInt(uintptr(fd), unix.F_GETFL, 0)
+ if err != nil {
+ t.Fatal(err)
+ }
+ out := newOutput(slave)
+ if _, err := unix.FcntlInt(uintptr(fd), unix.F_SETFL, flags|unix.O_NONBLOCK); err != nil {
+ t.Fatal(err)
+ }
+ t.Cleanup(func() { unix.FcntlInt(uintptr(fd), unix.F_SETFL, flags) })
+ const size = 1 << 20
+ got := make(chan int, 1)
+ go func() {
+ time.Sleep(100 * time.Millisecond) // let the buffer fill first
+ buf := make([]byte, 64<<10)
+ total := 0
+ for total < size {
+ n, err := master.Read(buf)
+ total += n
+ if err != nil {
+ break
+ }
+ }
+ got <- total
+ }()
+ n, err := out.Write(bytes.Repeat([]byte("y"), size))
+ if err != nil || n != size {
+ t.Fatalf("Write = %d, %v; want all %d bytes", n, err, size)
+ }
+ if total := <-got; total < size {
+ t.Fatalf("the terminal got %d bytes, want %d", total, size)
+ }
+}
diff --git a/interactive_term_other.go b/interactive_term_other.go
index f5e65b9f6..ff77a9b8e 100644
--- a/interactive_term_other.go
+++ b/interactive_term_other.go
@@ -7,6 +7,7 @@ package main
import (
"errors"
+ "io"
"os"
)
@@ -32,3 +33,7 @@ type fileInput struct{ *os.File }
func newInput(f *os.File) sessionInput { return fileInput{f} }
func (fileInput) Stop() {}
+
+func (fileInput) Close() error { return nil }
+
+func newOutput(f *os.File) io.Writer { return f }
diff --git a/interactive_term_unix.go b/interactive_term_unix.go
index b69c383b2..3e4364963 100644
--- a/interactive_term_unix.go
+++ b/interactive_term_unix.go
@@ -16,16 +16,19 @@ import (
"golang.org/x/sys/unix"
)
-// unixTerm is stdin and stdout.
-type unixTerm struct{ in, out *os.File }
+// unixTerm is stdin and stdout, by descriptor. Each *os.File's Fd is
+// called once, here: Fd puts its file back in blocking mode, and stdin and
+// stdout usually share one open file description, so a later call would
+// undo fdInput's O_NONBLOCK in the middle of a session.
+type unixTerm struct{ in, out int }
-func newTerminal(in, out *os.File) terminal { return &unixTerm{in: in, out: out} }
+func newTerminal(in, out *os.File) terminal { return &unixTerm{in: int(in.Fd()), out: int(out.Fd())} }
// termSupported: sessions work here.
func termSupported() error { return nil }
-func isTTY(f *os.File) bool {
- _, err := unix.IoctlGetTermios(int(f.Fd()), ioctlGetTermios)
+func isTTY(fd int) bool {
+ _, err := unix.IoctlGetTermios(fd, ioctlGetTermios)
return err == nil
}
@@ -34,7 +37,7 @@ func (t *unixTerm) IsTerminal() bool { return isTTY(t.in) && isTTY(t.out) }
// MakeRaw is cfmakeraw on stdin: no echo, no line editing, no signals from
// keys, no flow control and no output processing, one byte at a time.
func (t *unixTerm) MakeRaw() (func() error, error) {
- fd := int(t.in.Fd())
+ fd := t.in
old, err := unix.IoctlGetTermios(fd, ioctlGetTermios)
if err != nil {
return nil, err
@@ -69,7 +72,7 @@ func (t *unixTerm) MakeRaw() (func() error, error) {
}
func (t *unixTerm) Size() (uint16, uint16, error) {
- ws, err := unix.IoctlGetWinsize(int(t.out.Fd()), unix.TIOCGWINSZ)
+ ws, err := unix.IoctlGetWinsize(t.out, unix.TIOCGWINSZ)
if err != nil {
return 0, 0, err
}
@@ -110,20 +113,65 @@ const inputPoll = 100 * time.Millisecond
// fdInput reads a file descriptor (stdin) through select with a timeout,
// so Stop ends a Read in progress within inputPoll instead of leaving it
-// blocked in read(2) for the next keystroke.
+// blocked in read(2) for the next keystroke. The descriptor is put in
+// O_NONBLOCK at the first Read and its flags put back by Close: readiness
+// can vanish between select and read (a restore to canonical mode, a
+// flush), and then read answers EAGAIN, which goes back to the stop-aware
+// select, instead of waiting for the next line.
type fdInput struct {
fd int
stopped atomic.Bool
+
+ mu sync.Mutex
+ armed bool // O_NONBLOCK set by this input
+ oldFlags int
+ // afterReady, a test seam, runs between a select that found the
+ // descriptor ready and the read.
+ afterReady func()
}
func newInput(f *os.File) sessionInput { return &fdInput{fd: int(f.Fd())} }
func (in *fdInput) Stop() { in.stopped.Store(true) }
+// arm puts the descriptor in O_NONBLOCK, once, keeping its flags for Close.
+func (in *fdInput) arm() error {
+ in.mu.Lock()
+ defer in.mu.Unlock()
+ if in.armed {
+ return nil
+ }
+ flags, err := unix.FcntlInt(uintptr(in.fd), unix.F_GETFL, 0)
+ if err != nil {
+ return err
+ }
+ if _, err := unix.FcntlInt(uintptr(in.fd), unix.F_SETFL, flags|unix.O_NONBLOCK); err != nil {
+ return err
+ }
+ in.armed, in.oldFlags = true, flags
+ return nil
+}
+
+// Close puts the descriptor's flags back as the first Read found them. The
+// session calls it once its reader has returned.
+func (in *fdInput) Close() error {
+ in.mu.Lock()
+ defer in.mu.Unlock()
+ if !in.armed {
+ return nil
+ }
+ in.armed = false
+ _, err := unix.FcntlInt(uintptr(in.fd), unix.F_SETFL, in.oldFlags)
+ return err
+}
+
func (in *fdInput) Read(p []byte) (int, error) {
if in.fd < 0 || in.fd >= unix.FD_SETSIZE {
return 0, unix.EBADF
}
+ if err := in.arm(); err != nil {
+ return 0, err
+ }
for {
if in.stopped.Load() {
return 0, errInputStopped
@@ -140,21 +188,64 @@ func (in *fdInput) Read(p []byte) (int, error) {
case n == 0:
continue
}
+ if in.afterReady != nil {
+ in.afterReady()
+ }
if in.stopped.Load() {
return 0, errInputStopped
}
- for {
- n, err := unix.Read(in.fd, p)
- if err == unix.EINTR {
- continue
- }
- if err != nil {
- return 0, err
- }
- if n == 0 {
- return 0, io.EOF
+ n, err = unix.Read(in.fd, p)
+ switch {
+ case err == unix.EAGAIN || err == unix.EINTR:
+ continue // back to the stop-aware select
+ case err != nil:
+ return 0, err
+ case n == 0:
+ return 0, io.EOF
+ }
+ return n, nil
+ }
+}
+
+// fdOutput writes a descriptor (stdout, stderr) that may share its open
+// file description with stdin, which fdInput puts in O_NONBLOCK for the
+// session: a write the terminal cannot take yet (EAGAIN) waits until it can
+// and goes on, instead of failing as a short write.
+type fdOutput struct{ fd int }
+
+func newOutput(f *os.File) io.Writer { return &fdOutput{fd: int(f.Fd())} }
+
+func (o *fdOutput) Write(p []byte) (int, error) {
+ written := 0
+ for written < len(p) {
+ n, err := unix.Write(o.fd, p[written:])
+ if n > 0 {
+ written += n
+ }
+ switch {
+ case err == unix.EINTR:
+ case err == unix.EAGAIN:
+ if err := waitWritable(o.fd); err != nil {
+ return written, err
}
- return n, nil
+ case err != nil:
+ return written, err
+ }
+ }
+ return written, nil
+}
+
+// waitWritable blocks until fd can take a write.
+func waitWritable(fd int) error {
+ if fd < 0 || fd >= unix.FD_SETSIZE {
+ return unix.EBADF
+ }
+ for {
+ var w unix.FdSet
+ w.Set(fd)
+ _, err := unix.Select(fd+1, nil, &w, nil, nil)
+ if err != unix.EINTR {
+ return err
}
}
}
diff --git a/internal/provision/rootfs_apps_6_census_test.go b/internal/provision/rootfs_apps_6_census_test.go
index f3a8850d4..ca2762c86 100644
--- a/internal/provision/rootfs_apps_6_census_test.go
+++ b/internal/provision/rootfs_apps_6_census_test.go
@@ -75,6 +75,8 @@ package provision
// no record key built and nothing written.
// - Task 13 fix round 1: openSession wraps stdin in newInput; the same
// path literal, nothing written; re-pinned.
+// - Task 13 fix round 2: openSession wraps stdout and stderr in
+// newOutput; the same path literal, nothing written; re-pinned.
func rootfsApps6WriteCensusInventory() []censusEntry {
entries := append([]censusEntry(nil), fleetPublicRoutesWriteCensusInventory()...)
replacements := []censusEntry{
@@ -108,7 +110,7 @@ func rootfsApps6WriteCensusInventory() []censusEntry {
{"internal/console/apiinteractive.go", "Server.putGrant", "nonrecord", "sel:Put", "22a18ef45051da8cfb8a6a62ad8891afd28e3bf71cc26a541639cd2a1dc0a1ff"},
{"internal/console/server.go", "consolePerfSkip", "key-site", "lit:instances", "d4b65473d3702b49d79a799d46f078e4491b6e86a59a101dd4c1ce4d50f698e7"},
{"internal/console/runsweep.go", "Server.clearDeadMarker", "record-writer", "key:SetRecordInteractive", "3e26dfe2a13a9e3b6525fb3c4f4a54da79a464c061f95eaa9fadbaf1ee041f9a"},
- {"interactive_cli.go", "openSession", "key-site", "lit:instances", "35c4382b05ef131c2d37d834283f70adb78e7e782b7b540889599b8b9e6c19e8"},
+ {"interactive_cli.go", "openSession", "key-site", "lit:instances", "b9c99fbe10d5483f3531ef9d7c51b033deeb3fdf1ca2d64aa23900cf77802512"},
}
for _, a := range added {
for _, e := range entries {
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index ed51038fa..c9e8a0668 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 977d75ba26008adb69ada0897ea5cdc37efa7b1019ccfd1c56ad4f0f9795f7b1
+plan14-root-reads-rootfs-apps-6.tsv 3e6d53be6bcf12f9d186f3157262a895a5c59b7c13f15012ac296c5e80ff8b12
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 3eabe2b2c..f2eb5ffed 100644
--- a/internal/provision/testdata/plan14-root-reads-rootfs-apps-6.tsv
+++ b/internal/provision/testdata/plan14-root-reads-rootfs-apps-6.tsv
@@ -26,12 +26,12 @@
@legacy 438a9858d01281800b89923ab2c4bf47bba5c3eab23e07fe43af9a5e3a9ae755 internal/provision/reconcile.go Reconcile legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos), from its reconcile loops: each listed record is observed through the box's lifetime judge (ObserveWith: the record, then its host incarnation slot) before the shape, channel and scope checks, a stale record is left out and an unjudgeable one protected; the removal phase observes a row's own record key when the pass holds none for it under that key, and deletes a held row whose record is gone or stale through DeleteIfHold; a nil judge (claims on) is main's body; registry read sites unchanged, offsets moved; fix round 1: the removal phase observes a row's own key only under an account the listing trusts, so a retired or unmaterialised account's row keeps record gone, and the pass arms its own context with the judge; Task 7: under a judge an existing provisioned row of the record's own app and account follows the existing-row rules (heldByVanishedPredecessor and retireHeldPredecessor's DeleteIfHold first, the record then minted on the same pass; the hold; installRowLifetime), each a separate write under the host's hold lock; registry read sites unchanged, offsets moved;rev3=census-ruling-instance-egress-sizes-328-329;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=#328/#329 plan 1 Task 7: the pass reads its apps' policy objects (control/app-policy/<sqid>/<app>.json in the bucket) through the agent's PolicyCache, each verified with ReleasePub by apppolicy.VerifyKey (ed25519 over the policy's own domain line, bound to the account and app, unexpired, not future-dated; anything else is no policy), and carries the columns into its rows. New kinds registry:EgressAllow, registry:Size and registry:PolicyExpiresAt, one site each, all the assignment of a fresh row's columns (nr) from policies.cols; plus one whole:Route site, the existing row handed to policies.forRow. Other read sites unchanged, offsets moved; the agent's own pass, no root decision;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos, from its reconcile loops: after the scan, hands the in-scope records to cfg.Lifetimes (the box's lifetime index): Merge after a failed read or partial listing, Replace after a complete one, nothing on a dry run or with no index; the scan, judge and removal phases unchanged; the same 166 sites, no read added;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 2 and 5 (D5, spec §5.0): a seeded record over a row with a runtime is skipped and logged; a row with a runtime (or a new record with one) takes no seed; runtime and a rootfs row's hibernation are never converged from a record (a mismatch is logged; a record claiming a runtime its row lacks is not applied); reads Runtime of the record and the row; the box writes less; fix wave 1 (ceea6353, whole-branch P1-2): before minting a row for a record with no runtime and no row (both mint paths), the pass reads the app's kind marker once per app per pass (release.ReadAppKindMarker: one GET of the create-only kind.json from the release store s, through freshStore, validated by readAppKindMarker); a rootfs marker leaves the record unmaterialized and logged (an older console stripped its runtime), and a marker that cannot be read defers the mint this pass; a refusal before minting only, registry read sites unchanged, the box writes less; fix wave 2 (whole-branch r2 P1): the kind-marker read and its refusal apply only to a socket-backed instance record (DerivesPaths), so a static or upstream-backed record of a rootfs app, which carries no runtime by design, is minted as before with no read; fewer reads, registry read sites unchanged;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 10: the forward phase on the hub (FleetOwners set): the scan keeps the fleet-placed records it skips and counts records per host; a trash-only marker prefetch; disputed (failed-GET) hosts; armed, a host an in-scope and a fleet record both name is given neither, its journal waits and the removal phase keeps its row (+registry:Account, +registry:App, +registry:Host x2: the collision guard, its log line and report mark); the instance loop leaves a forward host; retirable excludes forward rows. Same record keys; writes only the registry (PutForward, DeleteForward); no bucket write.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 3: in the per-record loop, beside the RunSeen call, calls cfg.InteractiveSeen(rec) when the hook is set and the in-scope record carries an interactive-session marker (rec.Interactive != nil), once per record per pass, before the pass acts on it; the hook is the box worker's non-blocking note (Task 12). Same record keys and literal; no read added (registry read sites unchanged, 178); nothing written by the call registry:Account@36233,registry:Account@37498,registry:Account@55577,registry:Account@55623,registry:Account@56467,registry:Account@56844,registry:Account@57070,registry:Account@57137,registry:Account@57183,registry:Account@57276,registry:Account@57318,registry:Account@57966,registry:Account@58224,registry:Account@58764,registry:Account@58812,registry:Account@59185,registry:Account@59231,registry:Account@59476,registry:Account@59901,registry:Account@60389,registry:Account@61125,registry:Account@61318,registry:Account@61664,registry:Account@62229,registry:App@36206,registry:App@37471,registry:App@55597,registry:App@55635,registry:App@56479,registry:App@56856,registry:App@57082,registry:App@57157,registry:App@57195,registry:App@57296,registry:App@57978,registry:App@58236,registry:App@58776,registry:App@58824,registry:App@59205,registry:App@59243,registry:App@59488,registry:App@59913,registry:App@60401,registry:App@61137,registry:App@61330,registry:App@61676,registry:App@62241,registry:ClaimOwnership@36820,registry:DBPath@45677,registry:DBPath@45692,registry:DBPath@45938,registry:DBPath@46541,registry:DBPath@46554,registry:EgressAllow@35319,registry:Gate@42022,registry:Gate@42162,registry:Gate@42449,registry:Hibernate@40694,registry:Hibernate@40892,registry:Hibernate@40957,registry:Hibernate@41296,registry:Hibernate@41647,registry:Hibernate@41957,registry:HoldOp@60870,registry:HoldOp@60961,registry:HoldOp@61096,registry:HoldOp@61472,registry:Host@26327,registry:Host@55556,registry:Host@56443,registry:Host@56820,registry:Host@56984,registry:Host@57090,registry:Host@57986,registry:Host@58192,registry:Host@59068,registry:Host@59340,registry:Host@59455,registry:Host@59778,registry:Host@59875,registry:Host@60266,registry:Host@60363,registry:Host@60577,registry:Host@60952,registry:Host@61087,registry:Host@61291,registry:Host@61364,registry:Host@61463,registry:Host@61638,registry:Host@61713,registry:Host@61799,registry:Host@62206,registry:Kind@36962,registry:Kind@37225,registry:Kind@45595,registry:Kind@45608,registry:Kind@45718,registry:Kind@45731,registry:Kind@46452,registry:Kind@46463,registry:Kind@54680,registry:Kind@60568,registry:Kind@61078,registry:Kind@61454,registry:Kind@61629,registry:Kind@61790,registry:PolicyExpiresAt@35344,registry:Pool@54766,registry:Provisioned@36182,registry:Provisioned@37447,registry:Provisioned@54725,registry:RateLimit@42535,registry:RateLimit@42686,registry:RateLimit@42973,registry:Region@54755,registry:Replication@41381,registry:Replication@41508,registry:Runtime@28984,registry:Runtime@29162,registry:Runtime@31367,registry:Runtime@40061,registry:Runtime@40115,registry:Runtime@40319,registry:Seed@44075,registry:SeedSource@43558,registry:Size@35335,registry:Socket@45643,registry:Socket@45658,registry:Socket@45955,registry:Socket@46511,registry:Socket@46524,registry:Unit@45561,registry:Unit@45574,registry:Unit@46478,registry:Unit@46489,whole:ClaimOwnership@36823,whole:ClaimOwnership@36840,whole:Route@26309,whole:Route@26320,whole:Route@26338,whole:Route@27619,whole:Route@29479,whole:Route@29486,whole:Route@29526,whole:Route@29887,whole:Route@30225,whole:Route@30672,whole:Route@30723,whole:Route@30760,whole:Route@32432,whole:Route@32641,whole:Route@32980,whole:Route@32989,whole:Route@33035,whole:Route@35268,whole:Route@35827,whole:Route@36298,whole:Route@36308,whole:Route@36665,whole:Route@36672,whole:Route@36740,whole:Route@37063,whole:Route@38096,whole:Route@41047,whole:Route@45787,whole:Route@47373,whole:Route@47418,whole:Route@47428,whole:Route@48298,whole:Route@49325,whole:Route@54791,whole:Route@54939,whole:Route@56036,whole:Route@56395,whole:Route@56777,whole:Route@61551,whole:Route@62136,whole:Route@62186 be1b699f14a2f8d6935d959dee168bdf6fb556cd78da458f5ba8a1c0e8512a17
@legacy da695cf047ad1ddad8d36bfc6ab71bae2afe595233e3628f4e990b10d3221950 internal/provision/seed.go SeedAbortBecause legacy accepted-legacy accepted-legacy;rev3=census-ruling-seeded-instances;basis=the console (cmd/console serve under console.service, user carlos-console): the record transition the --from door aborts a seed with, recording its reason;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 9 (carried from Task 3's review): after the open-run refusal, an import's abort is also refused while the record carries a session marker (rec.Interactive), with an InteractiveOpenError; a --from seed's abort is unchanged; it only refuses more, no read added file:Open@432 1b3914ea6c6e599868c2736ab21601b8f112acab9220119e633fbf7fbd4c32c2
@legacy 24888be0f70a4d2684194c7613a2b59d741ca11a60e02fba53c9bfde31e19dde interactive_cli.go consoleOpen legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 13: new, carlos console's session Open (Process console, no argv); +file:Open is the interactive.Open type name, not os.Open; reads nothing file:Open@19,file:Open@46 049ebe355fca9a478b0598057faadc16e09fd999a72a66d1113451793af969a6
-@legacy 428e3c25c1d866b73ecc613e5f9a67e614b745790c0960f683029d93aff2bb4a interactive_cli.go openSession legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 13: new, the CLI's session on the signed-in console (a laptop process, not root on a box): this terminal's stdin and stdout, SIGINT, SIGTERM and SIGHUP, the door's URL; +file:Open is the interactive.Open parameter type, not os.Open; reads nothing from disk Task 13 fix round 1: stdin is wrapped in newInput (fdInput, the same stdin descriptor read through select with a 100 ms timeout so the session can stop its reader); no read added, the same one site file:Open@72 35c4382b05ef131c2d37d834283f70adb78e7e782b7b540889599b8b9e6c19e8
+@legacy 1beeed772774026e8e48f58bbb59e2e2f8a27831fe1fc16123dfeb16e94b31fd interactive_cli.go openSession legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 13: new, the CLI's session on the signed-in console (a laptop process, not root on a box): this terminal's stdin and stdout, SIGINT, SIGTERM and SIGHUP, the door's URL; +file:Open is the interactive.Open parameter type, not os.Open; reads nothing from disk Task 13 fix round 1: stdin is wrapped in newInput (fdInput, the same stdin descriptor read through select with a 100 ms timeout so the session can stop its reader); no read added, the same one site Task 13 fix round 2: stdout and stderr are wrapped in newOutput (fdOutput: write(2) to the same descriptors, waiting through EAGAIN with select); no read added, the same one site file:Open@72 b9c99fbe10d5483f3531ef9d7c51b033deeb3fdf1ca2d64aa23900cf77802512
@legacy e7ca33cf58d42da56c8188ae94fac7d96977a887da9297a76eb12c744c7a8bdc interactive_cli.go runSession legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 13: new, carlos run -it's and carlos console's session: refuses without a terminal, dials the console's session door once and runs the session; +file:Open is the interactive.Open parameter type, not os.Open; reads nothing from disk file:Open@101 c425502da54fbda621c3b5f5815be77dfe1a6abcc4902950c9537a7508f32515
@legacy 4503db4f8b5da340c5cc8c5227815d37743851ba4abfd7c8f00160a94bb6eeeb interactive_cli.go session.bridge legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 13: new, the session's bridge once the command starts: +file:Read is the CLI's own stdin (the user's keyboard, 4 KiB a read) sent as KindData, and the window's size sent as KindResize; opens and reads no file Task 13 fix round 1: the copier is owned: s.copier is closed when it returns and the session's end waits for it; its +file:Read is still the CLI's own stdin (now a sessionInput, fdInput on a real terminal); same one site file:Read@253 0a4a3816de79f8c813a27c4e5193963bd79b302788ae498b590b3e0808d0c639
@legacy ad71a5528842b791edc2554f9745237dee53acef5d01dadcf02268b644d4ea5a interactive_cli.go sessionOpen legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 13: new, fills the Open's terminal type from $TERM and its size from the terminal; +file:Open is the interactive.Open type name, not os.Open; reads nothing from disk file:Open@132,file:Open@22,file:Open@55 0eeb82605a87c4aa513fd9f3ec5f3219596c093eb1004bd90af54832d6f65e15
@legacy b07b7ea673e9a37164c38ce626e79cde4042a166b4b829dd3c78bc245d3e23a3 interactive_cli.go type session legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 13: new, one dialled session's state; +file:Open is the interactive.Open field type, not os.Open; reads nothing Task 13 fix round 1: gains the restore-succeeded and diagnostic flags and the copier's done channel, all in memory; reads nothing file:Open@135 0b289a8c835afd6ac0f84f89af48b7a0c70432012a770cf43ddb40bf23127613
-@legacy 50eb937207a81e4bb9968b5040fc1a7fb22d50816d059eb8677d2449f6537159 interactive_term_unix.go fdInput.Read legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 13 fix round 1: new, the CLI's stdin on linux and macOS (a laptop process): select(2) on the stdin descriptor with a 100 ms timeout and its stop flag, then read(2) of what is ready; the two +file:Read sites are unix.Read of that descriptor and the method's own name; opens nothing file:Read@19,file:Read@517 267e1318c37217d0b39c9e3eac1183aa993e98917a6b46c9ffeb155c74922db0
+@legacy 8e9818913aced6b93f70ccea5b7018e8e5d0f9e99701f11b6c4efb5ce00ba258 interactive_term_unix.go fdInput.Read legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 13 fix round 1: new, the CLI's stdin on linux and macOS (a laptop process): select(2) on the stdin descriptor with a 100 ms timeout and its stop flag, then read(2) of what is ready; the two +file:Read sites are unix.Read of that descriptor and the method's own name; opens nothing Task 13 fix round 2: puts the stdin descriptor in O_NONBLOCK at its first read (arm, F_GETFL/F_SETFL on the CLI's own stdin; Close puts the flags back once the reader has returned) and goes back to the stop-aware select on EAGAIN or EINTR; the same two sites, opens nothing file:Read@19,file:Read@611 de6ede5861c12f39d56c1c5bf9a1b104fd9441b10951ecd79e27c3cab8896b60
@legacy 432e0850cbdf6796ff4582bada35e5617292317b50f822fb18896cd64819f35e internal/activator/backend_rootfs.go ExecBackend.KillOneShot legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 7a (Call A1), new: a rootfs row only (else errOneShotKillBinary) and a one-shot role only (cmd or tty): StopRootfs(host, role, 0, no worker, kill) to root's existing /stop on DeadlineControl, then waitRoleCgroupEmpty (unitEvents on the role's rootfs unit) on roleEmptyBound; nil is the proof; the registry:Host sites are log and error text and the host passed to root, which names the unit from its own validated host; fix round 2: root's kill waits on oneShotKillControlBound, a package var equal to DeadlineControl (30 s) so a test can shrink it, in place of the constant; the same budgets, the same reads registry:Host@1023,registry:Host@154,registry:Host@279,registry:Host@374,registry:Host@433,registry:Host@559,registry:Host@657,registry:Host@716,registry:Host@954,whole:Route@877 8168e9fc15e050df81837e7a66e6d20feed7df36639d119f14824c8be3bcbad5
@legacy 6f89b17e52b3166bcee93563263c4d66854ff60dab0dc6fecbca8a4f08b352a5 internal/activator/backend_rootfs.go ExecBackend.startRootfsRun legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 7a, new: StartCmd's rootfs arm: refuses a run with no serving image (errNoCmdExe) or a partial one (errPartialStagedIdentity), both marked, and one with no launch environment (errNoGenEnv); asks replicaKeyGate; composes rootfsCmdVars over the generation's launch environment and the row's dbPath; then startRootfsCmd with the operator's argv exactly as given; root validates the image by digest and runs the argv inside the instance's namespace; the registry:Host sites are error text; Plan 6 Task 8: also a session rootfs arm: the same serving-image, partial-identity, launch-environment and replica-key refusals first; with spec.TTY set it composes rootfsTTYVars (no run id or directory; TERM and CARLOS_SESSION_ID) and starts startRootfsCmd in the tty role with spec.Process (console) or spec.Args, else rootfsCmdVars and the cmd role as before; +whole:Route x2 are rt to rootfsTTYVars and the dbPath read once for both registry:Host@192,registry:Host@450,registry:Host@587,whole:Route@1013,whole:Route@1160,whole:Route@1240,whole:Route@773,whole:Route@872,whole:Route@930 62055615354e08d3c3ca91486ab3e0604367a1f013e263984df2962dafcf26b3
@legacy c6d7609e34806d3c51e249713109f3bb9bae3c0645d4b6bf9f8190e48f9ce88b internal/activator/backend_unit.go SplitBackend.KillOneShot legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 7a, new: forwards KillOneShot by pick(rt), as KillGen does; a half without it refuses (errOneShotKillBinary); reads only the route registry:Host@219,whole:Route@123,whole:Route@286 59823fbe5e35c5b54e0843a681ad59f684bd28e3a8315c1571198b3e5c43d3ee
@@ -94,12 +94,12 @@ internal/layout/plan.go NestedPlatformNames legacy accepted-legacy accepted-lega
internal/provision/reconcile.go Reconcile legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos), from its reconcile loops: each listed record is observed through the box's lifetime judge (ObserveWith: the record, then its host incarnation slot) before the shape, channel and scope checks, a stale record is left out and an unjudgeable one protected; the removal phase observes a row's own record key when the pass holds none for it under that key, and deletes a held row whose record is gone or stale through DeleteIfHold; a nil judge (claims on) is main's body; registry read sites unchanged, offsets moved; fix round 1: the removal phase observes a row's own key only under an account the listing trusts, so a retired or unmaterialised account's row keeps record gone, and the pass arms its own context with the judge; Task 7: under a judge an existing provisioned row of the record's own app and account follows the existing-row rules (heldByVanishedPredecessor and retireHeldPredecessor's DeleteIfHold first, the record then minted on the same pass; the hold; installRowLifetime), each a separate write under the host's hold lock; registry read sites unchanged, offsets moved;rev3=census-ruling-instance-egress-sizes-328-329;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=#328/#329 plan 1 Task 7: the pass reads its apps' policy objects (control/app-policy/<sqid>/<app>.json in the bucket) through the agent's PolicyCache, each verified with ReleasePub by apppolicy.VerifyKey (ed25519 over the policy's own domain line, bound to the account and app, unexpired, not future-dated; anything else is no policy), and carries the columns into its rows. New kinds registry:EgressAllow, registry:Size and registry:PolicyExpiresAt, one site each, all the assignment of a fresh row's columns (nr) from policies.cols; plus one whole:Route site, the existing row handed to policies.forRow. Other read sites unchanged, offsets moved; the agent's own pass, no root decision;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos, from its reconcile loops: after the scan, hands the in-scope records to cfg.Lifetimes (the box's lifetime index): Merge after a failed read or partial listing, Replace after a complete one, nothing on a dry run or with no index; the scan, judge and removal phases unchanged; the same 166 sites, no read added;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 2 and 5 (D5, spec §5.0): a seeded record over a row with a runtime is skipped and logged; a row with a runtime (or a new record with one) takes no seed; runtime and a rootfs row's hibernation are never converged from a record (a mismatch is logged; a record claiming a runtime its row lacks is not applied); reads Runtime of the record and the row; the box writes less; fix wave 1 (ceea6353, whole-branch P1-2): before minting a row for a record with no runtime and no row (both mint paths), the pass reads the app's kind marker once per app per pass (release.ReadAppKindMarker: one GET of the create-only kind.json from the release store s, through freshStore, validated by readAppKindMarker); a rootfs marker leaves the record unmaterialized and logged (an older console stripped its runtime), and a marker that cannot be read defers the mint this pass; a refusal before minting only, registry read sites unchanged, the box writes less; fix wave 2 (whole-branch r2 P1): the kind-marker read and its refusal apply only to a socket-backed instance record (DerivesPaths), so a static or upstream-backed record of a rootfs app, which carries no runtime by design, is minted as before with no read; fewer reads, registry read sites unchanged;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 10: the forward phase on the hub (FleetOwners set): the scan keeps the fleet-placed records it skips and counts records per host; a trash-only marker prefetch; disputed (failed-GET) hosts; armed, a host an in-scope and a fleet record both name is given neither, its journal waits and the removal phase keeps its row (+registry:Account, +registry:App, +registry:Host x2: the collision guard, its log line and report mark); the instance loop leaves a forward host; retirable excludes forward rows. Same record keys; writes only the registry (PutForward, DeleteForward); no bucket write.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 3: in the per-record loop, beside the RunSeen call, calls cfg.InteractiveSeen(rec) when the hook is set and the in-scope record carries an interactive-session marker (rec.Interactive != nil), once per record per pass, before the pass acts on it; the hook is the box worker's non-blocking note (Task 12). Same record keys and literal; no read added (registry read sites unchanged, 178); nothing written by the call registry:Account@36233,registry:Account@37498,registry:Account@55577,registry:Account@55623,registry:Account@56467,registry:Account@56844,registry:Account@57070,registry:Account@57137,registry:Account@57183,registry:Account@57276,registry:Account@57318,registry:Account@57966,registry:Account@58224,registry:Account@58764,registry:Account@58812,registry:Account@59185,registry:Account@59231,registry:Account@59476,registry:Account@59901,registry:Account@60389,registry:Account@61125,registry:Account@61318,registry:Account@61664,registry:Account@62229,registry:App@36206,registry:App@37471,registry:App@55597,registry:App@55635,registry:App@56479,registry:App@56856,registry:App@57082,registry:App@57157,registry:App@57195,registry:App@57296,registry:App@57978,registry:App@58236,registry:App@58776,registry:App@58824,registry:App@59205,registry:App@59243,registry:App@59488,registry:App@59913,registry:App@60401,registry:App@61137,registry:App@61330,registry:App@61676,registry:App@62241,registry:ClaimOwnership@36820,registry:DBPath@45677,registry:DBPath@45692,registry:DBPath@45938,registry:DBPath@46541,registry:DBPath@46554,registry:EgressAllow@35319,registry:Gate@42022,registry:Gate@42162,registry:Gate@42449,registry:Hibernate@40694,registry:Hibernate@40892,registry:Hibernate@40957,registry:Hibernate@41296,registry:Hibernate@41647,registry:Hibernate@41957,registry:HoldOp@60870,registry:HoldOp@60961,registry:HoldOp@61096,registry:HoldOp@61472,registry:Host@26327,registry:Host@55556,registry:Host@56443,registry:Host@56820,registry:Host@56984,registry:Host@57090,registry:Host@57986,registry:Host@58192,registry:Host@59068,registry:Host@59340,registry:Host@59455,registry:Host@59778,registry:Host@59875,registry:Host@60266,registry:Host@60363,registry:Host@60577,registry:Host@60952,registry:Host@61087,registry:Host@61291,registry:Host@61364,registry:Host@61463,registry:Host@61638,registry:Host@61713,registry:Host@61799,registry:Host@62206,registry:Kind@36962,registry:Kind@37225,registry:Kind@45595,registry:Kind@45608,registry:Kind@45718,registry:Kind@45731,registry:Kind@46452,registry:Kind@46463,registry:Kind@54680,registry:Kind@60568,registry:Kind@61078,registry:Kind@61454,registry:Kind@61629,registry:Kind@61790,registry:PolicyExpiresAt@35344,registry:Pool@54766,registry:Provisioned@36182,registry:Provisioned@37447,registry:Provisioned@54725,registry:RateLimit@42535,registry:RateLimit@42686,registry:RateLimit@42973,registry:Region@54755,registry:Replication@41381,registry:Replication@41508,registry:Runtime@28984,registry:Runtime@29162,registry:Runtime@31367,registry:Runtime@40061,registry:Runtime@40115,registry:Runtime@40319,registry:Seed@44075,registry:SeedSource@43558,registry:Size@35335,registry:Socket@45643,registry:Socket@45658,registry:Socket@45955,registry:Socket@46511,registry:Socket@46524,registry:Unit@45561,registry:Unit@45574,registry:Unit@46478,registry:Unit@46489,whole:ClaimOwnership@36823,whole:ClaimOwnership@36840,whole:Route@26309,whole:Route@26320,whole:Route@26338,whole:Route@27619,whole:Route@29479,whole:Route@29486,whole:Route@29526,whole:Route@29887,whole:Route@30225,whole:Route@30672,whole:Route@30723,whole:Route@30760,whole:Route@32432,whole:Route@32641,whole:Route@32980,whole:Route@32989,whole:Route@33035,whole:Route@35268,whole:Route@35827,whole:Route@36298,whole:Route@36308,whole:Route@36665,whole:Route@36672,whole:Route@36740,whole:Route@37063,whole:Route@38096,whole:Route@41047,whole:Route@45787,whole:Route@47373,whole:Route@47418,whole:Route@47428,whole:Route@48298,whole:Route@49325,whole:Route@54791,whole:Route@54939,whole:Route@56036,whole:Route@56395,whole:Route@56777,whole:Route@61551,whole:Route@62136,whole:Route@62186 be1b699f14a2f8d6935d959dee168bdf6fb556cd78da458f5ba8a1c0e8512a17
internal/provision/seed.go SeedAbortBecause legacy accepted-legacy accepted-legacy;rev3=census-ruling-seeded-instances;basis=the console (cmd/console serve under console.service, user carlos-console): the record transition the --from door aborts a seed with, recording its reason;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 9 (carried from Task 3's review): after the open-run refusal, an import's abort is also refused while the record carries a session marker (rec.Interactive), with an InteractiveOpenError; a --from seed's abort is unchanged; it only refuses more, no read added file:Open@432 1b3914ea6c6e599868c2736ab21601b8f112acab9220119e633fbf7fbd4c32c2
interactive_cli.go consoleOpen legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 13: new, carlos console's session Open (Process console, no argv); +file:Open is the interactive.Open type name, not os.Open; reads nothing file:Open@19,file:Open@46 049ebe355fca9a478b0598057faadc16e09fd999a72a66d1113451793af969a6
-interactive_cli.go openSession legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 13: new, the CLI's session on the signed-in console (a laptop process, not root on a box): this terminal's stdin and stdout, SIGINT, SIGTERM and SIGHUP, the door's URL; +file:Open is the interactive.Open parameter type, not os.Open; reads nothing from disk Task 13 fix round 1: stdin is wrapped in newInput (fdInput, the same stdin descriptor read through select with a 100 ms timeout so the session can stop its reader); no read added, the same one site file:Open@72 35c4382b05ef131c2d37d834283f70adb78e7e782b7b540889599b8b9e6c19e8
+interactive_cli.go openSession legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 13: new, the CLI's session on the signed-in console (a laptop process, not root on a box): this terminal's stdin and stdout, SIGINT, SIGTERM and SIGHUP, the door's URL; +file:Open is the interactive.Open parameter type, not os.Open; reads nothing from disk Task 13 fix round 1: stdin is wrapped in newInput (fdInput, the same stdin descriptor read through select with a 100 ms timeout so the session can stop its reader); no read added, the same one site Task 13 fix round 2: stdout and stderr are wrapped in newOutput (fdOutput: write(2) to the same descriptors, waiting through EAGAIN with select); no read added, the same one site file:Open@72 b9c99fbe10d5483f3531ef9d7c51b033deeb3fdf1ca2d64aa23900cf77802512
interactive_cli.go runSession legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 13: new, carlos run -it's and carlos console's session: refuses without a terminal, dials the console's session door once and runs the session; +file:Open is the interactive.Open parameter type, not os.Open; reads nothing from disk file:Open@101 c425502da54fbda621c3b5f5815be77dfe1a6abcc4902950c9537a7508f32515
interactive_cli.go session.bridge legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 13: new, the session's bridge once the command starts: +file:Read is the CLI's own stdin (the user's keyboard, 4 KiB a read) sent as KindData, and the window's size sent as KindResize; opens and reads no file Task 13 fix round 1: the copier is owned: s.copier is closed when it returns and the session's end waits for it; its +file:Read is still the CLI's own stdin (now a sessionInput, fdInput on a real terminal); same one site file:Read@253 0a4a3816de79f8c813a27c4e5193963bd79b302788ae498b590b3e0808d0c639
interactive_cli.go sessionOpen legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 13: new, fills the Open's terminal type from $TERM and its size from the terminal; +file:Open is the interactive.Open type name, not os.Open; reads nothing from disk file:Open@132,file:Open@22,file:Open@55 0eeb82605a87c4aa513fd9f3ec5f3219596c093eb1004bd90af54832d6f65e15
interactive_cli.go type session legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 13: new, one dialled session's state; +file:Open is the interactive.Open field type, not os.Open; reads nothing Task 13 fix round 1: gains the restore-succeeded and diagnostic flags and the copier's done channel, all in memory; reads nothing file:Open@135 0b289a8c835afd6ac0f84f89af48b7a0c70432012a770cf43ddb40bf23127613
-interactive_term_unix.go fdInput.Read legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 13 fix round 1: new, the CLI's stdin on linux and macOS (a laptop process): select(2) on the stdin descriptor with a 100 ms timeout and its stop flag, then read(2) of what is ready; the two +file:Read sites are unix.Read of that descriptor and the method's own name; opens nothing file:Read@19,file:Read@517 267e1318c37217d0b39c9e3eac1183aa993e98917a6b46c9ffeb155c74922db0
+interactive_term_unix.go fdInput.Read legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 13 fix round 1: new, the CLI's stdin on linux and macOS (a laptop process): select(2) on the stdin descriptor with a 100 ms timeout and its stop flag, then read(2) of what is ready; the two +file:Read sites are unix.Read of that descriptor and the method's own name; opens nothing Task 13 fix round 2: puts the stdin descriptor in O_NONBLOCK at its first read (arm, F_GETFL/F_SETFL on the CLI's own stdin; Close puts the flags back once the reader has returned) and goes back to the stop-aware select on EAGAIN or EINTR; the same two sites, opens nothing file:Read@19,file:Read@611 de6ede5861c12f39d56c1c5bf9a1b104fd9441b10951ecd79e27c3cab8896b60
internal/activator/backend_rootfs.go ExecBackend.KillOneShot legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 7a (Call A1), new: a rootfs row only (else errOneShotKillBinary) and a one-shot role only (cmd or tty): StopRootfs(host, role, 0, no worker, kill) to root's existing /stop on DeadlineControl, then waitRoleCgroupEmpty (unitEvents on the role's rootfs unit) on roleEmptyBound; nil is the proof; the registry:Host sites are log and error text and the host passed to root, which names the unit from its own validated host; fix round 2: root's kill waits on oneShotKillControlBound, a package var equal to DeadlineControl (30 s) so a test can shrink it, in place of the constant; the same budgets, the same reads registry:Host@1023,registry:Host@154,registry:Host@279,registry:Host@374,registry:Host@433,registry:Host@559,registry:Host@657,registry:Host@716,registry:Host@954,whole:Route@877 8168e9fc15e050df81837e7a66e6d20feed7df36639d119f14824c8be3bcbad5
internal/activator/backend_rootfs.go ExecBackend.startRootfsRun legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 7a, new: StartCmd's rootfs arm: refuses a run with no serving image (errNoCmdExe) or a partial one (errPartialStagedIdentity), both marked, and one with no launch environment (errNoGenEnv); asks replicaKeyGate; composes rootfsCmdVars over the generation's launch environment and the row's dbPath; then startRootfsCmd with the operator's argv exactly as given; root validates the image by digest and runs the argv inside the instance's namespace; the registry:Host sites are error text; Plan 6 Task 8: also a session rootfs arm: the same serving-image, partial-identity, launch-environment and replica-key refusals first; with spec.TTY set it composes rootfsTTYVars (no run id or directory; TERM and CARLOS_SESSION_ID) and starts startRootfsCmd in the tty role with spec.Process (console) or spec.Args, else rootfsCmdVars and the cmd role as before; +whole:Route x2 are rt to rootfsTTYVars and the dbPath read once for both registry:Host@192,registry:Host@450,registry:Host@587,whole:Route@1013,whole:Route@1160,whole:Route@1240,whole:Route@773,whole:Route@872,whole:Route@930 62055615354e08d3c3ca91486ab3e0604367a1f013e263984df2962dafcf26b3
internal/activator/backend_unit.go SplitBackend.KillOneShot legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 7a, new: forwards KillOneShot by pick(rt), as KillGen does; a half without it refuses (errOneShotKillBinary); reads only the route registry:Host@219,whole:Route@123,whole:Route@286 59823fbe5e35c5b54e0843a681ad59f684bd28e3a8315c1571198b3e5c43d3ee
@@ -138,7 +138,7 @@ internal/activator/cmdunit.go cmdUnit.Poll legacy accepted-legacy accepted-legac
internal/activator/rootfs_service.go Service.rootfsTick legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: per activator tick, lists residents (Registry.ResidentInstances through the DueStore), and for each rootfs entry kills generations whose replica reports a lost lease with no watch installed, stops an exited rootfs process (StopExited), and supervises; then drops forgotten residents and reserves proactive starts (residentJob) for resident-shaped, unheld rows within the start ceiling after the locked admission;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W, W1.10: when the tick kills a lost-lease resident's generations it also starts stopRootfsWorkersAtLoss(e) beside them; superviseRootfsLocked (a no-op in Group A) is now the worker supervision; the same 15 read sites, no read added; stops more, starts nothing new on its own;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 7a: the no-signal fallback also covers a hibernating rootfs entry with a one-shot unit that may run (oneShotHoldsLocked); it latches ownerKilled and runs each one-shot kill func (KillOneShot to root's existing /stop) with go off a.mu, beside a resident's killResidentGens and stopRootfsWorkersAtLoss as before; new site +whole:Route is e.route.Rootfs(); stops more, starts nothing registry:Host@1842,registry:Host@2071,registry:Host@2427,whole:Route@113,whole:Route@1200,whole:Route@1795,whole:Route@1824,whole:Route@1993,whole:Route@2024,whole:Route@2106,whole:Route@2271,whole:Route@2320,whole:Route@2465,whole:Route@397,whole:Route@803,whole:Route@824 de44f5578a049a224f06a302863752c3a4ff53767478a54d08e373db018efe82
@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 . cd9148f8eb3f72053f0d0e22f3a58638024830a5dea7682ba42646fa094dc7a3
+@coverage . ffb9ecf54351e9e97eae074b119d2af259869b1478e32d2c3fa558fe76ecebba
@coverage internal/activator 72f34fc88388e97bbd0d84d0256f409ca6931af0b6127ebb7895b01a02f2e73d
@coverage internal/appconfig cac8d8ef7538a456d034801c95ce6508a4983e5516b3bbbd302bec0fbafdd479
@coverage internal/host 5fa4abbdabdf0d6816ab3e589fd563fe9291b5921fe529cb2383adf0497937b1