Accept Lean 4.33's docstring shape, and catch shape changes early - #26
Merged
Conversation
The v4.33.0 patch built cleanly and the run then failed two hours later, partway through the load: ValidationError: 4.modifiers.docString Input should be a valid tuple [input_value='The speed of light in free space. '] jixia's model types docString as Lean's older [text, bool] pair, but Lean 4.33 emits a bare string, so every declaration carrying a docstring failed to parse. Widen the field to accept either shape and read the text through one helper. Only the text is ever stored, so how Lean represents the flag is not worth tracking. Verified against both shapes and the null case. The larger problem is that a compiling jixia proved nothing about whether its output is usable, and the mismatch only surfaced after a multi-hour load. Add a smoke test that runs jixia over a single module immediately after building it and parses the result exactly as the loader does, so this class of breakage fails in seconds with a clear message instead of hours in.
There was a problem hiding this comment.
Pull request overview
This PR hardens the indexing pipeline against upstream Lean/jixia JSON shape changes by accepting both legacy and new docstring representations and by adding a fast post-build smoke test to fail early when loader parsing will break.
Changes:
- Widen
jixia.structs.Modifiers.docstringto accept either(text, flag)or baretext, and centralize extraction via_docstring_text. - Store only the docstring text for declarations, regardless of Lean’s internal representation.
- Add a GitHub Actions smoke test that runs
jixiaon one module and validates the produced JSON using the same parsing types as the loader.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
database/jixia_db.py |
Adds a compatibility shim for docstring shape changes and normalizes docstring storage to text-only. |
.github/workflows/weekly-index.yml |
Adds a post-build smoke test to catch incompatible jixia JSON output within minutes. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if: steps.build_jixia.outcome == 'success' | ||
| continue-on-error: true | ||
| run: | | ||
| MODULE=$(find physlib/Physlib -name '*.lean' | head -1) |
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.
Why
The v4.33.0 patch built cleanly — the patch loop worked exactly as designed (
jixia-lean-4.32.patch: applied but did not build, reverting→jixia built with jixia-lean-4.33.patch). Then the run failed two hours later, partway through the load:jixia's model types
docStringas Lean's older[text, bool]pair. Lean 4.33 emits a bare string, so every declaration with a docstring failed to parse.The real problem
A compiling jixia proved nothing about whether its output is usable, and the mismatch only surfaced after a multi-hour load. That is the reliability gap, not the specific field.
What
Modifiers.docstringand read the text through one helper. Only the text is ever stored, so how Lean represents the flag is not worth tracking. Verified against[text, bool], barestr, andNone.Ordering of guards, after this