Skip to content

Keep implementation notes separate from mathematical articles - #172

Merged
Deicyde merged 15 commits into
mainfrom
fix/agents-md-working-notes
Oct 13, 2026
Merged

Deicyde merged 15 commits into
mainfrom
fix/agents-md-working-notes

Conversation

@Deicyde

@Deicyde Deicyde commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • keep mathematical articles to frontmatter and informal mathematics
  • store versioned implementation handoffs in one hidden file per article: blueprint/.implementation-notes/<article_id>.md
  • key notes by durable article_id, so article moves preserve them and independent article claims never share a note file
  • make autoform check reject noncanonical, malformed, empty, symlinked, unreadable, or orphaned notes, ignore hidden entries such as editor lock files, and say how to repair an orphan
  • make autoform audit report a note left after its article is proved, or after every formalizable descendant of a container is proved
  • leave ordinary agents.md and standard AGENTS.md untouched as normal content/instructions
  • teach Roadmap and Formalize to use the per-article note and keep transcripts, secrets, and machine-local paths out; Formalize deletes every note the audit reports as stale, including a container's note its proof completes; Agent Review reads the notes and expects Mathlib candidates there, never in articles

Why this design

Implementation details should not clutter the mathematical wiki, but a shared agents.md created a reserved-name collision, cross-worker merge hotspot, filename-based stale state, and a hard migration for older pinned projects.

The hidden per-article directory avoids those problems. Existing and older graph loaders scan only blueprint/roadmap/, while existing renderers and structure views already omit hidden path components. No renderer exception or pin migration is required.

Contract

  • filenames are existing durable article IDs plus .md
  • one regular, nonempty UTF-8 Markdown file belongs to one article claim
  • roadmap path moves do not rename the note
  • the file is deleted after leaf proof or completion of a container's formalizable subtree (a container with no formalizable descendant keeps its note); audit reports stale notes
  • hidden implementation notes are neither mathematics nor dependency-graph state and never enter publication hashes
  • the stale finding names the file to delete (.implementation-notes/<article_id>.md); any worker may delete a stale note, or repair an orphan a merge left behind by restoring a lost article_id or by moving useful content to the surviving article's note and deleting the orphan

Validation

At exact implementation head before the final clean merge from current main:

  • full suite: 1,842 passed, 6 skipped, 1 expected failure
  • focused graph/audit/render/visualization/skill suites: 229 passed
  • container cleanup roll-up regression: 1,200 containment levels without recursion
  • make lint and make check-example: passed
  • Formalize and Roadmap skill validation: passed
  • independent code and architecture re-reviews: approved

After merging current main, the focused tests, lint, diff check, and
example build pass. GitHub CI at b032c03f was green, including both Windows
and real-Lean jobs.

At 3e95335, which has Formalize delete stale notes, states the container rule exactly in the README and Roadmap skill, and passes a statement string to _ArticleShape in the deep-containment test to match main: make lint passes locally, and GitHub CI is green for both the push and the merge with main, including the Python 3.10 and 3.13 test jobs (lint, full suite, example build), Windows, and real-Lean jobs.

At 6c46193, after a deep multi-agent review (graph validation, audit rule, publication, docs, tests with mutation checks, compatibility, product judgment, merge interaction with main, and consumer runs on the bundled example, hartshorne and hatcher-at), four follow-up commits add orphan-note repair guidance, point Agent Review at the notes, add negative container-rollup tests, and tighten edge cases. The affected suites pass on the branch merged with main at 93c5d28 (289 passed), lint is clean, and GitHub CI is green for both the push and the merge with main, including the Python 3.10 and 3.13 test jobs (lint, full suite, example build), Windows, and real-Lean jobs.

At 13a8567d, a merge of main at 76e486d5: four files conflicted (audit.py, the Formalize and Roadmap skills, and tests/test_audit.py imports), each resolved by keeping both sides, with main's migrate article-ids --write wording. migrate article-ids --write refuses while an orphaned note exists, so a lost article_id cannot be replaced by a fresh one. Lint passes and the affected suites pass locally (490 passed), and GitHub CI is green for both the push and the merge with main, including the Python 3.10 and 3.13 test jobs (lint, full suite, example build), Windows, and real-Lean jobs.

Articles are the informal book: frontmatter and mathematics. Formalize's
execution notes, and the Lean names, Mathlib gaps, and prior art agents
already write into articles, were published as Lean commentary in the
book. Give them one place per roadmap directory instead: an agents.md
beside the articles, one section per article under a heading naming its
file, deleted once the article is proved.

The graph and its chapter check, the render copy, the publication
revision, and both structure pages skip agents.md, matched ignoring
case, so the notes are never nodes, never published, and editing them
does not mark a site stale. Formalize and Roadmap write their notes
there and nowhere else.

