← Về thư mục
scripts/test_check_firm_rules_sync.py
- _run · function · L32-L33 — def _run(root: Path) -> subprocess.CompletedProcess[str]
- tree · function · L37-L51 — def tree(tmp_path: Path) -> Path
- _mutate · function · L54-L58 — def _mutate(root: Path, rel: str, old: str, new: str) -> None
- test_clean_tree_passes · function · L63-L65 — def test_clean_tree_passes(tree: Path) -> None
- test_mirror_wording_drift_fails · function · L70-L79 — def test_mirror_wording_drift_fails(tree: Path) -> None: # Alter the canonical operative clause in the synthesis mirror.
- test_mirror_wording_drift_in_writer_fails · function · L82-L90 — def test_mirror_wording_drift_in_writer_fails(tree: Path) -> None
- test_semantic_edit_in_agent_slot_fails · function · L93-L104 — def test_semantic_edit_in_agent_slot_fails(tree: Path) -> None: # The wildcard must not be wide enough to swallow a semantic edit # smuggled into the self-reference slot. "agent or compiler" is 4 words / # contains "or" → must NOT match → flagged as drift.
- test_renaming_cim_back_to_contamination_id_fails · function · L109-L117 — def test_renaming_cim_back_to_contamination_id_fails(tree: Path) -> None: # Reverting the rule heading to the contamination ID breaks BOTH the sync # check (canonical clause's ID no longer matches) AND the collision guard. # Either failure is acceptable here; this test guards the rename, not the # collision guard in isolation (see test_stray_contamination_id_in_section).
- test_stray_contamination_id_in_section_fails · function · L120-L134 — def test_stray_contamination_id_in_section_fails(tree: Path) -> None: # Inject a stray contamination ID into the Claim Intent Manifest section # body WITHOUT touching any R-CIM canonical clause. This isolates the # collision guard: the sync check still passes, so only the collision guard # can catch this. Regression test for the (v3.8)-header bug that silently # disabled the guard.
- test_stray_contamination_id_behind_fenced_fake_heading_fails · function · L137-L154 — def test_stray_contamination_id_behind_fenced_fake_heading_fails(tree: Path) -> None: # A forbidden contamination ID hidden inside the section after a FENCED fake #
## heading must still be caught. A naive section extractor that stops at # any ## line would terminate the section early at the fake heading and # miss the ID. Regression guard for the fence-aware _extract_section: the # fake ## Legacy is inside a ``` block, so it does NOT end the section. # Anchor on the section-internal R-CIM-A bullet (unique to the Claim Intent # Manifest section — "Three firm rules:" also appears earlier in the prompt, # outside the section, so anchoring there would inject out-of-section).
- test_full_contamination_namespace_guarded_in_section · function · L157-L169 — def test_full_contamination_namespace_guarded_in_section(tree: Path) -> None: # The guard seals the whole R-L3-2-A..E namespace, not just the A/B/C that # historically collided. A D/E ID appearing in the claim-manifest section is # still a leak (claim-manifest surfaces carry no contamination IDs at all).
- test_contamination_id_in_schema_fails · function · L172-L176 — def test_contamination_id_in_schema_fails(tree: Path) -> None
- test_cim_id_in_formatter_fails · function · L181-L190 — def test_cim_id_in_formatter_fails(tree: Path) -> None: # Inject an R-CIM token into the contamination pass-through paragraph.
- test_contradiction_phrase_in_r_l3_2_a_sentence_fails · function · L195-L206 — def test_contradiction_phrase_in_r_l3_2_a_sentence_fails(tree: Path) -> None
- test_contradiction_guard_does_not_flag_collaboration_observer · function · L209-L222 — def test_contradiction_guard_does_not_flag_collaboration_observer(tree: Path) -> None
- test_contradiction_phrase_after_semicolon_still_caught · function · L225-L236 — def test_contradiction_phrase_after_semicolon_still_caught(tree: Path) -> None
- test_contradiction_phrase_outside_r_l3_2_a_sentence_passes · function · L239-L248 — def test_contradiction_phrase_outside_r_l3_2_a_sentence_passes(tree: Path) -> None
- test_missing_canonical_block_fails · function · L253-L267 — def test_missing_canonical_block_fails(tree: Path) -> None
- test_missing_cim_section_header_fails · function · L272-L282 — def test_missing_cim_section_header_fails(tree: Path) -> None: # Rename the section header so it no longer matches. The collision guard # must REFUSE (flag the missing section), not pass vacuously.
- test_missing_guard_file_fails · function · L285-L291 — def test_missing_guard_file_fails(tree: Path) -> None: # Delete a contamination-context file. The guard must flag the absence, # not silently skip it.
- test_extract_section_tolerates_version_suffix · function · L296-L298 — def test_extract_section_tolerates_version_suffix() -> None
- test_extract_section_at_eof_no_trailing_newline · function · L301-L303 — def test_extract_section_at_eof_no_trailing_newline() -> None
- test_extract_section_does_not_stop_at_level3_heading · function · L306-L309 — def test_extract_section_does_not_stop_at_level3_heading() -> None
- test_extract_section_stops_at_next_level2 · function · L312-L314 — def test_extract_section_stops_at_next_level2() -> None
- test_extract_section_does_not_stop_at_fenced_heading · function · L317-L334 — def test_extract_section_does_not_stop_at_fenced_heading() -> None: # A
## line inside a fenced code block is example text, not a real # section boundary; the section must continue past it so the collision guard # still scans content after the fence.
- test_extract_section_returns_none_when_header_absent · function · L337-L338 — def test_extract_section_returns_none_when_header_absent() -> None