Repository navigation
Conversation
nc9
force-pushed
the
feat/pages-command-701
branch
from
October 31, 2026 02:07
c3ff810 to
1a8a4e9
Compare
…e (json, csv, markdown, filters, flags) #701 Signed-off-by: Nik Cubrilovic <[email protected]>
…d bidi overrides, csv formula guard #701 Signed-off-by: Nik Cubrilovic <[email protected]>
…URL cells, json escapes C1 and bidi, h1/headings/@id columns, invisible chars, filters #701 Signed-off-by: Nik Cubrilovic <[email protected]>
…ters; code point sweep and escape fixpoint tests; json escape moves here #701 Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
force-pushed
the
feat/pages-command-701
branch
from
October 31, 2026 03:07
1a8a4e9 to
a140bf0
Compare
… via split/join, e2e covers query variants and a self link, CodeQL i flag #701 Signed-off-by: Nik Cubrilovic <[email protected]>
Merged
Contributor
Author
|
Landed in v0.0.149 as nik |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 1 of #701 (the CLI half;
--format html,--diffand the hostedlist_pagesfollow, see below). Refs #701.squirrel pagesprints one row per crawled page of a stored audit, modelled onsquirrel entities(same project-scoped store access,--crawl,-f,-o, exit 0 on every answer).json,csv,markdown; default is a console table of the first 50 rows on a TTY, markdown when piped or-o. CSV is RFC 4180 with the spreadsheet formula guard the entities export has; markdown cells go throughescapeMarkdownCell.--missing title|description|h1|schema,--duplicate title|description,--too-long(75 / 160, the rules' defaults),--orphan,--section /blog(segment boundary),--page <text>.core/meta-title,core/meta-description,core/h1,core/title-unique,content/duplicate-title,content/duplicate-description,links/orphan-pages,core/canonical,core/robots-meta,content/word-count, plus the factsnoindexandno-schema.--duplicateand--orphanselect on those flags.page_features, the pages' stored parse for links,rule_results); nothing is fetched. One new storage read,getFlaggedPages, returns only rule id, page and item ids (a page rule'spage_url, a duplicate group'sitems[].sourcePages, an orphan's item id). Link counts come from the stored parse (link_appearancesholds external links only), in id batches.docs/cli/pages.mdx(+ nav and CLI index) are in.Not in this PR, and why
--format html(a sortable, filterable table) and--diff <audit>: next PR.replayedcolumn for smart re-audits, hostedlist_pages(MCP and REST), the row cap and the open questions on the issue: the hosted side is the private repo. Failed pages are included as rows with their status (open question 3, recommended yes);--orphanfollows the rule (no internal in-link, not sitemap-only; open question 4).squirrel links(from the comment on the issue): a separate command, not started.Tests:
packages/report/tests/page-map-701.test.ts(15: every filter and combination, csv escaping and formula guard, markdown cell escaping, json),packages/crawler/tests/page-map-701.test.ts(2: flagged pages from page and site rules),apps/cli/tests/cli/pages-command-e2e.test.ts(9: real audit of a local site, then json/csv/markdown, each filter,-o, bad flag values, unknown crawl,--crawl), completion tests for all three shells, the help-listing test. Gates: tsgo in apps/cli, packages/report and packages/crawler, cli format:check and lint,make validate, released-changelog guard.Skill: the squirrelscan agent skill should list
squirrel pages(an agent reading a site's titles and links wants it). Needs a private issue with theskillslabel; I have not filed it.nik
Security round: every string from an audited page (url, finalUrl, title, description, canonical, schema types, the site name) is cleaned before it reaches a terminal, csv or markdown:
cleanTextstrips C0 and C1 controls (so ESC sequences, OSC 8 hyperlinks and 8-bit CSI are inert), bidi overrides and isolates, and line breaks (one value is one line). csv additionally prefixes a formula start (=,+,-,@, after any whitespace) with an apostrophe. markdown cells and code spans are escaped as before. json keeps the bytes (it escapes them itself). Shared helperstripUnsafeLineTextin core-contracts (same text as in #1394, so the two merge cleanly). Tests: report (cleanText, csvSafeText, hostile row through csv, markdown, json), console table (printTable, unparseable URL and escapes in path), and the e2e site now serves a page whose title carries ESC[2J, an OSC 8 hyperlink, a bidi override and a newline and whose description is=cmd|...; csv and markdown contain no control character and csv neutralises the formula.Review round 2 (independent review)
normalizeUrlthe orphan and internal-link rules use, so a page stored with a trailing slash or a query string gets its in- and out-links (and its self link is not counted). The e2e site now has/b?id=1and/blog/post/; the test fails (0 instead of 5) without the fix, and asserts the orphan rule does not flag them either.urlCell), tested by counting unescaped pipes per row.@idare not stored per page was wrong; they are in the stored parse. New columnsh1,headingCount,schemaIds(first 20), in json, csv and the docs; the false sentence is gone.renderPageMapJsonwrites DEL, C1 controls, bidi overrides, invisible characters and line separators as\uXXXX(lossless, still valid JSON).cleanTextremoves zero-width and tag-block characters (zero-width joiner and non-joiner kept, scripts need them);--missingonly judges pages that answered below 400 and were parsed;--sectionand--pageare case-insensitive and match percent-encoded paths (/café);--orphanhelp and docs say what the rule's minimum is and that a skipped rule flags nothing;-oto an unwritable path is a clean error; more than one--crawlwithout--diffis a usage error.title/descriptionstill merge missing, short and long (they mirror the rule's one verdict);--too-longkeeps the rules' default limits;getFlaggedPageshas no index on(crawl_id, rule_id)and scans the crawl's rule results (a schema migration, separate); no streaming for 10k+ page audits; a missing audit prints prose on stdout with exit 0 even for-f json, assquirrel entitiesdoes (decision for the maintainer).stripUnsafeLineTextnow also removes invisible characters. fix(report): squirrel report --input reads skippedChecks back #518 #1394 carries the earlier text of the same function, so whichever merges second takes this version.squirrel pages(labels: skills).