← Back to list
name: buildbuddy-invocation-compare
description: Compare two BuildBuddy invocation URLs or IDs to troubleshoot hermeticity/reproducibility and cache invalidation. Use when asked to diff canonical Bazel flags, find the first shared action-cache misses, inspect Action/ActionResult differences (inputs/command/env/platform/outputs), or analyze compact execution logs with

buildbuddy-invocation-compare
by sluongng
dotfiles and configurations for personal developement environment
⭐ 5🍴 0📅 Jan 16, 2026
SKILL.md
name: buildbuddy-invocation-compare
description: Compare two BuildBuddy invocation URLs or IDs to troubleshoot hermeticity/reproducibility and cache invalidation. Use when asked to diff canonical Bazel flags, find the first shared action-cache misses, inspect Action/ActionResult differences (inputs/command/env/platform/outputs), or analyze compact execution logs with bb explain.
metadata:
short-description: Compare two BuildBuddy invocations and pinpoint cache/action differences.
BuildBuddy Invocation Compare
Overview
Compare two invocations end-to-end to isolate the earliest shared action-cache miss and pinpoint why actions are rebuilt or produce divergent outputs.
Workflow
0) Preflight: auth + inputs
- Extract invocation IDs from the URLs.
- Confirm API base URL and API key presence without printing the key.
- Create a temp working directory and cache API responses there.
- Use the request templates in
references/requests.md.
1) Diff canonical flags
- Call
GetInvocationfor both IDs. - Extract the canonical command line (
structuredCommandLine.commandLineLabelmatchingcanonical). - Sort flags and diff; highlight any differences in startup or command options.
- If canonical is missing, fall back to the only structured command line and note the limitation.
- Some entries may have
commandLineLabel=null; filter them out to avoid jq errors.
2) Find the first shared AC miss
- Call
GetCacheScoreCardfor both invocations filtered to:cache_type=AC,request_type=READ,response_type=NOT_FOUND- ordered by
start_timeascending
- Use
scripts/find_first_shared_ac_miss.pyto identify the earliest shared{target, mnemonic}with AC misses on both sides. - Record
target_id,action_mnemonic, andaction_idfrom each side for the next step.
3) Locate the rerun action(s)
- Call
GetExecutionwithinline_execute_response=truefor each invocation. - Filter executions by target label, mnemonic, and primary output path (if known) to disambiguate actions.
- Capture:
action_digest(Action proto in CAS)action_result_digestorexecute_response.result(ActionResult)execute_response.result(stdout/stderr/output digests)primary_output_pathto ensure you are comparing the correct action
4) Diff Action and ActionResult
Fetch protos via bazel run //tools/cas and compare with diff -u or jq.
Focus on these common divergence points:
- Input root tree: Compare
Action.input_root_digest; if it differs, fetch both trees and identify differing file paths/digests. If only a few files differ, download and diff them. - Command args / outputs: Compare
Command.arguments,Command.output_files, andCommand.output_directories. Expect platform or toolchain mismatches to surface here. - Env / platform properties: Compare
Command.environment_variablesandAction.platform.properties. Treat differences as evidence of non-strict env or platform drift. - Output digests: Compare
ActionResult.output_filesandoutput_directories; if digests differ with identical inputs/commands, suspect non-determinism.
Prefer bb explain when input roots differ and compact execution logs are available to pinpoint exact input changes.
5) Compact execution logs (optional)
- If
execution_log.binpb.zstappears in the build tool logs, download both logs and diff withbb explain. - Alternatively, pass invocation IDs directly to
bb explainwhen the logs are available in BES.
Response requirements
- Summarize the root cause clearly and tie it to the earliest shared AC miss.
- Call out which of the divergence categories applies (inputs, command/outputs, env/platform, output digest).
- Include a pointer to the compare UI sources:
app/compare/compare_actions.tsxorapp/compare/compare_invocations.tsxfor deeper inspection.
Resources
references/requests.mdfor API + jq templates.scripts/find_first_shared_ac_miss.pyto identify the earliest shared AC miss.
Score
Total Score
55/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
✓最近の活動
1ヶ月以内に更新
+10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
✓タグ
1つ以上のタグが設定されている
+5
Reviews
💬
Reviews coming soon

