Advertise framework inspection commands in usage
This commit is contained in:
@@ -87,7 +87,7 @@ loading behavior changed.
|
||||
|
||||
### R5: Include Framework Configuration Inspection In Built-In Usage
|
||||
|
||||
Priority: P3 (low). Status: Open.
|
||||
Priority: P3 (low). Status: Complete.
|
||||
|
||||
Location: `internal/adapter/cli/run.go:742–749` (`printUsage`), following the
|
||||
new command-family implementation in `2ba2ce1` and `411a67b`.
|
||||
@@ -108,6 +108,23 @@ or its incidental ordering.
|
||||
Acceptance: built-in usage advertises the actual family and remains consistent
|
||||
with `docs/cli.md`; the focused CLI check and development baseline pass.
|
||||
|
||||
Resolution: built-in usage now advertises all four framework operations, the
|
||||
supported selection flags, and that `--path` is required for `explain`.
|
||||
`TestUsageAdvertisesFrameworkConfigurationInspection` exercises the CLI entry
|
||||
point and checks the family, operations, flags, exit status, and output stream
|
||||
without snapshotting the whole usage text or fixing operation order. It failed
|
||||
before the usage change and passed afterward. Full tests, race tests, static
|
||||
checks, a native build outside the repository, formatting, and diff checks
|
||||
passed; command parsing and exit behavior are unchanged.
|
||||
|
||||
### Remediation Completion
|
||||
|
||||
R3, R4, and R5 are complete. R1's earlier resolution was verified in the current
|
||||
HTTP timeout test: assertions concern deadlines and cancellation, not context
|
||||
identity. R2 remains superseded; the current plan and feature roadmap accurately
|
||||
record completed implementation and separate release preparation. No active
|
||||
finding remains, and no historical plan or release was rewritten.
|
||||
|
||||
### Review Verification
|
||||
|
||||
- `go test -count=1 ./...`, `go test -race -count=1 ./...`, and
|
||||
|
||||
@@ -746,5 +746,6 @@ func printUsage(w io.Writer) {
|
||||
fmt.Fprintf(w, " serve: scriptorium serve [--config PATH] [--config-overlay NAME] [--promptkit-source PATH ...] [--addr %s] [--schema-dir DIR] [--artifact-root DIR] [--max-request-bytes N] [--max-artifact-bytes N] [--max-response-bytes N]\n", defaults.HTTPAddrDefault)
|
||||
fmt.Fprintln(w, " inspect prompt: scriptorium inspect prompt --prompt ID [--prompt-version VERSION] [--config PATH] [--config-overlay NAME] [--promptkit-source PATH ...] [--schema-dir DIR] [--format text|json] [--out path]")
|
||||
fmt.Fprintln(w, " inspect profile: scriptorium inspect profile --profile ID [--config PATH] [--config-overlay NAME] [--promptkit-source PATH ...] [--schema-dir DIR] [--format text|json] [--out path]")
|
||||
fmt.Fprintln(w, " inspect configuration: scriptorium inspect configuration <validate|show|sources|explain> [--config PATH] [--config-overlay NAME] [--promptkit-source PATH ...] [--schema-dir DIR] [--path JSON_POINTER (required for explain)]")
|
||||
fmt.Fprintln(w, " config: scriptorium config <validate|show|sources|explain> [--config PATH] [--config-overlay NAME] [application overrides] [--path /pointer for explain]")
|
||||
}
|
||||
|
||||
@@ -251,6 +251,32 @@ func TestParseServeArgsRejectsRuntimeOverrideFlags(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestUsageAdvertisesFrameworkConfigurationInspection(t *testing.T) {
|
||||
code, stdout, usage := runCLICommand(t, Run, nil)
|
||||
if code != ExitRuntimeError || stdout != "" {
|
||||
t.Fatalf("usage exit/streams changed: code=%d stdout=%q", code, stdout)
|
||||
}
|
||||
|
||||
var frameworkUsage string
|
||||
for _, line := range strings.Split(usage, "\n") {
|
||||
if strings.Contains(line, "inspect configuration") {
|
||||
frameworkUsage = line
|
||||
break
|
||||
}
|
||||
}
|
||||
if frameworkUsage == "" {
|
||||
t.Fatalf("usage omits framework configuration inspection: %s", usage)
|
||||
}
|
||||
for _, want := range []string{
|
||||
"validate", "show", "sources", "explain",
|
||||
"--config", "--config-overlay", "--promptkit-source", "--schema-dir", "--path",
|
||||
} {
|
||||
if !strings.Contains(frameworkUsage, want) {
|
||||
t.Errorf("framework configuration usage omits %q: %s", want, frameworkUsage)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestUsageIncludesExecutionAndServeFlags(t *testing.T) {
|
||||
var stderr bytes.Buffer
|
||||
code := Run(nil, io.Discard, &stderr)
|
||||
|
||||
Reference in New Issue
Block a user