From 5bab35f096fd688f36f1acfa2a38145b495bbbe2 Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Tue, 17 Nov 2026 20:54:47 +0000 Subject: [PATCH] Compose the complete example from native step fragments --- docs/roadmap/implementation.md | 6 +++ examples/dnd-complete.config.yml | 3 +- .../dnd-session.describe-session.yml | 37 ++++++++++++++++ examples/pipelines/dnd-session.yml | 43 +++---------------- .../cli/dnd_enemy_events_contract_test.go | 7 +++ internal/cli/state_hardening_test.go | 2 +- 6 files changed, 59 insertions(+), 39 deletions(-) create mode 100644 examples/pipelines/dnd-session.describe-session.yml diff --git a/docs/roadmap/implementation.md b/docs/roadmap/implementation.md index 61c8217c..57ae2dde 100644 --- a/docs/roadmap/implementation.md +++ b/docs/roadmap/implementation.md @@ -364,6 +364,12 @@ Prompt size: discovery and cross-boundary behavioral verification. ## 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. Inspect examples/dnd-complete.config.yml, pipelines/dnd-session.yml, development diff --git a/examples/dnd-complete.config.yml b/examples/dnd-complete.config.yml index 20a8c7e3..87771e29 100644 --- a/examples/dnd-complete.config.yml +++ b/examples/dnd-complete.config.yml @@ -1,7 +1,8 @@ version: 5 -configkit: +config: imports: - path: pipelines/dnd-session.yml + required: true promptkit: profile_file: ./llm-profiles/dnd-extraction.yml transient_retries: 2 diff --git a/examples/pipelines/dnd-session.describe-session.yml b/examples/pipelines/dnd-session.describe-session.yml new file mode 100644 index 00000000..ffc346db --- /dev/null +++ b/examples/pipelines/dnd-session.describe-session.yml @@ -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 diff --git a/examples/pipelines/dnd-session.yml b/examples/pipelines/dnd-session.yml index 7703baf5..c4010cab 100644 --- a/examples/pipelines/dnd-session.yml +++ b/examples/pipelines/dnd-session.yml @@ -1,3 +1,9 @@ +config: + imports: + - path: dnd-session.describe-session.yml + required: true + destination: [pipelines, dnd-session, steps] + placement: sequence-item pipelines: dnd-session: llm_profile: dnd-extraction @@ -30,43 +36,6 @@ pipelines: - npc-occurrences - enemy-events 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 # Accepted registry artifacts and scene-description eligibility artifacts # are supplied in memory to their compatible consumers in this step. diff --git a/internal/cli/dnd_enemy_events_contract_test.go b/internal/cli/dnd_enemy_events_contract_test.go index 0fc3f4ae..62365e31 100644 --- a/internal/cli/dnd_enemy_events_contract_test.go +++ b/internal/cli/dnd_enemy_events_contract_test.go @@ -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 { 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") if err := os.WriteFile(path, []byte(updated), 0o600); err != nil { t.Fatal(err) diff --git a/internal/cli/state_hardening_test.go b/internal/cli/state_hardening_test.go index a8ed64b7..b5b2f609 100644 --- a/internal/cli/state_hardening_test.go +++ b/internal/cli/state_hardening_test.go @@ -154,7 +154,7 @@ func TestRunRetainsDebugBundlesAcrossFailures(t *testing.T) { root := filepath.Join(t.TempDir(), "debug") 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()) - 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()) } assertAbsent(t, root)