carlos / platform Public

claim census: keep the agent's router update cache (harness G10 re-run, 8.2)

A normal system update leaves <data>/system/router/<version>/carlos until
the agent's next hourly observe, so a migration window can meet it. The
census keeps system/router as a shared tree of box state; root already
checks the cache against the signed sums before use. Overlay
claim-router-cache, envelope only, proposed to platform-d8.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 27303f54f526b72f46f38f77e012ca993e230a4c parent 64a9847
5 files changed, +54 −0
  • docs/superpowers/notes/census-proposal-claim-step8-readiness.md +20 −0
  • internal/host/claimcensus.go +8 −0
  • internal/host/claimcensus_migration_linux_test.go +18 −0
  • internal/provision/plan14_root_reads_test.go +6 −0
  • internal/provision/testdata/plan14-root-reads-claim-router-cache.tsv +2 −0

CI passed — run details

diff --git a/docs/superpowers/notes/census-proposal-claim-step8-readiness.md b/docs/superpowers/notes/census-proposal-claim-step8-readiness.md
index f40bed77c..537fe9ef7 100644
--- a/docs/superpowers/notes/census-proposal-claim-step8-readiness.md
+++ b/docs/superpowers/notes/census-proposal-claim-step8-readiness.md
@@ -335,3 +335,23 @@ Census review 2 conditions (folded into fix round 2):
- **Recommended (a).** `rootStopCoordinator` no longer falls back to `Identity.Verify`: without a cleanup enrollment the bound stays nil and every stop refuses. Its row's "no read" now holds. The lifecycle rootrunner fixture, whose owners open no cleanup enrollment, sets the bound itself.
- **Recommended (b).** Ruling 6 also fails on any production reassignment of `openRootMigrationState` or `rootMigrationStartupFloors`.
- **Condition 3** (the `inputExemptions` tag) is left for the ruling.
+
+## Router cache
+
+Status: PROPOSED to platform-d8.
+
+At 8.2 the harness's G10 re-run (2026-10-20, 23:25Z) stopped with `migration census: data entry "system/router/v0.28.15/carlos" is not classified`.
+
+**Cause.** A normal `carlos system update` leaves the agent's router cache, `<data>/system/router/<version>/carlos` (`systemCachePath`), in place until the agent's next hourly observe forgets it. A migration window can start inside that hour.
+
+**Fix.** `claimBoxDataCensus` now keeps the agent's whole system update directory (`systemDataDir`, `system/router`) as a shared tree: directories and regular files only, and a symlink refuses. The existing file rule for `requested.json` stays.
+- **Root reads.** Root already walks the cache beneath the data dir (`openBeneath` over `systemCacheParts`) and checks it against the release's signed sums before use.
+- **Not an installation artifact.** The cache is box state, and nothing the census adopts or imports.
+
+**Census.** `claimBoxDataCensus` has no read site of its own, so this is envelope only: overlay `plan14-root-reads-claim-router-cache.tsv` re-pins `internal/host`. The seal stands, and 9B8 has no change.
+
+**Ruling 6.** Only claim-mode census callers reach `claimBoxDataCensus`.
+
+**Tests.**
+- `TestMigrationCensusKeepsRouterCache` accepts a cache file and refuses a symlinked one.
+- With the class removed, it reproduces the harness's exact error.
diff --git a/internal/host/claimcensus.go b/internal/host/claimcensus.go
index db55329de..a3ae91acb 100644
--- a/internal/host/claimcensus.go
+++ b/internal/host/claimcensus.go
@@ -89,6 +89,14 @@ func claimBoxDataCensus(dataDir string) []string {
// channel, <acct>/<app>/<channel>.digests. Box anti-rollback state,
// never cleared and never an installation artifact (#324).
hostbox.CensusTree(rel(release.EdgeRatchetDir(dataDir))),
+ // The agent's system update state: its request (requested.json, also
+ // a file below) and its cache of the router build it fetched,
+ // <version>/carlos (systemCachePath). Root walks the cache beneath
+ // the data dir and checks it against the release's signed sums before
+ // it uses it; a normal update leaves it until the agent's next hourly
+ // observe forgets it, so a migration window can meet it (harness,
+ // 2026-10-20). Box state, never an installation artifact.
+ hostbox.CensusTree(rel(systemDataDir(dataDir))),
}
for _, path := range []string{
filepath.Join(dataDir, stageRequestMarker), // the agent's root stage request
diff --git a/internal/host/claimcensus_migration_linux_test.go b/internal/host/claimcensus_migration_linux_test.go
index 130ea9ebe..9e4da572a 100644
--- a/internal/host/claimcensus_migration_linux_test.go
+++ b/internal/host/claimcensus_migration_linux_test.go
@@ -194,6 +194,24 @@ func leoRatchetMarks(t *testing.T, c *leoCensusTree) {
leoWrite(t, filepath.Join(c.roots["units"], activationLockName))
}
+// A normal update leaves the agent's router cache until its next hourly
+// observe (harness G10 re-run, 8.2, 2026-10-20): the census keeps it.
+func TestMigrationCensusKeepsRouterCache(t *testing.T) {
+ c := newLeoCensusTree(t)
+ cache := systemCachePath(c.roots["data"], "v0.28.15")
+ if err := os.MkdirAll(filepath.Dir(cache), 0o755); err != nil {
+ t.Fatal(err)
+ }
+ leoWrite(t, cache)
+ if err := c.check(t, allWindowUnits()); err != nil {
+ t.Fatalf("router cache: %v", err)
+ }
+ leoReplaceWithLink(t, cache, "/etc/passwd")
+ if err := c.check(t, allWindowUnits()); !errors.Is(err, hostbox.ErrTypedInventory) {
+ t.Fatalf("a symlinked router cache = %v, want a refusal", err)
+ }
+}
+
// Each class is exact: one entry outside it refuses, naming the entry.
func TestMigrationCensusRefusesOutsideLeosClasses(t *testing.T) {
for name, mutate := range map[string]func(*testing.T, *leoCensusTree){
diff --git a/internal/provision/plan14_root_reads_test.go b/internal/provision/plan14_root_reads_test.go
index 868d6ed6d..b840d260a 100644
--- a/internal/provision/plan14_root_reads_test.go
+++ b/internal/provision/plan14_root_reads_test.go
@@ -1094,6 +1094,12 @@ func TestPlan14RootReadCensus(t *testing.T) {
if err = loadRootReadInventory(filepath.Join(root, "internal/provision/testdata/plan14-root-reads-claim-merge-main-2.tsv"), &inv, true); err != nil {
t.Fatal(err)
}
+ // Census overlay claim-router-cache (the migration census keeps the
+ // agent's router update cache, harness G10 re-run 8.2), loaded last:
+ // envelope only. Proposed to platform-d8; the seal stands.
+ if err = loadRootReadInventory(filepath.Join(root, "internal/provision/testdata/plan14-root-reads-claim-router-cache.tsv"), &inv, true); err != nil {
+ t.Fatal(err)
+ }
errs := append(compareRootReads(got, inv), checkRootReadLegacy(inv, seal)...)
errs = append(errs, checkRootReadDeclarations(got, inv)...)
if len(errs) > 0 {
diff --git a/internal/provision/testdata/plan14-root-reads-claim-router-cache.tsv b/internal/provision/testdata/plan14-root-reads-claim-router-cache.tsv
new file mode 100644
index 000000000..a4606d328
--- /dev/null
+++ b/internal/provision/testdata/plan14-root-reads-claim-router-cache.tsv
@@ -0,0 +1,2 @@
+# Census overlay claim-router-cache (harness G10 re-run, 8.2, 2026-10-20: a normal update leaves the agent's router cache, <data>/system/router/<version>/carlos, until its next hourly observe, and the migration census refused it). claimBoxDataCensus keeps the agent's whole system update directory (system/router: requested.json and the version cache) as a shared tree: directories and regular files only, a symlink refuses. Root already walks the cache beneath the data dir and checks it against the release's signed sums before use; it is box state, never an installation artifact. claimBoxDataCensus has no read site of its own: envelope only. PROPOSED-claim-router-cache.
+@coverage internal/host e5ad5c73f8920418a59ca1ec2f62e6b2003289e822d38d296173ed6303acda27