Skip to content

fix(detector): stop scoring bare package.json as a framework hit - #13965

Merged
ChiragAgg5k merged 1 commit into
mainfrom
fix/detector-package-json-false-positive
Sep 29, 2026
Merged

ChiragAgg5k merged 1 commit into
mainfrom
fix/detector-package-json-false-positive

Conversation

@cursor

@cursor cursor Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes #13911.

JS::getFiles() listed package.json for every JS framework. Any repo with only that file scored a 1 for all detectors, then the fewest-parents tie-break picked Angular — including lodash-only or turborepo-tooling roots with no framework.

Clear the base file list so detection requires a framework-specific config file and/or dependency package.

Test Plan

  • Added unit cases: bare package.json file-only → null; lodash / turbo / {} package contents with package.json → null
  • bin/monorepo test detector (CI)
  • Existing framework file/package edge cases still pass

Related PRs and Issues

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?
Open in Web View Automation 

Every JS framework inherited package.json from JS::getFiles(), so any
repo with only that file tied at score 1 and collapsed to Angular via
fewest-parents. Clear the base file list so detection requires a
framework-specific config file or dependency package.

Fixes #13911

Co-authored-by: chiragaggarwal5k <[email protected]>
@cursor
cursor Bot requested a review from ChiragAgg5k September 29, 2026 03:49
@cursor
cursor Bot marked this pull request as ready for review September 29, 2026 03:49
@ghost

ghost commented Sep 29, 2026

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

The change addresses the reported false positive, and I found no concrete regression requiring a fix.

This change removes package.json from the file matches inherited by JavaScript framework detectors, so a manifest alone no longer produces a framework result. It adds regression tests for a bare manifest and manifests containing only unrelated dependencies.

Verdict New comments Fixed Still open
💬 Commented 0 0 0

Note

@cursor[bot] does not have write access to this repository, so Hansi does not approve automatically. A maintainer can review and approve.

📂 Walkthrough · 2
File Change
packages/detector/src/Detection/Framework/JS.php Removes the shared package.json file match from JavaScript framework scoring.
packages/detector/tests/DetectorTest.php Tests that manifest-only repositories without framework signals return null.

Reviewed 5fd5f53 · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@greptile-apps

greptile-apps Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Changes framework detection logic for JavaScript projects.

The PR appears safe to merge.

Summary

The PR removes package.json as a generic match for every JavaScript framework and adds regressions for manifests without framework signals.

  • Framework-specific files and dependencies remain detection signals.
  • No actionable issue was identified.

Reviews (1) · Last reviewed commit: "fix(detector): stop scoring bare package..."

@github-actions

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → fix/detector-package-json-false-positive (after).

Metric Before After Change
🚀 Requests/sec 193.08 184.17 ⚪ -4.6%
⏱️ Latency P50 89.77 ms 93.66 ms ⚪ +4.3%
⏱️ Latency P95 212.6 ms 224.86 ms 🔴 +5.8%
Per-scenario breakdown & investigation details

Metrics below reflect the current branch (after). Δ P95 compares against the base.

Scenario P50 (ms) P95 (ms) Requests RPS Δ P95 (ms)
API total 93.66 224.86 11,457 184.17 +12.26
Account 182 336.94 603 10 +12.48
TablesDB 89.49 169.34 6,231 101.47 +1.16
Storage 86.87 195.84 3,015 51.13 +9.24
Functions 136.4 286.71 1,608 27.96 +35.78

Top API waits (after)

API request Max wait (ms)
account.name.update 695.29
functions.variables.update 458.18
account.prefs.update 449.49
functions.variables.create 410.56
tablesdb.rows.create 403.34

@ChiragAgg5k
ChiragAgg5k merged commit 7c97d73 into main Sep 29, 2026
51 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the fix/detector-package-json-false-positive branch September 29, 2026 10:36
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.

detector: Framework detection can never return null for a repo with a package.json

3 participants