@radicaltools/mcp 0.6.0 → 0.6.1

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.
@@ -31,7 +31,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
31
31
  var define_RADICAL_BUILD_default;
32
32
  var init_define_RADICAL_BUILD = __esm({
33
33
  "<define:__RADICAL_BUILD__>"() {
34
- define_RADICAL_BUILD_default = { version: "0.6.0", commit: "6b160c8", date: "2026-11-24", release: true };
34
+ define_RADICAL_BUILD_default = { version: "0.6.1", commit: "ce06b9e", date: "2026-11-27", release: true };
35
35
  }
36
36
  });
37
37
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_define_RADICAL_BUILD
3
- } from "./chunk-COZU3R23.js";
3
+ } from "./chunk-CKZSHFE5.js";
4
4
 
5
5
  // ../../packages/layout/src/elkLayout.ts
6
6
  init_define_RADICAL_BUILD();
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_define_RADICAL_BUILD
3
- } from "./chunk-COZU3R23.js";
3
+ } from "./chunk-CKZSHFE5.js";
4
4
 
5
5
  // ../../packages/assay/node_modules/unpdf/dist/index.mjs
6
6
  init_define_RADICAL_BUILD();
@@ -41,7 +41,7 @@ async function resolvePDFJSImports(pdfjsResolver, { force = false } = {}) {
41
41
  }
42
42
  }
43
43
  try {
44
- const { resolvePDFJS } = await import("./pdfjs-MDC5AZDP.js");
44
+ const { resolvePDFJS } = await import("./pdfjs-DDCLOUBH.js");
45
45
  resolvedModule = await resolvePDFJS();
46
46
  } catch (error) {
47
47
  console.error(error);
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  applyElkLayout,
3
3
  applyTreeLayout
4
- } from "./chunk-5N36X7LP.js";
5
- import "./chunk-COZU3R23.js";
4
+ } from "./chunk-H2EUPF2D.js";
5
+ import "./chunk-CKZSHFE5.js";
6
6
  export {
7
7
  applyElkLayout,
8
8
  applyTreeLayout
package/dist/index.js CHANGED
@@ -83,13 +83,13 @@ import {
83
83
  viewShowsEveryNode,
84
84
  wikiDepthOf,
85
85
  withCanvasPositions
86
- } from "./chunk-5N36X7LP.js";
86
+ } from "./chunk-H2EUPF2D.js";
87
87
  import {
88
88
  __commonJS,
89
89
  __toESM,
90
90
  define_RADICAL_BUILD_default,
91
91
  init_define_RADICAL_BUILD
92
- } from "./chunk-COZU3R23.js";
92
+ } from "./chunk-CKZSHFE5.js";
93
93
 
94
94
  // ../../node_modules/webcola/dist/src/powergraph.js
95
95
  var require_powergraph = __commonJS({
@@ -13841,7 +13841,8 @@ function testRule(outcome, message) {
13841
13841
  if (!model.tests) return [];
13842
13842
  return Object.values(model.nodes).filter((n) => TESTED_TYPES.includes(n.type)).flatMap((node) => testOutcomes(node, model).filter((o) => o.outcome === outcome).map((o) => {
13843
13843
  const related = failing ? affectedBy(model, node).map((n) => n.id) : [];
13844
- return { nodeId: node.id, message: message(node, o.id.raw, model), ...related.length ? { relatedIds: related } : {} };
13844
+ const reason = outcome === "failed" ? findTests(o.id, model.tests ?? []).matches.find((c) => c.status === "failed" && c.message)?.message : void 0;
13845
+ return { nodeId: node.id, test: o.id.raw, message: message(node, o.id.raw, model), ...reason ? { reason } : {}, ...related.length ? { relatedIds: related } : {} };
13845
13846
  }));
13846
13847
  };
13847
13848
  }
@@ -13864,6 +13865,9 @@ function metricRule(outcome, message) {
13864
13865
  const origin = originOf(node);
13865
13866
  return elements.flatMap((element) => elementConditions(node, model, element).filter((r) => r.outcome === outcome).map((r) => ({
13866
13867
  nodeId: origin ? element.id : node.id,
13868
+ condition: r.condition,
13869
+ ...r.measurement ? { measured: r.measurement } : {},
13870
+ ...r.detail ? { why: r.detail } : {},
13867
13871
  message: `${message(node, r.condition, seen(r), r.detail).replace(/\.$/, "")} for ${TYPE_NAME[element.type] ?? element.type} ${quote(element)}${origin ? ` (a fitness function of ${origin})` : ""}.`,
13868
13872
  ...origin ? { relatedIds: [node.id] } : outcome === "failed" ? { relatedIds: [element.id] } : {}
13869
13873
  })));
@@ -13871,7 +13875,14 @@ function metricRule(outcome, message) {
13871
13875
  const metricLines = new Set(conditionsOf(node).filter((c) => c.kind === "metric").map((c) => c.raw));
13872
13876
  return conditionResults(node, model).filter((r) => r.outcome === outcome && metricLines.has(r.condition)).map((r) => {
13873
13877
  const related = outcome === "failed" ? affectedBy(model, node).map((n) => n.id) : [];
13874
- return { nodeId: node.id, message: message(node, r.condition, seen(r), r.detail), ...related.length ? { relatedIds: related } : {} };
13878
+ return {
13879
+ nodeId: node.id,
13880
+ condition: r.condition,
13881
+ ...r.measurement ? { measured: r.measurement } : {},
13882
+ ...r.detail ? { why: r.detail } : {},
13883
+ message: message(node, r.condition, seen(r), r.detail),
13884
+ ...related.length ? { relatedIds: related } : {}
13885
+ };
13875
13886
  });
13876
13887
  });
13877
13888
  };
