test_grading_appends_a_pass_history¶
Tests › tests/test_acceptance_cli.py
What this test is for
Why it exists
MEASURED, AND THE MEASUREMENT ATE ITS OWN EVIDENCE. Regrading five cells against an unchanged rubric moved one by -12.1 points, and which marks flipped is now unrecoverable — the second pass overwrote the first. A variance figure needs BOTH passes; grading kept one.
Given
answers = tmp_path / "answers"answers.mkdir()
5 more
(answers / f"Q1_sonnet_{_A}_r1.md").write_text("an answer", encoding="utf-8")scores = iter([True, False])def scored(question, answer, rubric, arm): return score.QuestionResult( id=question.id, decisions=[ score.Decision("m", "conclusion", 2, next(scores), agreement=1.0, samples=3) ], )monkeypatch.setattr(cli, "score_question", scored)args = argparse.Namespace(rubric=MBEDTLS, answers=answers)
When
cli.cmd_grade(args)latest = json.loads((answers / f"Q1_sonnet_{_A}_r1.grade.json").read_text())history = (answers / f"Q1_sonnet_{_A}_r1.grades.jsonl").read_text().splitlines()
2 more
passes = [json.loads(line) for line in history]all(p["rubric_digest"] == latest["rubric_digest"] for p in passes)
Then
- ✓ cli.cmd_grade(args) equals 0
- ✓ cli.cmd_grade(args) equals 0
- ✓ latest["score"] equals 0.0
- ✓ len(history) equals 2
- ✓ [p["score"] for p in passes] equals [1.0, 0.0]
- ✓ passes[0]["decisions"][0]["hit"] is True
- ✓ passes[1]["decisions"][0]["hit"] is False
- ✓ all(p["rubric_digest"] == latest["rubric_digest"] for p in passes) holds
tests/test_acceptance_cli.py:646 · its file's page
What it checks (8)
assert cli.cmd_grade(args) == 0observescmd_gradeassert cli.cmd_grade(args) == 0observescmd_gradeassert latest["score"] == 0.0, "the sidecar holds the LATEST pass"not attributedassert len(history) == 2, f"both passes must be retained, got {len(history)}"not attributedassert [p["score"] for p in passes] == [1.0, 0.0], "in the order they were graded"not attributedassert passes[0]["decisions"][0]["hit"] is True, "a pass keeps its DECISIONS, not just a score"not attributedassert passes[1]["decisions"][0]["hit"] is Falsenot attributedassert all(p["rubric_digest"] == latest["rubric_digest"] for p in passes), ( "each pass records the rubric it graded against, or a drift cannot be told from noise" )observesall
Where the product reaches it
dossier→_rank_enum_over_mirror→_class_side_is_only_enum_mirrors→all(flow)
Call flow
What it reaches
Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.
Also reaches 1 requirement
Its run touches their code; that is reach, not proof.
- REQ-DDB-WIKI-054 inferred