Skip to content

fix(proofs): move RTAJittered.lean imports above all comments#159

Merged
avrabe merged 1 commit intomainfrom
fix/rtajittered-import-order
Apr 25, 2026
Merged

fix(proofs): move RTAJittered.lean imports above all comments#159
avrabe merged 1 commit intomainfrom
fix/rtajittered-import-order

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented Apr 25, 2026

Summary

The new Lean CI gate from #151 surfaced a real syntax error in `proofs/Proofs/Scheduling/RTAJittered.lean` (landed in #148):

```
error: Proofs/Scheduling/RTAJittered.lean:35:0:
invalid 'import' command, it must be used in the beginning of the file
```

Lean 4.29.0-rc6 requires `import` to come before any other top-level content. The original file had a leading `/-!` docstring (OK) followed by a `/- ... -/` block comment (NOT OK), then the imports. Lean treats the second block as a top-level command, which makes the imports illegal.

Fix

Merged the two blocks into a single `/-! ... -/` module docstring placed before the imports. Lean's leading-docstring exception still holds, so imports remain "at the beginning".

Content unchanged — only the comment framing.

Why this slipped through

The Track A commit-3 agent (#148) couldn't run `lake build` locally (no Lean toolchain in sandbox). It explicitly flagged this risk in its report. The new `use-mathlib-cache: true` path on #151 pulls Mathlib in ~5 min instead of timing out at 60 min, finally letting CI reach our in-tree files.

Test plan

  • CI Lean job passes
  • No regressions to `cargo test --workspace`

🤖 Generated with Claude Code

The Lean compiler requires `import` statements to appear before any
other top-level content (including doc-comment blocks `/- ... -/`).
The original file from #148 had two stacked comment blocks (a `/-!`
docstring then a `/- ... -/` overview) above the `import` lines, and
Lean 4.29.0-rc6 rejects that with:

    error: Proofs/Scheduling/RTAJittered.lean:35:0:
           invalid 'import' command, it must be used in the beginning
           of the file

Fix: merge the two blocks into a single `/-! ... -/` module docstring
that sits *before* the imports — Lean treats the leading docstring as
metadata, not as a top-level command, so imports following it are still
"at the beginning". Same content, different framing.

Discovered by the new Lean CI gate from #151 once Mathlib's precompiled
cache lands fast enough to actually reach our in-tree files.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@avrabe avrabe merged commit c5b35df into main Apr 25, 2026
14 checks passed
@avrabe avrabe deleted the fix/rtajittered-import-order branch April 25, 2026 22:20
avrabe added a commit that referenced this pull request Apr 26, 2026
Lean 4.29.0-rc6 rejects `import` after a `/-! ... -/` module-docstring
in this file's pattern, even though Mathlib uses module docstrings
throughout — likely an interaction with the closing `-/` being on the
same line as content text. The other working files in this directory
(RTA.lean, RMBound.lean, EDF.lean) all use a regular `/- ... -/`
block comment with the closing `-/` on its own line, so we match that
style.

#159 (the previous import-order fix) addressed the structural ordering
but introduced the `/-!` form. CI surfaced that in #151's first run
that actually reached our in-tree files via mathlib-cache.

Body unchanged. Format-only edit.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.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.

1 participant