package wire import "time" // Merge authority (spec docs/superpowers/specs/2026-11-11-equipo-merge- // authority.md): cards, choices, tools and the API shapes. // Cards. A merge receipt says Equipo merged on its own, with Undo when // the merge SHA is the hub's word; the ships card asks once per project // whether merging to main ships to users; the policy card confirms a // change the coordinator proposed that would loosen the policy. const ( CardMergeReceipt = "merge_receipt" CardMergeShips = "merge_ships" CardMergePolicy = "merge_policy" // CardUndoneMerge is a receipt's state once Undo opened the revert. CardUndoneMerge = "undone" ) // Choices. const ( ChoiceWaitMac = "wait_mac" ChoiceShips = "ships" ChoiceNotShips = "not_ships" ChoiceSave = "save" ChoiceCancel = "cancel" ) // Coordinator tools: hold_merge stops Equipo merging a task on its own; // set_merge_policy proposes a project's policy (tighter applies at once, // looser needs the person's tap). const ( ToolHoldMerge = "hold_merge" ToolSetMergePolicy = "set_merge_policy" ) // Merge policy bounds on the wire. const ( MaxMergeWords = 300 MaxMergeHold = 200 ) // MergeDecision is the newest decision on a task's merge, as the task // shows it: the class, Equipo's stance and every criterion. type MergeDecision struct { Class string `json:"class"` Stance string `json:"stance,omitempty"` DecidedBy string `json:"decided_by,omitempty"` Reasons []MergeCriterion `json:"reasons"` At time.Time `json:"at"` } // MergeCriterion is one rule's outcome. type MergeCriterion struct { Name string `json:"name"` OK bool `json:"ok"` Value string `json:"value,omitempty"` } // MergePolicy is a project's merge policy (GET/PUT // /api/v1/projects/{id}/merge-policy). type MergePolicy struct { ProjectID string `json:"project_id"` Mode string `json:"mode"` ModeReason string `json:"mode_reason"` MaxLines int `json:"max_lines"` MaxFiles int `json:"max_files"` MainShips string `json:"main_ships"` ExtraSensitive []string `json:"extra_sensitive"` Words string `json:"words"` Revision int64 `json:"revision"` Editable bool `json:"editable"` Decisions []MergeDecision `json:"decisions"` } // SetMergePolicy is PUT /api/v1/projects/{id}/merge-policy: the whole // policy at Revision. type SetMergePolicy struct { Mode string `json:"mode"` MaxLines int `json:"max_lines"` MaxFiles int `json:"max_files"` MainShips string `json:"main_ships"` ExtraSensitive []string `json:"extra_sensitive"` Words string `json:"words"` Revision int64 `json:"revision"` } // UndoMerge is POST /api/v1/tasks/{id}/undo-merge: the receipt's // revision as the person saw it. type UndoMerge struct { Revision int64 `json:"revision"` }