Adopt the upstream fix for malformed prompt configuration

This commit is contained in:
2026-11-17 01:28:21 +00:00
parent a355f05a27
commit e8c070805e
5 changed files with 54 additions and 42 deletions

View File

@@ -70,7 +70,7 @@ License and notices: [LGPL v3](licenses/LGPL-3.0.txt) |
## CommandKit ckconfig ## CommandKit ckconfig
Selected module: `go.maximumdirect.net/ckconfig` at `v0.7.0`. Selected module: `go.maximumdirect.net/ckconfig` at `v0.8.0`.
Copyright (C) 2026 Eric Rakestraw Copyright (C) 2026 Eric Rakestraw
@@ -78,13 +78,13 @@ SPDX-License-Identifier: LGPL-3.0-or-later
License and notices: [LGPL v3](licenses/LGPL-3.0.txt) | License and notices: [LGPL v3](licenses/LGPL-3.0.txt) |
[GPL v3](licenses/GPL-3.0.txt) | [GPL v3](licenses/GPL-3.0.txt) |
[COPYRIGHT](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/64f6453b8453f914f272d427bb4ae6f59deacd2b/integrations/ckconfig/COPYRIGHT). [COPYRIGHT](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/735b35a0a175018d6f1353f66716c99fd84f3160/integrations/ckconfig/COPYRIGHT).
[Source](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/64f6453b8453f914f272d427bb4ae6f59deacd2b). [Source](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/735b35a0a175018d6f1353f66716c99fd84f3160).
## CommandKit ckprompt ## CommandKit ckprompt
Selected module: `go.maximumdirect.net/ckprompt` at `v0.7.0`. Selected module: `go.maximumdirect.net/ckprompt` at `v0.9.0`.
Copyright (C) 2026 Eric Rakestraw Copyright (C) 2026 Eric Rakestraw
@@ -92,9 +92,9 @@ SPDX-License-Identifier: LGPL-3.0-or-later
License and notices: [LGPL v3](licenses/LGPL-3.0.txt) | License and notices: [LGPL v3](licenses/LGPL-3.0.txt) |
[GPL v3](licenses/GPL-3.0.txt) | [GPL v3](licenses/GPL-3.0.txt) |
[COPYRIGHT](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/f369d6a78253b6e6fcb1e023fb2e9c3af1d20ff0/integrations/ckprompt/COPYRIGHT). [COPYRIGHT](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/29694ea874b53151d832c141b7c5913779852e0e/integrations/ckprompt/COPYRIGHT).
[Source](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/f369d6a78253b6e6fcb1e023fb2e9c3af1d20ff0). [Source](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/29694ea874b53151d832c141b7c5913779852e0e).
## Go runtime and standard library ## Go runtime and standard library
@@ -210,7 +210,7 @@ License and notices: [Apache 2.0](licenses/Apache-2.0.txt).
## PromptKit ## PromptKit
Selected module: `go.maximumdirect.net/promptkit` at `v0.23.0`. Selected module: `go.maximumdirect.net/promptkit` at `v0.23.1`.
Copyright (C) 2026 Eric Rakestraw Copyright (C) 2026 Eric Rakestraw
@@ -218,9 +218,9 @@ SPDX-License-Identifier: LGPL-3.0-or-later
License and notices: [LGPL v3](licenses/LGPL-3.0.txt) | License and notices: [LGPL v3](licenses/LGPL-3.0.txt) |
[GPL v3](licenses/GPL-3.0.txt) | [GPL v3](licenses/GPL-3.0.txt) |
[COPYRIGHT](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/fcbff80ab227397a03935ab3bf8114481c0736a7/COPYRIGHT). [COPYRIGHT](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/74066167942fcf6f70c112359995739ec9789fa6/COPYRIGHT).
[Source](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/fcbff80ab227397a03935ab3bf8114481c0736a7). [Source](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/74066167942fcf6f70c112359995739ec9789fa6).
## yaml.v3 ## yaml.v3

View File

