mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-12-04 02:38:18 +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:
@@ -44,6 +44,14 @@ def test_no_sink_anywhere_in_the_repository_is_tier_zero_at_any_depth() -> None:
|
||||
assert e is not None and e.tier == TIER_EXCLUDE
|
||||
|
||||
|
||||
def test_a_summary_that_does_not_say_the_family_is_absent_excludes_nothing() -> None:
|
||||
"""The repository-wide cut acts on an explicit answer. An engine that omits `familyInRepo` has not said the
|
||||
family is nowhere in the repository, and reading silence as absence would make every pair tier 0."""
|
||||
rows = [{key: value for key, value in SUMMARY.items() if key != "familyInRepo"}, _sink("os.system(cmd)")]
|
||||
e = evidence_from_rows(rows, entry=True)
|
||||
assert e is not None and e.tier != TIER_EXCLUDE
|
||||
|
||||
|
||||
def test_a_sink_with_no_source_is_asked_last() -> None:
|
||||
e = evidence_from_rows([SUMMARY, _sink('$wpdb->get_row("... $id")')])
|
||||
assert e is not None and e.tier == TIER_NO_SOURCE
|
||||
|
||||
Reference in New Issue
Block a user