From 35e780cf7990a1b3f7833fe57ac9852878a955d2 Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Mon, 23 Nov 2026 19:16:17 +0000 Subject: [PATCH] ci(check_tarball): refuse AGENTS.md at any depth An AGENTS.md under roles/ holds contributor rules; shipped in the Collection, a consumer's agent reading an installed role would load them. galaxy.yml build_ignore lists the current ones, and the archive check now refuses any AGENTS.md, compared case-insensitively, as the allow list behind that deny list. A root AGENTS.md was already refused by ALLOWED_TOP. Refs: #244 Assisted-by: Claude Code --- scripts/check_tarball.py | 2 ++ tests/scripts/test_check_tarball.py | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/scripts/check_tarball.py b/scripts/check_tarball.py index e672fb8..a5a7686 100644 --- a/scripts/check_tarball.py +++ b/scripts/check_tarball.py @@ -89,6 +89,8 @@ FORBIDDEN = [ "*.env.*", "*/.env*", ".env*", + # Contributor rules: a consumer's agent reading an installed role would load them. + "*/agents.md", ] # Names Windows treats as devices, with or without an extension (and with trailing spaces). WINDOWS_RESERVED = { diff --git a/tests/scripts/test_check_tarball.py b/tests/scripts/test_check_tarball.py index 77ddf3d..1486a05 100644 --- a/tests/scripts/test_check_tarball.py +++ b/tests/scripts/test_check_tarball.py @@ -70,6 +70,22 @@ class TarballTest(unittest.TestCase): self.assertEqual(len(found), 1, name) self.assertIn("forbidden pattern", found[0], name) + def test_agents_md_is_refused_at_any_depth(self): + for name in ( + "roles/AGENTS.md", + "roles/x/AGENTS.md", + "roles/x/templates/Agents.md", + ): + found = check_tarball.problems([name]) + self.assertEqual(len(found), 1, name) + self.assertIn("forbidden pattern", found[0], name) + self.assertEqual( + check_tarball.problems( + ["roles/x/README.md", "roles/x/files/agents_notes.md"] + ), + [], + ) + def test_ambiguous_names_are_rejected(self): cases = { "roles/a/x ": "ends in a space or a dot",