Skip to content

fix: stop ignoring --max-depth, --min-ratio, --no-sort on --json-input#424

Merged
KSXGitHub merged 12 commits into
masterfrom
claude/relaxed-edison-bR744
May 28, 2026
Merged

fix: stop ignoring --max-depth, --min-ratio, --no-sort on --json-input#424
KSXGitHub merged 12 commits into
masterfrom
claude/relaxed-edison-bR744

Conversation

@KSXGitHub
Copy link
Copy Markdown
Owner

@KSXGitHub KSXGitHub commented May 26, 2026

Fixes #420.

--max-depth, --min-ratio, and --no-sort were ignored when --json-input
was used, so the deserialized tree was rendered verbatim. --max-depth
regressed in 0.12.0 when depth limiting moved from the visualizer into the tree
builder; --min-ratio and --no-sort had never been applied on this path.

The --json-input code path now applies the same depth retention,
insignificant-data culling, and sorting that the filesystem scan performs.

Tests

  • json_input_max_depth, json_input_min_ratio, and json_input_no_sort
    assert each flag now takes effect.
  • The existing json_input round-trip test pins --min-ratio=0 so it keeps
    verifying faithful reconstruction.

…is used

These options were silently ignored on the --json-input code path, which
rendered the deserialized tree verbatim. --max-depth regressed in 0.12.0
when depth limiting moved out of the visualizer, while --min-ratio and
--no-sort were never honored there. Apply the same depth retention,
insignificant-data culling, and sorting that the filesystem scan performs.

https://claude.ai/code/session_01Nj3xEp1eoDKRp1MUCxNQRQ
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 26, 2026

Performance Regression Reports

commit: 572e3e5

There are no regressions.

claude and others added 4 commits May 26, 2026 15:50
The existing assertion derives the expected output from the same pipeline
the production code runs, so a correlated off-by-one in the depth predicate
would pass undetected. Pin the depth boundary by asserting which node names
are present and absent, independently of that pipeline.

https://claude.ai/code/session_01Nj3xEp1eoDKRp1MUCxNQRQ
…cull_insignificant_data

Move the early-out for non-positive ratios into the method so callers no
longer need to wrap it in an `if min_ratio > 0.0` guard. The guard also
covers NaN so the method is a no-op for every ratio that is not greater
than zero, matching the behavior the call-site guards provided.

https://claude.ai/code/session_01Nj3xEp1eoDKRp1MUCxNQRQ
@KSXGitHub KSXGitHub changed the title fix!: stop ignoring --max-depth, --min-ratio, --no-sort on --json-input fix: stop ignoring --max-depth, --min-ratio, --no-sort on --json-input May 28, 2026
KSXGitHub and others added 5 commits May 28, 2026 20:32
Why is the AI so stupid?
Why, again, is the AI so fucking stupid?
The min-ratio test previously verified `actual` only against a value
produced by replaying the same culling pipeline as the code under test.
Assert directly that an entry far above the threshold survives and one far
below it is culled, so the test no longer depends solely on that pipeline.

https://claude.ai/code/session_01Nj3xEp1eoDKRp1MUCxNQRQ
Drop the `apply_pipeline` and `visualize` helpers, which computed each
expected rendering by re-running the same depth/cull/sort pipeline as the
code under test. Verify each flag instead with implementation-independent
oracles and real-run differentials: compare against a run with the flag
neutralized, and assert directly which entries appear, disappear, or change
order. This matches how the other tests in this file derive their oracles.

https://claude.ai/code/session_01Nj3xEp1eoDKRp1MUCxNQRQ
Comment thread tests/json.rs Outdated
claude added 2 commits May 28, 2026 14:52
Replace the bare boolean `assert!` comparisons with `assert_op!` from the
already-declared `assert-cmp` crate so a failure reports both operand
values. Bind the positions to locals first, as the simple macro form and
the `perfectionist::macro-argument-binding` lint both require.

https://claude.ai/code/session_01Nj3xEp1eoDKRp1MUCxNQRQ
Add `assert_op_expr` to the rule's `allow_extra` list: the macro evaluates
each operand exactly once, so it carries no drop-or-duplicate hazard, unlike
the `debug_assert_op*` pair already in `deny_extra`. With the exemption in
place, pass the position expressions to `assert_op_expr!` directly instead of
binding them to locals first.

https://claude.ai/code/session_01Nj3xEp1eoDKRp1MUCxNQRQ
@KSXGitHub KSXGitHub marked this pull request as ready for review May 28, 2026 15:10
@KSXGitHub KSXGitHub merged commit 4b0f192 into master May 28, 2026
15 checks passed
@KSXGitHub KSXGitHub deleted the claude/relaxed-edison-bR744 branch May 28, 2026 15:10
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.

fix: --max-depth (and --min-ratio, --no-sort) ignored when --json-input is used

2 participants