Files
Trevin Chow 48082dbd14 fix(cli): synthesize happy-args instead of TODO examples (#4650)
* fix(cli): synthesize happy-args instead of TODO examples

Derive runnable pp:happy-args and Example strings from spec
example/enum/default/format at generate time. Omit example-value
placeholders from emitted Example lines rather than shipping
copy-paste 400s. Leave opaque IDs and other underivable required
inputs unset so live dogfood does not invent values.

Closes #4258

Co-authored-by: Trevin Chow <tmchow@users.noreply.github.com>

* test(cli): update goldens for synthesized happy-args

Refresh generate-golden-api and generate-public-param-names fixtures
so required params with spec defaults emit runnable Example strings
and pp:happy-args, and underivable placeholders are omitted from
Cobra Example lines.

Co-authored-by: Trevin Chow <tmchow@users.noreply.github.com>

* fix(cli): omit invented Cobra examples; reject unencodable happy-args

Apply the same required-input derivability gate to synthesized Cobra
Example strings as to pp:happy-args, and refuse values with literal
backslashes that splitHappyArgs cannot round-trip.

Co-authored-by: Trevin Chow <tmchow@users.noreply.github.com>

* fix(cli): skip underivable optional positionals in happy-args

Optional positionals no longer fail closed during synthesis. Required
positionals still block; underivable optionals are omitted from
pp:happy-args and synthesized Cobra examples.

Co-authored-by: Trevin Chow <tmchow@users.noreply.github.com>

* fix(cli): fail closed on non-trailing optional positionals

Happy-args overlays positionals by index after dropping labels, so
omitting a mid-list optional rebinds later values. Skip only a trailing
underivable-optional suffix; otherwise leave synthesis unset.

Co-authored-by: Trevin Chow <tmchow@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Trevin Chow <tmchow@users.noreply.github.com>
2026-09-09 13:06:34 +00:00
..