Merge pull request 'feat: require live PR head re-pin before conflict-fix classification (Closes #522)' (#563) from feat/issue-522-conflict-fix-classification into master

This commit was merged in pull request #563.
This commit is contained in:
2026-07-09 07:41:33 -05:00
7 changed files with 505 additions and 1 deletions
+35
View File
@@ -827,6 +827,7 @@ import reconciliation_workflow # noqa: E402
import audit_reconciliation_mode # noqa: E402
import review_merge_state_machine # noqa: E402
import pr_work_lease # noqa: E402
import conflict_fix_classification # noqa: E402
import native_mcp_preference # noqa: E402
import master_parity_gate # noqa: E402
@@ -8335,6 +8336,40 @@ def gitea_acquire_conflict_fix_lease(
}
@mcp.tool()
def gitea_assess_conflict_fix_classification(
pr_number: int,
inventory_head_sha: str | None = None,
inventory_mergeable: bool | None = None,
live_head_sha: str | None = None,
live_mergeable: bool | None = None,
) -> dict:
"""Read-only: classify conflict-fix need from live PR state (#522).
Open PR inventory can be stale. Callers must pass a live re-fetched PR head
and mergeability value before creating a conflict-fix worktree.
"""
read_block = _profile_operation_gate("gitea.read")
if read_block:
return {
"success": False,
"performed": False,
"reasons": read_block,
"permission_report": _permission_block_report("gitea.read"),
}
result = conflict_fix_classification.assess_conflict_fix_classification(
pr_number=pr_number,
inventory_head_sha=inventory_head_sha,
inventory_mergeable=inventory_mergeable,
live_head_sha=live_head_sha,
live_mergeable=live_mergeable,
)
result["success"] = True
result["performed"] = False
return result
@mcp.tool()
def gitea_assess_conflict_fix_push(
pr_number: int,