Repository navigation
feat: glance public-name check — watcher refuses added/renamed library names before any close-out (#641) - #642
Merged
Conversation
Enforces AUTONOMY.md "Public-name narrowing of `glance` — 2026-11-16" (#641). bin/public_names.py compares each changed library module's public names (module-level def/class/assignment, plus __init__ re-exports and __all__) before and after with ast, and reports added and renamed names; a removal alone is info. Tests, private modules and names, and repos outside config/policy.yaml `public_name_libraries:` are ignored; package directories come from the body map's `package:`. A parse failure or an unreadable diff cannot tell and fails closed. CLI: `pyauto-brain public-names <owner/repo>#<n>` (read-only gh api), `--repo <path> --range a..b`, or `--repo-name R --before D --after D`; exit 0 clean, 1 hit, 2 cannot tell. Wired into the shift close-out template (refusal why reaches the digest), the /prm tiered merge and ship_library/ship_workspace stop lists, and the review faculty's ReviewSurface (public_names + a risk flag). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review round on 4605a26 (#641): - repo names match case-folded (owner, repo and the policy list); - the watcher runs the check in RealSpawner.spawn_closeout: a hit or a cannot-tell writes the refused .closeout and starts no session; the close-out prompt keeps it as a second layer; - policy membership is decided before the body map is read, so a non-library PR passes when PyAutoMind is unreadable; - a package directory missing at the head, an empty merge-base sha, and a package __init__ star-importing a changed module cannot tell; - __all__.extend/append are read; .pyi stubs are skipped (documented); - AUTONOMY.md "Public-name narrowing" Enforcement paragraph states the enforcement as built. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ame check (human approved 2026-11-16) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d (re-review) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A package __init__ star-importing a module the diff touched now cannot tell only when that module is private or the star import cannot be resolved. A changed public module's names are already compared directly, so a harmless edit such as autofit/aggregator/aggregator.py passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #641. This enforces AUTONOMY.md "Public-name narrowing of
glance— 2026-11-16" (#639): a change that adds or renames a public name in a library package goes to a human/prm.bin/public_names.py,pyauto-brain public-names: anastcomparison of each module's public names (defs, classes, constants,__init__exports including__all__extend/append) at the PR's merge base and head.config/policy.yamlpublic_name_libraries:; package directories come from Mindrepos.yaml.spawn_closeoutruns the check on every library PR first. A hit or can't-tell writes a refused.closeoutwith the reason, which reaches the digest, and starts no session. The close-out template step stays as a second layer./prmreference,ship_library,ship_workspace), and appears in the ReviewSurface.gh apicompare, file-list and contents GETs on library PRs its own workers named, once per close-out.Test plan
tests/test_public_names.py(40 tests): the real chore: shift defaults — 4 workers, 8 sessions, 5M token budget #656 fixture and range catch all sevenlatent_*_from; private, body-only and value-only changes pass; renames,__init__exports,__all__.extendand annotated assignments are caught; parse errors, missing packages and an empty merge base exit 2; the close-out refusal reaches the digest; non-library repos make no gh call.🤖 Generated with Claude Code