@ttsc/graph 0.30.4 → 0.31.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.
Files changed (292) hide show
  1. package/README.md +122 -30
  2. package/lib/CapturedProcessOutput.d.ts +47 -0
  3. package/lib/CapturedProcessOutput.js +3 -0
  4. package/lib/CapturedProcessOutput.js.map +1 -0
  5. package/lib/ILauncherOption.d.ts +22 -0
  6. package/lib/ILauncherOption.js +3 -0
  7. package/lib/ILauncherOption.js.map +1 -0
  8. package/lib/IProjectOptions.d.ts +18 -0
  9. package/lib/IProjectOptions.js +3 -0
  10. package/lib/IProjectOptions.js.map +1 -0
  11. package/lib/ParsedLauncherOptions.d.ts +13 -0
  12. package/lib/ParsedLauncherOptions.js +3 -0
  13. package/lib/ParsedLauncherOptions.js.map +1 -0
  14. package/lib/TtscGraphApplication.d.ts +38 -1
  15. package/lib/TtscGraphApplication.js +26 -1
  16. package/lib/TtscGraphApplication.js.map +1 -1
  17. package/lib/TtscGraphLauncherArguments.d.ts +115 -0
  18. package/lib/TtscGraphLauncherArguments.js +181 -0
  19. package/lib/TtscGraphLauncherArguments.js.map +1 -0
  20. package/lib/TtscGraphViewSnapshot.d.ts +35 -0
  21. package/lib/TtscGraphViewSnapshot.js +48 -0
  22. package/lib/TtscGraphViewSnapshot.js.map +1 -0
  23. package/lib/index.d.ts +9 -24
  24. package/lib/index.js +6 -128
  25. package/lib/index.js.map +1 -1
  26. package/lib/internal/GraphProcessTrace.d.ts +1 -0
  27. package/lib/internal/GraphProcessTrace.js +235 -0
  28. package/lib/internal/GraphProcessTrace.js.map +1 -0
  29. package/lib/launcherArgs.d.ts +75 -16
  30. package/lib/launcherArgs.js +77 -8
  31. package/lib/launcherArgs.js.map +1 -1
  32. package/lib/model/IArtifactDirectory.d.ts +26 -0
  33. package/lib/model/IArtifactDirectory.js +3 -0
  34. package/lib/model/IArtifactDirectory.js.map +1 -0
  35. package/lib/model/IArtifactInputs.d.ts +19 -0
  36. package/lib/model/IArtifactInputs.js +3 -0
  37. package/lib/model/IArtifactInputs.js.map +1 -0
  38. package/lib/model/IPublishedArtifacts.d.ts +76 -0
  39. package/lib/model/IPublishedArtifacts.js +3 -0
  40. package/lib/model/IPublishedArtifacts.js.map +1 -0
  41. package/lib/model/IPublishedArtifactsResident.d.ts +19 -0
  42. package/lib/model/IPublishedArtifactsResident.js +3 -0
  43. package/lib/model/IPublishedArtifactsResident.js.map +1 -0
  44. package/lib/model/ITtscLintDaemonTarget.d.ts +20 -0
  45. package/lib/model/ITtscLintDaemonTarget.js +3 -0
  46. package/lib/model/ITtscLintDaemonTarget.js.map +1 -0
  47. package/lib/model/TtscGraphLinePeer.d.ts +146 -0
  48. package/lib/model/TtscGraphLinePeer.js +213 -0
  49. package/lib/model/TtscGraphLinePeer.js.map +1 -0
  50. package/lib/model/TtscGraphMemory.d.ts +156 -16
  51. package/lib/model/TtscGraphMemory.js +228 -222
  52. package/lib/model/TtscGraphMemory.js.map +1 -1
  53. package/lib/model/TtscGraphNativeArguments.d.ts +40 -0
  54. package/lib/model/TtscGraphNativeArguments.js +64 -0
  55. package/lib/model/TtscGraphNativeArguments.js.map +1 -0
  56. package/lib/model/TtscGraphNodeId.d.ts +55 -3
  57. package/lib/model/TtscGraphNodeId.js +40 -2
  58. package/lib/model/TtscGraphNodeId.js.map +1 -1
  59. package/lib/model/TtscGraphProjection.d.ts +156 -0
  60. package/lib/model/TtscGraphProjection.js +390 -0
  61. package/lib/model/TtscGraphProjection.js.map +1 -0
  62. package/lib/model/TtscGraphProtocol.d.ts +28 -0
  63. package/lib/model/TtscGraphProtocol.js +928 -0
  64. package/lib/model/TtscGraphProtocol.js.map +1 -0
  65. package/lib/model/TtscGraphReadonly.d.ts +15 -0
  66. package/lib/model/TtscGraphReadonly.js +3 -0
  67. package/lib/model/TtscGraphReadonly.js.map +1 -0
  68. package/lib/model/TtscGraphRequestOptions.d.ts +16 -0
  69. package/lib/model/TtscGraphRequestOptions.js +3 -0
  70. package/lib/model/TtscGraphRequestOptions.js.map +1 -0
  71. package/lib/model/TtscGraphSession.d.ts +82 -36
  72. package/lib/model/TtscGraphSession.js +164 -1238
  73. package/lib/model/TtscGraphSession.js.map +1 -1
  74. package/lib/model/TtscGraphSessionOptions.d.ts +20 -0
  75. package/lib/model/TtscGraphSessionOptions.js +3 -0
  76. package/lib/model/TtscGraphSessionOptions.js.map +1 -0
  77. package/lib/model/TtscGraphSessionState.d.ts +187 -0
  78. package/lib/model/TtscGraphSessionState.js +417 -0
  79. package/lib/model/TtscGraphSessionState.js.map +1 -0
  80. package/lib/model/TtscGraphShardStore.d.ts +64 -3
  81. package/lib/model/TtscGraphShardStore.js +85 -15
  82. package/lib/model/TtscGraphShardStore.js.map +1 -1
  83. package/lib/model/TtscGraphSourceReader.d.ts +31 -8
  84. package/lib/model/TtscGraphSourceReader.js +37 -13
  85. package/lib/model/TtscGraphSourceReader.js.map +1 -1
  86. package/lib/model/TtscLintDaemon.d.ts +35 -17
  87. package/lib/model/TtscLintDaemon.js +39 -117
  88. package/lib/model/TtscLintDaemon.js.map +1 -1
  89. package/lib/model/TtscLintDaemonState.d.ts +69 -0
  90. package/lib/model/TtscLintDaemonState.js +166 -0
  91. package/lib/model/TtscLintDaemonState.js.map +1 -0
  92. package/lib/model/copyGraphRecords.d.ts +14 -0
  93. package/lib/model/copyGraphRecords.js +19 -0
  94. package/lib/model/copyGraphRecords.js.map +1 -0
  95. package/lib/model/copyGraphSnapshot.d.ts +17 -0
  96. package/lib/model/copyGraphSnapshot.js +33 -0
  97. package/lib/model/copyGraphSnapshot.js.map +1 -0
  98. package/lib/model/loadGraph.d.ts +19 -10
  99. package/lib/model/loadGraph.js +21 -12
  100. package/lib/model/loadGraph.js.map +1 -1
  101. package/lib/model/publishedArtifacts.d.ts +78 -97
  102. package/lib/model/publishedArtifacts.js +271 -85
  103. package/lib/model/publishedArtifacts.js.map +1 -1
  104. package/lib/nativeExecutable.d.ts +19 -8
  105. package/lib/nativeExecutable.js +75 -15
  106. package/lib/nativeExecutable.js.map +1 -1
  107. package/lib/reduce.d.ts +19 -45
  108. package/lib/reduce.js +19 -3
  109. package/lib/reduce.js.map +1 -1
  110. package/lib/resolveGraphBinary.d.ts +9 -0
  111. package/lib/resolveGraphBinary.js +11 -3
  112. package/lib/resolveGraphBinary.js.map +1 -1
  113. package/lib/runGraph.d.ts +21 -0
  114. package/lib/runGraph.js +83 -0
  115. package/lib/runGraph.js.map +1 -0
  116. package/lib/server/IResolvedGraphHandle.d.ts +22 -0
  117. package/lib/server/IResolvedGraphHandle.js +3 -0
  118. package/lib/server/IResolvedGraphHandle.js.map +1 -0
  119. package/lib/server/createServer.d.ts +14 -10
  120. package/lib/server/createServer.js +42 -39
  121. package/lib/server/createServer.js.map +1 -1
  122. package/lib/server/exportSurface.d.ts +23 -1
  123. package/lib/server/exportSurface.js +23 -1
  124. package/lib/server/exportSurface.js.map +1 -1
  125. package/lib/server/formatGraphFailure.d.ts +20 -0
  126. package/lib/server/formatGraphFailure.js +35 -0
  127. package/lib/server/formatGraphFailure.js.map +1 -0
  128. package/lib/server/pathPolicy.d.ts +70 -5
  129. package/lib/server/pathPolicy.js +66 -4
  130. package/lib/server/pathPolicy.js.map +1 -1
  131. package/lib/server/resolveHandle.d.ts +10 -5
  132. package/lib/server/resolveHandle.js +39 -7
  133. package/lib/server/resolveHandle.js.map +1 -1
  134. package/lib/server/resultAudit.d.ts +17 -14
  135. package/lib/server/resultAudit.js +56 -27
  136. package/lib/server/resultAudit.js.map +1 -1
  137. package/lib/server/resultNext.d.ts +26 -1
  138. package/lib/server/resultNext.js +14 -0
  139. package/lib/server/resultNext.js.map +1 -1
  140. package/lib/server/runDetails.d.ts +72 -15
  141. package/lib/server/runDetails.js +104 -69
  142. package/lib/server/runDetails.js.map +1 -1
  143. package/lib/server/runEntrypoints.d.ts +9 -0
  144. package/lib/server/runEntrypoints.js +9 -0
  145. package/lib/server/runEntrypoints.js.map +1 -1
  146. package/lib/server/runLookup.d.ts +13 -3
  147. package/lib/server/runLookup.js +19 -6
  148. package/lib/server/runLookup.js.map +1 -1
  149. package/lib/server/runOverview.d.ts +13 -4
  150. package/lib/server/runOverview.js +13 -4
  151. package/lib/server/runOverview.js.map +1 -1
  152. package/lib/server/runTour.d.ts +9 -0
  153. package/lib/server/runTour.js +33 -65
  154. package/lib/server/runTour.js.map +1 -1
  155. package/lib/server/runTrace.d.ts +25 -1
  156. package/lib/server/runTrace.js +133 -88
  157. package/lib/server/runTrace.js.map +1 -1
  158. package/lib/server/startServer.d.ts +16 -0
  159. package/lib/server/startServer.js +24 -1
  160. package/lib/server/startServer.js.map +1 -1
  161. package/lib/structures/ITtscGraphApplication.d.ts +95 -41
  162. package/lib/structures/ITtscGraphDecorator.d.ts +18 -0
  163. package/lib/structures/ITtscGraphDetails.d.ts +81 -6
  164. package/lib/structures/ITtscGraphDocTag.d.ts +17 -8
  165. package/lib/structures/ITtscGraphDump.d.ts +106 -8
  166. package/lib/structures/ITtscGraphEdge.d.ts +14 -2
  167. package/lib/structures/ITtscGraphEntrypoints.d.ts +81 -6
  168. package/lib/structures/ITtscGraphEscape.d.ts +24 -2
  169. package/lib/structures/ITtscGraphEvidence.d.ts +9 -0
  170. package/lib/structures/ITtscGraphLookup.d.ts +42 -9
  171. package/lib/structures/ITtscGraphNext.d.ts +12 -1
  172. package/lib/structures/ITtscGraphNode.d.ts +38 -11
  173. package/lib/structures/ITtscGraphOverview.d.ts +81 -6
  174. package/lib/structures/ITtscGraphSnapshot.d.ts +97 -2
  175. package/lib/structures/ITtscGraphSpan.d.ts +9 -0
  176. package/lib/structures/ITtscGraphTour.d.ts +83 -9
  177. package/lib/structures/ITtscGraphTrace.d.ts +99 -14
  178. package/lib/structures/RawDump.d.ts +22 -0
  179. package/lib/structures/RawDump.js +3 -0
  180. package/lib/structures/RawDump.js.map +1 -0
  181. package/lib/structures/RawEdge.d.ts +20 -0
  182. package/lib/structures/RawEdge.js +3 -0
  183. package/lib/structures/RawEdge.js.map +1 -0
  184. package/lib/structures/RawNode.d.ts +26 -0
  185. package/lib/structures/RawNode.js +3 -0
  186. package/lib/structures/RawNode.js.map +1 -0
  187. package/lib/structures/TtscGraphArtifactNodeKind.d.ts +9 -0
  188. package/lib/structures/TtscGraphArtifactNodeKind.js +9 -0
  189. package/lib/structures/TtscGraphArtifactNodeKind.js.map +1 -1
  190. package/lib/structures/TtscGraphDumpEdgeKind.d.ts +15 -1
  191. package/lib/structures/TtscGraphDumpNodeKind.d.ts +9 -0
  192. package/lib/structures/TtscGraphEdgeKind.d.ts +13 -4
  193. package/lib/structures/TtscGraphNodeKind.d.ts +9 -0
  194. package/lib/structures/TtscGraphNodeModifier.d.ts +9 -0
  195. package/lib/structures/ViewerLink.d.ts +20 -0
  196. package/lib/structures/ViewerLink.js +3 -0
  197. package/lib/structures/ViewerLink.js.map +1 -0
  198. package/lib/structures/ViewerNode.d.ts +24 -0
  199. package/lib/structures/ViewerNode.js +3 -0
  200. package/lib/structures/ViewerNode.js.map +1 -0
  201. package/lib/structures/ViewerPayload.d.ts +42 -0
  202. package/lib/structures/ViewerPayload.js +3 -0
  203. package/lib/structures/ViewerPayload.js.map +1 -0
  204. package/lib/view.d.ts +9 -0
  205. package/lib/view.js +203 -91
  206. package/lib/view.js.map +1 -1
  207. package/lib/viewer/viewer.js +1 -1
  208. package/package.json +8 -6
  209. package/src/CapturedProcessOutput.ts +50 -0
  210. package/src/ILauncherOption.ts +24 -0
  211. package/src/IProjectOptions.ts +19 -0
  212. package/src/ParsedLauncherOptions.ts +13 -0
  213. package/src/TtscGraphApplication.ts +38 -1
  214. package/src/TtscGraphLauncherArguments.ts +207 -0
  215. package/src/TtscGraphViewSnapshot.ts +46 -0
  216. package/src/index.ts +9 -160
  217. package/src/internal/GraphProcessTrace.ts +242 -0
  218. package/src/launcherArgs.ts +89 -23
  219. package/src/model/IArtifactDirectory.ts +27 -0
  220. package/src/model/IArtifactInputs.ts +21 -0
  221. package/src/model/IPublishedArtifacts.ts +81 -0
  222. package/src/model/IPublishedArtifactsResident.ts +24 -0
  223. package/src/model/ITtscLintDaemonTarget.ts +22 -0
  224. package/src/model/TtscGraphLinePeer.ts +318 -0
  225. package/src/model/TtscGraphMemory.ts +284 -246
  226. package/src/model/TtscGraphNativeArguments.ts +67 -0
  227. package/src/model/TtscGraphNodeId.ts +57 -3
  228. package/src/model/TtscGraphProjection.ts +473 -0
  229. package/src/model/TtscGraphProtocol.ts +90 -0
  230. package/src/model/TtscGraphReadonly.ts +17 -0
  231. package/src/model/TtscGraphRequestOptions.ts +16 -0
  232. package/src/model/TtscGraphSession.ts +196 -475
  233. package/src/model/TtscGraphSessionOptions.ts +22 -0
  234. package/src/model/TtscGraphSessionState.ts +558 -0
  235. package/src/model/TtscGraphShardStore.ts +99 -23
  236. package/src/model/TtscGraphSourceReader.ts +37 -15
  237. package/src/model/TtscLintDaemon.ts +55 -136
  238. package/src/model/TtscLintDaemonState.ts +174 -0
  239. package/src/model/copyGraphRecords.ts +17 -0
  240. package/src/model/copyGraphSnapshot.ts +30 -0
  241. package/src/model/loadGraph.ts +23 -12
  242. package/src/model/publishedArtifacts.ts +361 -182
  243. package/src/nativeExecutable.ts +93 -26
  244. package/src/reduce.ts +24 -51
  245. package/src/resolveGraphBinary.ts +13 -3
  246. package/src/runGraph.ts +90 -0
  247. package/src/server/IResolvedGraphHandle.ts +24 -0
  248. package/src/server/createServer.ts +16 -22
  249. package/src/server/exportSurface.ts +23 -1
  250. package/src/server/formatGraphFailure.ts +32 -0
  251. package/src/server/pathPolicy.ts +70 -5
  252. package/src/server/resolveHandle.ts +45 -14
  253. package/src/server/resultAudit.ts +58 -27
  254. package/src/server/resultNext.ts +26 -1
  255. package/src/server/runDetails.ts +138 -73
  256. package/src/server/runEntrypoints.ts +13 -1
  257. package/src/server/runLookup.ts +23 -7
  258. package/src/server/runOverview.ts +17 -5
  259. package/src/server/runTour.ts +44 -82
  260. package/src/server/runTrace.ts +175 -102
  261. package/src/server/startServer.ts +29 -1
  262. package/src/structures/ITtscGraphApplication.ts +95 -41
  263. package/src/structures/ITtscGraphDecorator.ts +18 -0
  264. package/src/structures/ITtscGraphDetails.ts +81 -6
  265. package/src/structures/ITtscGraphDocTag.ts +17 -8
  266. package/src/structures/ITtscGraphDump.ts +106 -8
  267. package/src/structures/ITtscGraphEdge.ts +14 -2
  268. package/src/structures/ITtscGraphEntrypoints.ts +81 -6
  269. package/src/structures/ITtscGraphEscape.ts +24 -2
  270. package/src/structures/ITtscGraphEvidence.ts +9 -0
  271. package/src/structures/ITtscGraphLookup.ts +42 -9
  272. package/src/structures/ITtscGraphNext.ts +12 -1
  273. package/src/structures/ITtscGraphNode.ts +38 -11
  274. package/src/structures/ITtscGraphOverview.ts +88 -6
  275. package/src/structures/ITtscGraphSnapshot.ts +117 -2
  276. package/src/structures/ITtscGraphSpan.ts +9 -0
  277. package/src/structures/ITtscGraphTour.ts +83 -9
  278. package/src/structures/ITtscGraphTrace.ts +100 -14
  279. package/src/structures/RawDump.ts +25 -0
  280. package/src/structures/RawEdge.ts +22 -0
  281. package/src/structures/RawNode.ts +31 -0
  282. package/src/structures/TtscGraphArtifactNodeKind.ts +9 -0
  283. package/src/structures/TtscGraphDumpEdgeKind.ts +15 -1
  284. package/src/structures/TtscGraphDumpNodeKind.ts +9 -0
  285. package/src/structures/TtscGraphEdgeKind.ts +13 -4
  286. package/src/structures/TtscGraphNodeKind.ts +9 -0
  287. package/src/structures/TtscGraphNodeModifier.ts +9 -0
  288. package/src/structures/ViewerLink.ts +22 -0
  289. package/src/structures/ViewerNode.ts +28 -0
  290. package/src/structures/ViewerPayload.ts +52 -0
  291. package/src/view.ts +208 -110
  292. package/src/viewer/legend.ts +119 -27
