lean-pkg 0.30.1__tar.gz → 0.30.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (350) hide show
  1. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/CHANGELOG.md +44 -0
  2. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/CITATION.cff +5 -2
  3. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/PKG-INFO +1 -1
  4. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/README.md +1 -1
  5. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/pyproject.toml +1 -1
  6. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/__init__.py +1 -1
  7. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/cli.py +3 -3
  8. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/comparator_config.py +11 -4
  9. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/core.py +40 -1
  10. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/coverage.py +30 -4
  11. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/lean_scan.py +20 -2
  12. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/page.py +57 -5
  13. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg.egg-info/PKG-INFO +1 -1
  14. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg.egg-info/SOURCES.txt +1 -0
  15. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_core_split.py +5 -2
  16. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_coverage_accounted.py +88 -0
  17. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_docs.py +2 -0
  18. lean_pkg-0.30.2/tests/test_render_cache.py +83 -0
  19. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_smoke_configs.py +24 -0
  20. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/LICENSE +0 -0
  21. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/MANIFEST.in +0 -0
  22. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/PYPI.md +0 -0
  23. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/setup.cfg +0 -0
  24. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/adapters/__init__.py +0 -0
  25. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/adapters/github.py +0 -0
  26. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/adapters/leansearch.py +0 -0
  27. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/adapters/loogle.py +0 -0
  28. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/adapters/palomar.py +0 -0
  29. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/adapters/reservoir.py +0 -0
  30. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/anchor.py +0 -0
  31. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/audit.py +0 -0
  32. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/binding_file.py +0 -0
  33. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/blueprint.py +0 -0
  34. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/build_scope.py +0 -0
  35. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/ci_github.py +0 -0
  36. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/claim_axioms.py +0 -0
  37. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/claims.py +0 -0
  38. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/claims_mark.py +0 -0
  39. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/cli_parser.py +0 -0
  40. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/command_tree.py +0 -0
  41. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/comparator_contracts.py +0 -0
  42. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/comparator_receipt.py +0 -0
  43. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/comparator_stage.py +0 -0
  44. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/comparator_types.py +0 -0
  45. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/container.py +0 -0
  46. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/controls.py +0 -0
  47. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/data/stacks/lts-2026.10.yaml +0 -0
  48. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/data/toolchain-advisories.yaml +0 -0
  49. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/data/upgrade-breaking.yaml +0 -0
  50. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/data/verify-workflow-pins.yaml +0 -0
  51. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/deps_closure.py +0 -0
  52. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/deps_fill.py +0 -0
  53. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/dup_constants.py +0 -0
  54. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/exercise.py +0 -0
  55. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/exercise_forbid.py +0 -0
  56. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/export_paths.py +0 -0
  57. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/extract.py +0 -0
  58. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/extract_decls.py +0 -0
  59. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/extract_ledger.py +0 -0
  60. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/extract_summary.py +0 -0
  61. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/extract_types.py +0 -0
  62. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/extract_write.py +0 -0
  63. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/formalization.py +0 -0
  64. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/formalization_kept.py +0 -0
  65. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/fresh_repo.py +0 -0
  66. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/gate.py +0 -0
  67. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/headline.py +0 -0
  68. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/help_topics.py +0 -0
  69. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/holes.py +0 -0
  70. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/host_routes.py +0 -0
  71. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/html_blocks.py +0 -0
  72. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/hypotheses.py +0 -0
  73. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/index.py +0 -0
  74. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/json_stdout.py +0 -0
  75. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/lake_hygiene.py +0 -0
  76. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/lean_diag.py +0 -0
  77. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/ledger.py +0 -0
  78. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/next_step.py +0 -0
  79. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/page_html.py +0 -0
  80. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/palomar.py +0 -0
  81. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/palomar_check.py +0 -0
  82. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/port_modules.py +0 -0
  83. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/prior_art.py +0 -0
  84. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/producer.py +0 -0
  85. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/producer_skew.py +0 -0
  86. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/public_safety.py +0 -0
  87. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/publish.py +0 -0
  88. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/rebase.py +0 -0
  89. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/receipt.py +0 -0
  90. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/receipt_check.py +0 -0
  91. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/receipt_ci.py +0 -0
  92. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/receipt_systemd.py +0 -0
  93. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/recommended.py +0 -0
  94. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/report.py +0 -0
  95. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/reservoir.py +0 -0
  96. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/scaffold.py +0 -0
  97. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/schemas/formalization-0.4.schema.json +0 -0
  98. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/schemas/formalization-0.4.schema.source.txt +0 -0
  99. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/scripts/ClaimAxioms.lean +0 -0
  100. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/scripts/ContractsOnly.lean +0 -0
  101. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/scripts/ControlsProbe.lean +0 -0
  102. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/scripts/DupConstants.lean +0 -0
  103. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/scripts/HypProbe.lean +0 -0
  104. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/scripts/comparator-check.sh +0 -0
  105. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/scripts/verify-comparator.sh +0 -0
  106. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/seal_bundle.py +0 -0
  107. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/search.py +0 -0
  108. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/site_check.py +0 -0
  109. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/site_profiles/easley.yaml +0 -0
  110. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/site_profiles/github-actions.yaml +0 -0
  111. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/sites.py +0 -0
  112. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/stacks.py +0 -0
  113. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/statements_module.py +0 -0
  114. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/templates/Apache-2.0.txt +0 -0
  115. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/toolchain_advisories.py +0 -0
  116. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/upgrade.py +0 -0
  117. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg/verify.py +0 -0
  118. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg.egg-info/dependency_links.txt +0 -0
  119. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg.egg-info/entry_points.txt +0 -0
  120. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg.egg-info/requires.txt +0 -0
  121. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/src/lean_pkg.egg-info/top_level.txt +0 -0
  122. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_adapters.py +0 -0
  123. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_append_note.py +0 -0
  124. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_audit_claims_coverage.py +0 -0
  125. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_audit_gh_outcomes.py +0 -0
  126. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_audit_missing_path.py +0 -0
  127. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_audit_no_github_mirror.py +0 -0
  128. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_audit_palomar.py +0 -0
  129. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_audit_receipts_paths.py +0 -0
  130. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_audit_reference_branch.py +0 -0
  131. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_binding_file.py +0 -0
  132. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_binding_file_g3.py +0 -0
  133. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_blueprint_check.py +0 -0
  134. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_bootstrap_collaborator.py +0 -0
  135. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_branch_notice.py +0 -0
  136. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_campaign_recovery_docs.py +0 -0
  137. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_check_changelog_releases.py +0 -0
  138. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_ci_attested.py +0 -0
  139. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_ci_comparator.py +0 -0
  140. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_ci_corroborate.py +0 -0
  141. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_ci_receipt_level1.py +0 -0
  142. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_claim_axioms.py +0 -0
  143. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_claims.py +0 -0
  144. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_claims_ledger.py +0 -0
  145. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_claims_mark.py +0 -0
  146. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_claims_rebase.py +0 -0
  147. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_cli.py +0 -0
  148. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_cli_consistency.py +0 -0
  149. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_cli_contract_argv.py +0 -0
  150. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_cli_contract_corpus.py +0 -0
  151. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_cli_contract_help.py +0 -0
  152. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_cli_contract_json.py +0 -0
  153. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_cli_contract_names.py +0 -0
  154. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_columns.py +0 -0
  155. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_command_docs.py +0 -0
  156. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_command_tree_stage2.py +0 -0
  157. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_commit.py +0 -0
  158. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_comparator.py +0 -0
  159. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_comparator_attempts.py +0 -0
  160. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_comparator_config.py +0 -0
  161. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_comparator_contracts.py +0 -0
  162. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_comparator_coverage.py +0 -0
  163. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_comparator_evidence_dir.py +0 -0
  164. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_comparator_host_label.py +0 -0
  165. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_comparator_list_defaults.py +0 -0
  166. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_comparator_log_transport.py +0 -0
  167. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_comparator_mismatch_next.py +0 -0
  168. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_comparator_name_hints.py +0 -0
  169. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_comparator_no_mathlib.py +0 -0
  170. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_comparator_readiness.py +0 -0
  171. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_comparator_receipt.py +0 -0
  172. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_comparator_replace.py +0 -0
  173. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_comparator_repo_claims_file.py +0 -0
  174. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_comparator_sacct_seal.py +0 -0
  175. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_comparator_stage.py +0 -0
  176. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_comparator_tool_toolchain.py +0 -0
  177. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_comparator_types.py +0 -0
  178. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_comparator_types_deep.py +0 -0
  179. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_compressed_log_bindings.py +0 -0
  180. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_conditional_claims.py +0 -0
  181. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_conditional_closeout.py +0 -0
  182. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_conditional_outputs.py +0 -0
  183. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_consent_dedupe.py +0 -0
  184. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_controls.py +0 -0
  185. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_coverage_conclusion.py +0 -0
  186. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_coverage_extensions.py +0 -0
  187. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_coverage_offline.py +0 -0
  188. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_coverage_witness.py +0 -0
  189. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_cut_release.py +0 -0
  190. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_defaults.py +0 -0
  191. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_docs_classifier_preflight.py +0 -0
  192. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_docs_descendants.py +0 -0
  193. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_docs_old_spellings.py +0 -0
  194. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_doctor.py +0 -0
  195. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_dup_constants.py +0 -0
  196. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_evidence_formalization.py +0 -0
  197. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_exercise.py +0 -0
  198. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_exercise_course.py +0 -0
  199. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_extract_decls.py +0 -0
  200. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_extract_ledger.py +0 -0
  201. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_extract_plan.py +0 -0
  202. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_extract_summary.py +0 -0
  203. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_extract_types.py +0 -0
  204. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_fields_only.py +0 -0
  205. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_formalization.py +0 -0
  206. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_formalization_anchor.py +0 -0
  207. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_formalization_kept.py +0 -0
  208. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_formalization_refresh.py +0 -0
  209. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_formats.py +0 -0
  210. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_fresh_repo.py +0 -0
  211. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_gate.py +0 -0
  212. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_gate_binding.py +0 -0
  213. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_gate_binding_scope.py +0 -0
  214. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_gate_check.py +0 -0
  215. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_gate_check_next.py +0 -0
  216. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_gate_claims.py +0 -0
  217. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_gate_pins.py +0 -0
  218. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_gate_receipt_path.py +0 -0
  219. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_gate_refresh.py +0 -0
  220. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_gate_regate.py +0 -0
  221. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_headline.py +0 -0
  222. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_help_topics.py +0 -0
  223. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_hints_and_time.py +0 -0
  224. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_host_check.py +0 -0
  225. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_host_routes.py +0 -0
  226. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_hypotheses_ledger.py +0 -0
  227. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_hypotheses_probe.py +0 -0
  228. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_ignored_evidence.py +0 -0
  229. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_index_add.py +0 -0
  230. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_index_built_on.py +0 -0
  231. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_index_check.py +0 -0
  232. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_index_claims.py +0 -0
  233. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_index_docs_descendants.py +0 -0
  234. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_index_render.py +0 -0
  235. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_index_schema.py +0 -0
  236. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_init.py +0 -0
  237. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_input_hygiene.py +0 -0
  238. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_internal_claims.py +0 -0
  239. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_json.py +0 -0
  240. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_json_control_chars.py +0 -0
  241. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_json_stdout.py +0 -0
  242. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_judged_as.py +0 -0
  243. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_lake_cache_systemd.py +0 -0
  244. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_lake_hygiene.py +0 -0
  245. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_large_artifacts_recipe.py +0 -0
  246. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_lean_diag.py +0 -0
  247. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_lean_scan_extract.py +0 -0
  248. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_lease.py +0 -0
  249. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_lease_actor.py +0 -0
  250. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_lease_expiry_notice.py +0 -0
  251. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_lease_registry_stamp.py +0 -0
  252. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_ledger_exact_covers.py +0 -0
  253. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_ledger_golden.py +0 -0
  254. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_lifecycle_notes.py +0 -0
  255. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_llms.py +0 -0
  256. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_locking.py +0 -0
  257. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_manuscript_findings.py +0 -0
  258. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_mathlib_none.py +0 -0
  259. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_migrate.py +0 -0
  260. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_migrate_v3.py +0 -0
  261. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_namespace_notes.py +0 -0
  262. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_new.py +0 -0
  263. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_next.py +0 -0
  264. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_noninteractive.py +0 -0
  265. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_olean_manifest.py +0 -0
  266. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_outputs_golden.py +0 -0
  267. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_package_fields.py +0 -0
  268. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_packaging.py +0 -0
  269. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_page.py +0 -0
  270. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_page_repo_head.py +0 -0
  271. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_page_site.py +0 -0
  272. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_palomar_check.py +0 -0
  273. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_palomar_prepare.py +0 -0
  274. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_palomar_snapshot.py +0 -0
  275. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_paper.py +0 -0
  276. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_port_modules.py +0 -0
  277. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_prior_art.py +0 -0
  278. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_producer_skew.py +0 -0
  279. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_promote_audit.py +0 -0
  280. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_promote_scope.py +0 -0
  281. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_public_allow.py +0 -0
  282. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_public_safety.py +0 -0
  283. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_public_safety_gzip.py +0 -0
  284. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_public_safety_long_line_stream.py +0 -0
  285. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_public_safety_scope.py +0 -0
  286. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_publication_hold.py +0 -0
  287. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_publish.py +0 -0
  288. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_receipt_check.py +0 -0
  289. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_receipt_check_opt_in.py +0 -0
  290. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_receipt_ci.py +0 -0
  291. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_receipt_container.py +0 -0
  292. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_receipt_private_scan.py +0 -0
  293. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_receipt_producer.py +0 -0
  294. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_receipt_slurm.py +0 -0
  295. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_receipt_slurm_artifacts.py +0 -0
  296. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_receipt_slurm_contracts_preflight.py +0 -0
  297. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_receipt_slurm_fill_plan.py +0 -0
  298. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_receipt_slurm_preflight_deps.py +0 -0
  299. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_receipt_slurm_runtime_preflight.py +0 -0
  300. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_receipt_slurm_sacct_seal.py +0 -0
  301. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_receipt_slurm_template_src.py +0 -0
  302. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_receipt_subdir_package.py +0 -0
  303. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_receipt_systemd.py +0 -0
  304. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_recommended.py +0 -0
  305. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_record.py +0 -0
  306. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_record_evidence.py +0 -0
  307. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_record_transitions.py +0 -0
  308. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_refresh_descendant.py +0 -0
  309. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_register.py +0 -0
  310. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_registry_core.py +0 -0
  311. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_registry_snapshot.py +0 -0
  312. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_release_script.py +0 -0
  313. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_release_version.py +0 -0
  314. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_repo_override.py +0 -0
  315. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_report.py +0 -0
  316. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_report_log_required.py +0 -0
  317. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_reservoir_check.py +0 -0
  318. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_review_fixes_prior_art.py +0 -0
  319. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_robustness.py +0 -0
  320. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_seal_bundle.py +0 -0
  321. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_search.py +0 -0
  322. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_search_completeness.py +0 -0
  323. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_search_declarations.py +0 -0
  324. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_search_field_coverage.py +0 -0
  325. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_search_scan.py +0 -0
  326. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_search_sources.py +0 -0
  327. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_sibling_packages.py +0 -0
  328. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_signoff_sidecar.py +0 -0
  329. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_site_check.py +0 -0
  330. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_sites.py +0 -0
  331. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_skills.py +0 -0
  332. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_source_paper_ai.py +0 -0
  333. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_stack_opt_in.py +0 -0
  334. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_stacks.py +0 -0
  335. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_statements_module.py +0 -0
  336. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_status_scope.py +0 -0
  337. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_subdir_package.py +0 -0
  338. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_template_module_headers.py +0 -0
  339. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_toolchain_advisories.py +0 -0
  340. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_toolchain_floor.py +0 -0
  341. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_trust.py +0 -0
  342. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_update_publication_fields.py +0 -0
  343. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_update_relocate.py +0 -0
  344. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_upgrade.py +0 -0
  345. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_user_default.py +0 -0
  346. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_validate.py +0 -0
  347. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_verdict_first.py +0 -0
  348. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_verify_preflight.py +0 -0
  349. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_verify_workflow_oidc.py +0 -0
  350. {lean_pkg-0.30.1 → lean_pkg-0.30.2}/tests/test_wiki.py +0 -0
