test_grading_appends_a_pass_history

Tests › tests/test_acceptance_cli.py

passed Passed in the packaged run.

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

  1. answers = tmp_path / "answers"
  2. answers.mkdir()
5 more
  1. (answers / f"Q1_sonnet_{_A}_r1.md").write_text("an answer", encoding="utf-8")
  2. scores = iter([True, False])
  3. 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) ], )
  4. monkeypatch.setattr(cli, "score_question", scored)
  5. args = argparse.Namespace(rubric=MBEDTLS, answers=answers)
→

When

  1. cli.cmd_grade(args)
  2. latest = json.loads((answers / f"Q1_sonnet_{_A}_r1.grade.json").read_text())
  3. history = (answers / f"Q1_sonnet_{_A}_r1.grades.jsonl").read_text().splitlines()
2 more
  1. passes = [json.loads(line) for line in history]
  2. all(p["rubric_digest"] == latest["rubric_digest"] for p in passes)
→

Then

  1. ✓ cli.cmd_grade(args) equals 0
  2. ✓ cli.cmd_grade(args) equals 0
  3. ✓ latest["score"] equals 0.0
  4. ✓ len(history) equals 2
  5. ✓ [p["score"] for p in passes] equals [1.0, 0.0]
  6. ✓ passes[0]["decisions"][0]["hit"] is True
  7. ✓ passes[1]["decisions"][0]["hit"] is False
  8. ✓ 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)

  1. assert cli.cmd_grade(args) == 0 observes cmd_grade
  2. assert cli.cmd_grade(args) == 0 observes cmd_grade
  3. assert latest["score"] == 0.0, "the sidecar holds the LATEST pass" not attributed
  4. assert len(history) == 2, f"both passes must be retained, got {len(history)}" not attributed
  5. assert [p["score"] for p in passes] == [1.0, 0.0], "in the order they were graded" not attributed
  6. assert passes[0]["decisions"][0]["hit"] is True, "a pass keeps its DECISIONS, not just a score" not attributed
  7. assert passes[1]["decisions"][0]["hit"] is False not attributed
  8. assert 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" ) observes all

Where the product reaches it

  • dossier → _rank_enum_over_mirror → _class_side_is_only_enum_mirrors → all (flow)

Call flow

test_grading_appends_a_pass_history→cmd_grade→all

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.

test_grading_appends_a_pass_history · 8 checksallREQ-DDB-WIKI-054 · inferred
Also reaches 1 requirement

Its run touches their code; that is reach, not proof.