Repository navigation
Description
The page-type classifier is documented and tested as never producing homepage from the model: that label comes from the URL rule ("/" or an empty path), ahead of the model. The shipped model head nevertheless has a homepage class (class bar 0.3), and the runtime returns the model's argmax whenever it clears its bar. On any non-root URL the model can therefore label a page homepage with source: "model".
Evidence
A fire audit of the bundled artifact on 5,841 pages from domains no head was trained or tuned on (one non-root page per domain): 586 pages got a model-sourced page type, and 142 of those (24%) were homepage. A blind judge agreed with the label on 52% of them. It called them about, listing, product listing or other pages. Every other class that fires is more precise than that, and homepage is the only class with a bar as low as 0.3.
The report counts model labels in the page structure block, so an audit would print "N homepages" for pages that are not.
Where
packages/page-classifier/src/predict.ts: the page type branch takes the model's label whenprobability >= threshold, whatever the URL.packages/page-classifier/tests/predict.test.ts("homepage is a URL rule, and only a rule") only covers the root path.packages/page-classifier/src/rules-fallback.ts: the comment onrulePageTypestates the invariant.
Acceptance Criteria
- A page whose URL path is not "/" never gets
pageType.label === "homepage"from the classifier, with any source. - A root-path page still gets
homepagefrom the URL rule withsource: "rules"and confidence 1, unchanged. - On a non-root page where the model's top class is
homepage, the answer is the next class if it clears its own bar, else the rules answer; the choice is documented in the package README. - A test with a non-root URL and markup the model reads as a home page proves the first criterion.
- The golden baseline either does not move or the change is explained (page-type counts in
structure.pageTypes). -
The fire audit on the same sample is re-run (or the same pages are re-scored) and shows no(struck 2026-11-15: AC1 and AC2 make a non-roothomepagemodel fires.homepagemodel fire impossible by construction, so a re-score of the private 5,841-page sample can only return 0; proven by the shipped-head test in predict.test.ts)
Activity
nc9 commentedon Oct 30, 2026
Checked on main: ACs 1 to 4 are already satisfied.
packages/page-classifier/src/predict.tsselectPageTypeskipshomepageunless the URL is the root (the next class if it clears its own bar, else the rules answer), the package README documents the choice,tests/predict.test.tshas theselectPageTypeunit tests, a "non-root page is never homepage, with or without a model" test, and a test on the shipped head using a landing page the model reads as a home page. This landed in the original classifier bundle (#1179). With #902 (PR #1338) the root also includes/index.html; the model still never answershomepageoff the root.Not done, and not doable from the public repo: AC 5 (golden baseline) beyond the unchanged public goldens, and AC 6 (re-scoring the 5,841-page fire-audit sample), which needs the private sample. Leaving the issue open for AC 6, or closing it if you are happy with the unit and shipped-head tests as the proof.
nc9 commentedon Oct 30, 2026
Verified against main after v0.0.145. Met: criteria 1 to 4 (a non-root path is never
homepage, the root still is from the rules at confidence 1, the next class is used when it clears its own bar, and a test covers a landing page the model reads as home). Open: criterion 5 (thestructure.pageTypeseffect on the golden baseline is not explained) and criterion 6 (the re-run on the 5,841-page sample is not done). Leaving this open for those.nik
nc9 commentedon Nov 2, 2026
Checked against main (e86767f). Ticked the golden-baseline criterion: the public goldens (
golden-baseline.test.ts,tests/golden/*) do not pinstructure.pageTypesor any classification, and the guard shipped in the same commit as the classifier (8f40967, first in v0.0.138), so no baseline ever held a modelhomepageon a non-root page;golden-baseline.test.tspasses (6) andpackages/page-classifier/tests/predict.test.tspasses (74). Still open: the last criterion, re-running or re-scoring the fire audit on the same sample, which needs the private 5,841-page sample. The public evidence for it: tests inpredict.test.tsrunclassifyPagewith a head that always says homepage on non-root URLs, including "with the shipped bars no other class can clear its bar when homepage is on top".nik
nc9 commentedon Nov 4, 2026
Acceptance check against main 8d22fa2:
predict.tsselectPageTypeskips thehomepageclass unlessallowHomepage(root path);tests/predict.test.ts"a non-root page is never labelled homepage, with or without a model"predict.tsroot branch (source: "rules", confidence 1); "homepage is a URL rule, and only a rule"selectPageTypetests ("the bar that counts is the chosen class's, not homepage's"); package README page type paragraphstructure.pageTypes; the guard shipped with the classifier, so no baseline held a non-root model homepagebun test packages/page-classifier/tests/predict.test.ts: 74 pass, 0 fail.Not verifiable from here: criterion 6 needs the original 5,841-page sample, which is not available to this repo or the session. Unit and shipped-head tests prove the invariant, but the criterion asks for a re-score of that sample, so it stays unticked and the issue stays open. Someone with the sample should re-score it (or explicitly accept the shipped-head tests as the proof).
nik
nc9 commentedon Nov 15, 2026
All criteria met on public main d41e1fb. The last one (fire-audit re-score) is struck: AC1 (non-root pages never get homepage from any source) and AC2 (the root path is answered by the rules) make a non-root
homepagemodel fire impossible, whichpackages/page-classifier/tests/predict.test.tsproves in "the shipped head never answers homepage off the root path" (75 pass). Closing.