feat(ci): publish hosted light candidates in pool artifact
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 --checkcmux-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:
| metric | before | after | delta | harness or run link |
|---|---|---|---|---|
| candidate rows discovered from 100-row compressed fixture | 0 | 100 | +100 rows | deterministic local hosted_light_candidates harness |
| decode/sanitize wall time per 100-row fixture | n/a | 0.56 ms | n/a | Python timeit, 5x100 calls, best run |
| additional GitHub/API reads | 0 | 0 | 0 | code 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](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
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_DISABLEDkill switch suppresses the field. CI_RUNNER_STATEis 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.