mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-12-03 18:28:19 +00:00
test(contributor-scan): pin tier-zero pruning at the scan boundary (5.14)
Four regression tests for the mechanism that landed in9a8e9f0and3b6e642: - 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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user