A project whose CI pins an older AUTOFORM_REF reads agents.md as an
article and fails check, so until the pin moves the skills keep notes
in the report.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 7, 2026
@Deicyde

Deicyde commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor Author

Superseded by the review of f13757c after the per-article notes redesign: #172 (comment)

Review of #172 at 8e372ad. The graph, render, and hash changes are sound, but coverage still accepts the notes file as article evidence, and the old-pin caveat is wrong for notes files with an H1.

Should fix

  • autoform_cli/coverage.py:574 _is_roadmap_article still accepts any existing .md under roadmap/. A DECOMPOSED row whose only evidence is [Notes](../roadmap/agents.md) therefore passes load_coverage (no issues) and autoform check (rc 0). On base the same project fails with agents: missing H1 title. After render_site, the coverage page links to ../roadmap/agents.md, which is never written. Fix: import is_agent_notes from .graph and append and not is_agent_notes(candidate). Add a test_coverage case that expects "DECOMPOSED coverage evidence has no link to an existing roadmap article". With both changes, test_coverage gives 54 passed and ruff is clean.
  • autoform_cli/README.md:85 (same wording at skills/formalize/SKILL.md:125 and skills/roadmap/SKILL.md:71): the claim that an older AUTOFORM_REF "reads it as an article and fails" holds only when the file has no H1. On base, agents.md = # top.md\n\nMathlib gap.\n passes check ("OK: 4 articles"), becomes node agents, and render publishes roadmap/agents.md. That is the leak this PR exists to stop, on exactly the pinned projects the caveat targets. Fix: state the format ("one ## <file>.md section per article, no H1") in README:81 and both skills, or reword the caveat to say an old pin either fails or publishes the notes.

Golf

  • tests/test_skill_examples.py:72 the "agents.md" entry duplicates the stricter assertions in the new test (line 110). Delete the line without replacing it. test_skill_examples still gives 26 passed.

Nits

  • autoform_cli/render.py:333 render skips agents.md, but _rewrite_links still rewrites links to it, so an article that links its notes gets a dead link on the site (roadmap/README.md -> agents.md exists: False). check does not flag it. Drop the link and keep its label when the target is_agent_notes, or say "never linked from an article" in the skills.
  • autoform_cli/README.md:1040 says to record revision outcomes "in the agents.md beside each touched article", while skills/formalize/SKILL.md:124 says to delete the section once the article is proved. Repaired in-place dependents and proof-impacted articles stay proved, so their record is lost, including the note that they still rest on deprecated X. Exempt revision records until the migration lands, or put them in the commit or report.
  • autoform_cli/README.md:13 the match is name.casefold() == "agents.md", so an article named Agents.md drops out with no error. Write "except agents.md (in any letter case)".
  • skills/formalize/SKILL.md:64 the line is 49 columns between 74-column neighbors. Reflow lines 62-66.

Checked, no change needed

  • Merged tree: test_graph 58, test_render 78, test_visualization 24, test_skill_examples 26, test_coverage 53, all passed. ruff on the seven changed Python files passes.
  • Graph discovery, the orphaned-chapter check, render_site, _published_source_files, and both structure pages all skip agents.md. Editing the notes leaves the publication revision unchanged.
  • Parallel workers appending to one agents.md conflict textually. The PR body accepts this tradeoff, and the skill says to keep both sections.
  • No Execution notes references remain outside the test that forbids them.

Posted by PR swarm: PR Swarm Lead

@Deicyde Deicyde changed the title Keep agents' working notes in agents.md beside the articles Keep implementation notes separate from mathematical articles Oct 7, 2026
@Deicyde

Deicyde commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Review of #172 at f13757c (replaces the review of 8e372ad). The per-article hidden-notes design is sound and nothing blocks the merge, but audit reports note errors at wrong paths and the revision contract conflicts with the new audit rule.

The earlier coverage, old-pin, dead-agents.md-link and casefold findings are moot because notes no longer live under roadmap/. The revision-record finding is still present and worse (see Should fix). The duplicate skill assertion and the ragged lines are still present.

