carlos / platform Public

review: Astra findings for flake-demo-claim-browser (READY)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev d6c5c461cb82fecfbdbfe7870c99c8d359cfea41 parent 7910cf1
1 file changed, +31 −0
  • docs/superpowers/reviews/FINDINGS-flake-demo-claim-browser.md +31 −0

CI passed — run details

diff --git a/docs/superpowers/reviews/FINDINGS-flake-demo-claim-browser.md b/docs/superpowers/reviews/FINDINGS-flake-demo-claim-browser.md
new file mode 100644
index 000000000..6d84c81f7
--- /dev/null
+++ b/docs/superpowers/reviews/FINDINGS-flake-demo-claim-browser.md
@@ -0,0 +1,31 @@
+Reviewed `7910cf1e6b0ae9322c1e531bd8cb27ca95ead82a` against `origin/main` (`12158f40fdafa2b08a0ee747059289c39d09bace`), round 1. The diff contains only the browser-test change and its review brief.
+
+**P1: none. P2: none.**
+
+**P3 — The sibling scripts retain the navigation race.**
+Invariant: assertions must run against the intended document after navigation.
+
+- [demo_claim_browser.mjs:80](/home/paulca/amadan.net/carlos/platform-flake-browser/internal/console/testdata/demo_claim_browser.mjs:80) polls across the token shell’s replacement. Its reloads at lines 184–185 and 240–241 immediately poll a condition already satisfied by the outgoing document.
+- [demo_claim_resume_browser.mjs:164](/home/paulca/amadan.net/carlos/platform-flake-browser/internal/console/testdata/demo_claim_resume_browser.mjs:164) navigates between pages with the same radio-selector condition, then immediately polls it. Lines 200–201 also poll across the submission and resume navigation chain.
+
+These can fail during document replacement or accept the outgoing document and run subsequent assertions too early. In a follow-up, add passive navigation waits matched to each flow before polling. The resume flow needs to account for its intermediate documents. These are existing, out-of-scope issues, as the brief specifies.
+
+The requested checks:
+
+1. **The new waits leave no CDP command in either identified navigation window.** [demo_claim_kept_browser.mjs:56](/home/paulca/amadan.net/carlos/platform-flake-browser/internal/console/testdata/demo_claim_kept_browser.mjs:56) only checks the event array and awaits timers. Both navigation calls immediately await it. The live-mode `shot()` and completion fetch occur after the second commit, at lines 93–94. Reload assertions and the settled screenshot likewise follow the reload commit. There is no retry or suppression of a failed command.
+
+2. **The event and filtering are appropriate.** The handler checks the attached session and excludes child frames. CDP defines `Frame.url` without its fragment and distinguishes document navigation from same-document navigation, so the expected URLs are correct without additional stripping. See [https://raw.githubusercontent.com/ChromeDevTools/devtools-protocol/master/pdl/domains/Page.pdl](https://raw.githubusercontent.com/ChromeDevTools/devtools-protocol/master/pdl/domains/Page.pdl).
+
+ Chromium updates the renderer connection before committing navigation and resumes queued commands against that connection. This supports using the event as the boundary for subsequent evaluations across a renderer swap; flattening does not pin the session to the outgoing renderer. The event does not mean the DOM is ready, which is why retaining `until()` matters. See [https://raw.githubusercontent.com/chromium/chromium/main/content/browser/devtools/render_frame_devtools_agent_host.cc](https://raw.githubusercontent.com/chromium/chromium/main/content/browser/devtools/render_frame_devtools_agent_host.cc).
+
+3. **The strict sequence fits these fixtures.** The script never traverses history, so it does not trigger a back-forward-cache restoration. `history.replaceState()` does not add a document commit. The previous scene’s expected commits have already been received before the next snapshot. The live completion fetch updates server state and the page updates its DOM; neither adds a navigation. I found no legitimate extra commit that this assertion would reject in the current flow.
+
+4. **Both navigation sites in the kept script are covered.** Its only explicit navigation operations are the initial `Page.navigate` and `Page.reload`; both now wait. The shell’s implicit replacement is covered by expecting two initial commits.
+
+5. **The existing proof is preserved.** [demo_claim_kept_browser.mjs:96](/home/paulca/amadan.net/carlos/platform-flake-browser/internal/console/testdata/demo_claim_kept_browser.mjs:96) retains the reveal count, fragment and history checks, token absence, cookie scope, settled reload, and CSP assertions. The reload check is stronger because it can no longer succeed on the outgoing document.
+
+6. **The proposed cause is credible, but the exact failed command remains unproven.** The first scene is live. Its shell delay, staged completion holds and celebration precede reload, supporting the conclusion that the 3.61-second failure happened earlier. The local 4.7-second measurement alone would not establish CI timing. Chromium also explicitly emits this error for outstanding JavaScript-executing commands during renderer replacement, matching the proposed mechanism. See [https://raw.githubusercontent.com/chromium/chromium/main/content/browser/devtools/devtools_session.cc](https://raw.githubusercontent.com/chromium/chromium/main/content/browser/devtools/devtools_session.cc). Unexpected target closure remains another possible source; this change correctly leaves such failures visible.
+
+Validation was static inspection and Chromium source verification. I did not run tests in this read-only environment or independently reproduce the reported failure. No files were changed.
+
+**READY**
\ No newline at end of file