Repository navigation
fix(crawler): one transition table for crawl and frontier status, checked in the write - #1671
Merged
Merged
Conversation
3 tasks
Contributor
Author
|
Note from the private #3874 review (cloud crawl end): the private cloud runtime writes nik |
nc9
force-pushed
the
fix/frontier-guards-1659
branch
from
November 10, 2026 09:24
e9e876a to
f27bae3
Compare
nc9
marked this pull request as ready for review
November 10, 2026 09:24
…cked in the write #1659 Signed-off-by: Nik Cubrilovic <[email protected]>
Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
force-pushed
the
fix/frontier-guards-1659
branch
from
November 10, 2026 10:12
f27bae3 to
96f57a1
Compare
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 #1659
What
crawls.statusandfrontier.statuswere last-writer-wins.stop()could writepausedover a crawl that had alreadycompleted, and a late worker could rewrite a frontier URL that was already finished or that--resumehad re-queued.Both now have a transition table in one place, next to the types in core-contracts (
CRAWL_STATUS_TRANSITIONS,FRONTIER_STATUS_TRANSITIONS,canTransitionCrawl,canTransitionFrontier, documented there and indocs/configuration/storage.mdxunder "Crawl status").SQLiteStorage.updateCrawlandupdateFrontierStatuscheck the table in the same statement as the write: the allowed-from list is a bound parameter, so the statement text (and the prepared-statement cache the code already worries about) is unchanged. A write the table refuses changes nothing, the other columns it carried included; it never throws and never aborts the crawl.onIgnoredTransitionon the storage reports each refusal (the crawler package has no logger, so this is the debug hook and the test seam).Crawl edges:
runningfrom anywhere;pausedfromrunning;completedandstoppedfromrunningorpaused;crawledfrom those pluscompleted/stopped;analyzedfrom those pluscrawled;failedfromrunningorpaused. Frontier:fetchingfrompending;done,failed,skippedonly fromfetching;pendingfromfetching(resetStaleFetching).Acceptance criteria
stop()after a terminal status leaves it unchanged: a real crawler test (crawl tocompleted, thenstop(), stillcompleted), plus the storage edges.fetching, andresetStaleFetchingstill re-queues onlyfetchingentries.Characterization first
packages/crawler/tests/status-transitions-1659.test.tswas written and run against the unguarded storage before the guard: its 20 legal-edge tests (every edge the crawler and the CLI use: resume, backstop cut, re-crawl, re-analysis, the frontier pop and finish,resetStaleFetching) were green and its 16 illegal-edge tests red. After the guard all 38 pass.packages/core-contracts/tests/status-transitions-1659.test.tsis the full table, edge by edge (49 crawl pairs, 25 frontier pairs).Also run, by explicit path, unchanged: full-crawl-harness, crawler-stop-hard-cap, abandoned-crawls, retire-crawls, hot-statements-cached, crawl-lease, crawl-liveness, frontier-exists-cached, unstored-frontier-1396, page-map-701, the CLI stop-interrupted-crawl, retention, streaming-frontier and crawl-loop-concurrency tests, two audit-engine goldens, and the audit-stdout and include-pages e2e.
tsgoinpackages/crawlerandpackages/core-contracts, root lint,make validate.Notes
JSON_REPORT_SCHEMA_VERSIONis untouched.crawler.tsstart, resume, restart,stop(), completion; the CLI'scrawledandanalyzed; the synthetic-site writer) uses an allowed edge.status,report_statusand the lease into one derived phase.