Should fix

  • autoform_cli/audit.py:549 _validation_article_path treats the .implementation-notes/... prefix as a node ID, so every note error is reported at a nonexistent file. An orphaned note is reported at roadmap/.implementation-notes/af_111111111111111111111111.md.md. A file in place of the directory gives roadmap/.implementation-notes.md, and an alias gives roadmap/.Implementation-Notes.md. This breaks README:808 ("structured findings at blueprint-relative paths"). Fix: after the return "." guard add if node_id.split("/", 1)[0].casefold() == IMPLEMENTATION_NOTES_DIR: return node_id, then add an orphan-note audit test. That test fails on the head and passes with the fix (test_audit 27 passed, ruff clean).
  • autoform_cli/README.md:1092 the revision contract says to record the outcome in each touched article's note. Repaired in-place dependents and expand-route proof-impacted articles stay proved, though, and audit.py:176 then reports stale-implementation-note. A proved article with a revision note passes check and fails audit. Workers either fail audit or delete the record that the article still rests on deprecated X. On main that record lived in ## Execution notes and was never forced out. Fix: "Record what happened in the revision commit and report; use an article's implementation note only while that article remains unproved."
  • skills/roadmap/SKILL.md:71 Roadmap is told to put prior art in the note but never told to delete it. A note on an article marked mathlib: true fails audit, because status counts that as proved. Deleting or merging an article leaves an orphan, which stops every graph command: on the bundled example with one leftover note, check rc=1, render rc=1 and work list rc=2. README:83 says only that autoform check rejects bad notes. Fix: add "Delete the note when the article is proved or marked mathlib: true, and in the same commit that deletes or merges the article; an orphaned note fails every command that loads the graph." Reword README:83 to "Every command that loads the graph, including autoform check, rejects".
  • autoform_cli/audit.py:176 no test covers a note on an unproved article. With and derived[node_id].proved removed, test_audit still gives 25 passed, so audit could reject every in-progress note unnoticed. Fix: add an unproved-theorem-with-note case next to test_audit_rejects_implementation_notes_left_after_proof that asserts no stale-implementation-note.

Golf

These edits, applied together with the audit fix and two new tests, keep the suites passing: test_graph 61 (the drop is the 2 agents.md cases), test_audit 27, test_render 78, test_skill_examples 26, ruff clean.

  • autoform_cli/graph.py:407 replace node_id = article_ids.get(path.stem) / if node_id is None: with if path.stem not in article_ids:, and put the four wrapped issues.append calls on one line each (limit is 120). Keep the separate symlink and not-a-directory messages.
  • tests/test_graph.py:526 delete test_agents_filenames_remain_ordinary_articles; it guards the abandoned design, and main has no agents.md handling. Fold test_implementation_notes_directory_has_canonical_spelling (593) into the fail-closed parametrize as a directory column. In tests/test_render.py delete 1048-1050 and 1058, and assert == before at 1062.
  • tests/test_skill_examples.py:72 duplicates line 107. Line 110 pins rationale prose, and line 120 guards agents.md, which main never had. Delete all three, and drop the rationale sentence at skills/formalize/SKILL.md:124-125, which repeats README:80-83.

Nits

  • autoform_cli/graph.py:410 a parse error in the note's own article (for example a missing H1) also reports its valid note as "names no roadmap article", which invites deleting a good handoff. Skip the orphan check when parse issues exist.
  • autoform_cli/graph.py:397 the dotfile skip runs before the symlink and naming checks. A misnamed .af_<id>.md and a .secret symlink to $HOME both pass check. Nothing leaks, but the body says symlinks are rejected. Separately, at line 418 a BOM-only or zero-width-only note passes the nonempty check. Reject symlinks before the skip, and strip \ufeff and \u200b before the nonempty check.
  • skills/formalize/SKILL.md:119 an article link to ../.implementation-notes/<id>.md passes check and renders as a dead link. Add "and never links its note".
  • autoform_cli/graph.py:377 the note tests cover only the misnamed, orphan, empty and alias cases. Add rows for a symlinked note, a symlinked directory, <id>.txt, non-UTF-8 content and a .DS_Store positive case.
  • autoform_cli/templates/github/workflows/autoform-verify.yml:39 generated CI runs check and render, never audit, so the body's "audit enforces cleanup" overstates it. README:87 ("reports") is accurate. Fix the body.
  • autoform_cli/README.md:13 lines 13-16 reflow unchanged text; revert them. Reflow the ragged new lines: README:85 (49 cols), README:1091 and 1093 (39), formalize SKILL.md:62 (30) and 65 (36), roadmap SKILL.md:94 (85).

Checked, no change needed

  • Notes live outside roadmap/, so coverage cannot cite them. Render, the structure pages and publication_source_revision omit the directory. Base 4c80749 check and render ignore it, so no AUTOFORM_REF migration is needed.
  • Moves keep notes valid because notes are keyed by article_id. Uppercase IDs, .MD, nested directories, symlinked notes or directories (except hidden ones, see Nits), invalid UTF-8 and whitespace-only content are rejected.
  • Failing closed in load_graph matches how other graph errors behave. Only the deletion guidance and the README wording need to change.

