Skip to content

feat(ponytail): regex-free over-engineering detector + numbered review findings - #84

Merged
getappz merged 2 commits into
masterfrom
feat/review-engineering-signals
Jul 7, 2026
Merged

feat(ponytail): regex-free over-engineering detector + numbered review findings#84
getappz merged 2 commits into
masterfrom
feat/review-engineering-signals

Conversation

@getappz

@getappz getappz commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features
    • Added detection for common over-engineering patterns, such as unnecessary libraries and deep-copy workarounds, to surface cleaner alternatives.
  • Documentation
    • Tightened audit and review output instructions so findings use a consistent numbered, single-line format.
    • Added clearer examples and pattern guidance to make review results easier to read and follow.
  • Tests
    • Added coverage for the new detection behavior, including matching and non-matching cases.

…w findings

- Add detect_over_engineering() with substring matching (stdlib only, no deps)
- Detects: lodash, moment, axios imports, JSON.parse(JSON.stringify) antipattern
- Numbered findings format in review and audit skill prompts
- Common patterns pre-filter table in review skill
- 5 tests covering all patterns + clean code passthrough
- Closes ponytail PR audit tickets #63, #78
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@getappz, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 3 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4524daa2-c03e-440b-9020-bd6564d744b1

📥 Commits

Reviewing files that changed from the base of the PR and between 96627a7 and f57425b.

📒 Files selected for processing (2)
  • crates/ponytail/src/skill-review.md
  • crates/ponytail/src/sub_skills.rs
📝 Walkthrough

Walkthrough

This PR adds a new detect_over_engineering function and Finding struct to sub_skills.rs that scans text for over-engineering patterns (lodash, moment, axios, deep-clone) with unit tests, and updates skill-audit.md and skill-review.md to require numbered, single-line finding output with a new common-patterns reference table.

Changes

Over-engineering Detector and Output Format

Layer / File(s) Summary
Detector struct and entrypoint
crates/ponytail/src/sub_skills.rs
Adds public Finding struct and detect_over_engineering function that scans, sorts, and returns findings.
Pattern matching and tests
crates/ponytail/src/sub_skills.rs
Implements internal line-by-line pattern matching with deduplication and adds unit tests for lodash, moment, axios, and deep-clone detection.
Numbered output format docs
crates/ponytail/src/skill-audit.md, crates/ponytail/src/skill-review.md
Updates required output templates to numbered single-line findings and adds a common-patterns pre-filter table with revised examples.

Estimated code review effort: 2 (Simple) | ~12 minutes

Possibly related issues

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description omits the required template sections for Summary, Test plan, and Notes for reviewers. Add the missing headings and fill in Summary, Test plan checkboxes, and Notes for reviewers with risk areas and backwards compatibility.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: a regex-free detector plus numbered review findings.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/review-engineering-signals

Comment @coderabbitai help to get the list of available commands.

@getappz

getappz commented Jul 7, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (2)
crates/ponytail/src/sub_skills.rs (2)

60-99: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add test coverage for single-quote imports and the "import _" false-positive risk.

