Update public documentation for shared native configuration

This commit is contained in:
2026-11-23 03:41:47 +00:00
parent ede8514450
commit 6e8c0a0c0c
6 changed files with 150 additions and 308 deletions

View File

@@ -5,12 +5,11 @@ an HTTP service. It prepares prompt requests, runs them against
OpenAI-compatible model endpoints, and returns generated output with validation OpenAI-compatible model endpoints, and returns generated output with validation
metadata. metadata.
CommandKit supplies native configuration, resource discovery, preview, reporting, The application uses [PromptKit v0.25.0](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/207677e9948dc5699073a4d6620d21139033c72d/docs/consumers/pkg-promptkit.md)
and completion interfaces alongside application generation and HTTP startup. for prompt execution and [ConfigKit v1.4.0](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/config.md)
for configuration. [CommandKit v0.8.0](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/0b53a63648c536afe50c46f948159116f776adae/docs/cli.md)
The application uses and its ckconfig v0.11.0 and ckprompt v0.12.0 integrations supply native
[PromptKit v0.23.3](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/804a4d32b23aa2e7973400bb0a322a7016574c9f/) configuration, resource discovery, preview, reporting, and completion.
for prompt, profile, schema, preparation, generation, and validation behavior.
Scriptorium owns executable configuration, CLI and HTTP mapping, process Scriptorium owns executable configuration, CLI and HTTP mapping, process
behavior, output presentation, and HTTP artifact-containment policy. behavior, output presentation, and HTTP artifact-containment policy.
@@ -41,11 +40,11 @@ a model. For complete invocation and output behavior, see the
- [Consumer integration overview](docs/consumers/api.md) - [Consumer integration overview](docs/consumers/api.md)
- [Migration from the former Go package](docs/consumers/migrating-to-promptkit.md) - [Migration from the former Go package](docs/consumers/migrating-to-promptkit.md)
- [Native CLI migration](docs/consumers/upgrading-cli.md) - [Native CLI migration](docs/consumers/upgrading-cli.md)
- [Upgrade Promptkit source selectors and definitions](docs/consumers/upgrading-promptkit.md) - [Upgrade PromptKit definitions](docs/consumers/upgrading-promptkit.md)
- [Subprocess integration](docs/integrations/subprocess.md) - [Subprocess integration](docs/integrations/subprocess.md)
- [Architecture policy](docs/policy/architecture.md) - [Architecture policy](docs/policy/architecture.md)
- [Promptkit framework formats](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/804a4d32b23aa2e7973400bb0a322a7016574c9f/docs/formats.md) - [PromptKit framework formats](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/207677e9948dc5699073a4d6620d21139033c72d/docs/formats.md)
- [Promptkit Go consumer guide](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/804a4d32b23aa2e7973400bb0a322a7016574c9f/docs/consumers/pkg-promptkit.md) - [PromptKit Go consumer guide](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/207677e9948dc5699073a4d6620d21139033c72d/docs/consumers/pkg-promptkit.md)
## Examples ## Examples

View File

