Skip to content

Simplification pass: remove redundant tests and single-use indirection - #24

Merged
lavindeep merged 4 commits into
mainfrom
chore/v0.11.3-simplifications
Jul 28, 2026
Merged

Simplification pass: remove redundant tests and single-use indirection#24
lavindeep merged 4 commits into
mainfrom
chore/v0.11.3-simplifications

Conversation

@lavindeep

Copy link
Copy Markdown
Owner

Implements the twelve verified simplifications from the v0.11.3 audit as four scoped commits.

Changes

  • Remove redundant and inert tests — duplicate explanation-mapping tests fully covered by the classifier-driven drift cases, two signature-only render_diff tests, a duplicate ExtractedPage shape test, a tautological phase test, and an uncollected fixture self-test in conftest.py.
  • Dedupe test factories — one shared canonical_plan_call() helper replaces three identical propose-plan factories (ten call sites); drop the spinner's test-only _current_label_text accessor.
  • Simplify source indirection — plain max_plan_steps attribute instead of a forwarding property; inline the single-use audit redaction toggle (per-value redaction preserved and now pinned by a test); merge the duplicate active/pending plan-step scans into _plan_step(active_only=).
  • Inline single-use classifier helpers and share the workspace path display — three single-caller command_policy helpers inlined with characterization tests pinning the exact affected branches (first-match helper detection, clustered short-option parsing, format-field normalization); the duplicated live-workspace path-display adapter in both UIs extracted to make_workspace_path_display() in tools.base, with strengthened live-over-stale display tests.

Numbers

  • 23 files, +146/−247 (net −101 lines)
  • Test suite: 1678 → 1666 (17 redundant tests removed, 5 protective characterization tests added)
  • No behavior changes: all reason strings, risk levels, and classifier precedence byte-identical; docs/DESIGN.md internal references updated in the same commits

Verification

  • Full gate green at every commit: ruff check, ruff format, mypy --strict, pytest
  • Classifier changes validated by side-by-side probe comparison against the pre-change module and by mutation-testing the new characterization tests

Delete duplicate explanation-mapping tests fully covered by the
classifier-driven drift cases, two signature-only render_diff tests,
a duplicate ExtractedPage shape test, a tautological phase test, and
an uncollected PNG fixture self-test in conftest.
…cessor

Replace three identical propose_plan test factories with one shared
canonical_plan_call() helper in the fake-LLM module and migrate its
ten callers. Delete the spinner's test-only _current_label_text
accessor; tests read _frame(0).plain directly.
…scans

Replace the max_plan_steps forwarding property with a plain attribute,
inline the single-use audit redaction toggle while keeping per-value
redaction, and merge the duplicate active/pending plan-step scans into
one _plan_step(active_only=) helper. Characterization tests added for
the per-value redaction invariant and the pending-step fallback;
DESIGN.md references updated in the same change.
…display

Inline the three single-caller command-policy helpers at their call
sites, preserving first-match helper detection, option parsing, and
all reason strings and risk levels; add characterization tests that
pin the exact affected branches. Extract the duplicated live-workspace
path-display adapter from both UIs into make_workspace_path_display()
in tools.base, with strengthened live-over-stale display tests.
@cursor

cursor Bot commented Jul 18, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@lavindeep
lavindeep merged commit 4fa7e38 into main Jul 28, 2026
2 checks passed
@lavindeep
lavindeep deleted the chore/v0.11.3-simplifications branch July 28, 2026 06:43
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.

1 participant