Document PromptKit catalogs and smoke testing
This commit is contained in:
@@ -11,7 +11,7 @@ through `commandkit.New` or `App.Register`.
|
||||
| --- | --- |
|
||||
| `gitea.maximumdirect.net/eric/CommandKit` | The application needs typed command declarations and common CLI behavior. |
|
||||
| `gitea.maximumdirect.net/eric/CommandKit/integrations/ckconfig` | The application wants ConfigKit-backed configuration scopes and reports. |
|
||||
| `gitea.maximumdirect.net/eric/CommandKit/integrations/ckprompt` | The application wants PromptKit engine configuration/comparison, prompt/profile catalogs, named inspection, requirements discovery, or concrete request validation. |
|
||||
| `gitea.maximumdirect.net/eric/CommandKit/integrations/ckprompt` | The application wants PromptKit engine configuration/comparison, five catalogs, named inspection, requirements discovery, request validation, or native smoke testing. |
|
||||
|
||||
The two integrations are independent optional imports. `ckprompt` uses the
|
||||
public scope and error contracts from `ckconfig`; importing it does not add the
|
||||
@@ -22,7 +22,7 @@ core-only, ConfigKit-only, and composed applications.
|
||||
## Go compatibility
|
||||
|
||||
All three modules declare a consumer minimum of Go 1.26.0. The root module also
|
||||
selects ReleaseKit v0.4.0 as a Go tool, which makes that tool's module graph part
|
||||
selects ReleaseKit v0.4.2 as a Go tool, which makes that tool's module graph part
|
||||
of the root consumer module requirements even though production packages do not
|
||||
import ReleaseKit. The [release policy](../policy/release.md#consumer-minimum-and-release-toolchain)
|
||||
defines the support assumption. Maintainers use Go 1.26.8 for validation and
|
||||
@@ -126,17 +126,20 @@ engine's captured configuration. Add that scope to a `ckconfig.Suite` to expose
|
||||
it under `config` with validate/show/sources/explain and native diff operations;
|
||||
it does not install PromptKit catalog, definition, or requirements commands.
|
||||
|
||||
`ckprompt.FromEngine(loadEngine)` supplies five callbacks: prompt and profile
|
||||
catalogs, named prompt and profile inspection, and native requirements
|
||||
discovery. Concrete request validation is a sixth, independently optional
|
||||
capability and is added explicitly with `ckprompt.WithRequestValidation`.
|
||||
`ckprompt.Command(suite)` creates only operations whose callbacks are present;
|
||||
discovery and validation share `promptkit requirements` but can be installed
|
||||
independently. A composed suite can keep the standard five and add validation:
|
||||
`ckprompt.FromEngine(loadEngine)` supplies eight callbacks: prompt, profile,
|
||||
backend, namespace, and collection catalogs; named prompt and profile
|
||||
inspection; and native requirements discovery. Concrete request validation and
|
||||
smoke testing are separate capabilities, added explicitly with
|
||||
`ckprompt.WithRequestValidation` and `ckprompt.WithSmokeTesting`. The suite has
|
||||
ten independently optional callbacks in total. `ckprompt.Command(suite)` creates
|
||||
only operations whose callbacks are present; discovery, validation, and smoke
|
||||
testing can be installed independently. A composed suite can enable both
|
||||
additional operations:
|
||||
|
||||
```go
|
||||
suite := ckprompt.FromEngine(loadEngine)
|
||||
suite = ckprompt.WithRequestValidation(suite, loadEngine, buildRequest)
|
||||
suite = ckprompt.WithSmokeTesting(suite, loadEngine, nil)
|
||||
suite.NewInput = newInput
|
||||
suite.NewState = newState
|
||||
suite.Selectors = selectors
|
||||
@@ -165,8 +168,9 @@ absent, so explicitly supplied empty values stay meaningful. Applications that
|
||||
validate and then execute a request are encouraged to share their request
|
||||
construction logic between those paths.
|
||||
|
||||
All six suite capabilities are independently optional. For catalogs without
|
||||
named or requirements inspection, narrow the suite before command capture:
|
||||
The eight catalog and inspection callbacks and the two explicit additions are
|
||||
independently optional. For catalogs without named or requirements inspection,
|
||||
narrow the suite before command capture:
|
||||
|
||||
```go
|
||||
definitions := ckprompt.FromEngine(loadEngine)
|
||||
@@ -176,7 +180,7 @@ definitions.InspectRequirements = nil
|
||||
definitionCommand := ckprompt.Command(definitions)
|
||||
```
|
||||
|
||||
Each selected inspection, requirements, validation, or catalog operation
|
||||
Each selected inspection, requirements, validation, smoke, or catalog operation
|
||||
prepares one input, applies its captured selectors, checks that input, and
|
||||
initializes one state value when those steps are reached. The bundled validation
|
||||
adapter delegates concrete request preparation to PromptKit and carries its
|
||||
@@ -195,13 +199,19 @@ PromptKit preparation, which can resolve prompt/profile resources, load
|
||||
artifacts and schemas, render messages, and perform applicable configuration
|
||||
and credential checks. It does not make a model call or certify that a later
|
||||
execution will succeed. Application loaders and direct callbacks retain their
|
||||
own effects. The [CLI reference](../cli.md#promptkit-definition-inspection)
|
||||
and [requirements contract](../cli.md#promptkit-requirements) own operator
|
||||
syntax and reports.
|
||||
own effects. Smoke testing explicitly invokes one native PromptKit diagnostic
|
||||
or all four in order. Native inference checks use the configured public
|
||||
`promptkit.LLMClient`; applications retain ownership of client and probe
|
||||
configuration. A builder may customize the seeded native request, and its
|
||||
complete return value is authoritative. The [CLI reference](../cli.md#promptkit-smoke-testing),
|
||||
[definition inspection](../cli.md#promptkit-definition-inspection), and
|
||||
[requirements contract](../cli.md#promptkit-requirements) own operator syntax
|
||||
and reports.
|
||||
|
||||
The [composed example](../../integrations/ckprompt/examples/composed/README.md)
|
||||
combines app and PromptKit config scopes, comparison and catalogs, named and
|
||||
requirements inspection, and an application-owned `session restore` command.
|
||||
requirements inspection, request validation, smoke testing, and an
|
||||
application-owned `session restore` command.
|
||||
|
||||
## Outcomes and ownership
|
||||
|
||||
@@ -214,7 +224,8 @@ process.
|
||||
Go declarations and GoDoc own exact exported contracts. ConfigKit owns
|
||||
configuration decoding, validation, and provenance. PromptKit owns prompt
|
||||
formats, profile resolution, and inspection details. See the
|
||||
[ConfigKit inspection API](https://gitea.maximumdirect.net/eric/ConfigKit/src/commit/dc09959cca4e105f49ec316c6d4ba585bd2340bd/inspection.go),
|
||||
[PromptKit engine methods](https://gitea.maximumdirect.net/eric/promptkit/src/commit/4b8169da286917fde7875425bb32b799b12c6af3/engine.go),
|
||||
[configuration inspection](https://gitea.maximumdirect.net/eric/promptkit/src/commit/4b8169da286917fde7875425bb32b799b12c6af3/configuration_inspection.go),
|
||||
and [inspection types](https://gitea.maximumdirect.net/eric/promptkit/src/commit/4b8169da286917fde7875425bb32b799b12c6af3/types.go).
|
||||
[ConfigKit v0.8.0 inspection API](https://gitea.maximumdirect.net/eric/ConfigKit/src/commit/137769f3f18a370c68444242fb5d88e620e307e5/inspection.go),
|
||||
[PromptKit engine methods](https://gitea.maximumdirect.net/eric/promptkit/src/commit/9178f3eb91c2b2138caa78e22be93c048b4bc992/engine.go),
|
||||
[configuration inspection](https://gitea.maximumdirect.net/eric/promptkit/src/commit/9178f3eb91c2b2138caa78e22be93c048b4bc992/configuration_inspection.go),
|
||||
[smoke diagnostics](https://gitea.maximumdirect.net/eric/promptkit/src/commit/9178f3eb91c2b2138caa78e22be93c048b4bc992/smoke_diagnostics.go),
|
||||
and [PromptKit v0.16.0 consumer guidance](https://gitea.maximumdirect.net/eric/promptkit/src/commit/9178f3eb91c2b2138caa78e22be93c048b4bc992/docs/consumers/pkg-promptkit.md).
|
||||
|
||||
Reference in New Issue
Block a user