Repository navigation
v1.4.0
Added
-
Bounded LLM extraction concurrency (
aifeature).LlmExtractornow builds a
liter_llm::ManagedClientinstead of a bareDefaultClient, with liter-llm 1.18.0's queueing
InFlightLimitLayerwired in. The newLlmExtractorConfig::max_in_flightcaps simultaneously
outstanding provider requests globally for the extractor's client rather than per call site, so
a wide crawl fan-out cannot burst past a provider's per-key concurrency allowance. The bound is a
dedicatedInFlightBoundenum --Limited(NonZeroUsize)orUnlimited-- rather than an
Option<usize>, so neither unsafe state is reachable by accident: the default is
Limited(8), lifting the bound requires namingInFlightBound::Unlimitedat the call site, and
a zero bound (which admits no request at all and would deadlock every extraction) is a compile
error rather than a runtimeCrawlError::InvalidConfig.LlmExtractorConfigimplements
Default, so..Default::default()picks up the bounded default instead of silently disabling
the limiter.InFlightBoundis exported from the crate root.
LlmExtractorConfig::response_cacheoptionally puts liter-llm's in-memory response cache in
front of the provider; cache hits are served without consuming an in-flight permit, so repeat
pages still answer immediately while the bound is saturated.LlmExtractor::newkeeps its
existing signature and picks up the default bound. Enablingainow also enables
liter-llm/tower, which suppliesManagedClientand the limiter. -
LlmExtractoris now public API (aifeature).crawlberg::{LlmExtractor, LlmExtractorConfig, LlmResponseCacheConfig}are exported from the crate root. The extractor had
been declared as a privatemod llm_extractor;inside apub(crate)module with no re-export
and a file-level#![allow(dead_code)], so it and itsContentFilterimplementation were
unreachable from outside the crate -- including the in-flight bound above. Theallow(dead_code)
is removed; the type is reachable and used. Like the otherdefaultsimplementations it is a
Rust-level export only and is not part of the generated language bindings.
Fixed
-
The published Rust documentation snippets did not compile. 220 of the 264 generated Rust
snippets read aresultbinding their own call site had discarded into_, so every one of
them failed to compile witherror[E0425]: cannot find value result. Regenerating against
alef 0.67.5 emitslet result = scrape(&engine, &url).await.expect("call failed")and takes
Rust snippet failures from 220 to 9; the remaining 9 are stream fixtures that miss a
tokio_streamimport.
The same regeneration fixes the assertion-rendering defect in the Dart and C# snippets (dart
22 -> 12 failures, csharp 11 -> 9). The broken output had persisted across alef upgrades
because alef's generation cache is not keyed on the alef version, soalef generatereplayed
stale bytes andalef verifyreported them as fresh. -
The Java binding no longer flattens a native error into a generic
CrawlbergRsException.
All eight synchronous FFI entry points in
packages/java/src/main/java/io/xberg/crawlberg/CrawlbergRs.javacaughtThrowableand rethrew
it asnew CrawlbergRsException("FFI call failed", e).checkLastError()reports the real
Rust-side failure by throwingConversionErrorException,CoreErrorException,PanicException
orCrawlbergRsException— all of which areCrawlbergRsExceptionsubtypes, so every one was
caught by that generic handler one frame later and re-wrapped. Callers saw"FFI call failed"
with the real message demoted to a cause, andcatch (PanicException e)could never match
because the concrete type had been erased. The regenerated code rethrows a
CrawlbergRsExceptionunchanged and wraps only genuinely unexpected throwables. The six
*Asyncwrappers are unaffected: they wrap inCompletionException, which is the documented
CompletableFuturecontract and already preserves the cause. -
A skipped
publish-cratesno longer reads as a passing gate, and a release that published
nothing can no longer report success. Six places in.github/workflows/publish.yamlgated
downstream build, publish and release-promotion jobs on
needs.publish-crates.result != 'failure'. That expression is TRUE when the dependency was
skipped, andpublish-cratesskips for two opposite reasons: the version is already on
crates.io (a re-run or a resumed release, where downstream must proceed) or an upstream gate
such as version validation or crate packaging failed (where downstream must not).result
alone cannot separate them, so every one of those conditions was gating on nothing --
tree-sitter-language-pack v1.15.5 promoted a GitHub release toLatestwith 40+ failed jobs and
every registry publish skipped, and still reported success.A new always-running
crates-gatejob resolves the ambiguity once, into an explicit
outcome(published/already-present/not-required/dry-run/blocked) and an
okflag that every consumer now tests instead ofresult. Because the job always runs, its
outputs always exist; because it never fails, depending on it cannot skip a consumer. The
legitimate already-published path stays exactly as permissive as before, and only the
gate-failed path is newly blocked.Nothing in the workflow failed a run whose publish jobs were skipped:
release-finalizeand
announce-discordgate on!contains(needs.*.result, 'failure'), which is blind toskipped,
so a release that reached zero registries would still be flipped out of draft and announced. Both
now also require the crates gate, and a newrelease-reportjob verifies every enabled publish
target individually, treatingskippedas a failure unless the target is not enabled for this
release or its registry probe already found this exact version published. -
The Ruby gem published on a failed build and bypassed version validation.
publish-rubygems
acceptedneeds.ruby-gem.result == 'failure'and carried!cancelled(), so a release in which
the gem build failed still ran the publish step against whatever artifacts happened to exist.
Only thelinuxmatrix leg keeps the source gem -- the other three legs delete it -- and that
source gem is the only artifact crawlberg has ever shipped: all 23 versions on RubyGems are
platformruby, with no per-platform gem in the registry's history. So the acceptedfailure
never preserved a partial-platform publish; it only allowed a release with no source gem at all.
The disjunction was not a deliberate choice either -- it entered in a bulk regeneration commit,
replacing an explicit== 'success'. The job now requiresruby-gemto succeed. Separately, it
was reached withoutvalidate-versionsinneeds:at all. The other publish jobs that omit it
still inherit the gate, either through aneedschain carrying no skip override (publish-pypi,
publish-packagist) or through an explicit success check on a job that does carry it
(publish-hex,publish-homebrew-bottles); the!cancelled()here removed both routes, so the
version gate could not block a Ruby publish.validate-versionsis now a dependency and its
success is required. Dropping!cancelled()also restores the default dependency skip, so a
failedcheck-rubygemsno longer lets the publish proceed on an unanswered
already-published check. The gate now matchespublish-node,publish-maven, and
publish-nugetexactly. -
Entity-escaped sitemap URLs were truncated to the text after the last entity. quick-xml
reports an entity reference as its ownEvent::GeneralRefand splits the element's character
data around it, so<loc>https://example.com/s1.xml?a=1&b=2</loc>arrived as three events.
The sitemap parsers assigned each text event to the current field instead of accumulating, so
every piece but the last was discarded and that<loc>parsed tob=2. Because&must be
entity-escaped in XML, every sitemap URL carrying more than one query parameter was silently
corrupted -- a truncated string still looks like a successful parse -- so the wrong URLs were
enqueued and the real ones were never crawled. Bothparse_sitemap_xmlandparse_sitemap_index
now buffer character data across events and commit it on the closing tag, and they resolve the
reference events themselves, so the escaped character survives rather than vanishing from the
middle of the value. This covers every text-bearing field --loc,lastmod,changefreq,
priority, and the sitemap-indexloc-- and applies to numeric character references
(&,&) as well as the named XML entities. The defect predates the quick-xml 0.42
upgrade; a probe built against 0.41 truncates identically. -
The docs advertised musl artifacts that are not published. The README claimed precompiled
binaries "across every binding" and linked a platform matrix that did not exist, and
RELEASE.mddescribed the two Node musl packages as an OIDC misconfiguration with a
trusted-publisher fix. Neither held up against the registries:@xberg-io/crawlberg-linux-x64-musl
and@xberg-io/crawlberg-linux-arm64-muslare name-reservation placeholders at0.0.1and have
never carried a release, PyPI has nomusllinuxwheels, and the Go and PHP release assets are
glibc-only. The cause is not credentials — thenode-bindingsmatrix inpublish.yamlhas no
musl target, so no artifact is built, and the publish step skips platform directories with no
binary rather than failing. Installation now carries a per-ecosystem musl support matrix stating
which bindings work on Alpine (CLI, Docker, Rust, Ruby, Java, C#, Elixir) and which do not (Node,
Python, Go, PHP), why the omission is deliberate, and the Alpine workarounds. It also records the
two silent failure modes:npm installon Alpine exits 0 while installing no native binary,
because npm skips the unresolvable optional dependency, andpipfalls back to an sdist build.
RELEASE.mdnow documents the decision instead of a fix that would publish nothing, and the two
placeholder package READMEs say they are unpublished rather than describing a binary that does
not exist. -
The coding-agent plugin version gate never ran on the commits that cause drift.
plugin/sat at 1.3.1 while core shipped 1.3.2 and 1.3.3, so every runtime bundle —
OpenCode, Hermes, Claude Code, Cursor, Codex, Gemini, Kimi, Factory — declared a version
two releases stale. The checker for this already existed
(scripts/sync_plugin_version.py --check, run byCI Plugin), butci-plugin.yaml's
paths:filter did not listCargo.toml. A release commit bumpsCargo.tomland nothing
underplugin/, so the workflow was never triggered and the gate reported nothing rather
than failing —CI Pluginlast ran on the 1.3.1 release.Cargo.tomland
.task/tools/version-sync.ymlare now in the filter, so any core bump re-runs the gate.
sync_plugin_version.pyalso grew--expect <version>, which asserts that core and the
plugin both equal the version being released;publish.yaml'svalidate-versionsjob runs
it against the tag, so a drifted plugin now fails the release instead of publishing a bundle
that lags the version it claims to be. The 13 stale version declarations are re-synced to
1.3.3. -
Two e2e assertions were tautologies rather than URL leaks, and tested nothing.
links_protocol_relativeexists to prove that<a href="//cdn.example.com/resource">inherits
the page's scheme, but asserted only that some link URL contains//— true of every absolute
URL, and satisfied by the fixture's one ordinaryhttps://example.com/normallink without the
protocol-relative pair being resolved at all. It now asserts both resolved forms,
http://cdn.example.com/resourceandhttp://images.example.com/photo.jpg, which a passthrough
of the raw href cannot produce.strategy_best_first_seedasserted thatpages[0].urlcontains
/— true of every URL, including the/page1and/page2results the fixture exists to rule
out. Its seed is the mock origin root and carries no path, so it now assertsnot_contains
/page, which fails if any non-seed page is crawled first. Both were confirmed to fail under
mutation before being accepted. -
The URL being scraped decided its own network error classification.
network_error_kind
keyword-scanned a string built fromreqwest::Error'sDisplay, which embeds the request URL,
so every keyword the scan looks for —dns,ssl,tls,certificate,handshake,resolve,
lookup,timeout,proxy,connect— could be supplied by the path or hostname being fetched
rather than by the failure. Measured against a refused TCP connection:/blog/dns-explained
reporteddns:,/blog/ssl-explainedand/blog/certificate-pinningreportedssl:, and
/blog/timeout-tuningreportedtimeout:— all four wereconnection refused (os error 61).
The scan now runs overchain_without_request_url, which3afbde890had applied only inside the
data-loss predicate. The one classification this changes in the fixture suite is
error_invalid_proxy: it was tagged[network:proxy]purely because its path spells "proxy",
while its actual chain istcp connect error ... connection refused, and it is now tagged
[network:connection]. TheCrawlErrorvariant isConnectioneither way —NetworkErrorKind::Proxy
has always mapped toconnection_with_source— so the fixture'sconnectionassertion is
unchanged and still correct.A refused proxy CONNECT names no proxy anywhere in its chain, so
[network:proxy]was in practice
reachable only through the request URL. The unit test that accepted either tag is replaced by one
that pins[network:connection], alongside a table-driven test that walks every scanned keyword. -
Two more e2e assertions matched a substring of their own request URL. Same defect class as
error_unsupported_scheme: every classified network error embeds the URL, and the URL embeds the
fixture id, so an assertion whose expected substring also occurs in the id passes on the address
rather than the behaviour.error_data_loss_truncatedasserteddata_losswhile actually
returningconnection: [network:connection] ... /fixtures/error_data_loss_truncated— its mock
route declares acontent-lengthits body does not satisfy, which panics hyper 1.9.0 in the
generated mock server, and the test passed 5/5 anyway. It now assertsdata_loss:, a prefix no
URL path segment can carry.error_empty_batch_urlsassertedurls, which its own id supplies;
the fixture was long ago repurposed to a 404 case (mock_responsesis empty and the description
says so), so it now assertsnot_found, matching what it actually exercises.error_data_loss_truncatedis consequently red, and stays red: like its sibling
error_partial_responseit needs a mock server that can emit an unknown-length or truncated
body, and both alef-generated harnesses build every response as a known-lengthBody::from.
A red test that names a real gap is the correct state; loosening the assertion would only
restore the false pass. -
CrawlError::DataLosswas unreachable for the case it names, and network classification
keyed off the request URL.classify_reqwest_erroronly reached its data-loss branch under
NetworkErrorKind::Other, but hyper renders a truncated body'sIncompleteMessageas
"connection closed before message completed", sonetwork_error_kind's generic
contains("connection")arm claimed every truncated body first — a response cut short against
its declaredcontent-lengthcame back as a plain connection failure. Worse, the string those
heuristics scan is built fromreqwest::Error'sDisplay, which embeds the request URL, so a
path such as/blog/dns-explainedor/fixtures/error_data_loss_truncateddecided its own
classification. The data-loss predicate now runs forConnectionas well asOther, and it
matches against the chain with the request URL removed. Covered by
truncated_body_produces_data_loss_prefix(a raw socket that under-delivers its
content-length) anda_url_spelling_truncated_is_not_a_data_loss(a refused connection whose
path spells the keyword). -
The PHP e2e format hook pointed at a php-cs-fixer that no checkout has.
[crates.e2e.format].phpinvoked../../vendor/bin/php-cs-fixer, butvendor/is gitignored and
the repo-rootcomposer.jsonnever declaredfriendsofphp/php-cs-fixer— only the lock file did.
So no fresh checkout (every CI runner, and this one) could resolve the binary, and alef's format
hook silently no-ops on a missing command: regeneration rewrote all 31 generated PHP files with
alef's raw, over-indented template output and reported nothing. Declared
friendsofphp/php-cs-fixerinrequire-dev(pinning to the v3.95.1 the lock already carried, so
no dependency churn) and rewrote the hook tocomposer installfirst and invoke the tool through
composer exec, which resolves from the repo-root manifest regardless of cwd. The php e2e job
already installscomposer, so this now resolves in CI rather than only on a developer machine. -
Four SSRF/scheme fixtures asserted against the mock server address instead of the address under
test.validation_ssrf_loopback_denied,validation_ssrf_ipv4_mapped_ipv6_denied,
validation_ssrf_nat64_loopback_deniedanderror_unsupported_schemeeach declare aninput.url
that is the subject of the assertion, but every backend'smock_urlargument discarded it and
substituted the per-fixture mock server address. All three SSRF fixtures therefore exercised the
same trivial IPv4-loopback case, and the IPv4-mapped-IPv6 (::ffff:127.0.0.1) and NAT64
(64:ff9b::7f00:1) normalization paths incrates/crawlberg/src/net/ssrf.rshad no e2e coverage
in any of the 16 generated language suites. Setpreserve_input_urls: trueon those four fixtures
so the declared addresses reach the call verbatim. -
error_unsupported_schemeasserted on a substring of its own fixture id. With the mock server
URL substituted, the error text contained.../fixtures/error_unsupported_scheme, so
contains("unsupported")matched regardless of what actually failed. With the real
gopher://invalid.example.com/URL, crawlberg returns
ssrf_policy_violation: gopher://invalid.example.com/ - disallowed scheme: gopher, not an
Unsupportederror — the old assertion does not hold. Tightened the assertion to
disallowed scheme: gopher, which names the rejection the fixture exists to cover. -
cargo test -p crawlbergcould not compile.crates/crawlberg/tests/test_interact.rsmatched
onCrawlError::unsupported(message)— the macro-generated constructor function, not the enum
variant — which is E0164 (fncalls are not allowed in patterns). Sincebrowser-chromiumoxide
is off by default, the#[cfg(not(feature = ...))]test was always compiled and always failed the
build. Replaced with thematches!(..., Err(CrawlError::Unsupported { message, .. }) if ...)idiom
used elsewhere in the file. -
Redirect-cycle detection missed the first return to a bare-origin seed URL. In
follow_redirects(crates/crawlberg/src/engine/crawl_loop.rs), the cycle-detectionseenset
was seeded with the caller's raw URL string, while every subsequent hop key came from
resolve_redirect's WHATWG-serializedUrl::joinoutput. A chain seeded at a bare origin (e.g.
http://host:port, no trailing slash) that redirects back to/produced a hop key of
http://host:port/— never equal to the raw seed — so the cycle was missed on its first return
and only caught one hop later (redirect_count == 2instead of1). Added
canonical_redirect_key, used for the seed and for every hop'scontains/insertpair across
all three redirect mechanisms (3xxLocation,Refreshheader,<meta http-equiv="refresh">). -
Skipped
redirect_loopandredirect_max_exceededfor the wasm binding
(fixtures/redirect/redirect_loop.json,fixtures/redirect/redirect_max_exceeded.json): wasm's
fetchfollows redirects transparently with no manual hop tracking, somax_redirectsis never
enforced there and a genuine cycle exhausts the browser's own redirect budget and errors instead
of stopping at one hop.
Changed
-
Upgraded workspace dependencies across semver-incompatible boundaries (
cargo upgrade --incompatible):quick-xml0.41 -> 0.42 anduuid1.24 -> 1.25. quick-xml 0.42 is a breaking
change — element names now read as&strinstead of&[u8], andBytesText::xml_contentis
infallible rather than returning aResult— sositemap.rsmatches on string literals and
consumes the decoded text directly. Theflutter_rust_bridge(=2.12.0) and renamedgetrandom
(0.2/0.3) requirements were deliberately left behind; both are pinned on purpose, the latter to
force the JS backend features into the older getrandom lines pulled in transitively. -
Bumped the declared
liter-llmminimum from1.17to1.18(resolved: 1.18.0) now that the
in-flight limiter is used, and refreshedhtml-to-markdown-rsto 3.11.4 in the lockfile.
liter-llm 1.18.0 is a breaking change shipped as a minor —EmbeddingProvider::embedtakes
&EmbeddingInputrather than&str, andVectorMetadatagained animage_urlfield — but
crawlberg references none of those three surfaces, so the upgrade is source-compatible here. -
Added
[crates.e2e.snippets](output = "docs-site/src/snippets/generated") toalef.toml,
matching the config shape tree-sitter-language-pack and html-to-markdown use for the alef
doc-snippet migration.[workspace.docs.snippets].dirsstill points at the flat, hand-written
docs-site/src/snippetstree, deliberately not yet repointed atgenerated/:alef e2e generate
cannot write any snippet today because 263 of 264docs-tagged fixtures leakMOCK_SERVER_URL
mock-harness scaffolding into their would-be snippet body and alef's mock-harness guard aborts
the whole batch before writing anything. Unlike tslp/h2m, nearly every crawlberg e2e call takes
a URL, so this needspreserve_input_urls+ a$mock_urlplaceholder added across the fixture
set — verified correct in isolation againstfixtures/engine/engine_scrape_basic.json, but not
applied repo-wide pending its own review. The 14 hand-writtengetting-started/basic_usage.md
snippets are unchanged.
Zig
Add to your build.zig.zon:
.dependencies = .{
.crawlberg-zig = .{\n .url = \"https://github.com/xberg-io/crawlberg/releases/download/v1.4.0/crawlberg-zig-v1.4.0.tar.gz\",\n .hash = \"crawlberg-1.4.0-IoY1CttWKiKtFEsrr8EkrG2Eo7n7olUvWkVaE8HLqtq6\",\n },\n},\n```\n