Files
audita/docs/roadmap/library-upgrades.md

31 KiB

ConfigKit, PromptKit, and CommandKit Upgrade

Status: Adoption decisions agreed; implementation plan prepared. Implementation has not begun.

Reviewed: 2026-11-23, against Audita commit da5b8913d1206a8e8f0a784b2322760385548a60 (v4.0.0).

Recommendation

Upgrade the three libraries and both CommandKit integrations together. Adopt 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 domain correction and validation behavior, semantic repair, and ordinary output handling. Prompt definitions own output contracts and structural-repair budgets; Audita's separate overrides are removed. Debug representation and startup failure classification also change as specified below.

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 agreed adoption choices and the desired outcome. The implementation plan owns the ordered work and validation.

Reviewed Releases

The following are the latest published versions verified against each upstream repository's remote tags. Full commits identify the source behind each tag; CommandKit's integrations are independently versioned modules in its repository.

Module Audita currently selects Recommended version Reviewed release commit
go.maximumdirect.net/configkit v1.2.1 v1.4.0 4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3
go.maximumdirect.net/promptkit v0.23.2 v0.25.0 207677e9948dc5699073a4d6620d21139033c72d
go.maximumdirect.net/commandkit v0.7.0 v0.8.0 0b53a63648c536afe50c46f948159116f776adae
go.maximumdirect.net/ckconfig v0.9.0 v0.11.0 cd5cf483a46caeff7ca0a91fb4747d57188a3888
go.maximumdirect.net/ckprompt v0.10.0 v0.12.0 2422ccf02d6b55756b07f21e66a581202a09fc3f

The matched integrations select these ConfigKit, PromptKit, and core versions. Their Go minimum remains 1.27.0, matching Audita. The reviewed module manifests require no additional upgrade to Audita's existing YAML, JSON Schema, Cobra, pflag, or ReleaseKit selections.

The review covered intervening ConfigKit v1.3.0, PromptKit v0.23.3 and v0.24.0, ckconfig v0.10.0, and ckprompt v0.11.0 as well as the target releases. Upstream release notes, migration guidance, public APIs, and Audita's consumers were compared directly.

Current Baseline

  • internal/core/config.Load produces an application-only ConfigKit result, with application defaults, glossary companions, imports, overlays, recorded resolution, and explicit CLI overrides.
  • internal/framework/llm/runtime.go separately constructs a PromptKit engine. It reconstructs the application's main filesystem context to discover prompt companions, selects the bundled catalog and embedded prompts, and installs embedded response schemas through WithSchemaFS.
  • Prompt companions are wrapperless PromptKit fragments. Embedded definitions contain collections.audita; operator fragments can contain profiles, backends, and collections. Resource identities do not include a configuration path prefix.
  • Processing replaces each prompt's output contract with an Audita-owned schema and explicit structural-repair budget. Semantic correction repair uses native exchanges and Engine.Coordinate, separately from structural repair.
  • The LLM adapter records native execution facts for operation outcomes and optional detailed debug evidence. Its debug collector projects token fields into Audita DTOs and uses a native execution group. There is no ordinary invocation-wide token/cost flag.
  • Command assembly already uses ckconfig and ckprompt. Source collision checks recover message-file paths by rendering effective PromptKit YAML and decoding a partial projection with root-relative metadata paths.

A compile-only compatibility probe used a temporary alternate module file with all five target versions. Audita's module files were unchanged. The unchanged application does not compile: WithSchemaFS is unavailable and RunRequest.Validation now requires *OutputContractInput instead of *OutputContract. Prompt registry tests also use the removed schema option. These are confirmed initial migration points, not an exhaustive runtime check.

ConfigKit: Share the Completed Load

ConfigKit v1.3.0 adds explicit configured secrets-directory bootstrap and overwrite selection. v1.4.0 adds Result.Value and Result.InspectSubtree, which 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.

Target end state

The application configuration includes native promptkit.Settings under yaml:"promptkit". Compose Audita's ConfigKit definition with promptkit.Configure, preserving Audita's application version rule, recorded domain resolution, glossary identities, and validation. Retain application defaults except for the structural-repair setting removed below. Pass the whole successful result to promptkit.NewFromConfig with the runtime HTTP client.

Compose the bundled OpenRouter catalog, embedded prompts, schema-root input, glossary companions, and operator prompt companions as native inputs before the load. Select BundledOpenRouterUnderlay explicitly: NewFromConfig does not add the standalone constructor's default bundle. Main configuration, selected overlay, and explicit overrides should then operate on the combined document using ConfigKit's normal precedence.

