agents/skills/experimental-code-coverage-build-inspector/SKILL.md
This skill inspects LUCI builds to validate instrumentation configuration, coverage pipeline execution, recipe skip/error messages, and target file coverage metrics.
[!IMPORTANT] Mandatory Diagnostic Script: You MUST use the automated inspection script
tools/code_coverage/inspect_coverage_build.pyas your primary inspection tool. When investigating a specific error flagged by the script, use thebuildbucketskill located indepot_toolsrather than manually runningbb get.
gn_args and .gclient configuration for a LUCI tryjob.overall test coverage and unit test coverage pipeline steps.When invoked during CQ triage, this skill requires:
build_link: The Buildbucket build URL/link to inspect (e.g.,
https://ci.chromium.org/b/8679...), passed in the prompt by calling agent.language_context: Programming language context ("cpp", "objc", "rust",
"java", "js", or "ts"). Consult references/language_coverage_map.json.target_files: Optional list of specific target files under investigation
(e.g., ["chrome/browser/ui/color/material_new_tab_page_color_mixer.cc"]).test_suites: Specific list of target test suites (e.g.,
["chrome_junit_tests", "content_browsertests"]) to verify execution for.metrics_of_concern: Specific coverage metric types or target thresholds
under investigation (e.g., "line_coverage", "function_coverage").Execute the automated inspection tool against the target build:
python3 tools/code_coverage/inspect_coverage_build.py \
--build <build_link> \
--language <language_context> \
--files <target_file_1> <target_file_2> \
--save-artifact scratch/inspection_<build_id>.md
SCHEDULED or
STARTED), do NOT exit or return a final report prematurely.schedule tool to set up a recurring 10-minute poll:
CronExpression: "*/10 * * * *"Prompt: "Re-run tools/code_coverage/inspect_coverage_build.py against
<build_link>. If still running, go idle. If terminal, cancel this cron
timer using manage_task and execute Section 3 (Conditional Deep-Dive)."Once the script completes against a terminal build, use the buildbucket skill
to pull deeper log snippets only when specific conditions occur:
SUCCESS and target files have expected coverage, no
extra log scraping is needed. Proceed directly to Section 4.SUCCESS:
inspect_coverage_build.py extracts 0.00% Line Coverage (or very low
coverage) for target_files despite pipeline SUCCESS:
buildbucket to check which test suites actually ran on the bot.GN args or .gclient):
buildbucket to inspect the lookup GN args step output.Compile a structured Markdown artifact (scratch/inspection_<build_id>.md or
path requested by parent agent) structured into three parts:
Report back to the parent CQ Debugging agent with the artifact file URI.
The inspect_coverage_build.py script automatically verifies three phases:
references/language_coverage_map.json.llvm-cov HTML reports
from GCS and parses exact coverage percentages and uncovered line numbers.[!IMPORTANT] Use the
buildbucketSkill: For all follow-up log investigation, step status queries, and error log extraction listed below, you MUST use thebuildbucketskill located indepot_tools. If thebuildbucketskill is not available indepot_tools, notify the user.
When the script detects official Clang coverage recipe skip or error messages
from build/recipes/recipe_modules/code_coverage/api.py, follow these triage
instructions to investigate further:
skip processing clang coverage data because no profile data collected
.profraw profile dirs.use_clang_coverage = true was missing.skip processing because no profdata was generated
llvm-profdata merge failed or produced no output.Found invalid profraw files (presentation.properties['merge errors'])
.profraw files detected during profile merge.merge errors property output to identify crashing or
OOM-killed Swarming test shards.skip processing because no data is found
target_files ran
on this bot or if target_files lack unit tests.process_coverage_data_failure = True
processing_step.logs['error'] for Python traceback.