@radicaltools/cli 0.6.1 → 0.6.3
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/{chunk-SBQRTX3Y.js → chunk-KLTSABHI.js} +1 -1
- package/dist/{dist-LSHMW73I.js → dist-5LSJ4CQ3.js} +2 -2
- package/dist/hub-catalogue/concern/concern-accessibility.radical +85 -1
- package/dist/hub-catalogue/concern/concern-api-collections.radical +78 -1
- package/dist/hub-catalogue/concern/concern-api-errors.radical +78 -1
- package/dist/hub-catalogue/concern/concern-api-evolution.radical +78 -1
- package/dist/hub-catalogue/concern/concern-api-idempotency.radical +121 -3
- package/dist/hub-catalogue/concern/concern-api-resource-design.radical +78 -1
- package/dist/hub-catalogue/concern/concern-api-style-guide.radical +78 -1
- package/dist/hub-catalogue/concern/concern-architecture-style.radical +83 -7
- package/dist/hub-catalogue/concern/concern-audit-trail.radical +77 -1
- package/dist/hub-catalogue/concern/concern-authentication.radical +178 -8
- package/dist/hub-catalogue/concern/concern-authorization.radical +133 -7
- package/dist/hub-catalogue/concern/concern-availability.radical +156 -6
- package/dist/hub-catalogue/concern/concern-backend-stack.radical +71 -8
- package/dist/hub-catalogue/concern/concern-backup-recovery.radical +136 -6
- package/dist/hub-catalogue/concern/concern-caching.radical +73 -1
- package/dist/hub-catalogue/concern/concern-capacity.radical +124 -5
- package/dist/hub-catalogue/concern/concern-ci-cd-pipeline.radical +154 -15
- package/dist/hub-catalogue/concern/concern-code-documentation.radical +131 -13
- package/dist/hub-catalogue/concern/concern-code-quality-gate.radical +116 -7
- package/dist/hub-catalogue/concern/concern-code-review-branching.radical +174 -13
- package/dist/hub-catalogue/concern/concern-code-style.radical +148 -16
- package/dist/hub-catalogue/concern/concern-communication-style.radical +94 -7
- package/dist/hub-catalogue/concern/concern-data-classification.radical +77 -1
- package/dist/hub-catalogue/concern/concern-data-consistency.radical +87 -5
- package/dist/hub-catalogue/concern/concern-data-store.radical +87 -5
- package/dist/hub-catalogue/concern/concern-decomposition.radical +78 -1
- package/dist/hub-catalogue/concern/concern-definition-of-done.radical +150 -11
- package/dist/hub-catalogue/concern/concern-delivery-metrics.radical +130 -5
- package/dist/hub-catalogue/concern/concern-dependency-hygiene.radical +127 -10
- package/dist/hub-catalogue/concern/concern-deployment.radical +113 -9
- package/dist/hub-catalogue/concern/concern-encryption.radical +146 -5
- package/dist/hub-catalogue/concern/concern-error-handling-logging.radical +118 -12
- package/dist/hub-catalogue/concern/concern-eu-dora.radical +69 -1
- package/dist/hub-catalogue/concern/concern-frontend-stack.radical +148 -9
- package/dist/hub-catalogue/concern/concern-incident-management.radical +122 -1
- package/dist/hub-catalogue/concern/concern-infrastructure.radical +54 -1
- package/dist/hub-catalogue/concern/concern-integration-resilience.radical +110 -5
- package/dist/hub-catalogue/concern/concern-messaging.radical +89 -2
- package/dist/hub-catalogue/concern/concern-mobile-performance.radical +67 -1
- package/dist/hub-catalogue/concern/concern-module-boundaries.radical +92 -5
- package/dist/hub-catalogue/concern/concern-observability.radical +105 -1
- package/dist/hub-catalogue/concern/concern-operational-readiness.radical +140 -5
- package/dist/hub-catalogue/concern/concern-personal-data.radical +206 -7
- package/dist/hub-catalogue/concern/concern-quality-priorities.radical +104 -12
- package/dist/hub-catalogue/concern/concern-rate-limiting.radical +110 -1
- package/dist/hub-catalogue/concern/concern-release-versioning.radical +99 -7
- package/dist/hub-catalogue/concern/concern-retention.radical +130 -9
- package/dist/hub-catalogue/concern/concern-secrets.radical +196 -12
- package/dist/hub-catalogue/concern/concern-secure-coding.radical +122 -1
- package/dist/hub-catalogue/concern/concern-secure-development.radical +118 -1
- package/dist/hub-catalogue/concern/concern-security-detection.radical +124 -1
- package/dist/hub-catalogue/concern/concern-supply-chain.radical +116 -1
- package/dist/hub-catalogue/concern/concern-technical-debt.radical +162 -19
- package/dist/hub-catalogue/concern/concern-technology-lifecycle.radical +152 -18
- package/dist/hub-catalogue/concern/concern-tenant-isolation.radical +111 -1
- package/dist/hub-catalogue/concern/concern-test-strategy.radical +83 -7
- package/dist/hub-catalogue/concern/concern-threat-modelling.radical +120 -1
- package/dist/hub-catalogue/concern/concern-usability.radical +84 -5
- package/dist/index.js +68 -18
- package/dist/{pdfjs-WWNLOMK2.js → pdfjs-NDGKK4BL.js} +1 -1
- package/dist/{undici-53QU2XSN.js → undici-BOSAZUPY.js} +1 -1
- package/package.json +1 -1
|
@@ -19,7 +19,126 @@
|
|
|
19
19
|
"trigger": "LIST RELATIONS WHERE (source.type = \"person\" OR source.external = true) AND target.external != true AND (target.type = \"system\" OR target.type = \"container\" OR target.type = \"webapp\" OR target.type = \"component\")",
|
|
20
20
|
"applyTo": "target",
|
|
21
21
|
"why": "people or external systems reach these elements across a trust boundary, so how their threats are found and ended has to be decided.",
|
|
22
|
-
"group": "security"
|
|
22
|
+
"group": "security",
|
|
23
|
+
"scope": {
|
|
24
|
+
"group": "security",
|
|
25
|
+
"questions": [
|
|
26
|
+
{
|
|
27
|
+
"key": "EXPOSURE",
|
|
28
|
+
"label": "Who can reach it?",
|
|
29
|
+
"default": "customers",
|
|
30
|
+
"hint": "The more strangers can reach it, the more attacks it meets that need no inside knowledge (Microsoft SDL asks this first).",
|
|
31
|
+
"options": [
|
|
32
|
+
{
|
|
33
|
+
"value": "staff",
|
|
34
|
+
"label": "only our own staff",
|
|
35
|
+
"description": "An internal system: everyone who reaches it works for the organisation that runs it, from its network or with its accounts."
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"value": "customers",
|
|
39
|
+
"label": "our customers and staff",
|
|
40
|
+
"description": "People who come to us for a service (to book, order, pay, look something up) and our staff; there is no open sign-up, community or API for strangers."
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"value": "public",
|
|
44
|
+
"label": "anyone, at scale",
|
|
45
|
+
"description": "Open sign-up, a public API, content anyone can post, or so many users that bots and automated abuse come with them."
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"key": "DATA",
|
|
51
|
+
"label": "What would a leak of its data harm?",
|
|
52
|
+
"default": "ordinary",
|
|
53
|
+
"hint": "The most sensitive data it keeps decides (FIPS 199 confidentiality; GDPR Art. 9 for special categories).",
|
|
54
|
+
"options": [
|
|
55
|
+
{
|
|
56
|
+
"value": "none",
|
|
57
|
+
"label": "nothing: nothing private",
|
|
58
|
+
"description": "Public information only, and staff sign-in."
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"value": "ordinary",
|
|
62
|
+
"label": "little: ordinary personal or business data",
|
|
63
|
+
"description": "Names, e-mail addresses, orders, ordinary business documents: a leak is unpleasant, not ruinous."
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"value": "confidential",
|
|
67
|
+
"label": "a lot: confidential data",
|
|
68
|
+
"description": "Financial or account data, identity numbers, location, private messages, trade secrets or customer lists: a leak seriously harms people or the business."
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"value": "special",
|
|
72
|
+
"label": "people deeply: special categories",
|
|
73
|
+
"description": "Health, biometrics, genetic data, religion, politics, sexual orientation, union membership, criminal records, or children's data (GDPR Art. 9 and 10)."
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"key": "TENANCY",
|
|
79
|
+
"label": "How many customer organisations does one running copy serve?",
|
|
80
|
+
"default": "one",
|
|
81
|
+
"hint": "Several organisations in one deployment means one missed filter shows one customer another's data (AWS SaaS Lens).",
|
|
82
|
+
"options": [
|
|
83
|
+
{
|
|
84
|
+
"value": "one",
|
|
85
|
+
"label": "one organisation",
|
|
86
|
+
"description": "It serves one organisation (a shop, a company, a public body), however many people use it."
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"value": "shared",
|
|
90
|
+
"label": "several, sharing",
|
|
91
|
+
"description": "Several customer organisations (tenants) share the same deployment and data stores, kept apart by the software."
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"value": "separate",
|
|
95
|
+
"label": "several, each its own",
|
|
96
|
+
"description": "Several customer organisations, each with its own database or its own copy of the system."
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"key": "CAPACITY",
|
|
102
|
+
"label": "Who looks after its IT and security?",
|
|
103
|
+
"default": "ig1",
|
|
104
|
+
"hint": "What an organisation can run decides how much security practice it can keep up (CIS Controls Implementation Groups 1 to 3).",
|
|
105
|
+
"options": [
|
|
106
|
+
{
|
|
107
|
+
"value": "ig1",
|
|
108
|
+
"label": "the people who build it",
|
|
109
|
+
"description": "A few people who build it; nobody works on IT or security full time (CIS IG1)."
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"value": "ig2",
|
|
113
|
+
"label": "people who run IT",
|
|
114
|
+
"description": "There are people whose job includes running and protecting the infrastructure; several departments rely on it (CIS IG2)."
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"value": "ig3",
|
|
118
|
+
"label": "security specialists",
|
|
119
|
+
"description": "A security team or specialists of their own (security operations, penetration testers), under regulators' eyes (CIS IG3)."
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
"when": [
|
|
125
|
+
{
|
|
126
|
+
"DATA": [
|
|
127
|
+
"confidential",
|
|
128
|
+
"special"
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"EXPOSURE": [
|
|
133
|
+
"public"
|
|
134
|
+
],
|
|
135
|
+
"CAPACITY": [
|
|
136
|
+
"ig2",
|
|
137
|
+
"ig3"
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
}
|
|
23
142
|
},
|
|
24
143
|
"sources": [
|
|
25
144
|
{
|
|
@@ -21,7 +21,66 @@
|
|
|
21
21
|
"trigger": "LIST RELATIONS WHERE source.type = \"person\" AND target.type = \"webapp\" AND target.external != true",
|
|
22
22
|
"applyTo": "target",
|
|
23
23
|
"why": "people use these web front ends, so how navigation, links, form errors and empty views behave, and how usability is reviewed, has to be decided.",
|
|
24
|
-
"group": "ux"
|
|
24
|
+
"group": "ux",
|
|
25
|
+
"scope": {
|
|
26
|
+
"group": "ux",
|
|
27
|
+
"questions": [
|
|
28
|
+
{
|
|
29
|
+
"key": "USERS",
|
|
30
|
+
"label": "Who uses its screens?",
|
|
31
|
+
"default": "staff",
|
|
32
|
+
"hint": "Consumers include people with disabilities and older devices the organisation does not choose.",
|
|
33
|
+
"options": [
|
|
34
|
+
{
|
|
35
|
+
"value": "staff",
|
|
36
|
+
"label": "our staff",
|
|
37
|
+
"description": "Only people who work for the organisation."
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"value": "consumers",
|
|
41
|
+
"label": "customers or the public",
|
|
42
|
+
"description": "Customers, citizens or anyone else outside the organisation."
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"key": "ACCESSIBILITY_LAW",
|
|
48
|
+
"label": "Does a law require it to be accessible?",
|
|
49
|
+
"default": "no",
|
|
50
|
+
"hint": "The European Accessibility Act covers consumer e-commerce and banking from June 2025; public bodies fall under the Web Accessibility Directive.",
|
|
51
|
+
"options": [
|
|
52
|
+
{
|
|
53
|
+
"value": "no",
|
|
54
|
+
"label": "no",
|
|
55
|
+
"description": "No accessibility law applies to it."
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"value": "yes",
|
|
59
|
+
"label": "yes",
|
|
60
|
+
"description": "A public body, or a consumer service under the European Accessibility Act or a like law."
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"key": "MOBILE",
|
|
66
|
+
"label": "Is it used on phones?",
|
|
67
|
+
"default": "rarely",
|
|
68
|
+
"hint": "Phones on slow networks make load time and responsiveness felt.",
|
|
69
|
+
"options": [
|
|
70
|
+
{
|
|
71
|
+
"value": "rarely",
|
|
72
|
+
"label": "rarely",
|
|
73
|
+
"description": "Mostly on desktop computers."
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"value": "phones",
|
|
77
|
+
"label": "often or mostly",
|
|
78
|
+
"description": "Many people use it on phones or tablets."
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
}
|
|
25
84
|
},
|
|
26
85
|
"sources": [
|
|
27
86
|
{
|
|
@@ -112,7 +171,12 @@
|
|
|
112
171
|
"label": "no navigation: a linear journey with a Back link",
|
|
113
172
|
"description": "A transactional service that takes people through one task a question at a time: the same header on every page, no site navigation, and a Back link to the previous page, as GOV.UK services do. Pick it for forms-based services such as applying, registering or paying."
|
|
114
173
|
}
|
|
115
|
-
]
|
|
174
|
+
],
|
|
175
|
+
"scopeWhen": {
|
|
176
|
+
"ACCESSIBILITY_LAW": [
|
|
177
|
+
"yes"
|
|
178
|
+
]
|
|
179
|
+
}
|
|
116
180
|
},
|
|
117
181
|
{
|
|
118
182
|
"key": "LINK_REPEAT",
|
|
@@ -131,7 +195,12 @@
|
|
|
131
195
|
"label": "up to a set limit",
|
|
132
196
|
"description": "A target may repeat up to the limit set below (for instance a call to action at the top and at the end of a long page). Links to different sections of one page count as links to that page. Pick it for long content or marketing pages, and keep the limit small."
|
|
133
197
|
}
|
|
134
|
-
]
|
|
198
|
+
],
|
|
199
|
+
"scopeWhen": {
|
|
200
|
+
"ACCESSIBILITY_LAW": [
|
|
201
|
+
"yes"
|
|
202
|
+
]
|
|
203
|
+
}
|
|
135
204
|
},
|
|
136
205
|
{
|
|
137
206
|
"key": "LINK_TEXT",
|
|
@@ -150,7 +219,12 @@
|
|
|
150
219
|
"label": "a link name that says where it goes together with its context",
|
|
151
220
|
"description": "A name may repeat when its list item, table row, paragraph or card tells the links apart, with the context in visually hidden text where the visible text repeats (\"Change\" in each row). The level of WCAG 2.4.4 (A). Pick it for dense tables and lists with an action per row."
|
|
152
221
|
}
|
|
153
|
-
]
|
|
222
|
+
],
|
|
223
|
+
"scopeWhen": {
|
|
224
|
+
"ACCESSIBILITY_LAW": [
|
|
225
|
+
"yes"
|
|
226
|
+
]
|
|
227
|
+
}
|
|
154
228
|
},
|
|
155
229
|
{
|
|
156
230
|
"key": "ERRORS",
|
|
@@ -174,7 +248,12 @@
|
|
|
174
248
|
"label": "a message at each field once it is left, and a summary on submit",
|
|
175
249
|
"description": "A field with a format to check (an IBAN, a password rule) is checked when the user leaves it, never while typing, and on submit the summary appears as well. GOV.UK advises against checking on leaving a field; pick it only where user research shows early feedback saves rework in long or complex forms."
|
|
176
250
|
}
|
|
177
|
-
]
|
|
251
|
+
],
|
|
252
|
+
"scopeWhen": {
|
|
253
|
+
"ACCESSIBILITY_LAW": [
|
|
254
|
+
"yes"
|
|
255
|
+
]
|
|
256
|
+
}
|
|
178
257
|
},
|
|
179
258
|
{
|
|
180
259
|
"key": "EMPTY",
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
define_RADICAL_BUILD_default,
|
|
4
4
|
init_define_RADICAL_BUILD
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-KLTSABHI.js";
|
|
6
6
|
|
|
7
7
|
// src/index.ts
|
|
8
8
|
init_define_RADICAL_BUILD();
|
|
@@ -766,7 +766,11 @@ function builtInGovernanceMetamodel() {
|
|
|
766
766
|
{ key: "alternatives", label: "Alternatives considered", type: "textarea" },
|
|
767
767
|
// The Hub concern pack the decision settles (its concern id), for the
|
|
768
768
|
// check's concern-unaddressed rule; set by a pack's import.
|
|
769
|
-
{ key: "concern", label: "Concern (Hub)", type: "text" }
|
|
769
|
+
{ key: "concern", label: "Concern (Hub)", type: "text" },
|
|
770
|
+
// How it settles that concern: `not-needed` records that the system does
|
|
771
|
+
// not need it (Radical Forge, when the person leaves an open concern out):
|
|
772
|
+
// nothing to check, so no fitness function implements it.
|
|
773
|
+
{ key: "concern_outcome", label: "Concern outcome", type: "enum", options: ["settled", "not-needed"] }
|
|
770
774
|
];
|
|
771
775
|
const adr = {
|
|
772
776
|
id: "adr",
|
|
@@ -2407,14 +2411,17 @@ function capitalize(s2) {
|
|
|
2407
2411
|
function earsActionIsClause(action) {
|
|
2408
2412
|
return /\S\s+shall\s+\S/i.test(action);
|
|
2409
2413
|
}
|
|
2414
|
+
function withoutKeyword(text3, keyword) {
|
|
2415
|
+
return text3.trim().replace(new RegExp(`^${keyword}\\s+`, "i"), "").replace(/,\s*(then)?\s*$/i, "").trim();
|
|
2416
|
+
}
|
|
2410
2417
|
function composeEarsSentence(node, subject, statePrecondition) {
|
|
2411
2418
|
const earsType = String(node.ears_type ?? "ubiquitous");
|
|
2412
2419
|
const subj = (subject || "the system").trim();
|
|
2413
2420
|
const action = String(node.action ?? "").trim();
|
|
2414
|
-
const trigger = String(node.trigger ?? "")
|
|
2415
|
-
const precondition = (statePrecondition ?? "").trim() || String(node.precondition ?? "")
|
|
2416
|
-
const unwanted = String(node.unwanted_condition ?? "")
|
|
2417
|
-
const feature = String(node.feature ?? "")
|
|
2421
|
+
const trigger = withoutKeyword(String(node.trigger ?? ""), "when");
|
|
2422
|
+
const precondition = withoutKeyword((statePrecondition ?? "").trim() || String(node.precondition ?? ""), "while");
|
|
2423
|
+
const unwanted = withoutKeyword(String(node.unwanted_condition ?? ""), "if");
|
|
2424
|
+
const feature = withoutKeyword(String(node.feature ?? ""), "where");
|
|
2418
2425
|
const actionPart = action.replace(/\.+$/, "") || "\u2039action\u203A";
|
|
2419
2426
|
const ownClause2 = earsActionIsClause(actionPart);
|
|
2420
2427
|
const shallClause = ownClause2 ? actionPart.replace(/^(The|A|An)\b/, (w) => w.toLowerCase()) : `${subj} shall ${actionPart}`;
|
|
@@ -5340,6 +5347,8 @@ same turn.
|
|
|
5340
5347
|
Syntax:
|
|
5341
5348
|
- LIST NODES
|
|
5342
5349
|
- LIST NODES WHERE <expr> [LIMIT n]
|
|
5350
|
+
- LIST <type, plural or not> [WHERE <expr>] [LIMIT n] \u2014 the same as
|
|
5351
|
+
LIST NODES WHERE type = "<type>" (LIST REQUIREMENTS, LIST FITNESS-FNS)
|
|
5343
5352
|
- LIST RELATIONS
|
|
5344
5353
|
- LIST RELATIONS WHERE <expr> [LIMIT n]
|
|
5345
5354
|
- LIST VIEWS
|
|
@@ -6067,14 +6076,38 @@ function runFullQuery(raw, ctx) {
|
|
|
6067
6076
|
result: summarizeTraversalResults(nodeId, reached, ctx.nodes, relations)
|
|
6068
6077
|
};
|
|
6069
6078
|
}
|
|
6079
|
+
const byType = typeListQuery(raw, ctx);
|
|
6080
|
+
if (byType) return { ...runFullQuery(byType, ctx), query: raw };
|
|
6070
6081
|
throw new Error(`Unsupported query: ${raw}`);
|
|
6071
6082
|
}
|
|
6083
|
+
function nodeTypeNamed(word, ctx) {
|
|
6084
|
+
const types2 = /* @__PURE__ */ new Set([...Object.keys(ctx.metamodel?.nodeTypes ?? {}), ...Object.values(ctx.nodes).map((n) => n.type)]);
|
|
6085
|
+
const w = word.trim().toLowerCase().replace(/[\s_]+/g, "-");
|
|
6086
|
+
const candidates = [w, w.replace(/ies$/, "y"), w.replace(/es$/, ""), w.replace(/s$/, "")];
|
|
6087
|
+
for (const c of candidates) if (c && types2.has(c)) return c;
|
|
6088
|
+
return null;
|
|
6089
|
+
}
|
|
6090
|
+
function typeListQuery(raw, ctx) {
|
|
6091
|
+
const m = /^LIST\s+([A-Za-z][\w-]*(?:[ _][A-Za-z][\w-]*)?)(?:\s+WHERE\s+(.+?))?(?:\s+LIMIT\s+(\d+))?$/i.exec(raw);
|
|
6092
|
+
if (!m || /^(NODES|RELATIONS|VIEWS|SEQUENCES|TECHNOLOGIES)$/i.test(m[1])) return null;
|
|
6093
|
+
const type2 = nodeTypeNamed(m[1], ctx);
|
|
6094
|
+
if (!type2) return null;
|
|
6095
|
+
return `LIST NODES WHERE type = "${type2}"${m[2] ? ` AND (${m[2]})` : ""}${m[3] ? ` LIMIT ${m[3]}` : ""}`;
|
|
6096
|
+
}
|
|
6072
6097
|
|
|
6073
6098
|
// ../../packages/common/src/hubImport.ts
|
|
6074
6099
|
init_define_RADICAL_BUILD();
|
|
6075
6100
|
|
|
6101
|
+
// ../../packages/common/src/concernScope.ts
|
|
6102
|
+
init_define_RADICAL_BUILD();
|
|
6103
|
+
|
|
6076
6104
|
// ../../packages/common/src/concerns.ts
|
|
6077
6105
|
var CONCERN_KEY = "concern";
|
|
6106
|
+
function concernsOf(node) {
|
|
6107
|
+
const value = node[CONCERN_KEY];
|
|
6108
|
+
return typeof value === "string" ? value.split(",").map((c) => c.trim()).filter(Boolean) : [];
|
|
6109
|
+
}
|
|
6110
|
+
var CONCERN_OUTCOME_KEY = "concern_outcome";
|
|
6078
6111
|
var isConcernPack = (meta) => meta.category === "concern" && !!meta.concern;
|
|
6079
6112
|
function questionLine(param) {
|
|
6080
6113
|
const choices = param.options?.length ? ` (${param.options.map((o) => `${o.value}: ${o.label}`).join(" | ")})` : "";
|
|
@@ -6097,10 +6130,11 @@ function concernStatuses(packs, nodes, relations) {
|
|
|
6097
6130
|
const adrsBy = /* @__PURE__ */ new Map();
|
|
6098
6131
|
for (const n of Object.values(nodes)) {
|
|
6099
6132
|
if (n.type !== "adr") continue;
|
|
6100
|
-
const concern
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6133
|
+
for (const concern of concernsOf(n)) {
|
|
6134
|
+
const list = adrsBy.get(concern);
|
|
6135
|
+
if (list) list.push(n);
|
|
6136
|
+
else adrsBy.set(concern, [n]);
|
|
6137
|
+
}
|
|
6104
6138
|
}
|
|
6105
6139
|
const constrained = /* @__PURE__ */ new Map();
|
|
6106
6140
|
for (const r of Object.values(relations)) {
|
|
@@ -6143,7 +6177,8 @@ function unboundDecisions(packs, nodes, relations, metamodel) {
|
|
|
6143
6177
|
if (r.relationType === "implements" && nodes[r.sourceId]?.type === "fitness-fn") implementedBy.set(r.targetId, [...implementedBy.get(r.targetId) ?? [], r.sourceId]);
|
|
6144
6178
|
}
|
|
6145
6179
|
return Object.values(nodes).filter((n) => n.type === "adr" && prop2(n, CONCERN_KEY) && prop2(n, "status") === "accepted" && !constraining.has(n.id)).map((adr) => {
|
|
6146
|
-
const
|
|
6180
|
+
const marked = concernsOf(adr);
|
|
6181
|
+
const pack = marked.length === 1 ? packs.find((p) => p.concern.id === marked[0]) : void 0;
|
|
6147
6182
|
return {
|
|
6148
6183
|
adr,
|
|
6149
6184
|
concern: prop2(adr, CONCERN_KEY),
|
|
@@ -7011,7 +7046,7 @@ var CHECK_RULES = [
|
|
|
7011
7046
|
id: "scenario-value-untested",
|
|
7012
7047
|
description: "With the test sources (radical check reads the files of the tests .radical/radical.json binds): **every hard value a scenario names that tells a case apart** (not a count below 10) **is in the file of a test bound to it**.",
|
|
7013
7048
|
severity: "warning",
|
|
7014
|
-
dimension: "
|
|
7049
|
+
dimension: "behaviour",
|
|
7015
7050
|
run: (model) => {
|
|
7016
7051
|
const sources = model.testSources;
|
|
7017
7052
|
if (!sources) return [];
|
|
@@ -7071,7 +7106,7 @@ var CHECK_RULES = [
|
|
|
7071
7106
|
description: "**Every accepted ADR is implemented by a fitness function** that checks it.",
|
|
7072
7107
|
severity: "warning",
|
|
7073
7108
|
dimension: "decisions",
|
|
7074
|
-
run: (model) => model.metamodel.nodeTypes["fitness-fn"] ? unlinked(model, "adr", "implements", "in", ["fitness-fn"]).filter((n) => prop3(n, "status") === "accepted").filter((n) => !relationsOf(model, "waives").from.has(n.id)).map((n) => ({ nodeId: n.id, message: `No fitness function implements accepted ADR ${quote(n)}.` })) : []
|
|
7109
|
+
run: (model) => model.metamodel.nodeTypes["fitness-fn"] ? unlinked(model, "adr", "implements", "in", ["fitness-fn"]).filter((n) => prop3(n, "status") === "accepted").filter((n) => !relationsOf(model, "waives").from.has(n.id) && prop3(n, CONCERN_OUTCOME_KEY) !== "not-needed").map((n) => ({ nodeId: n.id, message: `No fitness function implements accepted ADR ${quote(n)}.` })) : []
|
|
7075
7110
|
},
|
|
7076
7111
|
{
|
|
7077
7112
|
id: "inherited-adr-unapplied",
|
|
@@ -7168,14 +7203,14 @@ var CHECK_RULES = [
|
|
|
7168
7203
|
id: "scenario-without-metrics",
|
|
7169
7204
|
description: "**Every scenario has what checks it**: tests the repository's .radical/radical.json binds to it, or metric conditions (property `metrics`, one per line: `<metric>{<labels>} <op> <number> [unit]`). One the repository must verify is scenario-not-verified-here's.",
|
|
7170
7205
|
severity: "warning",
|
|
7171
|
-
dimension: "
|
|
7206
|
+
dimension: "behaviour",
|
|
7172
7207
|
run: (model) => nodesOf(model, "scenario").filter((n) => !conditionsOf(n).length && !verifiedHere(model, n)).map((n) => ({ nodeId: n.id, message: `Scenario ${quote(n)} names no check.` }))
|
|
7173
7208
|
},
|
|
7174
7209
|
{
|
|
7175
7210
|
id: "scenario-not-verified-here",
|
|
7176
7211
|
description: "With the repository's .radical/radical.json (the CLI): **every scenario of a requirement an element the repository builds satisfies has tests the file binds to it, or metric conditions**.",
|
|
7177
7212
|
severity: "warning",
|
|
7178
|
-
dimension: "
|
|
7213
|
+
dimension: "behaviour",
|
|
7179
7214
|
run: (model) => nodesOf(model, "scenario").filter((n) => !conditionsOf(n).length && verifiedHere(model, n)).map((n) => ({ nodeId: n.id, message: `Scenario ${quote(n)} is this repository's to verify (an element it builds satisfies its requirement), and ${model.repository.file} binds no test to it: radical verify ${n.id} --test "<file> \u203A <title>".` }))
|
|
7180
7215
|
},
|
|
7181
7216
|
{
|
|
@@ -7192,7 +7227,7 @@ var CHECK_RULES = [
|
|
|
7192
7227
|
id: "fitness-fn-without-metrics",
|
|
7193
7228
|
description: "**Every fitness function states what checks it and when it passes** (property `metrics`, one condition per line).",
|
|
7194
7229
|
severity: "warning",
|
|
7195
|
-
dimension: "
|
|
7230
|
+
dimension: "fitness",
|
|
7196
7231
|
run: (model) => nodesOf(model, "fitness-fn").filter((n) => !conditionsOf(n).length).map((n) => ({ nodeId: n.id, message: `Fitness function ${quote(n)} names no check.` }))
|
|
7197
7232
|
},
|
|
7198
7233
|
{
|
|
@@ -7439,6 +7474,21 @@ var CHECK_METRICS = [
|
|
|
7439
7474
|
byRule("elements-valid", "Elements the metamodel allows", "Elements no metamodel issue points at.", "consistency", "metamodel", (m) => Object.values(m.nodes)),
|
|
7440
7475
|
byRule("requirements-complete", "Complete requirements", "Requirements with an action and every field their EARS type reads.", "completeness", "requirement-incomplete", (m) => nodesOf(m, "requirement")),
|
|
7441
7476
|
byRule("adrs-complete", "Complete accepted ADRs", "Accepted ADRs with a date, context, decision and consequences.", "completeness", "adr-incomplete", acceptedAdrs),
|
|
7477
|
+
{
|
|
7478
|
+
// The rules of unreadable checks had no metric, so Completeness read 100%
|
|
7479
|
+
// beside findings to fix (the user, 2026-11-29: "the numbers don't add up").
|
|
7480
|
+
id: "checks-readable",
|
|
7481
|
+
label: "Checks that can be read",
|
|
7482
|
+
dimension: "completeness",
|
|
7483
|
+
rule: "metric-invalid",
|
|
7484
|
+
description: "Fitness functions and scenarios whose Metrics and Measure lines the check can read.",
|
|
7485
|
+
measure: (ctx) => {
|
|
7486
|
+
const nodes = [...nodesOf(ctx.model, "fitness-fn"), ...nodesOf(ctx.model, "scenario")];
|
|
7487
|
+
if (!nodes.length) return null;
|
|
7488
|
+
const unreadable = new Set(ctx.found.filter((f) => (f.rule === "metric-invalid" || f.rule === "fitness-fn-measure-invalid") && f.nodeId).map((f) => f.nodeId));
|
|
7489
|
+
return { count: nodes.filter((n) => !unreadable.has(n.id)).length, total: nodes.length };
|
|
7490
|
+
}
|
|
7491
|
+
},
|
|
7442
7492
|
byRule("needs-with-requirement", "Needs with a requirement", "Needs at least one requirement derives from, directly or through a need inside them.", "traceability", "need-without-requirement", (m) => nodesOf(m, "need")),
|
|
7443
7493
|
byRule("requirements-with-origin", "Requirements with an origin", "Requirements that derive from a need or another requirement.", "traceability", "requirement-without-origin", (m) => nodesOf(m, "requirement")),
|
|
7444
7494
|
byRule("requirements-quoting-need", "Requirements that quote their need", "Requirements derived from a need whose Derives from relation quotes the words they rest on; measured once a relation of the model quotes.", "traceability", "derives-quote-missing", (m) => {
|
|
@@ -7450,10 +7500,10 @@ var CHECK_METRICS = [
|
|
|
7450
7500
|
byRule("requirements-satisfied", "Requirements satisfied", "Requirements an element of the architecture satisfies.", "traceability", "requirement-unsatisfied", (m) => nodesOf(m, "requirement")),
|
|
7451
7501
|
byRule("requirements-with-scenario", "Requirements with a scenario", "Requirements at least one scenario verifies.", "traceability", "requirement-without-scenario", (m) => hasType(m, "scenario") ? nodesOf(m, "requirement") : null),
|
|
7452
7502
|
byRule("scenarios-verifying", "Scenarios that verify something", "Scenarios that verify a requirement or a state machine.", "traceability", "scenario-verifies-nothing", (m) => nodesOf(m, "scenario")),
|
|
7453
|
-
byRule("scenarios-with-metrics", "Scenarios that name a check", "Scenarios
|
|
7503
|
+
byRule("scenarios-with-metrics", "Scenarios that name a check", "Scenarios with a check: tests the repository binds to them, or metric conditions measured on the running system.", "behaviour", "scenario-without-metrics", (m) => nodesOf(m, "scenario")),
|
|
7454
7504
|
byRule("adrs-with-fitness-fn", "Accepted ADRs with a fitness function", "Accepted ADRs a fitness function implements.", "decisions", "adr-without-fitness-fn", (m) => hasType(m, "fitness-fn") ? acceptedAdrs(m) : null),
|
|
7455
7505
|
byRule("fitness-fns-linked", "Fitness functions linked", "Fitness functions that implement an ADR or constrain an element.", "decisions", "fitness-fn-unlinked", (m) => nodesOf(m, "fitness-fn")),
|
|
7456
|
-
byRule("fitness-fns-with-metrics", "Fitness functions that name a check", "Fitness functions
|
|
7506
|
+
byRule("fitness-fns-with-metrics", "Fitness functions that name a check", "Fitness functions with a check: tests the repository binds to them, or metric conditions measured on the running system.", "fitness", "fitness-fn-without-metrics", (m) => nodesOf(m, "fitness-fn")),
|
|
7457
7507
|
{
|
|
7458
7508
|
id: "requirements-verified",
|
|
7459
7509
|
label: "Requirements verified",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@radicaltools/cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"description": "Connect coding agents to Radical Markdown architecture models, check, diff and export them, and fuzz a project against them, from the command line.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://radical.tools",
|