Files
Agent-System/internal/bizdev/rdev_flow_test.go
T
weichenandCursor 37b1aaa3ae feat(rdev): add medical design-control workflow (13 stages / 60 docs)
Seed rdev.v2.json, rd_ templates, catalog policy (order 40), squad
kind orchestration, and hard precheck requiring completed main (CDO).
Includes StageKey dynamicization from P0 and docs for P2–P4 skeleton.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 09:46:26 +00:00

45 lines
1.2 KiB
Go

package bizdev
import (
"context"
"errors"
"strings"
"testing"
"chat-agent-system/internal/config"
"chat-agent-system/internal/projectworkflow"
"chat-agent-system/internal/squad"
)
// TestRDev_PrecheckAndKindOrchestration 覆盖 rdev 硬门禁与 kind 编排(stub,无真实 PI)。
func TestRDev_PrecheckAndKindOrchestration(t *testing.T) {
cfg := &config.Config{DataDir: t.TempDir(), AllowInMemory: true, AgentBackend: "stub"}
svc, err := NewService(cfg)
if err != nil {
t.Fatal(err)
}
_, err = svc.ExecuteTask(context.Background(), TaskRunRequest{
TaskKey: "rd_proposal",
ProjectID: 9001,
Backend: "stub",
WorkDir: t.TempDir(),
})
if err == nil || !errors.Is(err, projectworkflow.ErrPrerequisiteNotMet) {
t.Fatalf("want ErrPrerequisiteNotMet, got %v", err)
}
if !strings.Contains(err.Error(), "CDO") {
t.Fatalf("message: %v", err)
}
if n := len(squad.DefaultWorkflowSteps("rd_proposal")); n < 4 {
t.Fatalf("document steps=%d", n)
}
if n := len(squad.DefaultWorkflowSteps("rd_planning_review")); n != 3 {
t.Fatalf("review steps=%d", n)
}
if n := len(squad.DefaultWorkflowSteps("rd_prototype_photos")); n != 4 {
t.Fatalf("upload steps=%d", n)
}
}