@ttsc/graph 0.30.3 → 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
@@ -0,0 +1,390 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TtscGraphProjection = void 0;
4
+ const TtscGraphArtifactNodeKind_1 = require("../structures/TtscGraphArtifactNodeKind");
5
+ const TtscGraphNodeId_1 = require("./TtscGraphNodeId");
6
+ const copyGraphSnapshot_1 = require("./copyGraphSnapshot");
7
+ /**
8
+ * Immutable structural projection components for validated resident facts.
9
+ *
10
+ * Node refinement and containment depend on all declarations in the same file;
11
+ * export reanchoring depends on the source node's module declaration. Grouping
12
+ * both raw nodes and source-owned edges by that file captures these
13
+ * dependencies, including metadata/artifact nodes sharing it. Global metadata
14
+ * invalidates all components, and complete generation order is reconstructed
15
+ * independently.
16
+ *
17
+ * @evidence contracts/common.md#principled-implementation Frozen raw reference sequences prove unchanged component inputs; all same-file declarations and source edges participate, so lexical collisions, module folding and artifact parents cannot borrow stale derived facts.
18
+ * @evidence contracts/common.md#clear-and-simple-design Full synthesis remains one implementation used by cold construction and invalidated components; create owns dependency partitioning and immutable component reuse.
19
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The store still validates the complete generation first. No content witness, owner or raw edge is skipped to obtain reuse, and public DTOs are never frozen by borrowing.
20
+ * @evidence contracts/common.md#meaningful-documentation Native prose explains actual synthesis dependencies, metadata invalidation and generation ordering rather than claiming universally delta-only work.
21
+ * @evidence contracts/performance.md#efficient-algorithms Grouping and generation ordering scan all raw references. Only changed file components synthesize outer records and detach/freeze nested facts once; metadata changes rebuild all. Reference arrays/maps remain linear in generation size.
22
+ * @evidence contracts/performance.md#reuse-equivalent-work Equal frozen node/edge sequences and equal project/config/producer/capability/universe metadata retain the component. Cross-file edge changes invalidate their owning component; target absence remains a store validation error.
23
+ * @evidence contracts/performance.md#bound-retention-and-release-resources Returned state retains only current file components and generation arrays; deleted components are omitted and no previous State reference is stored.
24
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation In-memory fact coordinates and reference identity select reuse; no native filesystem or process operation runs here.
25
+ */
26
+ var TtscGraphProjection;
27
+ (function (TtscGraphProjection) {
28
+ /**
29
+ * Detach a caller's full dump before exposing synthesized immutable facts.
30
+ *
31
+ * Synthesis borrows nested facts synchronously and changes only new outer
32
+ * records. Final recursive copying detaches those facts before freezing or
33
+ * exposing the result, for mutable callers and frozen resident inputs alike.
34
+ *
35
+ * @evidence contracts/common.md#principled-implementation Readonly borrowed synthesis inputs preserve caller ownership; only fresh outer records change, and final recursive copying isolates every nested record before freezing and publication.
36
+ * @evidence contracts/common.md#clear-and-simple-design Cold models and invalidated components use the same synthesis implementation.
37
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Native export relations remain authoritative and no caller-owned DTO is frozen in place.
38
+ * @evidence contracts/common.md#meaningful-documentation Native prose states caller ownership, synchronous borrowing, construction-local changes and the final immutable publication boundary.
39
+ * @evidence contracts/performance.md#efficient-algorithms Synthesis scans facts and indexes owner handles; only colliding handles require candidate scans. One final recursive copy costs the selected fact population's nested bytes, without an intermediate mutable DTO copy.
40
+ * @evidenceExclude contracts/performance.md#reuse-equivalent-work This operation constructs a supplied population; create selects components requiring construction.
41
+ * @evidence contracts/performance.md#bound-retention-and-release-resources The returned frozen facts transfer to the model/component owner; no historical state is retained here.
42
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation In-memory synthesis and copying perform no native operations.
43
+ */
44
+ function full(dump) {
45
+ return (0, copyGraphSnapshot_1.copyGraphSnapshot)(synthesize(dump));
46
+ }
47
+ TtscGraphProjection.full = full;
48
+ /**
49
+ * Reuse only components with the same complete synthesis input sequence.
50
+ *
51
+ * The caller supplies store-owned frozen facts after complete validation.
52
+ * Same-file declarations determine lexical owners and module anchors; source
53
+ * edges belong to that same component. Output ordering remains
54
+ * generation-wide.
55
+ *
56
+ * @evidence contracts/common.md#principled-implementation Complete ordered raw inputs and global metadata qualify each component. Synthesis dependencies are local to a node's file, while cross-file edge target existence has already been validated by the store.
57
+ * @evidence contracts/common.md#clear-and-simple-design Partitioning, component selection and global output ordering are separate stages; full owns the shared synthesis implementation.
58
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Every raw node and source edge participates; no ownership, provenance or manifest validation is skipped and no native relation is invented.
59
+ * @evidence contracts/common.md#meaningful-documentation Native paragraphs explain the frozen-input premise and why same-file declarations and source edges form the dependency boundary.
60
+ * @evidence contracts/performance.md#efficient-algorithms Linear reference grouping/equality and generation ordering remain necessary. Invalidated components borrow nested inputs during synthesis and detach/freeze once at full's publication boundary, with temporary maps/arrays proportional to current facts.
61
+ * @evidence contracts/performance.md#reuse-equivalent-work Exact raw reference sequences plus project/config/schema/capability/producer/universe metadata retain equivalent components. Changed owner declarations or source relations invalidate the whole dependent file component.
62
+ * @evidence contracts/performance.md#bound-retention-and-release-resources New state retains only current components and output arrays; deleted components disappear and no previous state is linked.
63
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation Fact coordinates select in-memory groups; no filesystem or process operation interprets them.
64
+ */
65
+ function create(dump, previous) {
66
+ const metadata = JSON.stringify({
67
+ project: dump.project,
68
+ tsconfig: dump.tsconfig,
69
+ schemaVersion: dump.provenance.schemaVersion,
70
+ capabilities: dump.provenance.capabilities,
71
+ producer: dump.provenance.producer,
72
+ artifactProducer: dump.provenance.artifactProducer,
73
+ universe: dump.provenance.universe,
74
+ });
75
+ const inputs = new Map();
76
+ const files = new Map();
77
+ for (const node of dump.nodes) {
78
+ let input = inputs.get(node.file);
79
+ if (input === undefined) {
80
+ input = { nodes: [], edges: [] };
81
+ inputs.set(node.file, input);
82
+ }
83
+ input.nodes.push(node);
84
+ files.set(node.id, node.file);
85
+ }
86
+ for (const edge of dump.edges)
87
+ inputs.get(files.get(edge.from)).edges.push(edge);
88
+ const components = new Map();
89
+ for (const [file, input] of inputs) {
90
+ const old = metadata === previous?.metadata
91
+ ? previous.components.get(file)
92
+ : undefined;
93
+ if (old !== undefined &&
94
+ same(input.nodes, old.rawNodes) &&
95
+ same(input.edges, old.rawEdges)) {
96
+ components.set(file, old);
97
+ continue;
98
+ }
99
+ const projected = full(input);
100
+ const count = input.nodes.filter((node) => node.kind !== "module").length;
101
+ components.set(file, {
102
+ rawNodes: Object.freeze(input.nodes),
103
+ rawEdges: Object.freeze(input.edges),
104
+ nodes: new Map(projected.nodes.slice(0, count).map((node) => [node.id, node])),
105
+ file: projected.nodes[count],
106
+ edges: new Map(input.edges.map((edge, index) => [edge, projected.edges[index]])),
107
+ structural: new Map(projected.edges
108
+ .slice(input.edges.length)
109
+ .map((edge) => [edge.to, edge])),
110
+ });
111
+ }
112
+ const nodes = [];
113
+ const structural = [];
114
+ const containers = new Set();
115
+ for (const node of dump.nodes) {
116
+ if (node.kind === "module")
117
+ continue;
118
+ const component = components.get(node.file);
119
+ nodes.push(component.nodes.get(node.id));
120
+ const edge = component.structural.get(node.id);
121
+ if (edge !== undefined)
122
+ structural.push(edge);
123
+ if (!node.external && !(0, TtscGraphArtifactNodeKind_1.isArtifactNodeKind)(node.kind) && node.file !== "")
124
+ containers.add(node.file);
125
+ }
126
+ for (const node of dump.nodes)
127
+ if (node.kind === "module" && node.file !== "")
128
+ containers.add(node.file);
129
+ for (const file of containers)
130
+ nodes.push(components.get(file).file);
131
+ const edges = dump.edges.map((edge) => components.get(files.get(edge.from)).edges.get(edge));
132
+ for (const edge of structural)
133
+ edges.push(edge);
134
+ return Object.freeze({
135
+ metadata,
136
+ components,
137
+ nodes: Object.freeze(nodes),
138
+ edges: Object.freeze(edges),
139
+ });
140
+ }
141
+ TtscGraphProjection.create = create;
142
+ })(TtscGraphProjection || (exports.TtscGraphProjection = TtscGraphProjection = {}));
143
+ /** Reference order is part of synthesis and query result identity. */
144
+ function same(left, right) {
145
+ return (left.length === right.length &&
146
+ left.every((value, index) => value === right[index]));
147
+ }
148
+ /** Append to a construction-local bucket; published outputs are frozen later. */
149
+ function push(map, key, value) {
150
+ const bucket = map.get(key);
151
+ if (bucket)
152
+ bucket.push(value);
153
+ else
154
+ map.set(key, [value]);
155
+ }
156
+ /**
157
+ * The within-file identity of a node: its owner-qualified name when it has one
158
+ * (`Class.method`), else its simple name. Merged declarations can share this
159
+ * handle; declaration ranges disambiguate their member ownership.
160
+ */
161
+ function keyOf(node) {
162
+ return node.qualifiedName ?? node.name;
163
+ }
164
+ /**
165
+ * The owner key derived from facts the producer serialized separately.
166
+ *
167
+ * A quoted member named `"a.b"` has Name `a.b` and QualifiedName `Box.a.b`.
168
+ * Cutting the qualified name at its last dot invents owner `Box.a`; removing
169
+ * the exact `.${name}` suffix instead preserves the producer's real boundary.
170
+ * Object keys containing dots, brackets or no characters carry a JSON bracket
171
+ * suffix, keeping their identity distinct from nested object ownership.
172
+ */
173
+ function ownerKey(node) {
174
+ if (node.qualifiedName === undefined || node.qualifiedName === node.name)
175
+ return undefined;
176
+ const suffix = `.${node.name}`;
177
+ let owner;
178
+ if (node.qualifiedName.endsWith(suffix)) {
179
+ owner = node.qualifiedName.slice(0, -suffix.length);
180
+ }
181
+ else if (node.qualifiedName.endsWith('"]')) {
182
+ // The native producer brackets reserved/empty object keys using JSON. Find
183
+ // the opening string quote without treating an escaped quote inside the
184
+ // key as a boundary; JSON decoding accepts equivalent Unicode escapes.
185
+ const qualified = node.qualifiedName;
186
+ for (let index = qualified.length - 3; index > 0; index--) {
187
+ if (qualified[index] !== '"')
188
+ continue;
189
+ let escapes = 0;
190
+ for (let before = index - 1; before >= 0 && qualified[before] === "\\"; before--)
191
+ escapes++;
192
+ if (escapes % 2 !== 0)
193
+ continue;
194
+ if (qualified[index - 1] !== "[")
195
+ break;
196
+ try {
197
+ if (JSON.parse(qualified.slice(index, -1)) === node.name)
198
+ owner = qualified.slice(0, index - 1);
199
+ }
200
+ catch {
201
+ // A malformed qualified coordinate proves no owner.
202
+ }
203
+ break;
204
+ }
205
+ }
206
+ return owner === "" ? undefined : owner;
207
+ }
208
+ /** Prove lexical ownership using complete same-file declaration coordinates. */
209
+ function enclosesDeclaration(owner, member) {
210
+ const outer = owner.evidence;
211
+ const inner = member.evidence;
212
+ if (outer === undefined ||
213
+ inner === undefined ||
214
+ outer.file !== inner.file ||
215
+ outer.startCol === undefined ||
216
+ outer.endLine === undefined ||
217
+ outer.endCol === undefined ||
218
+ inner.startCol === undefined ||
219
+ inner.endLine === undefined ||
220
+ inner.endCol === undefined)
221
+ return false;
222
+ return ((outer.startLine < inner.startLine ||
223
+ (outer.startLine === inner.startLine &&
224
+ outer.startCol <= inner.startCol)) &&
225
+ (outer.endLine > inner.endLine ||
226
+ (outer.endLine === inner.endLine && outer.endCol >= inner.endCol)));
227
+ }
228
+ /** A file's id and node name from its dump path coordinate. */
229
+ function fileNodeId(file) {
230
+ return file;
231
+ }
232
+ /**
233
+ * A wire span with its file put back: the one the builder left out because the
234
+ * reader has it, or the one it kept because it could not be derived (an
235
+ * implementation in another file).
236
+ */
237
+ function spanIn(span, file) {
238
+ return { ...span, file: span.file ?? file };
239
+ }
240
+ /**
241
+ * The source file a node id names. An id is `path#Qualified.Name:kind`, and a
242
+ * file node's id is the path itself.
243
+ */
244
+ function fileOfNodeId(id) {
245
+ return (0, TtscGraphNodeId_1.ttscGraphNodeIdPath)(id) ?? id;
246
+ }
247
+ function basename(file) {
248
+ const slash = file.lastIndexOf("/");
249
+ return slash >= 0 ? file.slice(slash + 1) : file;
250
+ }
251
+ /**
252
+ * Derive the structural layer from a dump's faithful facts: refine class-member
253
+ * variables to properties, add a `file` node per workspace source, connect the
254
+ * `contains` ownership tree, and re-anchor compiler-owned `exports` edges.
255
+ */
256
+ function synthesize(dump) {
257
+ // A module node is the dump's name for a source file's export surface, and a
258
+ // file node is this layer's name for the same file. Fold the two: the module
259
+ // keeps its file present here even when the file declares nothing (a barrel),
260
+ // and its `exports` edges are re-anchored on the file id every other tool
261
+ // already traverses. What the module carried, the file now carries.
262
+ const moduleFiles = new Set(dump.nodes.filter((n) => n.kind === "module").map((n) => n.file));
263
+ const moduleIds = new Map(dump.nodes.filter((n) => n.kind === "module").map((n) => [n.id, n.file]));
264
+ // Create outer nodes so property refinement does not mutate the caller's dump, and
265
+ // put back the file the builder left out of every span: a node's span is in
266
+ // the node's file, an edge's span is in the file its `from` id names. The
267
+ // builder omits both because they are exactly reconstructible and they are not
268
+ // small — the two copies are 17% of the document, 55 MB of VS Code's 323 MB,
269
+ // paid again in the encode, the pipe, the parse and the validation. Nothing
270
+ // downstream of this line sees a span without its file.
271
+ const nodes = dump.nodes.flatMap((n) => {
272
+ if (n.kind === "module")
273
+ return [];
274
+ const { evidence, implementation, ...rest } = n;
275
+ return [
276
+ {
277
+ ...rest,
278
+ kind: n.kind,
279
+ ...(evidence !== undefined
280
+ ? { evidence: spanIn(evidence, n.file) }
281
+ : {}),
282
+ ...(implementation !== undefined
283
+ ? { implementation: spanIn(implementation, n.file) }
284
+ : {}),
285
+ },
286
+ ];
287
+ });
288
+ const edges = dump.edges.map((edge) => {
289
+ const { evidence, ...rest } = edge;
290
+ const from = moduleIds.get(edge.from);
291
+ return {
292
+ ...rest,
293
+ ...(from !== undefined ? { from: fileNodeId(from) } : {}),
294
+ ...(evidence !== undefined
295
+ ? { evidence: spanIn(evidence, fileOfNodeId(edge.from)) }
296
+ : {}),
297
+ };
298
+ });
299
+ // Index workspace nodes by (file, within-file key) so ownership can resolve a
300
+ // member to its declaring class/namespace.
301
+ const byFileKey = new Map();
302
+ for (const node of nodes) {
303
+ if (!node.external)
304
+ push(byFileKey, node.file + "\0" + keyOf(node), node);
305
+ }
306
+ const owners = new Map();
307
+ const owner = (node) => {
308
+ if (owners.has(node))
309
+ return owners.get(node);
310
+ const parent = ownerKey(node);
311
+ const candidates = parent === undefined
312
+ ? undefined
313
+ : byFileKey.get(node.file + "\0" + parent);
314
+ // A unique checker handle also owns merged namespace members outside its
315
+ // primary declaration span. Only a colliding handle needs lexical evidence.
316
+ // Ambiguous or incomplete ranges prove no declaration owner; retain file
317
+ // containment rather than assigning an arbitrary merged declaration.
318
+ const enclosing = candidates?.length === 1
319
+ ? candidates
320
+ : candidates?.filter((candidate) => enclosesDeclaration(candidate, node));
321
+ const selected = enclosing?.length === 1 ? enclosing[0] : undefined;
322
+ owners.set(node, selected);
323
+ return selected;
324
+ };
325
+ // Refine: a `variable` whose owner is a class or interface is a property.
326
+ for (const node of nodes) {
327
+ if (node.kind !== "variable" || node.external)
328
+ continue;
329
+ const parent = owner(node);
330
+ if (parent && (parent.kind === "class" || parent.kind === "interface")) {
331
+ node.kind = "property";
332
+ }
333
+ }
334
+ // One file container node per distinct workspace source file, plus every file
335
+ // the dump saw an export surface on — a barrel declares nothing, so its only
336
+ // trace in the dump is its module node, and it is exactly the file a consumer
337
+ // imports the package from.
338
+ const fileNodes = new Map();
339
+ const addFileNode = (file) => {
340
+ if (file === "" || fileNodes.has(file))
341
+ return;
342
+ fileNodes.set(file, {
343
+ id: fileNodeId(file),
344
+ kind: "file",
345
+ name: basename(file),
346
+ file,
347
+ external: false,
348
+ });
349
+ };
350
+ for (const node of nodes) {
351
+ if (node.external || (0, TtscGraphArtifactNodeKind_1.isArtifactNodeKind)(node.kind))
352
+ continue;
353
+ addFileNode(node.file);
354
+ }
355
+ for (const file of moduleFiles)
356
+ addFileNode(file);
357
+ // Ownership: a member is contained by its owner; a top-level declaration by
358
+ // its file. Exports are not synthesized here: the dump's `exports` edges come
359
+ // from the checker's export table, which follows re-exports and barrels, so
360
+ // they say which module puts a symbol on the wire. Deriving them from the
361
+ // `exported` flag instead would say only that the declaring file made it
362
+ // public, which is the fact that cannot tell a package's front door from its
363
+ // legacy subpath.
364
+ const structural = [];
365
+ for (const node of nodes) {
366
+ // An artifact is contained by the artifact its producer named, and by
367
+ // nothing when that producer named none. It is never contained by a `file`
368
+ // node: a document is already its own node, a Prisma address carries no
369
+ // path on purpose, and an API operation has no file at all.
370
+ if ((0, TtscGraphArtifactNodeKind_1.isArtifactNodeKind)(node.kind)) {
371
+ if (node.parent !== undefined && node.parent !== "")
372
+ structural.push({ from: node.parent, to: node.id, kind: "contains" });
373
+ continue;
374
+ }
375
+ if (node.external || node.file === "")
376
+ continue;
377
+ const parent = owner(node);
378
+ const container = parent ? parent.id : fileNodeId(node.file);
379
+ structural.push({
380
+ from: container,
381
+ to: node.id,
382
+ kind: "contains",
383
+ });
384
+ }
385
+ return {
386
+ nodes: [...nodes, ...fileNodes.values()],
387
+ edges: [...edges, ...structural],
388
+ };
389
+ }
390
+ //# sourceMappingURL=TtscGraphProjection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TtscGraphProjection.js","sourceRoot":"","sources":["../../src/model/TtscGraphProjection.ts"],"names":[],"mappings":";;;AAKA,uFAA6E;AAC7E,uDAAwD;AAExD,2DAAwD;AAExD;;;;;;;;;;;;;;;;;;GAkBG;AACH,IAAiB,mBAAmB,CAuJnC;AAvJD,WAAiB,mBAAmB;IA2BlC;;;;;;;;;;;;;;;OAeG;IACH,SAAgB,IAAI,CAClB,IAAgE;QAEhE,OAAO,IAAA,qCAAiB,EAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7C,CAAC;IAJe,oBAAA,IAAI,OAInB,CAAA;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,SAAgB,MAAM,CACpB,IAAuC,EACvC,QAAgB;QAEhB,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC;YAC9B,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC,aAAa;YAC5C,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,YAAY;YAC1C,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ;YAClC,gBAAgB,EAAE,IAAI,CAAC,UAAU,CAAC,gBAAgB;YAClD,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ;SACnC,CAAC,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkD,CAAC;QACzE,MAAM,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;QACxC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAC9B,IAAI,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAClC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBACxB,KAAK,GAAG,EAAE,KAAK,EAA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,CAAC,CAAC;YACxE,SAAS;QACX,CAAC;QACD,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,KAAK,EAAE;YAAE,SAAS;QAChD,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;QAC3B,MAAM,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7D,UAAU,CAAC,IAAI,CAAC;YACd,IAAI,EAAE,SAAS;YACf,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,IAAI,EAAE,UAAU;SACjB,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,KAAK,EAAE,CAAC,GAAG,KAAK,EAAE,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC;QACxC,KAAK,EAAE,CAAC,GAAG,KAAK,EAAE,GAAG,UAAU,CAAC;KACjC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { ITtscGraphSnapshot } from "../structures/ITtscGraphSnapshot";
2
+ /**
3
+ * Decode the graph serve envelope before any state or body facts are consumed.
4
+ *
5
+ * @evidence contracts/common.md#principled-implementation JSON framing, protocol agreement and generated complete-envelope validation precede typed state admission.
6
+ * @evidence contracts/common.md#clear-and-simple-design The decoder owns the wire contract; state owns correlation and generation semantics after this boundary.
7
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The installed typia transform validates the declared envelope rather than a partial cast or handwritten schema replacement.
8
+ * @evidence contracts/common.md#meaningful-documentation Native comments explain why protocol agreement must precede shape validation and why routing fields belong in the envelope.
9
+ * @evidenceExclude contracts/performance.md#efficient-algorithms decode owns JSON and generated envelope validation; the namespace adds no processing algorithm.
10
+ * @evidenceExclude contracts/performance.md#reuse-equivalent-work decode validates each submitted line, while state establishes reuse of graph generations.
11
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The namespace retains no decoded frame or native handle; its caller owns typed results.
12
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation a JSON line decoder; it reads no file, path or process.
13
+ */
14
+ export declare namespace TtscGraphProtocol {
15
+ /**
16
+ * Decode one line or throw the owned framing/version/schema diagnostic.
17
+ *
18
+ * @evidence contracts/common.md#principled-implementation JSON parsing precedes protocol agreement and generated complete-envelope validation, so no field is routed before its declared wire contract holds.
19
+ * @evidence contracts/common.md#clear-and-simple-design This single decoder supplies typed inputs to state; state owns pending correlation, schema body agreement and generation semantics.
20
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Installed typia validates the whole declared envelope rather than a handwritten partial guard or a fabricated trusted frame.
21
+ * @evidence contracts/common.md#meaningful-documentation The headline states owned failure behavior; private comments explain version-before-shape and routing-field validation.
22
+ * @evidence contracts/performance.md#efficient-algorithms JSON parsing and generated field traversal process the line and carried graph facts linearly; no project, directory or historical-frame scan occurs.
23
+ * @evidenceExclude contracts/performance.md#reuse-equivalent-work Each submitted wire line requires validation; graph state alone coordinates current-model reuse.
24
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources Parsed values and error text are local; the typed result transfers to state and no native reader, child or frame history is retained.
25
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation parses one line of JSON text and validates it; no file, path or process.
26
+ */
27
+ function decode(line: string): ITtscGraphSnapshot;
28
+ }