From 867f8c38543980617767b8ae38ce28b389cc207a Mon Sep 17 00:00:00 2001 From: Benjamin Admin Date: Sun, 28 Jun 2026 19:31:15 +0200 Subject: [PATCH] =?UTF-8?q?feat(onboarding):=20make=20the=20advisor=20visi?= =?UTF-8?q?bly=20responsive=20=E2=80=94=20headline=20leads=20with=20the=20?= =?UTF-8?q?moving=20number=20+=20auto-recompute?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Testing surfaced that toggling certifications appeared to "do nothing": the headline led with the TOTAL requirement count (constant per target, e.g. 17 for CRA), and the page only recomputed on an explicit button click. Both fixed: - engine.py headline now leads with the number that actually moves: "11 von 17 Anforderungen offen · 6 wahrscheinlich (Zertifikate) · 5 zu klären" (was "17 Anforderungen erkannt · …"). Keeps the "automatisch erkannt (Intake)" substring. - frontend auto-recomputes on certifications / target / scanner-signal change (no button needed). Now ISO27001 alone -> "13 von 17 offen · 4 wahrscheinlich"; + ISO9001+TISAX+IEC62443 -> "11 von 17 offen · 6 wahrscheinlich". (Domain truth stays visible: CRA's product-cyber gaps barely move with management-system certs.) 28 onboarding+transition tests pass, check-loc 0. --- admin-compliance/app/sdk/onboarding-advisor/page.tsx | 3 +++ backend-compliance/compliance/onboarding/engine.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/admin-compliance/app/sdk/onboarding-advisor/page.tsx b/admin-compliance/app/sdk/onboarding-advisor/page.tsx index 33f848a8..a3932e43 100644 --- a/admin-compliance/app/sdk/onboarding-advisor/page.tsx +++ b/admin-compliance/app/sdk/onboarding-advisor/page.tsx @@ -96,6 +96,9 @@ export default function OnboardingAdvisorPage() { } finally { setLoading(false) } } + // auto-recompute when certifications / target / scanner signals change (no button click needed) + useEffect(() => { if (certs.length) run() }, [certs, target, findings]) // eslint-disable-line react-hooks/exhaustive-deps + return (
diff --git a/backend-compliance/compliance/onboarding/engine.py b/backend-compliance/compliance/onboarding/engine.py index a226287c..5ad2a67f 100644 --- a/backend-compliance/compliance/onboarding/engine.py +++ b/backend-compliance/compliance/onboarding/engine.py @@ -143,8 +143,8 @@ def advisor_start( next_best_questions=next_q, capability_delta=delta, top_measures=measures, evidence_requests=evidence, unsupported_domains=unsupported, completeness_summary=rep.completeness_summary, - headline="%d Anforderungen erkannt · %d automatisch erkannt (Intake) · %d wahrscheinlich (Zertifikate) · %d zu klären" - % (len(assess.coverage), len(auto_detected), len(probably), len(next_q))) + headline="%d von %d Anforderungen offen · %d automatisch erkannt (Intake) · %d wahrscheinlich (Zertifikate) · %d zu klären" + % (len(delta), len(assess.coverage), len(auto_detected), len(probably), len(next_q))) def apply_answer(known_capabilities: Sequence[str], capability_id: str, answer: str) -> List[str]: