Files
breakpilot-compliance/backend-compliance/tests/test_customer_mission_5.py
T
Benjamin Admin dbf7b9b587 feat: Customer Mission #5 — a non-security target, evidence relevance flips both ways
Closes the Evidence-Relevance(Target) claim by testing it on a deliberately NON-security target
(a hand-authored environmental / material-evidence Required set — no corpus, no ISO-14001 norm
model, no new module). One company profile, three targets through the same engine:

  - ISO 14001: keine (CRA) / keine (TISAX) / HOCH (environmental)   <- flips
  - ISO 27001: hoch (CRA) / hoch (TISAX) / keine (environmental)    <- flips the other way
  - PSIRT:     hoch (CRA) / keine (TISAX) / keine (environmental)

Proves relevance(evidence, target) is two-sided: no evidence is relevant "in itself"; relevance
only arises against a target -> it must be computed, never stored as an attribute of the evidence.

With this, the target-type diversity for the later selector is complete (Regulation · Certification
· Contract/Tender · OEM-Spec · Environmental/Material) — five target types through one engine, so a
Scope→Journey selector finally makes sense. Synthetic, no real names. Non-runtime -> no deploy. 5 tests.
2026-06-28 10:18:28 +02:00

56 lines
1.9 KiB
Python

"""Customer Mission #5 — a non-security target: evidence relevance flips both ways.
Pins the one claim this mission exists to prove: relevance(evidence, target) is a function of the
TARGET, not an attribute of the evidence. The same ISO 14001 is keine against CRA/TISAX but hoch
against an environmental/material target, while the security certs flip the other way (hoch against
security targets, keine against the environmental one). Tight scope: no corpus, no norm model, no
new runtime module, no real names.
"""
from __future__ import annotations
import os
import subprocess
import sys
def _run():
root = os.path.join(os.path.dirname(__file__), "..")
r = subprocess.run(
[sys.executable, "reference_scenarios/mission_non_security_target.py"],
cwd=root, env={**os.environ, "PYTHONPATH": "."}, capture_output=True, text=True,
)
assert r.returncode == 0, r.stderr
return r.stdout
def test_runs_end_to_end():
out = _run()
assert "Customer Mission #5" in out
def test_iso14001_relevance_flips_to_high_on_environmental_target():
out = _run()
# the headline: same cert, keine against security targets, hoch against the environmental one
assert "**ISO14001** | keine (0) | keine (0) | hoch (3) |" in out
def test_security_evidence_is_worthless_against_environmental_target():
out = _run()
# symmetry: security certs are relevant for security, keine for the environmental target
assert "**ISO27001** | hoch (5) | hoch (3) | keine (0) |" in out
assert "**PSIRT** | hoch (3) | keine (0) | keine (0) |" in out
def test_relevance_is_a_function_of_the_target():
out = _run()
assert "relevance(evidence, target)` zweiseitig bewiesen" in out
# five target types now covered -> selector becomes sensible
assert "fünf Zielarten" in out
def test_no_real_company_names():
out = _run().lower()
for name in ["eto", "owis", "winterhalter"]:
assert name not in out