Skip to content

feat: glance public-name check — watcher refuses added/renamed library names before any close-out (#641) - #642

Merged
Jammy2211 merged 5 commits into
mainfrom
feature/glance-public-name-check
Nov 16, 2026
Merged

Jammy2211 merged 5 commits into
mainfrom
feature/glance-public-name-check

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

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: an ast comparison of each module's public names (defs, classes, constants, __init__ exports including __all__ extend/append) at the PR's merge base and head.
    • Exit 0 is clean. Repos the ruling doesn't cover also exit 0, without reading Mind.
    • Exit 1 means a name was added or renamed.
    • Exit 2 means it can't tell (parse error, missing package directory, empty merge base, a changed star import), and fails closed.
    • Repo names are case-folded. The library list is in config/policy.yaml public_name_libraries:; package directories come from Mind repos.yaml.
  • Deterministic in the watcher: spawn_closeout runs the check on every library PR first. A hit or can't-tell writes a refused .closeout with the reason, which reaches the digest, and starts no session. The close-out template step stays as a second layer.
  • Also stops the in-turn tiered merge (/prm reference, ship_library, ship_workspace), and appears in the ReviewSurface.
  • Doctrine: the Enforcement paragraph is updated. The watcher network-surface amendment of 2026-11-16 was approved by the human: read-only gh api compare, file-list and contents GETs on library PRs its own workers named, once per close-out.

Test plan

🤖 Generated with Claude Code

Jammy2211 and others added 5 commits November 16, 2026 12:06
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>
@Jammy2211
Jammy2211 merged commit 0c534de into main Nov 16, 2026
2 checks passed
@Jammy2211
Jammy2211 deleted the feature/glance-public-name-check branch November 16, 2026 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: glance public-name diff check — added or renamed public library names go to a human /prm

1 participant