Skip to content

Reduce duplicated CLI and sandbox source - #1850

Merged
mergify[bot] merged 2 commits into
mainfrom
lean178/575-source-dedupe-pass4
Nov 26, 2026
Merged

mergify[bot] merged 2 commits into
mainfrom
lean178/575-source-dedupe-pass4

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Reduce duplicated CLI and sandbox source

Context and goal

  • Context: The source cap has 26 lines free at the starting base, with additional work queued.
  • Problem: Several existing CLI and sandbox code paths repeat control flow or setup.
  • Goal: Remove at least 50 source lines without changing delivery behavior.

Refs #575

Acceptance

  • Source drops by at least 50 lines and test lines do not grow.
  • Only cli.py, sandbox.py and _proc.py change, away from the queued receipt, review-round and urllib edits.
  • Output, error handling, command order, locks and sandbox environment retain existing behavior.

Notes

Base

Base: 1ae8075

Validation

Recorded for d511fe6c3050

  • uv run --group dev ruff check src tests: exit 0
  • uv run --group dev tach check: exit 0
  • uv run --python 3.14 python scripts/check_architecture_docs.py: exit 0
  • scripts/size_budget.sh: exit 0
  • uv run --group dev pytest -q: exit 0

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

Review

  • primary, claude, d511fe6, approve

eowca and others added 2 commits November 26, 2026 12:37
Share sandbox failures and review publication identity checks. Simplify check receipt and subprocess result construction without changing interfaces.

Architecture-Review: unchanged; command output, receipt schema, subprocess setup, and sandbox boundaries stay the same.
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 d511fe6c3050b158f37673d4d6ba50e686ee0af5, 42.0s: 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.

Comment thread src/loopzero/cli.py
print(f"loopzero {args.command}: {exc}", file=sys.stderr)
return 4
except HANDLED as exc:
if isinstance(exc, sandbox.SandboxUnavailable) and args.command in {"check", "review"}:

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: The 'sandbox unavailable' exit-2 handling now depends on command-name strings in _run

Moving the SandboxUnavailable handling out of cmd_check/cmd_review into _run widens its scope. Before, only failures from sandbox.run_checks and _run_review exited with code 2. Now any SandboxUnavailable raised anywhere in the check or review commands does, including in the lock wrapper, _context, and the repost path. I traced the current raisers (runners.py:355/359/419, sandbox.py) and found none reachable outside those two calls, so behavior is unchanged today and tests/test_cli.py:810 and :2320 still hold through main. The cost is that the handling now lives on a hard-coded {"check", "review"} set far from the commands. A new command that runs the sandbox would silently get exit 1 with a different message, and renaming either command would break it without any error. Optional fix: add a short comment here pointing at cmd_check and cmd_review, or define the set as a named constant next to HANDLED.

@eowca
eowca marked this pull request as ready for review November 26, 2026 11:49
@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

@Mergifyio queue

@mergify

mergify Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

✅ Merged into main as f227668 at 11:57 UTC

7 min in the queue, 5 min of it CI.

So far

  • ✅ Entered the queue Thu 26 Nov, 11:50 · rule main · triggered by @eowca with the @mergifyio queue command
  • ✅ Passed · draft #1858
  • ✅ Merged 11:57 · f227668 · squash
3 merge conditions met
  • github-review-approved · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required
  • any of · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required:
    • check-success = checks
    • check-neutral = checks
    • check-skipped = checks
  • any of · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required:
    • check-success = Loop-zero Eligibility
    • check-neutral = Loop-zero Eligibility
    • check-skipped = Loop-zero Eligibility

Times in UTC · dashboard · how the merge queue works

@mergify mergify Bot added the queued label Nov 26, 2026
@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

No description provided.

@mergify
mergify Bot merged commit f227668 into main Nov 26, 2026
16 checks passed
@mergify mergify Bot removed the queued label Nov 26, 2026
@eowca
eowca deleted the lean178/575-source-dedupe-pass4 branch November 26, 2026 11:58
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.

1 participant