package operator import "testing" // Base joins canonical adoption (Paul, 2026-11-23: Base production at // https://base.oficina.works). A plan may adopt it into team oficina, alone // or with all seven other canonical apps, and the adoption binds only the // canonical host: never Base's old CARLOS host. func TestBaseIsAdoptableIntoTeamOficina(t *testing.T) { f := newHTTPDirectory(t) all := []string{"docs", "sheets", "slides", "calendar", "calls", "memoria", "equipo", "base"} for _, apps := range [][]string{{"base"}, all} { p := Plan{Version: 1, Purpose: "operator-plan", Role: "directory", Origin: f.engine.verifier.pins.Origin, Installation: token(1), Registry: token(2), Device: token(3), PlanID: token(4), Kind: "add-apps", Apps: apps, Label: "oficina", ExistingTeam: "Uk", Issued: f.now.Unix(), Expires: f.now.Unix() + PlanLifetime} set := map[string]bool{} for _, app := range all { set[app] = true } if !p.valid(set) { t.Fatalf("adoption of %v refused", apps) } } if !routeScope("Uk", "oficina", "Uk", "base", "base", "https://base.oficina.works") { t.Fatal("Base's canonical host refused") } for _, origin := range []string{"https://base.bds.oncarlos.com", "https://base.oficina.works/", "https://blue.base.oficina.works"} { if routeScope("Uk", "oficina", "Uk", "base", "base", origin) { t.Fatalf("adoption bound %s", origin) } } // Ordinary provisioning still never takes the canonical host. if routeScope("", "blue", "Bb", "base", "blue-base", "https://base.oficina.works") { t.Fatal("a new team took Base's canonical host") } }