Back to Chromium

Applying Gemini CLI to Fix Chromium Unsafe Buffer Usage

agents/prompts/projects/spanification/README.md

148.0.7773.11.5 KB
Original Source

Applying Gemini CLI to Fix Chromium Unsafe Buffer Usage

CodeHealth rotation

This script and prompt are powering the CodeHealth rotation for spanification of unsafe buffer usage in Chromium. See go/code-health-unsafe-buffer-access and the list of bugs.

The pending generation, patches, and bugs are tracked in the following spreadsheet: go/codehealth-spanification-spreadsheet (Googler-only)

Background

This prompt task applies Gemini CLI to identify and fix unsafe buffer usage in the Chromium codebase.

For more details, see /docs/unsafe_buffers.md.

Googler-only docs: go/gemini-spanification-setup

Setup

  1. Setup Gemini CLI following /agents/README.md.
  2. Create //GEMINI.md following /agents/prompts/README.md.
  3. landmines extension is recommended. See /agents/extensions/README.md.

Usage

bash
vpython3 agents/prompts/projects/spanification/run.py [file_path]

Where [file_path] is the path to the Chromium source file you want to process. The script will analyze the file, identify unsafe buffer usages, generate spanified code.

The file ./gemini_spanification_output.json will contains the commit message and the logs of the operations.