Skip to content

quality.py declaration-name fixes + proof-profile own workflow - #35

Merged
Vilin97 merged 2 commits into
mainfrom
ci/declaration-names-and-profile-workflow
May 10, 2026
Merged

Vilin97 merged 2 commits into
mainfrom
ci/declaration-names-and-profile-workflow

Conversation

@Vilin97

@Vilin97 Vilin97 commented May 10, 2026

Copy link
Copy Markdown
Collaborator

Two independent changes (the second was requested explicitly):

1. quality.py: parse Unicode and _root_.-escaped declaration names. The axiom-audit parser's identifier regexes were ASCII-only, so theorem c₀_pos was parsed as c (then #print axioms failed with 'unknown constant' — this is what forced the Kakeya import to rename coeff_top_eval₂_…), and theorem _root_.Foo.bar was kept verbatim (audit then emitted #print axioms _root_._root_.Foo.bar). Now Unicode-aware (\w/\W are Unicode in Py3) and _qualify_name strips the _root_. escape. Regression tests added.

2. Proof profile → its own workflow. Moved the advisory proof-profile job out of lean_action_ci.yml into proof-profile.yml, triggered on PR-open and on a /profile comment (from a write-access commenter — the job runs the PR's Lean code, so untrusted comment-triggers are gated), mirroring llm-review.yml. Previously it ran on every push. Also drops the orphaned pull-requests: write permission from lean_action_ci.yml.

🤖 Opened by Claude Code.

Vilin97 added 2 commits May 10, 2026 00:49
The axiom-audit declaration parser used ASCII-only identifier regexes, so a name like `c₀_pos` was truncated to `c` (then `#print axioms` failed with 'unknown constant'), and `theorem _root_.Foo.bar` was kept verbatim (the audit then emitted the doubled `#print axioms _root_._root_.Foo.bar`). Make the identifier patterns Unicode-aware and strip the `_root_.` escape in _qualify_name. Adds regression tests.
Extract the advisory proof-profile job out of lean_action_ci.yml into proof-profile.yml. It now runs once when a PR is opened and re-runs only on a `/profile` comment (from a write-access commenter), mirroring llm-review.yml — instead of on every push. Drops the now-unneeded `pull-requests: write` permission from lean_action_ci.yml.
@Vilin97
Vilin97 marked this pull request as ready for review May 10, 2026 07:52
Copilot AI review requested due to automatic review settings May 10, 2026 07:52
@Vilin97
Vilin97 merged commit 882f079 into main May 10, 2026
8 of 9 checks passed
@Vilin97
Vilin97 deleted the ci/declaration-names-and-profile-workflow branch May 10, 2026 07:53

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 makes two targeted maintenance improvements: it fixes the Python-side axiom-audit declaration parser so it correctly handles Unicode identifiers and _root_.-escaped names, and it moves the (advisory) proof profiling job out of the main Lean CI workflow into its own on-demand workflow to reduce unnecessary runs and tighten permissions.

Changes:

  • Update quality.py declaration parsing to be Unicode-aware and to strip _root_. escapes so generated #print axioms commands resolve.
  • Add regression tests covering Unicode declaration names and _root_.Foo.bar parsing behavior.
  • Introduce a dedicated Proof Profile workflow triggered on PR open and /profile comments; remove the old job and unneeded permissions from lean_action_ci.yml.

Fit: good_fit
Level: undergraduate
Branch: tooling / CI
Mode: mixed
Obscure problem: false
Code quality: 4/5
Significance: Improves correctness of the axiom audit (avoiding false “unknown constant” failures) and reduces CI load by making proof profiling opt-in/advisory instead of running on every push.
Verdict: request_changes

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
python/lean_pool/quality.py Unicode-aware identifier parsing and _root_. escape stripping for axiom audit declaration collection.
python/tests/test_quality.py Regression tests for Unicode declaration names and _root_-escaped declarations.
.github/workflows/proof-profile.yml New standalone proof profiling workflow with PR-open and /profile triggers plus sticky comment + artifact output.
.github/workflows/lean_action_ci.yml Removes the embedded proof-profile job and drops now-unneeded PR write permission.

Comment on lines +40 to +43
(github.event_name == 'issue_comment' &&
github.event.issue.pull_request != null &&
startsWith(github.event.comment.body, '/profile') &&
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association))
jobs:
profile:
runs-on: ubuntu-latest
name: Proof profile (advisory)
PY

- name: Post sticky PR comment with profile
if: steps.files.outputs.files != ''
Vilin97 added a commit that referenced this pull request May 10, 2026
…mment

The two 'Comment when ...' steps in llm-review.yml ran 'gh pr comment' without --repo or a checkout, so they failed 'not a git repository' on PRs that hit those branches (no .lean files, or Lean CI not green) — this made the 'review' check red on PR #35. Add REPO env + --repo to both. Also remove the now-inert '-- size-limit-ok:' comment from LeanPool/FelConjecture/Solution.lean (the waiver was removed in 702b453; the comment only misleads).
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