@sigloch/contracts 12.8.0 → 12.12.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.
- package/dist/harness/index.d.ts +9 -2
- package/dist/harness/index.js +11 -2
- package/dist/se/chain-metrics.d.ts +6 -0
- package/dist/se/chain-metrics.js +29 -4
- package/dist/se/chain-roles.d.ts +61 -0
- package/dist/se/chain-roles.js +159 -0
- package/dist/se/fchain-quality-rules.d.ts +2 -1
- package/dist/se/fchain-quality-rules.js +52 -0
- package/dist/se/grammar-snapshot.d.ts +7 -7
- package/dist/se/grammar-snapshot.js +14 -5
- package/dist/se/index.d.ts +3 -2
- package/dist/se/index.js +4 -2
- package/dist/se/ontology.js +1 -0
- package/dist/se/policy.d.ts +1 -0
- package/dist/se/policy.js +11 -0
- package/dist/se/quality-rules.d.ts +2 -2
- package/dist/se/quality-rules.js +37 -28
- package/dist/se/readiness.js +1 -1
- package/dist/se/rule-help.js +19 -8
- package/dist/se/uc-quality-rules.d.ts +2 -1
- package/dist/se/uc-quality-rules.js +29 -0
- package/package.json +1 -1
package/dist/harness/index.d.ts
CHANGED
|
@@ -179,9 +179,15 @@ export declare const UpdateDomainSchema: z.ZodEnum<{
|
|
|
179
179
|
suggestions: "suggestions";
|
|
180
180
|
}>;
|
|
181
181
|
export type UpdateDomain = z.infer<typeof UpdateDomainSchema>;
|
|
182
|
-
/**
|
|
182
|
+
/**
|
|
183
|
+
* Emitted once per mutation (`invalidate`) and once per reseed (`reset`, CR-GC-885). `reset` means: the
|
|
184
|
+
* whole graph was replaced, read it again. A reader ignores any type it does not know (CR-GC-809).
|
|
185
|
+
*/
|
|
183
186
|
export declare const LiveUpdateEventSchema: z.ZodObject<{
|
|
184
|
-
type: z.
|
|
187
|
+
type: z.ZodEnum<{
|
|
188
|
+
invalidate: "invalidate";
|
|
189
|
+
reset: "reset";
|
|
190
|
+
}>;
|
|
185
191
|
domains: z.ZodArray<z.ZodEnum<{
|
|
186
192
|
graph: "graph";
|
|
187
193
|
rules: "rules";
|
|
@@ -190,5 +196,6 @@ export declare const LiveUpdateEventSchema: z.ZodObject<{
|
|
|
190
196
|
}>>;
|
|
191
197
|
ts: z.ZodString;
|
|
192
198
|
version: z.ZodOptional<z.ZodNumber>;
|
|
199
|
+
formatE: z.ZodOptional<z.ZodString>;
|
|
193
200
|
}, z.core.$strip>;
|
|
194
201
|
export type LiveUpdateEvent = z.infer<typeof LiveUpdateEventSchema>;
|
package/dist/harness/index.js
CHANGED
|
@@ -191,12 +191,21 @@ export const MutateResultSchema = z.object({
|
|
|
191
191
|
// ---------------------------------------------------------------------------
|
|
192
192
|
/** Domains a mutation may invalidate (superset; always at least ['graph']). */
|
|
193
193
|
export const UpdateDomainSchema = z.enum(['graph', 'rules', 'readiness', 'suggestions']);
|
|
194
|
-
/**
|
|
194
|
+
/**
|
|
195
|
+
* Emitted once per mutation (`invalidate`) and once per reseed (`reset`, CR-GC-885). `reset` means: the
|
|
196
|
+
* whole graph was replaced, read it again. A reader ignores any type it does not know (CR-GC-809).
|
|
197
|
+
*/
|
|
195
198
|
export const LiveUpdateEventSchema = z.object({
|
|
196
|
-
type: z.
|
|
199
|
+
type: z.enum(['invalidate', 'reset']),
|
|
197
200
|
domains: z.array(UpdateDomainSchema),
|
|
198
201
|
/** ISO timestamp of when the event was produced. */
|
|
199
202
|
ts: z.string(),
|
|
200
203
|
/** CR-199: graph revision after the mutation that triggered this event. */
|
|
201
204
|
version: GraphVersionSchema.optional(),
|
|
205
|
+
/**
|
|
206
|
+
* CR-GC-809: the effect of the mutation as Format-E — cascades and merges included, not the submitted
|
|
207
|
+
* batch (`deltaToFormatE`, graph-api-core). Absent on a batch without changes and above the size limit;
|
|
208
|
+
* a reader that needs the change then reads the whole graph.
|
|
209
|
+
*/
|
|
210
|
+
formatE: z.string().optional(),
|
|
202
211
|
});
|
|
@@ -70,6 +70,11 @@
|
|
|
70
70
|
* `answerPathBlockedBy`.
|
|
71
71
|
* - Der Weg verlaesst seine Kette nicht. Wartet ein Glied synchron auf eine FUNC, die kein Glied
|
|
72
72
|
* ist, ist das ebenso ein Hindernis. Die Kette zu schliessen ist Arbeit am Modell.
|
|
73
|
+
* - CR-SM-423: „Er kann eine andere Kette mit bedienen" (Autor zu Frage 3). Liegen Erzeuger und
|
|
74
|
+
* wartendes Glied beide in derselben anderen Kette, gehoert der Fluss dorthin (ein Verteiler, der
|
|
75
|
+
* je Aufruf nur auf seinen eigenen Zweig wartet). Der Weg ueberspringt ihn; er hindert nicht.
|
|
76
|
+
* - CR-SM-424: Ob das Glied wirklich nur je Aufruf wartet oder bei jedem Aufruf, sieht das Modell
|
|
77
|
+
* nicht. Darum nennt `answerPathSkipped` jeden uebersprungenen Fluss; der Autor prueft ihn am Code.
|
|
73
78
|
*
|
|
74
79
|
* Gelesen wird je Paar (Fluss, erzeugende FUNC), und zwar an jedem Abnehmer gleich: der ACTOR
|
|
75
80
|
* wartet auf das Glied, das ihm einen Fluss mit `sync` liefert (das ist die Antwort; ein Fluss mit
|
|
@@ -117,6 +122,7 @@ export declare const ChainMetrics: z.ZodObject<{
|
|
|
117
122
|
}, z.core.$strict>>;
|
|
118
123
|
answerPath: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
119
124
|
answerPathBlockedBy: z.ZodArray<z.ZodString>;
|
|
125
|
+
answerPathSkipped: z.ZodArray<z.ZodString>;
|
|
120
126
|
chainId: z.ZodString;
|
|
121
127
|
chainName: z.ZodString;
|
|
122
128
|
}, z.core.$strict>, z.ZodObject<{
|
package/dist/se/chain-metrics.js
CHANGED
|
@@ -70,6 +70,11 @@
|
|
|
70
70
|
* `answerPathBlockedBy`.
|
|
71
71
|
* - Der Weg verlaesst seine Kette nicht. Wartet ein Glied synchron auf eine FUNC, die kein Glied
|
|
72
72
|
* ist, ist das ebenso ein Hindernis. Die Kette zu schliessen ist Arbeit am Modell.
|
|
73
|
+
* - CR-SM-423: „Er kann eine andere Kette mit bedienen" (Autor zu Frage 3). Liegen Erzeuger und
|
|
74
|
+
* wartendes Glied beide in derselben anderen Kette, gehoert der Fluss dorthin (ein Verteiler, der
|
|
75
|
+
* je Aufruf nur auf seinen eigenen Zweig wartet). Der Weg ueberspringt ihn; er hindert nicht.
|
|
76
|
+
* - CR-SM-424: Ob das Glied wirklich nur je Aufruf wartet oder bei jedem Aufruf, sieht das Modell
|
|
77
|
+
* nicht. Darum nennt `answerPathSkipped` jeden uebersprungenen Fluss; der Autor prueft ihn am Code.
|
|
73
78
|
*
|
|
74
79
|
* Gelesen wird je Paar (Fluss, erzeugende FUNC), und zwar an jedem Abnehmer gleich: der ACTOR
|
|
75
80
|
* wartet auf das Glied, das ihm einen Fluss mit `sync` liefert (das ist die Antwort; ein Fluss mit
|
|
@@ -166,6 +171,13 @@ const MeasuredChain = z.strictObject({
|
|
|
166
171
|
* `null` ist.
|
|
167
172
|
*/
|
|
168
173
|
answerPathBlockedBy: z.array(z.string()),
|
|
174
|
+
/**
|
|
175
|
+
* CR-SM-424 — die Fluesse, die der Weg nach CR-SM-423 ueberspringt: `sync`, von einer FUNC ausserhalb
|
|
176
|
+
* der Kette, die mit dem wartenden Glied eine andere Kette teilt. Angenommen ist ein Verteiler, der
|
|
177
|
+
* je Aufruf nur auf seinen eigenen Zweig wartet. Wartet das Glied bei jedem Aufruf, fehlt der Erzeuger
|
|
178
|
+
* auf dem Weg — das sagt nur der Code.
|
|
179
|
+
*/
|
|
180
|
+
answerPathSkipped: z.array(z.string()),
|
|
169
181
|
});
|
|
170
182
|
/** Eine nicht bewertbare Kette: der Grund statt der Zahl. Reihenfolge der Gruende ist fest. */
|
|
171
183
|
const UnmeasurableChain = z.strictObject({
|
|
@@ -329,11 +341,22 @@ export function chainMetrics(graph) {
|
|
|
329
341
|
// den Fluss gleich — der ACTOR den Ausgang, ein Glied seinen Eingang.
|
|
330
342
|
const waits = new Set();
|
|
331
343
|
const blockedBy = new Set();
|
|
344
|
+
const skipped = new Set();
|
|
332
345
|
const open = [];
|
|
333
|
-
|
|
346
|
+
// CR-SM-423: ein Glied, das eine andere Kette mit bedient (Verteiler), bekommt deren Fluesse. Liegen
|
|
347
|
+
// Erzeuger und wartendes Glied beide in derselben anderen Kette, gehoert der Fluss dorthin — der Weg
|
|
348
|
+
// ueberspringt ihn. Nur ein Erzeuger ohne gemeinsame Kette mit dem Glied haelt den Weg auf.
|
|
349
|
+
const serves = (producer, consumer) => [...(chainsOf.get(producer) ?? [])].some((c) => c !== fc.id && (chainsOf.get(consumer)?.has(c) ?? false));
|
|
350
|
+
const follow = (flow, producer, consumer) => {
|
|
334
351
|
const sync = readFlowSync(idx.byId.get(flow)?.attributes);
|
|
335
|
-
if (sync.state !== 'bound'
|
|
352
|
+
if (sync.state !== 'bound')
|
|
336
353
|
blockedBy.add(flow);
|
|
354
|
+
else if (sync.value === 'sync' && !inChain.has(producer)) {
|
|
355
|
+
if (!consumer || !serves(producer, consumer))
|
|
356
|
+
blockedBy.add(flow);
|
|
357
|
+
else
|
|
358
|
+
skipped.add(flow);
|
|
359
|
+
}
|
|
337
360
|
else if (sync.value === 'sync' && !waits.has(producer)) {
|
|
338
361
|
waits.add(producer);
|
|
339
362
|
open.push(producer);
|
|
@@ -345,10 +368,11 @@ export function chainMetrics(graph) {
|
|
|
345
368
|
follow(flow, m);
|
|
346
369
|
}
|
|
347
370
|
while (open.length > 0) {
|
|
348
|
-
|
|
371
|
+
const consumer = open.pop();
|
|
372
|
+
for (const flow of flowsInto(consumer)) {
|
|
349
373
|
for (const t of idx.in(flow, 'io'))
|
|
350
374
|
if (idx.typeOf(t.source) === 'FUNC')
|
|
351
|
-
follow(flow, t.source);
|
|
375
|
+
follow(flow, t.source, consumer);
|
|
352
376
|
}
|
|
353
377
|
}
|
|
354
378
|
return {
|
|
@@ -371,6 +395,7 @@ export function chainMetrics(graph) {
|
|
|
371
395
|
handovers: at(flowsOutOf, (flow) => idx.out(flow, 'io').map((t) => t.target)),
|
|
372
396
|
answerPath: blockedBy.size === 0 ? [...waits].sort() : null,
|
|
373
397
|
answerPathBlockedBy: [...blockedBy].sort(),
|
|
398
|
+
answerPathSkipped: [...skipped].sort(),
|
|
374
399
|
};
|
|
375
400
|
});
|
|
376
401
|
const measurable = chains.filter((c) => c.measurable).length;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CR-SM-420 — die ROLLEN der Akteure je Wirkkette, abgeleitet statt deklariert.
|
|
3
|
+
*
|
|
4
|
+
* Eine FCHAIN ist eine Menge von FUNC; welcher Akteur sie ausloest, steht nirgends. Bis hierher galt
|
|
5
|
+
* jeder einspeisende ACTOR als Ausloeser (gve Rang 0, ConOps „triggert"), auch die Freigeberin, die
|
|
6
|
+
* mitten in der Kette einen Vorschlag sieht und freigibt. Ein Attribut `start` an der FCHAIN
|
|
7
|
+
* (ITEM-2026-1101) ist verworfen: es naennte den Eingang ein zweites Mal neben der io-Kante, und die
|
|
8
|
+
* Rolle haengt an Fluss UND Kette, nicht am Akteur. Gelesen wird, was das Modell schon traegt:
|
|
9
|
+
*
|
|
10
|
+
* - Glieder M = FUNC unter der FCHAIN. Link u→v: u erzeugt einen FLOW, v verbraucht ihn, beide Glieder.
|
|
11
|
+
* - Aktivierungsnetz: jeder Link, dazu die Gegenkante v→u, wenn der FLOW `sync` traegt und u keinen
|
|
12
|
+
* Eingang hat, weder aus der Kette noch von einem Akteur — v holt aus einem Speicher (`sync` schliesst das Holen ein, ontology.ts).
|
|
13
|
+
* Ohne die Quittung: ein `sync`-Link u→v, zu dem es v→u mit `async` gibt (v legt ab und wartet auf die
|
|
14
|
+
* Annahme), aktiviert nicht (CR-SM-422).
|
|
15
|
+
* - Eingang = (ACTOR a, FLOW f, Glied c) mit a -io-> f -io-> c; seine Deckung = die von c aus
|
|
16
|
+
* erreichbaren Glieder.
|
|
17
|
+
* - Ausloeser: ein Eingang, dessen Deckung ganz M umfasst. Jeder andere Eingang, in dieser Reihenfolge:
|
|
18
|
+
* `neighbor` (Ausloeser einer anderen Kette, die c ebenfalls enthaelt), `middle` (a bekam vorher aus
|
|
19
|
+
* der Kette einen Fluss mit `sync`: Akteur in der Mitte, Schnitt bei c), `answer` (f traegt `sync`,
|
|
20
|
+
* a bekommt aus der Kette nur Fluesse ohne `sync`), `predelivery` (f `async`, a bekommt nichts aus der
|
|
21
|
+
* Kette), sonst `unknown`.
|
|
22
|
+
* - Abschnitte: die Kette zerfaellt an jedem Glied, an dem ein Akteur in der Mitte eintritt; das Glied
|
|
23
|
+
* gehoert zu beiden Seiten.
|
|
24
|
+
*
|
|
25
|
+
* Mehrere Ausloeser sind zulaessig, wenn alle am selben Glied mit demselben Vertrag (SCHEMA) andocken —
|
|
26
|
+
* dann ist „wer startet" ein Feld im Vertrag (Freigabe des Autors 2026-10-28, im CR zitiert). FC-06
|
|
27
|
+
* meldet die uebrigen Faelle. Rein ueber den Graphen, ohne `node:` — gve liest das im Browser.
|
|
28
|
+
*
|
|
29
|
+
* @author andreas@siglochconsulting
|
|
30
|
+
*/
|
|
31
|
+
import { type OntologyGraph } from './ontology.js';
|
|
32
|
+
export type EntryRole = 'trigger' | 'neighbor' | 'middle' | 'answer' | 'predelivery' | 'unknown';
|
|
33
|
+
export interface ChainEntry {
|
|
34
|
+
actor: string;
|
|
35
|
+
flow: string;
|
|
36
|
+
/** Das Glied, an dem der Eingang andockt. */
|
|
37
|
+
member: string;
|
|
38
|
+
role: EntryRole;
|
|
39
|
+
}
|
|
40
|
+
export interface ChainSink {
|
|
41
|
+
actor: string;
|
|
42
|
+
flow: string;
|
|
43
|
+
/** Das Glied, das liefert. */
|
|
44
|
+
member: string;
|
|
45
|
+
}
|
|
46
|
+
export interface ChainRoles {
|
|
47
|
+
chainId: string;
|
|
48
|
+
members: string[];
|
|
49
|
+
/** Jeder Eingang mit Rolle, sortiert nach Fluss, Akteur, Glied. */
|
|
50
|
+
entries: ChainEntry[];
|
|
51
|
+
sinks: ChainSink[];
|
|
52
|
+
/** Erster Abschnitt zuerst; ohne Akteur in der Mitte genau einer (alle Glieder). */
|
|
53
|
+
segments: string[][];
|
|
54
|
+
/** Glieder, die kein Eingang erreicht. */
|
|
55
|
+
unreached: string[];
|
|
56
|
+
/** Fluesse an einem Glied ohne lesbares `sync` — die Ableitung raet dort. */
|
|
57
|
+
unsynced: string[];
|
|
58
|
+
/** Mehrere Ausloeser an EINEM Glied mit EINEM Vertrag (oder hoechstens einer). */
|
|
59
|
+
triggersAgree: boolean;
|
|
60
|
+
}
|
|
61
|
+
export declare function chainRoles(graph: OntologyGraph): ChainRoles[];
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CR-SM-420 — die ROLLEN der Akteure je Wirkkette, abgeleitet statt deklariert.
|
|
3
|
+
*
|
|
4
|
+
* Eine FCHAIN ist eine Menge von FUNC; welcher Akteur sie ausloest, steht nirgends. Bis hierher galt
|
|
5
|
+
* jeder einspeisende ACTOR als Ausloeser (gve Rang 0, ConOps „triggert"), auch die Freigeberin, die
|
|
6
|
+
* mitten in der Kette einen Vorschlag sieht und freigibt. Ein Attribut `start` an der FCHAIN
|
|
7
|
+
* (ITEM-2026-1101) ist verworfen: es naennte den Eingang ein zweites Mal neben der io-Kante, und die
|
|
8
|
+
* Rolle haengt an Fluss UND Kette, nicht am Akteur. Gelesen wird, was das Modell schon traegt:
|
|
9
|
+
*
|
|
10
|
+
* - Glieder M = FUNC unter der FCHAIN. Link u→v: u erzeugt einen FLOW, v verbraucht ihn, beide Glieder.
|
|
11
|
+
* - Aktivierungsnetz: jeder Link, dazu die Gegenkante v→u, wenn der FLOW `sync` traegt und u keinen
|
|
12
|
+
* Eingang hat, weder aus der Kette noch von einem Akteur — v holt aus einem Speicher (`sync` schliesst das Holen ein, ontology.ts).
|
|
13
|
+
* Ohne die Quittung: ein `sync`-Link u→v, zu dem es v→u mit `async` gibt (v legt ab und wartet auf die
|
|
14
|
+
* Annahme), aktiviert nicht (CR-SM-422).
|
|
15
|
+
* - Eingang = (ACTOR a, FLOW f, Glied c) mit a -io-> f -io-> c; seine Deckung = die von c aus
|
|
16
|
+
* erreichbaren Glieder.
|
|
17
|
+
* - Ausloeser: ein Eingang, dessen Deckung ganz M umfasst. Jeder andere Eingang, in dieser Reihenfolge:
|
|
18
|
+
* `neighbor` (Ausloeser einer anderen Kette, die c ebenfalls enthaelt), `middle` (a bekam vorher aus
|
|
19
|
+
* der Kette einen Fluss mit `sync`: Akteur in der Mitte, Schnitt bei c), `answer` (f traegt `sync`,
|
|
20
|
+
* a bekommt aus der Kette nur Fluesse ohne `sync`), `predelivery` (f `async`, a bekommt nichts aus der
|
|
21
|
+
* Kette), sonst `unknown`.
|
|
22
|
+
* - Abschnitte: die Kette zerfaellt an jedem Glied, an dem ein Akteur in der Mitte eintritt; das Glied
|
|
23
|
+
* gehoert zu beiden Seiten.
|
|
24
|
+
*
|
|
25
|
+
* Mehrere Ausloeser sind zulaessig, wenn alle am selben Glied mit demselben Vertrag (SCHEMA) andocken —
|
|
26
|
+
* dann ist „wer startet" ein Feld im Vertrag (Freigabe des Autors 2026-10-28, im CR zitiert). FC-06
|
|
27
|
+
* meldet die uebrigen Faelle. Rein ueber den Graphen, ohne `node:` — gve liest das im Browser.
|
|
28
|
+
*
|
|
29
|
+
* @author andreas@siglochconsulting
|
|
30
|
+
*/
|
|
31
|
+
import { readFlowSync } from './ontology.js';
|
|
32
|
+
import { indexOf } from './graph-index.js';
|
|
33
|
+
export function chainRoles(graph) {
|
|
34
|
+
const idx = indexOf(graph);
|
|
35
|
+
const syncOf = (flow) => readFlowSync(idx.byId.get(flow)?.attributes);
|
|
36
|
+
const isSync = (flow) => { const s = syncOf(flow); return s.state === 'bound' && s.value === 'sync'; };
|
|
37
|
+
const isAsync = (flow) => { const s = syncOf(flow); return s.state === 'bound' && s.value === 'async'; };
|
|
38
|
+
const producersOf = (flow) => idx.in(flow, 'io').map((t) => t.source);
|
|
39
|
+
const consumersOf = (flow) => idx.out(flow, 'io').map((t) => t.target);
|
|
40
|
+
const schemaOf = (flow) => idx.out(flow, 'relation').map((t) => t.target).filter((id) => idx.typeOf(id) === 'SCHEMA').sort().join(',');
|
|
41
|
+
const flowsOutOf = (id) => idx.out(id, 'io').map((t) => t.target).filter((f) => idx.typeOf(f) === 'FLOW');
|
|
42
|
+
const flowsInto = (id) => idx.in(id, 'io').map((t) => t.source).filter((f) => idx.typeOf(f) === 'FLOW');
|
|
43
|
+
const chains = idx.elementsOfType('FCHAIN').map((fc) => {
|
|
44
|
+
const members = [...new Set(idx.out(fc.id, 'compose').map((t) => t.target).filter((id) => idx.typeOf(id) === 'FUNC'))].sort();
|
|
45
|
+
const inChain = new Set(members);
|
|
46
|
+
const links = [];
|
|
47
|
+
for (const u of members) {
|
|
48
|
+
for (const f of flowsOutOf(u)) {
|
|
49
|
+
for (const v of consumersOf(f))
|
|
50
|
+
if (v !== u && inChain.has(v))
|
|
51
|
+
links.push({ u, v, sync: isSync(f), async: isAsync(f) });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
// CR-SM-422: eine Quittung — `sync` zurueck an ein Glied, das hierher `async` abgelegt hat — ist die Antwort an
|
|
55
|
+
// den Ablegenden, keine Aktivierung. Ohne diese Ausnahme erreichte die Freigeberin ueber die Quittung des
|
|
56
|
+
// Cockpits das Werkzeug des KI-Clients und galt als zweiter Ausloeser (immo-infra CR-INF-012).
|
|
57
|
+
const receipt = (l) => l.sync && links.some((k) => k.u === l.v && k.v === l.u && k.async);
|
|
58
|
+
const active = links.filter((l) => !receipt(l));
|
|
59
|
+
// Ein Speicher hat keinen Eingang, weder aus der Kette noch von einem Akteur — ein Glied, das ein Akteur ruft,
|
|
60
|
+
// ist keiner, auch wenn es aus der Kette nichts bekommt (CR-SM-422).
|
|
61
|
+
const actorFed = new Set(members.filter((m) => flowsInto(m).some((f) => producersOf(f).some((p) => idx.typeOf(p) === 'ACTOR'))));
|
|
62
|
+
const fed = new Set([...active.map((l) => l.v), ...actorFed]);
|
|
63
|
+
const adj = new Map(members.map((m) => [m, new Set()]));
|
|
64
|
+
for (const l of active) {
|
|
65
|
+
adj.get(l.u).add(l.v);
|
|
66
|
+
if (l.sync && !fed.has(l.u))
|
|
67
|
+
adj.get(l.v).add(l.u);
|
|
68
|
+
}
|
|
69
|
+
const cover = new Map();
|
|
70
|
+
const coverOf = (start) => {
|
|
71
|
+
const hit = cover.get(start);
|
|
72
|
+
if (hit)
|
|
73
|
+
return hit;
|
|
74
|
+
const seen = new Set([start]);
|
|
75
|
+
const todo = [start];
|
|
76
|
+
while (todo.length > 0)
|
|
77
|
+
for (const n of adj.get(todo.pop()))
|
|
78
|
+
if (!seen.has(n)) {
|
|
79
|
+
seen.add(n);
|
|
80
|
+
todo.push(n);
|
|
81
|
+
}
|
|
82
|
+
cover.set(start, seen);
|
|
83
|
+
return seen;
|
|
84
|
+
};
|
|
85
|
+
const raw = [];
|
|
86
|
+
for (const member of members) {
|
|
87
|
+
for (const flow of flowsInto(member)) {
|
|
88
|
+
for (const actor of producersOf(flow))
|
|
89
|
+
if (idx.typeOf(actor) === 'ACTOR')
|
|
90
|
+
raw.push({ actor, flow, member });
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
raw.sort((a, b) => a.flow.localeCompare(b.flow) || a.actor.localeCompare(b.actor) || a.member.localeCompare(b.member));
|
|
94
|
+
const sinks = [];
|
|
95
|
+
for (const member of members) {
|
|
96
|
+
for (const flow of flowsOutOf(member)) {
|
|
97
|
+
for (const actor of consumersOf(flow))
|
|
98
|
+
if (idx.typeOf(actor) === 'ACTOR')
|
|
99
|
+
sinks.push({ actor, flow, member });
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
sinks.sort((a, b) => a.flow.localeCompare(b.flow) || a.actor.localeCompare(b.actor) || a.member.localeCompare(b.member));
|
|
103
|
+
const unsynced = new Set();
|
|
104
|
+
for (const m of members)
|
|
105
|
+
for (const f of [...flowsOutOf(m), ...flowsInto(m)])
|
|
106
|
+
if (syncOf(f).state !== 'bound')
|
|
107
|
+
unsynced.add(f);
|
|
108
|
+
const full = (e) => members.every((m) => coverOf(e.member).has(m));
|
|
109
|
+
return { fc, members, inChain, raw, sinks, unsynced: [...unsynced].sort(), coverOf, full };
|
|
110
|
+
});
|
|
111
|
+
// Ausloeser je Kette zuerst — `neighbor` fragt nach den Ausloesern der ANDEREN Ketten.
|
|
112
|
+
const triggerFlows = new Map(chains.map((c) => [c.fc.id, new Set(c.raw.filter(c.full).map((e) => `${e.flow} ${e.member}`))]));
|
|
113
|
+
return chains.map((c) => {
|
|
114
|
+
const triggers = c.raw.filter(c.full);
|
|
115
|
+
const reachedByTrigger = new Set(triggers.flatMap((e) => [...c.coverOf(e.member)]));
|
|
116
|
+
const scope = triggers.length > 0 ? reachedByTrigger : new Set(c.members);
|
|
117
|
+
const fromChain = (actor) => c.sinks.filter((s) => s.actor === actor && scope.has(s.member)).map((s) => s.flow);
|
|
118
|
+
const entries = c.raw.map((e) => {
|
|
119
|
+
if (c.full(e))
|
|
120
|
+
return { ...e, role: 'trigger' };
|
|
121
|
+
const neighbor = chains.some((o) => o.fc.id !== c.fc.id && o.inChain.has(e.member) && triggerFlows.get(o.fc.id).has(`${e.flow} ${e.member}`));
|
|
122
|
+
if (neighbor)
|
|
123
|
+
return { ...e, role: 'neighbor' };
|
|
124
|
+
const received = fromChain(e.actor);
|
|
125
|
+
if (received.some(isSync))
|
|
126
|
+
return { ...e, role: 'middle' };
|
|
127
|
+
if (isSync(e.flow) && received.length > 0)
|
|
128
|
+
return { ...e, role: 'answer' };
|
|
129
|
+
if (isAsync(e.flow) && received.length === 0)
|
|
130
|
+
return { ...e, role: 'predelivery' };
|
|
131
|
+
return { ...e, role: 'unknown' };
|
|
132
|
+
});
|
|
133
|
+
const cuts = [...new Set(entries.filter((e) => e.role === 'middle').map((e) => e.member))]
|
|
134
|
+
.sort((a, b) => c.coverOf(b).size - c.coverOf(a).size || a.localeCompare(b));
|
|
135
|
+
const segments = [];
|
|
136
|
+
let rest = new Set(c.members);
|
|
137
|
+
for (const cut of cuts) {
|
|
138
|
+
const after = c.coverOf(cut);
|
|
139
|
+
const before = [...rest].filter((m) => !after.has(m) || m === cut);
|
|
140
|
+
if (before.length > 1 || (before.length === 1 && before[0] !== cut))
|
|
141
|
+
segments.push(before.sort());
|
|
142
|
+
rest = new Set([...after].filter((m) => rest.has(m)));
|
|
143
|
+
}
|
|
144
|
+
if (rest.size > 0)
|
|
145
|
+
segments.push([...rest].sort());
|
|
146
|
+
const reached = new Set(c.raw.flatMap((e) => [...c.coverOf(e.member)]));
|
|
147
|
+
const keys = new Set(triggers.map((e) => `${e.member} ${schemaOf(e.flow)}`));
|
|
148
|
+
return {
|
|
149
|
+
chainId: c.fc.id,
|
|
150
|
+
members: c.members,
|
|
151
|
+
entries,
|
|
152
|
+
sinks: c.sinks,
|
|
153
|
+
segments,
|
|
154
|
+
unreached: c.members.filter((m) => !reached.has(m)),
|
|
155
|
+
unsynced: c.unsynced,
|
|
156
|
+
triggersAgree: keys.size <= 1,
|
|
157
|
+
};
|
|
158
|
+
});
|
|
159
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* FC-03..FC-
|
|
2
|
+
* FC-03..FC-06 — FCHAIN quality rules (CR-121 Phase 1; FC-05 CR-SM-363; FC-06 CR-SM-420; FC-02 in UC-03 aufgegangen, CR-SM-412).
|
|
3
3
|
*/
|
|
4
4
|
import type { OntologyGraph } from './ontology.js';
|
|
5
5
|
import type { RuleDefinition, RuleViolation } from './rules.js';
|
|
@@ -7,5 +7,6 @@ import type { MetricPolicy } from './policy.js';
|
|
|
7
7
|
export declare function fc03FchainFlat(graph: OntologyGraph): RuleViolation[];
|
|
8
8
|
export declare function fc04ActorBounded(graph: OntologyGraph): RuleViolation[];
|
|
9
9
|
export declare function fc05ChainConnected(graph: OntologyGraph): RuleViolation[];
|
|
10
|
+
export declare function fc06OneTrigger(graph: OntologyGraph): RuleViolation[];
|
|
10
11
|
export declare const FC_RULES: RuleDefinition[];
|
|
11
12
|
export declare function evaluateFCRules(graph: OntologyGraph, policy: MetricPolicy): RuleViolation[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { indexOf } from './graph-index.js';
|
|
2
2
|
import { unwiredFuncs } from './rules.js';
|
|
3
|
+
import { chainRoles } from './chain-roles.js';
|
|
3
4
|
// ---------------------------------------------------------------------------
|
|
4
5
|
// FC-03: ein Block (FUNC mit FUNC-Kindern) ist weder Glied einer Kette noch Erfueller einer Anforderung —
|
|
5
6
|
// error seit CR-SM-410. Fall 1: FUNC within FCHAIN must not compose other FUNC (flat chain).
|
|
@@ -224,6 +225,54 @@ export function fc05ChainConnected(graph) {
|
|
|
224
225
|
return violations;
|
|
225
226
|
}
|
|
226
227
|
// ---------------------------------------------------------------------------
|
|
228
|
+
// FC-06: die Kette hat EINEN Ausloeser (CR-SM-420).
|
|
229
|
+
//
|
|
230
|
+
// Der Ausloeser ist abgeleitet (`chainRoles`): der Eingang, von dem aus alle Glieder erreichbar sind.
|
|
231
|
+
// Ein Akteur in der Mitte ist zulaessig, ebenso mehrere Ausloeser am selben Glied mit demselben
|
|
232
|
+
// Vertrag (Freigabe des Autors 2026-10-28). EIN Befund je Kette, EINE Ursache, in dieser Reihenfolge:
|
|
233
|
+
// - `unsynced`: ein Fluss an einem Glied traegt kein lesbares `sync` — dann raet die Ableitung, und
|
|
234
|
+
// FC-06 urteilt nicht weiter (wie `answerPathBlockedBy`, CR-SM-408);
|
|
235
|
+
// - `predelivery`: ein Akteur liefert nur vorab (async, bekommt nichts aus der Kette) — er ist kein Akteur
|
|
236
|
+
// der Kette; die Funktion holt die Daten selbst aus einer Datei oder einem Speicher (CR-SM-422);
|
|
237
|
+
// - `no-trigger`: kein Eingang erreicht alle Glieder;
|
|
238
|
+
// - `triggers-disagree`: mehrere Ausloeser an verschiedenen Gliedern oder mit verschiedenem Vertrag.
|
|
239
|
+
// Eine Kette ohne Glied oder ohne ACTOR-Eingang gehoert R-15 bzw. FC-04 — FC-06 schweigt dort.
|
|
240
|
+
// ---------------------------------------------------------------------------
|
|
241
|
+
export function fc06OneTrigger(graph) {
|
|
242
|
+
const idx = indexOf(graph);
|
|
243
|
+
const violations = [];
|
|
244
|
+
for (const r of chainRoles(graph)) {
|
|
245
|
+
if (r.members.length === 0 || r.entries.length === 0)
|
|
246
|
+
continue;
|
|
247
|
+
const fc = idx.byId.get(r.chainId);
|
|
248
|
+
const push = (cause, message, fix_hint) => violations.push({
|
|
249
|
+
rule_id: 'FC-06',
|
|
250
|
+
severity: 'warning',
|
|
251
|
+
element_id: fc.id,
|
|
252
|
+
message: `[${cause}] ${message}`,
|
|
253
|
+
fix_hint,
|
|
254
|
+
context: { element_type: fc.type, element_name: fc.name },
|
|
255
|
+
});
|
|
256
|
+
const triggers = r.entries.filter((e) => e.role === 'trigger');
|
|
257
|
+
const vorab = r.entries.filter((e) => e.role === 'predelivery');
|
|
258
|
+
if (r.unsynced.length > 0) {
|
|
259
|
+
push('unsynced', `${fc.id}: flows without sync, the trigger cannot be derived (${r.unsynced.join(', ')})`, 'Set `@sync sync` (the receiver waits for it) or `@sync async` (delivered beforehand) on each flow');
|
|
260
|
+
}
|
|
261
|
+
else if (vorab.length > 0) {
|
|
262
|
+
push('predelivery', `${fc.id}: actors only deliver in advance (${vorab.map((e) => `${e.actor} via ${e.flow} at ${e.member}`).join('; ')})`, 'An actor triggers or receives; data delivered in advance is read by the function itself — model it as a file or store the member reads, not as an actor flow');
|
|
263
|
+
}
|
|
264
|
+
else if (triggers.length === 0) {
|
|
265
|
+
const reach = r.unreached.length > 0 ? `unreached: ${r.unreached.join(', ')}` : 'each entry reaches only a part';
|
|
266
|
+
push('no-trigger', `${fc.id} has no trigger: no entry reaches every member (${reach})`, 'Connect the unreached members with a FLOW from the chain, or split the chain — one FCHAIN per trigger');
|
|
267
|
+
}
|
|
268
|
+
else if (!r.triggersAgree) {
|
|
269
|
+
const list = triggers.map((e) => `${e.actor} via ${e.flow} at ${e.member}`);
|
|
270
|
+
push('triggers-disagree', `${fc.id} has ${triggers.length} triggers at different members or with different contracts (${list.join('; ')})`, 'Several actors may start one chain only at the same member with the same SCHEMA — otherwise give each trigger its own FCHAIN');
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
return violations;
|
|
274
|
+
}
|
|
275
|
+
// ---------------------------------------------------------------------------
|
|
227
276
|
// Aggregated
|
|
228
277
|
// ---------------------------------------------------------------------------
|
|
229
278
|
export const FC_RULES = [
|
|
@@ -240,6 +289,9 @@ export const FC_RULES = [
|
|
|
240
289
|
// PDR mit einer Kette, die keine Kennzahl und keine Analyse traegt. FC-04 bleibt ohne Rolle: sie meldet
|
|
241
290
|
// auch an bewertbaren Ketten, die eine andere fortsetzen.
|
|
242
291
|
{ id: 'FC-05', name: 'FCHAIN is connected (producer -> consumer)', severity: 'warning', stage: 6, role: 'existence', evaluate: fc05ChainConnected, domain: ['FCHAIN'] },
|
|
292
|
+
// CR-SM-420: Stufe 8 ist die spaeteste Menge, die FC-06 liest (SCHEMA, fuer den Vertrag der Ausloeser) — keine Ausnahme.
|
|
293
|
+
// Ein FLOW traegt genau einen SCHEMA (R-18), die Menge ist also gefuellt, sobald es Fluesse gibt.
|
|
294
|
+
{ id: 'FC-06', name: 'FCHAIN has one trigger', severity: 'warning', stage: 8, evaluate: fc06OneTrigger, domain: ['FCHAIN'] },
|
|
243
295
|
];
|
|
244
296
|
// CR-SM-236: `policy` wird durchgereicht, auch wo diese Familie heute keine Schwelle hat —
|
|
245
297
|
// ein Sonderweg je Familie waere genau der zweite Pfad, den der Regelsatz verbietet.
|
|
@@ -11,19 +11,19 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export declare const GRAMMAR_SNAPSHOT: {
|
|
13
13
|
readonly versions: {
|
|
14
|
-
readonly ontology: "11.
|
|
14
|
+
readonly ontology: "11.1.0";
|
|
15
15
|
readonly metaModel: "6.0.0";
|
|
16
|
-
readonly rules: "
|
|
16
|
+
readonly rules: "50.0.0";
|
|
17
17
|
};
|
|
18
18
|
readonly elementTypes: readonly ["ACTOR", "CR", "FCHAIN", "FLOW", "FUNC", "MOD", "MS", "REQ", "SCHEMA", "SYS", "TEST", "UC"];
|
|
19
19
|
readonly traceTypes: readonly ["allocate", "compose", "io", "relation", "satisfy", "verify"];
|
|
20
20
|
readonly patterns: readonly ["ACTOR -io-> FLOW", "CR -relation-> FUNC", "CR -relation-> MOD", "CR -relation-> MS", "CR -relation-> REQ", "CR -relation-> SCHEMA", "CR -relation-> UC", "FCHAIN -compose-> FUNC [1..*]", "FCHAIN -satisfy-> REQ where target.kinds in {non-functional}", "FLOW -io-> ACTOR", "FLOW -io-> FUNC", "FLOW -relation-> SCHEMA [1]", "FUNC -allocate-> MOD [0..1]", "FUNC -compose-> FUNC [0..*]", "FUNC -io-> FLOW", "FUNC -satisfy-> REQ where target.kinds in {functional}", "MOD -compose-> MOD [0..*]", "MOD -satisfy-> REQ where target.kinds in {non-functional}", "MS -compose-> FUNC", "MS -compose-> REQ", "MS -compose-> UC", "MS -relation-> MS label=depends-on", "REQ -compose-> REQ [0..*]", "SYS -compose-> MOD [0..*]", "SYS -compose-> REQ [0..*]", "SYS -compose-> SYS [0..*]", "SYS -compose-> UC [1..*]", "SYS -satisfy-> REQ where target.kinds in {non-functional}", "TEST -verify-> REQ", "TEST -verify-> SCHEMA", "UC -compose-> FCHAIN [1..*]", "UC -compose-> REQ [1..*]"];
|
|
21
21
|
readonly elementColumns: readonly ["OntologyElement.attributes", "OntologyElement.created_at", "OntologyElement.description", "OntologyElement.id", "OntologyElement.kinds", "OntologyElement.method", "OntologyElement.name", "OntologyElement.status", "OntologyElement.type", "OntologyElement.updated_at", "Trace.attributes", "Trace.created_at", "Trace.label", "Trace.source", "Trace.target", "Trace.type", "Trace.verified_at", "Trace.weight"];
|
|
22
|
-
readonly attributes: readonly ["CR.architectureOnly: boolean", "CR.rationale: string", "CR.spike: boolean", "CR.status: enum", "FLOW.sync: enum", "FUNC.external: boolean", "FUNC.measuredMs: number", "FUNC.realRef: object", "FUNC.safety_relevant: boolean", "FUNC.sourceFile: string", "FUNC.timingBudgetMs: number", "MOD.external: boolean", "MOD.kind: string", "MOD.path: string", "MOD.realRef: object", "REQ.detection: number", "REQ.occurrence: number", "REQ.role: enum", "REQ.severity: number", "SCHEMA.contract: string", "SCHEMA.external: boolean", "SCHEMA.realRef: object", "TEST.sourceFile: string", "TEST.testRefs: array", "UC.operatingMode: string"];
|
|
22
|
+
readonly attributes: readonly ["CR.architectureOnly: boolean", "CR.maxFiles: number", "CR.rationale: string", "CR.spike: boolean", "CR.status: enum", "FLOW.sync: enum", "FUNC.external: boolean", "FUNC.measuredMs: number", "FUNC.realRef: object", "FUNC.safety_relevant: boolean", "FUNC.sourceFile: string", "FUNC.timingBudgetMs: number", "MOD.external: boolean", "MOD.kind: string", "MOD.path: string", "MOD.realRef: object", "REQ.detection: number", "REQ.occurrence: number", "REQ.role: enum", "REQ.severity: number", "SCHEMA.contract: string", "SCHEMA.external: boolean", "SCHEMA.realRef: object", "TEST.sourceFile: string", "TEST.testRefs: array", "UC.operatingMode: string"];
|
|
23
23
|
readonly enums: readonly ["CR.status=done", "CR.status=open", "FLOW.sync=async", "FLOW.sync=sync", "OntologyElement.kinds=functional", "OntologyElement.kinds=non-functional", "OntologyElement.method=analysis", "OntologyElement.method=demonstration", "OntologyElement.method=inspection", "OntologyElement.method=test", "OntologyElement.status=done", "OntologyElement.status=draft", "OntologyElement.status=open", "OntologyElement.status=reviewed", "REQ.role=mitigation", "REQ.role=risk"];
|
|
24
|
-
readonly rules: readonly ["AF-01 (warning) domain=[graph] stage=3 role=analysis", "AF-02 (warning) domain=[graph] stage=7 role=analysis", "AF-03 (warning) domain=[graph] stage=7 role=analysis", "AF-04 (warning) domain=[graph] stage=8 role=analysis", "AF-05 (warning) domain=[graph] stage=10 role=existence", "BQ-01 (warning) domain=[REQ] stage=3", "BQ-02 (warning) domain=[REQ] stage=3", "BQ-
|
|
24
|
+
readonly rules: readonly ["AF-01 (warning) domain=[graph] stage=3 role=analysis", "AF-02 (warning) domain=[graph] stage=7 role=analysis", "AF-03 (warning) domain=[graph] stage=7 role=analysis", "AF-04 (warning) domain=[graph] stage=8 role=analysis", "AF-05 (warning) domain=[graph] stage=10 role=existence", "BQ-01 (warning) domain=[REQ] stage=3", "BQ-02 (warning) domain=[REQ] stage=3", "BQ-03 (warning) domain=[REQ] stage=3", "BQ-04 (warning) domain=[REQ] stage=3", "BQ-07 (warning) domain=[REQ] stage=3", "BW-02 (warning) domain=[FUNC] stage=5", "CL-01 (warning) domain=[ACTOR] stage=2", "CR-01 (warning) domain=[MOD] stage=7", "CR-R01 (warning) domain=[CR] stage=10", "CR-R02 (warning) domain=[CR] stage=10", "CR-R03 (warning) domain=[all] stage=immer", "FC-03 (error) domain=[FUNC] stage=5", "FC-04 (warning) domain=[FCHAIN] stage=6", "FC-05 (warning) domain=[FCHAIN] stage=6 role=existence", "FC-06 (warning) domain=[FCHAIN] stage=8", "FM-01 (warning) domain=[REQ] stage=3", "FM-02 (warning) domain=[REQ] stage=3", "FM-03 (warning) domain=[REQ] stage=9", "IO-01 (warning) domain=[FUNC] stage=5", "IO-02 (error) domain=[FLOW] stage=6", "MS-01 (warning) domain=[MS] stage=10", "MS-02 (warning) domain=[MS] stage=10", "MS-03 (info) domain=[CR] stage=10", "MT-01 (warning) domain=[MOD] stage=7", "MT-02 (warning) domain=[MOD] stage=7", "MT-04 (info) domain=[FUNC] stage=5", "ND-01 (warning) domain=[FUNC] stage=5", "ND-02 (warning) domain=[SCHEMA] stage=8", "NFR-01 (warning) domain=[FCHAIN,FUNC,MOD] stage=7", "R-01 (error) domain=[REQ] stage=9 role=existence", "R-02 (warning) domain=[FUNC] stage=5", "R-04 (warning) domain=[MOD] stage=7", "R-05 (warning) domain=[TEST] stage=9", "R-08 (error) domain=[all] stage=immer", "R-10 (warning) domain=[FLOW] stage=6", "R-12 (warning) domain=[FUNC] stage=5", "R-15 (warning) domain=[FCHAIN] stage=5 role=existence", "R-16 (warning) domain=[ACTOR] stage=2", "R-17 (warning) domain=[SYS] stage=2 role=existence", "R-18 (error) domain=[all] stage=immer", "R-19 (warning) domain=[TEST] stage=11", "R-20 (warning) domain=[FUNC] stage=11", "R-21 (warning) domain=[FCHAIN,FUNC] stage=9", "R-22 (warning) domain=[FUNC] stage=7 role=existence", "R-23 (warning) domain=[MOD] stage=7", "R-26 (warning) domain=[SCHEMA] stage=11", "R-29 (error) domain=[TEST] stage=11", "R-30 (warning) domain=[FUNC] stage=5", "R-31 (warning) domain=[FUNC] stage=6 role=existence", "R-32 (warning) domain=[SCHEMA] stage=9 role=existence", "R-33 (warning) domain=[graph] stage=1 role=existence", "R-35 (error) domain=[FUNC] stage=7", "RC-01 (warning) domain=[FUNC] stage=12", "RC-02 (warning) domain=[TEST] stage=12", "RC-03 (warning) domain=[SCHEMA] stage=12", "RC-04 (warning) domain=[SCHEMA] stage=12", "RC-05 (warning) domain=[MOD] stage=10", "RC-06 (warning) domain=[FUNC,MOD,SCHEMA] stage=12", "RC-07 (warning) domain=[CR,SYS] stage=10", "RC-08 (warning) domain=[SCHEMA] stage=12", "RC-09 (warning) domain=[SCHEMA] stage=12", "RC-10 (warning) domain=[MOD] stage=12", "RC-11 (warning) domain=[SYS] stage=12", "RC-12 (warning) domain=[FLOW] stage=12", "RC-13 (warning) domain=[FUNC] stage=12", "RD-01 (warning) domain=[REQ] stage=3", "RD-02 (warning) domain=[REQ] stage=3", "RD-04 (warning) domain=[FUNC,MOD,SYS] stage=7", "RD-05 (warning) domain=[FUNC,MOD] stage=7", "SC-02 (warning) domain=[SCHEMA] stage=8", "UC-01 (warning) domain=[UC] stage=3 role=existence", "UC-02 (warning) domain=[UC] stage=2 role=existence", "UC-03 (warning) domain=[UC] stage=4 role=existence", "UC-04 (warning) domain=[UC] stage=2", "UC-07 (warning) domain=[FCHAIN,UC] stage=4", "VR-01 (info) domain=[TEST] stage=11"];
|
|
25
25
|
readonly conformanceRules: readonly ["RC-01 (warning)", "RC-02 (warning)", "RC-03 (warning)", "RC-04 (warning)", "RC-05 (warning)", "RC-06 (warning)", "RC-07 (warning)", "RC-08 (warning)", "RC-09 (warning)", "RC-10 (warning)", "RC-11 (warning)", "RC-12 (warning)", "RC-13 (warning)"];
|
|
26
|
-
readonly policy: readonly ["apTable = null", "boundaryWidth = {warning:5}", "criticality = {infrastructure:3}", "crossingFlows = {warning:3}", "decompositionBreadth = {min:3,warning:9}", "instability = null", "lcom4 = {info:4,warning:6}", "riskRpn = 100"];
|
|
27
|
-
readonly ruleHelp: readonly ["AF-01", "AF-02", "AF-03", "AF-04", "AF-05", "BQ-01", "BQ-02", "BQ-
|
|
28
|
-
readonly exports: readonly ["ACCEPTED_FINDINGS_ATTRIBUTE", "AF_RULES", "ALL_RULE_DEFS", "AO_RULES", "AcceptedFindingSchema", "ActionPriority", "AnalysisArtifactId", "AnalysisFreshnessStampSchema", "ApTableSchema", "BOUNDED_PATTERNS", "BQ_RULES", "CLOSED_STATUS", "CODE_CONFORMANCE_RULES", "CR_RULES", "CallEdgeSchema", "CallSiteSchema", "ChainMetrics", "CodeFactsSchema", "ConstraintCarriers", "DEFAULT_METRIC_POLICY", "ELEMENT_ATTRIBUTES", "ELEMENT_DESCRIPTIONS", "ElementType", "ElementUid", "FC_RULES", "FM_RULES", "FileFactsSchema", "FlowSync", "FunctionCriticality", "GRAPH_ANCHOR", "ImportEdgeSchema", "MARK_STAGE", "MAX_SLUG_LENGTH", "META_MODEL_VERSION", "MODELING_ELEMENT_TYPES", "MT_RULES", "Mark", "MetricPolicySchema", "ModuleMetrics", "ND_RULES", "ONTOLOGY_VERSION", "OntologyElement", "OntologyGraph", "PHASE_READINESS_NAME", "REQUIRED_PATTERNS", "RULES_VERSION", "RULE_HELP", "RULE_TASKS", "RealRefSchema", "RepoRelativePathSchema", "ReqKind", "ReqRole", "RequirementScope", "RiskCarriers", "RuleSeverity", "RuleViolation", "SC_RULES", "STAGE_SETS", "SteerSpace", "SteerTerm", "TASK_ENTRY", "TASK_OWNED_RULES", "TRACE_PATTERNS", "TestRefSchema", "TestRefsSchema", "TestResult", "Trace", "TraceType", "UC_RULES", "V3_RULES", "VIEW_RULES", "VerificationMethod", "ViolationCandidate", "ViolationContext", "acceptedRuleIds", "actionPriority", "admittingAlternatives", "allocationCohesion", "apMethod", "attributeTypeOf", "boxContracts", "bq01Unambiguous", "bq02Verifiable", "
|
|
26
|
+
readonly policy: readonly ["apTable = null", "boundaryWidth = {warning:5}", "criticality = {infrastructure:3}", "crossingFlows = {warning:3}", "decompositionBreadth = {min:3,warning:9}", "instability = null", "lcom4 = {info:4,warning:6}", "needNameTerms = [\"KI\",\"MCP\",\"Gate\",\"Lauf\",\"Ziel\"]", "riskRpn = 100"];
|
|
27
|
+
readonly ruleHelp: readonly ["AF-01", "AF-02", "AF-03", "AF-04", "AF-05", "BQ-01", "BQ-02", "BQ-03", "BQ-04", "BQ-07", "BW-02", "CL-01", "CR-01", "CR-R01", "CR-R02", "CR-R03", "FC-03", "FC-04", "FC-05", "FC-06", "FM-01", "FM-02", "FM-03", "IO-01", "IO-02", "MS-01", "MS-02", "MS-03", "MT-01", "MT-02", "MT-04", "ND-01", "ND-02", "NFR-01", "R-01", "R-02", "R-04", "R-05", "R-08", "R-10", "R-12", "R-15", "R-16", "R-17", "R-18", "R-19", "R-20", "R-21", "R-22", "R-23", "R-26", "R-29", "R-30", "R-31", "R-32", "R-33", "R-35", "RC-01", "RC-02", "RC-03", "RC-04", "RC-05", "RC-06", "RC-07", "RC-08", "RC-09", "RC-10", "RC-11", "RC-12", "RC-13", "RD-01", "RD-02", "RD-04", "RD-05", "SC-02", "UC-01", "UC-02", "UC-03", "UC-04", "UC-07", "VR-01"];
|
|
28
|
+
readonly exports: readonly ["ACCEPTED_FINDINGS_ATTRIBUTE", "AF_RULES", "ALL_RULE_DEFS", "AO_RULES", "AcceptedFindingSchema", "ActionPriority", "AnalysisArtifactId", "AnalysisFreshnessStampSchema", "ApTableSchema", "BOUNDED_PATTERNS", "BQ_RULES", "CLOSED_STATUS", "CODE_CONFORMANCE_RULES", "CR_RULES", "CallEdgeSchema", "CallSiteSchema", "ChainMetrics", "CodeFactsSchema", "ConstraintCarriers", "DEFAULT_METRIC_POLICY", "ELEMENT_ATTRIBUTES", "ELEMENT_DESCRIPTIONS", "ElementType", "ElementUid", "FC_RULES", "FM_RULES", "FileFactsSchema", "FlowSync", "FunctionCriticality", "GRAPH_ANCHOR", "ImportEdgeSchema", "MARK_STAGE", "MAX_SLUG_LENGTH", "META_MODEL_VERSION", "MODELING_ELEMENT_TYPES", "MT_RULES", "Mark", "MetricPolicySchema", "ModuleMetrics", "ND_RULES", "ONTOLOGY_VERSION", "OntologyElement", "OntologyGraph", "PHASE_READINESS_NAME", "REQUIRED_PATTERNS", "RULES_VERSION", "RULE_HELP", "RULE_TASKS", "RealRefSchema", "RepoRelativePathSchema", "ReqKind", "ReqRole", "RequirementScope", "RiskCarriers", "RuleSeverity", "RuleViolation", "SC_RULES", "STAGE_SETS", "SteerSpace", "SteerTerm", "TASK_ENTRY", "TASK_OWNED_RULES", "TRACE_PATTERNS", "TestRefSchema", "TestRefsSchema", "TestResult", "Trace", "TraceType", "UC_RULES", "V3_RULES", "VIEW_RULES", "VerificationMethod", "ViolationCandidate", "ViolationContext", "acceptedRuleIds", "actionPriority", "admittingAlternatives", "allocationCohesion", "apMethod", "attributeTypeOf", "boxContracts", "bq01Unambiguous", "bq02Verifiable", "bq03Singular", "bq04Necessary", "bq07Complete", "bw02WhiteboxWidth", "callCoverage", "chainMetrics", "chainRoles", "chainsByFunc", "cl01ConopsCompleteness", "constraintCarriers", "contractsOfFlow", "cr01CrossingFlowCount", "crossingContractCount", "decomposedFuncs", "evaluateAFRules", "evaluateAORules", "evaluateAllRules", "evaluateBQRules", "evaluateCRRules", "evaluateConformanceRules", "evaluateFCRules", "evaluateFMRules", "evaluateMTRules", "evaluateNDRules", "evaluateRules", "evaluateSCRules", "evaluateUCRules", "evaluateViewRules", "extractFormatE", "fc03FchainFlat", "fc04ActorBounded", "fc05ChainConnected", "fc06OneTrigger", "flowProducers", "fm01MissingFmeaAttributes", "fm02MissingMitigation", "fm03HighRiskUnverified", "funcSimilarity", "funcSubtree", "functionCriticality", "getRuleDefsForProfile", "hydrateAttrValue", "importCoverage", "indexOf", "io01CrossModuleCompleteness", "isDue", "isElementUid", "isValidTrace", "jaccard", "markOfStage", "maxOccurs", "minOccurs", "moduleCrossings", "moduleMetrics", "mt01Instability", "mt02Lcom4", "mt04WhiteboxLcom4", "nd01FuncNearDuplicate", "nd02SchemaNearDuplicate", "nfr01BudgetOvershoot", "normalizeReqKinds", "pairsAbove", "parseElementUid", "readAnalysisStamp", "readFlowSync", "readRealRef", "readReqRole", "readTestRefs", "requirementScope", "riskCarriers", "sc02IsReferenced", "schemaSimilarity", "setBQ04SimilarityMatrix", "subtreeFuncs", "taskOf", "toElementUid", "toEvaluableGraph", "tokens", "traceRejection", "tryParseElementUid", "uc01HasRequirements", "uc02HasActor", "uc03HasScenario", "uc04GoalDefined", "uc07NameStatesNeed", "unbuiltElementIds", "unwiredFuncs", "vr01TestNoResult", "whiteboxContractCount"];
|
|
29
29
|
};
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export const GRAMMAR_SNAPSHOT = {
|
|
13
13
|
versions: {
|
|
14
|
-
ontology: "11.
|
|
14
|
+
ontology: "11.1.0",
|
|
15
15
|
metaModel: "6.0.0",
|
|
16
|
-
rules: "
|
|
16
|
+
rules: "50.0.0",
|
|
17
17
|
},
|
|
18
18
|
elementTypes: [
|
|
19
19
|
"ACTOR",
|
|
@@ -93,6 +93,7 @@ export const GRAMMAR_SNAPSHOT = {
|
|
|
93
93
|
],
|
|
94
94
|
attributes: [
|
|
95
95
|
"CR.architectureOnly: boolean",
|
|
96
|
+
"CR.maxFiles: number",
|
|
96
97
|
"CR.rationale: string",
|
|
97
98
|
"CR.spike: boolean",
|
|
98
99
|
"CR.status: enum",
|
|
@@ -144,8 +145,8 @@ export const GRAMMAR_SNAPSHOT = {
|
|
|
144
145
|
"AF-05 (warning) domain=[graph] stage=10 role=existence",
|
|
145
146
|
"BQ-01 (warning) domain=[REQ] stage=3",
|
|
146
147
|
"BQ-02 (warning) domain=[REQ] stage=3",
|
|
148
|
+
"BQ-03 (warning) domain=[REQ] stage=3",
|
|
147
149
|
"BQ-04 (warning) domain=[REQ] stage=3",
|
|
148
|
-
"BQ-06 (warning) domain=[REQ] stage=3",
|
|
149
150
|
"BQ-07 (warning) domain=[REQ] stage=3",
|
|
150
151
|
"BW-02 (warning) domain=[FUNC] stage=5",
|
|
151
152
|
"CL-01 (warning) domain=[ACTOR] stage=2",
|
|
@@ -156,6 +157,7 @@ export const GRAMMAR_SNAPSHOT = {
|
|
|
156
157
|
"FC-03 (error) domain=[FUNC] stage=5",
|
|
157
158
|
"FC-04 (warning) domain=[FCHAIN] stage=6",
|
|
158
159
|
"FC-05 (warning) domain=[FCHAIN] stage=6 role=existence",
|
|
160
|
+
"FC-06 (warning) domain=[FCHAIN] stage=8",
|
|
159
161
|
"FM-01 (warning) domain=[REQ] stage=3",
|
|
160
162
|
"FM-02 (warning) domain=[REQ] stage=3",
|
|
161
163
|
"FM-03 (warning) domain=[REQ] stage=9",
|
|
@@ -215,6 +217,7 @@ export const GRAMMAR_SNAPSHOT = {
|
|
|
215
217
|
"UC-02 (warning) domain=[UC] stage=2 role=existence",
|
|
216
218
|
"UC-03 (warning) domain=[UC] stage=4 role=existence",
|
|
217
219
|
"UC-04 (warning) domain=[UC] stage=2",
|
|
220
|
+
"UC-07 (warning) domain=[FCHAIN,UC] stage=4",
|
|
218
221
|
"VR-01 (info) domain=[TEST] stage=11",
|
|
219
222
|
],
|
|
220
223
|
conformanceRules: [
|
|
@@ -240,6 +243,7 @@ export const GRAMMAR_SNAPSHOT = {
|
|
|
240
243
|
"decompositionBreadth = {min:3,warning:9}",
|
|
241
244
|
"instability = null",
|
|
242
245
|
"lcom4 = {info:4,warning:6}",
|
|
246
|
+
"needNameTerms = [\"KI\",\"MCP\",\"Gate\",\"Lauf\",\"Ziel\"]",
|
|
243
247
|
"riskRpn = 100",
|
|
244
248
|
],
|
|
245
249
|
ruleHelp: [
|
|
@@ -250,8 +254,8 @@ export const GRAMMAR_SNAPSHOT = {
|
|
|
250
254
|
"AF-05",
|
|
251
255
|
"BQ-01",
|
|
252
256
|
"BQ-02",
|
|
257
|
+
"BQ-03",
|
|
253
258
|
"BQ-04",
|
|
254
|
-
"BQ-06",
|
|
255
259
|
"BQ-07",
|
|
256
260
|
"BW-02",
|
|
257
261
|
"CL-01",
|
|
@@ -262,6 +266,7 @@ export const GRAMMAR_SNAPSHOT = {
|
|
|
262
266
|
"FC-03",
|
|
263
267
|
"FC-04",
|
|
264
268
|
"FC-05",
|
|
269
|
+
"FC-06",
|
|
265
270
|
"FM-01",
|
|
266
271
|
"FM-02",
|
|
267
272
|
"FM-03",
|
|
@@ -321,6 +326,7 @@ export const GRAMMAR_SNAPSHOT = {
|
|
|
321
326
|
"UC-02",
|
|
322
327
|
"UC-03",
|
|
323
328
|
"UC-04",
|
|
329
|
+
"UC-07",
|
|
324
330
|
"VR-01",
|
|
325
331
|
],
|
|
326
332
|
exports: [
|
|
@@ -407,12 +413,13 @@ export const GRAMMAR_SNAPSHOT = {
|
|
|
407
413
|
"boxContracts",
|
|
408
414
|
"bq01Unambiguous",
|
|
409
415
|
"bq02Verifiable",
|
|
416
|
+
"bq03Singular",
|
|
410
417
|
"bq04Necessary",
|
|
411
|
-
"bq06Conforming",
|
|
412
418
|
"bq07Complete",
|
|
413
419
|
"bw02WhiteboxWidth",
|
|
414
420
|
"callCoverage",
|
|
415
421
|
"chainMetrics",
|
|
422
|
+
"chainRoles",
|
|
416
423
|
"chainsByFunc",
|
|
417
424
|
"cl01ConopsCompleteness",
|
|
418
425
|
"constraintCarriers",
|
|
@@ -438,6 +445,7 @@ export const GRAMMAR_SNAPSHOT = {
|
|
|
438
445
|
"fc03FchainFlat",
|
|
439
446
|
"fc04ActorBounded",
|
|
440
447
|
"fc05ChainConnected",
|
|
448
|
+
"fc06OneTrigger",
|
|
441
449
|
"flowProducers",
|
|
442
450
|
"fm01MissingFmeaAttributes",
|
|
443
451
|
"fm02MissingMitigation",
|
|
@@ -489,6 +497,7 @@ export const GRAMMAR_SNAPSHOT = {
|
|
|
489
497
|
"uc02HasActor",
|
|
490
498
|
"uc03HasScenario",
|
|
491
499
|
"uc04GoalDefined",
|
|
500
|
+
"uc07NameStatesNeed",
|
|
492
501
|
"unbuiltElementIds",
|
|
493
502
|
"unwiredFuncs",
|
|
494
503
|
"vr01TestNoResult",
|
package/dist/se/index.d.ts
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Single source of truth for SE ontology schemas across all projects.
|
|
4
4
|
*/
|
|
5
5
|
/** Ontology schema version (element types + trace types). */
|
|
6
|
-
export declare const ONTOLOGY_VERSION = "11.
|
|
6
|
+
export declare const ONTOLOGY_VERSION = "11.1.0";
|
|
7
7
|
/** Rules engine version (validation rules incl. RC conformance). */
|
|
8
|
-
export declare const RULES_VERSION = "
|
|
8
|
+
export declare const RULES_VERSION = "50.0.0";
|
|
9
9
|
/** Meta-model version (trace pattern constraints + format-e parser). */
|
|
10
10
|
export declare const META_MODEL_VERSION = "6.0.0";
|
|
11
11
|
export * from './ontology.js';
|
|
@@ -33,6 +33,7 @@ export * from './module-crossings.js';
|
|
|
33
33
|
*/
|
|
34
34
|
export * from './function-criticality.js';
|
|
35
35
|
export * from './chain-metrics.js';
|
|
36
|
+
export * from './chain-roles.js';
|
|
36
37
|
export * from './risk-carriers.js';
|
|
37
38
|
export * from './quality-rules.js';
|
|
38
39
|
export * from './analysis-freshness-rules.js';
|
package/dist/se/index.js
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Single source of truth for SE ontology schemas across all projects.
|
|
4
4
|
*/
|
|
5
5
|
/** Ontology schema version (element types + trace types). */
|
|
6
|
-
export const ONTOLOGY_VERSION = '11.
|
|
6
|
+
export const ONTOLOGY_VERSION = '11.1.0'; // MINOR (CR-SM-426): +`CR.attributes.maxFiles: number` — stand in 100 CR-Knoten der Familie, kam ueber Format-E aber als String zurueck, weil die Deklaration fehlte. `concept` und `deferred` bleiben undeklariert (CR-SM-393: wirkungslos, kein Leser). Prior: MAJOR (CR-SM-393): das Attribut `concept` entfaellt an TEST, REQ, FUNC, MOD und SCHEMA (Entscheidung des Autors 2026-10-05: Konzept war nur als Zwischenstand gedacht, um mitten im Bau nicht mit Fehlermeldungen ueberhaeuft zu werden; gemessen setzt der lokale Agent es an JEDES Element). Ein Bestandsgraph, der es traegt, laedt weiter: `attributes` ist ein freier Sack, das Attribut ist wirkungslos; ueber Format-E kommt `@concept true` jetzt als String an (kein deklarierter Typ). Bestand: 444 Elemente in 23 von 35 Graphen tragen es (TEST 221, FUNC 113, SCHEMA 99, MOD 11, REQ 0). Prior: // MINOR (CR-SM-391): +`REQ.attributes.concept: boolean` — das fuenfte Element mit dem Schalter (TEST, FUNC, MOD, SCHEMA). Gelesen von R-01: nur eine Konzept-REQ darf ausschliesslich Konzept-TESTs tragen. Anders als an den vier anderen ist er KEINE Ausnahme von einer Bindungspflicht (eine REQ hat keinen realRef), sondern die Erklaerung, dass der Nachweis noch nicht faellig ist; ein `verify` braucht auch sie. Bestand: kein Graph der Familie traegt `concept` an einer REQ (35 Graphen, gemessen 2026-10-05), keine Migration. Prior: // MINOR (CR-SM-386): +`CR.attributes.architectureOnly: boolean`. CR-R02 las den Schalter identitaetsscharf (`=== true`), er stand aber nicht in ELEMENT_ATTRIBUTES — die typ-geleitete Hydrierung (CR-SM-251) liess `@architectureOnly true` als String "true" stehen, die Ausnahme war ueber Format-E unerreichbar. Bestand: bereits gespeicherte Strings "true" bleiben im Store Strings, bis der Knoten neu geschrieben oder per Export-Reimport hydriert wird; keine Migration. Prior: // BREAKING innerhalb des unveroeffentlichten 10.x (CR-SM-366): `ReqKind` 6 -> 2 Werte {functional, non-functional}, genau EIN Wert je REQ. Entfallen: precondition/postcondition (Vorbedingung = Eingangs-FLOW der Kette, Nachbedingung = UC-Ziel, geprueft ueber R-21; Leser UC-05/06 seit CR-SM-357 weg) und risk/mitigation (-> `REQ.attributes.role`, CR-SM-365). Die Zeichenkette bleibt 10.1.0: die Enum-WERTE stehen in keiner Oberflaeche von grammar-snapshot.ts (nur die Spalte `OntologyElement.kinds`), `check:grammar` verlangt also keine Bewegung; gegen die Registry (9.1.0) ist 10.x der eine Major dieses Zugs. Migration (graphcode CR-GC-669): pre/post-REQ je REQ auf functional|non-functional oder aufloesen, risk/mitigation -> role. Prior: // MINOR (CR-SM-365): +`REQ.attributes.role` (Enum `ReqRole` risk|mitigation, Leser `readReqRole`) — die FMEA-Rolle einer Anforderung, satisfy-neutral. Reine Ergaenzung an der Oberflaeche (ReqKind unveraendert; die Entfernung von risk/mitigation aus `kinds` ist CR-SM-366). Kein eigener Major: 10.0.0 ist unveroeffentlicht (Registry 9.1.0), 10.x ist EIN Major gegen die Registry; `check:grammar` vergleicht je Commit gegen HEAD und erzwingt daher eine Bewegung der Zeichenkette. Prior: // MAJOR (CR-SM-364): FLOW traegt genau ein Realisierungsattribut `sync` (Enum sync|async, fehlend = unbekannt, kein Default; Leser `readFlowSync`, Enum `FlowSync`). `protocol` und `qos` entfallen — formal breaking, am Bestand folgenlos: 0 von 186 Familien-FLOWs (bok, SM, GVE, GC, graphify) setzen eines davon, kein Leser ausser ontology.ts/grammar-snapshot.ts. Prior: // MINOR (CR-SM-355): `AnalysisFreshnessStampSchema.crRefs?: string[]` — die aus einem Task hervorgegangenen CRs, atomar mit dem Stempel; TR-01/IR-01 lesen es. Prior: // BREAKING (CR-SM-294): das Feld `asil` entfaellt ersatzlos, zusammen mit dem Enum `AsilLevel`. Sein einziger Leser war R-03 (ASIL isolation), und die Messung ueber 19 Familiengraphen (4540 Elemente) zeigt: 0 von 305 MOD tragen `asil` ueberhaupt. Ein Feld ohne Schreiber ist eine Regel, die nie feuert -- Gate 3 der Grammatik-Review. Mit R-03 fallen im selben Zug RT-01, PH-01, R-27 (alle drei lesen `attributes.kind === 'physical'`, 0 von 305 MOD tragen es) und CA-01 (`attributes.requires` / `attributes.capability`, 0/0). Die physische Ebene der Ontologie war nie in Gebrauch: kein Mitglied der Familie modelliert Hardware oder funktionale Sicherheit. `kind`, `requires` und `capability` brauchen KEINEN Schema-Eingriff -- sie lagen im freien `attributes`-Sack und sind nach der Streichung ihrer Leser schlicht unbenutzte Schluessel. Migration: ein Graph, der `asil` traegt, verliert das Feld beim naechsten Reseed; kein Element und keine Kante faellt (0 -> 0 Befunde ueber alle 19 Graphen). Prior: BREAKING (CR-SM-266a): drei Enums schrumpfen, und alle drei sind ENTFERNUNGEN. (1) ElementType 13 -> 12: `SESSION` entfaellt. (2) TraceType 7 -> 6: `produces` entfaellt. Beide trugen genau EIN Pattern (`SESSION -produces-> *`), und die Messung hat es widerlegt: 0 produces-Kanten und 0 SESSION-Knoten in ALLEN 9 aktiven Familie-Graphen, auch im graphcode-Selbstmodell nach 195 gegateten Versionen. Die reale Provenance lebt seit CR-GC-347 in `.graphcode/audit.jsonl` -- audit_trail/audit_stats lesen die DATEI, nie den Graphen; einziger Schreiber war ein toter Pfad (CR-195d in graph-api-core), Leser mit Wirkung keiner. Der urspruengliche CR-Entwurf hielt das Pattern fuer die Provenance-Kante und wollte es BEHALTEN ('Nicht-Befund'); die Zaehlung hat den Nicht-Befund kassiert -- Gate 1 verlangt fuer das Wiederaufmachen einer Entscheidung eine Messung, und hier war sie es. (3) Mit `produces` faellt `TraceCategory` und `Trace.category`. Das ist die wichtigste Haelfte: R-08 und R-18 haben `category === 'audit'` UEBERSPRUNGEN, also haette nach D5 jede Kante mit diesem selbstgesetzten Attribut die komplette Pattern-Matrix UND die Referenzintegritaet umgangen. Ein Attribut, das eine Strukturpruefung abschaltet, ist die Klasse aus CR-SM-263/-257; hier zusaetzlich der billige Zweitweg aus CR-GC-366, nur ohne Kante. Gemessen: 0 von 0 Traces aller 9 Graphen tragen `category` -- die Entfernung nimmt niemandem etwas weg. (4) ReqKind 7 -> 6: `negative` entfaellt. Ein Verbots-REQ ist auch eine Anforderung -- die Implementierung muss Regeln abfragen oder Sicherungen einbauen, das ist `functional`. Der Wert hatte NULL Leser (anders als risk/mitigation -> FM-01..03, pre/postcondition -> UC-05/06, non-functional -> NFR-01) und haette durch die neuen where-Praedikate per AUSLASSUNG erstmals Wirkung bekommen: er stand in keiner der vier Listen und waere nur noch per FCHAIN erfuellbar gewesen. Die sechs verbleibenden Werte partitionieren die where-Listen VOLLSTAENDIG. Migration `negative`: 3 REQs, alle graphcode, Ziel-kind je REQ statt pauschal -- REQ-dashboard-readonly und REQ-readonly-bridge nach `non-functional` (Architektur-Constraint an der Modulgrenze, konsistent mit D2), REQ-no-extraction nach `functional`. Rest-Reject dabei: genau 1 (`FUNC-serve-sse -satisfy-> REQ-readonly-bridge`), aufzuloesen durch Loeschen oder Heben auf die FCHAIN. Prior: BREAKING (CR-GC-366): das Trace-Pattern `FUNC -satisfy-> UC` entfaellt ersatzlos. Es war ein zweiter Weg vom Verhalten zum Use Case neben dem einzig tragenden `UC -compose-> FCHAIN -compose-> FUNC` — und der billigere: eine FUNC konnte einen UC bedienen, ohne in dessen Wirkkette zu stehen, womit IO-01 (FLOW-Pfade je Kettenpaar) und R-21 (Integrationstest je Kette) sie nie sahen. Die Abkuerzung umging genau die Pruefungen, die die Anbindung belastbar machen. Am graphcode-Selbstmodell waren 10 der 26 solchen Kanten reine Dopplung (die FUNC stand ohnehin in der FCHAIN), die restlichen 13 sind der Migrationsanlass. Jeder Graph mit solchen Kanten faellt jetzt R-18 (error) zur Last und muss migriert werden: FUNC in die FCHAIN des UC aufnehmen, satisfy-Kante loeschen. Prior: 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 = '
|
|
8
|
+
export const RULES_VERSION = '50.0.0'; // MAJOR (CR-SM-434): neue Warnung UC-07 „Name states the need“ (UC- und FCHAIN-Name ohne Woerter aus `policy.needNameTerms`, Vorgabe KI, MCP, Gate, Lauf, Ziel) und neues PFLICHTFELD `needNameTerms` an `MetricPolicy` (Praezedenz CR-SM-283, CR-SM-314: ein Host mit vollstaendiger Policy, z. B. graphcode.config.jsonc, muss das Feld setzen). Das Urteil wird strenger: an 37 Modelldateien der Familie ohne eigene Liste 8 neue Warnungen (Lauf 4, Gate 3, Ziel 1). Davor 49.4.0: MINOR (CR-SM-433): BQ-06 „Conforming“ entfaellt (Entscheidung des Autors 2026-11-11, CR-SM-431: ein Modalverb sagt nichts ueber die Qualitaet, „Das System muss robust sein“ besteht die Regel). Am graphcode-Modell meldete sie 165 von 198 Anforderungen. MINOR wie bei FC-02 (CR-SM-412), nicht MAJOR wie bei TR-01 (CR-SM-400): kein Urteil wird strenger, nur ein Befund faellt weg, und kein Modell bekommt dadurch einen neuen; keine Marke aendert sich (BQ-06 war warning, Stufe 3, ohne Rolle). Kein Sachverhalt geht verloren: die REQ ohne `description` meldet BQ-07 weiter, das Modalverb zaehlt BQ-03 weiter. Gemessen am graphcode-Modell: BQ-06 165 -> 0, BQ-02 66, BQ-03 6 und BQ-07 0 unveraendert, Befunde gesamt 740 -> 577. Am Selbstmodell (SSOT) 11 -> 0. Entfernt: Export `bq06Conforming`, `RULE_HELP['BQ-06']`, `ALL_RULE_DEFS` 81 -> 80 Regeln, Task `anforderungsqualitaet` 6 -> 5 Regeln. Kein Leser des Exports in graphcode, graph-view-edit, graphify (src, scripts); graphcode-Tests, die BQ-06 nennen, zieht graphcode beim Upgrade nach. Prior: MINOR (CR-SM-430, CR-SM-432): BQ-02 prueft nur REQ mit `kinds: non-functional` (eine funktionale wird am Ergebnis geprueft, eine ohne `kinds` meldet BQ-07; graphcode-Modell 160 -> 66 Befunde), und die neue Regel BQ-03 „Singular“ (warning, Stufe 3, Domaene REQ) meldet eine REQ mit mehr als einer Zusage, gezaehlt ueber die Modalverben shall, must, must not, soll, muss, darf nicht (graphcode-Modell: 6 REQ). Kein neues Attribut. Das Urteil von BQ-02 wird schwaecher, kein Modell bekommt einen Befund weniger als Fehler. Prior: MINOR (CR-SM-420): neue Regel FC-06 (warning, Stufe 8, Domaene FCHAIN) — die Kette hat EINEN Ausloeser, abgeleitet aus io-Kanten und `sync` (`chainRoles`); mehrere Ausloeser nur am selben Glied mit demselben Vertrag (Freigabe des Autors 2026-10-28). Kein neues Attribut. Prior: MINOR (CR-SM-415): zwei neue Regeln, beide warning, Stufe 12 — RC-12 („Sync flow has a call“, Domaene FLOW: ein FLOW mit `sync: sync` ohne Aufrufweg zwischen Erzeuger- und Abnehmer-FUNC, hoechstens 3 Kanten, eine der beiden Richtungen, oder ohne gueltigen Beleg `FLOW.realRef`) und RC-13 („Call between anchored functions has a flow“, Domaene FUNC: ein Aufrufweg zwischen zwei verankerten FUNCs ohne FLOW; innerster Anker, Weg endet an der ersten anderen verankerten FUNC). Beide lesen das neue optionale Feld `CodeFacts.callEdges`/`callScope` und schweigen ohne es; kein bestehendes Modell bekommt einen Befund, bis ein Lieferant die Kanten liefert (graphcode CR-GC-846). Dazu die Messung `callCoverage` neben `importCoverage`. Davor 49.0.0: MAJOR (CR-SM-405): neue Regel RC-11 („Code file belongs to a module“, warning, Stufe 12, Domaene SYS): je Import-Endpunkt, der zu keinem MOD aufloest, ein Befund am SYS — dieselbe Aufloesung wie RC-05 und `importCoverage` (Entscheidung des Autors 2026-10-15/19: Variante A, keine Ausnahmeliste; warning, weil RC nie am Gate laeuft, CR-SM-353, und auf Stufe 12 jeder Befund Bau haelt). Das Urteil wird strenger: ein Modell mit unzugeordnetem Code erreicht Bau nicht mehr. Vorbedingung graphcode 147518d7 (ITEM-2026-948): Tests und Nicht-Code sind keine Import-Endpunkte mehr. Davor 48.0.0: MAJOR (CR-SM-413): R-22 prueft nur noch Blattfunktionen, und die neue Regel R-35 („Block is not allocated to a module“, error, Stufe 7) meldet einen Block (FUNC mit FUNC-Kindern), der eine `allocate`-Kante auf ein MOD traegt (Entscheidung des Autors 2026-10-14/15: „mod ist mod, warum kommen da ueberhaupt func. und schon gar keine aggregierten“; eigene Kennung, weil die Regel MOD braucht, also Stufe 7, nicht Stufe 5 wie FC-03). Das Urteil wird strenger: ein Modell mit zugeordnetem Block bekommt einen Fehler, der PDR haelt. Vorher gerichtet: graphcode 15 Kanten, graph-view-edit 1. Bewusst nicht gerichtet (Entscheidung des Autors 2026-10-15, „fehler akzeptieren“): sirail, bok, sigllm, energymanager, agentdiary-frontier. Davor 47.1.0: MINOR (CR-SM-412): FC-02 („Leaf UC has FCHAIN“) entfaellt, UC-03 uebernimmt seine Blatt-Bedingung (ein UC mit `compose → UC`-Kindern braucht keine eigene Kette). Beide meldeten denselben Sachverhalt, weil `UC -compose-> UC` nicht in der Matrix steht: 36 von 36 Befunden doppelt ueber 36 Graphen. Kein Sachverhalt geht verloren, kein Urteil wird strenger, keine Marke aendert sich (FC-02 trug keine Rolle, UC-03 haelt wie bisher). Export `fc02LeafUcHasFchain` faellt, kein Leser in graphcode/graph-view-edit. Davor 47.0.0: MAJOR (CR-SM-411): R-08 bekommt unter derselben Kennung und Schwere den zweiten Fall — ein Element traegt in einem Feld einen Wert, den der Element-Vertrag (`OntologyElement`) nicht kennt; dazu `role` an REQ (Entscheidung des Autors 2026-10-12: der Stand ist ein Fehler, den eine Regel als Befund meldet; das Modell wird nicht beim Laden abgelehnt). Bis hierher pruefte das nur das graphcode-Gate an dem, was ein Zug schreibt (lokal `SCHEMA-02`); Altbestand nannte keine Regel, und die Messung in graphcode brach daran ab (CR-GC-786). Das Urteil wird strenger: gezaehlt ueber 36 Modelldateien der Familie 100 neue Fehler in 6 Dateien (98 an `kinds` aus der Zeit vor CR-SM-366, 2 an `status`). Kein Export faellt; ein Modell mit Altbestand laedt weiter, das Gate weist nur neu eingefuehrte Fehler ab. An R-08 statt einer eigenen Kennung: Stufe `immer`, Menge `all` und Schwere sind dieselben, die Aussage auch (der Bestand widerspricht seinem Schema). Der Regelname lautet jetzt „Data integrity“. Davor 46.0.0: MAJOR (CR-SM-410): FC-03 (Block als Glied einer Kette) wird vom Hinweis zum FEHLER (Entscheidung des Autors 2026-10-11: „Block als Glied oder Erfuellen ist ein Fehler, dann muessen die bestehenden Repos eben gerichtet werden"). Als Fehler haelt der Befund die Marke PDR, und ein Gate, das neue Fehler abweist, nimmt eine Kette mit Block nicht mehr an. Nachgezaehlt ueber 30 Modelle der Familie nach dem Richten (graph-view-edit 30faf80, graphcode c20b2afd): 41 Bloecke, 0 Befunde. Unter derselben Kennung der zweite Fall: ein Block, der eine Anforderung erfuellt (`FUNC -satisfy-> REQ` an einer FUNC mit FUNC-Kindern), ist derselbe Fehler — bis hierher meldete das keine Regel. An FC-03 statt an R-02, weil eine Kennung keine zwei Schweren traegt (R-02 bleibt Warnung). Der Regelname lautet jetzt „Block is neither chain member nor satisfier". Davor 45.0.0: MAJOR (CR-SM-409): FC-05 (Kette haengt zusammen) bekommt die Rolle `existence` und haelt damit die Marke PDR (Entscheidung des Autors 2026-10-11). Kein Eintrag entfaellt, kein Befund aendert sich — aber das Urteil wird strenger: ein Modell mit zerfallener Kette, das PDR erreichte, erreicht sie nicht mehr. Gezaehlt ueber 30 Modelle der Familie: FC-05 meldet 2 Ketten in 1 Modell (graph-view-edit), dort haelt IO-02 die Marke schon; heute verliert kein Modell eine Marke. R-30 und FC-04 bleiben ohne Rolle. Davor 44.0.0: MAJOR (CR-SM-401): Stufe statt Dimension, Befunde zaehlen statt Prozent (Entscheidung des Autors 2026-10-07). ENTFERNT: `RULE_TO_DIMENSION`, `ReadinessDimension`, `ReadinessScore`, `ReadinessReport` (contracts; `SteerSpace`/`SteerTerm` bleiben), `DIMENSION_READINESS_NAME`, `DIMENSION_READINESS_DELTA_NAME`; in se-engine `computeReadiness` und `coreTypesOf`. Es gibt EINE Einteilung der Regeln, die Stufe; die Zahl der Befunde je Stufe liefert `countByStage` in @sigloch/graphcode-client. Keine Regel, keine Stufe, keine Marke aendert sich — Befunde und Marken ueber 38 Graphen identisch (gemessen). Davor 43.0.0 (CR-SM-400): eine Entscheidung ist ein erledigter Auftrag (Entscheidungen des Autors 2026-10-07). (a) `hasOpenOrder` filtert nicht mehr auf `relation [label: decides]`: ein offener CR ist ein Auftrag, ohne Ersatz. 3 offene CRs im Bestand tragen die Kante; in der Rig-Referenz `frontier` eroeffnen zwei davon jetzt den Bau, bis sie als erledigt gefuehrt sind. (b) Regel TR-01 („Trade decision recorded as CR“) ist ENTFERNT, mit ihr das Feld `crRefs` am Analyse-Vermerk und die Exporte `tradeDecisionRecorded`, `TASK_OUTCOME_RULES`, `evaluateTaskOutcomeRules` — 1 Befund an 38 Graphen. Der Vermerk ist `{ graphVersion }`; ein Alt-Vermerk mit `crRefs` laedt weiter (nicht-striktes Schema, das Feld wird abgestreift). Kein Kerntyp und kein Score je Dimension wandert (gemessen). (c) Der Hinweis von AF-02 nennt den erledigten CR mit relation-Kanten statt der `decides`-Kante. Katalog 77 → 76 Regeln. NICHT enthalten: CR-R02, `commitRef`, `architectureOnly` (warten auf den Autor, CR-SM-400 §4). Davor 42.0.0 (CR-SM-399): sechs Streichungen aus dem Sonderwissen der Steuerung (IR-01, `reqRefs`, `READINESS_SCORED_PROFILES`, `readFlowSync`, `codeRef`-Rueckfall, `fields`).
|
|
9
9
|
/** Meta-model version (trace pattern constraints + format-e parser). */
|
|
10
10
|
export const META_MODEL_VERSION = '6.0.0'; // MAJOR (CR-SM-366): satisfy-where je Erfueller genau ein kind — FUNC {functional}, MOD/SYS {non-functional}, und NEU `FCHAIN -satisfy-> REQ where target.kinds in {non-functional}` (bisher ohne where). Eine functional-REQ an der Kette hatte keine FUNC und damit keinen realRef; jetzt R-18 `kinds-mismatch` mit candidate_sources [FUNC]. Bestand (5 Familien-Snapshots, 2026-09-27): 27 functional-REQ an FCHAIN, 53 satisfy-Kanten auf pre/postcondition-REQ, 4 auf risk/mitigation-REQ; ungueltige satisfy-Kanten 7 -> 91. Prior: // MINOR (CR-SM-341): `CR -relation-> SCHEMA` ergaenzt -- reine Erweiterung, keine Bestandskante wird ungueltig. Die Kante war der einzige Punkt, an dem zwei Regeln DESSELBEN Katalogs einander widersprachen: CR-R01 verlangt einen Umfang und nennt SCHEMA ausdruecklich (SCOPE_TYPES = FUNC/MOD/SCHEMA/REQ/UC, cr-quality-rules.ts), R-18 wies genau diese Kante ab, weil die Matrix fuer CR nur MS/UC/REQ/FUNC/MOD kannte. Gemessen an zwei Audit-Logs: 6 Ablehnungen in graphcode, 3 in sigllm -- jedes Mal ein CR, dessen Umfang ein Vertrag ist. Erweitert statt den fixHint zu kuerzen: ein CR, der eine Schnittstelle schneidet, hat genau dort seinen Umfang. Gleicher Zug, ohne Oberflaechenwirkung: R-18 haengt seinen Ablehnungsgrund als `context.trace_rejection` an den Befund (neuer Export `admittingAlternatives`). Prior: // MINOR (CR-SM-317, ITEM-2026-064): neues Muster `TEST -verify-> SCHEMA` — der Vertragstest haengt am Vertrag, nicht an einer Hilfs-REQ; additiv, kein bestehender Graph faellt. Prior: // BREAKING (CR-SM-271 Teil 2): `FLOW -relation-> SCHEMA` wird `1..1` — die erste DURCHGESETZTE Untergrenze (minOccurs/REQUIRED_PATTERNS; nur exakt-`1`, die `1..*`-compose-Untergrenzen bleiben Vollstaendigkeits-Warnungen ihrer Regeln). Migrationsbestand vorab abgetragen: graphcode 2, sigloch-modules 4, graph-view-edit 5 (je durchs Gate), urbanmobility-Fixture geloescht (39, Spike ohne Referenzen); sirail 4 offen (EXPORT_PENDING-Divergenz seit 2026-08-18).
|
|
11
11
|
export * from './ontology.js';
|
|
@@ -44,6 +44,8 @@ export * from './module-crossings.js';
|
|
|
44
44
|
export * from './function-criticality.js';
|
|
45
45
|
// CR-SM-404: Kennzahlen je FCHAIN und die Bewertbarkeitsquote — reine Rechnung, ruft FC-05 auf.
|
|
46
46
|
export * from './chain-metrics.js';
|
|
47
|
+
// CR-SM-420: Rollen der Akteure je Kette (Ausloeser, in der Mitte, Senke) und Abschnitte — gelesen von FC-06, gve, ConOps.
|
|
48
|
+
export * from './chain-roles.js';
|
|
47
49
|
// CR-SM-407: Traeger je Risiko und Risiken je Traeger — reine Rechnung, keine Regel.
|
|
48
50
|
export * from './risk-carriers.js';
|
|
49
51
|
export * from './quality-rules.js';
|
package/dist/se/ontology.js
CHANGED
|
@@ -415,6 +415,7 @@ export const ELEMENT_ATTRIBUTES = {
|
|
|
415
415
|
{ key: 'status', type: 'enum', enumValues: ['open', 'done'], description: 'CR completion status' },
|
|
416
416
|
{ key: 'rationale', type: 'string', description: 'Reason for the change' },
|
|
417
417
|
{ key: 'spike', type: 'boolean', description: 'CR is a spike/exploration' },
|
|
418
|
+
{ key: 'maxFiles', type: 'number', description: 'Upper bound of files the CR may touch, from the cut in se-plan (CR-SM-426)' },
|
|
418
419
|
{ key: 'architectureOnly', type: 'boolean', description: 'Done CR without code change (model/architecture only): exempt from the CR-R02 commitRef requirement (CR-SM-386)' },
|
|
419
420
|
],
|
|
420
421
|
// CR-SM-364: genau ein Realisierungsattribut. `protocol`/`qos` entfielen — freie Strings, in
|
package/dist/se/policy.d.ts
CHANGED
package/dist/se/policy.js
CHANGED
|
@@ -107,6 +107,15 @@ export const MetricPolicySchema = z.object({
|
|
|
107
107
|
* exportierten Graphen steht sie nie** (Zellwerte sind normative Wertung, keine Fakten).
|
|
108
108
|
*/
|
|
109
109
|
apTable: ApTableSchema.nullable(),
|
|
110
|
+
/**
|
|
111
|
+
* CR-SM-434: UC-07 — Woerter, die ein UC- oder FCHAIN-Name nicht tragen soll, weil sie die
|
|
112
|
+
* Umsetzung nennen statt das Beduerfnis. Ganzes Wort, Gross-/Kleinschreibung egal.
|
|
113
|
+
*
|
|
114
|
+
* Die Liste braucht ein Urteil je Repo: „Gate" und „Ziel" sind in graphcode Fachwoerter, „LLM" in
|
|
115
|
+
* graphify ein Beduerfnis. Ein Repo setzt darum seine VOLLSTAENDIGE Liste — sie ersetzt die
|
|
116
|
+
* Vorgabe, wird nicht mit ihr vereinigt. `null` -> UC-07 schweigt.
|
|
117
|
+
*/
|
|
118
|
+
needNameTerms: z.array(z.string().min(1)).nullable(),
|
|
110
119
|
});
|
|
111
120
|
/**
|
|
112
121
|
* Der Startwert, sichtbar als solcher — **kein** Fallback in der Regel.
|
|
@@ -159,4 +168,6 @@ export const DEFAULT_METRIC_POLICY = {
|
|
|
159
168
|
// `null` heißt hier nicht „aus", sondern „markierter Übergang": bestätigte AP-Invarianten,
|
|
160
169
|
// sonst RPN-Bänder. `apMethod()` macht das für den Leser sichtbar.
|
|
161
170
|
apTable: null,
|
|
171
|
+
// CR-SM-434: die fuenf Woerter aus dem Auftrag (CR-GC-881); Beleg und Abwaegung in CR-SM-434.
|
|
172
|
+
needNameTerms: ['KI', 'MCP', 'Gate', 'Lauf', 'Ziel'],
|
|
162
173
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* BQ-01 through BQ-07 — Base Quality rules for artefact descriptions.
|
|
2
|
+
* BQ-01 through BQ-07 (BQ-05 frei) — Base Quality rules for artefact descriptions.
|
|
3
3
|
* Complement the structural V3 rules (R-01..R-12) with content-level checks
|
|
4
4
|
* on REQ element descriptions (weasel words, verifiability, atomicity, etc.).
|
|
5
5
|
*/
|
|
@@ -8,6 +8,7 @@ import type { RuleDefinition, RuleViolation } from './rules.js';
|
|
|
8
8
|
import type { MetricPolicy } from './policy.js';
|
|
9
9
|
export declare function bq01Unambiguous(graph: OntologyGraph): RuleViolation[];
|
|
10
10
|
export declare function bq02Verifiable(graph: OntologyGraph): RuleViolation[];
|
|
11
|
+
export declare function bq03Singular(graph: OntologyGraph): RuleViolation[];
|
|
11
12
|
/**
|
|
12
13
|
* Inject a pre-computed similarity matrix for BQ-04.
|
|
13
14
|
* Call this before evaluateBQRules() when embeddings are available.
|
|
@@ -40,7 +41,6 @@ export declare function setBQ04SimilarityMatrix(data: {
|
|
|
40
41
|
* Grammatik-Entscheidung — `se-grammar-review`, eigener CR, nicht hier nebenbei.
|
|
41
42
|
*/
|
|
42
43
|
export declare function bq04Necessary(graph: OntologyGraph): RuleViolation[];
|
|
43
|
-
export declare function bq06Conforming(graph: OntologyGraph): RuleViolation[];
|
|
44
44
|
export declare function bq07Complete(graph: OntologyGraph): RuleViolation[];
|
|
45
45
|
export declare const BQ_RULES: RuleDefinition[];
|
|
46
46
|
/** Run all BQ rules against a graph, returning combined violations. */
|
package/dist/se/quality-rules.js
CHANGED
|
@@ -19,7 +19,7 @@ const weaselPattern = new RegExp(`\\b(${WEASEL_WORDS.map(w => w.replace(/\s+/g,
|
|
|
19
19
|
// ---------------------------------------------------------------------------
|
|
20
20
|
// CR-SM-352: messbar heisst eine Zahl MIT Einheit oder ein Vergleich — in beiden Sprachen gleich. Vorher
|
|
21
21
|
// zaehlten `must`/`shall` als "messbar": jede englische Anforderung bestand durch ihr Modalverb, jede
|
|
22
|
-
// deutsche ("muss") fiel ohne Einheit durch (opus5-14). Das Modalverb prueft
|
|
22
|
+
// deutsche ("muss") fiel ohne Einheit durch (opus5-14). Das Modalverb prueft keine Regel mehr (CR-SM-433). Eine nackte Zahl
|
|
23
23
|
// zaehlt nicht — sonst waeren "Spike-2", "2026-Q4" oder "Haertegrad 1" Kriterien (am SSOT gemessen).
|
|
24
24
|
const measurablePattern = /(\d+\s*(ms|s|sec|seconds?|min|minutes?|h|hours?|days?|%|percent|bytes?|KB|MB|GB|TB|times|x|sessions?|requests?|Sekunden?|Minuten?|Stunden?|Tagen?|Prozent|mal|Anfragen)\b|\d+\s*%|\b(exactly|at least|at most|no more than|within|before|after|at the latest|between|greater|less|equal|minimum|maximum|genau|mindestens|hoechstens|höchstens|spaetestens|spätestens|nicht mehr als|innerhalb|zwischen|groesser|größer|kleiner|gleich|minimal|maximal)\b)/i;
|
|
25
25
|
// ---------------------------------------------------------------------------
|
|
@@ -33,7 +33,7 @@ function reqElements(graph) {
|
|
|
33
33
|
* Store/Import ohne Re-Parse — dort fehlt das Feld. `req.description.trim()` warf dann
|
|
34
34
|
* `TypeError` und riss `evaluateAllRules` ab (gemessen am kadjar-Graphen, Spike CR-GC-438 §7).
|
|
35
35
|
* EIN Normalisierungspunkt statt eines Guards je Fundstelle: eine fehlende Beschreibung ist
|
|
36
|
-
* die leere Beschreibung — ein BEFUND (BQ-
|
|
36
|
+
* die leere Beschreibung — ein BEFUND (BQ-07 meldet sie), kein Absturz.
|
|
37
37
|
*/
|
|
38
38
|
/**
|
|
39
39
|
* CR-SM-285: `?? ''` faengt nur `null`/`undefined`. Ein Graph aus einer fremden Quelle (Import,
|
|
@@ -74,10 +74,15 @@ export function bq01Unambiguous(graph) {
|
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
76
|
// ---------------------------------------------------------------------------
|
|
77
|
-
// BQ-02 Verifiable — REQ must contain
|
|
77
|
+
// BQ-02 Verifiable — a non-functional REQ must contain a measurable criterion
|
|
78
78
|
// ---------------------------------------------------------------------------
|
|
79
|
+
// CR-SM-430: Definition Anforderung = ein Verhalten ("das System tut X") ODER eine Guete
|
|
80
|
+
// ("innerhalb von 2 s"). Ein Verhalten wird am Ergebnis geprueft, nicht an einer Zahl; nur die
|
|
81
|
+
// Guete braucht eine. Am graphcode-Modell: 160 -> 66 Befunde, die 94 geraeumten sind funktional.
|
|
82
|
+
// Eine REQ ohne `kinds` meldet BQ-07 — BQ-02 schweigt dort, eine Ursache gibt einen Befund.
|
|
79
83
|
export function bq02Verifiable(graph) {
|
|
80
84
|
return reqElements(graph)
|
|
85
|
+
.filter(req => normalizeReqKinds(req.kinds).includes('non-functional'))
|
|
81
86
|
.filter(req => !measurablePattern.test(descriptionOf(req)))
|
|
82
87
|
.map(req => ({
|
|
83
88
|
rule_id: 'BQ-02',
|
|
@@ -93,6 +98,34 @@ export function bq02Verifiable(graph) {
|
|
|
93
98
|
}));
|
|
94
99
|
}
|
|
95
100
|
// ---------------------------------------------------------------------------
|
|
101
|
+
// BQ-03 Singular — one commitment per REQ (CR-SM-432)
|
|
102
|
+
// ---------------------------------------------------------------------------
|
|
103
|
+
// Zaehlgrundlage ist die geschlossene Wortklasse der Modalverben: shall, must, must not, soll,
|
|
104
|
+
// muss, darf nicht. Die Muster gehoeren dieser Regel. "must not" ist EINE Zusage (laengste Alternative zuerst).
|
|
105
|
+
const MODAL_EN = 'must not|must|shall';
|
|
106
|
+
const MODAL_DE = 'darf nicht|soll|muss';
|
|
107
|
+
/** Ein Modalverb samt folgendem Wort (Fundstelle). */
|
|
108
|
+
const modalPattern = new RegExp(`\\b(${MODAL_EN}|${MODAL_DE})\\s+\\w+`, 'gi');
|
|
109
|
+
export function bq03Singular(graph) {
|
|
110
|
+
return reqElements(graph).flatMap(req => {
|
|
111
|
+
const commitments = [...descriptionOf(req).matchAll(modalPattern)].map(m => m[0]);
|
|
112
|
+
if (commitments.length < 2)
|
|
113
|
+
return [];
|
|
114
|
+
return [{
|
|
115
|
+
rule_id: 'BQ-03',
|
|
116
|
+
severity: 'warning',
|
|
117
|
+
element_id: req.id,
|
|
118
|
+
message: `${req.id} makes ${commitments.length} commitments: ${commitments.map(c => `"${c}"`).join(', ')}`,
|
|
119
|
+
fix_hint: 'Split into one REQ per commitment, each with its own verifying TEST',
|
|
120
|
+
context: {
|
|
121
|
+
element_type: req.type,
|
|
122
|
+
element_name: req.name,
|
|
123
|
+
current_description: req.description,
|
|
124
|
+
},
|
|
125
|
+
}];
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
// ---------------------------------------------------------------------------
|
|
96
129
|
// BQ-04 Necessary — semantic duplicate REQ detection (CR-054)
|
|
97
130
|
// ---------------------------------------------------------------------------
|
|
98
131
|
/** Threshold above which two REQs are considered near-duplicates. */
|
|
@@ -180,30 +213,6 @@ function findOwnerUC(graph, reqId) {
|
|
|
180
213
|
return trace?.source ?? null;
|
|
181
214
|
}
|
|
182
215
|
// ---------------------------------------------------------------------------
|
|
183
|
-
// BQ-06 Conforming — REQ description should follow "system shall" pattern
|
|
184
|
-
// ---------------------------------------------------------------------------
|
|
185
|
-
const conformingPattern = /\b(shall|must|must not)\s+\w+/i;
|
|
186
|
-
const conformingPatternDE = /\b(soll|muss|darf nicht)\s+\w+/i;
|
|
187
|
-
export function bq06Conforming(graph) {
|
|
188
|
-
return reqElements(graph)
|
|
189
|
-
.filter(req => {
|
|
190
|
-
const desc = descriptionOf(req).trim();
|
|
191
|
-
return !conformingPattern.test(desc) && !conformingPatternDE.test(desc);
|
|
192
|
-
})
|
|
193
|
-
.map(req => ({
|
|
194
|
-
rule_id: 'BQ-06',
|
|
195
|
-
severity: 'warning',
|
|
196
|
-
element_id: req.id,
|
|
197
|
-
message: `${req.id} does not follow "System shall..." pattern`,
|
|
198
|
-
fix_hint: 'Start description with "The system shall <verb>" or "Das System soll/muss <verb>"',
|
|
199
|
-
context: {
|
|
200
|
-
element_type: req.type,
|
|
201
|
-
element_name: req.name,
|
|
202
|
-
current_description: req.description,
|
|
203
|
-
},
|
|
204
|
-
}));
|
|
205
|
-
}
|
|
206
|
-
// ---------------------------------------------------------------------------
|
|
207
216
|
// BQ-07 Complete — REQ must have meaningful description and no placeholders
|
|
208
217
|
// ---------------------------------------------------------------------------
|
|
209
218
|
const BQ07_MIN_DESC_LENGTH = 20;
|
|
@@ -256,8 +265,8 @@ export function bq07Complete(graph) {
|
|
|
256
265
|
export const BQ_RULES = [
|
|
257
266
|
{ id: 'BQ-01', name: 'Unambiguous', severity: 'warning', stage: 3, evaluate: bq01Unambiguous, domain: ['REQ'] },
|
|
258
267
|
{ id: 'BQ-02', name: 'Verifiable', severity: 'warning', stage: 3, evaluate: bq02Verifiable, domain: ['REQ'] },
|
|
268
|
+
{ id: 'BQ-03', name: 'Singular', severity: 'warning', stage: 3, evaluate: bq03Singular, domain: ['REQ'] },
|
|
259
269
|
{ id: 'BQ-04', name: 'Necessary', severity: 'warning', stage: 3, evaluate: bq04Necessary, domain: ['REQ'] },
|
|
260
|
-
{ id: 'BQ-06', name: 'Conforming', severity: 'warning', stage: 3, evaluate: bq06Conforming, domain: ['REQ'] },
|
|
261
270
|
{ id: 'BQ-07', name: 'Complete', severity: 'warning', stage: 3, evaluate: bq07Complete, domain: ['REQ'] },
|
|
262
271
|
];
|
|
263
272
|
/** Run all BQ rules against a graph, returning combined violations. */
|
package/dist/se/readiness.js
CHANGED
|
@@ -108,7 +108,7 @@ export const RULE_TASKS = ['kern', 'conops', 'trade', 'irr', 'fmea', 'plan', 'an
|
|
|
108
108
|
/** Die Regeln, die ein Arbeitsschritt dem Kern abnimmt. Jede Regel hoechstens einmal — der Test haelt das fest. */
|
|
109
109
|
export const TASK_OWNED_RULES = {
|
|
110
110
|
// Annahme (CR-SM-350): BQ bekommt einen eigenen Task, ohne automatischen Eintrittspunkt.
|
|
111
|
-
anforderungsqualitaet: ['BQ-01', 'BQ-02', 'BQ-
|
|
111
|
+
anforderungsqualitaet: ['BQ-01', 'BQ-02', 'BQ-03', 'BQ-04', 'BQ-07'],
|
|
112
112
|
};
|
|
113
113
|
/**
|
|
114
114
|
* Analyse → die Regel, die „diese Analyse fehlt" sagt (ihr Skill steht an der Regelhilfe,
|
package/dist/se/rule-help.js
CHANGED
|
@@ -75,19 +75,19 @@ export const RULE_HELP = {
|
|
|
75
75
|
prompt: "se:author-req",
|
|
76
76
|
},
|
|
77
77
|
'BQ-02': {
|
|
78
|
-
plain: "This requirement has
|
|
79
|
-
se: "INCOSE quality: verifiable.
|
|
78
|
+
plain: "This quality requirement (\"opens fast\") has no number or limit → nobody can tell whether it is met. Add the number with its unit, or the comparison. A requirement for behaviour is checked by its result and is not asked for a number.",
|
|
79
|
+
se: "INCOSE quality: verifiable. Only `REQ` with `kinds: non-functional` (a quality) is checked: it needs a number with a unit or a comparison. A functional `REQ` is not checked here; a `REQ` without `kinds` is reported by BQ-07 only (CR-SM-430). The counterpart to R-01, which asks whether a test EXISTS; this one asks whether one COULD exist.",
|
|
80
|
+
prompt: "se:author-req",
|
|
81
|
+
},
|
|
82
|
+
'BQ-03': {
|
|
83
|
+
plain: "This requirement promises more than one thing (\"must A and must not B\") → each promise needs its own test. Split it into one requirement per promise.",
|
|
84
|
+
se: "INCOSE quality: singular. A `REQ` description with more than one modal verb (shall, must, must not, soll, muss, darf nicht); the rule names every hit. A prohibition that only limits the other promise counts: it is verifiable on its own (CR-SM-432).",
|
|
80
85
|
prompt: "se:author-req",
|
|
81
86
|
},
|
|
82
87
|
'BQ-04': {
|
|
83
88
|
plain: "This requirement says almost the same as another one → decide which is the real one and merge or differentiate them.",
|
|
84
89
|
se: "INCOSE quality: necessary. Near-duplicate `REQ` pair by description similarity. NOTE: this rule is currently inert — it was written for pre-computed EMBEDDING similarity, which a pure contracts package cannot produce; a token-based substitute measured 0 findings across the family and 4950 on a templated fixture, both gate-7 outliers (CR-SM-286). Treated as an open grammar item, not a live check.",
|
|
85
90
|
},
|
|
86
|
-
'BQ-06': {
|
|
87
|
-
plain: "This requirement is not written in the agreed form (\"The system shall …\") → rewrite it that way, so every requirement reads the same.",
|
|
88
|
-
se: "INCOSE quality: conforming. The `REQ` description does not follow the \"System shall…\" pattern.",
|
|
89
|
-
prompt: "se:author-req",
|
|
90
|
-
},
|
|
91
91
|
'BQ-07': {
|
|
92
92
|
plain: "This requirement is missing a piece — who acts, on what, or under which condition → complete the sentence.",
|
|
93
93
|
se: "INCOSE quality: complete. The `REQ` lacks one of the required parts; the rule lists which.",
|
|
@@ -139,6 +139,11 @@ export const RULE_HELP = {
|
|
|
139
139
|
se: "`FCHAIN` whose member `FUNC`s do not form one (weakly) connected component along producer → consumer (`FUNC -io-> FLOW -io-> FUNC`, both ends members). Per side component the cause: `missing-link` (main and side part are joined through a `FUNC` outside the chain — compose it) or `bag` (no FUNC joins them: a missing FLOW between members, or parallel services at a shared source — split). One finding per chain, components in `context.side_components` (CR-SM-242). Silent while any member lacks an io input or output (R-31 first); entry/exit belong to FC-04 (CR-SM-363).",
|
|
140
140
|
vorschlag: 'Verbinde die Schritte der Funktionsketten {n} über Datenflüsse.',
|
|
141
141
|
},
|
|
142
|
+
'FC-06': {
|
|
143
|
+
plain: "It is unclear who starts this sequence: no single starting point reaches all its steps, several starters enter at different steps, or a data flow does not say whether its receiver waits for it → mark each flow as waiting or delivered beforehand, and give each starter its own sequence unless they all enter at the same step with the same contract.",
|
|
144
|
+
se: "`FCHAIN` without exactly one trigger, derived by `chainRoles` (no attribute): the trigger is the entry `ACTOR -io-> FLOW -io-> FUNC∈chain` from which every member is reachable along producer → consumer, plus the reverse edge of a `sync` fetch from a member without chain input. Causes, one per chain: `unsynced` (a flow at a member lacks `sync` — the derivation would guess), `predelivery` (an actor only delivers in advance — data the function reads itself, model it as a file or store, CR-SM-422), `no-trigger`, `triggers-disagree` (several triggers at different members or with different SCHEMA). An actor in the middle (it received a `sync` flow from the chain before it feeds back) is allowed and cuts the chain into segments (CR-SM-420).",
|
|
145
|
+
vorschlag: 'Kläre den Auslöser der Funktionsketten {n}: sync an jedem Fluss, ein Auslöser je Kette.',
|
|
146
|
+
},
|
|
142
147
|
'FM-01': {
|
|
143
148
|
plain: "A requirement is marked as a risk but carries no risk ratings → rate how bad, how likely and how detectable it is (1-10 each).",
|
|
144
149
|
se: "`REQ` with `role:\"risk\"` missing `severity` / `occurrence` / `detection` attributes (AIAG-VDA). The role is the requirement's motivation, not its kind — satisfy-neutral (CR-SM-365).",
|
|
@@ -225,7 +230,7 @@ export const RULE_HELP = {
|
|
|
225
230
|
'R-04': {
|
|
226
231
|
plain: "Too many different data formats cross this module's boundary → merge formats, or move the functions that carry them.",
|
|
227
232
|
se: "`MOD` whose boundary is crossed by `metricPolicy.boundaryWidth.warning` or more DISTINCT contracts (`SCHEMA` on the io path `FUNC` ─io→ `FLOW` ─io→ `FUNC` across the boundary, union over all neighbours — CR-SM-276). Same question and same threshold as BW-02 on the FUNC tree (CR-SM-312); module SIZE is RD-04's question since CR-SM-311.",
|
|
228
|
-
prompt: "se
|
|
233
|
+
prompt: "se:optimize",
|
|
229
234
|
vorschlag: 'Verringere die Datenformate an der Grenze des Moduls {n}.',
|
|
230
235
|
},
|
|
231
236
|
'R-05': {
|
|
@@ -445,6 +450,12 @@ export const RULE_HELP = {
|
|
|
445
450
|
prompt: "se:author-uc",
|
|
446
451
|
vorschlag: 'Beschreibe das Ziel der Abläufe {n}.',
|
|
447
452
|
},
|
|
453
|
+
'UC-07': {
|
|
454
|
+
plain: "The name of a scenario or chain says how it is built (e.g. \"KI-Inhalt ins Ziel\", \"Geplanter Lauf\"), not what the user wants → name it verb + object from the user's view (e.g. \"Beitrag veroeffentlichen\").",
|
|
455
|
+
se: "`UC` or `FCHAIN` name containing a word of `policy.needNameTerms` (whole word, case-insensitive; default KI, MCP, Gate, Lauf, Ziel). The list is per repo: a repo sets its full list, it replaces the default; `null` switches the rule off. MOD/SCHEMA names and the match between chain and UC name are not checked (CR-SM-434).",
|
|
456
|
+
prompt: "se:author-uc",
|
|
457
|
+
vorschlag: 'Benenne {n} nach dem Beduerfnis des Akteurs (Verb + Objekt).',
|
|
458
|
+
},
|
|
448
459
|
'VR-01': {
|
|
449
460
|
plain: "A test exists but no result was ever recorded, so nobody knows if it passed → record the outcome.",
|
|
450
461
|
se: "`TEST` with no `testResult` attribute — assumed pending, never assumed green.",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* UC-01..UC-
|
|
2
|
+
* UC-01..UC-04, UC-07 — Use Case quality rules (CR-121 Phase 1; UC-05/06 gestrichen, UC-07 CR-SM-434).
|
|
3
3
|
*/
|
|
4
4
|
import type { OntologyGraph } from './ontology.js';
|
|
5
5
|
import type { RuleDefinition, RuleViolation } from './rules.js';
|
|
@@ -8,5 +8,6 @@ export declare function uc01HasRequirements(graph: OntologyGraph): RuleViolation
|
|
|
8
8
|
export declare function uc02HasActor(graph: OntologyGraph): RuleViolation[];
|
|
9
9
|
export declare function uc03HasScenario(graph: OntologyGraph): RuleViolation[];
|
|
10
10
|
export declare function uc04GoalDefined(graph: OntologyGraph): RuleViolation[];
|
|
11
|
+
export declare function uc07NameStatesNeed(graph: OntologyGraph, policy: MetricPolicy): RuleViolation[];
|
|
11
12
|
export declare const UC_RULES: RuleDefinition[];
|
|
12
13
|
export declare function evaluateUCRules(graph: OntologyGraph, policy: MetricPolicy): RuleViolation[];
|
|
@@ -119,6 +119,34 @@ export function uc04GoalDefined(graph) {
|
|
|
119
119
|
}));
|
|
120
120
|
}
|
|
121
121
|
// ---------------------------------------------------------------------------
|
|
122
|
+
// UC-07 (CR-SM-434): UC- und FCHAIN-Name benennen das Beduerfnis, nicht die Umsetzung.
|
|
123
|
+
// Geprueft wird nur die Wortliste `policy.needNameTerms`. Namen von MOD/SCHEMA und die Naehe von
|
|
124
|
+
// Kettenname zu UC-Name pruefen wir nicht: beides meldete in 9 Modellen der Familie ueberwiegend
|
|
125
|
+
// Fachwoerter und Teil-Szenarien (siehe CR-SM-434).
|
|
126
|
+
// ---------------------------------------------------------------------------
|
|
127
|
+
const wordsOf = (s) => s.toLowerCase().split(/[^\p{L}\p{N}]+/u).filter(Boolean);
|
|
128
|
+
export function uc07NameStatesNeed(graph, policy) {
|
|
129
|
+
if (policy.needNameTerms === null)
|
|
130
|
+
return [];
|
|
131
|
+
const terms = new Set(policy.needNameTerms.map(t => t.toLowerCase()));
|
|
132
|
+
return graph.elements
|
|
133
|
+
.filter(e => e.type === 'UC' || e.type === 'FCHAIN')
|
|
134
|
+
.flatMap(el => {
|
|
135
|
+
const name = typeof el.name === 'string' ? el.name : '';
|
|
136
|
+
const hits = [...new Set(wordsOf(name).filter(w => terms.has(w)))];
|
|
137
|
+
if (hits.length === 0)
|
|
138
|
+
return [];
|
|
139
|
+
return [{
|
|
140
|
+
rule_id: 'UC-07',
|
|
141
|
+
severity: 'warning',
|
|
142
|
+
element_id: el.id,
|
|
143
|
+
message: `${el.id} "${name}" names the implementation, not the need: ${hits.map(h => `"${h}"`).join(', ')}`,
|
|
144
|
+
fix_hint: 'Rename to verb + object from the actor\'s view (what the actor wants), without technical terms',
|
|
145
|
+
context: { element_type: el.type, element_name: name, terms: hits },
|
|
146
|
+
}];
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
// ---------------------------------------------------------------------------
|
|
122
150
|
// Aggregated
|
|
123
151
|
// ---------------------------------------------------------------------------
|
|
124
152
|
// CR-SM-357: UC-05/UC-06 (Pre-/Postcondition-REQ) sind gestrichen — Schreibregel in se:author-uc,
|
|
@@ -128,6 +156,7 @@ export const UC_RULES = [
|
|
|
128
156
|
{ id: 'UC-02', name: 'UC has actor', severity: 'warning', stage: 2, role: 'existence', evaluate: uc02HasActor, domain: ['UC'] },
|
|
129
157
|
{ id: 'UC-03', name: 'UC has scenario', severity: 'warning', stage: 4, role: 'existence', evaluate: uc03HasScenario, domain: ['UC'] },
|
|
130
158
|
{ id: 'UC-04', name: 'UC has goal', severity: 'warning', stage: 2, evaluate: uc04GoalDefined, domain: ['UC'] },
|
|
159
|
+
{ id: 'UC-07', name: 'Name states the need', severity: 'warning', stage: 4, evaluate: uc07NameStatesNeed, domain: ['UC', 'FCHAIN'] },
|
|
131
160
|
];
|
|
132
161
|
// CR-SM-236: `policy` wird durchgereicht, auch wo diese Familie heute keine Schwelle hat —
|
|
133
162
|
// ein Sonderweg je Familie waere genau der zweite Pfad, den der Regelsatz verbietet.
|