Skip to content

Check size budgets against the current target before queuing - #1729

Closed
eowca wants to merge 2 commits into
mainfrom
lean178/1293-current-target-budget
Closed

eowca wants to merge 2 commits into
mainfrom
lean178/1293-current-target-budget

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Check size budgets against the current target before queuing

Acceptance

  • For a ready source head, run the existing trusted checker on a disposable integration with the freshly fetched target and use that same commit as the baseline.
  • Show the measured count and cap through both readiness and new merge requests. Leave already submitted Mergify requests on the existing wait path.
  • Preserve source checkout, receipt, absolute caps and hold-or-shrink behavior.

Notes

The offline fixture tests ready, merge and an already submitted request with a stale source tracking ref. This PR adds test lines and will wait for test headroom after review.

Base

main @ 0287f2b

Validation

(no loopzero check run recorded)


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

Review

  • primary, claude, a09e542, request_changes
  • delta, claude, 3147238, approve

Co-Authored-By: Codex <noreply@openai.com>

@loopzero-feder-positronics loopzero-feder-positronics Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loopzero primary review by claude on a09e54266b2a977f6c60f3b09f83f4b13f1279a4, 75.5s: request_changes (0 critical, 1 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.

Comment thread src/loopzero/cli.py Resolved
Comment thread src/loopzero/cli.py
raise CliError(f"could not fetch {config.base_branch} from origin for the size budget check")
base = git("rev-parse", "FETCH_HEAD^{commit}")
script = git("show", f"{base}:{_SIZE_BUDGET}")
tree = git("merge-tree", "--write-tree", base, pr.head_sha)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: A merge conflict with the fresh target surfaces as a raw git failure

git merge-tree --write-tree exits 1 when the source head conflicts with the freshly fetched target. _git then raises a generic git command error, so ready and merge fail with merge-tree output instead of a clear 'PR conflicts with current ; rebase' message. Readiness may have passed against GitHub's older mergeability view. Consider calling _proc.run directly here and mapping a nonzero exit to a clear CliError. Similarly, consider mapping a missing scripts/size_budget.sh on the target (git show at line 1241) to a clear error.

Comment thread src/loopzero/cli.py
def _prequeue_size_budget(
wt: Path, config: Config, pr: github.PR, readiness: github.Readiness,
) -> None:
if not readiness.ready or config.merge_strategy != "mergify" or _SIZE_BUDGET not in config.checks:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Exact-string checker detection and duplicated isolated-fetch logic

_SIZE_BUDGET not in config.checks matches only the exact command scripts/size_budget.sh. Variants such as bash scripts/size_budget.sh or scripts/size_budget.sh origin/main silently skip the pre-queue check, and nothing reports the skip. The temporary clone, fetch and merge-tree sequence also reimplements part of candidate.fetched_git/_verify_tree (src/loopzero/candidate.py:307-396) without its size, time and transient-error handling. A raw fetch failure becomes a non-retryable CliError, while candidate.py classifies the same failure as GhUnavailable. Consider reusing or factoring the shared isolated-integration helper so the two paths do not drift apart.

Architecture-Review: unchanged; the candidate is still counted with the trusted target checker.
Co-Authored-By: Codex <noreply@openai.com>

@loopzero-feder-positronics loopzero-feder-positronics Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loopzero delta review by claude on 31472383d8fcf7164326a580ddb705de543ef543, 20.6s: approve (0 critical, 0 important, 0 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.

@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

waits for test headroom

@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #1750, which retains this implementation and reduces the test diff to 15 lines. The amended test proof needs a fresh review after both rounds were used here.

@eowca eowca closed this Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Report current-main size budget failures before requesting Mergify

1 participant