Files
WeiCHEN ad96f67442 refactor(workflowdef): make definition/runtime deps unidirectional
Keep registry key validation local to workflowdef with composition-root
injection, adapt FlatCatalog for projectworkflow, and drive the
orchestrator through LiveInstancePort views instead of projectinstance.
2026-09-22 21:44:57 +08:00

52 lines
1.4 KiB
Go

package workflowdef
import "fmt"
// Local copies of workflow registry keys for publish-time validation.
// Kept here so workflowdef does not import internal/workflow (unidirectional).
// Runtime resolution remains owned by internal/workflow; keep these sets aligned.
var executorKeys = map[string]struct{}{
"bizdev.stage.v1": {},
"squad.system_reqs.v1": {},
"squad.test_manager.v1": {},
"squad.rdev_doc.v1": {},
"bizdev.intake.v1": {},
"bizdev.research.v1": {},
"bizdev.feasibility.v1": {},
"bizdev.feasibility_dev.v1": {},
"bizdev.user_requirements.v1": {},
"bizdev.prelim_design.v1": {},
"bizdev.cdo_quote.v1": {},
"software.doc.v1": {},
}
var qualityGateKeys = map[string]struct{}{
"quality.system_reqs.v2": {},
"quality.test_manager.v2": {},
"quality.generic.v1": {},
"quality.rd_user_needs.v1": {},
"quality.rd_system_reqs.v1": {},
"quality.rd_review_minutes.v1": {},
"quality.rd_upload_index.v1": {},
}
func defaultValidateExecutorKey(key string) error {
if key == "" {
return fmt.Errorf("executor_key required")
}
if _, ok := executorKeys[key]; !ok {
return fmt.Errorf("unknown executor_key %q", key)
}
return nil
}
func defaultValidateQualityGateKey(key string) error {
if key == "" {
return nil
}
if _, ok := qualityGateKeys[key]; !ok {
return fmt.Errorf("unknown quality_gate_key %q", key)
}
return nil
}