@@ -67,13 +67,11 @@ The optional `model` object accepts `endpoint`, `model`, `temperature`,
`max_tokens`, `top_p`, `timeout_seconds`, `service_tier`, `max_tokens`, `top_p`, `timeout_seconds`, `service_tier`,
`reasoning_effort`, `api_key_env`, and `extra_params`. Numeric ranges and `reasoning_effort`, `api_key_env`, and `extra_params`. Numeric ranges and
framework credential semantics are defined by the framework credential semantics are defined by the
[PromptKit v0.23.3 format reference](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/804a4d32b23aa2e7973400bb0a322a7016574c9f/docs/formats.md). [PromptKit v0.25.0 format reference](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/207677e9948dc5699073a4d6620d21139033c72d/docs/formats.md).
Explicit zero values for the numeric fields are overrides; zero Explicit zero values for the numeric fields are overrides; zero
`timeout_seconds` disables the per-attempt generation deadline only, retaining the `timeout_seconds` disables the per-attempt generation deadline only, retaining the
request context and configured transport cap. The timeout layers are defined in request context and configured transport cap. The timeout layers are defined in
the [PromptKit v0.23.3 outbound integration contract](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/804a4d32b23aa2e7973400bb0a322a7016574c9f/docs/integrations/openai-compatible-chat.md#timeout-and-cancellation). the [PromptKit outbound integration contract](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/207677e9948dc5699073a4d6620d21139033c72d/docs/integrations/openai-compatible-chat.md#timeout-and-cancellation).
Each built-in transient retry gets a fresh generation timeout; the caller's
request context remains the outer cancellation boundary.
Raw API-key values are not accepted. `api_key`, the removed `prompt_version`, Raw API-key values are not accepted. `api_key`, the removed `prompt_version`,
and any other unknown field cause `400 invalid_json`. Prompt and profile IDs and any other unknown field cause `400 invalid_json`. Prompt and profile IDs
@@ -83,11 +81,10 @@ are passed unchanged, including qualified collection IDs.
inherits the selected profile, a non-empty string replaces its value, and an inherits the selected profile, a non-empty string replaces its value, and an
empty string explicitly clears it. JSON `null` is treated as omission. empty string explicitly clears it. JSON `null` is treated as omission.
`session_id` is passed directly to Promptkit. A nonblank value replaces a `session_id` is passed directly to PromptKit, which owns its
definition-rendered session ID; omission or a blank value lets the definition [resolution semantics](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/207677e9948dc5699073a4d6620d21139033c72d/docs/consumers/pkg-promptkit.md).
provide one. Promptkit trims direct values and limits them to 256 Unicode code Session IDs can appear in results and provider-facing requests; use
points. Session IDs are not credentials and may be included in prepared data, non-sensitive identifiers.
results, and provider-facing requests, so use stable non-sensitive identifiers.
### Strict JSON ### Strict JSON
@@ -98,8 +95,7 @@ reports any definition-required or template-referenced inputs.
`transient_retries` must be a JSON integer; a wrong type or noninteger number `transient_retries` must be a JSON integer; a wrong type or noninteger number
returns `400 invalid_json`, while a negative integer returns returns `400 invalid_json`, while a negative integer returns
`400 invalid_request` before execution. A request override does not change the `400 invalid_request` before execution. A request override does not change the
shared engine setting used by other requests. Promptkit owns eligible statuses, shared engine setting used by other requests. PromptKit owns retry semantics.
retry waits, and the separate transient budget for each repair generation.
`run_timeout_seconds` must be a JSON int64. A wrong type or int64 overflow `run_timeout_seconds` must be a JSON int64. A wrong type or int64 overflow
returns `400 invalid_json`; a negative value or one whose conversion to a Go returns `400 invalid_json`; a negative value or one whose conversion to a Go
duration would overflow returns `400 invalid_request`. The deadline starts duration would overflow returns `400 invalid_request`. The deadline starts

View File

@@ -1,186 +1,98 @@
# CLI Reference # CLI Reference
Scriptorium uses CommandKit v0.7.0, ckconfig v0.9.0, and ckprompt v0.10.0. Scriptorium installs native [CommandKit v0.8.0 and integration commands][native]
This document owns application invocation and delivery behavior. The pinned alongside application-owned `run` and `serve`. Upstream owns standard command
[upstream CLI contract][native-cli] owns standard family grammar and reports. grammar, reusable flags, reporting, completion, and outcomes. See
[Configuration](config.md) owns discovery, settings, and source composition; [configuration](config.md), the [HTTP contract](api.md), and the
the [HTTP API](api.md) owns the service contract. [CLI migration guide](consumers/upgrading-cli.md) for application choices.
Existing callers should read the [CLI migration guide](consumers/upgrading-cli.md).
## Commands ## Commands
```text ```text
scriptorium run PROMPT_ID [flags] scriptorium run PROMPT_ID [flags]
scriptorium serve [flags] scriptorium serve [flags]
scriptorium config scopes scriptorium config scopes|validate|show|sources|explain|diff [flags]
scriptorium config validate|show|sources|explain|diff [flags] scriptorium promptkit list|show|requirements|test [flags]
scriptorium promptkit list prompts|profiles|backends|namespaces|collections [flags]
scriptorium promptkit show prompt|profile|backend ID [flags]
scriptorium promptkit requirements show|validate PROMPT_ID [flags]
scriptorium promptkit show prepared PROMPT_ID [flags]
scriptorium promptkit test KIND [flags]
scriptorium help [COMMAND ...] scriptorium help [COMMAND ...]
scriptorium version scriptorium version
scriptorium completion bash|zsh|fish scriptorium completion bash|zsh|fish
``` ```
Native help is also available with `--help`. Help, version, scope discovery, Use `--help` for installed commands and flags. Help, version, scope discovery,
and static completion do not load configuration or contact a provider. bare config-explain help, and static completion do not acquire configuration.
Version/revision metadata is supplied by the build; ordinary builds identify Configuration-consuming commands accept `--config PATH` and `--overlay NAME`.
themselves as `dev` with no revision. Release build mechanics belong to the Native `--show-tokens` requests a diagnostic usage/cost summary; quiet mode
[release procedure](release.md). suppresses it. Explicit smoke tests may contact providers and incur cost.
Commands that consume configuration accept `--config PATH` and `--overlay NAME`.
An explicitly empty config value remains explicit; overlay names follow
[ConfigKit selection](config.md#explicit-imports-and-selected-overlays).
There are no source/schema convenience flags or legacy command aliases.
Native shared `--format`, `--quiet`, `--verbose`, `--debug`, and progress
controls retain their upstream meanings. Diagnostics use stderr, not stdout.
Verbose exposes emitted Info and Warning messages without changing result bytes.
## Generation ## Generation
`run` requires exactly one positional prompt ID. It has no duplicate prompt `run` requires one positional prompt ID and uses the native profile, session,
flag or direct backend-selection flag; choose a profile for backend routing. input, execution, and namespace bindings. Preferred aliases omit `llm-`, such
It uses these native bindings, with the preferred aliases below. Canonical as `--profile`, `--input-text`, `--input-file`, `--var`, `--endpoint`, and
spellings prepend `llm-` (for example, `--llm-profile`). `--timeout-seconds`. `--input` and `--llm-input` mean literal input text. The
[native CLI contract][native] owns the full binding and mapping semantics.
There is no duplicate prompt flag or direct backend flag.
| Preferred flags | Meaning | Application-owned controls are `--run-timeout DURATION`, passed unchanged as
| --- | --- | PromptKit's operation budget, and `--report PATH` with optional
| `--profile ID`, `--session-id ID` | Profile selection and optional non-secret session context. | `--report-format text|yaml|json`. Omission of the report format passes native
| `--var KEY=VALUE` | Repeatable caller-variable mappings. | automatic selection. An explicitly empty report path is a usage error.
| `--input-text NAME=TEXT`, `--input NAME=TEXT` | Repeatable literal input mappings; `--llm-input` is also a literal-text alias. |
| `--input-file NAME=PATH` | Repeatable file references. |
| `--endpoint URL`, `--model NAME` | Native endpoint/model overrides. |
| `--temperature N`, `--max-tokens N`, `--top-p N` | Presence-aware numeric overrides, including zero. |
| `--timeout-seconds N` | Integer per-attempt generation timeout; zero disables that deadline, not caller cancellation or the transport cap. |
| `--reasoning-effort VALUE`, `--service-tier VALUE` | Native provider controls; an explicit empty reasoning value is preserved. |
| `--api-key-env NAME` | Credential environment-variable name, never raw key bytes. |
| `--extra-params JSON` | Native JSON-object provider parameters. |
| `--transient-retries N` | Request retry override; omission leaves the engine default. |
| `--prompt-namespace NAME`, `--profile-namespace NAME`, `--backend-namespace NAME` | Independent native namespace views. Qualified resource IDs remain exact; stored references are not rewritten. |
Mappings split at the first `=`; commas and subsequent equals signs are literal.
Repeat flags for multiple mappings. The last text/file occurrence for the same
input wins in command-line order. PromptKit validates selected definitions,
inputs, namespaces, provider settings, and credential requirements; Scriptorium
does not add an execution-readiness preflight or configurable default namespace.
Native string/pointer override semantics remain upstream-owned.
Application-owned generation controls:
| Flag | Meaning |
| --- | --- |
| `--run-timeout DURATION` | Go duration passed unchanged to PromptKit's operation budget. Positive values cover engine preparation/execution, including cooperative waits and repairs. Zero, omission, and negative values add no budget. Parsing, configuration/engine setup, and delivery are outside it. |
| `--report PATH` | Additionally write the returned native result to a separate file. |
| `--report-format text\|yaml\|json` | Explicit separate-report format; omission leaves native automatic rendering selected. |
The operation budget is independent of the integer per-attempt timeout.
Earlier parent cancellation/deadlines still apply. Cancellation is cooperative;
synchronous work that ignores context cannot be forcibly interrupted.
### Results And Separate Reports ### Results And Separate Reports
The main report goes through the invocation reporter to stdout. Automatic/text Automatic/text stdout is exactly the generated artifact bytes, without an added
output is exactly `Artifact.Body`, with no added newline, header, escaping, or newline. Native JSON/YAML output is the full upstream result. Save stdout with
summary. JSON/YAML output is the full native PromptKit `RunResult`, without a shell redirection; there is no output-file flag. Omit `--quiet` to capture the
Scriptorium envelope. In native structured serialization, artifact bytes use main result, since quiet suppresses it even when redirected.
the upstream representation (JSON base64), not an application text projection.
Save main output with shell redirection or the subprocess stdout destination. An explicitly requested report is independently rendered from the same result,
There is no `--output` or `--out` flag. Omit `--quiet` when capturing the main without the artifact-only template, even in quiet mode. Its extension does not
result: native quiet suppresses it even when stdout is redirected. choose a format; `-` is an ordinary filename. Files are created or truncated
normally, with mode 0644 for new files subject to umask; parent directories are
`--report` renders the same result through CommandKit without the artifact-only not created. A resultless failure leaves an existing report untouched. Main
text template. Its format is independent of stdout's `--format` and the filename delivery is attempted first, then the report even if main delivery fails. Writes
extension. Omission passes an unset format to the upstream renderer; it currently are nontransactional; the caller owns redirected destinations and retention.
renders structured values as YAML in automatic/text mode. Choose an explicit
format when required rather than relying on that upstream default.
The requested file is written even in quiet mode. Omission creates no separate
report. An explicitly empty path is a usage error before generation; `-` is an
ordinary filename. New files use mode 0644 subject to umask, existing files use
normal OS replacement behavior, and parent directories are not created.
Render, write, and close failures are reported.
Only a returned result is eligible for delivery. A resultless failure leaves an
existing report untouched; it does not synthesize an invocation-error result.
Main delivery is attempted first, then the requested report even if main
delivery fails. Writes are nontransactional; bytes already written remain.
Callers own redirected paths, retention, and keeping main and report destinations
separate. A shell may truncate its redirected file before the process starts.
## Application Configuration Inspection ## Application Configuration Inspection
The native `config` family defaults to `app`; select `--scope promptkit` for Native `config` defaults to `app`; `promptkit` focuses the same complete load at
captured framework configuration or use native scope discovery/all-scope modes. its framework section. Both scopes accept native overrides and independent
`app` uses the actual completed ConfigKit result and does not construct an engine. comparison selections; paths remain application-root paths. Neither scope
constructs an engine. See [configuration](config.md#inspection-and-credentials)
Native `--set POINTER=JSON` is enabled only for `app`. Records go directly to and the [native CLI contract][native] for scope and path operations.
ConfigKit: duplicate and ancestor/descendant-overlapping paths are rejected,
not resolved by flag order. No application-specific configuration flags or
custom `--against-*` counterparts are installed.
Native diff uses independent `--against-config`, `--against-overlay`, and
supported `--against-set` selections. Omitted right-side values do not inherit
the left side. See the [upstream contract][native-cli] for focused paths,
metadata discovery, source IDs, findings, explanations, and detailed comparisons.
## Framework Configuration Inspection ## Framework Configuration Inspection
The `promptkit` config scope loads application settings selected by `--config` The focused view retains native whole-load evidence and allows explicit queries
and `--overlay`, constructs an engine, and exposes its captured native view. outside its focus. Native sensitivity is not a general-purpose secret filter;
It does not accept temporary overrides; native capability checks also apply inspection, prompt, prepared, and result reports can contain sensitive content.
when an all-scope operation requests them.
Framework effective/explanation views retain native classified-field redaction,
including history. Environment-reference names and ordinary values remain
visible. This is not arbitrary secret detection and does not redact all prompt,
prepared, application, or generated content. Protect reports accordingly.
## Discovery, Preview, And Explicit Smoke Testing ## Discovery, Preview, And Explicit Smoke Testing
Inventories retain native defaults and `--namespace`/`--all-namespaces` filters. Native PromptKit commands expose inventories, named inspection, requirements,
Named inspections expose native prompt messages and profile/backend values; validation, prepared preview, and explicit smoke tests. Requirements discovery
prepared preview exposes rendered content, not a summary projection. is distinct from preparation and generation; consult the
[PromptKit consumer contract][promptkit] and [native CLI contract][native].
Requirements discovery works before input artifacts exist and without schema Prepared and named reports can include prompt content.
loading, credential resolution, message rendering, or provider access. It still
loads configuration and captured message resources. Reports preserve exact names,
metadata, variable presence (including empty values), completeness, and issue
codes. Partial discovery may succeed with status zero; completeness is not
binding satisfaction or execution readiness. Concrete validation and preview
keep their native preparation-time prerequisites and make no generation call.
Smoke-test kinds are `reachability`, `authentication`, `text_inference`,
`structured_output`, or `all`, with native aliases as documented upstream.
These explicit commands may contact providers and incur cost. Their presence
does not add a startup/provider probe. Read the native findings: unsuccessful or
unsupported checks are not automatically invocation failures.
## Server And Statuses ## Server And Statuses
`serve` accepts configuration selection and presence-aware HTTP controls: `serve` accepts `--addr`, `--artifact-root`, `--max-request-bytes`,
`--addr`, `--artifact-root`, `--max-request-bytes`, `--max-artifact-bytes`, `--max-artifact-bytes`, and `--max-response-bytes` in addition to configuration
and `--max-response-bytes`. It has no generation request controls. Values and selection. Interrupt/SIGTERM cancels the invocation and closes the listener and
defaults belong to [configuration](config.md). active connections; no graceful-drain guarantee is added.
Interrupt/SIGTERM cancels the invocation context. The server closes its listener | Status | Application meaning |
and active connections; canceled shutdown returns operational status, with no
graceful-drain deadline or guarantee that context-ignoring work has finished.
| Status | Meaning |
| --- | --- | | --- | --- |
| 0 | Native success, subject to successful presentation/delivery. | | 0 | Success, subject to delivery. |
| 1 | Operational failure, including lookup/preparation/generation/capacity, cancellation/timeouts, unclassified load errors, and delivery failure for an otherwise successful run. | | 1 | Operational failure, cancellation, or delivery failure. |
| 2 | Native usage/declaration-input errors, or configuration errors classified as invalid input by native diagnostic evidence. | | 2 | Usage error or natively classified invalid configuration. |
| 3 | Native `config diff --check` found differences. | | 3 | Native `config diff --check` found differences. |
| 4 | Completed generation returned `ValidationFailed`; artifact and native result remain deliverable. | | 4 | Completed generation failed content validation; its result is delivered. |
Native finalization handles presentation errors: success/usage become operational; Native finalization owns presentation failures. A report-file failure retains
an already nonzero domain outcome retains its classification/status. A report-file an existing nonzero domain status and adds delivery evidence. A resultless
failure preserves completed-validation status 4 while adding its explanation and operation failure does not produce a synthetic result.
cause. An operational failure to perform validation is status 1, not status 4.
JSON selection does not turn failures into a separate JSON error envelope.
[native-cli]: https://forge.maximumdirect.net/base-layer/commandkit/src/commit/d330d7637f2e7507eca931a899397222c82bc892/docs/cli.md [native]: https://forge.maximumdirect.net/base-layer/commandkit/src/commit/0b53a63648c536afe50c46f948159116f776adae/docs/cli.md
[promptkit]: https://forge.maximumdirect.net/base-layer/promptkit/src/commit/207677e9948dc5699073a4d6620d21139033c72d/docs/consumers/pkg-promptkit.md

View File

@@ -1,158 +1,84 @@
# Configuration Reference # Configuration Reference
This document owns Scriptorium's application settings, discovery, and source Scriptorium uses [ConfigKit v1.4.0][configkit] for application configuration
selection. [CLI syntax](cli.md) and the [HTTP API](api.md) have separate owners. and embeds [PromptKit v0.25.0 settings][formats] under `promptkit`. The
Framework definitions and execution semantics belong to the pinned [CLI reference](cli.md) describes selection and inspection commands.
[PromptKit v0.23.3 formats][formats]; ConfigKit v1.2.1 owns
[native composition and inspection][configkit].
## Discovery And Precedence ## Discovery And Precedence
An explicit `--config` selects that file, including an explicitly empty value `--config` selects one main file explicitly, including an empty selection. When
(which fails rather than falling back). With no selection, ConfigKit searches omitted, Scriptorium asks ConfigKit to search its `WorkingDirectory`,
these native presets in order, selecting one main file: `UserConfigDirectory`, `HomeDirectory`, and `UnixSystemDirectories` presets in
that order. Consult [ConfigKit's discovery contract][configkit] for their
expansion, filenames, errors, and optional exhaustion. Candidates are not layers.
| Preset | Directories in order | Filename groups | Scriptorium enables imports and puts PromptKit's bundled OpenRouter definitions
| --- | --- | --- | in the lowest underlay. ConfigKit owns composition, selected overlays, native
| WorkingDirectory | Current working directory | Named only | overrides, validation, and inspection. The completed typed configuration is
| UserConfigDirectory | Go user-config directory / `scriptorium`, then the user-config directory | Named then Generic in the application directory; Named only in the base | passed directly to PromptKit; it is not merged or resolved a second time.
| HomeDirectory | Go home directory / `.scriptorium`, then the home directory | Named then Generic in the application directory; Named only in the base |
| UnixSystemDirectories | `/usr/local/etc/scriptorium`, `/etc/scriptorium`, then `/etc` | Named then Generic in application directories; Named only in `/etc` |
Named means `scriptorium.yml`, then `scriptorium.yaml`. Generic means
`config.yml`, `config.yaml`, `main.yml`, then `main.yaml`.
ConfigKit uses native Go directory resolution (including its user-config/home
environment behavior) and checks every filename in one directory before the next.
Candidates are not configuration layers. Optional exhaustion uses application
defaults; a selected-file acquisition/decoding error is terminal.
ConfigKit assembles the main, enabled imports, and selected overlay, applies its
inheritance/composition rules, creates typed defaults and strictly decodes, applies
explicit override records, then runs application normalization and validation.
An override can correct a decoded value before validation, but cannot repair
source/composition/decoding errors. The completed result is authoritative:
runtime settings conversion does not merge, default, or normalize again.
## Application Settings ## Application Settings
Complete copyable configurations are maintained under See [minimal](../examples/config.yml), [complete](../examples/config.full.yml),
[examples](../examples/config.yml), including [full settings](../examples/config.full.yml), [composed](../examples/config.composed.yml), and
[application imports](../examples/config.composed.yml), [collection discovery](../examples/config.discovery.yml) examples. PromptKit
[framework fragment composition](../examples/config.collections.yml), settings and definitions live under `promptkit`; their fields, formats, resource
[collection checkout discovery](../examples/config.discovery.yml), and contexts, schemas, repair, and provider behavior belong to [PromptKit][formats].
[framework inheritance](../examples/config.inheritance.yml). The former `promptkit.configuration` and `promptkit.schema_dir` selectors are
rejected; use native imports and settings instead.
```yaml | Application field | Default | Meaning |
promptkit:
configuration: ./examples/promptkit.yml
schema_dir: ./examples/schemas
```
The `promptkit` section contains acquisition settings, not embedded framework
definitions. Profiles, prompts, backends, and collections belong in the separate
framework document. The retired `promptkit_sources`, top-level `schema_dir`,
and `defaults.render_format` fields have no compatibility conversion and are
rejected by strict decoding, as are unknown/raw credential fields.
| Field | Default | Meaning |
| --- | --- | --- | | --- | --- | --- |
| `promptkit.configuration` | empty | One external framework file; omission/empty selects no external main. | | `transient_retries` | upstream default | Optional nonnegative engine retry count; null/omission delegates upstream. |
| `promptkit.schema_dir` | `.` | Schema base directory passed to PromptKit. |
| `transient_retries` | upstream default | Optional nonnegative engine retry count. Omitted/null delegates upstream; zero disables additional transient attempts. |
| `server.addr` | `:8080` | HTTP listen address. | | `server.addr` | `:8080` | HTTP listen address. |
| `server.artifact_root` | empty | Root enabling HTTP file-artifact references. | | `server.artifact_root` | empty | Root enabling HTTP file references. |
| `server.max_request_bytes` | `16777216` | Encoded HTTP request limit; zero is unlimited. | | `server.max_request_bytes` | `16777216` | Encoded request limit; zero is unlimited. |
| `server.max_artifact_bytes` | `16777216` | HTTP file-artifact limit; zero is unlimited. | | `server.max_artifact_bytes` | `16777216` | File-artifact limit; zero is unlimited. |
| `server.max_response_bytes` | `16777216` | Encoded HTTP response limit; zero is unlimited. | | `server.max_response_bytes` | `16777216` | Encoded response limit; zero is unlimited. |
Size fields are nonnegative signed 64-bit values. [HTTP behavior](api.md) defines Limits are nonnegative signed 64-bit values. Address whitespace is trimmed and
their enforcement; [operations](operations.md) covers safe deployment choices. the artifact-root path is trimmed and cleaned during native resolution; its
relative path is interpreted from the process working directory. The
ConfigKit strictly decodes application YAML: empty files, unknown fields, [HTTP contract](api.md) describes enforcement.
multiple documents, aliases/anchors, and incompatible/null values fail under its
schema rules. Explicit empty strings and numeric zeros remain values. The
nullable retry field preserves null. Application paths are trimmed/cleaned and
the server address is trimmed within ConfigKit's resolver, with native
normalization evidence. Paths remain relative to process cwd, not the application
file's directory. No general environment-variable override layer is installed.
## Explicit Imports And Selected Overlays ## Explicit Imports And Selected Overlays
Application imports use native root `config.imports` and are enabled during Root `config.imports`, selected `--overlay` names, and `--set` records are
loading. ConfigKit owns paths/directories/globs, requiredness, destination/item passed to ConfigKit. See its [composition and overlay contract][configkit] for
placement, inheritance, sequence policy, and source-root confinement; consult its rules and source-relative paths. Both native inspection scopes support overrides;
[pinned contract][configkit]. Scriptorium does not widen the selected file's paths remain rooted at the application document. Comparison selections are
canonical source root or implement another traversal/merge policy. independent, but process-environment effects follow native sequential behavior.
`--overlay NAME` passes the name unchanged to ConfigKit. At the selected release,
empty and exact lowercase `default` select none; other names use letters,
digits, underscores, or hyphens and select `overlays/NAME.yml` beneath the main
source root. A missing selected overlay fails. It is not a filesystem-path flag,
inherited stack, or fallback-root mechanism. An active overlay after absent-main
search exhaustion has no independent filesystem root in this application.
Only `serve` has named application override flags, for its HTTP settings.
Native application-scope `--set` records are passed directly to ConfigKit.
Nonconflicting records are supported; duplicate and ancestor/descendant paths
are rejected rather than resolved by order. Configuration commands have no
application-defined source/schema/HTTP selectors or comparison counterparts.
Native comparison selections and supported overrides are independent on each side.
## Framework Source Mapping ## Framework Source Mapping
A nonempty resolved `promptkit.configuration` becomes an import-enabled The shared document may import complete framework entries or place wrapperless
`configkit.File` main input to PromptKit. An empty value leaves its main absent. fragments at `promptkit`. The [maintained entry](../examples/promptkit.yml) and
The native bundled OpenRouter underlay remains enabled; no application source [collection example](../examples/collections.yml) illustrate native placement.
list, directory expansion, or local precedence interpreter is installed. No application source list or second framework load is involved.
Imports in that external document compose framework definitions using PromptKit's
schema and ConfigKit's native rules. The [maintained entry file](../examples/promptkit.yml)
imports the application's maintained prompt/profile fragments and backend
definitions. Peer conflicts are errors, not filename-order precedence.
Native whole-record replacement and inheritance remain framework-owned.
Application settings do not embed or re-decode framework definitions.
PromptKit captures message-file resources with their defining source context
when constructing the engine. Schema/artifact reads, credential resolution, and
provider work retain native preparation/runtime lifecycles. The server keeps one
engine until restarted; later CLI invocations perform fresh loads.
### Collection Checkout Discovery ### Collection Checkout Discovery
The [discovery configuration](../examples/config.discovery.yml) selects The [discovery entry](../examples/discovery/framework.yml) imports both optional
[one framework entry](../examples/discovery/framework.yml) with two optional imports: collection-entry spellings. Each checkout declares its own namespace and
source-relative resources. A later invocation sees newly installed checkouts;
```yaml the running server does not hot-reload them.
config:
imports:
- glob: collections/*/collection.yml
- glob: collections/*/collection.yaml
```
Each independently maintained checkout declares its namespace and explicitly
imports its own definitions relative to its entry file. Checkout names do not
determine resource IDs. The [support example](../examples/discovery/collections/support-repo/collection.yml)
imports multiple profiles/prompts and a source-relative message; the
[review example](../examples/discovery/collections/review-repo/collection.yaml)
uses the other spelling. Arbitrary checkout YAML is not loaded implicitly.
Either glob may have no matches. New checkouts become visible on a later
invocation, not through server hot reload. Entries in one discovery document are
peers: conflicting qualified IDs fail instead of relying on glob order.
## Inspection And Credentials ## Inspection And Credentials
The native `app` scope exposes the actual application result without acquiring Both `app` and focused `promptkit` inspect the same kind of complete resolved
framework definitions or credentials. The `promptkit` scope exposes the captured document. Loading and validation cover the whole document; a focused view is
framework result selected by the application config/overlay. They are not merged not an isolation boundary. See [CLI inspection](cli.md#application-configuration-inspection)
into one synthetic document. See [CLI inspection](cli.md#application-configuration-inspection) and [native inspection][configkit].
for operations and independent comparison.
PromptKit owns profiles, namespaces, provider controls, repairs, retries, and Scriptorium explicitly invokes [ConfigKit secrets bootstrap][secrets] before
credential resolution. Store credential environment-variable names, not raw each acquisition. Native main-file controls may populate the process environment;
values; supply the selected environment to the process. Native framework their overwrite and failure behavior belongs to ConfigKit. The
redaction is limited to classified fields and history, not arbitrary sensitive [synthetic example](../examples/config.secrets.yml) demonstrates the integration.
content. Protect application, prompt, prepared, and generated reports as data. PromptKit resolves named credentials at its own lifecycle point. Raw `api_key`
fields in root or collection backends/profiles are rejected; use environment
variable names. Native sensitivity applies to classified paths, not arbitrary
prompt or generated content. Treat inspection and output as potentially sensitive.
[formats]: https://forge.maximumdirect.net/base-layer/promptkit/src/commit/804a4d32b23aa2e7973400bb0a322a7016574c9f/docs/formats.md [formats]: https://forge.maximumdirect.net/base-layer/promptkit/src/commit/207677e9948dc5699073a4d6620d21139033c72d/docs/formats.md
[configkit]: https://forge.maximumdirect.net/base-layer/configkit/src/commit/51ef3144158db1a09fabdbd1c7ae59908c84923b/docs/config.md [configkit]: https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/config.md
[secrets]: https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/config.md#explicit-secrets-directory-bootstrap

View File

@@ -8,11 +8,10 @@ the [framework upgrade guide](consumers/upgrading-promptkit.md) for definitions.
## Deploy Sources And Process ## Deploy Sources And Process
Provide readable application configuration, its selected framework entry file, Provide readable application configuration and explicitly imported definitions
and explicitly imported definitions/resources. Set cwd deliberately: application and resources. Set cwd deliberately for application paths. Framework imports,
path values are cwd-relative, while framework imports and message resources keep message resources, and schema paths use the selected libraries' native source
their native source contexts. ConfigKit confines source imports/overlays to the contexts; see [configuration](config.md).
selected main's canonical root; Scriptorium does not widen it.
Engine construction validates selected effective definitions and captures message Engine construction validates selected effective definitions and captures message
resources/template syntax, including definitions not used by a particular request. resources/template syntax, including definitions not used by a particular request.
@@ -29,13 +28,15 @@ supports both entry-file spellings and multiple definitions. New checkouts or
updates become visible to later invocations or a restarted server. updates become visible to later invocations or a restarted server.
Supply only needed credential environment variables through a supervisor or Supply only needed credential environment variables through a supervisor or
secret-management mechanism. Confirm presence without printing their values. configured [native secrets bootstrap](config.md#inspection-and-credentials).
Bootstrap can change the process environment before each acquisition; comparison
sides retain native sequential effects. Confirm presence without printing values.
Raw keys do not belong in arguments or checked-in configuration. Raw keys do not belong in arguments or checked-in configuration.
## Normal Operator Workflow ## Normal Operator Workflow
1. Validate application configuration through the native application scope. 1. Validate the complete shared configuration through a native scope. This does
This does not acquire framework sources or prove provider readiness. not capture message files or prove provider readiness.
2. Inspect framework configuration/resources and discover requirements for the 2. Inspect framework configuration/resources and discover requirements for the
selected prompt/profile/namespaces. Discovery can precede generated input selected prompt/profile/namespaces. Discovery can precede generated input
artifacts; completeness does not establish satisfied bindings. artifacts; completeness does not establish satisfied bindings.
@@ -59,7 +60,7 @@ Artifacts, prompt messages, prepared content, native run reports, metadata,
diagnostics, and redirected streams are caller-owned potentially sensitive data. diagnostics, and redirected streams are caller-owned potentially sensitive data.
The separate CLI report contains the full returned result, not metadata alone. The separate CLI report contains the full returned result, not metadata alone.
Control access, retention, encryption, backup, and deletion accordingly. Control access, retention, encryption, backup, and deletion accordingly.
Framework effective/explanation views apply native classified-field redaction, Native effective/explanation views apply classified-field redaction,
including history, but do not detect arbitrary secrets. Other content-bearing including history, but do not detect arbitrary secrets. Other content-bearing
reports are not automatically made safe for publication. reports are not automatically made safe for publication.

View File

@@ -476,6 +476,14 @@ Existing HTTP consumers need no reporting-schema migration for this work.
## Stage 9 — Consolidate Public And Operator Documentation Around Upstream Owners ## Stage 9 — Consolidate Public And Operator Documentation Around Upstream Owners
**Status: Complete.** Updated the README, CLI, configuration, operations, and
HTTP references for shared acquisition, native scopes and bootstrap while
retaining application-specific process, delivery, limits, and HTTP wire
contracts. Library-owned detail now links to the selected upstream versions.
Both maintained provider-free preview scripts pass offline, and incoming local
anchors to the revised references were checked. Broader link and upstream-target
verification remains part of the final audit.
**Files:** `README.md`, `docs/cli.md`, `docs/config.md`, `docs/operations.md`, **Files:** `README.md`, `docs/cli.md`, `docs/config.md`, `docs/operations.md`,
`docs/api.md`; maintained example links. `docs/api.md`; maintained example links.