Skip to content

Deduplicate review and check internals - #1512

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

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

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Context and goal

Free 150 source lines for the Lean178 landing wave. Share repeated candidate lookups, review receipt validation and sandbox setup while preserving existing CLI behavior and diagnostics.

Refs #575

Acceptance

  • Remove at least 150 net tracked Python lines under src/loopzero.
  • Leave existing tests intact and pass delivery checks.
  • Preserve provider arguments, candidate rechecks and sandbox policies.

The architecture guide still describes the delivery interfaces, trust boundaries and receipt formats.


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

Review

  • primary, claude, e00eec6, request_changes
  • delta, claude, 4c95f3b, approve

Validation

Recorded for 4c95f3b58b27

  • 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

@eowca
eowca marked this pull request as draft November 26, 2026 03:26
Architecture-Review: unchanged; existing subprocess, sandbox and candidate checks preserve their interfaces, trust boundaries and receipt formats.

Co-Authored-By: Codex <noreply@openai.com>
@eowca
eowca force-pushed the lean178/575-source-dedupe-part-2 branch from 1291c1d to e00eec6 Compare November 26, 2026 03:27

@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 e00eec6fc4b823fed911b0294beb590f60fc3659, 39.8s: request_changes (0 critical, 1 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/runners.py Outdated
_AUTH_FAILURE = re.compile(
r"not logged in|please run /login|please (?:run )?`?codex login`?|invalid api key"
r"|authentication[_ ]error|OAuth access token has expired|Failed to authenticate|token expired"
r"|\b401\b.*unauthori[sz]ed|login required|not authenticated|missing credentials", re.IGNORECASE,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

important: Merged auth regex drops the 'unauthorized … 401' alternative

The old _AUTH_PATTERNS matched \b401\b.*unauthori[sz]ed|unauthori[sz]ed.*\b401\b. The merged _AUTH_FAILURE regex only keeps \b401\b.*unauthori[sz]ed. Provider output where the word comes before the status code, such as Unauthorized (401) or HTTP error: unauthorized, status 401, no longer counts as an auth failure in _looks_like_auth_failure. It falls through to the generic bad-output or failure path instead of the auth diagnostic. That changes CLI behavior and diagnostics, which the task says must stay the same. The existing test at tests/test_runners.py:758 only covers 401 Unauthorized, which is why this passes. Fix: add |unauthori[sz]ed.*\b401\b back into the alternation, and add a parametrized case such as Unauthorized (401).

Comment thread src/loopzero/candidate.py
repository=repository,
expected_identity=expected_identity,
)
def recheck_candidate(message: str = "GitHub candidate lookup returned an invalid payload") -> None:

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: Nested recheck_candidate has no blank line before it and a loose message parameter

def recheck_candidate(message=...) comes straight after the candidate_path assignment with no blank line, and its message changes between call sites (the default versus "Invalid candidate lookup"). The behavior is the same as before, but splitting one diagnostic across a default argument is easy to get wrong in later edits. Consider adding a blank line before the def, and either use one message everywhere if the tests allow it, or pass the message explicitly at every call site.

Architecture-Review: unchanged; the original provider authentication diagnostics remain intact.

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 4c95f3b58b27379e449d7fcf5407823d2d756e22, 13.9s: 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)

Findings without a file location:

  • suggestion: Add a test for the unauthorized … 401 ordering this commit restores — This commit puts back the unauthori[sz]ed.*\b401\b alternative. A deduplication pass dropped it once without anything failing, because test_auth_phrases_only_fail_on_nonzero_exit only checks "401 Unauthorized". If it gets dropped again, a codex stderr such as Unauthorized (HTTP 401) would no longer count as an auth failure. It would show up as a generic runner error, not RunnerAuthFailed. Smallest fix: add ("codex", "Unauthorized: HTTP 401") to that parametrize list. The other changes in this diff are safe: moving login required doesn't change what the regex matches, and the line count stays the same, so the net-reduction target isn't affected.

Native Claude output is retained in the restricted local review receipt.

@eowca
eowca marked this pull request as ready for review November 26, 2026 07:00
@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 ef5d13c at 07:08 UTC

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

So far

  • ✅ Entered the queue Thu 26 Nov, 07:01 · rule main · triggered by @eowca with the @mergifyio queue command
  • ✅ Passed · draft #1582
  • ✅ Merged 07:08 · ef5d13c · 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 ef5d13c 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-part-2 branch November 26, 2026 07:08
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