Simplify consumer migration and subprocess guidance
This commit is contained in:
@@ -15,7 +15,7 @@ and the HTTP service according to the boundary your application needs.
|
|||||||
|
|
||||||
Go applications that need an in-process prompt framework should import
|
Go applications that need an in-process prompt framework should import
|
||||||
`go.maximumdirect.net/promptkit` directly. The tagged
|
`go.maximumdirect.net/promptkit` directly. The tagged
|
||||||
[Promptkit Go consumer guide](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/804a4d32b23aa2e7973400bb0a322a7016574c9f/docs/consumers/pkg-promptkit.md)
|
[Promptkit Go consumer guide](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/207677e9948dc5699073a4d6620d21139033c72d/docs/consumers/pkg-promptkit.md)
|
||||||
owns that interface; Scriptorium does not provide a Go library package.
|
owns that interface; Scriptorium does not provide a Go library package.
|
||||||
Consumers arriving from the former Scriptorium Go API should follow the
|
Consumers arriving from the former Scriptorium Go API should follow the
|
||||||
[migration guide](migrating-to-promptkit.md).
|
[migration guide](migrating-to-promptkit.md).
|
||||||
@@ -36,4 +36,4 @@ Scriptorium does not persist run state. A retry can produce different output
|
|||||||
and can incur another provider request. CLI exits belong to the
|
and can incur another provider request. CLI exits belong to the
|
||||||
[CLI reference](../cli.md), HTTP status behavior belongs to the
|
[CLI reference](../cli.md), HTTP status behavior belongs to the
|
||||||
[HTTP API reference](../api.md), and framework semantics belong to
|
[HTTP API reference](../api.md), and framework semantics belong to
|
||||||
[PromptKit v0.23.3](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/804a4d32b23aa2e7973400bb0a322a7016574c9f/docs/formats.md).
|
[PromptKit v0.25.0](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/207677e9948dc5699073a4d6620d21139033c72d/docs/formats.md).
|
||||||
|
|||||||
@@ -1,115 +1,11 @@
|
|||||||
# Migrate From Scriptorium To Promptkit
|
# Migrate From Scriptorium To PromptKit
|
||||||
|
|
||||||
This historical first hop targets Promptkit v0.11.1 and its former module
|
Scriptorium v0.11.1 was the final release containing the former in-process Go
|
||||||
path. For the current public module `go.maximumdirect.net/promptkit` and the
|
framework. Later Scriptorium releases provide the executable CLI and HTTP
|
||||||
ID-only configuration cutover, follow the
|
application instead; there is no compatibility facade for the old Go package.
|
||||||
[current upgrade guide](upgrading-promptkit.md) afterward and consult the
|
|
||||||
[current Go consumer guide](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/804a4d32b23aa2e7973400bb0a322a7016574c9f/docs/consumers/pkg-promptkit.md).
|
|
||||||
|
|
||||||
## Supported Migration Boundary
|
Applications needing an in-process framework should use
|
||||||
|
`go.maximumdirect.net/promptkit` and its [current consumer guide](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/207677e9948dc5699073a4d6620d21139033c72d/docs/consumers/pkg-promptkit.md).
|
||||||
Scriptorium `v0.11.1` at
|
Use the [PromptKit migration guidance](upgrading-promptkit.md) for library
|
||||||
`gitea.maximumdirect.net/eric/scriptorium` is the final release that provides
|
formats and successor releases. Applications using Scriptorium as a process or
|
||||||
the former in-process Go framework. Promptkit `v0.11.1` at
|
service should instead follow the [consumer overview](api.md).
|
||||||
`gitea.maximumdirect.net/eric/promptkit` is the destination for that framework
|
|
||||||
API. Scriptorium `v0.12.0` and later provide the CLI and HTTP application only.
|
|
||||||
|
|
||||||
There is no Scriptorium compatibility facade, alias package, forwarding
|
|
||||||
package, or deprecated wrapper. A consumer that cannot migrate may remain
|
|
||||||
pinned to Scriptorium `v0.11.1`, but that framework-bearing line does not
|
|
||||||
provide the slim application release.
|
|
||||||
|
|
||||||
## Update A Go Consumer
|
|
||||||
|
|
||||||
Start from a clean consumer checkout and review the pending diff before
|
|
||||||
committing it. Add the published Promptkit module:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
go get gitea.maximumdirect.net/eric/promptkit@v0.11.1
|
|
||||||
```
|
|
||||||
|
|
||||||
For an ordinary consumer that imports the former root package under its
|
|
||||||
default name, replace the exact import and package qualifier, then format the
|
|
||||||
changed Go files:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
git grep -l \
|
|
||||||
'"gitea.maximumdirect.net/eric/scriptorium"' \
|
|
||||||
-- '*.go' |
|
|
||||||
while IFS= read -r go_file
|
|
||||||
do
|
|
||||||
perl -pi -e \
|
|
||||||
's{"gitea.maximumdirect.net/eric/scriptorium"}{"gitea.maximumdirect.net/eric/promptkit"}g; s{\bscriptorium\.}{promptkit.}g' \
|
|
||||||
"$go_file"
|
|
||||||
gofmt -w "$go_file"
|
|
||||||
done
|
|
||||||
```
|
|
||||||
|
|
||||||
Inspect the resulting diff. Consumers that used an import alias should retain
|
|
||||||
or deliberately rename that alias instead of applying the qualifier
|
|
||||||
replacement mechanically.
|
|
||||||
|
|
||||||
Remove the now-unused Scriptorium requirement through module tidiness and run
|
|
||||||
the consumer's complete tests:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
go mod tidy
|
|
||||||
go test ./...
|
|
||||||
```
|
|
||||||
|
|
||||||
Confirm that `go.mod` selects Promptkit `v0.11.1` and that no Go file imports
|
|
||||||
the former Scriptorium package:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
test "$(
|
|
||||||
go list -m -f '{{.Path}}@{{.Version}}' \
|
|
||||||
gitea.maximumdirect.net/eric/promptkit
|
|
||||||
)" = 'gitea.maximumdirect.net/eric/promptkit@v0.11.1'
|
|
||||||
if git grep -n \
|
|
||||||
'gitea.maximumdirect.net/eric/scriptorium' \
|
|
||||||
-- '*.go'
|
|
||||||
then
|
|
||||||
printf '%s\n' 'a former Scriptorium Go import remains' >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
```
|
|
||||||
|
|
||||||
## Compatibility And Additions
|
|
||||||
|
|
||||||
Promptkit preserves the established engine, request, result, profile,
|
|
||||||
source-option, model-client, artifact, validation-value, and public-error
|
|
||||||
shapes where practical. Exact declarations and current behavior belong to the
|
|
||||||
tagged [Promptkit consumer guide](https://gitea.maximumdirect.net/eric/promptkit/src/tag/v0.11.1/docs/consumers/pkg-promptkit.md)
|
|
||||||
and Go source.
|
|
||||||
|
|
||||||
Promptkit also includes migration-relevant public contracts that were not in
|
|
||||||
Scriptorium `v0.11.1`:
|
|
||||||
|
|
||||||
- [`WithArtifactReader`](https://gitea.maximumdirect.net/eric/promptkit/src/tag/v0.11.1/engine.go#L169-L174)
|
|
||||||
and the
|
|
||||||
[`ArtifactReader` declaration](https://gitea.maximumdirect.net/eric/promptkit/src/tag/v0.11.1/types.go#L315)
|
|
||||||
provide the artifact-reading extension described by the tagged
|
|
||||||
[extension-interface guide](https://gitea.maximumdirect.net/eric/promptkit/src/tag/v0.11.1/docs/consumers/pkg-promptkit.md#extension-interfaces).
|
|
||||||
- [`ErrProfileRequired` and `ErrAPIKeyEnvMissing`](https://gitea.maximumdirect.net/eric/promptkit/src/tag/v0.11.1/engine.go#L33-L48)
|
|
||||||
provide the specific identities described by the tagged
|
|
||||||
[error guide](https://gitea.maximumdirect.net/eric/promptkit/src/tag/v0.11.1/docs/consumers/pkg-promptkit.md#handle-errors).
|
|
||||||
|
|
||||||
Use those tagged owners for exact signatures, wrapping guarantees, and
|
|
||||||
extension behavior.
|
|
||||||
|
|
||||||
## Verify Consumer Behavior
|
|
||||||
|
|
||||||
Source compatibility is only the first check. Exercise the behavior the
|
|
||||||
consumer actually relies upon, especially:
|
|
||||||
|
|
||||||
- prompt, profile, and schema source selection;
|
|
||||||
- direct and environment-based credentials;
|
|
||||||
- caller, generation, and transport timeout layering;
|
|
||||||
- output validation and validation-failure handling;
|
|
||||||
- injected model-client and artifact-reader extensions; and
|
|
||||||
- every `errors.Is` branch used for recovery or classification.
|
|
||||||
|
|
||||||
Also verify any serialized values, redaction expectations, filesystem policy,
|
|
||||||
and provider integration behavior that crosses the consumer's own boundary.
|
|
||||||
Promptkit owns the in-process framework contract; Scriptorium owns only its
|
|
||||||
executable CLI and HTTP application interfaces.
|
|
||||||
|
|||||||
@@ -35,20 +35,27 @@ occurrences share native last-occurrence precedence.
|
|||||||
|
|
||||||
## Migrate Application Configuration
|
## Migrate Application Configuration
|
||||||
|
|
||||||
Replace the source-selector list and top-level schema directory with
|
Replace `promptkit.configuration` and `promptkit.schema_dir` with native root
|
||||||
`promptkit.configuration` and `promptkit.schema_dir`.
|
imports and embedded PromptKit settings under `promptkit`. The
|
||||||
The [maintained example](../../examples/config.yml) selects a separate framework
|
[maintained example](../../examples/config.yml) imports a framework entry;
|
||||||
entry file that imports prompt/profile/backend definitions through native
|
wrapperless fragments can be mounted at the native destination. There is no
|
||||||
ConfigKit composition. No source/schema CLI flags or compatibility conversion
|
compatibility loader or source/schema CLI flag. Migrate schema references and
|
||||||
remain. Do not embed framework definitions inside the application section.
|
definitions using the [PromptKit configuration migration guide](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/207677e9948dc5699073a4d6620d21139033c72d/docs/consumers/configuration-migration.md).
|
||||||
|
|
||||||
Discovery now uses native cwd, user-config, home, then Unix-system presets and
|
Discovery now uses native cwd, user-config, home, then Unix-system presets and
|
||||||
their filename conventions. It is no longer limited to the two former
|
their filename conventions. It is no longer limited to the two former
|
||||||
`config.yml` paths. Set an explicit config path when migrating unattended jobs.
|
`config.yml` paths. Set an explicit config path when migrating unattended jobs.
|
||||||
Overlays remain native name selections. Application-scope native `--set` records
|
Overlays remain native name selections. Both `app` and `promptkit` scopes now
|
||||||
retain conflict rejection; order does not make duplicate paths authoritative.
|
inspect the same whole load and support native `--set` records at application-root
|
||||||
|
paths. A focused view can explicitly inspect outside its focus. Each comparison
|
||||||
|
side loads independently but native secrets bootstrap can affect the shared
|
||||||
|
process environment between sides; see [configuration](../config.md).
|
||||||
There are no custom source/schema/HTTP selectors under `config`.
|
There are no custom source/schema/HTTP selectors under `config`.
|
||||||
|
|
||||||
|
For library-level changes, see [PromptKit v0.24](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/207677e9948dc5699073a4d6620d21139033c72d/docs/releases/v0.24.0.md),
|
||||||
|
[v0.25](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/207677e9948dc5699073a4d6620d21139033c72d/docs/releases/v0.25.0.md), and
|
||||||
|
[CommandKit v0.8](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/0b53a63648c536afe50c46f948159116f776adae/docs/releases/v0.8.0.md).
|
||||||
|
|
||||||
## Capture Artifacts And Reports
|
## Capture Artifacts And Reports
|
||||||
|
|
||||||
For an artifact file plus full native report, from the repository root:
|
For an artifact file plus full native report, from the repository root:
|
||||||
|
|||||||
@@ -1,100 +1,14 @@
|
|||||||
# Upgrade PromptKit Sources And Definitions
|
# Upgrade PromptKit Sources And Definitions
|
||||||
|
|
||||||
This guide covers the earlier framework configuration cutover to
|
PromptKit owns its format and API migrations. Consult its
|
||||||
[PromptKit v0.23.3](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/804a4d32b23aa2e7973400bb0a322a7016574c9f/docs/consumers/configuration-migration.md)
|
[configuration migration guide](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/207677e9948dc5699073a4d6620d21139033c72d/docs/consumers/configuration-migration.md),
|
||||||
and ConfigKit v1.2.1. See the [framework format reference](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/804a4d32b23aa2e7973400bb0a322a7016574c9f/docs/formats.md)
|
[v0.24.0 release notes](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/207677e9948dc5699073a4d6620d21139033c72d/docs/releases/v0.24.0.md),
|
||||||
for the full upstream contract. The subsequent [native CLI migration](upgrading-cli.md)
|
[v0.25.0 release notes](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/207677e9948dc5699073a4d6620d21139033c72d/docs/releases/v0.25.0.md), and
|
||||||
owns command, reporting, application-discovery, and source-setting changes.
|
[current format reference](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/207677e9948dc5699073a4d6620d21139033c72d/docs/formats.md).
|
||||||
|
|
||||||
Removing version selectors and changing framework definition shapes are
|
For Scriptorium, deploy the migrated definitions and their source-relative
|
||||||
intentional incompatible changes under the [release policy](../policy/release.md#versioning-and-compatibility).
|
resources together. Replace the old external entry selector with shared
|
||||||
|
configuration imports as described in the [CLI migration guide](upgrading-cli.md#migrate-application-configuration).
|
||||||
## Application configuration
|
See [configuration](../config.md) for selected acquisition and
|
||||||
|
[operations](../operations.md) for restart and deployment responsibilities.
|
||||||
Framework definition migration and application acquisition are separate changes.
|
There is no legacy loader or compatibility conversion.
|
||||||
Rewrite older framework files as below, then select their entry file using the
|
|
||||||
current [application configuration](../config.md#application-settings).
|
|
||||||
The old source-selector list and top-level schema root are not current aliases;
|
|
||||||
follow the [CLI migration guide](upgrading-cli.md#migrate-application-configuration).
|
|
||||||
Scriptorium does not provide a legacy definition reader or embedded-definition
|
|
||||||
extraction/reload path.
|
|
||||||
|
|
||||||
## Rewrite framework definitions
|
|
||||||
|
|
||||||
Replace version-keyed prompts and keyed profile/backend mappings with lists
|
|
||||||
of records containing `id`. For example, before:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
prompts:
|
|
||||||
report:
|
|
||||||
"1":
|
|
||||||
default_profile: fast
|
|
||||||
messages:
|
|
||||||
- role: user
|
|
||||||
content: Summarize this note.
|
|
||||||
output:
|
|
||||||
format: text
|
|
||||||
validation_mode: none
|
|
||||||
profiles:
|
|
||||||
fast:
|
|
||||||
endpoint: https://example.invalid/v1
|
|
||||||
model: synthetic-model
|
|
||||||
```
|
|
||||||
|
|
||||||
After:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
prompts:
|
|
||||||
- id: report
|
|
||||||
default_profile: fast
|
|
||||||
messages:
|
|
||||||
- role: user
|
|
||||||
content: Summarize this note.
|
|
||||||
output:
|
|
||||||
format: text
|
|
||||||
validation_mode: none
|
|
||||||
profiles:
|
|
||||||
- id: fast
|
|
||||||
endpoint: https://example.invalid/v1
|
|
||||||
model: synthetic-model
|
|
||||||
```
|
|
||||||
|
|
||||||
Select prompts by exact ID; `--prompt-version` is rejected. If multiple former
|
|
||||||
versions must remain independently selectable, give them distinct IDs and
|
|
||||||
update callers. Qualified IDs such as `support/answer` are passed unchanged.
|
|
||||||
PromptKit resolves `content_file` relative to the source that supplied the
|
|
||||||
field, including imported or inherited definitions. The
|
|
||||||
[framework format reference](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/804a4d32b23aa2e7973400bb0a322a7016574c9f/docs/formats.md#messages-and-templates)
|
|
||||||
describes which paths are allowed within the source root.
|
|
||||||
|
|
||||||
Convert framework source controls from `configkit:` to `config:` and add
|
|
||||||
`required: true` for imports that must exist. An optional framework source
|
|
||||||
header, if present, is `version: 2`. Use sibling inheritance such as
|
|
||||||
`extends: {id: base}`.
|
|
||||||
|
|
||||||
The single external framework entry uses native ConfigKit import composition;
|
|
||||||
there is no application-managed source-list precedence. Native record replacement
|
|
||||||
and inheritance remain upstream-owned. Checkouts imported by the same
|
|
||||||
[discovery file](../config.md#collection-checkout-discovery) are peers:
|
|
||||||
conflicting definitions of the same ID fail instead of overriding one another.
|
|
||||||
|
|
||||||
Null profile endpoint, credential, or provider-map settings can fall
|
|
||||||
back to the selected backend; review behavior rather than assuming null clears
|
|
||||||
backend values. Keep JSON schemas self-contained instead of depending on remote
|
|
||||||
schema references. Application selectors remain separate from these framework
|
|
||||||
semantics.
|
|
||||||
|
|
||||||
## Replace catalog selections
|
|
||||||
|
|
||||||
The default-on OpenRouter bundle supplies actual profiles such as `auto` and
|
|
||||||
`gpt-sol-latest`. Former catalog and `promptkit-openrouter-*` IDs are not
|
|
||||||
compatibility aliases. Choose an intended current bundled profile explicitly,
|
|
||||||
or define a complete local profile with the endpoint, model, and settings you
|
|
||||||
need. Do not assume a new default model. The bundle is an underlay and caller
|
|
||||||
records can replace it through ordinary composition.
|
|
||||||
|
|
||||||
For multiple independently maintained repositories, see the
|
|
||||||
[collection-discovery example](../../examples/config.discovery.yml). Its
|
|
||||||
entry files declare their own namespaces; checkout names do not become IDs.
|
|
||||||
The [CLI reference](../cli.md) defines qualified selection and prepared preview; the
|
|
||||||
[operations guide](../operations.md) describes when updates take effect.
|
|
||||||
|
|||||||
@@ -14,11 +14,13 @@ for older command and file-output conventions.
|
|||||||
|
|
||||||
Pass an explicit application configuration or deliberately arrange the child's
|
Pass an explicit application configuration or deliberately arrange the child's
|
||||||
[configuration discovery](../config.md). Supply only the environment needed for
|
[configuration discovery](../config.md). Supply only the environment needed for
|
||||||
selected credentials; never put raw keys in arguments.
|
selected credentials; never put raw keys in arguments. Configured native secrets
|
||||||
|
bootstrap can populate the child's environment during acquisition; its effects
|
||||||
|
and diagnostics follow the [configuration contract](../config.md#inspection-and-credentials).
|
||||||
|
|
||||||
Discovery completeness is distinct from binding satisfaction and execution
|
Consumers own their binding graph and policy for incomplete discovery findings;
|
||||||
readiness. Partial reports can succeed. Consumers own their binding graph and
|
Scriptorium supplies no workflow state. The [upstream CLI contract](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/0b53a63648c536afe50c46f948159116f776adae/docs/cli.md)
|
||||||
policy for incomplete findings; Scriptorium supplies no workflow state.
|
owns native discovery and reporting semantics.
|
||||||
|
|
||||||
## Streams, Reports, And Availability
|
## Streams, Reports, And Availability
|
||||||
|
|
||||||
|
|||||||
@@ -517,6 +517,14 @@ behavior has an upstream owner instead of a new local reference table.
|
|||||||
|
|
||||||
## Stage 10 — Simplify Consumer And Migration Guidance
|
## Stage 10 — Simplify Consumer And Migration Guidance
|
||||||
|
|
||||||
|
**Status: Complete.** Consumer navigation now points to the selected PromptKit
|
||||||
|
contracts. The CLI migration guide explains shared imports, both inspection
|
||||||
|
scopes, override paths, and bootstrap effects. Historical Go migration and
|
||||||
|
PromptKit upgrade guidance are condensed to application boundaries and upstream
|
||||||
|
owners. Subprocess guidance retains process, delivery, and recovery responsibilities.
|
||||||
|
Incoming links to changed migration headings were checked; full link validation
|
||||||
|
remains in the final audit.
|
||||||
|
|
||||||
**Files:** `docs/consumers/api.md`, `upgrading-cli.md`, `upgrading-promptkit.md`,
|
**Files:** `docs/consumers/api.md`, `upgrading-cli.md`, `upgrading-promptkit.md`,
|
||||||
`migrating-to-promptkit.md`, and `docs/integrations/subprocess.md`.
|
`migrating-to-promptkit.md`, and `docs/integrations/subprocess.md`.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user