Skip to content

Page map export: per-page titles, descriptions, schema and links as a table (squirrel pages / list_pages) #701

Closed

Description

@nc9

Problem

After an audit there is no way to see the site as a table of pages. The JSON, markdown and llm reports contain issues and the entity map, but not the per-page data the crawl already collected. Checking a site's titles and descriptions for search intent, spotting orphan pages, or comparing schema across a section means writing a separate crawler.

A failing-rule list only shows pages that break a rule. Pages that pass do not appear, so you cannot review the whole set side by side or see patterns such as every blog title ending in the same suffix.

Proposal

A page map export from the crawl, as squirrel pages on the CLI and a list_pages tool on the MCP server and API, modelled on squirrel entities and list_entities.

One row per crawled page:

  • URL, final URL after redirects, HTTP status, canonical, robots/noindex
  • title and its length
  • meta description and its length
  • H1, heading count, word count
  • JSON-LD types and @ids declared on the page
  • internal links in and out, external links out (with the external domains), and anchor text
  • crawl depth, last modified, response time

Options:

  • --format csv|json|html|markdown. The html output is a single sortable, filterable table, as entities -f html already is for the graph.
  • Filters: --missing title|description|h1|schema, --duplicate title|description, --too-long, --orphan, --section /blog, --page <substring>.
  • --diff between two audits, so a title rewrite can be checked after a fix.
  • Flags column that reuses existing rule results (too long, duplicate, no schema, orphan), so the table and the issue list agree.

Notes

  • The data is already extracted during the crawl for the title, description, canonical, schema and link rules, so it should add no extra credits.
  • Paginate on the MCP side (limit, offset, hasMore) as list_entities does.
  • A prototype of the columns, run against a sitemap, was useful for a 15 site review: it surfaced duplicate and overlong descriptions, pages with no @id on their schema and orphan pages in one view.

Suggested labels: enhancement, cli, mcp, crawler.

Acceptance Criteria

  • squirrel pages prints one row per crawled page from the latest audit with: URL, final URL, status, canonical, noindex, title and length, description and length, H1, heading count, word count, JSON-LD types/@ids, internal links in/out, external links out with domains, crawl depth, response time.
  • --format csv|json|html|markdown all work; html is a single sortable, filterable table.
  • Filters work and combine: --missing title|description|h1|schema, --duplicate title|description, --too-long, --orphan, --section <path>, --page <substring>.
  • A flags column reuses existing rule results so the table and the issue list agree.
  • --diff <audit> shows added, removed and changed rows between two audits.
  • The hosted MCP and API expose list_pages with limit, offset, hasMore, same row shape as the CLI.
  • No extra credits are charged beyond the audit; the data comes from the existing crawl.
  • Shell completions, docs (docs/) and the agent skill are updated in the same change; a private issue (label skills) is filed if the skill needs a change.

