test: check the domain layer against sys.stdlib_module_names

The layering test pinned an exact import set, so any new stdlib import in
skills/issue tripped it — 'collections', added by issue_ac.py, did. Assert
the rule AGENTS.md actually states (stdlib only, never subprocess) instead
of a frozen snapshot of it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
naudachu
2026-08-10 15:43:24 +05:00
parent 484da64621
commit 47f53a7edc
+5 -3
View File
@@ -425,9 +425,11 @@ class TestLayering(unittest.TestCase):
for line in f: for line in f:
if line.startswith(("import ", "from ")): if line.startswith(("import ", "from ")):
imported.add(line.split()[1].split(".")[0]) imported.add(line.split()[1].split(".")[0])
local = {"issue", "issue_index"} local = {"issue", "issue_ac", "issue_index"}
self.assertEqual(imported - local, {"argparse", "os", "re", "sys"}, foreign = imported - local - sys.stdlib_module_names
"non-stdlib or unexpected import in the domain layer") self.assertEqual(foreign, set(),
"non-stdlib import in the domain layer: %s"
% ", ".join(sorted(foreign)))
self.assertNotIn("subprocess", imported) self.assertNotIn("subprocess", imported)