Use MainRelative for companion imports instead of reconstructing host roots and base directories in the LLM adapter. Keep optional companion discovery anchored to the selected main source; the absence of a main source should retain the existing embedded/default behavior. Keep source-local message resolution and effective origins intact.

One completed result should serve a processing acquisition and its engine. Comparison still acquires each side independently, including equal selections; this proposal does not establish a process-global cache or a universal one-load-per-invocation rule. Native loading and validation remain distinct from processing readiness and provider execution.

Inspection and source ownership

Keep the existing app and promptkit command scopes. The app scope describes the combined application result; the PromptKit scope uses native focused inspection at /promptkit. Explicit metadata queries retain application-root paths, and focused comparisons can include ancestor changes. A focused view is not an isolation or confidentiality boundary.

Use the captured typed settings and recorded source contexts when identifying consumed message files. Remove the YAML encode/decode projection where the shared result makes it unnecessary, and update metadata lookups to their native /promptkit/... paths. Preserve the existing output-collision protections. FromConfigKitSubtree is available if another concrete configuration scope is needed later; this upgrade does not need additional inspection commands.

Runtime failure classification

Agreed decision: Remove the embedded-only diagnostic engine construction in embeddedAssetOrInputError. Report the original shared-load or engine failure, preserving upstream diagnostics, source information, and error causes. Use native configuration-error classification where available. Retain directly identifiable application failures, such as inability to access a required embedded asset, without reconstructing an engine to establish responsibility.

Validate bundled assets through focused offline tests that load shipped definitions and check prompt and schema references. These tests protect structural correctness without freezing prompt wording. Runtime processing still stops on preparation failure, but Audita need not always distinguish a bundled defect from an operator-input problem. An unexpected shipped configuration defect may receive the ordinary configuration-failure classification; retain the original diagnostic evidence in that case.

Remove tests dedicated to the retired diagnostic reconstruction, retaining coverage of original error evidence, native classification, directly identifiable application failures, and cancellation. Update CLI and subprocess documentation for any resulting changes to error mapping, and assess release compatibility under the release policy.

Secrets bootstrap

Adopt LoadSecretsIntoEnvironmentFromConfig in the common configuration acquisition path, before the shared LoadLayered call and before concurrent model work. This is an agreed adoption choice for consistency with other ConfigKit consumers. Use its native main-document controls as defined in the upstream bootstrap contract.

Pass the selected host File or SearchConfig source to the helper, then use its returned prepared source as the layered load's main input. Reuse that captured main and its filesystem context rather than rediscovering or rereading the file. Engine construction consumes the completed result without repeating bootstrap. Missing optional discovery and configurations without secrets_dir retain the native no-op behavior.

Use upstream path resolution, eligible-file handling, overwrite semantics, and partial-effect behavior. No additional Audita bootstrap flags or environment precedence rules are needed. Link to the upstream contract for those controls and their limits.

Retain the returned SecretsReport even on failure. Use native safe diagnostics and the report's names, paths, and statuses for startup reporting, with routine entry details following existing verbose/debug controls. Bootstrap failure stops configuration preparation before outputs or provider work. Completed environment writes remain if a subsequent write or configuration load fails; follow upstream partial-effect semantics without adding rollback machinery.

Apply this startup path to configuration-consuming processing and inspection commands; help, version, and completion retain their configuration-free behavior. Inspection may therefore populate the process environment, while remaining independent of provider calls and processing readiness. Independent comparison acquisitions each prepare their selected main, and share the normal process environment; they do not receive isolated credential environments. Document Audita's startup integration and link upstream for bootstrap behavior and credential selection.

PromptKit: Adapt Configuration and Schema Boundaries

v0.23.3 fixes operation-timeout attribution and cancellation/error identities. v0.24.0 introduces shared configuration loading, prompt-owned schema selection, MessageContentHash, and a default of one structural repair for enabled validation modes. It is a breaking upstream release. v0.25.0 adds contextual execution observers, explicit provider conventions, reasoning/cache usage, and presence-aware USD costs. Follow the migration guide and format contract.

Configuration shape and compatibility

Complete PromptKit documents now require a promptkit wrapper. Preserve Audita's existing wrapperless prompts.yml and prompts/ fragments by mounting them at /promptkit, using SettingsInput or equivalent explicit destinations. Mount embedded fragments consistently. Discovery helpers return root-mounted inputs; they do not perform this adaptation automatically. Imports and nested destinations must be checked in the context of their containing fragment. This is a native fragment-mounting capability, so retaining these inputs does not require a compatibility parser or a parallel loading path.

