Repository navigation
feat(rules): internal link checks at every level, external links opt-in at quick, with limits and switches (repo#2729) - #721
Conversation
|
Review of PR 721. I read the diff and the main engine paths (probe selection, external-link cap, CLI flags). I did not run the tests.
No (critical) or (high) issues found. |
|
Triage of the review above. Fixes are in eedaddf.
|
…in at quick, with limits and switches #2729 Internal link targets the crawl did not fetch get a status-only request (HEAD, then GET) at every level: up to 200 per audit, most-linked first, inside the crawl scope and robots.txt, never an action link, free. External link checks stay as they were (surface and full on, quick and the old cloud depths off) behind one constant, EXTERNAL_LINKS_DEFAULT_ON, so turning them on everywhere later is one line. --external-links checks them at any level for one run; --no-external-links and --no-internal-links skip them. An audit checks at most max(page budget, 200) distinct external links, most-linked first, and reports the rest as Not checked (external-links-over-cap). New settings: [external_links] max_links and [internal_links] enabled / max_targets. The local MCP audit_website takes externalLinks and internalLinks. Signed-off-by: Nik Cubrilovic <[email protected]>
…xternalLinks in MCP; docs and tests #2729 Signed-off-by: Nik Cubrilovic <[email protected]>
eedaddf to
a3a63af
Compare
|
Reviewed the diff for the CLI flags, config schema, engine probe, external cap, audit-levels constant and report copy. I did not run the tests, and I could not read the private pairing PR. Findings
Test coverage. Coverage is good: the rules, the e2e on both engines, the CLI parser wiring and the MCP refusals are all tested. The gaps are the redirect case and the uncapped CLI path above. Security. The probe stays on the audited host and respects robots.txt and scope. The redirect and action-link points above are the open items. |
… and token filter, HEAD only, no credentials, every redirect hop rechecked #2729 Signed-off-by: Nik Cubrilovic <[email protected]>
|
Here is my triage of the claude-review findings on a3a63af. The fixes are in the new head, which also carries a security pass on the internal link probe.
|
|
Reviewed the diff, with most of my time on
Test coverage is strong: the fixture checks that nothing is requested for the action URLs, the unit tables cover bypasses and false positives, and there are CLI wiring tests. One gap is a test for an action-text link without nofollow, as in the first finding. |
…state the probe's limits in the docs #2729 Signed-off-by: Nik Cubrilovic <[email protected]>
|
Triage of the claude-review on 1f6f19a. Fixes are in 3585782.
|
|
Review of the internal link probe (repo#2729). I read the diff and the probe in full and did not run the tests or check CI. The probe is built defensively and I found nothing that should block the merge. It sends HEAD only, falls back to GET on 405/501, sends no credentials, follows redirects by hand with the same checks on every hop, and has a HEAD-reliability control. There is also a lot of test coverage for it.
|
…link check sends HEAD and how to turn it off #2729 Signed-off-by: Nik Cubrilovic <[email protected]>
|
Triage of the claude-review on 3585782 (no blockers). Fixes are in the new head.
|
|
Review of PR 721. I read the PR description and The probe is built carefully. There are no credentials, HEAD only (with a ranged GET after 405/501), manual redirects with every hop re-checked, and a deliberately conservative action filter. I found nothing that should block the merge.
|
|
Triage of the claude-review on a75341f. It found nothing blocking, and I am leaving its low findings and nits as they are rather than push again:
|
Brings in the internal link checks (#721) and release 0.0.111. The one conflict is in packages/audit-engine/src/adapter.ts: the third-party asset checks (#703) and the link-target probe both join the same asset Effect.all, and both fallbacks keep their fields. The fixture test's storage stub gains getRobotsTxt, which the merged asset phase calls. Signed-off-by: Claude <[email protected]> Co-Authored-By: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_01EAUNUbvoEuJsAyiazrJXLH
Refs squirrelscan/repo#2729, phase 2, amended to Nik's decision:
This pairs with a private PR (cloud run-time default, nullable opt-out storage, estimates, MCP and pricing copy) and a gitlink bump.
Change
Internal link checks run at every level (#2729 item 3).
HEAD. Up to 200 per audit, most-linked first, free.respect_robotsis on, and use the crawl's user agent and per-host concurrency.The probe never changes state (
packages/audit-engine/src/link-target-probe.ts; a security review flagged the first version). It is safe by construction:UserLogout.aspx)./logout;jsessionid=…,?route=account/logout,?task=user.logout,/users/sign_out,/add-to-cart/7,/confirm/abc123and?action=deleteItemare skipped, while/where-to-buyand/blog/how-to-verify-your-domainare checked._wpnonce, csrf, sig, code, key, state…--no-internal-links/[internal_links] enabled = falsefor sites with state-changing GET routes.docs/configuration/external-links.mdx, and linked from the links index and the broken-links page.How results feed
links/broken-links.meta.probed: true.refused-linksinfo check.[internal_links] enabledandmax_targets, plus--no-internal-links.--offlinekeeps the probe, because it only requests the audited site.External link defaults are unchanged, behind
EXTERNAL_LINKS_DEFAULT_ON = false(core-contractsaudit-levels.ts).--external-linkschecks external links at any level for one run.[external_links] enabled = false.--offlineor--no-external-links.--external-links=falseand--external-links falseare off switches.--no-external-linksstays.External link limit: the page budget or 200, whichever is more (
externalLinkCheckCap).priorityHrefs), then the most-linked, ties broken by URL.external-links-over-cap, rendered as Not checked.[external_links] max_linksoverrides the limit.Local MCP.
audit_websitetakesexternalLinksandinternalLinks.offline: truewithexternalLinks: trueis refused, the same as on the CLI.Report. The external-off reason is unchanged. Its hint now says how to opt in: "in the CLI pass --external-links, or run a Surface or Full audit, without --offline; in the cloud they are a website setting." Each skip reason has its own hint, and the over-cap line shows in every format.
Docs.
--external-linksand the MCP switches.Removed from the earlier version of this PR:
Evidence (fixture on
127.0.0.1.nip.io, CLI from source, signed out)--level quick(default)/missing-page (404),probed: trueexternal-links-not-checked, opt-in hint)--level quick --external-linkshttps://squirrelscan.com/zz-broken-link-probe-404 (404)--level quick --no-internal-links--offline --external-linksThe banner reads
quick · max 25 pagesby default andcustom (quick + external_links on) · max 25 pageswith the flag.Tests
Probe safety, real crawler fixture.
/logout,/unsubscribe?token=…,/cart/add?id=1,/confirm/abc123def456, a nofollow "Delete account", a_wpnoncelink, and a link that 302s to/logout./missing-page.Probe safety, unit tests.
bytes=0-0.credentials: "omit", manual redirects.core-contracts: the constant is pinned (false), Quick and the legacy depths read it, Surface and Full are on, and the Quick summary copy is checked.
CLI wiring (citty's real parser):
--external-linksbeats the config.=falseand space forms are off switches.--no-*at surface.CLI options:
internalLinksEnabled: falsegivesinternal_links.enabled = false, and--offlinekeeps the probe.MCP:
levelRunOptionslink switches beat the level and the config.audit_websiterefuses offline together with externalLinks.Report: the opt-in hint line in every format, and the over-cap hint line.
Rules (18 tests) and the engine e2e on both engines: the probe finds the 404, crawl-scope exclusion, the over-cap limit and priority, and both checks off.
Each touched test file was run 3 times by explicit path, all green. Typecheck is clean across core-contracts, report, rules, audit-engine and cli. CLI
format:checkandlintare clean,tangly check --strictpasses, anddetect-secrets-hookover all tracked files is clean.Codex is out of credits until Oct 18, so an Opus reviewer subagent reviewed this. Its P1 (
--external-links=falseturned checks on) and P2s are fixed in the second commit. It then reviewed the probe's safety work over two rounds. Its first round found filter bypasses (matrix params,?route=account/logout,sign_out, run-together verbs, path tokens) and false positives. Both are fixed in the third commit, and the second round confirmed it. Three claude-review rounds followed; their non-blocking findings are fixed or triaged in PR comments.The reviewer's note that
hasNegatedFlagignores--no-x=valueis older than this PR and shared with--no-publish, so it is not changed here. Its other note, that a signed-in CLI's WAF-escalated external link render is billed while the docs call the CLI's checks free, is also older than this PR and is filed as squirrelscan/repo#2757. The external link checker has no action or token filter for third-party links. That is also older than this PR, but--external-linksnow reaches it at Quick, so it is filed as squirrelscan/repo#2759.Skill
The squirrelscan skill needs a change, tracked in squirrelscan/repo#2737. It should cover:
--external-links,--no-external-linksand--no-internal-links;[internal_links]andmax_links;