Files
breakpilot-compliance/backend-compliance/tests/test_customer_mission_2.py
T
Benjamin Admin 3856bb3a4f feat: Customer Mission #2 — the company arrives with a PROFILE, not a journey
Second mission, deliberately different from #1: a highly-certified company (ISO 9001 +
ISO 27001 + ISO 14001 + TISAX + CE + PSIRT) asking „what do WE still need for the CRA?".
Stresses Mission #1's one open seam (Scope → Journey) and proves the reframe with the
real engines:

- The start is a Company Capability Profile (certs aggregated), NOT a single cert→target
  journey. Certifications are OBSERVATIONS feeding the profile.
- Evidence is target-relative: ISO 14001 is in the profile but irrelevant to the CRA;
  PSIRT covers two CRA-delta capabilities. More evidence = smaller delta (12 → 9).
- The „journey" is the computed delta (Profile, Target) — not a thing a selector picks.
  This SHRINKS Mission #1's jump: the seam is profile-intake + target-pick, not a
  journey-matcher engine. There is no „ISO 27001 → CRA"; only „Profile → CRA".

Records the 5 per-mission selection-rationale questions (which journey/why/decisive
info/model-extended?/new-parameter?). Selector input = (Company Profile, Target), which
collapses the 2^N cert-combination explosion.

Non-runtime (reference_scenarios + tests only) -> no deploy. 6 tests pass; check-loc 0.
2026-06-28 09:00:51 +02:00

71 lines
2.4 KiB
Python

"""Customer Mission #2 — the company arrives with a PROFILE, not a journey.
Pins the reframe Mission #2 proves with the real engines: the start state is a Company Capability
Profile (many certs aggregated), certifications are observations/evidence, and more evidence shrinks
the delta (single-cert 12 → multi-cert 9). The „journey" is the computed delta `(Profile, Target)`,
not a thing a selector picks — which shrinks Mission #1's one open seam.
"""
from __future__ import annotations
import os
import subprocess
import sys
def _run_mission():
root = os.path.join(os.path.dirname(__file__), "..")
r = subprocess.run(
[sys.executable, "reference_scenarios/mission_multicert_cra.py"],
cwd=root, env={**os.environ, "PYTHONPATH": "."}, capture_output=True, text=True,
)
assert r.returncode == 0, r.stderr
return r.stdout
def test_mission_runs_end_to_end():
out = _run_mission()
assert "Customer Mission #2" in out
assert "Company Capability Profile — der eigentliche Startzustand" in out
def test_more_evidence_shrinks_the_delta():
out = _run_mission()
# multi-cert profile (9) must beat the single-cert counterfactual (12) — evidence is additive.
assert "**Delta dieses Profils:** 9" in out
assert "**Gegenprobe (nur ISO 27001):** 12" in out
assert "Mehr Evidence → kleineres Delta" in out
def test_reframe_no_per_certificate_journey():
out = _run_mission()
# the journey is the computed delta (Profile, Target), not a selected cert→target transition.
assert "Keine per-Zertifikat-Journey" in out
assert "Company Capability Profile → CRA" in out
assert "Es wurde **keine Journey ausgewählt**" in out
def test_five_selection_rationale_questions_present():
out = _run_mission()
for q in [
"Welche Journey wurde gewählt?",
"Warum?",
"Welche Informationen waren für die Auswahl entscheidend?",
"Musste das Journey-Modell erweitert werden?",
"Musste ein neuer Selektionsparameter eingeführt werden?",
]:
assert q in out
def test_evidence_is_target_relative():
out = _run_mission()
# honest: ISO 14001 is in the profile but does not help the CRA; PSIRT covers two CRA-delta caps.
assert "ISO 14001" in out and "NICHT relevant" in out
assert "PSIRT" in out
def test_no_real_company_names():
out = _run_mission().lower()
for name in ["eto", "owis", "winterhalter"]:
assert name not in out