@sigloch/contracts 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -14,31 +14,31 @@ export declare const AF_RULES: readonly [{
|
|
|
14
14
|
readonly name: "ConOps freshness stamp present";
|
|
15
15
|
readonly severity: "warning";
|
|
16
16
|
readonly evaluate: (graph: OntologyGraph) => RuleViolation[];
|
|
17
|
-
readonly domain: readonly ["
|
|
17
|
+
readonly domain: readonly ["graph"];
|
|
18
18
|
}, {
|
|
19
19
|
readonly id: "AF-02";
|
|
20
20
|
readonly name: "Trade Study freshness stamp present";
|
|
21
21
|
readonly severity: "warning";
|
|
22
22
|
readonly evaluate: (graph: OntologyGraph) => RuleViolation[];
|
|
23
|
-
readonly domain: readonly ["
|
|
23
|
+
readonly domain: readonly ["graph"];
|
|
24
24
|
}, {
|
|
25
25
|
readonly id: "AF-03";
|
|
26
26
|
readonly name: "Assumption Review freshness stamp present";
|
|
27
27
|
readonly severity: "warning";
|
|
28
28
|
readonly evaluate: (graph: OntologyGraph) => RuleViolation[];
|
|
29
|
-
readonly domain: readonly ["
|
|
29
|
+
readonly domain: readonly ["graph"];
|
|
30
30
|
}, {
|
|
31
31
|
readonly id: "AF-04";
|
|
32
32
|
readonly name: "FMEA freshness stamp present";
|
|
33
33
|
readonly severity: "warning";
|
|
34
34
|
readonly evaluate: (graph: OntologyGraph) => RuleViolation[];
|
|
35
|
-
readonly domain: readonly ["
|
|
35
|
+
readonly domain: readonly ["graph"];
|
|
36
36
|
}, {
|
|
37
37
|
readonly id: "AF-05";
|
|
38
38
|
readonly name: "Implementation Plan freshness stamp present";
|
|
39
39
|
readonly severity: "warning";
|
|
40
40
|
readonly evaluate: (graph: OntologyGraph) => RuleViolation[];
|
|
41
|
-
readonly domain: readonly ["
|
|
41
|
+
readonly domain: readonly ["graph"];
|
|
42
42
|
}];
|
|
43
43
|
/** Evaluate all analysis-freshness-presence rules. */
|
|
44
44
|
export declare function evaluateAFRules(graph: OntologyGraph): RuleViolation[];
|
|
@@ -32,11 +32,11 @@ const assumptionReviewFreshnessPresent = analysisFreshnessPresence('AF-03', 'ass
|
|
|
32
32
|
const fmeaFreshnessPresent = analysisFreshnessPresence('AF-04', 'fmea');
|
|
33
33
|
const implplanFreshnessPresent = analysisFreshnessPresence('AF-05', 'implplan');
|
|
34
34
|
export const AF_RULES = [
|
|
35
|
-
{ id: 'AF-01', name: 'ConOps freshness stamp present', severity: 'warning', evaluate: conopsFreshnessPresent, domain: ['
|
|
36
|
-
{ id: 'AF-02', name: 'Trade Study freshness stamp present', severity: 'warning', evaluate: tradeFreshnessPresent, domain: ['
|
|
37
|
-
{ id: 'AF-03', name: 'Assumption Review freshness stamp present', severity: 'warning', evaluate: assumptionReviewFreshnessPresent, domain: ['
|
|
38
|
-
{ id: 'AF-04', name: 'FMEA freshness stamp present', severity: 'warning', evaluate: fmeaFreshnessPresent, domain: ['
|
|
39
|
-
{ id: 'AF-05', name: 'Implementation Plan freshness stamp present', severity: 'warning', evaluate: implplanFreshnessPresent, domain: ['
|
|
35
|
+
{ id: 'AF-01', name: 'ConOps freshness stamp present', severity: 'warning', evaluate: conopsFreshnessPresent, domain: ['graph'] },
|
|
36
|
+
{ id: 'AF-02', name: 'Trade Study freshness stamp present', severity: 'warning', evaluate: tradeFreshnessPresent, domain: ['graph'] },
|
|
37
|
+
{ id: 'AF-03', name: 'Assumption Review freshness stamp present', severity: 'warning', evaluate: assumptionReviewFreshnessPresent, domain: ['graph'] },
|
|
38
|
+
{ id: 'AF-04', name: 'FMEA freshness stamp present', severity: 'warning', evaluate: fmeaFreshnessPresent, domain: ['graph'] },
|
|
39
|
+
{ id: 'AF-05', name: 'Implementation Plan freshness stamp present', severity: 'warning', evaluate: implplanFreshnessPresent, domain: ['graph'] },
|
|
40
40
|
];
|
|
41
41
|
/** Evaluate all analysis-freshness-presence rules. */
|
|
42
42
|
export function evaluateAFRules(graph) {
|
package/dist/se/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/** Ontology schema version (element types + trace types). */
|
|
6
6
|
export declare const ONTOLOGY_VERSION = "6.0.0";
|
|
7
7
|
/** Rules engine version (validation rules incl. RC conformance). */
|
|
8
|
-
export declare const RULES_VERSION = "2.
|
|
8
|
+
export declare const RULES_VERSION = "2.27.0";
|
|
9
9
|
/** Meta-model version (trace pattern constraints + format-e parser). */
|
|
10
10
|
export declare const META_MODEL_VERSION = "1.4.0";
|
|
11
11
|
export * from './ontology.js';
|
package/dist/se/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/** Ontology schema version (element types + trace types). */
|
|
6
6
|
export const ONTOLOGY_VERSION = '6.0.0'; // BREAKING (CR-SM-231b): das knotenweite `testResult` entfaellt — das Ergebnis haengt PRO `testRefs`-Eintrag (`result`, `ranAt`, `evidence`), aus demselben Grund wie `tool`. Ein einzelnes Ergebnis am Knoten konnte bei n Laeufen nicht sagen, welcher gemeint ist, und "einer rot, einer gruen" war gar nicht darstellbar — genau der Zustand, den ein Gate wissen muss. FM-03 liest jetzt "jeder Eintrag passed": "irgendeiner gruen" haette einen gruenen Unit-Lauf einen roten Visual-Lauf verdecken lassen. Ein Eintrag ohne Ergebnis ist nicht bestanden. VR-01 meldet die Dateien ohne Ergebnis statt nur den Knoten. Prior: BREAKING (CR-SM-231): `testRef` (Objekt) entfaellt ersatzlos zugunsten von `testRefs` (Array, min 1) — eine Abnahme, n Testdateien. Kein Union, kein Alias: ein Graph mit dem alten Attribut faellt R-19 zur Last und muss migriert werden. Anlass war ein Zaehl-Audit (537 laufende Tests in 67 Dateien, 14 TEST-Knoten mit je genau einer Datei, 53 Dateien an keine Abnahme gebunden) plus ein belegter Ausweichweg: dieselbe Spec-Datei stand im testRef ZWEIER TEST-Knoten, womit die Relation faktisch n:m war — ein roter Lauf keiner Abnahme mehr eindeutig zuordenbar, der TRR-Gate zaehlte dieselbe Evidenz doppelt. `tool` bleibt PRO EINTRAG: eine Abnahme mischt real die Runner (vitest + playwright). +AttributeSpec.type 'array' (testRefs ist das erste Listen-Attribut). Prior: BREAKING: `SemanticId` (`Name.TypeAbbr.Counter`) deleted, `ElementUid` (`<TYPE>-<slug>`) is the family canon — the old canon was used by no production graph of the family while 626 of 1145 elements already carried TYPE-slug (CR-SM-217); realRef unifies codeRef+schemaRef (+physical-MOD CAD ref), symbol optional; testRef stays separate (CR-228 C); +RepoRelativePathSchema on testRef/realRef .file — no absolute/`..` paths (CR-GC-255)
|
|
7
7
|
/** Rules engine version (validation rules incl. RC conformance). */
|
|
8
|
-
export const RULES_VERSION = '2.
|
|
8
|
+
export const RULES_VERSION = '2.27.0'; // CR-SM-239: AF-01..05 und R-28 deklarieren `domain: ['graph']` statt `['SYS']` — sie pruefen EINMAL den Graphen, nicht die SYS-Elemente. Als Ein-Element-Gruppe waren sie ein Nenner-Beitrag mit fast sicherem Verstoss und zogen jede sonst leere Dimension auf 0 %: ein Graph ohne eine einzige REQ las `req` = 0 % (1 - 2/2 aus AF-01/AF-03) statt „nichts zu messen", und die Fokuswahl schickte den Executor dorthin. Kein Regelverhalten geaendert — nur die deklarierte Grundgesamtheit. Prior: CR-SM-231: +R-29 Testdatei-Exklusivitaet (severity **error**) — jede Testdatei erscheint in hoechstens einem `testRefs`. Das ist die Haelfte, die 1:n ERZWINGT statt es nur zu erlauben; ohne sie driftet das Attribut zurueck nach n:m. Bewusst schaerfer als R-19/R-20 (beide warning): eine doppelt beanspruchte Datei macht Gate-Zahlen nachweislich falsch, das ist eine Fehlmessung und kein Vollstaendigkeits-Signal. Rein graph-strukturell, kein I/O. R-19 und RC-02 lesen `testRefs`; RC-02 iteriert die Eintraege und nennt den konkreten Pfad statt nur der Knoten-ID. Prior: CR-SM-236: die letzten drei Urteilsschwellen sind Policy-Parameter statt Literal — CR-01 (`crossingFlows`, erstmals mit Aus-Zustand: `null` unterdrueckt auch die info je Modulpaar, die bisher die arch-Dimension verduennte), FM-03 (`riskRpn`, vorher inline 100) und R-04 (`moduleSize.{large,coupled,crossings}`, vorher inline 12/8/2 — drei Urteile, nicht eins). R-04 heisst jetzt 'Module size relative to crossing flows': die Regel waegt Groesse GEGEN Kreuzungen ab, der alte Name 'Max module size' verschwieg die zweite Haelfte der Bedingung. `RuleDefinition.evaluate` nimmt die Policy als zweiten Parameter, damit keine Familie einen Sonderweg braucht; einstellige Regelfunktionen bleiben zuweisbar. Bewertung unter DEFAULT_METRIC_POLICY unveraendert. Prior: CR-GC-315: R-12 + R-21 no longer tax FLOW reuse. R-12 restricted to dependency-carrying traces (compose/allocate/relation) — on `io` the only reachable shape was FUNC ─io→ FLOW ─io→ the SAME FUNC, i.e. read-modify-write on a shared FLOW, so the check was pure false-positive there (real io-cycles span ≥2 FUNCs and a 2-cycle test cannot see them); satisfy/verify/produces 2-cycles are pattern-illegal and belong to R-18. Its dedup key is now direction-independent (`type|sorted pair`) — keying on the message never collapsed anything, so every cycle was reported twice. R-21 no longer derives FUNC↔FUNC connections from FLOW co-adjacency alone: a producer/consumer pair with NO shared FCHAIN is silent. One hub FLOW with P producers and C consumers manufactured P·C findings, each demanding its own FCHAIN+integration test including pairs that never interact — reuse was penalised quadratically. The FCHAIN is the declared integration scope; the test is owed on that declared claim only. Rule intent (CR-GC-240 gap: unit/UC tests do not cover FUNC↔FUNC wiring) unchanged. Prior: CR-SM-227: +AF-01..05 Analysis-Freshness-Legs (analysis-freshness-rules.ts) — the third leg-kind a review gate checks (rule legs, layer-presence legs [R-28], now analysis-freshness legs, docs/articles/07-the-scoring-landscape.md); presence-only rules (Presence/Resolution-Split like R-19/R-20/R-26/R-27 vs. RC-01..05) checking a `graphVersion` freshness stamp exists under SYS.attributes.analysisFreshness.<AnalysisArtifactId> for each of the 5 CR-GC-221 judgment artifacts (conops/trade/assumption-review/fmea/implplan) — staleness (stamp vs live graphVersion) stays a consumer/I-O concern (`CreationCurrencyProvider`, @sigloch/graphcode-client), NOT evaluated here; Familie-Review 2026-08-05 gate assignment → RULE_TO_PHASE: ConOps/Trade/Assumption-Review → PDR, FMEA → CDR, Implementation Plan → TRR (SRR gets none); +AnalysisArtifactId enum + AnalysisFreshnessStampSchema (ontology.ts) as the SSOT graphcode-client's ARTIFACT_CATALOG analysis ids must match; grober Graph-Versions-Stempel only, no scope-hash in this first cut (conscious CR-SM-227 limitation).
|
|
9
9
|
/** Meta-model version (trace pattern constraints + format-e parser). */
|
|
10
10
|
export const META_MODEL_VERSION = '1.4.0'; // -REQ→MOD allocate pattern removed (CR-228 A); +FUNC→FUNC compose (blackbox function decomposition)
|
|
11
11
|
export * from './ontology.js';
|
package/dist/se/rules.d.ts
CHANGED
|
@@ -171,6 +171,18 @@ export interface RuleDefinition {
|
|
|
171
171
|
*
|
|
172
172
|
* Mehrere Typen, wo die Regel ueber mehrere feuert (RD-04: FUNC, MOD und SYS als Eltern
|
|
173
173
|
* einer Zerlegung). `['all']` = jedes Nicht-SESSION-Element (R-08/R-18 pruefen Traces).
|
|
174
|
+
*
|
|
175
|
+
* **CR-SM-239 — „ganzer Graph" ist etwas anderes als „diese Gruppe".** `['graph']` markiert
|
|
176
|
+
* eine Regel, die **einmal je Graph** prueft statt ueber eine Elementmenge: die
|
|
177
|
+
* Analyse-Freshness-Stempel (AF-01..05) und die Ebenen-Praesenz (R-28). Sie tragen KEINE
|
|
178
|
+
* Grundgesamtheit bei, denn sie haben keine — der Stempel haengt zwar unter SYS, geprueft
|
|
179
|
+
* wird aber der Graph, nicht das Element.
|
|
180
|
+
*
|
|
181
|
+
* Warum das zaehlt: mit `['SYS']` deklariert waren sie eine Ein-Element-Gruppe mit fast
|
|
182
|
+
* sicherem Verstoss. Eine Dimension ohne eigene Elemente (z. B. `req` in einem Graphen ohne
|
|
183
|
+
* eine einzige REQ) las dadurch **0 %** statt „nichts zu messen" — und der Executor
|
|
184
|
+
* fokussierte sie. Ein Graph-Check verfeinert eine Dimension, die es gibt; er erschafft
|
|
185
|
+
* keine.
|
|
174
186
|
*/
|
|
175
187
|
domain: readonly string[];
|
|
176
188
|
}
|
package/dist/se/rules.js
CHANGED
|
@@ -1044,7 +1044,7 @@ export const V3_RULES = [
|
|
|
1044
1044
|
{ id: 'RD-04', name: 'Decomposition breadth', severity: 'warning', evaluate: decompositionBreadth, domain: ['FUNC', 'MOD', 'SYS'] },
|
|
1045
1045
|
{ id: 'MS-01', name: 'Milestone empty scope', severity: 'warning', evaluate: msEmptyScope, domain: ['MS'] },
|
|
1046
1046
|
{ id: 'MS-02', name: 'Milestone dangling dependency', severity: 'error', evaluate: msDanglingDependency, domain: ['MS'] },
|
|
1047
|
-
{ id: 'R-28', name: 'Ebenen-Präsenz (FLOW+SCHEMA when funcCount>1)', severity: 'warning', evaluate: ebenenPraesenz, domain: ['
|
|
1047
|
+
{ id: 'R-28', name: 'Ebenen-Präsenz (FLOW+SCHEMA when funcCount>1)', severity: 'warning', evaluate: ebenenPraesenz, domain: ['graph'] },
|
|
1048
1048
|
];
|
|
1049
1049
|
/** Run all rules against a graph. CR-SM-236: `policy` ist Pflicht — wie bei `evaluateAllRules`. */
|
|
1050
1050
|
export function evaluateRules(graph, policy) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sigloch/contracts",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"prepublishOnly": "npm run build && npm run test"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@sigloch/contracts": "^4.
|
|
31
|
+
"@sigloch/contracts": "^4.1.0",
|
|
32
32
|
"zod": "^4.3.6"
|
|
33
33
|
},
|
|
34
34
|
"license": "MIT",
|