agents/projects/code-health/histogram-cleanup/references/analysis_guidelines.md
Use these guidelines to evaluate the difficulty and safety of removing an expired histogram.
HistogramTester to verify the metric was recorded are safe
to remove and should NOT lower the Confidence Score.<enum>
is used by other histograms before proposing its deletion from enums.xml.<expired_intentionally> tag in the XML. This tag means the team
specifically wants to keep the code around for local diagnostics. Only target
expired histograms that lack this tag (forgotten technical debt).When presenting candidates, provide an estimated effort level based on the following:
HistogramTester).<variants> or <token> expansions.browser_tests or more complex mocks/simulations.<variants> expansions.interactive_ui_tests or complex multi-process state.<token> expansions or shared enums that need cleaning.When instructed to perform a deep dive on an expired histogram, use the
following exact workflow for the histogram <HistogramName>:
<token> or <variants> generated names) in the codebase.
cs search returns a massive number of
results (e.g., > 20) or immediately shows external references (e.g., Chrome
OS platform2), STOP searching. Assign a Confidence Score of 0
immediately.cs (CodeSearch) to check for external references (e.g.,
Chrome OS platform2 or internal repos). If external references exist, the
removal is UNSAFE."My.Hist" on one line and
"ogram.Name" on the next). Search for chunks of the name rather than just
the full string or the last dot-separated segment to ensure you find all
call sites.MyExpiredHistogram) to catch occurrences in constant names, variable
identifiers, or Java resource IDs.rg (ripgrep) for fast local discovery of the files you will need to
edit.Return ONLY a concise summary of the affected files and tests, any identified risks, the final Confidence Score, a brief justification, and the Removal Plan.