Keep existing resource IDs, references, and application configuration version 3. An optional promptkit section in the application main and its overlay can provide native settings without requiring existing companion files to be rewritten. Full external PromptKit documents use the new upstream wrapper; document that distinction rather than silently accepting a file at the wrong mount. PromptKit no longer enforces resource-version fields; retain Audita's application version rule without inventing resource-version requirements.

Shared loading deliberately makes PromptKit settings part of application configuration validation and inspection. Invalid PromptKit definitions may now surface in application inspection as well as engine construction. Explain that change, and keep help/version and processing-readiness checks at their existing boundaries. No provider calls or required credentials belong in configuration inspection.

Prompt-owned output contracts and structural-repair budgets

Agreed decision: Each proposal, validation, and repair prompt definition owns its output format, validation mode, schema selection, and structural-repair budget. Ordinary and coordinated processing select the prompt and leave RunRequest.Validation unset, allowing PromptKit to use that definition's output contract. Processing and native request previews use the same configured contract; Audita does not substitute a schema or budget at the call site.

Replace WithSchemaFS with a native SchemaRootSource input, mounted under /promptkit and anchored to the embedded schema filesystem at its asset root (currently exposed through responseschema.Filesystem()). This preserves the existing shipped schema_path references and standalone request previews without duplicating schema JSON into prompt YAML. PromptKit also supports inline and source-relative schema_file definitions; adopt those where an operator actually needs them.

Keep shared schema assets referenced by prompt definitions rather than copying schema JSON into every prompt. Remove the adapter's output-contract builder, per-call schema-selection fields, and schema-key lookup/registry machinery that no longer serves a purpose. Retain the embedded assets and any necessary loading support. Execution diagnostics should describe the actual prepared contract, using native evidence instead of an independently selected registry contract.

Shipped prompt definitions omit output.repair_attempts to adopt PromptKit's native default, currently one additional generation for enabled validation. Operators customize this field through native prompt configuration, including explicit zero to disable structural repair. ConfigKit owns composition and clearing; PromptKit owns contract resolution and structural repair.

Remove Audita's root and stage llm.repair_attempts setting, its default, inheritance and validation logic, request plumbing, and any associated CLI bindings. Do not translate the retired setting into per-call replacements or retain a compatibility path that copies and modifies prompt contracts. Migration guidance should move explicit structural budgets into the applicable prompt definitions and explain that structural budgets are selected by prompt rather than by Audita stage.

Operator replacement prompts must supply output contracts compatible with Audita's expected response shapes. Audita continues decoding responses and performing domain checks, including proposal identity, applicability, decision reconciliation, and protection. It does not enforce a second schema selection over the operator's configured contract. Keep transient retries and Audita's semantic correction-repair budget (llm.correction_repair_attempts) separate, with their existing operation deadlines and partial-success behavior. Failed structural validation continues through the existing model-operation failure handling. Update ordinary and coordinated requests together.

Decoder clarification: Successful PromptKit validation no longer guarantees that a response is valid JSON compatible with Audita's decode target, because the selected prompt owns the validation contract. Treat response JSON syntax and type errors as recoverable invalid-output failures for the affected operation. Retain fatal classification for application programming errors, such as an invalid decode target. Apply this distinction to ordinary and coordinated responses, preserving existing cancellation and partial-success handling. Do not add a second schema-enforcement layer or an additional retry loop.

Link to the upstream schema reference for external prompt definitions and file resolution. Audita's documentation should identify its shipped schema selection and domain requirements. Do not add another schema resolver or introduce broader schema prohibitions in Audita.

Providers and execution evidence

Custom OpenRouter backends should explicitly set provider: openrouter to receive its usage, cost, and default authentication conventions. Use provider: vllm for actual vLLM services. An omitted provider retains generic OpenAI-compatible behavior; an endpoint hostname or backend ID does not select provider conventions. Keep generic services generic, including the existing local example unless its server actually uses another supported convention.

Allow native zero_cost declarations, but do not infer that a local backend is free or set zero-cost defaults for operators. Unknown cost remains distinct from known zero and an incomplete subtotal. PromptKit owns attempt aggregation, reasoning-token interpretation, cache-hit ratios, cost sources, and terminal coverage. Costs are observations, not a billing guarantee or budget control.

Debug execution data and format compatibility

Agreed decision: Use an Audita-owned diagnostic envelope containing native PromptKit execution facts. Audita supplies stage, module, role, logical-call, and relevant correction or validation-batch attribution. Place native evidence in a clearly named nested field, using PromptKit's public types wherever practical. Remove redundant local metric structures and mappings; concentrate any necessary serialization adaptation at the diagnostic-output boundary. Native execution types belong in the integration and diagnostic machinery; modules and validators continue using their application contracts.

Carry MessageContentHash into prepared debug metadata where useful, and retain reasoning tokens, native cost facts, and cache-hit information with their native availability/completeness semantics. Audita may select execution membership for a stage or logical call; PromptKit owns aggregation. Avoid recomputing metrics or summing overlapping attempt, terminal, and group totals. These facts belong in optional diagnostics; ordinary errors/recoveries documents continue to describe processing outcomes.

Accept a deliberate change to the debug artifact format. Native evidence may evolve with the imported PromptKit version; keep one serializer for the selected format rather than maintaining an old-format compatibility path. Assess existing published compatibility commitments and affected consumers, document this transition and any required script updates, and choose the release version accordingly. Retaining the current debug field layout is not a requirement.

Tests should protect correct attribution, inclusion of native evidence, and any necessary serialization conversion. Avoid snapshots that freeze the complete upstream execution structure or repeat PromptKit's accounting checks.

CommandKit: Adopt Native Invocation Reporting

Core v0.8.0 provides invocation features for shared flags, context decoration, and final diagnostic reports. ckconfig v0.11.0 includes native subtree support and a help-only preflight exemption. ckprompt v0.12.0 installs --show-tokens through the existing nonempty PromptKit family, including application-owned commands. See the consumer guide.

Adopt that built-in flag and presentation. Propagate Invocation.Context through proposal, validator, and coordinated repair work, including derived cancellation contexts, and continue joining owned work before returning. The integration's contextual observer then sees executions across nested clients and engines, including failures. Audita should retain explicit request observers for domain operation counts and debug attribution without installing the same collector twice or implementing another CLI total/report callback.

The native summary is opt-in, goes to diagnostics, follows deferred completion messages, respects quiet, and precedes terminal failure explanations. It does not require debug artifacts or ordinary reporting. Help, version, completion, and input errors skip feature startup; bare config explain has the same help exemption. Preserve the current transcript stream and completion behavior.

Adopt native inspection additions and smoke-report changes: backend provider and explicit zero-cost fields, resolved repair budgets, prepared message hashes, reasoning usage, and cache-hit ratios. Smoke reports now default to text with annotated YAML evidence; machine consumers should request --format yaml or --format json. Smoke usage is reported separately from ordinary execution usage, and smoke reports do not gain a cost field. Update affected examples and tests without promising historical incidental formatting.

Documentation Ownership and Consolidation

Agreed documentation direction: Audita identifies the ConfigKit, PromptKit, and CommandKit libraries it imports and links to their canonical upstream documentation. Upstream owns descriptions of its features, configuration fields, defaults, algorithms, CLI grammar, output formats, and API behavior. Replace local explanations of adopted library features with those links.

Keep Audita's selected integration and application-owned behavior local: configuration discovery and companion locations chosen by Audita, input mounts, role/profile mappings, remaining application-owned processing budgets, required domain response shapes and shipped schema assets, failure classification, transcript/report handling, and application migration steps. A concise integration statement should explain where the adopted library fits and link upstream for its behavior. Planning documents may identify APIs and migration constraints needed to explain the proposed work; those details should not grow into a parallel library reference in the published documentation.

Keep ordinary Audita workflows discoverable. Brief application examples may demonstrate standard flags such as --show-tokens or an inspection command, with a link to upstream for the detailed contract. These examples explain how to operate Audita; they need not reproduce a library command or field reference.

Align the documentation during this upgrade, including existing duplication:

