Skip to content

[Merged by Bors] - chore: adaptation for upcoming on_goal change - #44446

Closed
JovanGerb wants to merge 1 commit into
leanprover-community:masterfrom
JovanGerb:Jovan-on_goal-adapt
Closed

JovanGerb wants to merge 1 commit into
leanprover-community:masterfrom
JovanGerb:Jovan-on_goal-adapt

Conversation

@JovanGerb

Copy link
Copy Markdown
Contributor

This PR contains the adaptations for the upcoming change to the on_goal tactic.


@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

PR summary d8368daf0a

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

No declarations were harmed in the making of this PR! 🐙

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.

Declarations diff (Lean)

✅ Lean-aware diff — post-build, computed from the Lean environment (commit d8368da).

  • +0 new declarations
  • −0 removed declarations

No declaration differences.


No changes to strong technical debt.
No changes to weak technical debt.

Current commit d8368daf0a
Reference commit d8440dec66

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/technical-debt-metrics.py pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@grunweg

grunweg commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Thanks!
bors merge

@mathlib-bors mathlib-bors Bot added the ready-to-merge This PR has been sent to bors. label Oct 4, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Oct 4, 2026
This PR contains the adaptations for the upcoming change to the `on_goal` tactic.
@mathlib-bors mathlib-bors Bot added the bors-staging This PR is currently being built by bors on the staging branch. label Oct 4, 2026
@mathlib-bors

mathlib-bors Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

@mathlib-bors mathlib-bors Bot changed the title chore: adaptation for upcoming on_goal change [Merged by Bors] - chore: adaptation for upcoming on_goal change Oct 4, 2026
@mathlib-bors mathlib-bors Bot closed this Oct 4, 2026
Kha pushed a commit to leanprover/downstream-lean4 that referenced this pull request Oct 4, 2026
Run
[37207955571](https://github.com/leanprover/downstream-lean4/actions/runs/37207955571)
on `nightly-2026-10-04` went red in `mathlib4` (critical) and `repl`,
with `cslib`
skipped behind `mathlib4`. The cause is not the nightly — it is the
`downstream: update repo batteries` merge 4cfce6c, which brought in

[batteries#1990](leanprover-community/batteries#1990).

## mathlib4

batteries#1990 lets `on_goal` act on several goals at once. It
introduces

```lean
syntax goalNum := "-"? num
```

and replaces `elab "on_goal " reverse:"-"? n:num " => " seq:tacticSeq`
with
`elab "on_goal " ns:goalNum+ " => " seq:tacticSeq`, and `pick_goal`
likewise.
That breaks Mathlib in two independent ways.

**1. The `on_goal` quotations in
`Mathlib.Tactic.ClickSuggestions.Util`** — `$n₁` is now
a `TSyntax goalNum` where the code wants a `NumLit`, and the
term-position quotation
wants a `goalNum` where `Syntax.mkNatLit` gives a `NumLit`. This is the
only error CI
reported. The fix is the author's own adaptation,

[mathlib4#44446](leanprover-community/mathlib4#44446),
applied
verbatim: annotate the three antiquotations `:num`.

**2. The syntax node kinds were renamed.** The `-` used to be an atom of
the tactic
syntax itself and is now part of `goalNum`, so the generated kinds
change:

| old | new |
| --- | --- |
| `Batteries.Tactic.«tacticOn_goal-_=>_»` |
`Batteries.Tactic.«tacticOn_goal_=>_»` |
| `Batteries.Tactic.«tacticPick_goal-_»` |
`Batteries.Tactic.tacticPick_goal_` |

Mathlib's `multiGoal` and `unusedTactic` linters keep those kinds in
exclusion lists,
written out by name, so after the rename neither linter recognises
`on_goal` or
`pick_goal` as focusing the goal any more and every use in Mathlib
starts warning —
`--wfail` turns that into a build failure. Renamed in
`Mathlib/Tactic/Linter/Multigoal.lean` (both entries) and
`Mathlib/Tactic/Linter/UnusedTacticExtension.lean`.

44446 does not carry this half, because upstream Mathlib still builds
against the
pre-#1990 batteries, where the old kinds exist and the exclusions work.
Upstream will
need it at its next batteries bump.

(`Mathlib/Tactic/Linter/FlexibleLinter.lean:299` holds a third such
entry, under the
pre-Batteries name `Std.Tactic.«tacticOn_goal-_=>_»`. It has been dead
since the
rename to batteries and is left alone here — reviving it would change
that linter's
output, which is not this breakage.)

Verified locally on 4cfce6c + `nightly-2026-10-04`:

* `lake build Mathlib Archive Counterexamples Wanted cache --wfail` —
18352 jobs, no
  warnings
* `lake test --iofail` — 18868 jobs
* `lake lint` — `Linting passed for Mathlib.`

`repl`, whose `test` phase failed on the very same module, needs no
change of its own:
`lake build` and `lake test` pass here, including the `test/Mathlib`
build and the
`on_goal` case of the `test/*.in` suite.

## Not fixed here

`cslib` and `verso-slides` are the two repos this run left red that are
already covered
by open PRs, and no second fix is opened for them:

* `cslib` —
[#129](#129), the
`Set.Finite.measure_lt_top_of_sigmaFinite` clash. It was *skipped* in
this run behind
`mathlib4`, so CI has not run it since `nightly-2026-10-03`. Re-verified
here on top of
this commit, with #129 applied: `lake build --wfail --iofail` (6646
jobs),
  `lake test --wfail --iofail` (18601 jobs) and `lake lint` all pass.
* `verso-slides` —
[#126](#126), the
`SubVerso.Examples` re-export. Re-verified with #126 applied: `lake
build` (749 jobs)
  and `lake test -- --no-playwright` pass.

Nothing was left unfinished: every phase of every repo in this run's red
set passes
locally, given those two PRs.

<!-- downstream-watch: unattended -->

Co-authored-by: downstream-lean4[bot] <downstream-lean4[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bors-staging This PR is currently being built by bors on the staging branch. ready-to-merge This PR has been sent to bors. t-meta Tactics, attributes or user commands

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants