Skip to content

fix(classifier): the root /index.html document reads as the home page #902 - #1338

Closed
nc9 wants to merge 5 commits into
mainfrom
fix/page-type-900-902
Closed

nc9 wants to merge 5 commits into
mainfrom
fix/page-type-900-902

Conversation

@nc9

@nc9 nc9 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #902. Refs #900 (already satisfied on main for the model side, see below).

What changed

isRootPath (the URL rule behind homepage) now also accepts the single-segment /index.html, exact and case-sensitive, query string and fragment ignored. Nothing else changes: nested documents, other document names and locale roots stay as they were. README and rulePageType docs state the rule. The existing test that listed /index.html among "never homepage" paths is updated, and /index.html is added to the "root path is unchanged" shipped-model test.

Measurement (issue AC 1, 2, 4): the bar is NOT met on the raw numbers

For 3,000 origins from the launch corpus (fixed seed) I fetched /, a control path that cannot exist (a host that serves the home page for any path is excluded), and each index, default and home document. A document "is the home page" when title, first H1 and (Jaccard >= 0.9) text equal the root's: objective, no judge. Script and criteria: ops/scratch/pagetype-902/analyze-index-docs.py.

  • /index.html served in place (not redirected away): 628 pages, 558 the same page as /: 0.889, lower 95% bound 0.862 (under the 0.90 the issue set).
  • Setting aside 5 error-titled answers: 558 of 623 = 0.896 (lower 0.869).
  • Also setting aside 33 near-empty answers (fewer than 15 distinct words: blank or placeholder pages rather than documents): 558 of 590 = 0.946, lower 0.924.
  • Every other index, default and home document is lower still (index.php 0.79, index.htm 0.52, the rest 0.0 to 0.5) and unchanged.

So the rule is justified only if near-empty answers are not counted against it. That is a judgement call and is left to the maintainer; the numbers above are all stated in the CHANGELOG and on the issue.

Caveats, stated plainly: the sample is launch-corpus origins, skewed to modern sites, and I cannot check overlap with the page-type training and audit sets. The first pass (a different 3,000 origins) gave the same picture (index.html 0.88 raw, everything else lower). The 457 sites whose /index.html redirects elsewhere are not counted: their crawled page is wherever it lands.

#900

The model-side ACs (1 to 4) are already on main: selectPageType vetoes homepage off the root path, the README documents the choice, and predict.test.ts has unit tests plus a test on the shipped head. AC 5 and 6 (golden numbers and re-scoring the 5,841-page fire-audit sample) need the private sample and are not done here.

Tests

predict.test.ts: each of index, default and home with html, htm, php, asp, aspx and jsp (only /index.html is root), a nested path, a query string, a fragment, exact-match negatives (case, trailing dot, extra text), the locale root, and the page at /index.html classified as homepage from the rules at confidence 1. page-classifier suite: 230 pass. make validate passes, tsgo clean. Docs: package README (no user docs mention this rule). Skill: no change.

Review round

@nc9
nc9 force-pushed the fix/page-type-900-902 branch from 11148e3 to 18c7b6d Compare October 30, 2026 20:24
@nc9

nc9 commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Landed in v0.0.145 as a0d13093 07fde398 89b4609c 29259872 9be14af1 via #1377. Release: https://github.com/squirrelscan/squirrelscan/releases/tag/v0.0.145. Closing this original.

nik

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.

Page type: index and default documents at the site root read as unknown, not homepage

1 participant