Affected material Required alignment
Documentation policy Completed: adopted upstream v1.13's dependency-documentation rule from revision 5b9088601290564647a9e20c13f95c0da9f4cb15. Apply it to the remaining documentation work below.
Configuration Retain Audita's schema, source selection, companion mounts, role settings, and remaining overrides. Remove the retired structural-repair setting and link to its migration guidance. Link to ConfigKit for composition and secrets controls, and to PromptKit for output contracts, structural budgets, and resource formats; avoid reproducing their field/default references.
CLI Identify the installed CommandKit integrations and link to the upstream command reference. Describe Audita's process command and application-specific stream/exit mapping locally. Introduce native usage reporting with a brief workflow example and an upstream link; leave the detailed flag, report layout, and formatting reference upstream.
LLM integration Reduce the document to Audita's adapter boundary, role/schema/budget choices, and mapping of model failures into processing outcomes. Link upstream for transport, provider conventions, credentials, retry/repair mechanics, admission, and token/cost semantics.
Operations and subprocess integration Describe when Audita invokes secrets bootstrap and how startup failure affects processing/output preparation. Link to ConfigKit for bootstrap behavior and to CommandKit for native diagnostic reporting; retain Audita-owned output lifecycle and subprocess handling.
LLM runtime, prompt registry, diagnostics internals, and CLI/configuration recipes Retain Audita's component wiring, call sites, domain attribution, and change recipes. Replace standalone explanations of upstream loading, coordination, observation, schema resolution, and metrics with focused upstream links.
Maintained examples and migration guides Keep minimal runnable Audita projects, application-specific prompt inputs, and actual Audita conversion steps. Link upstream for general library tutorials and native command syntax rather than expanding local walkthroughs into library manuals.

Use links to canonical documentation for the selected upstream releases, using the release identities recorded above. Refresh outdated upstream references as part of current guidance; migration guides should link to the source or target release appropriate to the conversion they describe. Link to the owning topic or section, rather than copying the upstream reference into another local page. Preserve immutable release records and accepted ADR decisions; this work concerns maintained documentation. Keep attribution notices in their existing canonical location.

Completion requires the adopted libraries to be discoverable through brief adoption statements and canonical upstream links. Apply that approach to the new secrets, schema, provider, and token/cost capabilities rather than adding local feature references. Review the affected documents for duplicated library explanations while checking that Audita-specific choices and workflows remain understandable. No new library reference pages or recurring documentation gates are needed.

Acceptance Criteria

  • The selected dependency versions match the reviewed releases, with consistent module metadata and commit-pinned attribution. The reviewed target COPYRIGHT and LICENSE files are unchanged from the currently selected releases; all five remain LGPL-3.0-or-later.
  • One combined native result serves application settings and engine capture, preceded by configured secrets bootstrap with prepared-source reuse and safe startup evidence. Native inspection and processing use the same assembly.
  • Prompt definitions own actual output contracts and structural budgets. Audita's retired setting, per-call overrides, and redundant registry are gone. Domain checks and recoverable JSON decoding retain the selected behavior.
  • Native execution facts and aggregation supply CLI usage reporting and the new diagnostic envelope. Domain attribution, cancellation/joining, ordinary reports, partial success, and output publication retain their contracts.
  • Superseded source assembly, filesystem reconstruction, YAML round trips, diagnostic engine reconstruction, metric projections, and tests dedicated to those retired mechanisms are removed. No temporary compatibility path remains.
  • Current documentation and maintained examples follow the upstream ownership rule. Migration guidance and v4.1.0 release documentation explain actual configuration, inspection, debug, and failure-classification changes.
  • Representative offline integration coverage protects Audita's wiring and selected behavior without repeating upstream test inventories. The complete offline suite and required Linux builds pass for the completed source.

The implementation plan identifies the owning components, ordered changes, and focused checks. The earlier compile probe establishes incompatibility, not successful adoption; implementation has not been validated.

Scope and Release Impact

This is a coordinated integration change, rather than a version-only update. It does not require a toolchain increase, a new concurrency scheduler, new semantic repair policy, pricing estimates, spending limits, or a redesign of ordinary processing reports. ConfigKit secrets bootstrap is included in the adoption; additional custom inspection scopes remain an optional future choice.

Compatibility is a consideration, not an absolute constraint on the target design. Retain wrapperless companion inputs through native mounting, but avoid compatibility branches whose only purpose is preserving incidental inspection formatting, debug representations, or old loading mechanisms. The agreed debug format and failure-classification changes follow the compatibility assessments described above. Choose the desired application contract first, then assess migration and release impact; a smaller release number is not a reason to retain avoidable complexity.

Native fragment mounting preserves the wrapperless companion shape, but removal of Audita's structural-repair setting is an intentional configuration migration. Operator prompts that previously relied on per-call contract replacement must also provide a compatible output contract. Document the conversion, including root/stage budget removal and the changed default. Review representative projects and existing integration contracts for additional migration needs when implementing the agreed debug and failure classification changes.

Maintainer-authorized release target: v4.1.0. Because Audita has just tagged a major release, the maintainer has authorized a one-time override of the normal release versioning policy to deliver this roadmap's breaking changes in a minor release. This authorization applies to this adoption only; the release policy remains unchanged. Record the override here only, not in the release notes. The v4.1.0 release notes should describe the actual changes and migration requirements.