carlos / platform Public

review: Astra round 1 findings for worker-publish-order-1252 (READY)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 16ab36069728d1744ff245c2554834b7a376ce8b parent 513f5c7
1 file changed, +21 −0
  • docs/superpowers/reviews/FINDINGS-worker-publish-order-1252-R1.md +21 −0

CI passed — run details

diff --git a/docs/superpowers/reviews/FINDINGS-worker-publish-order-1252-R1.md b/docs/superpowers/reviews/FINDINGS-worker-publish-order-1252-R1.md
new file mode 100644
index 000000000..1f805d422
--- /dev/null
+++ b/docs/superpowers/reviews/FINDINGS-worker-publish-order-1252-R1.md
@@ -0,0 +1,21 @@
+Reviewed commit `513f5c7cef4f6f272905cc3304a78acc17d2d45f` against base `5048247f`, round 1 of 3. The difference from the brief’s named commit is the brief itself.
+
+No P1, P2 or P3 findings.
+
+1. **Worker publication order (#1252).** The author’s explanation holds. Wake closes `e.ready` before publishing, so `WakeWorker` returning does not guarantee delivery (`internal/activator/activator.go:2465`). Wake and successful respawn increment `workerInc` under `a.mu`; immediate and held publications all pass through `publishWorkerServing` (`internal/activator/workerswap.go:327`). That function holds `servingMu` across both the entry/incarnation check and callback. An old publication therefore either arrives first or is dropped, including when a different entry replaces the original.
+
+ `servingWriter` maintains one drain goroutine and replaces pending values with the latest delivery (`internal/host/rollout.go:260`). Registry writes cannot overtake one another. The rollout manager excludes workers from its separate serving-version writer (`internal/rollout/manager.go:1429`). An older write can finish after a newer child is installed, but cannot finish after that newer identity’s registry write through this path.
+
+2. **Proof-clock security and concurrency (#1247).** Production continues to use `time.Now()` (`internal/console/edgeproof.go:71`). The field is private, has no request/configuration/environment setter, and its only assignment is in `demoAPIProofClock`, in a test file.
+
+ All three verification sites retain their original execution position; only the clock expression changes. No verification moves across a body read, and existing post-body calls still sample time when verification executes. Configured demo publish and claim handlers continue capturing verified attribution before reading the body.
+
+ Each test owns its server and installs the function before dispatching requests. The function remains unchanged thereafter, while its captured time uses atomic loads and increments. Independent parallel tests therefore do not share a clock or race on its value.
+
+3. **Regression coverage.** The added waits establish the initial publication required by the existing assertions. The stale-publication test still explicitly replays the old incarnation after the replacement publishes. The fallback test still detects publication before release. The new test forces the late-wake interleaving and waits for wake completion before requiring exactly `v2`.
+
+ The expiry tests advance time by `edgeproof.Skew + time.Second` on the first body read. They still require successful admission, confirm expiration, and check attribution in the stored app or claim budgets. Moving attribution behind the body read would still violate those assertions. Removing the three-second sleeps preserves the relevant coverage.
+
+Validation limitation: the targeted tests could not start because Go attempted to update `go.mod` in this read-only session. Runtime and race-test results are therefore unverified. `git diff --check` passed. No files were edited, reviewers spawned, or full suites run.
+
+READY
\ No newline at end of file