Update examples and tests for shared glossaries
This commit is contained in:
@@ -137,6 +137,7 @@ func TestRunArtifactsWithSucceededAnalyzeSkipsUnlessForced(t *testing.T) {
|
||||
seed.MarkStageSucceeded(stageName, time.Date(2026, 5, 3, 10, 1, 0, 0, time.UTC), nil)
|
||||
}
|
||||
seed.MarkStageSkipped("extract", time.Date(2026, 5, 3, 10, 1, 0, 0, time.UTC), "notarius_disabled")
|
||||
seedPolishGlossaryEvidence(t, workspaceRoot, seed)
|
||||
seedCurrentSemanticEvidence(t, loadConfigForSemanticEvidence(t, pipelinePath, campaignPath, sessionPath), seed, "prepare", "transcribe", "merge", "polish", "normalize", "trim", "render")
|
||||
if err := store.Save(context.Background(), manifestPath, seed); err != nil {
|
||||
t.Fatalf("save manifest: %v", err)
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/adapters/audita"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/adapters/scriptorium"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/adapters/storage"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/artifacts"
|
||||
@@ -20,6 +21,7 @@ import (
|
||||
|
||||
func TestAssembledFullRunUsesCanonicalOrder(t *testing.T) {
|
||||
cfg := testConfig(t)
|
||||
seedGlossaryManifest(t, cfg)
|
||||
canonical := []string{
|
||||
"prepare", "transcribe", "merge", "polish", "normalize", "trim",
|
||||
"render", "extract", "analyze", "publish", "notify", "cleanup",
|
||||
@@ -29,7 +31,7 @@ func TestAssembledFullRunUsesCanonicalOrder(t *testing.T) {
|
||||
for _, name := range canonical {
|
||||
stages = append(stages, resultStage{name: name, result: &stage.StageResult{}, order: &order})
|
||||
}
|
||||
summary, err := executeStages(context.Background(), cfg, stages, RunOptions{})
|
||||
summary, err := executeStages(context.Background(), cfg, stages, RunOptions{Env: &Env{Audita: &audita.FakeRunner{}}})
|
||||
if err != nil {
|
||||
t.Fatalf("executeStages() error = %v", err)
|
||||
}
|
||||
@@ -323,6 +325,7 @@ func TestAssembledSplitBundleProfileSwitchRecordsProvenanceAndLimitsReuse(t *tes
|
||||
providers := make([]stage.SemanticConfigFingerprinter, len(names))
|
||||
seed := manifest.New(production.Session.SessionID, time.Now().UTC())
|
||||
seed.Campaign = production.Session.Campaign
|
||||
seedGlossaryRecords(t, workspace, seed)
|
||||
for _, candidate := range stage.All() {
|
||||
seed.MarkStageSucceeded(candidate.Name(), time.Now().UTC(), nil)
|
||||
}
|
||||
@@ -352,7 +355,7 @@ func TestAssembledSplitBundleProfileSwitchRecordsProvenanceAndLimitsReuse(t *tes
|
||||
|
||||
testingRuns := make([]int, len(names))
|
||||
testingStages := assembledSemanticStages(names, providers, testingRuns)
|
||||
testingSummary, err := executeStages(context.Background(), testingCfg, testingStages, RunOptions{Env: &Env{Scriptorium: &scriptorium.FakeRunner{}}})
|
||||
testingSummary, err := executeStages(context.Background(), testingCfg, testingStages, RunOptions{Env: &Env{Audita: &audita.FakeRunner{}, Scriptorium: &scriptorium.FakeRunner{}}})
|
||||
if err != nil {
|
||||
t.Fatalf("switch to testing profile: %v", err)
|
||||
}
|
||||
|
||||
@@ -472,7 +472,7 @@ inputs:
|
||||
|
||||
mustWriteTestFile(t, filepath.Join(campaignDir, "speakers.yml"), "match:\n - speaker: Alice\n match: [\"alice\"]\n")
|
||||
mustWriteTestFile(t, filepath.Join(campaignDir, "autocorrect.yml"), "[]\n")
|
||||
mustWriteTestFile(t, filepath.Join(campaignDir, "glossary.yml"), "[]\n")
|
||||
mustWriteTestFile(t, filepath.Join(campaignDir, "glossary.yml"), "campaign: {entries: []}\n")
|
||||
mustWriteTestFile(t, filepath.Join(campaignDir, "party.yml"), "schema_version: narratio.party.v1\ncharacters:\n arannis:\n player: {name: Eric}\n character:\n name: Arannis\n classes: [{name: wizard}]\n")
|
||||
mustWriteTestFile(t, filepath.Join(dir, "audio", "alice.flac"), "audio-bytes")
|
||||
|
||||
@@ -702,12 +702,15 @@ func TestAuditaAppHelper(t *testing.T) {
|
||||
os.Exit(2)
|
||||
}
|
||||
processArgs := args[start:]
|
||||
if len(processArgs) < 2 || processArgs[0] != "process" {
|
||||
_, _ = os.Stderr.WriteString("expected Audita v2 process invocation\n")
|
||||
if len(processArgs) < 2 || (processArgs[0] != "process" && processArgs[0] != "preflight") {
|
||||
_, _ = os.Stderr.WriteString("expected Audita process or preflight invocation\n")
|
||||
os.Exit(2)
|
||||
}
|
||||
if processArgs[0] == "preflight" {
|
||||
os.Exit(0)
|
||||
}
|
||||
for _, arg := range processArgs {
|
||||
if arg == "--report-json" || arg == "--work-dir" || arg == "--debug" || arg == "--reporting=false" {
|
||||
if arg == "--report-json" || arg == "--debug" || arg == "--reporting=false" {
|
||||
_, _ = os.Stderr.WriteString("retired or unwanted Audita flag\n")
|
||||
os.Exit(2)
|
||||
}
|
||||
@@ -726,8 +729,12 @@ func TestAuditaAppHelper(t *testing.T) {
|
||||
_, _ = os.Stderr.WriteString(fmt.Sprintf("write output: %v\n", err))
|
||||
os.Exit(2)
|
||||
}
|
||||
reportDir := appSeriatimFlagValue(processArgs, "--report-dir")
|
||||
if err := os.MkdirAll(reportDir, 0o755); err != nil {
|
||||
os.Exit(2)
|
||||
}
|
||||
for _, name := range []string{"errors.yml", "recoveries.yml", "report.md"} {
|
||||
if err := os.WriteFile(filepath.Join(filepath.Dir(outputPath), name), []byte("status: completed\n"), 0o644); err != nil {
|
||||
if err := os.WriteFile(filepath.Join(reportDir, name), []byte("status: completed\n"), 0o644); err != nil {
|
||||
_, _ = os.Stderr.WriteString(fmt.Sprintf("write %s: %v\n", name, err))
|
||||
os.Exit(2)
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ func TestExtractLifecyclePrepareBindsVerifiedReferenceSnapshots(t *testing.T) {
|
||||
sourceID string
|
||||
filename string
|
||||
}{
|
||||
{selector: "glossary", sourceID: artifactpolicy.SourceInputGlossary, filename: "glossary.yml"},
|
||||
{selector: "glossary", sourceID: artifactpolicy.SourceInputGlossaryCampaign, filename: "campaign.yml"},
|
||||
{selector: "party", sourceID: artifactpolicy.SourceInputParty, filename: "party.yml"},
|
||||
{selector: "players", sourceID: artifactpolicy.SourceInputPlayers, filename: "players.yml"},
|
||||
{selector: "spells", sourceID: artifactpolicy.SourceInputSpellCatalog, filename: "spell_catalog.json"},
|
||||
@@ -182,11 +182,11 @@ func TestExtractLifecyclePrepareBindsVerifiedReferenceSnapshots(t *testing.T) {
|
||||
loaded := loadLifecycleManifest(t, cfg)
|
||||
for index, expected := range want {
|
||||
binding := request.References[index]
|
||||
canonical := filepath.Join(paths.InputsDir, expected.filename)
|
||||
descriptor, ok := artifactpolicy.DescribePreparedInputSource(expected.sourceID)
|
||||
if !ok {
|
||||
t.Fatalf("DescribePreparedInputSource(%q) ok = false", expected.sourceID)
|
||||
}
|
||||
canonical := filepath.Join(paths.InputsDir, descriptor.Filename)
|
||||
snapshot, err := artifacts.SessionNotariusReferenceSnapshotPath(
|
||||
paths, lifecycleInputChecksum(t, loaded, descriptor.ManifestKind), expected.filename,
|
||||
)
|
||||
@@ -1085,7 +1085,7 @@ func configureLifecycleReferences(t *testing.T, cfg *config.Config) map[string]s
|
||||
cfg.Pipeline.Notarius.References = map[string]string{
|
||||
"party": artifactpolicy.SourceInputParty,
|
||||
"players": artifactpolicy.SourceInputPlayers,
|
||||
"glossary": artifactpolicy.SourceInputGlossary,
|
||||
"glossary": artifactpolicy.SourceInputGlossaryCampaign,
|
||||
"spells": artifactpolicy.SourceInputSpellCatalog,
|
||||
}
|
||||
spellPath := filepath.Join(filepath.Dir(cfg.CampaignPath), "spells.json")
|
||||
@@ -1098,10 +1098,10 @@ func configureLifecycleReferences(t *testing.T, cfg *config.Config) map[string]s
|
||||
cfg.Session.Inputs.SpellCatalogFile = "./spells.json"
|
||||
|
||||
return map[string]string{
|
||||
artifactpolicy.SourceInputParty: filepath.Join(filepath.Dir(cfg.CampaignPath), "party.yml"),
|
||||
artifactpolicy.SourceInputPlayers: filepath.Join(filepath.Dir(cfg.CampaignPath), "players.yml"),
|
||||
artifactpolicy.SourceInputGlossary: filepath.Join(filepath.Dir(cfg.CampaignPath), "glossary.yml"),
|
||||
artifactpolicy.SourceInputSpellCatalog: spellPath,
|
||||
artifactpolicy.SourceInputParty: filepath.Join(filepath.Dir(cfg.CampaignPath), "party.yml"),
|
||||
artifactpolicy.SourceInputPlayers: filepath.Join(filepath.Dir(cfg.CampaignPath), "players.yml"),
|
||||
artifactpolicy.SourceInputGlossaryCampaign: filepath.Join(filepath.Dir(cfg.CampaignPath), "glossary.yml"),
|
||||
artifactpolicy.SourceInputSpellCatalog: spellPath,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,13 +6,17 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/artifactpolicy"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/artifacts"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/config"
|
||||
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/manifest"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/stage"
|
||||
"go.maximumdirect.net/commandkit"
|
||||
)
|
||||
|
||||
@@ -81,11 +85,62 @@ func seedInvocationPrerequisites(t *testing.T, root, selected string) {
|
||||
m.Campaign = "sample-campaign"
|
||||
}
|
||||
markFixturePrerequisites(t, m, selected)
|
||||
if selected == "polish" {
|
||||
seedGlossaryRecords(t, root, m)
|
||||
}
|
||||
if err := store.Save(context.Background(), path, m); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func seedGlossaryRecords(t *testing.T, root string, m *manifest.Manifest) {
|
||||
t.Helper()
|
||||
store := artifacts.NewLocalStore(root)
|
||||
paths, err := store.EnsureLayoutFor("sample-campaign", "2026-05-03")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for _, descriptor := range artifactpolicy.GlossaryInputSources() {
|
||||
found := false
|
||||
for _, input := range m.Inputs {
|
||||
if input.Kind == descriptor.ManifestKind {
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if found {
|
||||
continue
|
||||
}
|
||||
path := filepath.Join(paths.InputsDir, descriptor.Filename)
|
||||
mustWriteTestFile(t, path, "synthetic: {entries: []}\n")
|
||||
checksum, err := store.Checksum(path)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
m.Inputs = append(m.Inputs, manifest.InputRecord{Kind: descriptor.ManifestKind, Path: path, Checksum: checksum})
|
||||
}
|
||||
}
|
||||
|
||||
func seedPolishGlossaryEvidence(t *testing.T, root string, m *manifest.Manifest) {
|
||||
t.Helper()
|
||||
paths := artifacts.NewLocalStore(root).SessionPathsFor("sample-campaign", "2026-05-03")
|
||||
_, evidence, err := stage.BuildPolishRequest(paths, m, "", filepath.Join(paths.Root, "scratch", "polished.json"), filepath.Join(paths.Root, "scratch", "logs"), filepath.Join(paths.Root, "scratch", "debug"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
m.Stages["polish"].Metadata = map[string]any{"glossary_evidence": evidence}
|
||||
}
|
||||
|
||||
func seedGlossaryManifest(t *testing.T, cfg *config.Config) {
|
||||
t.Helper()
|
||||
m := manifest.New(cfg.Session.SessionID, time.Now().UTC())
|
||||
m.Campaign = cfg.Session.Campaign
|
||||
seedGlossaryRecords(t, cfg.Pipeline.Workspace.Root, m)
|
||||
if err := (&manifest.LocalStore{}).Save(context.Background(), manifestPathFor(cfg), m); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func findingMatches(findings []finding, severity, category, message string) bool {
|
||||
for _, item := range findings {
|
||||
if (severity == "" || item.Severity == severity) && item.Category == category && strings.Contains(item.Message, message) {
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/adapters/audita"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/adapters/scriptorium"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/adapters/storage"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/artifactmodel"
|
||||
@@ -441,11 +442,12 @@ inputs:
|
||||
`), 0o644); err != nil {
|
||||
t.Fatalf("write session: %v", err)
|
||||
}
|
||||
seedValidationPrepared(t, &config.Config{Pipeline: &config.PipelineConfig{Workspace: config.WorkspaceConfig{Root: workspaceRoot}}, Session: &config.SessionConfig{Campaign: "sample-campaign", SessionID: "2026-05-03"}})
|
||||
|
||||
fake := &storage.FakeBackend{}
|
||||
audioKey := artifacts.S3PublishedOutputKey(artifacts.S3AudioPrefix(artifacts.S3SessionPrefix("dnd", "sample-campaign", "2026-05-03"), "audio/"), "alice.flac")
|
||||
fake.SeedObject(storage.FakeObject{Key: audioKey, Data: []byte("audio")})
|
||||
deps := commandDependencies{newScriptorium: func() scriptorium.Runner { return &scriptorium.FakeRunner{} }, newObjectStore: func(context.Context, *config.Config) (storage.ObjectStore, error) {
|
||||
deps := commandDependencies{newAudita: func(*config.Config) (audita.Runner, error) { return &audita.FakeRunner{}, nil }, newScriptorium: func() scriptorium.Runner { return &scriptorium.FakeRunner{} }, newObjectStore: func(context.Context, *config.Config) (storage.ObjectStore, error) {
|
||||
if os.Getenv(accessKeyEnv) != "test-key-id" || os.Getenv(secretKeyEnv) != "test-secret" {
|
||||
return nil, fmt.Errorf("secrets were not loaded before object store init")
|
||||
}
|
||||
@@ -479,6 +481,7 @@ func TestOperatorCommandsReportConfiguredSpellCatalog(t *testing.T) {
|
||||
}
|
||||
spellPath := filepath.Join(filepath.Dir(campaignPath), "spells.json")
|
||||
mustWriteTestFile(t, spellPath, "{\"spells\":[]}\n")
|
||||
seedValidationPrepared(t, loadConfigForSemanticEvidence(t, pipelinePath, campaignPath, sessionPath))
|
||||
|
||||
fake := &storage.FakeBackend{}
|
||||
var storeInitCalls int
|
||||
|
||||
@@ -234,11 +234,14 @@ func TestProviderCredentialProcessFixture(t *testing.T) {
|
||||
os.Exit(0)
|
||||
}
|
||||
switch args[0] {
|
||||
case "process":
|
||||
case "process", "preflight":
|
||||
if os.Getenv(auditaOnlyName) != auditaOnlyKey {
|
||||
_, _ = os.Stderr.WriteString("Audita-only credential not forwarded\n")
|
||||
os.Exit(2)
|
||||
}
|
||||
if args[0] == "preflight" {
|
||||
os.Exit(0)
|
||||
}
|
||||
output := appSeriatimFlagValue(args, "--output")
|
||||
if output == "" {
|
||||
os.Exit(2)
|
||||
@@ -249,8 +252,12 @@ func TestProviderCredentialProcessFixture(t *testing.T) {
|
||||
if err := os.WriteFile(output, []byte(`{"schema":"audita.processed.v1","segments":[]}`), 0o644); err != nil {
|
||||
os.Exit(2)
|
||||
}
|
||||
reportDir := appSeriatimFlagValue(args, "--report-dir")
|
||||
if err := os.MkdirAll(reportDir, 0o755); err != nil {
|
||||
os.Exit(2)
|
||||
}
|
||||
for _, name := range []string{"errors.yml", "recoveries.yml", "report.md"} {
|
||||
if err := os.WriteFile(filepath.Join(filepath.Dir(output), name), []byte("status: completed\n"), 0o644); err != nil {
|
||||
if err := os.WriteFile(filepath.Join(reportDir, name), []byte("status: completed\n"), 0o644); err != nil {
|
||||
os.Exit(2)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/adapters/audita"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/adapters/scriptorium"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/adapters/storage"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/artifacts"
|
||||
@@ -451,7 +452,7 @@ func remoteSessionLoaderDependencies(fake *storage.FakeBackend) (commandDependen
|
||||
}
|
||||
|
||||
func fakeCommandDependencies(fake *storage.FakeBackend, storeInitCalls *int) commandDependencies {
|
||||
return commandDependencies{newScriptorium: func() scriptorium.Runner { return &scriptorium.FakeRunner{} }, newObjectStore: func(context.Context, *config.Config) (storage.ObjectStore, error) {
|
||||
return commandDependencies{newAudita: func(*config.Config) (audita.Runner, error) { return &audita.FakeRunner{}, nil }, newScriptorium: func() scriptorium.Runner { return &scriptorium.FakeRunner{} }, newObjectStore: func(context.Context, *config.Config) (storage.ObjectStore, error) {
|
||||
if storeInitCalls != nil {
|
||||
*storeInitCalls++
|
||||
}
|
||||
|
||||
@@ -66,6 +66,7 @@ func TestRunNoRemainingStagesRecordsSkippedStages(t *testing.T) {
|
||||
m.MarkStageSucceeded(name, time.Date(2026, 5, 3, 10, 1, 0, 0, time.UTC), nil)
|
||||
}
|
||||
m.MarkStageSkipped("extract", time.Date(2026, 5, 3, 10, 1, 0, 0, time.UTC), "notarius_disabled")
|
||||
seedPolishGlossaryEvidence(t, workspaceRoot, m)
|
||||
seedCurrentSemanticEvidence(t, loadConfigForSemanticEvidence(t, pipelinePath, campaignPath, sessionPath), m, "prepare", "transcribe", "merge", "polish", "normalize", "trim", "render", "publish", "notify")
|
||||
if err := store.Save(context.Background(), manifestPath, m); err != nil {
|
||||
t.Fatalf("save manifest: %v", err)
|
||||
@@ -187,6 +188,8 @@ func TestRunSingleStageSkipAndForce(t *testing.T) {
|
||||
m := manifest.New("2026-05-03", time.Date(2026, 5, 3, 10, 0, 0, 0, time.UTC))
|
||||
setCurrentBuiltInEvidence(t, m, "merge", artifacts.TranscriptOutputKindBase, artifacts.ArtifactTranscriptBase, basePath)
|
||||
m.MarkStageSucceeded("polish", time.Date(2026, 5, 3, 10, 1, 0, 0, time.UTC), nil)
|
||||
seedGlossaryRecords(t, workspaceRoot, m)
|
||||
seedPolishGlossaryEvidence(t, workspaceRoot, m)
|
||||
seedCurrentSemanticEvidence(t, loadConfigForSemanticEvidence(t, pipelinePath, campaignPath, sessionPath), m, "polish")
|
||||
if err := store.Save(context.Background(), manifestPath, m); err != nil {
|
||||
t.Fatalf("save manifest: %v", err)
|
||||
|
||||
@@ -60,10 +60,8 @@ func TestPartialRunRetainsAllFailureCausesAndDurableSuccess(t *testing.T) {
|
||||
t.Fatalf("summary=%#v", summary)
|
||||
}
|
||||
if compositionFailure {
|
||||
for _, result := range summary.StageResults {
|
||||
if result.Attempted || result.Outcome != "not_attempted" {
|
||||
t.Fatalf("composition scheduled work: %#v", summary)
|
||||
}
|
||||
if firstRuns != 1 || summary.StageResults[0].Outcome != "completed" || summary.StageResults[1].Attempted || summary.StageResults[1].Outcome != "failed" || summary.StageResults[2].Outcome != "not_attempted" {
|
||||
t.Fatalf("composition results: %#v", summary)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -10,6 +10,9 @@ import (
|
||||
)
|
||||
|
||||
func inspectInvocationRequirements(runtime *invocationRuntime, start int) error {
|
||||
if !stagesContainAny(runtime.stages[start:], "polish", "trim", "analyze") {
|
||||
return nil
|
||||
}
|
||||
remaining := runtime.plan
|
||||
remaining.stages = append([]stage.Stage(nil), runtime.stages[start:]...)
|
||||
projection, err := projectSelectedWork(runtime.ctx, runtime.cfg, remaining, runtime.opts.Force, runtime.opts.SelectedArtifacts, runtime.effectiveArtifacts, runtime.artifactStore, runtime.manifest)
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/adapters/audita"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/manifest"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/stage"
|
||||
)
|
||||
@@ -147,6 +148,7 @@ func TestExecuteStagesResumeValidationFailureRecordsSessionFailure(t *testing.T)
|
||||
|
||||
func TestExecuteStagesSuccessfulSaveFailureMarksStageFailedAndInvalidatesDependents(t *testing.T) {
|
||||
cfg := testConfig(t)
|
||||
seedGlossaryManifest(t, cfg)
|
||||
store := &successfulStageSaveFailingStore{
|
||||
delegate: &manifest.LocalStore{},
|
||||
stageName: "polish",
|
||||
@@ -155,7 +157,7 @@ func TestExecuteStagesSuccessfulSaveFailureMarksStageFailedAndInvalidatesDepende
|
||||
|
||||
_, err := executeStages(context.Background(), cfg, []stage.Stage{
|
||||
countingStage{name: "polish", runs: new(int)},
|
||||
}, RunOptions{Env: &Env{ManifestStore: store}})
|
||||
}, RunOptions{Env: &Env{ManifestStore: store, Audita: &audita.FakeRunner{}}})
|
||||
if err == nil || !strings.Contains(err.Error(), "save manifest after stage \"polish\"") {
|
||||
t.Fatalf("executeStages() error = %v, want successful-stage save failure", err)
|
||||
}
|
||||
@@ -174,8 +176,9 @@ func TestExecuteStagesSuccessfulSaveFailureMarksStageFailedAndInvalidatesDepende
|
||||
|
||||
func TestExecuteStagesSelfSkipSaveFailureIsNotReportedComplete(t *testing.T) {
|
||||
cfg := testConfig(t)
|
||||
seedGlossaryManifest(t, cfg)
|
||||
store := &successfulStageSaveFailingStore{delegate: &manifest.LocalStore{}, stageName: "polish", dependent: "normalize", failStatus: manifest.StatusSkipped}
|
||||
summary, err := executeStages(context.Background(), cfg, []stage.Stage{resultStage{name: "polish", result: &stage.StageResult{Disposition: stage.StageDispositionSkipped, SkipReason: "disabled"}}}, RunOptions{Env: &Env{ManifestStore: store}})
|
||||
summary, err := executeStages(context.Background(), cfg, []stage.Stage{resultStage{name: "polish", result: &stage.StageResult{Disposition: stage.StageDispositionSkipped, SkipReason: "disabled"}}}, RunOptions{Env: &Env{ManifestStore: store, Audita: &audita.FakeRunner{}}})
|
||||
if err == nil || summary == nil || summary.Complete || len(summary.Skipped) != 0 || summary.StageResults[0].Outcome != "failed" {
|
||||
t.Fatalf("summary=%#v error=%v", summary, err)
|
||||
}
|
||||
|
||||
@@ -804,6 +804,7 @@ func TestExecuteStagesForceSuccessInvalidatesDownstreamSucceededStages(t *testin
|
||||
store := &manifest.LocalStore{}
|
||||
|
||||
existing := manifest.New(cfg.Session.SessionID, time.Date(2026, 5, 3, 1, 0, 0, 0, time.UTC))
|
||||
seedGlossaryRecords(t, cfg.Pipeline.Workspace.Root, existing)
|
||||
for _, stageName := range []string{"prepare", "transcribe", "merge", "polish", "normalize", "trim", "extract", "render", "publish", "notify"} {
|
||||
existing.MarkStageSucceeded(stageName, time.Date(2026, 5, 3, 1, 1, 0, 0, time.UTC), nil)
|
||||
}
|
||||
@@ -817,7 +818,7 @@ func TestExecuteStagesForceSuccessInvalidatesDownstreamSucceededStages(t *testin
|
||||
|
||||
runs := 0
|
||||
stageToRun := countingStage{name: "polish", runs: &runs}
|
||||
summary, err := executeStages(context.Background(), cfg, []stage.Stage{stageToRun}, RunOptions{Force: true})
|
||||
summary, err := executeStages(context.Background(), cfg, []stage.Stage{stageToRun}, RunOptions{Force: true, Env: &Env{Audita: &audita.FakeRunner{}}})
|
||||
if err != nil {
|
||||
t.Fatalf("executeStages() error = %v", err)
|
||||
}
|
||||
@@ -1238,7 +1239,7 @@ func TestExecuteStagesRunLocalArtifactsAndCanonicalSync(t *testing.T) {
|
||||
runLocalChecks := []string{
|
||||
filepath.Join(runRoot, "transcribe", "outputs", "transcripts", "raw", "alice.json"),
|
||||
filepath.Join(runRoot, "merge", "logs", "seriatim.stdout.log"),
|
||||
filepath.Join(runRoot, "polish", "config", "audita.generated.yml"),
|
||||
filepath.Join(runRoot, "polish", "outputs", "transcripts", "polished.json"),
|
||||
filepath.Join(runRoot, "normalize", "logs", "seriatim.normalize.stdout.log"),
|
||||
filepath.Join(runRoot, "trim", "outputs", "transcripts", "final.trimmed.json"),
|
||||
}
|
||||
@@ -1333,6 +1334,7 @@ func TestExecuteStagesSkippedStagePreservesExistingOutputsProvenance(t *testing.
|
||||
|
||||
func TestAdapterFailureMarksManifestFailed(t *testing.T) {
|
||||
cfg := testConfig(t)
|
||||
seedGlossaryManifest(t, cfg)
|
||||
selected, err := stage.Select("polish")
|
||||
if err != nil {
|
||||
t.Fatalf("Select() error = %v", err)
|
||||
@@ -1352,9 +1354,6 @@ func TestAdapterFailureMarksManifestFailed(t *testing.T) {
|
||||
if err := os.WriteFile(filepath.Join(paths.TranscriptsDir, "base.json"), []byte(`{"segments":[]}`), 0o644); err != nil {
|
||||
t.Fatalf("write merged transcript: %v", err)
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(paths.InputsDir, "glossary.yml"), []byte("terms: []\n"), 0o644); err != nil {
|
||||
t.Fatalf("write glossary: %v", err)
|
||||
}
|
||||
|
||||
_, runErr := executeStages(context.Background(), cfg, []stage.Stage{selected}, RunOptions{Env: env})
|
||||
if runErr == nil {
|
||||
@@ -1388,7 +1387,7 @@ func testConfig(t *testing.T) *config.Config {
|
||||
mustWriteFile(t, sessionPath, "session_id: 2026-05-03\ncampaign: sample-campaign\ninputs:\n audio_dir: ./audio\n")
|
||||
mustWriteFile(t, filepath.Join(cfgDir, "speakers.yml"), "alice: alice.flac\n")
|
||||
mustWriteFile(t, filepath.Join(cfgDir, "autocorrect.yml"), "[]\n")
|
||||
mustWriteFile(t, filepath.Join(cfgDir, "glossary.yml"), "[]\n")
|
||||
mustWriteFile(t, filepath.Join(cfgDir, "glossary.yml"), "campaign: {entries: []}\n")
|
||||
mustWriteFile(t, filepath.Join(cfgDir, "party.yml"), "schema_version: narratio.party.v1\ncharacters:\n arannis:\n player: {name: Eric}\n character:\n name: Arannis\n classes: [{name: wizard}]\n")
|
||||
mustWriteFile(t, filepath.Join(cfgDir, "audio", "alice.flac"), "audio")
|
||||
partyDocument, err := config.ParseParty([]byte("schema_version: narratio.party.v1\ncharacters:\n arannis:\n player: {name: Eric}\n character:\n name: Arannis\n classes: [{name: wizard}]\n"))
|
||||
@@ -1439,7 +1438,7 @@ func testConfig(t *testing.T) *config.Config {
|
||||
AudioDir: "./audio",
|
||||
SpeakersFile: "./speakers.yml",
|
||||
AutocorrectFile: "./autocorrect.yml",
|
||||
GlossaryFile: new("./glossary.yml"),
|
||||
GlossaryFile: new(filepath.Join(cfgDir, "glossary.yml")),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/adapters/audita"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/adapters/scriptorium"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/config"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/manifest"
|
||||
@@ -388,6 +389,7 @@ func TestRefinementSemanticChangesRespectDependencyBranches(t *testing.T) {
|
||||
cfg := testConfig(t)
|
||||
providers := make([]stage.SemanticConfigFingerprinter, len(names))
|
||||
seed := manifest.New(cfg.Session.SessionID, time.Now().UTC())
|
||||
seedGlossaryRecords(t, cfg.Pipeline.Workspace.Root, seed)
|
||||
for _, candidate := range stage.All() {
|
||||
seed.MarkStageSucceeded(candidate.Name(), time.Now().UTC(), nil)
|
||||
}
|
||||
@@ -410,7 +412,7 @@ func TestRefinementSemanticChangesRespectDependencyBranches(t *testing.T) {
|
||||
for index, name := range names {
|
||||
selected = append(selected, semanticContractRunStub{name: name, provider: providers[index], runs: &runs[index]})
|
||||
}
|
||||
if _, err := executeStages(context.Background(), cfg, selected, RunOptions{Env: &Env{Scriptorium: &scriptorium.FakeRunner{}}}); err != nil {
|
||||
if _, err := executeStages(context.Background(), cfg, selected, RunOptions{Env: &Env{Audita: &audita.FakeRunner{}, Scriptorium: &scriptorium.FakeRunner{}}}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if runs != test.wantRuns {
|
||||
@@ -431,6 +433,7 @@ func TestOldPolishSemanticEvidenceIsReconsideredOnlyWhenSelected(t *testing.T) {
|
||||
cfg := testConfig(t)
|
||||
names := []string{"prepare", "transcribe", "merge", "polish", "normalize", "trim", "render"}
|
||||
seed := manifest.New(cfg.Session.SessionID, time.Now().UTC())
|
||||
seedGlossaryRecords(t, cfg.Pipeline.Workspace.Root, seed)
|
||||
for _, candidate := range stage.All() {
|
||||
seed.MarkStageSucceeded(candidate.Name(), time.Now().UTC(), nil)
|
||||
}
|
||||
@@ -466,7 +469,7 @@ func TestOldPolishSemanticEvidenceIsReconsideredOnlyWhenSelected(t *testing.T) {
|
||||
if loaded.Stages["polish"].SemanticConfig.Version != seed.Stages["polish"].SemanticConfig.Version {
|
||||
t.Fatal("downstream-only execution rewrote unselected polish evidence")
|
||||
}
|
||||
if _, err := executeStages(context.Background(), cfg, selected, RunOptions{}); err != nil {
|
||||
if _, err := executeStages(context.Background(), cfg, selected, RunOptions{Env: &Env{Audita: &audita.FakeRunner{}}}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if want := []int{0, 0, 0, 1, 1, 1, 1}; !reflect.DeepEqual(runs, want) {
|
||||
@@ -476,7 +479,11 @@ func TestOldPolishSemanticEvidenceIsReconsideredOnlyWhenSelected(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if loaded.Stages["polish"].SemanticConfig.Version != 2 || loaded.Stages["extract"].Status != manifest.StatusStale {
|
||||
currentFingerprint, err := providers[3].SemanticConfigFingerprint(&stage.Env{Config: cfg})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if loaded.Stages["polish"].SemanticConfig.Version != currentFingerprint.Version || loaded.Stages["extract"].Status != manifest.StatusStale {
|
||||
t.Fatalf("old evidence was not replaced with normal dependent invalidation: polish=%#v extract=%#v", loaded.Stages["polish"], loaded.Stages["extract"])
|
||||
}
|
||||
for index := range runs {
|
||||
|
||||
@@ -190,6 +190,7 @@ func TestExecuteWorkflowCommandsAcceptPositionalSessionID(t *testing.T) {
|
||||
func TestExecuteSessionSubcommandsAcceptPositionalSessionID(t *testing.T) {
|
||||
workspaceRoot := t.TempDir()
|
||||
pipelinePath, campaignPath, sessionPath := writeValidConfigFiles(t, workspaceRoot)
|
||||
seedValidationPrepared(t, loadConfigForSemanticEvidence(t, pipelinePath, campaignPath, sessionPath))
|
||||
fake := &storage.FakeBackend{}
|
||||
seedOperatorCommittedOutputs(t, fake, nil)
|
||||
var storeInitCalls int
|
||||
|
||||
@@ -2,6 +2,7 @@ package config
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -13,6 +14,55 @@ import (
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
func TestGlossaryAuthoringExamplesResolve(t *testing.T) {
|
||||
examples, err := filepath.Abs(filepath.Join("..", "..", "examples"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for _, tc := range []struct {
|
||||
name, fragment, selectors, campaign, setting, spells string
|
||||
}{
|
||||
{name: "inline", fragment: "inline-only.yml", campaign: "Silver Watch", setting: "entries: []", spells: "entries: []"},
|
||||
{name: "file", fragment: "file-only.yml", campaign: "Lantern Watch", setting: "entries: []", spells: "entries: []"},
|
||||
{name: "combined with catalog", fragment: "combined.yml", selectors: " setting: lantern_coast\n system: sample_magic\n", campaign: "Silver Watch", setting: "North Harbor", spells: "Lantern Glow"},
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
fragment := filepath.Join("glossary-authoring", tc.fragment)
|
||||
for _, name := range []string{fragment, "glossary.yml"} {
|
||||
data, err := os.ReadFile(filepath.Join(examples, name))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
writePipelineFixture(t, dir, name, string(data))
|
||||
}
|
||||
campaign := writePipelineFixture(t, dir, "campaign.yml", fmt.Sprintf(`config:
|
||||
imports:
|
||||
- path: %q
|
||||
campaign_id: sample-campaign
|
||||
inputs:
|
||||
speakers_file: %q
|
||||
autocorrect_file: %q
|
||||
party_file: %q
|
||||
%s`, fragment, filepath.Join(examples, "campaigns", "sample-campaign", "speakers.yml"), filepath.Join(examples, "campaigns", "sample-campaign", "autocorrect.yml"), filepath.Join(examples, "campaigns", "sample-campaign", "party.yml"), tc.selectors))
|
||||
session := writePipelineFixture(t, dir, "session.yml", "session_id: session\ninputs: {audio_dir: audio}\n")
|
||||
cfg, err := LoadWithSessionOptions(filepath.Join(examples, "pipeline.catalog.yml"), campaign, session, SessionLoadOptions{})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
docs, err := ResolveGlossaries(cfg)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for role, want := range map[string]string{"campaign": tc.campaign, "setting": tc.setting, "spells": tc.spells} {
|
||||
if !strings.Contains(string(docs[role]), want) {
|
||||
t.Fatalf("%s = %s; want %q", role, docs[role], want)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestRepresentativeLoadDefaultsAndValidation(t *testing.T) {
|
||||
pipelinePath, sessionPath := writeConfigFiles(t, `whisperx:
|
||||
transcribe_url: https://transcription.example.com/transcribe
|
||||
@@ -261,6 +311,7 @@ func TestExamplesLoadAndValidate(t *testing.T) {
|
||||
t.Setenv("NOTARIUS_LLM_API_KEY", "synthetic-example-notarius-key")
|
||||
examplesDir := filepath.Join("..", "..", "examples")
|
||||
if got, want := maintainedPipelineRoots(t, examplesDir), []string{
|
||||
"pipeline.catalog.yml",
|
||||
"pipeline.extraction-subset.yml",
|
||||
"pipeline.full.annotated.yml",
|
||||
"pipeline.minimal.yml",
|
||||
@@ -274,6 +325,7 @@ func TestExamplesLoadAndValidate(t *testing.T) {
|
||||
pipelineFile string
|
||||
sessionFile string
|
||||
}{
|
||||
{name: "catalog pipeline with local audio session", pipelineFile: "pipeline.catalog.yml", sessionFile: "session.local-audio.yml"},
|
||||
{
|
||||
name: "minimal pipeline with local audio session",
|
||||
pipelineFile: "pipeline.minimal.yml",
|
||||
|
||||
@@ -359,7 +359,7 @@ func TestNotariusReferenceValidationAndNormalization(t *testing.T) {
|
||||
cfg.References = map[string]string{
|
||||
" party ": " narratio.input.party ",
|
||||
" chunk . players ": "narratio.input.players",
|
||||
" npc-registry . extract . glossary ": "narratio.input.glossary",
|
||||
" npc-registry . extract . glossary ": "narratio.input.glossary.campaign",
|
||||
"spells": "narratio.input.spell_catalog",
|
||||
}
|
||||
|
||||
@@ -372,7 +372,7 @@ func TestNotariusReferenceValidationAndNormalization(t *testing.T) {
|
||||
want := map[string]string{
|
||||
"party": "narratio.input.party",
|
||||
"chunk.players": "narratio.input.players",
|
||||
"npc-registry.extract.glossary": "narratio.input.glossary",
|
||||
"npc-registry.extract.glossary": "narratio.input.glossary.campaign",
|
||||
"spells": "narratio.input.spell_catalog",
|
||||
}
|
||||
if len(cfg.References) != len(want) {
|
||||
|
||||
@@ -247,7 +247,7 @@ func TestScriptoriumLoadAndValidate(t *testing.T) {
|
||||
source: narratio.input.party
|
||||
required: true
|
||||
glossary:
|
||||
source: narratio.input.glossary
|
||||
source: narratio.input.glossary.campaign
|
||||
required: false
|
||||
`,
|
||||
},
|
||||
|
||||
@@ -1148,12 +1148,12 @@ func TestAnalyzeResolvesPreparedStableInputSources(t *testing.T) {
|
||||
writeAnalyzeFile(t, filepath.Join(paths.TranscriptsDir, "final.trimmed.json"), `{"segments":[]}`)
|
||||
playersPath := filepath.Join(paths.InputsDir, "players.yml")
|
||||
partyPath := filepath.Join(paths.InputsDir, "party.yml")
|
||||
glossaryPath := filepath.Join(paths.InputsDir, "glossary.yml")
|
||||
glossaryPath := filepath.Join(paths.InputsDir, "glossaries", "campaign.yml")
|
||||
spellCatalogPath := filepath.Join(paths.InputsDir, "spell_catalog.json")
|
||||
recordPreparedAnalyzeInput(t, m, artifactpolicy.SourceInputPlayers, playersPath, "- Eric\n")
|
||||
m.Inputs[len(m.Inputs)-1].Source = "derived_from_party"
|
||||
recordPreparedAnalyzeInput(t, m, artifactpolicy.SourceInputParty, partyPath, "- Arannis\n")
|
||||
recordPreparedAnalyzeInput(t, m, artifactpolicy.SourceInputGlossary, glossaryPath, "- term: Ten Towns\n")
|
||||
recordPreparedAnalyzeInput(t, m, artifactpolicy.SourceInputGlossaryCampaign, glossaryPath, "campaign: {entries: [{id: ten_towns, name: Ten Towns}]}\n")
|
||||
recordPreparedAnalyzeInput(t, m, artifactpolicy.SourceInputSpellCatalog, spellCatalogPath, "{\"spells\":[]}\n")
|
||||
|
||||
artifact := env.Config.ArtifactCatalog.Artifacts["session_recap"]
|
||||
@@ -1166,7 +1166,7 @@ func TestAnalyzeResolvesPreparedStableInputSources(t *testing.T) {
|
||||
Required: true,
|
||||
}
|
||||
artifact.Inputs["glossary"] = config.ScriptoriumInputConfig{
|
||||
Source: "narratio.input.glossary",
|
||||
Source: "narratio.input.glossary.campaign",
|
||||
Required: true,
|
||||
}
|
||||
artifact.Inputs["spells"] = config.ScriptoriumInputConfig{
|
||||
|
||||
@@ -173,7 +173,7 @@ func TestExtractStageResolvesAllPreparedReferencesInSelectorOrder(t *testing.T)
|
||||
}{
|
||||
{selector: " players ", sourceID: artifactpolicy.SourceInputPlayers, contents: "players-secret\n"},
|
||||
{selector: "spells.spell_catalog", sourceID: artifactpolicy.SourceInputSpellCatalog, contents: "spell-secret\n"},
|
||||
{selector: "glossary", sourceID: artifactpolicy.SourceInputGlossary, contents: "glossary-secret\n"},
|
||||
{selector: "glossary", sourceID: artifactpolicy.SourceInputGlossaryCampaign, contents: "glossary-secret\n"},
|
||||
{selector: "party", sourceID: artifactpolicy.SourceInputParty, contents: "party-secret\n"},
|
||||
}
|
||||
env.Config.Pipeline.Notarius.References = make(map[string]string, len(configured))
|
||||
@@ -433,7 +433,7 @@ func TestExtractReferenceSnapshotsDeduplicateEquivalentDestinations(t *testing.T
|
||||
Bindings: []notarius.ReferenceBinding{{Selector: "party"}, {Selector: "alternate"}},
|
||||
Identities: []extractReferenceIdentity{
|
||||
identity,
|
||||
{Selector: "alternate", SourceID: artifactpolicy.SourceInputGlossary, Path: identity.Path, Checksum: checksum, SizeBytes: identity.SizeBytes},
|
||||
{Selector: "alternate", SourceID: artifactpolicy.SourceInputGlossaryCampaign, Path: identity.Path, Checksum: checksum, SizeBytes: identity.SizeBytes},
|
||||
},
|
||||
}
|
||||
bindings, err := materializeExtractReferenceSnapshots(sessionPathsForEnv(env, m.SessionID), references)
|
||||
@@ -964,7 +964,9 @@ func TestExtractionFingerprintIsIndependentOfOutputMapOrder(t *testing.T) {
|
||||
mutate func(*extractReferenceIdentity)
|
||||
}{
|
||||
{name: "selector", mutate: func(identity *extractReferenceIdentity) { identity.Selector = "changed" }},
|
||||
{name: "source", mutate: func(identity *extractReferenceIdentity) { identity.SourceID = artifactpolicy.SourceInputGlossary }},
|
||||
{name: "source", mutate: func(identity *extractReferenceIdentity) {
|
||||
identity.SourceID = artifactpolicy.SourceInputGlossaryCampaign
|
||||
}},
|
||||
{name: "path", mutate: func(identity *extractReferenceIdentity) { identity.Path = "inputs/changed.yml" }},
|
||||
{name: "checksum", mutate: func(identity *extractReferenceIdentity) { identity.Checksum = "changed-checksum" }},
|
||||
{name: "size", mutate: func(identity *extractReferenceIdentity) { identity.SizeBytes++ }},
|
||||
|
||||
@@ -876,7 +876,7 @@ inputs:
|
||||
writeFile(t, sessionPath, "session_id: 2026-05-03\n")
|
||||
writeFile(t, filepath.Join(cfgDir, "speakers.yml"), "alice: alice.flac\n")
|
||||
writeFile(t, filepath.Join(cfgDir, "autocorrect.yml"), "[]\n")
|
||||
writeFile(t, filepath.Join(cfgDir, "glossary.yml"), "[]\n")
|
||||
writeFile(t, filepath.Join(cfgDir, "glossary.yml"), "campaign: {entries: []}\n")
|
||||
partyBytes := []byte("schema_version: narratio.party.v1\ncharacters:\n arannis:\n player: {name: Eric}\n character:\n name: Arannis\n classes: [{name: wizard}]\n")
|
||||
writeFile(t, filepath.Join(cfgDir, "party.yml"), string(partyBytes))
|
||||
party, err := config.ParseParty(partyBytes)
|
||||
|
||||
@@ -426,7 +426,7 @@ func setupTranscribeEnv(t *testing.T, audioFiles []string) (*Env, *manifest.Mani
|
||||
writeFile(t, campaignPath, "campaign_id: sample-campaign\ninputs:\n speakers_file: ./speakers.yml\n autocorrect_file: ./autocorrect.yml\n glossary_file: ./glossary.yml\n party_file: ./party.yml\n")
|
||||
writeFile(t, filepath.Join(cfgDir, "speakers.yml"), "alice: alice.flac\n")
|
||||
writeFile(t, filepath.Join(cfgDir, "autocorrect.yml"), "[]\n")
|
||||
writeFile(t, filepath.Join(cfgDir, "glossary.yml"), "[]\n")
|
||||
writeFile(t, filepath.Join(cfgDir, "glossary.yml"), "campaign: {entries: []}\n")
|
||||
partyBytes := []byte("schema_version: narratio.party.v1\ncharacters:\n arannis:\n player: {name: Eric}\n character:\n name: Arannis\n classes: [{name: wizard}]\n")
|
||||
writeFile(t, filepath.Join(cfgDir, "party.yml"), string(partyBytes))
|
||||
party, err := config.ParseParty(partyBytes)
|
||||
@@ -462,7 +462,7 @@ func setupTranscribeEnv(t *testing.T, audioFiles []string) (*Env, *manifest.Mani
|
||||
AudioDir: "./audio",
|
||||
SpeakersFile: "./speakers.yml",
|
||||
AutocorrectFile: "./autocorrect.yml",
|
||||
GlossaryFile: new("./glossary.yml"),
|
||||
GlossaryFile: new(filepath.Join(cfgDir, "glossary.yml")),
|
||||
},
|
||||
},
|
||||
StableInputs: config.ResolvedStableInputs{
|
||||
|
||||
Reference in New Issue
Block a user