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
metadata.
CommandKit supplies native configuration, resource discovery, preview, reporting,
and completion interfaces alongside application generation and HTTP startup.
The application uses
[PromptKit v0.23.3](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/804a4d32b23aa2e7973400bb0a322a7016574c9f/)
for prompt, profile, schema, preparation, generation, and validation behavior.
The application uses [PromptKit v0.25.0](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/207677e9948dc5699073a4d6620d21139033c72d/docs/consumers/pkg-promptkit.md)
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)
and its ckconfig v0.11.0 and ckprompt v0.12.0 integrations supply native
configuration, resource discovery, preview, reporting, and completion.
Scriptorium owns executable configuration, CLI and HTTP mapping, process
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)
- [Migration from the former Go package](docs/consumers/migrating-to-promptkit.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)
- [Architecture policy](docs/policy/architecture.md)
- [Promptkit framework formats](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/804a4d32b23aa2e7973400bb0a322a7016574c9f/docs/formats.md)
- [Promptkit Go consumer guide](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/804a4d32b23aa2e7973400bb0a322a7016574c9f/docs/consumers/pkg-promptkit.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/207677e9948dc5699073a4d6620d21139033c72d/docs/consumers/pkg-promptkit.md)
## Examples

View File

@@ -67,13 +67,11 @@ The optional `model` object accepts `endpoint`, `model`, `temperature`,
`max_tokens`, `top_p`, `timeout_seconds`, `service_tier`,
`reasoning_effort`, `api_key_env`, and `extra_params`. Numeric ranges and
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
`timeout_seconds` disables the per-attempt generation deadline only, retaining the
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).
Each built-in transient retry gets a fresh generation timeout; the caller's
request context remains the outer cancellation boundary.
the [PromptKit outbound integration contract](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/207677e9948dc5699073a4d6620d21139033c72d/docs/integrations/openai-compatible-chat.md#timeout-and-cancellation).
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
@@ -83,11 +81,10 @@ are passed unchanged, including qualified collection IDs.
inherits the selected profile, a non-empty string replaces its value, and an
empty string explicitly clears it. JSON `null` is treated as omission.
`session_id` is passed directly to Promptkit. A nonblank value replaces a
definition-rendered session ID; omission or a blank value lets the definition
provide one. Promptkit trims direct values and limits them to 256 Unicode code
points. Session IDs are not credentials and may be included in prepared data,
results, and provider-facing requests, so use stable non-sensitive identifiers.
`session_id` is passed directly to PromptKit, which owns its
[resolution semantics](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/207677e9948dc5699073a4d6620d21139033c72d/docs/consumers/pkg-promptkit.md).
Session IDs can appear in results and provider-facing requests; use
non-sensitive identifiers.
### 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
returns `400 invalid_json`, while a negative integer returns
`400 invalid_request` before execution. A request override does not change the
shared engine setting used by other requests. Promptkit owns eligible statuses,
retry waits, and the separate transient budget for each repair generation.
shared engine setting used by other requests. PromptKit owns retry semantics.
`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
duration would overflow returns `400 invalid_request`. The deadline starts

View File

@@ -1,186 +1,98 @@
# CLI Reference
Scriptorium uses CommandKit v0.7.0, ckconfig v0.9.0, and ckprompt v0.10.0.
This document owns application invocation and delivery behavior. The pinned
[upstream CLI contract][native-cli] owns standard family grammar and reports.
[Configuration](config.md) owns discovery, settings, and source composition;
the [HTTP API](api.md) owns the service contract.
Existing callers should read the [CLI migration guide](consumers/upgrading-cli.md).
Scriptorium installs native [CommandKit v0.8.0 and integration commands][native]
alongside application-owned `run` and `serve`. Upstream owns standard command
grammar, reusable flags, reporting, completion, and outcomes. See
[configuration](config.md), the [HTTP contract](api.md), and the
[CLI migration guide](consumers/upgrading-cli.md) for application choices.
## Commands
```text
scriptorium run PROMPT_ID [flags]
scriptorium serve [flags]
scriptorium config scopes
scriptorium config validate|show|sources|explain|diff [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 config scopes|validate|show|sources|explain|diff [flags]
scriptorium promptkit list|show|requirements|test [flags]
scriptorium help [COMMAND ...]
scriptorium version
scriptorium completion bash|zsh|fish
```
Native help is also available with `--help`. Help, version, scope discovery,
and static completion do not load configuration or contact a provider.
Version/revision metadata is supplied by the build; ordinary builds identify
themselves as `dev` with no revision. Release build mechanics belong to the
[release procedure](release.md).
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.
Use `--help` for installed commands and flags. Help, version, scope discovery,
bare config-explain help, and static completion do not acquire configuration.
Configuration-consuming commands accept `--config PATH` and `--overlay NAME`.
Native `--show-tokens` requests a diagnostic usage/cost summary; quiet mode
suppresses it. Explicit smoke tests may contact providers and incur cost.
## Generation
`run` requires exactly one positional prompt ID. It has no duplicate prompt
flag or direct backend-selection flag; choose a profile for backend routing.
It uses these native bindings, with the preferred aliases below. Canonical
spellings prepend `llm-` (for example, `--llm-profile`).
`run` requires one positional prompt ID and uses the native profile, session,
input, execution, and namespace bindings. Preferred aliases omit `llm-`, such
as `--profile`, `--input-text`, `--input-file`, `--var`, `--endpoint`, and
`--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 |
| --- | --- |
| `--profile ID`, `--session-id ID` | Profile selection and optional non-secret session context. |
| `--var KEY=VALUE` | Repeatable caller-variable mappings. |
| `--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.
Application-owned controls are `--run-timeout DURATION`, passed unchanged as
PromptKit's operation budget, and `--report PATH` with optional
`--report-format text|yaml|json`. Omission of the report format passes native
automatic selection. An explicitly empty report path is a usage error.
### Results And Separate Reports
The main report goes through the invocation reporter to stdout. Automatic/text
output is exactly `Artifact.Body`, with no added newline, header, escaping, or
summary. JSON/YAML output is the full native PromptKit `RunResult`, without a
Scriptorium envelope. In native structured serialization, artifact bytes use
the upstream representation (JSON base64), not an application text projection.
Automatic/text stdout is exactly the generated artifact bytes, without an added
newline. Native JSON/YAML output is the full upstream result. Save stdout with
shell redirection; there is no output-file flag. Omit `--quiet` to capture the
main result, since quiet suppresses it even when redirected.
Save main output with shell redirection or the subprocess stdout destination.
There is no `--output` or `--out` flag. Omit `--quiet` when capturing the main
result: native quiet suppresses it even when stdout is redirected.
`--report` renders the same result through CommandKit without the artifact-only
text template. Its format is independent of stdout's `--format` and the filename
extension. Omission passes an unset format to the upstream renderer; it currently
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.
An explicitly requested report is independently rendered from the same result,
without the artifact-only template, even in quiet mode. Its extension does not
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
not created. A resultless failure leaves an existing report untouched. Main
delivery is attempted first, then the report even if main delivery fails. Writes
are nontransactional; the caller owns redirected destinations and retention.
## Application Configuration Inspection
The native `config` family defaults to `app`; select `--scope promptkit` for
captured framework configuration or use native scope discovery/all-scope modes.
`app` uses the actual completed ConfigKit result and does not construct an engine.
Native `--set POINTER=JSON` is enabled only for `app`. Records go directly to
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.
Native `config` defaults to `app`; `promptkit` focuses the same complete load at
its framework section. Both scopes accept native overrides and independent
comparison selections; paths remain application-root paths. Neither scope
constructs an engine. See [configuration](config.md#inspection-and-credentials)
and the [native CLI contract][native] for scope and path operations.
## Framework Configuration Inspection
The `promptkit` config scope loads application settings selected by `--config`
and `--overlay`, constructs an engine, and exposes its captured native view.
It does not accept temporary overrides; native capability checks also apply
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.
The focused view retains native whole-load evidence and allows explicit queries
outside its focus. Native sensitivity is not a general-purpose secret filter;
inspection, prompt, prepared, and result reports can contain sensitive content.
## Discovery, Preview, And Explicit Smoke Testing
Inventories retain native defaults and `--namespace`/`--all-namespaces` filters.
Named inspections expose native prompt messages and profile/backend values;
prepared preview exposes rendered content, not a summary projection.
Requirements discovery works before input artifacts exist and without schema
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.
Native PromptKit commands expose inventories, named inspection, requirements,
validation, prepared preview, and explicit smoke tests. Requirements discovery
is distinct from preparation and generation; consult the
[PromptKit consumer contract][promptkit] and [native CLI contract][native].
Prepared and named reports can include prompt content.
## Server And Statuses
`serve` accepts configuration selection and presence-aware HTTP controls:
`--addr`, `--artifact-root`, `--max-request-bytes`, `--max-artifact-bytes`,
and `--max-response-bytes`. It has no generation request controls. Values and
defaults belong to [configuration](config.md).
`serve` accepts `--addr`, `--artifact-root`, `--max-request-bytes`,
`--max-artifact-bytes`, and `--max-response-bytes` in addition to configuration
selection. Interrupt/SIGTERM cancels the invocation and closes the listener and
active connections; no graceful-drain guarantee is added.
Interrupt/SIGTERM cancels the invocation context. The server closes its listener
and active connections; canceled shutdown returns operational status, with no
graceful-drain deadline or guarantee that context-ignoring work has finished.
| Status | Meaning |
| Status | Application meaning |
| --- | --- |
| 0 | Native success, subject to successful presentation/delivery. |
| 1 | Operational failure, including lookup/preparation/generation/capacity, cancellation/timeouts, unclassified load errors, and delivery failure for an otherwise successful run. |
| 2 | Native usage/declaration-input errors, or configuration errors classified as invalid input by native diagnostic evidence. |
| 0 | Success, subject to delivery. |
| 1 | Operational failure, cancellation, or delivery failure. |
| 2 | Usage error or natively classified invalid configuration. |
| 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;
an already nonzero domain outcome retains its classification/status. A report-file
failure preserves completed-validation status 4 while adding its explanation and
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 finalization owns presentation failures. A report-file failure retains
an existing nonzero domain status and adds delivery evidence. A resultless
operation failure does not produce a synthetic result.
[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
This document owns Scriptorium's application settings, discovery, and source
selection. [CLI syntax](cli.md) and the [HTTP API](api.md) have separate owners.
Framework definitions and execution semantics belong to the pinned
[PromptKit v0.23.3 formats][formats]; ConfigKit v1.2.1 owns
[native composition and inspection][configkit].
Scriptorium uses [ConfigKit v1.4.0][configkit] for application configuration
and embeds [PromptKit v0.25.0 settings][formats] under `promptkit`. The
[CLI reference](cli.md) describes selection and inspection commands.
## Discovery And Precedence
An explicit `--config` selects that file, including an explicitly empty value
(which fails rather than falling back). With no selection, ConfigKit searches
these native presets in order, selecting one main file:
`--config` selects one main file explicitly, including an empty selection. When
omitted, Scriptorium asks ConfigKit to search its `WorkingDirectory`,
`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 |
| --- | --- | --- |
| WorkingDirectory | Current working directory | Named only |
| UserConfigDirectory | Go user-config directory / `scriptorium`, then the user-config directory | Named then Generic in the application directory; Named only in the base |
| 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.
Scriptorium enables imports and puts PromptKit's bundled OpenRouter definitions
in the lowest underlay. ConfigKit owns composition, selected overlays, native
overrides, validation, and inspection. The completed typed configuration is
passed directly to PromptKit; it is not merged or resolved a second time.
## Application Settings
Complete copyable configurations are maintained under
[examples](../examples/config.yml), including [full settings](../examples/config.full.yml),
[application imports](../examples/config.composed.yml),
[framework fragment composition](../examples/config.collections.yml),
[collection checkout discovery](../examples/config.discovery.yml), and
[framework inheritance](../examples/config.inheritance.yml).
See [minimal](../examples/config.yml), [complete](../examples/config.full.yml),
[composed](../examples/config.composed.yml), and
[collection discovery](../examples/config.discovery.yml) examples. PromptKit
settings and definitions live under `promptkit`; their fields, formats, resource
contexts, schemas, repair, and provider behavior belong to [PromptKit][formats].
The former `promptkit.configuration` and `promptkit.schema_dir` selectors are
rejected; use native imports and settings instead.
```yaml
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 |
| Application field | Default | Meaning |
| --- | --- | --- |
| `promptkit.configuration` | empty | One external framework file; omission/empty selects no external main. |
| `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. |
| `transient_retries` | upstream default | Optional nonnegative engine retry count; null/omission delegates upstream. |
| `server.addr` | `:8080` | HTTP listen address. |
| `server.artifact_root` | empty | Root enabling HTTP file-artifact references. |
| `server.max_request_bytes` | `16777216` | Encoded HTTP request limit; zero is unlimited. |
| `server.max_artifact_bytes` | `16777216` | HTTP file-artifact limit; zero is unlimited. |
| `server.max_response_bytes` | `16777216` | Encoded HTTP response limit; zero is unlimited. |
| `server.artifact_root` | empty | Root enabling HTTP file references. |
| `server.max_request_bytes` | `16777216` | Encoded request limit; zero is unlimited. |
| `server.max_artifact_bytes` | `16777216` | File-artifact 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
their enforcement; [operations](operations.md) covers safe deployment choices.
ConfigKit strictly decodes application YAML: empty files, unknown fields,
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.
Limits are nonnegative signed 64-bit values. Address whitespace is trimmed and
the artifact-root path is trimmed and cleaned during native resolution; its
relative path is interpreted from the process working directory. The
[HTTP contract](api.md) describes enforcement.
## Explicit Imports And Selected Overlays
Application imports use native root `config.imports` and are enabled during
loading. ConfigKit owns paths/directories/globs, requiredness, destination/item
placement, inheritance, sequence policy, and source-root confinement; consult its
[pinned contract][configkit]. Scriptorium does not widen the selected file's
canonical source root or implement another traversal/merge policy.
`--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.
Root `config.imports`, selected `--overlay` names, and `--set` records are
passed to ConfigKit. See its [composition and overlay contract][configkit] for
rules and source-relative paths. Both native inspection scopes support overrides;
paths remain rooted at the application document. Comparison selections are
independent, but process-environment effects follow native sequential behavior.
## Framework Source Mapping
A nonempty resolved `promptkit.configuration` becomes an import-enabled
`configkit.File` main input to PromptKit. An empty value leaves its main absent.
The native bundled OpenRouter underlay remains enabled; no application source
list, directory expansion, or local precedence interpreter is installed.
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.
The shared document may import complete framework entries or place wrapperless
fragments at `promptkit`. The [maintained entry](../examples/promptkit.yml) and
[collection example](../examples/collections.yml) illustrate native placement.
No application source list or second framework load is involved.
### Collection Checkout Discovery
The [discovery configuration](../examples/config.discovery.yml) selects
[one framework entry](../examples/discovery/framework.yml) with two optional imports:
```yaml
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.
The [discovery entry](../examples/discovery/framework.yml) imports both optional
collection-entry spellings. Each checkout declares its own namespace and
source-relative resources. A later invocation sees newly installed checkouts;
the running server does not hot-reload them.
## Inspection And Credentials
The native `app` scope exposes the actual application result without acquiring
framework definitions or credentials. The `promptkit` scope exposes the captured
framework result selected by the application config/overlay. They are not merged
into one synthetic document. See [CLI inspection](cli.md#application-configuration-inspection)
for operations and independent comparison.
Both `app` and focused `promptkit` inspect the same kind of complete resolved
document. Loading and validation cover the whole document; a focused view is
not an isolation boundary. See [CLI inspection](cli.md#application-configuration-inspection)
and [native inspection][configkit].
PromptKit owns profiles, namespaces, provider controls, repairs, retries, and
credential resolution. Store credential environment-variable names, not raw
values; supply the selected environment to the process. Native framework
redaction is limited to classified fields and history, not arbitrary sensitive
content. Protect application, prompt, prepared, and generated reports as data.
Scriptorium explicitly invokes [ConfigKit secrets bootstrap][secrets] before
each acquisition. Native main-file controls may populate the process environment;
their overwrite and failure behavior belongs to ConfigKit. The
[synthetic example](../examples/config.secrets.yml) demonstrates the integration.
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
[configkit]: https://forge.maximumdirect.net/base-layer/configkit/src/commit/51ef3144158db1a09fabdbd1c7ae59908c84923b/docs/config.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/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
Provide readable application configuration, its selected framework entry file,
and explicitly imported definitions/resources. Set cwd deliberately: application
path values are cwd-relative, while framework imports and message resources keep
their native source contexts. ConfigKit confines source imports/overlays to the
selected main's canonical root; Scriptorium does not widen it.
Provide readable application configuration and explicitly imported definitions
and resources. Set cwd deliberately for application paths. Framework imports,
message resources, and schema paths use the selected libraries' native source
contexts; see [configuration](config.md).
Engine construction validates selected effective definitions and captures message
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.
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.
## Normal Operator Workflow
1. Validate application configuration through the native application scope.
This does not acquire framework sources or prove provider readiness.
1. Validate the complete shared configuration through a native scope. This does
not capture message files or prove provider readiness.
2. Inspect framework configuration/resources and discover requirements for the
selected prompt/profile/namespaces. Discovery can precede generated input
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.
The separate CLI report contains the full returned result, not metadata alone.
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
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
**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`,
`docs/api.md`; maintained example links.