Data Model: Squash Merge Target Safety

Entities

BranchIntegrationRequest

FieldTypeMeaning
source_branchstringMission integration branch.
target_branchstringPersisted mission target branch.
strategyMergeStrategysquash, merge, or rebase.
modeenumPreview or execute.

SquashSimulation

FieldTypeMeaning
worktree_pathtemporary pathDetached checkout at the target tip.
target_sha_beforeobject idAtomicity anchor.
merge_commandargvNormal git merge --squash <source>, without a blanket conflict preference.
unmerged_pathsordered tuple of pathsPaths Git could not reconcile.
resolved_planning_pathsordered tuple of pathsConflicts resolved by the existing target-newer planning authority.

BranchIntegrationBlocker

FieldTypeMeaning
diagnostic_codestringStable machine-readable blocker identifier.
source_branchstringMission branch that would be integrated.
target_branchstringProtected target branch.
conflicting_pathsordered tuple of pathsRemaining ungoverned conflicts.
remediationlist of stringsOperator-visible next actions.

Relationships and invariants

1. A BranchIntegrationRequest creates exactly one isolated SquashSimulation when the selected strategy is squash and both refs exist. 2. A simulation may delegate only registered artifact paths to custom merge drivers and target-newer PRIMARY planning paths to the planning-recency authority. 3. Any remaining unmerged_paths produce a BranchIntegrationBlocker. 4. Preview always discards the simulation and never advances a ref. 5. Execute commits and advances the target only when no blocker exists. 6. Conflict leaves the source ref, target ref, primary checkout bytes, WP states, lane branches, and lane worktrees unchanged.