package schedule import "testing" func TestCopyHardTierCeiling(t *testing.T) { s := Step{Role: "copy", Priority: Urgent, Release: "owner"} strong := metered("strong", 0, glm53) if d := Decide(in(s, strong)); d.Run { t.Fatalf("Copy ran strong model: %+v", d) } sub := sub("subscription", "claude") if d := Decide(in(s, sub)); d.Run { t.Fatalf("Copy ran unclassified subscription: %+v", d) } c := metered("standard", 0, glm53, glm52) if d := Decide(in(s, c)); !d.Run || d.Model != glm52.ID { t.Fatalf("standard unavailable: %+v", d) } c = metered("full", 900000, glm52) if d := Decide(in(s, c)); d.Run { t.Fatalf("Copy exceeded spend-derived cheap cap: %+v", d) } } func TestReviewAvoidsCopyFamily(t *testing.T) { s := Step{Role: RoleReview, Engineer: &Engineer{ID: "eng", Family: "claude", Families: []string{"codex"}}} d := Decide(in(s, sub("copy", "codex"), sub("other", "other"))) if !d.Run || d.Connection != "other" { t.Fatalf("Copy family labelled independent: %+v", d) } } func TestCopyKnownSubscriptionTier(t *testing.T) { m, ok := CopySubscriptionModel("claude", "claude-haiku-5-5") if !ok || m.Tier != TierCheap { t.Fatal("known cheap subscription unclassified") } c := sub("haiku", "claude") c.Models = []Model{m} if d := Decide(in(Step{Role: "copy"}, c)); !d.Run { t.Fatalf("cheap subscription held: %+v", d) } if _, ok := CopySubscriptionModel("claude", "unclassified-next-model"); ok { t.Fatal("unknown subscription classified") } }