@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
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
COLLAPSED_HEIGHT,
|
|
3
|
-
COLLAPSED_WIDTH,
|
|
4
|
-
ELK_CHILD_SPACING,
|
|
5
|
-
ELK_ROOT_SPACING,
|
|
6
|
-
isContainerType,
|
|
7
|
-
projectToVisibleGraph
|
|
8
|
-
} from "./chunk-KI4NVSTU.js";
|
|
9
|
-
|
|
10
|
-
// ../../packages/layout/src/elkLayout.ts
|
|
11
|
-
import ELK from "elkjs/lib/elk.bundled.js";
|
|
12
|
-
var elk = new ELK();
|
|
13
|
-
var LAYERED_OPTIONS = {
|
|
14
|
-
"elk.algorithm": "layered",
|
|
15
|
-
"elk.direction": "DOWN",
|
|
16
|
-
// SEPARATE_CHILDREN (default): each compound node is laid out independently.
|
|
17
|
-
// Cross-boundary crossing minimisation is handled by our geometric post-process
|
|
18
|
-
// (minimizeCrossings in crossingOpt.ts) — safer than INCLUDE_CHILDREN which
|
|
19
|
-
// crashes ELK's internal scanline constraint calculator with compound graphs.
|
|
20
|
-
// ── Connected-component placement ────────────────────────────────────────
|
|
21
|
-
"elk.separateConnectedComponents": "true",
|
|
22
|
-
// ── Crossing minimisation ─────────────────────────────────────────────────
|
|
23
|
-
"elk.layered.crossingMinimization.strategy": "LAYER_SWEEP",
|
|
24
|
-
"elk.layered.crossingMinimization.greedySwitch.type": "TWO_SIDED",
|
|
25
|
-
"elk.layered.thoroughness": "50",
|
|
26
|
-
"elk.layered.considerModelOrder.strategy": "NONE",
|
|
27
|
-
// ── Node placement ────────────────────────────────────────────────────────
|
|
28
|
-
"elk.layered.nodePlacement.strategy": "NETWORK_SIMPLEX",
|
|
29
|
-
// ── Spacing ───────────────────────────────────────────────────────────────
|
|
30
|
-
...ELK_ROOT_SPACING,
|
|
31
|
-
// ── Post-layout ──────────────────────────────────────────────────────────
|
|
32
|
-
"elk.layered.unnecessaryBendpoints": "true",
|
|
33
|
-
"elk.layered.compaction.postCompaction.strategy": "EDGE_LENGTH",
|
|
34
|
-
"elk.padding": "[top=120, right=30, bottom=30, left=30]"
|
|
35
|
-
};
|
|
36
|
-
var CHILD_OPTIONS = {
|
|
37
|
-
"elk.algorithm": "layered",
|
|
38
|
-
"elk.direction": "RIGHT",
|
|
39
|
-
"elk.separateConnectedComponents": "true",
|
|
40
|
-
"elk.layered.crossingMinimization.strategy": "LAYER_SWEEP",
|
|
41
|
-
"elk.layered.crossingMinimization.greedySwitch.type": "TWO_SIDED",
|
|
42
|
-
"elk.layered.thoroughness": "50",
|
|
43
|
-
"elk.layered.considerModelOrder.strategy": "NONE",
|
|
44
|
-
"elk.layered.nodePlacement.strategy": "NETWORK_SIMPLEX",
|
|
45
|
-
...ELK_CHILD_SPACING,
|
|
46
|
-
"elk.layered.unnecessaryBendpoints": "true",
|
|
47
|
-
"elk.layered.compaction.postCompaction.strategy": "EDGE_LENGTH",
|
|
48
|
-
"elk.padding": "[top=110, right=20, bottom=20, left=20]"
|
|
49
|
-
};
|
|
50
|
-
function ancestorChain(nodeId, nodes) {
|
|
51
|
-
const chain = [nodeId];
|
|
52
|
-
let cur = nodes[nodeId];
|
|
53
|
-
while (cur?.parentId) {
|
|
54
|
-
chain.push(cur.parentId);
|
|
55
|
-
cur = nodes[cur.parentId];
|
|
56
|
-
}
|
|
57
|
-
return chain;
|
|
58
|
-
}
|
|
59
|
-
function lcaContainerId(srcId, tgtId, nodes) {
|
|
60
|
-
if (srcId === tgtId) return nodes[srcId]?.parentId;
|
|
61
|
-
const srcSet = new Set(ancestorChain(srcId, nodes));
|
|
62
|
-
for (const id of ancestorChain(tgtId, nodes)) {
|
|
63
|
-
if (srcSet.has(id) && id !== srcId && id !== tgtId) return id;
|
|
64
|
-
}
|
|
65
|
-
return void 0;
|
|
66
|
-
}
|
|
67
|
-
function buildElkNode(n, allNodes, elkNodeMap) {
|
|
68
|
-
const isCollapsed = n.collapsed && isContainerType(n.type);
|
|
69
|
-
const width = isCollapsed ? COLLAPSED_WIDTH[n.type] : n.width;
|
|
70
|
-
const height = isCollapsed ? COLLAPSED_HEIGHT[n.type] : n.height;
|
|
71
|
-
const childC4 = isCollapsed ? [] : Object.values(allNodes).filter((c) => c.parentId === n.id);
|
|
72
|
-
const children = childC4.map((c) => buildElkNode(c, allNodes, elkNodeMap));
|
|
73
|
-
const elkNode = {
|
|
74
|
-
id: n.id,
|
|
75
|
-
width,
|
|
76
|
-
height,
|
|
77
|
-
layoutOptions: children.length > 0 ? CHILD_OPTIONS : void 0,
|
|
78
|
-
children,
|
|
79
|
-
edges: []
|
|
80
|
-
};
|
|
81
|
-
elkNodeMap[n.id] = elkNode;
|
|
82
|
-
return elkNode;
|
|
83
|
-
}
|
|
84
|
-
function parseElkResult(node, result) {
|
|
85
|
-
if (node.id !== "root" && node.x != null && node.y != null) {
|
|
86
|
-
result[node.id] = { x: node.x, y: node.y, width: node.width, height: node.height };
|
|
87
|
-
}
|
|
88
|
-
for (const child of node.children ?? []) {
|
|
89
|
-
parseElkResult(child, result);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
async function applyElkLayout(inputNodes, inputRelations, opts) {
|
|
93
|
-
const { nodes: c4Nodes, relations: c4Relations } = projectToVisibleGraph(inputNodes, inputRelations);
|
|
94
|
-
const elkNodeMap = {};
|
|
95
|
-
const childOpts = opts?.childOptions ?? CHILD_OPTIONS;
|
|
96
|
-
const buildWith = (n) => {
|
|
97
|
-
const built = buildElkNode(n, c4Nodes, elkNodeMap);
|
|
98
|
-
const apply = (node) => {
|
|
99
|
-
if (node.children && node.children.length > 0) {
|
|
100
|
-
node.layoutOptions = childOpts;
|
|
101
|
-
for (const c of node.children) apply(c);
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
apply(built);
|
|
105
|
-
return built;
|
|
106
|
-
};
|
|
107
|
-
const rootChildren = Object.values(c4Nodes).filter((n) => !n.parentId).map(buildWith);
|
|
108
|
-
const root = {
|
|
109
|
-
id: "root",
|
|
110
|
-
layoutOptions: opts?.rootOptions ?? LAYERED_OPTIONS,
|
|
111
|
-
children: rootChildren,
|
|
112
|
-
edges: []
|
|
113
|
-
};
|
|
114
|
-
elkNodeMap["root"] = root;
|
|
115
|
-
for (const rel of Object.values(c4Relations)) {
|
|
116
|
-
if (!c4Nodes[rel.sourceId] || !c4Nodes[rel.targetId]) continue;
|
|
117
|
-
const lca = lcaContainerId(rel.sourceId, rel.targetId, c4Nodes);
|
|
118
|
-
const container = (lca ? elkNodeMap[lca] : root) ?? root;
|
|
119
|
-
const edge = { id: rel.id, sources: [rel.sourceId], targets: [rel.targetId] };
|
|
120
|
-
if (!container.edges) container.edges = [];
|
|
121
|
-
container.edges.push(edge);
|
|
122
|
-
}
|
|
123
|
-
try {
|
|
124
|
-
const result = await elk.layout(root);
|
|
125
|
-
const positions = {};
|
|
126
|
-
parseElkResult(result, positions);
|
|
127
|
-
return positions;
|
|
128
|
-
} catch (err) {
|
|
129
|
-
console.error("[ELK] Layout error:", err);
|
|
130
|
-
return {};
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
var TREE_ROOT_OPTIONS = {
|
|
134
|
-
"elk.algorithm": "layered",
|
|
135
|
-
"elk.direction": "DOWN",
|
|
136
|
-
"elk.separateConnectedComponents": "true",
|
|
137
|
-
"elk.spacing.componentComponent": "60",
|
|
138
|
-
"elk.layered.crossingMinimization.strategy": "LAYER_SWEEP",
|
|
139
|
-
"elk.layered.crossingMinimization.greedySwitch.type": "TWO_SIDED",
|
|
140
|
-
"elk.layered.thoroughness": "50",
|
|
141
|
-
// Honour input order so siblings stay close to their declared grouping —
|
|
142
|
-
// the dominant cue users associate with "tree" layouts.
|
|
143
|
-
"elk.layered.considerModelOrder.strategy": "NODES_AND_EDGES",
|
|
144
|
-
"elk.layered.nodePlacement.strategy": "BRANDES_KOEPF",
|
|
145
|
-
"elk.layered.nodePlacement.bk.fixedAlignment": "BALANCED",
|
|
146
|
-
"elk.spacing.nodeNode": "50",
|
|
147
|
-
"elk.layered.spacing.nodeNodeBetweenLayers": "70",
|
|
148
|
-
"elk.spacing.edgeNode": "20",
|
|
149
|
-
"elk.spacing.edgeEdge": "10",
|
|
150
|
-
"elk.layered.compaction.postCompaction.strategy": "LEFT",
|
|
151
|
-
"elk.layered.unnecessaryBendpoints": "true",
|
|
152
|
-
"elk.padding": "[top=120, right=30, bottom=30, left=30]"
|
|
153
|
-
};
|
|
154
|
-
var TREE_CHILD_OPTIONS = {
|
|
155
|
-
// Children of every compound container also flow top-down — this is what
|
|
156
|
-
// produces the visible "nested tree" look (vs. the default ELK config
|
|
157
|
-
// where compound children flow left-to-right).
|
|
158
|
-
"elk.algorithm": "layered",
|
|
159
|
-
"elk.direction": "DOWN",
|
|
160
|
-
"elk.separateConnectedComponents": "true",
|
|
161
|
-
"elk.spacing.componentComponent": "30",
|
|
162
|
-
"elk.layered.crossingMinimization.strategy": "LAYER_SWEEP",
|
|
163
|
-
"elk.layered.crossingMinimization.greedySwitch.type": "TWO_SIDED",
|
|
164
|
-
"elk.layered.thoroughness": "50",
|
|
165
|
-
"elk.layered.considerModelOrder.strategy": "NODES_AND_EDGES",
|
|
166
|
-
"elk.layered.nodePlacement.strategy": "BRANDES_KOEPF",
|
|
167
|
-
"elk.layered.nodePlacement.bk.fixedAlignment": "BALANCED",
|
|
168
|
-
"elk.spacing.nodeNode": "28",
|
|
169
|
-
"elk.layered.spacing.nodeNodeBetweenLayers": "40",
|
|
170
|
-
"elk.spacing.edgeNode": "12",
|
|
171
|
-
"elk.spacing.edgeEdge": "8",
|
|
172
|
-
"elk.layered.compaction.postCompaction.strategy": "LEFT",
|
|
173
|
-
"elk.layered.unnecessaryBendpoints": "true",
|
|
174
|
-
"elk.padding": "[top=110, right=20, bottom=20, left=20]"
|
|
175
|
-
};
|
|
176
|
-
async function applyTreeLayout(c4Nodes, c4Relations) {
|
|
177
|
-
return applyElkLayout(c4Nodes, c4Relations, {
|
|
178
|
-
rootOptions: TREE_ROOT_OPTIONS,
|
|
179
|
-
childOptions: TREE_CHILD_OPTIONS
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
export {
|
|
183
|
-
applyElkLayout,
|
|
184
|
-
applyTreeLayout
|
|
185
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"hub": {
|
|
3
|
-
"id": "adr-api-versioning",
|
|
4
|
-
"category": "adr",
|
|
5
|
-
"name": "API Versioning Policy",
|
|
6
|
-
"description": "Records how public APIs are versioned, what counts as a breaking change and how deprecations are communicated.",
|
|
7
|
-
"tags": [
|
|
8
|
-
"api",
|
|
9
|
-
"versioning",
|
|
10
|
-
"compatibility",
|
|
11
|
-
"governance"
|
|
12
|
-
],
|
|
13
|
-
"requiredMetamodel": "c4-ddd-governance-builtin",
|
|
14
|
-
"templateParams": [
|
|
15
|
-
{
|
|
16
|
-
"key": "VERSIONING_SCHEME",
|
|
17
|
-
"label": "Versioning scheme",
|
|
18
|
-
"hint": "URL path major version (/v1, /v2)",
|
|
19
|
-
"defaultValue": "URL path major version (/v1, /v2)"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"key": "DEPRECATION_MONTHS",
|
|
23
|
-
"label": "Minimum deprecation period (months)",
|
|
24
|
-
"hint": "6",
|
|
25
|
-
"defaultValue": "6"
|
|
26
|
-
}
|
|
27
|
-
],
|
|
28
|
-
"hubRefs": [
|
|
29
|
-
"req-backward-compatibility",
|
|
30
|
-
"req-api-standard",
|
|
31
|
-
"ff-api-contract"
|
|
32
|
-
]
|
|
33
|
-
},
|
|
34
|
-
"nodes": [
|
|
35
|
-
{
|
|
36
|
-
"id": "adr-api-versioning-1",
|
|
37
|
-
"type": "adr",
|
|
38
|
-
"label": "ADR: {{VERSIONING_SCHEME}} API versioning",
|
|
39
|
-
"x": 0,
|
|
40
|
-
"y": 0,
|
|
41
|
-
"width": 180,
|
|
42
|
-
"height": 52,
|
|
43
|
-
"collapsed": false,
|
|
44
|
-
"status": "proposed",
|
|
45
|
-
"date": "",
|
|
46
|
-
"context": "Public and partner APIs must evolve without breaking existing clients, which upgrade on their own schedule. The team needs one rule for what is a breaking change, how a new version is exposed and how long old versions are supported, so that every service does not invent its own policy.",
|
|
47
|
-
"decision": "Version public APIs with {{VERSIONING_SCHEME}}. Additive changes (new optional fields, new endpoints, new enum values where documented as open) are non-breaking and ship within the current version. Removing or renaming fields, changing types or semantics, or tightening validation is breaking and requires a new major version. Deprecated versions remain fully functional for at least {{DEPRECATION_MONTHS}} months, announced via a Deprecation header, the changelog and direct notice to registered consumers.",
|
|
48
|
-
"consequences": "• Clients can rely on a stable contract within a major version and plan migrations.\n• Running two major versions in parallel is normal; the implementation must support it (adapters or parallel routes).\n• The contract-diff check in CI is the enforcement point; a breaking diff fails the build unless the major version changes.\n• Clients must tolerate unknown fields, and this is stated in the API guidelines.\n• Internal service-to-service APIs may use a lighter policy when all consumers are known and deploy together.",
|
|
49
|
-
"alternatives": "1. Header or media-type versioning — cleaner URLs; harder to test in a browser and easy to omit by mistake.\n2. Date-based versioning per account (Stripe style) — fine-grained and gentle for clients; significant implementation complexity.\n3. No versioning, only additive changes forever — simple; accumulates dead fields and eventually forces a big-bang break.\n4. Version per endpoint — maximum flexibility; consumers must track many version numbers."
|
|
50
|
-
}
|
|
51
|
-
],
|
|
52
|
-
"relations": []
|
|
53
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"hub": {
|
|
3
|
-
"id": "adr-auth-strategy",
|
|
4
|
-
"category": "adr",
|
|
5
|
-
"name": "Authentication Strategy",
|
|
6
|
-
"description": "Records how users and machine clients authenticate, and where token validation happens.",
|
|
7
|
-
"tags": [
|
|
8
|
-
"security",
|
|
9
|
-
"authentication",
|
|
10
|
-
"identity"
|
|
11
|
-
],
|
|
12
|
-
"requiredMetamodel": "c4-ddd-governance-builtin",
|
|
13
|
-
"templateParams": [
|
|
14
|
-
{
|
|
15
|
-
"key": "AUTH_MECHANISM",
|
|
16
|
-
"label": "Authentication mechanism",
|
|
17
|
-
"hint": "OAuth 2.0 / OIDC with an external IdP",
|
|
18
|
-
"defaultValue": "OAuth 2.0 / OIDC with an external IdP"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"key": "TOKEN_LIFETIME_MINUTES",
|
|
22
|
-
"label": "Access-token lifetime (min)",
|
|
23
|
-
"hint": "15",
|
|
24
|
-
"defaultValue": "15"
|
|
25
|
-
}
|
|
26
|
-
],
|
|
27
|
-
"hubRefs": [
|
|
28
|
-
"req-auth",
|
|
29
|
-
"req-mfa",
|
|
30
|
-
"pattern-api-gateway",
|
|
31
|
-
"adr-zero-trust-network"
|
|
32
|
-
]
|
|
33
|
-
},
|
|
34
|
-
"nodes": [
|
|
35
|
-
{
|
|
36
|
-
"id": "adr-auth-strategy-1",
|
|
37
|
-
"type": "adr",
|
|
38
|
-
"label": "ADR: {{AUTH_MECHANISM}} for authentication",
|
|
39
|
-
"x": 0,
|
|
40
|
-
"y": 0,
|
|
41
|
-
"width": 180,
|
|
42
|
-
"height": 52,
|
|
43
|
-
"collapsed": false,
|
|
44
|
-
"status": "proposed",
|
|
45
|
-
"date": "",
|
|
46
|
-
"context": "Human users and machine clients must authenticate to the APIs. Requirements include single sign-on with the organisation's identity provider, stateless verification at the API layer, short-lived credentials with refresh, revocation on compromise, support for service-to-service calls, and MFA for privileged operations. Building and operating an in-house credential store is a liability the team wants to avoid.",
|
|
47
|
-
"decision": "Use {{AUTH_MECHANISM}}. Users authenticate with the Authorization Code flow with PKCE; services use the Client Credentials flow. Access tokens are JWTs with a lifetime of {{TOKEN_LIFETIME_MINUTES}} minutes, validated at the API gateway against the IdP's JWKS; refresh tokens are rotated on use and revoked server-side.",
|
|
48
|
-
"consequences": "• No passwords are stored or verified by our services.\n• Every service can validate tokens locally; the IdP is not on the request path.\n• Short token lifetimes bound the damage of a leaked token; revocation of long sessions is handled via refresh-token rotation.\n• The IdP becomes a critical dependency for login (not for already-issued tokens) and needs its own availability review.\n• Authorisation (roles, scopes, tenant claims) must be designed on top; authentication alone does not decide what a caller may do.",
|
|
49
|
-
"alternatives": "1. Server-side sessions with cookies — simple for a single web app; does not fit APIs consumed by multiple clients and services.\n2. Self-issued JWTs with our own user store — full control; we own credential storage, password policy, MFA and breach response.\n3. API keys per client — trivial to implement; no identity of the human behind the call, hard to rotate, no standard for scopes.\n4. Mutual TLS for all clients — strong service-to-service story; impractical for browsers and mobile apps."
|
|
50
|
-
}
|
|
51
|
-
],
|
|
52
|
-
"relations": []
|
|
53
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"hub": {
|
|
3
|
-
"id": "adr-caching-strategy",
|
|
4
|
-
"category": "adr",
|
|
5
|
-
"name": "Caching Strategy",
|
|
6
|
-
"description": "Records where and how data is cached, how cache entries are invalidated and what staleness is acceptable.",
|
|
7
|
-
"tags": [
|
|
8
|
-
"performance",
|
|
9
|
-
"caching",
|
|
10
|
-
"data",
|
|
11
|
-
"scalability"
|
|
12
|
-
],
|
|
13
|
-
"requiredMetamodel": "c4-ddd-governance-builtin",
|
|
14
|
-
"templateParams": [
|
|
15
|
-
{
|
|
16
|
-
"key": "CACHE_PATTERN",
|
|
17
|
-
"label": "Cache pattern",
|
|
18
|
-
"hint": "Cache-aside",
|
|
19
|
-
"defaultValue": "Cache-aside"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"key": "CACHE_STORE",
|
|
23
|
-
"label": "Cache store",
|
|
24
|
-
"hint": "Redis",
|
|
25
|
-
"defaultValue": "Redis"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"key": "DEFAULT_TTL_SECONDS",
|
|
29
|
-
"label": "Default TTL (s)",
|
|
30
|
-
"hint": "300",
|
|
31
|
-
"defaultValue": "300"
|
|
32
|
-
}
|
|
33
|
-
],
|
|
34
|
-
"hubRefs": [
|
|
35
|
-
"req-api-response-time",
|
|
36
|
-
"req-db-query-response",
|
|
37
|
-
"adr-data-store"
|
|
38
|
-
]
|
|
39
|
-
},
|
|
40
|
-
"nodes": [
|
|
41
|
-
{
|
|
42
|
-
"id": "adr-caching-strategy-1",
|
|
43
|
-
"type": "adr",
|
|
44
|
-
"label": "ADR: {{CACHE_PATTERN}} caching with {{CACHE_STORE}}",
|
|
45
|
-
"x": 0,
|
|
46
|
-
"y": 0,
|
|
47
|
-
"width": 180,
|
|
48
|
-
"height": 52,
|
|
49
|
-
"collapsed": false,
|
|
50
|
-
"status": "proposed",
|
|
51
|
-
"date": "",
|
|
52
|
-
"context": "Read-heavy endpoints exceed their latency budget when every request reaches the database, and the database is the hardest tier to scale. Forces: how stale a read may be for each data class, the write frequency of cached data, the cost of a cache miss storm after a deployment, multi-instance consistency and the operational overhead of another stateful component.",
|
|
53
|
-
"decision": "Use {{CACHE_PATTERN}} caching backed by {{CACHE_STORE}} for read-mostly reference and aggregate data, with a default TTL of {{DEFAULT_TTL_SECONDS}} seconds and explicit invalidation on write for data classes where staleness is not acceptable. Cache keys include the schema version so deployments do not serve incompatible payloads. Caching is opt-in per data class and documented in the service's data catalogue.",
|
|
54
|
-
"consequences": "• Database load and p95 latency drop for the covered endpoints; the cache becomes part of the capacity model.\n• Every cached data class has a declared staleness budget; UI and API contracts state it.\n• Cache unavailability must degrade to direct reads, not to failure; the client library implements this fallback.\n• Thundering-herd protection (request coalescing, jittered TTLs) is required for hot keys.\n• Personal data in the cache is subject to the same encryption, residency and erasure rules as the primary store.",
|
|
55
|
-
"alternatives": "1. No caching, scale the database — simplest consistency; expensive and eventually hits a ceiling.\n2. Read-through / write-through cache — transparent to callers; couples every write to cache availability.\n3. CDN / HTTP caching only — excellent for public, anonymous content; useless for personalised responses.\n4. In-process cache per instance — no extra infrastructure; inconsistent across instances and lost on every deploy."
|
|
56
|
-
}
|
|
57
|
-
],
|
|
58
|
-
"relations": []
|
|
59
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"hub": {
|
|
3
|
-
"id": "adr-data-consistency-model",
|
|
4
|
-
"category": "adr",
|
|
5
|
-
"name": "Data Consistency Model",
|
|
6
|
-
"description": "Records whether cross-service state changes are strongly or eventually consistent, and where the line between the two sits.",
|
|
7
|
-
"tags": [
|
|
8
|
-
"consistency",
|
|
9
|
-
"distributed-systems",
|
|
10
|
-
"data",
|
|
11
|
-
"event-driven"
|
|
12
|
-
],
|
|
13
|
-
"requiredMetamodel": "c4-ddd-governance-builtin",
|
|
14
|
-
"hubRefs": [
|
|
15
|
-
"pattern-saga",
|
|
16
|
-
"pattern-cqrs",
|
|
17
|
-
"pattern-event-driven",
|
|
18
|
-
"req-idempotency",
|
|
19
|
-
"ff-data-integrity-check"
|
|
20
|
-
]
|
|
21
|
-
},
|
|
22
|
-
"nodes": [
|
|
23
|
-
{
|
|
24
|
-
"id": "adr-data-consistency-model-1",
|
|
25
|
-
"type": "adr",
|
|
26
|
-
"label": "ADR: Eventual consistency across service boundaries",
|
|
27
|
-
"width": 180,
|
|
28
|
-
"height": 52,
|
|
29
|
-
"collapsed": false,
|
|
30
|
-
"x": 0,
|
|
31
|
-
"y": 0,
|
|
32
|
-
"status": "proposed",
|
|
33
|
-
"date": "",
|
|
34
|
-
"context": "Data now lives in more than one service's database. Some workflows want the same read-your-writes guarantee a single database gave us for free; others just need to converge eventually. Treating every boundary as strongly consistent means distributed transactions, which cost availability and throughput.",
|
|
35
|
-
"decision": "Each service is strongly consistent within its own transactional boundary. Across service boundaries, consistency is eventual: state changes propagate as domain events, and consumers are built to tolerate a short, bounded lag rather than assume the source has already applied the change.",
|
|
36
|
-
"consequences": "• UIs that read a just-written value across a service boundary need an explicit strategy (optimistic UI, polling, or a synchronous read-your-writes API for that one case) rather than assuming instant propagation.\n• Sagas and event choreography replace distributed transactions for multi-service workflows.\n• Reconciliation jobs are still needed as a backstop for the rare cases where propagation silently fails.\n• Debugging \"why doesn't this read reflect that write\" becomes a recurring class of support question that needs tooling (event lag dashboards).",
|
|
37
|
-
"alternatives": "1. Distributed transactions (2PC/XA) — true strong consistency everywhere, but couples service availability together and doesn't survive partitions well.\n2. Strong consistency via a shared database — simplest mentally, but re-couples the services the boundary was meant to decouple.\n3. Eventual consistency via events (chosen) — services stay independently deployable and available; consumers must be designed for lag."
|
|
38
|
-
}
|
|
39
|
-
]
|
|
40
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"hub": {
|
|
3
|
-
"id": "adr-data-store",
|
|
4
|
-
"category": "adr",
|
|
5
|
-
"name": "Primary Data Store",
|
|
6
|
-
"description": "Records the choice of the main persistence technology and the data-model, consistency and operational trade-offs behind it.",
|
|
7
|
-
"tags": [
|
|
8
|
-
"database",
|
|
9
|
-
"persistence",
|
|
10
|
-
"data"
|
|
11
|
-
],
|
|
12
|
-
"requiredMetamodel": "c4-ddd-governance-builtin",
|
|
13
|
-
"templateParams": [
|
|
14
|
-
{
|
|
15
|
-
"key": "DATABASE",
|
|
16
|
-
"label": "Chosen data store",
|
|
17
|
-
"hint": "PostgreSQL",
|
|
18
|
-
"defaultValue": "PostgreSQL"
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
"hubRefs": [
|
|
22
|
-
"adr-caching-strategy",
|
|
23
|
-
"req-data-integrity",
|
|
24
|
-
"req-db-query-response",
|
|
25
|
-
"adr-multi-tenancy-strategy"
|
|
26
|
-
]
|
|
27
|
-
},
|
|
28
|
-
"nodes": [
|
|
29
|
-
{
|
|
30
|
-
"id": "adr-data-store-1",
|
|
31
|
-
"type": "adr",
|
|
32
|
-
"label": "ADR: {{DATABASE}} as primary data store",
|
|
33
|
-
"x": 0,
|
|
34
|
-
"y": 0,
|
|
35
|
-
"width": 180,
|
|
36
|
-
"height": 52,
|
|
37
|
-
"collapsed": false,
|
|
38
|
-
"status": "proposed",
|
|
39
|
-
"date": "",
|
|
40
|
-
"context": "The service needs a primary store for its transactional data. Forces: shape of the data (relational vs document vs graph), consistency needs (strong vs eventual), dominant query patterns (point lookups, joins, aggregations, search), expected growth, managed-service availability in our cloud, backup/restore and point-in-time recovery, and the team's operational experience.",
|
|
41
|
-
"decision": "Use {{DATABASE}} as the primary transactional store. Specialised needs (full-text search, caching, analytics, time series) are served by purpose-built secondary stores fed from the primary, never the other way round.",
|
|
42
|
-
"consequences": "• Schema changes go through versioned, backward-compatible migrations run by the pipeline.\n• Backups, point-in-time recovery and restore drills are part of the operational baseline.\n• Secondary stores are derived data and may be rebuilt from the primary at any time.\n• Query patterns that fight the chosen model (e.g. deep graph traversal on a relational store) are a signal to introduce a dedicated store, not to bend the primary.\n• Vendor and managed-service lock-in is accepted in exchange for operational simplicity.",
|
|
43
|
-
"alternatives": "1. Document store (MongoDB, DynamoDB) — flexible schema and horizontal scale; weaker for ad-hoc joins and multi-document transactions.\n2. Distributed SQL (CockroachDB, Spanner, YugabyteDB) — relational model with geo-scale; higher cost and latency floor.\n3. Multi-model from day one — each store optimal for its use; operational and consistency complexity too high for the current team size.\n4. Event store as system of record — perfect audit trail; requires CQRS discipline across the whole service."
|
|
44
|
-
}
|
|
45
|
-
],
|
|
46
|
-
"relations": []
|
|
47
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"hub": {
|
|
3
|
-
"id": "adr-deployment-strategy",
|
|
4
|
-
"category": "adr",
|
|
5
|
-
"name": "Deployment Strategy",
|
|
6
|
-
"description": "Records how new versions are rolled out to production and rolled back, balancing risk, speed and infrastructure cost.",
|
|
7
|
-
"tags": [
|
|
8
|
-
"deployment",
|
|
9
|
-
"release",
|
|
10
|
-
"ci-cd",
|
|
11
|
-
"devops"
|
|
12
|
-
],
|
|
13
|
-
"requiredMetamodel": "c4-ddd-governance-builtin",
|
|
14
|
-
"templateParams": [
|
|
15
|
-
{
|
|
16
|
-
"key": "DEPLOY_STRATEGY",
|
|
17
|
-
"label": "Rollout strategy",
|
|
18
|
-
"hint": "Canary",
|
|
19
|
-
"defaultValue": "Canary"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"key": "CANARY_INITIAL_PCT",
|
|
23
|
-
"label": "Initial canary traffic (%)",
|
|
24
|
-
"hint": "5",
|
|
25
|
-
"defaultValue": "5"
|
|
26
|
-
}
|
|
27
|
-
],
|
|
28
|
-
"hubRefs": [
|
|
29
|
-
"req-zero-downtime-deploy",
|
|
30
|
-
"ff-change-failure-rate",
|
|
31
|
-
"ff-deploy-frequency"
|
|
32
|
-
]
|
|
33
|
-
},
|
|
34
|
-
"nodes": [
|
|
35
|
-
{
|
|
36
|
-
"id": "adr-deployment-strategy-1",
|
|
37
|
-
"type": "adr",
|
|
38
|
-
"label": "ADR: {{DEPLOY_STRATEGY}} deployments",
|
|
39
|
-
"x": 0,
|
|
40
|
-
"y": 0,
|
|
41
|
-
"width": 180,
|
|
42
|
-
"height": 52,
|
|
43
|
-
"collapsed": false,
|
|
44
|
-
"status": "proposed",
|
|
45
|
-
"date": "",
|
|
46
|
-
"context": "Releases must reach production without downtime, with a fast and reliable rollback and with early detection of regressions that tests did not catch. Forces: the availability target, whether the database schema can be evolved compatibly, the maturity of production metrics, infrastructure cost tolerance and the number of deployments per day the team aims for.",
|
|
47
|
-
"decision": "Use {{DEPLOY_STRATEGY}} deployments. New versions receive {{CANARY_INITIAL_PCT}}% of traffic first; promotion to 100% is automatic when error rate and latency SLIs stay within budget for the observation window, and rollback is automatic when they do not. All schema changes are expand/contract migrations so both versions can run side by side.",
|
|
48
|
-
"consequences": "• Regressions affect a small share of users and are rolled back automatically.\n• Requires reliable, low-latency SLIs — the deployment gate is only as good as the metrics.\n• Both versions run concurrently: database migrations, message schemas and caches must be compatible across N and N+1.\n• Feature flags decouple release from exposure and are used for changes that cannot be canaried by traffic share.\n• Slightly higher infrastructure cost during rollout; far lower than permanently duplicated environments.",
|
|
49
|
-
"alternatives": "1. Blue-green — instant switch and rollback; doubles the environment and still exposes 100% of users at once.\n2. Rolling update — lowest infrastructure overhead; slower rollback and no traffic-share control.\n3. Recreate (stop, then start) — simplest; incurs downtime and fails the zero-downtime requirement.\n4. Feature-flag-only releases — fine-grained exposure control; does not protect against faults in the new binary itself."
|
|
50
|
-
}
|
|
51
|
-
],
|
|
52
|
-
"relations": []
|
|
53
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"hub": {
|
|
3
|
-
"id": "adr-event-schema-evolution",
|
|
4
|
-
"category": "adr",
|
|
5
|
-
"name": "Event Schema Evolution",
|
|
6
|
-
"description": "Records how event schemas are defined, registered and evolved so that producers and consumers can change independently.",
|
|
7
|
-
"tags": [
|
|
8
|
-
"messaging",
|
|
9
|
-
"event-driven",
|
|
10
|
-
"schema",
|
|
11
|
-
"governance"
|
|
12
|
-
],
|
|
13
|
-
"requiredMetamodel": "c4-ddd-governance-builtin",
|
|
14
|
-
"templateParams": [
|
|
15
|
-
{
|
|
16
|
-
"key": "SCHEMA_FORMAT",
|
|
17
|
-
"label": "Schema format",
|
|
18
|
-
"hint": "Avro",
|
|
19
|
-
"defaultValue": "Avro"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"key": "COMPATIBILITY_MODE",
|
|
23
|
-
"label": "Registry compatibility mode",
|
|
24
|
-
"hint": "BACKWARD",
|
|
25
|
-
"defaultValue": "BACKWARD"
|
|
26
|
-
}
|
|
27
|
-
],
|
|
28
|
-
"hubRefs": [
|
|
29
|
-
"req-event-schema-compatibility",
|
|
30
|
-
"pattern-event-driven",
|
|
31
|
-
"adr-integration-style"
|
|
32
|
-
]
|
|
33
|
-
},
|
|
34
|
-
"nodes": [
|
|
35
|
-
{
|
|
36
|
-
"id": "adr-event-schema-evolution-1",
|
|
37
|
-
"type": "adr",
|
|
38
|
-
"label": "ADR: {{SCHEMA_FORMAT}} with a schema registry",
|
|
39
|
-
"x": 0,
|
|
40
|
-
"y": 0,
|
|
41
|
-
"width": 180,
|
|
42
|
-
"height": 52,
|
|
43
|
-
"collapsed": false,
|
|
44
|
-
"status": "proposed",
|
|
45
|
-
"date": "",
|
|
46
|
-
"context": "Events published to the broker are consumed by services owned by other teams, some unknown to the producer. Without a shared definition and compatibility rules, a field rename by a producer breaks consumers at runtime. Forces: payload size and serialisation speed, tooling for code generation, how strictly compatibility should be enforced and who owns each event.",
|
|
47
|
-
"decision": "Define every event with {{SCHEMA_FORMAT}} schemas registered in a schema registry under {{COMPATIBILITY_MODE}} compatibility. The registry rejects incompatible schema versions; the build pipeline runs the same check earlier. Each event type has an owning team, a documented purpose and a CloudEvents-style envelope (id, type, source, time, trace context).",
|
|
48
|
-
"consequences": "• Consumers can upgrade before or after producers within the compatibility rules; deploy ordering is no longer coupled.\n• Breaking changes require a new event type (or major version suffix) and a migration period, never an in-place change.\n• Code generation from schemas gives typed producers and consumers in every language in use.\n• The registry is a runtime dependency for serialisation and must be highly available and cached client-side.\n• Schema reviews become a lightweight governance step with a visible owner.",
|
|
49
|
-
"alternatives": "1. JSON without a registry — zero tooling; compatibility relies on convention and breaks silently.\n2. Protobuf with schemas in a shared repository — compact and typed; compatibility is enforced only by review unless a registry is added.\n3. JSON Schema with a registry — human-readable; weaker code generation and larger payloads.\n4. Versioned topics per schema change — explicit; topic sprawl and duplicated consumers."
|
|
50
|
-
}
|
|
51
|
-
],
|
|
52
|
-
"relations": []
|
|
53
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"hub": {
|
|
3
|
-
"id": "adr-integration-style",
|
|
4
|
-
"category": "adr",
|
|
5
|
-
"name": "Service Integration Style",
|
|
6
|
-
"description": "Records the default way services communicate — synchronous calls, asynchronous events, or a defined mix — and when each is appropriate.",
|
|
7
|
-
"tags": [
|
|
8
|
-
"integration",
|
|
9
|
-
"messaging",
|
|
10
|
-
"api",
|
|
11
|
-
"distributed-systems"
|
|
12
|
-
],
|
|
13
|
-
"requiredMetamodel": "c4-ddd-governance-builtin",
|
|
14
|
-
"templateParams": [
|
|
15
|
-
{
|
|
16
|
-
"key": "INTEGRATION_STYLE",
|
|
17
|
-
"label": "Default integration style",
|
|
18
|
-
"hint": "Sync REST for queries, async events for state changes",
|
|
19
|
-
"defaultValue": "Sync REST for queries, async events for state changes"
|
|
20
|
-
}
|
|
21
|
-
],
|
|
22
|
-
"hubRefs": [
|
|
23
|
-
"pattern-event-driven",
|
|
24
|
-
"pattern-circuit-breaker",
|
|
25
|
-
"req-graceful-degradation",
|
|
26
|
-
"adr-event-schema-evolution",
|
|
27
|
-
"pattern-bff",
|
|
28
|
-
"pattern-anti-corruption-layer"
|
|
29
|
-
]
|
|
30
|
-
},
|
|
31
|
-
"nodes": [
|
|
32
|
-
{
|
|
33
|
-
"id": "adr-integration-style-1",
|
|
34
|
-
"type": "adr",
|
|
35
|
-
"label": "ADR: {{INTEGRATION_STYLE}} between services",
|
|
36
|
-
"x": 0,
|
|
37
|
-
"y": 0,
|
|
38
|
-
"width": 180,
|
|
39
|
-
"height": 52,
|
|
40
|
-
"collapsed": false,
|
|
41
|
-
"status": "proposed",
|
|
42
|
-
"date": "",
|
|
43
|
-
"context": "Services need to exchange data and trigger work in each other. Synchronous request/response is simple to reason about but couples availability and latency along the call chain. Asynchronous messaging decouples producers from consumers and absorbs load, at the cost of eventual consistency and harder debugging. Forces: latency expectations, tolerance for stale data, failure isolation, ordering guarantees and the team's experience with brokers.",
|
|
44
|
-
"decision": "Adopt {{INTEGRATION_STYLE}}. Reads that a user is waiting on use synchronous calls with timeouts, retries with back-off and circuit breakers. State changes that other services need to know about are published as domain events through the message broker; consumers own their projections. Synchronous calls that fan out to more than two services are a design smell to be reviewed.",
|
|
45
|
-
"consequences": "• Services can be deployed and scaled independently; a slow consumer does not slow the producer.\n• Data is eventually consistent across services; UIs must be designed for it.\n• Every event needs a schema, an owner and a compatibility policy.\n• Distributed tracing and correlation ids across both calls and messages are mandatory for debuggability.\n• Idempotent consumers and the outbox pattern are required to avoid lost or duplicated events.",
|
|
46
|
-
"alternatives": "1. Synchronous only (REST/gRPC) — simplest mental model; availability of the whole chain is the product of its parts.\n2. Asynchronous only — maximal decoupling; awkward for request/response interactions and adds latency to every read.\n3. Shared database integration — no network hop; couples schemas across teams and defeats service autonomy.\n4. Orchestration via a workflow engine — explicit long-running processes; adds a central component and vendor coupling."
|
|
47
|
-
}
|
|
48
|
-
],
|
|
49
|
-
"relations": []
|
|
50
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"hub": {
|
|
3
|
-
"id": "adr-ledger-reconciliation-strategy",
|
|
4
|
-
"category": "adr",
|
|
5
|
-
"name": "Ledger Reconciliation Strategy",
|
|
6
|
-
"description": "Records how the internal journal is kept in agreement with the external bank or processor record — continuously, in a nightly batch, or both.",
|
|
7
|
-
"tags": [
|
|
8
|
-
"fintech",
|
|
9
|
-
"ledger",
|
|
10
|
-
"reconciliation",
|
|
11
|
-
"governance"
|
|
12
|
-
],
|
|
13
|
-
"requiredMetamodel": "c4-ddd-governance-builtin",
|
|
14
|
-
"hubRefs": [
|
|
15
|
-
"pattern-event-sourced-ledger",
|
|
16
|
-
"ff-ledger-balance-integrity",
|
|
17
|
-
"req-disaster-recovery"
|
|
18
|
-
]
|
|
19
|
-
},
|
|
20
|
-
"nodes": [
|
|
21
|
-
{
|
|
22
|
-
"id": "adr-ledger-reconciliation-strategy-1",
|
|
23
|
-
"type": "adr",
|
|
24
|
-
"label": "ADR: Continuous reconciliation with a nightly batch safety net",
|
|
25
|
-
"width": 180,
|
|
26
|
-
"height": 52,
|
|
27
|
-
"collapsed": false,
|
|
28
|
-
"x": 0,
|
|
29
|
-
"y": 0,
|
|
30
|
-
"status": "proposed",
|
|
31
|
-
"date": "",
|
|
32
|
-
"context": "The internal journal and the bank or processor's own records can disagree — a webhook is dropped, an event arrives out of order, a correction happens on the processor's side days later. Left undetected, that drift eventually surfaces as a customer-visible balance error.",
|
|
33
|
-
"decision": "Reconcile continuously: match each inbound settlement event against the journal within minutes of receipt. Back that with a nightly full batch reconciliation against the processor's end-of-day statement, which catches anything the event stream missed — a webhook that never arrived, a late correction, a duplicate.",
|
|
34
|
-
"consequences": "• Most discrepancies surface and are actionable within minutes, while the business context is still fresh.\n• The nightly batch is what actually guarantees completeness — it doesn't depend on every event having arrived, only on the processor's statement being authoritative — so it can't be skipped as \"redundant\" once continuous reconciliation is working.\n• Two reconciliation code paths, streaming and batch, need to agree on what \"matched\" means, or they produce contradictory exception reports.\n• Every discrepancy needs a place to land — a suspense account, not a dropped log line — or reconciliation becomes something that alerts but doesn't actually fix anything.",
|
|
35
|
-
"alternatives": "1. Nightly batch only — simplest to build, but a discrepancy from this morning sits undetected and possibly compounding until the batch runs.\n2. Continuous event-driven only — fast, but blind to anything the event stream itself missed, such as a webhook that was never delivered.\n3. Manual, periodic spreadsheet reconciliation — doesn't scale past a handful of transactions a day and depends entirely on someone remembering to run it.\n4. Continuous plus nightly batch safety net (chosen) — fast detection for the common case, with a completeness guarantee that doesn't depend on the event stream being perfect."
|
|
36
|
-
}
|
|
37
|
-
]
|
|
38
|
-
}
|