review: Astra round 1 findings for audit-edge-test-sleeps
READY AFTER FIXES; both P2s fixed in 3dead10c.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+36
−0
docs/superpowers/reviews/FINDINGS-audit-edge-test-sleeps-R1.md+36 −0
CI passed — run details
diff --git a/docs/superpowers/reviews/FINDINGS-audit-edge-test-sleeps-R1.md b/docs/superpowers/reviews/FINDINGS-audit-edge-test-sleeps-R1.md| new file mode 100644 |
| index 000000000..064093eb9 |
| --- /dev/null |
| +++ b/docs/superpowers/reviews/FINDINGS-audit-edge-test-sleeps-R1.md |
| @@ -0,0 +1,36 @@ |
| +Reviewed `origin/main...5dc4ad0249beff4d9a50fb947d0c875b3a47c0e4`, round 1. The difference from the brief’s named commit is the brief itself. |
| + |
| +No P1 findings. |
| + |
| +1. **P2 — The fake clock masks a missing failed-refresh heartbeat.** |
| + [internal/edge/lbhealth_test.go:170](/home/paulca/amadan.net/carlos/platform-audit-edge-test-sleeps/internal/edge/lbhealth_test.go:170) |
| + **Invariant:** every completed refresh stamps the heartbeat, including failed attempts. |
| + |
| + The clock has not advanced since the successful refresh. Consequently, `before` equals the existing heartbeat. At `before.Add(lbhealth.RefreshWindow)`, that old heartbeat remains valid because the boundary is inclusive. An implementation that stamps only successful refreshes now passes this assertion and the subsequent stuck-refresh assertions. |
| + |
| + **Fix:** advance the clock before capturing `before` and performing the failed refresh. Check at a time when the successful refresh’s stamp has expired but the failed attempt’s stamp remains valid. |
| + |
| +2. **P2 — The free-path witness now depends on one 100 ms probe succeeding.** |
| + [internal/edge/lbhealth_test.go:359](/home/paulca/amadan.net/carlos/platform-audit-edge-test-sleeps/internal/edge/lbhealth_test.go:359) |
| + **Invariant:** an available serving path must pass the health witness despite ordinary scheduler delays. |
| + |
| + Two unbuffered sends guarantee completion of only the first poll. If its probe goroutine is delayed beyond `servingProbeTimeout`, the first poll records no heartbeat. The assertion can then run before the second poll completes, reporting a wedged path even though the cache lock is free. The previous five-second wait allowed two completed probe opportunities. |
| + |
| + **Fix:** for the free-path case, drive further polls until a fresh heartbeat is observed, with a bounded overall deadline. Keep the wedged-path assertion separate so retries cannot conceal an incorrectly emitted heartbeat. |
| + |
| +No P3 findings. |
| + |
| +The remaining checks are satisfactory by inspection: |
| + |
| +- The production silence window remains three seconds. Its only assignments after initialization are in the test helper. Tests using that helper are sequential. The timer reads the variable synchronously during construction; its goroutine does not reread it. Successful forwarding tests await completion, and observation shutdown joins its callback. |
| +- The fake activator records notes before signaling. The service wrapper signals only after `Service.NoteForward` returns. These waits establish the ordering needed by the assertions. |
| +- The registry-watch sends correctly establish completion of preceding polls. Backdating the initial heartbeat preserves the distinction between a stale setup beat and a fresh watch beat. |
| +- The brief’s third check names the wrong test: the shortened six-window wait is in `TestSlowHolderResponseIsNotAborted`. `TestSlowHolderTwentySecondHeadersKeepForwarding` still retains the production window and waits twenty seconds ([forwardha_service_test.go:294](/home/paulca/amadan.net/carlos/platform-audit-edge-test-sleeps/internal/edge/forwardha_service_test.go:294)). The scaled wait is acceptable for the observation test, especially with that absolute-duration service witness retained. |
| + |
| +`git diff --check` passed. Targeted tests could not start: Go could not create its work directory in the read-only sandbox. No full suites ran. |
| + |
| +**Census verdict: approve the `internal/edge` envelope re-pin.** I read the declaration and observation lifecycle in [forwardha.go:509](/home/paulca/amadan.net/carlos/platform-audit-edge-test-sleeps/internal/edge/forwardha.go:509), lines 509–551, and its forwarding integration, lines 413–485. The sole production change converts the unchanged three-second constant into an unexported variable. It adds no root reads, paths, commands, or authority and weakens no production validation. The envelope-only overlay at [plan14-root-reads-audit-edge-test-sleeps.tsv:3](/home/paulca/amadan.net/carlos/platform-audit-edge-test-sleeps/internal/provision/testdata/plan14-root-reads-audit-edge-test-sleeps.tsv:3) is appropriate; no unit dispositions change. |
| + |
| +Apply the P2 fixes without reopening review, per the stopping rule. |
| + |
| +READY AFTER FIXES |
| \ No newline at end of file |