diff --git a/bin/rule_hook/rules.py b/bin/rule_hook/rules.py index 636e7083..9d119eb0 100644 --- a/bin/rule_hook/rules.py +++ b/bin/rule_hook/rules.py @@ -45,7 +45,7 @@ RULES: dict[RuleName, Rule] = { ), "no-ai-attribution": Rule( "no commit, PR, issue comment or file carries a Claude or Anthropic attribution, such as a co-author trailer or a generated-with line", - "a git, gh or tea command, and any file written", + "a git, gh, tea or chunk-pr command, and any file written", ), # A Read carries no text for a marker, and a misjudged read has a way through that the message names, so no marker waives it. "repeat-read": Rule( @@ -140,7 +140,7 @@ def check(breaches: list[Breach], written: str, markdown: bool, bash: bool) -> C def command_breaches(command: str, simples: list[Simple], home: str) -> list[Breach]: breaches = [] found = commits(simples, home) - publishing = [simple for simple in simples if simple.words[0] in ("gh", "git", "tea")] + publishing = [simple for simple in simples if posixpath.basename(simple.words[0]) in ("chunk-pr", "gh", "git", "tea")] if publishing and ATTRIBUTION.search(command): breaches.append(Breach("no-ai-attribution", "the command carries an attribution", publishing[0].directory)) for simple in simples: diff --git a/bin/rule_hook/test_rule_hook.py b/bin/rule_hook/test_rule_hook.py index ded9dc2e..db283b15 100644 --- a/bin/rule_hook/test_rule_hook.py +++ b/bin/rule_hook/test_rule_hook.py @@ -133,8 +133,9 @@ class CommandBreaches(unittest.TestCase): with self.subTest(command): self.assertEqual(checked(command), []) - def test_an_attribution_breaks_only_in_a_git_gh_or_tea_command(self): + def test_an_attribution_breaks_only_in_a_git_gh_tea_or_chunk_pr_command(self): self.assertEqual(checked(f"tea pr create --description '{TRAILER}'"), ["no-ai-attribution"]) + self.assertEqual(checked(f"~/.claude/bin/chunk-pr open 'Do it' '{TRAILER}'"), ["no-ai-attribution"]) self.assertEqual(checked(f"grep -rn '{TRAILER}' ."), []) def test_a_commit_breach_names_the_commit_s_checkout(self):