Repository navigation
fix(specs): fall back only when ju is absent; let broken ju imports fail - #6
Merged
Merged
Conversation
…ail (#4) The bare `except ImportError` around the whole ju spec-generation block swallowed a ModuleNotFoundError for `dill` (undeclared, imported at module level by ju 0.1.31's oas.py), so CI only ever exercised the basic fallback. - Import ju.rjsf through _import_func_to_form_spec: only a missing `ju` / `ju.rjsf` falls back, with a visible JuNotInstalledWarning. Any other import failure propagates. The spec-generation call is no longer guarded. - Require ju>=0.1.33 (imports cleanly; honors required fields, i2mint/ju#9). - Add no-fallback ju integration tests that skip only when ju is absent, plus tests for the warning and for broken-dependency propagation. Closes #4 Claude-Session: https://claude.ai/code/session_01UMu2bF25xcBqjScMKa7A3X
…t ju Adversarial-review finding: an old ju without ju.rjsf, or a stray namespace 'ju/' dir, fell back with a misleading 'not installed' warning. Only a missing top-level 'ju' now falls back. Tests simulate absence with a finder (as a real absence behaves) and cover the missing-submodule case. Claude-Session: https://claude.ai/code/session_01UMu2bF25xcBqjScMKa7A3X
This was referenced Oct 12, 2026
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.
Closes #4.
Root cause
On the runner,
ju==0.1.31failed to import:ju/oas.pydoesimport dillat module level anddillis not a declared dependency of ju. The bareexcept ImportErroraround the whole ju block inspecs.pyswallowed that, so CI only ever ran the basic fallback (CI coverage showedspecs.pylines 97-108, the ju path, as missed). Reproduced in a clean venv: ju 0.1.31 raisesModuleNotFoundError: No module named 'dill'; ju 0.1.33 imports and generates specs correctly.Change
_import_func_to_form_spec(): only a missingju/ju.rjsffalls back, emitting a visibleJuNotInstalledWarning. Any other import failure (missing ju dependency, renamed symbol) propagates. Thefunc_to_form_speccall itself is no longer inside a try block.ju>=0.1.33floor (clean import; json_schema_to_signature's 'properties' branch ignores json_schema['required'] entirely ju#9 required-field handling).Verified in three clean venvs: ju 0.1.33 → all pass; ju 0.1.31 → fails loudly on
dill; no ju → 4 skipped with reason + warning.Review
Adversarial review (fresh Opus subagent): no confirmed defects in the diff. It checked three venvs (ju 0.1.33, broken 0.1.31, no ju), reversed test order and isolation leaks; all clean. Findings acted on:
ju.rjsf, or a stray namespaceju/, fell back with a misleading warning. Only a missing top-leveljufalls back now (2nd commit).stacklevelthroughMapping.get), param_to_prop_type is accepted but never passed to ju; *args/**kwargs become required string fields #9 (pre-existing:param_to_prop_typeignored,*args/**kwargsbecome required fields), Audit remaining broadexcept ImportErrorguards (pandas, pydantic, trans auto-register) #7 (other broadexcept ImportErrorguards).Dependents gate:
priv test-dependents uf(also-t): no dependents, so only uf's own suite ran. Its 38 doctest failures are identical to master's (pre-existing, #5). Repotests/: 35 passed.CI: ju 0.1.33 installed on the runner; ju tests ran (0 skipped); the ju branch of
specs.pyis now covered.https://claude.ai/code/session_01UMu2bF25xcBqjScMKa7A3X