Boundary
The wrapper becomes the contract. Callers should rely on the JSON shape, not on the exact stdout format of the underlying script.
Labs / Lab 02
Move from human-friendly text to one output shape that callers can depend on.
What this adds
The term counter already works for humans. This lab makes it safer for automation by returning a predictable JSON envelope with success, items, summary data, and errors.
Once that shape is stable, other layers can validate, log, replay, and compose tool calls without scraping loose text.
The wrapper becomes the contract. Callers should rely on the JSON shape, not on the exact stdout format of the underlying script.
Success and failure both return valid JSON, and callers can inspect the result without regex or brittle parsing.
ripgrep's JSON mode shows the same pattern: a familiar CLI plus a machine-readable output format for editors, hosts, and automation.
Structured output is the difference between "I can maybe use this in a loop" and "I can trust this in a host."