carlos / platform Public

console remote instances: the expiry purge notes its record deletions too

Codex census review of a7134627: the temporary-app expiry purge
(expirypass.go, release.PurgeAppIfTrashedAt) deletes records without
noting the app. It now notes it first; every console path that deletes
an instance or sidecar record is named in retireUnsettled's comment.
Census re-proposed (envelope only).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev f764752de1a051daa711f610dbe784853ea90237 parent a713462
4 files changed, +6 −3
  • docs/superpowers/notes/console-remote-instances.md +2 −1
  • internal/console/expirypass.go +1 −0
  • internal/console/remoteinstances.go +2 −1
  • internal/provision/testdata/plan14-root-reads-console-remote-instances.tsv +1 −1

CI failed — run details

diff --git a/docs/superpowers/notes/console-remote-instances.md b/docs/superpowers/notes/console-remote-instances.md
index 429245ca2..a37fa3e42 100644
--- a/docs/superpowers/notes/console-remote-instances.md
+++ b/docs/superpowers/notes/console-remote-instances.md
@@ -271,7 +271,8 @@ conservative rule.
times, so deletions are dated by the console itself: every record
deletion the console makes (`retireHostRecord`, `retireClaimHostRecord`
including claim recovery, the ordinary delete's `deleteRead`, seed
- cleanup's `finishSeedOnce`, and both app purges) notes the app in memory before deleting
+ cleanup's `finishSeedOnce`, the owner's purge, the claim purge and
+ the temporary-app expiry purge) notes the app in memory before deleting
anything (a note that cannot fail to be
written, unlike the best-effort audit row). Memory does not survive a
restart, so a console refuses every retire for `channelSettle` after
diff --git a/internal/console/expirypass.go b/internal/console/expirypass.go
index 2f58f1817..2fe508148 100644
--- a/internal/console/expirypass.go
+++ b/internal/console/expirypass.go
@@ -211,6 +211,7 @@ func (s *Server) purgeOne(ctx context.Context, r AppRow, now time.Time, ev evide
s.audit(acct, r.App, expiryActor, "purge-refused", "did not delete "+r.App+": it has email set up. Delete it from the Trash page")
return
}
+ s.noteRecordDeletion(r.Sqid, r.App, time.Now()) // the canary-retire guard's evidence, first
err = release.PurgeAppIfTrashedAt(ctx, s.cfg.Releases, s.cfg.ReleasePub, r.Sqid, r.App, time.Unix(life.PurgeFor, 0), now)
switch {
case err == nil:
diff --git a/internal/console/remoteinstances.go b/internal/console/remoteinstances.go
index 9b1baeb2a..898803a8c 100644
--- a/internal/console/remoteinstances.go
+++ b/internal/console/remoteinstances.go
@@ -462,7 +462,8 @@ var errRetireUnsettled = errors.New("the app's instances have not settled")
// - any was deleted in the last channelSettle (recentRecordDeletion):
// every console path that deletes a record notes the app in memory
// before deleting (noteRecordDeletion: retireHostRecord,
-// retireClaimHostRecord, deleteRead, finishSeedOnce, both app purges),
+// retireClaimHostRecord, deleteRead, finishSeedOnce, the owner's purge,
+// the claim purge and the expiry purge),
// and the console refuses for channelSettle after it starts; the audit
// log is read too;
// - the box reports cannot all be read; or
diff --git a/internal/provision/testdata/plan14-root-reads-console-remote-instances.tsv b/internal/provision/testdata/plan14-root-reads-console-remote-instances.tsv
index b8dc7229b..ecfa44fea 100644
--- a/internal/provision/testdata/plan14-root-reads-console-remote-instances.tsv
+++ b/internal/provision/testdata/plan14-root-reads-console-remote-instances.tsv
@@ -21,5 +21,5 @@ internal/console/server.go Server.channelHosts legacy accepted-legacy accepted-l
internal/console/templates/app_overview.html external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-console-remote-instances;basis=Running tile does not claim Served when a route's state is unknown and reads the existing 'no data right now' when every instance's state is unknown; Web addresses tile reads 'no data right now' instead of 'DNS & certs OK' for a domain with no reading; display only. file:external@0 2a112ff768c300894881b858e61465841c87810ca7cb1d98a0fe2a54155a0ca1
internal/console/apiinstances.go Server.instanceHealth legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-console-remote-instances;basis=Records with no local registry row get health only from a box report naming the record's own account and app (held down: Failed; transient, unidentified or unread: Can't tell right now), readings pinned to that box and bounded by each record's created_at. Builds registry.Route literals from the record; reads no registry for them. registry:Account@1987,registry:Account@2007,registry:App@1948,registry:App@1964,registry:Host@839,registry:Unit@2117,registry:Unit@2159,whole:Route@1151,whole:Route@2054,whole:Route@2075,whole:Route@2854,whole:Route@3646,whole:Route@4126,whole:Route@4179,whole:Route@4294,whole:Route@792,whole:Route@821,whole:Route@832,whole:Route@850 f2b042a95c77b07f0bcd1c11f099769a7ad3c1a230c521af71c6bf5cb7685897
internal/console/view.go Assemble legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-console-remote-instances;basis=Collects the set of local registry hosts (rt.Host) so a record host the registry has gets no remote row (its record's created_at bounds the local row's metrics history); adds rows from the account's records and tenant-named box reports when given a remote source. registry:App@1716,registry:App@1739,registry:App@2117,registry:App@2147,registry:Backing@2017,registry:Caps@1385,registry:Channel@960,registry:Environment@1942,registry:Hibernate@1859,registry:Host@1768,registry:Host@861,registry:Kind@1783,registry:Platform@1889,registry:Provisioned@2042,registry:Status@1800,registry:Unit@1999,registry:Version@1823,whole:Route@2092,whole:Route@2167,whole:Route@810,whole:Route@839,whole:Route@910 120ae8c042523f872fd1c19357b8bb830e4afe9da1e38ad202df2ada3ad52ada
-@coverage internal/console 8161c8308fdf9124483a5f62eaf0b4d39e45f7e9ff02a4fd3f9d712b2d6f885f
+@coverage internal/console f77f5c4347463e2b4e812d77a67f129baa19434f45c14f9892032a869bc85c37
@coverage internal/console/templates 6e272e30e00be5785b3f364a947ea4ab86b2d96a0e8d21821b7812c45f0a636f