Skip to content

test: cover emitter domain guidance regressions#911

Merged
madara88645 merged 4 commits into
mainfrom
cursor/missing-test-coverage-4ca9
Jul 2, 2026
Merged

test: cover emitter domain guidance regressions#911
madara88645 merged 4 commits into
mainfrom
cursor/missing-test-coverage-4ca9

Conversation

@cursor

@cursor cursor Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add focused regression coverage for domain-specific guidance in app/emitters.py
  • fix a false-positive follow-up route where generic "Optimize this API..." prompts were incorrectly getting React-performance questions

Risky behavior now covered

  • browser-download prompts only surface Safari/file-download guidance when both browser and download signals are present
  • React performance prompts surface the intended performance considerations and follow-up questions
  • generic API optimization prompts no longer misroute to React-profiler follow-ups

Test files added/updated

  • tests/test_emitters_utils.py
  • tests/test_expanded_prompt.py

Why these tests materially reduce regression risk

  • they pin core compile prompt routing in a shared utility with broad product impact
  • they cover both positive and negative branches, so future heuristic refactors are less likely to silently misclassify prompts
  • they validate the user-facing v2 expanded prompt output, not just helper internals

Validation

  • python3 -m pytest tests/test_emitters_utils.py tests/test_expanded_prompt.py -q
  • python3 -m pytest tests/test_emitters.py tests/test_emitters_utils.py tests/test_expanded_prompt.py -q

Notes

  • Aikido MCP security scanning was not available in this environment, so I could not run the requested scan step.
Open in Web View Automation 

@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
compiler Ready Ready Preview, Comment Jul 1, 2026 3:17pm

@madara88645

Copy link
Copy Markdown
Owner

@cursor please rebase this PR onto the latest main.

Since this branch was opened, #912 (fix(heuristics): correct QA report high-severity regressions) landed and heavily reworked app/emitters.py — specifically _relevant_followups, which is the same region this PR touches. A local git merge-tree shows a "changed in both" conflict there, so it is not cleanly mergeable as-is.

Two asks:

  1. Rebase onto current main and resolve the _relevant_followups conflict.
  2. Justify the behavior change: this PR removes "optimi" from the perf follow-up marker set (a real behavior change, not just test coverage — despite the test: title). Please explain why, or drop it. If it's intentional, cover it with an explicit test and note it in the PR description.

After rebasing, make sure the full suite (incl. the new tests/test_qa_report_gate.py gate from #912) stays green. Keep changes conservative and provider-agnostic.

@cursor

cursor Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

I've successfully rebased the PR onto the latest main and resolved all conflicts. Here's what I did:

Changes Made

1. Rebased onto current main

2. Updated tests for new heuristic

3. Justified the "optimi" behavior change
The removal of "optimi" from the performance markers is intentional and already well-tested:

The problem it fixes: Generic prompts like "Optimize this API and make it better" were incorrectly triggering React-specific performance questions ("Have you profiled it with React DevTools Profiler?")

How it's fixed: By removing "optimi", generic optimization requests now correctly route to software domain questions ("Which language, framework, and version are targeted?"), while React performance issues still trigger through other markers like "re-render", "rerender", "slow", "perf", "memo", etc.

Test coverage: The test test_generic_api_optimization_prompt_falls_back_to_software_followups explicitly validates this behavior

4. Verified full test suite

Ready for Review

The PR is now cleanly rebased and all tests pass. The behavior change is intentional, well-tested, and solves a real false-positive routing issue. The changes remain conservative and provider-agnostic as requested.

Open in Web Open in Cursor 

cursoragent and others added 4 commits July 1, 2026 15:14
Co-authored-by: Mehmet Özel <madara88645@users.noreply.github.com>
Co-authored-by: Mehmet Özel <madara88645@users.noreply.github.com>
Co-authored-by: Mehmet Özel <madara88645@users.noreply.github.com>
Adapt scenario consideration tests to match the stricter
detect_frontend_download_feature logic from #912. The new detection
requires three signals: download/export action, feature-adding verb
(add/create/implement), and frontend surface (browser/button/users).

The updated tests now correctly validate both positive and negative
paths for the centralized heuristic.

Co-authored-by: Mehmet Özel <madara88645@users.noreply.github.com>
@cursor cursor Bot force-pushed the cursor/missing-test-coverage-4ca9 branch from 3e62151 to 4b7b18f Compare July 1, 2026 15:17
@madara88645 madara88645 marked this pull request as ready for review July 2, 2026 05:11
@madara88645 madara88645 merged commit df3db9e into main Jul 2, 2026
12 checks passed
@madara88645 madara88645 deleted the cursor/missing-test-coverage-4ca9 branch July 2, 2026 05:11

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

PR Risk Assessment

Risk level: Low

Code review required: No

Reviewers assigned: None (not required at this risk level)

Approval: N/A — PR already merged (df3db9e by @madara88645)


Evidence-based assessment

Area Finding
Files changed 3 (app/emitters.py, tests/test_emitters_utils.py, tests/test_expanded_prompt.py)
Production logic 1-line change: removed "optimi" from perf-marker list in _relevant_followups
Tests +102 lines of focused regression coverage (unit + expanded-prompt integration)
Blast radius Narrow — fixes false-positive routing where generic "Optimize this API…" prompts incorrectly received React-profiler follow-ups
Infra / auth / schema None

Rationale

The diff is predominantly test additions, but it includes a small production behavior fix in shared emitter routing. That places it above Very Low (test-only), yet the change is a single, well-isolated heuristic correction with strong positive/negative test coverage — consistent with Low risk.

No CODEOWNERS file is present; no domain-expert review is warranted at this level.


Automated risk assessment — conclusions derived from diff evidence only.

Open in Web View Automation 

Sent by Cursor Automation: Assign PR reviewers

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.

2 participants