Migrate prompt integration to PromptKit 0.16
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# Dependency upgrades, discovery, and smoke testing implementation plan
|
# Dependency upgrades, discovery, and smoke testing implementation plan
|
||||||
|
|
||||||
Status: Stages 1–3 complete; Stage 4 is next.
|
Status: Stages 1–4 complete; Stage 5 is next.
|
||||||
|
|
||||||
## Authority and baseline
|
## Authority and baseline
|
||||||
|
|
||||||
@@ -303,6 +303,15 @@ do not create compatibility shims solely to make this intermediate stage green.
|
|||||||
**Complete when:** production adaptation uses the new ID-only API and optional
|
**Complete when:** production adaptation uses the new ID-only API and optional
|
||||||
version representation.
|
version representation.
|
||||||
|
|
||||||
|
**Completed:** 2026-10-17. ckprompt selects PromptKit v0.16.0 with generated
|
||||||
|
checksums and attribution pinned to release revision
|
||||||
|
`9178f3eb91c2b2138caa78e22be93c048b4bc992`; upstream `COPYRIGHT` and `LICENSE`
|
||||||
|
are unchanged. Production adapters use ID-only prompt inspection, the three
|
||||||
|
prompt-version selectors and their seed assignments are removed, and inspection
|
||||||
|
and catalog reports retain optional version values. `GOTOOLCHAIN=local go build
|
||||||
|
./...` passed for the ckprompt module. Fixtures and consumer code remain for
|
||||||
|
Stage 5.
|
||||||
|
|
||||||
## Stage 5: Migrate existing fixtures, tests, and composed loading
|
## Stage 5: Migrate existing fixtures, tests, and composed loading
|
||||||
|
|
||||||
**Primary files:** ckprompt tests, `examples/composed/main.go` and fixtures,
|
**Primary files:** ckprompt tests, `examples/composed/main.go` and fixtures,
|
||||||
|
|||||||
@@ -19,8 +19,6 @@ type PromptRequest struct {
|
|||||||
Selection ckconfig.Selection
|
Selection ckconfig.Selection
|
||||||
// ID is the selected named prompt.
|
// ID is the selected named prompt.
|
||||||
ID string
|
ID string
|
||||||
// Version carries the explicitly supplied prompt version, if present.
|
|
||||||
Version commandkit.Supplied[string]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ProfileRequest selects one named profile for inspection.
|
// ProfileRequest selects one named profile for inspection.
|
||||||
@@ -265,7 +263,7 @@ func FromEngine[I, S any](load func(context.Context, ckconfig.Selection, I, S) (
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return commandkit.Acquired[*promptkit.PromptInspection]{Diagnostics: diagnostics}, err
|
return commandkit.Acquired[*promptkit.PromptInspection]{Diagnostics: diagnostics}, err
|
||||||
}
|
}
|
||||||
inspection, err := engine.InspectPrompt(ctx, request.ID, request.Version.Value)
|
inspection, err := engine.InspectPrompt(ctx, request.ID)
|
||||||
return commandkit.Acquired[*promptkit.PromptInspection]{Value: inspection, Diagnostics: diagnostics}, err
|
return commandkit.Acquired[*promptkit.PromptInspection]{Value: inspection, Diagnostics: diagnostics}, err
|
||||||
},
|
},
|
||||||
InspectProfile: func(ctx context.Context, request ProfileRequest, input I, state S) (commandkit.Acquired[*promptkit.ProfileInspection], error) {
|
InspectProfile: func(ctx context.Context, request ProfileRequest, input I, state S) (commandkit.Acquired[*promptkit.ProfileInspection], error) {
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import (
|
|||||||
type definitionInput[I any] struct {
|
type definitionInput[I any] struct {
|
||||||
selection ckconfig.Selection
|
selection ckconfig.Selection
|
||||||
id string
|
id string
|
||||||
version commandkit.Supplied[string]
|
|
||||||
format string
|
format string
|
||||||
captured commandkit.FlagValues[I]
|
captured commandkit.FlagValues[I]
|
||||||
selected I
|
selected I
|
||||||
@@ -191,11 +190,6 @@ func newDefinitionCommand[I, S any](suite Suite[I, S], name string, prompt bool)
|
|||||||
commandkit.ValueFlag(commandkit.FlagMeta{Name: "format", Usage: "Report format: text or yaml."}, stringDefault("text"), parseDefinitionString,
|
commandkit.ValueFlag(commandkit.FlagMeta{Name: "format", Usage: "Report format: text or yaml."}, stringDefault("text"), parseDefinitionString,
|
||||||
func(input **definitionInput[I], value commandkit.Supplied[string]) { (*input).format = value.Value }),
|
func(input **definitionInput[I], value commandkit.Supplied[string]) { (*input).format = value.Value }),
|
||||||
)
|
)
|
||||||
if prompt {
|
|
||||||
flags = append(flags, commandkit.ValueFlag(commandkit.FlagMeta{Name: "version", Usage: "Prompt version to inspect."}, (*string)(nil), parseDefinitionString,
|
|
||||||
func(input **definitionInput[I], value commandkit.Supplied[string]) { (*input).version = value }))
|
|
||||||
}
|
|
||||||
|
|
||||||
spec := commandkit.CommandSpec[*definitionInput[I]]{
|
spec := commandkit.CommandSpec[*definitionInput[I]]{
|
||||||
Name: name,
|
Name: name,
|
||||||
Summary: "Inspect a named PromptKit " + name + ".",
|
Summary: "Inspect a named PromptKit " + name + ".",
|
||||||
@@ -241,10 +235,6 @@ func newRequirementsCommand[I, S any](suite Suite[I, S]) commandkit.Command {
|
|||||||
func(input **requirementsInput[I], value commandkit.Supplied[string]) {
|
func(input **requirementsInput[I], value commandkit.Supplied[string]) {
|
||||||
(*input).selection.Overlay = value
|
(*input).selection.Overlay = value
|
||||||
}),
|
}),
|
||||||
commandkit.ValueFlag(commandkit.FlagMeta{Name: "version", Usage: "Prompt version to inspect."}, stringDefault(""), parseDefinitionString,
|
|
||||||
func(input **requirementsInput[I], value commandkit.Supplied[string]) {
|
|
||||||
(*input).inspection.PromptVersion = value.Value
|
|
||||||
}),
|
|
||||||
commandkit.ValueFlag(commandkit.FlagMeta{Name: "profile", Usage: "Profile identity for discovery."}, stringDefault(""), parseDefinitionString,
|
commandkit.ValueFlag(commandkit.FlagMeta{Name: "profile", Usage: "Profile identity for discovery."}, stringDefault(""), parseDefinitionString,
|
||||||
func(input **requirementsInput[I], value commandkit.Supplied[string]) {
|
func(input **requirementsInput[I], value commandkit.Supplied[string]) {
|
||||||
(*input).inspection.ProfileID = value.Value
|
(*input).inspection.ProfileID = value.Value
|
||||||
@@ -371,7 +361,7 @@ func runDefinitionInspection[I, S any](invocation commandkit.Invocation, suite S
|
|||||||
}
|
}
|
||||||
|
|
||||||
if prompt {
|
if prompt {
|
||||||
request := PromptRequest{Selection: input.selection, ID: input.id, Version: input.version}
|
request := PromptRequest{Selection: input.selection, ID: input.id}
|
||||||
acquired, err := suite.InspectPrompt(invocation.Context, request, input.selected, state)
|
acquired, err := suite.InspectPrompt(invocation.Context, request, input.selected, state)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return definitionFailure(err, acquired.Diagnostics)
|
return definitionFailure(err, acquired.Diagnostics)
|
||||||
@@ -419,7 +409,7 @@ type promptOutputContractReport struct {
|
|||||||
|
|
||||||
type promptInspectionReport struct {
|
type promptInspectionReport struct {
|
||||||
PromptID string `yaml:"prompt_id"`
|
PromptID string `yaml:"prompt_id"`
|
||||||
PromptVersion string `yaml:"prompt_version"`
|
PromptVersion *string `yaml:"version,omitempty"`
|
||||||
PromptHash string `yaml:"prompt_hash"`
|
PromptHash string `yaml:"prompt_hash"`
|
||||||
DefaultProfileID string `yaml:"default_profile_id"`
|
DefaultProfileID string `yaml:"default_profile_id"`
|
||||||
Inputs []promptInputReport `yaml:"inputs"`
|
Inputs []promptInputReport `yaml:"inputs"`
|
||||||
@@ -428,7 +418,7 @@ type promptInspectionReport struct {
|
|||||||
|
|
||||||
type requirementsInspectionReport struct {
|
type requirementsInspectionReport struct {
|
||||||
PromptID string `yaml:"prompt_id"`
|
PromptID string `yaml:"prompt_id"`
|
||||||
PromptVersion string `yaml:"prompt_version"`
|
PromptVersion *string `yaml:"version,omitempty"`
|
||||||
ProfileID string `yaml:"profile_id"`
|
ProfileID string `yaml:"profile_id"`
|
||||||
Complete bool `yaml:"complete"`
|
Complete bool `yaml:"complete"`
|
||||||
Inputs []requirementInputReport `yaml:"inputs"`
|
Inputs []requirementInputReport `yaml:"inputs"`
|
||||||
@@ -623,7 +613,9 @@ func renderProfileReport(invocation commandkit.Invocation, report profileInspect
|
|||||||
func formatPromptText(report promptInspectionReport) string {
|
func formatPromptText(report promptInspectionReport) string {
|
||||||
var output strings.Builder
|
var output strings.Builder
|
||||||
fmt.Fprintf(&output, "Prompt ID: %s\n", strconv.Quote(report.PromptID))
|
fmt.Fprintf(&output, "Prompt ID: %s\n", strconv.Quote(report.PromptID))
|
||||||
fmt.Fprintf(&output, "Prompt version: %s\n", strconv.Quote(report.PromptVersion))
|
if report.PromptVersion != nil {
|
||||||
|
fmt.Fprintf(&output, "Prompt version: %s\n", strconv.Quote(*report.PromptVersion))
|
||||||
|
}
|
||||||
fmt.Fprintf(&output, "Prompt hash: %s\n", strconv.Quote(report.PromptHash))
|
fmt.Fprintf(&output, "Prompt hash: %s\n", strconv.Quote(report.PromptHash))
|
||||||
fmt.Fprintf(&output, "Default profile ID: %s\n", strconv.Quote(report.DefaultProfileID))
|
fmt.Fprintf(&output, "Default profile ID: %s\n", strconv.Quote(report.DefaultProfileID))
|
||||||
output.WriteString("Inputs:\n")
|
output.WriteString("Inputs:\n")
|
||||||
@@ -664,8 +656,8 @@ func encodePromptYAML(writer io.Writer, value any) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type promptCatalogEntry struct {
|
type promptCatalogEntry struct {
|
||||||
ID string `yaml:"id"`
|
ID string `yaml:"id"`
|
||||||
Version string `yaml:"version"`
|
Version *string `yaml:"version,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func encodePromptCatalog(prompts []promptkit.PromptIdentity) ([]byte, error) {
|
func encodePromptCatalog(prompts []promptkit.PromptIdentity) ([]byte, error) {
|
||||||
|
|||||||
@@ -2,16 +2,16 @@
|
|||||||
|
|
||||||
## PromptKit
|
## PromptKit
|
||||||
|
|
||||||
Selected module: `gitea.maximumdirect.net/eric/promptkit` at `v0.15.0`.
|
Selected module: `gitea.maximumdirect.net/eric/promptkit` at `v0.16.0`.
|
||||||
|
|
||||||
Copyright (C) 2026 Eric Rakestraw
|
Copyright (C) 2026 Eric Rakestraw
|
||||||
|
|
||||||
SPDX-License-Identifier: LGPL-3.0-or-later
|
SPDX-License-Identifier: LGPL-3.0-or-later
|
||||||
|
|
||||||
License and notices: [LGPL v3.0](../../LICENSE) |
|
License and notices: [LGPL v3.0](../../LICENSE) |
|
||||||
[LICENSE](https://gitea.maximumdirect.net/eric/promptkit/src/commit/635674c066d0b432187f96e72b9c03d085443ac5/LICENSE).
|
[LICENSE](https://gitea.maximumdirect.net/eric/promptkit/src/commit/9178f3eb91c2b2138caa78e22be93c048b4bc992/LICENSE).
|
||||||
|
|
||||||
[Source](https://gitea.maximumdirect.net/eric/promptkit/src/commit/635674c066d0b432187f96e72b9c03d085443ac5).
|
[Source](https://gitea.maximumdirect.net/eric/promptkit/src/commit/9178f3eb91c2b2138caa78e22be93c048b4bc992).
|
||||||
|
|
||||||
## ConfigKit
|
## ConfigKit
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ require (
|
|||||||
gitea.maximumdirect.net/eric/CommandKit v0.2.0
|
gitea.maximumdirect.net/eric/CommandKit v0.2.0
|
||||||
gitea.maximumdirect.net/eric/CommandKit/integrations/ckconfig v0.1.0
|
gitea.maximumdirect.net/eric/CommandKit/integrations/ckconfig v0.1.0
|
||||||
gitea.maximumdirect.net/eric/ConfigKit v0.8.0
|
gitea.maximumdirect.net/eric/ConfigKit v0.8.0
|
||||||
gitea.maximumdirect.net/eric/promptkit v0.15.0
|
gitea.maximumdirect.net/eric/promptkit v0.16.0
|
||||||
go.yaml.in/yaml/v4 v4.0.0-rc.6
|
go.yaml.in/yaml/v4 v4.0.0-rc.6
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ gitea.maximumdirect.net/eric/ConfigKit v0.8.0 h1:xCIhYnOHjw7rFvB+vIremPKGeROOxKT
|
|||||||
gitea.maximumdirect.net/eric/ConfigKit v0.8.0/go.mod h1:C82sbyKHYMV1OwaD2GJanFrwTfcZfjlW2JsGze5b0kA=
|
gitea.maximumdirect.net/eric/ConfigKit v0.8.0/go.mod h1:C82sbyKHYMV1OwaD2GJanFrwTfcZfjlW2JsGze5b0kA=
|
||||||
gitea.maximumdirect.net/eric/promptkit v0.15.0 h1:PhG8F4SQNyxuHDZ++nLKjtObMfkz9f38/DuSVv45bHM=
|
gitea.maximumdirect.net/eric/promptkit v0.15.0 h1:PhG8F4SQNyxuHDZ++nLKjtObMfkz9f38/DuSVv45bHM=
|
||||||
gitea.maximumdirect.net/eric/promptkit v0.15.0/go.mod h1:2YGvNca3bNXZP+e+pJeGzsNUcxwkHvzvuoc+LNNiT3E=
|
gitea.maximumdirect.net/eric/promptkit v0.15.0/go.mod h1:2YGvNca3bNXZP+e+pJeGzsNUcxwkHvzvuoc+LNNiT3E=
|
||||||
|
gitea.maximumdirect.net/eric/promptkit v0.16.0 h1:g3dhN0QfzQriaVOBmGUZCw2iBM9Mli2AAU4CbMfzcuY=
|
||||||
|
gitea.maximumdirect.net/eric/promptkit v0.16.0/go.mod h1:yGSi8nhksSNrCYZ0RTSZaVHkrF43R77g1CG1LFaNJfI=
|
||||||
gitea.maximumdirect.net/eric/promptkit-backend-openrouter/v3 v3.20260930.0 h1:lzfCDbzJQRGzIlRPRprnAV9hVVL5zUQy80VMQ0kbYa0=
|
gitea.maximumdirect.net/eric/promptkit-backend-openrouter/v3 v3.20260930.0 h1:lzfCDbzJQRGzIlRPRprnAV9hVVL5zUQy80VMQ0kbYa0=
|
||||||
gitea.maximumdirect.net/eric/promptkit-backend-openrouter/v3 v3.20260930.0/go.mod h1:HjS0f+3q0IdHCTEz+VVAEgIwIWJFAZUjuKdAtvtqKdg=
|
gitea.maximumdirect.net/eric/promptkit-backend-openrouter/v3 v3.20260930.0/go.mod h1:HjS0f+3q0IdHCTEz+VVAEgIwIWJFAZUjuKdAtvtqKdg=
|
||||||
gitea.maximumdirect.net/eric/promptkit-backend-rakestrawhome/v3 v3.20260930.0 h1:h12ZTRldAmpLAomj0oQRGteFxHLN1LPE6XDl9zJNbm8=
|
gitea.maximumdirect.net/eric/promptkit-backend-rakestrawhome/v3 v3.20260930.0 h1:h12ZTRldAmpLAomj0oQRGteFxHLN1LPE6XDl9zJNbm8=
|
||||||
|
|||||||
@@ -36,10 +36,6 @@ func newValidationCommand[I, S any](suite Suite[I, S]) commandkit.Command {
|
|||||||
func(input **validationCommandInput[I], value commandkit.Supplied[string]) {
|
func(input **validationCommandInput[I], value commandkit.Supplied[string]) {
|
||||||
(*input).request.Selection.Overlay = value
|
(*input).request.Selection.Overlay = value
|
||||||
}),
|
}),
|
||||||
commandkit.ValueFlag(commandkit.FlagMeta{Name: "version", Usage: "Prompt version to validate."}, stringDefault(""), parseDefinitionString,
|
|
||||||
func(input **validationCommandInput[I], value commandkit.Supplied[string]) {
|
|
||||||
(*input).request.Request.PromptVersion = value.Value
|
|
||||||
}),
|
|
||||||
commandkit.ValueFlag(commandkit.FlagMeta{Name: "profile", Usage: "Profile identity for validation."}, stringDefault(""), parseDefinitionString,
|
commandkit.ValueFlag(commandkit.FlagMeta{Name: "profile", Usage: "Profile identity for validation."}, stringDefault(""), parseDefinitionString,
|
||||||
func(input **validationCommandInput[I], value commandkit.Supplied[string]) {
|
func(input **validationCommandInput[I], value commandkit.Supplied[string]) {
|
||||||
(*input).request.Request.ProfileID = value.Value
|
(*input).request.Request.ProfileID = value.Value
|
||||||
|
|||||||
Reference in New Issue
Block a user