@radicaltools/cli 0.2.0 → 0.3.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.
Files changed (57) hide show
  1. package/README.md +353 -33
  2. package/dist/hub-catalogue/concern/concern-api-collections.radical +1136 -0
  3. package/dist/hub-catalogue/concern/concern-api-errors.radical +1180 -0
  4. package/dist/hub-catalogue/concern/concern-api-evolution.radical +1174 -0
  5. package/dist/hub-catalogue/concern/concern-api-idempotency.radical +1218 -0
  6. package/dist/hub-catalogue/concern/concern-api-resource-design.radical +1102 -0
  7. package/dist/hub-catalogue/concern/concern-api-style-guide.radical +1210 -0
  8. package/dist/hub-catalogue/concern/concern-architecture-style.radical +1268 -0
  9. package/dist/hub-catalogue/concern/concern-audit-trail.radical +1096 -0
  10. package/dist/hub-catalogue/concern/concern-authentication.radical +895 -0
  11. package/dist/hub-catalogue/concern/concern-authorization.radical +1686 -0
  12. package/dist/hub-catalogue/concern/concern-availability.radical +1028 -0
  13. package/dist/hub-catalogue/concern/concern-backend-stack.radical +1037 -0
  14. package/dist/hub-catalogue/concern/concern-backup-recovery.radical +1560 -0
  15. package/dist/hub-catalogue/concern/concern-caching.radical +1294 -0
  16. package/dist/hub-catalogue/concern/concern-capacity.radical +915 -0
  17. package/dist/hub-catalogue/concern/concern-code-documentation.radical +1397 -0
  18. package/dist/hub-catalogue/concern/concern-code-quality-gate.radical +1409 -0
  19. package/dist/hub-catalogue/concern/concern-code-review-branching.radical +1416 -0
  20. package/dist/hub-catalogue/concern/concern-code-style.radical +1058 -0
  21. package/dist/hub-catalogue/concern/concern-communication-style.radical +1508 -0
  22. package/dist/hub-catalogue/concern/concern-data-classification.radical +970 -0
  23. package/dist/hub-catalogue/concern/concern-data-consistency.radical +1112 -0
  24. package/dist/hub-catalogue/concern/concern-data-store.radical +1282 -0
  25. package/dist/hub-catalogue/concern/concern-decomposition.radical +1318 -0
  26. package/dist/hub-catalogue/concern/concern-definition-of-done.radical +1214 -0
  27. package/dist/hub-catalogue/concern/concern-delivery-metrics.radical +966 -0
  28. package/dist/hub-catalogue/concern/concern-dependency-hygiene.radical +1345 -0
  29. package/dist/hub-catalogue/concern/concern-deployment.radical +1203 -0
  30. package/dist/hub-catalogue/concern/concern-encryption.radical +1318 -0
  31. package/dist/hub-catalogue/concern/concern-error-handling-logging.radical +1197 -0
  32. package/dist/hub-catalogue/concern/concern-eu-dora.radical +1321 -0
  33. package/dist/hub-catalogue/concern/concern-frontend-stack.radical +1647 -0
  34. package/dist/hub-catalogue/concern/concern-incident-management.radical +1204 -0
  35. package/dist/hub-catalogue/concern/concern-infrastructure.radical +2183 -0
  36. package/dist/hub-catalogue/concern/concern-integration-resilience.radical +1116 -0
  37. package/dist/hub-catalogue/concern/concern-messaging.radical +973 -0
  38. package/dist/hub-catalogue/concern/concern-module-boundaries.radical +867 -0
  39. package/dist/hub-catalogue/concern/concern-observability.radical +997 -0
  40. package/dist/hub-catalogue/concern/concern-operational-readiness.radical +1249 -0
  41. package/dist/hub-catalogue/concern/concern-personal-data.radical +1949 -0
  42. package/dist/hub-catalogue/concern/concern-quality-priorities.radical +1091 -0
  43. package/dist/hub-catalogue/concern/concern-rate-limiting.radical +1445 -0
  44. package/dist/hub-catalogue/concern/concern-release-versioning.radical +1358 -0
  45. package/dist/hub-catalogue/concern/concern-retention.radical +1399 -0
  46. package/dist/hub-catalogue/concern/concern-secrets.radical +1284 -0
  47. package/dist/hub-catalogue/concern/concern-secure-coding.radical +1379 -0
  48. package/dist/hub-catalogue/concern/concern-secure-development.radical +1245 -0
  49. package/dist/hub-catalogue/concern/concern-security-detection.radical +1153 -0
  50. package/dist/hub-catalogue/concern/concern-supply-chain.radical +1386 -0
  51. package/dist/hub-catalogue/concern/concern-technical-debt.radical +1450 -0
  52. package/dist/hub-catalogue/concern/concern-technology-lifecycle.radical +1145 -0
  53. package/dist/hub-catalogue/concern/concern-tenant-isolation.radical +1440 -0
  54. package/dist/hub-catalogue/concern/concern-test-strategy.radical +1212 -0
  55. package/dist/hub-catalogue/concern/concern-threat-modelling.radical +1143 -0
  56. package/dist/index.js +12712 -7144
  57. package/package.json +5 -3