All current tests use double-quoted import syntax. Given the gaps noted above, consider adding a test asserting import _ from "underscore" (or similar non-lodash import _) does not produce a lodash finding, and a test for single-quoted from 'lodash'/require('axios') style once that support is added.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/ponytail/src/sub_skills.rs` around lines 60 - 99, Add coverage in the
tests module for import parsing edge cases: extend the existing
detect_over_engineering tests to verify single-quoted module syntax is handled
for lodash/axios once supported, and add a regression test around
detect_over_engineering / the lodash detection logic to ensure a generic import
_ from a non-lodash package like underscore does not trigger a false-positive
lodash finding. Use the existing test names in the tests module as anchors and
keep the assertions aligned with the current findings tag/replacement behavior.

26-33: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Unused base_line parameter adds speculative generality.

ponytail_engineering_check_internal is only ever invoked with base_line = 0 (Line 28), and no other call site exists in the provided code. The parameter and its base_line + line_num + 1 arithmetic add complexity without current benefit — somewhat ironic for a detector built to flag over-engineering.

If there's a planned future use (e.g. scanning multi-chunk diffs with an offset), consider adding a short comment noting that; otherwise inline the 0 and drop the parameter.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/ponytail/src/sub_skills.rs` around lines 26 - 33, The helper in
ponytail_engineering_check_internal has an unused speculative base_line
parameter that is only passed as 0 from detect_over_engineering and adds
unnecessary arithmetic. Remove the base_line parameter from
ponytail_engineering_check_internal and inline the current line calculation so
callers and internal logic stay simple, or if you intend to keep offset support,
add a brief comment and use a real caller that passes a nonzero offset; update
detect_over_engineering accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/ponytail/src/skill-review.md`:
- Around line 45-47: The example bullets in the skill review content are not
following the required format because they omit the file prefix and use bare
line references; update the examples to match the exact template shape using the
same unique symbols and structure already present in this document. Keep the two
example entries consistent with the stricter guidance by preserving the required
file-scoped reference format and avoiding shorthand line notation.

In `@crates/ponytail/src/sub_skills.rs`:
- Line 35: The lodash detection in sub_skills.rs uses an overly broad needle, so
fix the lodash entry in the sub_skills list to match only lodash imports rather
than any default import named _. Update the needles associated with the lodash
rule so the matching logic in that data entry is scoped to lodash-specific
import forms, using the existing symbols around the "lodash" tuple in
sub_skills.rs.
- Around line 35-38: The needle list in sub_skills.rs only matches double-quoted
import forms, so single-quoted JS/TS imports can slip through undetected. Update
the pattern entries for the lodash, moment, and axios sub-skills to include
single-quote variants alongside the existing double-quote needles, keeping the
same intent in the common-patterns table. Use the existing tuple entries in
sub_skills.rs as the place to expand the import needles.

---

Nitpick comments:
In `@crates/ponytail/src/sub_skills.rs`:
- Around line 60-99: Add coverage in the tests module for import parsing edge
cases: extend the existing detect_over_engineering tests to verify single-quoted
module syntax is handled for lodash/axios once supported, and add a regression
test around detect_over_engineering / the lodash detection logic to ensure a
generic import _ from a non-lodash package like underscore does not trigger a
false-positive lodash finding. Use the existing test names in the tests module
as anchors and keep the assertions aligned with the current findings
tag/replacement behavior.
- Around line 26-33: The helper in ponytail_engineering_check_internal has an
unused speculative base_line parameter that is only passed as 0 from
detect_over_engineering and adds unnecessary arithmetic. Remove the base_line
parameter from ponytail_engineering_check_internal and inline the current line
calculation so callers and internal logic stay simple, or if you intend to keep
offset support, add a brief comment and use a real caller that passes a nonzero
offset; update detect_over_engineering accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d6c343a0-eefa-4916-ba9c-8d43b8393c9b

📥 Commits

Reviewing files that changed from the base of the PR and between 05263fa and 96627a7.

📒 Files selected for processing (3)
  • crates/ponytail/src/skill-audit.md
  • crates/ponytail/src/skill-review.md
  • crates/ponytail/src/sub_skills.rs

Comment thread crates/ponytail/src/skill-review.md Outdated
Comment thread crates/ponytail/src/sub_skills.rs Outdated
Comment thread crates/ponytail/src/sub_skills.rs Outdated
…e-positive fix, example format

- Add single-quoted import variants for lodash/moment/axios detection
- Remove bare 'import _' false-positive, scope to lodash-specific forms
- Fix skill-review.md examples to use required <file>:L format
- Add tests for single-quote imports and non-lodash _ import
@getappz

getappz commented Jul 7, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@getappz
getappz merged commit 55c2963 into master Jul 7, 2026
8 checks passed
@getappz
getappz deleted the feat/review-engineering-signals branch July 7, 2026 18:39
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant