Migrate maintained D&D examples to native configuration
This commit is contained in:
@@ -1731,6 +1731,26 @@ historical release/ADR/archive mentions rather than blindly deleting text matche
|
|||||||
|
|
||||||
## Stage 36: Migrate The Maintained Minimal And Complete Examples
|
## Stage 36: Migrate The Maintained Minimal And Complete Examples
|
||||||
|
|
||||||
|
**Status:** Complete. The two version 6 examples now live in separate
|
||||||
|
`examples/dnd-minimal/` and `examples/dnd-complete/` directories with their own
|
||||||
|
transcripts and declaration-relative imports/references. Moved data fixtures
|
||||||
|
without changing their bytes and updated test consumers. Retired the old copyable
|
||||||
|
configurations/profile file. Minimal uses embedded resources only; complete uses
|
||||||
|
all D&D families, ordered generated references, optional domain auxiliaries,
|
||||||
|
native companion profile/backend inheritance, independent workers, and explicit
|
||||||
|
cache/mode/semantic-turn controls. The limited backend leaves native queue and
|
||||||
|
diagnostic defaults inherited; development profile/pipeline/overlay variants use
|
||||||
|
native customization and explicit zero semantic turns rather than repair wrappers.
|
||||||
|
|
||||||
|
Both actual configurations and their pipelines pass native offline validation
|
||||||
|
without credentials, including the development variant and overlay. Maintained
|
||||||
|
fake-provider runs verify domain publication and source/contextual identity;
|
||||||
|
inspection tests verify companion isolation, inherited resources, and overlay
|
||||||
|
origins without provider work. Whole-tree tests, vet, build, repeated focused race
|
||||||
|
checks, direct executable validation, and `git diff --check` pass. No live model
|
||||||
|
or real credentials were used. Later assembled verification and documentation
|
||||||
|
stages remain pending.
|
||||||
|
|
||||||
**Goal:** two useful D&D configurations demonstrate the final native workflow.
|
**Goal:** two useful D&D configurations demonstrate the final native workflow.
|
||||||
|
|
||||||
**Inspect/change:** `examples/dnd-{minimal,complete}.config.yml`, pipeline imports,
|
**Inspect/change:** `examples/dnd-{minimal,complete}.config.yml`, pipeline imports,
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
version: 5
|
|
||||||
config:
|
|
||||||
imports:
|
|
||||||
- path: pipelines/dnd-session.yml
|
|
||||||
required: true
|
|
||||||
promptkit:
|
|
||||||
profile_file: ./llm-profiles/dnd-extraction.yml
|
|
||||||
transient_retries: 2
|
|
||||||
concurrency:
|
|
||||||
total_llm: 2
|
|
||||||
stage_workers:
|
|
||||||
extract: 2
|
|
||||||
output:
|
|
||||||
directory: ./notarius-output
|
|
||||||
cache:
|
|
||||||
chunk_plans:
|
|
||||||
mode: auto
|
|
||||||
directory: ./notarius-cache/chunk-plans
|
|
||||||
checkpoints:
|
|
||||||
enabled: true
|
|
||||||
directory: ./notarius-cache/checkpoints
|
|
||||||
debug:
|
|
||||||
directory: ./notarius-debug
|
|
||||||
14
examples/dnd-complete/config.yml
Normal file
14
examples/dnd-complete/config.yml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
version: 6
|
||||||
|
config:
|
||||||
|
imports:
|
||||||
|
- path: pipelines/dnd-session.yml
|
||||||
|
required: true
|
||||||
|
# This bounds ready pipeline jobs independently of native backend admission.
|
||||||
|
concurrency:
|
||||||
|
workers: 4
|
||||||
|
output:
|
||||||
|
directory: ./notarius-output
|
||||||
|
cache_directory: ./notarius-cache
|
||||||
|
# A directory alone does not enable capture; select --debug when needed.
|
||||||
|
debug:
|
||||||
|
directory: ./notarius-debug
|
||||||
11
examples/dnd-complete/overlays/development.yml
Normal file
11
examples/dnd-complete/overlays/development.yml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# Invocation: --overlay development. These are application controls, not a
|
||||||
|
# replacement LLM scheduler or backend concurrency configuration.
|
||||||
|
concurrency:
|
||||||
|
workers: 1
|
||||||
|
output:
|
||||||
|
directory: ../notarius-output-development
|
||||||
|
pipelines:
|
||||||
|
dnd-session:
|
||||||
|
llm_profile: notarius/dnd-extraction-development
|
||||||
|
max_additional_turns: 0
|
||||||
|
cache: bypass
|
||||||
@@ -4,7 +4,6 @@ artifacts:
|
|||||||
item-registry:
|
item-registry:
|
||||||
extract:
|
extract:
|
||||||
module: dnd/item-registry
|
module: dnd/item-registry
|
||||||
retries: 2
|
|
||||||
merge:
|
merge:
|
||||||
module: appendorder
|
module: appendorder
|
||||||
normalize:
|
normalize:
|
||||||
@@ -12,25 +11,20 @@ artifacts:
|
|||||||
npc-registry:
|
npc-registry:
|
||||||
extract:
|
extract:
|
||||||
module: dnd/npc-registry
|
module: dnd/npc-registry
|
||||||
retries: 2
|
|
||||||
merge:
|
merge:
|
||||||
module: appendorder
|
module: appendorder
|
||||||
normalize:
|
normalize:
|
||||||
module: dnd/npc-registry
|
module: dnd/npc-registry
|
||||||
retries: 2
|
|
||||||
location-registry:
|
location-registry:
|
||||||
extract:
|
extract:
|
||||||
module: dnd/location-registry
|
module: dnd/location-registry
|
||||||
retries: 2
|
|
||||||
merge:
|
merge:
|
||||||
module: appendorder
|
module: appendorder
|
||||||
normalize:
|
normalize:
|
||||||
module: dnd/location-registry
|
module: dnd/location-registry
|
||||||
retries: 2
|
|
||||||
scene-descriptions:
|
scene-descriptions:
|
||||||
extract:
|
extract:
|
||||||
module: dnd/scene-descriptions
|
module: dnd/scene-descriptions
|
||||||
retries: 2
|
|
||||||
merge:
|
merge:
|
||||||
module: appendorder
|
module: appendorder
|
||||||
normalize:
|
normalize:
|
||||||
@@ -6,18 +6,20 @@ config:
|
|||||||
placement: sequence-item
|
placement: sequence-item
|
||||||
pipelines:
|
pipelines:
|
||||||
dnd-session:
|
dnd-session:
|
||||||
llm_profile: dnd-extraction
|
llm_profile: notarius/dnd-extraction-example
|
||||||
|
mode: strict
|
||||||
|
max_additional_turns: 2
|
||||||
|
cache: auto
|
||||||
input:
|
input:
|
||||||
module: seriatim
|
module: seriatim
|
||||||
# Stable campaign context is shared by every module that accepts these slots.
|
# Stable campaign context is shared by every module that accepts these slots.
|
||||||
references:
|
references:
|
||||||
party:
|
party:
|
||||||
path: ../dnd-party.txt
|
path: ../party.txt
|
||||||
glossary:
|
glossary:
|
||||||
path: ../dnd-glossary.txt
|
path: ../glossary.txt
|
||||||
chunk:
|
chunk:
|
||||||
module: dnd/scenes
|
module: dnd/scenes
|
||||||
retries: 2
|
|
||||||
output:
|
output:
|
||||||
module: json
|
module: json
|
||||||
options:
|
options:
|
||||||
@@ -60,7 +62,6 @@ pipelines:
|
|||||||
item-occurrences:
|
item-occurrences:
|
||||||
extract:
|
extract:
|
||||||
module: dnd/item-occurrences
|
module: dnd/item-occurrences
|
||||||
retries: 2
|
|
||||||
merge:
|
merge:
|
||||||
module: appendorder
|
module: appendorder
|
||||||
normalize:
|
normalize:
|
||||||
@@ -68,10 +69,9 @@ pipelines:
|
|||||||
spells:
|
spells:
|
||||||
extract:
|
extract:
|
||||||
module: dnd/spells
|
module: dnd/spells
|
||||||
retries: 2
|
|
||||||
references:
|
references:
|
||||||
spell_catalog:
|
spell_catalog:
|
||||||
path: ../dnd-spell-catalog.json
|
path: ../spell-catalog.json
|
||||||
merge:
|
merge:
|
||||||
module: appendorder
|
module: appendorder
|
||||||
# Stage-local file references are intentionally bound at each stage.
|
# Stage-local file references are intentionally bound at each stage.
|
||||||
@@ -79,11 +79,10 @@ pipelines:
|
|||||||
module: dnd/spells
|
module: dnd/spells
|
||||||
references:
|
references:
|
||||||
spell_catalog:
|
spell_catalog:
|
||||||
path: ../dnd-spell-catalog.json
|
path: ../spell-catalog.json
|
||||||
combat-turns:
|
combat-turns:
|
||||||
extract:
|
extract:
|
||||||
module: dnd/combat-turns
|
module: dnd/combat-turns
|
||||||
retries: 2
|
|
||||||
merge:
|
merge:
|
||||||
module: appendorder
|
module: appendorder
|
||||||
normalize:
|
normalize:
|
||||||
@@ -91,7 +90,6 @@ pipelines:
|
|||||||
npc-occurrences:
|
npc-occurrences:
|
||||||
extract:
|
extract:
|
||||||
module: dnd/npc-occurrences
|
module: dnd/npc-occurrences
|
||||||
retries: 2
|
|
||||||
merge:
|
merge:
|
||||||
module: appendorder
|
module: appendorder
|
||||||
normalize:
|
normalize:
|
||||||
@@ -99,7 +97,6 @@ pipelines:
|
|||||||
location-occurrences:
|
location-occurrences:
|
||||||
extract:
|
extract:
|
||||||
module: dnd/location-occurrences
|
module: dnd/location-occurrences
|
||||||
retries: 2
|
|
||||||
merge:
|
merge:
|
||||||
module: appendorder
|
module: appendorder
|
||||||
normalize:
|
normalize:
|
||||||
@@ -126,14 +123,14 @@ pipelines:
|
|||||||
enemy-events:
|
enemy-events:
|
||||||
extract:
|
extract:
|
||||||
module: dnd/enemy-events
|
module: dnd/enemy-events
|
||||||
retries: 2
|
|
||||||
merge:
|
merge:
|
||||||
module: appendorder
|
module: appendorder
|
||||||
normalize:
|
normalize:
|
||||||
module: dnd/enemy-events
|
module: dnd/enemy-events
|
||||||
|
|
||||||
# Development variant: disable PromptKit structural repairs while retaining
|
# Inherit the full pipeline, select a native profile variant, and disable
|
||||||
# the inherited steps and configured producer retry budgets.
|
# semantic continuation for a quick comparison. Structural repair stays native.
|
||||||
dnd-session-development:
|
dnd-session-development:
|
||||||
extends: dnd-session
|
extends: dnd-session
|
||||||
structured_output_repair_attempts: 0
|
llm_profile: notarius/dnd-extraction-development
|
||||||
|
max_additional_turns: 0
|
||||||
15
examples/dnd-complete/prompts.yml
Normal file
15
examples/dnd-complete/prompts.yml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# Native wrapperless settings, discovered beside this example's config.yml.
|
||||||
|
# Inherit the bundled backend without pinning its queue or diagnostic defaults.
|
||||||
|
backends:
|
||||||
|
- id: limited-openrouter
|
||||||
|
extends: {id: openrouter}
|
||||||
|
concurrency_limit: 2
|
||||||
|
collections:
|
||||||
|
notarius:
|
||||||
|
profiles:
|
||||||
|
- id: dnd-extraction-example
|
||||||
|
extends: {id: dnd-extraction}
|
||||||
|
backend: limited-openrouter
|
||||||
|
- id: dnd-extraction-development
|
||||||
|
extends: {id: dnd-extraction-example}
|
||||||
|
temperature: 0.2
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
version: 5
|
version: 6
|
||||||
pipelines:
|
pipelines:
|
||||||
dnd-session:
|
dnd-session:
|
||||||
llm_profile: dnd-extraction
|
llm_profile: notarius/dnd-extraction
|
||||||
input:
|
input:
|
||||||
module: seriatim
|
module: seriatim
|
||||||
artifacts:
|
artifacts:
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
profiles:
|
|
||||||
dnd-extraction:
|
|
||||||
backend: openrouter
|
|
||||||
model: openai/gpt-5.6-luna
|
|
||||||
timeout_seconds: 240
|
|
||||||
service_tier: flex
|
|
||||||
dnd-extraction-development:
|
|
||||||
extends: dnd-extraction
|
|
||||||
temperature: 0.2
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
# This selects operational settings only; choose a different LLM profile with
|
|
||||||
# the pipeline's llm_profile field or the run command's --llm-profile flag.
|
|
||||||
concurrency:
|
|
||||||
total_llm: 1
|
|
||||||
stage_workers:
|
|
||||||
extract: 1
|
|
||||||
output:
|
|
||||||
directory: ./notarius-output-development
|
|
||||||
@@ -52,7 +52,7 @@ func TestAssembledEnemyEventLaneRejectsInvalidFinalArtifactDespiteValidatorOverr
|
|||||||
}
|
}
|
||||||
_, err = pipeline.New().Run(context.Background(), pipeline.RunInput{
|
_, err = pipeline.New().Run(context.Background(), pipeline.RunInput{
|
||||||
Prepared: prepared,
|
Prepared: prepared,
|
||||||
RawInput: readRepositoryFile(t, "examples", "seriatim-minimal-transcript.json"),
|
RawInput: readRepositoryFile(t, "examples", "dnd-minimal", "transcript.json"),
|
||||||
})
|
})
|
||||||
if err == nil || !strings.Contains(err.Error(), "encode dnd enemy event list") || !strings.Contains(err.Error(), "must not exceed") {
|
if err == nil || !strings.Contains(err.Error(), "encode dnd enemy event list") || !strings.Contains(err.Error(), "must not exceed") {
|
||||||
t.Fatalf("Run() error = %v, want final durable range rejection", err)
|
t.Fatalf("Run() error = %v, want final durable range rejection", err)
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ func TestAssembledSpellPipelineNormalizesMergedCasts(t *testing.T) {
|
|||||||
|
|
||||||
output, err := pipeline.New().Run(context.Background(), pipeline.RunInput{
|
output, err := pipeline.New().Run(context.Background(), pipeline.RunInput{
|
||||||
Prepared: prepared,
|
Prepared: prepared,
|
||||||
RawInput: readRepositoryFile(t, "examples", "seriatim-minimal-transcript.json"),
|
RawInput: readRepositoryFile(t, "examples", "dnd-minimal", "transcript.json"),
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Run() error = %v, want nil", err)
|
t.Fatalf("Run() error = %v, want nil", err)
|
||||||
@@ -106,7 +106,7 @@ func TestAssembledSpellPipelineCorrectsRejectedDirectExtraction(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
output, err := pipeline.New().Run(context.Background(), pipeline.RunInput{Prepared: prepared, RawInput: readRepositoryFile(t, "examples", "seriatim-minimal-transcript.json")})
|
output, err := pipeline.New().Run(context.Background(), pipeline.RunInput{Prepared: prepared, RawInput: readRepositoryFile(t, "examples", "dnd-minimal", "transcript.json")})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
@@ -155,7 +155,7 @@ func TestAssembledSpellPipelineHonorsNormalizeValidatorOverride(t *testing.T) {
|
|||||||
}
|
}
|
||||||
output, err := pipeline.New().Run(context.Background(), pipeline.RunInput{
|
output, err := pipeline.New().Run(context.Background(), pipeline.RunInput{
|
||||||
Prepared: prepared,
|
Prepared: prepared,
|
||||||
RawInput: readRepositoryFile(t, "examples", "seriatim-minimal-transcript.json"),
|
RawInput: readRepositoryFile(t, "examples", "dnd-minimal", "transcript.json"),
|
||||||
})
|
})
|
||||||
if err != nil || output.FallbackCount != 0 || len(output.OutputFiles) != 1 {
|
if err != nil || output.FallbackCount != 0 || len(output.OutputFiles) != 1 {
|
||||||
t.Fatalf("Run() error = %v output = %#v, want approved override run", err, output)
|
t.Fatalf("Run() error = %v output = %#v, want approved override run", err, output)
|
||||||
@@ -173,7 +173,7 @@ func TestAssembledSpellPipelineRejectsUnknownSpellDuringNormalization(t *testing
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
output, err := pipeline.New().Run(context.Background(), pipeline.RunInput{Prepared: prepared, RawInput: readRepositoryFile(t, "examples", "seriatim-minimal-transcript.json")})
|
output, err := pipeline.New().Run(context.Background(), pipeline.RunInput{Prepared: prepared, RawInput: readRepositoryFile(t, "examples", "dnd-minimal", "transcript.json")})
|
||||||
for _, fragment := range []string{"normalize", `lane "spells"`, "extract/dnd/spells/catalog"} {
|
for _, fragment := range []string{"normalize", `lane "spells"`, "extract/dnd/spells/catalog"} {
|
||||||
if err == nil || !strings.Contains(err.Error(), fragment) {
|
if err == nil || !strings.Contains(err.Error(), fragment) {
|
||||||
t.Fatalf("error=%v, want scoped catalog rejection (%s)", err, fragment)
|
t.Fatalf("error=%v, want scoped catalog rejection (%s)", err, fragment)
|
||||||
@@ -192,7 +192,7 @@ func TestAssembledSpellPipelinePromotesUnknownSpellAdvisoryWhenOverrideAccepts(t
|
|||||||
}
|
}
|
||||||
output, err := pipeline.New().Run(context.Background(), pipeline.RunInput{
|
output, err := pipeline.New().Run(context.Background(), pipeline.RunInput{
|
||||||
Prepared: prepared,
|
Prepared: prepared,
|
||||||
RawInput: readRepositoryFile(t, "examples", "seriatim-minimal-transcript.json"),
|
RawInput: readRepositoryFile(t, "examples", "dnd-minimal", "transcript.json"),
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Run() error = %v, want nil", err)
|
t.Fatalf("Run() error = %v, want nil", err)
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import (
|
|||||||
|
|
||||||
func TestProductionEnemyEventConfigurationResolvesGeneratedHandoffs(t *testing.T) {
|
func TestProductionEnemyEventConfigurationResolvesGeneratedHandoffs(t *testing.T) {
|
||||||
components := productionTestComponents(t)
|
components := productionTestComponents(t)
|
||||||
configPath := writeEnemyEventContractConfig(t)
|
configPath := repositoryPath("examples", "dnd-complete", "config.yml")
|
||||||
loaded, err := config.Load(configPath, config.LoadOptions{})
|
loaded, err := config.Load(configPath, config.LoadOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
@@ -83,15 +83,16 @@ func TestProductionEnemyEventConfigurationResolvesGeneratedHandoffs(t *testing.T
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestNativeOrderedDNDRunPublishesRegistryBackedEntityOccurrences(t *testing.T) {
|
func TestMaintainedCompleteInvocationPublishesRegistryBackedEntityOccurrences(t *testing.T) {
|
||||||
configPath := writeEnemyEventContractConfig(t)
|
t.Setenv("OPENROUTER_API_KEY", "notarius-test-credential")
|
||||||
|
configPath := repositoryPath("examples", "dnd-complete", "config.yml")
|
||||||
outputRoot := filepath.Join(t.TempDir(), "output")
|
outputRoot := filepath.Join(t.TempDir(), "output")
|
||||||
client := &enemyEventLLMClient{}
|
client := &enemyEventLLMClient{}
|
||||||
options := productionRunOptions(t, client)
|
options := productionRunOptions(t, client)
|
||||||
var stdout, stderr strings.Builder
|
var stdout, stderr strings.Builder
|
||||||
code := RunWithOptions([]string{
|
code := RunWithOptions([]string{
|
||||||
"run", "dnd-session", "--config", configPath,
|
"run", "dnd-session", "--config", configPath,
|
||||||
"--input-file", repositoryPath("examples", "dnd-complete-transcript.json"),
|
"--input-file", repositoryPath("examples", "dnd-complete", "transcript.json"),
|
||||||
"--cache", "bypass", "--output-dir", outputRoot,
|
"--cache", "bypass", "--output-dir", outputRoot,
|
||||||
"--llm-session-id", "enemy-event-session", "--format", "json",
|
"--llm-session-id", "enemy-event-session", "--format", "json",
|
||||||
}, &stdout, &stderr, options)
|
}, &stdout, &stderr, options)
|
||||||
@@ -188,83 +189,6 @@ func TestNativeOrderedDNDRunPublishesRegistryBackedEntityOccurrences(t *testing.
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func writeEnemyEventContractConfig(t *testing.T) string {
|
|
||||||
t.Helper()
|
|
||||||
return writeProductionContractConfig(t, fmt.Sprintf(`version: 6
|
|
||||||
pipelines:
|
|
||||||
dnd-session:
|
|
||||||
cache: bypass
|
|
||||||
input: {module: seriatim}
|
|
||||||
chunk: {module: dnd/scenes}
|
|
||||||
references:
|
|
||||||
party: {path: %q}
|
|
||||||
glossary: {path: %q}
|
|
||||||
output:
|
|
||||||
module: json
|
|
||||||
options:
|
|
||||||
include_chunk_map: true
|
|
||||||
evidence_context:
|
|
||||||
enabled: true
|
|
||||||
window_units: 3
|
|
||||||
lanes: [item-occurrences, item-registry, location-registry, location-occurrences, npc-registry, spells, combat-turns, npc-occurrences, enemy-events]
|
|
||||||
steps:
|
|
||||||
- id: describe-session
|
|
||||||
artifacts:
|
|
||||||
item-registry:
|
|
||||||
extract: {module: dnd/item-registry}
|
|
||||||
normalize: {module: dnd/item-registry}
|
|
||||||
npc-registry:
|
|
||||||
extract: {module: dnd/npc-registry}
|
|
||||||
normalize: {module: dnd/npc-registry}
|
|
||||||
location-registry:
|
|
||||||
extract: {module: dnd/location-registry}
|
|
||||||
normalize: {module: dnd/location-registry}
|
|
||||||
scene-descriptions:
|
|
||||||
extract: {module: dnd/scene-descriptions}
|
|
||||||
normalize: {module: dnd/scene-descriptions}
|
|
||||||
- id: extract-events
|
|
||||||
references:
|
|
||||||
location_registry: {artifact: {step: describe-session, lane: location-registry}}
|
|
||||||
npc_registry: {artifact: {step: describe-session, lane: npc-registry}}
|
|
||||||
scene_descriptions: {artifact: {step: describe-session, lane: scene-descriptions}}
|
|
||||||
item_registry: {artifact: {step: describe-session, lane: item-registry}}
|
|
||||||
artifacts:
|
|
||||||
item-occurrences:
|
|
||||||
extract: {module: dnd/item-occurrences}
|
|
||||||
normalize: {module: dnd/item-occurrences}
|
|
||||||
spells:
|
|
||||||
extract:
|
|
||||||
module: dnd/spells
|
|
||||||
references:
|
|
||||||
spell_catalog: {path: %q}
|
|
||||||
normalize:
|
|
||||||
module: dnd/spells
|
|
||||||
references:
|
|
||||||
spell_catalog: {path: %q}
|
|
||||||
combat-turns:
|
|
||||||
extract: {module: dnd/combat-turns}
|
|
||||||
normalize: {module: dnd/combat-turns}
|
|
||||||
npc-occurrences:
|
|
||||||
extract: {module: dnd/npc-occurrences}
|
|
||||||
normalize: {module: dnd/npc-occurrences}
|
|
||||||
location-occurrences:
|
|
||||||
extract: {module: dnd/location-occurrences}
|
|
||||||
normalize: {module: dnd/location-occurrences}
|
|
||||||
- id: track-enemies
|
|
||||||
references:
|
|
||||||
npc_registry: {artifact: {step: describe-session, lane: npc-registry}}
|
|
||||||
scene_descriptions: {artifact: {step: describe-session, lane: scene-descriptions}}
|
|
||||||
combat_turns: {artifact: {step: extract-events, lane: combat-turns}}
|
|
||||||
npc_occurrences: {artifact: {step: extract-events, lane: npc-occurrences}}
|
|
||||||
artifacts:
|
|
||||||
enemy-events:
|
|
||||||
extract: {module: dnd/enemy-events}
|
|
||||||
normalize: {module: dnd/enemy-events}
|
|
||||||
`+productionProviderConfiguration,
|
|
||||||
repositoryPath("examples", "dnd-party.txt"), repositoryPath("examples", "dnd-glossary.txt"),
|
|
||||||
repositoryPath("examples", "dnd-spell-catalog.json"), repositoryPath("examples", "dnd-spell-catalog.json")))
|
|
||||||
}
|
|
||||||
|
|
||||||
type enemyEventLLMClient struct {
|
type enemyEventLLMClient struct {
|
||||||
mu sync.Mutex
|
mu sync.Mutex
|
||||||
requests []promptkit.GenerateRequest
|
requests []promptkit.GenerateRequest
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ func TestProductionSceneDescriptionWorkflow(t *testing.T) {
|
|||||||
}
|
}
|
||||||
output, err := pipeline.New().Run(context.Background(), pipeline.RunInput{
|
output, err := pipeline.New().Run(context.Background(), pipeline.RunInput{
|
||||||
Prepared: prepared,
|
Prepared: prepared,
|
||||||
RawInput: readRepositoryFile(t, "examples", "seriatim-minimal-transcript.json"),
|
RawInput: readRepositoryFile(t, "examples", "dnd-minimal", "transcript.json"),
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Run() error = %v", err)
|
t.Fatalf("Run() error = %v", err)
|
||||||
|
|||||||
@@ -3,9 +3,11 @@ package cli
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"reflect"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
@@ -20,6 +22,8 @@ import (
|
|||||||
locationnormalize "gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/normalize/locationregistry"
|
locationnormalize "gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/normalize/locationregistry"
|
||||||
spellnormalize "gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/normalize/spells"
|
spellnormalize "gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/normalize/spells"
|
||||||
"gitea.maximumdirect.net/eric/notarius/internal/modules/seriatim/input/transcript"
|
"gitea.maximumdirect.net/eric/notarius/internal/modules/seriatim/input/transcript"
|
||||||
|
"go.maximumdirect.net/commandkit"
|
||||||
|
"go.maximumdirect.net/promptkit"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMaintainedExamplesLoadResolveAndList(t *testing.T) {
|
func TestMaintainedExamplesLoadResolveAndList(t *testing.T) {
|
||||||
@@ -28,8 +32,8 @@ func TestMaintainedExamplesLoadResolveAndList(t *testing.T) {
|
|||||||
for _, example := range maintainedExampleFiles(t) {
|
for _, example := range maintainedExampleFiles(t) {
|
||||||
t.Run(example.name, func(t *testing.T) {
|
t.Run(example.name, func(t *testing.T) {
|
||||||
cfg := loadMaintainedExample(t, example.path)
|
cfg := loadMaintainedExample(t, example.path)
|
||||||
if example.name == "complete" && cfg.Concurrency.Workers != 2 {
|
if example.name == "complete" && cfg.Concurrency.Workers != 4 {
|
||||||
t.Fatalf("complete example concurrency = %#v, want an explicit shared worker limit of 2", cfg.Concurrency)
|
t.Fatalf("complete example concurrency = %#v, want four shared workers independent of backend admission", cfg.Concurrency)
|
||||||
}
|
}
|
||||||
raw, err := os.ReadFile(example.transcriptPath)
|
raw, err := os.ReadFile(example.transcriptPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -59,6 +63,9 @@ func TestMaintainedExamplesLoadResolveAndList(t *testing.T) {
|
|||||||
}
|
}
|
||||||
if example.name == "complete" {
|
if example.name == "complete" {
|
||||||
if pipelineID == "dnd-session-development" {
|
if pipelineID == "dnd-session-development" {
|
||||||
|
if materialized.ChunkControls.MaxAdditionalTurns != 0 || materialized.Chunk.LLMProfile != "notarius/dnd-extraction-development" {
|
||||||
|
t.Fatalf("development native controls=%#v profile=%q", materialized.ChunkControls, materialized.Chunk.LLMProfile)
|
||||||
|
}
|
||||||
parent, found := completePipelines["dnd-session"]
|
parent, found := completePipelines["dnd-session"]
|
||||||
if !found {
|
if !found {
|
||||||
t.Fatal("complete parent pipeline was not resolved before its development variant")
|
t.Fatal("complete parent pipeline was not resolved before its development variant")
|
||||||
@@ -137,56 +144,104 @@ func TestMaintainedExamplesLoadResolveAndList(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestMaintainedConfigurationExampleSet(t *testing.T) {
|
func TestMaintainedExamplesIsolateCompanionsAndInheritNativeResources(t *testing.T) {
|
||||||
entries, err := os.ReadDir(repositoryPath("examples"))
|
client := &productionFakeLLMClient{}
|
||||||
|
loaders := &nativeLoaders{lookupEnv: emptyLookup, engineOptions: []promptkit.Option{promptkit.WithLLMClient(client)}}
|
||||||
|
ctx := context.Background()
|
||||||
|
completePath := repositoryPath("examples", "dnd-complete", "config.yml")
|
||||||
|
complete, err := loaders.engine(ctx, nativeSelection(completePath))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
var names []string
|
base, err := complete.InspectProfile(ctx, "notarius/dnd-extraction")
|
||||||
for _, entry := range entries {
|
if err != nil {
|
||||||
if !entry.IsDir() && strings.HasSuffix(entry.Name(), ".config.yml") {
|
t.Fatal(err)
|
||||||
names = append(names, entry.Name())
|
}
|
||||||
|
example, err := complete.InspectProfile(ctx, "notarius/dnd-extraction-example")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
development, err := complete.InspectProfile(ctx, "notarius/dnd-extraction-development")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
for _, profile := range []*promptkit.ProfileInspection{example, development} {
|
||||||
|
if !reflect.DeepEqual(profile.Model, base.Model) || !reflect.DeepEqual(profile.TimeoutSeconds, base.TimeoutSeconds) || !reflect.DeepEqual(profile.ServiceTier, base.ServiceTier) || profile.Backend == nil || *profile.Backend != "limited-openrouter" {
|
||||||
|
t.Fatalf("inherited profile=%#v, embedded parent=%#v", profile, base)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sort.Strings(names)
|
if development.Temperature == nil || *development.Temperature != 0.2 || !reflect.DeepEqual(example.Temperature, base.Temperature) {
|
||||||
if got := strings.Join(names, ","); got != "dnd-complete.config.yml,dnd-minimal.config.yml" {
|
t.Fatalf("development customization leaked into parent: %#v %#v", development, example)
|
||||||
t.Fatalf("maintained configuration examples = %q, want only the minimal and complete D&D examples", got)
|
|
||||||
}
|
}
|
||||||
|
bundled, err := complete.InspectBackend(ctx, "openrouter")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
limited, err := complete.InspectBackend(ctx, "limited-openrouter")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
if limited.ConcurrencyLimit == nil || *limited.ConcurrencyLimit != 2 || limited.Endpoint != bundled.Endpoint || !reflect.DeepEqual(limited.APIKeyEnv, bundled.APIKeyEnv) || !reflect.DeepEqual(limited.SmokeTests, bundled.SmokeTests) {
|
||||||
|
t.Fatalf("limited backend=%#v, bundled parent=%#v", limited, bundled)
|
||||||
|
}
|
||||||
|
minimal, err := loaders.engine(ctx, nativeSelection(repositoryPath("examples", "dnd-minimal", "config.yml")))
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
if _, err := minimal.InspectProfile(ctx, "notarius/dnd-extraction-example"); !errors.Is(err, promptkit.ErrProfileNotFound) {
|
||||||
|
t.Fatalf("complete example profile leaked into minimal selection: %v", err)
|
||||||
|
}
|
||||||
|
if _, err := minimal.InspectBackend(ctx, "limited-openrouter"); !errors.Is(err, promptkit.ErrBackendNotFound) {
|
||||||
|
t.Fatalf("complete example backend leaked into minimal selection: %v", err)
|
||||||
|
}
|
||||||
|
if len(client.requestsSnapshot()) != 0 {
|
||||||
|
t.Fatal("example inspection called provider")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
overlayEntries, err := os.ReadDir(repositoryPath("examples", "overlays"))
|
func TestMaintainedDevelopmentOverlayResolvesNativeControlsAndRelativeOutput(t *testing.T) {
|
||||||
|
path := repositoryPath("examples", "dnd-complete", "config.yml")
|
||||||
|
selection := nativeSelection(path)
|
||||||
|
selection.Overlay = commandkit.Supplied[string]{Set: true, Value: "development"}
|
||||||
|
loaders := &nativeLoaders{lookupEnv: emptyLookup}
|
||||||
|
result, err := loaders.application(context.Background(), selection)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
names = names[:0]
|
loaded, err := config.FromResult(result)
|
||||||
for _, entry := range overlayEntries {
|
|
||||||
if !entry.IsDir() && strings.HasSuffix(entry.Name(), ".yml") {
|
|
||||||
names = append(names, entry.Name())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sort.Strings(names)
|
|
||||||
if got := strings.Join(names, ","); got != "development.yml" {
|
|
||||||
t.Fatalf("maintained configuration overlays = %q, want development.yml", got)
|
|
||||||
}
|
|
||||||
llmProfiles, err := os.ReadDir(repositoryPath("examples", "llm-profiles"))
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
if len(llmProfiles) != 1 || llmProfiles[0].Name() != "dnd-extraction.yml" {
|
cfg := loaded.RuntimeConfig()
|
||||||
t.Fatalf("maintained LLM profile files = %#v, want the single combined profile file", llmProfiles)
|
if cfg.Concurrency.Workers != 1 || cfg.Output.Directory != filepath.Join(filepath.Dir(path), "notarius-output-development") {
|
||||||
|
t.Fatalf("development application controls=%#v %#v", cfg.Concurrency, cfg.Output)
|
||||||
|
}
|
||||||
|
resolved, err := cfg.Resolve(resolveInputForMaintainedExample(productionTestComponents(t), "dnd-session"))
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
if resolved.ResolvedPipeline.Chunk.LLMProfile != "notarius/dnd-extraction-development" || resolved.ResolvedPipeline.ChunkControls != (contracts.ProducerControls{Mode: contracts.ModeStrict, MaxAdditionalTurns: 0, Cache: contracts.CacheBypass}) {
|
||||||
|
t.Fatalf("development chunk selection=%#v controls=%#v", resolved.ResolvedPipeline.Chunk, resolved.ResolvedPipeline.ChunkControls)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestMaintainedExamplesValidateEffectiveProfilesOffline(t *testing.T) {
|
func TestMaintainedExamplesValidateEffectiveProfilesOffline(t *testing.T) {
|
||||||
t.Chdir(repositoryPath())
|
t.Chdir(repositoryPath())
|
||||||
t.Setenv("OPENROUTER_API_KEY", "")
|
t.Setenv("OPENROUTER_API_KEY", "")
|
||||||
|
client := &productionFakeLLMClient{}
|
||||||
|
options := Options{LLMClient: client}
|
||||||
for _, example := range maintainedExampleFiles(t) {
|
for _, example := range maintainedExampleFiles(t) {
|
||||||
t.Run(example.name, func(t *testing.T) {
|
t.Run(example.name, func(t *testing.T) {
|
||||||
|
var configOut, configErr strings.Builder
|
||||||
|
if code := RunWithOptions([]string{"config", "validate", "--config", example.path}, &configOut, &configErr, options); code != 0 {
|
||||||
|
t.Fatalf("configuration validation: status=%d stdout=%q stderr=%q", code, configOut.String(), configErr.String())
|
||||||
|
}
|
||||||
for _, pipelineID := range example.pipelineIDs {
|
for _, pipelineID := range example.pipelineIDs {
|
||||||
t.Run(pipelineID, func(t *testing.T) {
|
t.Run(pipelineID, func(t *testing.T) {
|
||||||
var stdout, stderr strings.Builder
|
var stdout, stderr strings.Builder
|
||||||
code := RunWithOptions([]string{
|
code := RunWithOptions([]string{
|
||||||
"pipeline", "validate", pipelineID, "--config", example.path,
|
"pipeline", "validate", pipelineID, "--config", example.path,
|
||||||
}, &stdout, &stderr, Options{})
|
}, &stdout, &stderr, options)
|
||||||
if code != 0 || stderr.Len() != 0 || !strings.Contains(stdout.String(), pipelineID) {
|
if code != 0 || stderr.Len() != 0 || !strings.Contains(stdout.String(), pipelineID) {
|
||||||
t.Fatalf("code=%d stdout=%q stderr=%q", code, stdout.String(), stderr.String())
|
t.Fatalf("code=%d stdout=%q stderr=%q", code, stdout.String(), stderr.String())
|
||||||
}
|
}
|
||||||
@@ -198,11 +253,14 @@ func TestMaintainedExamplesValidateEffectiveProfilesOffline(t *testing.T) {
|
|||||||
var stdout, stderr strings.Builder
|
var stdout, stderr strings.Builder
|
||||||
code := RunWithOptions([]string{
|
code := RunWithOptions([]string{
|
||||||
"promptkit", "show", "profile", "notarius/dnd-extraction-development",
|
"promptkit", "show", "profile", "notarius/dnd-extraction-development",
|
||||||
"--config", repositoryPath("examples", "dnd-complete.config.yml"), "--format", "json",
|
"--config", repositoryPath("examples", "dnd-complete", "config.yml"), "--format", "json",
|
||||||
}, &stdout, &stderr, Options{})
|
}, &stdout, &stderr, options)
|
||||||
if code != 0 || stderr.Len() != 0 || !json.Valid([]byte(stdout.String())) || !strings.Contains(stdout.String(), "dnd-extraction-development") {
|
if code != 0 || stderr.Len() != 0 || !json.Valid([]byte(stdout.String())) || !strings.Contains(stdout.String(), "dnd-extraction-development") {
|
||||||
t.Fatalf("development profile inspection: status=%d stdout=%q stderr=%q", code, stdout.String(), stderr.String())
|
t.Fatalf("development profile inspection: status=%d stdout=%q stderr=%q", code, stdout.String(), stderr.String())
|
||||||
}
|
}
|
||||||
|
if len(client.requestsSnapshot()) != 0 {
|
||||||
|
t.Fatal("offline example validation or inspection called provider")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func exampleStepLaneIDs(resolved pipeline.ResolvedPipeline) []string {
|
func exampleStepLaneIDs(resolved pipeline.ResolvedPipeline) []string {
|
||||||
@@ -244,7 +302,8 @@ func generatedReferenceBindingDescriptions(resolved pipeline.ResolvedPipeline) [
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestMaintainedMinimalInvocationPublishesDomainArtifacts(t *testing.T) {
|
func TestMaintainedMinimalInvocationPublishesDomainArtifacts(t *testing.T) {
|
||||||
cfg := loadMaintainedExample(t, repositoryPath("examples", "dnd-minimal.config.yml"))
|
t.Setenv("OPENROUTER_API_KEY", "notarius-test-credential")
|
||||||
|
cfg := loadMaintainedExample(t, repositoryPath("examples", "dnd-minimal", "config.yml"))
|
||||||
resolved, err := cfg.Resolve(resolveInputForMaintainedExample(productionTestComponents(t), "dnd-session"))
|
resolved, err := cfg.Resolve(resolveInputForMaintainedExample(productionTestComponents(t), "dnd-session"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
@@ -259,8 +318,8 @@ func TestMaintainedMinimalInvocationPublishesDomainArtifacts(t *testing.T) {
|
|||||||
var stdout, stderr strings.Builder
|
var stdout, stderr strings.Builder
|
||||||
code := RunWithOptions([]string{
|
code := RunWithOptions([]string{
|
||||||
"run", "dnd-session",
|
"run", "dnd-session",
|
||||||
"--config", repositoryPath("examples", "dnd-minimal.config.yml"),
|
"--config", repositoryPath("examples", "dnd-minimal", "config.yml"),
|
||||||
"--input-file", repositoryPath("examples", "seriatim-minimal-transcript.json"),
|
"--input-file", repositoryPath("examples", "dnd-minimal", "transcript.json"),
|
||||||
"--lane", "spells", "--cache", "bypass", "--output-dir", outputRoot, "--format", "json",
|
"--lane", "spells", "--cache", "bypass", "--output-dir", outputRoot, "--format", "json",
|
||||||
}, &stdout, &stderr, options)
|
}, &stdout, &stderr, options)
|
||||||
if code != 0 {
|
if code != 0 {
|
||||||
@@ -301,7 +360,7 @@ func TestMaintainedMalformedInputOnlyRecordsDebugFailureWhenRequested(t *testing
|
|||||||
options := productionRunOptions(t, client)
|
options := productionRunOptions(t, client)
|
||||||
args := []string{
|
args := []string{
|
||||||
"run", "dnd-session",
|
"run", "dnd-session",
|
||||||
"--config", repositoryPath("examples", "dnd-minimal.config.yml"),
|
"--config", repositoryPath("examples", "dnd-minimal", "config.yml"),
|
||||||
"--input-file", malformed, "--cache", "bypass", "--output-dir", outputRoot,
|
"--input-file", malformed, "--cache", "bypass", "--output-dir", outputRoot,
|
||||||
}
|
}
|
||||||
if debug {
|
if debug {
|
||||||
@@ -340,7 +399,7 @@ func resolveInputForMaintainedExample(components productionComponents, pipelineI
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestCompleteDNDSharedCLIReferencesExpandAcrossCompatibleTargets(t *testing.T) {
|
func TestCompleteDNDSharedCLIReferencesExpandAcrossCompatibleTargets(t *testing.T) {
|
||||||
cfg := loadMaintainedExample(t, repositoryPath("examples", "dnd-complete.config.yml"))
|
cfg := loadMaintainedExample(t, repositoryPath("examples", "dnd-complete", "config.yml"))
|
||||||
catalog := catalogFromRegistries(productionTestComponents(t).registries)
|
catalog := catalogFromRegistries(productionTestComponents(t).registries)
|
||||||
sources := map[string]string{
|
sources := map[string]string{
|
||||||
"party": "/references/party.txt",
|
"party": "/references/party.txt",
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ pipelines:
|
|||||||
configPath := writeProductionContractConfig(t, content)
|
configPath := writeProductionContractConfig(t, content)
|
||||||
client := &productionFakeLLMClient{}
|
client := &productionFakeLLMClient{}
|
||||||
var stdout, stderr strings.Builder
|
var stdout, stderr strings.Builder
|
||||||
code := RunWithOptions([]string{"run", "dnd-session", "--config", configPath, "--input-file", repositoryPath("examples", "seriatim-minimal-transcript.json")}, &stdout, &stderr, productionRunOptions(t, client))
|
code := RunWithOptions([]string{"run", "dnd-session", "--config", configPath, "--input-file", repositoryPath("examples", "dnd-minimal", "transcript.json")}, &stdout, &stderr, productionRunOptions(t, client))
|
||||||
for _, fragment := range []string{`pipeline "dnd-session"`, `reference slot "npc_registry"`, "1048577 bytes", "limit 1048576"} {
|
for _, fragment := range []string{`pipeline "dnd-session"`, `reference slot "npc_registry"`, "1048577 bytes", "limit 1048576"} {
|
||||||
if code == 0 || !strings.Contains(stderr.String(), fragment) {
|
if code == 0 || !strings.Contains(stderr.String(), fragment) {
|
||||||
t.Fatalf("status=%d stderr=%q, want %q", code, stderr.String(), fragment)
|
t.Fatalf("status=%d stderr=%q, want %q", code, stderr.String(), fragment)
|
||||||
|
|||||||
@@ -388,14 +388,14 @@ func TestProductionSpellNormalizerRejectsInvalidCatalogReferencesBeforeExecution
|
|||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
content := productionSpellCatalogContractConfig(t)
|
content := productionSpellCatalogContractConfig(t)
|
||||||
catalogSource := repositoryPath("examples", "dnd-spell-catalog.json")
|
catalogSource := repositoryPath("examples", "dnd-complete", "spell-catalog.json")
|
||||||
content = strings.Replace(content, catalogSource, "__extract_catalog__", 1)
|
content = strings.Replace(content, catalogSource, "__extract_catalog__", 1)
|
||||||
content = replaceRequiredOnce(t, content, catalogSource, catalogPath)
|
content = replaceRequiredOnce(t, content, catalogSource, catalogPath)
|
||||||
content = replaceRequiredOnce(t, content, "__extract_catalog__", catalogSource)
|
content = replaceRequiredOnce(t, content, "__extract_catalog__", catalogSource)
|
||||||
configFile := writeProductionContractConfig(t, content)
|
configFile := writeProductionContractConfig(t, content)
|
||||||
client := &productionFakeLLMClient{}
|
client := &productionFakeLLMClient{}
|
||||||
var stdout, stderr strings.Builder
|
var stdout, stderr strings.Builder
|
||||||
code := RunWithOptions([]string{"run", "dnd-session", "--config", configFile, "--input-file", repositoryPath("examples", "seriatim-minimal-transcript.json"), "--cache", "bypass"}, &stdout, &stderr, productionRunOptions(t, client))
|
code := RunWithOptions([]string{"run", "dnd-session", "--config", configFile, "--input-file", repositoryPath("examples", "dnd-minimal", "transcript.json"), "--cache", "bypass"}, &stdout, &stderr, productionRunOptions(t, client))
|
||||||
for _, fragment := range []string{"normalize", `lane "spells"`, `reference slot "spell_catalog"`, "1048577 bytes", "limit 1048576"} {
|
for _, fragment := range []string{"normalize", `lane "spells"`, `reference slot "spell_catalog"`, "1048577 bytes", "limit 1048576"} {
|
||||||
if code == 0 || !strings.Contains(stderr.String(), fragment) {
|
if code == 0 || !strings.Contains(stderr.String(), fragment) {
|
||||||
t.Fatalf("status=%d stderr=%q, want %q", code, stderr.String(), fragment)
|
t.Fatalf("status=%d stderr=%q, want %q", code, stderr.String(), fragment)
|
||||||
@@ -565,7 +565,7 @@ func TestProductionSceneRunPublishesAnnotationFreeChunkPlan(t *testing.T) {
|
|||||||
path := writeProductionContractConfig(t, productionRunConfig(outputRoot, "dnd/scenes"))
|
path := writeProductionContractConfig(t, productionRunConfig(outputRoot, "dnd/scenes"))
|
||||||
client := &productionFakeLLMClient{}
|
client := &productionFakeLLMClient{}
|
||||||
var stdout, stderr strings.Builder
|
var stdout, stderr strings.Builder
|
||||||
code := RunWithOptions([]string{"run", "dnd-session", "--config", path, "--input-file", repositoryPath("examples", "seriatim-minimal-transcript.json"), "--cache", "bypass", "--llm-session-id", "offline-session", "--format", "json"}, &stdout, &stderr, productionRunOptions(t, client))
|
code := RunWithOptions([]string{"run", "dnd-session", "--config", path, "--input-file", repositoryPath("examples", "dnd-minimal", "transcript.json"), "--cache", "bypass", "--llm-session-id", "offline-session", "--format", "json"}, &stdout, &stderr, productionRunOptions(t, client))
|
||||||
if code != 0 {
|
if code != 0 {
|
||||||
t.Fatalf("status=%d stdout=%q stderr=%q", code, stdout.String(), stderr.String())
|
t.Fatalf("status=%d stdout=%q stderr=%q", code, stdout.String(), stderr.String())
|
||||||
}
|
}
|
||||||
@@ -615,8 +615,8 @@ type maintainedExample struct {
|
|||||||
func maintainedExampleFiles(t *testing.T) []maintainedExample {
|
func maintainedExampleFiles(t *testing.T) []maintainedExample {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
return []maintainedExample{
|
return []maintainedExample{
|
||||||
{name: "minimal", path: repositoryPath("examples", "dnd-minimal.config.yml"), transcriptPath: repositoryPath("examples", "seriatim-minimal-transcript.json"), pipelineIDs: []string{"dnd-session"}},
|
{name: "minimal", path: repositoryPath("examples", "dnd-minimal", "config.yml"), transcriptPath: repositoryPath("examples", "dnd-minimal", "transcript.json"), pipelineIDs: []string{"dnd-session"}},
|
||||||
{name: "complete", path: repositoryPath("examples", "dnd-complete.config.yml"), transcriptPath: repositoryPath("examples", "dnd-complete-transcript.json"), pipelineIDs: []string{"dnd-session", "dnd-session-development"}},
|
{name: "complete", path: repositoryPath("examples", "dnd-complete", "config.yml"), transcriptPath: repositoryPath("examples", "dnd-complete", "transcript.json"), pipelineIDs: []string{"dnd-session", "dnd-session-development"}},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -644,7 +644,7 @@ pipelines:
|
|||||||
references:
|
references:
|
||||||
spell_catalog:
|
spell_catalog:
|
||||||
path: %q
|
path: %q
|
||||||
`, repositoryPath("examples", "dnd-party.txt"), repositoryPath("examples", "dnd-glossary.txt"), repositoryPath("examples", "dnd-spell-catalog.json"), repositoryPath("examples", "dnd-spell-catalog.json"))
|
`, repositoryPath("examples", "dnd-complete", "party.txt"), repositoryPath("examples", "dnd-complete", "glossary.txt"), repositoryPath("examples", "dnd-complete", "spell-catalog.json"), repositoryPath("examples", "dnd-complete", "spell-catalog.json"))
|
||||||
}
|
}
|
||||||
|
|
||||||
func writeProductionSpellCatalogContractConfig(t *testing.T) string {
|
func writeProductionSpellCatalogContractConfig(t *testing.T) string {
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ func TestProductionSpellCatalogValidationCoordinatesCorrections(t *testing.T) {
|
|||||||
}
|
}
|
||||||
output, err := pipeline.New().Run(context.Background(), pipeline.RunInput{
|
output, err := pipeline.New().Run(context.Background(), pipeline.RunInput{
|
||||||
Prepared: prepared,
|
Prepared: prepared,
|
||||||
RawInput: readRepositoryFile(t, "examples", "seriatim-minimal-transcript.json"),
|
RawInput: readRepositoryFile(t, "examples", "dnd-minimal", "transcript.json"),
|
||||||
})
|
})
|
||||||
if calls := llmClient.CallCount(); calls > additionalTurns+1 || calls != tt.wantCalls {
|
if calls := llmClient.CallCount(); calls > additionalTurns+1 || calls != tt.wantCalls {
|
||||||
t.Fatalf("LLM calls = %d, want %d and no more than %d", calls, tt.wantCalls, additionalTurns+1)
|
t.Fatalf("LLM calls = %d, want %d and no more than %d", calls, tt.wantCalls, additionalTurns+1)
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ func TestMaterializedSpellCatalogOrderingPreservesSemanticContents(t *testing.T)
|
|||||||
|
|
||||||
func TestConfiguredSpellCatalogBindingChangesResolvedPipelineIdentity(t *testing.T) {
|
func TestConfiguredSpellCatalogBindingChangesResolvedPipelineIdentity(t *testing.T) {
|
||||||
base := productionSpellCatalogContractConfig(t)
|
base := productionSpellCatalogContractConfig(t)
|
||||||
changed := strings.Replace(base, repositoryPath("examples", "dnd-spell-catalog.json"), filepath.Join(t.TempDir(), "alternate-spell-catalog.json"), 1)
|
changed := strings.Replace(base, repositoryPath("examples", "dnd-complete", "spell-catalog.json"), filepath.Join(t.TempDir(), "alternate-spell-catalog.json"), 1)
|
||||||
if changed == base {
|
if changed == base {
|
||||||
t.Fatal("production configuration did not contain the maintained catalog binding")
|
t.Fatal("production configuration did not contain the maintained catalog binding")
|
||||||
}
|
}
|
||||||
@@ -108,7 +108,7 @@ func TestProductionOverlayRunAlignsGroundingAndValidation(t *testing.T) {
|
|||||||
client := &productionFakeLLMClient{spellResponse: productionSpellResponse("Aegis of Emberfall")}
|
client := &productionFakeLLMClient{spellResponse: productionSpellResponse("Aegis of Emberfall")}
|
||||||
configPath := writeProductionContractConfig(t, productionSpellCatalogContractConfig(t)+productionProviderConfiguration)
|
configPath := writeProductionContractConfig(t, productionSpellCatalogContractConfig(t)+productionProviderConfiguration)
|
||||||
var stdout, stderr strings.Builder
|
var stdout, stderr strings.Builder
|
||||||
code := RunWithOptions([]string{"run", "dnd-session", "--config", configPath, "--input-file", repositoryPath("examples", "seriatim-minimal-transcript.json"), "--lane", "spells", "--cache", "bypass", "--output-dir", outputRoot, "--format", "json"}, &stdout, &stderr, productionRunOptions(t, client))
|
code := RunWithOptions([]string{"run", "dnd-session", "--config", configPath, "--input-file", repositoryPath("examples", "dnd-minimal", "transcript.json"), "--lane", "spells", "--cache", "bypass", "--output-dir", outputRoot, "--format", "json"}, &stdout, &stderr, productionRunOptions(t, client))
|
||||||
if code != 0 {
|
if code != 0 {
|
||||||
t.Fatalf("status=%d stdout=%q stderr=%q", code, stdout.String(), stderr.String())
|
t.Fatalf("status=%d stdout=%q stderr=%q", code, stdout.String(), stderr.String())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ func newStateRunFixture(t *testing.T) *stateRunFixture {
|
|||||||
root := t.TempDir()
|
root := t.TempDir()
|
||||||
fixture := &stateRunFixture{
|
fixture := &stateRunFixture{
|
||||||
configPath: filepath.Join(root, "config.yml"),
|
configPath: filepath.Join(root, "config.yml"),
|
||||||
inputPath: repositoryPath("examples", "seriatim-minimal-transcript.json"),
|
inputPath: repositoryPath("examples", "dnd-minimal", "transcript.json"),
|
||||||
outputRoot: filepath.Join(root, "output"), cacheRoot: filepath.Join(root, "cache"), debugRoot: filepath.Join(root, "debug"),
|
outputRoot: filepath.Join(root, "output"), cacheRoot: filepath.Join(root, "cache"), debugRoot: filepath.Join(root, "debug"),
|
||||||
client: &productionFakeLLMClient{},
|
client: &productionFakeLLMClient{},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user