Skip to content

reassemble: dependency-aware deletion, per-unit neighbour pruning, combo audit - #31

Merged
ppotapov-aws merged 1 commit into
mainfrom
reassemble-param-audit
Sep 2, 2026
Merged

ppotapov-aws merged 1 commit into
mainfrom
reassemble-param-audit

Conversation

@ppotapov-aws

@ppotapov-aws ppotapov-aws commented Sep 2, 2026 •

Copy link
Copy Markdown
Collaborator

Audit every lean_reassemble parameter combination and make each either well-defined or explicitly rejected — never a silent wrong/misleading result.

Behavior:

  • Add a shared dependency-conflict detector (Rewrite.lean: deletedNames / danglingReferences / dependencyConflictMessage) over records' direct deps. materialize-repo and materialize-units now fail fast — naming each dependent -> deleted pair — when a surviving declaration would be left referencing a deleted theorem, instead of an opaque lake break (or, under a scoped --build-target, a false "passed"). A sorry dependent is correctly treated as safe (its references are holed out).
  • materialize-units: a manifest delete on a same-module neighbour now removes that declaration from each unit's file (target still holed, other neighbours kept), with the same conflict check scoped per module. A keep target is excluded with a warning, and a run that yields zero tasks (e.g. whole-run --proofs delete/keep) now fails instead of writing verification: passed over nothing.
  • Reject the inert --keep-eval / --in-process for materialize-units. Record the exact lake build <target> command in the repo manifest.json verification so a scoped verification is not mistaken for a whole-project one.

Docs: reassemble/docs/parameter-matrix.md (the full spec), linked from the README; usage text updated.

Tests: new TestProject/Fixture/Deps.lean + records-deps.jsonl (a real theorem->theorem edge the old fixtures lacked); pure danglingReferences tests, the three audit regressions, and units neighbour-pruning in ReassembleTests.lean.

…mbo audit

Audit every lean_reassemble parameter combination and make each either
well-defined or explicitly rejected — never a silent wrong/misleading result.

Behavior:
- Add a shared dependency-conflict detector (Rewrite.lean: deletedNames /
  danglingReferences / dependencyConflictMessage) over records' direct `deps`.
  materialize-repo and materialize-units now fail fast — naming each
  `dependent -> deleted` pair — when a surviving declaration would be left
  referencing a deleted theorem, instead of an opaque `lake` break (or, under a
  scoped --build-target, a false "passed"). A `sorry` dependent is correctly
  treated as safe (its references are holed out).
- materialize-units: a manifest `delete` on a same-module neighbour now removes
  that declaration from each unit's file (target still holed, other neighbours
  kept), with the same conflict check scoped per module. A `keep` target is
  excluded with a warning, and a run that yields zero tasks (e.g. whole-run
  --proofs delete/keep) now fails instead of writing verification: passed over
  nothing.
- Reject the inert --keep-eval / --in-process for materialize-units. Record the
  exact `lake build <target>` command in the repo manifest.json verification so a
  scoped verification is not mistaken for a whole-project one.

Docs: reassemble/docs/parameter-matrix.md (the full spec), linked from the README;
usage text updated.

Tests: new TestProject/Fixture/Deps.lean + records-deps.jsonl (a real
theorem->theorem edge the old fixtures lacked); pure danglingReferences tests, the
three audit regressions, and units neighbour-pruning in ReassembleTests.lean.
@ppotapov-aws ppotapov-aws changed the title reassemble: dependency-aware deletion, per-unit neighbour pruning, co… reassemble: dependency-aware deletion, per-unit neighbour pruning, combo audit Sep 2, 2026
@ppotapov-aws
ppotapov-aws merged commit 87dc16b into main Sep 2, 2026
5 checks passed
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