diff --git a/docs/roadmap/implementation.md b/docs/roadmap/implementation.md index 91ad954..db393c7 100644 --- a/docs/roadmap/implementation.md +++ b/docs/roadmap/implementation.md @@ -281,6 +281,18 @@ help without bootstrap or feature reports. Both scopes accept native overrides. ## Stage 5 — Migrate Maintained Configuration And Collection Examples +**Status: Complete.** Maintained application entrypoints now import native +framework documents, wrapperless fragments mount under `promptkit`, and the +collection checkouts declare their namespaces and sequence destinations. Added +source-relative structured schemas and a synthetic configured-secrets example; +the collection overlay retains the local GPU profile selection. + +Validated every maintained application configuration in both native scopes, +the standalone collection/GPU entry, both provider-free preview scripts, +structured schema previews, and the collection overlay using the built CLI. +The isolated example bootstrap test passes and restores its environment. The +full maintained-test package remains deferred until old CLI fixtures are migrated. + **Files:** application/definition YAML under `examples/`, maintained preview scripts, representative collection resources, and example-loading tests. diff --git a/examples/collection-gpu.yml b/examples/collection-gpu.yml index 629e086..29cb451 100644 --- a/examples/collection-gpu.yml +++ b/examples/collection-gpu.yml @@ -3,4 +3,5 @@ config: - path: collections.yml required: true - path: profiles/local-gpu.yml + destination: [promptkit] required: true diff --git a/examples/collections.yml b/examples/collections.yml index 08bc483..774f631 100644 --- a/examples/collections.yml +++ b/examples/collections.yml @@ -1,5 +1,6 @@ config: imports: - dir: config-fragments/collections + destination: [promptkit] pattern: '*.yml' required: true diff --git a/examples/config-fragments/sources.yml b/examples/config-fragments/sources.yml index 9dbea30..f57f5a0 100644 --- a/examples/config-fragments/sources.yml +++ b/examples/config-fragments/sources.yml @@ -1,3 +1,4 @@ -promptkit: - configuration: ./examples/promptkit.yml - schema_dir: ./examples/schemas +config: + imports: + - path: ../promptkit.yml + required: true diff --git a/examples/config.collections.yml b/examples/config.collections.yml index 5b99189..0833bf2 100644 --- a/examples/config.collections.yml +++ b/examples/config.collections.yml @@ -1,3 +1,4 @@ -promptkit: - configuration: ./examples/collections.yml - schema_dir: ./examples/schemas +config: + imports: + - path: collections.yml + required: true diff --git a/examples/config.composed.yml b/examples/config.composed.yml index 506419a..a45d2e4 100644 --- a/examples/config.composed.yml +++ b/examples/config.composed.yml @@ -1,4 +1,4 @@ -# Select from the repository root; application paths remain working-directory-relative. +# Imports are relative to this application file. config: imports: - path: config-fragments/sources.yml diff --git a/examples/config.discovery.yml b/examples/config.discovery.yml index 98aa2fa..dccdf45 100644 --- a/examples/config.discovery.yml +++ b/examples/config.discovery.yml @@ -1,2 +1,4 @@ -promptkit: - configuration: ./examples/discovery/framework.yml +config: + imports: + - path: discovery/framework.yml + required: true diff --git a/examples/config.full.yml b/examples/config.full.yml index 4d97fee..de8f925 100644 --- a/examples/config.full.yml +++ b/examples/config.full.yml @@ -1,6 +1,7 @@ -promptkit: - configuration: ./examples/promptkit.yml - schema_dir: ./examples/schemas +config: + imports: + - path: promptkit.yml + required: true server: addr: 127.0.0.1:8080 diff --git a/examples/config.inheritance.yml b/examples/config.inheritance.yml index 8c21754..59571c6 100644 --- a/examples/config.inheritance.yml +++ b/examples/config.inheritance.yml @@ -1,4 +1,4 @@ -# Application paths are relative to the repository invocation directory. -promptkit: - configuration: ./examples/inheritance.yml - schema_dir: ./examples/schemas +config: + imports: + - path: inheritance.yml + required: true diff --git a/examples/config.secrets.yml b/examples/config.secrets.yml new file mode 100644 index 0000000..db6f4d7 --- /dev/null +++ b/examples/config.secrets.yml @@ -0,0 +1,6 @@ +# Native bootstrap: https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/config.md#explicit-secrets-directory-bootstrap +config: + secrets_dir: secrets-example + imports: + - path: promptkit.yml + required: true diff --git a/examples/config.yml b/examples/config.yml index 5457ea4..3574c2d 100644 --- a/examples/config.yml +++ b/examples/config.yml @@ -1,6 +1,7 @@ -promptkit: - configuration: ./examples/promptkit.yml - schema_dir: ./examples/schemas +config: + imports: + - path: promptkit.yml + required: true server: addr: :8080 diff --git a/examples/definitions.yml b/examples/definitions.yml index f2e4aae..a2640b1 100644 --- a/examples/definitions.yml +++ b/examples/definitions.yml @@ -1,8 +1,10 @@ config: imports: - dir: prompts + destination: [promptkit] pattern: '*.yaml' required: true - dir: profiles + destination: [promptkit] pattern: '*.y*ml' required: true diff --git a/examples/discovery/collections/review-repo/collection.yaml b/examples/discovery/collections/review-repo/collection.yaml index 4c83504..3cf6a04 100644 --- a/examples/discovery/collections/review-repo/collection.yaml +++ b/examples/discovery/collections/review-repo/collection.yaml @@ -1,12 +1,13 @@ config: imports: - path: profiles/base.yaml - destination: [collections, review, profiles] + destination: [promptkit, collections, review, profiles] placement: sequence-item required: true - path: prompts/answer.yaml - destination: [collections, review, prompts] + destination: [promptkit, collections, review, prompts] placement: sequence-item required: true -collections: - review: {} +promptkit: + collections: + review: {} diff --git a/examples/discovery/collections/support-repo/collection.yml b/examples/discovery/collections/support-repo/collection.yml index ccd42d5..8877eb4 100644 --- a/examples/discovery/collections/support-repo/collection.yml +++ b/examples/discovery/collections/support-repo/collection.yml @@ -1,20 +1,25 @@ config: imports: - path: profiles/base.yml - destination: [collections, support, profiles] + destination: [promptkit, collections, support, profiles] placement: sequence-item required: true - path: profiles/fast.yml - destination: [collections, support, profiles] + destination: [promptkit, collections, support, profiles] placement: sequence-item required: true - path: prompts/answer.yml - destination: [collections, support, prompts] + destination: [promptkit, collections, support, prompts] placement: sequence-item required: true - path: prompts/summarize.yml - destination: [collections, support, prompts] + destination: [promptkit, collections, support, prompts] placement: sequence-item required: true -collections: - support: {} + - path: prompts/structured.yml + destination: [promptkit, collections, support, prompts] + placement: sequence-item + required: true +promptkit: + collections: + support: {} diff --git a/examples/discovery/collections/support-repo/prompts/structured.schema.json b/examples/discovery/collections/support-repo/prompts/structured.schema.json new file mode 100644 index 0000000..bb507cc --- /dev/null +++ b/examples/discovery/collections/support-repo/prompts/structured.schema.json @@ -0,0 +1 @@ +{"type":"object","properties":{"answer":{"type":"string"}},"required":["answer"]} diff --git a/examples/discovery/collections/support-repo/prompts/structured.yml b/examples/discovery/collections/support-repo/prompts/structured.yml new file mode 100644 index 0000000..cc2b779 --- /dev/null +++ b/examples/discovery/collections/support-repo/prompts/structured.yml @@ -0,0 +1,10 @@ +id: structured +default_profile: support/base +messages: + - role: user + content: Return a short structured answer. +output: + format: json + validation_mode: json_schema + schema_file: structured.schema.json + repair_attempts: 0 diff --git a/examples/inheritance.yml b/examples/inheritance.yml index f443d8b..93ba915 100644 --- a/examples/inheritance.yml +++ b/examples/inheritance.yml @@ -3,4 +3,5 @@ config: - path: definitions.yml required: true - path: framework/inheritance.yml + destination: [promptkit] required: true diff --git a/examples/overlays/collection.yml b/examples/overlays/collection.yml index 72af312..425ee36 100644 --- a/examples/overlays/collection.yml +++ b/examples/overlays/collection.yml @@ -1,2 +1,6 @@ promptkit: - configuration: ./examples/collection-gpu.yml + profiles: + - id: local-gpu + backend: local-gpu + model: local-model + reasoning_effort: low diff --git a/examples/promptkit.yml b/examples/promptkit.yml index 7552cba..210ccef 100644 --- a/examples/promptkit.yml +++ b/examples/promptkit.yml @@ -3,4 +3,5 @@ config: - path: definitions.yml required: true - path: framework/backends.yml + destination: [promptkit] required: true diff --git a/examples/prompts/generic.structured_events.yaml b/examples/prompts/generic.structured_events.yaml index 95a68f4..ec95f56 100644 --- a/examples/prompts/generic.structured_events.yaml +++ b/examples/prompts/generic.structured_events.yaml @@ -19,5 +19,5 @@ prompts: output: format: json validation_mode: json_schema - schema_path: structured_events.schema.json + schema_file: ../schemas/structured_events.schema.json repair_attempts: 0 diff --git a/examples/secrets-example/SCRIPTORIUM_EXAMPLE_TOKEN b/examples/secrets-example/SCRIPTORIUM_EXAMPLE_TOKEN new file mode 100644 index 0000000..d9c94b4 --- /dev/null +++ b/examples/secrets-example/SCRIPTORIUM_EXAMPLE_TOKEN @@ -0,0 +1 @@ +synthetic-example-token diff --git a/internal/adapter/cli/bootstrap_test.go b/internal/adapter/cli/bootstrap_test.go index b529424..7949a31 100644 --- a/internal/adapter/cli/bootstrap_test.go +++ b/internal/adapter/cli/bootstrap_test.go @@ -147,3 +147,17 @@ func TestNativeScopesAndHelpUseSharedLoading(t *testing.T) { } } } + +func TestMaintainedSecretsExample(t *testing.T) { + t.Setenv("SCRIPTORIUM_EXAMPLE_TOKEN", "") + root, err := filepath.Abs(filepath.Join("..", "..", "..")) + if err != nil { + t.Fatal(err) + } + t.Chdir(root) + var out, diagnostic bytes.Buffer + outcome := Execute(context.Background(), commandkit.Identity{Name: "scriptorium"}, []string{"config", "validate", "--scope=promptkit", "--config=examples/config.secrets.yml"}, &out, &diagnostic) + if outcome.Status != 0 || os.Getenv("SCRIPTORIUM_EXAMPLE_TOKEN") != "" { + t.Fatalf("example: %+v %q", outcome, diagnostic.String()) + } +}