Repository navigation
Description
Problem
#1208 (shipped in v0.0.139 via #1218) has no effect in a real audit. On a one-page site with <section id="about"> and <section id="contact">, nav links href="#about" and href="#contact", 230 words in About and a mailto: link, squirrel audit v0.0.139 still reports:
eeat/about-pagewarn: "No About page found"eeat/contact-pagewarn: "No Contact page found"
To reproduce, serve this page locally and run squirrel audit http://127.0.0.1:8137/ --http --offline --no-publish -f llm --rule-include eeat/about-page --rule-include eeat/contact-page:
<nav><a href="#about">About</a> <a href="#services">Services</a> <a href="#contact">Contact</a></nav>
<main><section id="services">…</section>
<section id="about"><h2>Who we are</h2><p>(230 words)</p></section>
<section id="contact"><h2>Talk to us</h2><a href="mailto:[email protected]">Email us</a></section></main>Cause
findInPageSection (packages/rules/src/shared/inpage-section.ts) reads ctx.site.pages[].parsed.document. The streaming engine (streamPageRules), which the CLI and the cloud both run, gives site rules no live DOM: page DOMs are gone by the site pass, and site rules that need DOM data read page-time records from ctx.collectedSignals (see packages/rules/src/collected-signals.ts, and links/page-anchors.ts for the anchors precedent). So the matcher sees no document on any page and falls through to "No About page found". The #1218 tests built SiteData with parsed documents, the v1 shape, so they passed.
Acceptance Criteria
- The in-page section signal is collected page-time while the DOM is live: matched section ids, their word counts, and whether the page has a
mailto:/tel:link or a form. It's bounded like the other collected records, andfindInPageSectionusesctx.collectedSignalswhen present, keeping the DOM path for v1. - Engine-level test: the fixture above, run through the streaming engine (the same path
squirrel audituses), passes botheeat/about-page("About section found on the homepage (#about)") andeeat/contact-page. The test fails on v0.0.139's code. - The same engine-level test covers a thin About section (info) and a stray
id="about"with no fragment link (no pass). - The CLI repro above passes both rules.
-
crawl/single-page-site(Detect single-page sites: unscored finding plus a summary signal #1209) is checked the same way: an engine-level test with this fixture shows the finding fires (or proves it already did). -
scripts/test-suites.ts --run rulesand--run audit-enginepass, and the per-rule byte-identical golden gate holds for the rules that use collected signals.
Activity
fix(rules): legacy collected snapshots skip instead of warn, cap id s…
fix(rules): in-page About and Contact sections work in the streaming …