Compose the complete example from native step fragments

This commit is contained in:
2026-11-17 20:54:47 +00:00
parent 8136b4814f
commit 5bab35f096
6 changed files with 59 additions and 39 deletions

View File

@@ -364,6 +364,12 @@ Prompt size: discovery and cross-boundary behavioral verification.
## Stage 8 — Maintain Runnable Native Composition Examples ## Stage 8 — Maintain Runnable Native Composition Examples
**Complete.** The complete example imports its first step as a required native
sequence item; existing order, handoff, and inheritance assertions pass. The
CLI and module-integration suites and credential-free minimal, complete, and
development validation pass. An old missing-source diagnostic assertion was
also updated to match the delegated loader.
Goal: demonstrate the approved features in the existing two top-level examples. Goal: demonstrate the approved features in the existing two top-level examples.
Inspect examples/dnd-complete.config.yml, pipelines/dnd-session.yml, development Inspect examples/dnd-complete.config.yml, pipelines/dnd-session.yml, development

View File

@@ -1,7 +1,8 @@
version: 5 version: 5
configkit: config:
imports: imports:
- path: pipelines/dnd-session.yml - path: pipelines/dnd-session.yml
required: true
promptkit: promptkit:
profile_file: ./llm-profiles/dnd-extraction.yml profile_file: ./llm-profiles/dnd-extraction.yml
transient_retries: 2 transient_retries: 2

View File

@@ -0,0 +1,37 @@
# Establish session-wide reference artifacts before their consumers.
id: describe-session
artifacts:
item-registry:
extract:
module: dnd/item-registry
retries: 2
merge:
module: appendorder
normalize:
module: dnd/item-registry
npc-registry:
extract:
module: dnd/npc-registry
retries: 2
merge:
module: appendorder
normalize:
module: dnd/npc-registry
retries: 2
location-registry:
extract:
module: dnd/location-registry
retries: 2
merge:
module: appendorder
normalize:
module: dnd/location-registry
retries: 2
scene-descriptions:
extract:
module: dnd/scene-descriptions
retries: 2
merge:
module: appendorder
normalize:
module: dnd/scene-descriptions

View File

@@ -1,3 +1,9 @@
config:
imports:
- path: dnd-session.describe-session.yml
required: true
destination: [pipelines, dnd-session, steps]
placement: sequence-item
pipelines: pipelines:
dnd-session: dnd-session:
llm_profile: dnd-extraction llm_profile: dnd-extraction
@@ -30,43 +36,6 @@ pipelines:
- npc-occurrences - npc-occurrences
- enemy-events - enemy-events
steps: steps:
# Establish session-wide reference artifacts before their consumers.
- id: describe-session
artifacts:
item-registry:
extract:
module: dnd/item-registry
retries: 2
merge:
module: appendorder
normalize:
module: dnd/item-registry
npc-registry:
extract:
module: dnd/npc-registry
retries: 2
merge:
module: appendorder
normalize:
module: dnd/npc-registry
retries: 2
location-registry:
extract:
module: dnd/location-registry
retries: 2
merge:
module: appendorder
normalize:
module: dnd/location-registry
retries: 2
scene-descriptions:
extract:
module: dnd/scene-descriptions
retries: 2
merge:
module: appendorder
normalize:
module: dnd/scene-descriptions
- id: extract-events - id: extract-events
# Accepted registry artifacts and scene-description eligibility artifacts # Accepted registry artifacts and scene-description eligibility artifacts
# are supplied in memory to their compatible consumers in this step. # are supplied in memory to their compatible consumers in this step.

View File

@@ -286,6 +286,13 @@ func completeExampleConfigWithTemporaryCache(t *testing.T) string {
if err := os.WriteFile(filepath.Join(root, "pipelines", "dnd-session.yml"), fragment, 0o600); err != nil { if err := os.WriteFile(filepath.Join(root, "pipelines", "dnd-session.yml"), fragment, 0o600); err != nil {
t.Fatal(err) t.Fatal(err)
} }
description, err := os.ReadFile(repositoryPath("examples", "pipelines", "dnd-session.describe-session.yml"))
if err != nil {
t.Fatal(err)
}
if err := os.WriteFile(filepath.Join(root, "pipelines", "dnd-session.describe-session.yml"), description, 0o600); err != nil {
t.Fatal(err)
}
path := filepath.Join(root, "dnd-complete.config.yml") path := filepath.Join(root, "dnd-complete.config.yml")
if err := os.WriteFile(path, []byte(updated), 0o600); err != nil { if err := os.WriteFile(path, []byte(updated), 0o600); err != nil {
t.Fatal(err) t.Fatal(err)

View File

@@ -154,7 +154,7 @@ func TestRunRetainsDebugBundlesAcrossFailures(t *testing.T) {
root := filepath.Join(t.TempDir(), "debug") root := filepath.Join(t.TempDir(), "debug")
var stdout, stderr bytes.Buffer var stdout, stderr bytes.Buffer
code := RunWithOptions([]string{"run", "sample", "--config", filepath.Join(t.TempDir(), "missing.yml"), "--input", "missing", "--debug", "--debug-dir", root}, &stdout, &stderr, newStateTestHarness().options()) code := RunWithOptions([]string{"run", "sample", "--config", filepath.Join(t.TempDir(), "missing.yml"), "--input", "missing", "--debug", "--debug-dir", root}, &stdout, &stderr, newStateTestHarness().options())
if code != 1 || !strings.Contains(stderr.String(), "config file") { if code != 1 || !strings.Contains(stderr.String(), "source.missing") {
t.Fatalf("code=%d stderr=%q", code, stderr.String()) t.Fatalf("code=%d stderr=%q", code, stderr.String())
} }
assertAbsent(t, root) assertAbsent(t, root)