ci: match the composed producer job name so compile reuse can find a producer
What
Both compile-reuse lookups identify the producing job by exact GitHub job name. They stopped matching anything on 2026-09-21 and have been dead since.
scripts/ci/find_admitted_build.py:66 job["name"] == ADMISSION_JOB
scripts/ci/reuse_app_host_products.py:306 job.get("name") == "macOS compile admission"
#13405 extracted the macOS jobs from ci.yml into the reusable ci-macos.yml, called from the macos job. GitHub reports a reusable workflow's jobs as <caller job> / <job name>, so the producer is now macos / macOS compile admission. Neither constant moved with it.
This matches the final path segment instead, so the lookup survives the job being reached directly or through any caller.
Verified, not inferred
Three CI runs created minutes before this PR:
'macos / macOS compile admission' labels=blacksmith-6vcpu-macos-15 status=queued
'macos / macOS compile admission' labels=blacksmith-6vcpu-macos-15 status=in_progress
'macos / macOS compile admission' labels=blacksmith-6vcpu-macos-15 status=in_progress
Before/after the refactor:
| Window | Runs with a job named exactly macOS compile admission |
|---|---|
| Pre-refactor (09-21 10:00–14:00Z) | 25 / 30 |
| Post-refactor (09-22 02:29–04:58Z) | 2 / 207 |
The two survivors are stale branches whose merge commit still carried the inline ci.yml.
Consequence: find_admitted_build.py returns None unconditionally, and reuse_app_host_products.py records producer_compile_unsuccessful for every candidate. Both reuse mechanisms are structurally dead, 100% of the time. Sampled macos-compile-admission-metrics-* artifacts agree — every successful admission reports a real ~1,015s compile with classification: "hosted fallback", and the measured reuse hit rate across ~110 successful admissions is zero.
Why this is low risk
- Already fail-open at both call sites. The
admittedstep iscontinue-on-error: true; the reuse path records a miss reason and compiles normally. - Cannot smuggle in a foreign product. Reuse still revalidates product identity against GitHub's immutable Git objects (
reuse_app_host_products.py:291), so a wrongly matched producer is rejected downstream. - Invalidates no cached product. Neither edited file is in
PRODUCT_CI_INPUTS, andreaches_product()returnsFalseforscripts/ci/*outside that set. No open PR is forced to recompile. (Deliberately not factored into a shared helper inproduct_input_identity.py— that file hashes itself into every product identity, so touching it would invalidate every cached product repo-wide.)
The test that should have caught this
tests/test_ci_change_areas.py fabricated the bare job name in its admission_job() fixture, so it passed against production code that could never match in reality.
The fixture now uses the composed name, and a new test derives that name from the workflows themselves — the ci.yml job whose uses: targets ci-macos.yml, plus the macos-compile-admission job's name — then asserts both lookups accept it. I confirmed it fails when either fix is reverted:
guard correctly fails on reverted code:
find_admitted_build does not match 'macos / macOS compile admission'
That is the signal #13405 should have tripped.
Expected saving
Near zero today, by itself. In a push burst the producer arrives last: of 49 sampled runs that republished a fingerprint an earlier same-branch run had already published, zero had a predecessor whose admission concluded success, so there was nothing to reuse even with a working lookup.
What makes it pay is #13644, the macOS admission debounce, which merged today at 14:00Z and collapses those bursts into one surviving run. This PR is the prerequisite: with the debounce collapsing bursts and the lookup repaired, the ~23.7% duplicate-fingerprint pool becomes harvestable. Landing this without that measurement would be pointless; landing the debounce without this leaves the reuse path dead.
Test
test_reuse_app_host_products.py, test_app_host_test_products.py, test_ci_persistent_mac_compile.py, test_ci_workload_profiles.py, test_ci_guard_workflow_structure.py and test_ci_self_hosted_guard.sh all pass. 149 test_ci_change_areas.py cases pass; its shallow-clone cases require HEAD^1 and fail identically on main.
Related
- #13405 — the refactor that introduced the composed name
- #13644 — the macOS admission debounce that makes reuse reachable
- #13652 — runner cost measurement
🤖 Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.
Summary by cubic
Fixes the macOS compile producer lookup so compile reuse works again after the macOS jobs moved into a reusable workflow.
GitHub reports reusable workflow jobs as <caller job> / <job name>, so the producer is now macos / macOS compile admission; both reuse lookups compared the exact macOS compile admission name and have silently matched nothing since, leaving both reuse paths dead. They now match the final segment of the job name, which works whether the job is reached directly or through any caller.
Both call sites already fail open, so a miss just records a reason and compiles normally, and reuse still revalidates product identity downstream. The test fixture used the bare job name, which masked the regression; it now uses the composed name, and a new test derives it from the workflows themselves so a future move breaks the test instead of reuse.