@sigloch/graph-api-core 5.6.0 → 5.7.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/rule-engine.d.ts +0 -19
- package/dist/rule-engine.js +2 -5
- package/dist/se-descriptor.js +9 -14
- package/package.json +2 -2
package/dist/rule-engine.d.ts
CHANGED
|
@@ -13,30 +13,11 @@ export interface RuleViolation {
|
|
|
13
13
|
fixHint?: string;
|
|
14
14
|
/** Carried from the contracts rule: candidate_targets / existing_traces context for fix automation. */
|
|
15
15
|
context?: unknown;
|
|
16
|
-
/**
|
|
17
|
-
* Stamped by the engine from the rule that produced this violation (CR-GC-312).
|
|
18
|
-
* `false` = visible but not gate-relevant. Absent means gating, so every existing
|
|
19
|
-
* consumer keeps its behaviour without reading the field.
|
|
20
|
-
*/
|
|
21
|
-
gating?: boolean;
|
|
22
16
|
}
|
|
23
17
|
export interface Rule {
|
|
24
18
|
id: string;
|
|
25
19
|
name: string;
|
|
26
20
|
severity: 'error' | 'warning' | 'info';
|
|
27
|
-
/**
|
|
28
|
-
* May an `error` from this rule BLOCK a write? (CR-GC-312) Default `true`.
|
|
29
|
-
*
|
|
30
|
-
* Severity says how bad a finding is; this says whether the gate acts on it. The
|
|
31
|
-
* two are separate because a rule family can be correct and worth surfacing long
|
|
32
|
-
* before a repo has paid off its backlog — switching one on would otherwise freeze
|
|
33
|
-
* every write on debt the writer did not create. Set `false` to surface a rule in
|
|
34
|
-
* `evaluate`/readiness while it is still being worked down, then promote it.
|
|
35
|
-
*
|
|
36
|
-
* NOT a severity downgrade: the violation keeps `severity: 'error'` and reads as one
|
|
37
|
-
* everywhere it is displayed.
|
|
38
|
-
*/
|
|
39
|
-
gating?: boolean;
|
|
40
21
|
/**
|
|
41
22
|
* `policy` (CR-GC-402) overrides the threshold set this rule was BOUND with at
|
|
42
23
|
* descriptor construction, for this call only. Omitted = judge with the bound one,
|
package/dist/rule-engine.js
CHANGED
|
@@ -19,12 +19,9 @@ export class DefaultRuleEngine {
|
|
|
19
19
|
evaluate(graph, policy) {
|
|
20
20
|
const violations = [];
|
|
21
21
|
for (const rule of this.rules) {
|
|
22
|
-
// CR-
|
|
23
|
-
// without a second lookup into the catalog. Only stamped when the rule opts
|
|
24
|
-
// OUT — an absent field means gating, the pre-existing behaviour.
|
|
25
|
-
const stamp = rule.gating === false ? { gating: false } : undefined;
|
|
22
|
+
// CR-SM-353: kein `gating`-Stempel mehr — die Schwere IST die Gate-Wirkung (`error` blockt).
|
|
26
23
|
for (const v of rule.evaluate(graph, policy))
|
|
27
|
-
violations.push(
|
|
24
|
+
violations.push(v);
|
|
28
25
|
}
|
|
29
26
|
return violations;
|
|
30
27
|
}
|
package/dist/se-descriptor.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* - Graph (nodes/edges) ⟷ OntologyGraph (elements/traces)
|
|
10
10
|
* - RuleViolation (ruleId/…) ⟷ contracts RuleViolation (rule_id/…)
|
|
11
11
|
*/
|
|
12
|
-
import { ElementType, TraceType, TRACE_PATTERNS, V3_RULES, MT_RULES, UC_RULES, FC_RULES, SC_RULES, CR_RULES, AO_RULES, FM_RULES, VIEW_RULES, AF_RULES, ONTOLOGY_VERSION, DEFAULT_METRIC_POLICY, normalizeReqKinds, } from '@sigloch/contracts/se';
|
|
12
|
+
import { ElementType, TraceType, TRACE_PATTERNS, V3_RULES, MT_RULES, UC_RULES, FC_RULES, SC_RULES, CR_RULES, AO_RULES, FM_RULES, VIEW_RULES, AF_RULES, TASK_OUTCOME_RULES, ONTOLOGY_VERSION, DEFAULT_METRIC_POLICY, normalizeReqKinds, } from '@sigloch/contracts/se';
|
|
13
13
|
/**
|
|
14
14
|
* Project an ontology-agnostic Graph (nodes/edges) onto the SE OntologyGraph
|
|
15
15
|
* (elements/traces) that contracts/se rules evaluate against. Type-specific
|
|
@@ -136,19 +136,14 @@ function liftAttributes(rest) {
|
|
|
136
136
|
* - RC (conformance) needs `CodeFacts` from a repo checkout, which this package has
|
|
137
137
|
* no access to; graphcode evaluates those itself in `src/conformance.ts`.
|
|
138
138
|
*
|
|
139
|
-
* `gating`
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
* producer", error) guards the one-FLOW-per-connection cut; without gate power a
|
|
147
|
-
* suggested merge put two producers back into one FLOW and passed the gate. The delta
|
|
148
|
-
* baseline keeps the switch-on safe: only NEW findings block, graphcode's own graph is
|
|
149
|
-
* at IO-02 = 0, and IO-01 shares the prefix but is a warning, which never blocks.
|
|
139
|
+
* CR-SM-353: `gating` entfaellt — die Schwere IST die Gate-Wirkung. Der Einschalt-Schutz, den das
|
|
140
|
+
* Flag einmal bot (114 Altfunde in graphcodes eigenem Graphen haetten jeden Write blockiert), ist
|
|
141
|
+
* seit der Delta-Semantik des Gates doppelt: nur NEU eingefuehrte error-Funde blocken, Altlast nie.
|
|
142
|
+
* Was blieb, war eine zweite Bedeutung von `error`, die jeder Konsument einzeln auseinanderhalten
|
|
143
|
+
* musste (Rewind opus5-12: `blockingErrors 0 → 8` fuer FM-03-Funde, die nie geblockt haetten).
|
|
144
|
+
* Jetzt: jede Regel mit `severity: 'error'` in `ALL_RULE_DEFS` steht im Gate-Katalog und blockt
|
|
145
|
+
* (IO-02, R-01, R-08, R-18, R-29); alles andere ist `warning` oder `info`.
|
|
150
146
|
*/
|
|
151
|
-
const GATING_PREFIXES = ['R-', 'RD-', 'MT-', 'IO-'];
|
|
152
147
|
const SE_RULE_DEFS = [
|
|
153
148
|
...V3_RULES,
|
|
154
149
|
...UC_RULES,
|
|
@@ -159,13 +154,13 @@ const SE_RULE_DEFS = [
|
|
|
159
154
|
...FM_RULES,
|
|
160
155
|
...VIEW_RULES,
|
|
161
156
|
...AF_RULES,
|
|
157
|
+
...TASK_OUTCOME_RULES, // CR-SM-355: Task-Ausgaenge trade / irr
|
|
162
158
|
];
|
|
163
159
|
function adapt(def, evaluate, boundPolicy) {
|
|
164
160
|
return {
|
|
165
161
|
id: def.id,
|
|
166
162
|
name: def.name,
|
|
167
163
|
severity: def.severity,
|
|
168
|
-
gating: GATING_PREFIXES.some((p) => def.id.startsWith(p)),
|
|
169
164
|
// CR-GC-402: the CALLER's policy wins for this evaluation, the descriptor's bound
|
|
170
165
|
// one is the fallback. Without this the threshold was frozen at construction, so a
|
|
171
166
|
// consumer of the published `SE_DESCRIPTOR` judged with `DEFAULT_METRIC_POLICY` no
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sigloch/graph-api-core",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"@sigloch/contracts": ">=10 <11",
|
|
46
|
+
"@sigloch/contracts": ">=10.10 <11",
|
|
47
47
|
"kuzu-wasm": "^0.11.3"
|
|
48
48
|
},
|
|
49
49
|
"peerDependenciesMeta": {
|