Summary
Wire the existing QualitySchema constant into the gaze schema CLI command by adding positional argument support. This is the core bug fix from #118 — QualitySchema is a 248-line, tested constant that no user can access.
Parent issue: #118
Problem
gaze schema only prints report.Schema (the analyze schema)
QualitySchema exists at internal/report/schema.go:196, is maintained and tested (4 test functions), but has no CLI exposure
- The
gaze schema help text is misleading — says "Gaze analysis output" when it only covers analyze
- README says "JSON output conforms to documented schemas" (line 188) — overstates coverage
Proposed Changes
1. CLI: Add positional arg to newSchemaCmd()
Change cmd/gaze/main.go:412-425:
cobra.NoArgs → cobra.MaximumNArgs(1)
- Add
ValidArgs: []string{"analyze", "quality"} for tab completion
- Default to
analyze when no argument given (backward compatible)
- Dispatch to
report.Schema or report.QualitySchema based on arg
2. Help text updates
Short: "Print JSON Schemas for Gaze output formats"
Long: List available schema names and explain usage
3. Documentation updates
README.md:188 — clarify which outputs have formal schemas
docs/reference/cli/schema.md — update synopsis, examples, argument list
docs/reference/json-schemas.md:354-362 — remove "not exposed via CLI" note
4. Tests
TestSchemaCmd_NoArgs — backward compatibility (prints analyze schema)
TestSchemaCmd_AnalyzeArg — gaze schema analyze returns report.Schema (verify $id)
TestSchemaCmd_QualityArg — gaze schema quality returns report.QualitySchema (verify $id)
TestSchemaCmd_InvalidArg — clear error on invalid argument
TestSchemaCmd_AllSchemasAreValidJSON — table-driven JSON validity check
Constraints
- Bare
gaze schema MUST continue printing the analyze schema (backward compatibility)
- No new schema constants needed —
QualitySchema already exists
- Requires a spec (modifies production code + CLI behavior)
Summary
Wire the existing
QualitySchemaconstant into thegaze schemaCLI command by adding positional argument support. This is the core bug fix from #118 —QualitySchemais a 248-line, tested constant that no user can access.Parent issue: #118
Problem
gaze schemaonly printsreport.Schema(the analyze schema)QualitySchemaexists atinternal/report/schema.go:196, is maintained and tested (4 test functions), but has no CLI exposuregaze schemahelp text is misleading — says "Gaze analysis output" when it only coversanalyzeProposed Changes
1. CLI: Add positional arg to
newSchemaCmd()Change
cmd/gaze/main.go:412-425:cobra.NoArgs→cobra.MaximumNArgs(1)ValidArgs: []string{"analyze", "quality"}for tab completionanalyzewhen no argument given (backward compatible)report.Schemaorreport.QualitySchemabased on arg2. Help text updates
Short: "Print JSON Schemas for Gaze output formats"Long: List available schema names and explain usage3. Documentation updates
README.md:188— clarify which outputs have formal schemasdocs/reference/cli/schema.md— update synopsis, examples, argument listdocs/reference/json-schemas.md:354-362— remove "not exposed via CLI" note4. Tests
TestSchemaCmd_NoArgs— backward compatibility (prints analyze schema)TestSchemaCmd_AnalyzeArg—gaze schema analyzereturnsreport.Schema(verify$id)TestSchemaCmd_QualityArg—gaze schema qualityreturnsreport.QualitySchema(verify$id)TestSchemaCmd_InvalidArg— clear error on invalid argumentTestSchemaCmd_AllSchemasAreValidJSON— table-driven JSON validity checkConstraints
gaze schemaMUST continue printing the analyze schema (backward compatibility)QualitySchemaalready exists