Finalize library adoption decisions and native repair defaults

This commit is contained in:
2026-11-23 02:35:15 +00:00
parent 60a80381a9
commit 4dc461f9c9

View File

@@ -1,6 +1,7 @@
# ConfigKit, PromptKit, and CommandKit Upgrade
**Status:** Proposed adoption; implementation has not begun.
**Status:** Adoption decisions agreed; ready for implementation planning.
Implementation has not begun.
**Reviewed:** 2026-11-23, against Audita commit
`da5b8913d1206a8e8f0a784b2322760385548a60` (v4.0.0).
@@ -12,16 +13,17 @@ PromptKit's application-owned configuration handoff and CommandKit's native
invocation usage reporting. Include ConfigKit's configured secrets bootstrap
to keep startup consistent with other ConfigKit consumers. This reduces
Audita's configuration assembly and reporting responsibilities while retaining
its correction, validation, repair, and output contracts.
its domain correction and validation behavior, semantic repair, and ordinary
output handling. Structural-repair defaults, debug representation, and startup
failure classification change as specified below.
Keeping separate loads through `NewEngine` is a viable smaller adaptation,
provided the new input and schema APIs are handled. The shared-load approach is
recommended because it removes filesystem-context reconstruction and gives
application settings, PromptKit settings, and overlays one provenance model.
Use the shared-load approach because it removes filesystem-context
reconstruction and gives application settings, PromptKit settings, and overlays
one provenance model.
The tradeoff is broader configuration validation and inspection, described below.
This document records recommendations and the desired outcome. A subsequent
implementation plan can divide the work into bounded units.
This document records agreed adoption choices and the desired outcome.
A subsequent implementation plan can divide the work into bounded units.
## Reviewed Releases
@@ -86,12 +88,13 @@ let a library capture its typed settings and focused inspection from an
application-owned result. The latter is directly useful to Audita's PromptKit
adoption. See the [component handoff guide](https://forge.maximumdirect.net/base-layer/configkit/src/tag/v1.4.0/docs/consumers/README.md#component-handoff).
### Recommended end state
### Target end state
The application configuration includes native `promptkit.Settings` under
`yaml:"promptkit"`. Compose Audita's ConfigKit definition with
`promptkit.Configure`, preserving Audita's defaults, application version rule,
recorded domain resolution, glossary identities, and validation. Pass the whole
`promptkit.Configure`, preserving Audita's application version rule, recorded
domain resolution, glossary identities, and validation. Retain application
defaults except for the structural-repair default changed below. Pass the whole
successful result to `promptkit.NewFromConfig` with the runtime HTTP client.
Compose the bundled OpenRouter catalog, embedded prompts, schema-root input,
@@ -233,18 +236,32 @@ also supports inline and source-relative `schema_file` definitions; adopt those
where an operator actually needs them.
For processing requests, construct `OutputContractInput` with the canonical
registry schema as inline JSON and an explicit pointer to the resolved Audita
repair budget. Runtime replacements replace the whole output contract. Passing
the schema inline keeps Audita's domain response contract independent of an
registry schema as inline JSON and an optional structural-repair budget.
Runtime replacements replace the whole output contract. Passing the schema
inline keeps Audita's domain response contract independent of an
operator's schema-root selection. Keep one embedded schema source of truth.
Preserve configurable structural budgets and explicit zero. Whether processing
retains Audita's current default of two or adopts PromptKit's default of one is
[open decision 3](#3-structural-repair-default). Native requests using a prompt's
own output definition retain upstream budget resolution. Keep transient retries
and semantic correction repair distinct, with their existing operation deadlines
and partial-success behavior. Update ordinary and coordinated request
construction together after selecting the processing default.
**Agreed decision:** Adopt PromptKit's native structural-repair default, currently
one additional generation for enabled validation. Remove Audita's default of two;
leave `OutputContractInput.RepairAttempts` nil when no effective override is
selected so PromptKit resolves the default. Do not replace the old local default
with a hard-coded copy of the upstream value.
Preserve root and stage overrides, stage inheritance, and explicit zero to
disable structural repair. Carry the optional selection through configuration
and request construction without converting an unspecified value to zero.
ConfigKit continues to own presence, composition, and clearing; PromptKit resolves
an unspecified budget at its boundary. A processing request's replacement output
contract resolves independently of the prompt's configured output budget. Native
requests using a prompt's own output definition retain upstream budget resolution.
Keep transient retries and semantic correction repair distinct, with their
existing operation deadlines and partial-success behavior. This decision changes
the default recovery opportunity, not schema enforcement or the handling of an
operation that exhausts its repairs. Update ordinary and coordinated requests
together. Document the changed default and the explicit override for workloads
that benefit from two repairs; future workload evidence can justify revisiting
the default locally or upstream.
Link to the upstream schema reference for external prompt definitions and file
resolution. Audita's documentation should identify its shipped schema selection
@@ -390,16 +407,18 @@ The implementation should cover the following outcomes:
- Bootstrap configured secrets through the upstream helper before loading,
reuse its prepared main, and retain its safe report and native failure facts.
- Adapt embedded-schema installation and explicit request contracts, preserving
canonical domain schemas and existing configured budgets.
canonical domain schemas and explicit configured budgets. Carry unspecified
structural budgets to PromptKit for native default resolution, preserving
stage inheritance and explicit zero.
- Adopt native usage reporting and retain useful new metadata in optional debug
evidence. Preserve cancellation causes, recoverable timeouts, and joined work.
- Remove superseded source assembly, filesystem-context reconstruction, YAML
encode/decode round trips, the embedded-only diagnostic engine construction,
and redundant accounting projections as their replacements land. Adopt the
agreed diagnostic envelope and native evidence representation. Remove or
consolidate tests that only protect those retired
mechanisms; retain behavioral coverage for the application contracts they
served. Cleanup is a completion outcome of this upgrade.
consolidate tests that only protect those retired mechanisms; retain
behavioral coverage for the application contracts they served. Cleanup is a
completion outcome of this upgrade.
- Update canonical configuration, CLI, operations, LLM integration, and internal
documentation plus maintained examples under the ownership and consolidation
direction above. Replace duplicated library guidance with canonical upstream
@@ -413,7 +432,8 @@ The implementation should cover the following outcomes:
Use focused offline tests at Audita's integration boundaries: representative
source selection and mounting with relative resources; shared configuration
handoff; secrets bootstrap with prepared-source reuse and startup failure
reporting; canonical schema and configured repair-budget handoff; inspection
reporting; canonical schema and optional repair-budget handoff, including omitted
values, root/stage inheritance, and explicit zero/nonzero overrides; inspection
scopes and comparison acquisitions; context propagation and failure
classification; and domain attribution across proposal, validation, and repair.
Check transcript/diagnostic stream separation, quiet/help behavior, and
@@ -454,25 +474,3 @@ implementation intentionally requires configuration conversion or breaks an
Audita integration contract, document it and select a major release under the
[release policy](../policy/release.md#versioning-and-compatibility). A compatible
adoption with the added CLI capability is suitable for a minor release.
## Open Decisions
The remaining recommendation is pending discussion; it is not an approved
implementation choice.
### 3. Structural-repair default
Should processing retain Audita's default of two structural repairs or adopt
PromptKit's default of one?
**Recommendation:** Adopt the native default unless Audita workload experience
provides a reason for two. This reduces an application-specific policy difference;
the existing value alone is not a reason to preserve it. Select the simplest
budget handoff consistent with the chosen default and recorded configuration.
This is a behavior decision requiring discussion, not a mechanical API migration.
**Alternative:** Retain two as an explicit Audita default if representative
workloads benefit from the additional structural-repair opportunity. That may
improve successful completion, but can add latency and provider work and keeps
the default distinct from native requests. Preserve explicit zero, operator
overrides, and the separate semantic correction-repair budget under either choice.