@@ -3,8 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TtscGraphMemory = void 0;
4
4
  exports.documentationTarget = documentationTarget;
5
5
  exports.leadingToken = leadingToken;
6
- const TtscGraphArtifactNodeKind_1 = require("../structures/TtscGraphArtifactNodeKind");
7
- const TtscGraphNodeId_1 = require("./TtscGraphNodeId");
6
+ const TtscGraphProjection_1 = require("./TtscGraphProjection");
8
7
  const TtscGraphSourceReader_1 = require("./TtscGraphSourceReader");
9
8
  /**
10
9
  * The in-memory resident graph the MCP tools answer from.
@@ -16,8 +15,23 @@ const TtscGraphSourceReader_1 = require("./TtscGraphSourceReader");
16
15
  * implementation relationships are checker facts already present in the dump.
17
16
  * Every tool call is then a lookup or traversal over the indexes built here;
18
17
  * nothing recompiles.
18
+ *
19
+ * Snapshot records are owned copies and recursively frozen. Borrowed node
20
+ * records and edge buckets have recursively readonly types, so caller changes
21
+ * cannot invalidate generation-keyed indexes and caches.
22
+ *
23
+ * @evidence contracts/common.md#principled-implementation Native facts are preserved while module/file folding, exact owner suffixes and artifact parents synthesize only this layer's structural relationships.
24
+ * @evidence contracts/common.md#clear-and-simple-design One snapshot owns node, name, relation and citation indexes; individual accessors expose that shared model.
25
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Export surfaces remain checker relationships rather than guessed from local export flags or fixture paths.
26
+ * @evidence contracts/common.md#meaningful-documentation Native paragraphs distinguish compiler facts from synthesized structure, and accessors explain lookup and absence semantics.
27
+ * @evidenceExclude contracts/performance.md#efficient-algorithms from and fromResident own projection/index construction through their private helpers; this class declaration describes the resulting representation.
28
+ * @evidenceExclude contracts/performance.md#reuse-equivalent-work from and fromResident establish each shared generation; the declaration does not independently coordinate requests.
29
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources from and fromResident transfer generation storage to their caller; session/caller release owns its duration rather than this declaration.
30
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation an in-memory index over parsed facts; the source reader it owns is the only file reader.
19
31
  */
