Skip to content

Restore the impact fixes the split omitted, and count paths from every owning article - #147

Closed
Deicyde wants to merge 4 commits into
mainfrom
fix/impact-unowned-and-unused-dependents
Closed

Deicyde wants to merge 4 commits into
mainfrom
fix/impact-unowned-and-unused-dependents

Conversation

@Deicyde

@Deicyde Deicyde commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

This PR restores the work impact fixes that the split of #115 left out and applies the #136-layer parts of the review on #142. It targets split/revision-impact so the changes land before autoform-impact/v1 freezes.

Commit What it does Source
8940cc8 Claims a --declaration no article names like an unowned helper: under every owner's target, or its own lean/<slug>-<digest> key when it has no owner. contained then requires the revised article's target to be the only claim target. Restored from #115's cc36d27, adapted to plural owners
fff95bd Adds unused_statement_dependencies: the stated articles whose Markdown statement rests on the revision through statement edges, but which are not statement-impacted. They join claim_targets and rule out contained. The probe follows names, so it misses a dependent whose Lean inlines a revised definition's body. H7 from #142 (d9f9e94), adapted
0f5d787 Leaves mathlib: true articles out of that list. Their statement is a Mathlib declaration, and the loader refuses to retract them. #142 review item 2 (3bc24df)
70fe798 Counts Markdown paths from every article that a revised declaration belongs to: the revised article, every article naming a revised declaration and, when none names it, its owners. #142 review item 3

Before 70fe798, --declaration X checked paths only from the selected article, which had two failures when X was named by another article T:

  • A stated article whose statement rests on T was neither reported nor claimed.
  • T itself, and the articles that depend on T, were reported as missing a dependency path.

The fff95bd port keeps this layer's plural helper owners, its exact source inventory, and its Markdown, Lean-source and build revision lines. The exact-format test now pins those revision lines (review item 4).

The revision-contract text that says how to handle an unused statement dependency belongs with the contract in the open-statements layer. It goes in the companion PR into split/open-statements.

Tests

  • ruff check is clean.
  • Without Lean, tests/test_impact.py, tests/test_claims.py and tests/test_work.py gave 166 passed, 1 skipped, 1 failed. The failure is test_cas_acquire_race_has_exactly_one_winner, which timed out joining its threads under a load average above 300 and passes when run alone.
  • With real Lean (AUTOFORM_REQUIRE_REAL_LEAN_TESTS=1), tests/test_impact.py gave 66 passed.
  • Mutation check: dropping the owner loop or the anchor exclusion each fails the new test.

`work impact R --declaration X` skipped X when listing helpers, so when no
article named X its claim set held only R's target. Two revisions of the same
unowned helper from different articles then each claimed only their own
article and could both edit X. A revised declaration no article names is now
claimed under every owner's target, or under the `lean/<slug>-<digest>` key an
unowned helper gets, and `contained` holds exactly when the revised article's
target is the only one, so such a revision is never reported as safe to make
in place under R's claim alone.

Restored from closed #115 (cc36d27), which the split omitted, and adapted to
plural helper owners.
The impact probe follows names, so a Markdown statement dependent whose Lean
inlines the revised definition's body instead of naming it was not impacted,
and the revision left it fully proved under the old meaning. The report now
lists unused_statement_dependencies: the stated articles that reach the
revised article through Markdown statement edges, transitively, but are not
statement-impacted. They join claim_targets and keep the revision from being
contained, and the text report prints them on one line.

The README describes the field and what contained now requires. How the
revision contract treats such an article belongs with the contract, in the
open-statements layer.

Restored from closed #115 (d9f9e94) and adapted to this layer's plural
helper owners and Lean source and build revision lines.
A mathlib: true article counts as stated, so one whose Markdown statement
depends on the revised article was reported in unused_statement_dependencies
and claimed, although its statement is a Mathlib declaration that cannot use
the revised one and the loader refuses to retract it.

Restored from closed #115's review follow-ups (3bc24df).
work impact checked Markdown paths only against the selected article. With
--declaration X where another article T names X, or owns it when no article
does, a stated article whose Markdown statement rests on T was neither
reported in unused_statement_dependencies nor claimed, although inlining X
changes its statement, while T and the articles depending on T were reported
as missing a dependency path. Both checks now start from the revised article
and every article naming a revised declaration or, when none names it, owning
it; an unowned declaration adds no article.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 5, 2026
Base automatically changed from split/revision-impact to main October 6, 2026 00:41
@Deicyde

Deicyde commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Replaced by #150: this branch rebased onto the final split/revision-impact head (8f4f5c8), which then merged into main with #136, so #150 targets main. 8940cc8 is dropped because 901f5f8 landed the same claim rule; fff95bd, 0f5d787 and 70fe798 carry over unchanged as 0364e0f, 7a23a94 and e1301c6.

@Deicyde Deicyde closed this Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant