Wire intent→coordinator DocResolver confirm cards→action_executor kinds for comment, reopen, pending-supplements query, and real submit-review execution.
75 lines
2.7 KiB
Go
75 lines
2.7 KiB
Go
package supplementimpact
|
|
|
|
import "time"
|
|
|
|
const (
|
|
StatusPending = "pending"
|
|
StatusDecided = "decided"
|
|
StatusRunning = "running"
|
|
StatusDone = "done"
|
|
StatusPartiallyDone = "partially_done"
|
|
StatusExpired = "expired"
|
|
StatusCancelled = "cancelled"
|
|
|
|
OutcomeApplied = "applied"
|
|
OutcomeProposalPending = "proposal_pending"
|
|
OutcomeProposalRejected = "proposal_rejected"
|
|
OutcomeSkippedBusy = "skipped_busy"
|
|
OutcomeSkippedLocked = "skipped_locked"
|
|
OutcomeFailed = "failed"
|
|
|
|
BatchTTL = 24 * time.Hour
|
|
)
|
|
|
|
// Batch is one supplement → impact analysis confirmation unit.
|
|
type Batch struct {
|
|
BatchID string `json:"batch_id"`
|
|
ProjectID int64 `json:"project_id"`
|
|
SessionID string `json:"session_id"`
|
|
InitiatorUserID int64 `json:"initiator_user_id"`
|
|
SourceKind string `json:"source_kind"`
|
|
SourceSummary string `json:"source_summary"`
|
|
CoverageStatus string `json:"coverage_status"`
|
|
Status string `json:"status"`
|
|
DecisionNonce string `json:"decision_nonce"`
|
|
DecisionDigest string `json:"decision_digest"`
|
|
Revision int64 `json:"revision"`
|
|
ExpiresAt time.Time `json:"expires_at"`
|
|
Items []Item `json:"items,omitempty"`
|
|
}
|
|
|
|
// Item is one affected document inside a batch.
|
|
type Item struct {
|
|
ID int64 `json:"id"`
|
|
BatchID string `json:"batch_id"`
|
|
DocID string `json:"doc_id"`
|
|
Title string `json:"title"`
|
|
ItemKey string `json:"item_key"`
|
|
ImpactType string `json:"impact_type"`
|
|
Depth int `json:"depth"`
|
|
Reason string `json:"reason"`
|
|
AuthorClaimedSnapshot bool `json:"author_claimed_snapshot"`
|
|
AuthorIDSnapshot int64 `json:"author_id_snapshot"`
|
|
BusySnapshot bool `json:"busy_snapshot"`
|
|
LockedSnapshot bool `json:"locked_snapshot"`
|
|
ReviewerIDSnapshot int64 `json:"reviewer_id_snapshot,omitempty"`
|
|
ApproverIDSnapshot int64 `json:"approver_id_snapshot,omitempty"`
|
|
CurrentStateSnapshot string `json:"current_state_snapshot,omitempty"`
|
|
ChangeSummary string `json:"change_summary"`
|
|
Selected bool `json:"selected"`
|
|
Outcome string `json:"outcome"`
|
|
ProposalID string `json:"proposal_id"`
|
|
RunID string `json:"run_id"`
|
|
}
|
|
|
|
// DecisionCommand is the confirm/cancel envelope (nonce+digest+revision CAS).
|
|
type DecisionCommand struct {
|
|
BatchID string
|
|
ActorUserID int64
|
|
Kind string // confirm | cancel
|
|
SelectedDocIDs []string
|
|
DecisionNonce string
|
|
DecisionDigest string
|
|
ExpectedRevision int64
|
|
}
|