Posted by PR swarm: PR Swarm Lead

@Deicyde

Deicyde commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Re-checked at c2528c7. All four should-fix items from the review of f13757c5 are fixed, and each fix has a test that fails without it. Nothing blocks the merge.

  • Note errors are now reported at the note's own blueprint path (audit.py:560). test_audit_reports_invalid_note_at_its_blueprint_path fails 3 of 3 when that branch is removed.
  • The revision contract keeps the record in the revision commit and report, and uses a note only while its article is unproved.
  • Roadmap deletes the note on proof, on mathlib: true, and in the commit that deletes or merges the article. The README now says every command that loads the graph rejects bad notes.
  • test_audit_allows_implementation_notes_while_work_is_unproved fails when the proved guard at audit.py:186 is dropped.

The nits are closed too:

  • an article parse error no longer reports its note as orphaned;
  • symlinks are rejected before the dotfile skip;
  • BOM-only and zero-width-only notes count as empty;
  • both skills say never to link the note;
  • the five missing fail-closed cases have tests;
  • the body says audit "reports";
  • the README reflow at line 13 is reverted, and the ragged lines are reflowed.

Optional golf, still open

  • tests/test_graph.py:527, tests/test_render.py:1048-1050 and 1058 (then assert == before at 1062), and tests/test_skill_examples.py:125 guard the abandoned agents.md design; main has no agents.md handling.
  • Five note tests in tests/test_graph.py (577, 596, 613, 630 and 652) build the same one-article blueprint in 8 lines each. One _note_blueprint(tmp_path) helper would remove about 25 lines.
  • tests/test_skill_examples.py:72 is implied by line 107. Line 110 pins the rationale sentence at skills/formalize/SKILL.md:124-125, which repeats README:80-83.
  • autoform_cli/graph.py lines 379, 386, 407, 412 and 422 still wrap issues.append calls that fit on one line.

Validation at c2528c7: test_audit 29, test_graph 69 and test_skill_examples 26 pass locally. Both mutations above were run against those tests. The CI test jobs are green; real Lean was still running at the time of writing.

Posted by PR swarm: PR Swarm Lead

@Deicyde

Deicyde commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Supersedes the “not ready” review of f13757c5: #172 (comment)

Final exact-head review at c2528c7a: ready for human review. The follow-up fixes:

  • preserve complete blueprint-relative diagnostic paths for malformed note filenames, including spaces and colons;
  • keep revision outcomes in the revision commit/report when touched articles remain proved, using implementation notes only for unproved work;
  • require Roadmap to delete notes on proof/mathlib: true and atomically with article deletion or merge;
  • verify that unproved work may retain a note and that proved work may not;
  • avoid false orphan findings while an article itself is malformed;
  • reject symlinked directories/files, malformed extensions, invalid UTF-8, BOM/zero-width-only notes, and orphan notes while allowing .DS_Store;
  • forbid links from mathematical articles to hidden notes.

Validation at this exact head:

  • focused graph/audit/render/visualization/skill suites: 226 passed;
  • Ruff, git diff --check, and make check-example: pass;
  • Formalize and Roadmap skill validation: pass;
  • all exact-head GitHub checks pass, including Windows and both real-Lean jobs;
  • independent code and architecture re-reviews: approved with no remaining blockers.

@Deicyde

Deicyde commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Gap in the stale-note audit: stale-implementation-note fires only when status.derive(graph)[node].proved, and proved is per-node (status.py:111: formalized proof, Mathlib, or a stated definition). A chapter or other container article is never proved, so a note keyed to its article_id is never flagged and can stay forever.

In hartshorne and hatcher-at, the 9 Lean-side notes left after cleaning proved articles are all on chapter READMEs, and some are already stale.

Possible fix: flag a container's note once every article it contains is proved.

@Deicyde

Deicyde commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Supersedes the container stale-note gap reported here: #172 (comment)

Fixed at exact head b032c03f. Container notes are now stale when the container has at least one formalizable descendant and every such descendant is derived proved; a container with any unfinished formalizable descendant may retain its note.

The roll-up is computed once, bottom-up and iteratively. A 1,200-level containment regression verifies that the audit does not recurse or rescan each subtree.

Validation at this exact head:

  • focused graph/audit/render/visualization/skill suites: 229 passed;
  • dedicated audit/skill suite: 58 passed;
  • Ruff, git diff --check, and make check-example: pass;
  • all exact-head GitHub checks pass, including Windows and both real-Lean jobs;
  • independent code and architecture reviews: approved with no remaining blockers.

#172 is ready for human review.

