← Về thư mục
scripts/test_policy_anchor_disclosure.py
- _inp · function · L38-L62 — def _inp( *, ai_used=None, categories=None, policy_anchor="icmje", venue=None, slr_lineage=False, mode_param=None, tool_type="LLM", methodological_in_slr=True, level_of_involvement=None, affected_sections=None, )
- G10PrecedenceTableTest · class · L68-L121 — class G10PrecedenceTableTest(unittest.TestCase)
- test_row_1_ai_used_false_with_used_category_emits_conflict_annotation · method · L69-L74 — def test_row_1_ai_used_false_with_used_category_emits_conflict_annotation(self) -> None
- test_row_2_ai_used_false_clean_no_used_no_uncertain_emits_no_ai_statement · method · L76-L81 — def test_row_2_ai_used_false_clean_no_used_no_uncertain_emits_no_ai_statement(self) -> None
- test_row_3_ai_used_false_with_uncertain_no_used_emits_tension_annotation · method · L83-L88 — def test_row_3_ai_used_false_with_uncertain_no_used_emits_tension_annotation(self) -> None
- test_row_4_ai_used_true_with_used_full_anchor_render · method · L90-L95 — def test_row_4_ai_used_true_with_used_full_anchor_render(self) -> None
- test_row_4_used_category_without_ai_used_flag_full_anchor_render · method · L97-L102 — def test_row_4_used_category_without_ai_used_flag_full_anchor_render(self) -> None
- test_row_5_uncertain_no_used_no_flag_emits_not_supplied_annotation · method · L104-L109 — def test_row_5_uncertain_no_used_no_flag_emits_not_supplied_annotation(self) -> None
- test_row_6_all_not_used_no_uncertain_no_flag_silent · method · L111-L116 — def test_row_6_all_not_used_no_uncertain_no_flag_silent(self) -> None
- test_row_7_empty_input_emits_cold_start_annotation · method · L118-L121 — def test_row_7_empty_input_emits_cold_start_annotation(self) -> None
- AutoPromotionForbiddanceTest · class · L127-L144 — class AutoPromotionForbiddanceTest(unittest.TestCase)
- test_uncertain_never_rendered_as_used_in_row_4 · method · L128-L140 — def test_uncertain_never_rendered_as_used_in_row_4(self) -> None
- test_explicit_promote_raises · method · L142-L144 — def test_explicit_promote_raises(self) -> None
- G1InvariantTest · class · L150-L156 — class G1InvariantTest(unittest.TestCase)
- test_referee_does_not_read_corpus_entry_field · method · L151-L156 — def test_referee_does_not_read_corpus_entry_field(self) -> None: # The referee receives flat input; assert the dataclass has no # 'corpus_entry_ai_disclosure' (the would-be entry-level field).
- G2InvariantTest · class · L162-L196 — class G2InvariantTest(unittest.TestCase)
- test_prisma_track_requires_slr_lineage · method · L163-L173 — def test_prisma_track_requires_slr_lineage(self) -> None: # slr_lineage=False with --policy-anchor=prisma-trAIce → rejected
- test_prisma_track_with_lineage_passes · method · L175-L184 — def test_prisma_track_with_lineage_passes(self) -> None
- test_cold_start_mode_param_substitutes_lineage · method · L186-L196 — def test_cold_start_mode_param_substitutes_lineage(self) -> None
- G5InvariantTest · class · L202-L237 — class G5InvariantTest(unittest.TestCase)
- test_prompt_disclosure_fires_when_all_three_gates_hold · method · L203-L210 — def test_prompt_disclosure_fires_when_all_three_gates_hold(self) -> None
- test_prompt_disclosure_skipped_when_not_prisma_track · method · L212-L219 — def test_prompt_disclosure_skipped_when_not_prisma_track(self) -> None
- test_prompt_disclosure_skipped_when_non_llm_tool · method · L221-L228 — def test_prompt_disclosure_skipped_when_non_llm_tool(self) -> None
- test_prompt_disclosure_skipped_when_copyediting_only · method · L230-L237 — def test_prompt_disclosure_skipped_when_copyediting_only(self) -> None
- G7InvariantTest · class · L243-L258 — class G7InvariantTest(unittest.TestCase)
- test_nature_carveout_eliminates · method · L244-L246 — def test_nature_carveout_eliminates(self) -> None
- test_ieee_carveout_downgrades · method · L248-L250 — def test_ieee_carveout_downgrades(self) -> None
- test_prisma_carveout_out_of_scope · method · L252-L254 — def test_prisma_carveout_out_of_scope(self) -> None
- test_icmje_carveout_not_addressed · method · L256-L258 — def test_icmje_carveout_not_addressed(self) -> None
- G8InvariantTest · class · L264-L330 — class G8InvariantTest(unittest.TestCase)
- test_ieee_render_requires_both_level_and_sections · method · L265-L270 — def test_ieee_render_requires_both_level_and_sections(self) -> None
- test_ieee_render_requires_level_when_sections_present · method · L272-L277 — def test_ieee_render_requires_level_when_sections_present(self) -> None
- test_ieee_render_passes_when_both_present · method · L279-L284 — def test_ieee_render_passes_when_both_present(self) -> None: # Should not raise
- test_ieee_row_4_render_enforces_pairing · method · L286-L300 — def test_ieee_row_4_render_enforces_pairing(self) -> None: # Codex round-3 P2 #1 closure: previously row 4 returned # anchor_render for IEEE even when only level_of_involvement was # supplied (no affected_sections). The decision function must # raise PairedMandateViolation in that case.
- test_ieee_row_4_render_passes_when_both_inputs_present · method · L302-L313 — def test_ieee_row_4_render_passes_when_both_inputs_present(self) -> None
- test_ieee_row_4_render_passes_when_neither_pairing_input_present · method · L315-L330 — def test_ieee_row_4_render_passes_when_neither_pairing_input_present(self) -> None: # When neither IEEE-pairing input is supplied, the renderer still # proceeds — the missing pairing surfaces as a per-facet "not # supplied" annotation downstream (per protocol §3.4); it is not # a hard violation at the decision-table level.
- G9InvariantTest · class · L336-L349 — class G9InvariantTest(unittest.TestCase)
- test_anchor_image_regimes_are_distinct · method · L337-L343 — def test_anchor_image_regimes_are_distinct(self) -> None
- test_nature_regime_is_default_deny · method · L345-L346 — def test_nature_regime_is_default_deny(self) -> None
- test_ieee_regime_folds_into_acknowledgments · method · L348-L349 — def test_ieee_regime_folds_into_acknowledgments(self) -> None
- Concern1Test · class · L355-L367 — class Concern1Test(unittest.TestCase)
- test_slr_lineage_input_directly_drives_track · method · L356-L367 — def test_slr_lineage_input_directly_drives_track(self) -> None: # Even with origin_mode=full, slr_lineage=true routes to prisma-trAIce
- Concern5Test · class · L373-L381 — class Concern5Test(unittest.TestCase)
- test_nature_image_render_emits_two_channels · method · L374-L381 — def test_nature_image_render_emits_two_channels(self) -> None
- Concern6Test · class · L387-L401 — class Concern6Test(unittest.TestCase)
- test_used_and_uncertain_mix_renders_used_with_uncertain_annotation · method · L388-L401 — def test_used_and_uncertain_mix_renders_used_with_uncertain_annotation(self) -> None
- Concern7Test · class · L407-L472 — class Concern7Test(unittest.TestCase)
- test_consistent_nature_pair_passes · method · L408-L418 — def test_consistent_nature_pair_passes(self) -> None: # --venue=Nature + --policy-anchor=nature is consistent
- test_conflicting_pair_rejected · method · L420-L429 — def test_conflicting_pair_rejected(self) -> None
- test_unmapped_venue_with_anchor_rejected · method · L431-L442 — def test_unmapped_venue_with_anchor_rejected(self) -> None: # Codex round-1 P2 #2 closure: unmapped venue (ICLR) with anchor # must reject, not silently fall through.
- test_nature_spelling_variant_with_non_nature_anchor_rejected · method · L444-L456 — def test_nature_spelling_variant_with_non_nature_anchor_rejected(self) -> None: # Codex round-1 P2 #2 secondary case: even a Nature-shaped venue # string outside the canonical set must reject when paired with a # non-nature anchor.
- test_nature_db_label_with_nature_anchor_passes · method · L458-L472 — def test_nature_db_label_with_nature_anchor_passes(self) -> None: # Codex round-2 P2 #1 closure: the v3.2 venue_disclosure_policies # entry uses "Nature (Nature Publishing Group)" as its label. # That exact string + policy_anchor='nature' must be treated as a # consistent pair (not raised). Without this, every author using # the existing policy database name would be blocked.
- CategoryStateEnumValidationTest · class · L478-L496 — class CategoryStateEnumValidationTest(unittest.TestCase)
- test_lowercase_used_raises · method · L479-L483 — def test_lowercase_used_raises(self) -> None
- test_typo_category_state_raises · method · L485-L489 — def test_typo_category_state_raises(self) -> None
- test_valid_states_pass · method · L491-L496 — def test_valid_states_pass(self) -> None: # All three canonical states pass without raising; smoke check.
- SelectorUnsuppliedTest · class · L502-L523 — class SelectorUnsuppliedTest(unittest.TestCase)
- test_no_selector_at_all_raises · method · L503-L507 — def test_no_selector_at_all_raises(self) -> None
- test_venue_only_delegates_to_venue_path · method · L509-L523 — def test_venue_only_delegates_to_venue_path(self) -> None: # Codex round-4 P2 #2: RendererInput(venue="ICLR", policy_anchor=None) # used to default policy_anchor to "icmje" and produce a conflict # error. Now the referee delegates the venue-only case to v3.2.
- NaturePortfolioVariantTest · class · L529-L582 — class NaturePortfolioVariantTest(unittest.TestCase)
- test_nature_medicine_with_nature_anchor_passes · method · L530-L543 — def test_nature_medicine_with_nature_anchor_passes(self) -> None: # Codex round-4 P2 #3: Nature Portfolio journals (Nature Medicine, # Nature Climate Change, Nature Communications, …) all inherit # the parent Nature AI policy. Pairing any of them with # policy_anchor='nature' is a consistent pair, not a conflict.
- test_nature_communications_with_nature_anchor_passes · method · L545-L554 — def test_nature_communications_with_nature_anchor_passes(self) -> None
- test_unrelated_journal_with_nature_anchor_still_rejects · method · L556-L566 — def test_unrelated_journal_with_nature_anchor_still_rejects(self) -> None: # Non-Nature-prefixed venue + nature anchor remains a conflict.
- test_helper_returns_true_for_canonical_names · method · L568-L570 — def test_helper_returns_true_for_canonical_names(self) -> None
- test_helper_returns_true_for_prefix_journals · method · L572-L574 — def test_helper_returns_true_for_prefix_journals(self) -> None
- test_helper_returns_false_for_unrelated_journals · method · L576-L582 — def test_helper_returns_false_for_unrelated_journals(self) -> None
- PolicyAnchorEnumValidationTest · class · L588-L607 — class PolicyAnchorEnumValidationTest(unittest.TestCase)
- test_typo_anchor_value_raises · method · L589-L597 — def test_typo_anchor_value_raises(self) -> None
- test_unknown_anchor_value_raises · method · L599-L607 — def test_unknown_anchor_value_raises(self) -> None
- Concern10Test · class · L613-L645 — class Concern10Test(unittest.TestCase)
- test_bare_ai_used_true_no_categories_triggers_categorization_flow · method · L614-L619 — def test_bare_ai_used_true_no_categories_triggers_categorization_flow(self) -> None
- test_bare_ai_used_true_all_not_used_triggers_categorization_flow · method · L621-L633 — def test_bare_ai_used_true_all_not_used_triggers_categorization_flow(self) -> None: # ai_used=true contradicts everything-NOT-USED; row 1 doesn't apply # (row 1 needs USED) → caught by concern #10 gate. Codex round-5 # P2 #2: protocol §3 G10 row 4 sub-gate spec extended to cover # this case (was bare-flag only previously). Referee already # handled it correctly; protocol doc now aligned.
- test_ai_used_true_with_uncertain_only_triggers_categorization · method · L635-L645 — def test_ai_used_true_with_uncertain_only_triggers_categorization(self) -> None: # Edge case from round-5 P2 #2: ai_used=true + only UNCERTAIN # categories should also trigger categorization flow rather than # a row-4 render (no USED facets means no substantive content).
- Concern11Test · class · L651-L662 — class Concern11Test(unittest.TestCase)
- test_renderer_input_excludes_corpus_entry_fields · method · L652-L656 — def test_renderer_input_excludes_corpus_entry_fields(self) -> None
- test_plumbing_inputs_are_runtime_signals · method · L658-L662 — def test_plumbing_inputs_are_runtime_signals(self) -> None: # slr_lineage + mode_param are runtime renderer inputs, not entry-level