Skip to content

Review base merge resolutions in the available delta - #1259

Closed
eowca wants to merge 8 commits into
mainfrom
lean178/1240-conflict-merge-delta
Closed

eowca wants to merge 8 commits into
mainfrom
lean178/1240-conflict-merge-delta

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Review base merge resolutions in the available delta

Context and goal

An approved PR with a remaining delta round can be blocked when main introduces a conflict. On #1583, the resolution passed its tests, but the review CLI rejected the merge before invoking a reviewer.

Closes #1240

Acceptance

  • Verify that the reviewed commit is on the first-parent history and each merged parent comes from the live configured base. Reject unverified or incomplete history before invoking a reviewer.
  • Send the existing delta runner topic patches and changes from each automatic remerge to the recorded merge tree. Include conflict resolutions and exclude unrelated base changes.
  • Bind new review evidence to the resolved head. Keep inherited approval and finding checks for verified clean base merges.

Notes

The regression test inspects the actual patch sent to the reviewer and checks readiness before and after the resolved head receives review. This change preserves the two-round review budget.

Review

eowca and others added 4 commits November 26, 2026 01:59
Co-Authored-By: Codex <noreply@openai.com>
Architecture-Review: unchanged; the prior documentation update still describes delta validation and inherited coverage.
Co-Authored-By: Codex <noreply@openai.com>
eowca and others added 3 commits November 26, 2026 08:32
Co-Authored-By: Codex <noreply@openai.com>
Architecture-Review: unchanged; the no-delta check moves inside delta patch 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 7b9c73c482da53c825860b29e624ba2620b183ff, 62.7s: 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.

return None
if clean:
return b""
patch = git("log", "--first-parent", "--reverse", "--remerge-diff", "-p", "--format=",

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: Merge-delta patch drops --ignore-submodules=none, unlike diff_since

worktree.diff_since (worktree.py:252) passes --ignore-submodules=none so that submodule pointer changes stay in the reviewer material even if .gitmodules sets ignore=. The new git log --first-parent --remerge-diff -p ... call passes --submodule=short but leaves out --ignore-submodules=none. As a result, the two delta paths can disagree about what counts as a change: a topic commit or resolution that moves a submodule with an ignore setting could be left out of the merge-path patch. Smallest fix: add --ignore-submodules=none (and --no-color for parity) to the log arguments.

Comment thread src/loopzero/cli.py
return worktree.diff_since(wt, since)
patch = (eligibility.base_merge_material(config.repo, number, since, head, config.base_branch, clean=False)
if number is not None else None)
if patch is 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: Transient fetch/API failures produce advice to rewrite history

base_merge_material returns None for every exception it catches: GhError, CandidateError from the time, size or output bounds of fetched_git, OSError, and so on. _delta_patch then always raises "could not verify merge history … Save your work, then replay the fixes on the reviewed head". A network blip, a timeout or a delta over 8 MiB therefore tells the user to discard a valid conflict resolution and replay their work, which uses up the round the change is meant to protect. Smallest fix: have base_merge_material tell a failed check apart from an infrastructure error, for example by letting GhError/CandidateError propagate when clean=False, or by returning a reason. Then _delta_patch can suggest a retry in that case. The clean=True readiness path can keep failing closed.

Comment thread src/loopzero/cli.py
)
if allowed != kind:
raise CliError("saved review kind differs from the remaining review budget")
_delta_patch(wt, config, reviewed, head, pr.number)

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: Repost re-verifies merge history but discards the patch

On --repost, _delta_patch runs only as a gate: it does a full isolated fetch and remerge, then throws the result away. It does not compare the patch with what the saved review actually saw, even though Codex evidence records diff_sha256. Either compare the hash when it is available, or add a comment that this call is only an ancestry/base-provenance check. Otherwise a later reader may assume repost binds the saved review to the current material.

Architecture-Review: unchanged; the delta retains pointer changes just as the ordinary diff does.

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

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Primary review disposition: 595b57fcb forces submodule pointer changes into the patch, matching ordinary review, and the regression now exercises a pointer declared with ignore = all. I’m deferring more granular fetch diagnostics. Repost continues to revalidate live base provenance and use the saved exact-head review evidence. A new hash requirement would change the evidence contract, so this PR leaves it out.

@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 595b57fcbcb1eddf7131cea403d0da16264c0f39, 14.2s: 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.

return None
if clean:
return b""
patch = git("log", "--first-parent", "--reverse", "--remerge-diff", "-p", "--format=",

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: Diff hardening flags are now copied in three places

The flag set --no-color --no-ext-diff --no-textconv --text --ignore-submodules=none --submodule=short now appears in three places: here, in worktree.py:252-253, and as the allow-list in runners.py:816-817. This delta had to add --no-color and --ignore-submodules=none here by hand to match worktree.py. That shows how the copies drift: if one changes later, the topic delta and the merge delta can render submodules or textconv content differently, or the runner can reject commands it should allow. Suggested fix: define one REVIEW_DIFF_FLAGS tuple, for example in worktree.py, and use it in all three places. This isn't blocking because all three copies match today.

@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Delta review disposition: both patch commands now use the same hardening flags, and the regression asserts that submodule pointers reach the reviewer. I’m deferring centralization of the flags to preserve the approved head and avoid coupling the patch builder with the evidence allow-list in this change.

@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #1663 for #1240, carrying the approved patch onto current main and preserving #1559’s hosted outage handling.

@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.

review trust: Review conflict resolutions in the available delta

1 participant