@@ -9,6 +9,48 @@ full policy, and the criteria for 1.0.0, are in RELEASING.md, "When to tag".
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ## [0.30.2] - 2026-12-02
13
+
14
+ ### Changed
15
+
16
+ - `coverage check` (rule R11), `page --check` and `receipt check` accept a
17
+ compared theorem that is the declaration of an `internal` or `reusable`
18
+ claim Lean generates (a structure field, an `@[ext]` lemma) when the
19
+ gate receipt's `claim_axioms` read that declaration from the built
20
+ environment (#463). R11 read only the claim's file, where no line states
21
+ such a declaration: 106 helper theorems of a field report were refused.
22
+ The offline form (`--file`, `verify`'s preflight) has no receipt and is
23
+ unchanged.
24
+
25
+ ### Fixed
26
+
27
+ - The page's smoke-check line no longer says that the smoke theorems
28
+ "state nothing of this package" when some of them name claims of the
29
+ package (a configuration of the package's own helper claims marked as a
30
+ smoke check, 3,270 theorems in a field report): it says how many name
31
+ claims and that a smoke check credits no claim (#462). Counted by name,
32
+ so a declaration Lean generates counts too.
33
+ - `page` (and `site check`, `publish`, which render the page) no longer
34
+ takes hours on a large package (#464). One render read the same files
35
+ and scanned the same Lean text for every claim, and recomputed the
36
+ judged_as names of every claim per theorem: a 6,632-claim companion's
37
+ `page --site` was stopped after 5 h. A render now reads each file and
38
+ scans each text once (`core.render_cache`, scoped to the render) and
39
+ computes the judged_as names once: that page renders in 6 min 45 s, and
40
+ a 268-claim one in 38 s instead of 563 s. Every output is byte-identical.
41
+
42
+ ### Documentation
43
+
44
+ - docs/upgrades/0.30.1: the record of docs-only PR #458 gains its `# Docs:`
45
+ line and the sentence that it was read for this record, which were
46
+ missing at the cut (#460). A documented change to a released page:
47
+ RELEASING.md, "Released records", and a pin in the test.
48
+ - Proposal 0016 (draft): a summary README page block that links the full
49
+ page, chosen in `coverage.yaml`, for companions whose full page is too
50
+ large for a README (#461).
51
+
52
+ public-safety (make public-safety, --strict, history): 0 hit(s) (0 tree, 0 history); 0 blocking, 0 warning(s)
53
+
12
54
  ## [0.30.1] - 2026-11-30
13
55
 
14
56
  ### Changed
@@ -31,6 +73,8 @@ full policy, and the criteria for 1.0.0, are in RELEASING.md, "When to tag".
31
73
 
32
74
  public-safety (make public-safety, --strict, history): 0 hit(s) (0 tree, 0 history); 0 blocking, 0 warning(s)
33
75
 
76
+ Zenodo version DOI: [10.5281/zenodo.24690284](https://doi.org/10.5281/zenodo.24690284)
77
+
34
78
  ## [0.30.0] - 2026-11-21
35
79
 
36
80
  ### Added
@@ -6,8 +6,8 @@ authors:
6
6
  - family-names: Chen
7
7
  given-names: Le
8
8
  affiliation: "Auburn University"
9
- version: "0.30.1"
10
- date-released: "2026-11-30"
9
+ version: "0.30.2"
10
+ date-released: "2026-12-02"
11
11
  license: Apache-2.0
12
12
  repository-code: "https://github.com/lean-pkg/lean-pkg"
13
13
  doi: 10.5281/zenodo.23272098
@@ -213,6 +213,9 @@ identifiers:
213
213
  - type: doi
214
214
  value: 10.5281/zenodo.24432261
215
215
  description: Version DOI for 0.30.0
216
+ - type: doi
217
+ value: 10.5281/zenodo.24690284
218
+ description: Version DOI for 0.30.1
216
219
  url: "https://lean-pkg.github.io/lean-pkg/"
217
220
  keywords:
218
221
  - Lean 4
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lean-pkg
3
- Version: 0.30.1
3
+ Version: 0.30.2
4
4
  Summary: Lifecycle registry and trust gate for Lean 4 formalization packages: leases, receipt-bound gates, comparator (Palomar) evidence, one-way promotion.
5
5
  Author: Le Chen
6
6
  License-Expression: Apache-2.0
@@ -365,7 +365,7 @@ DOIs. To cite a state between releases, cite the repository at a commit:
365
365
  author = {Chen, Le},
366
366
  title = {lean-pkg: a registry and trust gate for Lean 4 formalization packages},
367
367
  year = {2026},
368
- version = {0.30.1},
368
+ version = {0.30.2},
369
369
  url = {https://github.com/lean-pkg/lean-pkg},
370
370
  note = {commit <sha>}
371
371
  }
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "lean-pkg"
7
- version = "0.30.1"
7
+ version = "0.30.2"
8
8
  description = "Lifecycle registry and trust gate for Lean 4 formalization packages: leases, receipt-bound gates, comparator (Palomar) evidence, one-way promotion."
9
9
  # PyPI renders the long description without the repository around it, so README.md's relative links and
10
10
  # images would break there: PYPI.md is a short page whose links are all absolute (tests/test_packaging.py).
@@ -1,3 +1,3 @@
1
1
  """lean-pkg: lifecycle registry and trust gate for Lean 4 formalization packages."""
2
2
 
3
- __version__ = "0.30.1"
3
+ __version__ = "0.30.2"
@@ -147,7 +147,7 @@ from .core import ( # noqa: F401 re-exports, one release (#317)
147
147
  event_line_problems, EVENT_LINE_VERSION, event_line_version, _event_log_problem, EVENTS_ENV, EVENTS_NAME,
148
148
  events_path, events_source, EVIDENCE_EVENTS, evidence_symlinks, Fail, find_reuse, _fingerprint,
149
149
  flush_events, formalization_rel, _GATE_EVENT_KEYS, get_pkg, gh, gh_nwo, git, git_env_set, git_head,
150
- GIT_REPO_ENV, _git_show_bytes, git_show_bytes, GITHUB_URL_RE, _HEX40, HOME, _is_ancestor, is_evidence_path,
150
+ GIT_REPO_ENV, _git_show_bytes, git_show_bytes, _git_show_bytes_uncached, GITHUB_URL_RE, _HEX40, HOME, _is_ancestor, is_evidence_path,
151
151
  is_naive_ts, lake_artifact, LAKE_ARTIFACT_SUFFIXES, LEAN_LIB_RE, lean_pkg_home, LEAN_PKG_HOME_ENV,
152
152
  lean_root_namespaces, lease_actor, LEASE_CONTACT_MAX, _LEASE_EVENT_KEYS, lease_expiry,
153
153
  lease_expiry_or_none, LEASE_FIELDS, lease_invalid, lease_live, lease_live_or_none, LEASE_OPTIONAL_FIELDS,
@@ -161,7 +161,7 @@ from .core import ( # noqa: F401 re-exports, one release (#317)
161
161
  registry_home_dir, registry_lock, registry_not_found, registry_path, registry_snapshot_arg,
162
162
  registry_source, registry_behind_warning, registry_state, registry_state_of, registry_sync_counts, REGISTRY_VERSION, repo_path, report_preexisting, require_nonempty, REQUIRED_FIELDS,
163
163
  RESERVOIR_API, reservoir_listing_status, RESERVOIR_URL_RE, resolve_tree_path, _RESOLVED_SOURCE,
164
- RETRACT_EVENT, retracted_entries, _rev, RULE_HINTS, run, save_registry, scrubbed_env, sha256_bytes,
164
+ render_cache, render_memo, RETRACT_EVENT, retracted_entries, _rev, RULE_HINTS, run, save_registry, scrubbed_env, sha256_bytes,
165
165
  SNAPSHOT_ENV, SNAPSHOT_REFUSAL, split_new_errors, STATUSES, SUPPORTED_REGISTRY_VERSIONS, symlink_targets,
166
166
  tracked_at, TRACKS, _umask, under_any, UPDATABLE, UPDATED_FROM_FIELDS, UPSTREAM_TARGETS, UsageError,
167
167
  user_default_registry, utc_today, V2_PACKAGE_DEFAULTS, V3_PACKAGE_DEFAULTS, VISIBILITIES, warn_lease,
@@ -172,7 +172,7 @@ from . import core as _core
172
172
  # Names core.py rebinds at run time (a `global` statement there): a re-export above would keep the first
173
173
  # object, so lean_pkg.cli reads them from core.py on every access instead (PEP 562 module __getattr__).
174
174
  # tests/test_core_split.py keeps this tuple equal to the `global` statements in core.py.
175
- _CORE_REBOUND = ("_LOADED_PACKAGES",)
175
+ _CORE_REBOUND = ("_LOADED_PACKAGES", "_RENDER_MEMO")
176
176
 
177
177
 
178
178
  def __getattr__(name: str):
@@ -65,12 +65,18 @@ def scaffold_todo_names(cfg: dict, rel: str | None = None, sidecar: dict | None
65
65
 
66
66
 
67
67
  def _components(name: str) -> list[str] | None:
68
- """A Lean name's components, a «quoted» plain identifier unquoted (`«foo»` is `foo`); None when malformed."""
68
+ """A Lean name's components, a «quoted» plain identifier unquoted (`«foo»` is `foo`); None when malformed.
69
+ Memoized inside core.render_cache (the naming rule splits the same names for every claim)."""
70
+ parts = core.render_memo("comparator_config._components", str(name), lambda: _components_tuple(name))
71
+ return None if parts is None else list(parts)
72
+
73
+
74
+ def _components_tuple(name: str) -> tuple[str, ...] | None:
69
75
  parts = lean_scan.split_name(str(name).strip())
70
76
  if parts is None:
71
77
  return None
72
- return [p[1:-1] if p.startswith("«") and re.fullmatch(r"«[A-Za-z_][A-Za-z0-9_'!?]*»", p) else p
73
- for p in parts]
78
+ return tuple(p[1:-1] if p.startswith("«") and re.fullmatch(r"«[A-Za-z_][A-Za-z0-9_'!?]*»", p) else p
79
+ for p in parts)
74
80
 
75
81
 
76
82
  def qualified_decls(read_file, claims: list[dict]) -> set[str]:
@@ -431,12 +437,13 @@ def do_config_from_claims(reg: dict, name: str, out: str, dry_run: bool, namespa
431
437
  existing = skipped = 0
432
438
  added: list[dict] = []
433
439
  sources: list[dict] = []
440
+ mapped = mapped_names(claims) # once, not per claim: it reads every claim
434
441
  for c in claims:
435
442
  decl, cid = str(c.get("decl") or ""), str(c.get("id") or "")
436
443
  if c.get("kind") not in CLAIM_KINDS or c.get("status") == "superseded" or not decl:
437
444
  skipped += 1
438
445
  continue
439
- if claim_covered(configured, c, qualified, mapped_names(claims)) or f"{ns}.{decl}" in configured \
446
+ if claim_covered(configured, c, qualified, mapped) or f"{ns}.{decl}" in configured \
440
447
  or cid in todo_claims:
441
448
  existing += 1
442
449
  continue
@@ -1587,10 +1587,49 @@ def sha256_bytes(b: bytes) -> str:
1587
1587
  return hashlib.sha256(b).hexdigest()
1588
1588
 
1589
1589
 
1590
+ # One render's memo (render_cache): None outside a render, so a long-lived process (the test suite, a
1591
+ # library caller) keeps nothing between renders. A field report: a 6,632-claim companion's page --site did
1592
+ # not finish in 5 h, recomputing the same pure results; with them memoized, about 9 minutes.
1593
+ _RENDER_MEMO: dict | None = None
1594
+
1595
+
1596
+ @contextlib.contextmanager
1597
+ def render_cache():
1598
+ """Memoize, for one page render, the reads and scans it repeats: git_show_bytes, lean_scan._mask and
1599
+ lean_scan.declarations, comparator_config._components. Each is a function of its arguments while the
1600
+ render runs (it commits nothing, so HEAD stays put). Nested scopes share the outermost memo."""
1601
+ global _RENDER_MEMO
1602
+ outer = _RENDER_MEMO
1603
+ if outer is None:
1604
+ _RENDER_MEMO = {}
1605
+ try:
1606
+ yield
1607
+ finally:
1608
+ if outer is None:
1609
+ _RENDER_MEMO = None
1610
+
1611
+
1612
+ def render_memo(kind: str, key, compute):
1613
+ """compute() once per (kind, key) inside render_cache; outside it, every call computes. The caller
1614
+ must return an immutable value or copy a mutable one."""
1615
+ memo = _RENDER_MEMO
1616
+ if memo is None:
1617
+ return compute()
1618
+ table = memo.setdefault(kind, {})
1619
+ if key not in table:
1620
+ table[key] = compute()
1621
+ return table[key]
1622
+
1623
+
1590
1624
  def git_show_bytes(repo: pathlib.Path, rel: str, rev: str = "HEAD") -> bytes | None:
1591
1625
  """Bytes of <rev>:<rel>, or None when the path is not tracked there. `rel` is relative to the
1592
1626
  package directory `repo`, which may be a subdirectory of its git repository: a bare `rel` is read
1593
- as `./rel` (git resolves a bare `<rev>:<path>` from the repository root, #21.2)."""
1627
+ as `./rel` (git resolves a bare `<rev>:<path>` from the repository root, #21.2). Memoized inside
1628
+ render_cache."""
1629
+ return render_memo("git_show_bytes", (str(repo), str(rel), str(rev)), lambda: _git_show_bytes_uncached(repo, rel, rev))
1630
+
1631
+
1632
+ def _git_show_bytes_uncached(repo: pathlib.Path, rel: str, rev: str) -> bytes | None:
1594
1633
  spec = rel if rel.startswith(("./", "../")) else f"./{rel}"
1595
1634
  p = subprocess.run(["git", "-C", str(repo), "show", f"{rev}:{spec}"],
1596
1635
  capture_output=True, env=scrubbed_env())
@@ -971,13 +971,14 @@ def check_against(doc: dict, claims: dict[str, dict], claims_rel: str, repo: pat
971
971
 
972
972
 
973
973
  def theorem_mapping_problems(doc: dict, claims: dict[str, dict], configs: list[dict], smoke, read_file,
974
- source: str) -> list[str]:
974
+ source: str, built: frozenset[str] | set[str] = frozenset()) -> list[str]:
975
975
  """R10/R11: every theorem of `configs` ({path, theorem_names} each) is the declaration of a claim some row
976
976
  names, or of a claim claims.yaml marks internal or reusable (ACCOUNTED_STATUSES: a supporting lemma the
977
977
  package declares as such needs no row), unless its configuration is a declared smoke check (its path in
978
978
  `smoke`), whose theorems must then name no claim a row names. `read_file(rel)` reads the claims' Lean files
979
- (a decl counts only when its file declares it: comparator_config.qualified_decls); `source` says where the
980
- configurations came from."""
979
+ (a decl counts only when its file declares it: comparator_config.qualified_decls, or when it is in `built`,
980
+ the decls the gate receipt's claim_axioms read from the built environment: built_decls); `source` says
981
+ where the configurations came from."""
981
982
  from . import comparator_config as cc
982
983
  errors: list[str] = []
983
984
  named = [(i, cid) for i, r in enumerate(doc["rows"]) for cid in r.get("claims") or [] if cid in claims]
@@ -987,6 +988,8 @@ def theorem_mapping_problems(doc: dict, claims: dict[str, dict], configs: list[d
987
988
  accounted = row_claims + [c for _cid, c in others if c.get("status") in ACCOUNTED_STATUSES]
988
989
  unaccounted = [(cid, c) for cid, c in others if c.get("status") not in ACCOUNTED_STATUSES]
989
990
  qualified = cc.qualified_decls(read_file, row_claims + [c for _cid, c in others])
991
+ # a declaration Lean generates (a structure field, an @[ext] lemma) is in no file's text, but the build has it
992
+ qualified |= {d for c in claims.values() for d in [str(c.get("decl") or "")] if d and d in built}
990
993
  decls = [(str(c.get("decl") or ""), str(c.get("decl") or "") in qualified) for c in accounted]
991
994
  mapped = cc.mapped_names(list(claims.values())) # a judged_as name judges its own claim only (#CM)
992
995
  for c in configs:
@@ -1019,6 +1022,27 @@ def theorem_mapping_problems(doc: dict, claims: dict[str, dict], configs: list[d
1019
1022
  return errors
1020
1023
 
1021
1024
 
1025
+ def built_decls(repo: pathlib.Path, lower: dict | None) -> frozenset[str]:
1026
+ """The claim decls the gate (lower-tier) receipt's claim_axioms read from the built environment: every
1027
+ decl of claims.yaml at the receipt's commit that is not in its `missing` list. The probe that writes the
1028
+ key must cover every claim of that claims.yaml (claim_axioms.judge refuses a log that skips one), so a decl
1029
+ counts only when the summary's `checked` agrees with that count. Empty when the receipt has no claim_axioms,
1030
+ names no commit, or anything does not add up: R11 then reads the claims' files alone, as before."""
1031
+ from . import claim_axioms
1032
+ ca = (lower or {}).get("claim_axioms")
1033
+ commit = str((lower or {}).get("commit") or "")
1034
+ if not isinstance(ca, dict) or not core._HEX40.fullmatch(commit):
1035
+ return frozenset()
1036
+ missing, checked = ca.get("missing"), ca.get("checked")
1037
+ if not isinstance(missing, list) or not isinstance(checked, int) or isinstance(checked, bool):
1038
+ return frozenset()
1039
+ required, problems = claim_axioms.required_claims(core.git_show_bytes(repo, "claims.yaml", commit))
1040
+ found = [d for d in required if d not in set(map(str, missing))]
1041
+ if problems or not required or checked != len(found):
1042
+ return frozenset()
1043
+ return frozenset(found)
1044
+
1045
+
1022
1046
  def scope_problems(pkg: dict, doc: dict, claims: dict[str, dict], repo: pathlib.Path) -> list[str]:
1023
1047
  """The lab's lean-scope-page rules that apply to a rendered page (docs/page.md#from-lean-scope-page):
1024
1048
  R8/R9, every claim a row names has its `file` committed at HEAD (the page links the declaration
@@ -1047,8 +1071,10 @@ def scope_problems(pkg: dict, doc: dict, claims: dict[str, dict], repo: pathlib.
1047
1071
  return errors
1048
1072
  smoke = cc.smoke_configs(repo, str(comp.get("commit") or "") if core._HEX40.fullmatch(
1049
1073
  str(comp.get("commit") or "")) else None, "HEAD")
1074
+ gate_rel = (pkg.get("gate") or {}).get("receipt")
1075
+ lower, _raw = receipt_at_head(repo, gate_rel) if gate_rel else (None, None)
1050
1076
  errors += theorem_mapping_problems(doc, claims, configs, smoke, claims_mod._reader(repo, "HEAD"),
1051
- "recorded comparator receipt")
1077
+ "recorded comparator receipt", built_decls(repo, lower))
1052
1078
  for c in configs:
1053
1079
  where = c.get("path") or "?"
1054
1080
  if where in smoke:
@@ -84,7 +84,19 @@ def is_name(name) -> bool:
84
84
  # masking: comments and strings become spaces (newlines kept), docstrings are remembered
85
85
 
86
86
  def _mask(text: str) -> tuple[str, list[tuple[int, int, str]]]:
87
- """(text with comments, docstrings and string literals blanked, [(start, end, docstring text)])."""
87
+ """(text with comments, docstrings and string literals blanked, [(start, end, docstring text)]).
88
+ Memoized inside core.render_cache (one page render scans the same Challenge file for every claim)."""
89
+ from . import core
90
+ masked, docs = core.render_memo("lean_scan._mask", text, lambda: _mask_tuple(text))
91
+ return masked, list(docs)
92
+
93
+
94
+ def _mask_tuple(text: str) -> tuple[str, tuple[tuple[int, int, str], ...]]:
95
+ masked, docs = _mask_text(text)
96
+ return masked, tuple(docs)
97
+
98
+
99
+ def _mask_text(text: str) -> tuple[str, list[tuple[int, int, str]]]:
88
100
  out = list(text)
89
101
  docs: list[tuple[int, int, str]] = []
90
102
  n, i = len(text), 0
@@ -243,7 +255,13 @@ def declarations(text: str) -> list[tuple[int, str, str, str | None, str, str]]:
243
255
  """(line, keyword, qualified name, docstring or None, stripped source line, name as written) for every
244
256
  declaration. `class inductive` and `class abbrev` report keyword `class`; an anonymous instance is left
245
257
  out; a `_root_.` name is not prefixed with the namespace. Scopes are kept one name component at a
246
- time, as Lean keeps them; a keyword on a line inside a syntax quotation declares nothing."""
258
+ time, as Lean keeps them; a keyword on a line inside a syntax quotation declares nothing. Memoized inside
259
+ core.render_cache."""
260
+ from . import core
261
+ return list(core.render_memo("lean_scan.declarations", text, lambda: tuple(_declarations(text))))
262
+
263
+
264
+ def _declarations(text: str) -> list[tuple[int, str, str, str | None, str, str]]:
247
265
  masked, docs = _mask(text)
248
266
  lines = text.splitlines()
249
267
  starts, off = [], 0
@@ -455,6 +455,7 @@ def _context(pkg: dict, repo, allow_private: bool, override: dict | None = None)
455
455
  "led": ledger_mod.ledger_for(pkg, "promote"), "gate": gate, "evidence": ev_rows, "lower": lower,
456
456
  "comp": comp, "backed": backed, "sites": profiles, "cite": citation(pkg, repo), "license": license_file(pkg, repo),
457
457
  "https": https, "prefix": prefix, "bound": bound, "configs": configs, "qualified": qualified,
458
+ "mapped": cc.mapped_names(list(claims.values())), # once per render: it reads every claim
458
459
  "smoke": smoke,
459
460
  "anchor": anchor, "preview": view if preview else None, "invalid": view if invalid else None,
460
461
  "repo_view": view,
@@ -524,6 +525,39 @@ def _smoke_line(cfgs: list[dict], smoke: dict) -> str:
524
525
  f"({_md(smoke[c['path']])})" for c in cfgs)
525
526
 
526
527
 
528
+ def _smoke_claim_names(cfgs: list[dict], claims: list[dict]) -> tuple[int, int]:
529
+ """(theorems of the smoke configurations that name a claim, all of them). A theorem names a claim when it is
530
+ the claim's `judged_as`, its `decl`, or `<Prefix>.<decl>`: the naming rule of `comparator_config.covers`, by
531
+ name only, so a declaration Lean generates (a structure field) counts too. The page only describes them;
532
+ nothing is credited."""
533
+ from . import comparator_config as cc
534
+ judged = {j for c in claims for j in [cc.judged_name(c)] if j}
535
+ by_last: dict[str, set[tuple[str, ...]]] = {}
536
+ for c in claims:
537
+ want = cc._components(str(c.get("decl") or ""))
538
+ if want:
539
+ by_last.setdefault(want[-1], set()).add(tuple(want))
540
+ names = {t for c in cfgs for t in _names(c.get("theorem_names"))}
541
+ hits = 0
542
+ for t in names:
543
+ have = cc._components(t)
544
+ if t in judged or (have and any(len(have) >= len(w) and tuple(have[-len(w):]) == w
545
+ for w in by_last.get(have[-1], ()))):
546
+ hits += 1
547
+ return hits, len(names)
548
+
549
+
550
+ def _smoke_sentence(cfgs: list[dict], claims: list[dict]) -> str:
551
+ """What the smoke-check line says about its theorems. 'It states nothing of this package' is true only when
552
+ none of them names a claim; a package may mark its own helper claims' configuration as a smoke check."""
553
+ hits, total = _smoke_claim_names(cfgs, claims)
554
+ lead = "Each passed the comparison like the others, to show the comparator set-up works"
555
+ if not hits:
556
+ return f"{lead}; it states nothing of this package and verifies no result on this page."
557
+ return (f"{lead}. {hits} of these {total} theorem(s) name claims of this package (`claims.yaml`); a smoke "
558
+ f"check credits no claim and verifies no result on this page.")
559
+
560
+
527
561
  def _hole_text(c: dict) -> str:
528
562
  from .holes import receipt_judged
529
563
  holes = _names(c.get("definition_names"))
@@ -564,8 +598,7 @@ def _lean_statement(ctx: dict, cid: str) -> dict:
564
598
  if cfg.get("path") in ctx.get("smoke", {}): # a smoke check states no result
565
599
  continue
566
600
  for t in cfg.get("theorem_names") or []:
567
- if isinstance(t, str) and cc.claim_covered({t}, c, ctx["qualified"],
568
- cc.mapped_names(list(ctx["claims"].values()))):
601
+ if isinstance(t, str) and cc.claim_covered({t}, c, ctx["qualified"], ctx["mapped"]):
569
602
  rel = module_path(cfg.get("challenge_module"))
570
603
  src = read(rel)
571
604
  text = lean_scan.statement(src, t) if src else None
@@ -1163,9 +1196,8 @@ def _body_rest(ctx: dict, target: str, md: list[str], counts: dict | None, n_ver
1163
1196
  f"{', '.join(f'`{a}`' for a in permitted) or 'none'}; definitions compared by name only: "
1164
1197
  f"{_holes_line(configs)}.")
1165
1198
  if smoke_cfgs:
1166
- md.append(f"- Smoke checks (not results): {_smoke_line(smoke_cfgs, smoke)}. Each passed the comparison "
1167
- f"like the others, to show the comparator set-up works; it states nothing of this package "
1168
- f"and verifies no result on this page.")
1199
+ md.append(f"- Smoke checks (not results): {_smoke_line(smoke_cfgs, smoke)}. "
1200
+ f"{_smoke_sentence(smoke_cfgs, list(ctx['claims'].values()))}")
1169
1201
  md += _stack_lines(doc, repo, warnings)
1170
1202
  md.append("")
1171
1203
  ev_rows = ctx["evidence"]
@@ -1385,6 +1417,14 @@ def _scan(pkg: dict, repo, outputs: dict[str, str]) -> None:
1385
1417
  def render_all(pkg: dict, repo, allow_private: bool = False, advisories: bool = True,
1386
1418
  override: dict | None = None, corroborator: Corroborator | None = None
1387
1419
  ) -> tuple[dict[str, str], dict, list[str]]:
1420
+ """See _render_all; it runs inside one core.render_cache (shared with an enclosing one)."""
1421
+ with core.render_cache():
1422
+ return _render_all(pkg, repo, allow_private, advisories, override, corroborator)
1423
+
1424
+
1425
+ def _render_all(pkg: dict, repo, allow_private: bool = False, advisories: bool = True,
1426
+ override: dict | None = None, corroborator: Corroborator | None = None
1427
+ ) -> tuple[dict[str, str], dict, list[str]]:
1388
1428
  """({'readme': block, 'verification.md', 'coverage.md', 'html'}: every output, each with a final
1389
1429
  newline; the facts for --json; warnings). One context feeds them all; all are scanned together.
1390
1430
  advisories=False leaves the toolchain advisory lines out: the baseline `--check` compares against.
@@ -1605,6 +1645,18 @@ def do_page(reg: dict, name: str, *, write: bool, check: bool, out: str | None,
1605
1645
  repo_arg: str | None = None, strict_preview: bool = False, corroborate: bool = False,
1606
1646
  fetch=None, attested: bool = False,
1607
1647
  trusted_root: str | None = None) -> tuple[list[str], dict, list[str], int]:
1648
+ """The page command: its renders and checks share one core.render_cache."""
1649
+ with core.render_cache():
1650
+ return _do_page(reg, name, write=write, check=check, out=out, allow_private=allow_private, agent=agent,
1651
+ site=site, html=html, repo_arg=repo_arg, strict_preview=strict_preview,
1652
+ corroborate=corroborate, fetch=fetch, attested=attested, trusted_root=trusted_root)
1653
+
1654
+
1655
+ def _do_page(reg: dict, name: str, *, write: bool, check: bool, out: str | None, allow_private: bool,
1656
+ agent: str | None, site: str | None = None, html: str | None = None,
1657
+ repo_arg: str | None = None, strict_preview: bool = False, corroborate: bool = False,
1658
+ fetch=None, attested: bool = False,
1659
+ trusted_root: str | None = None) -> tuple[list[str], dict, list[str], int]:
1608
1660
  if sum(map(bool, (write, check, out))) > 1:
1609
1661
  raise core.UsageError("--write, --check and --out are mutually exclusive")
1610
1662
  from .receipt_check import attested_usage
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lean-pkg
3
- Version: 0.30.1
3
+ Version: 0.30.2
4
4
  Summary: Lifecycle registry and trust gate for Lean 4 formalization packages: leases, receipt-bound gates, comparator (Palomar) evidence, one-way promotion.
5
5
  Author: Le Chen
6
6
  License-Expression: Apache-2.0
@@ -307,6 +307,7 @@ tests/test_registry_core.py
307
307
  tests/test_registry_snapshot.py
308
308
  tests/test_release_script.py
309
309
  tests/test_release_version.py
310
+ tests/test_render_cache.py
310
311
  tests/test_repo_override.py
311
312
  tests/test_report.py
312
313
  tests/test_report_log_required.py
@@ -110,8 +110,11 @@ def test_a_name_core_rebinds_is_read_through_from_cli(env):
110
110
  # read each one from core.py (its __getattr__), or lean_pkg.cli would keep the first object
111
111
  rebinds = {name for node in ast.walk(ast.parse((SRC / "core.py").read_text()))
112
112
  if isinstance(node, ast.Global) for name in node.names}
113
- assert rebinds == set(cli._CORE_REBOUND) == {"_LOADED_PACKAGES"}
114
- assert "_LOADED_PACKAGES" not in vars(cli) # not a re-export: read through
113
+ assert rebinds == set(cli._CORE_REBOUND) == {"_LOADED_PACKAGES", "_RENDER_MEMO"}
114
+ assert "_LOADED_PACKAGES" not in vars(cli) and "_RENDER_MEMO" not in vars(cli) # read through
115
+ with core.render_cache(): # rebinds core._RENDER_MEMO to a fresh memo
116
+ assert cli._RENDER_MEMO is core._RENDER_MEMO is not None
117
+ assert cli._RENDER_MEMO is None
115
118
  reg = cli.load_registry(env.registry) # rebinds core._LOADED_PACKAGES to reg["packages"]
116
119
  assert core._LOADED_PACKAGES is reg["packages"]
117
120
  assert cli._LOADED_PACKAGES is core._LOADED_PACKAGES
@@ -109,3 +109,91 @@ def test_a_smoke_configuration_is_unchanged():
109
109
  def test_accounted_statuses_are_internal_and_reusable_only():
110
110
  from lean_pkg.claims import CLAIM_STATUSES
111
111
  assert set(cov.ACCOUNTED_STATUSES) == {"internal", "reusable"} <= set(CLAIM_STATUSES)
112
+
113
+
114
+ # --- a declaration Lean generates: in no file's text, but in the built environment (LO field report) -----------
115
+
116
+ GENERATED = "Demo.Good.smooth" # a structure field: `structure Good ... smooth : ...` declares no such line
117
+
118
+
119
+ def _claims_generated(status: str = "internal") -> dict:
120
+ return {**_claims("internal"), "beta/good-smooth": {"decl": GENERATED, "file": "Demo/Main.lean", "status": status}}
121
+
122
+
123
+ def test_a_generated_internal_claim_counts_when_the_build_has_it():
124
+ """R11 reads a claim's file to see that it declares the decl; a field projection or an @[ext] lemma is
125
+ declared by Lean, not by a line of the file. The gate receipt's claim_axioms read it from the built
126
+ environment (`built`), and that is enough."""
127
+ read = {"Demo/Main.lean": LEAN}.get
128
+ cfgs = [{"path": "helpers.json", "theorem_names": [f"BetaAudit.{GENERATED}"]}]
129
+ errs = cov.theorem_mapping_problems(_doc(), _claims_generated(), cfgs, set(), read, "t")
130
+ assert len(errs) == 1 and "of no claim a row names and of no internal or reusable claim" in errs[0]
131
+ assert cov.theorem_mapping_problems(_doc(), _claims_generated(), cfgs, set(), read, "t",
132
+ frozenset({GENERATED})) == []
133
+
134
+
135
+ def test_the_built_environment_credits_no_other_claim():
136
+ read = {"Demo/Main.lean": LEAN}.get
137
+ cfgs = [{"path": "helpers.json", "theorem_names": [f"BetaAudit.{GENERATED}"]}]
138
+ errs = cov.theorem_mapping_problems(_doc(), _claims_generated("experimental"), cfgs, set(), read, "t",
139
+ frozenset({GENERATED}))
140
+ assert len(errs) == 1 and "whose status is 'experimental'" in errs[0]
141
+ cfgs = [{"path": "helpers.json", "theorem_names": ["BetaAudit.Demo.orphan"]}]
142
+ errs = cov.theorem_mapping_problems(_doc(), _claims_generated(), cfgs, set(), read, "t",
143
+ frozenset({GENERATED, "Demo.orphan"}))
144
+ assert len(errs) == 1 and "'BetaAudit.Demo.orphan'" in errs[0] # a built name that is no claim's decl
145
+
146
+
147
+ def _git(repo, *args) -> str:
148
+ import subprocess
149
+ return subprocess.run(["git", "-C", str(repo), "-c", "user.name=t", "-c", "user.email=t@example.org",
150
+ *args], check=True, capture_output=True, text=True).stdout.strip()
151
+
152
+
153
+ def _claims_file(*decls: str) -> str:
154
+ return "schema: claims/1\npackage: beta\nclaims:\n" + "".join(
155
+ f"- id: beta/c{i}\n decl: {d}\n kind: lemma\n file: Demo/Main.lean\n status: internal\n"
156
+ for i, d in enumerate(decls))
157
+
158
+
159
+ def test_built_decls_reads_the_receipts_claim_axioms_against_claims_at_its_commit(tmp_path):
160
+ _git(tmp_path, "init", "-q")
161
+ (tmp_path / "claims.yaml").write_text(_claims_file("Demo.foo_le_bar", GENERATED))
162
+ _git(tmp_path, "add", "claims.yaml")
163
+ _git(tmp_path, "commit", "-q", "-m", "claims")
164
+ commit = _git(tmp_path, "rev-parse", "HEAD")
165
+ rec = {"commit": commit, "claim_axioms": {"checked": 2, "nonstandard": [], "missing": []}}
166
+ assert cov.built_decls(tmp_path, rec) == {"Demo.foo_le_bar", GENERATED}
167
+ rec["claim_axioms"] = {"checked": 1, "nonstandard": [], "missing": [GENERATED]}
168
+ assert cov.built_decls(tmp_path, rec) == {"Demo.foo_le_bar"}
169
+ for bad in ({"checked": 3, "nonstandard": [], "missing": []}, # does not add up: trust nothing
170
+ {"checked": True, "nonstandard": [], "missing": []},
171
+ {"checked": 2, "nonstandard": []}):
172
+ assert cov.built_decls(tmp_path, {"commit": commit, "claim_axioms": bad}) == frozenset()
173
+ assert cov.built_decls(tmp_path, {"commit": commit}) == frozenset() # no claim_axioms
174
+ assert cov.built_decls(tmp_path, {"commit": commit[:12], "claim_axioms": rec["claim_axioms"]}) == frozenset()
175
+ assert cov.built_decls(tmp_path, None) == frozenset()
176
+
177
+
178
+ def test_scope_problems_takes_the_built_environment_from_the_gate_receipt(tmp_path):
179
+ (tmp_path / "Demo").mkdir()
180
+ (tmp_path / "Demo" / "Main.lean").write_text(LEAN)
181
+ (tmp_path / "claims.yaml").write_text(_claims_file("Demo.foo_le_bar", GENERATED))
182
+ _git(tmp_path, "init", "-q")
183
+ _git(tmp_path, "add", "-A")
184
+ _git(tmp_path, "commit", "-q", "-m", "package")
185
+ commit = _git(tmp_path, "rev-parse", "HEAD")
186
+ (tmp_path / ".lean-receipts").mkdir()
187
+ comp = {"commit": commit, "configs": [{"path": "helpers.json", "theorem_names": [f"BetaAudit.{GENERATED}"]}]}
188
+ (tmp_path / ".lean-receipts" / "c.json").write_text(json.dumps(comp))
189
+ lower = {"commit": commit, "claim_axioms": {"checked": 2, "nonstandard": [], "missing": []}}
190
+ (tmp_path / ".lean-receipts" / "g.json").write_text(json.dumps(lower))
191
+ _git(tmp_path, "add", "-A")
192
+ _git(tmp_path, "commit", "-q", "-m", "receipts")
193
+ doc = {"rows": [{"claims": ["beta/c0"]}]}
194
+ claims = {"beta/c0": {"decl": "Demo.foo_le_bar", "file": "Demo/Main.lean", "status": "reusable"},
195
+ "beta/c1": {"decl": GENERATED, "file": "Demo/Main.lean", "status": "internal"}}
196
+ pkg = {"gate": {"comparator": ".lean-receipts/c.json", "receipt": ".lean-receipts/g.json"}}
197
+ assert [e for e in cov.scope_problems(pkg, doc, claims, tmp_path) if GENERATED in e] == []
198
+ pkg = {"gate": {"comparator": ".lean-receipts/c.json"}} # no gate receipt: the file rule alone
199
+ assert any(GENERATED in e for e in cov.scope_problems(pkg, doc, claims, tmp_path))
@@ -106,6 +106,8 @@ def test_no_relative_md_link_text_crosses_lines():
106
106
  _RELEASED_PAGE_ALLOWED = {
107
107
  "0.19.0": ("834ac6d718b6dcbbe8c93d259c5dd81bcf674c753db7ef4b88341e3e7cf926ac",
108
108
  "7e89a88 removed a duplicate #285 row after the release"),
109
+ "0.30.1": ("1c9cb82ca4c52b45e73c29b309d8518b92aa8e1e3b8a6fbd2bdc82fb16e53d4f",
110
+ "#460 added the missing sentence that PR #458 was read for this record"),
109
111
  }
110
112
 
111
113