Repository navigation
feat(crawl): return each page as Markdown, and choose how a crawl finds URLs - #44
Open
zenrows-dev-pool[bot] wants to merge 6 commits into
Open
zenrows-dev-pool[bot] wants to merge 6 commits into
zenrows-dev-pool[bot] wants to merge 6 commits into
Conversation
`crawl create --output-format markdown` stores each kept URL's page converted to Markdown, read back with `crawl content` and `crawl download` as `--output-format html` already was. A value that is neither is still refused locally, before any network call. A crawl also reports `discovery`, the strategies it found URLs with, so `crawl get --json` carries it instead of dropping it.
The lock names the API description this surface was synced to, by its blob id, so a later drift check compares against it instead of reporting the surface as never synced. Two operations in that description are not served to callers and no surface exposes them; the lock lists them as pending, so a change to either does not read as drift here.
`crawl create --discovery links` asks for the strategy a crawl finds URLs with on each page it walks: the links in each page's HTML, which is also what it runs with when the flag is left out. Any other value is refused locally, before any network call. The acceptance harness also passes the run's base URL to the CLI. The CLI reads its own variable, which the harness never set, so a run against another base URL still sent its calls to production.
StefanoGuerrini
marked this pull request as ready for review
October 15, 2026 14:59
StefanoGuerrini
self-requested a review
October 15, 2026 14:59
crawl results said partial false on any ended crawl. After a stop, the API keeps next_cursor set while pages still in flight can add URLs, so the list was not complete yet. partial now follows next_cursor, and a partial read carries a note to read the results again later.
The values that the json output and pagination discovery use stay off for every user. The lock now records them as held, so the drift check reads their flag on each pass.
…arrive A stop reads stopped at once, but the API still reads the pages in flight for up to 10 minutes and builds the file from what it kept until then. download now asks the API, as results does, and says to download again later while it is not done.
This branch has not been deployed
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.
Summary
crawl createalso takes--discovery links, and refuses any other valuelocally.
crawl create --output-format markdownstores each kept page converted toMarkdown, read back with
crawl contentandcrawl downloadas--output-format htmlalready was. A crawl also reportsdiscovery, socrawl get --jsoncarries it instead of dropping it.What the task asked for
The command had drifted from the API it wraps. It refused every output format
but
html, and its result type dropped thediscoveryfield a crawl reports.How the check confirmed it
npm run typecheckandnpm testboth pass, 364 tests. This change adds twochecks to the Crawl acceptance suite. Check 22 covers a create with
--output-format markdown. Check 23 covers a value that is neither, which thecommand still refuses locally before any network call.
A running Crawl service took
output_format: "markdown"and came back withmarkdown.Encoded by: acceptance checks 22, 23 and 24, andtests/crawl-command.test.ts.The test that listed
--discoveryamong unknown flags now checks it sendslinksand refuses every other value before any network call.How to try it
Provenance
The command checks the format itself and names what it takes, which is how it
already handled
html. A reader of--helpsees the choice without a roundtrip to the API.
The lock records the API description this surface follows. It lists
GET /healthzandPOST /internal/v1/crawls/{crawl_id}/stopas pending. Bothare in the description and callers cannot reach either. Listing them keeps a
change to either from reading as drift here.
Review
One pass, by the author. Human must verify: nothing outstanding.
Deviations
None.
Record owed
None.