Repository navigation
Checkpoint recorded stages in the sandbox check loop - #1696
Conversation
Co-Authored-By: Codex <noreply@openai.com>
This reverts commit 2eae6c8.
Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
loopzero primary review by claude on c3f8fd66c5a729c61782d747b4eebf9a8a0c8f1d, 26.3s: approve (0 critical, 0 important, 1 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.
| checkpoint, CheckReport(head, dirty, tuple(results), settings_sha256), | ||
| previous, commands[index + 1:], | ||
| ) | ||
| if checkpoint is not None and result.input_key and result.exit_code == 0: |
There was a problem hiding this comment.
suggestion: Moving the checkpoint helper into run_checks makes the loop nest deeper
This change is meant to reduce complexity in run_checks. Moving the checkpoint logic into the loop keeps Ruff's branch count at 16, but the code now nests four levels deep in the main loop (with → for → if → if). It also builds the checkpoint report inside the loop. I checked the behaviour and it matches the old helper. input_key defaults to None, and _input_key returns None or a hash, so the unconditional replace(result, input_key=key) gives the same values as the old if key: path. commands[ordinal:] is the same slice as the old commands[index + 1:]. Removing the not local.results guard is safe: with _resolved=True and checks=(command,), the loop always appends exactly one result or raises. A smaller option is to keep a helper that takes (results, commands[ordinal:]) and is called only when checkpoint is not None and result.input_key and result.exit_code == 0. That still avoids building an unused report and keeps the nested block out of the hotspot function. This is optional.
|
@Mergifyio queue |
✅ Merged into
|
|
No description provided. |
Checkpoint recorded stages in the sandbox check loop
Context and goal
run_checksamong the five branching hotspots. The other four are in files touched by the parked PRs listed on Simplify the sandbox check loop after the source complexity audit #1694.Closes #1694.
Acceptance
Notes
bf1002c2b7c1. Ruff ranked the five asconfig._build(32 branches),cli.cmd_review(28),runners._codex_evidence(16),sandbox.run_checks(16), andcli.cmd_merge(16). Source delta is 14 added and 22 deleted, net −8. The 40-line target was not reached within the eligible files.run_checkswith one command, no runner, no preparations and no input keys. Every completed call appends one stage before returning. A thrown exception still passes through the existing error path.8916b1a6c0b4, PR Checkpoint recorded stages in the sandbox check loop #1696 still draft. Hosted checks passed; the queued local check was cancelled at the slot supervisor before review. Focused tests and the size gate passed. The final measured reduction, net 8 source lines, is posted on Keep loop-zero improvement builders full: refill continuously (Marcin standing order) #575. Resume with a full slotted check, then primary review.Validation
Recorded for
c3f8fd66c5a7uv 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 0Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Review