Skip to content

refactor(browser): share output-write settlement test setup - #166292

Merged
vincentkoc merged 2 commits into
mainfrom
refactor/slop40k-14-20261006
Oct 7, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
refactor/slop40k-14-20261006

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Browser download tests repeat five identical setups for observing when an output write settles.

User Impact

No user-visible behavior changes. All 41 existing cases and their cleanup assertions are preserved, including real Chromium cancellation and live current-document downloads.

Why This Change Was Made

Share the synchronous settlement observer in browser test support. Each setup still captures its caller's current writer, creates a fresh settlement promise, and returns the original write promise. The caller continues to own its waits, hooks, and cleanup.

This is maintainer-approved standalone test maintenance under the existing cleanup campaign. Five test/support files remove 33 net test lines (+28/-61); production code is unchanged.

Evidence

  • Retained historical paired proof on 10334ec913d7b18f32e6e1d16e9ac10bdc760534: 41 baseline and 41 candidate cases passed, with identical ordered full names, titles, ancestors and statuses.
  • Current dependency proof on c39d9b0692dbaafa5b1bfe02514c9f6411ab5546, candidate tree be701f4b6359b5bb6622fef62c32c76da676a7ae: 41/41 passed (12 Chromium, 8 capture, 16 unit, 5 live), with the same complete ordered cases as both historical reports. No skipped, pending, todo or failed cases; no historical baseline replay.
  • Linux x64, Node 24.19.0, Vitest 5.0.1, one worker. Pinned Playwright 1.63.0 installed and ran Chromium revision 1243 (153.0.8010.12) from a fresh cache. Each test process used an empty home; browser/live selectors were explicitly enabled and missing-browser skip and executable overrides were cleared.
  • Current selected five-path staged checks passed: plugin test types, formatting, doctor contract guards, three dead-export scans (zero entries), package/plugin boundaries, lint (zero warnings/errors), repository guards, and git diff --check. All seven commands passed and the carrier was restored cleanly.
  • Selected gates took 355.140 seconds. No performance improvement is claimed.
  • Independent full source/equivalence review, source autoreview and exact signed-tree proof binding passed. Current bundle SHA-256: d4de53457454a7f7775ab9f8b02ab1cc6ced1840ca35ff0e9635b1e8d13e0480. Historical bundle: d3b6d63b99f1f4e76539191880bc5ebe187d618da3697b51a743bccce0ee714e.

The dependency repair in #166217 is merged and incorporated in the current proof inputs. Exact-head hosted CI, review and ordinary native landing gates remain required; frozen-source proof is not labeled as runtime on newer main.

@vincentkoc vincentkoc self-assigned this Oct 6, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 6, 2026
@clawsweeper

clawsweeper Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 7, 2026, 12:20 AM ET / 04:20 UTC (Revision 2).

ClawSweeper review

What this changes

The PR shares browser-download test setup for observing output-write completion while preserving existing assertions and cleanup.

Merge readiness

✅ Ready for maintainer review

Keep open: this useful test consolidation remains absent from current main, and the introduced diff preserves settlement ordering and caller-owned cleanup. No actionable correctness or security findings remain.

Priority: P3
Reviewed head: 3e73c2de32454bed02b8cf869c689cbc601eda5f

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving test consolidation with relevant recorded validation and no actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The MEMBER-authored PR changes only test setup, so the external-contributor runtime gate does not apply. Its recorded Chromium replay supports preserved cancellation and cleanup coverage; no production owner or stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The MEMBER-authored PR changes only test setup, so the external-contributor runtime gate does not apply. Its recorded Chromium replay supports preserved cancellation and cleanup coverage; no production owner or stored-data contract changes.
Evidence reviewed 7 items Pinned introduced diff: The merge-base-to-head delta extracts five identical observer setups into one local test-support module. It leaves production code, assertions, waits, and restoration hooks unchanged.
Settlement and cleanup equivalence: The helper synchronously captures the caller’s current writer, creates a fresh settlement promise, resolves it on either outcome, and returns the original write promise. Complete affected tests and production download modules were inspected; the helper takes the caller’s module instance rather than importing another runtime instance.
Current-main necessity: Fetched main still contains all five inline settlement setups and no shared observer. The linked merged prerequisite repair does not implement this consolidation.
Findings None None.
Security None None.

