chore(report): add total/results aliases for json output, document deprecation#87
Open
coletebou wants to merge 1 commit into
Open
chore(report): add total/results aliases for json output, document deprecation#87coletebou wants to merge 1 commit into
coletebou wants to merge 1 commit into
Conversation
…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 }`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
clawpatch report --jsonreturns{ findings: <count>, output, items: [...] }. The mixed naming (findingsis a number,itemsis the array) breaks common pipelines likejq '.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 marksfindings: <number>as deprecated and plans removal in 0.4.Files
src/app.ts— 4 lines added toreportCommand's json branchsrc/workflow.test.ts— 3 assertions:total === findings,total === items.length,results === itemsREADME.md— deprecation noteCHANGELOG.md— entryValidation
pnpm format:check— cleanpnpm typecheck— cleanpnpm lint— cleanpnpm build— cleanpnpm test— 541 passed, 1 skipped (+3 new)Notes
Smallest PR in this stack — additive only, no behavior change for existing callers.