4.7 KiB
Automatic Usage Reporting Review
Status: one open documentation finding; production code unchanged by this review.
Scope and evidence
Reviewed implementation commit b7467c5 against all eight stages of
the implementation plan and the agreed
target state.
| Stages | Review result |
|---|---|
| 1–2: capture, installation, parsing and discovery | Captured feature handles, prospective-registry validation, rollback, separate flag values, aliases, help and completion follow the selected design. |
| 3–4: lifecycle, reporting and public assembly | Startup follows successful command input checking; builtin exclusions, context composition, invocation isolation, quiet rendering, finalization order and presentation failures follow the selected contracts. |
| 5–6: upstream adoption and reports | Published PromptKit v0.25.0 supplies observation/accounting; native reasoning, ratio, cost, zero/unknown/incomplete states and smoke separation survive adaptation. R1 concerns the operator documentation. |
| 7: consumer evidence | Normal integration installation enables the offline application pipeline without accounting code in its handler. |
| 8: documentation and validation | Workspace and isolated-source checks pass. R1 remains in the canonical CLI reference. Published-dependency alignment remains the explicitly planned release follow-up. |
No production correctness defect, missing architectural capability, or inadvertently strengthened contract requiring remediation was identified.
Validation used Go 1.27.4:
- All three workspace
go testsuites passed. - Independent root and ckconfig
GOWORK=offsuites passed. - Isolated ckprompt
go test -count=1 ./...passed using a temporary modfile replacing only core and ckconfig with local sources. PromptKit remained the published v0.25.0. This does not establish compatibility with newly published core/ckconfig releases, which have not been selected for this checkout. - The offline pipeline returned valid JSON on stdout and the expected two-prompt, 28-token, USD 0.0025 summary on diagnostics. Quiet suppressed both streams.
- The offline
text_inferencesmoke command retained its own nonzero token/ratio evidence while the ordinary execution summary remained zero and carried the smoke-separation note. - Core dependency inspection found no optional integration/domain modules; formatting and diff checks passed.
R1: Complete the canonical smoke-report documentation
Priority: P3. Status: open. Plan coverage: Stages 5 and 8.
Relevant material: the smoke --format row in
the CLI reference, the
smoke report fields and example, and the new
usage-reporting description.
Compare the smoke report DTO and templates
and their installation in smoke commands.
Expected: the canonical operator reference should consistently describe the
implemented text-template default and the added structured usage evidence. Both
attempt and aggregate usage now include reasoning_tokens and cache_hit_ratio.
The ratio is a nullable numeric fraction in JSON/YAML, including a present zero;
text additionally presents available ratios as percentages with one decimal place.
Actual: the new usage-reporting section says smoke reports default to text, but the smoke flag table retains the earlier description that automatic/text output uses YAML for structured reports. The current text template does retain the YAML evidence and append percentage comments, so the table should describe that selected template rather than imply the old generic fallback. The smoke field description and sample also omit the two added usage fields and do not explain the numeric ratio's units or unavailable/null representation.
Impact: readers get inconsistent format guidance and an outdated example of
the emitted usage shape. In particular, the structured ratio's 0.2 means 20%,
not 0.2%; the canonical reference currently leaves that distinction unexplained.
The implementation and existing projection tests retain the correct evidence.
Remediation: update the smoke format row, usage-field description, and sample
in docs/cli.md to match the implemented reports. Include reasoning count state
and nullable fractional cache-hit ratio at the attempt/aggregate boundary;
explain the text percentage presentation and keep provider/accounting semantics
linked upstream. Verify the sample against the current DTO or offline consumer.
This requires documentation updates, not a production behavior change or a new
upstream-domain test suite.