From 338e93a7ebda9a86593069d63f9d5a7fe23ccaf5 Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Mon, 23 Nov 2026 04:51:51 +0000 Subject: [PATCH] Complete library adoption validation and cleanup --- docs/cli.md | 4 ++-- docs/migrations/v4.1.md | 3 ++- docs/roadmap/implementation.md | 8 ++++++++ go.sum | 10 ---------- internal/cli/process.go | 4 ++++ internal/cli/process_inputs.go | 7 ++++++- internal/cli/runtime_errors_test.go | 13 +++++++++++++ 7 files changed, 35 insertions(+), 14 deletions(-) diff --git a/docs/cli.md b/docs/cli.md index cf6b93b..8558862 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -57,7 +57,7 @@ Process stdout contains transcript JSON when no output file is selected. Ordinar reports may record recoverable model failures even when processing completes. Exit status `0` means success, `1` runtime or output failure, `2` invalid usage or input, and native comparison may return `3` for differences. ConfigKit -classifies native configuration diagnostics; bootstrap failures and -cancellation are operational. A missing +classifies native configuration diagnostics; unclassified runtime preparation +and bootstrap failures, and cancellation, are operational. A missing processing profile or required glossary selection is an input failure. See the [output contract](integrations/output-files.md) and [subprocess contract](integrations/subprocess.md). diff --git a/docs/migrations/v4.1.md b/docs/migrations/v4.1.md index fa13aeb..0355eb8 100644 --- a/docs/migrations/v4.1.md +++ b/docs/migrations/v4.1.md @@ -57,7 +57,8 @@ should request `--format yaml` or `--format json`. See the Application and PromptKit resources now share configuration loading and validation. Invalid native configuration can be reported during application inspection as well as processing; native configuration usage errors are -classified as status `2`, while bootstrap failures are status `1`. A failed +classified as status `2`, while unclassified runtime preparation and bootstrap +failures are status `1`. A failed bootstrap occurs before transcript and output preparation. Help, version, and other help-only paths do not perform the load. See [subprocess integration](../integrations/subprocess.md) for handling results and [ConfigKit bootstrap documentation](https://forge.maximumdirect.net/base-layer/configkit/src/tag/v1.4.0/docs/config.md) diff --git a/docs/roadmap/implementation.md b/docs/roadmap/implementation.md index 7ee0570..21b3ce7 100644 --- a/docs/roadmap/implementation.md +++ b/docs/roadmap/implementation.md @@ -556,6 +556,14 @@ compatibility path or temporary scaffold, and the workspace is clean. Report the completed source commit and prepared release documentation without claiming that v4.1.0 has been published. +**Complete.** Deferred integration checks and the final cleanup are finished. +Offline `go mod tidy`, `go vet ./...`, and `go test -race ./...` passed with +Go 1.27.4. Linux amd64 and arm64 production builds succeeded, changed Go files +are formatted, affected local documentation links were checked, and retired +implementation references were reviewed. Runtime preparation errors retain +operational classification; native configuration usage errors remain usage +errors. Release documentation is prepared for a later publication task. + ## Open Questions None. Product choices are resolved by the feature roadmap. The private assembly diff --git a/go.sum b/go.sum index 851df7c..2ed1785 100644 --- a/go.sum +++ b/go.sum @@ -13,24 +13,14 @@ github.com/spf13/pflag v1.1.0 h1:6W6MbVUrnMb8PEhjkqwsVLY7ryuzRfFHF4mQd7L94ag= github.com/spf13/pflag v1.1.0/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/yuin/goldmark/v2 v2.1.16 h1:MXvCVo+Cb2SVJ5cwJUzXetDjI7HECRJCkcqylEQtcJo= github.com/yuin/goldmark/v2 v2.1.16/go.mod h1:G6M4/qOFtfn01/o14BU1UR2Lo5N3S9Qo7xCuz/sHjGQ= -go.maximumdirect.net/ckconfig v0.9.0 h1:s9Ikga4wt4K1NpLCX9bLhm5vbcm1Fgqy9yk2lmO4Sss= -go.maximumdirect.net/ckconfig v0.9.0/go.mod h1:yGjFVr2UzjJjiwDdMwsKehuQfvvtv7rTEOIk5NQOY00= go.maximumdirect.net/ckconfig v0.11.0 h1:oTPW5R4vW5TNs97rqgABC/dir723rbGBz0FUyZ9QiNk= go.maximumdirect.net/ckconfig v0.11.0/go.mod h1:9phvXeLAgQSBKpJWqPyIQASKVJr0nRhiPMIQkfNhaRo= -go.maximumdirect.net/ckprompt v0.10.0 h1:t2UyWSke+bWH9aTDrw5/bteD+TO0y5LD0NWw0y2KniQ= -go.maximumdirect.net/ckprompt v0.10.0/go.mod h1:vx8lZnelASctQtyxY2yV4PuTZfLpE9EqDa+LPj3+SHM= go.maximumdirect.net/ckprompt v0.12.0 h1:TPx4c0ohnG51F5eXk9SLHvkSKGNnWBhzkJAC5LdZCrE= go.maximumdirect.net/ckprompt v0.12.0/go.mod h1:6DsEfIbKsFFzdAAV2TZD2LiwMvEG//s7zFOVe2wDvN0= -go.maximumdirect.net/commandkit v0.7.0 h1:toLDGhHoVe6gBX5HWuzQ/Joz0cBqEhJXolW21m3axBk= -go.maximumdirect.net/commandkit v0.7.0/go.mod h1:sVp3JXKpm2YrP4Ie8Q3nWmQgwBdPN8uO+wQU72erDns= go.maximumdirect.net/commandkit v0.8.0 h1:EBDjr7SvfgvVDsA2S95hkOhgZe7oGZdDvURDJxHyX48= go.maximumdirect.net/commandkit v0.8.0/go.mod h1:sVp3JXKpm2YrP4Ie8Q3nWmQgwBdPN8uO+wQU72erDns= -go.maximumdirect.net/configkit v1.2.1 h1:f+/6WjNl6CULbMr6ZSVwi4aty9rmuDfJlvpeU7I+HZM= -go.maximumdirect.net/configkit v1.2.1/go.mod h1:ewu6blSokUDCMovy8JBXAdXRikGmlHXAQpFghnPWRfs= go.maximumdirect.net/configkit v1.4.0 h1:TfOupZbQ23/ZMs+xt5lmyukCF11ekqKep8KbmFQD63o= go.maximumdirect.net/configkit v1.4.0/go.mod h1:ewu6blSokUDCMovy8JBXAdXRikGmlHXAQpFghnPWRfs= -go.maximumdirect.net/promptkit v0.23.2 h1:nE+Qqqbw5GN4PHD2e5OEWUHXcYkESZm3ryZVBsKWwFQ= -go.maximumdirect.net/promptkit v0.23.2/go.mod h1:vPFg76VXcffP0JBFMS2WADCHwV5FYvO2O4bvIoiDlwc= go.maximumdirect.net/promptkit v0.25.0 h1:vJOfxauwASllOSDceR2oypJ4NEwIh2s6F8dDexEzdM8= go.maximumdirect.net/promptkit v0.25.0/go.mod h1:o2axdkV11KTPDgk81i2vrJ66dtcedXRhau/Ko3YSZ4A= go.maximumdirect.net/releasekit v0.10.0 h1:3GOgaIigXTkvYaRkntWZASE//2NTR1+IhkoKmt64aJo= diff --git a/internal/cli/process.go b/internal/cli/process.go index ceb169c..e559960 100644 --- a/internal/cli/process.go +++ b/internal/cli/process.go @@ -41,6 +41,10 @@ func runProcess(inv commandkit.Invocation, input processInput) commandkit.Outcom if errors.As(err, &secretsErr) { return commandkit.Failure(secretsErr.Error()).WithCause(err) } + var runtimeErr *runtimePreparationError + if errors.As(err, &runtimeErr) { + return commandkit.Failure(err.Error()).WithCause(err) + } if inv.Context.Err() != nil || appconfig.IsAssetError(err) { return commandkit.Failure("Could not prepare processing.").WithCause(err) } diff --git a/internal/cli/process_inputs.go b/internal/cli/process_inputs.go index 621f8e6..dbc22f9 100644 --- a/internal/cli/process_inputs.go +++ b/internal/cli/process_inputs.go @@ -33,6 +33,11 @@ type processInputs struct { ProtectedPaths []string } +type runtimePreparationError struct{ cause error } + +func (e *runtimePreparationError) Error() string { return e.cause.Error() } +func (e *runtimePreparationError) Unwrap() error { return e.cause } + func loadProcessInputs(ctx context.Context, input processInput, mode commandkit.ReportingMode) (*processInputs, error) { if mode == commandkit.ReportingModeQuiet && input.Output.Value == "" { return nil, fmt.Errorf("quiet processing requires an output file or /dev/null") @@ -44,7 +49,7 @@ func loadProcessInputs(ctx context.Context, input processInput, mode commandkit. } runtime, err := llm.NewRuntime(ctx, loaded, nil) if err != nil { - return nil, err + return nil, &runtimePreparationError{cause: err} } if err := ctx.Err(); err != nil { return nil, err diff --git a/internal/cli/runtime_errors_test.go b/internal/cli/runtime_errors_test.go index 4b09d0d..55b4aef 100644 --- a/internal/cli/runtime_errors_test.go +++ b/internal/cli/runtime_errors_test.go @@ -60,6 +60,19 @@ func TestMalformedCompanionReturnsInputFailure(t *testing.T) { } } +func TestRuntimePreparationFailureIsOperational(t *testing.T) { + main := writeRuntimeErrorConfig(t, "collections:\n audita:\n prompts:\n - id: modules.grammar.proposal\n messages:\n - role: user\n content: '{{'\n output:\n format: text\n validation_mode: none\n") + transcript := filepath.Join(filepath.Dir(main), "transcript.json") + if err := os.WriteFile(transcript, []byte("[]\n"), 0600); err != nil { + t.Fatal(err) + } + var stdout, stderr bytes.Buffer + status := Run(context.Background(), []string{"process", transcript, "--config", main}, &stdout, &stderr) + if status != 1 || stdout.Len() != 0 { + t.Fatalf("runtime error: status=%d stdout=%q stderr=%q", status, stdout.String(), stderr.String()) + } +} + func TestUnreadableCompanionReturnsOperationalFailure(t *testing.T) { main := writeRuntimeErrorConfig(t, "profiles: []\n") companion := filepath.Join(filepath.Dir(main), "prompts.yml")