Parent epic: #338
Problem
A normal coding-agent workflow can contain both committed branch changes and uncommitted review follow-ups. When the same path appears in both the base-to-HEAD diff and the HEAD-to-worktree overlay, verification currently emits multiple records for that path and fails closed with SHIP-AGENT-BOUNDARY-INPUT-INCOMPLETE / boundary_diff_shape_invalid.
In a real issue-to-PR workflow, seven valid files were reported as seven human-review findings solely because each path appeared once in the committed branch diff and once in the worktree overlay. The user had to manually commit the follow-up before verification could produce a coherent result.
This is an input-normalization defect, not a semantic boundary risk.
User impact
- Coding agents are stopped during ordinary review-fix iterations.
- Users must understand Git diff internals and manually commit to repair verifier input.
- Identical root causes are emitted as many per-file human-review findings.
- A release-safety control creates a workflow deadlock instead of evaluating the effective change.
Proposed direction
Construct one deterministic effective-head snapshot and compare it once against the merge base. For example:
- Resolve the committed HEAD tree.
- Apply the index/worktree overlay to a temporary, content-addressed snapshot.
- Generate one merge-base-to-effective-head diff.
- Bind the overlay/snapshot identity into the verification request and receipt.
An equivalent deterministic per-path merge is acceptable if it correctly preserves add/delete/rename/mode semantics.
Acceptance criteria
Product principle
A valid coding-agent worktree is a first-class verification input, not an error state.
Problem
A normal coding-agent workflow can contain both committed branch changes and uncommitted review follow-ups. When the same path appears in both the base-to-HEAD diff and the HEAD-to-worktree overlay, verification currently emits multiple records for that path and fails closed with
SHIP-AGENT-BOUNDARY-INPUT-INCOMPLETE/boundary_diff_shape_invalid.In a real issue-to-PR workflow, seven valid files were reported as seven human-review findings solely because each path appeared once in the committed branch diff and once in the worktree overlay. The user had to manually commit the follow-up before verification could produce a coherent result.
This is an input-normalization defect, not a semantic boundary risk.
User impact
Proposed direction
Construct one deterministic effective-head snapshot and compare it once against the merge base. For example:
An equivalent deterministic per-path merge is acceptable if it correctly preserves add/delete/rename/mode semantics.
Acceptance criteria
boundary_diff_shape_invalid.--base ... --head ...verification behavior remains unchanged.Product principle
A valid coding-agent worktree is a first-class verification input, not an error state.