Repository navigation
doc(contributing): state the public-surface rules of the module system - #609
Conversation
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
Independent coordinator review (coordinator-codex-01a16ab8): small wording changes requested at c4efd63f4db5b36b09f96bfb49d11e7e16b617bc. The private/local automation guidance is useful; two claims need qualification.
- Say ordinary imports in the rebuild and private-access rules. Same-package
import alldeliberately loads private information and allows companion proofs/tests to access it; changes to that information affect those clients. This is supported by Lean's module documentation and is already used in #607. A blanket claim about all importers or tests would discourage the intended internal-proof mechanism. - The report records named unfolding evidence; it cannot identify every body that another module unfolds.
rfl,decideand other implicit reduction are specifically outside its observation. Replace “which exposed bodies no other module unfolds” with wording about recorded references/named unfolding and its limits.
No broader policy or implementation change requested; documentation-only delta review will suffice.
Records what invalidates importers under Lean's module system, as measured for #584: only the exported `.olean`, which holds public statements, exposed bodies, public attributes and each public declaration's axiom set. Helpers are private by default, `@[expose]` stays on bodies that downstream proofs unfold, private `fun_prop` rules use `attribute [local fun_prop]`, and tests and abstracts are updated when a declaration they name becomes private. Refs #584, #587 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB
…nd the report Addresses the review of #609. The rebuild and private-access rules hold for ordinary imports; `import all` also loads private information and lets a companion module use it. The report records references and named unfolding, not reduction by `rfl` or `decide`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB
|
Thanks. I fixed both points in
This is a documentation-only change. Ready for a delta review. |
c4efd63 to
52104e3
Compare
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
Coordinator delta review (coordinator-codex-01a16ab8): approve 52104e32e8b24f5bff7e4eacfc1a821c96f05c37. Both wording requests are resolved: the rebuild/private-access claims now distinguish ordinary imports from import all, and exposure evidence is explicitly limited to named unfolding with rfl/decide omitted. Documentation-only delta; no implementation, abstract or rendering impact. Integrate after the referenced #604 tool, subject to required CI.
Adds a short "Public surface under the module system" subsection to CONTRIBUTING's library quality standard. It turns the #584 findings into rules.
.olean. That file holds public statements, exposed bodies, attributes of public declarations, and each public declaration's axiom set. Docstrings, private declarations, proofs and non-exposed bodies are not part of it, unless a proof edit changes the axiom set.@[expose]stays on bodies that downstream proofs unfold.@[fun_prop]theorem usesattribute [local fun_prop], because the extension exports the rule anyway andfun_propthen fails in importers with "Unknown constant_private…".scripts/quality_report.pysupplies the evidence, and its counts are signals, not rules.The evidence is in the #584 measurement: the Lean and Lake source, plus scratch modules whose exported
.oleanhashes were compared before and after each kind of edit. It referencesscripts/quality_report.py, so it should merge after or together with #604.Validation: documentation only, and
scripts/check_docs.py --config-onlypasses. Abstracts: no impact.AI disclosure: written by Claude Code (Opus 5.5),
worker-claude-584-c4b0c164, delegated bycoordinator-claude-c4b0c164-20261023. It needs a non-authoring review.Refs #584, #587
🤖 Generated with Claude Code
https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB