carlos / platform Public

Burst notices: read the peer snapshot under the lock (Astra R1 P2)

Astra R1 on the promotion branch: burstPeerCurrent read the home-map
snapshot before taking n.mu, so a worker holding an older snapshot could
prune a peer that sendBurstNotices had just created from a newer one,
dropping its notices as gone. It now reads the snapshot under n.mu, as
sendBurstNotices does, so snapshots are applied in lock order. Census
envelope for internal/edge re-pinned. R1 verdict READY AFTER FIXES, no
P1; census envelopes approved by Astra.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 1cc2ca0f278c4f1b258d3c60fb445b325904cf9d parent 374bcff
3 files changed, +29 −3
  • docs/superpowers/reviews/CODEX-FINDINGS-PROBE-BURST-BLOCK-R1.md +24 −0
  • internal/edge/burst_notice.go +4 −2
  • internal/provision/testdata/plan14-root-reads-probe-burst-block.tsv +1 −1
diff --git a/docs/superpowers/reviews/CODEX-FINDINGS-PROBE-BURST-BLOCK-R1.md b/docs/superpowers/reviews/CODEX-FINDINGS-PROBE-BURST-BLOCK-R1.md
new file mode 100644
index 000000000..48c965fb3
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-FINDINGS-PROBE-BURST-BLOCK-R1.md
@@ -0,0 +1,24 @@
+Reviewed `4c6416787..374bcff00711d247235b7bab0425e3c5ac6f11d8`, round 1.
+
+No P1 findings.
+
+**P2 — Notice workers: a stale snapshot can prune a newly created peer.**
+
+At [burst_notice.go:400](/home/paulca/github.com/carlosframework/platform-probe-burst-block-491/internal/edge/burst_notice.go:400), `burstPeerCurrent` reads the snapshot before acquiring `n.mu`, then prunes every peer using that snapshot.
+
+Failure scenario: a worker captures a snapshot without Betty and pauses. The home map adds Betty; `sendBurstNotices` acquires `n.mu`, reads the newer snapshot and creates Betty’s worker and queue (lines 266–278). The paused worker resumes and prunes Betty using its older snapshot (lines 400–403). Betty’s queued notices are dropped as `Gone` despite her remaining eligible.
+
+Fix: acquire `n.mu` before reading the home-map snapshot, matching `sendBurstNotices`. Add a deterministic concurrency test covering this ordering.
+
+Fault family: peer reconciliation must not apply an older snapshot after newer peer creation. Fix within this round; no further review round required.
+
+No P3 findings.
+
+Census verdicts:
+
+- **`internal/edge`: approve.** Read `burst_notice.go` lines 252–305 and 362–494, including the new check and its dispatch caller; also the changed tests and guard comments. The change adds no tenant-controlled root reads or execution paths and preserves signing and transport checks. The P2 concerns erroneous notice loss.
+- **`internal/edgeguard`: approve.** Read [catalogue.go:114](/home/paulca/github.com/carlosframework/platform-probe-burst-block-491/internal/edgeguard/catalogue.go:114), lines 114–170, and the changed lookup test. Promotion changes the existing rule’s mode without adding input paths. Existing catalogue, static-file, fleet and record-only checks remain in place.
+
+`git diff --check` passed. Targeted tests could not start: the read-only sandbox denied Go’s build-directory creation. No files changed; no full suites run.
+
+**READY AFTER FIXES**
\ No newline at end of file
diff --git a/internal/edge/burst_notice.go b/internal/edge/burst_notice.go
index cb95d65db..d174957bf 100644
--- a/internal/edge/burst_notice.go
+++ b/internal/edge/burst_notice.go
@@ -397,10 +397,12 @@ func (e *Edge) burstPeerCurrent(n *burstNotices, p *burstPeer) bool {
if m == nil {
return false
}
- snap := m.snapshot()
+ // The snapshot is read under n.mu, as sendBurstNotices reads it, so a
+ // worker can never prune with a map older than the one a newer peer was
+ // created from (Astra R1 P2).
n.mu.Lock()
defer n.mu.Unlock()
- n.pruneLocked(n.targetsLocked(snap, e.box, m.privateDial))
+ n.pruneLocked(n.targetsLocked(m.snapshot(), e.box, m.privateDial))
return n.peers[p.box] == p
}
diff --git a/internal/provision/testdata/plan14-root-reads-probe-burst-block.tsv b/internal/provision/testdata/plan14-root-reads-probe-burst-block.tsv
index 252aaa8d3..ca44a11f6 100644
--- a/internal/provision/testdata/plan14-root-reads-probe-burst-block.tsv
+++ b/internal/provision/testdata/plan14-root-reads-probe-burst-block.tsv
@@ -1,4 +1,4 @@
# Census overlay probe-burst-block, written by census-propose (#369). census-ruling-probe-burst-block, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-probe-burst-block.md.
# 0 body, 0 sites, 2 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
-@coverage internal/edge 863c3d1323d8b05a372cedf4fd86fdc922901751a0d4c49fe17271c79c628144
+@coverage internal/edge 829958cf0f9944bdd982d26fa99ff396166690c0842b045060f9da3ca15bd873
@coverage internal/edgeguard a26fa6f359b091151c8df59275bccd02cd2621686f40c4164f48f7155ac16895