CLI: write triage.json (or expose per-page routing) when --hybrid is set

Author: ralfaouad-TLCreated Sep 18, 2026Updated Sep 18, 2026

Version: opendataloader-pdf 2.4.7 (pip, bundled JAR), Java 17, --hybrid docling-fast --hybrid-mode auto against a local opendataloader-pdf-hybrid --no-ocr server.

Request: when --hybrid is set, have the CLI write the per-page triage results (triage.json) next to the outputs, or expose the routing some other machine-readable way (a --triage-log <dir> option would be enough).

What exists today: TriageLogger.logToFile(...) and HybridDocumentProcessor.processDocument(String, Config, Set<Integer>, Path outputDir) already produce exactly this file (document, hybrid, pages[].page/decision/confidence/signals), but the CLI path goes through DocumentProcessor → HybridDocumentProcessor.processDocument(inputPdfName, config, pagesToProcess), i.e. the 3-argument overload, which passes null as the output directory, so the file is never written. As far as I can see only HybridBackendFailureIntegrationTest passes a directory. The Page N: JAVA|BACKEND (confidence=X) lines are logged at FINE (so reachable with a java.util.logging config), but the TriageSignals behind the decision are not logged anywhere.

Why it matters: we are evaluating hybrid mode as the route for pages the Java path cannot read (e.g. #740) and scoring the triage's choices per page against ground truth; that needs the decision per page and ideally the signals, from the CLI, without re-implementing the file loop programmatically. Right now we parse the FINE log for the decision and lose the signals.

Workaround in use: -Djava.util.logging.config.file=... with org.opendataloader.pdf.processors.HybridDocumentProcessor.level = FINE, then parse INFO: File name: / FINE: Page N: lines per file.

No files attached; this is about the CLI code path, not a specific document.

Source: opendataloader-project/opendataloader-pdf