Repository navigation
perf(audit-engine): stop sending dead-links chunks once one comes back unanswered #753 - #755
Merged
Merged
Conversation
4 tasks
nc9
marked this pull request as ready for review
October 14, 2026 10:12
|
Reviewed the diff. No blocking issues.
|
4 tasks done
…k unanswered #753 A chunk the bulk checker answers with none of its urls now ends the bulk pass, like a throw: the remaining urls go to the local per-link checker straight away instead of each later chunk costing the service's full wait. A chunk that answers at least one url keeps the pass going. Tests pin the local fallback for urls the service leaves out (stored with their local status, a 404 reported as dead by links/dead-links), the stop after an unanswered chunk, and that partial answers do not stop the pass, through the engine and through the CLI's own dead-links checker. Removes the CLI adapter's unreferenced fork of checkExternalLinksOnStorage and runBulkChecker; the live path has been the engine's since #252. Signed-off-by: Nik Cubrilovic <[email protected]>
…he chunk inside the try #753 Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
force-pushed
the
fix/dead-links-stop-on-unanswered-753
branch
from
October 14, 2026 11:05
cc4689a to
df8e56e
Compare
|
Review of #755. I read the diff and grepped for leftover references. I did not run the tests, and CI was still pending when I looked. The change is small and does what it says.
No correctness, security or performance problems found. Looks good to merge once CI is green. |
This was referenced Oct 14, 2026
Closed
nc9
added a commit
that referenced
this pull request
Oct 15, 2026
…ers #764 A rate-limited bulk answer (rateLimited 503, 429, 430) or one the service could not verify (wafBlocked, null status) is never written to the local link cache, and the next run asks the service again. Fixed in the engine by #755 and #800; this pins it through the real SQLite cache. Signed-off-by: Nik Cubrilovic <[email protected]>
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.
Closes #753.
What changed
A signed-in
squirrel auditsends its external links to the cloud dead-links service 200 at a time, and checks locally any link the service leaves out of a reply. Since squirrelscan/repo#2799 the service waits up to a minute for links it has not seen and gives up after 20 seconds without a new answer, so a busy service could answer every batch with nothing, one wait per batch, before the local checks started.runBulkChecker(packages/audit-engine/src/external-checker.ts) now ends the bulk pass when a chunk comes back answering none of the urls it asked about, the same way it already did on a throw. The remaining urls go to the local per-link checker straight away. A chunk that answers at least one of its urls keeps the pass going, so partial answers behave as before.runBulkCheckerinapps/cli/src/audit/adapter.ts, but that copy, and thecheckExternalLinksOnStoragearound it, has been unreferenced since the CLI moved its post-crawl phases onto the engine's streaming pipeline (perf(cli): run the audit's post-crawl phases on the streaming pipeline #252). The live loop is the engine's. This PR fixes the engine's and deletes the adapter's unreferenced copy (and the imports only it used), keeping theExternalBulkCheckertype thatcloud.tsimports. The CLI's other fork,apps/cli/src/crawler/external-checker.ts, is also unreferenced insrc(only itsExternalCheckResulttype is used) but two tests still exercise it; that is CLI: delete the unreferenced external link checker and sitemap parser copies, and point their tests at the shared packages #756.SQUIRREL_LINK_CHECK_SERVICE_URL, unset in production) can answer a chunk with nothing when its shared deadline is spent, when the service returns no ticket, or when the first poll fails before any verdict arrived. With this PR each of those now sends the remaining chunks to the local checker too, where before only a throw did. Its comments that say only a throw ends the pass need a follow-up in the private repo: squirrelscan/repo#2820.try, so a checker that resolves to something other than a map still ends the pass instead of failing the phase.Acceptance criteria
checkExternalLinkstest in the engine; through the CLI's own checker, the stored link rows carry the local 200 and 404.)links/dead-linksChecked 2 external link(s); 1 dead, andlinks/broken-external-linkslists the 404.Verification
bun test tests/bulk-checker-unanswered-753.test.tsinpackages/audit-engine: 9 pass (also after the never-throws fix). Against main'srunBulkChecker4 of them fail (the stop cases), the rest pin today's fallback.bun test tests/audit/dead-links-unanswered-753.test.ts tests/audit/cloud-spend.test.tsinapps/cli: 10 pass.link-checks-not-run-e2e,external-link-cap-2729(engine),quick-skips-cloud,undecoded-fetches(CLI): pass.tsgo --noEmitinpackages/audit-engineandapps/cli: clean.apps/cliformat:checkandlint: clean.docs/:tangly check --strictpasses.docs/rules/links/dead-links.mdxsays squirrel stops asking after a batch with no answers.Agent skill
No change needed: the skill does not describe how the CLI batches dead-link checks.