chrome-devtools-frontend 1.0.1742811
Legitimate Chrome DevTools package
“Chrome DevTools UI”
ADODB.Stream SaveToFile method callActiveXObject constructor reference
SHA-256ae006b1377d4a176b2eb36abd961023744d118eadfc024a4fe04931a36a4bd5f
Evidence
⋯4 lines
5---
6
7**Rule.** Keep AI agent prompts, tool schemas, and data formatters deterministic, token-efficient, and decoupled from UI and locale state
8- **Look for**: Localized `i18nString` calls or verbose boilerplate prose inside AI data formatters, unsorted flag/property lists in prompt serializers, AI tools missing permission policy declarations, or monolithic trace models passed to response widgets.
9- **Do not flag**: User-facing UI labels rendered in the AI assistance panel chrome rather than sent to the LLM.
10
11**Why.** AI agent data formatters (`models/ai_assistance/data_formatters/`) must produce deterministic, unlocalized, concise text representations decoupled from UI widgets and trace insight models, while tools must declare explicit permission policies and flatten verbose CDP types.
⋯5 lines
17```ts
18export function formatInsightForPrompt(insight: Insight): string {
19 return `Here is a detailed explanation: ${i18nString(UIStrings.localizedSummary)}`;
20}
21```
22
23Good:
⋯6 lines
1---
2name: devtools/models-and-core/core-cdp-and-extension-error-handling
3rubric: correctness
4severity: blocking
5---
6
7**Rule.** Handle CDP ProtocolResponseWithError and ContentDataOrError explicitly, release RemoteObject handles in finally blocks, and return Promises
8- **Look for**: `try { await ...invoke_*() }` or `try { await request.requestContentData() }` blocks, `Runtime.evaluate` calls creating `RemoteObject`s without `release()` in `finally`, callback-taking SDK methods instead of `Promise`, or `reject(rawObject)` in `ExtensionAPI.ts`.
9- **Do not flag**: `try/catch` blocks that wrap subsequent throwing operations like `JSON.parse()`. Properties marked required (non-optional) in generated `front_end/generated/protocol.ts` CDP types (do not ask for redundant runtime null/undefined checks on them), or `node.shadowRoots()[0]` accesses (elements have at most one shadow root; the array return type is a legacy Shadow DOM v0 artifact).
10
11**Why.** CDP agent calls and `requestContentData()` resolve to error-bearing response objects (`getError()`, `ContentData.isError()`) rather than throwing, so wrapping them in `try/catch` is misleading. Furthermore, temporary `RemoteObject` handles must be released in `finally` blocks, and extension APIs must reject with sanitized `Error` instances.
12
13## Examples
14
15Bad:
16
17```ts
18try {
19 const content = await request.requestContentData();
20 process(content.text);
21} catch (err) {
⋯13 lines
1---
2name: code-review
3description: Generic checklist for reviewing DevTools CLs (your own before upload, or someone else's on Gerrit). Covers test correctness (tautolo …
3:381… iew before `git cl upload`.
4---
5
6# Code Review
7
8This checklist comes from recurring reviewer feedback on landed DevTools CLs.
9Use it for self-review before upload and for reviewing other people's CLs.
10
11## 1. Gather context
12
13- **Automated Review Agent (diff already in prompt):** Do not run shell
14 commands. Use `read_file` to inspect enclosing classes/functions/tests and
15 `search_files` to verify callers or conventions across the repository.
16- ** …
129:8… w DOM". Check that the setting being toggled actually affects the
130 scenario.
131- **Fail fast:** Throw or assert when a required value is missing. Don't let
132 the test time out later.
133- **Pre-migration tests for legacy widgets:** When reviewing tests added …
Showing the top 5 files — 6 more files (56 regions) not shown.
No evidence locations were recorded for this file. Raw result