How this fits together

The browser plugin saves downloads through an output owner that stages and publishes files. Its cancellation tests observe that writer’s completion before checking that partial files have been removed.

flowchart TD
  A[Download test scenario] --> B[Shared settlement observer]
  B --> C[Existing output writer]
  C --> D[Write succeeds or rejects]
  D --> E[Settlement signal]
  E --> F[Caller assertions and cleanup]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -33. Total -33 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 5 28 61 -33
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 28 61 -33

Review metrics

None.

Technical review

Best possible solution:

Keep one plugin-local settlement observer while leaving scenario-specific waits, assertions, and cleanup with each test.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR consolidates existing test setup rather than reporting a product defect.

Is this the best way to solve the issue?

Yes: the local helper preserves the original promise and module identity without moving lifecycle responsibilities away from callers.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 5be0e7764b3a.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is bounded test-maintenance cleanup with no production behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The MEMBER-authored PR changes only test setup, so the external-contributor runtime gate does not apply. Its recorded Chromium replay supports preserved cancellation and cleanup coverage; no production owner or stored-data contract changes.

Evidence

What I checked:

  • Pinned introduced diff: The merge-base-to-head delta extracts five identical observer setups into one local test-support module. It leaves production code, assertions, waits, and restoration hooks unchanged. (extensions/browser/src/browser/output-files.test-support.ts:4, 3e73c2de3245)
  • Settlement and cleanup equivalence: The helper synchronously captures the caller’s current writer, creates a fresh settlement promise, resolves it on either outcome, and returns the original write promise. Complete affected tests and production download modules were inspected; the helper takes the caller’s module instance rather than importing another runtime instance. (extensions/browser/src/browser/output-files.test-support.ts:5, 3e73c2de3245)
  • Current-main necessity: Fetched main still contains all five inline settlement setups and no shared observer. The linked merged prerequisite repair does not implement this consolidation. (extensions/browser/src/browser/pw-download-capture.test.ts:153, 5be0e7764b3a)
  • Supplied validation and accepted scope: The captured PR body records maintainer-approved standalone maintenance, historical paired 41-case equivalence, and a current 41/41 replay including real Chromium cancellation and current-document downloads. It identifies the dependency-repair base c39d9b0 and candidate tree be701f4b6359b5bb6622fef62c32c76da676a7ae. These are contributor-recorded results, not reviewer-executed tests. (3e73c2de3245)
  • Re-review continuity: The prior completed review contains no findings or published rank-up moves. The extracted helper is unchanged from that reviewed head; the author’s subsequent comment requests re-review. (extensions/browser/src/browser/output-files.test-support.ts:4, 3e73c2de3245)
  • Feature-history routing: Current-main history connects Peter Steinberger with recent settlement-test maintenance and Patrick Erichsen with the current-document download feature. Historical blame could not complete because an older blob was unavailable and its fetch returned HTTP 403; introduction attribution remains unverified. (extensions/browser/src/browser/pw-tools-core.download-current-document.live.test.ts, 5be0e7764b3a)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Patrick Erichsen: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-06T21:06:04.862Z sha 047dea6 :: needs maintainer review before merge. :: none

@vincentkoc
vincentkoc marked this pull request as ready for review October 7, 2026 04:16
@clawsweeper

clawsweeper Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@vincentkoc
vincentkoc merged commit 078ca89 into main Oct 7, 2026
176 checks passed
@vincentkoc
vincentkoc deleted the refactor/slop40k-14-20261006 branch October 7, 2026 04:35
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 8, 2026
…#166292)

* refactor(browser): share output-write settlement test setup

* chore: incorporate qualified main for browser test validation

Co-authored-by: Vincent Koc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: browser P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant