Skip to content

Accept Lean 4.33's docstring shape, and catch shape changes early - #26

Merged
Gabrielebattimelli merged 1 commit into
mainfrom
fix/jixia-4.33-docstring
Aug 18, 2026
Merged

Accept Lean 4.33's docstring shape, and catch shape changes early#26
Gabrielebattimelli merged 1 commit into
mainfrom
fix/jixia-4.33-docstring

Conversation

@Gabrielebattimelli

Copy link
Copy Markdown
Member

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, revertingjixia built with jixia-lean-4.33.patch). Then the run 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. ', input_type=str]

jixia's model types docString as 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

  • Accept either shape. Widen Modifiers.docstring 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 [text, bool], bare str, and None.
  • Smoke-test jixia immediately after building it. Run it over a single module and parse the output exactly as the loader does. This class of breakage now fails in seconds with a clear message instead of hours in.

Ordering of guards, after this

Stage Catches Cost of failure
Patch loop jixia won't compile ~5 min
Smoke test (new) output shape changed ~1 min
Sanity check load produced implausible data ~1 hr
Image size guard oversized image pre-release
Health check + auto-rollback bad deploy site stays up

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.
Copilot AI lite review requested due to automatic review settings August 18, 2026 21:07
@Gabrielebattimelli
Gabrielebattimelli merged commit e1a0b08 into main Aug 18, 2026
2 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.docstring to accept either (text, flag) or bare text, 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 jixia on 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)
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