zibo-yang added a commit to zibo-yang/autoform-bot that referenced this pull request Oct 7, 2026
Nothing told an agent whether the blueprint already held a result, so a
Roadmap pass could add a second article for it and Formalize could prove
a helper twice. `autoform search TARGET QUERY` answers in one local,
read-only call, and each hit carries what a reuse decision needs: the
statement as authored, the derived state, the Lean targets with file and
line, the sources, and the articles that already depend on it.

An article is a hit when every term occurs in one of its fields, after
folding case, width, accents, typographic punctuation and invisible
characters. Filler words such as "of" are dropped from the query and a
word of letters loses a common ending, so "recovered" finds "recovers".
An article holding the words as typed is listed before one that only a
shortened word reaches, so shortening never hides a hit. Fields rank title, Lean name, the article's own path
segment, statement, then containing titles. Full path IDs and qualified
Lean names rank last, so a chapter directory or a namespace does not
bury a statement match. The statement is matched as the site publishes
it.

Ordering adds one tie-break to the issue's: between hits with the same
best field, the one whose weakest term sits in a better field is first.
`## Execution notes` is not searched, because facebookresearch#172 moves those notes out
of the article.

Search keeps no index: each call reads every article and renders its
statement. It rereads each article and refuses bytes other than those
the graph was built from, so a hit belongs to the reported source
revision. `--json` writes `autoform-search/v1`.

Part of facebookresearch#143.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zibo-yang added a commit to zibo-yang/autoform-bot that referenced this pull request Oct 7, 2026
Nothing told an agent whether the blueprint already held a result, so a
Roadmap pass could add a second article for it and Formalize could prove
a helper twice. `autoform search TARGET QUERY` answers in one local,
read-only call, and each hit carries what a reuse decision needs: the
statement as authored, the derived state, the Lean targets with file and
line, the sources, and the articles that already depend on it.

An article is a hit when every term occurs in one of its fields, after
folding case, width, accents, typographic punctuation and invisible
characters. Filler words such as "of" are dropped from the query and a
word of letters loses a common ending, so "recovered" finds "recovers".
A term sheds the sentence punctuation and quotation marks around it. An
article holding the words as typed is listed before one that only a
shortened word reaches, so shortening never hides a hit. Fields rank
title, Lean name, the article's own path segment, statement, then
containing titles. Full path IDs and qualified Lean names rank last, so a
chapter directory or a namespace does not bury a statement match. Titles
and the statement are matched as the site publishes them.

Ordering adds one tie-break to the issue's: between hits with the same
best field, the one whose weakest term sits in a better field is first.
`## Execution notes` is not searched, because facebookresearch#172 moves those notes out
of the article.

Search keeps no index: each call reads every article and renders its
statement. It rereads each article and refuses bytes other than those
the graph was built from, so a hit belongs to the reported source
revision. `--json` writes `autoform-search/v1`.

Part of facebookresearch#143.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Deicyde

Deicyde commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Correction to my earlier comment: its suggested fix ("every article it contains is proved") misses 5 of the 9 book notes, because sub-container READMEs and other non-formalizable pages don't derive proved. The subtree rule in b032c03f is the right one: with the 9 chapter- and section-level notes in hartshorne and hatcher-at converted to .implementation-notes/ files, b032c03f flags all 9; c2528c7a flagged none.

Two gaps remain at b032c03f:

  1. Nothing tells Formalize to delete a container's note. The PR that proves a container's last formalizable descendant creates stale-implementation-note on the container, but the skill keeps the worker to the claimed article (formalize/SKILL.md:64-65, :118-126) and its findings (:133-137); only Roadmap has the container rule (roadmap/SKILL.md:76-77). autoform doctor fails on the finding, so in a book whose CI runs doctor (hartshorne's does), that PR fails unless the worker leaves the skill's scope. If two PRs finish a container in parallel, the finding first appears on main, where Formalize only reports it. Suggest: Formalize deletes any container note the audit reports as stale.
  2. README.md:1093-1094 still limits a note to "while that article remains unproved", which never ends for a container, and :85-86 drops the code's "at least one formalizable descendant" condition.

zibo-yang added a commit to zibo-yang/autoform-bot that referenced this pull request Oct 7, 2026
Nothing told an agent whether the blueprint already held a result, so a
Roadmap pass could add a second article for it and Formalize could prove
a helper twice. `autoform search TARGET QUERY` answers in one local,
read-only call, and each hit carries what a reuse decision needs: the
statement as authored, the derived state, the Lean targets with file and
line, the sources, and the articles that already depend on it.

An article is a hit when every term occurs in one of its fields, after
folding case, width, accents, typographic punctuation and invisible
characters. Filler words such as "of" are dropped from the query and a
word of letters loses a common ending, so "recovered" finds "recovers".
A term sheds the sentence punctuation, quotation marks, backticks and
wrapping emphasis around it. Only the query is shortened, so shortening
adds hits and never removes one. Fields rank
title, Lean name, the article's own path segment, statement, then
containing titles. Full path IDs and qualified Lean names rank last, so a
chapter directory or a namespace does not bury a statement match. Titles
and the statement are matched as the site publishes them.

Ordering adds two tie-breaks to the issue's. Between hits with the same
best field, one holding the words as typed is before one reached only
through a shortened word, and then the one whose weakest term sits in a
better field is first.
`## Execution notes` is not searched, because facebookresearch#172 moves those notes out
of the article.

Search keeps no index: each call reads every article and renders its
statement. It rereads each article and refuses bytes other than those
the graph was built from, so a hit belongs to the reported source
revision. `--json` writes `autoform-search/v1`.

Part of facebookresearch#143.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zibo-yang added a commit to zibo-yang/autoform-bot that referenced this pull request Oct 7, 2026
Nothing told an agent whether the blueprint already held a result, so a
Roadmap pass could add a second article for it and Formalize could prove
a helper twice. `autoform search TARGET QUERY` answers in one local,
read-only call, and each hit carries what a reuse decision needs: the
statement as authored, the derived state, the Lean targets with file and
line, the sources, and the articles that already depend on it.

An article is a hit when every term occurs in one of its fields, after
folding case, width, accents, typographic punctuation and invisible
characters. Filler words such as "of" are dropped from the query and a
word of letters loses a common ending, so "recovered" finds "recovers".
A term sheds the sentence punctuation, quotation marks, backticks and
wrapping emphasis around it. Only the query is shortened, so shortening
adds hits and never removes one. Fields rank
title, Lean name, the article's own path segment, statement, then
containing titles. Full path IDs and qualified Lean names rank last, so a
chapter directory or a namespace does not bury a statement match. Titles
and the statement are matched as the site publishes them.

Ordering adds two tie-breaks to the issue's. Between hits with the same
best field, one holding the words as typed is before one reached only
through a shortened word, and then the one whose weakest term sits in a
better field is first.
`## Execution notes` is not searched, because facebookresearch#172 moves those notes out
of the article.

Search keeps no index: each call reads every article and renders its
statement. It rereads each article and refuses bytes other than those
the graph was built from, so a hit belongs to the reported source
revision. `--json` writes `autoform-search/v1`.

Part of facebookresearch#143.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zibo-yang added a commit to zibo-yang/autoform-bot that referenced this pull request Oct 8, 2026
Nothing told an agent whether the blueprint already held a result, so a
Roadmap pass could add a second article for it and Formalize could prove
a helper twice. `autoform search TARGET QUERY` answers in one local,
read-only call, and each hit carries what a reuse decision needs: the
statement as authored, the derived state, the Lean targets with file and
line, the sources, and the articles that already depend on it.

An article is a hit when every term occurs in one of its fields, after
folding case, width, accents, typographic punctuation and invisible
characters. Filler words such as "of" are dropped from the query and a
word of letters loses a common ending, so "recovered" finds "recovers".
A term sheds the sentence punctuation, quotation marks, backticks and
wrapping emphasis around it. Only the query is shortened, so shortening
adds hits and never removes one. Fields rank
title, Lean name, the article's own path segment, statement, then
containing titles. Full path IDs and qualified Lean names rank last, so a
chapter directory or a namespace does not bury a statement match. Titles
and the statement are matched as the site publishes them.

Ordering adds two tie-breaks to the issue's. Between hits with the same
best field, one holding the words as typed is before one reached only
through a shortened word, and then the one whose weakest term sits in a
better field is first.
`## Execution notes` is not searched, because facebookresearch#172 moves those notes out
of the article.

Search keeps no index: each call reads every article and renders its
statement. It rereads each article and refuses bytes other than those
the graph was built from, so a hit belongs to the reported source
revision. `--json` writes `autoform-search/v1`.

Part of facebookresearch#143.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Deicyde

Deicyde commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

Pre-merge review of 6c46193, the head after my previous reply.

Review. A multi-agent review covered note validation (about 30 edge-case fixtures), the stale-note rule (15 blueprints, a 2,121-article graph, mutated rollups), publication (notes never reach the site, views, search, or publication hash, including under the 1cf2ca8 renderer), docs and skills against the code, test strength (27 mutations), CLI and JSON compatibility, product judgment, and the merge with main. On the bundled example, and on hartshorne and hatcher-at with notes added, output differed from main only by the intended stale-note finding. Two independent verifiers checked every substantive finding.

Fixed:

  1. d48e2f5: the Agent Review rubric asked for explicit Mathlib candidates without pointing at the hidden notes, so a reviewer would ask for Lean text back in articles. It now reads each node's note and expects Mathlib candidates there, never in the article. New negative tests catch a rollup that ignores an unproved nested article or lets one sibling overwrite another; both mutations passed the whole suite before.
  2. 3ab3f3d, 6c46193: one branch deleting or merging an article while another writes its note orphans the note without a Git conflict, and every graph-loading command then refuses. The error now says how to repair it, and Formalize, Roadmap and the README describe the repair: restore a lost article_id, or move anything useful to the surviving article's note and delete the orphan. Any worker may do this.
  3. 76ff8fc: errors under a misplaced roadmap/.implementation-notes/ point at the real path again, as on main; hidden entries such as Emacs lock symlinks no longer block every command; the stale finding names .implementation-notes/<article_id>.md; Formalize commits stale-note deletions after rebasing; the README's claims sentence and Roadmap's no-transcript/secret rule now match the code and this PR's description.

Left as is: a traceback when the notes directory is not searchable (main crashes the same way for roadmap directories), a KeyError from audit_graph on hand-built graphs with default depths (no command reaches it), and rejection of editor backup files in the notes directory (fail-closed naming). Open design question: only a worker's own leaf note is ever read, so container notes are cleaned up but not read, and notes on exposition pages are never flagged.

Validation: the affected suites pass on this head merged with main at 93c5d28 (289 passed), lint is clean, and GitHub CI is green for both the push and the merge with main, including the Python 3.10 and 3.13 test jobs (lint, full suite, example build), Windows, and real-Lean jobs.

…-notes

# Conflicts:
#	autoform_cli/audit.py
#	skills/formalize/SKILL.md
#	skills/roadmap/SKILL.md
#	tests/test_audit.py
@Deicyde

Deicyde commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

Review at 13a8567

Verdict: merge-ready. This head merges main at 76e486d5 into the reviewed 6c46193 (results above). CI is green for both the push and the merge with main, including real Lean, and the PR has no conflicts.

  • Merge. Four files conflicted, and each resolution keeps both sides: audit.py runs the stale-note check and then main's unclosed-fence check, and the Formalize and Roadmap skills take main's migrate article-ids --write wording alongside the notes rules. The six files Git merged on its own match its automatic merge byte for byte. Against main, the PR's changes are the same as before the merge, apart from one rewrapped paragraph and the merged import line in test_audit.py.
  • Interactions with main. I reproduced each one. The roadmap symlink refusal returns before note validation, so it never reports a false orphan. migrate article-ids --write and autoform search refuse while a note is orphaned, so a lost article_id cannot be replaced by a fresh one before it is restored. One article can carry both stale-implementation-note and unclosed-code-fence.
  • Earlier fixes. All of them survived the merge: hidden entries are skipped before the symlink check, misplaced-notes errors point at their real path, the stale finding names .implementation-notes/<article_id>.md, the orphan error carries the repair hint, the Agent Review rubric points at the notes, and the negative rollup tests pass.
  • Tests. 490 passed locally across the audit, graph, skill-example, article-identity, render, visualization, markdown, search and scope-completion suites. Lint is clean. The only local failures are project-inspection FIFO probes timing out under load, and they fail on main alone too.

Follow-ups, none blocking:

  1. When Roadmap moves a note into a new page that has no article_id yet, deleting the old article first orphans the note, and migrate article-ids then refuses too. One sentence in the Roadmap skill would avoid it: give the surviving page its ID before deleting the old one.
  2. Only a worker's own leaf note is ever read, so container notes are cleaned up but not read, and notes on exposition pages are never flagged.
  3. Since Show finished scopes as complete, and draw containers as scopes #196 the site keeps a scope open while it has not_ready leaves, but the container-note rule counts only formalizable descendants, so a container's note can be flagged stale while the site still shows that scope open.

@Deicyde Deicyde added the review: ready Review complete with no known merge blockers label Oct 12, 2026
@Deicyde
Deicyde marked this pull request as ready for review October 12, 2026 23:38
@Deicyde
Deicyde merged commit c070c36 into main Oct 13, 2026
9 checks passed
@Deicyde
Deicyde deleted the fix/agents-md-working-notes branch October 13, 2026 02:50
Deicyde added a commit that referenced this pull request Oct 13, 2026
#172 made every command that loads the graph reject malformed, empty,
symlinked or orphaned implementation notes. Render and the dashboard load the
graph from a private copy without hidden files, so they skipped the check.
They now run it against the vault itself; the notes are never published or
hashed, so reading them in place changes no output.
Deicyde added a commit that referenced this pull request Oct 13, 2026
Brings in #172 (implementation notes), #111, #168 and #223 to #229.
Three files conflicted, each because both sides added text at the same
spot; every resolution keeps both:

- AGENTS.md: main's rewritten roadmap bullet (implementation notes under
  blueprint/.implementation-notes/), then this branch's import bullet.
- skills/formalize/SKILL.md: this branch's "renew the complete claim set"
  joined with main's audit run and stale-note deletion, rewrapped.
- tests/test_skill_examples.py: this branch's import-scope test and main's
  implementation-notes test, side by side.
Deicyde added a commit that referenced this pull request Oct 13, 2026
Merge main at 82cca35, which carries the final #168 (b553a92) and
#111 (521a940) plus #172, #175, #186, #188, #198, #208, #209 and the
audit PRs #223 to #229. Main's changes are kept as they are, and this
branch's changes apply on top of them unchanged.

Only tests/test_shared_lean_runtime.py conflicted, in two places. The
imports keep both sides: main's servers.lsp.server import, which #168's
new live-process LSP timeout test needs, and this branch's
servers.repl.core header-command import. The second conflict is in
test_partial_repl_startup_transfers_cleanup_without_masking_the_error,
where #168 relaxed a timing bound from 0.5 to 1.5 seconds. This branch
replaces that test with
test_dirty_repl_generation_transfers_to_retirement_before_lease_release
because a cold pool no longer starts a REPL while it is built, so the
replacement stays and #168's edit leaves with the old test.

The other files both sides changed merged without conflict:
servers/lean_runtime.py, the CI workflow,
tests/test_repl_core_protocol.py, tests/test_skill_examples.py,
skills/setup/SKILL.md and the example README.
Deicyde added a commit that referenced this pull request Oct 13, 2026
Brings in main at 82cca35: the Lean client's request phases (#175), the
skeleton probe's roots passed as JSON (#209), autoform unused-hypotheses
(#198), the shared checkout pin check (#186), the tree snapshot scan
closure (#188), the statement contract follow-ups (#208), retained project
cleanup and LSP process ownership (#168, #111), implementation notes
outside articles (#172), and the audit fixes #223 to #229.

Conflicts:

- autoform_cli/audit.py: this branch's validate_coverage_roles import
  beside main's IMPLEMENTATION_NOTES_DIR import.
- autoform_cli/graph.py: this branch's ATLAS_SCHEMA and _MAX_ATLAS_BYTES
  beside main's IMPLEMENTATION_NOTES_DIR.
- autoform_cli/README.md: this branch's area, atlas and catalog
  paragraphs, then main's implementation-notes paragraph. The publication
  contract keeps this branch's explorer description and takes main's
  "Hidden files, including .implementation-notes, are omitted".
- skills/roadmap/SKILL.md: main's implementation-notes paragraph after the
  article-ids instruction, then this branch's paragraph break before the
  claim rule. Main's "Assert formalization or mathlib: true only after
  exact verification" stays out there, because this branch moved that rule
  into its own assertion paragraph further down.
- tests/test_visualization.py: both new tests, this branch's checked
  catalog labels and main's structure page without implementation notes.

One change had no textual conflict. #172 has every command that loads the
graph reject malformed, empty, symlinked or orphaned implementation notes.
Render loads the graph from its capture, which leaves hidden files out, so
it skipped that check. It now checks the notes in the vault, the same fix
#165 makes for its own capture. The notes are never published or hashed,
so reading them in place changes no output. A new test renders a vault
with an orphaned note and expects render to stop before it writes
anything.
Deicyde added a commit that referenced this pull request Oct 14, 2026
…e article

Formalize asked for one sentence in the article saying why a hypothesis was
kept (#198), while the article keeps only frontmatter and mathematics (#172).
The sentence now gives the reason in mathematical or source terms, which the
article may hold. Part of #252.
Deicyde added a commit that referenced this pull request Oct 14, 2026
…-followups

Follow up #172: kept-hypothesis reasons, not_ready containers and article moves
Deicyde added a commit that referenced this pull request Oct 21, 2026
…complete the changelog

--version now prints debrief_orchestrator.autoform_version(), the string a
debrief records, so a plugin checkout shows its commit beside the version
main keeps between releases. A custom action reads it only when --version is
given, since it runs git.

The release test monkeypatches the version lookup instead of skipping when
autoform is not installed, checks that only --version reads the version, and
checks that the changelog's newest release heading names the project version.

The changelog adds the dashboard (#91), implementation notes (#172),
unpublished folders (#381), --version, and #376, #380, #392, #394 and #406;
corrects the library line; and regroups #362, #365 and #67. The CLI reference
documents --version.
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. review: ready Review complete with no known merge blockers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant