Skip to content

feat(scripts): map changed files and feature surfaces to CI browser checks - #4841

Merged
devswha merged 4 commits into
mainfrom
feat/browser-checks
Nov 27, 2026
Merged

devswha merged 4 commits into
mainfrom
feat/browser-checks

Conversation

@devswha

@devswha devswha commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Change

Add scripts/browser-checks.ts so contributors and agents can map changed files (or named feature surfaces such as composer, pending, files, diff, sidebar, terminal, prompts, relay, account) directly to the canonical CI browser scripts in scripts/ci-browser.sh without maintaining a hand-edited per-script table that conflicts across PRs.

  • Ranks canonical CI browser scripts using direct imports, 1-hop src/ caller/CSS propagation, inverse-document-frequency DOM/API-route/protocol-code coupling tokens, and named feature surfaces (--surfaces, --surface <id>, --base <rev>, --limit <n>, --json).
  • Excludes demo-only browser checks when changes touch server/ alone.
  • Supports --run to execute the matched browser checks through the isolated runner (scripts/ci-browser-parallel.ts for demo-only sets, or scripts/check.ts run --build when any script needs an isolated herdr session).
  • Documents bun scripts/browser-checks.ts in CONTRIBUTING.md.

Validation

  • Ran bun test ./scripts/browser-checks.test.ts (6 pass, 0 fail)
  • Ran bun run check fast (actionlint, generate:types --check, generate:themes --check, typecheck, build, and test:unit: 28,839 pass, 0 fail across 1,356 files)
  • Skipped bun run check full locally (covered by CI Integration and browser and Native Windows install; this change touches scripts/ tooling and CONTRIBUTING.md only)

@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features
    • Added a command-line tool that identifies browser checks relevant to changed files or selected feature areas. You can review suggested checks, list available areas, output results as JSON, or run the checks directly.
    • Check selection accounts for staged, unstaged, and untracked changes, and avoids suggesting demo-only checks for server-only edits.
  • Documentation
    • Added contribution guidance for finding and running relevant browser checks.

The change adds a browser-check tool that maps changed files or named surfaces to CI browser scripts. It can show match details and suggested commands, or run selected scripts.

Changes: Browser Check Tool

Layer / File(s) Summary
Surface model and repository index
scripts/browser-checks.ts
Defines browser surfaces and result types. Scans repository files, imports, and source tokens to build script and surface summaries.
Target discovery and check selection
scripts/browser-checks.ts, scripts/browser-checks.test.ts
Discovers changed files, validates targets, and ranks matching scripts. Tests cover surface and path matching, server-only targets, coupling tokens, and invalid inputs.
CLI, execution, and usage
scripts/browser-checks.ts, CONTRIBUTING.md
Adds CLI options for listing surfaces, outputting JSON, and running matches. The runner builds the shell when needed and configures the child process. CONTRIBUTING.md documents the command.

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Feature

Merge Risk: Minimal · previous review eedb5

This adds a developer tool that maps changed files to CI browser checks, plus documentation. No concrete defect remains in the reviewed head, and the change is limited to scripts and contributor docs, so merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: a new script that maps changed files and feature surfaces to CI browser checks. It is specific and matches the summary and objectives. It is 74 characters, which is ac…
Description check Passed The description follows the template's two sections, Change and Validation. The Change section explains the new script, its options, the --run behavior, and the CONTRIBUTING.md update. The Validation …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: a new script that maps changed files and feature surfaces to CI browser checks. It is specific and matches the summary and objectives. It is 74 characters, which is acceptable.

Full details: Description check

Explanation

The description follows the template's two sections, Change and Validation. The Change section explains the new script, its options, the --run behavior, and the CONTRIBUTING.md update. The Validation section lists the tests and checks run, with results, and states which check was skipped and why. It does not link an issue, and the template asks for one for features. The description also does not state that the change is a feature the maintainer agreed to, and the template's HTTP/WS contract-test note does not apply to this change.

Resolution

Optional: link the issue where a maintainer agreed to this feature, since the template asks for it on feature changes. The description is otherwise complete.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between b378257 and eedb55a.

Files selected for processing: 3

  • CONTRIBUTING.md
  • scripts/browser-checks.test.ts
  • scripts/browser-checks.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 0 remain after this review.

@devswha

devswha commented Nov 26, 2026

Copy link
Copy Markdown
Owner Author

Holding per maintainer instruction: leave open as a PR without merging.

@devswha devswha added the hold Not merged until the owner says so label Nov 26, 2026
Map 29 CI browser scripts that matched no surface (machine dialog, account PC list, per-agent chat and image QA, header, PWA update and others), weigh a matched surface at 20 instead of 8, and take a 1-hop importer's tokens at 0.25 instead of 0.6 so a large caller such as App.tsx no longer floods the ranking. On 21 older merged PRs not used for tuning, a script the PR edited ranks in the top 12 for 11 instead of 10.
…d renames and Windows paths

