Document the v2 operator migration

This commit is contained in:
2026-09-07 04:55:13 +00:00
parent 2b97ef3722
commit a4f37ff427
19 changed files with 263 additions and 74 deletions

View File

@@ -285,15 +285,19 @@ func TestExamplesLoadAndValidate(t *testing.T) {
t.Fatalf("load split bundle campaign: %v", err)
}
for _, profile := range []struct {
name string
model string
name string
selection string
model string
}{
{name: "production", model: "narratio-production-model-placeholder"},
{name: "testing", model: "narratio-testing-model-placeholder"},
{name: "production base", model: "narratio-production-model-placeholder"},
{name: "testing", selection: "testing", model: "narratio-testing-model-placeholder"},
} {
t.Run(profile.name, func(t *testing.T) {
selected := profile.name
pipeline, err := LoadPipelineWithOptions(pipelinePath, PipelineLoadOptions{Profile: &selected})
options := PipelineLoadOptions{}
if profile.selection != "" {
options.Profile = &profile.selection
}
pipeline, err := LoadPipelineWithOptions(pipelinePath, options)
if err != nil {
t.Fatalf("load split bundle pipeline: %v", err)
}
@@ -314,10 +318,16 @@ func TestExamplesLoadAndValidate(t *testing.T) {
if cfg.Pipeline.Audita.LLMAPIKey != nil || cfg.Pipeline.Storage.Backend != StorageBackendLocal || cfg.Pipeline.Storage.S3 != nil {
t.Fatalf("split bundle must remain offline and secret-free: audita=%#v storage=%#v", cfg.Pipeline.Audita, cfg.Pipeline.Storage)
}
if selectedProfile, ok := SelectedPipelineProfile(cfg.Pipeline); !ok || selectedProfile.Name != profile.name {
t.Fatalf("selected profile = %#v, want %q", selectedProfile, profile.name)
selectedProfile, selected := SelectedPipelineProfile(cfg.Pipeline)
if profile.selection == "" && selected {
t.Fatalf("production base unexpectedly selected profile %#v", selectedProfile)
}
if profile.selection != "" && (!selected || selectedProfile.Name != profile.selection) {
t.Fatalf("selected profile = %#v, want %q", selectedProfile, profile.selection)
}
for _, key := range []string{
"session_recap",
"player_handout",
"character_meta_arannis",
"character_meta_brenna",
"character_items_arannis",
@@ -330,6 +340,12 @@ func TestExamplesLoadAndValidate(t *testing.T) {
if got := cfg.Pipeline.Scriptorium.Artifacts["character_items_arannis"].Inputs["character_meta"].Source; got != "narratio.artifact.character_meta_arannis" {
t.Fatalf("same-member input source = %q", got)
}
if got := cfg.Pipeline.Scriptorium.Artifacts["player_handout"].DependsOn; !reflect.DeepEqual(got, []string{"session_recap"}) {
t.Fatalf("input-only artifact dependency = %#v", got)
}
if got := cfg.Pipeline.Scriptorium.Artifacts["character_items_arannis"].DependsOn; !reflect.DeepEqual(got, []string{"character_meta_arannis"}) {
t.Fatalf("family input dependency = %#v", got)
}
if cfg.Party.Canonical == nil || len(cfg.Party.Canonical.Characters) != 2 {
t.Fatalf("canonical party = %#v", cfg.Party)
}
@@ -340,7 +356,18 @@ func TestExamplesLoadAndValidate(t *testing.T) {
if len(cfg.Pipeline.Publish.Outputs) != 3 {
t.Fatalf("publish outputs = %#v, want transcript plus two family outputs", cfg.Pipeline.Publish.Outputs)
}
if profile.name == "testing" {
catalog, err := EffectiveArtifactCatalog(cfg.Pipeline, cfg.Party)
if err != nil {
t.Fatal(err)
}
wantCatalogSize := 6
if profile.selection == "testing" {
wantCatalogSize++
}
if len(catalog) != wantCatalogSize {
t.Fatalf("effective artifact catalog has %d records, want %d", len(catalog), wantCatalogSize)
}
if profile.selection == "testing" {
artifact, exists := cfg.Pipeline.Scriptorium.Artifacts["testing_notes"]
if !exists || artifact.Enabled {
t.Fatalf("testing-only disabled artifact = %#v", artifact)