@radicaltools/mcp 0.1.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -26
- package/dist/chunk-Z7THA3L5.js +3200 -0
- package/dist/elkLayout-TAUBPPVN.js +8 -0
- package/dist/hub-catalogue/concern/concern-api-evolution.radical +935 -0
- package/dist/hub-catalogue/concern/concern-architecture-style.radical +1112 -0
- package/dist/hub-catalogue/concern/concern-authentication.radical +685 -0
- package/dist/hub-catalogue/concern/concern-authorization.radical +1464 -0
- package/dist/hub-catalogue/concern/concern-availability.radical +804 -0
- package/dist/hub-catalogue/concern/concern-backend-stack.radical +1118 -0
- package/dist/hub-catalogue/concern/concern-backup-recovery.radical +1304 -0
- package/dist/hub-catalogue/concern/concern-capacity.radical +802 -0
- package/dist/hub-catalogue/concern/concern-communication-style.radical +1202 -0
- package/dist/hub-catalogue/concern/concern-data-consistency.radical +1081 -0
- package/dist/hub-catalogue/concern/concern-data-store.radical +960 -0
- package/dist/hub-catalogue/concern/concern-decomposition.radical +1143 -0
- package/dist/hub-catalogue/concern/concern-deployment.radical +952 -0
- package/dist/hub-catalogue/concern/concern-encryption.radical +1055 -0
- package/dist/hub-catalogue/concern/concern-frontend-stack.radical +1340 -0
- package/dist/hub-catalogue/concern/concern-infrastructure.radical +1151 -0
- package/dist/hub-catalogue/concern/concern-integration-resilience.radical +1079 -0
- package/dist/hub-catalogue/concern/concern-messaging.radical +940 -0
- package/dist/hub-catalogue/concern/concern-module-boundaries.radical +864 -0
- package/dist/hub-catalogue/concern/concern-observability.radical +1048 -0
- package/dist/hub-catalogue/concern/concern-personal-data.radical +1434 -0
- package/dist/hub-catalogue/concern/concern-rate-limiting.radical +1153 -0
- package/dist/hub-catalogue/concern/concern-secrets.radical +1026 -0
- package/dist/hub-catalogue/concern/concern-supply-chain.radical +1312 -0
- package/dist/hub-catalogue/concern/concern-tenant-isolation.radical +1306 -0
- package/dist/hub-catalogue/concern/concern-test-strategy.radical +1193 -0
- package/dist/index.js +22690 -6064
- package/package.json +1 -1
- package/dist/chunk-KI4NVSTU.js +0 -1763
- package/dist/elkLayout-WC6AXWOG.js +0 -185
- package/dist/hub-catalogue/adr/adr-api-versioning.radical +0 -53
- package/dist/hub-catalogue/adr/adr-auth-strategy.radical +0 -53
- package/dist/hub-catalogue/adr/adr-caching-strategy.radical +0 -59
- package/dist/hub-catalogue/adr/adr-data-consistency-model.radical +0 -40
- package/dist/hub-catalogue/adr/adr-data-store.radical +0 -47
- package/dist/hub-catalogue/adr/adr-deployment-strategy.radical +0 -53
- package/dist/hub-catalogue/adr/adr-event-schema-evolution.radical +0 -53
- package/dist/hub-catalogue/adr/adr-integration-style.radical +0 -50
- package/dist/hub-catalogue/adr/adr-ledger-reconciliation-strategy.radical +0 -38
- package/dist/hub-catalogue/adr/adr-llm-provider-strategy.radical +0 -40
- package/dist/hub-catalogue/adr/adr-marketplace-payments-model.radical +0 -39
- package/dist/hub-catalogue/adr/adr-multi-region.radical +0 -60
- package/dist/hub-catalogue/adr/adr-multi-tenancy-strategy.radical +0 -41
- package/dist/hub-catalogue/adr/adr-observability.radical +0 -59
- package/dist/hub-catalogue/adr/adr-realtime-transport.radical +0 -38
- package/dist/hub-catalogue/adr/adr-tech-stack.radical +0 -45
- package/dist/hub-catalogue/adr/adr-zero-trust-network.radical +0 -40
- package/dist/hub-catalogue/blueprint/bp-ai-assistant-platform.radical +0 -1641
- package/dist/hub-catalogue/blueprint/bp-analytical-data-platform.radical +0 -1428
- package/dist/hub-catalogue/blueprint/bp-ecommerce-platform.radical +0 -1989
- package/dist/hub-catalogue/blueprint/bp-fintech-ledger-platform.radical +0 -1701
- package/dist/hub-catalogue/blueprint/bp-marketplace-platform.radical +0 -1792
- package/dist/hub-catalogue/blueprint/bp-realtime-collaboration.radical +0 -1421
- package/dist/hub-catalogue/blueprint/bp-saas-b2b-platform.radical +0 -1713
- package/dist/hub-catalogue/fitness-function/ff-accessibility-scan.radical +0 -34
- package/dist/hub-catalogue/fitness-function/ff-ai-eval-gate.radical +0 -52
- package/dist/hub-catalogue/fitness-function/ff-api-contract.radical +0 -36
- package/dist/hub-catalogue/fitness-function/ff-capacity-load-test.radical +0 -67
- package/dist/hub-catalogue/fitness-function/ff-carbon-footprint-guard.radical +0 -62
- package/dist/hub-catalogue/fitness-function/ff-change-failure-rate.radical +0 -45
- package/dist/hub-catalogue/fitness-function/ff-chaos-resilience-test.radical +0 -53
- package/dist/hub-catalogue/fitness-function/ff-cost-efficiency-guard.radical +0 -64
- package/dist/hub-catalogue/fitness-function/ff-coupling-guard.radical +0 -45
- package/dist/hub-catalogue/fitness-function/ff-data-integrity-check.radical +0 -51
- package/dist/hub-catalogue/fitness-function/ff-data-residency.radical +0 -43
- package/dist/hub-catalogue/fitness-function/ff-dependency-rules.radical +0 -37
- package/dist/hub-catalogue/fitness-function/ff-deploy-frequency.radical +0 -46
- package/dist/hub-catalogue/fitness-function/ff-dr-drill-success.radical +0 -52
- package/dist/hub-catalogue/fitness-function/ff-duplication-guard.radical +0 -53
- package/dist/hub-catalogue/fitness-function/ff-error-budget.radical +0 -59
- package/dist/hub-catalogue/fitness-function/ff-fail-safe-verification.radical +0 -34
- package/dist/hub-catalogue/fitness-function/ff-infra-drift.radical +0 -34
- package/dist/hub-catalogue/fitness-function/ff-latency-slo.radical +0 -59
- package/dist/hub-catalogue/fitness-function/ff-lead-time.radical +0 -44
- package/dist/hub-catalogue/fitness-function/ff-ledger-balance-integrity.radical +0 -45
- package/dist/hub-catalogue/fitness-function/ff-license-compliance.radical +0 -43
- package/dist/hub-catalogue/fitness-function/ff-mttr.radical +0 -45
- package/dist/hub-catalogue/fitness-function/ff-noisy-neighbor-guard.radical +0 -66
- package/dist/hub-catalogue/fitness-function/ff-sast-scan.radical +0 -35
- package/dist/hub-catalogue/fitness-function/ff-scale-out-verification.radical +0 -66
- package/dist/hub-catalogue/fitness-function/ff-security-scan.radical +0 -45
- package/dist/hub-catalogue/fitness-function/ff-startup-shutdown-check.radical +0 -66
- package/dist/hub-catalogue/fitness-function/ff-sync-convergence-test.radical +0 -45
- package/dist/hub-catalogue/fitness-function/ff-test-coverage.radical +0 -43
- package/dist/hub-catalogue/fitness-function/ff-web-vitals.radical +0 -57
- package/dist/hub-catalogue/pattern/pattern-anti-corruption-layer.radical +0 -88
- package/dist/hub-catalogue/pattern/pattern-api-gateway.radical +0 -168
- package/dist/hub-catalogue/pattern/pattern-bff.radical +0 -179
- package/dist/hub-catalogue/pattern/pattern-bulkhead.radical +0 -114
- package/dist/hub-catalogue/pattern/pattern-circuit-breaker.radical +0 -219
- package/dist/hub-catalogue/pattern/pattern-cqrs.radical +0 -195
- package/dist/hub-catalogue/pattern/pattern-crdt-sync.radical +0 -200
- package/dist/hub-catalogue/pattern/pattern-event-driven.radical +0 -210
- package/dist/hub-catalogue/pattern/pattern-event-sourced-ledger.radical +0 -211
- package/dist/hub-catalogue/pattern/pattern-hexagonal.radical +0 -196
- package/dist/hub-catalogue/pattern/pattern-microservices.radical +0 -262
- package/dist/hub-catalogue/pattern/pattern-rag-pipeline.radical +0 -213
- package/dist/hub-catalogue/pattern/pattern-rate-limiter.radical +0 -114
- package/dist/hub-catalogue/pattern/pattern-saga.radical +0 -208
- package/dist/hub-catalogue/pattern/pattern-sidecar.radical +0 -123
- package/dist/hub-catalogue/pattern/pattern-strangler-fig.radical +0 -227
- package/dist/hub-catalogue/pattern/pattern-transactional-outbox.radical +0 -209
- package/dist/hub-catalogue/requirement/req-accessibility.radical +0 -48
- package/dist/hub-catalogue/requirement/req-ai-autonomous-resolution.radical +0 -51
- package/dist/hub-catalogue/requirement/req-ai-groundedness.radical +0 -45
- package/dist/hub-catalogue/requirement/req-ai-human-handoff.radical +0 -46
- package/dist/hub-catalogue/requirement/req-alerting.radical +0 -52
- package/dist/hub-catalogue/requirement/req-api-response-time.radical +0 -51
- package/dist/hub-catalogue/requirement/req-api-standard.radical +0 -45
- package/dist/hub-catalogue/requirement/req-audit-logging.radical +0 -43
- package/dist/hub-catalogue/requirement/req-auth-response-time.radical +0 -45
- package/dist/hub-catalogue/requirement/req-auth.radical +0 -43
- package/dist/hub-catalogue/requirement/req-autoscaling.radical +0 -62
- package/dist/hub-catalogue/requirement/req-availability.radical +0 -50
- package/dist/hub-catalogue/requirement/req-backward-compatibility.radical +0 -46
- package/dist/hub-catalogue/requirement/req-batch-job-completion.radical +0 -50
- package/dist/hub-catalogue/requirement/req-carbon-efficiency.radical +0 -64
- package/dist/hub-catalogue/requirement/req-centralised-logging.radical +0 -45
- package/dist/hub-catalogue/requirement/req-ci-pipeline-time.radical +0 -43
- package/dist/hub-catalogue/requirement/req-code-complexity.radical +0 -43
- package/dist/hub-catalogue/requirement/req-config-propagation.radical +0 -45
- package/dist/hub-catalogue/requirement/req-data-integrity.radical +0 -35
- package/dist/hub-catalogue/requirement/req-data-retention.radical +0 -44
- package/dist/hub-catalogue/requirement/req-db-query-response.radical +0 -44
- package/dist/hub-catalogue/requirement/req-disaster-recovery.radical +0 -59
- package/dist/hub-catalogue/requirement/req-distributed-tracing.radical +0 -45
- package/dist/hub-catalogue/requirement/req-encryption.radical +0 -49
- package/dist/hub-catalogue/requirement/req-error-rate.radical +0 -45
- package/dist/hub-catalogue/requirement/req-error-recovery.radical +0 -34
- package/dist/hub-catalogue/requirement/req-event-schema-compatibility.radical +0 -37
- package/dist/hub-catalogue/requirement/req-fail-safe-default.radical +0 -55
- package/dist/hub-catalogue/requirement/req-fast-startup-graceful-shutdown.radical +0 -69
- package/dist/hub-catalogue/requirement/req-gdpr-erasure.radical +0 -44
- package/dist/hub-catalogue/requirement/req-graceful-degradation.radical +0 -39
- package/dist/hub-catalogue/requirement/req-health-checks.radical +0 -43
- package/dist/hub-catalogue/requirement/req-iac.radical +0 -36
- package/dist/hub-catalogue/requirement/req-idempotency.radical +0 -47
- package/dist/hub-catalogue/requirement/req-input-validation.radical +0 -37
- package/dist/hub-catalogue/requirement/req-least-privilege.radical +0 -47
- package/dist/hub-catalogue/requirement/req-ledger-immutability.radical +0 -38
- package/dist/hub-catalogue/requirement/req-mfa.radical +0 -36
- package/dist/hub-catalogue/requirement/req-ml-extraction-accuracy.radical +0 -42
- package/dist/hub-catalogue/requirement/req-onboarding-time.radical +0 -42
- package/dist/hub-catalogue/requirement/req-page-load-time.radical +0 -59
- package/dist/hub-catalogue/requirement/req-payout-latency.radical +0 -46
- package/dist/hub-catalogue/requirement/req-presence-latency.radical +0 -46
- package/dist/hub-catalogue/requirement/req-rate-limiting.radical +0 -45
- package/dist/hub-catalogue/requirement/req-report-generation.radical +0 -44
- package/dist/hub-catalogue/requirement/req-resource-efficiency.radical +0 -64
- package/dist/hub-catalogue/requirement/req-resource-headroom.radical +0 -53
- package/dist/hub-catalogue/requirement/req-resource-isolation.radical +0 -37
- package/dist/hub-catalogue/requirement/req-search-response-time.radical +0 -44
- package/dist/hub-catalogue/requirement/req-secrets-management.radical +0 -45
- package/dist/hub-catalogue/requirement/req-task-success-rate.radical +0 -42
- package/dist/hub-catalogue/requirement/req-test-coverage.radical +0 -42
- package/dist/hub-catalogue/requirement/req-throughput.radical +0 -55
- package/dist/hub-catalogue/requirement/req-vulnerability-scanning.radical +0 -52
- package/dist/hub-catalogue/requirement/req-zero-downtime-deploy.radical +0 -39
|
@@ -0,0 +1,864 @@
|
|
|
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; who owns each; and how the build enforces it on the code there is today.",
|
|
7
|
+
"tags": [
|
|
8
|
+
"maintainability",
|
|
9
|
+
"modularity",
|
|
10
|
+
"dependencies",
|
|
11
|
+
"architecture rules",
|
|
12
|
+
"cycles",
|
|
13
|
+
"shared kernel",
|
|
14
|
+
"codeowners"
|
|
15
|
+
],
|
|
16
|
+
"requiredMetamodel": "c4-ddd-governance-builtin",
|
|
17
|
+
"concern": {
|
|
18
|
+
"id": "module-boundaries",
|
|
19
|
+
"trigger": "LIST NODES WHERE (type = \"container\" OR type = \"webapp\") AND external != true",
|
|
20
|
+
"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.",
|
|
21
|
+
"group": "architecture"
|
|
22
|
+
},
|
|
23
|
+
"sources": [
|
|
24
|
+
{
|
|
25
|
+
"title": "ISO/IEC 25010, Maintainability: modularity, analysability, modifiability, testability",
|
|
26
|
+
"url": "https://iso25000.com/index.php/en/iso-25000-standards/iso-25010"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"title": "Ford, Parsons, Kua, Sadalage: Building Evolutionary Architectures, 2nd ed. (fitness functions)",
|
|
30
|
+
"url": "https://www.oreilly.com/library/view/building-evolutionary-architectures/9781492097532/"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"title": "Martin Fowler: BoundedContext",
|
|
34
|
+
"url": "https://martinfowler.com/bliki/BoundedContext.html"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"title": "Spring Modulith reference documentation",
|
|
38
|
+
"url": "https://docs.spring.io/spring-modulith/reference/"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"title": "Nx: Enforce module boundaries",
|
|
42
|
+
"url": "https://nx.dev/features/enforce-module-boundaries"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"title": "ArchUnit user guide",
|
|
46
|
+
"url": "https://www.archunit.org/userguide/html/000_Index.html"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"title": "dependency-cruiser",
|
|
50
|
+
"url": "https://github.com/sverweij/dependency-cruiser"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"templateParams": [
|
|
54
|
+
{
|
|
55
|
+
"key": "RULES",
|
|
56
|
+
"title": "Dependency rules",
|
|
57
|
+
"label": "How are the allowed dependencies between parts declared?",
|
|
58
|
+
"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.",
|
|
59
|
+
"defaultValue": "allowlist",
|
|
60
|
+
"options": [
|
|
61
|
+
{
|
|
62
|
+
"value": "allowlist",
|
|
63
|
+
"label": "each part lists what it may use",
|
|
64
|
+
"description": "Every part declares the parts it may depend on (Spring Modulith allowedDependencies, import-linter contracts, an explicit map in dependency-cruiser); 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."
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"value": "levels",
|
|
68
|
+
"label": "parts ranked in levels",
|
|
69
|
+
"description": "Each part is tagged with a level (for example app, feature, domain, util) and may depend only on parts of lower levels, never on its own level's peers or higher. Pick it for a monorepo with dozens of libraries, where a list per part would be unmaintainable."
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"key": "ENFORCE",
|
|
75
|
+
"title": "Enforcement",
|
|
76
|
+
"label": "How are the rules enforced on the code there is today?",
|
|
77
|
+
"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.",
|
|
78
|
+
"defaultValue": "fail",
|
|
79
|
+
"options": [
|
|
80
|
+
{
|
|
81
|
+
"value": "fail",
|
|
82
|
+
"label": "every violation fails the build",
|
|
83
|
+
"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."
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"value": "ratchet",
|
|
87
|
+
"label": "existing violations frozen, new ones fail",
|
|
88
|
+
"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."
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"key": "SHARED",
|
|
94
|
+
"title": "Shared code",
|
|
95
|
+
"label": "What may the parts share?",
|
|
96
|
+
"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.",
|
|
97
|
+
"defaultValue": "kernel",
|
|
98
|
+
"options": [
|
|
99
|
+
{
|
|
100
|
+
"value": "kernel",
|
|
101
|
+
"label": "a small shared kernel",
|
|
102
|
+
"description": "A few value types and contracts (money, identifiers, event schemas) live in one shared part that every user of it must approve changes to. Pick it when parts genuinely speak the same language about a few concepts."
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"value": "library",
|
|
106
|
+
"label": "versioned internal libraries",
|
|
107
|
+
"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)."
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"value": "none",
|
|
111
|
+
"label": "nothing but third-party libraries",
|
|
112
|
+
"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."
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"key": "OWNERS",
|
|
118
|
+
"title": "Ownership",
|
|
119
|
+
"label": "Does each part have a team that owns it?",
|
|
120
|
+
"hint": "Boundaries hold better when someone is responsible for each side: a change to a part asks its owners.",
|
|
121
|
+
"defaultValue": "team",
|
|
122
|
+
"options": [
|
|
123
|
+
{
|
|
124
|
+
"value": "team",
|
|
125
|
+
"label": "yes, one owning team per part",
|
|
126
|
+
"description": "Each part has an owning team in CODEOWNERS whose approval a change to it needs. Pick it when more than one team works in the code."
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"value": "collective",
|
|
130
|
+
"label": "no, one team owns the whole codebase",
|
|
131
|
+
"description": "One team owns everything and any member may change any part. Pick it for a single team of up to about eight people."
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"key": "RATCHET_PERCENT",
|
|
137
|
+
"label": "By how much must the baseline of known violations shrink each quarter (%)?",
|
|
138
|
+
"defaultValue": "20",
|
|
139
|
+
"type": "number"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"key": "KERNEL_PERCENT",
|
|
143
|
+
"label": "At most how much of the code may the shared kernel be (% of lines)?",
|
|
144
|
+
"defaultValue": "5",
|
|
145
|
+
"type": "number"
|
|
146
|
+
}
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
"nodes": [
|
|
150
|
+
{
|
|
151
|
+
"id": "need",
|
|
152
|
+
"type": "need",
|
|
153
|
+
"label": "Parts change on their own",
|
|
154
|
+
"x": 0,
|
|
155
|
+
"y": 0,
|
|
156
|
+
"kind": "brief",
|
|
157
|
+
"source": "Hub concern pack: Module boundaries",
|
|
158
|
+
"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."
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"id": "req-allowlist",
|
|
162
|
+
"type": "requirement",
|
|
163
|
+
"label": "Only declared dependencies",
|
|
164
|
+
"x": 260,
|
|
165
|
+
"y": 0,
|
|
166
|
+
"ears_type": "ubiquitous",
|
|
167
|
+
"action": "let each part depend only on the parts it declares as allowed, with 0 undeclared dependencies between parts on the main branch outside the recorded baseline",
|
|
168
|
+
"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).",
|
|
169
|
+
"hubWhen": {
|
|
170
|
+
"RULES": [
|
|
171
|
+
"allowlist"
|
|
172
|
+
]
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"id": "req-levels",
|
|
177
|
+
"type": "requirement",
|
|
178
|
+
"label": "Dependencies point down levels",
|
|
179
|
+
"x": 260,
|
|
180
|
+
"y": 130,
|
|
181
|
+
"ears_type": "ubiquitous",
|
|
182
|
+
"action": "let each part depend only on parts of a lower level, with 0 dependencies on a part of the same or a higher level on the main branch outside the recorded baseline",
|
|
183
|
+
"rationale": "Levels give a large number of parts one direction without a list per part (Nx, enforce module boundaries; ISO/IEC 25010 modularity).",
|
|
184
|
+
"hubWhen": {
|
|
185
|
+
"RULES": [
|
|
186
|
+
"levels"
|
|
187
|
+
]
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"id": "req-public-api",
|
|
192
|
+
"type": "requirement",
|
|
193
|
+
"label": "Parts meet through APIs",
|
|
194
|
+
"x": 260,
|
|
195
|
+
"y": 260,
|
|
196
|
+
"ears_type": "ubiquitous",
|
|
197
|
+
"action": "let a part use another only through that part's published API (its public package or index), with 0 imports of another part's internal files and 0 queries on another part's tables",
|
|
198
|
+
"rationale": "A part whose internals others reach into cannot change them alone, and cannot later be extracted (Fowler, BoundedContext; Spring Modulith, application modules)."
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"id": "req-cycles",
|
|
202
|
+
"type": "requirement",
|
|
203
|
+
"label": "No cycles between parts",
|
|
204
|
+
"x": 260,
|
|
205
|
+
"y": 390,
|
|
206
|
+
"ears_type": "ubiquitous",
|
|
207
|
+
"action": "keep the dependency graph between parts free of cycles, with 0 cycles between modules, packages or libraries",
|
|
208
|
+
"rationale": "Parts in a cycle can only be understood, tested and released together, which makes them one part (Acyclic Dependencies Principle, R. C. Martin; ISO/IEC 25010 modularity)."
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"id": "req-fail",
|
|
212
|
+
"type": "requirement",
|
|
213
|
+
"label": "Violations fail the build",
|
|
214
|
+
"x": 260,
|
|
215
|
+
"y": 520,
|
|
216
|
+
"ears_type": "unwanted-behaviour",
|
|
217
|
+
"unwanted_condition": "a change adds a dependency the rules forbid or a cycle",
|
|
218
|
+
"action": "fail the build of that change before it can be merged, naming the rule and the two parts involved",
|
|
219
|
+
"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).",
|
|
220
|
+
"hubWhen": {
|
|
221
|
+
"ENFORCE": [
|
|
222
|
+
"fail"
|
|
223
|
+
]
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"id": "req-ratchet",
|
|
228
|
+
"type": "requirement",
|
|
229
|
+
"label": "Known violations shrink",
|
|
230
|
+
"x": 260,
|
|
231
|
+
"y": 650,
|
|
232
|
+
"ears_type": "state-driven",
|
|
233
|
+
"precondition": "known violations remain in the recorded baseline",
|
|
234
|
+
"action": "fail any change that adds a violation outside the baseline, and shrink the baseline by at least {{RATCHET_PERCENT}}% each quarter",
|
|
235
|
+
"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 (ArchUnit FreezingArchRule, dependency-cruiser known violations).",
|
|
236
|
+
"hubWhen": {
|
|
237
|
+
"ENFORCE": [
|
|
238
|
+
"ratchet"
|
|
239
|
+
]
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"id": "req-kernel",
|
|
244
|
+
"type": "requirement",
|
|
245
|
+
"label": "Shared kernel stays small",
|
|
246
|
+
"x": 260,
|
|
247
|
+
"y": 780,
|
|
248
|
+
"ears_type": "ubiquitous",
|
|
249
|
+
"action": "keep in the shared kernel only types and contracts used by at least two parts, with no I/O, framework or rule of a single part, at most {{KERNEL_PERCENT}}% of the code, and changes approved by an owner of every part that uses it",
|
|
250
|
+
"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).",
|
|
251
|
+
"hubWhen": {
|
|
252
|
+
"SHARED": [
|
|
253
|
+
"kernel"
|
|
254
|
+
]
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"id": "req-library",
|
|
259
|
+
"type": "requirement",
|
|
260
|
+
"label": "Shared libraries are versioned",
|
|
261
|
+
"x": 260,
|
|
262
|
+
"y": 910,
|
|
263
|
+
"ears_type": "event-driven",
|
|
264
|
+
"trigger": "shared code changes",
|
|
265
|
+
"action": "publish it as a new semantic version of its library, and keep every consumer at most one major version behind the latest for no longer than 90 days",
|
|
266
|
+
"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).",
|
|
267
|
+
"hubWhen": {
|
|
268
|
+
"SHARED": [
|
|
269
|
+
"library"
|
|
270
|
+
]
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"id": "req-no-shared",
|
|
275
|
+
"type": "requirement",
|
|
276
|
+
"label": "Nothing shared but contracts",
|
|
277
|
+
"x": 260,
|
|
278
|
+
"y": 1040,
|
|
279
|
+
"ears_type": "ubiquitous",
|
|
280
|
+
"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",
|
|
281
|
+
"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).",
|
|
282
|
+
"hubWhen": {
|
|
283
|
+
"SHARED": [
|
|
284
|
+
"none"
|
|
285
|
+
]
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
"id": "req-owners",
|
|
290
|
+
"type": "requirement",
|
|
291
|
+
"label": "Every part has an owner",
|
|
292
|
+
"x": 260,
|
|
293
|
+
"y": 1170,
|
|
294
|
+
"ears_type": "ubiquitous",
|
|
295
|
+
"action": "name an owning team in CODEOWNERS for 100% of the parts, and require that team's approval to merge a change to its part",
|
|
296
|
+
"rationale": "A boundary nobody owns is crossed by whoever is in a hurry; owners review what crosses theirs (Conway's law; GitHub CODEOWNERS).",
|
|
297
|
+
"hubWhen": {
|
|
298
|
+
"OWNERS": [
|
|
299
|
+
"team"
|
|
300
|
+
]
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
"id": "sc-allowlist",
|
|
305
|
+
"type": "scenario",
|
|
306
|
+
"label": "Undeclared dependency found",
|
|
307
|
+
"x": 520,
|
|
308
|
+
"y": 0,
|
|
309
|
+
"given": "the ordering module, allowed to use catalog only",
|
|
310
|
+
"when": "a change makes it import a class of billing",
|
|
311
|
+
"then": "the rule check reports the undeclared dependency naming both modules",
|
|
312
|
+
"hubWhen": {
|
|
313
|
+
"RULES": [
|
|
314
|
+
"allowlist"
|
|
315
|
+
]
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"id": "sc-levels",
|
|
320
|
+
"type": "scenario",
|
|
321
|
+
"label": "Upward dependency found",
|
|
322
|
+
"x": 520,
|
|
323
|
+
"y": 130,
|
|
324
|
+
"given": "a domain library and a feature library",
|
|
325
|
+
"when": "the domain library imports the feature library",
|
|
326
|
+
"then": "the rule check reports the dependency on a higher level",
|
|
327
|
+
"hubWhen": {
|
|
328
|
+
"RULES": [
|
|
329
|
+
"levels"
|
|
330
|
+
]
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
"id": "sc-public-api",
|
|
335
|
+
"type": "scenario",
|
|
336
|
+
"label": "Internal access refused",
|
|
337
|
+
"x": 520,
|
|
338
|
+
"y": 260,
|
|
339
|
+
"given": "two parts, each with a published API",
|
|
340
|
+
"when": "one imports the other's internal class",
|
|
341
|
+
"then": "the rule check reports it and the build fails"
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
"id": "sc-cycles",
|
|
345
|
+
"type": "scenario",
|
|
346
|
+
"label": "Cycle refused",
|
|
347
|
+
"x": 520,
|
|
348
|
+
"y": 390,
|
|
349
|
+
"given": "two parts where A depends on B",
|
|
350
|
+
"when": "a change makes B depend on A",
|
|
351
|
+
"then": "the rule check reports the cycle with both parts named and the change is not merged"
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
"id": "sc-fail",
|
|
355
|
+
"type": "scenario",
|
|
356
|
+
"label": "Violation blocks merge",
|
|
357
|
+
"x": 520,
|
|
358
|
+
"y": 520,
|
|
359
|
+
"given": "a pull request that adds a forbidden dependency",
|
|
360
|
+
"when": "the build runs",
|
|
361
|
+
"then": "the build fails naming the rule and both parts, and the pull request cannot be merged",
|
|
362
|
+
"hubWhen": {
|
|
363
|
+
"ENFORCE": [
|
|
364
|
+
"fail"
|
|
365
|
+
]
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"id": "sc-ratchet",
|
|
370
|
+
"type": "scenario",
|
|
371
|
+
"label": "Baseline holds and shrinks",
|
|
372
|
+
"x": 520,
|
|
373
|
+
"y": 650,
|
|
374
|
+
"given": "a baseline of known violations",
|
|
375
|
+
"when": "a change adds a new violation, and a quarter ends",
|
|
376
|
+
"then": "the change fails the build, and the baseline holds at least {{RATCHET_PERCENT}}% fewer violations than a quarter earlier",
|
|
377
|
+
"hubWhen": {
|
|
378
|
+
"ENFORCE": [
|
|
379
|
+
"ratchet"
|
|
380
|
+
]
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
"id": "sc-kernel",
|
|
385
|
+
"type": "scenario",
|
|
386
|
+
"label": "Kernel stays small",
|
|
387
|
+
"x": 520,
|
|
388
|
+
"y": 780,
|
|
389
|
+
"given": "the shared kernel",
|
|
390
|
+
"when": "a change adds code used by one part only, or the kernel passes {{KERNEL_PERCENT}}% of the lines",
|
|
391
|
+
"then": "the check fails and the change is moved into the part that uses it",
|
|
392
|
+
"hubWhen": {
|
|
393
|
+
"SHARED": [
|
|
394
|
+
"kernel"
|
|
395
|
+
]
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
"id": "sc-library",
|
|
400
|
+
"type": "scenario",
|
|
401
|
+
"label": "Library upgraded in time",
|
|
402
|
+
"x": 520,
|
|
403
|
+
"y": 910,
|
|
404
|
+
"given": "a shared library and its consumers",
|
|
405
|
+
"when": "a new major version is published",
|
|
406
|
+
"then": "within 90 days every consumer is on it or the previous major",
|
|
407
|
+
"hubWhen": {
|
|
408
|
+
"SHARED": [
|
|
409
|
+
"library"
|
|
410
|
+
]
|
|
411
|
+
}
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
"id": "sc-no-shared",
|
|
415
|
+
"type": "scenario",
|
|
416
|
+
"label": "Cross-part import refused",
|
|
417
|
+
"x": 520,
|
|
418
|
+
"y": 1040,
|
|
419
|
+
"given": "two parts",
|
|
420
|
+
"when": "one imports a helper from the other",
|
|
421
|
+
"then": "the rule check reports it and the build fails",
|
|
422
|
+
"hubWhen": {
|
|
423
|
+
"SHARED": [
|
|
424
|
+
"none"
|
|
425
|
+
]
|
|
426
|
+
}
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
"id": "sc-owners",
|
|
430
|
+
"type": "scenario",
|
|
431
|
+
"label": "Owner approves change",
|
|
432
|
+
"x": 520,
|
|
433
|
+
"y": 1170,
|
|
434
|
+
"given": "a part owned by a team",
|
|
435
|
+
"when": "someone outside the team opens a pull request changing it",
|
|
436
|
+
"then": "the pull request cannot be merged until the owning team approves it",
|
|
437
|
+
"hubWhen": {
|
|
438
|
+
"OWNERS": [
|
|
439
|
+
"team"
|
|
440
|
+
]
|
|
441
|
+
}
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
"id": "adr-allowlist",
|
|
445
|
+
"type": "adr",
|
|
446
|
+
"label": "Declared dependencies only",
|
|
447
|
+
"x": 780,
|
|
448
|
+
"y": 0,
|
|
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; this pack keeps the boundaries between them.",
|
|
453
|
+
"decision": "Each part (module, package or library) declares the parts it may depend on and exposes a published API; any other dependency, any access to another part's internals and any cycle fails the rule check, which runs as a test in every build ({{ENFORCE}}). Shared code: {{SHARED}}. Ownership: {{OWNERS}}. The checker by stack: Spring Modulith (@ApplicationModule(allowedDependencies = …) with ApplicationModules.verify()) for Spring Boot, ArchUnit slices for other JVM code, import-linter contracts for Python, NetArchTest for .NET, dependency-cruiser with an explicit map for TypeScript. Pick the one that runs as a unit test in the existing test runner, so a violation shows up like any failing test.",
|
|
454
|
+
"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 two lines 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.",
|
|
455
|
+
"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.",
|
|
456
|
+
"hubWhen": {
|
|
457
|
+
"RULES": [
|
|
458
|
+
"allowlist"
|
|
459
|
+
]
|
|
460
|
+
}
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
"id": "adr-levels",
|
|
464
|
+
"type": "adr",
|
|
465
|
+
"label": "Parts ranked in levels",
|
|
466
|
+
"x": 780,
|
|
467
|
+
"y": 130,
|
|
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; this pack keeps the boundaries between them.",
|
|
472
|
+
"decision": "Each part is tagged with a level (app, feature, data-access, domain, util; or the levels the codebase needs) and may depend only on parts of lower levels and only through their public entry point; cycles are forbidden. The rules run in every build ({{ENFORCE}}). Shared code: {{SHARED}}. Ownership: {{OWNERS}}. The checker by stack: Nx's @nx/enforce-module-boundaries with type tags (plus scope tags per domain) in a TypeScript monorepo, eslint-plugin-boundaries without Nx, ArchUnit layeredArchitecture() over module packages on the JVM, import-linter's layers contract for Python.",
|
|
473
|
+
"consequences": "• One rule covers dozens of parts; a new library only needs its tags.\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 when that matters.\n• Boundaries hold only while the lint runs in every build.",
|
|
474
|
+
"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.",
|
|
475
|
+
"hubWhen": {
|
|
476
|
+
"RULES": [
|
|
477
|
+
"levels"
|
|
478
|
+
]
|
|
479
|
+
}
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
"id": "adr-shared-kernel",
|
|
483
|
+
"type": "adr",
|
|
484
|
+
"label": "A small shared kernel",
|
|
485
|
+
"x": 780,
|
|
486
|
+
"y": 260,
|
|
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; this pack keeps the boundaries between them.",
|
|
491
|
+
"decision": "Code shared between parts lives in one shared kernel: value types and contracts (money, identifiers, event schemas) used by at least two parts, with no I/O, no framework and no rule of a single part, at most {{KERNEL_PERCENT}}% of the source lines. Every part that uses the kernel has an owner among its CODEOWNERS, so a change to it is approved by them all.",
|
|
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": 390,
|
|
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; this pack keeps the boundaries between them.",
|
|
510
|
+
"decision": "Code shared between parts is published as internal libraries 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; Renovate opens the upgrade pull requests, minor and patch versions merge automatically on green builds, and no consumer stays more than one major version behind for over 90 days.",
|
|
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": 520,
|
|
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; this pack keeps the boundaries between them.",
|
|
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
|
+
"category": "structural",
|
|
545
|
+
"threshold": "0 cycles between modules, packages or libraries on the main branch",
|
|
546
|
+
"description": "A dependency rule in the build fails on any cycle between the folders that make up the parts. On the JVM the same check is ArchUnit's slices().matching(\"..(*)..\").should().beFreeOfCycles(); for Python, import-linter's independence contract.\n\nTool: dependency-cruiser\n\n```js\n// .dependency-cruiser.cjs\nmodule.exports = {\n forbidden: [{\n name: 'no-circular',\n comment: 'ADR Module boundaries: parts in a cycle are one part',\n severity: 'error',\n from: { path: '^src/' },\n to: { circular: true },\n }],\n options: { tsConfig: { fileName: 'tsconfig.json' }, doNotFollow: { path: 'node_modules' } },\n}\n// package.json: \"check:deps\": \"depcruise src --config .dependency-cruiser.cjs\"\n```"
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
"id": "ff-public-api",
|
|
550
|
+
"type": "fitness-fn",
|
|
551
|
+
"label": "Only public APIs used",
|
|
552
|
+
"x": 1040,
|
|
553
|
+
"y": 130,
|
|
554
|
+
"category": "structural",
|
|
555
|
+
"threshold": "0 imports from one part into another part's internal files",
|
|
556
|
+
"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() and Nx's module boundaries do the same in their stacks.\n\nTool: dependency-cruiser\n\n```js\n// .dependency-cruiser.cjs\nmodule.exports = {\n 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}\n```"
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
"id": "ff-allowlist",
|
|
560
|
+
"type": "fitness-fn",
|
|
561
|
+
"label": "Only declared dependencies",
|
|
562
|
+
"x": 1040,
|
|
563
|
+
"y": 260,
|
|
564
|
+
"category": "structural",
|
|
565
|
+
"threshold": "0 dependencies on modules a module does not declare, 0 accesses to internals and 0 cycles between modules",
|
|
566
|
+
"description": "Each module declares its allowed dependencies in package-info.java; a test lets Spring Modulith find the modules and verify every dependency against those lists, and writes the module diagram. In Python, import-linter contracts per module do the same.\n\nTool: Spring Modulith (ArchUnit underneath)\n\n```java\n// ordering/package-info.java\n@ApplicationModule(allowedDependencies = { \"catalog\", \"customer::api\" })\npackage com.example.shop.ordering;\n\nclass ModuleStructureTest {\n static final ApplicationModules modules = ApplicationModules.of(ShopApplication.class);\n\n @Test\n void modulesUseOnlyDeclaredDependencies() {\n modules.verify(); // fails on undeclared dependencies, internals and cycles\n }\n\n @Test\n void writeDocumentation() {\n new Documenter(modules).writeModulesAsPlantUml();\n }\n}\n```",
|
|
567
|
+
"hubWhen": {
|
|
568
|
+
"RULES": [
|
|
569
|
+
"allowlist"
|
|
570
|
+
]
|
|
571
|
+
}
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
"id": "ff-levels",
|
|
575
|
+
"type": "fitness-fn",
|
|
576
|
+
"label": "Dependencies point down levels",
|
|
577
|
+
"x": 1040,
|
|
578
|
+
"y": 390,
|
|
579
|
+
"category": "structural",
|
|
580
|
+
"threshold": "0 dependencies on a library of the same or a higher level",
|
|
581
|
+
"description": "Each Nx project is tagged with its level; the lint rule fails when a project depends on a project of a level it may not use, or imports past a library's public entry point.\n\nTool: Nx module boundaries (@nx/enforce-module-boundaries)\n\n```js\n// eslint.config.mjs\nimport nx from '@nx/eslint-plugin'\nexport default [\n ...nx.configs['flat/base'],\n {\n files: ['**/*.ts'],\n rules: {\n '@nx/enforce-module-boundaries': ['error', {\n enforceBuildableLibDependency: true,\n depConstraints: [\n { sourceTag: 'type:app', onlyDependOnLibsWithTags: ['type:feature', 'type:data-access', 'type:domain', 'type:util'] },\n { sourceTag: 'type:feature', onlyDependOnLibsWithTags: ['type:data-access', 'type:domain', 'type:util'] },\n { sourceTag: 'type:data-access', onlyDependOnLibsWithTags: ['type:domain', 'type:util'] },\n { sourceTag: 'type:domain', onlyDependOnLibsWithTags: ['type:util'] },\n { sourceTag: 'type:util', onlyDependOnLibsWithTags: [] },\n ],\n }],\n },\n },\n]\n```",
|
|
582
|
+
"hubWhen": {
|
|
583
|
+
"RULES": [
|
|
584
|
+
"levels"
|
|
585
|
+
]
|
|
586
|
+
}
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
"id": "ff-ratchet",
|
|
590
|
+
"type": "fitness-fn",
|
|
591
|
+
"label": "Known violations frozen",
|
|
592
|
+
"x": 1040,
|
|
593
|
+
"y": 520,
|
|
594
|
+
"category": "structural",
|
|
595
|
+
"threshold": "0 new violations outside the baseline; the baseline shrinks by at least {{RATCHET_PERCENT}}% each quarter",
|
|
596
|
+
"description": "The rules run with today's violations frozen in a baseline committed to the repository: a new violation fails, a fixed one is removed from the store automatically. A quarterly review compares the size of the baseline with the quarter before. With dependency-cruiser the same is `depcruise-baseline` and `--ignore-known`.\n\nTool: ArchUnit FreezingArchRule\n\n```java\n@AnalyzeClasses(packages = \"com.example.shop\")\nclass FrozenRulesTest {\n // archunit.properties:\n // freeze.store.default.path=src/test/resources/archunit_store\n // freeze.store.default.allowStoreCreation=true (first run only)\n // freeze.refreeze=false\n @ArchTest\n static final ArchRule noCycles =\n freeze(slices().matching(\"com.example.shop.(*)..\").should().beFreeOfCycles());\n\n @ArchTest\n static final ArchRule noInternals =\n freeze(noClasses().that().resideInAPackage(\"com.example.shop.ordering..\")\n .should().dependOnClassesThat().resideInAPackage(\"com.example.shop.billing.internal..\"));\n}\n```",
|
|
597
|
+
"hubWhen": {
|
|
598
|
+
"ENFORCE": [
|
|
599
|
+
"ratchet"
|
|
600
|
+
]
|
|
601
|
+
}
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
"id": "ff-kernel",
|
|
605
|
+
"type": "fitness-fn",
|
|
606
|
+
"label": "Shared kernel stays small",
|
|
607
|
+
"x": 1040,
|
|
608
|
+
"y": 650,
|
|
609
|
+
"category": "structural",
|
|
610
|
+
"threshold": "The shared kernel imports no part and no I/O library, and holds at most {{KERNEL_PERCENT}}% of the source lines",
|
|
611
|
+
"description": "A dependency rule keeps the kernel free of the parts and of I/O; a second step in the same job compares the kernel's line count with the whole and fails above the limit.\n\nTool: dependency-cruiser and cloc\n\n```js\n// .dependency-cruiser.cjs\nmodule.exports = {\n 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/(pg|mongodb|axios|express|fastify|kafkajs)'] },\n }],\n}\n// CI: 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```",
|
|
612
|
+
"hubWhen": {
|
|
613
|
+
"SHARED": [
|
|
614
|
+
"kernel"
|
|
615
|
+
]
|
|
616
|
+
}
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
"id": "ff-library",
|
|
620
|
+
"type": "fitness-fn",
|
|
621
|
+
"label": "Library versions not left behind",
|
|
622
|
+
"x": 1040,
|
|
623
|
+
"y": 780,
|
|
624
|
+
"category": "process",
|
|
625
|
+
"threshold": "An update pull request for a new internal library version is opened within 1 day; no consumer stays more than one major version behind for over 90 days",
|
|
626
|
+
"description": "Renovate watches the internal registry and opens a pull request in every consumer when a shared library is released; patch and minor versions merge automatically on green tests, majors go to the owning team, and the dependency dashboard shows who lags.\n\nTool: Renovate\n\n```json\n{\n \"$schema\": \"https://docs.renovatebot.com/renovate-schema.json\",\n \"extends\": [\"config:recommended\", \":dependencyDashboard\"],\n \"packageRules\": [\n {\n \"matchPackageNames\": [\"@shop/**\"],\n \"groupName\": \"internal libraries\",\n \"schedule\": [\"at any time\"],\n \"automerge\": true,\n \"matchUpdateTypes\": [\"minor\", \"patch\"]\n },\n {\n \"matchPackageNames\": [\"@shop/**\"],\n \"matchUpdateTypes\": [\"major\"],\n \"labels\": [\"internal-major\"],\n \"prPriority\": 5\n }\n ]\n}\n```",
|
|
627
|
+
"hubWhen": {
|
|
628
|
+
"SHARED": [
|
|
629
|
+
"library"
|
|
630
|
+
]
|
|
631
|
+
}
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
"id": "ff-no-shared",
|
|
635
|
+
"type": "fitness-fn",
|
|
636
|
+
"label": "No code shared between parts",
|
|
637
|
+
"x": 1040,
|
|
638
|
+
"y": 910,
|
|
639
|
+
"category": "structural",
|
|
640
|
+
"threshold": "0 imports from one part's folder into another's",
|
|
641
|
+
"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\nTool: dependency-cruiser\n\n```js\n// .dependency-cruiser.cjs\nmodule.exports = {\n 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}\n```",
|
|
642
|
+
"hubWhen": {
|
|
643
|
+
"SHARED": [
|
|
644
|
+
"none"
|
|
645
|
+
]
|
|
646
|
+
}
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
"id": "ff-owners",
|
|
650
|
+
"type": "fitness-fn",
|
|
651
|
+
"label": "Every part has owners",
|
|
652
|
+
"x": 1040,
|
|
653
|
+
"y": 1040,
|
|
654
|
+
"category": "process",
|
|
655
|
+
"threshold": "100% of the part folders are matched by a CODEOWNERS entry naming an existing team; branch protection requires code owner review",
|
|
656
|
+
"description": "A workflow validates CODEOWNERS on every pull request: every file is owned, and each owner exists and has write access. Branch protection on main requires a review from code owners.\n\nTool: codeowners-validator (GitHub Action) with GitHub branch protection\n\n```yaml\n# .github/workflows/codeowners.yml\nname: CODEOWNERS\non: [pull_request]\njobs:\n validate:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n - uses: mszostok/codeowners-validator@v0.7.4\n with:\n checks: \"files,owners,duppatterns,syntax\"\n experimental_checks: \"notowned\"\n github_access_token: \"${{ secrets.OWNERS_VALIDATOR_TOKEN }}\"\n```",
|
|
657
|
+
"hubWhen": {
|
|
658
|
+
"OWNERS": [
|
|
659
|
+
"team"
|
|
660
|
+
]
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
],
|
|
664
|
+
"relations": [
|
|
665
|
+
{
|
|
666
|
+
"id": "req-allowlist--derives--need",
|
|
667
|
+
"sourceId": "req-allowlist",
|
|
668
|
+
"targetId": "need",
|
|
669
|
+
"relationType": "derives"
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
"id": "req-levels--derives--need",
|
|
673
|
+
"sourceId": "req-levels",
|
|
674
|
+
"targetId": "need",
|
|
675
|
+
"relationType": "derives"
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
"id": "req-public-api--derives--need",
|
|
679
|
+
"sourceId": "req-public-api",
|
|
680
|
+
"targetId": "need",
|
|
681
|
+
"relationType": "derives"
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
"id": "req-cycles--derives--need",
|
|
685
|
+
"sourceId": "req-cycles",
|
|
686
|
+
"targetId": "need",
|
|
687
|
+
"relationType": "derives"
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
"id": "req-fail--derives--need",
|
|
691
|
+
"sourceId": "req-fail",
|
|
692
|
+
"targetId": "need",
|
|
693
|
+
"relationType": "derives"
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
"id": "req-ratchet--derives--need",
|
|
697
|
+
"sourceId": "req-ratchet",
|
|
698
|
+
"targetId": "need",
|
|
699
|
+
"relationType": "derives"
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
"id": "req-kernel--derives--need",
|
|
703
|
+
"sourceId": "req-kernel",
|
|
704
|
+
"targetId": "need",
|
|
705
|
+
"relationType": "derives"
|
|
706
|
+
},
|
|
707
|
+
{
|
|
708
|
+
"id": "req-library--derives--need",
|
|
709
|
+
"sourceId": "req-library",
|
|
710
|
+
"targetId": "need",
|
|
711
|
+
"relationType": "derives"
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
"id": "req-no-shared--derives--need",
|
|
715
|
+
"sourceId": "req-no-shared",
|
|
716
|
+
"targetId": "need",
|
|
717
|
+
"relationType": "derives"
|
|
718
|
+
},
|
|
719
|
+
{
|
|
720
|
+
"id": "req-owners--derives--need",
|
|
721
|
+
"sourceId": "req-owners",
|
|
722
|
+
"targetId": "need",
|
|
723
|
+
"relationType": "derives"
|
|
724
|
+
},
|
|
725
|
+
{
|
|
726
|
+
"id": "sc-allowlist--verifies--req-allowlist",
|
|
727
|
+
"sourceId": "sc-allowlist",
|
|
728
|
+
"targetId": "req-allowlist",
|
|
729
|
+
"relationType": "verifies"
|
|
730
|
+
},
|
|
731
|
+
{
|
|
732
|
+
"id": "sc-levels--verifies--req-levels",
|
|
733
|
+
"sourceId": "sc-levels",
|
|
734
|
+
"targetId": "req-levels",
|
|
735
|
+
"relationType": "verifies"
|
|
736
|
+
},
|
|
737
|
+
{
|
|
738
|
+
"id": "sc-public-api--verifies--req-public-api",
|
|
739
|
+
"sourceId": "sc-public-api",
|
|
740
|
+
"targetId": "req-public-api",
|
|
741
|
+
"relationType": "verifies"
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
"id": "sc-cycles--verifies--req-cycles",
|
|
745
|
+
"sourceId": "sc-cycles",
|
|
746
|
+
"targetId": "req-cycles",
|
|
747
|
+
"relationType": "verifies"
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
"id": "sc-fail--verifies--req-fail",
|
|
751
|
+
"sourceId": "sc-fail",
|
|
752
|
+
"targetId": "req-fail",
|
|
753
|
+
"relationType": "verifies"
|
|
754
|
+
},
|
|
755
|
+
{
|
|
756
|
+
"id": "sc-ratchet--verifies--req-ratchet",
|
|
757
|
+
"sourceId": "sc-ratchet",
|
|
758
|
+
"targetId": "req-ratchet",
|
|
759
|
+
"relationType": "verifies"
|
|
760
|
+
},
|
|
761
|
+
{
|
|
762
|
+
"id": "sc-kernel--verifies--req-kernel",
|
|
763
|
+
"sourceId": "sc-kernel",
|
|
764
|
+
"targetId": "req-kernel",
|
|
765
|
+
"relationType": "verifies"
|
|
766
|
+
},
|
|
767
|
+
{
|
|
768
|
+
"id": "sc-library--verifies--req-library",
|
|
769
|
+
"sourceId": "sc-library",
|
|
770
|
+
"targetId": "req-library",
|
|
771
|
+
"relationType": "verifies"
|
|
772
|
+
},
|
|
773
|
+
{
|
|
774
|
+
"id": "sc-no-shared--verifies--req-no-shared",
|
|
775
|
+
"sourceId": "sc-no-shared",
|
|
776
|
+
"targetId": "req-no-shared",
|
|
777
|
+
"relationType": "verifies"
|
|
778
|
+
},
|
|
779
|
+
{
|
|
780
|
+
"id": "sc-owners--verifies--req-owners",
|
|
781
|
+
"sourceId": "sc-owners",
|
|
782
|
+
"targetId": "req-owners",
|
|
783
|
+
"relationType": "verifies"
|
|
784
|
+
},
|
|
785
|
+
{
|
|
786
|
+
"id": "ff-cycles--implements--adr-allowlist",
|
|
787
|
+
"sourceId": "ff-cycles",
|
|
788
|
+
"targetId": "adr-allowlist",
|
|
789
|
+
"relationType": "implements"
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
"id": "ff-cycles--implements--adr-levels",
|
|
793
|
+
"sourceId": "ff-cycles",
|
|
794
|
+
"targetId": "adr-levels",
|
|
795
|
+
"relationType": "implements"
|
|
796
|
+
},
|
|
797
|
+
{
|
|
798
|
+
"id": "ff-public-api--implements--adr-allowlist",
|
|
799
|
+
"sourceId": "ff-public-api",
|
|
800
|
+
"targetId": "adr-allowlist",
|
|
801
|
+
"relationType": "implements"
|
|
802
|
+
},
|
|
803
|
+
{
|
|
804
|
+
"id": "ff-public-api--implements--adr-levels",
|
|
805
|
+
"sourceId": "ff-public-api",
|
|
806
|
+
"targetId": "adr-levels",
|
|
807
|
+
"relationType": "implements"
|
|
808
|
+
},
|
|
809
|
+
{
|
|
810
|
+
"id": "ff-allowlist--implements--adr-allowlist",
|
|
811
|
+
"sourceId": "ff-allowlist",
|
|
812
|
+
"targetId": "adr-allowlist",
|
|
813
|
+
"relationType": "implements"
|
|
814
|
+
},
|
|
815
|
+
{
|
|
816
|
+
"id": "ff-levels--implements--adr-levels",
|
|
817
|
+
"sourceId": "ff-levels",
|
|
818
|
+
"targetId": "adr-levels",
|
|
819
|
+
"relationType": "implements"
|
|
820
|
+
},
|
|
821
|
+
{
|
|
822
|
+
"id": "ff-ratchet--implements--adr-allowlist",
|
|
823
|
+
"sourceId": "ff-ratchet",
|
|
824
|
+
"targetId": "adr-allowlist",
|
|
825
|
+
"relationType": "implements"
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
"id": "ff-ratchet--implements--adr-levels",
|
|
829
|
+
"sourceId": "ff-ratchet",
|
|
830
|
+
"targetId": "adr-levels",
|
|
831
|
+
"relationType": "implements"
|
|
832
|
+
},
|
|
833
|
+
{
|
|
834
|
+
"id": "ff-kernel--implements--adr-shared-kernel",
|
|
835
|
+
"sourceId": "ff-kernel",
|
|
836
|
+
"targetId": "adr-shared-kernel",
|
|
837
|
+
"relationType": "implements"
|
|
838
|
+
},
|
|
839
|
+
{
|
|
840
|
+
"id": "ff-library--implements--adr-shared-libraries",
|
|
841
|
+
"sourceId": "ff-library",
|
|
842
|
+
"targetId": "adr-shared-libraries",
|
|
843
|
+
"relationType": "implements"
|
|
844
|
+
},
|
|
845
|
+
{
|
|
846
|
+
"id": "ff-no-shared--implements--adr-share-nothing",
|
|
847
|
+
"sourceId": "ff-no-shared",
|
|
848
|
+
"targetId": "adr-share-nothing",
|
|
849
|
+
"relationType": "implements"
|
|
850
|
+
},
|
|
851
|
+
{
|
|
852
|
+
"id": "ff-owners--implements--adr-allowlist",
|
|
853
|
+
"sourceId": "ff-owners",
|
|
854
|
+
"targetId": "adr-allowlist",
|
|
855
|
+
"relationType": "implements"
|
|
856
|
+
},
|
|
857
|
+
{
|
|
858
|
+
"id": "ff-owners--implements--adr-levels",
|
|
859
|
+
"sourceId": "ff-owners",
|
|
860
|
+
"targetId": "adr-levels",
|
|
861
|
+
"relationType": "implements"
|
|
862
|
+
}
|
|
863
|
+
]
|
|
864
|
+
}
|