Finalize persistent-Mac compile fallback routing

Merged
TE
2mo ago
+220-182

Summary

Finish the persistent-Mac compile pilot on top of #13411 without carrying the stale history from #13425.

  • keep the required hosted macOS compile admission job off the persistent-route critical path;
  • allocate the hosted macOS runner immediately, restore exact reusable products first, then perform a ready-only producer observation from inside that already-running job; queued/running/absent producers fall through to hosted compilation immediately;
  • publish an explicit GitHub-selected source-identity validity bit and gate persistent request/observation on it, so ambiguous/octopus source identity falls cleanly to hosted admission;
  • preserve the default-branch router as the only Actions-write/dispatch owner;
  • keep the current cancellation-aware RetryWait implementation for the default-branch dispatcher while the required hosted path uses a nonblocking ready-only observation;
  • close the mapping-form self-hosted runner guard gap by inspecting group: and labels: lines and exempting only the exact persistent producer mapping;
  • update focused contract tests and operator docs.

The canonical workload implementation remains source-exact: source commits older than #13411 lack the profile registry and intentionally fall back hosted. No newer semantic runner is injected into an older SOURCE_SHA.

Supersedes the remaining landing delta from #13425 once #13411 is merged.

Related: #13198, #13411, #13425. Glaeda: teamleaderleo/glaeda#1084.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Finalizes the persistent-Mac compile pilot so the required hosted macOS admission job no longer waits on a separate route job. The admission job allocates the macOS runner immediately, restores any exact reusable product first, and then makes a single nonblocking, read-only check of the persistent producer from inside the already-running job.

  • Removes the persistent-mac-compile-route job and moves its observe-only logic into macos-compile-admission, keeping the default-branch router as the only workflow with Actions write/dispatch authority.
  • Adds a --ready-only observation mode that uses the producer only when its compile job is already completed, falling back hosted for absent, queued, or running producers, and to the producer conclusion when completed unsuccessfully. Ready-only observation drops the queue and execution wait budgets entirely and refuses to run without --observe-only.
  • Adds an explicit source_identity_valid bit from the changes job and gates persistent request/observation on it, so ambiguous or octopus source identities fall back cleanly to hosted admission instead of failing the step.
  • Extends the self-hosted runner guard to treat cmux-persistent-compile as a fleet selector and inspect mapping-form group: and labels: selection lines, exempting only the exact persistent producer mapping.
  • Fixes admission timing accounting so route observation is no longer double-counted now that it runs inside the already-allocated admission job.