You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
report: fold canonical query-string variants in the cloud builder, smart-audit union and entity map (follow-up to #858) #1350
Follow-up to #858 (PR #1348 folds query-string variants into their canonical page in the CLI report, squirrel audit and squirrel report, fresh crawls only).
Problem
The same fold is not applied everywhere a page is counted:
the hosted container's report builder (buildV1Report / cloud publish) still lists a variant as a page and counts it in affected pages;
a smart audit's union (carried pages) is not folded, so coverage.knownPages and carried findings still count variants;
the entity map lists every crawled URL, so entities.summary.pagesTotal can exceed meta.totalPages by the number of folded variants.
Expected
The helpers canonicalVariantMap and foldChecksToCanonical (packages/audit-engine/src/canonical-groups.ts) are applied in the cloud report builder and the smart-audit union, and the entity map either excludes variants or states how many it lists, so every page count in a report agrees.
Acceptance Criteria
A hosted audit of a site with a query-string variant that declares another crawled page as its canonical reports one affected page and a page total without the variant, with meta.canonicalVariants set.
A smart audit that carries pages folds carried variants the same way, and coverage.knownPages agrees with meta.totalPages.
entities.summary.pagesTotal equals meta.totalPages or the report states the number of variants the entity map still lists.
A site with no variants reports byte-identically to before in all three paths.
Tests cover the cloud builder and the smart-audit union with a variant and a paginated page that has its own canonical.
Part of this shipped in v0.0.145: the entity map fold and the shared report builder fold (with a byte-identical check when there is nothing to fold). Met: criterion 3. Open: criterion 2 and 5 (a smart audit's union of carried pages is not folded yet), criterion 4 for the union path and criterion 1 (the hosted builder option is not turned on by anything in this repo). Leaving this open.
Looked at what is left (criteria 1, 2, 4 for the union, 5): it is not buildable from this repo alone. A smart audit's carried pages live in the site_pages and findings rows the hosted store keeps, and SitePageRecord (packages/core-contracts/src/storage.ts) carries no canonical URL, so mergeSmartAudits cannot tell a carried query-string variant from a page of its own, and coverage.knownPages comes from the store's active page count. Folding them needs the canonical (or its fold target) recorded per site page at publish time, a hosted schema change, plus the hosted builder turning on the shared fold option (nothing in this repo does). Until that is decided there, a public PR would only pin today's counts. Leaving the issue open for the hosted side.
Status as of v0.0.159: this stays open. The remaining criteria (1, 2, 4 for the smart-audit union, and 5) need the canonical page recorded per site page in the hosted store and the hosted report builder to turn on the shared fold option, which is a change outside this repository; it is tracked privately. Criterion 3 is already ticked.
The remaining criteria need the hosted side first: the site page record has to carry the canonical URL, and the hosted report builder has to enable the fold. Tracked privately; this issue closes when that ships.
The CLI and engine side shipped in squirrel v0.0.180 (see the v0.0.180 section of CHANGELOG.md). Kept open until the hosted (cloud) side meets the remaining acceptance criteria.
The public side is done in v0.0.180. The remaining criteria (1, 2, 4 and the hosted-builder part of 5) need the hosted report builder to use the fold. That work is in the private cloud code and is tracked there. This issue stays open until it ships.
Correction to my earlier comment: the hosted side has shipped. The cloud runtime exports query-string variants, and the API folds them after scoring and sets canonicalVariants on the report. Tests cover a variant, carried pages and a site with no variants. The one remaining piece is folding the published entity map, which is tracked privately. This should be ready to accept once that lands.
The public side is complete on main at 9994763. bun test packages/audit-engine/tests/canonical-variants-report-1350.test.ts packages/audit-engine/tests/canonical-variants-merge-1350.test.ts gives 26 pass, 0 fail, covering the report and merge paths, a site with no variants staying byte-identical, the entity-map fold helpers, and the paginated-canonical case.
One piece is left: folding the published entity map in the hosted build, which is tracked privately. Blocked on that. This gets accepted once it lands.
Activity
fix(audit-engine,cli): entity map and the shared report builder count…
fix(audit-engine,cli): entity map fold keys on the URLs the map lists…
fix(audit-engine,cli): entity map and the shared report builder count…
fix(audit-engine,cli): entity map fold keys on the URLs the map lists…
nc9 commentedon Oct 30, 2026
Part of this shipped in v0.0.145: the entity map fold and the shared report builder fold (with a byte-identical check when there is nothing to fold). Met: criterion 3. Open: criterion 2 and 5 (a smart audit's union of carried pages is not folded yet), criterion 4 for the union path and criterion 1 (the hosted builder option is not turned on by anything in this repo). Leaving this open.
nik
nc9 commentedon Oct 31, 2026
Looked at what is left (criteria 1, 2, 4 for the union, 5): it is not buildable from this repo alone. A smart audit's carried pages live in the
site_pagesand findings rows the hosted store keeps, andSitePageRecord(packages/core-contracts/src/storage.ts) carries no canonical URL, somergeSmartAuditscannot tell a carried query-string variant from a page of its own, andcoverage.knownPagescomes from the store's active page count. Folding them needs the canonical (or its fold target) recorded per site page at publish time, a hosted schema change, plus the hosted builder turning on the shared fold option (nothing in this repo does). Until that is decided there, a public PR would only pin today's counts. Leaving the issue open for the hosted side.nik
nc9 commentedon Nov 2, 2026
Status as of v0.0.159: this stays open. The remaining criteria (1, 2, 4 for the smart-audit union, and 5) need the canonical page recorded per site page in the hosted store and the hosted report builder to turn on the shared fold option, which is a change outside this repository; it is tracked privately. Criterion 3 is already ticked.
nik
nc9 commentedon Nov 11, 2026
The remaining criteria need the hosted side first: the site page record has to carry the canonical URL, and the hosted report builder has to enable the fold. Tracked privately; this issue closes when that ships.
nik
feat(engine): site pages record their canonical; cloud merge counts v…
feat(engine): site pages record their canonical; cloud merge counts v…
feat(engine): site pages record their canonical; cloud merge counts v…
feat(engine): site pages record their canonical; cloud merge counts v…
feat(engine): site pages record their canonical; cloud merge counts v…
feat(engine): site pages record their canonical; cloud merge counts v…
feat(engine): site pages record their canonical; cloud merge counts v…
feat(engine): site pages record their canonical; cloud merge counts v…
nc9 commentedon Nov 13, 2026
The CLI and engine side shipped in squirrel v0.0.180 (see the v0.0.180 section of CHANGELOG.md). Kept open until the hosted (cloud) side meets the remaining acceptance criteria.
nc9 commentedon Nov 16, 2026
The public side is done in v0.0.180. The remaining criteria (1, 2, 4 and the hosted-builder part of 5) need the hosted report builder to use the fold. That work is in the private cloud code and is tracked there. This issue stays open until it ships.
nc9 commentedon Nov 16, 2026
Correction to my earlier comment: the hosted side has shipped. The cloud runtime exports query-string variants, and the API folds them after scoring and sets
canonicalVariantson the report. Tests cover a variant, carried pages and a site with no variants. The one remaining piece is folding the published entity map, which is tracked privately. This should be ready to accept once that lands.nc9 commentedon Nov 20, 2026
The public side is complete on main at 9994763.
bun test packages/audit-engine/tests/canonical-variants-report-1350.test.ts packages/audit-engine/tests/canonical-variants-merge-1350.test.tsgives 26 pass, 0 fail, covering the report and merge paths, a site with no variants staying byte-identical, the entity-map fold helpers, and the paginated-canonical case.One piece is left: folding the published entity map in the hosted build, which is tracked privately. Blocked on that. This gets accepted once it lands.
nik