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
|
## 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
|
**Files:** application/definition YAML under `examples/`, maintained preview
|
||||||
scripts, representative collection resources, and example-loading tests.
|
scripts, representative collection resources, and example-loading tests.
|
||||||
|
|
||||||
|
|||||||
@@ -3,4 +3,5 @@ config:
|
|||||||
- path: collections.yml
|
- path: collections.yml
|
||||||
required: true
|
required: true
|
||||||
- path: profiles/local-gpu.yml
|
- path: profiles/local-gpu.yml
|
||||||
|
destination: [promptkit]
|
||||||
required: true
|
required: true
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
config:
|
config:
|
||||||
imports:
|
imports:
|
||||||
- dir: config-fragments/collections
|
- dir: config-fragments/collections
|
||||||
|
destination: [promptkit]
|
||||||
pattern: '*.yml'
|
pattern: '*.yml'
|
||||||
required: true
|
required: true
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
promptkit:
|
config:
|
||||||
configuration: ./examples/promptkit.yml
|
imports:
|
||||||
schema_dir: ./examples/schemas
|
- path: ../promptkit.yml
|
||||||
|
required: true
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
promptkit:
|
config:
|
||||||
configuration: ./examples/collections.yml
|
imports:
|
||||||
schema_dir: ./examples/schemas
|
- 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:
|
config:
|
||||||
imports:
|
imports:
|
||||||
- path: config-fragments/sources.yml
|
- path: config-fragments/sources.yml
|
||||||
|
|||||||
@@ -1,2 +1,4 @@
|
|||||||
promptkit:
|
config:
|
||||||
configuration: ./examples/discovery/framework.yml
|
imports:
|
||||||
|
- path: discovery/framework.yml
|
||||||
|
required: true
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
promptkit:
|
config:
|
||||||
configuration: ./examples/promptkit.yml
|
imports:
|
||||||
schema_dir: ./examples/schemas
|
- path: promptkit.yml
|
||||||
|
required: true
|
||||||
|
|
||||||
server:
|
server:
|
||||||
addr: 127.0.0.1:8080
|
addr: 127.0.0.1:8080
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Application paths are relative to the repository invocation directory.
|
config:
|
||||||
promptkit:
|
imports:
|
||||||
configuration: ./examples/inheritance.yml
|
- path: inheritance.yml
|
||||||
schema_dir: ./examples/schemas
|
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:
|
config:
|
||||||
configuration: ./examples/promptkit.yml
|
imports:
|
||||||
schema_dir: ./examples/schemas
|
- path: promptkit.yml
|
||||||
|
required: true
|
||||||
|
|
||||||
server:
|
server:
|
||||||
addr: :8080
|
addr: :8080
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
config:
|
config:
|
||||||
imports:
|
imports:
|
||||||
- dir: prompts
|
- dir: prompts
|
||||||
|
destination: [promptkit]
|
||||||
pattern: '*.yaml'
|
pattern: '*.yaml'
|
||||||
required: true
|
required: true
|
||||||
- dir: profiles
|
- dir: profiles
|
||||||
|
destination: [promptkit]
|
||||||
pattern: '*.y*ml'
|
pattern: '*.y*ml'
|
||||||
required: true
|
required: true
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
config:
|
config:
|
||||||
imports:
|
imports:
|
||||||
- path: profiles/base.yaml
|
- path: profiles/base.yaml
|
||||||
destination: [collections, review, profiles]
|
destination: [promptkit, collections, review, profiles]
|
||||||
placement: sequence-item
|
placement: sequence-item
|
||||||
required: true
|
required: true
|
||||||
- path: prompts/answer.yaml
|
- path: prompts/answer.yaml
|
||||||
destination: [collections, review, prompts]
|
destination: [promptkit, collections, review, prompts]
|
||||||
placement: sequence-item
|
placement: sequence-item
|
||||||
required: true
|
required: true
|
||||||
|
promptkit:
|
||||||
collections:
|
collections:
|
||||||
review: {}
|
review: {}
|
||||||
|
|||||||
@@ -1,20 +1,25 @@
|
|||||||
config:
|
config:
|
||||||
imports:
|
imports:
|
||||||
- path: profiles/base.yml
|
- path: profiles/base.yml
|
||||||
destination: [collections, support, profiles]
|
destination: [promptkit, collections, support, profiles]
|
||||||
placement: sequence-item
|
placement: sequence-item
|
||||||
required: true
|
required: true
|
||||||
- path: profiles/fast.yml
|
- path: profiles/fast.yml
|
||||||
destination: [collections, support, profiles]
|
destination: [promptkit, collections, support, profiles]
|
||||||
placement: sequence-item
|
placement: sequence-item
|
||||||
required: true
|
required: true
|
||||||
- path: prompts/answer.yml
|
- path: prompts/answer.yml
|
||||||
destination: [collections, support, prompts]
|
destination: [promptkit, collections, support, prompts]
|
||||||
placement: sequence-item
|
placement: sequence-item
|
||||||
required: true
|
required: true
|
||||||
- path: prompts/summarize.yml
|
- path: prompts/summarize.yml
|
||||||
destination: [collections, support, prompts]
|
destination: [promptkit, collections, support, prompts]
|
||||||
placement: sequence-item
|
placement: sequence-item
|
||||||
required: true
|
required: true
|
||||||
|
- path: prompts/structured.yml
|
||||||
|
destination: [promptkit, collections, support, prompts]
|
||||||
|
placement: sequence-item
|
||||||
|
required: true
|
||||||
|
promptkit:
|
||||||
collections:
|
collections:
|
||||||
support: {}
|
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
|
- path: definitions.yml
|
||||||
required: true
|
required: true
|
||||||
- path: framework/inheritance.yml
|
- path: framework/inheritance.yml
|
||||||
|
destination: [promptkit]
|
||||||
required: true
|
required: true
|
||||||
|
|||||||
@@ -1,2 +1,6 @@
|
|||||||
promptkit:
|
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
|
- path: definitions.yml
|
||||||
required: true
|
required: true
|
||||||
- path: framework/backends.yml
|
- path: framework/backends.yml
|
||||||
|
destination: [promptkit]
|
||||||
required: true
|
required: true
|
||||||
|
|||||||
@@ -19,5 +19,5 @@ prompts:
|
|||||||
output:
|
output:
|
||||||
format: json
|
format: json
|
||||||
validation_mode: json_schema
|
validation_mode: json_schema
|
||||||
schema_path: structured_events.schema.json
|
schema_file: ../schemas/structured_events.schema.json
|
||||||
repair_attempts: 0
|
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