Repository navigation
Keep the scheduler CPU grant out of local readiness receipts - #1698
Conversation
Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
loopzero primary review by claude on 0142601d03b72cfdd4341d0f773b62f045d62f32, 35.3s: approve (0 critical, 0 important, 2 suggestion)
Settings per native call (launch configuration and CLI claims, not backend attestation):
- Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)
Native Claude output is retained in the restricted local review receipt.
| settings = _execution_settings(config, base) | ||
| if config.check_runner and settings["runner_executable"] is None: | ||
| return None | ||
| if not config.check_runner and "HEAVY_SLOT_GRANTED_CORES" not in config.env: |
There was a problem hiding this comment.
suggestion: The explicit-grant guard never applies because config.env holds (name, value) pairs
Config.env is declared as tuple[tuple[str, str], ...] in types.py:44. Because of that, "HEAVY_SLOT_GRANTED_CORES" not in config.env compares the string against pairs, so it is always True. The grant is therefore removed from settings["environment"] even when it was set explicitly in checks.env.
The acceptance criterion still holds today, but only by accident: _execution_settings also copies the raw env field from asdict(config) into the digest, so a changed explicit value still changes the fingerprint. The guard looks like it does something it doesn't. If the redundant env key is ever dropped from the settings, the bug will surface silently.
Smallest fix: test against dict(config.env), or {name for name, _ in config.env}. Also add a test case that sets the grant through checks.env, changes its value, and asserts that _current_check_report returns None. That would cover the second acceptance bullet, which has no test right now.
| settings = _execution_settings(config, base) | ||
| if config.check_runner and settings["runner_executable"] is None: | ||
| return None | ||
| if not config.check_runner and "HEAVY_SLOT_GRANTED_CORES" not in config.env: |
There was a problem hiding this comment.
suggestion: A variable name from one downstream project is hardcoded into a generic fingerprint
The exemption names HEAVY_SLOT_GRANTED_CORES directly inside settings_fingerprint. It applies to any project that allowlists that name, whatever the project uses the value for. Readiness then ignores a value that the trusted base forwards into the sandbox, and nothing here confirms the value only controls worker count.
This is acceptable as a narrow fix. Moving the name to a module-level constant next to SANDBOX_ENV, with a comment explaining why it is excluded, would make the exception easier to find. It would also make it easier to replace later with a configurable list of transient inputs.
|
@Mergifyio queue |
✅ Merged into
|
|
No description provided. |
Keep the scheduler CPU grant out of local readiness receipts
Context and goal
Closes #1596
Acceptance
Security notes
The trusted base still owns what enters the sandbox. The exception applies only to the inherited worker-count input of local checks, never to PATH, locale, explicit check settings, delegated runners, or the stage cache. No check is skipped and no environment value is recorded in the receipt.
Validation
Recorded for
0142601d03b7uv run --group dev ruff check src tests: exit 0uv run --group dev tach check: exit 0uv run --python 3.14 python scripts/check_architecture_docs.py: exit 0scripts/size_budget.sh: exit 0uv run --group dev pytest -q: exit 0The unfixed check passed with the grant forwarded but rejected the saved receipt when the value changed. The fixed readiness predicate accepts changed and absent inherited grants, rejects a changed ordinary allowlisted input, and still runs keyed stages fresh after the grant changes. Focused sandbox tests: 20 passed. The architecture guide now records the exception.
Security review
The trusted allowlist and commands still define what runs. The exemption does not change sandbox forwarding, configured environment values, stage keys, runner identity, head matching, or receipt publication. IntelFlo's production consumer validates the grant for worker sizing. No blocking security findings.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Review