@@ -45,6 +45,42 @@ def test_ignores_aligned_pr_guidance(self) -> None:
4545
4646 self .assertEqual (report .conflict_group_count , 0 )
4747
48+
49+ def test_does_not_treat_negated_pr_guidance_as_pr_requirement (self ) -> None :
50+ with tempfile .TemporaryDirectory () as tmp_dir :
51+ root = Path (tmp_dir )
52+ (root / "AGENTS.md" ).write_text (
53+ "# Agent instructions\n \n - Commit directly to main.\n " ,
54+ encoding = "utf-8" ,
55+ )
56+ (root / "CLAUDE.md" ).write_text (
57+ "# Claude instructions\n \n - Do not use pull requests for changes to main.\n " ,
58+ encoding = "utf-8" ,
59+ )
60+
61+ report = build_conflict_report (root , discover_instruction_files (root ))
62+
63+ self .assertEqual (report .conflict_group_count , 0 )
64+
65+ def test_reports_negated_pr_guidance_against_pr_requirement (self ) -> None :
66+ with tempfile .TemporaryDirectory () as tmp_dir :
67+ root = Path (tmp_dir )
68+ (root / "AGENTS.md" ).write_text (
69+ "# Agent instructions\n \n - Do not use pull requests for changes to main.\n " ,
70+ encoding = "utf-8" ,
71+ )
72+ (root / "CLAUDE.md" ).write_text (
73+ "# Claude instructions\n \n - Use pull requests for changes to main.\n " ,
74+ encoding = "utf-8" ,
75+ )
76+
77+ report = build_conflict_report (root , discover_instruction_files (root ))
78+
79+ self .assertEqual (report .conflict_group_count , 1 )
80+ self .assertEqual (report .groups [0 ].topic , "main integration" )
81+ self .assertEqual ([location .path for location in report .groups [0 ].allow_locations ], ["AGENTS.md" ]) # noqa: E501
82+ self .assertEqual ([location .path for location in report .groups [0 ].block_locations ], ["CLAUDE.md" ]) # noqa: E501
83+
4884 def test_rejects_symlinked_instruction_files (self ) -> None :
4985 with tempfile .TemporaryDirectory () as tmp_dir :
5086 root = Path (tmp_dir )
0 commit comments