From 32fe7c5b986422dc8f54711555119de46308e1e9 Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Tue, 25 Aug 2026 19:25:57 +0000 Subject: [PATCH] Upgrade PromptKit to v0.8.0 --- docs/integrations/pkg-promptkit.md | 15 +++++++++------ docs/roadmap/implementation.md | 2 +- go.mod | 2 +- go.sum | 4 ++-- internal/cli/promptkit_profiles_test.go | 4 ++-- internal/cli/run_id_test.go | 11 +++++++++-- .../llm/promptkit_profile_fingerprint.go | 2 +- 7 files changed, 25 insertions(+), 15 deletions(-) diff --git a/docs/integrations/pkg-promptkit.md b/docs/integrations/pkg-promptkit.md index baa78119..e0a0971f 100644 --- a/docs/integrations/pkg-promptkit.md +++ b/docs/integrations/pkg-promptkit.md @@ -1,11 +1,11 @@ # PromptKit Integration Notarius pins -[`gitea.maximumdirect.net/eric/promptkit` v0.5.0](https://gitea.maximumdirect.net/eric/promptkit/src/tag/v0.5.0) +[`gitea.maximumdirect.net/eric/promptkit` v0.8.0](https://gitea.maximumdirect.net/eric/promptkit/src/tag/v0.8.0) as its in-process prompt engine. The upstream -[Go package consumer guide](https://gitea.maximumdirect.net/eric/promptkit/src/tag/v0.5.0/docs/consumers/pkg-promptkit.md) +[Go package consumer guide](https://gitea.maximumdirect.net/eric/promptkit/src/tag/v0.8.0/docs/consumers/pkg-promptkit.md) owns the public engine API, and the upstream -[format reference](https://gitea.maximumdirect.net/eric/promptkit/src/tag/v0.5.0/docs/formats.md) +[format reference](https://gitea.maximumdirect.net/eric/promptkit/src/tag/v0.8.0/docs/formats.md) owns prompt, profile, and schema file contracts. ## Supported Boundary @@ -26,7 +26,7 @@ Notarius relies on the root `promptkit` package to: admission exhaustion through `ErrCapacityExceeded`. The pinned -[`BackendLocal`, `LocalBackend`, and `WithBackend` API](https://gitea.maximumdirect.net/eric/promptkit/src/tag/v0.5.0/backends.go) +[`BackendLocal`, `LocalBackend`, and `WithBackend` API](https://gitea.maximumdirect.net/eric/promptkit/src/tag/v0.8.0/backends.go) owns the registration and backend-capacity contract. For one completion, the adapter calls `PrepareExecution`, takes a @@ -52,7 +52,7 @@ Notarius sends one stable effective session through PromptKit's direct session field, which is authoritative for provider session behavior. It also retains the same value as the `session_id` prompt variable for maintained prompt compatibility. The generated identifier is 76 ASCII characters, within -PromptKit v0.5.0's 256-code-point session limit. Session IDs are non-secret +PromptKit v0.8.0's 256-code-point session limit. Session IDs are non-secret correlation identifiers and may be exposed to providers and provider observability. The CLI contract owns generation and override behavior. @@ -84,7 +84,7 @@ configuration and deployment workflow are defined in [Configuration](../config.md#promptkit-profiles) and [Operations](../operations.md#promptkit-profile-deployment). -Notarius supports this boundary against PromptKit v0.5.0. Its fallback source, +Notarius supports this boundary against PromptKit v0.8.0. Its fallback source, prepared-execution, inspection, and typed capacity APIs are used as public upstream contracts; other PromptKit APIs or file-format behavior are not implicitly supported. A dependency upgrade requires reviewing the adapter, @@ -106,3 +106,6 @@ the conventional local backend. PromptKit API or format changes outside this boundary are not implicitly supported. Updating the pinned version requires reviewing the adapter and profile/configuration contracts against the upstream documentation. + +This dependency update does not change any production prompt's declared +`repair_attempts` budget. diff --git a/docs/roadmap/implementation.md b/docs/roadmap/implementation.md index a8c4969d..3c56b788 100644 --- a/docs/roadmap/implementation.md +++ b/docs/roadmap/implementation.md @@ -74,7 +74,7 @@ warning redesign as part of this plan. durable ownership distinction between PromptKit structural repair and Notarius stage/semantic validation policy. -## Stage 1: Upgrade The Dependency And Establish A Clean v0.8.0 Baseline +## Stage 1: Upgrade The Dependency And Establish A Clean v0.8.0 Baseline ✅ ### Goal diff --git a/go.mod b/go.mod index da48e8f6..c55f25b1 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module gitea.maximumdirect.net/eric/notarius go 1.25.5 require ( - gitea.maximumdirect.net/eric/promptkit v0.5.0 + gitea.maximumdirect.net/eric/promptkit v0.8.0 github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/go.sum b/go.sum index 4fd237b1..02bbdff2 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -gitea.maximumdirect.net/eric/promptkit v0.5.0 h1:jnpazLyyNhWrB2xzwwtUkNUfktkTdkENTwuSPnKiYrc= -gitea.maximumdirect.net/eric/promptkit v0.5.0/go.mod h1:R95NM6fbMDGDC0/UomgnSBP6ui2ns+8SZb8bESNvrDQ= +gitea.maximumdirect.net/eric/promptkit v0.8.0 h1:NGd9hDLu0UMxKbvittMrqM5Ua94eFb+kOE7UIir8l08= +gitea.maximumdirect.net/eric/promptkit v0.8.0/go.mod h1:R95NM6fbMDGDC0/UomgnSBP6ui2ns+8SZb8bESNvrDQ= github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI= github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 h1:KRzFb2m7YtdldCEkzs6KqmJw4nqEVZGK7IN2kJkjTuQ= diff --git a/internal/cli/promptkit_profiles_test.go b/internal/cli/promptkit_profiles_test.go index 6a76dc90..a5b9e417 100644 --- a/internal/cli/promptkit_profiles_test.go +++ b/internal/cli/promptkit_profiles_test.go @@ -71,10 +71,10 @@ api_key_env: NOTARIUS_PROMPTKIT_PROFILE_INSPECTION_TEST_KEY }, { name: "malformed profile", - profilePath: writeProfile(t, "malformed-profile", "id: malformed-profile\nbackend: [\n"), + profilePath: writeProfile(t, "malformed-profile", "id: malformed-profile\nendpoint: https://provider.example/v1?credential=forbidden\nmodel: malformed-model\n"), profileID: "malformed-profile", wantErr: []string{`PromptKit profile "malformed-profile" is invalid or unreadable`}, - rejectErr: []string{"malformed-profile.yaml", "backend: ["}, + rejectErr: []string{"malformed-profile.yaml", "credential=forbidden"}, }, { name: "invalid profile source", diff --git a/internal/cli/run_id_test.go b/internal/cli/run_id_test.go index ae0f9d97..d7829cfe 100644 --- a/internal/cli/run_id_test.go +++ b/internal/cli/run_id_test.go @@ -48,8 +48,15 @@ func TestWriteOutputFilesSupportsNestedLogicalPaths(t *testing.T) { if err != nil { t.Fatal(err) } - if info.Mode().Perm() != want { - t.Fatalf("%s mode = %#o, want %#o", path, info.Mode().Perm(), want) + mode := info.Mode().Perm() + if mode&^want != 0 { + t.Fatalf("%s mode = %#o, must not be broader than %#o", path, mode, want) + } + if info.IsDir() && mode&0o700 != 0o700 { + t.Fatalf("%s mode = %#o, want owner access", path, mode) + } + if !info.IsDir() && mode != want { + t.Fatalf("%s mode = %#o, want %#o", path, mode, want) } } entries, err := os.ReadDir(filepath.Join(runPath, "nested")) diff --git a/internal/framework/llm/promptkit_profile_fingerprint.go b/internal/framework/llm/promptkit_profile_fingerprint.go index f774dee0..e13f6720 100644 --- a/internal/framework/llm/promptkit_profile_fingerprint.go +++ b/internal/framework/llm/promptkit_profile_fingerprint.go @@ -17,7 +17,7 @@ const ( promptKitLocalBackendMarker = "notarius:promptkit-local-backend:v1" // The built-in profile catalog is compiled into this pinned PromptKit // release. Update this identity when the dependency is upgraded. - promptKitBuiltinProfileCatalogID = "promptkit:v0.5.0:builtin-profiles" + promptKitBuiltinProfileCatalogID = "promptkit:v0.8.0:builtin-profiles" ) func promptKitProfileFingerprint(profileDir, profileFile, fallbackProfileDigest string) (CheckpointFingerprint, error) {