agents/projects/code-health/histogram-cleanup/references/bug_discovery.md
Use these instructions to find existing "Check expiry" bugs for histograms, or to create a new tracking bug.
CRITICAL MANDATE: You MUST use the mcp_Coding_internal_search tool (Moma)
for ALL discovery and verification. NEVER use mcp_Buganizer_get_bugs or
get_bugs for this process, as they redact Chromium issues and return
unrelated internal bugs.
Use this exact pattern in Moma:
"Check expiry of your histograms" "<HistogramName>" "<ExpiryDate>" status:open
expires_after date from the XML (e.g., 2021-10-25).Automated sweeps often create new bugs when old ones are ignored. However, the oldest bug is frequently the one that remains open while newer duplicates are closed.
URL: provided in each
Moma result to definitively determine the bug ID.
b.corp.google.com/issues/<ID> or
issuetracker.google.com/issues/<ID>): The <ID> is already a Buganizer
ID. Use it directly.bugs.chromium.org/p/chromium/issues/detail?id=<ID>):
Use curl -sL to fetch this exact URL and extract the official migrated
Buganizer ID from the redirect script (e.g.,
curl -sL "https://bugs.chromium.org/p/chromium/issues/detail?id=<ID>" | grep -o 'issues\.chromium\.org/[0-9]*').
Use the extracted ID.Bug: footer to ensure you link to the oldest tracker.status:open or actively tracking expiry. Do not use Buganizer tools
(render_issue, etc.) to verify the bug, as they will fail on restricted
Chromium issues. Rely entirely on the information from Moma and the curl
redirect.If no open bug is found, or if the Moma results only show closed/won't fix bugs,
use ask_user (type='choice') to determine bug handling:
label: "Generate New Bug", description: "Auto-create a Buganizer issue in
the CodeHealth component"label: "Provide Existing Bug", description: "User will provide the
existing Bug ID"label: "Skip Bug", description: "Do not include a Bug reference in the
footer"run_shell_command (whoami) for LDAP. Use
mcp_Buganizer_create_buganizer_issue (Component: 1456931, Hotlist:
8218789, Assignee: <LDAP>). Title:
[histogram-cleanup] Remove expired histogram: <HistogramName>. Description
MUST start with: "Note: This bug was automatically generated by the Chrome
Code Health AI." followed by a statement that the histogram is being removed
as it has expired and has no recording sites.ask_user (type='text') with question:
"What is the Buganizer ID?".