@webpieces/nx-webpieces-rules 0.4.908 → 0.4.910
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 +15 -1
- package/package.json +7 -7
- package/src/lib/api-usage/external-systems.js +2 -0
- package/src/lib/api-usage/external-systems.js.map +1 -1
- package/src/lib/graph-filter.client.d.ts +2 -1
- package/src/lib/graph-filter.client.js +16 -4
- package/src/lib/graph-filter.client.js.map +1 -1
- package/src/lib/graph-level-bands.d.ts +3 -0
- package/src/lib/graph-level-bands.js +24 -8
- package/src/lib/graph-level-bands.js.map +1 -1
- package/src/lib/runtime-external-triggers.js +1 -1
- package/src/lib/runtime-external-triggers.js.map +1 -1
- package/src/lib/runtime-graph-io.js +29 -1
- package/src/lib/runtime-graph-io.js.map +1 -1
- package/src/lib/runtime-graph-levels.d.ts +2 -20
- package/src/lib/runtime-graph-levels.js +8 -30
- package/src/lib/runtime-graph-levels.js.map +1 -1
- package/src/lib/runtime-graph-model.d.ts +21 -13
- package/src/lib/runtime-graph-model.js +18 -0
- package/src/lib/runtime-graph-model.js.map +1 -1
- package/src/lib/runtime-graph.d.ts +1 -1
- package/src/lib/runtime-graph.js +15 -6
- package/src/lib/runtime-graph.js.map +1 -1
- package/src/lib/runtime-layout.d.ts +6 -0
- package/src/lib/runtime-layout.js +31 -0
- package/src/lib/runtime-layout.js.map +1 -0
- package/src/lib/runtime-node-levels.d.ts +13 -0
- package/src/lib/runtime-node-levels.js +118 -0
- package/src/lib/runtime-node-levels.js.map +1 -0
- package/src/lib/runtime-remote-calls.js +2 -0
- package/src/lib/runtime-remote-calls.js.map +1 -1
- package/src/lib/runtime-viewer-adapter.js +47 -5
- package/src/lib/runtime-viewer-adapter.js.map +1 -1
- package/src/lib/runtime-visualizer.js +30 -31
- package/src/lib/runtime-visualizer.js.map +1 -1
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.adjacencyFromEdges = adjacencyFromEdges;
|
|
4
4
|
exports.applyCycleCuts = applyCycleCuts;
|
|
5
|
-
exports.runtimeAdjacency = runtimeAdjacency;
|
|
6
5
|
exports.assignLevels = assignLevels;
|
|
7
6
|
const rules_config_1 = require("@webpieces/rules-config");
|
|
8
7
|
const graph_sorter_1 = require("./graph-sorter");
|
|
@@ -17,23 +16,7 @@ const runtime_config_1 = require("./runtime-config");
|
|
|
17
16
|
* computation over the result, with no knowledge of contracts at all. Splitting it also keeps
|
|
18
17
|
* runtime-graph.ts under the file-size limit, which is the visible symptom of the same thing.
|
|
19
18
|
*/
|
|
20
|
-
/**
|
|
21
|
-
* Adjacency (service -> [targets]) used for leveling + cycle checks.
|
|
22
|
-
*
|
|
23
|
-
* TWO KINDS OF EDGE ARE EXCLUDED, and the second is modelled on the first:
|
|
24
|
-
*
|
|
25
|
-
* PUBSUB EDGES. A queue is precisely the thing that decouples producer from consumer: the producer
|
|
26
|
-
* returns as soon as the task is enqueued and never waits on the consumer, so a queued hop is not a
|
|
27
|
-
* runtime dependency in the sense levels and cycle detection mean. Counting them would make the
|
|
28
|
-
* common and correct `A → queue → A` (a service deferring its own work) an architecture cycle, and
|
|
29
|
-
* would rank services by an ordering that does not constrain deploy or startup.
|
|
30
|
-
*
|
|
31
|
-
* EDGES STAMPED `cutLegacyCycle`. The calling project carries a `cutLegacyCycle:<target>` nx tag
|
|
32
|
-
* (see cut-legacy-cycle-resolver.ts) ADMITTING that this hop closes a real cycle which is being
|
|
33
|
-
* tolerated as legacy debt. Unlike a queued hop the coupling is real, so the edge is still drawn —
|
|
34
|
-
* it is only kept out of leveling and cycle detection, which are the two things a cycle makes
|
|
35
|
-
* meaningless.
|
|
36
|
-
*/
|
|
19
|
+
/** RPC adjacency for callers working with an edge list alone. Full runtime layering uses RuntimeNodeLevels. */
|
|
37
20
|
// webpieces-disable no-function-outside-class -- pure graph helper, matches the sibling helpers in this file
|
|
38
21
|
function adjacencyFromEdges(serviceNames, edges) {
|
|
39
22
|
const adj = {};
|
|
@@ -85,8 +68,7 @@ function applyCycleCuts(edges, projects, nodeByServiceName) {
|
|
|
85
68
|
`nothing exempts nothing.`);
|
|
86
69
|
continue;
|
|
87
70
|
}
|
|
88
|
-
//
|
|
89
|
-
// never needs cutting; only a direct call edge is cuttable.
|
|
71
|
+
// Legacy cuts apply to direct calls only. Foreign queues remain visible to cycle detection.
|
|
90
72
|
const cut = edges.filter((e) => e.from === name && e.to === node && e.type !== 'pubsub');
|
|
91
73
|
if (cut.length === 0) {
|
|
92
74
|
problems.push(`${name} declares ${cut_legacy_cycle_resolver_1.CUT_LEGACY_CYCLE_TAG_PREFIX}${target}, but it has no direct ` +
|
|
@@ -99,11 +81,6 @@ function applyCycleCuts(edges, projects, nodeByServiceName) {
|
|
|
99
81
|
}
|
|
100
82
|
return problems;
|
|
101
83
|
}
|
|
102
|
-
/** Adjacency (service -> [targets]) from a loaded runtime graph. */
|
|
103
|
-
// webpieces-disable no-function-outside-class -- pure graph helper, sibling of the one above
|
|
104
|
-
function runtimeAdjacency(graph) {
|
|
105
|
-
return adjacencyFromEdges(Object.keys(graph.services), graph.runtimeEdges);
|
|
106
|
-
}
|
|
107
84
|
/** The cures for a cyclic runtime graph, honest ones first and the IOU last. */
|
|
108
85
|
// webpieces-disable no-function-outside-class -- cure list for the throw below, sibling of the helpers in this file
|
|
109
86
|
function cycleCures() {
|
|
@@ -111,14 +88,13 @@ function cycleCures() {
|
|
|
111
88
|
new rules_config_1.Option('Retag a node that is not really a deployed service. A project tagged `role:server` in ' +
|
|
112
89
|
'its project.json that is in fact a library should carry `role:lib` instead, which ' +
|
|
113
90
|
'takes it out of the runtime graph entirely and removes every edge through it.', true),
|
|
114
|
-
new rules_config_1.Option('
|
|
115
|
-
'
|
|
116
|
-
'because the producer returns without waiting on the consumer.'),
|
|
91
|
+
new rules_config_1.Option('Break the feedback path through the named queue or RPC hop. Foreign queues count ' +
|
|
92
|
+
'toward runtime layering; only a service enqueueing to itself is exempt.'),
|
|
117
93
|
new rules_config_1.Option('Extract the shared contract into a `role:api-lib` project that both sides depend on, ' +
|
|
118
94
|
'so the call runs in one direction only.'),
|
|
119
95
|
new rules_config_1.Option('Last resort — admit the debt. Add `' +
|
|
120
96
|
cut_legacy_cycle_resolver_1.CUT_LEGACY_CYCLE_TAG_PREFIX +
|
|
121
|
-
|
|
97
|
+
"<targetService>` to the CALLING project's project.json tags, naming the service on " +
|
|
122
98
|
'the other end of the one edge you are cutting. This does NOT say the edge is ' +
|
|
123
99
|
'harmless; it records that the cycle is real and is being tolerated as legacy debt. ' +
|
|
124
100
|
'The edge stays on the drawing as a dashed "legacy cycle" arrow, and ' +
|
|
@@ -144,7 +120,9 @@ function cycleCures() {
|
|
|
144
120
|
function assignLevels(adjacency) {
|
|
145
121
|
const cycles = new graph_cycles_1.ProjectCycleDetector().find(adjacency);
|
|
146
122
|
if (cycles.length > 0) {
|
|
147
|
-
const listed = cycles
|
|
123
|
+
const listed = cycles
|
|
124
|
+
.map((cycle) => ` ${cycle.describe()}`)
|
|
125
|
+
.join('\n');
|
|
148
126
|
const plural = cycles.length === 1 ? 'cycle' : 'cycles';
|
|
149
127
|
throw new rules_config_1.RuleFailError(runtime_config_1.RUNTIME_RULE_NAME, `The runtime service graph contains ${cycles.length} ${plural}:\n${listed}\n` +
|
|
150
128
|
'CD deploys services in dependency order and a cycle has no such order — whichever ' +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-graph-levels.js","sourceRoot":"","sources":["../../../../../../packages/tooling/nx-webpieces-rules/src/lib/runtime-graph-levels.ts"],"names":[],"mappings":";;AAkCA,gDAaC;AAyBD,wCAkCC;AAID,4CAEC;AAiDD,oCAqBC;AAtLD,0DAAgE;AAChE,iDAAwD;AAExD,iDAAoE;AACpE,2EAA0E;AAC1E,qDAAqD;AAGrD;;;;;;;GAOG;AACH;;;;;;;;;;;;;;;;GAgBG;AACH,6GAA6G;AAC7G,SAAgB,kBAAkB,CA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CAAoB,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC1D,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpB,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAmB,EAAU,EAAE,CAAC,KAAK,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/F,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC;QACxD,MAAM,IAAI,4BAAa,CACnB,kCAAiB,EACjB,sCAAsC,MAAM,CAAC,MAAM,IAAI,MAAM,MAAM,MAAM,IAAI;YACzE,oFAAoF;YACpF,4EAA4E;YAC5E,qFAAqF;YACrF,wBAAwB,EAC5B,SAAS,EACT,SAAS,EACT,UAAU,EAAE,CACf,CAAC;IACN,CAAC;IACD,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,MAAM,MAAM,GAAG,IAAA,qCAAsB,EAAC,SAAS,CAAC,CAAC;IACjD,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;QAAE,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC;IAC1E,OAAO,MAAM,CAAC;AAClB,CAAC","sourcesContent":["import { RuleFailError, Option } from '@webpieces/rules-config';\nimport { sortGraphTopologically } from './graph-sorter';\nimport type { GraphEntry, EnhancedGraph } from './graph-sorter';\nimport { ProjectCycleDetector, ProjectCycle } from './graph-cycles';\nimport { CUT_LEGACY_CYCLE_TAG_PREFIX } from './cut-legacy-cycle-resolver';\nimport { RUNTIME_RULE_NAME } from './runtime-config';\nimport type { RuntimeEdge, RuntimeGraph } from './runtime-graph-model';\n\n/**\n * LEVELS and ADJACENCY for the runtime graph — how deep each service sits, and who calls whom.\n *\n * Its own module rather than a block inside runtime-graph.ts: that file owns DERIVATION (turning\n * apiRelations into services, apis, edges, queues and triggers), and this is a pure graph\n * computation over the result, with no knowledge of contracts at all. Splitting it also keeps\n * runtime-graph.ts under the file-size limit, which is the visible symptom of the same thing.\n */\n/**\n * Adjacency (service -> [targets]) used for leveling + cycle checks.\n *\n * TWO KINDS OF EDGE ARE EXCLUDED, and the second is modelled on the first:\n *\n * PUBSUB EDGES. A queue is precisely the thing that decouples producer from consumer: the producer\n * returns as soon as the task is enqueued and never waits on the consumer, so a queued hop is not a\n * runtime dependency in the sense levels and cycle detection mean. Counting them would make the\n * common and correct `A → queue → A` (a service deferring its own work) an architecture cycle, and\n * would rank services by an ordering that does not constrain deploy or startup.\n *\n * EDGES STAMPED `cutLegacyCycle`. The calling project carries a `cutLegacyCycle:<target>` nx tag\n * (see cut-legacy-cycle-resolver.ts) ADMITTING that this hop closes a real cycle which is being\n * tolerated as legacy debt. Unlike a queued hop the coupling is real, so the edge is still drawn —\n * it is only kept out of leveling and cycle detection, which are the two things a cycle makes\n * meaningless.\n */\n// webpieces-disable no-function-outside-class -- pure graph helper, matches the sibling helpers in this file\nexport function adjacencyFromEdges(\n serviceNames: string[],\n edges: RuntimeEdge[],\n): Record<string, string[]> {\n const adj: Record<string, string[]> = {};\n for (const name of serviceNames) adj[name] = [];\n for (const edge of edges) {\n if (edge.type === 'pubsub') continue;\n if (edge.cutLegacyCycle === true) continue;\n if (!adj[edge.from]) adj[edge.from] = [];\n adj[edge.from].push(edge.to);\n }\n return adj;\n}\n\n/**\n * Stamp `cutLegacyCycle` on every runtime edge a project declared a cut for — the DECLARATION\n * (`cutLegacyCycle:<targetService>` nx tags, resolved into `GraphEntry.cutLegacyCycle` and committed\n * to dependencies.json) turned into the mark {@link adjacencyFromEdges} above reads.\n *\n * IT FAILS THE BUILD ON A TAG THAT CUTS NOTHING, in both directions:\n *\n * - the tag names a service no runtime node answers to — a typo or a rename. Silently doing nothing\n * is the worst outcome available: the check would look exempted while no edge was in fact cut, or\n * the tag would keep reading as a live IOU after the service it named was deleted. `serviceName`\n * is validated against real module names for exactly this reason.\n * - the tag resolves, but there is no direct edge to cut. The debt is PAID — delete the tag, so\n * `grep -rn cutLegacyCycle` keeps enumerating only cycles still actually tolerated.\n *\n * Returned as problems (the deriver's `problems` list) rather than thrown, so one run names every\n * bad tag instead of stopping at the first.\n *\n * @param edges the derived runtime edges, mutated in place.\n * @param projects the committed project entries carrying `cutLegacyCycle`.\n * @param nodeByServiceName addressable name -> runtime node, the SAME map that resolves a call\n * target, so a tag may name a module name or a declared serviceName.\n */\n// webpieces-disable no-function-outside-class -- pure pass over derived edges, sibling of the helpers here\nexport function applyCycleCuts(\n edges: RuntimeEdge[],\n projects: EnhancedGraph,\n nodeByServiceName: Map<string, string>,\n): string[] {\n const problems: string[] = [];\n for (const name of Object.keys(projects).sort()) {\n const entry: GraphEntry = projects[name];\n for (const target of entry.cutLegacyCycle ?? []) {\n const node = nodeByServiceName.get(target);\n if (node === undefined) {\n problems.push(\n `${name} declares ${CUT_LEGACY_CYCLE_TAG_PREFIX}${target}, but no runtime service ` +\n `answers to '${target}'. Fix the name or delete the tag — a cut that names ` +\n `nothing exempts nothing.`,\n );\n continue;\n }\n // A queued hop is already excluded from leveling, so it can never be part of a cycle and\n // never needs cutting; only a direct call edge is cuttable.\n const cut = edges.filter(\n (e: RuntimeEdge) => e.from === name && e.to === node && e.type !== 'pubsub',\n );\n if (cut.length === 0) {\n problems.push(\n `${name} declares ${CUT_LEGACY_CYCLE_TAG_PREFIX}${target}, but it has no direct ` +\n `runtime call edge to '${node}'. The debt is paid — delete the tag.`,\n );\n continue;\n }\n for (const e of cut) e.cutLegacyCycle = true;\n }\n }\n return problems;\n}\n\n/** Adjacency (service -> [targets]) from a loaded runtime graph. */\n// webpieces-disable no-function-outside-class -- pure graph helper, sibling of the one above\nexport function runtimeAdjacency(graph: RuntimeGraph): Record<string, string[]> {\n return adjacencyFromEdges(Object.keys(graph.services), graph.runtimeEdges);\n}\n\n/** The cures for a cyclic runtime graph, honest ones first and the IOU last. */\n// webpieces-disable no-function-outside-class -- cure list for the throw below, sibling of the helpers in this file\nfunction cycleCures(): Option[] {\n return [\n new Option(\n 'Retag a node that is not really a deployed service. A project tagged `role:server` in ' +\n 'its project.json that is in fact a library should carry `role:lib` instead, which ' +\n 'takes it out of the runtime graph entirely and removes every edge through it.',\n true,\n ),\n new Option(\n 'Make the hop asynchronous. A contract marked `@PubSub()` is delivered through a Cloud ' +\n 'Tasks queue, and queued edges are excluded from leveling and cycle detection ' +\n 'because the producer returns without waiting on the consumer.',\n ),\n new Option(\n 'Extract the shared contract into a `role:api-lib` project that both sides depend on, ' +\n 'so the call runs in one direction only.',\n ),\n new Option(\n 'Last resort — admit the debt. Add `' +\n CUT_LEGACY_CYCLE_TAG_PREFIX +\n '<targetService>` to the CALLING project\\'s project.json tags, naming the service on ' +\n 'the other end of the one edge you are cutting. This does NOT say the edge is ' +\n 'harmless; it records that the cycle is real and is being tolerated as legacy debt. ' +\n 'The edge stays on the drawing as a dashed \"legacy cycle\" arrow, and ' +\n '`grep -rn cutLegacyCycle` enumerates every one still outstanding.',\n ),\n ];\n}\n\n/**\n * Assign levels via topological sort — and THROW on a cycle rather than levelling one.\n *\n * This used to swallow the cycle and flatten EVERY service to level 0, which was the worst available\n * outcome twice over: one bad edge anywhere silently restratified the whole graph, and the reason\n * was discarded, so the diagram rendered as one legitimate-looking flat row.\n *\n * Cycles are not allowed. CD deploys services in dependency order, and a cyclic architecture has no\n * such order — whichever member rolls out first is calling one that is not up yet — so the graph is\n * not deployable and its level numbers mean nothing.\n *\n * Detection is {@link ProjectCycleDetector}, the ONE cycle detector in this package (it guards the\n * compile-time project graph too); only the audience and the cures differ, so only the message is\n * written here.\n */\n// webpieces-disable no-function-outside-class -- pure graph helper, sibling of the two above\nexport function assignLevels(adjacency: Record<string, string[]>): Record<string, number> {\n const cycles = new ProjectCycleDetector().find(adjacency);\n if (cycles.length > 0) {\n const listed = cycles.map((cycle: ProjectCycle): string => ` ${cycle.describe()}`).join('\\n');\n const plural = cycles.length === 1 ? 'cycle' : 'cycles';\n throw new RuleFailError(\n RUNTIME_RULE_NAME,\n `The runtime service graph contains ${cycles.length} ${plural}:\\n${listed}\\n` +\n 'CD deploys services in dependency order and a cycle has no such order — whichever ' +\n 'service in the chain rolls out first calls one that is not up yet — so an ' +\n 'architecture with cycles cannot be deployed and its level numbers are meaningless. ' +\n 'Cut every chain above.',\n undefined,\n undefined,\n cycleCures(),\n );\n }\n const levels: Record<string, number> = {};\n const sorted = sortGraphTopologically(adjacency);\n for (const name of Object.keys(sorted)) levels[name] = sorted[name].level;\n return levels;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"runtime-graph-levels.js","sourceRoot":"","sources":["../../../../../../packages/tooling/nx-webpieces-rules/src/lib/runtime-graph-levels.ts"],"names":[],"mappings":";;AAkBA,gDAaC;AAyBD,wCAiCC;AAgDD,oCAuBC;AAhKD,0DAAgE;AAChE,iDAAwD;AAExD,iDAAoE;AACpE,2EAA0E;AAC1E,qDAAqD;AAGrD;;;;;;;GAOG;AACH,+GAA+G;AAC/G,6GAA6G;AAC7G,SAAgB,kBAAkB,CAC9B,YAAsB,EACtB,KAAoB;IAEpB,MAAM,GAAG,GAA6B,EAAE,CAAC;IACzC,KAAK,MAAM,IAAI,IAAI,YAAY;QAAE,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;IAChD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACvB,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ;YAAE,SAAS;QACrC,IAAI,IAAI,CAAC,cAAc,KAAK,IAAI;YAAE,SAAS;QAC3C,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;QACzC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,C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AI,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;QAAE,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC;IAC1E,OAAO,MAAM,CAAC;AAClB,CAAC","sourcesContent":["import { RuleFailError, Option } from '@webpieces/rules-config';\nimport { sortGraphTopologically } from './graph-sorter';\nimport type { GraphEntry, EnhancedGraph } from './graph-sorter';\nimport { ProjectCycleDetector, ProjectCycle } from './graph-cycles';\nimport { CUT_LEGACY_CYCLE_TAG_PREFIX } from './cut-legacy-cycle-resolver';\nimport { RUNTIME_RULE_NAME } from './runtime-config';\nimport type { RuntimeEdge } from './runtime-graph-model';\n\n/**\n * LEVELS and ADJACENCY for the runtime graph — how deep each service sits, and who calls whom.\n *\n * Its own module rather than a block inside runtime-graph.ts: that file owns DERIVATION (turning\n * apiRelations into services, apis, edges, queues and triggers), and this is a pure graph\n * computation over the result, with no knowledge of contracts at all. Splitting it also keeps\n * runtime-graph.ts under the file-size limit, which is the visible symptom of the same thing.\n */\n/** RPC adjacency for callers working with an edge list alone. Full runtime layering uses RuntimeNodeLevels. */\n// webpieces-disable no-function-outside-class -- pure graph helper, matches the sibling helpers in this file\nexport function adjacencyFromEdges(\n serviceNames: string[],\n edges: RuntimeEdge[],\n): Record<string, string[]> {\n const adj: Record<string, string[]> = {};\n for (const name of serviceNames) adj[name] = [];\n for (const edge of edges) {\n if (edge.type === 'pubsub') continue;\n if (edge.cutLegacyCycle === true) continue;\n if (!adj[edge.from]) adj[edge.from] = [];\n adj[edge.from].push(edge.to);\n }\n return adj;\n}\n\n/**\n * Stamp `cutLegacyCycle` on every runtime edge a project declared a cut for — the DECLARATION\n * (`cutLegacyCycle:<targetService>` nx tags, resolved into `GraphEntry.cutLegacyCycle` and committed\n * to dependencies.json) turned into the mark {@link adjacencyFromEdges} above reads.\n *\n * IT FAILS THE BUILD ON A TAG THAT CUTS NOTHING, in both directions:\n *\n * - the tag names a service no runtime node answers to — a typo or a rename. Silently doing nothing\n * is the worst outcome available: the check would look exempted while no edge was in fact cut, or\n * the tag would keep reading as a live IOU after the service it named was deleted. `serviceName`\n * is validated against real module names for exactly this reason.\n * - the tag resolves, but there is no direct edge to cut. The debt is PAID — delete the tag, so\n * `grep -rn cutLegacyCycle` keeps enumerating only cycles still actually tolerated.\n *\n * Returned as problems (the deriver's `problems` list) rather than thrown, so one run names every\n * bad tag instead of stopping at the first.\n *\n * @param edges the derived runtime edges, mutated in place.\n * @param projects the committed project entries carrying `cutLegacyCycle`.\n * @param nodeByServiceName addressable name -> runtime node, the SAME map that resolves a call\n * target, so a tag may name a module name or a declared serviceName.\n */\n// webpieces-disable no-function-outside-class -- pure pass over derived edges, sibling of the helpers here\nexport function applyCycleCuts(\n edges: RuntimeEdge[],\n projects: EnhancedGraph,\n nodeByServiceName: Map<string, string>,\n): string[] {\n const problems: string[] = [];\n for (const name of Object.keys(projects).sort()) {\n const entry: GraphEntry = projects[name];\n for (const target of entry.cutLegacyCycle ?? []) {\n const node = nodeByServiceName.get(target);\n if (node === undefined) {\n problems.push(\n `${name} declares ${CUT_LEGACY_CYCLE_TAG_PREFIX}${target}, but no runtime service ` +\n `answers to '${target}'. Fix the name or delete the tag — a cut that names ` +\n `nothing exempts nothing.`,\n );\n continue;\n }\n // Legacy cuts apply to direct calls only. Foreign queues remain visible to cycle detection.\n const cut = edges.filter(\n (e: RuntimeEdge) => e.from === name && e.to === node && e.type !== 'pubsub',\n );\n if (cut.length === 0) {\n problems.push(\n `${name} declares ${CUT_LEGACY_CYCLE_TAG_PREFIX}${target}, but it has no direct ` +\n `runtime call edge to '${node}'. The debt is paid — delete the tag.`,\n );\n continue;\n }\n for (const e of cut) e.cutLegacyCycle = true;\n }\n }\n return problems;\n}\n\n/** The cures for a cyclic runtime graph, honest ones first and the IOU last. */\n// webpieces-disable no-function-outside-class -- cure list for the throw below, sibling of the helpers in this file\nfunction cycleCures(): Option[] {\n return [\n new Option(\n 'Retag a node that is not really a deployed service. A project tagged `role:server` in ' +\n 'its project.json that is in fact a library should carry `role:lib` instead, which ' +\n 'takes it out of the runtime graph entirely and removes every edge through it.',\n true,\n ),\n new Option(\n 'Break the feedback path through the named queue or RPC hop. Foreign queues count ' +\n 'toward runtime layering; only a service enqueueing to itself is exempt.',\n ),\n new Option(\n 'Extract the shared contract into a `role:api-lib` project that both sides depend on, ' +\n 'so the call runs in one direction only.',\n ),\n new Option(\n 'Last resort — admit the debt. Add `' +\n CUT_LEGACY_CYCLE_TAG_PREFIX +\n \"<targetService>` to the CALLING project's project.json tags, naming the service on \" +\n 'the other end of the one edge you are cutting. This does NOT say the edge is ' +\n 'harmless; it records that the cycle is real and is being tolerated as legacy debt. ' +\n 'The edge stays on the drawing as a dashed \"legacy cycle\" arrow, and ' +\n '`grep -rn cutLegacyCycle` enumerates every one still outstanding.',\n ),\n ];\n}\n\n/**\n * Assign levels via topological sort — and THROW on a cycle rather than levelling one.\n *\n * This used to swallow the cycle and flatten EVERY service to level 0, which was the worst available\n * outcome twice over: one bad edge anywhere silently restratified the whole graph, and the reason\n * was discarded, so the diagram rendered as one legitimate-looking flat row.\n *\n * Cycles are not allowed. CD deploys services in dependency order, and a cyclic architecture has no\n * such order — whichever member rolls out first is calling one that is not up yet — so the graph is\n * not deployable and its level numbers mean nothing.\n *\n * Detection is {@link ProjectCycleDetector}, the ONE cycle detector in this package (it guards the\n * compile-time project graph too); only the audience and the cures differ, so only the message is\n * written here.\n */\n// webpieces-disable no-function-outside-class -- pure graph helper, sibling of the two above\nexport function assignLevels(adjacency: Record<string, string[]>): Record<string, number> {\n const cycles = new ProjectCycleDetector().find(adjacency);\n if (cycles.length > 0) {\n const listed = cycles\n .map((cycle: ProjectCycle): string => ` ${cycle.describe()}`)\n .join('\\n');\n const plural = cycles.length === 1 ? 'cycle' : 'cycles';\n throw new RuleFailError(\n RUNTIME_RULE_NAME,\n `The runtime service graph contains ${cycles.length} ${plural}:\\n${listed}\\n` +\n 'CD deploys services in dependency order and a cycle has no such order — whichever ' +\n 'service in the chain rolls out first calls one that is not up yet — so an ' +\n 'architecture with cycles cannot be deployed and its level numbers are meaningless. ' +\n 'Cut every chain above.',\n undefined,\n undefined,\n cycleCures(),\n );\n }\n const levels: Record<string, number> = {};\n const sorted = sortGraphTopologically(adjacency);\n for (const name of Object.keys(sorted)) levels[name] = sorted[name].level;\n return levels;\n}\n"]}
|
|
@@ -10,8 +10,11 @@
|
|
|
10
10
|
* class would only ever be a shape assertion over a plain object, never a constructed instance.
|
|
11
11
|
*/
|
|
12
12
|
import type { ApiRef, ApiTransport, ExternalSystemDeclaration, ExternalSystemKind } from './api-usage/api-relations';
|
|
13
|
-
export
|
|
13
|
+
export declare class RuntimeLevel {
|
|
14
14
|
level: number;
|
|
15
|
+
levelBecause: string;
|
|
16
|
+
}
|
|
17
|
+
export interface RuntimeService extends RuntimeLevel {
|
|
15
18
|
/**
|
|
16
19
|
* The project's declared nx role — 'server' or 'client' (a library is never a node). Carried so
|
|
17
20
|
* the viz can LABEL the node with what it actually is: it used to infer the role from
|
|
@@ -110,13 +113,16 @@ export interface RuntimeEdge {
|
|
|
110
113
|
* Only exact method declarations may populate producer facts. Contract-only client wiring
|
|
111
114
|
* produces contract-level edges without a method queue, regardless of the endpoint table.
|
|
112
115
|
*/
|
|
113
|
-
export
|
|
116
|
+
export declare class RuntimeQueueFlow extends RuntimeLevel {
|
|
117
|
+
selfQueue: boolean;
|
|
118
|
+
producedBy: string[];
|
|
119
|
+
consumedBy: string[];
|
|
120
|
+
}
|
|
121
|
+
export interface RuntimeQueue extends RuntimeQueueFlow {
|
|
114
122
|
api: string;
|
|
115
123
|
method: string;
|
|
116
124
|
/** `@Queue(...)` override, else `${Api}-${method}` — the name Terraform must match 1:1. */
|
|
117
125
|
queueName: string;
|
|
118
|
-
producedBy: string[];
|
|
119
|
-
consumedBy: string[];
|
|
120
126
|
}
|
|
121
127
|
/**
|
|
122
128
|
* An endpoint driven by something that is NOT an in-repo caller — a clock or an outside system.
|
|
@@ -124,7 +130,7 @@ export interface RuntimeQueue {
|
|
|
124
130
|
* invisible until now: a nightly sweep and a GCP push subscription are real runtime entry points
|
|
125
131
|
* with real Terraform behind them, and the graph showed neither.
|
|
126
132
|
*/
|
|
127
|
-
export interface RuntimeTrigger {
|
|
133
|
+
export interface RuntimeTrigger extends RuntimeLevel {
|
|
128
134
|
/** 'cron' → a scheduler fires it; 'external' → a system outside this repo posts to it. */
|
|
129
135
|
kind: 'cron' | 'external';
|
|
130
136
|
api: string;
|
|
@@ -137,16 +143,15 @@ export interface RuntimeTrigger {
|
|
|
137
143
|
* Present for 'external': WHO outside this repo posts to it, declared as
|
|
138
144
|
* `@Endpoint(POST, p, WRITE, EXTERNAL, { calledBy: 'twilio' })`.
|
|
139
145
|
*
|
|
140
|
-
* The
|
|
141
|
-
*
|
|
142
|
-
* `label` is the identity here too, not display text.
|
|
146
|
+
* The caller is drawn separately from an outbound system with the same label: callers
|
|
147
|
+
* start the flow on the top row, while outbound systems are sinks on L0.
|
|
143
148
|
*
|
|
144
149
|
* Optional only for graphs generated BEFORE the caller was required; generation now fails rather
|
|
145
150
|
* than emitting an `external` method without one.
|
|
146
151
|
*/
|
|
147
152
|
caller?: ExternalSystemDeclaration;
|
|
148
153
|
}
|
|
149
|
-
export interface RuntimeUnresolved {
|
|
154
|
+
export interface RuntimeUnresolved extends RuntimeLevel {
|
|
150
155
|
service: string;
|
|
151
156
|
api: string;
|
|
152
157
|
}
|
|
@@ -167,7 +172,7 @@ export interface RuntimeUnresolved {
|
|
|
167
172
|
* `label` is the node IDENTITY, not just display text: two services declaring `postgres` converge on
|
|
168
173
|
* ONE node with two arrows into it, rather than drawing a database each.
|
|
169
174
|
*/
|
|
170
|
-
export interface RuntimeExternalSystem {
|
|
175
|
+
export interface RuntimeExternalSystem extends RuntimeLevel {
|
|
171
176
|
kind: ExternalSystemKind;
|
|
172
177
|
/** Display name AND node identity — declarations sharing a label share a node. */
|
|
173
178
|
label: string;
|
|
@@ -188,10 +193,10 @@ export interface RuntimeRemoteCall {
|
|
|
188
193
|
/**
|
|
189
194
|
* A service OUTSIDE this workspace (another repo, a VM, partner endpoints) declared in the reviewed
|
|
190
195
|
* `remoteServices` table of dependencies.json (#1203). It is a SERVICE — it implements our contracts —
|
|
191
|
-
* so it is drawn as a service node, distinct from a vendor external system.
|
|
192
|
-
*
|
|
196
|
+
* so it is drawn as a service node, distinct from a vendor external system. Its level is zero:
|
|
197
|
+
* outbound calls from outside this workspace are not part of this graph.
|
|
193
198
|
*/
|
|
194
|
-
export interface RuntimeRemoteService {
|
|
199
|
+
export interface RuntimeRemoteService extends RuntimeLevel {
|
|
195
200
|
/** Display text from the reviewed declaration; the key is the identity. */
|
|
196
201
|
label?: string;
|
|
197
202
|
/** The contracts it is declared to implement, as `Api (transport)`, in reviewed order. */
|
|
@@ -200,6 +205,9 @@ export interface RuntimeRemoteService {
|
|
|
200
205
|
calledBy: RuntimeRemoteCall[];
|
|
201
206
|
}
|
|
202
207
|
export interface RuntimeGraph {
|
|
208
|
+
maxLevel: number;
|
|
209
|
+
/** Contract-only pubsub flows; these do not assert any method-level producers. */
|
|
210
|
+
contractQueues: Record<string, RuntimeQueueFlow>;
|
|
203
211
|
services: Record<string, RuntimeService>;
|
|
204
212
|
apis: Record<string, RuntimeApi>;
|
|
205
213
|
runtimeEdges: RuntimeEdge[];
|
|
@@ -11,4 +11,22 @@
|
|
|
11
11
|
* class would only ever be a shape assertion over a plain object, never a constructed instance.
|
|
12
12
|
*/
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.RuntimeQueueFlow = exports.RuntimeLevel = void 0;
|
|
15
|
+
class RuntimeLevel {
|
|
16
|
+
level = 0;
|
|
17
|
+
levelBecause = '';
|
|
18
|
+
}
|
|
19
|
+
exports.RuntimeLevel = RuntimeLevel;
|
|
20
|
+
/**
|
|
21
|
+
* One Cloud Tasks queue: the async seam between a producer and a consumer, at METHOD granularity.
|
|
22
|
+
*
|
|
23
|
+
* Only exact method declarations may populate producer facts. Contract-only client wiring
|
|
24
|
+
* produces contract-level edges without a method queue, regardless of the endpoint table.
|
|
25
|
+
*/
|
|
26
|
+
class RuntimeQueueFlow extends RuntimeLevel {
|
|
27
|
+
selfQueue = false;
|
|
28
|
+
producedBy = [];
|
|
29
|
+
consumedBy = [];
|
|
30
|
+
}
|
|
31
|
+
exports.RuntimeQueueFlow = RuntimeQueueFlow;
|
|
14
32
|
//# sourceMappingURL=runtime-graph-model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-graph-model.js","sourceRoot":"","sources":["../../../../../../packages/tooling/nx-webpieces-rules/src/lib/runtime-graph-model.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG","sourcesContent":["/**\n * Runtime Graph model\n *\n * The serialization DTOs for architecture/runtime-dependencies.json. Split out of runtime-graph.ts,\n * which owns the DERIVATION (and had grown past the file-size limit), so the committed data shape\n * can be read on its own — it is what every consumer of the file, and any future Terraform\n * cross-check, actually programs against.\n *\n * Interfaces rather than classes: these are parsed straight out of JSON with `JSON.parse`, so a\n * class would only ever be a shape assertion over a plain object, never a constructed instance.\n */\n\nimport type {\n ApiRef,\n ApiTransport,\n ExternalSystemDeclaration,\n ExternalSystemKind,\n} from './api-usage/api-relations';\n\nexport interface RuntimeService {\n level: number;\n /**\n * The project's declared nx role — 'server' or 'client' (a library is never a node). Carried so\n * the viz can LABEL the node with what it actually is: it used to infer the role from\n * `implements.length > 0`, which labelled every relation-less server \"client\". Optional so a\n * runtime-dependencies.json written before this field existed still parses and still renders\n * exactly as it did (the visualizer falls back to the old inference).\n */\n role?: string;\n /**\n * The name clients address this service by (`new ClientConfig('helper-fsdb')`), declared in its\n * project.json. Absent for a service nothing calls by name (e.g. a browser app).\n */\n serviceName?: string;\n /**\n * The service(s) this node's clients call when the call site carries no literal `ClientConfig`,\n * declared in its project.json (metadata.webpieces.callsService). A single name, or an\n * `{ apiClassName: serviceName }` map. Absent when the node declares no target. Mirrors\n * GraphEntry.callsService; it is the CALLING-side counterpart of `serviceName`.\n */\n callsService?: string | Record<string, string>;\n implements: string[];\n /**\n * apiClassName -> the LIBRARY project whose apiRelations declared that implements, for the apis\n * this service serves through an embedded library rather than its own source (e.g. a shared\n * route-registration lib). Answers \"who implements WarmupApi, and where did that come from?\",\n * which previously required walking the dependsOn closure by hand.\n */\n implementsVia?: Record<string, string>;\n uses: string[];\n dependsOn: string[];\n /** Reviewed binding provenance and runtime conditions, retained for compact detail views. */\n wiringUses?: ApiRef[];\n wiringImplements?: ApiRef[];\n /**\n * When false, this service is hidden from the rendered runtime graph (its\n * node AND every edge touching it are omitted from the HTML/DOT). It stays\n * in runtime-dependencies.json so the data view is complete. Absent means\n * drawn (the default). Mirrors GraphEntry.drawOnGraph from the `drawOnGraph:`\n * nx tag.\n */\n drawOnGraph?: boolean;\n /**\n * The products this service belongs to (#1179), sorted: exactly its project's declared\n * `product:<name>` tags (#1216). Never derived from a runtime call or a queue; a call into another\n * product's service shows as the runtime edge, not as a product. Absent for a service whose\n * project is untagged. See graph-products.ts.\n */\n products?: string[];\n}\n\nexport interface RuntimeApi {\n implementedBy: string[];\n usedBy: string[];\n /** Transport of this API — 'rpc' (direct call) or 'pubsub' (delivered through a queue). */\n type?: ApiTransport;\n /**\n * The api-lib project that OWNS this contract. For a contract nothing in-repo implements, this\n * is the external library the calls leave the repo through (`lib-firestore`, `lib-gmail`), which\n * is what the runtime viz labels its terminal external nodes with.\n */\n owner?: string;\n /**\n * Set when the contract carries an `@externalSystem <kind> [label]` JSDoc tag — the vendor seam\n * declaring WHAT it is a seam to, so the viz can draw firestore as a database rather than as the\n * same grey box as every other external. Absent on everything else.\n */\n externalSystem?: ExternalSystemDeclaration;\n}\n\nexport interface RuntimeEdge {\n from: string;\n to: string;\n via: string[];\n /**\n * Transport of this edge. 'rpc' → a direct call arrow. 'pubsub' → the producer enqueues and the\n * consumer is delivered later, so the runtime viz draws it as producer → QUEUE → consumer.\n * Edges are split by transport, so every edge is a single kind.\n */\n type?: ApiTransport;\n /**\n * `\"ApiClassName.methodName\"` — the queue this edge flows through. Present iff `type` is\n * 'pubsub'. Queues are per METHOD, not per service pair, because that is the unit Cloud Tasks\n * (and Terraform) actually create, so two services exchanging three queued methods are three\n * queues rather than one arrow.\n */\n queue?: string;\n /**\n * True when the CALLING project carries a `cutLegacyCycle:<target>` nx tag naming this edge's\n * target — an admission that this hop closes a REAL cycle that is being tolerated as legacy\n * debt, not a claim that it is harmless. The edge is still drawn (dashed, labelled \"legacy\n * cycle\"); it is only excluded from leveling and cycle detection. Absent on every other edge.\n */\n cutLegacyCycle?: boolean;\n}\n\n/**\n * One Cloud Tasks queue: the async seam between a producer and a consumer, at METHOD granularity.\n *\n * Only exact method declarations may populate producer facts. Contract-only client wiring\n * produces contract-level edges without a method queue, regardless of the endpoint table.\n */\nexport interface RuntimeQueue {\n api: string;\n method: string;\n /** `@Queue(...)` override, else `${Api}-${method}` — the name Terraform must match 1:1. */\n queueName: string;\n producedBy: string[];\n consumedBy: string[];\n}\n\n/**\n * An endpoint driven by something that is NOT an in-repo caller — a clock or an outside system.\n * These never appear as runtime EDGES (there is no in-repo `from`), which is exactly why they were\n * invisible until now: a nightly sweep and a GCP push subscription are real runtime entry points\n * with real Terraform behind them, and the graph showed neither.\n */\nexport interface RuntimeTrigger {\n /** 'cron' → a scheduler fires it; 'external' → a system outside this repo posts to it. */\n kind: 'cron' | 'external';\n api: string;\n method: string;\n /** The service that SERVES the endpoint (the arrow's head). */\n service: string;\n /** Present for 'cron': the Cloud Scheduler job / queue name Terraform must match. */\n queueName?: string;\n /**\n * Present for 'external': WHO outside this repo posts to it, declared as\n * `@Endpoint(POST, p, WRITE, EXTERNAL, { calledBy: 'twilio' })`.\n *\n * The SAME `(kind,label)` an OUTBOUND {@link RuntimeExternalSystem} carries, so an inbound\n * `saas twilio` and an outbound `saas twilio` share a node identity and converge on ONE box —\n * `label` is the identity here too, not display text.\n *\n * Optional only for graphs generated BEFORE the caller was required; generation now fails rather\n * than emitting an `external` method without one.\n */\n caller?: ExternalSystemDeclaration;\n}\n\nexport interface RuntimeUnresolved {\n service: string;\n api: string;\n}\n\n/**\n * A system outside this repo that a service TALKS TO, drawn with a shape that says what it is\n * (a database as a cylinder, a bucket as a folder) instead of the one grey box every external\n * used to collapse into.\n *\n * Two declaration sites feed this, because the two real cases differ in whether a contract exists:\n *\n * - **Wrapped** — the repo has a vendor seam (`FirestoreAdminApi`), so the kind is declared with an\n * `@externalSystem <kind> [label]` JSDoc tag on the contract. A decorator cannot go on a TS\n * `interface`, and these seams are interfaces, so JSDoc is the only marker that fits in place.\n * - **Unwrapped** — the service opens the connection itself with no contract to mark (a `pg.Pool`,\n * a TypeORM `DataSource`), so the declaration is an `external:<kind>:<identity>` nx tag on that\n * project's project.json.\n *\n * `label` is the node IDENTITY, not just display text: two services declaring `postgres` converge on\n * ONE node with two arrows into it, rather than drawing a database each.\n */\nexport interface RuntimeExternalSystem {\n kind: ExternalSystemKind;\n /** Display name AND node identity — declarations sharing a label share a node. */\n label: string;\n /** Services with a direct arrow to it. No transitive fan-out: a tag speaks only for its project. */\n usedBy: string[];\n /** Contracts flowing over it. Empty for the unwrapped (tag-declared) case — there are none. */\n apis: string[];\n}\n\n/**\n * One caller's calls into a {@link RuntimeRemoteService}, one entry per (caller, transport): `via`\n * lists the contracts it calls there.\n */\nexport interface RuntimeRemoteCall {\n from: string;\n via: string[];\n type: ApiTransport;\n}\n\n/**\n * A service OUTSIDE this workspace (another repo, a VM, partner endpoints) declared in the reviewed\n * `remoteServices` table of dependencies.json (#1203). It is a SERVICE — it implements our contracts —\n * so it is drawn as a service node, distinct from a vendor external system. Render-only, like the\n * external systems: it is never leveled or cycle-checked, because its own calls are not in this repo.\n */\nexport interface RuntimeRemoteService {\n /** Display text from the reviewed declaration; the key is the identity. */\n label?: string;\n /** The contracts it is declared to implement, as `Api (transport)`, in reviewed order. */\n implements: string[];\n /** Workspace services that target it, sorted by caller then transport. */\n calledBy: RuntimeRemoteCall[];\n}\n\nexport interface RuntimeGraph {\n services: Record<string, RuntimeService>;\n apis: Record<string, RuntimeApi>;\n runtimeEdges: RuntimeEdge[];\n unresolvedUses: RuntimeUnresolved[];\n /** `\"Api.method\"` -> the queue between its producers and its consumers. */\n queues: Record<string, RuntimeQueue>;\n /** Clock- and outside-driven entry points, sorted for determinism. */\n triggers: RuntimeTrigger[];\n /**\n * Declared external systems, keyed by identity. Optional so every graph written before this\n * existed still parses — an absent map means \"nothing declared\", which renders exactly as before.\n */\n externalSystems?: Record<string, RuntimeExternalSystem>;\n /**\n * Reviewed out-of-workspace services, keyed by service name (#1203). Absent when none are\n * declared, so every graph written before this existed parses and renders exactly as before.\n */\n remoteServices?: Record<string, RuntimeRemoteService>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"runtime-graph-model.js","sourceRoot":"","sources":["../../../../../../packages/tooling/nx-webpieces-rules/src/lib/runtime-graph-model.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AASH,MAAa,YAAY;IACrB,KAAK,GAAG,CAAC,CAAC;IACV,YAAY,GAAG,EAAE,CAAC;CACrB;AAHD,oCAGC;AAkGD;;;;;GAKG;AACH,MAAa,gBAAiB,SAAQ,YAAY;IAC9C,SAAS,GAAG,KAAK,CAAC;IAClB,UAAU,GAAa,EAAE,CAAC;IAC1B,UAAU,GAAa,EAAE,CAAC;CAC7B;AAJD,4CAIC","sourcesContent":["/**\n * Runtime Graph model\n *\n * The serialization DTOs for architecture/runtime-dependencies.json. Split out of runtime-graph.ts,\n * which owns the DERIVATION (and had grown past the file-size limit), so the committed data shape\n * can be read on its own — it is what every consumer of the file, and any future Terraform\n * cross-check, actually programs against.\n *\n * Interfaces rather than classes: these are parsed straight out of JSON with `JSON.parse`, so a\n * class would only ever be a shape assertion over a plain object, never a constructed instance.\n */\n\nimport type {\n ApiRef,\n ApiTransport,\n ExternalSystemDeclaration,\n ExternalSystemKind,\n} from './api-usage/api-relations';\n\nexport class RuntimeLevel {\n level = 0;\n levelBecause = '';\n}\n\nexport interface RuntimeService extends RuntimeLevel {\n /**\n * The project's declared nx role — 'server' or 'client' (a library is never a node). Carried so\n * the viz can LABEL the node with what it actually is: it used to infer the role from\n * `implements.length > 0`, which labelled every relation-less server \"client\". Optional so a\n * runtime-dependencies.json written before this field existed still parses and still renders\n * exactly as it did (the visualizer falls back to the old inference).\n */\n role?: string;\n /**\n * The name clients address this service by (`new ClientConfig('helper-fsdb')`), declared in its\n * project.json. Absent for a service nothing calls by name (e.g. a browser app).\n */\n serviceName?: string;\n /**\n * The service(s) this node's clients call when the call site carries no literal `ClientConfig`,\n * declared in its project.json (metadata.webpieces.callsService). A single name, or an\n * `{ apiClassName: serviceName }` map. Absent when the node declares no target. Mirrors\n * GraphEntry.callsService; it is the CALLING-side counterpart of `serviceName`.\n */\n callsService?: string | Record<string, string>;\n implements: string[];\n /**\n * apiClassName -> the LIBRARY project whose apiRelations declared that implements, for the apis\n * this service serves through an embedded library rather than its own source (e.g. a shared\n * route-registration lib). Answers \"who implements WarmupApi, and where did that come from?\",\n * which previously required walking the dependsOn closure by hand.\n */\n implementsVia?: Record<string, string>;\n uses: string[];\n dependsOn: string[];\n /** Reviewed binding provenance and runtime conditions, retained for compact detail views. */\n wiringUses?: ApiRef[];\n wiringImplements?: ApiRef[];\n /**\n * When false, this service is hidden from the rendered runtime graph (its\n * node AND every edge touching it are omitted from the HTML/DOT). It stays\n * in runtime-dependencies.json so the data view is complete. Absent means\n * drawn (the default). Mirrors GraphEntry.drawOnGraph from the `drawOnGraph:`\n * nx tag.\n */\n drawOnGraph?: boolean;\n /**\n * The products this service belongs to (#1179), sorted: exactly its project's declared\n * `product:<name>` tags (#1216). Never derived from a runtime call or a queue; a call into another\n * product's service shows as the runtime edge, not as a product. Absent for a service whose\n * project is untagged. See graph-products.ts.\n */\n products?: string[];\n}\n\nexport interface RuntimeApi {\n implementedBy: string[];\n usedBy: string[];\n /** Transport of this API — 'rpc' (direct call) or 'pubsub' (delivered through a queue). */\n type?: ApiTransport;\n /**\n * The api-lib project that OWNS this contract. For a contract nothing in-repo implements, this\n * is the external library the calls leave the repo through (`lib-firestore`, `lib-gmail`), which\n * is what the runtime viz labels its terminal external nodes with.\n */\n owner?: string;\n /**\n * Set when the contract carries an `@externalSystem <kind> [label]` JSDoc tag — the vendor seam\n * declaring WHAT it is a seam to, so the viz can draw firestore as a database rather than as the\n * same grey box as every other external. Absent on everything else.\n */\n externalSystem?: ExternalSystemDeclaration;\n}\n\nexport interface RuntimeEdge {\n from: string;\n to: string;\n via: string[];\n /**\n * Transport of this edge. 'rpc' → a direct call arrow. 'pubsub' → the producer enqueues and the\n * consumer is delivered later, so the runtime viz draws it as producer → QUEUE → consumer.\n * Edges are split by transport, so every edge is a single kind.\n */\n type?: ApiTransport;\n /**\n * `\"ApiClassName.methodName\"` — the queue this edge flows through. Present iff `type` is\n * 'pubsub'. Queues are per METHOD, not per service pair, because that is the unit Cloud Tasks\n * (and Terraform) actually create, so two services exchanging three queued methods are three\n * queues rather than one arrow.\n */\n queue?: string;\n /**\n * True when the CALLING project carries a `cutLegacyCycle:<target>` nx tag naming this edge's\n * target — an admission that this hop closes a REAL cycle that is being tolerated as legacy\n * debt, not a claim that it is harmless. The edge is still drawn (dashed, labelled \"legacy\n * cycle\"); it is only excluded from leveling and cycle detection. Absent on every other edge.\n */\n cutLegacyCycle?: boolean;\n}\n\n/**\n * One Cloud Tasks queue: the async seam between a producer and a consumer, at METHOD granularity.\n *\n * Only exact method declarations may populate producer facts. Contract-only client wiring\n * produces contract-level edges without a method queue, regardless of the endpoint table.\n */\nexport class RuntimeQueueFlow extends RuntimeLevel {\n selfQueue = false;\n producedBy: string[] = [];\n consumedBy: string[] = [];\n}\n\nexport interface RuntimeQueue extends RuntimeQueueFlow {\n api: string;\n method: string;\n /** `@Queue(...)` override, else `${Api}-${method}` — the name Terraform must match 1:1. */\n queueName: string;\n}\n\n/**\n * An endpoint driven by something that is NOT an in-repo caller — a clock or an outside system.\n * These never appear as runtime EDGES (there is no in-repo `from`), which is exactly why they were\n * invisible until now: a nightly sweep and a GCP push subscription are real runtime entry points\n * with real Terraform behind them, and the graph showed neither.\n */\nexport interface RuntimeTrigger extends RuntimeLevel {\n /** 'cron' → a scheduler fires it; 'external' → a system outside this repo posts to it. */\n kind: 'cron' | 'external';\n api: string;\n method: string;\n /** The service that SERVES the endpoint (the arrow's head). */\n service: string;\n /** Present for 'cron': the Cloud Scheduler job / queue name Terraform must match. */\n queueName?: string;\n /**\n * Present for 'external': WHO outside this repo posts to it, declared as\n * `@Endpoint(POST, p, WRITE, EXTERNAL, { calledBy: 'twilio' })`.\n *\n * The caller is drawn separately from an outbound system with the same label: callers\n * start the flow on the top row, while outbound systems are sinks on L0.\n *\n * Optional only for graphs generated BEFORE the caller was required; generation now fails rather\n * than emitting an `external` method without one.\n */\n caller?: ExternalSystemDeclaration;\n}\n\nexport interface RuntimeUnresolved extends RuntimeLevel {\n service: string;\n api: string;\n}\n\n/**\n * A system outside this repo that a service TALKS TO, drawn with a shape that says what it is\n * (a database as a cylinder, a bucket as a folder) instead of the one grey box every external\n * used to collapse into.\n *\n * Two declaration sites feed this, because the two real cases differ in whether a contract exists:\n *\n * - **Wrapped** — the repo has a vendor seam (`FirestoreAdminApi`), so the kind is declared with an\n * `@externalSystem <kind> [label]` JSDoc tag on the contract. A decorator cannot go on a TS\n * `interface`, and these seams are interfaces, so JSDoc is the only marker that fits in place.\n * - **Unwrapped** — the service opens the connection itself with no contract to mark (a `pg.Pool`,\n * a TypeORM `DataSource`), so the declaration is an `external:<kind>:<identity>` nx tag on that\n * project's project.json.\n *\n * `label` is the node IDENTITY, not just display text: two services declaring `postgres` converge on\n * ONE node with two arrows into it, rather than drawing a database each.\n */\nexport interface RuntimeExternalSystem extends RuntimeLevel {\n kind: ExternalSystemKind;\n /** Display name AND node identity — declarations sharing a label share a node. */\n label: string;\n /** Services with a direct arrow to it. No transitive fan-out: a tag speaks only for its project. */\n usedBy: string[];\n /** Contracts flowing over it. Empty for the unwrapped (tag-declared) case — there are none. */\n apis: string[];\n}\n\n/**\n * One caller's calls into a {@link RuntimeRemoteService}, one entry per (caller, transport): `via`\n * lists the contracts it calls there.\n */\nexport interface RuntimeRemoteCall {\n from: string;\n via: string[];\n type: ApiTransport;\n}\n\n/**\n * A service OUTSIDE this workspace (another repo, a VM, partner endpoints) declared in the reviewed\n * `remoteServices` table of dependencies.json (#1203). It is a SERVICE — it implements our contracts —\n * so it is drawn as a service node, distinct from a vendor external system. Its level is zero:\n * outbound calls from outside this workspace are not part of this graph.\n */\nexport interface RuntimeRemoteService extends RuntimeLevel {\n /** Display text from the reviewed declaration; the key is the identity. */\n label?: string;\n /** The contracts it is declared to implement, as `Api (transport)`, in reviewed order. */\n implements: string[];\n /** Workspace services that target it, sorted by caller then transport. */\n calledBy: RuntimeRemoteCall[];\n}\n\nexport interface RuntimeGraph {\n maxLevel: number;\n /** Contract-only pubsub flows; these do not assert any method-level producers. */\n contractQueues: Record<string, RuntimeQueueFlow>;\n services: Record<string, RuntimeService>;\n apis: Record<string, RuntimeApi>;\n runtimeEdges: RuntimeEdge[];\n unresolvedUses: RuntimeUnresolved[];\n /** `\"Api.method\"` -> the queue between its producers and its consumers. */\n queues: Record<string, RuntimeQueue>;\n /** Clock- and outside-driven entry points, sorted for determinism. */\n triggers: RuntimeTrigger[];\n /**\n * Declared external systems, keyed by identity. Optional so every graph written before this\n * existed still parses — an absent map means \"nothing declared\", which renders exactly as before.\n */\n externalSystems?: Record<string, RuntimeExternalSystem>;\n /**\n * Reviewed out-of-workspace services, keyed by service name (#1203). Absent when none are\n * declared, so every graph written before this existed parses and renders exactly as before.\n */\n remoteServices?: Record<string, RuntimeRemoteService>;\n}\n"]}
|
|
@@ -94,4 +94,4 @@ export declare function deriveRuntimeGraph(projects: EnhancedGraph, hiddenProjec
|
|
|
94
94
|
* file that records its own doubts would just get committed and stop being read.
|
|
95
95
|
*/
|
|
96
96
|
export declare function deriveRuntimeGraphReport(projects: EnhancedGraph, hiddenProjects?: Set<string>, apiContracts?: ApiContracts, externalSystems?: ExternalSystemDecls, remoteServices?: RemoteServices): RuntimeGraphReport;
|
|
97
|
-
export { runtimeAdjacency } from './runtime-
|
|
97
|
+
export { runtimeAdjacency } from './runtime-node-levels';
|
package/src/lib/runtime-graph.js
CHANGED
|
@@ -39,6 +39,7 @@ const external_systems_1 = require("./api-usage/external-systems");
|
|
|
39
39
|
const graph_products_1 = require("./graph-products");
|
|
40
40
|
const runtime_remote_calls_1 = require("./runtime-remote-calls");
|
|
41
41
|
const runtime_graph_levels_1 = require("./runtime-graph-levels");
|
|
42
|
+
const runtime_node_levels_1 = require("./runtime-node-levels");
|
|
42
43
|
// Persistence lives in runtime-graph-io.ts; re-exported for the same reason as the model types.
|
|
43
44
|
var runtime_graph_io_1 = require("./runtime-graph-io");
|
|
44
45
|
Object.defineProperty(exports, "DEFAULT_RUNTIME_GRAPH_PATH", { enumerable: true, get: function () { return runtime_graph_io_1.DEFAULT_RUNTIME_GRAPH_PATH; } });
|
|
@@ -172,6 +173,8 @@ class RuntimeGraphDeriver {
|
|
|
172
173
|
for (const api of Array.from(apis.keys()).sort())
|
|
173
174
|
apisObj[api] = apis.get(api);
|
|
174
175
|
const graph = {
|
|
176
|
+
maxLevel: 0,
|
|
177
|
+
contractQueues: {},
|
|
175
178
|
services,
|
|
176
179
|
apis: apisObj,
|
|
177
180
|
runtimeEdges: edgeResult.edges,
|
|
@@ -188,6 +191,7 @@ class RuntimeGraphDeriver {
|
|
|
188
191
|
const systems = (0, external_systems_1.resolveExternalSystems)(this.externalSystemDecls, services);
|
|
189
192
|
(0, external_systems_1.attachExternalSystems)(graph, systems);
|
|
190
193
|
this.remoteCalls.attach(graph);
|
|
194
|
+
new runtime_node_levels_1.RuntimeNodeLevels().apply(graph);
|
|
191
195
|
return new RuntimeGraphReport(graph, this.warnings, this.problems, [...this.autoHidden].sort());
|
|
192
196
|
}
|
|
193
197
|
/**
|
|
@@ -205,6 +209,8 @@ class RuntimeGraphDeriver {
|
|
|
205
209
|
if (method.kind !== 'cron' && method.kind !== 'external')
|
|
206
210
|
continue;
|
|
207
211
|
const trigger = {
|
|
212
|
+
level: 0,
|
|
213
|
+
levelBecause: '',
|
|
208
214
|
kind: method.kind,
|
|
209
215
|
api: ref.api,
|
|
210
216
|
method: method.name,
|
|
@@ -369,7 +375,12 @@ class RuntimeGraphDeriver {
|
|
|
369
375
|
if (implementers.length === 0) {
|
|
370
376
|
// Nobody in-repo serves it. For a vendor contract that is the ANSWER, not a gap:
|
|
371
377
|
// the call leaves the repo, and the viz terminates it at a dashed vendor node.
|
|
372
|
-
unresolved.push({
|
|
378
|
+
unresolved.push({
|
|
379
|
+
level: 0,
|
|
380
|
+
levelBecause: 'outbound sink',
|
|
381
|
+
service: decl.name,
|
|
382
|
+
api: ref.api,
|
|
383
|
+
});
|
|
373
384
|
continue;
|
|
374
385
|
}
|
|
375
386
|
for (const target of this.targetsFor(decl.name, ref, implementers)) {
|
|
@@ -507,6 +518,7 @@ class RuntimeGraphDeriver {
|
|
|
507
518
|
// the committed JSON stays clean AND deterministic without conditional assembly.
|
|
508
519
|
const service = {
|
|
509
520
|
level: 0,
|
|
521
|
+
levelBecause: '',
|
|
510
522
|
role: this.projects[decl.name]?.role, // labels a relation-less node for what it IS
|
|
511
523
|
serviceName: this.projects[decl.name]?.serviceName,
|
|
512
524
|
callsService: this.projects[decl.name]?.callsService,
|
|
@@ -532,9 +544,6 @@ class RuntimeGraphDeriver {
|
|
|
532
544
|
this.autoHidden.push(decl.name);
|
|
533
545
|
}
|
|
534
546
|
}
|
|
535
|
-
const levels = (0, runtime_graph_levels_1.assignLevels)((0, runtime_graph_levels_1.adjacencyFromEdges)(Object.keys(services), edges));
|
|
536
|
-
for (const name of Object.keys(services))
|
|
537
|
-
services[name].level = levels[name] ?? 0;
|
|
538
547
|
return services;
|
|
539
548
|
}
|
|
540
549
|
}
|
|
@@ -560,6 +569,6 @@ function deriveRuntimeGraphReport(projects, hiddenProjects = new Set(), apiContr
|
|
|
560
569
|
}
|
|
561
570
|
// Levels + adjacency live in runtime-graph-levels.ts; re-exported for the same reason the model types
|
|
562
571
|
// and the io helpers above are — one obvious place to import the runtime graph from.
|
|
563
|
-
var
|
|
564
|
-
Object.defineProperty(exports, "runtimeAdjacency", { enumerable: true, get: function () { return
|
|
572
|
+
var runtime_node_levels_2 = require("./runtime-node-levels");
|
|
573
|
+
Object.defineProperty(exports, "runtimeAdjacency", { enumerable: true, get: function () { return runtime_node_levels_2.runtimeAdjacency; } });
|
|
565
574
|
//# sourceMappingURL=runtime-graph.js.map
|