- --run drops BROWSER_SHARD, BROWSER_EXCLUDE, BROWSER_LIVE_ONLY and CHECK_DIR from the child's environment, so CI filters cannot empty the picked set into a false pass and a reused check directory's herdr sessions are not stopped.
- An edit to a shared script helper (scripts/demo-server.ts and the like) lists the checks that import it instead of none.
- The printed command builds dist-shell/ first when a picked script needs it.
- --base must name a revision; changed files list both sides of a rename; Windows-style paths match.
- A file that is both an input and an input's importer is credited once.
- The diff and themes surfaces include useRepoDiffViewer and the theme bootstrap entry.
@devswha

devswha commented Nov 26, 2026

Copy link
Copy Markdown
Owner Author

Review pass (omo gate reviewer + Codex gpt-6.2-sol-fast xhigh at 35cf8e7) and one fix round, pushed as 35cf8e7 and 72013b3.

Accuracy study. For each merged PR, its changed source files were fed to the matcher and the CI browser scripts the PR itself edited (or that it broke) were looked up in the ranking. "Hit" = at least one of them in the default top 12.

Set Before (eedb55a) After (72013b3)
15 recent PRs (#4502 ... #4828, used for tuning) 6/15 hit, recall 0.36 9/15 hit, recall 0.51
21 older PRs (#4472 ... #4732, not used for tuning) 10/21 hit, recall 0.48 11/21 hit, recall 0.52

Examples after the fix: #4502 chat-fallback-browser-qa #1, #4768 core-kept-grid #1, #4821 settings-rows #3, #4820 device-security #2, #4811 machine-dialog #19 -> #5. Still weak: large terminal changes (#4759, #4775, #4778, #4781), where generic scripts (ui-ime, ui-terminal) outrank the specific ones. #4785's secret-input-regression and #4828's terminal-copy-off-regression are not in scripts/ci-browser.sh, so they are out of this tool's scope. One CLI run (full repo index) takes about 1.9 s.

Fixed

  • 35cf8e7: 29 CI scripts that matched no surface now do (4 left: ideal-state-idle, herdr-prefix-keys, portal, plugin-actions); a matched surface weighs 20 instead of 8; a 1-hop importer's tokens weigh 0.25 instead of 0.6. These values were picked on the 15-PR set; only the 21-PR set measures the gain (+1).
  • 72013b3: --run drops BROWSER_SHARD, BROWSER_EXCLUDE, BROWSER_LIVE_ONLY and CHECK_DIR (a false pass with BROWSER_LIVE_ONLY=true was reproduced by both reviewers; a reused CHECK_DIR's sessions would be stopped by check.ts); edits to shared helpers such as scripts/demo-server.ts list their importers; the printed command adds bun run build:shell && when needed; --base must name a revision; renames list both paths; Windows-style paths match; no double credit for a file that is both an input and an importer; diff/themes surfaces include useRepoDiffViewer and theme-bootstrap.

Left as follow-ups (not fixed here)

  • MEDIUM: the import scan misses generated browser-entry imports and new URL(path, import.meta.url) loads (e.g. src/lib/useWebPanel.ts, src/fonts/*.woff2 match nothing).
  • MEDIUM: under --run, build:shell writes dist-shell/ before check.ts takes the checkout lock (launch order only; no collision reproduced).
  • MEDIUM: on Windows, demoOnlyScripts in ci-browser-parallel.ts compares backslash paths with src/ and labels demo scripts as herdr (emulated on Linux, not run on Windows; existing code, safe direction).
  • MEDIUM: a deleted file loses its importers' import credit (its importer drops from Observe mode, held-input draft, and status push for every pane #1 to One bottom space under the composer on iOS #14).
  • LOW: the CSS ranking test still passes with CSS-to-TSX matching disabled.

Validation: bun test ./scripts/browser-checks.test.ts (6 pass, includes a new MachineDialog -> machine-dialog-regression case that fails on eedb55a). Skipped bun run check fast locally (this PC was over 85% CPU); CI runs it. scripts/conventions.test.ts fails the same 2 fixed-sleep ratchet tests on eedb55a and on 72013b3 here, so they are unrelated.

The hold label stays: it was set on the maintainer's instruction.

@devswha

devswha commented Nov 27, 2026

Copy link
Copy Markdown
Owner Author

Maintainer asked Dori to review and merge (Dori session 2026-11-27). Removing hold.

@devswha devswha removed the hold Not merged until the owner says so label Nov 27, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Deploying ovis with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6531696
Status: ✅  Deploy successful!
Preview URL: https://d1870fb8.ovis.pages.dev
Branch Preview URL: https://feat-browser-checks.ovis.pages.dev

View logs

@devswha
devswha merged commit 681e2e2 into main Nov 27, 2026
16 checks passed
@devswha
devswha deleted the feat/browser-checks branch November 27, 2026 06:34
@devswha

devswha commented Nov 27, 2026

Copy link
Copy Markdown
Owner Author

Merged through pr-merge at head 6531696ad. Seen before the merge was asked for: required checks green, no unresolved thread, no conflict, no hold, main not red, no release in progress. CodeRabbit said it did not review (a limit or a skip) since this head.

main had moved since the checks of 72013b37e: pr-merge --update merged it in (ebe59d046), and every required check was green at this head.

Maintainer's tooling PR; he asked Dori to review and merge (Dori session 2026-11-27); reviews: omo gate + Codex; accuracy check in PR comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant