Feat v0.9.6 deprecate stage_type, collapse stage_mode

stage_type no longer validated — starlark_hook presence determines
automation. stage_mode collapsed from 4→3 values (form/delegated/
automated); "review" mapped to "form" on input for backward compat.
Migration 018 converts existing rows. Review surface removed (~110
lines). 4 package manifests updated.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-03 17:41:55 +00:00
parent 75d7abc089
commit 446edb8333
25 changed files with 121 additions and 224 deletions

View File

@@ -56,9 +56,9 @@ type WorkflowStage struct {
Name string `json:"name"`
AssignmentTeamID *string `json:"assignment_team_id,omitempty"`
FormTemplate json.RawMessage `json:"form_template"`
StageMode string `json:"stage_mode"` // form | review | delegated | automated
StageMode string `json:"stage_mode"` // form | delegated | automated
Audience string `json:"audience"` // team | public | system
StageType string `json:"stage_type"` // simple | dynamic | automated
StageType string `json:"stage_type"` // deprecated — retained for backward compatibility
AutoTransition bool `json:"auto_transition"`
StageConfig json.RawMessage `json:"stage_config"`
BranchRules json.RawMessage `json:"branch_rules"`
@@ -72,7 +72,6 @@ type WorkflowStage struct {
const (
StageModeForm = "form"
StageModeReview = "review"
StageModeDelegated = "delegated"
StageModeAutomated = "automated"
)
@@ -80,12 +79,22 @@ const (
// ValidStageModes is the set of valid stage_mode values.
var ValidStageModes = map[string]bool{
StageModeForm: true,
StageModeReview: true,
StageModeDelegated: true,
StageModeAutomated: true,
}
// ── Stage Type Constants ────────────────────
// NormalizeStageModeInput maps deprecated stage_mode values to their
// replacements. "review" → "form"; all others pass through unchanged.
func NormalizeStageModeInput(mode string) string {
if mode == "review" {
return StageModeForm
}
return mode
}
// ── Stage Type Constants (deprecated) ───────
// stage_type is redundant with starlark_hook presence and is no longer
// validated. Constants are retained for backward-compatible references.
const (
StageTypeSimple = "simple"
@@ -93,13 +102,6 @@ const (
StageTypeAutomated = "automated"
)
// ValidStageTypes is the set of valid stage_type values.
var ValidStageTypes = map[string]bool{
StageTypeSimple: true,
StageTypeDynamic: true,
StageTypeAutomated: true,
}
// ── Audience Constants ──────────────────────
const (