Repository navigation
Deduplicate CLI readiness and command plumbing - #1921
Conversation
Architecture-Review: unchanged; command entry points, trusted configuration, review locking, and readiness policy retain their existing boundaries. Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
loopzero primary review by claude on 0ecf0893f70055b981e89e039f95d76d4f5462df, 38.2s: approve (0 critical, 0 important, 3 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.
|
|
||
|
|
||
| def _context(args: argparse.Namespace, *, pin_checks: bool = False) -> tuple[Path, Config]: | ||
| def _context(args: argparse.Namespace, *, pin_checks: bool = True) -> tuple[Path, Config]: |
There was a problem hiding this comment.
suggestion: pin_checks on _context is now a dead parameter
Every caller of _context now uses the default pin_checks=True (lines 612, 680, 767, 1313, 1754). The only explicit argument is pin_checks=True at line 1842, which the task says sits in a reserved hunk. No caller passes False, so the keyword can never change behavior. Flipping its default to True keeps an option nobody uses. Once #1907/#1780 land and line 1842 is free, drop the parameter and pass pin_checks=True straight to _load_config. That is smaller and removes the misleading option.
| markers = _pr_markers(reviews, head, publishers, repo=config.repo, number=pr.number) | ||
| if _review_cap_spent(markers) and all(marker.head != head for marker in markers): | ||
| exhausted = _review_cap_reason(config, pr, head, reviews, markers, publishers) | ||
| if _conflict_delta_base(config, pr, head, reviews, markers, publishers): |
There was a problem hiding this comment.
suggestion: Inlining _review_cap_reason and _readiness_precheck makes _readiness bigger
The behavior is the same. The precheck short-circuit order and the cap message text both match the originals. However, _readiness was already the most branch-heavy readiness function, and it now also carries the nested conflict-delta message branch and the walrus precheck. Inlining helpers mainly to save lines moves complexity into a hotspot that several pending PRs touch. This is acceptable given the budget goal. If a later pass has room, restoring the cap-message helper would keep _readiness easier to follow.
| git_dir = _git(wt, "rev-parse", "--absolute-git-dir", paths=True) | ||
| fd = os.open(git_dir, os.O_RDONLY | os.O_DIRECTORY) | ||
| try: | ||
| with ExitStack() as cleanup: |
There was a problem hiding this comment.
suggestion: ExitStack used only to replace a try/finally
ExitStack with a single callback(os.close, fd) behaves the same as the old try/finally (it is registered right after os.open succeeds). It is a less familiar idiom for one resource, and ExitStack.__exit__ is typed to return bool, so a static checker would report a missing return in locked. None is configured now. This is fine, but a short comment, or the plain try/finally if line budget allows, would read more clearly.
|
@Mergifyio queue |
✅ Merged into
|
|
No description provided. |
Context and goal
cli.pyrepeats the receipt-backed mark-ready sequence and carries private wait defaults that neither command uses. This change shares that sequence and simplifies the existing control flow.Refs #575
Acceptance
src/loopzero/cli.pyand leave tests untouched.Notes
Base
main @ 20fa3f2
Base: 20fa3f2
Validation
Recorded for
0ecf0893f700uv 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 01cb9945c. Coverage.py statement counts went from 1,223/1,317 to 1,211/1,303 and branch counts went from 451/528 to 447/524. The patch removed covered statements and branches. Every previously covered statement and branch still present remained covered. The untested pre-expired-deadline path is unchanged and now shares the timeout tail.Review