Skip to content

fix(connectors): harden website connector sitemap, robots and resume handling - #10556

Merged
waleedlatif1 merged 4 commits into
stagingfrom
fix/website-connector-hardening
Dec 1, 2026
Merged

waleedlatif1 merged 4 commits into
stagingfrom
fix/website-connector-hardening

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Sitemaps: a document is read only to the sitemaps.org limit of 50,000 entries, and entries are handled as the parser reads them, so parsing stops once the page cap is met. A gzipped sitemap full of tiny entries no longer builds a multi-million-entry array.
  • Resume: the listing cursor is now the last URL listed, not an offset. A listing rebuilt in a later run picks up after that URL, so resumed runs no longer set reconciliationSafe: false. Sites larger than one run's listing budget now get deletions again. Old numeric cursors sort before every URL, so they restart the listing, which is safe.
  • Unreadable sitemaps: a stale robots.txt sitemap, a 404 or invalid index child, or more than 20 sitemap documents no longer fail the sync. The bad or excess sitemap is skipped and the run is marked reconciliationUnsafe (or listingCapped for the cap). The sync fails only when no pages were found and a sitemap failed.
  • Redirects: page and sitemap fetches pass a standard redirect policy, so the crawler User-Agent, Accept, and the configured header survive the same-site hops the connector already allows (www/apex, HTTP to HTTPS). Keeping the header there is deliberate: the connector treats those hosts as one site, and a header-auth gateway needs it after the hop.
  • robots.txt (RFC 9309):
    • Any 4xx except 429 means no rules apply.
    • Redirects are followed to any host through the SSRF guard, and the configured header is stripped on cross-origin hops.
    • User-agent: SimBot/1.0 matches on the product token.
    • An oversized file is parsed up to 500 KiB instead of failing.
  • Pages: decoded in the charset from Content-Type or <meta charset>, falling back to the shared UTF-8/Windows-1252 decoder. X-Robots-Tag: noindex/none (unqualified or for SimBot) withdraws the page.
  • Validation has a 20s overall deadline.

Type of Change

  • Bug fix

Testing

  • connectors/website/website.integration.ts against real local HTTP servers through the SSRF-guarded fetch: 23 tests, with new cases for each fix.
  • Every new guard was reverted one at a time and its test went red: entry cap, early stop, keyset cursor, skip-on-failure, child cap, redirect policy, robots 4xx, cross-host robots, product token, robots prefix, charset, X-Robots-Tag, validation deadline.
  • Website unit tests pass.
  • Biome is clean.
  • Narrow native tsc over connectors/website is clean.
  • Ran check:comment-hygiene, check:utils, check:explicit-any, check:organization-egress, check:test-patterns.
  • Full type-check and audits are left to CI.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…handling

- cap sitemap entries per document and stop parsing once the page cap is met
- resume listings from the last URL listed so reconciliation survives resumed runs
- skip unreadable or excess sitemaps and mark the listing unsafe instead of failing
- keep crawler headers and the configured header across same-site redirects
- follow RFC 9309 for robots.txt: 4xx allows, cross-host redirects, product token, 500 KiB prefix
- decode pages in their declared charset and honor X-Robots-Tag
- give validation an overall deadline
@vercel

vercel Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Dec 1, 2026 8:39am UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 6 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/connectors/website/page.ts Resolved
Comment thread apps/sim/connectors/website/page.ts Resolved
@greptile-apps

greptile-apps Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; no new actionable issues were found.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issues were found.

Summary

Hardens website discovery, resume cursors, robots rules, and page decoding.

  • Website listings stop at clear limits and resume after the last URL.
  • Website requests follow robots rules and keep the right headers on redirects.
  • Website pages use their declared text encoding and indexing rules.

Reviews (4) · Last reviewed commit: "fix(connectors): website robots.txt keep..." · Reviewed by Greptile

Comment thread apps/sim/connectors/website/website.ts Resolved
Comment thread apps/sim/connectors/website/site.ts Resolved
Comment thread apps/sim/connectors/website/page.ts Resolved
Comment thread apps/sim/connectors/website/page.ts Resolved
… helpers

- a byte order mark decides a page's encoding; meta-declared UTF-16 reads as UTF-8; commented meta tags are ignored
- repeated X-Robots-Tag headers never carry another crawler's scope over an unqualified noindex
- an oversized robots.txt is cut at its last CR or LF
- listing hold and keyset paging are crawler-agnostic helpers
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 7 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/connectors/website/page.ts Resolved
Comment thread apps/sim/connectors/website/site.ts Resolved
Comment thread apps/sim/connectors/website/page.ts Resolved
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 7 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/connectors/website/site.ts Resolved
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 7 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 7605304 into staging Dec 1, 2026
84 checks passed

This branch was previously deployed

1 inactive deployment
Preview — f0171f15 Deployed Dec 1, 2026 by vercel[bot]
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.

1 participant