review: Astra scoped termination check, console shutdown (passed)
The one test P2 is fixed in a7488581.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+41
−0
docs/superpowers/reviews/CHECK-audit-console-shutdown-R1-fix.md+41 −0
diff --git a/docs/superpowers/reviews/CHECK-audit-console-shutdown-R1-fix.md b/docs/superpowers/reviews/CHECK-audit-console-shutdown-R1-fix.md| new file mode 100644 |
| index 000000000..4d6250178 |
| --- /dev/null |
| +++ b/docs/superpowers/reviews/CHECK-audit-console-shutdown-R1-fix.md |
| @@ -0,0 +1,41 @@ |
| +Scoped check of `a2e41dfed54263c4d553ebc056761f1b8774e9b3` at checkout `a60c26f6b827f109860626f9fb6776e104cb0651`. This does not reopen round 1. No P1 findings. |
| + |
| +1. **Round-1 findings — OK.** |
| + |
| + - **P2-1 resolved:** signal handling, release decisions and forced-exit status now run in one sequence. |
| + - **P2-2 resolved:** relay joins its writer loop; verify-reader completion and both GeoIP loops are registered workers. |
| + - **P2-3 resolved:** admission closes before cancellation and joining; subsequent worker starts are refused. |
| + - **P2-4 resolved:** timeout-specific tests use an empty worker registry and an already-completed observer. |
| + - **P3 resolved:** fixture cleanup cancels and joins the handoff test’s worker and observer. |
| + |
| +2. **Termination and policy lease — OK.** |
| + |
| + In [stop.go:214](/home/paulca/amadan.net/carlos/platform-audit-console-shutdown/cmd/console/stop.go:214), queued signals are checked before release and after its completion. Signals consumed during waits force status 1. Release runs only after actual capacity-observer completion, and the coordinator invokes it once. |
| + |
| + I found no newly introduced indefinite wait. Ordinary release still depends on the existing release implementation honoring its five-second context; a second signal now lets the coordinator stop waiting even if release ignores cancellation. The comments correctly acknowledge that an already-issued remote release cannot be recalled. |
| + |
| +3. **Admission and early startup — OK.** |
| + |
| + [stop.go:294](/home/paulca/amadan.net/carlos/platform-audit-console-shutdown/cmd/console/stop.go:294) closes admission under the same mutex used to register workers, before cancellation and joining. A racing start is either registered or refused. |
| + |
| + The changed startup calls use `work.ctx`. In [main.go:726](/home/paulca/amadan.net/carlos/platform-audit-console-shutdown/cmd/console/main.go:726), a startup failure after cancellation waits for the early-stop goroutine’s process exit. That goroutine does not depend on startup reaching handoff, so I found no circular wait. |
| + |
| +4. **Nested-loop joins — OK.** |
| + |
| + Relay’s writer loop observes the same cancellation context as its parent. The verify reader closes its completion channel when its loop returns. Both GeoIP loops check cancellation between ticks. |
| + |
| + A stuck store call or local-file operation can leave its worker running, but the console’s worker join remains bounded and names that worker. These additions do not make startup or process shutdown wait indefinitely for those loops. |
| + |
| +5. **New tests — P2: the relay regression test can falsely pass under scheduler delay.** |
| + |
| + **Location:** [workerjoin_test.go:45](/home/paulca/amadan.net/carlos/platform-audit-console-shutdown/internal/console/workerjoin_test.go:45). |
| + |
| + **Scenario:** Without `defer writer.Wait()`, a loaded runner can delay the relay’s main goroutine for the entire 200 ms observation window. The test then unblocks the writer before the main goroutine resumes, allowing the broken implementation to pass. |
| + |
| + **Fix:** Use `testing/synctest` with the held-store channels created inside its test scope. After cancellation, call `synctest.Wait()` and assert that `returned` remains open; then unblock the writer and verify completion. This tests the join without requiring scheduling within 200 ms. |
| + |
| + The queued-signal test is otherwise sound: its signal is buffered before `stop` runs. `GOMAXPROCS(1)` does not prevent preemption, despite the comment, but the corrected implementation’s assertions do not depend on that claim. |
| + |
| +The targeted tests could not start: the read-only sandbox prevented Go from creating its build directory. No tests executed, no full suites ran, no files changed, and no agents were spawned. |
| + |
| +CHECK PASSED |
| \ No newline at end of file |