@sigloch/contracts 9.1.0 → 10.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/se/ao-rules.d.ts +12 -12
- package/dist/se/ao-rules.js +88 -225
- package/dist/se/conformance-rules.d.ts +12 -0
- package/dist/se/conformance-rules.js +6 -6
- package/dist/se/cr-quality-rules.js +75 -58
- package/dist/se/evaluate-all.d.ts +4 -2
- package/dist/se/evaluate-all.js +61 -24
- package/dist/se/fchain-quality-rules.d.ts +0 -1
- package/dist/se/fchain-quality-rules.js +0 -44
- package/dist/se/flat-graph.d.ts +9 -1
- package/dist/se/flat-graph.js +15 -6
- package/dist/se/grammar-snapshot.d.ts +9 -5
- package/dist/se/grammar-snapshot.js +250 -15
- package/dist/se/index.d.ts +6 -3
- package/dist/se/index.js +14 -3
- package/dist/se/meta-model.d.ts +47 -0
- package/dist/se/meta-model.js +52 -5
- package/dist/se/metric-rules.d.ts +20 -1
- package/dist/se/metric-rules.js +97 -58
- package/dist/se/module-crossings.d.ts +102 -0
- package/dist/se/module-crossings.js +196 -0
- package/dist/se/near-duplicate-rules.d.ts +16 -24
- package/dist/se/near-duplicate-rules.js +21 -92
- package/dist/se/ontology.d.ts +0 -22
- package/dist/se/ontology.js +0 -2
- package/dist/se/policy.d.ts +6 -0
- package/dist/se/policy.js +53 -2
- package/dist/se/quality-rules.d.ts +18 -0
- package/dist/se/quality-rules.js +51 -9
- package/dist/se/readiness.d.ts +25 -3
- package/dist/se/readiness.js +39 -21
- package/dist/se/rule-help.d.ts +52 -0
- package/dist/se/rule-help.js +342 -0
- package/dist/se/rules.d.ts +6 -0
- package/dist/se/rules.js +303 -125
- package/dist/se/schema-quality-rules.d.ts +0 -1
- package/dist/se/schema-quality-rules.js +7 -28
- package/dist/se/similarity.d.ts +61 -0
- package/dist/se/similarity.js +116 -0
- package/package.json +4 -2
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* rule-help.ts — die Regelhilfe liegt NEBEN der Regel (CR-SM-300).
|
|
3
|
+
*
|
|
4
|
+
* Ein Hilfeeintrag ist keine Annotation *ueber* einer Regel, er ist **Teil ihrer Lieferung**:
|
|
5
|
+
* eine Regel, deren Befund niemand lesen kann, ist nicht fertig. Bis hierher lag die Schicht in
|
|
6
|
+
* graphcode (CR-GC-227, bewusst, aus Tempo — dort brauchte sie keinen Bump und kein Review), und
|
|
7
|
+
* derselbe CR hat die Verschiebung ausdruecklich als spaetere Entscheidung notiert. Sie ist jetzt
|
|
8
|
+
* getroffen; der Grund ist die Drift, die sie erzeugt hat: 11 Eintraege zu geloeschten Regeln und
|
|
9
|
+
* 8 Katalogregeln ohne Eintrag, unbemerkt ueber vier Releases. Hinter einem Symlink gilt kein
|
|
10
|
+
* Versionsbereich (CR-GC-488 §1a) — eine Pruefung im ungelesenen Repo ist keine Pruefung.
|
|
11
|
+
*
|
|
12
|
+
* ## Was hier NICHT steht
|
|
13
|
+
*
|
|
14
|
+
* - **Abgeleitetes** — Titel, Severity, Meldung und `fix_hint` stehen an der Regeldefinition
|
|
15
|
+
* (`ALL_RULE_DEFS`), die Dimensions-/Phasenzuordnung in `readiness.ts`. Kein Wort davon wird
|
|
16
|
+
* hier wiederholt; ein zweiter Speicher derselben Wahrheit laeuft auseinander.
|
|
17
|
+
* - **`fix_hint` gegen `plain`/`se`** — `fix_hint` ist die Anweisung an den AGENTEN („Add a
|
|
18
|
+
* `verify` trace"), `plain`/`se` die Erklaerung fuer den MENSCHEN („was ist hier eigentlich
|
|
19
|
+
* kaputt, und wie heisst das in der SE-Literatur"). Verschiedene Leser, verschiedene Laenge,
|
|
20
|
+
* verschiedene Sprache — deshalb drei Felder und nicht eines.
|
|
21
|
+
* - **Nicht-Regel-Hilfe** — Dashboard-Panels, Artefakte, das Vokabular und die sechs
|
|
22
|
+
* Metrik-Dimensionen (`HELP_METRICS`, CR-GC-458) bleiben in graphcode: sie sind an dessen
|
|
23
|
+
* Oberflaeche gebunden, nicht an den Regelkatalog.
|
|
24
|
+
*
|
|
25
|
+
* ## Was die Version haelt
|
|
26
|
+
*
|
|
27
|
+
* **Die PRAESENZ ist Oberflaeche** und haengt an `RULES_VERSION`: eine Regel ohne Hilfeeintrag
|
|
28
|
+
* kann nicht landen, ein Eintrag ohne Regel auch nicht (`tests/unit/se-rule-help.test.ts`,
|
|
29
|
+
* beidseitig, gegen die lebenden Registraturen — nie gegen eine Handzaehlung).
|
|
30
|
+
* **Der TEXT ist es nicht.** „Prosa ist ein Patch-Bump, keine Grammatik" (CR-SM-244): ein
|
|
31
|
+
* umformulierter Satz darf keinen Major ausloesen, deshalb steht im Golden-File nur die
|
|
32
|
+
* Schluesselmenge, nicht die Prosa.
|
|
33
|
+
*
|
|
34
|
+
* Sprache: Englisch, wie die Regelbeschreibungen selbst. 18,6 KB reine Strings — der
|
|
35
|
+
* `./browser`-Eintrag bleibt transitiv `node:`-frei (CR-SM-230), Strings ziehen nichts nach.
|
|
36
|
+
*
|
|
37
|
+
* @author andreas@siglochconsulting
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* Je Regel-ID der Hilfeeintrag — Katalogregeln (`ALL_RULE_DEFS`) UND Conformance-Regeln
|
|
41
|
+
* (`CODE_CONFORMANCE_RULES`). Vollstaendig in beide Richtungen, erzwungen im Test.
|
|
42
|
+
*/
|
|
43
|
+
export const RULE_HELP = {
|
|
44
|
+
'AF-01': {
|
|
45
|
+
plain: "The operations concept was never stamped as written, so nobody can tell if it is current → run the ConOps step.",
|
|
46
|
+
se: "No `analysisFreshness.conops` stamp under `SYS.attributes` (CR-SM-227 presence rule; staleness is a consumer concern).",
|
|
47
|
+
prompt: "se-conops",
|
|
48
|
+
},
|
|
49
|
+
'AF-02': {
|
|
50
|
+
plain: "No trade study is on record, so the choices made were never written down → record the decision.",
|
|
51
|
+
se: "No `analysisFreshness.trade` stamp under `SYS.attributes`.",
|
|
52
|
+
prompt: "se-trade",
|
|
53
|
+
},
|
|
54
|
+
'AF-03': {
|
|
55
|
+
plain: "The assumptions behind this system were never reviewed → run the assumption review.",
|
|
56
|
+
se: "No `analysisFreshness.assumption-review` stamp under `SYS.attributes`.",
|
|
57
|
+
prompt: "se-irr",
|
|
58
|
+
},
|
|
59
|
+
'AF-04': {
|
|
60
|
+
plain: "No failure analysis is on record → run the FMEA.",
|
|
61
|
+
se: "No `analysisFreshness.fmea` stamp under `SYS.attributes`.",
|
|
62
|
+
prompt: "se-fmea",
|
|
63
|
+
},
|
|
64
|
+
'AF-05': {
|
|
65
|
+
plain: "No implementation plan is on record → derive the build order.",
|
|
66
|
+
se: "No `analysisFreshness.implplan` stamp under `SYS.attributes`.",
|
|
67
|
+
prompt: "se-plan",
|
|
68
|
+
},
|
|
69
|
+
'BQ-01': {
|
|
70
|
+
plain: "This requirement uses a vague word (\"appropriate\", \"fast\", \"user-friendly\") → two readers will build two different things. Replace it with the number or the condition you mean.",
|
|
71
|
+
se: "INCOSE quality: unambiguous. A weasel word in the `REQ` description — the rule names the word it found.",
|
|
72
|
+
prompt: "se:author-req",
|
|
73
|
+
},
|
|
74
|
+
'BQ-02': {
|
|
75
|
+
plain: "This requirement has nothing you could measure → nobody can tell whether it is met. Add the number, the limit or the observable condition.",
|
|
76
|
+
se: "INCOSE quality: verifiable. No measurable criterion in the `REQ` — the counterpart to R-01, which asks whether a test EXISTS; this one asks whether one COULD exist.",
|
|
77
|
+
prompt: "se:author-req",
|
|
78
|
+
},
|
|
79
|
+
'BQ-04': {
|
|
80
|
+
plain: "This requirement says almost the same as another one → decide which is the real one and merge or differentiate them.",
|
|
81
|
+
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.",
|
|
82
|
+
},
|
|
83
|
+
'BQ-06': {
|
|
84
|
+
plain: "This requirement is not written in the agreed form (\"The system shall …\") → rewrite it that way, so every requirement reads the same.",
|
|
85
|
+
se: "INCOSE quality: conforming. The `REQ` description does not follow the \"System shall…\" pattern.",
|
|
86
|
+
prompt: "se:author-req",
|
|
87
|
+
},
|
|
88
|
+
'BQ-07': {
|
|
89
|
+
plain: "This requirement is missing a piece — who acts, on what, or under which condition → complete the sentence.",
|
|
90
|
+
se: "INCOSE quality: complete. The `REQ` lacks one of the required parts; the rule lists which.",
|
|
91
|
+
prompt: "se:author-req",
|
|
92
|
+
},
|
|
93
|
+
'BW-02': {
|
|
94
|
+
plain: "This block hands out many different kinds of data at its edge → whoever uses it has to understand all of them, so either bundle them or split the block.",
|
|
95
|
+
se: "Whitebox boundary width: distinct `SCHEMA` contracts on `FUNC` `io` `FLOW` `io` `FUNC` paths with one endpoint inside the `compose` subtree and one outside, judged against `metricPolicy.boundaryWidth.warning`. Parnas, information hiding — what a boundary HIDES is what makes it worth having. Rolled up over the subtree because a decomposed `FUNC` carries no `io` edges of its own (CR-SM-283).",
|
|
96
|
+
},
|
|
97
|
+
'CL-01': {
|
|
98
|
+
plain: "Someone only ever uses the system in one way, which usually means their other situations are missing → describe the scenarios you left out.",
|
|
99
|
+
se: "`ACTOR` whose `UC`s cover fewer than 2 distinct `operatingMode`s — a ConOps completeness signal.",
|
|
100
|
+
prompt: "se-conops",
|
|
101
|
+
},
|
|
102
|
+
'CR-01': {
|
|
103
|
+
plain: "Two parts exchange an unusually large amount of data, which usually means the boundary is in the wrong place → reconsider the cut.",
|
|
104
|
+
se: "High crossing `io` FLOW count between two `MOD`s — a coupling metric, advisory.",
|
|
105
|
+
},
|
|
106
|
+
'CR-R01': {
|
|
107
|
+
plain: "A change is recorded but says nothing about what it changes → link it to what it touches.",
|
|
108
|
+
se: "`CR` with no `relation` traces. It tracks nothing, so it is not traceable evidence.",
|
|
109
|
+
},
|
|
110
|
+
'CR-R02': {
|
|
111
|
+
plain: "A change is marked finished but there is no commit proving it → record the commit, or set it back to open.",
|
|
112
|
+
se: "`CR` with `status:done` and no `commitRef` attribute. This is the graph-vs-reality check for change history: \"done\" without evidence.",
|
|
113
|
+
},
|
|
114
|
+
'CR-R03': {
|
|
115
|
+
plain: "Several open changes touch the same thing, so they will collide → sequence them or merge them.",
|
|
116
|
+
se: "One element tracked by more than one `CR` with `status` open/in-progress.",
|
|
117
|
+
},
|
|
118
|
+
'FC-02': {
|
|
119
|
+
plain: "A scenario that is not broken into sub-scenarios has no described sequence of steps → add one, even if the steps are done by hand.",
|
|
120
|
+
se: "Leaf `UC` (no `UC -compose-> UC`) with no `FCHAIN`. A chain may consist of EXISTING FUNCs an actor strings together — it costs a node plus compose edges, not code.",
|
|
121
|
+
prompt: "se:author-uc",
|
|
122
|
+
},
|
|
123
|
+
'FC-03': {
|
|
124
|
+
plain: "A step inside a sequence contains further steps, so the sequence has hidden depth → lift them to the same level.",
|
|
125
|
+
se: "`FUNC` inside an `FCHAIN` that itself `compose`s other `FUNC`s. Chains are flat by construction.",
|
|
126
|
+
},
|
|
127
|
+
'FC-04': {
|
|
128
|
+
plain: "A sequence either has nobody starting it or nothing coming back out → wire both ends to whoever uses it.",
|
|
129
|
+
se: "`FCHAIN` lacking an entry (`ACTOR -io-> FLOW -io-> FUNC∈chain`) or an exit (`FUNC∈chain -io-> FLOW -io-> ACTOR`). Stricter than FC-01: both directions, at FUNC/FLOW level, no UC-level bypass.",
|
|
130
|
+
},
|
|
131
|
+
'FM-01': {
|
|
132
|
+
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).",
|
|
133
|
+
se: "Risk `REQ` missing `severity` / `occurrence` / `detection` attributes (AIAG-VDA).",
|
|
134
|
+
prompt: "se-fmea",
|
|
135
|
+
},
|
|
136
|
+
'FM-02': {
|
|
137
|
+
plain: "A known risk has nothing planned against it → write the countermeasure as its own requirement.",
|
|
138
|
+
se: "Risk `REQ` with no `compose`d mitigation `REQ` (`kinds:[\"mitigation\"]`).",
|
|
139
|
+
prompt: "se-fmea",
|
|
140
|
+
},
|
|
141
|
+
'FM-03': {
|
|
142
|
+
plain: "A high risk has no test that actually passed → add a test proving the countermeasure works.",
|
|
143
|
+
se: "Risk `REQ` with RPN > 100 and no `TEST` carrying `testResult:\"passed\"` verifying it.",
|
|
144
|
+
prompt: "se-fmea",
|
|
145
|
+
},
|
|
146
|
+
'IO-01': {
|
|
147
|
+
plain: "Two steps in the same sequence have no described data passing between them → add the data one hands to the other.",
|
|
148
|
+
se: "A `FUNC` pair inside one `FCHAIN` with no `io` path (`FUNC -io-> FLOW -io-> FUNC`) connecting them.",
|
|
149
|
+
},
|
|
150
|
+
'MS-01': {
|
|
151
|
+
plain: "A milestone has no work assigned to it → assign the work items that belong to it.",
|
|
152
|
+
se: "`MS` with no `CR` `relation`.",
|
|
153
|
+
},
|
|
154
|
+
'MS-02': {
|
|
155
|
+
plain: "A milestone waits on another milestone that doesn't exist → fix or remove the dependency.",
|
|
156
|
+
se: "`MS` `depends-on` relation targeting a missing `MS`.",
|
|
157
|
+
},
|
|
158
|
+
'MS-03': {
|
|
159
|
+
plain: "A change is not assigned to any milestone, so it has no place in the plan → assign it.",
|
|
160
|
+
se: "`CR` with no `relation` trace to an `MS`.",
|
|
161
|
+
prompt: "se-plan",
|
|
162
|
+
},
|
|
163
|
+
'MT-01': {
|
|
164
|
+
plain: "This module draws more from others than others draw from it → it will keep changing whenever they do. Measured, not judged: no threshold is set by default.",
|
|
165
|
+
se: "Instability I = fan_out / (fan_in + fan_out), counted in DISTINCT CONTRACTS crossing the module boundary — the same `moduleCrossings` definition CR-01, R-04 and BW-02 use (CR-SM-274/276). CR-SM-293 fixed both halves: it used to count every trace touching the module, of which only 34 % was coupling (`allocate` is module SIZE, `satisfy` is specification); and the direction was inverted — the CONSUMER depends, so supplying outward is fan_in (Martin's Ca) and drawing inward is fan_out (Ce). `metricPolicy.instability` defaults to `null`: the distribution is bimodal, so no threshold can be read from it. The number stays in every `graph_metrics` module row, next to `uphillDependencies` (CR-SM-301).",
|
|
166
|
+
},
|
|
167
|
+
'MT-02': {
|
|
168
|
+
plain: "The parts inside this module never talk to each other → it is really several modules in one.",
|
|
169
|
+
se: "LCOM4: the allocated `FUNC`s fall into that many disconnected groups. Connected means shared DATA: a common outgoing `io` target, or touching the same `FLOW` in either direction. CR-SM-297 dropped `satisfy` from that union — two FUNCs meeting the same requirement can be fully decoupled at runtime, and if they share one, the REQUIREMENT is what needs decomposing. `info` from `metricPolicy.lcom4.info`, `warning` from `.warning` (CR-GC-329).",
|
|
170
|
+
},
|
|
171
|
+
'ND-01': {
|
|
172
|
+
plain: "Two functions look like the same function written twice → merge them, or make clear what each one does differently.",
|
|
173
|
+
se: "Near-duplicate `FUNC` above 0.85 similarity (name, description and legal trace partners). Since CR-SM-286 the similarity is computed IN the rule, cached per graph — before that it had to be injected, and without injection the rule returned green, indistinguishable from \"no duplicates\".",
|
|
174
|
+
},
|
|
175
|
+
'ND-02': {
|
|
176
|
+
plain: "Two data contracts describe the same thing twice → merge them, or say what distinguishes them.",
|
|
177
|
+
se: "Near-duplicate `SCHEMA` above 0.85 similarity (name, description, fields and legal trace partners). Partners are filtered through `isValidTrace`: a rule must not reach its verdict via an edge R-18 rejects (CR-SM-286).",
|
|
178
|
+
},
|
|
179
|
+
'NFR-01': {
|
|
180
|
+
plain: "Something measured exceeds the limit that was set for it → fix it or change the limit deliberately.",
|
|
181
|
+
se: "Measured value above its declared budget on a `MOD` (physical) or `FUNC`/`FCHAIN` (behavioural).",
|
|
182
|
+
},
|
|
183
|
+
'R-01': {
|
|
184
|
+
plain: "A feature you've promised has no test proving it's met, so you can't show it works → add or author a test for it.",
|
|
185
|
+
se: "`REQ` with no incoming `verify` trace (test→requirement coverage, INCOSE V&V).",
|
|
186
|
+
prompt: "se:close-violations",
|
|
187
|
+
},
|
|
188
|
+
'R-02': {
|
|
189
|
+
plain: "A function isn't linked to any feature it's meant to build, so it may be dead code → link it to the feature it serves, or delete it.",
|
|
190
|
+
se: "`FUNC` with no `satisfy` trace to a `REQ` (design→requirement traceability).",
|
|
191
|
+
},
|
|
192
|
+
'R-04': {
|
|
193
|
+
plain: "A module does too much or is too tangled → open it and split it.",
|
|
194
|
+
se: "`MOD` with >12 `FUNC`, or 8–12 `FUNC` with >2 flows crossing the module boundary (cohesion/coupling).",
|
|
195
|
+
prompt: "se-view:arch",
|
|
196
|
+
},
|
|
197
|
+
'R-05': {
|
|
198
|
+
plain: "A test doesn't check any feature you promised → link it to the feature it tests, or remove it.",
|
|
199
|
+
se: "`TEST` with no `verify` trace (test→requirement coverage) to a `REQ`.",
|
|
200
|
+
},
|
|
201
|
+
'R-08': {
|
|
202
|
+
plain: "A link points at something that no longer exists → repair or remove the broken link.",
|
|
203
|
+
se: "Trace whose source or target element is missing (dangling reference).",
|
|
204
|
+
},
|
|
205
|
+
'R-10': {
|
|
206
|
+
plain: "A piece of data goes nowhere — nothing produces or consumes it → connect it to a function or a person/outside system.",
|
|
207
|
+
se: "`FLOW` with no `io` trace to a `FUNC` or `ACTOR`.",
|
|
208
|
+
},
|
|
209
|
+
'R-12': {
|
|
210
|
+
plain: "Two items depend on each other in a loop, so neither can stand alone → remove or redirect one of the two links.",
|
|
211
|
+
se: "Direct cycle: A→B and B→A via the same trace type, checked on `compose` / `allocate` / `relation` only. Data (`io`) is exempt — a function that reads and writes the same `FLOW` is normal reuse, not a dependency cycle.",
|
|
212
|
+
},
|
|
213
|
+
'R-15': {
|
|
214
|
+
plain: "A sequence of steps for a use case is empty → add the functions that make it up.",
|
|
215
|
+
se: "`FCHAIN` with no `compose` to any `FUNC`.",
|
|
216
|
+
},
|
|
217
|
+
'R-16': {
|
|
218
|
+
plain: "A person or outside system isn't connected to anything → connect it to the data it sends or receives.",
|
|
219
|
+
se: "`ACTOR` with no `io` trace to a `FLOW`.",
|
|
220
|
+
},
|
|
221
|
+
'R-17': {
|
|
222
|
+
plain: "The top level of your project is empty — nothing is inside it → add the main use cases, features, or modules.",
|
|
223
|
+
se: "`SYS` with no `compose` to `UC` / `REQ` / `MOD`.",
|
|
224
|
+
},
|
|
225
|
+
'R-18': {
|
|
226
|
+
plain: "You connected two items in a combination that isn't allowed → use an allowed link, or fix what's at each end.",
|
|
227
|
+
se: "Trace whose (source-type, target-type) pair isn't an allowed combination in the metamodel of legal links.",
|
|
228
|
+
},
|
|
229
|
+
'R-19': {
|
|
230
|
+
plain: "A test that's meant to run doesn't point to a test file → add the link to the test file, or, if it isn't written yet, mark it not-yet-written.",
|
|
231
|
+
se: "Realized `TEST` with no valid `testRefs` `[{file, case?, tool}, …]` (at least one entry); else set `concept:true` (a stub).",
|
|
232
|
+
},
|
|
233
|
+
'R-20': {
|
|
234
|
+
plain: "A function is supposed to be built but doesn't point to its code → add the link to its code; or mark it not-built-yet / from-an-outside-library.",
|
|
235
|
+
se: "Realized `FUNC` with no valid `realRef` `{file, symbol}` (graph↔code binding); else `concept:true` / `external:true`.",
|
|
236
|
+
},
|
|
237
|
+
'R-21': {
|
|
238
|
+
plain: "You grouped functions into a chain that passes data along, but nothing tests that hand-off → add an integration test that checks the chain works.",
|
|
239
|
+
se: "FUNC↔FUNC connection (`FUNC` ─io→ `FLOW` ─io→ `FUNC`) whose endpoints DO share an `FCHAIN`, but no shared chain carries a verified integration test (`TEST` ─verify→ `REQ` ←satisfy─ `FCHAIN`). Pairs sharing no `FCHAIN` are silent: co-adjacency at a reused `FLOW` is not an asserted interface.",
|
|
240
|
+
},
|
|
241
|
+
'R-22': {
|
|
242
|
+
plain: "A function isn't assigned to any building block, so it has no home in the structure → put it on a module.",
|
|
243
|
+
se: "`FUNC` with no `allocate` trace to a `MOD` (deployment assignment); every function lives on exactly one module.",
|
|
244
|
+
},
|
|
245
|
+
'R-23': {
|
|
246
|
+
plain: "A building block is empty — no function is assigned to it → put a function on it, or remove the empty block.",
|
|
247
|
+
se: "`MOD` with no incoming `FUNC` ─allocate→ trace; the module-side complement of R-22 (empty-container signal like R-14/R-16/R-17).",
|
|
248
|
+
},
|
|
249
|
+
'R-26': {
|
|
250
|
+
plain: "A data format in the model isn't linked to the schema code that defines it → link it to the schema (or mark it concept/outside).",
|
|
251
|
+
se: "Realized `SCHEMA` with no valid `realRef` `{file, symbol}` (graph↔Zod binding); else `concept:true` / `external:true` (CR-211/228).",
|
|
252
|
+
},
|
|
253
|
+
'R-29': {
|
|
254
|
+
plain: "Two acceptances claim the same test file, so a red run cannot be traced to one of them and the gate counts that evidence twice → give the file to the one acceptance it really proves, or split it.",
|
|
255
|
+
se: "Test file exclusivity (CR-SM-231): every file in `attributes.testRefs` belongs to at most one `TEST`. An acceptance may name n files (1:n) — a file may not name n acceptances. Severity `error`, deliberately sharper than R-19/R-20: a doubly claimed file makes gate numbers wrong, which is a mis-measurement, not a completeness signal. Purely structural — the file need not exist to be claimed twice.",
|
|
256
|
+
},
|
|
257
|
+
'R-30': {
|
|
258
|
+
plain: "This function sits in no chain of effects, so nobody can say which use case it serves — and the checks that would prove its wiring never look at it → add it to the chain of the use case it belongs to.",
|
|
259
|
+
se: "FUNC belongs to a function chain (CR-GC-366): a `FUNC` needs an incoming `FCHAIN -compose-> FUNC`, directly or inherited from a parent `FUNC` it decomposes from. R-15 demanded the opposite direction — that a chain has functions — and nothing demanded that a function has a chain. That gap is load-bearing: IO-01 (FLOW paths between chain members) and R-21 (integration test per chain) both scope themselves to a chain, so a function outside every chain falls through both nets silently. Severity `warning`, not error: on a real model this fires on the majority of functions, and an error would block every further mutation through the delta gate.",
|
|
260
|
+
},
|
|
261
|
+
'R-31': {
|
|
262
|
+
plain: "This function has no input or no output, so it is a dead block in the picture — only an actor is allowed to be an end point → connect it to a flow on the missing side.",
|
|
263
|
+
se: "FUNC is wired (CR-GC-366): a `FUNC` needs at least one incoming `FLOW -io-> FUNC` and one outgoing `FUNC -io-> FLOW`. Only an `ACTOR` may terminate a chain. R-10 asks the same question from the FLOW side ('does this flow have a producer and a consumer?') and therefore never sees a function with no io edge at all — it does not appear in the FLOW loop. IO-01 presupposes chain membership and misses it too. One finding per FUNC naming the missing side(s), not one per side: otherwise the counter exceeds its own denominator contribution, the mis-measurement documented in CR-SM-242.",
|
|
264
|
+
},
|
|
265
|
+
'RC-01': {
|
|
266
|
+
plain: "A function points to code that isn't there anymore (file moved or name changed) → repoint it to the current code.",
|
|
267
|
+
se: "FUNC `realRef` that does not resolve: file missing on disk or symbol not declared in it (CR-GC-253 conformance over CodeFacts).",
|
|
268
|
+
},
|
|
269
|
+
'RC-02': {
|
|
270
|
+
plain: "A test points to a test file or test name that isn't there anymore → repoint it to the current test.",
|
|
271
|
+
se: "A `testRefs` entry that does not resolve: file missing or `case` not declared as an it/test/describe (CR-GC-253). The message names the concrete path — with n entries the node id alone is not actionable.",
|
|
272
|
+
},
|
|
273
|
+
'RC-03': {
|
|
274
|
+
plain: "A data format points to schema code that isn't there anymore (file moved or export renamed) → repoint it to the current schema.",
|
|
275
|
+
se: "SCHEMA `realRef` that does not resolve: file missing on disk or symbol not a declared export in it (CR-211/228 conformance over CodeFacts).",
|
|
276
|
+
},
|
|
277
|
+
'RC-04': {
|
|
278
|
+
plain: "A data format is defined but the function on that interface never actually checks incoming data against it → validate with it there.",
|
|
279
|
+
se: "Bound `SCHEMA` whose symbol is not imported+parsed (`.parse`/`.safeParse`) in any realized `FUNC` io-connected to it (CR-211); warn — the parse may sit in a framework layer.",
|
|
280
|
+
},
|
|
281
|
+
'RC-05': {
|
|
282
|
+
plain: "Code in one building block imports code in another, but the model never says those two are connected → draw the connection in the model, or drop the import.",
|
|
283
|
+
se: "File import crossing a `MOD` boundary with no documenting graph structure (no io/FLOW between the modules) — undocumented cross-module dependency (CR-212); warn indicator, not a blocker.",
|
|
284
|
+
},
|
|
285
|
+
'RC-06': {
|
|
286
|
+
plain: "This element points at code in a package your project does not actually install → either add the package, or point at the one that owns the symbol now.",
|
|
287
|
+
se: "An `external: true` `realRef` names a package that is in neither `dependencies` nor `devDependencies` of the consumer. Absent dependency data is SILENCE, not a violation — the extractor never looked, and treating that as \"declares nothing\" would report every external binding at once (CR-SM-262).",
|
|
288
|
+
},
|
|
289
|
+
'RD-01': {
|
|
290
|
+
plain: "A smallest-piece feature has nothing built to fulfil it → add what implements it.",
|
|
291
|
+
se: "Leaf `REQ` (no `compose`→`REQ` children) with no `satisfy` from a `FUNC`/`FCHAIN`/`MOD`/`SYS`.",
|
|
292
|
+
prompt: "se:close-violations",
|
|
293
|
+
},
|
|
294
|
+
'RD-02': {
|
|
295
|
+
plain: "You split a feature into smaller features but you're also building the big one directly → build only the small pieces, not both.",
|
|
296
|
+
se: "Parent `REQ` (has `compose`→`REQ` children) carrying a direct `FUNC` `satisfy`; the satisfy belongs on the children.",
|
|
297
|
+
},
|
|
298
|
+
'RD-03': {
|
|
299
|
+
plain: "You split a feature into pieces, but all the pieces are handled by the same one thing — the split may be pointless → consider merging them.",
|
|
300
|
+
se: "Parent `REQ` whose children all share one satisfier.",
|
|
301
|
+
},
|
|
302
|
+
'RD-04': {
|
|
303
|
+
plain: "One thing has more than 9 parts directly under it → group them, so each level stays readable.",
|
|
304
|
+
se: "Decomposition breadth above `metricPolicy.decompositionBreadth.warning` children on one level — `FUNC` `compose` `FUNC`, `SYS`/`MOD` `compose` `MOD`, and the root `FUNC` forest anchored at `SYS` (CR-SM-282). Default 9, the upper end of 7±2 (CR-SM-296). The `FUNC` `allocate` `MOD` leg moved to R-04 in that CR: counting allocated FUNCs is module SIZE, and one question deserves one rule.",
|
|
305
|
+
},
|
|
306
|
+
'SC-02': {
|
|
307
|
+
plain: "A data format is defined but nothing uses it → connect it to the data it describes, or drop it.",
|
|
308
|
+
se: "`SCHEMA` not referenced by any `FLOW` via a `relation` trace.",
|
|
309
|
+
},
|
|
310
|
+
'UC-01': {
|
|
311
|
+
plain: "A scenario says what someone wants to do but never says what the system must provide → write down the requirements it needs.",
|
|
312
|
+
se: "`UC` with no `compose` trace to any `REQ`. The use case carries no requirement content.",
|
|
313
|
+
prompt: "se:author-req",
|
|
314
|
+
},
|
|
315
|
+
'UC-02': {
|
|
316
|
+
plain: "A scenario has nobody who triggers it → name who or what starts it.",
|
|
317
|
+
se: "`UC` with no `ACTOR` connected by an `io` trace (directly or via a `FLOW` of its chain).",
|
|
318
|
+
prompt: "se:author-uc",
|
|
319
|
+
},
|
|
320
|
+
'UC-03': {
|
|
321
|
+
plain: "A scenario says what should be possible but not how it runs → describe the steps as a chain of functions.",
|
|
322
|
+
se: "`UC` with no `compose` trace to an `FCHAIN`. No behavioural scenario is declared.",
|
|
323
|
+
prompt: "se:author-uc",
|
|
324
|
+
},
|
|
325
|
+
'UC-04': {
|
|
326
|
+
plain: "A scenario has no real description, or still carries a placeholder like TBD → write what the user actually wants to achieve.",
|
|
327
|
+
se: "`UC` description shorter than 10 characters or containing TBD/TODO/FIXME/placeholder/XXX. Description IS the goal (CR-150).",
|
|
328
|
+
prompt: "se:author-uc",
|
|
329
|
+
},
|
|
330
|
+
'UC-05': {
|
|
331
|
+
plain: "A scenario does not say what must be true once it has finished → add that as a requirement.",
|
|
332
|
+
se: "`UC` with no `compose`d `REQ` carrying `kinds:[\"postcondition\"]`.",
|
|
333
|
+
},
|
|
334
|
+
'UC-06': {
|
|
335
|
+
plain: "A scenario does not say what must be true before it can start → add that as a requirement.",
|
|
336
|
+
se: "`UC` with no `compose`d `REQ` carrying `kinds:[\"precondition\"]`.",
|
|
337
|
+
},
|
|
338
|
+
'VR-01': {
|
|
339
|
+
plain: "A test exists but no result was ever recorded, so nobody knows if it passed → record the outcome.",
|
|
340
|
+
se: "`TEST` with no `testResult` attribute — assumed pending, never assumed green.",
|
|
341
|
+
},
|
|
342
|
+
};
|
package/dist/se/rules.d.ts
CHANGED
|
@@ -80,6 +80,9 @@ export declare const ViolationContext: z.ZodObject<{
|
|
|
80
80
|
}, z.core.$strip>>>;
|
|
81
81
|
parent_module: z.ZodOptional<z.ZodString>;
|
|
82
82
|
current_description: z.ZodOptional<z.ZodString>;
|
|
83
|
+
also_affects: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
84
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
85
|
+
threshold: z.ZodOptional<z.ZodNumber>;
|
|
83
86
|
}, z.core.$strip>;
|
|
84
87
|
export type ViolationContext = z.infer<typeof ViolationContext>;
|
|
85
88
|
export declare const RuleViolation: z.ZodObject<{
|
|
@@ -139,6 +142,9 @@ export declare const RuleViolation: z.ZodObject<{
|
|
|
139
142
|
}, z.core.$strip>>>;
|
|
140
143
|
parent_module: z.ZodOptional<z.ZodString>;
|
|
141
144
|
current_description: z.ZodOptional<z.ZodString>;
|
|
145
|
+
also_affects: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
146
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
147
|
+
threshold: z.ZodOptional<z.ZodNumber>;
|
|
142
148
|
}, z.core.$strip>>;
|
|
143
149
|
}, z.core.$strip>;
|
|
144
150
|
export type RuleViolation = z.infer<typeof RuleViolation>;
|