carlos / platform Public

Revert "console: recheck imports and paths after each write (#186)"

This reverts commit 09097e06. Paul's ruling of 2026-11-21: a front's
import gate covers its own route and same-box prefixes only; cross-box
prefixes keep serving. The refusal design and its recheck are
withdrawn, with domains.RestoreClaimPathsAt and the record-write census
layer they added.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 50112c7f102a4b7432cb31dbb8ea91b7fcce9cf9 parent 11e8849
9 files changed, +15 −292
  • internal/console/apidomains.go +2 −25
  • internal/console/apiinstanceimport.go +0 −16
  • internal/console/importpaths.go +11 −59
  • internal/console/importpaths_test.go +0 −68
  • internal/domains/claims.go +0 −47
  • internal/domains/paths_test.go +0 −47
  • internal/provision/path_routes_import_census_test.go +0 −28
  • internal/provision/plan9_b8_census_test.go +1 −1
  • internal/provision/testdata/plan14-root-reads-path-routes-across-boxes.tsv +1 −1
diff --git a/internal/console/apidomains.go b/internal/console/apidomains.go
index b5601739f..1559ee361 100644
--- a/internal/console/apidomains.go
+++ b/internal/console/apidomains.go
@@ -1046,10 +1046,8 @@ func (s *Server) handleAPIDomainPaths(w http.ResponseWriter, r *http.Request) {
ctx, cancel := context.WithTimeout(r.Context(), instanceStoreTimeout)
defer cancel()
// Path routes across boxes §7.6: while the host's import is open, no
- // prefix to an app on another box is added. Checked here, and again
- // after the write (below).
- prev, ref, err := s.openImportPathsRefusal(ctx, acct.Sqid, app, host, paths)
- if err != nil {
+ // prefix to an app on another box is added.
+ if ref, err := s.openImportPathsRefusal(ctx, acct.Sqid, app, host, paths); err != nil {
log.Printf("console: api domains paths %s/%s %s: import check: %v", acct.Sqid, app, host, err)
jsonError(w, http.StatusBadGateway, "could not update the hostname's path routes — try again")
return
@@ -1057,9 +1055,6 @@ func (s *Server) handleAPIDomainPaths(w http.ResponseWriter, r *http.Request) {
jsonError(w, ref.Status, ref.Msg)
return
}
- if pathsPublishWriteHook != nil {
- pathsPublishWriteHook()
- }
// SetClaimPaths copies the claim it reads, Catchall included, and writes
// it back against that read's ETag. A write that leaves a catch-all on
// takes regionalMu (#447, Paul's ruling 8), so its read and write both
@@ -1102,24 +1097,6 @@ func (s *Server) handleAPIDomainPaths(w http.ResponseWriter, r *http.Request) {
jsonError(w, http.StatusBadGateway, "could not update the hostname's path routes — try again")
return
}
- // §7.6's ordering with import begin, which writes the import's record
- // and then reads the claim: this door writes the claim (above) and then
- // reads the record (here). Whichever writes second reads the other's
- // write, so a begin racing this publish sees the new map or is seen
- // here, and one of the two withdraws. A read that fails withdraws too.
- if changed {
- if ref, err := s.withdrawRacedPaths(ctx, acct.Sqid, app, host, prev, paths); err != nil || ref != nil {
- // The write landed before it was withdrawn: boxes converge again.
- s.bumpSerial(ctx)
- if err != nil {
- log.Printf("console: api domains paths %s/%s %s: import check after the write: %v", acct.Sqid, app, host, err)
- jsonError(w, http.StatusBadGateway, "could not update the hostname's path routes — try again")
- return
- }
- jsonError(w, ref.Status, ref.Msg)
- return
- }
- }
if changed {
// The COUNT, never the map: a published map runs to MaxPathsPerClaim
// entries, and an audit row is a sentence an operator reads, not a
diff --git a/internal/console/apiinstanceimport.go b/internal/console/apiinstanceimport.go
index de349b29e..57dd0a2f2 100644
--- a/internal/console/apiinstanceimport.go
+++ b/internal/console/apiinstanceimport.go
@@ -197,9 +197,6 @@ func (s *Server) beginImport(w http.ResponseWriter, r *http.Request, c seedCreat
// Not the request's cancellation: a client leaving now must not turn a
// write that landed into an error.
writeCtx, writeCancel := context.WithTimeout(context.WithoutCancel(ctx), instanceStoreTimeout)
- if importBeginWriteHook != nil {
- importBeginWriteHook()
- }
err = s.createSeedRecord(writeCtx, c, rec)
writeCancel()
if err != nil {
@@ -222,19 +219,6 @@ func (s *Server) beginImport(w http.ResponseWriter, r *http.Request, c seedCreat
jsonError(w, http.StatusBadGateway, importFailed)
return
}
- // §7.6's ordering with the paths door, which writes the claim and then
- // reads the import's record: begin writes the record (above) and then
- // reads the claim (here). Whichever writes second reads the other's
- // write, so a publish racing this begin is seen here or sees this
- // record, and one of the two withdraws. A read that fails withdraws too.
- recheck, recheckCancel := context.WithTimeout(ctx, instanceStoreTimeout)
- ref := s.importPathsRefusal(recheck, host)
- recheckCancel()
- if ref != nil {
- s.unbeginImport(ctx, c, id, "a path to another box")
- jsonError(w, ref.Status, ref.Msg)
- return
- }
// From here every failure rolls the import back and finishes it
// before the answer goes out.
diff --git a/internal/console/importpaths.go b/internal/console/importpaths.go
index 76326bd0c..3f9eed16d 100644
--- a/internal/console/importpaths.go
+++ b/internal/console/importpaths.go
@@ -26,27 +26,15 @@ import (
"encoding/json"
"errors"
"log"
- "maps"
"net/http"
"os"
"github.com/carlosframework/platform/internal/domains"
"github.com/carlosframework/platform/internal/edgesfile"
"github.com/carlosframework/platform/internal/provision"
- "github.com/carlosframework/platform/internal/release"
"github.com/carlosframework/platform/internal/seeds"
)
-// Seams for the tests: each runs, when set, between its door's check and its
-// write, so a test can put the other door's whole call there.
-var (
- // importBeginWriteHook runs in begin before the record is written.
- importBeginWriteHook func()
- // pathsPublishWriteHook runs in the paths door before the claim is
- // written.
- pathsPublishWriteHook func()
-)
-
// pathTargetsLeaveFront reports whether any of targets is not provably homed
// on front's own box, by snap's edges files (this file's comment).
func pathTargetsLeaveFront(snap edgesSnapshot, front string, targets []string) bool {
@@ -116,63 +104,27 @@ func (s *Server) importPathsRefusal(ctx context.Context, host string) *doorRefus
return nil
}
-// openImportPathsRefusal is the paths door's rule 2, checked before its
-// write: while host's import is open, a publish adds no prefix to an app on
-// another box. Adding is a prefix the stored map lacks or maps elsewhere;
-// removals and unchanged prefixes pass. It judges only a claim the caller
-// holds, so a stranger's publish reaches SetClaimPaths' neutral 404 as
-// before, and it reads nothing more when the publish adds nothing (a
-// republish as a repair). prev is the map it read, for the check after the
-// write (withdrawRacedPaths). An error is a read that failed.
-func (s *Server) openImportPathsRefusal(ctx context.Context, acct, app, host string, paths map[string]string) (prev map[string]string, ref *doorRefusal, err error) {
+// openImportPathsRefusal is the paths door's rule 2: while host's import is
+// open, a publish adds no prefix to an app on another box. Adding is a prefix
+// the stored map lacks or maps elsewhere; removals and unchanged prefixes
+// pass. It judges only a claim the caller holds, so a stranger's publish
+// reaches SetClaimPaths' neutral 404 as before, and it reads nothing more
+// when the publish adds nothing (a republish as a repair). An error is a
+// read that failed.
+func (s *Server) openImportPathsRefusal(ctx context.Context, acct, app, host string, paths map[string]string) (*doorRefusal, error) {
cur, err := domains.GetClaim(ctx, s.cfg.Releases, host)
if errors.Is(err, os.ErrNotExist) {
- return nil, nil, nil
+ return nil, nil
}
if err != nil {
- return nil, nil, err
+ return nil, err
}
if cur.Account != acct || cur.App != app || cur.Instances {
- return nil, nil, nil
- }
- ref, err = s.crossBoxAddedRefusal(ctx, acct, app, host, cur.Paths, paths)
- return cur.Paths, ref, err
-}
-
-// withdrawRacedPaths is rule 2 again, after the paths door's write: an
-// import that began between the door's check and its write is seen here
-// (§7.6's ordering, at the door). When the publish added a prefix to another
-// box and an import is open, or the check cannot tell, the publish is
-// withdrawn: prev is put back with a CAS against the claim as read now, and
-// only while the stored map is still this publish's. A CAS that loses leaves
-// the claim alone, since a later write replaced this one (the import's own
-// check after its write judges that). The answer is the rule's refusal, or
-// the error that stopped the check.
-func (s *Server) withdrawRacedPaths(ctx context.Context, acct, app, host string, prev, paths map[string]string) (ref *doorRefusal, err error) {
- ref, err = s.crossBoxAddedRefusal(ctx, acct, app, host, prev, paths)
- if ref == nil && err == nil {
return nil, nil
}
- after, etag, rerr := domains.GetClaimETag(ctx, s.cfg.Releases, host)
- if rerr != nil {
- return ref, errors.Join(err, rerr)
- }
- if !maps.Equal(after.Paths, paths) {
- return ref, err
- }
- if _, werr := domains.RestoreClaimPathsAt(ctx, s.cfg.Releases, host, after, etag, acct, app, prev); werr != nil && !errors.Is(werr, release.ErrCASConflict) {
- return ref, errors.Join(err, werr)
- }
- return ref, err
-}
-
-// crossBoxAddedRefusal is rule 2's judgement of paths against prev: nil
-// unless the publish adds a prefix, host's import is open, and an added
-// target is on another box.
-func (s *Server) crossBoxAddedRefusal(ctx context.Context, acct, app, host string, prev, paths map[string]string) (*doorRefusal, error) {
var added []string
for prefix, target := range paths {
- if prev[prefix] != target {
+ if cur.Paths[prefix] != target {
added = append(added, target)
}
}
diff --git a/internal/console/importpaths_test.go b/internal/console/importpaths_test.go
index 58416ee4a..aa2e61e14 100644
--- a/internal/console/importpaths_test.go
+++ b/internal/console/importpaths_test.go
@@ -16,7 +16,6 @@ import (
"github.com/carlosframework/platform/internal/domains"
"github.com/carlosframework/platform/internal/provision"
- "github.com/carlosframework/platform/internal/seeds"
)
const (
@@ -157,70 +156,3 @@ func TestPathsDoorWithoutAnImport(t *testing.T) {
t.Fatalf("adding a prefix to another box with no import = %d %v, want 200", code, out)
}
}
-
-// requireNoOpenImportAcross is §7.6's invariant: never an open import at the
-// import's host while its claim sends a prefix to another box.
-func requireNoOpenImportAcross(t *testing.T, f fromFixture) {
- t.Helper()
- rec, err := f.record(t, importHost)
- open := err == nil && rec.Seed.Import() && rec.Seed.State != seeds.StateCommitted
- if c := claimOf(t, f.fx, importHost); open && c.Paths["far"] == farTarget {
- t.Fatalf("an open import (%s) with a prefix to another box: %v", rec.Seed.State, c.Paths)
- }
-}
-
-// TestImportRacePublishInsideBegin: a publish adding a prefix to another box
-// lands between begin's check and its record write. The publish saw no
-// import, so it stands; begin's check after its write sees it and withdraws
-// the import.
-func TestImportRacePublishInsideBegin(t *testing.T) {
- f := pathsAcrossFixture(t, map[string]string{"near": nearTarget})
- t.Cleanup(func() { importBeginWriteHook = nil })
- var pubCode int
- var pubOut map[string]any
- importBeginWriteHook = func() {
- importBeginWriteHook = nil
- pubCode, pubOut = putShopPaths(t, f, map[string]string{"near": nearTarget, "far": farTarget})
- }
- code, out := beginImport(t, f, importHost, importSHA, 10)
- if pubCode != http.StatusOK {
- t.Fatalf("the publish inside begin = %d %v, want 200 (no import recorded yet)", pubCode, pubOut)
- }
- if code != http.StatusConflict || str(t, out, "error") != importPathsAcrossBoxes {
- t.Fatalf("begin = %d %v, want 409 %q", code, out, importPathsAcrossBoxes)
- }
- f.requireNoRecord(t, importHost)
- if c := claimOf(t, f.fx, importHost); c.Paths["far"] != farTarget {
- t.Fatalf("claim paths = %v, want the publish standing", c.Paths)
- }
- requireNoOpenImportAcross(t, f)
-}
-
-// TestImportRaceBeginInsidePublish: an import begins between the paths
-// door's check and its write. Begin saw only same-box prefixes, so it
-// stands; the door's check after its write sees the import and puts the
-// previous map back.
-func TestImportRaceBeginInsidePublish(t *testing.T) {
- f := pathsAcrossFixture(t, map[string]string{"near": nearTarget})
- t.Cleanup(func() { pathsPublishWriteHook = nil })
- var beginCode int
- var beginOut map[string]any
- pathsPublishWriteHook = func() {
- pathsPublishWriteHook = nil
- beginCode, beginOut = beginImport(t, f, importHost, importSHA, 10)
- }
- before := serial(t, f.fx)
- code, out := putShopPaths(t, f, map[string]string{"near": nearTarget, "far": farTarget})
- f.requireBegun(t, beginCode, beginOut, importHost)
- if code != http.StatusConflict || str(t, out, "error") != importOpenPathsAcrossBoxes {
- t.Fatalf("publish = %d %v, want 409 %q", code, out, importOpenPathsAcrossBoxes)
- }
- if c := claimOf(t, f.fx, importHost); len(c.Paths) != 1 || c.Paths["near"] != nearTarget {
- t.Fatalf("claim paths = %v, want near alone (the publish withdrawn)", c.Paths)
- }
- // The withdrawn write was box-consumed: boxes are told to converge.
- if got := serial(t, f.fx); got <= before {
- t.Fatalf("serial after the withdrawal = %d, want past %d", got, before)
- }
- requireNoOpenImportAcross(t, f)
-}
diff --git a/internal/domains/claims.go b/internal/domains/claims.go
index d090dca9e..89c48c1d1 100644
--- a/internal/domains/claims.go
+++ b/internal/domains/claims.go
@@ -1214,46 +1214,6 @@ func claimRawSetClaimPaths(ctx context.Context, s release.Store, host, account,
}
}
-// claimRawRestoreClaimPathsAt puts paths back onto cur, the claim at host as
-// the caller read it, with a CAS on etag, the ETag of that read. It never
-// rereads: a claim that changed since is release.ErrCASConflict, returned as
-// it is with nothing written, and the caller leaves it. paths must be a map
-// this claim held, so its shape is not checked again. The owner gate is
-// SetClaimPaths', a regional claim carries no map, an empty etag is refused
-// as a CAS conflict, and the same map is a no-op. Its one caller is the paths
-// door's withdrawal of a publish that raced an import (path routes across
-// boxes spec §7.6).
-func claimRawRestoreClaimPathsAt(ctx context.Context, s release.Store, host string, cur *Claim, etag, account, app string, paths map[string]string) (changed bool, err error) {
- if cur == nil || cur.Account != account || cur.App != app || cur.Instances {
- return false, ErrHostUnavailable
- }
- if cur.Regional() {
- return false, ErrRegionalClaim
- }
- if samePaths(cur.Paths, paths) {
- return false, nil
- }
- if etag == "" {
- return false, release.ErrCASConflict
- }
- next := *cur
- next.Paths = nil
- if len(paths) > 0 {
- next.Paths = make(map[string]string, len(paths))
- for k, v := range paths {
- next.Paths[k] = v
- }
- }
- body, err := json.Marshal(next)
- if err != nil {
- return false, err
- }
- if _, err := s.Put(ctx, ClaimKey(host), body, etag); err != nil {
- return false, err
- }
- return true, nil
-}
-
// samePaths reports whether two prefix maps are equal, treating nil and empty
// as the same state. Republishing an unchanged map is the COMMON case — the
// caller republishes wholesale as a repair — so this is what keeps a repair
@@ -1311,13 +1271,6 @@ func SetClaimPaths(ctx context.Context, s release.Store, host, account, app stri
})
return
}
-func RestoreClaimPathsAt(ctx context.Context, s release.Store, host string, cur *Claim, etag, account, app string, paths map[string]string) (claimResult0 bool, claimResult1 error) {
- claimResult1 = release.WithAppMutation(ctx, s, account, app, "domains.RestoreClaimPathsAt", func(claimContext context.Context) error {
- claimResult0, claimResult1 = claimRawRestoreClaimPathsAt(claimContext, s, host, cur, etag, account, app, paths)
- return claimResult1
- })
- return
-}
func SetClaimPlacements(ctx context.Context, s release.Store, next Claim, cur *Claim, etag string) (claimResult0 bool, claimResult1 error) {
claimResult1 = release.WithAppMutation(ctx, s, next.Account, next.App, "domains.SetClaimPlacements", func(claimContext context.Context) error {
claimResult0, claimResult1 = claimRawSetClaimPlacements(claimContext, s, next, cur, etag)
diff --git a/internal/domains/paths_test.go b/internal/domains/paths_test.go
index e75122c57..7e172915b 100644
--- a/internal/domains/paths_test.go
+++ b/internal/domains/paths_test.go
@@ -252,50 +252,3 @@ func TestAttachConvergePreservesPaths(t *testing.T) {
t.Fatalf("paths = %v, want the map preserved across a converge repoint", c.Paths)
}
}
-
-// TestRestoreClaimPathsAtIsACAS: the map is put back only onto the claim as
-// the caller read it. A later write wins: the restore against the older read
-// is release.ErrCASConflict and writes nothing. A stranger is refused.
-func TestRestoreClaimPathsAtIsACAS(t *testing.T) {
- ctx := context.Background()
- s := release.NewDirStore(t.TempDir())
- if _, _, err := AttachClaim(ctx, s, Claim{
- Schema: 1, Host: "ti.to", Account: "tito", App: "classic",
- Route: "ti.to", CreatedAt: "2026-09-03T00:00:00Z",
- }); err != nil {
- t.Fatal(err)
- }
- prev := map[string]string{"paulca": "go.tito.io"}
- if _, err := SetClaimPaths(ctx, s, "ti.to", "tito", "classic", prev); err != nil {
- t.Fatal(err)
- }
- if _, err := SetClaimPaths(ctx, s, "ti.to", "tito", "classic", map[string]string{"paulca": "go.tito.io", "far": "far.tito.io"}); err != nil {
- t.Fatal(err)
- }
- cur, etag, err := GetClaimETag(ctx, s, "ti.to")
- if err != nil {
- t.Fatal(err)
- }
- if _, err := RestoreClaimPathsAt(ctx, s, "ti.to", cur, etag, "bad", "classic", prev); !errors.Is(err, ErrHostUnavailable) {
- t.Fatalf("a stranger's restore: err = %v, want ErrHostUnavailable", err)
- }
- if _, err := SetClaimPaths(ctx, s, "ti.to", "tito", "classic", map[string]string{"later": "go.tito.io"}); err != nil {
- t.Fatal(err)
- }
- if _, err := RestoreClaimPathsAt(ctx, s, "ti.to", cur, etag, "tito", "classic", prev); !errors.Is(err, release.ErrCASConflict) {
- t.Fatalf("a restore against an older read: err = %v, want ErrCASConflict", err)
- }
- if c, _ := GetClaim(ctx, s, "ti.to"); len(c.Paths) != 1 || c.Paths["later"] != "go.tito.io" {
- t.Fatalf("paths = %v, want the later write kept", c.Paths)
- }
- cur, etag, err = GetClaimETag(ctx, s, "ti.to")
- if err != nil {
- t.Fatal(err)
- }
- if changed, err := RestoreClaimPathsAt(ctx, s, "ti.to", cur, etag, "tito", "classic", prev); err != nil || !changed {
- t.Fatalf("a restore against the current read = %v, %v, want written", changed, err)
- }
- if c, _ := GetClaim(ctx, s, "ti.to"); len(c.Paths) != 1 || c.Paths["paulca"] != "go.tito.io" {
- t.Fatalf("paths = %v, want prev back", c.Paths)
- }
-}
diff --git a/internal/provision/path_routes_import_census_test.go b/internal/provision/path_routes_import_census_test.go
deleted file mode 100644
index aff72e9c8..000000000
--- a/internal/provision/path_routes_import_census_test.go
+++ /dev/null
@@ -1,28 +0,0 @@
-package provision
-
-// Record-write census entries for path routes across boxes (#186, branch
-// path-routes-across-boxes), the import refusal of Paul's ruling of
-// 2026-11-21 (spec §7.6), layered on domainsPlan2aWriteCensusInventory. No
-// deployment-bucket record write is added, moved or reclassified.
-// - claimRawRestoreClaimPathsAt (domains) is new: the paths door's
-// withdrawal of a publish that raced an import's begin. It puts a map
-// the claim held back onto the claim as the caller read it: the owner
-// gate (ErrHostUnavailable, instance catch-alls included), a regional
-// claim refused (ErrRegionalClaim), the same map a no-op, an empty etag
-// refused as a CAS conflict, then one Put of ClaimKey(host) with a CAS on
-// etag, a lost CAS returned as it is. A domain claim, not a record:
-// nonrecord, sel:Put.
-func pathRoutesImportWriteCensusInventory() []censusEntry {
- entries := append([]censusEntry(nil), domainsPlan2aWriteCensusInventory()...)
- added := []censusEntry{
- {"internal/domains/claims.go", "claimRawRestoreClaimPathsAt", "nonrecord", "sel:Put", "0b21f3d38fc1f7b48561e5114b8c4235b4d312c05a1fadbfb20cb6e081a5cfbc"},
- }
- for _, a := range added {
- for _, e := range entries {
- if e.File == a.File && e.Unit == a.Unit {
- panic("path-routes-import addition of a listed unit " + a.File + ":" + a.Unit)
- }
- }
- }
- return append(entries, added...)
-}
diff --git a/internal/provision/plan9_b8_census_test.go b/internal/provision/plan9_b8_census_test.go
index 2fb9998f0..1801caa1d 100644
--- a/internal/provision/plan9_b8_census_test.go
+++ b/internal/provision/plan9_b8_census_test.go
@@ -366,7 +366,7 @@ func TestPlan9B8RecordWriteCensus(t *testing.T) {
if len(got) < 100 {
t.Fatalf("census found only %d units under %s; the walk is broken", len(got), root)
}
- inventory := pathRoutesImportWriteCensusInventory()
+ inventory := domainsPlan2aWriteCensusInventory()
problems := append(censusDiff(inventory, got), censusPolicy(inventory)...)
if len(problems) > 0 {
t.Fatalf("record-write census rejected %d site(s); update the explicit inventory only after reviewing the source:\n %s", len(problems), strings.Join(problems, "\n "))
diff --git a/internal/provision/testdata/plan14-root-reads-path-routes-across-boxes.tsv b/internal/provision/testdata/plan14-root-reads-path-routes-across-boxes.tsv
index 39cdc7078..8951cbaa0 100644
--- a/internal/provision/testdata/plan14-root-reads-path-routes-across-boxes.tsv
+++ b/internal/provision/testdata/plan14-root-reads-path-routes-across-boxes.tsv
@@ -88,7 +88,7 @@ internal/host/edgesfile.go edgesFileWriteClaims authority F,J1 rev3=census-rulin
internal/registry/registry.go Registry.Fingerprint legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the registry's SQLite side, as carlos: in the agent (/opt/carlos/carlos agent, carlos-edge.service) and in the registry child (carlos __registry-child, which a root pass forks as the service user); the remote arm, unchanged, in the process that holds a remote handle: census-ruling-seeded-instances's body with the row's lifetime pair (incarnation, serving_seq) folded into the edge's change poll, each only when non-zero, so a registry with no pair digests as before; self-serve moves 1 Task 7;rev3=census-ruling-regional-domains-447;basis=#447 Task 4: hashes regional_domains (host, target, account, app, region; created_at not) over the same fresh connection, with a section marker written only when a row exists, so a registry with no regional rows digests as before; the one added site is that SELECT (+file:Query) on the box's own registry database, as carlos; no file path read;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): review R1 finding 1: the routes SELECT also reads host, kind, account, app, platform and fingerprintForwardInert (one CASE over the ForwardForbidden columns), and every row folds host, kind, account and app (tagged, quoted), platform when set, and forward_inert=0 for a forward row that is not inert, so a rowid reused by another hostname, an in-place account or app rewrite, or a stray forbidden column moves the edge's change poll. Same one SELECT per table on the same fresh connection to the box's own registry database, as carlos; no table, file or bucket read added; a digest, never a decision.;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 5): the SELECT also reads fleet_label and, only when it is set, hashes "fleet_label=<q>" into the digest, so labelling a row moves the edge's reload fingerprint. Read sites unchanged (33). Registry side, not root; an unlabelled registry's digest is byte-identical.;rev3=census-ruling-stateless-replicas-1;basis=Read the additive stateless projection in the existing registry SELECT and hash only when set; no new read source.;rev3=census-ruling-agent-start-demo-1;basis=Existing SELECT reads four more demo columns; only a marked row adds them to the hash, so ordinary hashes remain unchanged.;rev3=census-ruling-stateless-replicas-2;basis=Four additive projection columns join the existing routes SELECT and hash only when nonzero; no new query or file read. merge of origin/main 6be08467: Union main demo identity and expiry with replica columns in the same SELECT and hash; merge-only body change.;rev3=census-ruling-agent-start-demo-3;basis=Hash moved-notice wire bytes so notice-only changes invalidate an edge route snapshot. Census read-site delta: +file:QueryRow.;rev3=census-ruling-edge-page-cache-1;basis=selects the new pages_off column with the rest and folds "pages_off=1" into the hash only when set, as assets_off, so a registry that never sets it fingerprints as before; same routes SELECT, no new table; read sites unchanged (34); no read added;rev3=census-ruling-linked-deployments-slice1;basis=linked deployments slice 1 Task 1: hashes link_channels (link_id, account, token_hash, status, generation; connected, seen_at, seq and created_at not) over the same fresh connection, with a section marker written only when a row exists, so a registry with no links digests as before; the one added site is that SELECT (+file:Query) on the box's own registry database, as carlos; a digest, never a decision; linked deployments slice 1 Task 7: also folds home_link (id, serving_url, tunnel_url, the token's sha256 never the token, account, apps_domain, box_label, conn_gen; state and created_at not) and home_link_apps (name, home_account, home_app, home_host) through fingerprintHomeLink over the same fresh connection, each section marker written only when a row exists, so a registry with no link digests as before; no file path read; a digest, never a decision;rev3=census-ruling-account-subdomains;basis=hashes account_namespaces (name, account) over the same fresh connection, with a section marker written only when a row exists, so a registry with no held names digests as before; the one added site is that SELECT (+file:Query) on the box's own registry database, as carlos; a digest, never a decision;rev3=census-ruling-staticcheck-sa1012;basis=nil context replaced by context.Background(), behaviour unchanged;rev3=census-ruling-path-routes-across-boxes;basis=#186 spec 6: the route_paths section is hashRoutePaths (generation, epoch and row count when the three triggers and epoch column exist, else every row as before); its own Query left for that helper file:Exec@301,file:Open@205,file:Query@10412,file:Query@11334,file:Query@12437,file:Query@385,file:Query@6672,file:Query@7151,file:Query@8137,file:Query@8833,file:QueryRow@13354,registry:ClaimIncarnation@1746,registry:ClaimIncarnation@5580,registry:ClaimIncarnation@5657,registry:ClaimOwner@1790,registry:ClaimOwner@5781,registry:ClaimOwner@5846,registry:ClaimRowID@1809,registry:ClaimRowID@5873,registry:ClaimRowID@5939,registry:ClaimStamp@1771,registry:ClaimStamp@5690,registry:ClaimStamp@5754,registry:Incarnation@1865,registry:Incarnation@6160,registry:Incarnation@6224,registry:ServingSeq@1884,registry:ServingSeq@6251,registry:ServingSeq@6314,registry:Text@175,registry:path@224,registry:remote@55,registry:remote@87,whole:remoteClient@57,whole:remoteClient@89 4c652fc3906d681a36b1143813437d4622ce8d9b46514a9a22c426894187eaed
internal/registry/registry.go Registry.migrate legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the registry's SQLite side, as carlos: in the agent (/opt/carlos/carlos agent, carlos-edge.service) and in the registry child (carlos __registry-child, which a root pass forks as the service user), on every registry open; a box CLI verb that opens the registry directly runs it as whoever runs the verb: census-ruling-seeded-instances's body with two more columns added to routes (incarnation and serving_seq, INTEGER NOT NULL DEFAULT 0, idempotent through the duplicate-column rule); self-serve moves 1 Task 7;rev3=census-ruling-rootfs-apps-2;basis=one more ALTER TABLE, routes ADD COLUMN runtime TEXT NOT NULL DEFAULT '', beside main's rate_limit, assets_off, asset_gen, incarnation and serving_seq (the last four from the merges of origin/main 3c33f2eb and 953b9fda); the same sixteen sites, no read added;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328/#329 plan 1 Task 4: three more ALTER TABLE statements in the existing loop, routes ADD COLUMN egress_allow, size and policy_expires_at, each TEXT NOT NULL DEFAULT '' and idempotent through the duplicate-column rule; the same sixteen sites, no read added.;rev3=census-ruling-region-ha-p1a;basis=one more ALTER TABLE in the existing loop: routes ADD COLUMN ha INTEGER NOT NULL DEFAULT 0, idempotent through the duplicate-column rule; the same sixteen sites, no read added;rev3=census-ruling-ha-p1a-433;basis=the registry's SQLite side as carlos (agent, registry child; a box CLI verb that opens the registry directly runs it as whoever runs it), on every registry open: the ALTER TABLE routes statements are now built from the one migration definition routeAddedColumns (addedColumn name, type, default; review r1 P2): for each entry without the Claim mark, "ALTER TABLE routes ADD COLUMN " + spec(), byte for byte the statements main runs, in main's order, under the same duplicate-column rule. +registry:Claim is that mark, +whole:addedColumn the struct. Every name, type and default is an in-binary literal; no statement added, removed or changed; no read added.;rev3=census-ruling-regional-domains-447;basis=#447 Task 4: one more CREATE TABLE IF NOT EXISTS regional_domains (host TEXT PRIMARY KEY, target, account, app, region TEXT NOT NULL DEFAULT '', created_at INTEGER NOT NULL DEFAULT 0), beside wildcard_domains; the added sites are that statement (+file:Exec, +registry:sql), an in-binary literal; additive, no existing statement changed;rev3=census-ruling-region-ha-p1b3b-t;basis=Create local HA duty/replay tables and revision triggers in the existing registry connection; no new database path.;rev3=census-ruling-agent-start-demo-3;basis=Create moved-notice storage as a single (id, wire) row; fingerprints include the stored wire bytes. Census read-site delta: +file:Exec, +registry:sql.;rev3=census-ruling-linked-deployments-slice1;basis=linked deployments slice 1 Task 1: calls migrateLinks after migrateHADuties (one CREATE TABLE IF NOT EXISTS link_channels, an in-binary literal); additive, no existing statement changed; linked deployments slice 1 Task 7: also runs migrateHomeLink (CREATE TABLE IF NOT EXISTS home_link and home_link_apps) after migrateLinks; additive, the box's own registry database, as carlos;rev3=census-ruling-account-subdomains;basis=one more CREATE TABLE IF NOT EXISTS account_namespaces (name TEXT PRIMARY KEY, account TEXT NOT NULL), an in-binary literal (+file:Exec, +registry:sql); additive, no existing statement changed;rev3=census-ruling-path-routes-across-boxes;basis=#186: calls migratePathsGen after route_paths is created (route_paths_gen table, epoch column, three triggers); adds a read of r.sql only file:Exec@1124,file:Exec@1855,file:Exec@212,file:Exec@2409,file:Exec@3057,file:Exec@3822,file:Exec@4325,file:Exec@51,file:Exec@5188,file:Exec@5364,file:Exec@761,registry:Claim@686,registry:sql@1124,registry:sql@1855,registry:sql@212,registry:sql@2409,registry:sql@3057,registry:sql@3822,registry:sql@4274,registry:sql@4325,registry:sql@51,registry:sql@5188,registry:sql@5364,registry:sql@761,whole:addedColumn@661 2ff5d0572166f09f57942ae2291ae9215c2d0fa36c943517b0bec9ef224fbce0
@coverage . 3c6e0001c8f8a1f42e111818ebcb6dc0a787c94498697a9c69a7dbfed8ad2deb
-@coverage internal/domains 61db5c1cfad907ca0263edd5b3fbfc04cdfe51bcb0cb077aa109d98c7c376042
+@coverage internal/domains 45a4e7cf7cbbba5129d381d67f83df26d35941b2d66a7249f269f887946de3e1
@coverage internal/edge b1fc4c9369072afeb6aa99957c0d8f9ad6e524f3d554126b0f473f64c47577d3
@coverage internal/host b914741981b533165a5c990ab966021b32b15781d487eaa847eed474a5123578
@coverage internal/registry a0cf4a911d6dcf00a5bcdf379b52fd2338e08ad5e70c218748b87ab002a1a53f