Skip to content

chore(report): add total/results aliases for json output, document deprecation#87

Merged
steipete merged 3 commits into
openclaw:mainfrom
coletebou:pr/report-json-shape
May 20, 2026
Merged

chore(report): add total/results aliases for json output, document deprecation#87
steipete merged 3 commits into
openclaw:mainfrom
coletebou:pr/report-json-shape

Conversation

@coletebou
Copy link
Copy Markdown
Contributor

Summary

clawpatch report --json returns { findings: <count>, output, items: [...] }. The mixed naming (findings is a number, items is the array) breaks common pipelines like jq '.findings | length'.

This PR adds two additive aliases (no breaking changes):

{
  "findings": 3,        // existing — count, deprecated
  "total":    3,        // new — count, canonical
  "output":   "...",
  "items":    [...],    // existing — array
  "results":  [...]     // new — same array reference
}

results === items (referential equality, not a copy). README marks findings: <number> as deprecated and plans removal in 0.4.

Files

  • src/app.ts — 4 lines added to reportCommand's json branch
  • src/workflow.test.ts — 3 assertions: total === findings, total === items.length, results === items
  • README.md — deprecation note
  • CHANGELOG.md — entry

Validation

  • pnpm format:check — clean
  • pnpm typecheck — clean
  • pnpm lint — clean
  • pnpm build — clean
  • pnpm test — 541 passed, 1 skipped (+3 new)

Notes

Smallest PR in this stack — additive only, no behavior change for existing callers.

coletebou and others added 3 commits May 18, 2026 14:40
…precation

`clawpatch report --json` previously returned `{ findings: <count>, output, items: [...] }`,
which mixed a count called `findings` with an array under `items` and broke common
shell pipelines like `jq '.findings | length'`.

Add additive aliases so existing callers keep working:
- `total: <count>` mirrors `findings`.
- `results: <array>` is the same reference as `items` (parity with `{count, results}` consumers).

The legacy `findings: <number>` key is kept but documented as deprecated; v0.4
will drop `findings: <number>` and `results`, landing on `{ total, items, output }`.
@steipete steipete requested a review from a team as a code owner May 20, 2026 02:31
@steipete steipete merged commit 0812eed into openclaw:main May 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants