feat(ci): add static artifact cache index and lookup #10026
All Vouch review confidence checks passed
Residual risk 0.22 = Change Risk (0.52) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #10026"
general
weight: 0.35
erman-gurses
Summary
Issue: #8651
Add a prototype, statically maintained artifact cache index and a CLI that decides whether artifacts from previous CI runs match a build's fingerprints.
This is the "static index + lookup" step (Phase 2) of RFC0016 and provides the planning step for future CI cache reuse. It only writes a plan: it does not download archives, restore stages, or skip compilation.
By default only
amd-llvmartifacts are used. Other artifacts work the same way through include and exclude patterns.Design
record: update the index from a CI runlookup: decide whether a build can reuse artifactsChanges
New directory
build_tools/artifact_cache/:prototype_artifact_cache_index.json: a manually maintained, prototype indexof artifact fingerprints, archive locations, checksums, and source CI runs.
It holds metadata only, and a dynamic index is planned to replace it.
artifact_cache.pywith two subcommands:-
record: read a CI run's fingerprint (.fprint) and checksum(
.sha256sum) files through the artifact backend in_therock_utilsandupdate the index. A changed fingerprint replaces only the entry for the same
platform, name, component, and target; matching entries keep their original
run. Archives are never downloaded.
-
lookup: compare the build's local.fprintfiles with the index by name,component, target, fingerprint, and platform, and write a JSON plan. Only
artifacts the build produces are checked.
tests/artifact_cache_test.py: unit tests using simulated CI runs in a temporarydirectory (no network or AWS access).
README.md: the directory overview, index maintenance, usage, and a manual testprocedure.
Both subcommands take
INCLUDE...and--excluderegular expressions, asfetch_artifacts.pydoes. They default toamd-llvm, and.selects everything.Artifact names, the S3/local backend, and filtering reuse
_therock_utils/artifacts.py,_therock_utils/artifact_backend.py, andfetch_artifacts.py.Lookup plan
hit(with itsprovenanceandoutputs) or amisswitha reason.
If one misses, or their fingerprints differ, the whole group misses, so there
is no partial reuse.
actionispopulateonly when every artifact in the plan hits,and
buildotherwise.0; input or I/O errors exit with2..fprintfile, such as split per-target artifacts, arereported as skipped by
recordand never appear in a plan.Validation
43936062480(Linux), and all five plan checks passed:
-
record: fiveamd-llvmcomponents added; repeating it leaves the indexunchanged.
-
lookupwith an empty fingerprints directory: MISS,no_local_fingerprints.-
lookupwith the run's own fingerprints: HIT for all five components.-
lookupwith changed fingerprints: MISS,no_matching_index_entry.-
lookupwith one component removed: MISS,incomplete_groupfor the others.-
recordandlookupforbasewith--exclude _dbg_: HIT for all five.-
lookupwith.while the index also holdsbase: HIT, withbaseignored.43936062480reproducesthe checked-in file exactly.
The controlled HITs validate the lookup behavior; they do not establish
compatibility between a local build and that CI run.
Known limitations
recorddoes not check that a CI run succeeded; choose a run whose jobsuploaded complete artifacts. The index is trusted input.
still exist and match their checksums.
artifacts without fingerprints are not in it.
Follow-up work
Artifact copying, archive-content checksum verification, prebuilt-stage
restoration, CI workflow integration, and the dynamic index backend. This PR
generates the reuse plan; it does not skip LLVM compilation.