Migrate examples to shared native configuration
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
@@ -3,4 +3,5 @@ config:
|
||||
- path: collections.yml
|
||||
required: true
|
||||
- path: profiles/local-gpu.yml
|
||||
destination: [promptkit]
|
||||
required: true
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
config:
|
||||
imports:
|
||||
- dir: config-fragments/collections
|
||||
destination: [promptkit]
|
||||
pattern: '*.yml'
|
||||
required: true
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
promptkit:
|
||||
configuration: ./examples/promptkit.yml
|
||||
schema_dir: ./examples/schemas
|
||||
config:
|
||||
imports:
|
||||
- path: ../promptkit.yml
|
||||
required: true
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
promptkit:
|
||||
configuration: ./examples/collections.yml
|
||||
schema_dir: ./examples/schemas
|
||||
config:
|
||||
imports:
|
||||
- path: collections.yml
|
||||
required: true
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
promptkit:
|
||||
configuration: ./examples/discovery/framework.yml
|
||||
config:
|
||||
imports:
|
||||
- path: discovery/framework.yml
|
||||
required: true
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
6
examples/config.secrets.yml
Normal file
6
examples/config.secrets.yml
Normal file
@@ -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
|
||||
@@ -1,6 +1,7 @@
|
||||
promptkit:
|
||||
configuration: ./examples/promptkit.yml
|
||||
schema_dir: ./examples/schemas
|
||||
config:
|
||||
imports:
|
||||
- path: promptkit.yml
|
||||
required: true
|
||||
|
||||
server:
|
||||
addr: :8080
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
config:
|
||||
imports:
|
||||
- dir: prompts
|
||||
destination: [promptkit]
|
||||
pattern: '*.yaml'
|
||||
required: true
|
||||
- dir: profiles
|
||||
destination: [promptkit]
|
||||
pattern: '*.y*ml'
|
||||
required: true
|
||||
|
||||
@@ -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: {}
|
||||
|
||||
@@ -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: {}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{"type":"object","properties":{"answer":{"type":"string"}},"required":["answer"]}
|
||||
@@ -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
|
||||
@@ -3,4 +3,5 @@ config:
|
||||
- path: definitions.yml
|
||||
required: true
|
||||
- path: framework/inheritance.yml
|
||||
destination: [promptkit]
|
||||
required: true
|
||||
|
||||
@@ -1,2 +1,6 @@
|
||||
promptkit:
|
||||
configuration: ./examples/collection-gpu.yml
|
||||
profiles:
|
||||
- id: local-gpu
|
||||
backend: local-gpu
|
||||
model: local-model
|
||||
reasoning_effort: low
|
||||
|
||||
@@ -3,4 +3,5 @@ config:
|
||||
- path: definitions.yml
|
||||
required: true
|
||||
- path: framework/backends.yml
|
||||
destination: [promptkit]
|
||||
required: true
|
||||
|
||||
@@ -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
|
||||
|
||||
1
examples/secrets-example/SCRIPTORIUM_EXAMPLE_TOKEN
Normal file
1
examples/secrets-example/SCRIPTORIUM_EXAMPLE_TOKEN
Normal file
@@ -0,0 +1 @@
|
||||
synthetic-example-token
|
||||
@@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user