Added
- models: the experimental candidate inventory (
crates/xberg/src/candidate_models/inventory.json) is now the only pin store. It records every staged artifact's owned repository, immutable revision, SHA-256, size, license and per-file source, and selects an explicit fp32 or int8 subset per task so a consumer never downloads another task's graphs. The NLI preparation path derives both its SHA-256 and size manifests from the inventory and rejects a truncated or extended file before reading it; a wrong or floating revision fails before any byte is checked. A caller-suppliedLocalNliModelmust now also providesize_manifest, and an omitted size fails closed. Every entry stays experimental and unqualified; none is a default or a supported preset. (#2336) - classification:
LocalNliModel::stagedbuilds the experimental zero-shot NLI descriptor from the candidate inventory, selecting the host graph throughCandidateModel::files_for_target(the fp32 NLI graph exceeds the adapter's cap; an unsupported architecture fails instead of substituting one).LocalClassificationModerecords that caller labels are zero-shot, andLocalTextClassifier::classify_trained_taxonomyrejects a trained-taxonomy request while no fixed-taxonomy head is staged. Still behindclassification-onnx, still unqualified. (#2335) - captioning: the experimental
captioning-onnxfeature adds a CPU-only local image captioner over the staged SmolVLM-256M/500M graphs (xberg::local_captioning). It selects fp32 or int8 through the candidate inventory, stages or verifies every artifact by SHA-256 and exact size, preprocesses and prompts the export, runs a bounded greedy decoder with cancellation and deadlines, and never falls back to a provider. Florence-2 pins and descriptor validation are included, but the adapter refuses that family explicitly because its encoder-decoder, task-token and per-task post-processing pipeline is not implemented.LocalCaptioningModel::stagedandLocalImageCaptioner::stage/prepareare Rust-only and unqualified; the default feature set and the liter-llm captioning path are unchanged. (#2335) - captioning: SmolVLM preprocessing follows the pinned Idefics3 processor's
do_image_splittingpath: the image is resized to the processor'ssize, split intomax_image_sizetiles tagged<row_N_col_M>in row-major order, and closed by the squashed global frame. Tile count and total image tokens are bounded before inference, the prompt's token ids match the pinned processor for a 2x2 grid, and the single global-frame expansion is unchanged. Florence-2 stays refused explicitly: the earlier merged-decoder failure does not reproduce on the bundled ONNX Runtime 1.31.0, where both pinned quantizations load and run cached steps; the blocker is the unimplemented encoder-decoder/task-token/post-processing pipeline, recorded in the module docs. (#2335) - cli:
xberg cache warmandxberg doctorcan select the experimental local candidates with--captioning-model/--classification-model,--*-precisionand--*-backend, and report the selected/effective backend plus the prepared model identity. Doctor's offline output lists every pinned candidate artifact with its id, revision, size, SHA-256 and staged/missing state;cache warmstages, verifies and prepares the selection so the first request performs no network access.LocalTextClassifiergains the matchingstageandartifactssurface. The CLI features (captioning-onnx,classification-onnx) stay opt-in and are absent fromdefault/all/full; no candidate is a default preset. (#2335) - pdf:
pdf_options.extract_vector_geometry(defaultfalse) returns each PDF page's vector geometry onpages[].geometry: every painted path's subpaths, segments, bounding box, fill colour, stroke colour/width/dash, and Optional Content layer, in page coordinates with the content-stream and Form XObject transforms applied. The coordinate frame is the same one text bounds use, so a label can be matched to the shape it annotates. Off by default because a dense drawing sheet can hold more than ten thousand paths. (#2966) - pdf: measured annotation and viewport data.
PdfAnnotationnow carriesverticesfor Line, Polygon and PolyLine annotations,ink_listfor Ink, andmeasurefor the/Measuredictionary (producer scale text plus the/X,/Y,/D,/A,/Tand/Snumber-format arrays).pages[].viewportscarries every/VPpage viewport with its bounds, name and measure. A native writer appends a Polygon annotation with a copied measure dictionary to an existing PDF as an incremental update, preserving every original byte and other object. (#2966) - pdf:
pdf_options.plan_regions(opt-inplan-regionsCargo feature, default off) closes line segments from the vector geometry into a planar graph, bridges door-sized gaps up togap_tolerance, splits crossings and returns each bounded face onpages[].geometry.regionswith its area in square page points and the page text inside it.snap_tolerance,gap_toleranceandmax_segmentsare settings; work is bounded and degeneracies are skipped. The one added dependency isgeo(MIT OR Apache-2.0), reachable only through that feature. (#2966) - pdf:
extraction::plan_geometry::DrawingSetTextparses the text conventions of a construction drawing set: title-block sheet number, title and revision; feet-and-inch dimension strings (12'-0 5/8"to 144.625 inches) paired with the caller's text position; and architectural or ratio scale notes (3/8" = 1'-0"to 1:32,1:100to 100). Every field is optional and no parser invents a value. (#2966) - ocr:
OrtSessionOptions(memory_pattern,cpu_arena) now applies to PaddleOCR detection, classification and recognition ONNX Runtime sessions (max_threadsdoes not affect PaddleOCR), andset_ort_session_options/ort_session_optionsare exposed to the language bindings, so variable-size documents can run with a bounded memory footprint. PaddleOCR engines are pooled per option set. (#3284) - api:
XBERG_API_TOKENenables bearer-token authentication on every REST route exceptGET /health, and on the MCP HTTP transport (xberg mcp --transport http). The token must be ASCII. The Helm chart takes the token from a Secret (xberg.apiTokenSecret).
Changed
- release: Every published CLI archive (Linux gnu/musl, macOS, Windows) and the
core/full/cliDocker images now build libheif decode-only: the Linux and Docker builds pass-DWITH_X265=OFF/-DWITH_X264=OFF, the macOS CLI uses the source-builtdecodeprofile instead of Homebrew's x265-linked bottle, and the Windows vcpkg install requestslibheif[core,aom,libde265]instead of the port's defaulthevcfeature. A release gate opens each archive and fails on an x265 file, symbol orDT_NEEDED/load-command reference. HEIC/HEIF decoding is unchanged, but HEIF/HEIC image output viaImageOutputFormat::Heifnow reportsEncoderUnavailableon these artifacts instead of linking the GPL-2.0 encoder; the macOS Elixir NIF keeps its deliberate encoder profile and is conveyed under GPL-3.0-or-later with a written corresponding-source offer (GPL-SOURCE-OFFER.txt, valid three years, contactcontact@xberg.io). (#3338) - release (windows): The Windows x64 CLI ZIP now links the LGPL-3.0 libheif and libde265 as shared libraries from vcpkg's dynamic
x64-windowstriplet instead of embedding them inxberg.exe, and bundles only the codec DLLs reachable fromheif.dll(pluslibde265.dll,aom.dlland their closure),LGPL-3.0.txt,GPL-3.0.txt, the upstream codec notices and aGPL-SOURCE-OFFER.txtoffer of the Corresponding Source for three years. That is the LGPL-3.0 §4(d)(1) shared-library route rather than the §4(d)(0) relink material a static link needs, and it covers the §3/GPL-3.0 §6 source obligation because the vcpkg ports patch the codecs (THIRD_PARTY_LICENSES.mdrecords the method and the §2 modification notice). A new release gate reads the archive's PE imports, notices and offer and fails a Windows CLI ZIP whose executable stops importingheif.dll, whose codec DLL closure is incomplete, or that omits a text or the offer. (#3339) - api: Breaking. The REST server and the MCP HTTP transport now refuse to start on a non-loopback host (the Docker images bind
0.0.0.0) unlessXBERG_API_TOKENis set orXBERG_ALLOW_UNAUTHENTICATED=trueopts out (only for a trusted network). CORS is denied unlessXBERG_CORS_ORIGINSlists origins (*allows all); the libraryserve*functions now readXBERG_CORS_ORIGINSandXBERG_JOB_TIMEOUT_SECSfrom the environment as the CLI does.ServerConfig.cors_allows_all()andis_origin_allowed()(exposed in the bindings) change meaning: an emptycors_originslist now denies instead of allowing every origin, and only*allows all. Also,DELETE /cache/clearandPOST /cache/warmnow count against the concurrency limit. Migration: setXBERG_API_TOKENand sendAuthorization: Bearer <token>, or setXBERG_ALLOW_UNAUTHENTICATED=truebehind a trusted proxy; add browser origins toXBERG_CORS_ORIGINS. (#3165) - Breaking (libheif): In the Rust-only
xberg-libheifcrate,ImageHandle,Track,RegionItemand theRegiongeometry types carry the input lifetime (ImageHandle<'a>,Region<'a>) and share ownership of the context's native state and input, so they stay valid after theHeifContextis dropped but cannot outlive a borrowed input; a live region also keeps the context from loading another image, since libheif resolves its transformed getters against that context's image properties.Readernow requiresSendand is called under a lock, since libheif may read from worker threads.HeifContextis no longerSend.read_file,read_readerandread_bytesreturn a usage error while handles derived from the context are alive, and methods that take anImageHandlereject one from another context. Theimageintegration buffers its input in memory (up to 512 MiB). The removed internalImageHandle::context()wrapped the shared native context without carrying its source. (#3229) - Breaking (tesseract):
xberg-tesseractiterators are tied to the engine and its current recognition result.PageIterator,ResultIterator,ChoiceIteratorandMutableIteratorgain an<'api>lifetime and cannot outlive theTesseractAPIthat produced them. Theirnewconstructors and publichandlefields are removed, andTesseractAPI::handleispub(crate).ResultIterator::choices()replaces rawChoiceIteratorconstruction, andget_mutable_iteratorreturnsMutableIterator. An iterator call made after Init,set_image,recognize,clear, layout analysis or another call that replaces the result fails with the newTesseractError::StaleIterator.TesseractErroris now#[non_exhaustive]. (#3228) - Breaking (tesseract):
Pix::grayscale_bytesreturnsInvalidParameterErrorfor an image that is not 8 bpp or has a colormap, instead of narrowing raw pixel values. (#3228) - pdf/ocr: Embedded-image OCR reads identical image bytes once and shares the result with every occurrence, so a native PDF that paints one image on every page no longer pays an OCR read per page. (#3260)
- pdf: Scan grading is skipped when PDF metadata output is off and OCR is disabled or absent from the build, removing an extra pass over the pages; with OCR enabled or metadata requested the grade and the OCR routing it feeds are unchanged. (#3386)
Fixed
- pdf: A fixed-arity operator reads its trailing operands, as other readers apply them, so an operand leaked by an unknown operator ahead of it (
bcolor [0],pagesize width 597.5pt height 845pt) no longer shifts a matrix or drops the operator.[0] 1 0 0 1 -72 -779 cmapplies the documented translate instead of a shifted matrix, and a page whose text it places no longer extracts empty. (#3383) - pdf: A Form XObject's text survives the large-stream prescan: a
Doregion now includes the/Nameoperand that precedes it, so pages over 256 KiB of glyph outlines with an invisible OCR text layer in a form extract their text instead of nothing. (#3384) - pdf: Two ruled schedules side by side on one sheet, sharing row bands and separated by a wide graphics-free gap, are returned as separate tables instead of one whose bbox spans both; a cell wider than 60 points is only closed when a horizontal rule spans it, so a shared banded table bridged by its rules stays one table. (#3377)
- api: The drawing-set types (
SheetMetadata,ParsedScale) andPolygonAnnotationInputserialize, so the Java, Kotlin, C# and FFI JSON bridges for the new geometry surface exist instead of naming symbols the native library never exported. (#2966) - pdf: Separately titled tables printed as one band are split at each title again, both when a ruled detector joins stacked tables whose rules line up and when three titled tables sit side by side in one borderless band. Each title stays a full-width row and the header band that follows it stays with its own table; a spanning row inside a body and a header band that repeats without a title do not split. (#3348)
- pdf: A ruled table split by a taller row gap under a subtotal is rejoined into one table when adjacent bands repeat their column tracks and one family of long rules spans both, keeping the wrapped header and the first-column row span. (#3349)
- pdf: A two-column page letterhead in the top band is no longer emitted as a table; it stays text, while ruled tables and tables with retained grids remain tables. (#3350)
- ocr: Default preprocessing measures a raster's own paper level instead of comparing it with a fixed near-white value, so a lightly tinted or shaded scan page is still read as a page and takes the 300 DPI resample. A 100 DPI tinted table with 9 px digits keeps 72 of its 72 numbers instead of 65, and its 7 px variant 71 of 72 instead of 49, while a 300 DPI page is not resampled. (#3337)
- pdf: A leading ruled band whose cells wrap over several lines is one header row again, with each column's lines joined by position, instead of one body row per wrapped line that pushed the body down and dropped the header role. (#3346)
- pdf: A stacked header keeps the leaf band under its spanning title as header cells in the table grid and plain HTML output, spans intact, so those labels are no longer body cells there; Markdown and the styled HTML renderer still mark one header row, the spanning title. (#3347)
- layout:
serveandextractread layout models from the Xberg cache (XBERG_CACHE_DIR/layout, the platform cache directory by default) before the Hugging Face cache, so the models the Docker image warms at build time are used instead of downloaded again; a warmed model now resolves withHF_HUB_OFFLINE=1and no Hub request.cache warmdefaults to the same root as the runtime instead of.xbergin the current directory, andxberg::cache::resolve_cache_base_dir()exposes the resolved root. (#3320) - pdf: Native extraction keeps a raised ordinal suffix (
2nd,24th) in its sentence when the mark is a multi-glyph run set up to 0.5em above its base, while a lone raised mark keeps the narrower reach. (#3317) - ocr: A recognized dot-leader table row is no longer printed beside the row the detected table already carries. The row claim now compares rows without the leader artifacts a recognizer adds between a label and its values, including a leader that picked up a stray dash, while letters, digits, signs and currency still have to match in order. (#2503)
- ocr: A leader-aware table proof now also claims the rows it leaves behind, matching whole rows only and never every line inside the table's rectangle. On a 150 dpi six-column dot-leader scan read with PSM 6, HTML printed the row whose short leader the table cell did not carry beside the table that already carried it; the table is now emitted once. (#2503)
- tesseract: The text getters on
TesseractAPI(UTF-8, hOCR, ALTO, TSV, box, LSTM box, word-str box, UNLV) free the native text when UTF-8 conversion fails. (#3228) - pdf: Honor global OCR disable settings by skipping inline-image OCR and image loading requested only for OCR. (#3389)
- pdf: A born-digital equation line is written as display math (
$$...$$) and an equation inside a sentence as inline math ($...$) in Markdown, instead of plain text; Plain keeps the undelimited source. (#2331) - pdf: A running header or footer whose only change is its page number no longer stays in the body, on native and scanned pages. Scanned pages also strip cross-page furniture by default, matching
ContentFilterConfig::strip_repeating_text. (#2331) - release: The non-musl Go archive ships
LICENSEandTHIRD_PARTY_LICENSES.mdbeside the FFI library and link metadata, matching the musl archive, so the five Go downloads carry the notices for the libheif, libwpd and ONNX Runtime bytes they redistribute. (#3342)