test(contributor-scan): pin tier-zero pruning at the scan boundary (5.14)

Four regression tests for the mechanism that landed in 9a8e9f0 and 3b6e642:

- a family absent from the repository is never asked, at callDepth 0 or 3;
- the evidence that prunes a question is asked over that question's own
  scope and at the arbiter's callDepth;
- a pruned question is recorded as deferred with reason tier_zero and
  never as an outcome;
- an evidence summary that does not say the family is absent excludes
  nothing.

Each test was shown red under a control that breaks only the rule it
names. The engine's half of the rules (familyInRepo over the whole graph,
the reachable-set scope above depth 0) is verified by reading taint.sc
only; no executable test pins it.

Task 5.14 stays open: its Observable also asks whether the query completes
on pmpro, and the record on file (2026-09-22) answers that it does not.
This commit is contained in:
Marius Ciepluch
2026-11-24 11:43:37 +01:00
parent d26fbcbe53
commit 4c5b5d7932
3 changed files with 146 additions and 0 deletions
+15
View File
@@ -158,6 +158,21 @@ def test_partial_evidence_batch_is_unknown_not_tier_zero(tmp_path):
assert result.family_coverage[0].deferred == 1
def test_a_pruned_question_is_recorded_as_skipped_and_never_as_an_outcome(tmp_path):
"""contributor-scan 5.14: a skipped question is recorded as skipped, not as answered. `question_outcomes`
is the list of questions the engine was asked -- the family census counts its requests from it -- so a
tier-zero question belongs in `scope.deferred`, with its reason, and nowhere else. Recorded as completed it
would be a verdict; recorded as unanswered it would read as a scan that failed to ask."""
result = scan_repository(
source(tmp_path, "a.py", "b.py"),
[region("a.py"), region("b.py")],
backend=Backend({"a.py": vector(False), "b.py": vector()}),
ranking_mode="evidence",
)
assert [(q.identity.path, q.reason) for q in result.scope.deferred] == [("a.py", "tier_zero")]
assert [o.identity.path for o in result.question_outcomes] == ["b.py"], "a pruned question is neither answered nor left unanswered"
def test_later_timeout_retains_raw_answer_without_claiming_arbitration(tmp_path):
import time