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
+8
View File
@@ -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