fix: classifier-off single-type fallback + request-scope transform rows#31
Merged
Merged
Conversation
added 2 commits
June 12, 2026 21:50
Two robustness fixes surfaced while wiring structured array fields + cross-document
consolidation through the IDP:
1. classifier off + no expected_type silently extracted nothing. When the classifier
stage is disabled and the caller pins no type, a single-row file now defaults to
the sole declared document_type instead of leaving the segment `unmatched` (which
produced zero documents with no error). Mirrors the classifier's own single-
candidate shortcut.
2. request-scope LLM transformations returned empty rows. The transformer output
wrapped each row under a `values` key while the prompt emits flat {field: value}
rows, so the structured output never matched and consolidated rows came back
empty. The row is now a flat dict, matching the prompt — result.request_transformations
carries populated rows (e.g. a cap table consolidated across deeds).
Release 26.6.5.
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.
Two robustness fixes surfaced while wiring structured array fields + cross-document consolidation through the IDP layer.
1. Classifier off + no
expected_typesilently produced zero documentsWhen
stages.classifierwas off and a file carried noexpected_type, the segment stayedunmatchedand the file yielded no document — with no error. Callers that disable the classifier for a known single type (the common IDP path) silently got nothing back.A single-row file now defaults to the sole declared
document_typein that case, mirroring the single-candidate shortcut the classifier step itself takes (_step_classifier,len(document_types) == 1).2. Request-scope LLM transformation returned empty rows
The transformer's output model wrapped each row under a
valueskey (_TransformRow.values), buttransform.yamlinstructs the model to emit flat{field: value}rows. So the structured output never matched and every consolidated row came back empty —result.request_transformationswas unusable forscope: requestconsolidation (e.g. a cap table merged across deeds).The output row is now a flat
dict[str, Any], matching the prompt 1:1;_rebuild_rowsreads it directly.Verification
Reproduced live: a
scope: requestLLM transformation over several escrituras with acap_tablearray group now returns a populated, consolidated cap table underrequest_transformations(one row per current shareholder with NIF, participaciones, %, clase). Before, the rows were empty.Release 26.6.5.