You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(scripts): map changed files and feature surfaces to CI browser checks - #4841
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)
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.
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.
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: 4
Check name
Status
Explanation
Title check
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
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
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
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.
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.
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.
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
Add
scripts/browser-checks.tsso contributors and agents can map changed files (or named feature surfaces such ascomposer,pending,files,diff,sidebar,terminal,prompts,relay,account) directly to the canonical CI browser scripts inscripts/ci-browser.shwithout maintaining a hand-edited per-script table that conflicts across PRs.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).server/alone.--runto execute the matched browser checks through the isolated runner (scripts/ci-browser-parallel.tsfor demo-only sets, orscripts/check.ts run --buildwhen any script needs an isolated herdr session).bun scripts/browser-checks.tsinCONTRIBUTING.md.Validation
bun test ./scripts/browser-checks.test.ts(6 pass, 0 fail)bun run check fast(actionlint,generate:types --check,generate:themes --check,typecheck,build, andtest:unit: 28,839 pass, 0 fail across 1,356 files)bun run check fulllocally (covered by CIIntegration and browserandNative Windows install; this change touchesscripts/tooling andCONTRIBUTING.mdonly)