Skip to content

fix(types): align core Python contracts with ty - #4558

Merged
PeterStaar-IBM merged 9 commits into
2026-10-04-fix/python-type-contractsfrom
2026-10-04-fix/core-model-contracts
Oct 5, 2026
Merged

PeterStaar-IBM merged 9 commits into
2026-10-04-fix/python-type-contractsfrom
2026-10-04-fix/core-model-contracts

Conversation

@geoHeil

@geoHeil geoHeil commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

New ty diagnostics covered core parsing, pipeline, inference, and stage contracts. This patch adds explicit models and guards at those boundaries, and fixes three real incomplete-result cases in RapidOCR: missing text, missing confidence, and detection-only output now log and skip. Complete OCR text, confidence, and coordinates stay unchanged.

The changes stay in Python code and focused regression tests. They do not disable a ty rule or widen values to Any.

Validation: ty 0.0.84 passes on Python 3.10 and 3.13. Focused core and model tests pass, including 91 tests with one existing skip. make validate passes. The backend contract patch below this branch has separate source, model, and export tests.

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

✅ DCO Check Passed

Thanks @geoHeil, all your commits are properly signed off. 🎉

@geoHeil

geoHeil commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

@geoHeil
geoHeil force-pushed the 2026-10-04-fix/core-model-contracts branch from 4c8742f to 2de2e7c Compare October 4, 2026 09:52
Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>
Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>
Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>
Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>
@geoHeil
geoHeil force-pushed the 2026-10-04-fix/core-model-contracts branch from 2de2e7c to 3f08558 Compare October 4, 2026 09:52
@geoHeil
geoHeil added this pull request to stack #4562 October 4, 2026 10:29
@geoHeil
geoHeil requested a review from dolfim-ibm October 4, 2026 10:30
Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>
Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>
Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>
Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>
Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>
@PeterStaar-IBM
PeterStaar-IBM merged commit 5726a06 into 2026-10-04-docs/review-guardrails Oct 5, 2026
26 checks passed
@PeterStaar-IBM
PeterStaar-IBM deleted the 2026-10-04-fix/core-model-contracts branch October 5, 2026 04:56
PeterStaar-IBM pushed a commit that referenced this pull request Oct 5, 2026
* fix(types): align core Python contracts with ty

Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>

* fix(types): clarify inference engine contracts for ty

Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>

* fix(types): clarify stage and OCR contracts for ty

Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>

* fix(types): guard optional input formats

Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>

* fix(core): preserve threaded and VLM result contracts

Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>

* fix(types): narrow optional VLM engine selection

Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>

* fix(types): preserve MLX path contract

Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>

* fix(types): preserve MLX path contract

Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>

* fix(types): remove stale MLX ignore

Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>

---------

Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants