Skip to content

feat(flare-code): regex pre-filter for ponytail over-engineering checks - #293

Merged
getappz merged 2 commits into
masterfrom
item-54-regex-pre-filter
Jul 21, 2026
Merged

feat(flare-code): regex pre-filter for ponytail over-engineering checks#293
getappz merged 2 commits into
masterfrom
item-54-regex-pre-filter

Conversation

@getappz

@getappz getappz commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Summary

Test plan

  • cargo test -p agentflare-flare-code — 48/48 pass, including 8 new tests for the pre-filter (import/require preserved, copyright/SPDX stripped, generated-file short-circuit, existing lodash-detection still fires post-filter)
  • cargo fmt --check — clean
  • cargo clippy -p agentflare-flare-code --all-targets --all-features -- -D warnings -A unsafe_code -A clippy::pedantic — clean
  • cargo test --workspace — 692 passed, 0 failed

Summary by CodeRabbit

  • Bug Fixes
    • Improved over-engineering detection by automatically ignoring copyright and SPDX header lines.
    • Reduced false positives by excluding generated-code sections from analysis (including early generated-file markers).
  • Tests
    • Added/extended test coverage for header removal, generated-code markers, preservation of relevant lines (including imports), and continued detection of existing patterns.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: ca83ecab-27cd-4cbb-8b04-79a6c7f2f06d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds regex-based pre-filtering to over-engineering detection, removing header noise and skipping generated-code content while preserving relevant code. Tests cover filtering behavior and continued lodash detection.

Changes

Over-engineering pre-filtering

Layer / File(s) Summary
Regex pre-filter implementation
crates/flare-code/Cargo.toml, crates/flare-code/src/sub_skills.rs
Adds the regex dependency and filters copyright, SPDX, and generated-code markers before over-engineering analysis.
Pre-filter behavior validation
crates/flare-code/src/sub_skills.rs
Tests preserved imports, removed headers, generated markers, unchanged content, and lodash detection after filtering.

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

Possibly related issues

  • getappz/agentflare#54 — Implements the regex-based pre-filtering and generated-code handling described by the issue.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly names the regex pre-filter change for flare-code and matches the main PR scope.
Description check ✅ Passed The description covers Summary and Test plan with concrete results, so it is mostly complete despite missing reviewer notes.
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 item-54-regex-pre-filter

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

…checks

Strips copyright/SPDX headers and blanks out generated files before
detect_over_engineering runs, so noise lines never reach the check and
generated files are skipped entirely rather than false-positiving on
their own boilerplate.

Agentflare-Agent: claude-code_2-1-216_agent
Agentflare-Branch: item-54-regex-pre-filter
@getappz
getappz force-pushed the item-54-regex-pre-filter branch from ac1dfbf to d656bb4 Compare July 21, 2026 16:36
@getappz

getappz commented Jul 21, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 21, 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: 1

🤖 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/flare-code/src/sub_skills.rs`:
- Around line 88-97: Update pre_filter in
crates/flare-code/src/sub_skills.rs:88-97 to use any() over the first five lines
for generated-marker detection, and map filtered lines to empty strings instead
of removing them so original line numbers remain aligned. Update the expected
outputs at crates/flare-code/src/sub_skills.rs:246-250 and :272-276 to include
the preserved blank lines as \n\nfn foo() {}.
🪄 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: b2cf0f33-57ca-4392-938d-e4b2acdb042e

📥 Commits

Reviewing files that changed from the base of the PR and between dd13fae and d656bb4.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • crates/flare-code/Cargo.toml
  • crates/flare-code/src/sub_skills.rs

Comment thread crates/flare-code/src/sub_skills.rs
pre_filter stripped noise/copyright/generated lines entirely, shifting
line numbers for every finding detect_over_engineering reports after a
stripped line. Blank filtered lines instead of removing them so the
line count — and every downstream finding's line number — stays
aligned with the original source.

Agentflare-Agent: claude-code_2-1-216_agent
Agentflare-Branch: item-54-regex-pre-filter
@getappz

getappz commented Jul 21, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 21, 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 commented Jul 21, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

2 similar comments
@getappz

getappz commented Jul 21, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@getappz

getappz commented Jul 21, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 21, 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 commented Jul 21, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 21, 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 commented Jul 21, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 21, 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 commented Jul 21, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 21, 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 commented Jul 21, 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 commented Jul 21, 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 2ba4cfa into master Jul 21, 2026
18 checks passed
@getappz
getappz deleted the item-54-regex-pre-filter branch July 21, 2026 19:02
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