carlos / platform Public

fix(host): classify parked publications during the upload walk

Keep the preflight refusal and apply FilesDirSkip in claim seed and release flush. Require the classifier skip in the publication guard, with witnesses that plant secrets during the wake-state PUT.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev bc4f12067ff34fde32a38a0a3f399413154b4a78 parent cb26724
12 files changed, +159 −22
  • docs/superpowers/notes/census-durability-3a-escrow-claims.md +2 −2
  • docs/superpowers/notes/census-proposal-durability-3a-escrow.md +3 −3
  • internal/host/claimfilesseed_stage.go +1 −1
  • internal/host/escrow_publication_race_linux_test.go +100 −0
  • internal/host/relocationflush.go +1 −1
  • internal/layout/pubclass/pubclass.go +10 −2
  • internal/layout/pubclass/pubclass_test.go +12 −0
  • internal/layout/pubclass/publication_guard_test.go +4 −6
  • internal/layout/pubclass/testdata/publication_guard/clean.go +1 −1
  • internal/layout/pubclass/testdata/publication_guard/preflight.go +19 −0
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-durability-3a-escrow.tsv +5 −5
diff --git a/docs/superpowers/notes/census-durability-3a-escrow-claims.md b/docs/superpowers/notes/census-durability-3a-escrow-claims.md
index fd79395d0..e006bf174 100644
--- a/docs/superpowers/notes/census-durability-3a-escrow-claims.md
+++ b/docs/superpowers/notes/census-durability-3a-escrow-claims.md
@@ -70,7 +70,7 @@ internal/activator/escrow.go:ExecBackend.escrowDivergence durability 3a Task 4 f
internal/host/movesfiles.go:movesFiles.Establish Durability 3a Task 5 (parked path, host claims only): a present env file (claimEnvPresent: nested via instancefs.OpenBeneathOrAbsent, flat via Lstat; the bytes are never read) refuses with pubclass.ErrSecretPath before any bucket write; the env bytes are no longer read (readClaimEnvFile deleted); with no env file the establishment proceeds and stages StagePlatformDelete(EnvItem), so a raw env item a baseline holds is dropped, never carried into the new generation; openPrepared no longer takes the env and establishedOver no longer GETs an env object. Only refuses more, and reads less.
internal/host/movesfiles.go:claimEnvPresent Durability 3a Task 5: new: whether the claim env file exists, without reading it: nested, instancefs.OpenBeneathOrAbsent beneath the instance directory (no link at any component; the descriptor closed at once); flat, os.Lstat of <data>/<host>.env (a link there counts as present, so it refuses). An undecidable answer is an error. Only feeds a refusal.
internal/host/movesfiles.go:buildPrepared Durability 3a Task 5 (parked path, CARLOS_MOVES_PHASE1 only): wantEnv refuses with pubclass.ErrSecretPath before anything is read or written; the env presence check for !wantEnv is os.Stat instead of os.ReadFile (the secret is no longer read into memory); hostfiles.RefuseSecretsAt over root.Open(".") (+file:Open, a descriptor of the os.Root it already opened, never a pathname) before NewPrepared; the walk checks pubclass.Of(...) == App before each Stage; the env file is never staged. Only refuses more, and reads less.
-internal/host/relocationflush.go:ReleaseFlushFiles.Flush Durability 3a Task 5 (parked path, host claims only): the env file's presence is decided first with instancefs.OpenBeneathOrAbsent (the bytes are never read, replacing readInstanceFile of the env): present refuses with pubclass.ErrSecretPath before the manifest is read; hostfiles.RefuseSecretsAt over the root it opened, after the tenant seam and before hostfiles.Seed; absent still stages the env item's delete. Only refuses more, and reads less.
-internal/host/claimfilesseed_stage.go:filesSeedOperation.stage Durability 3a Task 5 (parked path, host claims with origins only): hostfiles.RefuseSecretsAt over the root it opened, before hostfiles.Seed: any path the classifier does not call App refuses the seed before its first write, with pubclass.ErrSecretPath. No read added; the walk is the descriptor walk Seed itself makes. Task 7 fix round 1: bind the descriptor returned through work.With once as dir; stat, RefuseSecretsAt and Seed use that same descriptor. No path, read, authority, refusal or production behavior changes; the account/host identity and descriptor lifetime are unchanged.
+internal/host/relocationflush.go:ReleaseFlushFiles.Flush Durability 3a Task 5 (parked path, host claims only): the env file's presence is decided first with instancefs.OpenBeneathOrAbsent (the bytes are never read, replacing readInstanceFile of the env): present refuses with pubclass.ErrSecretPath before the manifest is read; hostfiles.RefuseSecretsAt over the root it opened, after the tenant seam and before hostfiles.Seed; absent still stages the env item's delete. Only refuses more, and reads less. Branch fix R1 P1-2: Seed also receives FilesDirSkip for classification during the upload walk; the release flush composes its optional skip as an additional exclusion. The preflight remains; no read target or authority added.
+internal/host/claimfilesseed_stage.go:filesSeedOperation.stage Durability 3a Task 5 (parked path, host claims with origins only): hostfiles.RefuseSecretsAt over the root it opened, before hostfiles.Seed: any path the classifier does not call App refuses the seed before its first write, with pubclass.ErrSecretPath. No read added; the walk is the descriptor walk Seed itself makes. Task 7 fix round 1: bind the descriptor returned through work.With once as dir; stat, RefuseSecretsAt and Seed use that same descriptor. No path, read, authority, refusal or production behavior changes; the account/host identity and descriptor lifetime are unchanged. Branch fix R1 P1-2: Seed also receives FilesDirSkip for classification during the upload walk; the release flush composes its optional skip as an additional exclusion. The preflight remains; no read target or authority added.
# Task 8: approved console copy and documentation only; no root-binary source unit changed, no root read added. Earlier Tasks 1-7 claims above remain the whole-branch proposal.
diff --git a/docs/superpowers/notes/census-proposal-durability-3a-escrow.md b/docs/superpowers/notes/census-proposal-durability-3a-escrow.md
index da72f8242..eb7f4314f 100644
--- a/docs/superpowers/notes/census-proposal-durability-3a-escrow.md
+++ b/docs/superpowers/notes/census-proposal-durability-3a-escrow.md
@@ -11,9 +11,9 @@ Ruling `census-ruling-durability-3a-escrow`. The independent reviewer approves o
| `internal/activator/instancekey.go` `ExecBackend.ensureInstanceKeyAt` | body | unchanged (4) | durability 3a Task 4: asks mintGuardFor(ctx, rt) (was haMintGuard): an HA host's guard as before; an eligible host's escrowMintGuard, which on a ready box reads the bucket manifest and the sealed env item when a mint is next and refuses while the escrow holds the key, and on a box that is not ready refuses every mint; nil for any other host, which mints as before. The replica and fenced/conflict refusals are unchanged; only adds refusals Fix round 1: asks mintGuardWith(ctx, rt, !create): a launch's ensure shares its preparation's escrow read, the backfill's reads the bucket afresh; only refuses. |
| `internal/activator/instancekey.go` `ensureInstanceKey` | body | unchanged (1) | durability 3a Task 4: the guard is asked with InstanceKeyVar, at the same point (the locked read found no key and the bucket allowed a mint); create-only, fail-closed and defer-on-unknown unchanged; the same one site; only adds a refusal |
| `internal/host/agent.go` `runAgent` | body | unchanged (6) | durability 3a Task 3: one more assignment beside eb.FilesStore: eb.EscrowKey = haEscrowKey(os.Getenv("CARLOS_SECRETS_KEY")), the agent's own environment parsed by appconfig.ParsePrivateKey as the moves pass parses it (unset or unparseable: a log line and nil, and HA publication refuses on the box). No path is opened or read, no read site added; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 4: one more goroutine beside configSyncLoop: go escrowLoop(agentCtx, reg, svc), the escrow sweep every 30 s over the same registry and Service. This body reads nothing new itself; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 5: one more call beside eb.EscrowKey: wireRawSecretPages(eb, PageOperator, metricsBoxLabel(os.Getenv, readMachineID())), which sets eb.OnRawSecret to page an operator (alerting.Page through PageOperator, LevelIncident) on its own goroutine with a 20 s timeout; metricsBoxLabel and readMachineID are the reads this body already makes for the moves refusal log; no new read site; the same six sites, offsets moved; B,C,D,F authority retained. Merge of origin/main 90c4d3aa: main's own later changes to this body are kept as main has them, under main's rulings; this branch's change is the same as above. |
-| `internal/host/claimfilesseed_stage.go` `filesSeedOperation.stage` | body | unchanged (2) | Durability 3a Task 5 (parked path, host claims with origins only): hostfiles.RefuseSecretsAt over the root it opened, before hostfiles.Seed: any path the classifier does not call App refuses the seed before its first write, with pubclass.ErrSecretPath. No read added; the walk is the descriptor walk Seed itself makes. Task 7 fix round 1: bind the descriptor returned through work.With once as dir; stat, RefuseSecretsAt and Seed use that same descriptor. No path, read, authority, refusal or production behavior changes; the account/host identity and descriptor lifetime are unchanged. |
+| `internal/host/claimfilesseed_stage.go` `filesSeedOperation.stage` | body | unchanged (2) | Durability 3a Task 5 (parked path, host claims with origins only): hostfiles.RefuseSecretsAt over the root it opened, before hostfiles.Seed: any path the classifier does not call App refuses the seed before its first write, with pubclass.ErrSecretPath. No read added; the walk is the descriptor walk Seed itself makes. Task 7 fix round 1: bind the descriptor returned through work.With once as dir; stat, RefuseSecretsAt and Seed use that same descriptor. No path, read, authority, refusal or production behavior changes; the account/host identity and descriptor lifetime are unchanged. Branch fix R1 P1-2: Seed also receives FilesDirSkip for classification during the upload walk; the release flush composes its optional skip as an additional exclusion. The preflight remains; no read target or authority added. |
| `internal/host/movesfiles.go` `movesFiles.Establish` | body | unchanged (0) | Durability 3a Task 5 (parked path, host claims only): a present env file (claimEnvPresent: nested via instancefs.OpenBeneathOrAbsent, flat via Lstat; the bytes are never read) refuses with pubclass.ErrSecretPath before any bucket write; the env bytes are no longer read (readClaimEnvFile deleted); with no env file the establishment proceeds and stages StagePlatformDelete(EnvItem), so a raw env item a baseline holds is dropped, never carried into the new generation; openPrepared no longer takes the env and establishedOver no longer GETs an env object. Only refuses more, and reads less. |
-| `internal/host/relocationflush.go` `ReleaseFlushFiles.Flush` | body | unchanged (1) | Durability 3a Task 5 (parked path, host claims only): the env file's presence is decided first with instancefs.OpenBeneathOrAbsent (the bytes are never read, replacing readInstanceFile of the env): present refuses with pubclass.ErrSecretPath before the manifest is read; hostfiles.RefuseSecretsAt over the root it opened, after the tenant seam and before hostfiles.Seed; absent still stages the env item's delete. Only refuses more, and reads less. |
+| `internal/host/relocationflush.go` `ReleaseFlushFiles.Flush` | body | unchanged (1) | Durability 3a Task 5 (parked path, host claims only): the env file's presence is decided first with instancefs.OpenBeneathOrAbsent (the bytes are never read, replacing readInstanceFile of the env): present refuses with pubclass.ErrSecretPath before the manifest is read; hostfiles.RefuseSecretsAt over the root it opened, after the tenant seam and before hostfiles.Seed; absent still stages the env item's delete. Only refuses more, and reads less. Branch fix R1 P1-2: Seed also receives FilesDirSkip for classification during the upload walk; the release flush composes its optional skip as an additional exclusion. The preflight remains; no read target or authority added. |
| `internal/hostfiles/restore.go` `Restore` | body | unchanged (1) | durability 3a Task 3 fix round 1: passes nil for restore's new shadowed argument, so it fetches, writes and removes exactly what it did; the same reads. restore gains that argument (a caller's Shadowed func over the manifest it has already read and validated): a live entry it names, after the overlap rule, is skipped before any fetch and reported in RestoreStats.Shadowed. It only leaves things out; nothing new is opened, read or followed. RestoreRootBaselineShadowed is new, RestoreRootBaseline is it with nil. Durability 3a Task 5 fix round 1: restore() takes one more argument, checked (nil from Restore, RestoreRoot and RestoreRootBaselineShadowed), called with the manifest after checkManifest and before anything is removed, fetched or written (RestoreRootBaselineObserved passes the caller's); Restore passes nil, so its reads, opens and writes are exactly as before. |
| `internal/activator/backend_exec.go` `ExecBackend.Acquire` | sites | +registry:Host | durability 3a Task 4 fix round 1: after a successful acquire, records the instance lease it hands out (escrow.noteLease, memory only), so the escrow can ask whether this box holds the host's lease; the same acquire, no read added; the agent as carlos (carlos-edge.service), no root caller |
| `internal/activator/hafiles.go` `ExecBackend.newHostFiles` | sites | +whole:Route | durability 3a Task 3: now also sets the publisher's sealer (sealerFor(rt); its error is returned and nothing is built) and its skip, pubclass.FilesDirSkip(Nested, rt.Host), a pure function of the name, so every tree pass publishes only App paths and never the trio raw. Still no I/O; the new +registry:Host and +whole:Route sites are the sealer's and the classifier's arguments. Durability 3a Task 5: also sets the publisher's noteHeld, a closure calling noteRawBaseline(host, pub) (the detector over the manifest the publisher holds, decoded from its own committed bytes); no I/O; the -registry:Host site is rt.Host read once into a local. |
@@ -117,6 +117,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- quiet `internal/layout/plan.go:NestedPlatformNames`: reads nothing now; retired while it reads nothing (or its row keeps no sites)
- reads `internal/host/movesfiles.go:buildPrepared`: +file:Open, -file:ReadFile, +file:Stat; keeps legacy, task accepted-legacy
-Seal: `67b54b219f990c3dcfe32c6ffb11a80a4ca3898aec060fe9f4450e21098af714` → `92b173640c857f6dcbd78c80c6c6004d65fcbfb6f6f5d707e2badb1a782d0dd3`.
+Seal: `67b54b219f990c3dcfe32c6ffb11a80a4ca3898aec060fe9f4450e21098af714` → `b70fc335eac3c243d59d4a7d30bce8ff2131512f3581bdba86100bd023f1761c`.
Overlay: `internal/provision/testdata/plan14-root-reads-durability-3a-escrow.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/host/claimfilesseed_stage.go b/internal/host/claimfilesseed_stage.go
index 339c3918e..74359fc74 100644
--- a/internal/host/claimfilesseed_stage.go
+++ b/internal/host/claimfilesseed_stage.go
@@ -149,7 +149,7 @@ func (s *filesSeedOperation) stage(ctx context.Context, o hostclaim.Observed, in
if err := hostfiles.RefuseSecretsAt(ctx, dir, pubclass.Nested, o.Host); err != nil {
return fmt.Errorf("files seed of %s: %w", o.Host, err)
}
- s.stats, err = hostfiles.Seed(ctx, p, dir, wake, nil)
+ s.stats, err = hostfiles.Seed(ctx, p, dir, wake, pubclass.FilesDirSkip(pubclass.Nested, o.Host))
if err != nil {
return err
}
diff --git a/internal/host/escrow_publication_race_linux_test.go b/internal/host/escrow_publication_race_linux_test.go
new file mode 100644
index 000000000..230c5338c
--- /dev/null
+++ b/internal/host/escrow_publication_race_linux_test.go
@@ -0,0 +1,100 @@
+//go:build linux
+
+package host
+
+import (
+ "bytes"
+ "context"
+ "os"
+ "path/filepath"
+ "strings"
+ "testing"
+
+ "github.com/carlosframework/platform/internal/hostclaim"
+ "github.com/carlosframework/platform/internal/hostfiles"
+ "github.com/carlosframework/platform/internal/registry"
+ "github.com/carlosframework/platform/internal/release"
+)
+
+type secretDuringWakeStore struct {
+ release.Store
+ t *testing.T
+ dir, wakeKey string
+}
+
+func (s *secretDuringWakeStore) Put(ctx context.Context, key string, body []byte, match string) (string, error) {
+ if s.wakeKey == "" && strings.Contains(key, "/objects/") {
+ s.wakeKey = key
+ for _, name := range []string{"instance.key", "report.token"} {
+ if err := os.WriteFile(filepath.Join(s.dir, name), []byte("late-secret-"+name), 0o600); err != nil {
+ s.t.Fatal(err)
+ }
+ }
+ }
+ return s.Store.Put(ctx, key, body, match)
+}
+
+func checkLateSecretsNotUploaded(t *testing.T, s *secretDuringWakeStore, prefix string) {
+ t.Helper()
+ m, found, err := hostfiles.Load(t.Context(), s, prefix)
+ if err != nil || !found {
+ t.Fatalf("manifest: %v %v", found, err)
+ }
+ if m.Platform[hostfiles.WakeItem].Object != s.wakeKey {
+ t.Fatal("hook did not run during wake-state PUT")
+ }
+ for _, name := range []string{"instance.key", "report.token"} {
+ if e := m.Entries[name]; e.Object != "" {
+ t.Errorf("late %s uploaded raw: %+v", name, e)
+ }
+ }
+ keys, err := s.Store.List(t.Context(), prefix)
+ if err != nil {
+ t.Fatal(err)
+ }
+ for _, key := range keys {
+ body, _, err := s.Store.Get(t.Context(), key)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if bytes.Contains(body, []byte("late-secret-")) {
+ t.Errorf("raw secret in %s", key)
+ }
+ }
+ if m.Entries["tenant.txt"].Object == "" {
+ t.Fatal("ordinary file not uploaded")
+ }
+}
+
+func TestClaimSeedClassifiesSecretsCreatedDuringWakePUT(t *testing.T) {
+ f, private, _, in := filesSeedPrivateFixture(t)
+ dir := filepath.Join(filepath.Dir(f.route.DBPath), filesHost)
+ mkTree(t, dir, map[string]string{"tenant.txt": "ordinary"})
+ store := &secretDuringWakeStore{Store: private.Files, t: t, dir: dir}
+ private.Files = store
+ if err := private.Establish(t.Context(), f.observed, in, &filesFixture{t: t}); err != nil {
+ t.Fatal(err)
+ }
+ checkLateSecretsNotUploaded(t, store, movesFilesPrefix(f.observed.Claim.Holder.Location, "seed"))
+}
+
+func TestReleaseFlushClassifiesSecretsCreatedDuringWakePUT(t *testing.T) {
+ const host = "shop.example"
+ dir, envDir := t.TempDir(), t.TempDir()
+ mkTree(t, dir, map[string]string{"tenant.txt": "ordinary"})
+ store := &secretDuringWakeStore{Store: release.NewDirStore(t.TempDir()), t: t, dir: dir}
+ reg, err := registry.Open(filepath.Join(t.TempDir(), "registry.db"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ t.Cleanup(func() { reg.Close() })
+ if err := reg.Upsert(registry.Route{Host: host, Kind: "service", Addr: "10.0.0.1:3000", Status: "ready", Hibernate: true}); err != nil {
+ t.Fatal(err)
+ }
+ flush := ReleaseFlushFiles{Data: store, Registry: reg, FilesDir: func(string) string { return dir }, EnvPath: func(string) string { return filepath.Join(envDir, host+".env") }}
+ obs := hostclaim.Observed{Host: host, Claim: &hostclaim.Claim{Host: host, Holder: &hostclaim.Holder{Location: "instances/" + host + "/inc", Generation: "g6"}}}
+ if _, err := flush.Flush(t.Context(), obs); err != nil {
+ t.Fatal(err)
+ }
+ checkLateSecretsNotUploaded(t, store, "instances/"+host+"/inc/files/g-g6/")
+}
diff --git a/internal/host/relocationflush.go b/internal/host/relocationflush.go
index 7a4f2307d..36c1e7a64 100644
--- a/internal/host/relocationflush.go
+++ b/internal/host/relocationflush.go
@@ -97,7 +97,7 @@ func (f ReleaseFlushFiles) Flush(ctx context.Context, obs hostclaim.Observed) (i
if err := hostfiles.RefuseSecretsAt(ctx, root, pubclass.Nested, obs.Host); err != nil {
return 0, fmt.Errorf("release flush of %s: %w", obs.Host, err)
}
- st, err := hostfiles.Seed(ctx, p, root, ws, f.Skip)
+ st, err := hostfiles.Seed(ctx, p, root, ws, pubclass.FilesDirSkip(pubclass.Nested, obs.Host, f.Skip))
if err != nil {
if len(st.Unreadable) > 0 || len(st.Retry) > 0 || len(st.Torn) > 0 {
return 0, fmt.Errorf("hostfiles: release flush of %s: unreadable %q replaced %q torn %q", obs.Host, st.Unreadable, st.Retry, st.Torn)
diff --git a/internal/layout/pubclass/pubclass.go b/internal/layout/pubclass/pubclass.go
index 70a4fef16..afb72570a 100644
--- a/internal/layout/pubclass/pubclass.go
+++ b/internal/layout/pubclass/pubclass.go
@@ -174,9 +174,17 @@ func Of(l Layout, host, rel string, isDir bool) Class {
// FilesDirSkip is a hostfiles skip for a sync rooted at <root>/<host>:
// true for every path whose class as host+"/"+rel is not App.
-func FilesDirSkip(l Layout, host string) func(rel string, isDir bool) bool {
+func FilesDirSkip(l Layout, host string, extra ...func(string, bool) bool) func(rel string, isDir bool) bool {
return func(rel string, isDir bool) bool {
- return Of(l, host, host+"/"+rel, isDir) != App
+ if Of(l, host, host+"/"+rel, isDir) != App {
+ return true
+ }
+ for _, skip := range extra {
+ if skip != nil && skip(rel, isDir) {
+ return true
+ }
+ }
+ return false
}
}
diff --git a/internal/layout/pubclass/pubclass_test.go b/internal/layout/pubclass/pubclass_test.go
index db3acf5ec..551dc791a 100644
--- a/internal/layout/pubclass/pubclass_test.go
+++ b/internal/layout/pubclass/pubclass_test.go
@@ -232,3 +232,15 @@ func TestFixedShapeHostReadsEveryPlatformShape(t *testing.T) {
}
}
}
+
+func TestFilesDirSkipCombinesExtraExclusions(t *testing.T) {
+ skip := FilesDirSkip(Nested, "shop.example.com", nil, func(rel string, isDir bool) bool { return rel == "private" })
+ for _, tc := range []struct {
+ rel string
+ want bool
+ }{{"instance.key", true}, {"report.token", true}, {"private", true}, {"tenant.txt", false}} {
+ if got := skip(tc.rel, false); got != tc.want {
+ t.Errorf("%s: skip %v, want %v", tc.rel, got, tc.want)
+ }
+ }
+}
diff --git a/internal/layout/pubclass/publication_guard_test.go b/internal/layout/pubclass/publication_guard_test.go
index 90963aeb3..7d4e4c7eb 100644
--- a/internal/layout/pubclass/publication_guard_test.go
+++ b/internal/layout/pubclass/publication_guard_test.go
@@ -722,12 +722,12 @@ func (g *publicationGuard) check(u *publicationUnit, c *ast.CallExpr, target pub
g.problem(u, c, "StageSealed: argument is not SealedRel")
}
default:
- rootIndex, skipIndex := 2, 3
+ skipIndex := 3
if target.kind == "Seed" {
skipIndex = 4
}
if target.kind == "Publish" {
- rootIndex, skipIndex = 3, 4
+ skipIndex = 4
}
valid := false
if len(args) > skipIndex {
@@ -737,11 +737,8 @@ func (g *publicationGuard) check(u *publicationUnit, c *ast.CallExpr, target pub
valid = g.skip(u, args[skipIndex])
}
}
- if !valid && len(args) > rootIndex {
- valid = g.refused(u, c, args[rootIndex])
- }
if !valid {
- g.problem(u, c, target.kind+": skip is not FilesDirSkip and root has no dominating refusal")
+ g.problem(u, c, target.kind+": skip is not FilesDirSkip")
}
}
}
@@ -890,6 +887,7 @@ func TestEveryStagingOperationIsClassified(t *testing.T) {
}
want := map[string][]string{
"clean.go": nil,
+ "preflight.go": {"zzPreflightOnly:Seed:", "zzPreflightOnly:SyncDirAt:"},
"unmapped.go": {"zzUnmapped:Stage:", "zzUnmapped:Stage:"},
"refusalwrites.go": {"zzRefusalLoop:SyncDirAt:", "zzRefusalClosure:SyncDirAt:", "zzRefusalPointer:SyncDirAt:"},
"embedding.go": {"type zzEmbeddedPublisher:embedding:", "type zzEmbeddedPrepared:embedding:", "zzEmbeddedLocal:embedding:", "zzEmbeddedSignature:embedding:", "zzEmbeddedSignature:embedding:"},
diff --git a/internal/layout/pubclass/testdata/publication_guard/clean.go b/internal/layout/pubclass/testdata/publication_guard/clean.go
index 0ab4ef43b..2e87b18f3 100644
--- a/internal/layout/pubclass/testdata/publication_guard/clean.go
+++ b/internal/layout/pubclass/testdata/publication_guard/clean.go
@@ -46,7 +46,7 @@ func zzCleanRefusal(ctx context.Context, p *hostfiles.Publisher, root *os.File,
if err := hostfiles.RefuseSecretsAt(ctx, root, pubclass.Nested, host); err != nil {
return err
}
- _, err := hostfiles.Seed(ctx, p, root, hostfiles.WakeState{}, nil)
+ _, err := hostfiles.Seed(ctx, p, root, hostfiles.WakeState{}, pubclass.FilesDirSkip(pubclass.Nested, host))
return err
}
diff --git a/internal/layout/pubclass/testdata/publication_guard/preflight.go b/internal/layout/pubclass/testdata/publication_guard/preflight.go
new file mode 100644
index 000000000..16430f4e8
--- /dev/null
+++ b/internal/layout/pubclass/testdata/publication_guard/preflight.go
@@ -0,0 +1,19 @@
+package host
+
+import (
+ "context"
+ "github.com/carlosframework/platform/internal/hostfiles"
+ "github.com/carlosframework/platform/internal/layout/pubclass"
+ "os"
+)
+
+func zzPreflightOnly(ctx context.Context, p *hostfiles.Publisher, root *os.File, host string) error {
+ if err := hostfiles.RefuseSecretsAt(ctx, root, pubclass.Nested, host); err != nil {
+ return err
+ }
+ if _, err := hostfiles.Seed(ctx, p, root, hostfiles.WakeState{}, nil); err != nil {
+ return err
+ }
+ _, err := hostfiles.SyncDirAt(ctx, p, root, nil)
+ return err
+}
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index baf203821..a5726eab5 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -52,4 +52,4 @@ plan14-root-reads-managed-fleets-1b.tsv 7570ca617863882780c1c5a7d04430b578a297ee
plan14-root-reads-sponsor-existing-accounts.tsv 7570ca617863882780c1c5a7d04430b578a297ee4d72ca25acc1cdc5288ca283
plan14-root-reads-rootfs-apps-6.tsv c86929d08b9b2038fa103d1c7311ab2958e7100e92dc550d36daeb364affd029
plan14-root-reads-devbox-macos.tsv 67b54b219f990c3dcfe32c6ffb11a80a4ca3898aec060fe9f4450e21098af714
-plan14-root-reads-durability-3a-escrow.tsv 92b173640c857f6dcbd78c80c6c6004d65fcbfb6f6f5d707e2badb1a782d0dd3
+plan14-root-reads-durability-3a-escrow.tsv b70fc335eac3c243d59d4a7d30bce8ff2131512f3581bdba86100bd023f1761c
diff --git a/internal/provision/testdata/plan14-root-reads-durability-3a-escrow.tsv b/internal/provision/testdata/plan14-root-reads-durability-3a-escrow.tsv
index 355fb6cec..a25b54305 100644
--- a/internal/provision/testdata/plan14-root-reads-durability-3a-escrow.tsv
+++ b/internal/provision/testdata/plan14-root-reads-durability-3a-escrow.tsv
@@ -8,7 +8,7 @@
@legacy e60987732b032e682e6d78218e85625829d80ab8767d9575efeaee130e8b9830 internal/activator/instancekey.go ExecBackend.BackfillInstanceKey legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: back to main's body bar a comment: it calls ensureInstanceKeyAt as before, and an HA host's mint decision now lives inside that producer (haMintGuard, final fix F2); the agent's backfill skips HA hosts before this (instancekeys.go); the one +whole:Route of the first proposal is gone; no read added;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: comment only (the escrowed host's mint decision inside ensureInstanceKeyAt); the body is unchanged whole:Route@385,whole:Route@400 b65f3ce46f53cc9cc6679f490ff31684bc96c5d8d86c337c3c151cb11a480a4b
@legacy 4959fc931f2d6af0dd7a80d6f75b3eef14b502750ebd38e15ba1a5fdf50f95bf internal/activator/instancekey.go ExecBackend.ensureInstanceKeyAt legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: after the unchanged replica and fenced/conflict checks, asks haMintGuard(ctx, rt) (+whole:Route) and hands the guard to ensureInstanceKey; a classification error fails with InstanceKeyFailed; a non-HA host gets a nil guard and mints exactly as before; only adds a refusal;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: asks mintGuardFor(ctx, rt) (was haMintGuard): an HA host's guard as before; an eligible host's escrowMintGuard, which on a ready box reads the bucket manifest and the sealed env item when a mint is next and refuses while the escrow holds the key, and on a box that is not ready refuses every mint; nil for any other host, which mints as before. The replica and fenced/conflict refusals are unchanged; only adds refusals Fix round 1: asks mintGuardWith(ctx, rt, !create): a launch's ensure shares its preparation's escrow read, the backfill's reads the bucket afresh; only refuses. registry:Host@598,registry:Replica@159,whole:Route@491,whole:Route@667 5605bd1a4441859415f51b50c38e959987b2524fa8ccbec7364949e7097e9770
@legacy 62f2a51b33e98d5e15741fab9c6b9bbbb96a36846290bdc71800b28ac23dee51 internal/activator/instancekey.go ensureInstanceKey legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: one more parameter, guard (nil for every caller but ensureInstanceKeyAt on an HA host), asked once the locked read finds no key and the bucket allows a mint, before anything is minted; its refusal returns InstanceKeyFailed with nothing written. Create-only, fail-closed and defer-on-unknown are unchanged; the one site unchanged, no read added; only adds a refusal;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: the guard is asked with InstanceKeyVar, at the same point (the locked read found no key and the bucket allowed a mint); create-only, fail-closed and defer-on-unknown unchanged; the same one site; only adds a refusal file:Stat@4816 2d53f8246ac317c066d4b804cdc251aaf60abbd4423c6b780f0cbee227203fc8
-@legacy b35b2289ba8334ff5c2aa3902bf24e5d9656f1f2122849c4347494d56f678d4a internal/host/relocationflush.go ReleaseFlushFiles.Flush legacy accepted-legacy accepted-legacy;rev3=PROPOSED-seed;basis=census-ruling-FS-R6; tenant files and env are published data, never authority;rev3=census-ruling-durability-3a-escrow;basis=Durability 3a Task 5 (parked path, host claims only): the env file's presence is decided first with instancefs.OpenBeneathOrAbsent (the bytes are never read, replacing readInstanceFile of the env): present refuses with pubclass.ErrSecretPath before the manifest is read; hostfiles.RefuseSecretsAt over the root it opened, after the tenant seam and before hostfiles.Seed; absent still stages the env item's delete. Only refuses more, and reads less. file:Open@1428 076b8778ed1ca1052499a7432df959a9941cf8ea41e20c50a210c83a56f5c285
+@legacy bd27a869ea40ccecb8c4bff4b2f5eeeda93b81d2d0de2542f19af508eb5858a4 internal/host/relocationflush.go ReleaseFlushFiles.Flush legacy accepted-legacy accepted-legacy;rev3=PROPOSED-seed;basis=census-ruling-FS-R6; tenant files and env are published data, never authority;rev3=census-ruling-durability-3a-escrow;basis=Durability 3a Task 5 (parked path, host claims only): the env file's presence is decided first with instancefs.OpenBeneathOrAbsent (the bytes are never read, replacing readInstanceFile of the env): present refuses with pubclass.ErrSecretPath before the manifest is read; hostfiles.RefuseSecretsAt over the root it opened, after the tenant seam and before hostfiles.Seed; absent still stages the env item's delete. Only refuses more, and reads less. Branch fix R1 P1-2: Seed also receives FilesDirSkip for classification during the upload walk; the release flush composes its optional skip as an additional exclusion. The preflight remains; no read target or authority added. file:Open@1428 daf3181c23d5daa67552ed034f7acc9d953bc87d0103d44a3da2a397dd9858e3
@legacy e24a236954fe52e3d74ffc3a69733e88dec8bbdb5d7af50e7ddd06b993aa5188 internal/hostfiles/restore.go Restore legacy accepted-legacy accepted-legacy;rev3=merge-ruling-2;basis=Restore delegates to shared descriptor-root implementation; generic payload restoration remains legacy.;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: passes nil for restore's new baseline argument; the one site unchanged, nothing else changed;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3 fix round 1: passes nil for restore's new shadowed argument, so it fetches, writes and removes exactly what it did; the same reads. restore gains that argument (a caller's Shadowed func over the manifest it has already read and validated): a live entry it names, after the overlap rule, is skipped before any fetch and reported in RestoreStats.Shadowed. It only leaves things out; nothing new is opened, read or followed. RestoreRootBaselineShadowed is new, RestoreRootBaseline is it with nil. Durability 3a Task 5 fix round 1: restore() takes one more argument, checked (nil from Restore, RestoreRoot and RestoreRootBaselineShadowed), called with the manifest after checkManifest and before anything is removed, fetched or written (RestoreRootBaselineObserved passes the caller's); Restore passes nil, so its reads, opens and writes are exactly as before. file:OpenRoot@219 28385093d26c704b98e5f199ec9fa045302c989188abe38d41b3439f6a151a7e
@legacy a11c7bc89fb9c0f17ab1ed9d986e3ad4331b66a3ae9d2c857b3979aac03867fd internal/activator/escrow.go ExecBackend.EscrowSweep legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new, the agent as carlos (carlos-edge.service), no root caller, from escrowLoop: classifies each row against the rows handed in (Classify), keeps eligible rows known not HA from memory (haKnown, no read), and in host order from a round-robin cursor stats each escrowed file (stampAt) and publishes the changed ones, 8 at a time, at most 256 a sweep (sweepPublish); a box without a files store or key does nothing; opens nothing outside the rows' own data directories; writes only the hibernate bucket's files/0 prefix and the ledger Fix round 1: a host whose instance lease this box does not hold (holdsLease) is skipped, and one with a conflict marker counts as failing and is not published; the report is tallied through one lock (P1-4). Durability 3a Task 5: for each lease-held candidate, the host's held publisher (st.pub under the escrow lock) is handed to noteRawBaseline. Reads only manifests this process already holds (no request, no file opened); calls the detector, which logs and calls ExecBackend.OnRawSecret; nothing else changes. The +registry:Host sites are rt.Host as the state key and the detector's argument. registry:Host@1004,registry:Host@1041,registry:Host@1131,registry:Host@1287,registry:Host@1306,registry:Host@1457,registry:Host@1990,registry:Host@2336,registry:Host@2593,registry:Host@2667,registry:Host@536,registry:Host@761,registry:Host@795,registry:Host@933,whole:Route@1188,whole:Route@1192,whole:Route@1209,whole:Route@1296,whole:Route@1315,whole:Route@1466,whole:Route@1784,whole:Route@1992,whole:Route@2222,whole:Route@2338,whole:Route@2595,whole:Route@2669,whole:Route@356,whole:Route@519,whole:Route@587,whole:Route@653,whole:Route@706 ae45fefc9292c357fdc3d4ce737a1498eea44204a2beaedf6600051280ac43d1
@legacy 90f2d51840159dd44037a8eb60115e037f27c635d74652028b368bda6fcd35b8 internal/activator/escrow.go ExecBackend.SecretsEscrowed legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: haHostNow or escrowEligible; reads only what the HA classification already reads whole:Route@123,whole:Route@198 c22d35df72f67d7222efd0b0f09d51c42275ad4a10d637598fdc8b822f6333bd
@@ -73,9 +73,9 @@ internal/activator/instancekey.go ExecBackend.BackfillInstanceKey legacy accepte
internal/activator/instancekey.go ExecBackend.ensureInstanceKeyAt legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: after the unchanged replica and fenced/conflict checks, asks haMintGuard(ctx, rt) (+whole:Route) and hands the guard to ensureInstanceKey; a classification error fails with InstanceKeyFailed; a non-HA host gets a nil guard and mints exactly as before; only adds a refusal;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: asks mintGuardFor(ctx, rt) (was haMintGuard): an HA host's guard as before; an eligible host's escrowMintGuard, which on a ready box reads the bucket manifest and the sealed env item when a mint is next and refuses while the escrow holds the key, and on a box that is not ready refuses every mint; nil for any other host, which mints as before. The replica and fenced/conflict refusals are unchanged; only adds refusals Fix round 1: asks mintGuardWith(ctx, rt, !create): a launch's ensure shares its preparation's escrow read, the backfill's reads the bucket afresh; only refuses. registry:Host@598,registry:Replica@159,whole:Route@491,whole:Route@667 5605bd1a4441859415f51b50c38e959987b2524fa8ccbec7364949e7097e9770
internal/activator/instancekey.go ensureInstanceKey legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: one more parameter, guard (nil for every caller but ensureInstanceKeyAt on an HA host), asked once the locked read finds no key and the bucket allows a mint, before anything is minted; its refusal returns InstanceKeyFailed with nothing written. Create-only, fail-closed and defer-on-unknown are unchanged; the one site unchanged, no read added; only adds a refusal;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: the guard is asked with InstanceKeyVar, at the same point (the locked read found no key and the bucket allowed a mint); create-only, fail-closed and defer-on-unknown unchanged; the same one site; only adds a refusal file:Stat@4816 2d53f8246ac317c066d4b804cdc251aaf60abbd4423c6b780f0cbee227203fc8
internal/host/agent.go runAgent authority B,C,D,F rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): builds the box's lifetime judge once (newBoxJudge, nil with host claims on) and hands it to the seed placement, the moves and runs workers and every loop it starts; read sites unchanged, offsets moved; B,C,D,F authority retained; self-serve moves 1 Task 8: derives the box's lifetimes switch from the judge once (lifetimes := boxJudge != nil) and hands it to the edges file loop; read sites unchanged, offsets moved;rev3=census-ruling-plans-4d-lapse;basis=arms two more plans hooks from the same snapshot: e.SetPlanDisabledFor(planDisabledFor) beside SetPlanGovernedFor, and svc.SetDisabledFor(planDisabledRoute) beside SetMaxRunFor (plans 4d); the reads live in those units (plans-4d-units decision); read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-2;basis=main's body as of the merge of origin/main 9b81d97b (with main's plan rate ceiling, edge request records, regional box names, self-serve moves plan 1, plans 4d-1 lapse and its other later changes under main's own census rulings) plus the rootfs placement wiring in the activator start: an agentRootfs built from eb.NestedOK, CARLOS_DEPLOYMENT_SINGLE_TENANT, CARLOS_POOLS, the claim flag, swapArming's answer, the control client's /ready/rootfs and, on a fleet box whose identity resolved, fleetOwnerCheck over the deploy store main already opens for the fleet label (fleetStore), then arm and armedRootfs.Store; this body reads nothing new itself; the closures it wires read later, at a rootfs wake and each status tick: GET /ready/rootfs over the control socket, NestedOK's checks, and release.FleetOwnerKey for the judged row's own account and this box's fleet from the deploy store;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Tasks 7 and 11, #329 plan 3 Task 7 and plan 1 Task 7's policy cache: the control client is built once and handed to eb.Control, to the status tick (egressStatus) and to a new egressNudgeLoop goroutine; armSizeSource(svc, "/sys/fs/cgroup") after the activator Service; armPolicyCache() after armChangeIndex; statusLoop takes egressStatus. The reads are those units' own (decision rows); this body reads nothing new: the same five sites, offsets moved, in the agent; B,C,D,F authority retained.;rev3=census-ruling-remote-instance-metrics;basis=builds the metrics loop's owners closure (metricsOwners over the agent's registry, the activator and cgm.Leftover) when an activator exists and hands it to metricsLoop; reads nothing new itself;rev3=census-ruling-edge-asset-cache-3;basis=adds file:Statfs. runAgent keeps its authority (B,C,D,F). The new site is assetcache.Statfs, an exported assetcache.FS interface value (var Statfs FS = statfsFS{}), not a function value and not a call in runAgent: the ready hook passes it to armEdgeAssetCache as the store's filesystem, and armEdgeAssetCache calls its Space method on the configured data directory (dataDir(): $CARLOS_DATA_DIR, else /data), which calls unix.Statfs there (statfsFS.Space, accepted legacy at census-ruling-edge-asset-cache-2). No request-supplied pathname reaches it.;rev3=census-ruling-remote-metrics-nested;basis=main's body (merged origin/main acfa4f80, under main's own census rulings) plus: snapshots the nested layout (snapshotNestedUnits over /sys/fs/cgroup/carlos.slice/carlos-instances.slice) once at start, before the activator, and hands the metrics loop a unitSources struct (stamped units, routeHostNames, that root and the snapshot); reads nothing new itself;rev3=census-ruling-region-ha-p1a;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): wires region HA P1a into the activator: cfg.Record = haRecordFacts(openDeployStore, boxJudge) (the box's lifetime judge this body already builds with newBoxJudge, nil with host claims on; CI fix) and cfg.Self = lease.CurrentSelf; eb.Lifetimes (the process's lifetime index), eb.Registry, eb.StartupSwept (seedSweptAtStart.Load), eb.FilesStore from newProductionFilesStore (now lease.NewFilesStore, rootaws-loaded, a log line on failure) and lease.SetObligationDir(<data>/.ha-owed) (logged on failure; HA acquires then refuse); this body reads nothing new itself, the same five sites; the reads are those units' own (haRecordFacts and lease's SetObligationDir are new rows on this card); merge of origin/main d7ae1d76: main's own later changes to this body are kept as main has them, under main's rulings (census-ruling-remote-instance-metrics: the metricsOwners closure for metricsLoop; census-ruling-edge-asset-cache-3: the +file:Statfs site, assetcache.Statfs handed to the asset ready hook); this branch's change is the same as above;rev3=census-ruling-region-ha-p1b1;basis=region HA P1b-1: builds one termfence.Confirmer (Self from lease.CurrentSelf at each call, EC2 DescribeInstances method only, client from rootaws.LoadDefaultConfig with retries off, built lazily on first use) and sets eb.OwnerTerminated; this body reads nothing new itself, the same six sites;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 7: the startup Sweep literal hands its answer to startupSwept, which logs as before and, only on a clean sweep, marks rootfs admission swept (MarkRootfsSwept); same Sweep call, no read added;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (controller ruling after branch review R1, and Paul's R2 ruling): sets svc.Fleet = fleetWakeFor(os.Getenv, identity, identErr, fleetStore) from the identity it already resolves once and the deployment store the fleet loops already opened, and logs an ERROR naming the identity error when the box is on a fleet with an invalid identity. fleetWakeFor reads CARLOS_REGION and CARLOS_FLEET from the same environment. Read sites unchanged (6). Agent, not root; a platform box is unchanged.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 12: one call more beside armRunsPass, armInteractivePass(svc, reg, rolloutSink, boxJudge), in the same activator Configure hook, handing it the same box judge; fix round 1 (Astra P2, shutdown): after svc.Shutdown(ctx), shutdownInteractive(ctx) ends and joins every interactive session under the same shutdown budget; the worker's own reads are its units' (interactive.go); this body reads nothing new, the same six sites; merge of origin/main 6f1f6ca6: main's svc.Fleet = fleetWakeFor(...) and its invalid-identity ERROR line are kept as main has them (census-ruling-managed-fleets-1b); this branch's change is the same as above; read sites unchanged (6);rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: one more assignment beside eb.FilesStore: eb.EscrowKey = haEscrowKey(os.Getenv("CARLOS_SECRETS_KEY")), the agent's own environment parsed by appconfig.ParsePrivateKey as the moves pass parses it (unset or unparseable: a log line and nil, and HA publication refuses on the box). No path is opened or read, no read site added; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 4: one more goroutine beside configSyncLoop: go escrowLoop(agentCtx, reg, svc), the escrow sweep every 30 s over the same registry and Service. This body reads nothing new itself; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 5: one more call beside eb.EscrowKey: wireRawSecretPages(eb, PageOperator, metricsBoxLabel(os.Getenv, readMachineID())), which sets eb.OnRawSecret to page an operator (alerting.Page through PageOperator, LevelIncident) on its own goroutine with a 20 s timeout; metricsBoxLabel and readMachineID are the reads this body already makes for the moves refusal log; no new read site; the same six sites, offsets moved; B,C,D,F authority retained. Merge of origin/main 90c4d3aa: main's own later changes to this body are kept as main has them, under main's rulings; this branch's change is the same as above. file:Exec@17444,file:Open@1150,file:Statfs@44013,registry:App@11199,whole:Route@11191,whole:Route@28232 9077bf263076fbdb95be61279b53fb22bb70bf720022d2dab2ca196caa8d10d1
-internal/host/claimfilesseed_stage.go filesSeedOperation.stage authority C,J4 rev3=PROPOSED-seed; fresh private provider, real admitted tuple and origins; guarded safe source descriptor and wake snapshot; create conflicts compare bounded bytes at exact current version before commit;rev3=census-ruling-durability-3a-escrow;basis=Durability 3a Task 5 (parked path, host claims with origins only): hostfiles.RefuseSecretsAt over the root it opened, before hostfiles.Seed: any path the classifier does not call App refuses the seed before its first write, with pubclass.ErrSecretPath. No read added; the walk is the descriptor walk Seed itself makes. Task 7 fix round 1: bind the descriptor returned through work.With once as dir; stat, RefuseSecretsAt and Seed use that same descriptor. No path, read, authority, refusal or production behavior changes; the account/host identity and descriptor lifetime are unchanged. file:Stat@1497,file:Stat@761 7ad83fe3e76838280c03cb9189cb3d7b758a2cd861d6fe4947ae4f46d7a08f39
+internal/host/claimfilesseed_stage.go filesSeedOperation.stage authority C,J4 rev3=PROPOSED-seed; fresh private provider, real admitted tuple and origins; guarded safe source descriptor and wake snapshot; create conflicts compare bounded bytes at exact current version before commit;rev3=census-ruling-durability-3a-escrow;basis=Durability 3a Task 5 (parked path, host claims with origins only): hostfiles.RefuseSecretsAt over the root it opened, before hostfiles.Seed: any path the classifier does not call App refuses the seed before its first write, with pubclass.ErrSecretPath. No read added; the walk is the descriptor walk Seed itself makes. Task 7 fix round 1: bind the descriptor returned through work.With once as dir; stat, RefuseSecretsAt and Seed use that same descriptor. No path, read, authority, refusal or production behavior changes; the account/host identity and descriptor lifetime are unchanged. Branch fix R1 P1-2: Seed also receives FilesDirSkip for classification during the upload walk; the release flush composes its optional skip as an additional exclusion. The preflight remains; no read target or authority added. file:Stat@1540,file:Stat@761 15d5daee2a7bcdf768f30ed909d6e89b20b7d62466824a3232f9219a242b3cec
internal/host/movesfiles.go movesFiles.Establish authority C,J4 rev3=PROPOSED-p3;run=12;basis=agent files preparation; retains seed admitted-writer and ordinary origin proof with one C8 commit; H3 is inventory bookkeeping, C owns the enabled effect;rev3=census-ruling-durability-3a-escrow;basis=Durability 3a Task 5 (parked path, host claims only): a present env file (claimEnvPresent: nested via instancefs.OpenBeneathOrAbsent, flat via Lstat; the bytes are never read) refuses with pubclass.ErrSecretPath before any bucket write; the env bytes are no longer read (readClaimEnvFile deleted); with no env file the establishment proceeds and stages StagePlatformDelete(EnvItem), so a raw env item a baseline holds is dropped, never carried into the new generation; openPrepared no longer takes the env and establishedOver no longer GETs an env object. Only refuses more, and reads less. df33d8996c148bf34cdb6d5a59ac73137498beab31c561d926e3d19c59856a27
-internal/host/relocationflush.go ReleaseFlushFiles.Flush legacy accepted-legacy accepted-legacy;rev3=PROPOSED-seed;basis=census-ruling-FS-R6; tenant files and env are published data, never authority;rev3=census-ruling-durability-3a-escrow;basis=Durability 3a Task 5 (parked path, host claims only): the env file's presence is decided first with instancefs.OpenBeneathOrAbsent (the bytes are never read, replacing readInstanceFile of the env): present refuses with pubclass.ErrSecretPath before the manifest is read; hostfiles.RefuseSecretsAt over the root it opened, after the tenant seam and before hostfiles.Seed; absent still stages the env item's delete. Only refuses more, and reads less. file:Open@1428 076b8778ed1ca1052499a7432df959a9941cf8ea41e20c50a210c83a56f5c285
+internal/host/relocationflush.go ReleaseFlushFiles.Flush legacy accepted-legacy accepted-legacy;rev3=PROPOSED-seed;basis=census-ruling-FS-R6; tenant files and env are published data, never authority;rev3=census-ruling-durability-3a-escrow;basis=Durability 3a Task 5 (parked path, host claims only): the env file's presence is decided first with instancefs.OpenBeneathOrAbsent (the bytes are never read, replacing readInstanceFile of the env): present refuses with pubclass.ErrSecretPath before the manifest is read; hostfiles.RefuseSecretsAt over the root it opened, after the tenant seam and before hostfiles.Seed; absent still stages the env item's delete. Only refuses more, and reads less. Branch fix R1 P1-2: Seed also receives FilesDirSkip for classification during the upload walk; the release flush composes its optional skip as an additional exclusion. The preflight remains; no read target or authority added. file:Open@1428 daf3181c23d5daa67552ed034f7acc9d953bc87d0103d44a3da2a397dd9858e3
internal/hostfiles/restore.go Restore legacy accepted-legacy accepted-legacy;rev3=merge-ruling-2;basis=Restore delegates to shared descriptor-root implementation; generic payload restoration remains legacy.;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: passes nil for restore's new baseline argument; the one site unchanged, nothing else changed;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3 fix round 1: passes nil for restore's new shadowed argument, so it fetches, writes and removes exactly what it did; the same reads. restore gains that argument (a caller's Shadowed func over the manifest it has already read and validated): a live entry it names, after the overlap rule, is skipped before any fetch and reported in RestoreStats.Shadowed. It only leaves things out; nothing new is opened, read or followed. RestoreRootBaselineShadowed is new, RestoreRootBaseline is it with nil. Durability 3a Task 5 fix round 1: restore() takes one more argument, checked (nil from Restore, RestoreRoot and RestoreRootBaselineShadowed), called with the manifest after checkManifest and before anything is removed, fetched or written (RestoreRootBaselineObserved passes the caller's); Restore passes nil, so its reads, opens and writes are exactly as before. file:OpenRoot@219 28385093d26c704b98e5f199ec9fa045302c989188abe38d41b3439f6a151a7e
internal/activator/escrow.go ExecBackend.EscrowSweep legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new, the agent as carlos (carlos-edge.service), no root caller, from escrowLoop: classifies each row against the rows handed in (Classify), keeps eligible rows known not HA from memory (haKnown, no read), and in host order from a round-robin cursor stats each escrowed file (stampAt) and publishes the changed ones, 8 at a time, at most 256 a sweep (sweepPublish); a box without a files store or key does nothing; opens nothing outside the rows' own data directories; writes only the hibernate bucket's files/0 prefix and the ledger Fix round 1: a host whose instance lease this box does not hold (holdsLease) is skipped, and one with a conflict marker counts as failing and is not published; the report is tallied through one lock (P1-4). Durability 3a Task 5: for each lease-held candidate, the host's held publisher (st.pub under the escrow lock) is handed to noteRawBaseline. Reads only manifests this process already holds (no request, no file opened); calls the detector, which logs and calls ExecBackend.OnRawSecret; nothing else changes. The +registry:Host sites are rt.Host as the state key and the detector's argument. registry:Host@1004,registry:Host@1041,registry:Host@1131,registry:Host@1287,registry:Host@1306,registry:Host@1457,registry:Host@1990,registry:Host@2336,registry:Host@2593,registry:Host@2667,registry:Host@536,registry:Host@761,registry:Host@795,registry:Host@933,whole:Route@1188,whole:Route@1192,whole:Route@1209,whole:Route@1296,whole:Route@1315,whole:Route@1466,whole:Route@1784,whole:Route@1992,whole:Route@2222,whole:Route@2338,whole:Route@2595,whole:Route@2669,whole:Route@356,whole:Route@519,whole:Route@587,whole:Route@653,whole:Route@706 ae45fefc9292c357fdc3d4ce737a1498eea44204a2beaedf6600051280ac43d1
internal/activator/escrow.go ExecBackend.SecretsEscrowed legacy accepted-legacy accepted-legacy;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 4: new: haHostNow or escrowEligible; reads only what the HA classification already reads whole:Route@123,whole:Route@198 c22d35df72f67d7222efd0b0f09d51c42275ad4a10d637598fdc8b822f6333bd
@@ -144,7 +144,7 @@ internal/activator/paths.go ExecBackend.pathsFor legacy accepted-legacy accepted
@remove internal/host/schedule_wiring.go scheduleHostHA
@removed internal/host/schedule_wiring.go scheduleHostHA H3 census-ruling-durability-3a-escrow;absent;basis=durability 3a Task 4: renamed to scheduleHostEscrowed (on this card), asking SecretsEscrowed instead of IsHA
@coverage internal/activator 095e01249c36501ed819dcbb162624ab9dd1495bc170467d1fedb9ef46fecec5
-@coverage internal/host 3c8a9faa2e6abdc098bdb31624032e8b44da38e4e08b1e099c3bc969404e36aa
+@coverage internal/host 941b090a234199926a9f64c927657034c3b5fb17dea1f5a18716cfe2294f55b1
@coverage internal/hostfiles d79efb83d55025d18980240619281b671b8b928d72461aaefda686fbfa3ae68c
@coverage internal/layout f845fa728b0935279454d8b01023c5d6dae1c985061a41229cf0686e829f5c12
-@coverage internal/layout/pubclass 2563523c1fa1c5bfc78d349fa4b86335ab151417f61fa87daf35be3c84961a98
+@coverage internal/layout/pubclass 6515ba31b1848139c9da066a6c65b5583c39a92cb77621773d0d11d9cde24e24