@@ -14082,7 +14093,7 @@ var sourceReading = (text3) => reading(text3.replace(/(\d)_(?=\d)/g, "$1").repla
14082
14093
  var CHECK_RULES = [
14083
14094
  {
14084
14095
  id: "metamodel",
14085
- description: 'The model follows its metamodel: types, parents, relation pairs, required properties, references and the state machine rules. The Validation list in Studio and get_issues over MCP, with their severities: an unknown type or a relation to no element is an error, a relation pair the metamodel does not allow a warning (`"metamodel": "error"` makes every issue one).',
14096
+ description: '**The model follows its metamodel**: types, parents, relation pairs, required properties, references and the state machine rules. The Validation list in Studio and get_issues over MCP, with their severities: an unknown type or a relation to no element is an error, a relation pair the metamodel does not allow a warning (`"metamodel": "error"` makes every issue one).',
14086
14097
  severity: "error",
14087
14098
  dimension: "consistency",
14088
14099
  run: (model) => validateModel(model.nodes, model.relations, model.metamodel).map((issue) => ({
@@ -14095,42 +14106,42 @@ var CHECK_RULES = [
14095
14106
  },
14096
14107
  {
14097
14108
  id: "requirement-incomplete",
14098
- description: "A requirement has an action and every field its EARS type reads (an event-driven one a trigger, a state-driven one a precondition, \u2026).",
14109
+ description: "**A requirement has an action and every field its EARS type reads** (an event-driven one a trigger, a state-driven one a precondition, \u2026).",
14099
14110
  severity: "warning",
14100
14111
  dimension: "completeness",
14101
14112
  run: (model) => nodesOf(model, "requirement").filter((n) => !composeEarsSentence(n, void 0, requirementStatePhrase(n, model.nodes, model.relations)).complete).map((n) => ({ nodeId: n.id, message: `Requirement ${quote(n)} (${prop2(n, "ears_type") || "ubiquitous"}) misses the action or a field its EARS type needs.` }))
14102
14113
  },
14103
14114
  {
14104
14115
  id: "requirement-without-scenario",
14105
- description: "Every requirement is verified by at least one scenario.",
14116
+ description: "**Every requirement is verified by at least one scenario**.",
14106
14117
  severity: "warning",
14107
14118
  dimension: "traceability",
14108
14119
  run: (model) => model.metamodel.nodeTypes.scenario ? unlinked(model, "requirement", "verifies", "in", ["scenario"]).map((n) => ({ nodeId: n.id, message: `No scenario verifies requirement ${quote(n)}.` })) : []
14109
14120
  },
14110
14121
  {
14111
14122
  id: "requirement-unsatisfied",
14112
- description: "Every requirement is satisfied by an element of the architecture.",
14123
+ description: "**Every requirement is satisfied by an element of the architecture**.",
14113
14124
  severity: "warning",
14114
14125
  dimension: "traceability",
14115
14126
  run: (model) => unlinked(model, "requirement", "satisfies", "in").map((n) => ({ nodeId: n.id, message: `Nothing satisfies requirement ${quote(n)}.` }))
14116
14127
  },
14117
14128
  {
14118
14129
  id: "requirement-without-origin",
14119
- description: "Every requirement derives from a need or from another requirement.",
14130
+ description: "**Every requirement derives from a need or from another requirement**.",
14120
14131
  severity: "warning",
14121
14132
  dimension: "traceability",
14122
14133
  run: (model) => unlinked(model, "requirement", "derives", "out", ["need", "requirement"]).map((n) => ({ nodeId: n.id, message: `Requirement ${quote(n)} derives from no need and no other requirement.` }))
14123
14134
  },
14124
14135
  {
14125
14136
  id: "need-without-requirement",
14126
- description: "Every need has at least one requirement derived from it, or from a need inside it (a need that derives from it, Part of).",
14137
+ description: "**Every need has at least one requirement derived from it**, or from a need inside it (a need that derives from it, Part of).",
14127
14138
  severity: "warning",
14128
14139
  dimension: "traceability",
14129
14140
  run: (model) => unlinked(model, "need", "derives", "in", ["requirement"]).filter((n) => !requirementsOfNeed(model, n.id).length).map((n) => ({ nodeId: n.id, message: `No requirement derives from need ${quote(n)}.` }))
14130
14141
  },
14131
14142
  {
14132
14143
  id: "derives-quote-missing",
14133
- description: "A requirement's derives relation to a need quotes the words of the need it rests on (property quote, one verbatim fragment per line). Off unless check.json turns it on; the goal requirements-quoting-need follows it in percent.",
14144
+ description: "A requirement's derives relation to a need **quotes the words of the need it rests on** (property quote, one verbatim fragment per line). Off unless check.json turns it on; the goal requirements-quoting-need follows it in percent.",
14134
14145
  severity: "warning",
14135
14146
  off: true,
14136
14147
  dimension: "traceability",
@@ -14138,7 +14149,7 @@ var CHECK_RULES = [
14138
14149
  },
14139
14150
  {
14140
14151
  id: "derives-quote-not-in-need",
14141
- description: "Every fragment a derives relation quotes is in the need's text outside its superseded answers, as whole words (case, white space, Markdown marks, dashes and quotation marks aside; an ellipsis joins pieces that must be there in that order, within one question, answer or the text before the questions), and holds at least two words; only a relation to a need quotes.",
14152
+ description: "**Every fragment a derives relation quotes is in the need's text** outside its superseded answers, as whole words (case, white space, Markdown marks, dashes and quotation marks aside; an ellipsis joins pieces that must be there in that order, within one question, answer or the text before the questions), and holds at least two words; only a relation to a need quotes.",
14142
14153
  severity: "error",
14143
14154
  dimension: "traceability",
14144
14155
  run: (model) => Object.values(model.relations).filter((r) => r.relationType === "derives" && relationQuote(r).trim() && model.nodes[r.sourceId]?.type === "requirement" && !originOf(model.nodes[r.sourceId])).flatMap((r) => {
@@ -14153,7 +14164,7 @@ var CHECK_RULES = [
14153
14164
  },
14154
14165
  {
14155
14166
  id: "quote-value-missing",
14156
- description: "Every hard value a derives relation quotes (a number, null, true or false, a date or time, an identifier in backticks or quotation marks) is in the requirement's sentence, in that form or another (20 percent as 20%, 15 minutes as 900 seconds, 12.30 \u20AC as 1230 cents).",
14167
+ description: "**Every hard value a derives relation quotes** (a number, null, true or false, a date or time, an identifier in backticks or quotation marks) **is in the requirement's sentence**, in that form or another (20 percent as 20%, 15 minutes as 900 seconds, 12.30 \u20AC as 1230 cents).",
14157
14168
  severity: "warning",
14158
14169
  dimension: "traceability",
14159
14170
  run: (model) => nodesOf(model, "requirement").filter((n) => !originOf(n)).flatMap((req) => {
@@ -14164,14 +14175,14 @@ var CHECK_RULES = [
14164
14175
  },
14165
14176
  {
14166
14177
  id: "quote-value-differs",
14167
- description: "A requirement keeps the sense the words it quotes give a value: the same side of a limit (at most, more than, from \u2026 to; a refusal speaks of the other side), the same unit, the same order of a list, the same rounding.",
14178
+ description: "**A requirement keeps the sense the words it quotes give a value**: the same side of a limit (at most, more than, from \u2026 to; a refusal speaks of the other side), the same unit, the same order of a list, the same rounding.",
14168
14179
  severity: "warning",
14169
14180
  dimension: "traceability",
14170
14181
  run: (model) => nodesOf(model, "requirement").filter((n) => !originOf(n)).flatMap((req) => quoteSenseGaps(model, req))
14171
14182
  },
14172
14183
  {
14173
14184
  id: "requirement-value-unquoted",
14174
- description: "Every hard value a requirement states that quotes its need is in those quotes (or in those of the requirements it derives from), in that form or another, or its rationale names it as a decision of the model.",
14185
+ description: "**Every hard value a requirement states that quotes its need is in those quotes** (or in those of the requirements it derives from), in that form or another, or its rationale names it as a decision of the model.",
14175
14186
  severity: "warning",
14176
14187
  dimension: "traceability",
14177
14188
  run: (model) => nodesOf(model, "requirement").filter((n) => !originOf(n)).flatMap((req) => {
@@ -14181,7 +14192,7 @@ var CHECK_RULES = [
14181
14192
  },
14182
14193
  {
14183
14194
  id: "scenario-value-missing",
14184
- description: "Every hard value a requirement takes from the words it quotes is in a scenario that verifies it (its given, when, then or Gherkin text): what the person said reaches a check.",
14195
+ description: "**Every hard value a requirement takes from the words it quotes is in a scenario that verifies it** (its given, when, then or Gherkin text): what the person said reaches a check.",
14185
14196
  severity: "warning",
14186
14197
  dimension: "traceability",
14187
14198
  run: (model) => nodesOf(model, "requirement").filter((n) => !originOf(n)).flatMap((req) => {
@@ -14198,7 +14209,7 @@ var CHECK_RULES = [
14198
14209
  },
14199
14210
  {
14200
14211
  id: "example-not-in-scenario",
14201
- description: `Every example a need gives with values ("for example", "e.g.", "Example:") is whole in one scenario of the requirements derived from the need: the person's own case checks what they meant.`,
14212
+ description: `**Every example a need gives with values** ("for example", "e.g.", "Example:") **is whole in one scenario** of the requirements derived from the need: the person's own case checks what they meant.`,
14202
14213
  severity: "warning",
14203
14214
  dimension: "traceability",
14204
14215
  run: (model) => nodesOf(model, "need").filter((n) => !originOf(n)).flatMap((need) => {
@@ -14216,7 +14227,7 @@ var CHECK_RULES = [
14216
14227
  },
14217
14228
  {
14218
14229
  id: "scenario-value-untested",
14219
- 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.",
14230
+ 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**.",
14220
14231
  severity: "warning",
14221
14232
  dimension: "traceability",
14222
14233
  run: (model) => {
@@ -14236,7 +14247,7 @@ var CHECK_RULES = [
14236
14247
  },
14237
14248
  {
14238
14249
  id: "need-answer-unquoted",
14239
- description: "Every paragraph and list item of an answer of a person in a need (from a line that starts with A:, Answer: or A1:, or an answer on its question's line; lead-ins and lines of fewer than four words aside) is quoted by a requirement that derives from the need, or the answer is marked (no requirement) or (superseded).",
14250
+ description: "**Every paragraph and list item of an answer of a person in a need** (from a line that starts with A:, Answer: or A1:, or an answer on its question's line; lead-ins and lines of fewer than four words aside) **is quoted by a requirement that derives from the need**, or the answer is marked (no requirement) or (superseded).",
14240
14251
  severity: "warning",
14241
14252
  dimension: "traceability",
14242
14253
  run: (model) => {
@@ -14254,7 +14265,7 @@ var CHECK_RULES = [
14254
14265
  },
14255
14266
  {
14256
14267
  id: "need-answer-changed",
14257
- description: "With the model at the base (radical check in git, the Inspector with the branch's base): every answer of a person a need held there it still holds, word for word; a person's words are only added to, and an answer a later one replaces is marked (superseded).",
14268
+ description: "With the model at the base (radical check in git, the Inspector with the branch's base): **every answer of a person a need held there it still holds, word for word**; a person's words are only added to, and an answer a later one replaces is marked (superseded).",
14258
14269
  severity: "error",
14259
14270
  dimension: "traceability",
14260
14271
  run: (model) => {
@@ -14268,21 +14279,21 @@ var CHECK_RULES = [
14268
14279
  },
14269
14280
  {
14270
14281
  id: "scenario-verifies-nothing",
14271
- description: "Every scenario verifies a requirement or a state machine.",
14282
+ description: "**Every scenario verifies a requirement or a state machine**.",
14272
14283
  severity: "warning",
14273
14284
  dimension: "traceability",
14274
14285
  run: (model) => unlinked(model, "scenario", "verifies", "out").map((n) => ({ nodeId: n.id, message: `Scenario ${quote(n)} verifies no requirement and no state machine.` }))
14275
14286
  },
14276
14287
  {
14277
14288
  id: "adr-without-fitness-fn",
14278
- description: "Every accepted ADR is implemented by a fitness function that checks it.",
14289
+ description: "**Every accepted ADR is implemented by a fitness function** that checks it.",
14279
14290
  severity: "warning",
14280
14291
  dimension: "decisions",
14281
14292
  run: (model) => model.metamodel.nodeTypes["fitness-fn"] ? unlinked(model, "adr", "implements", "in", ["fitness-fn"]).filter((n) => prop2(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)}.` })) : []
14282
14293
  },
14283
14294
  {
14284
14295
  id: "inherited-adr-unapplied",
14285
- description: "Every accepted ADR of a model this one depends on (deps.json) binds it: it constrains at least one of this model's elements, or an accepted ADR of this model waives it and says why.",
14296
+ description: "**Every accepted ADR of a model this one depends on** (deps.json) **binds it**: it constrains at least one of this model's elements, or an accepted ADR of this model waives it and says why.",
14286
14297
  severity: "error",
14287
14298
  dimension: "decisions",
14288
14299
  run: (model) => inheritedDecisions(model).filter((d) => !d.elements.length).map(({ adr, origin }) => ({
@@ -14292,7 +14303,7 @@ var CHECK_RULES = [
14292
14303
  },
14293
14304
  {
14294
14305
  id: "inherited-adr-unchecked",
14295
- description: "Every element an accepted ADR of a model this one depends on constrains is checked: a fitness function implements the ADR (this model's or the other's) and names its check (metric conditions, or tests .radical/radical.json binds to it).",
14306
+ description: "**Every element an accepted ADR of a model this one depends on constrains is checked**: a fitness function implements the ADR (this model's or the other's) and names its check (metric conditions, or tests .radical/radical.json binds to it).",
14296
14307
  severity: "error",
14297
14308
  dimension: "decisions",
14298
14309
  run: (model) => inheritedDecisions(model).flatMap(({ adr, origin, elements }) => {
@@ -14306,7 +14317,7 @@ var CHECK_RULES = [
14306
14317
  },
14307
14318
  {
14308
14319
  id: "adr-incomplete",
14309
- description: "An accepted ADR records its date, context, decision and consequences.",
14320
+ description: "**An accepted ADR records its date, context, decision and consequences**.",
14310
14321
  severity: "warning",
14311
14322
  dimension: "completeness",
14312
14323
  run: (model) => nodesOf(model, "adr").filter((n) => prop2(n, "status") === "accepted").flatMap((n) => {
@@ -14316,7 +14327,7 @@ var CHECK_RULES = [
14316
14327
  },
14317
14328
  {
14318
14329
  id: "adr-superseded-unlinked",
14319
- description: "An ADR is superseded exactly when a newer ADR supersedes it.",
14330
+ description: "**An ADR is superseded exactly when a newer ADR supersedes it**.",
14320
14331
  severity: "warning",
14321
14332
  dimension: "consistency",
14322
14333
  run: (model) => {
@@ -14333,7 +14344,7 @@ var CHECK_RULES = [
14333
14344
  },
14334
14345
  {
14335
14346
  id: "fitness-fn-unlinked",
14336
- description: "Every fitness function implements an ADR or constrains an element.",
14347
+ description: "**Every fitness function implements an ADR or constrains an element**.",
14337
14348
  severity: "warning",
14338
14349
  dimension: "decisions",
14339
14350
  run: (model) => {
@@ -14344,7 +14355,7 @@ var CHECK_RULES = [
14344
14355
  },
14345
14356
  {
14346
14357
  id: "concern-unaddressed",
14347
- description: "Every concern a Hub concern pack finds in the model is settled by an accepted ADR marked with it (property `concern`) that constrains the elements it applies to, or what contains them.",
14358
+ description: "**Every concern a Hub concern pack finds in the model is settled by an accepted ADR marked with it** (property `concern`) that constrains the elements it applies to, or what contains them.",
14348
14359
  severity: "warning",
14349
14360
  dimension: "decisions",
14350
14361
  run: (model) => openConcerns(model.concerns ?? [], model.nodes, model.relations, model.metamodel).map(({ pack, open, pending }) => {
@@ -14361,7 +14372,7 @@ var CHECK_RULES = [
14361
14372
  },
14362
14373
  {
14363
14374
  id: "concern-unbound",
14364
- description: "Every accepted ADR marked with a concern (property `concern`, set by a Hub concern pack) constrains the elements it settles the concern for.",
14375
+ description: "**Every accepted ADR marked with a concern** (property `concern`, set by a Hub concern pack) **constrains the elements it settles the concern for**.",
14365
14376
  severity: "warning",
14366
14377
  dimension: "decisions",
14367
14378
  run: (model) => unboundDecisions(model.concerns ?? [], model.nodes, model.relations, model.metamodel).map(({ adr, concern, checks, bindTo }) => ({
@@ -14373,21 +14384,21 @@ var CHECK_RULES = [
14373
14384
  },
14374
14385
  {
14375
14386
  id: "scenario-without-metrics",
14376
- 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.",
14387
+ 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.",
14377
14388
  severity: "warning",
14378
14389
  dimension: "traceability",
14379
14390
  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.` }))
14380
14391
  },
14381
14392
  {
14382
14393
  id: "scenario-not-verified-here",
14383
- 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.",
14394
+ 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**.",
14384
14395
  severity: "warning",
14385
14396
  dimension: "traceability",
14386
14397
  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>".` }))
14387
14398
  },
14388
14399
  {
14389
14400
  id: "model-names-tests",
14390
- description: "A scenario or fitness function names no test in its Metrics: the repository binds its tests in .radical/radical.json (radical setup moves them there). A test named in Metrics still counts.",
14401
+ description: "**A scenario or fitness function names no test in its Metrics**: the repository binds its tests in .radical/radical.json (radical setup moves them there). A test named in Metrics still counts.",
14391
14402
  severity: "warning",
14392
14403
  dimension: "traceability",
14393
14404
  run: (model) => Object.values(model.nodes).filter((n) => TESTED_TYPES.includes(n.type) && !originOf(n)).flatMap((n) => {
@@ -14397,14 +14408,14 @@ var CHECK_RULES = [
14397
14408
  },
14398
14409
  {
14399
14410
  id: "fitness-fn-without-metrics",
14400
- description: "Every fitness function states what checks it and when it passes (property `metrics`, one condition per line).",
14411
+ description: "**Every fitness function states what checks it and when it passes** (property `metrics`, one condition per line).",
14401
14412
  severity: "warning",
14402
14413
  dimension: "decisions",
14403
14414
  run: (model) => nodesOf(model, "fitness-fn").filter((n) => !conditionsOf(n).length).map((n) => ({ nodeId: n.id, message: `Fitness function ${quote(n)} names no check.` }))
14404
14415
  },
14405
14416
  {
14406
14417
  id: "fitness-fn-unclassified",
14407
- description: "Every fitness function states its characteristic (ISO/IEC 25010), scope, cadence (with the event it is triggered on, or how often a temporal one falls due) and invocation.",
14418
+ description: "**Every fitness function states its characteristic** (ISO/IEC 25010), scope, cadence (with the event it is triggered on, or how often a temporal one falls due) and invocation.",
14408
14419
  severity: "warning",
14409
14420
  dimension: "decisions",
14410
14421
  run: (model) => nodesOf(model, "fitness-fn").flatMap((n) => {
@@ -14417,7 +14428,7 @@ var CHECK_RULES = [
14417
14428
  },
14418
14429
  {
14419
14430
  id: "fitness-fn-measure-invalid",
14420
- description: `Every line of a fitness function's \`measure\` names a sensor of radical sense (${SENSOR_NAMES.join(", ")}) or, run by the CLI, one of the repository's .radical/sensors/sensors.json.`,
14431
+ description: `**Every line of a fitness function's \`measure\` names a sensor** of radical sense (${SENSOR_NAMES.join(", ")}) or, run by the CLI, one of the repository's .radical/sensors/sensors.json.`,
14421
14432
  severity: "error",
14422
14433
  dimension: "completeness",
14423
14434
  run: (model) => model.sensors === void 0 ? [] : nodesOf(model, "fitness-fn").flatMap((n) => parseMeasure(n.measure).filter((line) => !isSensorName(line.sensor) && !model.sensors?.names.includes(line.sensor)).map((line) => ({
@@ -14427,14 +14438,14 @@ var CHECK_RULES = [
14427
14438
  },
14428
14439
  {
14429
14440
  id: "repository-mapping",
14430
- description: "With the repository's .radical/radical.json (the CLI): each entry names an element of the model, its own or another model's of the federation, under the element's name, with paths the repository has; tests are bound to scenarios and fitness functions.",
14441
+ description: "With the repository's .radical/radical.json (the CLI): **each entry names an element of the model**, its own or another model's of the federation, under the element's name, with paths the repository has; tests are bound to scenarios and fitness functions.",
14431
14442
  severity: "warning",
14432
14443
  dimension: "traceability",
14433
14444
  run: repositoryMapping
14434
14445
  },
14435
14446
  {
14436
14447
  id: "repository-settings-in-model",
14437
- description: `The model's check.json holds the model's rules and goals; the repository's test files (test-unbound's include and exclude) and CI's artifacts belong in .radical/radical.json ("tests", "ci"). Those in check.json are still read.`,
14448
+ description: `The model's check.json holds the model's rules and goals; **the repository's test files** (test-unbound's include and exclude) and CI's artifacts **belong in .radical/radical.json** ("tests", "ci"). Those in check.json are still read.`,
14438
14449
  severity: "warning",
14439
14450
  dimension: "completeness",
14440
14451
  run: (model) => (model.settingsInModel ?? []).map((what) => ({
@@ -14444,7 +14455,7 @@ var CHECK_RULES = [
14444
14455
  },
14445
14456
  {
14446
14457
  id: "description-path-missing",
14447
- description: "With the repository (the CLI): a path from the repository's root an element's description names (apps/cli/src/sense.ts) is in the repository; one that is gone tells of code that moved.",
14458
+ description: "With the repository (the CLI): **a path from the repository's root an element's description names** (apps/cli/src/sense.ts) **is in the repository**; one that is gone tells of code that moved.",
14448
14459
  severity: "warning",
14449
14460
  dimension: "consistency",
14450
14461
  run: (model) => Object.entries(model.missingPaths ?? {}).flatMap(([id, paths]) => {
@@ -14454,21 +14465,21 @@ var CHECK_RULES = [
14454
14465
  },
14455
14466
  {
14456
14467
  id: "measure-with-arguments",
14457
- description: `A fitness function's measure lines name sensors only: an adapter's arguments (files, options of the repository) belong to a sensor of .radical/sensors/sensors.json ({ "adapter": "playwright", "args": [...] }). A line with arguments still runs.`,
14468
+ description: `**A fitness function's measure lines name sensors only**: an adapter's arguments (files, options of the repository) belong to a sensor of .radical/sensors/sensors.json ({ "adapter": "playwright", "args": [...] }). A line with arguments still runs.`,
14458
14469
  severity: "warning",
14459
14470
  dimension: "completeness",
14460
14471
  run: (model) => nodesOf(model, "fitness-fn").flatMap((n) => parseMeasure(n.measure).filter((line) => line.args.length > 0).map((line) => ({ nodeId: n.id, message: `Fitness function ${quote(n)}: measure "${line.raw}" has the repository's arguments; name a sensor of .radical/sensors/sensors.json that holds them ({ "adapter": "${line.sensor}", "args": [...] }).` })))
14461
14472
  },
14462
14473
  {
14463
14474
  id: "metric-invalid",
14464
- description: "Every line of a scenario's or fitness function's `metrics` reads as a condition, its unit converts to the unit of the measurement it matches, and `combine` and `max_age` read.",
14475
+ description: "**Every line of a scenario's or fitness function's `metrics` reads as a condition**, its unit converts to the unit of the measurement it matches, and `combine` and `max_age` read.",
14465
14476
  severity: "error",
14466
14477
  dimension: "completeness",
14467
14478
  run: invalidChecks
14468
14479
  },
14469
14480
  {
14470
14481
  id: "test-failed",
14471
- description: "With --report: every test a scenario or fitness function names passed.",
14482
+ description: "With --report: **every test a scenario or fitness function names passed**.",
14472
14483
  severity: "error",
14473
14484
  dimension: "tests",
14474
14485
  readsReports: true,
@@ -14476,7 +14487,7 @@ var CHECK_RULES = [
14476
14487
  },
14477
14488
  {
14478
14489
  id: "test-not-found",
14479
- description: "With --report: every test a scenario or fitness function names is in the report of its file (a renamed or deleted test is not).",
14490
+ description: "With --report: **every test a scenario or fitness function names is in the report of its file** (a renamed or deleted test is not).",
14480
14491
  severity: "error",
14481
14492
  dimension: "tests",
14482
14493
  readsReports: true,
@@ -14484,7 +14495,7 @@ var CHECK_RULES = [
14484
14495
  },
14485
14496
  {
14486
14497
  id: "test-skipped",
14487
- description: "With --report: no test a scenario or fitness function names was skipped.",
14498
+ description: "With --report: **no test a scenario or fitness function names was skipped**.",
14488
14499
  severity: "warning",
14489
14500
  dimension: "tests",
14490
14501
  readsReports: true,
@@ -14492,15 +14503,15 @@ var CHECK_RULES = [
14492
14503
  },
14493
14504
  {
14494
14505
  id: "test-not-run",
14495
- description: "With --report: every file a scenario or fitness function names a test in is in the reports.",
14506
+ description: "With --report: **every file a scenario or fitness function names a test in is in the reports**.",
14496
14507
  severity: "warning",
14497
14508
  dimension: "tests",
14498
14509
  readsReports: true,
14499
- run: testRule("not-run", (node, id) => `${testedName(node)}: no report has the file of test ${id}.`)
14510
+ run: testRule("not-run", (node, id) => `${testedName(node)}: test ${id} did not run: no report has its file.`)
14500
14511
  },
14501
14512
  {
14502
14513
  id: "metric-failed",
14503
- description: "With measurements: every metric condition a scenario or fitness function states holds for the latest measurement it matches.",
14514
+ description: "With measurements: **every metric condition a scenario or fitness function states holds** for the latest measurement it matches.",
14504
14515
  severity: "error",
14505
14516
  dimension: "tests",
14506
14517
  readsMeasurements: true,
@@ -14508,7 +14519,7 @@ var CHECK_RULES = [
14508
14519
  },
14509
14520
  {
14510
14521
  id: "metric-stale",
14511
- description: "With measurements: the latest measurement each metric condition matches is no older than the element's max_age (a stale one never passes).",
14522
+ description: "With measurements: **the latest measurement each metric condition matches is no older than the element's max_age** (a stale one never passes).",
14512
14523
  severity: "warning",
14513
14524
  dimension: "tests",
14514
14525
  readsMeasurements: true,
@@ -14516,7 +14527,7 @@ var CHECK_RULES = [
14516
14527
  },
14517
14528
  {
14518
14529
  id: "metric-not-measured",
14519
- description: "With measurements: a measurement matches every metric condition a scenario or fitness function states.",
14530
+ description: "With measurements: **a measurement matches every metric condition a scenario or fitness function states**.",
14520
14531
  severity: "warning",
14521
14532
  dimension: "tests",
14522
14533
  readsMeasurements: true,
@@ -14524,7 +14535,7 @@ var CHECK_RULES = [
14524
14535
  },
14525
14536
  {
14526
14537
  id: "test-unbound",
14527
- description: "With --report and an include in check.json: every test in the files it includes is named by a scenario or a fitness function, by its title or its describe block (a whole file or directory does not count). One finding per test file.",
14538
+ description: "With --report and an include in check.json: **every test in the files it includes is named by a scenario or a fitness function**, by its title or its describe block (a whole file or directory does not count). One finding per test file.",
14528
14539
  severity: "warning",
14529
14540
  dimension: "tests",
14530
14541
  readsReports: true,
@@ -14568,7 +14579,7 @@ function wordFindings(model, off = /* @__PURE__ */ new Set()) {
14568
14579
  init_define_RADICAL_BUILD();
14569
14580
  var ADOPT_RULE = {
14570
14581
  id: "baselines-pending",
14571
- description: 'check.json does not wait for the baselines of its first run ("adopt": true); radical check --adopt takes them once.',
14582
+ description: '**check.json does not wait for the baselines of its first run** ("adopt": true); radical check --adopt takes them once.',
14572
14583
  severity: "error",
14573
14584
  dimension: "consistency"
14574
14585
  };
@@ -14589,7 +14600,7 @@ function existingCodeCheckConfig(ruleIds) {
14589
14600
  init_define_RADICAL_BUILD();
14590
14601
  var GOAL_RULE = {
14591
14602
  id: "goal-unmet",
14592
- description: 'Every metric check.json sets a goal for ("goals": { "<metric>": { "min": <percent> } }) reaches it. One finding per goal, with the metric as its code.',
14603
+ description: '**Every metric check.json sets a goal for** ("goals": { "<metric>": { "min": <percent> } }) **reaches it**. One finding per goal, with the metric as its code.',
14593
14604
  severity: "error"
14594
14605
  };
14595
14606
  var without = (rule) => (population) => (ctx) => {
@@ -14698,6 +14709,7 @@ init_define_RADICAL_BUILD();
14698
14709
  var CHECK_CONFIG_FILE = "check.json";
14699
14710
  var TEST_RESULTS_FILE = `${STATE_DIR}/test-results.json`;
14700
14711
  var MEASUREMENTS_FILE = `${STATE_DIR}/measurements.json`;
14712
+ var CI_FETCH_FILE = `${STATE_DIR}/ci-fetch.json`;
14701
14713
  function testsRanAt(results) {
14702
14714
  const runs = results.ci?.runs.map((r) => r.ranAt).filter((at) => !Number.isNaN(Date.parse(at))).sort() ?? [];
14703
14715
  return runs.length ? runs[runs.length - 1] : results.readAt;
@@ -14706,7 +14718,7 @@ function ciSourceOf(value) {
14706
14718
  const ci = value;
14707
14719
  if (!ci || ci.provider !== "github" || typeof ci.commit !== "string" || typeof ci.behind !== "number" || !Array.isArray(ci.runs)) return void 0;
14708
14720
  const runs = ci.runs.filter((r) => !!r && typeof r.id === "number" && typeof r.url === "string" && typeof r.sha === "string" && typeof r.ranAt === "string" && typeof r.workflow === "string" && Array.isArray(r.artifacts));
14709
- return { provider: "github", commit: ci.commit, behind: ci.behind, runs };
14721
+ return { provider: "github", commit: ci.commit, behind: ci.behind, runs, ...typeof ci.measurements === "number" ? { measurements: ci.measurements } : {} };
14710
14722
  }
14711
14723
  var STATUSES = /* @__PURE__ */ new Set(["passed", "failed", "skipped"]);
14712
14724
  function parseTestResults(text3) {
@@ -14720,13 +14732,16 @@ function parseTestResults(text3) {
14720
14732
  if (r?.version !== 1 || typeof r.readAt !== "string" || !Array.isArray(r.cases)) return null;
14721
14733
  const cases = r.cases.filter((c) => !!c && typeof c.file === "string" && Array.isArray(c.title) && c.title.every((t) => typeof t === "string") && STATUSES.has(c.status));
14722
14734
  const ci = ciSourceOf(r.ci);
14735
+ const k = r.kept;
14736
+ const kept2 = k && typeof k.since === "string" && typeof k.cases === "number" && typeof k.files === "number" ? { since: k.since, cases: k.cases, files: k.files } : void 0;
14723
14737
  return {
14724
14738
  version: 1,
14725
14739
  readAt: r.readAt,
14726
14740
  reports: Array.isArray(r.reports) ? r.reports.filter((x) => typeof x === "string") : [],
14727
14741
  cases,
14728
14742
  ...typeof r.commit === "string" ? { commit: r.commit } : {},
14729
- ...ci ? { ci } : {}
14743
+ ...ci ? { ci } : {},
14744
+ ...kept2 ? { kept: kept2 } : {}
14730
14745
  };
14731
14746
  }
14732
14747
  function parseCheckConfig(text3) {
@@ -14919,17 +14934,20 @@ init_define_RADICAL_BUILD();
14919
14934
  // ../../packages/common/src/check/format.ts
14920
14935
  init_define_RADICAL_BUILD();
14921
14936
 
14937
+ // ../../packages/common/src/check/findingWords.ts
14938
+ init_define_RADICAL_BUILD();
14939
+
14922
14940
  // ../../packages/common/src/check/configChanges.ts
14923
14941
  init_define_RADICAL_BUILD();
14924
14942
 
14925
14943
  // ../../packages/common/src/check/index.ts
14926
14944
  var FOLDER_RULES = [
14927
- { id: "folder-manifest", description: "The folder has a radical.md manifest of the Markdown-folder format, version 1.", severity: "error", dimension: "consistency" },
14928
- { id: "folder-json", description: "Every JSON sidecar (relations.json, views.json, \u2026) parses.", severity: "error", dimension: "consistency" },
14929
- { id: "folder-conflict", description: "No node file holds git conflict markers.", severity: "error", dimension: "consistency" },
14930
- { id: "folder-not-a-node", description: "A node file with frontmatter has an id and a type (one without them is skipped on loading, and its element is gone).", severity: "error", dimension: "consistency" },
14931
- { id: "folder-duplicate-id", description: "No two node files hold the same id.", severity: "error", dimension: "consistency" },
14932
- { id: "stale-reference", description: "Views, sequences and slides point only at elements, relations and views the model has.", severity: "warning", dimension: "consistency" }
14945
+ { id: "folder-manifest", description: "**The folder has a radical.md manifest** of the Markdown-folder format, version 1.", severity: "error", dimension: "consistency" },
14946
+ { id: "folder-json", description: "**Every JSON sidecar** (relations.json, views.json, \u2026) **parses**.", severity: "error", dimension: "consistency" },
14947
+ { id: "folder-conflict", description: "**No node file holds git conflict markers**.", severity: "error", dimension: "consistency" },
14948
+ { id: "folder-not-a-node", description: "**A node file with frontmatter has an id and a type** (one without them is skipped on loading, and its element is gone).", severity: "error", dimension: "consistency" },
14949
+ { id: "folder-duplicate-id", description: "**No two node files hold the same id**.", severity: "error", dimension: "consistency" },
14950
+ { id: "stale-reference", description: "**Views, sequences and slides point only at elements, relations and views the model has**.", severity: "warning", dimension: "consistency" }
14933
14951
  ];
14934
14952
  var STALE_REFERENCE = "stale-reference";
14935
14953
  var MODEL_RULE_IDS = /* @__PURE__ */ new Set([STALE_REFERENCE, ...CHECK_RULES.map((r) => r.id), GOAL_RULE.id, ADOPT_RULE.id]);
@@ -22641,7 +22659,7 @@ function unchangedResult(nodes, relations, style = "curved") {
22641
22659
  }
22642
22660
  async function runSmartLayoutELKPhase(inputNodes, inputRelations, metamodel, onProgress) {
22643
22661
  const { nodes, relations } = projectToVisibleGraph(inputNodes, inputRelations);
22644
- const { applyElkLayout } = await import("./elkLayout-EA73VLB2.js");
22662
+ const { applyElkLayout } = await import("./elkLayout-7MVDIEFO.js");
22645
22663
  const depth2 = maxContainmentDepth(metamodel);
22646
22664
  const mmDirection = depth2 >= 2 ? "RIGHT" : "DOWN";
22647
22665
  const engines = [
@@ -30651,7 +30669,7 @@ function htmlToMarkdown(html) {
30651
30669
  `;
30652
30670
  }
30653
30671
  async function pdfText(bytes) {
30654
- const { extractText, getDocumentProxy } = await import("./dist-4A76JBX4.js");
30672
+ const { extractText, getDocumentProxy } = await import("./dist-3IBN4PU7.js");
30655
30673
  let timer2;
30656
30674
  const late = new Promise((_, fail3) => {
30657
30675
  timer2 = setTimeout(() => fail3(new Error(`not read within ${PDF_TIMEOUT / 1e3} s`)), PDF_TIMEOUT);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_define_RADICAL_BUILD
3
- } from "./chunk-COZU3R23.js";
3
+ } from "./chunk-CKZSHFE5.js";
4
4
 
5
5
  // ../../packages/assay/node_modules/unpdf/dist/pdfjs.mjs
6
6
  init_define_RADICAL_BUILD();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radicaltools/mcp",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Local MCP server for Radical Markdown model folders.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://radical.tools",