Skip to content

Detector: corpus round 11 deferred edge cases - #1155

Merged
pbakaus merged 7 commits into
mainfrom
fix/detector-round11-edge-cases
Oct 23, 2026
Merged

pbakaus merged 7 commits into
mainfrom
fix/detector-round11-edge-cases

Conversation

@pbakaus

@pbakaus pbakaus commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Fixes #1076 (all five items).

What changes

  1. Quoted braces in at-rule headers (item 3, both engines). enclosed_only_by_at_rules (crates/foundation/src/css/scan.rs) now records where each block's header starts during the quote-aware scan it already runs (a newline ends an unterminated string, as in last_unquoted_delimiter). Before, it searched back with a quote-unaware rfind, so @supports (content: "a;b") { .b { … } } lost .b's selector. New cases are in enclosing_selector_matches_node.

  2. Inactive at-rule candidates in the pattern walk (item 2, URL engine). The stripe-only repeating_gradient_applies becomes computed_paint_applies. A glow needs the shadow property its snippet names to be something other than none, a halo needs a radial-gradient background image, and a grid needs a gradient background image. A value the capture did not record still answers yes. So does a ::before/::after part for the three new rules, because a content: '' box is never recorded. codex-grid-background used to offer only the first grid block, so the walk never got a second candidate. It now offers every grid block lazily through grid_background_hits. The frozen scanCssTextForGridBackground export still returns the first.

  3. Code in a scrolling page shell (item 4, URL engine). If a scroll-region ancestor is the page shell (clipping_container_is_page_shell), it no longer exempts code inside it. The existing code tests then decide, so a line that runs past the screen edge is reported.

  4. Wordmark name match (item 5, URL engine). If og:site_name or application-name is present, that is the site name and the title is not read. Otherwise a title with one part still counts whole. In a title with several parts, a part counts only if the host name contains it. A faint 100px "Pricing" on "Pricing | Northwind" now reports as a warning instead of an advisory.

  5. Scaled 1px text (item 1, URL engine). I checked this against main after Fix small measurement defects from craft run 1009 (round 13, branch D) #1151 landed. Fix small measurement defects from craft run 1009 (round 13, branch D) #1151 fixed the cramped-padding flush form: it now keeps sub-1px text that has a measured rect of 1px or more, text_descendants_flush_sides in quality.rs. The rest was still open: the sub-1px descendant test in no_font_size and text-occlusion's top_own_text both read the raw computed size. A new helper, painted::drawn_at_most_1px, now serves those readers and the occlusion victim test, so text a transform enlarges counts as text. The new fixture is text-occlusion-scaled-1px.html, with unit cases in painted.rs and page_checks.rs. The browser test fails with the source change stashed. This part touches only browser code, so the hook cost is unchanged.

Tests

  • Fixtures: text-occlusion-scaled-1px.html, pattern-walk-inactive-at-rules.html, text-overflow-code-page-shell.html, low-contrast-title-wordmark.html. crates/browser/tests/round11_edge_cases.rs drives them in a real browser. All three tests fail with the source changes stashed and pass with them.
  • New unit tests in driver.rs, decorative_text.rs and css_scan.rs.
  • Oracle: eight new fixture goldens were recorded from a release build and reviewed by hand (see DELTAS.md). No existing golden moved, and the frozen vectors replay unchanged. The directory sweeps are accepted deltas that were already behind main, so I did not re-record them.
  • docs/CLI-CONTRACT.md: new "Round 11 deferred edge cases" bullet. The wordmark site-name parenthetical is updated.

Hook cost

Item 3 reaches the text and static-HTML engines. Below are rule_cost --runs 9 tests/fixtures/antipatterns numbers (261 inputs) for main and this branch, run on the same machine and the same fixture set. The differences are within noise.

engine / unit main mean / p50 / p95 ms branch mean / p50 / p95 ms
static-html per edit 8.262 / 7.683 / 12.870 8.393 / 7.717 / 13.241
text per edit 3.027 / 2.870 / 4.972 3.081 / 2.915 / 5.032
static-html html-patterns 2.833 / 2.741 / 3.621 2.871 / 2.747 / 3.691
text side-tab 1.017 / 0.616 / 2.259 1.040 / 0.703 / 2.285
static-html border-rules 0.376 / 0.331 / 0.612 0.383 / 0.333 / 0.639
text codex-grid-background 0.231 / 0.180 / 0.362 0.232 / 0.180 / 0.360
static-html dark-glow 0.067 / 0.026 / 0.268 0.070 / 0.027 / 0.269
static-html stripe-child 0.029 / 0.029 / 0.081 0.030 / 0.029 / 0.083

🤖 Generated with Claude Code


Note

Medium Risk
Touches core detection heuristics (pattern gating, wordmark classification, text occlusion/overflow, and CSS selector recovery) with broad fixture coverage but subtle behavior changes on real pages.

Overview
Addresses corpus round 11 deferred edge cases (#1076) across CSS parsing, HTML pattern detection, and several browser checks.

Pattern walk: Inactive @media/@supports rules no longer suppress visible candidates. Stripe-only repeating_gradient_applies is generalized to computed_paint_applies, which also requires computed glow shadows, radial halos, and grid gradients to match what the rule declares. Grid backgrounds are offered lazily via grid_background_hits so the walk can skip dead candidates and still find the next match.

CSS structure: enclosed_only_by_at_rules tracks header start positions with quote-aware scanning so selectors inside at-rules with quoted ; or } in the header (e.g. @supports (content: "a;b")) are not lost.

