feat(programs): open Domain Knowledge Program v1 — 7-stage production line + per-domain KPI
The real bottleneck is domain MODELLING. Phase B is organized as one program with sub-programs per domain, each run through the SAME 7-stage production line. No new runtime framework, no new module (ADR-009, Freeze v1.0) — only program data + a derived reporting view. - Customer enters by INDUSTRY, not regulation: Industry -> Domain Model -> Requirement Sources -> Requirements -> Capabilities -> ... -> Completeness. - 7-stage checklist identical for every domain (Domain Model / Requirement Sources / Capability Registry / Transition Patterns / Playbooks / Reference Scenarios / Completeness) with per-stage ownership. README generalized to the framework. - Each domain lists typical_requirement_sources + typical_certifications -> pre-onboarding capability HYPOTHESIS (the ETO insight; feeds Company 2A as inferred, never confirmed). - Backlog v1 (by customer value): 1 Industrial Automation, 2 Environmental, 3 Automotive, 4 Medical, 5 Energy. Five domain-definition shells (environmental restructured to the unified shape, law-first preserved). - Per-domain KPI is DERIVED from the real corpus (computed-not-stored; sources modelled / transition patterns / playbooks / reference scenarios), NOT a curated number. Reference suite renders maturity bars: Industrial Automation 43% (3/7 sources) leads, Environmental 0% (work ahead). Backlog (value) and KPI (corpus state) are deliberately separated. - ADR-009: Domain Knowledge Program framework. Honest known refinement: regulation-ID normalization (CRA vs Cyber Resilience Act) aliased in the KPI. 7 program-contract tests (backlog order + industry-first + derived-not-stored), check-loc 0. Knowledge data + ADR + reference harness = non-runtime -> no deploy (ADR-001). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -142,35 +142,61 @@ def completeness_section() -> None:
|
||||
|
||||
|
||||
def domain_programs_section(base_dir) -> None:
|
||||
"""Render the Domain Knowledge Programs section (kept here so generate.py stays under the LOC budget)."""
|
||||
"""Domain Knowledge Program v1 — per-domain maturity KPI DERIVED from the corpus (computed-not-stored)."""
|
||||
import os
|
||||
import yaml
|
||||
from compliance.completeness import assess_completeness
|
||||
from compliance.knowledge_intake import build_knowledge_index
|
||||
|
||||
def _load(sub):
|
||||
d = os.path.join(base_dir, "..", "knowledge", sub)
|
||||
return [yaml.safe_load(open(os.path.join(d, f), encoding="utf-8"))
|
||||
for f in sorted(os.listdir(d)) if f.endswith(".yaml")]
|
||||
|
||||
idx = build_knowledge_index(_load("transition_patterns"), _load("implementation_playbooks"),
|
||||
_load("reference_transition_scenarios"))
|
||||
pdir = os.path.join(base_dir, "..", "knowledge", "programs")
|
||||
progs = [yaml.safe_load(open(os.path.join(pdir, f), encoding="utf-8"))
|
||||
for f in sorted(os.listdir(pdir)) if f.endswith(".yaml")]
|
||||
w("## Domain Knowledge Programs — ab jetzt Domänen, nicht Architektur")
|
||||
progs = sorted((yaml.safe_load(open(os.path.join(pdir, f), encoding="utf-8"))
|
||||
for f in sorted(os.listdir(pdir)) if f.endswith(".yaml")), key=lambda p: p.get("backlog_rank", 99))
|
||||
|
||||
_ALIAS = {"cyber resilience act": "cra", "maschinenverordnung": "maschinenvo", "iatf": "iatf16949"}
|
||||
|
||||
def _canon(r):
|
||||
k = str(r).strip().lower()
|
||||
return _ALIAS.get(k, k)
|
||||
|
||||
def _hits(reg_lists, src):
|
||||
cs = {_canon(s) for s in src}
|
||||
return [k for k, regs in reg_lists.items() if cs & {_canon(x) for x in regs}]
|
||||
|
||||
def _source_modeled(index, source, canon):
|
||||
c = canon(source)
|
||||
in_tp = any(c in {canon(x) for x in regs} for regs in index.transition_patterns.values())
|
||||
in_rts = any(c in {canon(x) for x in regs} for regs in index.reference_scenarios.values())
|
||||
in_pb = any(c in {canon(x) for x in index.capability_regulations.get(cap, [])} for cap in index.playbook_capabilities)
|
||||
return in_tp or in_rts or in_pb
|
||||
|
||||
w("## Domain Knowledge Program v1 — Reifegrad je Domäne (reproduzierbarer KPI)")
|
||||
w("")
|
||||
w('_Die Runtime-Architektur ist eingefroren. Eine neue Domäne = Daten + Wissen, die jede Sicht automatisch erweitern. Produktionsstraße: Corpus→Obligations→Capabilities→Transition→Playbooks→Reference→Completeness. **Law-first: Recht → Pflichten → Capabilities → Managementsystem → Delta.**_')
|
||||
w('_Engpass = Domänenmodellierung. Jede Domäne läuft durch DIESELBE 7-Stufen-Produktionsstraße (Domain Model → Requirement Sources → Capability Registry → Transition Patterns → Playbooks → Reference Scenarios → Completeness). Reifegrad aus dem ECHTEN Korpus abgeleitet (computed-not-stored), keine Marketingzahl. Einstieg über Industry, nicht Regelwerk._')
|
||||
w("")
|
||||
w("| Rank | Domäne | Reifegrad (Sources modelliert) | modelliert/total | Korpus TP·PB·RTS |")
|
||||
w("|---|---|---|---|---|")
|
||||
for p in progs:
|
||||
w("**%s** — _%s_ (status: `%s`)" % (p["name"], p["customer_question"], p["status"]))
|
||||
w("")
|
||||
w("| Stufe | Artefakt | Owner | Status |")
|
||||
w("|---|---|---|---|")
|
||||
for s in p.get("stages", []):
|
||||
w("| %s | %s | %s | **%s** |" % (s["id"], s["name"], s["owner"], s["status"]))
|
||||
w("")
|
||||
areas = next((s.get("areas", []) for s in p.get("stages", []) if s.get("id") == "B1"), [])
|
||||
if areas:
|
||||
rep = assess_completeness(identified_regulations=areas, corpus_status={}) # all unknown -> open baseline
|
||||
w("- **Baseline (Completeness):** %s — die 6 Bereiche: %s" % (rep.completeness_summary, ", ".join(areas)))
|
||||
w("")
|
||||
w("_Jedes Programm liefert dieselben Artefakte; Status `open/blocked` kippt automatisch, wenn die Stufen landen — Reference Suite + Completeness dokumentieren den Fortschritt je Domäne._")
|
||||
src = p.get("typical_requirement_sources", [])
|
||||
tp, rts = _hits(idx.transition_patterns, src), _hits(idx.reference_scenarios, src)
|
||||
cs = {_canon(s) for s in src}
|
||||
pb = [c for c in idx.playbook_capabilities if cs & {_canon(x) for x in idx.capability_regulations.get(c, [])}]
|
||||
modeled = [s for s in src if _source_modeled(idx, s, _canon)] # sources with >=1 corpus artifact
|
||||
breadth = (len(modeled) / len(src)) if src else 0.0 # honest differentiator (not CRA-shared depth)
|
||||
filled = int(round(breadth * 10))
|
||||
w("| %d | **%s** | `%s` %d%% | %d/%d | %d·%d·%d |" % (
|
||||
p.get("backlog_rank", 99), p["name"], "█" * filled + "░" * (10 - filled),
|
||||
int(round(breadth * 100)), len(modeled), len(src), len(tp), len(pb), len(rts)))
|
||||
w("")
|
||||
w('_Industry-Einstieg + ETO-Hypothese: jede Domäne kennt ihre typischen Sources + Zertifikate → vor dem Onboarding „diese Prozesswelt ist wahrscheinlich vorhanden" (Hypothese, nie Wahrheit; speist Company 2A als `inferred`). Backlog nach Kundennutzen, KPI nach echtem Korpusstand — beides bewusst getrennt._')
|
||||
w("")
|
||||
coverage_table([
|
||||
("Domain Program Blueprint (wiederverwendbar)", "PASS", "Corpus→…→Completeness, law-first, Ownership je Stufe"),
|
||||
("Environmental Program (Daten)", "PASS", "B1@Legal-KG · B2@Execution · B3@Reasoning (blocked)"),
|
||||
("Phase B = Domänen, keine Architektur", "PASS", "kein neues Runtime-Framework (Freeze, ADR-008)"),
|
||||
("Domain Knowledge Program (7-Stufen-Produktionsstraße)", "PASS", "%d Domänen im Backlog, Industrial Automation #1" % len(progs)),
|
||||
("Reifegrad-KPI (computed-not-stored)", "PASS", "aus echtem Korpus abgeleitet (TP/PB/RTS je Domäne)"),
|
||||
("Regelwerk-ID-Normalisierung", "TODO", "Alias CRA/MaschinenVO im KPI — kanonische IDs ausstehend"),
|
||||
])
|
||||
|
||||
@@ -365,29 +365,27 @@ _Sobald der Umwelt-Korpus (ISO 14001 etc.) landet, kippt `Environmental` automat
|
||||
| Begründete Ausschlüsse (Korpus/Anwendbarkeit) | **PASS** | 3 Ausschlüsse, alle mit Grund |
|
||||
| Fortschritts-Doku je Domäne | **PASS** | Environmental offen→validated bei Korpus-Landung |
|
||||
|
||||
## Domain Knowledge Programs — ab jetzt Domänen, nicht Architektur
|
||||
## Domain Knowledge Program v1 — Reifegrad je Domäne (reproduzierbarer KPI)
|
||||
|
||||
_Die Runtime-Architektur ist eingefroren. Eine neue Domäne = Daten + Wissen, die jede Sicht automatisch erweitern. Produktionsstraße: Corpus→Obligations→Capabilities→Transition→Playbooks→Reference→Completeness. **Law-first: Recht → Pflichten → Capabilities → Managementsystem → Delta.**_
|
||||
_Engpass = Domänenmodellierung. Jede Domäne läuft durch DIESELBE 7-Stufen-Produktionsstraße (Domain Model → Requirement Sources → Capability Registry → Transition Patterns → Playbooks → Reference Scenarios → Completeness). Reifegrad aus dem ECHTEN Korpus abgeleitet (computed-not-stored), keine Marketingzahl. Einstieg über Industry, nicht Regelwerk._
|
||||
|
||||
**Environmental Knowledge Program** — _Welche Umweltanforderungen gelten für mein Produkt (z. B. Industriespülmaschine)?_ (status: `started`)
|
||||
| Rank | Domäne | Reifegrad (Sources modelliert) | modelliert/total | Korpus TP·PB·RTS |
|
||||
|---|---|---|---|---|
|
||||
| 1 | **Industrial Automation Domain** | `████░░░░░░` 43% | 3/7 | 3·2·3 |
|
||||
| 2 | **Environmental Domain** | `░░░░░░░░░░` 0% | 0/6 | 0·0·0 |
|
||||
| 3 | **Automotive Domain** | `██░░░░░░░░` 17% | 1/6 | 1·0·0 |
|
||||
| 4 | **Medical Domain** | `██░░░░░░░░` 20% | 1/5 | 3·2·3 |
|
||||
| 5 | **Energy Domain** | `██░░░░░░░░` 25% | 1/4 | 3·2·3 |
|
||||
|
||||
| Stufe | Artefakt | Owner | Status |
|
||||
|---|---|---|---|
|
||||
| B1 | Environmental Regulatory Corpus | Legal Knowledge / Obligation Registry | **open** |
|
||||
| B2 | Environmental Capability Model | Compliance Execution | **open** |
|
||||
| B3 | Transition Patterns (ISO 14001 -> Environmental Corpus) | Reasoning (Knowledge Acquisition) | **blocked** |
|
||||
|
||||
- **Baseline (Completeness):** Identifiziert 6 · bewertet 0 · offen 6 · Unsicherheiten 0 · Begründung ja — die 6 Bereiche: water, chemicals, emissions, energy, waste, product_responsibility
|
||||
|
||||
_Jedes Programm liefert dieselben Artefakte; Status `open/blocked` kippt automatisch, wenn die Stufen landen — Reference Suite + Completeness dokumentieren den Fortschritt je Domäne._
|
||||
_Industry-Einstieg + ETO-Hypothese: jede Domäne kennt ihre typischen Sources + Zertifikate → vor dem Onboarding „diese Prozesswelt ist wahrscheinlich vorhanden" (Hypothese, nie Wahrheit; speist Company 2A als `inferred`). Backlog nach Kundennutzen, KPI nach echtem Korpusstand — beides bewusst getrennt._
|
||||
|
||||
**Architecture Coverage**
|
||||
|
||||
| Layer | Status | Hinweis |
|
||||
|---|---|---|
|
||||
| Domain Program Blueprint (wiederverwendbar) | **PASS** | Corpus→…→Completeness, law-first, Ownership je Stufe |
|
||||
| Environmental Program (Daten) | **PASS** | B1@Legal-KG · B2@Execution · B3@Reasoning (blocked) |
|
||||
| Phase B = Domänen, keine Architektur | **PASS** | kein neues Runtime-Framework (Freeze, ADR-008) |
|
||||
| Domain Knowledge Program (7-Stufen-Produktionsstraße) | **PASS** | 5 Domänen im Backlog, Industrial Automation #1 |
|
||||
| Reifegrad-KPI (computed-not-stored) | **PASS** | aus echtem Korpus abgeleitet (TP/PB/RTS je Domäne) |
|
||||
| Regelwerk-ID-Normalisierung | **TODO** | Alias CRA/MaschinenVO im KPI — kanonische IDs ausstehend |
|
||||
|
||||
## Gaps → Epics (Backlog — nur erfasst, NICHT implementiert)
|
||||
|
||||
@@ -401,5 +399,5 @@ _Jedes Programm liefert dieselben Artefakte; Status `open/blocked` kippt automat
|
||||
## Suite-Status (Roll-up)
|
||||
|
||||
- Coverage-Zellen gesamt: **47**
|
||||
- PASS: **36** · PARTIAL: 3 · UNSUPPORTED: 1 · TODO: 6 · N/A: 1 · NEEDS_FACTS: 0
|
||||
- PASS: **35** · PARTIAL: 3 · UNSUPPORTED: 1 · TODO: 7 · N/A: 1 · NEEDS_FACTS: 0
|
||||
- Fortschritt = PASS-Anteil steigt, wenn Epics RS-001…004 landen (objektiver Maßstab, kein LOC).
|
||||
|
||||
Reference in New Issue
Block a user