Skip to content

Add a name guard test - #23

Merged
VirtualMachinist merged 2 commits into
mainfrom
hygiene/guard
Nov 14, 2026
Merged

VirtualMachinist merged 2 commits into
mainfrom
hygiene/guard

Conversation

@VirtualMachinist

Copy link
Copy Markdown
Member

Adds a test that fails if a private machine name appears anywhere in the tree.

  • cmd/vigil/names_test.go walks the module tree, skipping .git/, and checks file contents and paths against a pinned list of salted sha256 hashes. Whole tokens and 5–7-byte substrings are both checked. The plaintext list is held off-repo.
  • A failure reports the path, the line, the list and the index. A path match is printed masked, and the matched text is never printed, so CI logs stay clean.
  • A self-test plants case, substring, joined-token and file-name forms in a temporary directory, checks a negative case, and asserts that no failure message leaks the planted text.
  • It runs under plain go test ./..., so both required checks enforce it.
  • CONTRIBUTING describes the guard.
  • One comment in promclient is reworded to match overlay-only slug lookup.

🤖 Generated with Claude Code

The comment still described the removed built-in list. Known slugs come only
from the overlay host list, so the comment now says that.

Signed-off-by: VirtualMachinist <252028890+VirtualMachinist@users.noreply.github.com>
A test walks the module root and fails if any file content or file name
carries a name on the maintainers list. The list is held as salted
hashes, so a failure prints a path, a line, a list and an index and
never the name. A self-test plants cases to prove the scanner bites.
CONTRIBUTING describes the guard and what to do when it fires.

Signed-off-by: VirtualMachinist <252028890+VirtualMachinist@users.noreply.github.com>
@VirtualMachinist
VirtualMachinist merged commit 4a71f03 into main Nov 14, 2026
2 checks passed
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.

1 participant