@@ -51,8 +51,9 @@ input, and status 1 for cancellation. While the supporting release is pending,
record the mismatch explicitly. A test that asserts only nonzero status does record the mismatch explicitly. A test that asserts only nonzero status does
not verify this fix. not verify this fix.
**Complete.** The upstream handoff is recorded below. The exit-status fix **Complete.** The upstream handoff below records the original behavior.
remains outstanding after the final verification pass. The [delegated inspection follow-up](#delegated-inspection-fix) records the
adopted fix.
Build a temporary executable with `go build -o /tmp/audita-inspection ./cmd/audita`. Build a temporary executable with `go build -o /tmp/audita-inspection ./cmd/audita`.
In a scratch directory, put `version: 3` in `config.yml`, `profiles: [` in the In a scratch directory, put `version: 3` in `config.yml`, `profiles: [` in the
@@ -82,8 +83,8 @@ assign it through `configFailure`, with `show` calling it through
integrations. They need to assign status 2 for typed operator-input failures integrations. They need to assign status 2 for typed operator-input failures
at those boundaries, preserving diagnostics, available inspection evidence, at those boundaries, preserving diagnostics, available inspection evidence,
and the cause. Cancellation and other operational failures need status 1. and the cause. Cancellation and other operational failures need status 1.
The upstream tag list contained releases through `v0.7.0` for each At the time of the handoff, the latest release of both integrations was
integration, which are already pinned. Recheck both in the final stage. `v0.7.0`, the version Audita used for the reproduction.
## Stage 2 — Remove application credential substitution ## Stage 2 — Remove application credential substitution
@@ -749,7 +750,8 @@ The completed sprint should leave the target architecture reachable through
measurements actually performed, including any outstanding external dependency. measurements actually performed, including any outstanding external dependency.
**Complete.** The integrated Audita work and release bootstrap passed checks. **Complete.** The integrated Audita work and release bootstrap passed checks.
The delegated inspection exit status remains an outstanding upstream item. The [delegated inspection follow-up](#delegated-inspection-fix) closes the
upstream item that was open at the end of the sprint.
The bootstrap rejects a dirty checkout and a failed status command with no The bootstrap rejects a dirty checkout and a failed status command with no
output. A clean fixture reaches ReleaseKit with the prepared checkout and output. A clean fixture reaches ReleaseKit with the prepared checkout and
@@ -763,9 +765,9 @@ glossary input were removed.
### Delegated inspection status ### Delegated inspection status
The [CommandKit upstream tags](https://forge.maximumdirect.net/base-layer/commandkit/tags) At sprint close, the latest CommandKit integration releases were `ckprompt`
confirmed `v0.7.0` is the latest release of both `ckprompt` and `ckconfig`. and `ckconfig` v0.7.0. The built Audita executable reproduced the Stage 1
The built Audita executable reproduced the Stage 1 mismatch: mismatch:
| Invalid input | Path | Observed status and diagnostic | | Invalid input | Path | Observed status and diagnostic |
| --- | --- | --- | | --- | --- | --- |
@@ -774,10 +776,23 @@ The built Audita executable reproduced the Stage 1 mismatch:
| Malformed automatic `prompts.yml` | `config show/sources/validate/explain/diff --scope promptkit` | 1, `yaml.invalid` | | Malformed automatic `prompts.yml` | `config show/sources/validate/explain/diff --scope promptkit` | 1, `yaml.invalid` |
| Malformed explicit app main file | `config show/sources/validate/explain/diff --scope app` | 1, `yaml.invalid` | | Malformed explicit app main file | `config show/sources/validate/explain/diff --scope app` | 1, `yaml.invalid` |
Caller cancellation remains status 1 in the shared CLI and subprocess tests. Caller cancellation returned status 1 in the shared CLI and subprocess tests.
The CommandKit integrations still own the fix to return status 2 for typed
operator-input failures. Audita retains its native delegations. The expected ### Delegated inspection fix
upstream change and reproduction remain in the Stage 1 handoff.
Audita adopted `ckprompt` v0.9.0, `ckconfig` v0.8.0, and PromptKit v0.23.1.
PromptKit preserves `ErrInvalidConfig` through `errors.Is` and unwraps to the
original cause. Both integrations can now classify the typed ConfigKit load
error as invalid input. Audita uses the existing native command wiring.
[ckprompt v0.9.0 release notes](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/29694ea874b53151d832c141b7c5913779852e0e/integrations/ckprompt/docs/releases/v0.9.0.md) ·
[PromptKit v0.23.1 release notes](https://forge.maximumdirect.net/base-layer/promptkit/src/commit/74066167942fcf6f70c112359995739ec9789fa6/docs/releases/v0.23.1.md)
The Stage 1 fixture now returns status 2 with `yaml.invalid` identifying
`prompts.yml` for `promptkit list prompts`, `process`, and all five PromptKit
configuration commands. `config sources` and `config validate` still emit
their reports. All five app-scope commands likewise return status 2 for a
malformed main file. The CLI cancellation test still verifies status 1,
`context.Canceled` in the cause chain, and empty stdout.
### Catalog closure ### Catalog closure
@@ -795,7 +810,7 @@ the historical audit observations. Each stage records its verification above.
| #13, #31, #51–52, #54 | Stages 2 and 5. | | #13, #31, #51–52, #54 | Stages 2 and 5. |
| #14–15, #22, #30–32, #39, #41 | Stages 5, 12, and 15–18. | | #14–15, #22, #30–32, #39, #41 | Stages 5, 12, and 15–18. |
| #17, #21, #35, #53, #59, #62 | Stages 5 and 6, with final caller checks in Stage 20. | | #17, #21, #35, #53, #59, #62 | Stages 5 and 6, with final caller checks in Stage 20. |
| #20, #24 | Stages 7 and 11 for processing; Stage 1 and the upstream disposition above for delegated inspection. | | #20, #24 | Stages 7 and 11 for processing, and the [delegated inspection fix](#delegated-inspection-fix). |
| #23, #25, #44 | Stages 12, 18, and 19. | | #23, #25, #44 | Stages 12, 18, and 19. |
| #28–29, #58, #60–61 | Stage 20. | | #28–29, #58, #60–61 | Stage 20. |
| #33, #43 | Stages 3 and 18. | | #33, #43 | Stages 3 and 18. |

6
go.mod
View File

@@ -4,11 +4,11 @@ go 1.27.0
require ( require (
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 github.com/santhosh-tekuri/jsonschema/v6 v6.0.2
go.maximumdirect.net/ckconfig v0.7.0 go.maximumdirect.net/ckconfig v0.8.0
go.maximumdirect.net/ckprompt v0.7.0 go.maximumdirect.net/ckprompt v0.9.0
go.maximumdirect.net/commandkit v0.6.0 go.maximumdirect.net/commandkit v0.6.0
go.maximumdirect.net/configkit v1.2.0 go.maximumdirect.net/configkit v1.2.0
go.maximumdirect.net/promptkit v0.23.0 go.maximumdirect.net/promptkit v0.23.1
go.maximumdirect.net/releasekit v0.9.0 go.maximumdirect.net/releasekit v0.9.0
gopkg.in/yaml.v3 v3.0.1 gopkg.in/yaml.v3 v3.0.1
) )

12
go.sum
View File

@@ -24,16 +24,16 @@ github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY=
github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/yuin/goldmark/v2 v2.1.6 h1:igy0q9JcqovoFXFx/XjtU8sHVhcUHavPj2sA3EoKJUE= github.com/yuin/goldmark/v2 v2.1.6 h1:igy0q9JcqovoFXFx/XjtU8sHVhcUHavPj2sA3EoKJUE=
github.com/yuin/goldmark/v2 v2.1.6/go.mod h1:G6M4/qOFtfn01/o14BU1UR2Lo5N3S9Qo7xCuz/sHjGQ= github.com/yuin/goldmark/v2 v2.1.6/go.mod h1:G6M4/qOFtfn01/o14BU1UR2Lo5N3S9Qo7xCuz/sHjGQ=
go.maximumdirect.net/ckconfig v0.7.0 h1:jRmKqgReLYIRHJl7Pr4+TlucifFirGANcsoC+5WrW7A= go.maximumdirect.net/ckconfig v0.8.0 h1:ZhHlj2jGv2qXfbUJH/IwuSok/2hhopJEDqZ2fTJMbNU=
go.maximumdirect.net/ckconfig v0.7.0/go.mod h1:ZBKCi0Z72+C6kQV+1HJHXFGcZTc11FYyaH1pQDSZFl8= go.maximumdirect.net/ckconfig v0.8.0/go.mod h1:ZBKCi0Z72+C6kQV+1HJHXFGcZTc11FYyaH1pQDSZFl8=
go.maximumdirect.net/ckprompt v0.7.0 h1:iACE8fZIaq9+/DF8zt1C1JwVPgZh12F2xJmlin2r45U= go.maximumdirect.net/ckprompt v0.9.0 h1:FpNwySOi6D6f21QFqU2IcrJZv3S8oPVDSxtKZLq0PtQ=
go.maximumdirect.net/ckprompt v0.7.0/go.mod h1:IuCIwxqKVjpZ+Rcd2JO2xmJ1QVtmPki5dV5PnzbD8CY= go.maximumdirect.net/ckprompt v0.9.0/go.mod h1:qI944GIIe6YW8pNaJDdrGOZXZEoN5/tPI0GgPg9vp88=
go.maximumdirect.net/commandkit v0.6.0 h1:4PHhMIlZuuvreIxZhUazeweg6zoYixEvhM9LJnkbGNA= go.maximumdirect.net/commandkit v0.6.0 h1:4PHhMIlZuuvreIxZhUazeweg6zoYixEvhM9LJnkbGNA=
go.maximumdirect.net/commandkit v0.6.0/go.mod h1:ZS98DewKNVBygKVDoh5MFD09CnPlP37dS9pVsID5Eoc= go.maximumdirect.net/commandkit v0.6.0/go.mod h1:ZS98DewKNVBygKVDoh5MFD09CnPlP37dS9pVsID5Eoc=
go.maximumdirect.net/configkit v1.2.0 h1:c4tDJ6Xeh/Jg90UZplLxsnf500lvrZBVj0E3i1ysir8= go.maximumdirect.net/configkit v1.2.0 h1:c4tDJ6Xeh/Jg90UZplLxsnf500lvrZBVj0E3i1ysir8=
go.maximumdirect.net/configkit v1.2.0/go.mod h1:s1zLJ9GGB/1Q4a+aOHMLISonJxWFgNWpA6SpPlOafeA= go.maximumdirect.net/configkit v1.2.0/go.mod h1:s1zLJ9GGB/1Q4a+aOHMLISonJxWFgNWpA6SpPlOafeA=
go.maximumdirect.net/promptkit v0.23.0 h1:Q17wmRHWSznc1yW1MuB7dxuT3KVYRCzHI9pKBzpXhq0= go.maximumdirect.net/promptkit v0.23.1 h1:3EUB7p7ycDpWwumlsRU6ZwckvImH0BysuHPbBSGRvTA=
go.maximumdirect.net/promptkit v0.23.0/go.mod h1:pi9acdCi80HWyzY+XYwRvMEoCiTcDWKyeBh3mzHdIFo= go.maximumdirect.net/promptkit v0.23.1/go.mod h1:pi9acdCi80HWyzY+XYwRvMEoCiTcDWKyeBh3mzHdIFo=
go.maximumdirect.net/releasekit v0.9.0 h1:sK+Aoj6gS6ATU/1reocjwBekp4YETYENwkcX5ti6mrE= go.maximumdirect.net/releasekit v0.9.0 h1:sK+Aoj6gS6ATU/1reocjwBekp4YETYENwkcX5ti6mrE=
go.maximumdirect.net/releasekit v0.9.0/go.mod h1:QE4BLrAhVJTzi+/YTcVl21K/qZp9ojRLg5kuoy3Zb44= go.maximumdirect.net/releasekit v0.9.0/go.mod h1:QE4BLrAhVJTzi+/YTcVl21K/qZp9ojRLg5kuoy3Zb44=
go.yaml.in/yaml/v4 v4.0.0-rc.6 h1:1h7H1ohdUh93/FyE4YaDa1Zh64K6VVbjF4K6WUxMtH4= go.yaml.in/yaml/v4 v4.0.0-rc.6 h1:1h7H1ohdUh93/FyE4YaDa1Zh64K6VVbjF4K6WUxMtH4=

View File

@@ -41,24 +41,21 @@ func TestResourceCommandsRejectInvalidOperatorPrompts(t *testing.T) {
} }
} }
func TestMalformedCompanionKeepsDelegatedExitStatusVisible(t *testing.T) { func TestMalformedCompanionReturnsInputFailure(t *testing.T) {
main := writeRuntimeErrorConfig(t, "profiles: [\n") main := writeRuntimeErrorConfig(t, "profiles: [\n")
transcript := filepath.Join(filepath.Dir(main), "transcript.json") transcript := filepath.Join(filepath.Dir(main), "transcript.json")
if err := os.WriteFile(transcript, []byte("[]\n"), 0600); err != nil { if err := os.WriteFile(transcript, []byte("[]\n"), 0600); err != nil {
t.Fatal(err) t.Fatal(err)
} }
for _, tc := range []struct { for _, args := range [][]string{
args []string {"promptkit", "list", "prompts"},
status int {"config", "show", "--scope", "promptkit"},
}{ {"process", transcript},
{[]string{"promptkit", "list", "prompts"}, 1},
{[]string{"config", "show", "--scope", "promptkit"}, 1},
{[]string{"process", transcript}, 2},
} { } {
var stdout, stderr bytes.Buffer var stdout, stderr bytes.Buffer
code := Run(context.Background(), append(tc.args, "--config", main), &stdout, &stderr) code := Run(context.Background(), append(args, "--config", main), &stdout, &stderr)
if code != tc.status || !strings.Contains(stderr.String(), "yaml.invalid") || stdout.Len() != 0 { if code != 2 || !strings.Contains(stderr.String(), "yaml.invalid") || !strings.Contains(stderr.String(), "prompts.yml") || stdout.Len() != 0 {
t.Fatalf("%v: status=%d want=%d stdout=%q stderr=%q", tc.args, code, tc.status, stdout.String(), stderr.String()) t.Errorf("%v: status=%d want=2 stdout=%q stderr=%q", args, code, stdout.String(), stderr.String())
} }
} }
} }