# Configuration Reference 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 `--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. 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 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. | Application field | Default | Meaning | | --- | --- | --- | | `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 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. | 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 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 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 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 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]. 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/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