Files
audita/docs/config.md

132 lines
8.1 KiB
Markdown
Raw Permalink Normal View History

# Audita Configuration
Audita uses version 3 application configuration. See the [migration guide](migrations/v3.md)
and [v4.1 migration guide](migrations/v4.1.md), and [examples](../examples/)
for complete projects. Command syntax is owned by
[the CLI reference](cli.md).
## Loading and composition
An explicit `--config` selects one main YAML file. Without it, ConfigKit searches
the working directory, user configuration directory, and Unix system directories
for `audita` configuration. If no file is found, built-in defaults apply. An
explicit invalid selection or failure of a selected file is an error; search does
not continue after a selected file fails. An omitted version uses the v3 schema;
a supplied version must be `3`.
Operator sources may use ConfigKit imports. The selected main file provides the
base for an optional `overlays/<name>.yml`, optional `glossary.yml`, and recursive
`glossary/` YAML files. Without a main source, automatic companion files are not
loaded from the working directory. ConfigKit composes sources, resolves native
inheritance, applies explicit overrides, records derived defaults, and validates
the result. Its [configuration reference](https://forge.maximumdirect.net/base-layer/configkit/src/tag/v1.4.0/docs/config.md)
owns native composition and provenance semantics.
Before shared configuration loading, Audita runs configured ConfigKit secrets
bootstrap against the selected main source. This can populate the process
environment for processing and native inspection; help and version do not load
configuration. A bootstrap failure stops the acquisition before transcript and
output preparation. See the [ConfigKit secrets documentation](https://forge.maximumdirect.net/base-layer/configkit/src/tag/v1.4.0/docs/config.md)
for directory and overwrite controls.
### PromptKit profiles and operator prompts
The combined result contains native PromptKit settings under `/promptkit`.
Audita combines the bundled OpenRouter catalog and its embedded prompts and
schemas with optional wrapperless `prompts.yml` and recursive `prompts/` YAML
files beside the application main. These companions are mounted at `/promptkit`;
a main or overlay may instead contain a `promptkit` section. Native imports,
resource collections, inheritance, and replacement apply.
Profiles, backends, models, credentials, admission, and provider parameters belong
to PromptKit configuration; see its [format reference](https://forge.maximumdirect.net/base-layer/promptkit/src/tag/v0.25.0/docs/formats.md).
The selected prompt owns its output contract and structural-repair budget;
operators replacing a prompt must supply a contract compatible with Audita's
expected response. See the [migration guide](migrations/v4.1.md).
Declare `provider: openrouter` for custom OpenRouter backends or `provider: vllm`
for vLLM; an omitted provider remains generic. Neither an endpoint nor a backend
ID implies provider conventions or zero cost. PromptKit owns those settings and
their [usage and cost semantics](https://forge.maximumdirect.net/base-layer/promptkit/src/tag/v0.25.0/docs/integrations/openai-compatible-chat.md).
The engine captures its sources for an invocation. Edit files and run a new
invocation to pick up changes. Inspection does not require model credentials.
## Pipeline and glossary selections
`glossary_collections` maps names to collections with an ordered `entries` list.
Each entry has an `id`, `name`, and `category`; `description`, `aliases`, and
`plural` provide optional context. Entries are identified within their collection
by `id`. Root `glossaries` and `protected_terms` select collection names. If root
protection is omitted, it derives from the root glossary selection.
`pipeline.stages` is an ordered list of `module` records; supported modules are
`glossary`, `homophones`, `spoken_word`, and `grammar`. The default sequence is
`glossary`, `homophones`, `glossary`, `spoken_word`, `grammar`. Repeated modules
run separately; `[]` runs normalization without model processing. An optional
nonempty, unique `id` identifies a record in evidence. Each record may override
`glossaries`, `protected_terms`, and fields under `llm`,
`validation`, and `context`. Omitted fields inherit their resolved root values.
Explicit empty lists and null list selections clear a selection.
Each entry receives its selected context and independent protection. Glossary
correction exempts active recognized spellings from protection for that entry.
A longer exempt name still takes precedence over a shorter protected spelling
inside it. A glossary correction must have at least one selected entry at
processing preflight. Empty definitions and empty protection remain valid
configuration.
The bundled prompts use English. The modules request complementary work:
- `glossary`: context-supported corrections toward selected glossary terms.
- `homophones`: plausible spoken-word mistranscriptions, including glossary terms.
- `spoken_word`: conservative filler, hesitation, and accidental repetition cleanup.
- `grammar`: punctuation, capitalization, spacing, and whole-word `a`/`an` cleanup.
Otherwise acceptable minor editorial cleanup may be accepted across modules, as
specified by the [editorial acceptance boundary](policy/architecture.md#correction-and-concurrency-invariants).
## Settings
| Setting | Default | Meaning |
| --- | --- | --- |
| `llm.proposal_profile` | unset | PromptKit profile for proposals; required for processing entries. |
| `llm.validation_profile` | effective proposal profile | Profile for model validation; null clears a selection before fallback. |
| `llm.correction_repair_profile` | effective proposal profile | Profile for correction repair; null clears an inherited selection before fallback. |
| `llm.correction_repair_attempts` | `1` | Nonnegative repair attempts per correction; zero disables correction repair. |
| `llm.transient_retries` | `2` | Additional transient attempts per generation. |
| `llm.operation_timeout` | `15m` | Positive duration per logical operation. |
| `validation.max_prompt_tokens` | `2048` | Positive validation batching budget. |
| `context.description` | empty | Prompt context; at most 500 bytes after trimming. |
| `chunking.target_sections` | unset | Optional positive count. Processing requires exactly this many nonempty sections when specified. An infeasible count is an input error. |
| `chunking.max_section_tokens`, `chunking.min_section_tokens` | `8192`, `2048` | The maximum bounds a section's estimated tokens, except for an oversized segment in a section of its own. The minimum is validated against the maximum and retained for compatibility. |
| `normalization.max_segment_gap`, `normalization.ellipsis_gap` | `4`, `3.5` | Nonnegative seconds. |
| `normalization.max_segment_duration`, `normalization.max_segment_tokens` | `60`, `2048` | Positive seconds and token estimate. |
| `output.schema` | `bare-segments` | Output format; see [output contracts](integrations/output-files.md). |
| `reporting.enabled`, `reporting.stdout_dir` | `true`, `.` | Ordinary report capture and default directory for stdout output. |
| `diagnostics.work_dir` | `/tmp/audita` | Parent directory for optional debug capture. |
For example, an entry can disable correction repair or select another profile:
```yaml
llm:
proposal_profile: local
correction_repair_attempts: 2
pipeline:
stages:
- module: grammar
llm:
correction_repair_profile: review
- module: spoken_word
llm:
correction_repair_attempts: 0
```
Processing profiles are selected explicitly; no profile or glossary is selected
automatically. The validation selection falls back after root and per-entry
settings are combined. An explicit root correction repair profile is inherited
by each entry unless overridden or cleared with null; otherwise the entry uses
its effective proposal profile. The repair profile is checked only when its
attempt budget is positive. Each correction repair attempt is a logical call
that can also use the configured transient retries and structural repairs. Null
does not disable validation. Numeric zero and false
retain their field meaning, subject to validation. Inspect recorded origins and
default dependencies using the [native commands](cli.md).