Closes #3310 Wires `ERROR_REASON.SDK_UNKNOWN_COMMAND` and `ERROR_REASON.USAGE` into the remaining untyped error paths in `gsd-tools.cjs` (template, frontmatter, requirements, milestone, uat, todo, workstream, graphify, learnings subcommand routers and `--cwd`/missing-required-arg paths). Tests assert via `JSON.parse(stderr).reason` rather than substring matching on prose. Closure regression guard locks the canonical `{ok, reason, message}` shape for every newly-typed path. Also moves `--json-errors` activation up to the top of `main()` so `--cwd` validation paths emit JSON rather than plain text when `GSD_JSON_ERRORS=1` is set.
391 B
391 B
type, pr
| type | pr |
|---|---|
| Changed | 3311 |
gsd-tools --json-errors covers every error path — every "Unknown subcommand" and missing-required-arg error now emits a typed ERROR_REASON code (sdk_unknown_command or usage) instead of the fallback unknown. Tests can now lock these paths via JSON.parse(stderr).reason without grepping the human message (#3310, builds on #3255).