diff-test: summarize changes per field (depth=2) in final output
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 57
- Forks
- 47
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 68
Description
Description
Extend diff-test's final summary line so that — when there are changes — it also reports a breakdown of changed fields aggregated at depth 2 of the JSON path.
Currently the output looks like:
Took: 15.082626564s - 0 changes in 0 of 14409 files (0.0%)
When changes exist, it would be useful to also see something like:
Field summary (files affected):
doc.body 1234
doc.flaws 456
doc.summary 12
...
Aggregation rule: multiple changes within the same depth-2 subtree on a single page count as 1 for that page (e.g. several diffs under doc.flaws.* → doc.flaws += 1 for that file).
Motivation
Makes it easier to understand the shape of a regression at a glance, without opening the HTML/CSV report.
Implementation notes
- The per-file diff in
full_diffalready produces dotted JSON-path keys in aBTreeMap<String, String>. - Add a shared counter map (
DashMap<String, AtomicUsize>) next tosame/total_changes. - After each
full_diffcall (in both the--valueHTML branch and the--csvbranch), compute theHashSetof depth-2 prefixes fromdiff.keys()and increment the counter once per prefix. - Print the sorted summary (descending by count) after the existing
Took: …line. - The non-
valueHTML branch doesn't callfull_diff, so the summary should be gated on--valueor--csv. - Note that
IGNORED_KEYScurrently excludesdoc.flaws,doc.modified,doc.popularity, etc., so those won't appear in the summary unless removed from that list.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in crates/diff-test/src/main.rs, tracing full_diff and the --value HTML and --csv branches where per-file diffs are processed. Add the depth-2 per-file aggregation and confirm that, for those modes and only when changes exist, the sorted field summary appears after the existing Took line.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 75/100