@@ -0,0 +1,867 @@
1
+ {
2
+ "hub": {
3
+ "id": "concern-module-boundaries",
4
+ "category": "concern",
5
+ "name": "Module boundaries",
6
+ "description": "Keeping the parts of the code apart: which part may depend on which, through what, with no cycles; what they may share; and how the build enforces it on the code there is today. The snippets are TypeScript with dependency-cruiser; each tool line names the JVM, .NET and Python equivalent.",
7
+ "tags": [
8
+ "maintainability",
9
+ "modularity",
10
+ "dependencies",
11
+ "architecture rules",
12
+ "cycles",
13
+ "shared kernel"
14
+ ],
15
+ "requiredMetamodel": "c4-ddd-governance-builtin",
16
+ "concern": {
17
+ "id": "module-boundaries",
18
+ "trigger": "LIST NODES WHERE (type = \"container\" OR type = \"webapp\") AND external != true",
19
+ "why": "code lives in these elements, so which of its parts may depend on which, and how the build keeps it that way, has to be decided.",
20
+ "group": "architecture"
21
+ },
22
+ "sources": [
23
+ {
24
+ "title": "ISO/IEC 25010, Maintainability: modularity, analysability, modifiability, testability",
25
+ "url": "https://iso25000.com/index.php/en/iso-25000-standards/iso-25010"
26
+ },
27
+ {
28
+ "title": "Ford, Parsons, Kua, Sadalage: Building Evolutionary Architectures, 2nd ed. (fitness functions)",
29
+ "url": "https://www.oreilly.com/library/view/building-evolutionary-architectures/9781492097532/"
30
+ },
31
+ {
32
+ "title": "Robert C. Martin: Clean Architecture (component principles: the Acyclic Dependencies Principle)",
33
+ "url": "https://www.oreilly.com/library/view/clean-architecture-a/9780134494272/"
34
+ },
35
+ {
36
+ "title": "Eric Evans: Domain-Driven Design (reference and summary; Shared Kernel)",
37
+ "url": "https://www.domainlanguage.com/ddd/"
38
+ },
39
+ {
40
+ "title": "Martin Fowler: BoundedContext",
41
+ "url": "https://martinfowler.com/bliki/BoundedContext.html"
42
+ },
43
+ {
44
+ "title": "Semantic Versioning 2.0.0",
45
+ "url": "https://semver.org/spec/v2.0.0.html"
46
+ },
47
+ {
48
+ "title": "Spring Modulith reference documentation",
49
+ "url": "https://docs.spring.io/spring-modulith/reference/"
50
+ },
51
+ {
52
+ "title": "Nx: Enforce module boundaries",
53
+ "url": "https://nx.dev/features/enforce-module-boundaries"
54
+ },
55
+ {
56
+ "title": "ArchUnit user guide",
57
+ "url": "https://www.archunit.org/userguide/html/000_Index.html"
58
+ },
59
+ {
60
+ "title": "dependency-cruiser",
61
+ "url": "https://github.com/sverweij/dependency-cruiser"
62
+ }
63
+ ],
64
+ "templateParams": [
65
+ {
66
+ "key": "RULES",
67
+ "title": "Dependency rules",
68
+ "label": "How are the allowed dependencies between parts declared?",
69
+ "hint": "Either each part says which others it may use, or parts are ranked in levels and may only use lower ones. Anything not allowed fails the build.",
70
+ "defaultValue": "allowlist",
71
+ "options": [
72
+ {
73
+ "value": "allowlist",
74
+ "label": "each part lists what it may use",
75
+ "description": "Every part declares the parts it may depend on (a module.json per part read by dependency-cruiser; Spring Modulith allowedDependencies, import-linter contracts elsewhere); everything else is forbidden. Pick it for up to about fifteen parts that are peers, such as the modules of a modular monolith, where each dependency deserves a decision."
76
+ },
77
+ {
78
+ "value": "levels",
79
+ "label": "parts ranked in levels",
80
+ "description": "Each part is tagged with a level (app, feature, data-access, domain, util) and may depend only on parts of lower levels, never on its own level's peers or higher. Pick it for a codebase with dozens of parts, where a list per part would be unmaintainable."
81
+ }
82
+ ]
83
+ },
84
+ {
85
+ "key": "ENFORCE",
86
+ "title": "Enforcement",
87
+ "label": "How are the rules enforced on the code there is today?",
88
+ "hint": "Rules that only fail on new code can be adopted on an old codebase today; rules that fail on everything need a clean codebase first.",
89
+ "defaultValue": "fail",
90
+ "options": [
91
+ {
92
+ "value": "fail",
93
+ "label": "every violation fails the build",
94
+ "description": "The rule check fails the build on any violation. Pick it for new code, or when the existing violations are few enough to fix before switching the check on."
95
+ },
96
+ {
97
+ "value": "ratchet",
98
+ "label": "existing violations frozen, new ones fail",
99
+ "description": "Today's violations are recorded in a baseline; only new ones fail, and the baseline must shrink every quarter. Pick it for an existing codebase with more violations than can be fixed at once."
100
+ }
101
+ ]
102
+ },
103
+ {
104
+ "key": "SHARED",
105
+ "title": "Shared code",
106
+ "label": "What may the parts share?",
107
+ "hint": "Shared code couples the parts that use it: a change to it is a change to each of them. The policy decides how much coupling is accepted, and who decides.",
108
+ "defaultValue": "kernel",
109
+ "options": [
110
+ {
111
+ "value": "kernel",
112
+ "label": "a small shared kernel",
113
+ "description": "A few value types and contracts (money, identifiers, event schemas) live in one shared part, src/shared-kernel, that every user of it must approve changes to. Pick it when parts genuinely speak the same language about a few concepts."
114
+ },
115
+ {
116
+ "value": "library",
117
+ "label": "versioned internal libraries",
118
+ "description": "Shared code is published as libraries with semantic versions; each part upgrades on its own schedule. Pick it when the parts are released separately (services, several repositories)."
119
+ },
120
+ {
121
+ "value": "none",
122
+ "label": "nothing but third-party libraries",
123
+ "description": "Parts share no code of their own; small helpers are duplicated and data crosses only through APIs or events. Pick it when teams must never wait for each other, accepting some duplication."
124
+ }
125
+ ]
126
+ },
127
+ {
128
+ "key": "RATCHET_PERCENT",
129
+ "label": "By how much must the baseline of known violations shrink each quarter (%)?",
130
+ "defaultValue": "20",
131
+ "type": "number"
132
+ },
133
+ {
134
+ "key": "KERNEL_PERCENT",
135
+ "label": "At most how much of the code may the shared kernel be (% of lines)?",
136
+ "defaultValue": "5",
137
+ "type": "number"
138
+ }
139
+ ]
140
+ },
141
+ "nodes": [
142
+ {
143
+ "id": "need",
144
+ "type": "need",
145
+ "label": "Parts change on their own",
146
+ "x": 0,
147
+ "y": 0,
148
+ "kind": "brief",
149
+ "source": "Hub concern pack: Module boundaries",
150
+ "description": "The code in this element must stay easy to understand, test and change as it grows and as people come and go. That needs parts with clear boundaries: a change to one part should not ripple through the others, each part should be testable on its own, and the rules about what may depend on what should hold because the build checks them, not because everyone remembers them. The checks below share one layout: each part lives in src/modules/<name> with its published API in src/modules/<name>/index.ts and its declarations in src/modules/<name>/module.json; shared code, where allowed, lives in src/shared-kernel; the rules are in .dependency-cruiser.cjs and run as `npm run check:deps` (depcruise src --config .dependency-cruiser.cjs); known violations, where frozen, are in .dependency-cruiser-known-violations.json."
151
+ },
152
+ {
153
+ "id": "req-allowlist",
154
+ "type": "requirement",
155
+ "label": "Only declared dependencies",
156
+ "x": 260,
157
+ "y": 0,
158
+ "ears_type": "ubiquitous",
159
+ "action": "let each part depend only on the parts it declares in its module.json as allowed, with 0 undeclared dependencies between parts on the main branch outside the recorded baseline",
160
+ "rationale": "Declaring each dependency makes it a decision visible in review; rules that are not checked erode with every shortcut (Building Evolutionary Architectures, ch. 2; Spring Modulith, allowed dependencies).",
161
+ "hubWhen": {
162
+ "RULES": [
163
+ "allowlist"
164
+ ]
165
+ }
166
+ },
167
+ {
168
+ "id": "req-levels",
169
+ "type": "requirement",
170
+ "label": "Dependencies point down levels",
171
+ "x": 260,
172
+ "y": 130,
173
+ "ears_type": "ubiquitous",
174
+ "action": "let each part depend only on parts of a lower level than the one declared in its module.json, with 0 dependencies on a part of the same or a higher level on the main branch outside the recorded baseline",
175
+ "rationale": "Levels give a large number of parts one direction without a list per part (Nx, enforce module boundaries; ISO/IEC 25010 modularity).",
176
+ "hubWhen": {
177
+ "RULES": [
178
+ "levels"
179
+ ]
180
+ }
181
+ },
182
+ {
183
+ "id": "req-public-api",
184
+ "type": "requirement",
185
+ "label": "Parts meet through APIs",
186
+ "x": 260,
187
+ "y": 260,
188
+ "ears_type": "ubiquitous",
189
+ "action": "let a part use another only through that part's published API (its index.ts), with 0 imports of another part's internal files",
190
+ "rationale": "A part whose internals others reach into cannot change them alone, and cannot later be extracted (Fowler, BoundedContext; Spring Modulith, application modules)."
191
+ },
192
+ {
193
+ "id": "req-cycles",
194
+ "type": "requirement",
195
+ "label": "No cycles between parts",
196
+ "x": 260,
197
+ "y": 390,
198
+ "ears_type": "ubiquitous",
199
+ "action": "keep the dependency graph between parts free of cycles, with 0 cycles that run through more than one part (a cycle inside one part is that part's own business)",
200
+ "rationale": "Parts in a cycle can only be understood, tested and released together, which makes them one part (Martin, Clean Architecture: the Acyclic Dependencies Principle; ISO/IEC 25010 modularity)."
201
+ },
202
+ {
203
+ "id": "req-fail",
204
+ "type": "requirement",
205
+ "label": "Violations fail the build",
206
+ "x": 260,
207
+ "y": 520,
208
+ "ears_type": "unwanted-behaviour",
209
+ "unwanted_condition": "a change adds a dependency the rules forbid or a cycle",
210
+ "action": "fail the build of that change before it can be merged, naming the rule and the two parts involved",
211
+ "rationale": "A violation is cheapest to fix in the pull request that brings it; after the merge others start to depend on it (Building Evolutionary Architectures, atomic fitness functions).",
212
+ "hubWhen": {
213
+ "ENFORCE": [
214
+ "fail"
215
+ ]
216
+ }
217
+ },
218
+ {
219
+ "id": "req-ratchet",
220
+ "type": "requirement",
221
+ "label": "Known violations shrink",
222
+ "x": 260,
223
+ "y": 650,
224
+ "ears_type": "state-driven",
225
+ "precondition": "known violations remain in the recorded baseline",
226
+ "action": "fail any change that adds a violation outside the baseline, and shrink the baseline by at least {{RATCHET_PERCENT}}% each quarter",
227
+ "rationale": "An old codebase cannot be fixed at once; freezing what is there stops it getting worse while the baseline records the debt to pay down (dependency-cruiser known violations; ArchUnit FreezingArchRule).",
228
+ "hubWhen": {
229
+ "ENFORCE": [
230
+ "ratchet"
231
+ ]
232
+ }
233
+ },
234
+ {
235
+ "id": "req-kernel",
236
+ "type": "requirement",
237
+ "label": "Shared kernel stays small",
238
+ "x": 260,
239
+ "y": 780,
240
+ "ears_type": "ubiquitous",
241
+ "action": "keep in the shared kernel only types and contracts used by at least two parts, with no dependency on a part and no third-party library beyond the allowed pure ones, at most {{KERNEL_PERCENT}}% of the source lines, and changes approved by the owners of every part that uses it as the Code review and branching pack decides ownership",
242
+ "rationale": "A shared kernel is shared on purpose and kept small; a growing \"common\" folder couples everything to everything (Evans, Domain-Driven Design, Shared Kernel).",
243
+ "hubWhen": {
244
+ "SHARED": [
245
+ "kernel"
246
+ ]
247
+ }
248
+ },
249
+ {
250
+ "id": "req-library",
251
+ "type": "requirement",
252
+ "label": "Shared libraries are versioned",
253
+ "x": 260,
254
+ "y": 910,
255
+ "ears_type": "event-driven",
256
+ "trigger": "shared code changes",
257
+ "action": "publish it as a new semantic version of its library, and move every consumer to the latest major version within 90 days of its release",
258
+ "rationale": "Versioned libraries let each part upgrade on its own schedule; bounding the lag keeps old versions from piling up (Semantic Versioning 2.0.0).",
259
+ "hubWhen": {
260
+ "SHARED": [
261
+ "library"
262
+ ]
263
+ }
264
+ },
265
+ {
266
+ "id": "req-no-shared",
267
+ "type": "requirement",
268
+ "label": "Nothing shared but contracts",
269
+ "x": 260,
270
+ "y": 1040,
271
+ "ears_type": "ubiquitous",
272
+ "action": "share no source code between parts apart from third-party libraries and API clients generated from published contracts, with 0 imports of another part's code",
273
+ "rationale": "Every shared line is a reason for two teams to coordinate; duplication of small helpers is cheaper than that coupling (Building Evolutionary Architectures, coupling).",
274
+ "hubWhen": {
275
+ "SHARED": [
276
+ "none"
277
+ ]
278
+ }
279
+ },
280
+ {
281
+ "id": "sc-allowlist",
282
+ "type": "scenario",
283
+ "label": "Undeclared dependency found",
284
+ "x": 520,
285
+ "y": 0,
286
+ "given": "the ordering module, allowed to use catalog only",
287
+ "when": "a change makes it import from billing",
288
+ "then": "the rule check reports the undeclared dependency naming both modules",
289
+ "hubWhen": {
290
+ "RULES": [
291
+ "allowlist"
292
+ ]
293
+ }
294
+ },
295
+ {
296
+ "id": "sc-levels",
297
+ "type": "scenario",
298
+ "label": "Upward dependency found",
299
+ "x": 520,
300
+ "y": 130,
301
+ "given": "a domain part and a feature part",
302
+ "when": "the domain part imports the feature part",
303
+ "then": "the rule check reports the dependency on a higher level",
304
+ "hubWhen": {
305
+ "RULES": [
306
+ "levels"
307
+ ]
308
+ }
309
+ },
310
+ {
311
+ "id": "sc-public-api",
312
+ "type": "scenario",
313
+ "label": "Internal access refused",
314
+ "x": 520,
315
+ "y": 260,
316
+ "given": "two parts, each with a published API",
317
+ "when": "one imports a file of the other that is not its index",
318
+ "then": "the rule check reports it and the build fails"
319
+ },
320
+ {
321
+ "id": "sc-cycles",
322
+ "type": "scenario",
323
+ "label": "Cycle refused",
324
+ "x": 520,
325
+ "y": 390,
326
+ "given": "two parts where A depends on B",
327
+ "when": "a change makes B depend on A",
328
+ "then": "the rule check reports the cycle with both parts named and the change is not merged"
329
+ },
330
+ {
331
+ "id": "sc-fail",
332
+ "type": "scenario",
333
+ "label": "Violation blocks merge",
334
+ "x": 520,
335
+ "y": 520,
336
+ "given": "a pull request that adds a forbidden dependency",
337
+ "when": "the build runs",
338
+ "then": "the dependency check fails naming the rule and both parts, and the pull request cannot be merged",
339
+ "hubWhen": {
340
+ "ENFORCE": [
341
+ "fail"
342
+ ]
343
+ }
344
+ },
345
+ {
346
+ "id": "sc-ratchet",
347
+ "type": "scenario",
348
+ "label": "Baseline holds and shrinks",
349
+ "x": 520,
350
+ "y": 650,
351
+ "given": "a baseline of known violations",
352
+ "when": "a change adds a new violation, and a quarter ends",
353
+ "then": "the change fails the build, and the baseline holds at least {{RATCHET_PERCENT}}% fewer violations than at the previous quarter's tag",
354
+ "hubWhen": {
355
+ "ENFORCE": [
356
+ "ratchet"
357
+ ]
358
+ }
359
+ },
360
+ {
361
+ "id": "sc-kernel",
362
+ "type": "scenario",
363
+ "label": "Kernel stays small",
364
+ "x": 520,
365
+ "y": 780,
366
+ "given": "the shared kernel",
367
+ "when": "a change makes it import a part or a database driver, or the kernel passes {{KERNEL_PERCENT}}% of the lines",
368
+ "then": "the check fails and the change is moved into the part that uses it",
369
+ "hubWhen": {
370
+ "SHARED": [
371
+ "kernel"
372
+ ]
373
+ }
374
+ },
375
+ {
376
+ "id": "sc-library",
377
+ "type": "scenario",
378
+ "label": "Library upgraded in time",
379
+ "x": 520,
380
+ "y": 910,
381
+ "given": "a shared library and its consumers",
382
+ "when": "a new major version is published",
383
+ "then": "within 90 days every consumer is on it, and the lag check fails for any that is not",
384
+ "hubWhen": {
385
+ "SHARED": [
386
+ "library"
387
+ ]
388
+ }
389
+ },
390
+ {
391
+ "id": "sc-no-shared",
392
+ "type": "scenario",
393
+ "label": "Cross-part import refused",
394
+ "x": 520,
395
+ "y": 1040,
396
+ "given": "two parts",
397
+ "when": "one imports a helper from the other",
398
+ "then": "the rule check reports it and the build fails",
399
+ "hubWhen": {
400
+ "SHARED": [
401
+ "none"
402
+ ]
403
+ }
404
+ },
405
+ {
406
+ "id": "adr-allowlist",
407
+ "type": "adr",
408
+ "label": "Declared dependencies only",
409
+ "x": 780,
410
+ "y": 0,
411
+ "concern": "module-boundaries",
412
+ "status": "accepted",
413
+ "date": "",
414
+ "context": "The code in this element is cut into parts (modules, packages, libraries) and keeps changing. Without written and checked rules, every shortcut adds a dependency nobody decided on: one module reads another's internals, two packages import each other, and a \"common\" folder grows until every change touches everything. The forces: rules kept only in a wiki erode within months; a cycle makes two parts one, so neither can be tested, owned or released alone; sharing code saves typing but couples the teams that share it; a boundary nobody owns is crossed by whoever is in a hurry; and an old codebase cannot fix every violation at once. What the parts are (layers, rings, slices) is the Architecture style pack; who owns each part is the Code review and branching pack; this pack keeps the boundaries between the parts.",
415
+ "decision": "Each part (src/modules/<name>) declares in its module.json the parts it may depend on (\"uses\") and exposes a published API in its index.ts; any other dependency, any import of another part's file but its index, and any cycle through more than one part fails the dependency check, which runs in every build ({{ENFORCE}}). Shared code: {{SHARED}}. The checker is dependency-cruiser with rules generated from the module.json files; on Spring Boot the same is Spring Modulith (@ApplicationModule(allowedDependencies = …) with ApplicationModules.verify()), on other JVM code ArchUnit slices, in Python import-linter contracts, on .NET NetArchTest. Pick the one that runs in the existing build, so a violation shows up like any failing test.",
416
+ "consequences": "• Every dependency between parts is a visible decision, reviewed when it is added.\n• The declarations are code to maintain: adding a dependency means changing one line in module.json and convincing a reviewer.\n• Boundaries hold only while the check runs in every build.\n• With many parts the lists become noise; levels scale better.",
417
+ "alternatives": "1. Levels: one rule for many parts, but less precise between peers.\n2. Only forbidding known-bad dependencies: easy to start, but anything not foreseen is allowed.\n3. No checked rules: fastest to start, and boundaries erode within months.",
418
+ "hubWhen": {
419
+ "RULES": [
420
+ "allowlist"
421
+ ]
422
+ }
423
+ },
424
+ {
425
+ "id": "adr-levels",
426
+ "type": "adr",
427
+ "label": "Parts ranked in levels",
428
+ "x": 780,
429
+ "y": 130,
430
+ "concern": "module-boundaries",
431
+ "status": "accepted",
432
+ "date": "",
433
+ "context": "The code in this element is cut into parts (modules, packages, libraries) and keeps changing. Without written and checked rules, every shortcut adds a dependency nobody decided on: one module reads another's internals, two packages import each other, and a \"common\" folder grows until every change touches everything. The forces: rules kept only in a wiki erode within months; a cycle makes two parts one, so neither can be tested, owned or released alone; sharing code saves typing but couples the teams that share it; a boundary nobody owns is crossed by whoever is in a hurry; and an old codebase cannot fix every violation at once. What the parts are (layers, rings, slices) is the Architecture style pack; who owns each part is the Code review and branching pack; this pack keeps the boundaries between the parts.",
434
+ "decision": "Each part (src/modules/<name>) declares its level in its module.json (util, domain, data-access, feature, app; or the levels the codebase needs) and may depend only on parts of lower levels and only through their index.ts; cycles through more than one part are forbidden. The dependency check runs in every build ({{ENFORCE}}). Shared code: {{SHARED}}. The checker is dependency-cruiser with rules generated from the levels; in an Nx workspace the same is @nx/enforce-module-boundaries with type tags, on the JVM ArchUnit's layeredArchitecture() over module packages, in Python import-linter's layers contract.",
435
+ "consequences": "• One rule covers dozens of parts; a new part only needs its level.\n• Peers at the same level cannot use each other, which pushes shared code down a level.\n• Says nothing about which domain may use which; add scope tags or an allowlist when that matters.\n• Boundaries hold only while the check runs in every build.",
436
+ "alternatives": "1. Per-part lists: precise, but unmaintainable for dozens of parts.\n2. Separate repositories per part: strong boundaries, slow cross-part changes.\n3. No checked rules: boundaries erode within months.",
437
+ "hubWhen": {
438
+ "RULES": [
439
+ "levels"
440
+ ]
441
+ }
442
+ },
443
+ {
444
+ "id": "adr-fail",
445
+ "type": "adr",
446
+ "label": "Every violation fails the build",
447
+ "x": 780,
448
+ "y": 260,
449
+ "concern": "module-boundaries",
450
+ "status": "accepted",
451
+ "date": "",
452
+ "context": "The code in this element is cut into parts (modules, packages, libraries) and keeps changing. Without written and checked rules, every shortcut adds a dependency nobody decided on: one module reads another's internals, two packages import each other, and a \"common\" folder grows until every change touches everything. The forces: rules kept only in a wiki erode within months; a cycle makes two parts one, so neither can be tested, owned or released alone; sharing code saves typing but couples the teams that share it; a boundary nobody owns is crossed by whoever is in a hurry; and an old codebase cannot fix every violation at once. What the parts are (layers, rings, slices) is the Architecture style pack; who owns each part is the Code review and branching pack; this pack keeps the boundaries between the parts.",
453
+ "decision": "The dependency check runs on every pull request as a job the main branch requires (the ruleset that protects main is the Code review and branching pack's), and any violation fails it: there is no baseline and no exception list. Existing violations, if any, are fixed before the check is switched on.",
454
+ "consequences": "• A violation never reaches main, so nobody comes to depend on one.\n• Switching the check on needs a clean codebase first; on an old one that is a project of its own.\n• A rule that turns out wrong blocks everyone until it is changed, which keeps the rules honest.",
455
+ "alternatives": "1. A frozen baseline with a ratchet: adoptable today on an old codebase, at the cost of carrying known violations.\n2. Warnings only: visible, and ignored within weeks.",
456
+ "hubWhen": {
457
+ "ENFORCE": [
458
+ "fail"
459
+ ]
460
+ }
461
+ },
462
+ {
463
+ "id": "adr-ratchet",
464
+ "type": "adr",
465
+ "label": "Known violations frozen, new ones fail",
466
+ "x": 780,
467
+ "y": 390,
468
+ "concern": "module-boundaries",
469
+ "status": "accepted",
470
+ "date": "",
471
+ "context": "The code in this element is cut into parts (modules, packages, libraries) and keeps changing. Without written and checked rules, every shortcut adds a dependency nobody decided on: one module reads another's internals, two packages import each other, and a \"common\" folder grows until every change touches everything. The forces: rules kept only in a wiki erode within months; a cycle makes two parts one, so neither can be tested, owned or released alone; sharing code saves typing but couples the teams that share it; a boundary nobody owns is crossed by whoever is in a hurry; and an old codebase cannot fix every violation at once. What the parts are (layers, rings, slices) is the Architecture style pack; who owns each part is the Code review and branching pack; this pack keeps the boundaries between the parts.",
472
+ "decision": "The dependency check runs on every pull request with today's violations frozen in .dependency-cruiser-known-violations.json (written once with the --baseline option, committed, never edited by hand): a new violation fails the build, a fixed one is removed from the baseline. The baseline shrinks by at least {{RATCHET_PERCENT}}% each quarter against the previous quarter's tag (quarter-<year>Q<n>), checked in the build. On the JVM the same is ArchUnit's FreezingArchRule with its store committed.",
473
+ "consequences": "• Adoptable today on an old codebase; the code stops getting worse at once.\n• The baseline is debt on record: paying it down is planned work, and the quarterly check makes skipping it visible.\n• A fixed violation that is not removed from the baseline hides nothing, since the check only ignores what is listed.",
474
+ "alternatives": "1. Every violation fails the build: cleaner, after fixing everything first.\n2. A deadline instead of a ratchet: all violations fixed by a date, usually missed.",
475
+ "hubWhen": {
476
+ "ENFORCE": [
477
+ "ratchet"
478
+ ]
479
+ }
480
+ },
481
+ {
482
+ "id": "adr-shared-kernel",
483
+ "type": "adr",
484
+ "label": "A small shared kernel",
485
+ "x": 780,
486
+ "y": 520,
487
+ "concern": "module-boundaries",
488
+ "status": "accepted",
489
+ "date": "",
490
+ "context": "The code in this element is cut into parts (modules, packages, libraries) and keeps changing. Without written and checked rules, every shortcut adds a dependency nobody decided on: one module reads another's internals, two packages import each other, and a \"common\" folder grows until every change touches everything. The forces: rules kept only in a wiki erode within months; a cycle makes two parts one, so neither can be tested, owned or released alone; sharing code saves typing but couples the teams that share it; a boundary nobody owns is crossed by whoever is in a hurry; and an old codebase cannot fix every violation at once. What the parts are (layers, rings, slices) is the Architecture style pack; who owns each part is the Code review and branching pack; this pack keeps the boundaries between the parts.",
491
+ "decision": "Code shared between parts lives in one shared kernel, src/shared-kernel: value types and contracts (money, identifiers, event schemas) used by at least two parts, with no dependency on a part, no I/O or framework library (only the pure libraries on the kernel's allowlist), at most {{KERNEL_PERCENT}}% of the source lines. A change to the kernel is approved by the owners of every part that uses it, as the Code review and branching pack decides ownership.",
492
+ "consequences": "• Parts speak the same language about the few concepts they share.\n• Every kernel change is a change to every part that uses it, hence the approvals and the size limit.\n• Helpers that are convenient but not shared concepts stay in the parts and are sometimes duplicated.",
493
+ "alternatives": "1. Versioned internal libraries: each part upgrades on its own schedule.\n2. Nothing shared: no coupling through code, at the cost of duplication.\n3. A free-for-all \"common\" folder: easy, and it couples everything to everything.",
494
+ "hubWhen": {
495
+ "SHARED": [
496
+ "kernel"
497
+ ]
498
+ }
499
+ },
500
+ {
501
+ "id": "adr-shared-libraries",
502
+ "type": "adr",
503
+ "label": "Versioned internal libraries",
504
+ "x": 780,
505
+ "y": 650,
506
+ "concern": "module-boundaries",
507
+ "status": "accepted",
508
+ "date": "",
509
+ "context": "The code in this element is cut into parts (modules, packages, libraries) and keeps changing. Without written and checked rules, every shortcut adds a dependency nobody decided on: one module reads another's internals, two packages import each other, and a \"common\" folder grows until every change touches everything. The forces: rules kept only in a wiki erode within months; a cycle makes two parts one, so neither can be tested, owned or released alone; sharing code saves typing but couples the teams that share it; a boundary nobody owns is crossed by whoever is in a hurry; and an old codebase cannot fix every violation at once. What the parts are (layers, rings, slices) is the Architecture style pack; who owns each part is the Code review and branching pack; this pack keeps the boundaries between the parts.",
510
+ "decision": "Code shared between parts is published as internal libraries under the @shop scope with semantic versions to the internal registry (npm, Maven, NuGet or PyPI on Artifactory, GitHub Packages or a cloud artifact registry). Each part upgrades on its own schedule; how the update pull requests arrive is decided in the Dependency hygiene pack. No consumer stays on an older major version for more than 90 days after a new major is released; a weekly check in every consumer fails past that.",
511
+ "consequences": "• Parts released apart are not forced to upgrade together.\n• Several versions of a library live at once; fixes have to be released and picked up.\n• Library owners must keep compatibility within a major version and announce majors.",
512
+ "alternatives": "1. A shared kernel in the same repository: always one version, but every change hits every user at once.\n2. Nothing shared: no versions to manage, some duplication.",
513
+ "hubWhen": {
514
+ "SHARED": [
515
+ "library"
516
+ ]
517
+ }
518
+ },
519
+ {
520
+ "id": "adr-share-nothing",
521
+ "type": "adr",
522
+ "label": "Parts share no code",
523
+ "x": 780,
524
+ "y": 780,
525
+ "concern": "module-boundaries",
526
+ "status": "accepted",
527
+ "date": "",
528
+ "context": "The code in this element is cut into parts (modules, packages, libraries) and keeps changing. Without written and checked rules, every shortcut adds a dependency nobody decided on: one module reads another's internals, two packages import each other, and a \"common\" folder grows until every change touches everything. The forces: rules kept only in a wiki erode within months; a cycle makes two parts one, so neither can be tested, owned or released alone; sharing code saves typing but couples the teams that share it; a boundary nobody owns is crossed by whoever is in a hurry; and an old codebase cannot fix every violation at once. What the parts are (layers, rings, slices) is the Architecture style pack; who owns each part is the Code review and branching pack; this pack keeps the boundaries between the parts.",
529
+ "decision": "Parts share no source code of their own: small helpers are duplicated, and data crosses only through published APIs or events, with clients generated in each consumer from the provider's contract. Third-party libraries are allowed.",
530
+ "consequences": "• No team ever waits for another to change shared code.\n• Some duplication, and a bug in a copied helper is fixed in each copy.\n• Contracts carry the whole weight of the coupling, so they must be versioned and checked.",
531
+ "alternatives": "1. A small shared kernel: less duplication for genuinely shared concepts.\n2. Versioned internal libraries: sharing without lock-step upgrades.",
532
+ "hubWhen": {
533
+ "SHARED": [
534
+ "none"
535
+ ]
536
+ }
537
+ },
538
+ {
539
+ "id": "ff-cycles",
540
+ "type": "fitness-fn",
541
+ "label": "No dependency cycles",
542
+ "x": 1040,
543
+ "y": 0,
544
+ "characteristic": "maintainability",
545
+ "scope": "atomic",
546
+ "cadence": "triggered",
547
+ "trigger": "pull-request",
548
+ "invocation": "automated",
549
+ "description": "A dependency rule fails on any cycle that leaves a part's folder (a cycle among the files of one part is not counted); it is one of the rules in .dependency-cruiser.cjs that npm run check:deps runs. On the JVM the same is ArchUnit's slices().matching(\"..(*)..\").should().beFreeOfCycles(); for Python, import-linter's independence contract.\n\nThreshold: 0 cycles that run through more than one part on the main branch\n\nTool: dependency-cruiser; for the JVM: ArchUnit slices; for Python: import-linter; for .NET: NetArchTest\n\n```js\n// .dependency-cruiser.cjs: add the rule to forbidden\nmodule.exports = { forbidden: [{\n name: 'no-cycles-between-parts',\n comment: 'ADR Module boundaries: parts in a cycle are one part',\n severity: 'error',\n from: { path: '^src/modules/([^/]+)/' },\n to: { circular: true, via: { pathNot: '^src/modules/$1/' } }, // the cycle passes through another part\n}] }\n// package.json: \"check:deps\": \"depcruise src --config .dependency-cruiser.cjs\"\n```"
550
+ },
551
+ {
552
+ "id": "ff-public-api",
553
+ "type": "fitness-fn",
554
+ "label": "Only public APIs used",
555
+ "x": 1040,
556
+ "y": 130,
557
+ "characteristic": "maintainability",
558
+ "scope": "atomic",
559
+ "cadence": "triggered",
560
+ "trigger": "pull-request",
561
+ "invocation": "automated",
562
+ "description": "A dependency rule allows a part to import another only through its index (the published API); a deep import into another part's folder fails the build. Spring Modulith's verify() (named interfaces such as customer::api are its published packages) and Nx's module boundaries do the same in their stacks.\n\nThreshold: 0 imports from one part into another part's files other than its index.ts\n\nTool: dependency-cruiser; for Spring Boot: Spring Modulith verify(); for an Nx workspace: @nx/enforce-module-boundaries; for .NET: NetArchTest\n\n```js\n// .dependency-cruiser.cjs: add the rule to forbidden\nmodule.exports = { forbidden: [{\n name: 'only-through-public-api',\n comment: 'ADR Module boundaries: parts meet through their published API',\n severity: 'error',\n from: { path: '^src/modules/([^/]+)/' },\n to: { path: '^src/modules/', pathNot: ['^src/modules/$1/', '^src/modules/[^/]+/index\\\\.ts$'] },\n}] }\n```"
563
+ },
564
+ {
565
+ "id": "ff-allowlist",
566
+ "type": "fitness-fn",
567
+ "label": "Only declared dependencies",
568
+ "x": 1040,
569
+ "y": 260,
570
+ "characteristic": "maintainability",
571
+ "scope": "atomic",
572
+ "cadence": "triggered",
573
+ "trigger": "pull-request",
574
+ "invocation": "automated",
575
+ "description": "Each part declares what it may use in src/modules/<name>/module.json; the configuration reads the files and generates one forbidden rule per part that allows imports only of the declared parts' index files. A new dependency means a one-line change to module.json, visible in review.\n\nThreshold: 0 dependencies from a part on a part its module.json does not list\n\nTool: dependency-cruiser; for Spring Boot: Spring Modulith @ApplicationModule(allowedDependencies) with ApplicationModules.verify(); for Python: import-linter forbidden contracts\n\n```js\n// .dependency-cruiser.cjs — each part declares what it may use in src/modules/<name>/module.json: { \"uses\": [\"catalog\", \"customer\"] }\nconst { readdirSync, readFileSync } = require('node:fs')\nconst parts = readdirSync('src/modules')\nconst uses = Object.fromEntries(parts.map((p) => [p, JSON.parse(readFileSync(`src/modules/${p}/module.json`, 'utf8')).uses ?? []]))\n\nmodule.exports = {\n forbidden: parts.map((p) => ({\n name: `${p}-uses-only-declared-parts`,\n comment: 'ADR Declared dependencies only: add the part to module.json to use it',\n severity: 'error',\n from: { path: `^src/modules/${p}/` },\n to: { path: '^src/modules/', pathNot: [`^src/modules/${p}/`, ...uses[p].map((u) => `^src/modules/${u}/index\\\\.ts$`)] },\n })),\n options: { tsConfig: { fileName: 'tsconfig.json' } },\n}\n```",
576
+ "hubWhen": {
577
+ "RULES": [
578
+ "allowlist"
579
+ ]
580
+ }
581
+ },
582
+ {
583
+ "id": "ff-levels",
584
+ "type": "fitness-fn",
585
+ "label": "Dependencies point down levels",
586
+ "x": 1040,
587
+ "y": 390,
588
+ "characteristic": "maintainability",
589
+ "scope": "atomic",
590
+ "cadence": "triggered",
591
+ "trigger": "pull-request",
592
+ "invocation": "automated",
593
+ "description": "Each part declares its level in src/modules/<name>/module.json; the configuration generates one forbidden rule per part that refuses imports from parts of the same or a higher level. In an Nx workspace the same is the type tags of @nx/enforce-module-boundaries.\n\nThreshold: 0 dependencies from a part on a part of the same or a higher level\n\nTool: dependency-cruiser; for an Nx workspace: @nx/enforce-module-boundaries with depConstraints on type tags; for the JVM: ArchUnit layeredArchitecture(); for Python: import-linter layers contract\n\n```js\n// .dependency-cruiser.cjs — each part declares its level in src/modules/<name>/module.json: { \"level\": \"feature\" }\nconst { readdirSync, readFileSync } = require('node:fs')\nconst LEVELS = ['util', 'domain', 'data-access', 'feature', 'app'] // lowest first: a part may use lower levels only\nconst parts = readdirSync('src/modules')\nconst level = Object.fromEntries(parts.map((p) => [p, LEVELS.indexOf(JSON.parse(readFileSync(`src/modules/${p}/module.json`, 'utf8')).level)]))\n\nmodule.exports = {\n forbidden: parts.map((p) => ({\n name: `${p}-depends-down-levels-only`,\n comment: 'ADR Parts ranked in levels: a part uses parts of lower levels only',\n severity: 'error',\n from: { path: `^src/modules/${p}/` },\n to: { path: parts.filter((o) => o !== p && level[o] >= level[p]).map((o) => `^src/modules/${o}/`) },\n })).filter((rule) => rule.to.path.length > 0),\n options: { tsConfig: { fileName: 'tsconfig.json' } },\n}\n```",
594
+ "hubWhen": {
595
+ "RULES": [
596
+ "levels"
597
+ ]
598
+ }
599
+ },
600
+ {
601
+ "id": "ff-fail",
602
+ "type": "fitness-fn",
603
+ "label": "Violations fail the pull request",
604
+ "x": 1040,
605
+ "y": 520,
606
+ "characteristic": "maintainability",
607
+ "scope": "atomic",
608
+ "cadence": "triggered",
609
+ "trigger": "pull-request",
610
+ "invocation": "automated",
611
+ "description": "A workflow runs npm run check:deps on every pull request; dependency-cruiser's default err reporter exits non-zero on an error-severity violation and prints the rule with the from and to files. The job is listed among the checks the main branch requires, in the ruleset the Code review and branching pack keeps.\n\nThreshold: The dependency check runs on every pull request and its job fails on any violation, naming the rule and both files\n\nTool: dependency-cruiser in GitHub Actions; for the JVM: the ArchUnit tests in the build's test job\n\n```yaml\n# .github/workflows/boundaries.yml\nname: module boundaries\non: [pull_request]\njobs:\n check-deps:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4.2.2 # pin by commit SHA in your repository\n - uses: actions/setup-node@v4.1.0 # pin by commit SHA in your repository\n with: { node-version-file: .nvmrc, cache: npm }\n - run: npm ci\n - run: npm run check:deps # depcruise src --config .dependency-cruiser.cjs; exits non-zero on a violation\n```",
612
+ "hubWhen": {
613
+ "ENFORCE": [
614
+ "fail"
615
+ ]
616
+ }
617
+ },
618
+ {
619
+ "id": "ff-ratchet",
620
+ "type": "fitness-fn",
621
+ "label": "Known violations frozen and shrinking",
622
+ "x": 1040,
623
+ "y": 650,
624
+ "characteristic": "maintainability",
625
+ "scope": "atomic",
626
+ "cadence": "triggered",
627
+ "trigger": "pull-request",
628
+ "invocation": "automated",
629
+ "description": "The dependency check runs with --ignore-known, so only violations not in the committed baseline fail; the baseline was written once with --baseline. A second step counts the baseline's entries against the file at the previous quarter's tag and fails when it has not shrunk enough. With ArchUnit the same is FreezingArchRule with its store committed and counted the same way.\n\nThreshold: 0 violations outside the baseline on every pull request; the baseline holds at least {{RATCHET_PERCENT}}% fewer entries than at the previous quarter's tag\n\nTool: dependency-cruiser (--baseline, --ignore-known) with jq and git in a shell step; for the JVM: ArchUnit FreezingArchRule with the archunit_store directory\n\n```bash\nset -euo pipefail\n# once, to freeze today's violations: npx depcruise src --config .dependency-cruiser.cjs --baseline (then commit the file)\nnpx depcruise src --config .dependency-cruiser.cjs --ignore-known # fails on violations outside .dependency-cruiser-known-violations.json\n\n# the baseline shrinks: compare with the previous quarter's tag (quarter-<year>Q<n>, set by the team)\nnow=$(jq length .dependency-cruiser-known-violations.json)\nprevious_tag=$(git describe --tags --match 'quarter-*' --abbrev=0 HEAD~1)\nthen=$(git show \"$previous_tag:.dependency-cruiser-known-violations.json\" | jq length)\necho \"known violations: $then at $previous_tag, $now now\"\n[ \"$((now * 100))\" -le \"$((then * (100 - {{RATCHET_PERCENT}})))\" ] || { echo \"the baseline has not shrunk by {{RATCHET_PERCENT}}% since $previous_tag\"; exit 1; }\n```",
630
+ "hubWhen": {
631
+ "ENFORCE": [
632
+ "ratchet"
633
+ ]
634
+ }
635
+ },
636
+ {
637
+ "id": "ff-kernel",
638
+ "type": "fitness-fn",
639
+ "label": "Shared kernel stays small",
640
+ "x": 1040,
641
+ "y": 780,
642
+ "characteristic": "maintainability",
643
+ "scope": "atomic",
644
+ "cadence": "triggered",
645
+ "trigger": "pull-request",
646
+ "invocation": "automated",
647
+ "description": "A dependency rule keeps the kernel free of the parts and of every package in node_modules except the pure ones on its allowlist (so a database driver, HTTP client or framework cannot slip in); a second step in the same job compares the kernel's line count with the whole and fails above the limit.\n\nThreshold: The shared kernel imports no part and no third-party package outside its allowlist, and holds at most {{KERNEL_PERCENT}}% of the source lines\n\nTool: dependency-cruiser and cloc with jq in a shell step; for the JVM: an ArchUnit rule over the kernel package and JaCoCo's line counts\n\n```js\n// .dependency-cruiser.cjs: add the rule to forbidden\nmodule.exports = { forbidden: [{\n name: 'kernel-depends-on-nothing',\n comment: 'ADR A small shared kernel: types and contracts only',\n severity: 'error',\n from: { path: '^src/shared-kernel/' },\n to: { path: ['^src/modules/', '^node_modules/'], pathNot: '^node_modules/(zod|uuid|decimal\\\\.js)/' }, // the pure libraries the kernel may use\n}] }\n// CI, in the same job: fail when the kernel passes the limit\n// kernel=$(cloc --json src/shared-kernel | jq '.SUM.code'); all=$(cloc --json src | jq '.SUM.code')\n// [ $((kernel * 100 / all)) -le {{KERNEL_PERCENT}} ]\n```",
648
+ "hubWhen": {
649
+ "SHARED": [
650
+ "kernel"
651
+ ]
652
+ }
653
+ },
654
+ {
655
+ "id": "ff-library",
656
+ "type": "fitness-fn",
657
+ "label": "No consumer left behind",
658
+ "x": 1040,
659
+ "y": 910,
660
+ "characteristic": "maintainability",
661
+ "scope": "atomic",
662
+ "cadence": "triggered",
663
+ "trigger": "weekly",
664
+ "invocation": "automated",
665
+ "description": "A weekly job in every consumer lists its outdated packages, and for each internal library whose latest major is newer than the installed one reads the release date of that version from the registry; a lag over 90 days fails the job naming the library.\n\nThreshold: 0 internal libraries on which a consumer is a major version behind for more than 90 days after the newer major's release\n\nTool: npm (outdated, view) in a TypeScript script run with tsx from a scheduled GitHub Actions job; for Maven: versions:display-dependency-updates with the release dates from the repository index\n\n```ts\n// scripts/library-lag.ts — scheduled weekly in every consumer: npx tsx scripts/library-lag.ts\nimport { execFileSync } from 'node:child_process'\n\nconst SCOPE = '@shop/'\nconst MAX_DAYS = 90\n// npm outdated exits 1 when something is outdated; its JSON is still on stdout\nconst npm = (args: string[]): string => { try { return execFileSync('npm', args, { encoding: 'utf8' }) } catch (e: any) { return e.stdout } }\nconst major = (version: string) => Number(version.split('.')[0])\n\nconst outdated: Record<string, { current: string; latest: string }> = JSON.parse(npm(['outdated', '--json']) || '{}')\nconst late: string[] = []\nfor (const [name, info] of Object.entries(outdated)) {\n if (!name.startsWith(SCOPE) || major(info.latest) <= major(info.current)) continue\n const published: Record<string, string> = JSON.parse(npm(['view', name, 'time', '--json']))\n const days = Math.floor((Date.now() - Date.parse(published[info.latest])) / 86_400_000)\n if (days > MAX_DAYS) late.push(`${name}: on ${info.current}, ${info.latest} was released ${days} days ago`)\n}\nif (late.length) { console.error('internal libraries a major behind for over 90 days:\\n' + late.join('\\n')); process.exit(1) }\n```",
666
+ "hubWhen": {
667
+ "SHARED": [
668
+ "library"
669
+ ]
670
+ }
671
+ },
672
+ {
673
+ "id": "ff-no-shared",
674
+ "type": "fitness-fn",
675
+ "label": "No code shared between parts",
676
+ "x": 1040,
677
+ "y": 1040,
678
+ "characteristic": "maintainability",
679
+ "scope": "atomic",
680
+ "cadence": "triggered",
681
+ "trigger": "pull-request",
682
+ "invocation": "automated",
683
+ "description": "A dependency rule forbids any import from one part into another; generated API clients live in each consumer and are generated from the provider's published contract.\n\nThreshold: 0 imports from one part's folder into another's\n\nTool: dependency-cruiser; for the JVM: ArchUnit slices().should().notDependOnEachOther(); for .NET: NetArchTest\n\n```js\n// .dependency-cruiser.cjs: add the rule to forbidden\nmodule.exports = { forbidden: [{\n name: 'parts-share-nothing',\n comment: 'ADR Parts share no code',\n severity: 'error',\n from: { path: '^src/modules/([^/]+)/' },\n to: { path: '^src/modules/', pathNot: '^src/modules/$1/' },\n}] }\n```",
684
+ "hubWhen": {
685
+ "SHARED": [
686
+ "none"
687
+ ]
688
+ }
689
+ }
690
+ ],
691
+ "relations": [
692
+ {
693
+ "id": "req-allowlist--derives--need",
694
+ "sourceId": "req-allowlist",
695
+ "targetId": "need",
696
+ "relationType": "derives"
697
+ },
698
+ {
699
+ "id": "req-levels--derives--need",
700
+ "sourceId": "req-levels",
701
+ "targetId": "need",
702
+ "relationType": "derives"
703
+ },
704
+ {
705
+ "id": "req-public-api--derives--need",
706
+ "sourceId": "req-public-api",
707
+ "targetId": "need",
708
+ "relationType": "derives"
709
+ },
710
+ {
711
+ "id": "req-cycles--derives--need",
712
+ "sourceId": "req-cycles",
713
+ "targetId": "need",
714
+ "relationType": "derives"
715
+ },
716
+ {
717
+ "id": "req-fail--derives--need",
718
+ "sourceId": "req-fail",
719
+ "targetId": "need",
720
+ "relationType": "derives"
721
+ },
722
+ {
723
+ "id": "req-ratchet--derives--need",
724
+ "sourceId": "req-ratchet",
725
+ "targetId": "need",
726
+ "relationType": "derives"
727
+ },
728
+ {
729
+ "id": "req-kernel--derives--need",
730
+ "sourceId": "req-kernel",
731
+ "targetId": "need",
732
+ "relationType": "derives"
733
+ },
734
+ {
735
+ "id": "req-library--derives--need",
736
+ "sourceId": "req-library",
737
+ "targetId": "need",
738
+ "relationType": "derives"
739
+ },
740
+ {
741
+ "id": "req-no-shared--derives--need",
742
+ "sourceId": "req-no-shared",
743
+ "targetId": "need",
744
+ "relationType": "derives"
745
+ },
746
+ {
747
+ "id": "sc-allowlist--verifies--req-allowlist",
748
+ "sourceId": "sc-allowlist",
749
+ "targetId": "req-allowlist",
750
+ "relationType": "verifies"
751
+ },
752
+ {
753
+ "id": "sc-levels--verifies--req-levels",
754
+ "sourceId": "sc-levels",
755
+ "targetId": "req-levels",
756
+ "relationType": "verifies"
757
+ },
758
+ {
759
+ "id": "sc-public-api--verifies--req-public-api",
760
+ "sourceId": "sc-public-api",
761
+ "targetId": "req-public-api",
762
+ "relationType": "verifies"
763
+ },
764
+ {
765
+ "id": "sc-cycles--verifies--req-cycles",
766
+ "sourceId": "sc-cycles",
767
+ "targetId": "req-cycles",
768
+ "relationType": "verifies"
769
+ },
770
+ {
771
+ "id": "sc-fail--verifies--req-fail",
772
+ "sourceId": "sc-fail",
773
+ "targetId": "req-fail",
774
+ "relationType": "verifies"
775
+ },
776
+ {
777
+ "id": "sc-ratchet--verifies--req-ratchet",
778
+ "sourceId": "sc-ratchet",
779
+ "targetId": "req-ratchet",
780
+ "relationType": "verifies"
781
+ },
782
+ {
783
+ "id": "sc-kernel--verifies--req-kernel",
784
+ "sourceId": "sc-kernel",
785
+ "targetId": "req-kernel",
786
+ "relationType": "verifies"
787
+ },
788
+ {
789
+ "id": "sc-library--verifies--req-library",
790
+ "sourceId": "sc-library",
791
+ "targetId": "req-library",
792
+ "relationType": "verifies"
793
+ },
794
+ {
795
+ "id": "sc-no-shared--verifies--req-no-shared",
796
+ "sourceId": "sc-no-shared",
797
+ "targetId": "req-no-shared",
798
+ "relationType": "verifies"
799
+ },
800
+ {
801
+ "id": "ff-cycles--implements--adr-allowlist",
802
+ "sourceId": "ff-cycles",
803
+ "targetId": "adr-allowlist",
804
+ "relationType": "implements"
805
+ },
806
+ {
807
+ "id": "ff-cycles--implements--adr-levels",
808
+ "sourceId": "ff-cycles",
809
+ "targetId": "adr-levels",
810
+ "relationType": "implements"
811
+ },
812
+ {
813
+ "id": "ff-public-api--implements--adr-allowlist",
814
+ "sourceId": "ff-public-api",
815
+ "targetId": "adr-allowlist",
816
+ "relationType": "implements"
817
+ },
818
+ {
819
+ "id": "ff-public-api--implements--adr-levels",
820
+ "sourceId": "ff-public-api",
821
+ "targetId": "adr-levels",
822
+ "relationType": "implements"
823
+ },
824
+ {
825
+ "id": "ff-allowlist--implements--adr-allowlist",
826
+ "sourceId": "ff-allowlist",
827
+ "targetId": "adr-allowlist",
828
+ "relationType": "implements"
829
+ },
830
+ {
831
+ "id": "ff-levels--implements--adr-levels",
832
+ "sourceId": "ff-levels",
833
+ "targetId": "adr-levels",
834
+ "relationType": "implements"
835
+ },
836
+ {
837
+ "id": "ff-fail--implements--adr-fail",
838
+ "sourceId": "ff-fail",
839
+ "targetId": "adr-fail",
840
+ "relationType": "implements"
841
+ },
842
+ {
843
+ "id": "ff-ratchet--implements--adr-ratchet",
844
+ "sourceId": "ff-ratchet",
845
+ "targetId": "adr-ratchet",
846
+ "relationType": "implements"
847
+ },
848
+ {
849
+ "id": "ff-kernel--implements--adr-shared-kernel",
850
+ "sourceId": "ff-kernel",
851
+ "targetId": "adr-shared-kernel",
852
+ "relationType": "implements"
853
+ },
854
+ {
855
+ "id": "ff-library--implements--adr-shared-libraries",
856
+ "sourceId": "ff-library",
857
+ "targetId": "adr-shared-libraries",
858
+ "relationType": "implements"
859
+ },
860
+ {
861
+ "id": "ff-no-shared--implements--adr-share-nothing",
862
+ "sourceId": "ff-no-shared",
863
+ "targetId": "adr-share-nothing",
864
+ "relationType": "implements"
865
+ }
866
+ ]
867
+ }