20
32
  class TtscGraphMemory {
33
+ projection;
34
+ nodeKeys;
21
35
  byId;
22
36
  outEdges;
23
37
  inEdges;
@@ -32,73 +46,172 @@ class TtscGraphMemory {
32
46
  edges;
33
47
  /** Provenance-gated source display facts cached for this exact snapshot. */
34
48
  source;
35
- constructor(project, nodes, edges, provenance) {
49
+ constructor(project, nodes, edges, provenance, projection, previous) {
50
+ this.projection = projection;
36
51
  this.project = project;
37
52
  this.nodes = nodes;
38
53
  this.edges = edges;
39
- this.source = new TtscGraphSourceReader_1.TtscGraphSourceReader(project, provenance);
40
- this.byId = new Map(nodes.map((n) => [n.id, n]));
41
- this.byNameIndex = new Map();
42
- this.bySymbolIndex = new Map();
43
- this.byDocTagTarget = new Map();
54
+ // Source adjudication belongs to this generation even when graph facts
55
+ // remain equivalent. Never transfer cached lines or cached absence.
56
+ this.source = new TtscGraphSourceReader_1.TtscGraphSourceReader(project, provenance === undefined
57
+ ? undefined
58
+ : {
59
+ capabilities: [...provenance.capabilities],
60
+ sources: provenance.sources.map((source) => ({ ...source })),
61
+ });
62
+ this.byId = new Map(nodes.map((node) => [node.id, node]));
63
+ this.nodeKeys = new Map();
44
64
  for (const node of nodes) {
45
- const bucket = this.byNameIndex.get(node.name);
46
- if (bucket)
47
- bucket.push(node);
48
- else
49
- this.byNameIndex.set(node.name, [node]);
50
- if (node.kind !== "file") {
51
- push(this.bySymbolIndex, node.name, node);
52
- if (node.qualifiedName !== undefined) {
53
- push(this.bySymbolIndex, node.qualifiedName, node);
54
- }
55
- }
56
- for (const target of docTagTargetsOf(node)) {
57
- const carriers = this.byDocTagTarget.get(target);
58
- // The membership check is redundant today — `docTagTargetsOf`
59
- // deduplicates within a node and this loop visits each node once — and
60
- // it is kept because the cost is a scan of a list that holds the
61
- // carriers of one address, while the failure it prevents is a
62
- // declaration reported twice as implementing one specification.
63
- if (carriers === undefined)
64
- this.byDocTagTarget.set(target, [node]);
65
- else if (!carriers.includes(node))
66
- carriers.push(node);
67
- }
68
- }
69
- this.outEdges = new Map();
70
- this.inEdges = new Map();
71
- for (const edge of edges) {
72
- push(this.outEdges, edge.from, edge);
73
- push(this.inEdges, edge.to, edge);
65
+ const retained = previous?.nodeKeys.get(node);
66
+ this.nodeKeys.set(node, retained ?? {
67
+ symbols: node.kind === "file"
68
+ ? []
69
+ : node.qualifiedName !== undefined &&
70
+ node.qualifiedName !== node.name
71
+ ? [node.name, node.qualifiedName]
72
+ : [node.name],
73
+ targets: docTagTargetsOf(node),
74
+ });
74
75
  }
76
+ this.byNameIndex = index(nodes, (node) => node.name, previous?.byNameIndex);
77
+ this.bySymbolIndex = index(nodes, (node) => this.nodeKeys.get(node).symbols, previous?.bySymbolIndex);
78
+ this.byDocTagTarget = index(nodes, (node) => this.nodeKeys.get(node).targets, previous?.byDocTagTarget);
79
+ this.outEdges = index(edges, (edge) => edge.from, previous?.outEdges);
80
+ this.inEdges = index(edges, (edge) => edge.to, previous?.inEdges);
81
+ Object.freeze(this);
75
82
  }
76
- /** Build a model from a parsed dump, synthesizing structural relationships. */
83
+ /**
84
+ * Build a model from a parsed dump, synthesizing structural relationships.
85
+ *
86
+ * The parsed dump must describe one valid generation. Node records are copied
87
+ * before member-kind refinement so the caller's dump is unchanged.
88
+ *
89
+ * @evidence contracts/common.md#principled-implementation Synthesis reanchors native module exports and derives containment from exact owner handles and disambiguating declaration ranges before constructing the indexes for that generation.
90
+ * @evidence contracts/common.md#clear-and-simple-design Synthesis owns representation changes; the private constructor owns index construction.
91
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts No export edges are guessed from flags, and artifact ownership follows its producer rather than TypeScript id heuristics.
92
+ * @evidence contracts/common.md#meaningful-documentation Native prose states the valid-generation precondition and caller-dump preservation.
93
+ * @evidence contracts/performance.md#efficient-algorithms Synthesis indexes nodes by file and handle, scanning only colliding owner buckets once per member; owned snapshot copying and index construction scan nodes, edges and facets; per-node target sets make citation deduplication linear in tag population without repeatedly scanning carrier buckets.
94
+ * @evidence contracts/performance.md#reuse-equivalent-work One model builds all indexes once over owned frozen facts and buckets, so external mutation cannot invalidate shared generation identity.
95
+ * @evidence contracts/performance.md#bound-retention-and-release-resources The model retains node/edge arrays, lookup indexes and source cache proportional to its generation; the session or direct caller releases the whole model when no longer needed.
96
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation builds indexes from a parsed dump object and reads no file; source text goes through TtscGraphSourceReader.
97
+ */
77
98
  static from(dump) {
78
- const { nodes, edges } = synthesize(dump);
99
+ const { nodes, edges } = TtscGraphProjection_1.TtscGraphProjection.full(dump);
79
100
  return new TtscGraphMemory(dump.project, nodes, edges, dump.provenance);
80
101
  }
81
- /** The node with this id, or undefined. */
102
+ /**
103
+ * Project validated frozen resident facts while retaining equivalent work.
104
+ *
105
+ * The shard store invokes this before committing its staged generation. Each
106
+ * model owns new index maps and a new source reader; unchanged facts and
107
+ * ordered index buckets may be shared with the previous immutable model.
108
+ *
109
+ * @evidence contracts/common.md#principled-implementation Validated frozen fact identity and complete projection dependencies qualify component reuse; construction never mutates the preceding model.
110
+ * @evidence contracts/common.md#clear-and-simple-design The projection owner handles synthesis components and this model owns ordered query indexes and source authority.
111
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts This internal path requires the store's complete validation; public from still detaches caller DTOs and no graph facts or validation are omitted.
112
+ * @evidence contracts/common.md#meaningful-documentation Native prose states the validated-input premise, staged commit and per-generation source-reader boundary.
113
+ * @evidence contracts/performance.md#efficient-algorithms Projection scans references and rebuilds only invalidated components; index scans retain equal buckets without allocating their arrays, while maps and generation arrays remain linear in facts.
114
+ * @evidence contracts/performance.md#reuse-equivalent-work Same-file owner/module dependencies and metadata qualify immutable components; exact ordered reference equality qualifies node/relation/citation buckets. New source adjudication is intentionally independent.
115
+ * @evidence contracts/performance.md#bound-retention-and-release-resources Each model retains only its current components, facts, indexes and source reader; unchanged values may also belong to retained old models, without a link retaining prior model generations.
116
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation Processes only frozen in-memory facts; source IO remains with the per-generation reader.
117
+ */
118
+ static fromResident(dump, previous) {
119
+ const projection = TtscGraphProjection_1.TtscGraphProjection.create(dump, previous?.projection);
120
+ return new TtscGraphMemory(dump.project, projection.nodes, projection.edges, dump.provenance, projection, previous);
121
+ }
122
+ /**
123
+ * The node with this exact stable id, or undefined when absent.
124
+ *
125
+ * @evidence contracts/common.md#principled-implementation The id index returns the snapshot's exact node without conflating same-named declarations.
126
+ * @evidence contracts/common.md#clear-and-simple-design This accessor delegates identity lookup to the single model index.
127
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Missing identities are not replaced by name-matched candidates.
128
+ * @evidence contracts/common.md#meaningful-documentation The native headline states exact-id and missing-result semantics.
129
+ * @evidence contracts/performance.md#efficient-algorithms Exact identity requires one construction-time map lookup and no node scan.
130
+ * @evidenceExclude contracts/performance.md#reuse-equivalent-work The accessor borrows a completed id index; from owns shared construction.
131
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources Returning an existing node acquires no handle or independent retained entry.
132
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation one Map lookup over in-memory facts.
133
+ */
82
134
  node(id) {
83
135
  return this.byId.get(id);
84
136
  }
85
- /** Edges leaving a node (the node is the `from`). */
137
+ /**
138
+ * Edges leaving a node (the node is the from endpoint), empty when absent.
139
+ *
140
+ * @evidence contracts/common.md#principled-implementation The outgoing index preserves native and synthesized edge direction for the exact node id.
141
+ * @evidence contracts/common.md#clear-and-simple-design The accessor exposes one readonly bucket without rescanning the edge population.
142
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Absence returns no edges rather than inferred calls from matching names.
143
+ * @evidence contracts/common.md#meaningful-documentation Native prose states endpoint direction, missing behavior and the readonly return contract.
144
+ * @evidence contracts/performance.md#efficient-algorithms A map lookup returns the outgoing bucket without traversing unrelated edges.
145
+ * @evidenceExclude contracts/performance.md#reuse-equivalent-work from owns the reused adjacency computation; the accessor only borrows its result.
146
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources Existing buckets remain generation-owned; the accessor acquires no separate resource.
147
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation one Map lookup over in-memory edges.
148
+ */
86
149
  outgoing(id) {
87
150
  return this.outEdges.get(id) ?? [];
88
151
  }
89
- /** Edges entering a node (the node is the `to`). */
152
+ /**
153
+ * Edges entering a node (the node is the to endpoint), empty when absent.
154
+ *
155
+ * @evidence contracts/common.md#principled-implementation The incoming index selects edges by their original target identity.
156
+ * @evidence contracts/common.md#clear-and-simple-design The accessor shares construction-time adjacency instead of implementing another traversal.
157
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts No callers are guessed from text or substituted when the bucket is absent.
158
+ * @evidence contracts/common.md#meaningful-documentation Native prose states incoming direction and empty absence before the tags.
159
+ * @evidence contracts/performance.md#efficient-algorithms A map lookup returns the incoming bucket without scanning graph edges.
160
+ * @evidenceExclude contracts/performance.md#reuse-equivalent-work This accessor borrows the index already shared by from rather than coordinating another producer.
161
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources It retains no state beyond the generation's existing edge bucket.
162
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation one Map lookup over in-memory edges.
163
+ */
90
164
  incoming(id) {
91
165
  return this.inEdges.get(id) ?? [];
92
166
  }
93
- /** Every node whose simple name equals `name`. */
167
+ /**
168
+ * Every node whose simple name equals name, empty when absent.
169
+ *
170
+ * @evidence contracts/common.md#principled-implementation The exact simple-name index returns all matching identities, preserving ambiguity.
171
+ * @evidence contracts/common.md#clear-and-simple-design A readonly bucket supplies name lookup independently of ranked search.
172
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Multiple declarations remain candidates rather than selecting the expected fixture's declaration.
173
+ * @evidence contracts/common.md#meaningful-documentation Native prose describes exact matching and empty absence.
174
+ * @evidence contracts/performance.md#efficient-algorithms Exact-name lookup performs one map access instead of filtering all nodes.
175
+ * @evidenceExclude contracts/performance.md#reuse-equivalent-work Name-index construction and validity belong to from, not this borrowed bucket lookup.
176
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The returned bucket remains generation-owned with no separately retained cache or handle.
177
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation one Map lookup over in-memory facts.
178
+ */
94
179
  named(name) {
95
180
  return this.byNameIndex.get(name) ?? [];
96
181
  }
97
- /** Every non-file node whose simple or owner-qualified symbol handle matches. */
182
+ /**
183
+ * Every non-file node whose simple or owner-qualified symbol handle matches.
184
+ *
185
+ * Matches borrow a frozen generation-owned bucket; no match returns an empty
186
+ * readonly list, and several matches remain distinct.
187
+ *
188
+ * @evidence contracts/common.md#principled-implementation The symbol index includes simple and qualified handles but excludes file containers from symbol resolution.
189
+ * @evidence contracts/common.md#clear-and-simple-design One shared index serves all exact-handle consumers without duplicate resolution policy.
190
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The accessor preserves ambiguity rather than fabricating a unique resolution.
191
+ * @evidence contracts/common.md#meaningful-documentation Native prose explains non-file selection, qualified handles and multiple/missing matches.
192
+ * @evidence contracts/performance.md#efficient-algorithms Both simple and qualified handles use the construction-time symbol index, so this accessor performs one map lookup without scanning candidates.
193
+ * @evidenceExclude contracts/performance.md#reuse-equivalent-work This borrows one already-built symbol bucket; model construction owns shared work.
194
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources Existing candidates remain frozen generation-owned records in a borrowed bucket; the accessor acquires no separate resource or retained entry.
195
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation one Map lookup over in-memory facts.
196
+ */
98
197
  symbols(handle) {
99
198
  return this.bySymbolIndex.get(handle) ?? [];
100
199
  }
101
- /** Every workspace node on its module's export surface. */
200
+ /**
201
+ * Every workspace node marked exported by the native declaration facts.
202
+ *
203
+ * External declarations are omitted. Module-specific re-export membership is
204
+ * available separately through exports edges.
205
+ *
206
+ * @evidence contracts/common.md#principled-implementation Filtering exported flags and excluding external nodes yields local exported declarations, not a guessed package front door.
207
+ * @evidence contracts/common.md#clear-and-simple-design The accessor performs one explicit population filter; per-module surface remains in relation indexes.
208
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The API does not equate declaring-file export flags with all barrel export relationships.
209
+ * @evidence contracts/common.md#meaningful-documentation Native prose distinguishes exported declarations from module-specific re-exports and states external omission.
210
+ * @evidence contracts/performance.md#efficient-algorithms One O(V) filter over generation nodes selects exported nonexternal declarations; no separate export-flag index is built.
211
+ * @evidence contracts/performance.md#reuse-equivalent-work Completed exported-list memoization is not implemented; every call returns a new mutable array over the shared generation nodes.
212
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The projected array belongs to its caller; this method retains no separate state.
213
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation filters the in-memory node array; no file, path or process.
214
+ */
102
215
  exported() {
103
216
  return this.nodes.filter((n) => n.exported && !n.external);
104
217
  }
@@ -117,6 +230,15 @@ class TtscGraphMemory {
117
230
  * part of a tag's text names a thing belongs to whatever convention wrote the
118
231
  * tag, so this is a selection rule of the consuming layer rather than a fact
119
232
  * the producer claims.
233
+ *
234
+ * @evidence contracts/common.md#principled-implementation Exact target lookup returns indexed declaration carriers under documentationTarget's explicit consumer-side selection rule.
235
+ * @evidence contracts/common.md#clear-and-simple-design The reverse citation index is built once alongside node indexes instead of rescanning tags per query.
236
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts A match identifies a written citation, not a coverage or truth verdict about its target.
237
+ * @evidence contracts/common.md#meaningful-documentation Native paragraphs explain reverse lookup, exact spelling and the consumer heuristic's authority boundary.
238
+ * @evidence contracts/performance.md#efficient-algorithms Reverse citation lookup uses the constructed target index instead of scanning all tags per request.
239
+ * @evidenceExclude contracts/performance.md#reuse-equivalent-work The accessor borrows the shared citation index; from owns synthesis and its validity key.
240
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources It returns an existing readonly carrier list and acquires no resource or historical cache.
241
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation one Map lookup over in-memory facts.
120
242
  */
121
243
  citing(target) {
122
244
  return this.byDocTagTarget.get(target) ?? [];
@@ -134,13 +256,13 @@ exports.TtscGraphMemory = TtscGraphMemory;
134
256
  function docTagTargetsOf(node) {
135
257
  if (node.docTags === undefined)
136
258
  return [];
137
- const targets = [];
259
+ const targets = new Set();
138
260
  for (const tag of node.docTags) {
139
261
  const token = documentationTarget(tag.text);
140
- if (token !== undefined && !targets.includes(token))
141
- targets.push(token);
262
+ if (token !== undefined)
263
+ targets.add(token);
142
264
  }
143
- return targets;
265
+ return [...targets];
144
266
  }
145
267
  /**
146
268
  * The address a documentation tag's text opens with, or undefined when its
@@ -165,6 +287,15 @@ function docTagTargetsOf(node) {
165
287
  * layer whose audit already declares its selection heuristic. A convention
166
288
  * whose addresses look like prose is simply not indexed; nothing is lost from
167
289
  * the tag itself, which `details` still returns in full.
290
+ *
291
+ * @evidence contracts/common.md#principled-implementation Leading-token extraction plus interior separators selects address-like tokens while rejecting ordinary prose; this is explicitly a lookup heuristic.
292
+ * @evidence contracts/common.md#clear-and-simple-design One selector owns citation indexing and query normalization, leaving raw tags unchanged in declaration facts.
293
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Address punctuation is a general convention boundary rather than an allowlist of expected specifications.
294
+ * @evidence contracts/common.md#meaningful-documentation Native paragraphs state false-prose matches, accepted address forms and the limitation for prose-like conventions.
295
+ * @evidence contracts/performance.md#efficient-algorithms Leading-token extraction and address classification scan only the tag text, with no graph-wide lookup.
296
+ * @evidenceExclude contracts/performance.md#reuse-equivalent-work This pure token classifier has no completed-work coordinator; from builds the reusable citation index.
297
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The optional returned string owns no native resource or retained history.
298
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation tokenizes a tag string; the address it returns is text that is never resolved or opened.
168
299
  */
169
300
  function documentationTarget(text) {
170
301
  const token = leadingToken(text);
@@ -185,6 +316,15 @@ function documentationTarget(text) {
185
316
  * An unclosed brace group is not a token: `{@link ISale` with the brace
186
317
  * forgotten would otherwise fall through to the whitespace split and index the
187
318
  * address `{@link`, which every link in the project shares.
319
+ *
320
+ * @evidence contracts/common.md#principled-implementation Trim and first whitespace preserve the opening token; a leading brace group is returned whole only when closed.
321
+ * @evidence contracts/common.md#clear-and-simple-design This lexical helper is shared by citation selection rather than parsing tag semantics itself.
322
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Malformed brace groups return absence instead of being coerced into a ubiquitous partial link.
323
+ * @evidence contracts/common.md#meaningful-documentation Native prose explains brace grouping and the malformed-token reason before acknowledgment tags.
324
+ * @evidence contracts/performance.md#efficient-algorithms A single bounded text scan finds the token boundary without constructing a parser or scanning unrelated tags.
325
+ * @evidenceExclude contracts/performance.md#reuse-equivalent-work This pure per-string extraction does not coordinate reusable producer work.
326
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources Only the returned token survives the call; no retained map or handle is acquired.
327
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation splits a string at whitespace or a brace group; the token is never resolved or opened.
188
328
  */
189
329
  function leadingToken(text) {
190
330
  const trimmed = text?.trim();
@@ -197,185 +337,51 @@ function leadingToken(text) {
197
337
  const stop = trimmed.search(/\s/u);
198
338
  return stop < 0 ? trimmed : trimmed.slice(0, stop);
199
339
  }
200
- /** Append value to the slice stored at key, creating the slice on first use. */
201
- function push(map, key, value) {
202
- const bucket = map.get(key);
203
- if (bucket)
204
- bucket.push(value);
205
- else
206
- map.set(key, [value]);
207
- }
208
- /**
209
- * The within-file identity of a node: its owner-qualified name when it has one
210
- * (`Class.method`), else its simple name. Two nodes in one file never share a
211
- * key, so it is the handle the ownership synthesis looks owners up by.
212
- */
213
- function keyOf(node) {
214
- return node.qualifiedName ?? node.name;
215
- }
216
340
  /**
217
- * The owner key derived from facts the producer serialized separately.
341
+ * Build an ordered index, copying a bucket only after its membership differs.
218
342
  *
219
- * A quoted member named `"a.b"` has Name `a.b` and QualifiedName `Box.a.b`.
220
- * Cutting the qualified name at its last dot invents owner `Box.a`; removing
221
- * the exact `.${name}` suffix instead preserves the producer's real boundary.
222
- */
223
- function ownerKey(node) {
224
- if (node.qualifiedName === undefined || node.qualifiedName === node.name)
225
- return undefined;
226
- const suffix = `.${node.name}`;
227
- if (!node.qualifiedName.endsWith(suffix))
228
- return undefined;
229
- const owner = node.qualifiedName.slice(0, -suffix.length);
230
- return owner === "" ? undefined : owner;
231
- }
232
- /** A file's id and node name from its dump path coordinate. */
233
- function fileNodeId(file) {
234
- return file;
235
- }
236
- /**
237
- * A wire span with its file put back: the one the builder left out because the
238
- * reader has it, or the one it kept because it could not be derived (an
239
- * implementation in another file).
343
+ * The scan compares reference identity at each position with the previous
344
+ * immutable bucket. Prefixes are copied only on the first difference; a
345
+ * shortened bucket is copied at the end. New maps never mutate old maps or
346
+ * frozen buckets. Cost is linear in memberships plus changed bucket sizes;
347
+ * current counts/maps are temporary and no historical index is retained.
240
348
  */
241
- function spanIn(span, file) {
242
- return { ...span, file: span.file ?? file };
243
- }
244
- /**
245
- * The source file a node id names. An id is `path#Qualified.Name:kind`, and a
246
- * file node's id is the path itself.
247
- */
248
- function fileOfNodeId(id) {
249
- return (0, TtscGraphNodeId_1.ttscGraphNodeIdPath)(id) ?? id;
250
- }
251
- function basename(file) {
252
- const slash = file.lastIndexOf("/");
253
- return slash >= 0 ? file.slice(slash + 1) : file;
254
- }
255
- /**
256
- * Derive the structural layer from a dump's faithful facts: refine class-member
257
- * variables to properties, add a `file` node per workspace source, connect the
258
- * `contains` ownership tree, and re-anchor compiler-owned `exports` edges.
259
- */
260
- function synthesize(dump) {
261
- // A module node is the dump's name for a source file's export surface, and a
262
- // file node is this layer's name for the same file. Fold the two: the module
263
- // keeps its file present here even when the file declares nothing (a barrel),
264
- // and its `exports` edges are re-anchored on the file id every other tool
265
- // already traverses. What the module carried, the file now carries.
266
- const moduleFiles = new Set(dump.nodes.filter((n) => n.kind === "module").map((n) => n.file));
267
- const moduleIds = new Map(dump.nodes.filter((n) => n.kind === "module").map((n) => [n.id, n.file]));
268
- // Clone nodes so property refinement does not mutate the caller's dump, and
269
- // put back the file the builder left out of every span: a node's span is in
270
- // the node's file, an edge's span is in the file its `from` id names. The
271
- // builder omits both because they are exactly reconstructible and they are not
272
- // small — the two copies are 17% of the document, 55 MB of VS Code's 323 MB,
273
- // paid again in the encode, the pipe, the parse and the validation. Nothing
274
- // downstream of this line sees a span without its file.
275
- const nodes = dump.nodes.flatMap((n) => {
276
- if (n.kind === "module")
277
- return [];
278
- const { evidence, implementation, ...rest } = n;
279
- return [
280
- {
281
- ...rest,
282
- kind: n.kind,
283
- ...(evidence !== undefined
284
- ? { evidence: spanIn(evidence, n.file) }
285
- : {}),
286
- ...(implementation !== undefined
287
- ? { implementation: spanIn(implementation, n.file) }
288
- : {}),
289
- },
290
- ];
291
- });
292
- const edges = dump.edges.map((edge) => {
293
- const { evidence, ...rest } = edge;
294
- const from = moduleIds.get(edge.from);
295
- return {
296
- ...rest,
297
- ...(from !== undefined ? { from: fileNodeId(from) } : {}),
298
- ...(evidence !== undefined
299
- ? { evidence: spanIn(evidence, fileOfNodeId(edge.from)) }
300
- : {}),
301
- };
302
- });
303
- // Index workspace nodes by (file, within-file key) so ownership can resolve a
304
- // member to its declaring class/namespace.
305
- const byFileKey = new Map();
306
- for (const node of nodes) {
307
- if (!node.external)
308
- byFileKey.set(node.file + "\0" + keyOf(node), node);
309
- }
310
- const owner = (node) => {
311
- const parent = ownerKey(node);
312
- if (parent === undefined)
313
- return undefined;
314
- return byFileKey.get(node.file + "\0" + parent);
315
- };
316
- // Refine: a `variable` whose owner is a class or interface is a property.
317
- for (const node of nodes) {
318
- if (node.kind !== "variable" || node.external)
319
- continue;
320
- const parent = owner(node);
321
- if (parent && (parent.kind === "class" || parent.kind === "interface")) {
322
- node.kind = "property";
349
+ function index(values, keys, previous) {
350
+ const result = new Map();
351
+ const counts = new Map();
352
+ const append = (key, value) => {
353
+ const count = counts.get(key) ?? 0;
354
+ let bucket = result.get(key);
355
+ if (bucket === undefined) {
356
+ bucket = previous?.get(key) ?? [];
357
+ result.set(key, bucket);
323
358
  }
324
- }
325
- // One file container node per distinct workspace source file, plus every file
326
- // the dump saw an export surface on — a barrel declares nothing, so its only
327
- // trace in the dump is its module node, and it is exactly the file a consumer
328
- // imports the package from.
329
- const fileNodes = new Map();
330
- const addFileNode = (file) => {
331
- if (file === "" || fileNodes.has(file))
332
- return;
333
- fileNodes.set(file, {
334
- id: fileNodeId(file),
335
- kind: "file",
336
- name: basename(file),
337
- file,
338
- external: false,
339
- });
359
+ if (bucket === previous?.get(key)) {
360
+ if (bucket[count] !== value) {
361
+ bucket = [...bucket.slice(0, count), value];
362
+ result.set(key, bucket);
363
+ }
364
+ }
365
+ else
366
+ bucket.push(value);
367
+ counts.set(key, count + 1);
340
368
  };
341
- for (const node of nodes) {
342
- if (node.external || (0, TtscGraphArtifactNodeKind_1.isArtifactNodeKind)(node.kind))
343
- continue;
344
- addFileNode(node.file);
345
- }
346
- for (const file of moduleFiles)
347
- addFileNode(file);
348
- // Ownership: a member is contained by its owner; a top-level declaration by
349
- // its file. Exports are not synthesized here: the dump's `exports` edges come
350
- // from the checker's export table, which follows re-exports and barrels, so
351
- // they say which module puts a symbol on the wire. Deriving them from the
352
- // `exported` flag instead would say only that the declaring file made it
353
- // public, which is the fact that cannot tell a package's front door from its
354
- // legacy subpath.
355
- const structural = [];
356
- for (const node of nodes) {
357
- // An artifact is contained by the artifact its producer named, and by
358
- // nothing when that producer named none. It is never contained by a `file`
359
- // node: a document is already its own node, a Prisma address carries no
360
- // path on purpose, and an API operation has no file at all.
361
- if ((0, TtscGraphArtifactNodeKind_1.isArtifactNodeKind)(node.kind)) {
362
- if (node.parent !== undefined && node.parent !== "")
363
- structural.push({ from: node.parent, to: node.id, kind: "contains" });
364
- continue;
369
+ for (const value of values) {
370
+ const selected = keys(value);
371
+ if (typeof selected === "string")
372
+ append(selected, value);
373
+ else {
374
+ for (const key of selected)
375
+ append(key, value);
365
376
  }
366
- if (node.external || node.file === "")
367
- continue;
368
- const parent = owner(node);
369
- const container = parent ? parent.id : fileNodeId(node.file);
370
- structural.push({
371
- from: container,
372
- to: node.id,
373
- kind: "contains",
374
- });
375
377
  }
376
- return {
377
- nodes: [...nodes, ...fileNodes.values()],
378
- edges: [...edges, ...structural],
379
- };
378
+ for (const [key, bucket] of result) {
379
+ const count = counts.get(key);
380
+ if (bucket === previous?.get(key) && bucket.length !== count)
381
+ result.set(key, Object.freeze(bucket.slice(0, count)));
382
+ else if (bucket !== previous?.get(key))
383
+ Object.freeze(bucket);
384
+ }
385
+ return result;
380
386
  }
381
387
  //# sourceMappingURL=TtscGraphMemory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TtscGraphMemory.js","sourceRoot":"","sources":["../../src/model/TtscGraphMemory.ts"],"names":[],"mappings":";;;;;AAKA,uFAA6E;AAE7E,uDAAwD;AACxD,mEAAgE;AAEhE;;;;;;;;;;GAUG;AACH;IACmB,IAAI,CAA8B;IAClC,QAAQ,CAAgC;IACxC,OAAO,CAAgC;IACvC,WAAW,CAAgC;IAC3C,aAAa,CAAgC;IAC7C,cAAc,CAAgC;IAE/D,wDAAwD;IAC/C,OAAO,CAAS;IACzB,8EAA8E;IACrE,KAAK,CAA4B;IAC1C,oDAAoD;IAC3C,KAAK,CAA4B;IAC1C,4EAA4E;IACnE,MAAM,CAAwB;IAEvC,YACE,OAAe,EACf,KAAuB,EACvB,KAAuB,EACvB,UAAsC;QAEtC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,IAAI,6CAAqB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QAE7D,IAAI,CAAC,IAAI,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACjD,IAAI,CAAC,WAAW,GAAG,IAAI,GAAG,EAAE,CAAC;QAC7B,IAAI,CAAC,aAAa,GAAG,IAAI,GAAG,EAAE,CAAC;QAC/B,IAAI,CAAC,cAAc,GAAG,IAAI,GAAG,EAAE,CAAC;QAChC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,MAAM,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