Skip to content

perf(resolver): short-circuit quality score checks - #556

Open
d-oit wants to merge 1 commit into
mainfrom
perf/short-circuit-quality-score-checks-5600317163421132739
Open

perf(resolver): short-circuit quality score checks#556
d-oit wants to merge 1 commit into
mainfrom
perf/short-circuit-quality-score-checks-5600317163421132739

Conversation

@d-oit

@d-oit d-oit commented Aug 7, 2026

Copy link
Copy Markdown
Owner

This patch optimizes _check_jargon and _compute_noise in scripts/quality.py
and its shadow copy .agents/skills/do-web-doc-resolver/scripts/quality.py.
The functions are rewritten to loop and return early once the threshold
is exceeded, preventing redundant full-string scans and substring counting.
Additionally, NAV_HEAVY_HTML body content length was increased in tests
to prevent clean_content falling back to raw HTML tag stripping.


PR created automatically by Jules for task 5600317163421132739 started by @d-oit

Co-authored-by: d-oit <6849456+d-oit@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
do-web-doc-resolover Ready Ready Preview Aug 7, 2026 11:02am

@deepsource-io

deepsource-io Bot commented Aug 7, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in f266dd6...68972f6 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
JavaScript Aug 7, 2026 11:01a.m. Review ↗
Python Aug 7, 2026 11:01a.m. Review ↗
Rust Aug 7, 2026 11:01a.m. Review ↗
Shell Aug 7, 2026 11:01a.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@graphify-labs graphify-labs 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.

Graphify reviewed this change.

Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).


Graphify review — findings

This PR refactors the _check_jargon and _compute_noise helper functions in two copies of quality.py (under scripts/ and .agents/skills/do-web-doc-resolver/scripts/), replacing the sum(...) generator-based counting with explicit loops that break early once the threshold is exceeded. It also expands the NAV_HEAVY_HTML test fixture in tests/test_content_clean.py by adding a longer paragraph of main content. The changes touch content-quality signal detection logic and its associated test data.

No blocking issues surfaced.

Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 186 functions depend on the 50 functions this change touches.

Health — grade B; 8 existing hotspot(s) in the area this change touches (pre-existing, not introduced here):

  • resolve_url_stream() — 30 callers, 14 callees (high)
  • score_content() — 46 callers, 9 callees (high)
  • resolve() — 30 callers, 5 callees (high)
  • fetch_url_content() — 11 callers, 9 callees (high)
  • resolve_url_stream_async() — 2 callers, 8 callees (medium)
  • _async_main() — 1 callers, 7 callees (medium)
  • main() — 1 callers, 7 callees (medium)
  • score_content() — 0 callers, 9 callees (medium)

Verification — 186 functions in the blast radius were not formally verified this run (proofs are advisory here).

Gate & verification

graphify gate

PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.

Advisory (not blocking):

  • verification_scope: 125 function(s) in the blast radius were not formally verified this run

@codacy-production

Copy link
Copy Markdown
Contributor

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

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