carlos / platform Public

activator: reword the seed refusal; remove the database before its marker

Round 2 reviews (Astra P2, Fable P3). The refusal fires on a WAL, SHM or
litestream metadata alone, and missing attribution is not proof the
files are another record's, so the sentence now says what was found and
that it was kept. placeSeed's cleanup after a failed post-rename check
removes the database before its marker: a crash between the two leaves
a marker alone, which the next wake re-places, never an unmarked
database the refusal would keep refusing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 2d6d2123b3e9aaaa8149b64649a7665057d2ae01 parent 5e96f85
2 files changed, +13 −6
  • internal/activator/seedplace.go +12 −5
  • internal/activator/seedplace_h3m6_linux_test.go +1 −1
diff --git a/internal/activator/seedplace.go b/internal/activator/seedplace.go
index c51390878..53a79151d 100644
--- a/internal/activator/seedplace.go
+++ b/internal/activator/seedplace.go
@@ -90,11 +90,15 @@ func seedRefusedClaim(host string) error {
return &SeedPlacementError{Sentence: fmt.Sprintf("%s could not start from its seed: claim control is on for this box.", host)}
}
-// seedOverUnattributedData is a seed whose first wake found a database at
-// its path that is not this seed's (H3-M6). It carries no code: a box
-// reports nothing, and every wake refuses until an operator has looked.
+// seedOverUnattributedData is a seed whose first wake found database files
+// at its path (the database, its WAL or SHM, or litestream metadata) that
+// no marker attributes to this seed (H3-M6). That is not proof they are
+// another record's, only that nothing here says they are this one's. It
+// carries no code: a box reports nothing, and every wake refuses until an
+// operator has followed the procedure in
+// docs/superpowers/notes/2026-11-30-h3-m6-box-owner-binding.md.
func seedOverUnattributedData(host, path string) error {
- return &SeedPlacementError{Sentence: fmt.Sprintf("%s could not start from its seed: this box already holds a database for it that is not this seed's. Ask an operator to check it.", host),
+ return &SeedPlacementError{Sentence: fmt.Sprintf("%s could not start from its seed: this box already has database files for it that nothing marks as this seed's, so they were kept and the seed was not placed. An operator has to check them.", host),
Err: fmt.Errorf("%s holds data no marker attributes to this seed; refusing to purge it", path)}
}
@@ -575,8 +579,11 @@ func (b *ExecBackend) placeSeed(ctx context.Context, rt registry.Route, src *see
return seedPlaceFailed(host, err)
}
if err := sameFileAt(dir, base, wrote); err != nil {
- _ = instancefs.RemoveAllBeneath(dir, base+SeedMarkerSuffix)
+ // The database before its marker: a crash between the two leaves a
+ // marker alone, which the next wake purges and re-places, never an
+ // unmarked database, which it would refuse (H3-M6).
_ = instancefs.RemoveAllBeneath(dir, base)
+ _ = instancefs.RemoveAllBeneath(dir, base+SeedMarkerSuffix)
return seedPlaceFailed(host, err)
}
return nil
diff --git a/internal/activator/seedplace_h3m6_linux_test.go b/internal/activator/seedplace_h3m6_linux_test.go
index 544aee48d..3158ee918 100644
--- a/internal/activator/seedplace_h3m6_linux_test.go
+++ b/internal/activator/seedplace_h3m6_linux_test.go
@@ -99,7 +99,7 @@ func TestH3M6RegionSeedRefusesAnUnattributedDatabase(t *testing.T) {
rt, objs, _ := seededRoute(t, b, rt, seeds.StateReady)
leaveOtherAppsDatabase(t, rt.DBPath, "")
_, err := b.Restore(context.Background(), rt)
- if err == nil || !strings.Contains(err.Error(), "could not start from its seed: this box already holds a database for it that is not this seed's.") {
+ if err == nil || !strings.Contains(err.Error(), "could not start from its seed: this box already has database files for it that nothing marks as this seed's, so they were kept and the seed was not placed. An operator has to check them.") {
t.Fatalf("Restore = %v; want the unattributed-data refusal", err)
}
if objs.opens != 0 {