Text checks: drawn_at_most_1px centralizes “1px unless transform scales it up” logic for unpainted text, occlusion victims, and overlay text—so font-size: 1px with scale: 16 is treated as readable. Code inside a full-page overflow: auto shell is no longer skipped as if it lived in a normal scroll region; overflow on code can still flag.

Wordmarks / low contrast: Site naming prefers non-empty og:site_name / application-name and ignores title parsing when set. Multi-part titles contribute site names only for segments corroborated by the hostname; faint page titles like “Pricing” on Pricing | Acme are not advisory wordmarks.

Tests: New antipattern fixtures plus round11_edge_cases.rs browser integration tests and targeted unit tests in driver, decorative_text, css_scan, painted, and page_checks.

Reviewed by Cursor Bugbot for commit cd20e24. Bugbot is set up for automated code reviews on this repo. Configure here.

pbakaus and others added 2 commits October 23, 2026 12:02
- At-rule headers: enclosingCssSelector finds each enclosing block's
  header start outside quoted strings, so a quoted brace or semicolon in
  an @supports condition no longer cuts it short.
- Pattern walk: dark-glow, radial-halo and codex-grid-background
  candidates need an element that computes what they declare, as the
  stripe rule already did; the grid scan now offers every grid block.
- text-overflow: a scrolling page shell does not exempt code in it.
- Ghost wordmark: title parts name the site only where og:site_name /
  application-name are absent and the host name holds them.

Item 1 (scaled 1px text) is left for after round 13's rewrite of the
same readers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	crates/live/assets/detect-antipatterns-browser.js
@impeccable-reviews

impeccable-reviews Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Retrigger
5 of 5 5/5 · Ready: no major issues found
This push leaves nothing to fix.

Nothing to fix.

About this review
  • crates/live/assets/detect-antipatterns-browser.js is too large to read.
  • Read from the code alone; no page was opened.

Reviewed 1 file on 23 Oct 2026, 21:29 UTC · Run page

Reviews (5) · Last reviewed commit: Wordmark: match title parts against the host without its top-level label

@greptile-apps

greptile-apps Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issue was found.

Summary

Addresses five detector edge cases, with regression fixtures, browser tests, and updated behavior notes.

  • CSS rules inside at-rules keep their selectors when headers contain quoted punctuation.
  • Pattern checks pass over inactive glow, halo, and grid candidates to find what paints.
  • Code that runs offscreen is checked even inside a scrolling page shell.
  • Faint title text counts as a wordmark only when it names the site.
  • Text enlarged from 1px is counted at the size it is drawn.

Reviews (5) · Last reviewed commit: "Wordmark: match title parts against the ..." · Reviewed by Greptile

Comment thread tests/fixtures/antipatterns/low-contrast-title-wordmark.html
pbakaus and others added 2 commits October 23, 2026 13:11
# Conflicts:
#	crates/live/assets/detect-antipatterns-browser.js
#	docs/CLI-CONTRACT.md
#	tests/oracle/DELTAS.md
The paint gate already judged font-size: 1px text at the size a
transform draws it. The sub-1px descendant test, text-occlusion's
top-text test and its victim test now ask the same drawn_at_most_1px
helper, so a run enlarged by a transform counts as text. The
cramped-padding flush form already keeps such text by its measured
rect since #1151.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pbakaus pbakaus changed the title Detector: corpus round 11 deferred edge cases (4 of 5) Detector: corpus round 11 deferred edge cases Oct 23, 2026
Comment thread crates/core/src/browser/decorative_text.rs Outdated
pbakaus and others added 2 commits October 23, 2026 13:45
…arts are

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	crates/live/assets/detect-antipatterns-browser.js

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 910a57d. Configure here.

Comment thread crates/core/src/browser/decorative_text.rs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pbakaus
pbakaus merged commit e0d6f1b into main Oct 23, 2026
20 checks passed
@linear-code

linear-code Bot commented Oct 23, 2026

Copy link
Copy Markdown

REN-1218

pbakaus added a commit that referenced this pull request Oct 23, 2026
Takes in #1155; bundle regenerated.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@pbakaus pbakaus mentioned this pull request Oct 23, 2026
abdulwahabone added a commit that referenced this pull request Oct 24, 2026
Main moved again while the previous merge was verified: release 4.7.1
and engine 0.1.17 (#1159, #1158), the row-stripe side tab and its
follow-ups (#1133, #1156), the stepper resting state (#1148), the
corpus round 11 deferred edge cases (#1155), the contrast grounds work
that drops unmeasured handed verdicts (#1147), and the generated
provider sync. No source conflicts; the in-page bundle conflicted as a
generated file and was regenerated from the merged source with
`cargo xtask bundle`. The sweep goldens stay main's as they stand: main
carries its newest fixtures' entries in them as accepted deltas in
DELTAS.md rather than re-recording, and this branch's sweep entries are
covered by its existing DELTAS entries the same way, as in the previous
merge.

Prepared with AI assistance (Claude Code).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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: corpus round 11 deferred edge cases

1 participant