Skip to content

Reduce duplicated delivery source - #1558

Closed
eowca wants to merge 5 commits into
mainfrom
lean178/575-source-dedupe
Closed

eowca wants to merge 5 commits into
mainfrom
lean178/575-source-dedupe

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Reduce duplicated delivery source

Context and goal

  • Goal: Free at least 250 source lines for the parked delivery wave while preserving observable CLI behavior.
  • Problem: The projected post-raise queue consumes the available source budget.
  • Context: This slice owns CLI, GitHub, Mergify, configuration and eligibility code. Remove the unused receipt-backfill script #1464 owns the receipt-backfill script and its tests.

Refs #575

Acceptance

  • The repository size checker reports at least 250 net fewer source lines and no added test lines.
  • The existing full suite passes with its cases and assertions intact.
  • Public command output, exit codes, request order and write guards remain the same.
  • Report the actual textual conflicts with parked PRs only after comparing the final patch.

Notes

  • Assigned slice measures 7,824 → 7,684 source lines (−140) and 13,695 → 13,695 test lines. The second source-dedupe slice owns the remaining modules. No tests were added or altered.

  • Keep GitHub status, review and ownership evidence pinned to the same head and credential. Preserve parse failures, fail-closed guards, deadlines, exception handling and cleanup effects. Check review and queue overlap from the isolated plan snapshot.

Base

Base: 89788a4

Validation

Recorded for a49d20669a42 (not current head) (unverified, run loopzero check)

  • 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

eowca and others added 3 commits November 26, 2026 04:40
Architecture-Review: unchanged; the CLI keeps its public commands, read and write boundaries, receipt format, and policy checks.
Co-Authored-By: Codex <noreply@openai.com>
Architecture-Review: unchanged; the combined merge preserves the current base-conflict report and consolidates only request construction.
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 e7966bf061a21d61d61de0f92332bc3ae4ff166e, 59.6s: approve (0 critical, 0 important, 4 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: This slice alone does not meet the ≥250-line acceptance target — The task notes report this slice at 7,730 → 7,576 source lines (−154). The acceptance criterion asks for at least 250 net fewer source lines, so this PR only meets it if the second source-dedupe slice lands too. Smallest fix: state in the PR body that the 250-line target applies to the whole wave, or link the second slice, so readiness isn't judged on this PR alone.

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

Comment thread src/loopzero/github.py

def _branch_head(repo: str, branch: str) -> str | None:
endpoint = f"repos/{repo}/branches/{quote(branch, safe='')}"
def _ref_sha(endpoint: str, field: str) -> str | 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: _ref_sha picks one of two unrelated validation rules from the field string

_ref_sha(endpoint, "commit") requires a 40-hex SHA and fails with "invalid remote branch SHA". _ref_sha(endpoint, "object") accepts any non-empty string and fails with "missing remote ref SHA". Hiding both rules behind one string switch makes it easy for a future caller to pass the wrong field and get the weaker check without noticing. Behavior is unchanged today. Consider sharing only the fetch-or-404 step and keeping each validation at its call site, or passing the validator explicitly.

Comment thread src/loopzero/config.py
raise ConfigError(f"{path}: {exc}") from None


def run_git(worktree: Path, *args: str, timeout: float = 60) -> _proc.Completed:

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 shared git runner lives in config.py, so the CLI depends on config for unrelated git calls

run_git wraps _proc.run with worktree_mod.GIT_ENV. It is now used for all of the CLI's git plumbing (_git, _is_ancestor, _primary_base, cmd_start, cmd_pr, _refresh_pr_checks). Putting it in config.py ties those git calls to the config module, and its hardcoded default timeout of 60 only matches cli.GIT_TIMEOUT (60.0) by coincidence. Consider moving it to worktree next to GIT_ENV and taking the timeout from one shared constant.

Comment thread src/loopzero/github.py
changed file with a hunk, so every blocking finding creates a review thread.
A supplied publisher is the login already checked for the supplied token.
"""
"""Publish with the verified login for token. GitHub only permits self-reviews as comments."""

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: post_review docstring dropped documented fallback-anchoring behavior

The removed docstring explained that findings with a missing location, or one outside the diff, are anchored on the first changed file with a hunk, so every blocking finding creates a review thread. It also explained that pr is fetched when not given. The code still does this, but the new one-line docstring no longer says so. Consider keeping one sentence on the anchoring rule, since it is a non-obvious invariant that readers of this function rely on.

Architecture-Review: unchanged; this restores the original parser implementation before taking main’s entry-point split.
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 4235dbb0a5451e1f3d808444db6f13731702c518, 10.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)

Findings without a file location:

  • suggestion: Reverting the parser helper adds about 14 source lines back to this slice — This delta replaces the local command() helper with the original sub.add_parser(...) / set_defaults(func=...) calls. The two versions behave the same: subcommand order, names, help text, the resolve usage string, arguments and func bindings all match, and Callable is still used elsewhere in the file (lines 693 and 962). The cost is that cli.py gains about 14 net source lines, which works against this task's goal of freeing source lines. Because the commit hands parser setup to the main entry-point split, recheck the size figure in the task notes (7,730 → 7,576, −154) against the final tree. Also confirm that the other slice actually takes over this dedupe so the work isn't dropped by both slices.

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

@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Owner queue route: the full sandboxed check passed on dab5f913 after a clean merge from main, and both required hosted checks are green. The local receipt guard rejects the remote settings fingerprint. Mergify will verify the integration candidate. The updated patch removes 140 source lines because #1523 already replaced its parser setup.

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

🚫 Left the queue · queue conditions no longer match

3 min in the queue, with no time running CI.

So far

Reason

Pull request #1558 has been dequeued

Queue conditions are not satisfied:

  • -conflict [📌 queue requirement]

To get back in the queue

  • Push a change if one is needed: the pull request is queued again once its queue conditions match.
  • If no change is needed, comment @mergifyio queue to queue it again as it is.

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.

@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #1611. The replacement preserves #1525’s trusted policy reuse and carries the remaining source dedupe on current main for fresh review.

@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant