OUTPUT #1095 | 1098 karakter | 24 satır
# ─── stage-2 question shape ──────────────────────────────────────────────────
def test_rerank_asks_one_absolute_question_per_candidate():
    by_name = {"a": skill("a"), "b": skill("b")}
    questions = rerank_questions(["a", "b"], by_name)

    assert set(questions) == {"which", "fits::a", "fits::b"}
    assert NONE in questions["which"]["criteria"]
    assert "Does the skill 'a' do the specific thing" in questions["fits::a"]["instructions"]
    assert questions["which"]["instructions"] != CHOICE_INSTRUCTIONS


def test_stage_two_sees_full_descriptions_not_index_lines():
    long_description = "x" * 400
    client = scripted_client(stage1="long", stage2="long", fits={"long": 0.8})
    suggest(client, "do the thing", [skill("long", description=long_description)])

    call = client.stage2_calls[0]
    assert long_description in _criteria(call)["long"]
    # Stage 2 always offers the no-match option; every *candidate* is a shortlist member,
    # never the whole roster.
    assert set(_criteria(call)) - {NONE} == {"long"}


root@213-238-170-219:/home/hermes#