Skip to content

Commit 65bfbc3

Browse files
authored
Merge pull request #459 from facebookresearch/fix/454-followups
Follow up #454: Mathlib row wording, example and test pins
2 parents 7a52246 + aa3865c commit 65bfbc3

3 files changed

Lines changed: 10 additions & 9 deletions

File tree

‎autoform_cli/README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ An article asserts only facts a human or agent verified:
220220
| `statement: retracted` | A revision retracted the statement while `lean:` still names the old declaration, which stays in the build until Formalize restates the article and records `statement: formalized` in its place. Requires `lean:`; invalid with `proof: formalized` or `mathlib: true`. CI's `autoform check` at an older `AUTOFORM_REF` rejects the marker, so move the pin first; until then, retract by removing `statement` and `proof` and keeping `lean:`. |
221221
| `proof: formalized` | The Lean proof compiles. Requires `statement: formalized` and `lean:`. Under the open policy it may rest on open statements, and the article is then conditional; only the derived `fully_proved` means complete and `sorry`-free. |
222222
| `mathlib: true` | The result is upstreamed into Mathlib. |
223-
| `mathlib_declaration: add_comm` | Mathlib name(s) the article restates; `audit` requires one on a `mathlib: true` article. Render shows each on the article's page as text, without a link, since nothing checks it against the pinned Mathlib. |
224-
| `mathlib_file: Mathlib/Algebra/Group/Defs.lean` | The Mathlib file that declares it, as a portable relative path; `search` reports it. |
223+
| `mathlib_declaration: Nat.exists_infinite_primes` | Mathlib name(s) the article restates; `audit` requires one on a `mathlib: true` article. Render lists each in a Mathlib row of the article's statement box, as text without a link, since nothing checks it against the pinned Mathlib. |
224+
| `mathlib_file: Mathlib/Data/Nat/Prime/Infinite.lean` | The Mathlib file that declares the `mathlib_declaration` name(s), as a portable relative path; `search` reports it. |
225225
| `not_ready: true` | Needs more blueprint work before it can be attempted. |
226226
| `lean: Ns.decl` | Declaration name(s) that discharge the article. |
227227
| `discussion: 42` | Issue number or URL where the article is being discussed. |
@@ -254,7 +254,7 @@ is stated or retracted but not proved
254254
dependency counts together with whatever its statement prerequisites reach, and
255255
a proved dependency passes on
256256
everything it reaches. The site colours it violet, never green, and lists those
257-
open statements in an `Assumes` row on the article page. It is never
257+
open statements in an `Assumes` row of its statement box. It is never
258258
`fully_proved`, which keeps its meaning in both policies; a conditional result
259259
is complete only once every open statement it assumes is proved. The
260260
palette and state names follow

‎autoform_cli/render.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2997,8 +2997,7 @@ def _render_environment(
29972997
source_link = _vault_source_link(node, repo_root=repo_root, linker=linker)
29982998
meta_rows = implementation_rows
29992999
if mathlib_names := declaration_names(node.mathlib_declaration or ""):
3000-
# As text: render links only bytes it matched to a commit, and it never
3001-
# reads the pinned Mathlib.
3000+
# As text: nothing checks these names against the pinned Mathlib.
30023001
meta_rows.append(("Mathlib", " · ".join(f"<code>{html.escape(name)}</code>" for name in mathlib_names)))
30033002
if node_status.key == "conditional":
30043003
# A conditional proof must never read as finished, so the open

‎tests/test_render.py‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -734,12 +734,12 @@ def test_a_mathlib_article_shows_its_mathlib_declarations_as_text(tmp_path: Path
734734
upstream = project / "blueprint/roadmap/upstream.md"
735735
upstream.write_text(article.format(names=""), encoding="utf-8")
736736
without = render_site(project / "blueprint", tmp_path / "without", lean_root=project)
737-
upstream.write_text(article.format(names="mathlib_declaration: add_comm, «a&b»\n"), encoding="utf-8")
737+
upstream.write_text(article.format(names="mathlib_declaration: add_comm, «a<b&c»\n"), encoding="utf-8")
738738
shown = render_site(project / "blueprint", tmp_path / "shown", lean_root=project)
739739

740740
row = (
741741
'<div class="bp-row"><span class="bp-key">Mathlib</span>'
742-
'<span class="bp-value"><code>add_comm</code> · <code>«a&amp;b»</code></span></div>'
742+
'<span class="bp-value"><code>add_comm</code> · <code>«a&lt;b&amp;c»</code></span></div>'
743743
)
744744
page = (tmp_path / "shown/roadmap/README.md").read_text(encoding="utf-8")
745745
assert page.count(row) == 1
@@ -3085,6 +3085,8 @@ def test_a_conditional_proof_names_the_open_statements_it_assumes(
30853085
for variable in ("GITHUB_REPOSITORY", "GITHUB_SERVER_URL", "GITHUB_SHA"):
30863086
monkeypatch.delenv(variable, raising=False)
30873087
project = _conditional_project(tmp_path, "allowed")
3088+
# Not mathlib: true, yet its Mathlib name is shown too.
3089+
_edit(project / "blueprint/roadmap/top.md", "discussion: 42\n", "discussion: 42\nmathlib_declaration: add_comm\n")
30883090

30893091
render_site(project / "blueprint", tmp_path / "out", lean_root=project, repository_url="", ref="")
30903092
page = (tmp_path / "out/roadmap/README.md").read_text(encoding="utf-8")
@@ -3099,9 +3101,9 @@ def test_a_conditional_proof_names_the_open_statements_it_assumes(
30993101
) in top
31003102
# Only the conditional proof carries the row; the open statement assumes nothing.
31013103
assert page.count('<span class="bp-key">Assumes</span>') == 1
3102-
# The row follows the implementation row and precedes Discussion.
3104+
# The row follows the Lean and Mathlib rows and precedes Discussion.
31033105
meta = top[top.index('<div class="bp-meta">'):top.index('<details class="bp-dependencies">')]
3104-
assert re.findall(r'<span class="bp-key">([^<]+)</span>', meta) == ["Lean", "Assumes", "Discussion"]
3106+
assert re.findall(r'<span class="bp-key">([^<]+)</span>', meta) == ["Lean", "Mathlib", "Assumes", "Discussion"]
31053107

31063108
css = (tmp_path / "out/stylesheets/blueprint.css").read_text(encoding="utf-8")
31073109
assert ".bp-ref-conditional::before, .bp-swatch-conditional { background: #E9DFFC; border-color: #6B3FCF; }" in css

0 commit comments

Comments
 (0)