feat(ci): publish hosted light candidates in pool artifact

Merged
TE
1h ago
+246-1

Adds an optional hosted-light-candidates/v1 field to the existing macos-pool-load artifact. The janitor receives the existing CI_RUNNER_STATE variable through environment wiring, validates both source clocks and the partial coverage envelope, and publishes only the seven sanitized candidate fields. Invalid, stale, foreign, oversized, disabled, or incomplete outer sources are omitted; existing snapshot truncation semantics remain unchanged.

The candidate field is discovery-only. Consumers must still re-read the current run, PR head, and complete current-attempt jobs before acting. This change adds no API listing, permission, cadence, routing, or consumer activation.

Validation:

  • python3 -m unittest tests.test_ci_queue_janitor (346 passed)
  • git diff --check
  • cmux-ci test -- python3 -m unittest tests.test_ci_queue_janitor (dispatch attempted twice; fleet push failed with GitHub 500, then SSH publickey denial before a run started)

Performance:

metricbeforeafterdeltaharness or run link
candidate rows discovered from 100-row compressed fixture0100+100 rowsdeterministic local hosted_light_candidates harness
decode/sanitize wall time per 100-row fixturen/a0.56 msn/aPython timeit, 5x100 calls, best run
additional GitHub/API reads000code path review; data enters through existing env/artifact flow

The source producer uses a partial, expiring envelope; this PR does not claim the janitor cadence meets a five-minute freshness SLO.

agent-identity footer --repo manaflow-ai/cmux
🤖 Generated with Codex

Agent session: agent session


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Publishes optional hosted-light candidate hints into the macos-pool-load artifact. The janitor reads CI_RUNNER_STATE and, when it carries a complete, fresh, size-bounded runner-state envelope, copies a sanitized hosted-light-candidates/v1 projection into the artifact. Previously the artifact carried no such hints; now consumers can discover hosted-light runs without listing runners or runs.

Details

  • Each candidate row is reduced to seven whitelisted fields; no other payload is forwarded.
  • The field is omitted when the outer sweep is truncated or starved, or when the source is invalid, stale, malformed, foreign, oversized, disabled, or incomplete.
  • Discovery only: consumers must still re-read the current run, PR head, and complete jobs before acting.
  • No API listing, permission, cadence, routing, or consumer activation changes; a CI_HOSTED_LIGHT_CANDIDATES_DISABLED kill switch suppresses the field.
  • CI_RUNNER_STATE is now classified as discovery metadata, not a runs-on label, in the runner variable tests.

Summary by CodeRabbit

  • New Features
    • CI queue snapshots can include eligible hosted-light workflow runs when fresh, valid runner-state information is available and the queue listing is complete.
    • Candidate details are limited to validated pull-request runs in queued or in-progress states. Invalid, stale, oversized, or incomplete information is omitted.
    • Hosted-light candidates can be disabled through a repository setting.
    • Candidate data includes only selected run details, and its delivery time is based on the receiving system’s clock.