carlos / platform Public

host: status store fields named apart from the record-write census; census re-proposed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev d477bee8492a40222553a6b22abd552db6ee1bed parent 6758f4e
5 files changed, +13 −13
  • docs/superpowers/notes/census-proposal-console-addr-from-install.md +1 −1
  • internal/host/consolefleet.go +6 −6
  • internal/host/consolefleet_test.go +2 −2
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-console-addr-from-install.tsv +3 −3

CI cancelled — superseded by a newer push — run details

diff --git a/docs/superpowers/notes/census-proposal-console-addr-from-install.md b/docs/superpowers/notes/census-proposal-console-addr-from-install.md
index 04ad4c24f..6bf4a2fe6 100644
--- a/docs/superpowers/notes/census-proposal-console-addr-from-install.md
+++ b/docs/superpowers/notes/census-proposal-console-addr-from-install.md
@@ -36,6 +36,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- new `internal/host/consolefleet_owner_unix.go:dirOwner`: reads +file:Lstat; written legacy, accepted-legacy, frozen
- quiet `internal/edge/replicaconsole.go:Edge.serveReplicaConsole`: reads nothing now; retired while it reads nothing (or its row keeps no sites)
-Seal: `841361b89e20c3763149e8784cdebb037dcc4b828b24196a01d3e300ff319661` → `4e91ecd973e6252fc2d2a325efe378588e9d52054ed8db98419caf3986bf7b81`.
+Seal: `841361b89e20c3763149e8784cdebb037dcc4b828b24196a01d3e300ff319661` → `ff7a860900676ac088e5472b0174f0a0333536936d122c27e792086ec271a7d2`.
Overlay: `internal/provision/testdata/plan14-root-reads-console-addr-from-install.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/host/consolefleet.go b/internal/host/consolefleet.go
index 810817595..25c7502bb 100644
--- a/internal/host/consolefleet.go
+++ b/internal/host/consolefleet.go
@@ -105,8 +105,8 @@ type consoleFleetStep struct {
// runDirOwner is /run/carlos-console's owner: exists false when absent,
// an error when it is not a real directory only its owner can write.
runDirOwner func() (uid int, exists bool, err error)
- readRecord func() ([]byte, error)
- writeRecord func([]byte) error
+ readStatus func() ([]byte, error)
+ writeStatus func([]byte) error
now func() time.Time
}
@@ -257,14 +257,14 @@ func consoleUnitUID(user string, lookup func(string) (int, error)) (int, error)
// persist writes rec unless the stored record differs only in its time, so
// an idle hourly pass does not churn the file; At is when this state began.
func (s consoleFleetStep) persist(rec consolefleet.Record) {
- if raw, err := s.readRecord(); err == nil {
+ if raw, err := s.readStatus(); err == nil {
if old, err := consolefleet.DecodeRecord(raw); err == nil && old.Outcome == rec.Outcome && old.Reason == rec.Reason && old.Exclusive == rec.Exclusive && old.ConsoleUID == rec.ConsoleUID {
return
}
}
raw, err := json.Marshal(rec)
if err == nil {
- err = s.writeRecord(raw)
+ err = s.writeStatus(raw)
}
if err != nil {
log.Printf("adopt: console fleet record: %v", err)
@@ -331,7 +331,7 @@ func productionConsoleFleetStep(ctx context.Context) consoleFleetStep {
return strconv.Atoi(u.Uid)
},
runDirOwner: func() (int, bool, error) { return dirOwner(consolefleet.Dir) },
- readRecord: func() ([]byte, error) {
+ readStatus: func() ([]byte, error) {
var raw []byte
err := withStore(func(st rootstate.Store) error {
var err error
@@ -340,7 +340,7 @@ func productionConsoleFleetStep(ctx context.Context) consoleFleetStep {
})
return raw, err
},
- writeRecord: func(b []byte) error {
+ writeStatus: func(b []byte) error {
return withStore(func(st rootstate.Store) error { return st.Write(consolefleet.StatusFile, b) })
},
now: time.Now,
diff --git a/internal/host/consolefleet_test.go b/internal/host/consolefleet_test.go
index e27f47c3a..f289cd352 100644
--- a/internal/host/consolefleet_test.go
+++ b/internal/host/consolefleet_test.go
@@ -72,8 +72,8 @@ func (f *fakeConsoleFleet) step() consoleFleetStep {
return 0, errors.New("unknown user " + name)
},
runDirOwner: func() (int, bool, error) { return f.dirOwner, f.dirExists, f.dirErr },
- readRecord: func() ([]byte, error) { return f.record, f.recordErr },
- writeRecord: func(b []byte) error { f.record = append([]byte(nil), b...); return nil },
+ readStatus: func() ([]byte, error) { return f.record, f.recordErr },
+ writeStatus: func(b []byte) error { f.record = append([]byte(nil), b...); return nil },
now: func() time.Time { return time.Date(2026, 11, 24, 10, 0, 0, 0, time.UTC) },
}
}
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 141e98e37..cd73f8e8f 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -285,4 +285,4 @@ plan14-root-reads-ha-departure-evidence.tsv 924ffc4037d32d7b46af1e373bad1476fc73
plan14-root-reads-stateless-scale-2-fleet-sizes.tsv 00fe607a04674579005013fae1e275cb0434ce54493b1efbe678aed59a12366b
plan14-root-reads-store-versioning.tsv 841361b89e20c3763149e8784cdebb037dcc4b828b24196a01d3e300ff319661
plan14-root-reads-parent-delegation-1383.tsv 841361b89e20c3763149e8784cdebb037dcc4b828b24196a01d3e300ff319661
-plan14-root-reads-console-addr-from-install.tsv 4e91ecd973e6252fc2d2a325efe378588e9d52054ed8db98419caf3986bf7b81
+plan14-root-reads-console-addr-from-install.tsv ff7a860900676ac088e5472b0174f0a0333536936d122c27e792086ec271a7d2
diff --git a/internal/provision/testdata/plan14-root-reads-console-addr-from-install.tsv b/internal/provision/testdata/plan14-root-reads-console-addr-from-install.tsv
index 35b7efc19..9624d0a43 100644
--- a/internal/provision/testdata/plan14-root-reads-console-addr-from-install.tsv
+++ b/internal/provision/testdata/plan14-root-reads-console-addr-from-install.tsv
@@ -8,7 +8,7 @@
@legacy f75586365ec9f7a45022e286f68ae37adfb99dbdf27f80e6c670257c21fddc40 internal/edge/replicaconsole.go Edge.routeReplicaConsole legacy accepted-legacy accepted-legacy;rev3=census-ruling-console-addr-from-install;basis=new name for the route-scan half of serveReplicaConsole, same registry reads as before but loopback TCP console routes only, never a socket route (Paul's cut after task 3 review R4); env > socket ahead of it (spec §6), and the socket choice reads no route data registry:Account@693,registry:App@713,registry:Host@634,registry:Socket@1152,registry:Unit@736,whole:Route@615 6181b95cda8b28549f4b762961e376cc870c9ba1c078850541c2c1fd11578a04
@legacy 8f203c7b1ba9576b8feb655862b637d4a7929b23a58aa2a8de20884df477e9ea internal/edge/replicaconsole.go consoleFleetSource.ready legacy accepted-legacy accepted-legacy;rev3=census-ruling-console-addr-from-install;basis=new: lstat of the fixed /run/carlos-console and its fleet.sock (root-created dir, owner checked against root recorded uid); the edge (user carlos), not root file:Lstat@356,file:Lstat@939 b9987e6cd57abafe2a72bebfcaac3391a90410c1511e56fcdcf34fbc76699f3d
@legacy f92e62f93979399ed131ce111624402631c50afdaa7d6ba92f9e4c0266f2204a internal/edge/replicaconsole.go readConsoleFleetRecordIn legacy accepted-legacy accepted-legacy;rev3=census-ruling-console-addr-from-install;basis=new: reads root public record /var/lib/carlos-console-fleet/status.json via rootstate.OpenTrustedFile and CheckPublicConfig, lstat of the reload-pending marker in the same trusted dir; the edge, not root file:Lstat@900,file:ReadAll@336 6c1ee7337d9a091949ff7d0b4fef84e00c65f3092f75a64578742c040b28bf1c
-@legacy 97a05365c9d4ce432ce83fc6438e93c75c713d582d6faf761137731ba3ba7ad1 internal/host/consolefleet.go productionConsoleFleetStep legacy accepted-legacy accepted-legacy;rev3=census-ruling-console-addr-from-install;basis=new root step seams: systemctl show of the fixed console.service, rootstate public store /var/lib/carlos-console-fleet (marker and record), lstat of /run/carlos-console; every path fixed, nothing tenant- or record-named file:Command@412,file:Open@123,file:Read@1245,file:Read@2185 bbcbb275d657fd2443892081dcb93744fc8891adb5ca47d905649121355dde04
+@legacy d93651a86d8140771a8f52e6a843512d2cca2fcc78486fd820f8839aa4948632 internal/host/consolefleet.go productionConsoleFleetStep legacy accepted-legacy accepted-legacy;rev3=census-ruling-console-addr-from-install;basis=new root step seams: systemctl show of the fixed console.service, rootstate public store /var/lib/carlos-console-fleet (marker and record), lstat of /run/carlos-console; every path fixed, nothing tenant- or record-named file:Command@412,file:Open@123,file:Read@1245,file:Read@2185 90f8f3a1c8b229c2712341932717f24681ad086c3f06b4b5939037c11c0774dc
@legacy 9c7c8523ea8f2cab84843f41849bf2de87a7c79de71ba880d21ef95512aafb38 internal/host/consolefleet.go readConsoleFleetDropInAt legacy accepted-legacy accepted-legacy;rev3=census-ruling-console-addr-from-install;basis=new: reads root own drop-in (production path fixed: /etc/systemd/system/console.service.d/70-carlos-fleet-socket.conf) through rootstate.OpenTrustedDir and OpenTrustedFileIn; untrusted entry is replaced, untrusted dir refused file:Lstat@374,file:ReadAll@620 8772ec8956469895482cbc3a77cd6fbedbba9b612d00ad9d332a7933e883e5ad
@legacy 2b2ef32ad234bfeab6df9975d06aec01c193d28c26eb2c15dadd2d91b35412ef internal/host/consolefleet.go readConsoleFleetRecordForStatus legacy accepted-legacy accepted-legacy;rev3=census-ruling-console-addr-from-install;basis=new: the agent reads root public record for the heartbeat through rootstate; reporting only file:Open@74,file:Read@190 5b8212027956f803263a156e676d27b5c07a38113bd9c3486c0c4cc88d78082a
@legacy 87717efd88ac0ef815799b32b8bc406482799f00620193cce210db6311b74911 internal/host/consolefleet_owner_unix.go dirOwner legacy accepted-legacy accepted-legacy;rev3=census-ruling-console-addr-from-install;basis=new: lstat of fixed /run/carlos-console for its owner uid; root step file:Lstat@75 6df5a9a2e74903906521dfa56439c7f2b94586f83de8c076f39533ad04dbe3ee
@@ -22,7 +22,7 @@ internal/caps/converge.go RuntimeDirClaimant legacy accepted-legacy accepted-leg
internal/edge/replicaconsole.go Edge.routeReplicaConsole legacy accepted-legacy accepted-legacy;rev3=census-ruling-console-addr-from-install;basis=new name for the route-scan half of serveReplicaConsole, same registry reads as before but loopback TCP console routes only, never a socket route (Paul's cut after task 3 review R4); env > socket ahead of it (spec §6), and the socket choice reads no route data registry:Account@693,registry:App@713,registry:Host@634,registry:Socket@1152,registry:Unit@736,whole:Route@615 6181b95cda8b28549f4b762961e376cc870c9ba1c078850541c2c1fd11578a04
internal/edge/replicaconsole.go consoleFleetSource.ready legacy accepted-legacy accepted-legacy;rev3=census-ruling-console-addr-from-install;basis=new: lstat of the fixed /run/carlos-console and its fleet.sock (root-created dir, owner checked against root recorded uid); the edge (user carlos), not root file:Lstat@356,file:Lstat@939 b9987e6cd57abafe2a72bebfcaac3391a90410c1511e56fcdcf34fbc76699f3d
internal/edge/replicaconsole.go readConsoleFleetRecordIn legacy accepted-legacy accepted-legacy;rev3=census-ruling-console-addr-from-install;basis=new: reads root public record /var/lib/carlos-console-fleet/status.json via rootstate.OpenTrustedFile and CheckPublicConfig, lstat of the reload-pending marker in the same trusted dir; the edge, not root file:Lstat@900,file:ReadAll@336 6c1ee7337d9a091949ff7d0b4fef84e00c65f3092f75a64578742c040b28bf1c
-internal/host/consolefleet.go productionConsoleFleetStep legacy accepted-legacy accepted-legacy;rev3=census-ruling-console-addr-from-install;basis=new root step seams: systemctl show of the fixed console.service, rootstate public store /var/lib/carlos-console-fleet (marker and record), lstat of /run/carlos-console; every path fixed, nothing tenant- or record-named file:Command@412,file:Open@123,file:Read@1245,file:Read@2185 bbcbb275d657fd2443892081dcb93744fc8891adb5ca47d905649121355dde04
+internal/host/consolefleet.go productionConsoleFleetStep legacy accepted-legacy accepted-legacy;rev3=census-ruling-console-addr-from-install;basis=new root step seams: systemctl show of the fixed console.service, rootstate public store /var/lib/carlos-console-fleet (marker and record), lstat of /run/carlos-console; every path fixed, nothing tenant- or record-named file:Command@412,file:Open@123,file:Read@1245,file:Read@2185 90f8f3a1c8b229c2712341932717f24681ad086c3f06b4b5939037c11c0774dc
internal/host/consolefleet.go readConsoleFleetDropInAt legacy accepted-legacy accepted-legacy;rev3=census-ruling-console-addr-from-install;basis=new: reads root own drop-in (production path fixed: /etc/systemd/system/console.service.d/70-carlos-fleet-socket.conf) through rootstate.OpenTrustedDir and OpenTrustedFileIn; untrusted entry is replaced, untrusted dir refused file:Lstat@374,file:ReadAll@620 8772ec8956469895482cbc3a77cd6fbedbba9b612d00ad9d332a7933e883e5ad
internal/host/consolefleet.go readConsoleFleetRecordForStatus legacy accepted-legacy accepted-legacy;rev3=census-ruling-console-addr-from-install;basis=new: the agent reads root public record for the heartbeat through rootstate; reporting only file:Open@74,file:Read@190 5b8212027956f803263a156e676d27b5c07a38113bd9c3486c0c4cc88d78082a
internal/host/consolefleet_owner_unix.go dirOwner legacy accepted-legacy accepted-legacy;rev3=census-ruling-console-addr-from-install;basis=new: lstat of fixed /run/carlos-console for its owner uid; root step file:Lstat@75 6df5a9a2e74903906521dfa56439c7f2b94586f83de8c076f39533ad04dbe3ee
@@ -32,5 +32,5 @@ internal/host/consolefleet_owner_unix.go dirOwner legacy accepted-legacy accepte
@coverage internal/caps 1dc3cc6958cd3a9ca29a7238ed6f6c5dd5b1d7c710b93270225170d9cd2f22ba
@coverage internal/consolefleet c4d6e34c13a92f6051da8b8ae7b35d65062c33f7496a864ce3991c48d007b551
@coverage internal/edge a080678779d406f3cae440ee4ab6f8209622049fcad0b0b3bc24e52a22dd8596
-@coverage internal/host c0f8eaa9c036abf43def2de3673791a1ce38c0358abddad5a9258191b3e92fd1
+@coverage internal/host caf093c81e25beb7b37f3b313f770228e13aa753c49345f0956e2bf23d2c0481
@coverage internal/status f6ee7b9ca28ed38307b4fc3a21bf7f4afaaa7df3a5ea39800aa69f649062677a