diff --git a/tests/test_adr_0163_d2_discrete_count_injection.py b/tests/test_adr_0163_d2_discrete_count_injection.py index 1a81cdba..2b23d5c9 100644 --- a/tests/test_adr_0163_d2_discrete_count_injection.py +++ b/tests/test_adr_0163_d2_discrete_count_injection.py @@ -140,8 +140,18 @@ class TestExtractionRefusal: def test_missing_counted_noun_refused(self) -> None: assert _try_extract("Sam has 5.") is None - def test_pronoun_subject_refused(self) -> None: - assert _try_extract("He has 5 apples.") is None + def test_pronoun_subject_flagged_for_resolution(self) -> None: + # ADR-0174: a bare pronoun subject is no longer hard-refused at + # extraction. It is admitted but tagged requires_pronoun_resolution=True; + # the candidate-graph (generate/math_candidate_graph.py) then refuses to + # commit an answer unless the pronoun resolves, so serving still refuses + # bare pronoun subjects end-to-end ("He has 5 apples. How many ..." -> + # answer=None). The defensive flag — not a None return — is the + # extraction-level contract; its absence would re-open the ADR-0174 + # wrong=0 hazard, so pin it here. + result = _try_extract("He has 5 apples.") + assert result is not None + assert result["requires_pronoun_resolution"] is True def test_lowercase_subject_refused(self) -> None: assert _try_extract("sam has 5 apples.") is None diff --git a/tests/test_propose_from_exemplars_cli.py b/tests/test_propose_from_exemplars_cli.py index 86d3c63c..7ef3def5 100644 --- a/tests/test_propose_from_exemplars_cli.py +++ b/tests/test_propose_from_exemplars_cli.py @@ -132,7 +132,7 @@ def test_cli_single_corpus_produces_pending_proposal(tmp_path: Path) -> None: assert rec["proposal"]["source"]["kind"] == "exemplar_corpus" -def test_cli_all_flag_proposes_three_corpora(tmp_path: Path) -> None: +def test_cli_all_flag_proposes_all_exemplar_corpora(tmp_path: Path) -> None: log_path = tmp_path / "proposals.jsonl" code, out, _ = _invoke_cli([ "teaching", "propose-from-exemplars", @@ -143,8 +143,15 @@ def test_cli_all_flag_proposes_three_corpora(tmp_path: Path) -> None: assert code == 0 payload = json.loads(out) cats = {p["shape_category"] for p in payload["proposals"]} + # --all proposes one pending proposal per exemplar corpus. The set grew + # from the original three as the ME-1..ME-5 matcher waves added + # currency_amount, discrete_count_statement, and multiplicative_aggregation + # exemplar corpora. Update this set when a new exemplar corpus is added. assert cats == { + "currency_amount", "descriptive_setup_no_quantity", + "discrete_count_statement", + "multiplicative_aggregation", "rate_with_currency", "temporal_aggregation", }