Activity

  1. added
    enhancement
    size: L
    on Oct 12, 2026
  2. nc9 commented on Oct 13, 2026

    @nc9
    ContributorAuthor

    Spec prep

    Verdict: feature request, still not built (current main e95e0f5, v0.0.112). Neither the CLI nor the MCP has a per-page export today.

    The only per-page data in the report is pageStatuses (url and status, in core-contracts AuditReport). The data itself is already stored, so no extra crawling or credits are needed.

    Data source: what the local crawl DB already holds

    All of these live in packages/crawler/src/storage/sqlite.ts, one row set per crawl_id:

    Column(s) in the request Source
    URL, final URL, status, crawl depth, response time, last modified pages (url, final_url, status, depth, load_time_ms, ttfb, last_modified, redirect_chain)
    title, description (lengths are derived), canonical, noindex, word count, JSON-LD types page_features (title, description, canonical, robots_noindex, meta_noindex, word_count, schema_types), written by extractPageFeatures (packages/audit-engine/src/page-features.ts) on every streaming audit and replayed from the rule cache
    H1 count page_features.report_scalars.h1Count
    H1 text, heading count not stored as scalars (see below)
    internal links in and out, external links out, external domains, anchor text link_appearances (href, page_url, anchor_text, rel, is_nofollow) joined to links.is_internal
    JSON-LD @ids per page entity_occurrences joined to entities
    flags rule_results (per crawl and page)

    For H1 text and heading count, the CLI can read them from pages.parsed_data (one JSON.parse per page), but the better fix is to add h1Text and headingCount to reportScalars in extractPageFeatures. It is a JSON column, so no migration is needed.

    Retention: retireCrawls can reclaim older audits (crawls.retired_at), so --diff has to refuse a retired crawl with a clear message.

    Hosted side (private repo, reference only)

    • Postgres has no per-page scalar store. site_pages holds only status and state; page_findings holds findings.
    • list_entities (apps/api/src/mcp/tools/entity-tools.ts) reads the entity map that arrives with the published report.
      • At publish time (apps/api/src/routes/v1/reports.ts), validatePublishedEntityMap checks it against the shared EntityMapSchema and strips unknown keys.
      • storePublishedEntityMap then writes it to R2 and indexes it in website_entity_snapshots.
      • The engine caps the map with ENTITY_MAP_PUBLISH_LIMITS (packages/core-contracts/src/entity-map.ts, 512 KB).
    • list_pages should copy that design exactly:
      • an optional pageMap section on the report, with a PageMapSchema and PAGE_MAP_PUBLISH_LIMITS in core-contracts;
      • built by the engine from the rows above;
      • carried by both publish paths (CLI publish and the cloud worker-agent);
      • validated, cleaned and stored to R2 by the API, then served paginated (limit, offset, hasMore).
    • Without an explicit schema the publish path will not keep the new section, so the private PR is required, not optional.
    • squirrel mcp is a stdio front end for the hosted MCP, so the tool lives only in apps/api.

    Credits

    None. squirrel pages reads the local store. list_pages is a read-only tool over a stored report, like list_entities and get_report: no re-crawl, no link checks, no probes.

    The one real cost is publish size. At about 600 bytes a row, a 500-page map is about 300 KB, and it counts against the single-POST publish budget (#2634's chunked path). Cap it with row and string limits, and mark the map truncated when a cap is hit.

    Surface

    • CLI

      • command: apps/cli/src/cli/commands/pages.ts, registered in apps/cli/src/cli/index.ts
      • controller: apps/cli/src/controllers/pages.ts
      • filters: apps/cli/src/pages/filters.ts
      • flags mirror squirrel entities: --input, crawl selection, -f, -o
    • Renderers: in packages/report, next to the entities exports. csv, markdown and json, plus html as a self-contained sortable, filterable table, the way renderEntityMapHtml is self-contained.

    • Flags column: read verdicts, never re-implement thresholds, so the table and the issue list agree:

      Flag Rule
      title too long core/meta-title
      description too long core/meta-description
      duplicate title content/duplicate-title (and core/title-unique)
      duplicate description content/duplicate-description
      missing h1 core/h1
      orphan links/orphan-pages (not integrity/orphan-page, which means something else)
      no schema empty schema_types
    • Completions: apps/cli/src/self/completion.ts (the commands list near line 51, plus bash, zsh and fish blocks like the entities one).

    • Docs:

      • new docs/cli/pages.mdx, added to docs.json next to cli/entities
      • mentions in docs/cli/index.mdx and docs/reports.mdx
      • the MCP tool in docs/developers/mcp.mdx and docs/cli/mcp.mdx
    • Skill: the squirrelscan agent skill needs a squirrel pages / list_pages section. File a private issue with the skills label.

    Suggested sub-issues

    1. Engine: buildPageMap(storage, crawlId) in audit-engine over the tables above, plus h1Text and headingCount in reportScalars. Unit tests on a synthetic-site crawl. Public, M.
    2. CLI squirrel pages: json, csv and markdown, all filters, the flags column, completions and docs/cli/pages.mdx. Public, M.
    3. -f html: a sortable, filterable single-file table in packages/report. Public, S.
    4. --diff <audit>: added, removed and changed rows, refusing retired crawls. Public, S.
    5. Report contract: the pageMap section, PageMapSchema and publish limits in core-contracts, emitted on publish by the CLI and the cloud worker-agent. Public, then private. M. It spans both repos, so it goes on the hold list.
    6. Hosted list_pages: the MCP tool, a REST route, the MCP server instructions in apps/api/src/mcp/server.ts, and publish-side validate and store. Private, M.
    7. Skill update: skills repo, XS.

    Order: 1, then 2 to 4 in parallel; 5, then 6; 7 last.

    Tests

    • Engine: a synthetic-site crawl (as the goldens build one) asserting one row per crawled page, link in and out counts against link_appearances, and @ids against entity_occurrences.
    • CLI: apps/cli/tests/entities/ is the template for a pages folder. Each filter alone and combined, each format, and --diff across two stored crawls.
    • API: schema clean and strip, pagination, an owner-scoped read and a truncated map.
    • No golden or rule-count impact: no rule changes. Adding scalars to reportScalars must not change any rule input; the rule cache replays page_features, so check rule-cache-replay-golden.test.ts.

    Open questions for the maintainer

    1. Smart re-audits: the newest crawl's page set includes pages replayed from the rule cache. Show them all (recommended), and add a column for "replayed"?
    2. Hosted row cap: a fixed row cap (for example 1,000) with truncated: true, or tied to the plan's page ceiling?
    3. Failed pages: include pages that failed to fetch (status 0 or 5xx) as rows? I recommend yes, with their status.
    4. --orphan: no internal inbound link from a crawled page (what links/orphan-pages reports), or also pages found only in the sitemap?
    5. REST: alongside the MCP tool (GET /v1/reports/:id/pages), or MCP only at first?

    Recommended session

    • Opus, medium effort, for sub-issues 1 and 5 (the contract and the publish budget).
    • Sonnet, medium effort, for 2, 3, 4 and 6.

    Size L confirmed. As one PR it would be XL across three repos, so split it.

  3. deniskern commented on Oct 18, 2026

    @deniskern

    A use case that builds on this: an internal link map. Besides the per-page in/out counts, we need the edge list itself, which the crawl already stores in link_appearances (page_url, href, anchor_text, position, is_nofollow).

    Proposal, as part of this export or as squirrel links:

    • One row per internal link: source URL, target URL, anchor text, position (content / nav / footer / sidebar / unknown), nofollow.
    • Per page in the page map: inbound links split into contextual (content) and template (nav/footer) links, plus crawl depth. A page linked only from the footer looks well linked in a total count, but it is not.
    • Optionally an internal PageRank per page, with nofollow edges excluded.
    • --format json|csv|graphml|dot, as squirrel entities already supports, and --page <url> for one page's inbound and outbound links. On MCP: list_links with limit/offset.

    Why: we currently read project.db directly to find pages that get demand in Search Console but few contextual links, and to check whether anchors for a keyword point at the intended page. That depends on an internal schema, so a supported export would let us drop it.

    Tested against v0.0.117.

  4. added theissue type on Oct 28, 2026
  5. 11 remaining items

  6. nc9 commented on Oct 31, 2026

    @nc9
    ContributorAuthor

    Verified against main after v0.0.149 (squirrel pages landed). Met and ticked: the table columns, the json, csv, markdown and html formats, the combinable filters, the rule-derived flags and --diff between two audits (criteria 1 to 5). Not ticked: the hosted listing (not in this repo), the credits note (the local command makes no fetch and costs nothing), and the last criterion, whose completions and docs are done but whose agent-skill update is a process item. Leaving this open for the hosted part and the skill.

    nik

  7. nc9 commented on Nov 12, 2026

    @nc9
    ContributorAuthor

    Not closed after v0.0.179 (https://github.com/squirrelscan/squirrelscan/releases/tag/v0.0.179). The local squirrel pages command and MCP list_pages shipped. Still open: the hosted MCP/API list_pages (private repo) and the agent-skill check or issue. The change that shipped is 01373a7.

    nik

  8. nc9 commented on Nov 13, 2026

    @nc9
    ContributorAuthor

    Closing as shipped for this repo. Verified against the tags in this step:

    • squirrel pages (table, json/csv/markdown/html, filters, rule-derived flags, --diff): 5e87c93, e5d0388, fd1e3e0. Each is an ancestor of v0.0.179, first shipped in v0.0.149.
    • MCP list_pages on the local server (squirrel mcp): 01373a7, an ancestor of v0.0.179, first shipped in it.

    Release: https://github.com/squirrelscan/squirrelscan/releases/tag/v0.0.179

    The hosted MCP/API list_pages needs the report contract and the private API, so it is tracked in the private repo (squirrelscan/repo#4172). The agent-skill check is stated there too.

    nik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    clienhancementsize: L

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions