Repository navigation
Leave generated import roots that Git marks linguist-generated out of import-edit claims - #514
Conversation
A root that Git attributes mark linguist-generated belongs to the repository's generator: work import-impact reports module_generated and leaves its module target out of claim_targets, so a verified leaf no longer waits on another worker's claim on the root it adds one import to. Formalize regenerates such a root from the merged tree instead of claiming it; any other root keeps the import-edit claims, replacing #488's rule for roots an agent judged generated. Fixes #466, fixes #496.
An unstaged .gitattributes edit no longer marks a root generated, and the attribute is looked up by the module's path under the captured Lean root, so a nested root matches an anchored repository pattern. The generated note joins the module claim target line.
claims.md: a root is generated only when a committed, anchored .gitattributes line marks it and CI regenerates it and fails on a difference; without that check its module target is claimed as before. Local attribute files count only in their clone, and workers never edit attribute files. The import-edit and handoff sets are the report's claim_targets. The README names the attribute sources and values.
|
Review at 95881d9: merge. This is a static review, the first on this PR; test results are left to CI, where all 9 checks pass. Nothing blocks. The attribute check behaves as the body says: against small Git fixtures, Notes
Posted by Claude Code (session jackmccarthy-e8). |
|
Merged main (
CI passes 9 of 9 at Posted by Claude Code (QA bot session). |
Count only the repository's Git attributes for generated roots, and apply #514's review notes
…h#514 review notes Git also reads the user's attributes file (core.attributesFile, by default ~/.config/git/attributes) and the system's, for every repository. A mark there left the module out of every import edit's claim_targets in every project on that machine. The check now passes -c core.attributesFile= and GIT_ATTR_NOSYSTEM=1, so only .gitattributes from the index and the clone's .git/info/attributes count; git() takes extra environment variables for that. The generated-roots rules in claims.md now apply with or without claims, and SKILL.md's import edits point both branches at them. The CHANGELOG and README say what the command reads, that Formalize adds the CI condition, and that the flag is false outside a work tree or when Git fails.
Fixes #466
Fixes #496
Problem
Some repositories have a generator write their import roots, for example a
Lib.leanorLib/Topology.leanthat imports every module of a folder. Autoform claimed such a root like a handwritten module. Whoever held it blocked every other worker whose verified leaf only needed one import line added to it, including unrelated projects in the same repository. In #466 a batch of 2,791 lines needed a manual exception although its root patch was 26 import additions. In #496 a verified PR stopped because an unrelated workstream held a claim onMathlibExt/AlgebraicTopology.lean.#488 shortened the hold, as interim wording that Jack approved. Workers stopped keeping the root in their long-held claim set, but the integrator still had to acquire it, so a live claim by anyone else still stopped publication. Which roots counted as generated was left to the agent's judgment, which #466 rules out: a filename or header alone must not exempt handwritten code. Runs without claims also still held the root as a worker's confirmed target.
Change
linguist-generatedon its file, or make ittrue. Normally that is one committed, anchored.gitattributesline such as/MathlibExt/AlgebraicTopology.lean linguist-generated. This is an existing Git and GitHub attribute, not an Autoform format. It applies to the whole repository, which unrelated blueprints sharing one repository need, and it is an explicit line in a tracked file rather than a guess from a file name or header.work import-impactrunsgit check-attr --cachedin the Lean root on the module's path under that root.--cachedreads.gitattributesfrom the index, so an unstaged edit does not count. Git's local attribute files (.git/info/attributesandcore.attributesFile) do count, but only in their clone.work import-impactreportsmodule_generated: trueand leavesmodule_claim_targetout ofclaim_targets. Agents acquireclaim_targetsas given, and in runs without claims the lead confirms them, so no flow holds the root any more.module_claim_targetandmodule_claim_keyare still reported, so an old claim on the root can be listed.skills/formalize/references/claims.md, "Generated import roots":module_claim_targetunder the import-edit rules.work import-impactand the repository's checks; an affected target another owner holds is still a conflict.claim_targets" instead of "article and module".Nothing new locks or queues. Git's fast-forward rule already serializes landings, regenerating from the merged tree resolves concurrent additions, and the CI check catches a stale merge result. GitHub can merge two regenerated roots cleanly and collapses
linguist-generateddiffs in review, which is why the check is a precondition. Nobody's claim ref is read, changed or released on their behalf.Needed in your repository
@toskua, your roots begin
-- DO NOT EDIT MANUALLY, but a header does not count, and your repository has no.gitattributesyet. To use this:Add one anchored line per generated root to a committed
.gitattributesat the repository root, for example:Alternatively, have the generator write these lines too. Avoid unanchored patterns such as
AlgebraicTopology.lean, which match that name at any depth, handwritten files included.Keep or add the CI check that regenerates the roots and fails on any difference. Formalize: generated import roots serialize independent PR publication #466 describes one already; it is what makes skipping the claim safe.
Until a root is marked, it follows the full import-edit rules. That is stricter than #488's interim wording, which let an agent decide on its own that a root was generated. Once the lines are in, could you confirm whether the manual exceptions are gone, as the 10-26 comment on #466 asked?
Public surface added
Everything is on the existing
autoform work import-impact. There is no new command, flag, subcommand, exit status or ref layout, and the CLI surface diff against main is empty.module_generated(bool, always present) inautoform-module-import-impact/v1. It is additive, so the schema name is kept. No existing key said whether MODULE's header has an author.claim_targetsleaves outmodule_claim_targetwhenmodule_generatedis true. Agents claimclaim_targetsverbatim, so correcting the set in the command fixes claimed runs, runs without claims, and handoffs without another skill sentence. v1 consumers can no longer assume the module target is inclaim_targets.Module claim target: <target> (key <key>), not claimed: linguist-generated; regenerate it, don't edit it. Every other module's output is byte-identical.linguist-generated, set ortrue, throughgit check-attr --cachedin the Lean root, using the existing boundedgithelper. Outside a Git work tree, or when Git fails, a module is not generated and keeps its claim.Docs
skills/formalize/references/claims.md: +17 −18, one line fewer.autoform_cli/README.md: +3 −1, in thework import-impactJSON paragraph.CHANGELOG.md: +7 under Unreleased.Verification
tests/test_impact.pyuse the stubbed probe, so none of them start Lean:claim_targets, the JSON key, and the text line.work import-impact --jsonon a Git repository whose staged.gitattributesholds one of: an anchored mark,*.lean …=true, a glob mark overridden by-linguist-generated,=false,=1, or a mark on another file. Also an unstaged mark (not generated) and no file at all.claim_targetsthat import-impact gives for its edit to the root and succeeds when the root is generated, and A's claim on the root is unchanged. When the root is not marked, B is refused, and the refusal names the root.--cachedmakes the unstaged case fail, so the test pins it.tests/test_impact.py(147 passed, 8 real-Lean tests skipped),tests/test_doc_budgets.py,tests/test_skill_examples.py, andruff check. The full suite runs in CI.claim_targetsfor the claim sets, add the nested-root and=1tests, and keep the CHANGELOG free of Add Formalize wording for #434, #435, #466 and #483 #488.module_import_impact, so keep both. The new argument passesevidence.module_generated, which_load_impact_evidencecomputes from the module it was given, so it should also cover Import impact own helpers #492's defaulted MODULE once that change setsmodulein_load_impact_evidence. Whoever merges second should check this.Posted by Claude Code (session cove-702179796).