gitnexus 1.6.6-rc.98 → 1.6.6

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 (541) hide show
  1. package/README.md +122 -68
  2. package/dist/_shared/graph/types.d.ts +17 -1
  3. package/dist/_shared/graph/types.d.ts.map +1 -1
  4. package/dist/_shared/index.d.ts +3 -5
  5. package/dist/_shared/index.d.ts.map +1 -1
  6. package/dist/_shared/index.js +2 -4
  7. package/dist/_shared/index.js.map +1 -1
  8. package/dist/_shared/scope-resolution/module-scope-index.d.ts +1 -2
  9. package/dist/_shared/scope-resolution/module-scope-index.d.ts.map +1 -1
  10. package/dist/_shared/scope-resolution/module-scope-index.js +1 -2
  11. package/dist/_shared/scope-resolution/module-scope-index.js.map +1 -1
  12. package/dist/_shared/scope-resolution/parsed-file.d.ts +24 -0
  13. package/dist/_shared/scope-resolution/parsed-file.d.ts.map +1 -1
  14. package/dist/_shared/scope-resolution/reference-site.d.ts +13 -1
  15. package/dist/_shared/scope-resolution/reference-site.d.ts.map +1 -1
  16. package/dist/_shared/scope-resolution/registries/context.d.ts +1 -0
  17. package/dist/_shared/scope-resolution/registries/context.d.ts.map +1 -1
  18. package/dist/_shared/scope-resolution/registries/context.js +6 -0
  19. package/dist/_shared/scope-resolution/registries/context.js.map +1 -1
  20. package/dist/_shared/scope-resolution/registries/evidence.d.ts +2 -3
  21. package/dist/_shared/scope-resolution/registries/evidence.d.ts.map +1 -1
  22. package/dist/_shared/scope-resolution/registries/evidence.js +2 -3
  23. package/dist/_shared/scope-resolution/registries/evidence.js.map +1 -1
  24. package/dist/_shared/scope-resolution/registries/macro-registry.d.ts +29 -0
  25. package/dist/_shared/scope-resolution/registries/macro-registry.d.ts.map +1 -0
  26. package/dist/_shared/scope-resolution/registries/macro-registry.js +32 -0
  27. package/dist/_shared/scope-resolution/registries/macro-registry.js.map +1 -0
  28. package/dist/_shared/scope-resolution/symbol-definition.d.ts +9 -0
  29. package/dist/_shared/scope-resolution/symbol-definition.d.ts.map +1 -1
  30. package/dist/_shared/scope-resolution/types.d.ts +1 -1
  31. package/dist/_shared/scope-resolution/types.d.ts.map +1 -1
  32. package/dist/cli/ai-context.d.ts +35 -1
  33. package/dist/cli/ai-context.js +111 -12
  34. package/dist/cli/analyze-config.d.ts +92 -0
  35. package/dist/cli/analyze-config.js +364 -0
  36. package/dist/cli/analyze.d.ts +17 -1
  37. package/dist/cli/analyze.js +224 -71
  38. package/dist/cli/cli-message.d.ts +1 -1
  39. package/dist/cli/doctor.d.ts +18 -0
  40. package/dist/cli/doctor.js +32 -0
  41. package/dist/cli/i18n/en.d.ts +2 -2
  42. package/dist/cli/i18n/en.js +2 -2
  43. package/dist/cli/i18n/resources.d.ts +2 -2
  44. package/dist/cli/i18n/zh-CN.js +2 -2
  45. package/dist/cli/index.js +4 -2
  46. package/dist/cli/resolve-invocation.d.ts +21 -0
  47. package/dist/cli/resolve-invocation.js +68 -0
  48. package/dist/cli/setup.d.ts +33 -0
  49. package/dist/cli/setup.js +96 -35
  50. package/dist/cli/skill-gen.js +2 -2
  51. package/dist/cli/wiki.js +20 -4
  52. package/dist/core/embeddings/embedder.d.ts +1 -1
  53. package/dist/core/embeddings/embedder.js +14 -1
  54. package/dist/core/embeddings/runtime-support.d.ts +41 -0
  55. package/dist/core/embeddings/runtime-support.js +65 -0
  56. package/dist/core/group/extractors/grpc-patterns/proto.js +2 -1
  57. package/dist/core/group/extractors/http-patterns/java.js +15 -1
  58. package/dist/core/ingestion/call-processor.d.ts +57 -227
  59. package/dist/core/ingestion/call-processor.js +172 -2595
  60. package/dist/core/ingestion/call-routing.d.ts +6 -5
  61. package/dist/core/ingestion/call-routing.js +6 -6
  62. package/dist/core/ingestion/call-types.d.ts +0 -75
  63. package/dist/core/ingestion/class-extractors/configs/c-cpp.js +26 -1
  64. package/dist/core/ingestion/class-extractors/configs/ruby.js +3 -0
  65. package/dist/core/ingestion/class-extractors/generic.js +9 -11
  66. package/dist/core/ingestion/class-types.d.ts +23 -0
  67. package/dist/core/ingestion/cobol/cobol-preprocessor.d.ts +11 -0
  68. package/dist/core/ingestion/cobol/cobol-preprocessor.js +227 -73
  69. package/dist/core/ingestion/cobol-processor.d.ts +1 -0
  70. package/dist/core/ingestion/cobol-processor.js +51 -2
  71. package/dist/core/ingestion/emit-references.js +8 -2
  72. package/dist/core/ingestion/export-detection.d.ts +2 -1
  73. package/dist/core/ingestion/export-detection.js +2 -6
  74. package/dist/core/ingestion/field-extractors/configs/dart.d.ts +0 -6
  75. package/dist/core/ingestion/field-extractors/configs/dart.js +62 -44
  76. package/dist/core/ingestion/field-extractors/configs/go.d.ts +0 -9
  77. package/dist/core/ingestion/field-extractors/configs/go.js +40 -1
  78. package/dist/core/ingestion/field-extractors/configs/jvm.js +43 -4
  79. package/dist/core/ingestion/field-extractors/configs/php.js +1 -2
  80. package/dist/core/ingestion/field-extractors/configs/swift.d.ts +12 -1
  81. package/dist/core/ingestion/field-extractors/configs/swift.js +31 -6
  82. package/dist/core/ingestion/field-extractors/generic.d.ts +6 -0
  83. package/dist/core/ingestion/field-extractors/generic.js +5 -4
  84. package/dist/core/ingestion/field-extractors/typescript.js +0 -29
  85. package/dist/core/ingestion/filesystem-walker.d.ts +0 -9
  86. package/dist/core/ingestion/filesystem-walker.js +0 -11
  87. package/dist/core/ingestion/finalize-orchestrator.js +14 -2
  88. package/dist/core/ingestion/import-resolvers/configs/swift.d.ts +21 -0
  89. package/dist/core/ingestion/import-resolvers/configs/swift.js +72 -11
  90. package/dist/core/ingestion/import-resolvers/python.d.ts +1 -1
  91. package/dist/core/ingestion/import-resolvers/standard.d.ts +2 -2
  92. package/dist/core/ingestion/import-resolvers/standard.js +6 -5
  93. package/dist/core/ingestion/import-resolvers/utils.d.ts +2 -5
  94. package/dist/core/ingestion/import-resolvers/utils.js +1 -9
  95. package/dist/core/ingestion/language-provider.d.ts +39 -119
  96. package/dist/core/ingestion/language-provider.js +0 -2
  97. package/dist/core/ingestion/languages/c/capture-side-channel.d.ts +62 -0
  98. package/dist/core/ingestion/languages/c/capture-side-channel.js +65 -0
  99. package/dist/core/ingestion/languages/c/captures.js +41 -23
  100. package/dist/core/ingestion/languages/c/import-decomposer.d.ts +9 -0
  101. package/dist/core/ingestion/languages/c/import-decomposer.js +15 -0
  102. package/dist/core/ingestion/languages/c/import-target.js +52 -9
  103. package/dist/core/ingestion/languages/c/index.d.ts +2 -1
  104. package/dist/core/ingestion/languages/c/index.js +2 -1
  105. package/dist/core/ingestion/languages/c/query.js +15 -0
  106. package/dist/core/ingestion/languages/c/scope-resolver.js +47 -4
  107. package/dist/core/ingestion/languages/c/static-linkage.d.ts +8 -0
  108. package/dist/core/ingestion/languages/c/static-linkage.js +46 -1
  109. package/dist/core/ingestion/languages/c-cpp.js +16 -7
  110. package/dist/core/ingestion/languages/cobol/captures.js +25 -2
  111. package/dist/core/ingestion/languages/cpp/adl.d.ts +88 -4
  112. package/dist/core/ingestion/languages/cpp/adl.js +380 -160
  113. package/dist/core/ingestion/languages/cpp/arity-metadata.js +2 -8
  114. package/dist/core/ingestion/languages/cpp/capture-side-channel.d.ts +65 -0
  115. package/dist/core/ingestion/languages/cpp/capture-side-channel.js +78 -0
  116. package/dist/core/ingestion/languages/cpp/captures.js +162 -54
  117. package/dist/core/ingestion/languages/cpp/file-local-linkage.d.ts +18 -52
  118. package/dist/core/ingestion/languages/cpp/file-local-linkage.js +49 -1
  119. package/dist/core/ingestion/languages/cpp/import-decomposer.d.ts +7 -0
  120. package/dist/core/ingestion/languages/cpp/import-decomposer.js +12 -0
  121. package/dist/core/ingestion/languages/cpp/index.d.ts +1 -0
  122. package/dist/core/ingestion/languages/cpp/index.js +1 -0
  123. package/dist/core/ingestion/languages/cpp/inline-namespaces.d.ts +8 -0
  124. package/dist/core/ingestion/languages/cpp/inline-namespaces.js +21 -0
  125. package/dist/core/ingestion/languages/cpp/query.js +21 -0
  126. package/dist/core/ingestion/languages/cpp/range-bindings.js +20 -5
  127. package/dist/core/ingestion/languages/cpp/scope-resolver.js +52 -5
  128. package/dist/core/ingestion/languages/cpp/two-phase-lookup.d.ts +20 -0
  129. package/dist/core/ingestion/languages/cpp/two-phase-lookup.js +83 -3
  130. package/dist/core/ingestion/languages/csharp/captures.js +205 -41
  131. package/dist/core/ingestion/languages/csharp/index.d.ts +3 -4
  132. package/dist/core/ingestion/languages/csharp/index.js +3 -4
  133. package/dist/core/ingestion/languages/csharp/interpret.js +17 -3
  134. package/dist/core/ingestion/languages/csharp/namespace-siblings.d.ts +17 -7
  135. package/dist/core/ingestion/languages/csharp/namespace-siblings.js +129 -124
  136. package/dist/core/ingestion/languages/csharp/qualified-type-names.d.ts +14 -0
  137. package/dist/core/ingestion/languages/csharp/qualified-type-names.js +59 -0
  138. package/dist/core/ingestion/languages/csharp/query.js +13 -0
  139. package/dist/core/ingestion/languages/csharp/receiver-binding.js +10 -6
  140. package/dist/core/ingestion/languages/csharp/scope-resolver.js +8 -1
  141. package/dist/core/ingestion/languages/csharp.js +0 -5
  142. package/dist/core/ingestion/languages/dart/arity-metadata.d.ts +25 -0
  143. package/dist/core/ingestion/languages/dart/arity-metadata.js +35 -0
  144. package/dist/core/ingestion/languages/dart/arity.d.ts +19 -0
  145. package/dist/core/ingestion/languages/dart/arity.js +31 -0
  146. package/dist/core/ingestion/languages/dart/built-ins.d.ts +11 -0
  147. package/dist/core/ingestion/languages/dart/built-ins.js +34 -0
  148. package/dist/core/ingestion/languages/dart/cache-stats.d.ts +13 -0
  149. package/dist/core/ingestion/languages/dart/cache-stats.js +24 -0
  150. package/dist/core/ingestion/languages/dart/captures.d.ts +29 -0
  151. package/dist/core/ingestion/languages/dart/captures.js +445 -0
  152. package/dist/core/ingestion/languages/dart/expand-wildcards.d.ts +13 -0
  153. package/dist/core/ingestion/languages/dart/expand-wildcards.js +31 -0
  154. package/dist/core/ingestion/languages/dart/import-target.d.ts +15 -0
  155. package/dist/core/ingestion/languages/dart/import-target.js +65 -0
  156. package/dist/core/ingestion/languages/dart/index.d.ts +28 -0
  157. package/dist/core/ingestion/languages/dart/index.js +28 -0
  158. package/dist/core/ingestion/languages/dart/interpret.d.ts +24 -0
  159. package/dist/core/ingestion/languages/dart/interpret.js +95 -0
  160. package/dist/core/ingestion/languages/dart/merge-bindings.d.ts +10 -0
  161. package/dist/core/ingestion/languages/dart/merge-bindings.js +39 -0
  162. package/dist/core/ingestion/languages/dart/query.d.ts +26 -0
  163. package/dist/core/ingestion/languages/dart/query.js +142 -0
  164. package/dist/core/ingestion/languages/dart/receiver-binding.d.ts +24 -0
  165. package/dist/core/ingestion/languages/dart/receiver-binding.js +87 -0
  166. package/dist/core/ingestion/languages/dart/scope-resolver.d.ts +29 -0
  167. package/dist/core/ingestion/languages/dart/scope-resolver.js +194 -0
  168. package/dist/core/ingestion/languages/dart/signature-bindings.d.ts +23 -0
  169. package/dist/core/ingestion/languages/dart/signature-bindings.js +51 -0
  170. package/dist/core/ingestion/languages/dart/simple-hooks.d.ts +20 -0
  171. package/dist/core/ingestion/languages/dart/simple-hooks.js +47 -0
  172. package/dist/core/ingestion/languages/dart.d.ts +0 -1
  173. package/dist/core/ingestion/languages/dart.js +15 -29
  174. package/dist/core/ingestion/languages/go/arity-metadata.d.ts +1 -0
  175. package/dist/core/ingestion/languages/go/arity-metadata.js +31 -1
  176. package/dist/core/ingestion/languages/go/captures.js +247 -26
  177. package/dist/core/ingestion/languages/go/interface-impls.js +476 -50
  178. package/dist/core/ingestion/languages/go/interpret.js +21 -11
  179. package/dist/core/ingestion/languages/go/method-owners.js +20 -8
  180. package/dist/core/ingestion/languages/go/query.js +15 -7
  181. package/dist/core/ingestion/languages/go/range-binding.js +24 -9
  182. package/dist/core/ingestion/languages/go/receiver-binding.js +1 -1
  183. package/dist/core/ingestion/languages/go/scope-resolver.js +2 -2
  184. package/dist/core/ingestion/languages/go/simple-hooks.js +10 -5
  185. package/dist/core/ingestion/languages/go/type-binding.d.ts +1 -0
  186. package/dist/core/ingestion/languages/go/type-binding.js +40 -2
  187. package/dist/core/ingestion/languages/go.d.ts +0 -1
  188. package/dist/core/ingestion/languages/go.js +0 -5
  189. package/dist/core/ingestion/languages/index.d.ts +0 -5
  190. package/dist/core/ingestion/languages/index.js +0 -3
  191. package/dist/core/ingestion/languages/java/captures.js +252 -23
  192. package/dist/core/ingestion/languages/java/interpret.js +12 -6
  193. package/dist/core/ingestion/languages/java/package-siblings.js +18 -5
  194. package/dist/core/ingestion/languages/java/query.js +16 -1
  195. package/dist/core/ingestion/languages/java/scope-resolver.d.ts +2 -8
  196. package/dist/core/ingestion/languages/java/scope-resolver.js +2 -8
  197. package/dist/core/ingestion/languages/java.js +0 -5
  198. package/dist/core/ingestion/languages/javascript/captures.js +185 -11
  199. package/dist/core/ingestion/languages/javascript/query.js +107 -1
  200. package/dist/core/ingestion/languages/kotlin/capture-side-channel.d.ts +57 -0
  201. package/dist/core/ingestion/languages/kotlin/capture-side-channel.js +60 -0
  202. package/dist/core/ingestion/languages/kotlin/captures.js +213 -22
  203. package/dist/core/ingestion/languages/kotlin/companion-scopes.d.ts +7 -0
  204. package/dist/core/ingestion/languages/kotlin/companion-scopes.js +10 -0
  205. package/dist/core/ingestion/languages/kotlin/index.d.ts +1 -0
  206. package/dist/core/ingestion/languages/kotlin/index.js +1 -0
  207. package/dist/core/ingestion/languages/kotlin/query.js +30 -0
  208. package/dist/core/ingestion/languages/kotlin/scope-resolver.d.ts +5 -7
  209. package/dist/core/ingestion/languages/kotlin/scope-resolver.js +22 -7
  210. package/dist/core/ingestion/languages/kotlin.js +8 -5
  211. package/dist/core/ingestion/languages/php/captures.js +135 -19
  212. package/dist/core/ingestion/languages/php/import-decomposer.js +21 -63
  213. package/dist/core/ingestion/languages/php/index.d.ts +3 -4
  214. package/dist/core/ingestion/languages/php/index.js +3 -4
  215. package/dist/core/ingestion/languages/php/query.js +5 -0
  216. package/dist/core/ingestion/languages/php/receiver-binding.js +8 -4
  217. package/dist/core/ingestion/languages/php.js +0 -4
  218. package/dist/core/ingestion/languages/python/captures.js +128 -13
  219. package/dist/core/ingestion/languages/python/depends-references.js +1 -1
  220. package/dist/core/ingestion/languages/python/import-target.d.ts +4 -5
  221. package/dist/core/ingestion/languages/python/import-target.js +108 -16
  222. package/dist/core/ingestion/languages/python/index-stats.d.ts +18 -0
  223. package/dist/core/ingestion/languages/python/index-stats.js +25 -0
  224. package/dist/core/ingestion/languages/python/index.d.ts +3 -4
  225. package/dist/core/ingestion/languages/python/index.js +3 -4
  226. package/dist/core/ingestion/languages/python/query.js +17 -0
  227. package/dist/core/ingestion/languages/python/scope-resolver.js +7 -6
  228. package/dist/core/ingestion/languages/python.d.ts +0 -2
  229. package/dist/core/ingestion/languages/python.js +0 -7
  230. package/dist/core/ingestion/languages/ruby/captures.js +174 -31
  231. package/dist/core/ingestion/languages/ruby/import-target.js +2 -1
  232. package/dist/core/ingestion/languages/ruby/interpret.js +2 -1
  233. package/dist/core/ingestion/languages/ruby/query.js +10 -0
  234. package/dist/core/ingestion/languages/ruby/scope-resolver.js +61 -11
  235. package/dist/core/ingestion/languages/ruby.js +4 -53
  236. package/dist/core/ingestion/languages/rust/captures.js +95 -13
  237. package/dist/core/ingestion/languages/rust/query.js +64 -1
  238. package/dist/core/ingestion/languages/rust/range-binding.js +40 -12
  239. package/dist/core/ingestion/languages/rust/receiver-binding.js +9 -0
  240. package/dist/core/ingestion/languages/rust/scope-resolver.js +75 -1
  241. package/dist/core/ingestion/languages/rust.d.ts +0 -2
  242. package/dist/core/ingestion/languages/rust.js +0 -6
  243. package/dist/core/ingestion/languages/swift/arity-metadata.d.ts +24 -0
  244. package/dist/core/ingestion/languages/swift/arity-metadata.js +41 -0
  245. package/dist/core/ingestion/languages/swift/arity.d.ts +29 -0
  246. package/dist/core/ingestion/languages/swift/arity.js +42 -0
  247. package/dist/core/ingestion/languages/swift/base-type.d.ts +20 -0
  248. package/dist/core/ingestion/languages/swift/base-type.js +27 -0
  249. package/dist/core/ingestion/languages/swift/cache-stats.d.ts +15 -0
  250. package/dist/core/ingestion/languages/swift/cache-stats.js +26 -0
  251. package/dist/core/ingestion/languages/swift/captures.d.ts +35 -0
  252. package/dist/core/ingestion/languages/swift/captures.js +495 -0
  253. package/dist/core/ingestion/languages/swift/implicit-imports.d.ts +34 -0
  254. package/dist/core/ingestion/languages/swift/implicit-imports.js +57 -0
  255. package/dist/core/ingestion/languages/swift/import-decomposer.d.ts +24 -0
  256. package/dist/core/ingestion/languages/swift/import-decomposer.js +84 -0
  257. package/dist/core/ingestion/languages/swift/import-target.d.ts +33 -0
  258. package/dist/core/ingestion/languages/swift/import-target.js +81 -0
  259. package/dist/core/ingestion/languages/swift/index.d.ts +37 -0
  260. package/dist/core/ingestion/languages/swift/index.js +37 -0
  261. package/dist/core/ingestion/languages/swift/interpret.d.ts +15 -0
  262. package/dist/core/ingestion/languages/swift/interpret.js +89 -0
  263. package/dist/core/ingestion/languages/swift/merge-bindings.d.ts +20 -0
  264. package/dist/core/ingestion/languages/swift/merge-bindings.js +48 -0
  265. package/dist/core/ingestion/languages/swift/query.d.ts +46 -0
  266. package/dist/core/ingestion/languages/swift/query.js +194 -0
  267. package/dist/core/ingestion/languages/swift/receiver-binding.d.ts +40 -0
  268. package/dist/core/ingestion/languages/swift/receiver-binding.js +161 -0
  269. package/dist/core/ingestion/languages/swift/scope-resolver.d.ts +50 -0
  270. package/dist/core/ingestion/languages/swift/scope-resolver.js +189 -0
  271. package/dist/core/ingestion/languages/swift/sibling-type-bindings.d.ts +34 -0
  272. package/dist/core/ingestion/languages/swift/sibling-type-bindings.js +65 -0
  273. package/dist/core/ingestion/languages/swift/signature-bindings.d.ts +25 -0
  274. package/dist/core/ingestion/languages/swift/signature-bindings.js +66 -0
  275. package/dist/core/ingestion/languages/swift/simple-hooks.d.ts +37 -0
  276. package/dist/core/ingestion/languages/swift/simple-hooks.js +60 -0
  277. package/dist/core/ingestion/languages/swift/target-grouping.d.ts +51 -0
  278. package/dist/core/ingestion/languages/swift/target-grouping.js +93 -0
  279. package/dist/core/ingestion/languages/swift/target-siblings.d.ts +30 -0
  280. package/dist/core/ingestion/languages/swift/target-siblings.js +71 -0
  281. package/dist/core/ingestion/languages/swift.d.ts +0 -5
  282. package/dist/core/ingestion/languages/swift.js +11 -87
  283. package/dist/core/ingestion/languages/typescript/array-callback.d.ts +3 -29
  284. package/dist/core/ingestion/languages/typescript/array-callback.js +4 -43
  285. package/dist/core/ingestion/languages/typescript/captures.js +147 -17
  286. package/dist/core/ingestion/languages/typescript/index.d.ts +3 -4
  287. package/dist/core/ingestion/languages/typescript/index.js +3 -4
  288. package/dist/core/ingestion/languages/typescript/query.d.ts +2 -3
  289. package/dist/core/ingestion/languages/typescript/query.js +125 -4
  290. package/dist/core/ingestion/languages/typescript/receiver-binding.js +0 -1
  291. package/dist/core/ingestion/languages/typescript.d.ts +2 -3
  292. package/dist/core/ingestion/languages/typescript.js +46 -23
  293. package/dist/core/ingestion/languages/vue/captures.d.ts +46 -0
  294. package/dist/core/ingestion/languages/vue/captures.js +67 -0
  295. package/dist/core/ingestion/languages/vue/import-target.d.ts +27 -0
  296. package/dist/core/ingestion/languages/vue/import-target.js +58 -0
  297. package/dist/core/ingestion/languages/vue/index.d.ts +49 -0
  298. package/dist/core/ingestion/languages/vue/index.js +49 -0
  299. package/dist/core/ingestion/languages/vue/scope-resolver.d.ts +55 -0
  300. package/dist/core/ingestion/languages/vue/scope-resolver.js +292 -0
  301. package/dist/core/ingestion/languages/vue.js +12 -4
  302. package/dist/core/ingestion/local-symbol-pruner.d.ts +11 -0
  303. package/dist/core/ingestion/local-symbol-pruner.js +63 -0
  304. package/dist/core/ingestion/method-extractors/configs/dart.js +14 -1
  305. package/dist/core/ingestion/method-extractors/configs/jvm.js +37 -20
  306. package/dist/core/ingestion/method-extractors/configs/php.js +0 -1
  307. package/dist/core/ingestion/method-extractors/configs/swift.js +11 -4
  308. package/dist/core/ingestion/method-types.d.ts +2 -2
  309. package/dist/core/ingestion/model/index.d.ts +0 -3
  310. package/dist/core/ingestion/model/index.js +0 -8
  311. package/dist/core/ingestion/model/resolve.d.ts +7 -43
  312. package/dist/core/ingestion/model/resolve.js +7 -226
  313. package/dist/core/ingestion/model/scope-resolution-indexes.d.ts +46 -1
  314. package/dist/core/ingestion/model/semantic-model.d.ts +4 -6
  315. package/dist/core/ingestion/model/semantic-model.js +1 -1
  316. package/dist/core/ingestion/model/symbol-table.d.ts +3 -4
  317. package/dist/core/ingestion/model/symbol-table.js +3 -4
  318. package/dist/core/ingestion/parsing-processor.d.ts +30 -24
  319. package/dist/core/ingestion/parsing-processor.js +76 -640
  320. package/dist/core/ingestion/pipeline-phases/communities.d.ts +1 -1
  321. package/dist/core/ingestion/pipeline-phases/communities.js +5 -2
  322. package/dist/core/ingestion/pipeline-phases/cross-file.d.ts +9 -8
  323. package/dist/core/ingestion/pipeline-phases/cross-file.js +16 -12
  324. package/dist/core/ingestion/pipeline-phases/index.d.ts +1 -0
  325. package/dist/core/ingestion/pipeline-phases/index.js +1 -0
  326. package/dist/core/ingestion/pipeline-phases/mro.d.ts +1 -1
  327. package/dist/core/ingestion/pipeline-phases/mro.js +2 -2
  328. package/dist/core/ingestion/pipeline-phases/parse-impl.d.ts +44 -22
  329. package/dist/core/ingestion/pipeline-phases/parse-impl.js +426 -565
  330. package/dist/core/ingestion/pipeline-phases/parse.d.ts +13 -33
  331. package/dist/core/ingestion/pipeline-phases/parse.js +2 -2
  332. package/dist/core/ingestion/pipeline-phases/processes.d.ts +1 -1
  333. package/dist/core/ingestion/pipeline-phases/processes.js +5 -3
  334. package/dist/core/ingestion/pipeline-phases/prune-local-symbols.d.ts +14 -0
  335. package/dist/core/ingestion/pipeline-phases/prune-local-symbols.js +26 -0
  336. package/dist/core/ingestion/pipeline.d.ts +27 -19
  337. package/dist/core/ingestion/pipeline.js +4 -2
  338. package/dist/core/ingestion/resolve-references.js +15 -3
  339. package/dist/core/ingestion/route-extractors/laravel.d.ts +10 -0
  340. package/dist/core/ingestion/route-extractors/laravel.js +88 -9
  341. package/dist/core/ingestion/scope-extractor-bridge.d.ts +2 -1
  342. package/dist/core/ingestion/scope-extractor-bridge.js +2 -2
  343. package/dist/core/ingestion/scope-extractor.js +13 -0
  344. package/dist/core/ingestion/scope-resolution/contract/scope-resolver.d.ts +181 -15
  345. package/dist/core/ingestion/scope-resolution/contract/scope-resolver.js +21 -10
  346. package/dist/core/ingestion/scope-resolution/graph-bridge/edges.js +10 -2
  347. package/dist/core/ingestion/scope-resolution/graph-bridge/ids.d.ts +7 -1
  348. package/dist/core/ingestion/scope-resolution/graph-bridge/ids.js +58 -6
  349. package/dist/core/ingestion/scope-resolution/graph-bridge/node-lookup.js +24 -5
  350. package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.d.ts +68 -1
  351. package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.js +189 -29
  352. package/dist/core/ingestion/scope-resolution/passes/imported-return-types.js +21 -1
  353. package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.js +1 -1
  354. package/dist/core/ingestion/scope-resolution/pipeline/phase.d.ts +8 -11
  355. package/dist/core/ingestion/scope-resolution/pipeline/phase.js +171 -50
  356. package/dist/core/ingestion/scope-resolution/pipeline/registry.d.ts +3 -4
  357. package/dist/core/ingestion/scope-resolution/pipeline/registry.js +9 -4
  358. package/dist/core/ingestion/scope-resolution/pipeline/run.d.ts +28 -5
  359. package/dist/core/ingestion/scope-resolution/pipeline/run.js +191 -24
  360. package/dist/core/ingestion/scope-resolution/pipeline/validate-bindings-immutability.js +31 -0
  361. package/dist/core/ingestion/scope-resolution/scope/walkers.d.ts +72 -0
  362. package/dist/core/ingestion/scope-resolution/scope/walkers.js +440 -39
  363. package/dist/core/ingestion/scope-resolution/workspace-index.d.ts +18 -2
  364. package/dist/core/ingestion/scope-resolution/workspace-index.js +94 -7
  365. package/dist/core/ingestion/tree-sitter-queries.d.ts +14 -14
  366. package/dist/core/ingestion/tree-sitter-queries.js +380 -158
  367. package/dist/core/ingestion/ts-js-hoc-utils.d.ts +12 -0
  368. package/dist/core/ingestion/ts-js-hoc-utils.js +105 -0
  369. package/dist/core/ingestion/type-env.d.ts +2 -1
  370. package/dist/core/ingestion/type-env.js +6 -8
  371. package/dist/core/ingestion/type-extractors/c-cpp.js +8 -10
  372. package/dist/core/ingestion/type-extractors/csharp.js +18 -34
  373. package/dist/core/ingestion/type-extractors/go.js +2 -10
  374. package/dist/core/ingestion/type-extractors/jvm.js +6 -5
  375. package/dist/core/ingestion/type-extractors/php.js +1 -1
  376. package/dist/core/ingestion/type-extractors/python.js +1 -1
  377. package/dist/core/ingestion/type-extractors/ruby.js +2 -2
  378. package/dist/core/ingestion/type-extractors/rust.js +0 -16
  379. package/dist/core/ingestion/type-extractors/shared.d.ts +2 -2
  380. package/dist/core/ingestion/type-extractors/shared.js +25 -11
  381. package/dist/core/ingestion/type-extractors/swift.js +5 -5
  382. package/dist/core/ingestion/type-extractors/types.d.ts +1 -1
  383. package/dist/core/ingestion/type-extractors/typescript.js +1 -1
  384. package/dist/core/ingestion/utils/ast-helpers.d.ts +119 -1
  385. package/dist/core/ingestion/utils/ast-helpers.js +260 -13
  386. package/dist/core/ingestion/utils/callable-labels.d.ts +13 -0
  387. package/dist/core/ingestion/utils/callable-labels.js +14 -0
  388. package/dist/core/ingestion/utils/deferred-resolution-profile.d.ts +10 -0
  389. package/dist/core/ingestion/utils/deferred-resolution-profile.js +30 -0
  390. package/dist/core/ingestion/utils/heap-probe.d.ts +20 -0
  391. package/dist/core/ingestion/utils/heap-probe.js +39 -0
  392. package/dist/core/ingestion/utils/heritage-marker.d.ts +33 -0
  393. package/dist/core/ingestion/utils/heritage-marker.js +41 -0
  394. package/dist/core/ingestion/utils/qualified-name.d.ts +37 -0
  395. package/dist/core/ingestion/utils/qualified-name.js +67 -0
  396. package/dist/core/ingestion/variable-extractors/configs/c-cpp.js +49 -0
  397. package/dist/core/ingestion/variable-extractors/configs/dart.js +76 -62
  398. package/dist/core/ingestion/variable-extractors/configs/go.js +74 -7
  399. package/dist/core/ingestion/variable-extractors/configs/jvm.js +35 -8
  400. package/dist/core/ingestion/variable-extractors/generic.js +40 -12
  401. package/dist/core/ingestion/variable-types.d.ts +9 -0
  402. package/dist/core/ingestion/vue-sfc-extractor.d.ts +97 -7
  403. package/dist/core/ingestion/vue-sfc-extractor.js +433 -11
  404. package/dist/core/ingestion/workers/parse-worker.d.ts +0 -11
  405. package/dist/core/ingestion/workers/parse-worker.js +358 -187
  406. package/dist/core/ingestion/workers/worker-pool.d.ts +78 -9
  407. package/dist/core/ingestion/workers/worker-pool.js +346 -49
  408. package/dist/core/lbug/csv-generator.js +20 -2
  409. package/dist/core/lbug/lbug-adapter.js +29 -10
  410. package/dist/core/lbug/native-check.js +17 -5
  411. package/dist/core/lbug/pool-adapter.d.ts +0 -19
  412. package/dist/core/lbug/pool-adapter.js +40 -77
  413. package/dist/core/lbug/query-result-utils.d.ts +19 -0
  414. package/dist/core/lbug/query-result-utils.js +28 -0
  415. package/dist/core/run-analyze.d.ts +9 -2
  416. package/dist/core/run-analyze.js +24 -3
  417. package/dist/core/tree-sitter/parser-loader.d.ts +13 -0
  418. package/dist/core/tree-sitter/parser-loader.js +4 -0
  419. package/dist/core/tree-sitter/safe-parse.d.ts +70 -3
  420. package/dist/core/tree-sitter/safe-parse.js +214 -11
  421. package/dist/core/wiki/generator.js +13 -5
  422. package/dist/core/wiki/graph-queries.d.ts +3 -0
  423. package/dist/core/wiki/graph-queries.js +9 -1
  424. package/dist/core/wiki/llm-client.d.ts +1 -1
  425. package/dist/core/wiki/llm-client.js +7 -2
  426. package/dist/core/wiki/local-cli-client.d.ts +2 -1
  427. package/dist/core/wiki/local-cli-client.js +62 -4
  428. package/dist/mcp/compatible-stdio-transport.d.ts +3 -0
  429. package/dist/mcp/compatible-stdio-transport.js +22 -0
  430. package/dist/mcp/core/embedder.d.ts +1 -1
  431. package/dist/mcp/core/embedder.js +13 -1
  432. package/dist/mcp/local/local-backend.d.ts +37 -5
  433. package/dist/mcp/local/local-backend.js +227 -129
  434. package/dist/mcp/resources.js +3 -3
  435. package/dist/mcp/server.js +9 -1
  436. package/dist/storage/git.d.ts +11 -0
  437. package/dist/storage/git.js +30 -0
  438. package/dist/storage/parse-cache.d.ts +23 -1
  439. package/dist/storage/parse-cache.js +138 -32
  440. package/dist/storage/parsedfile-store.d.ts +142 -0
  441. package/dist/storage/parsedfile-store.js +367 -0
  442. package/dist/storage/repo-manager.d.ts +2 -1
  443. package/dist/storage/scope-index-store.d.ts +114 -0
  444. package/dist/storage/scope-index-store.js +236 -0
  445. package/dist/types/pipeline.d.ts +6 -3
  446. package/hooks/antigravity/gitnexus-antigravity-hook.cjs +2 -1
  447. package/hooks/claude/gitnexus-hook.cjs +2 -1
  448. package/hooks/claude/resolve-analyze-cmd.cjs +323 -0
  449. package/package.json +4 -5
  450. package/scripts/bench-scope-resolution.ts +1 -3
  451. package/scripts/cross-platform-tests.ts +4 -1
  452. package/skills/gitnexus-cli.md +8 -6
  453. package/skills/gitnexus-debugging.md +15 -15
  454. package/skills/gitnexus-exploring.md +11 -11
  455. package/skills/gitnexus-guide.md +1 -1
  456. package/skills/gitnexus-impact-analysis.md +10 -10
  457. package/skills/gitnexus-pr-review.md +19 -19
  458. package/skills/gitnexus-refactoring.md +25 -25
  459. package/web/assets/{agent-BRX-afm3.js → agent-EkX7webX.js} +156 -131
  460. package/web/assets/{architectureDiagram-UL44E2DR-B1oYB8-c.js → architectureDiagram-UL44E2DR-BoczH8cv.js} +1 -1
  461. package/web/assets/{chunk-LCXTWHL2-SPC6pgWI.js → chunk-LCXTWHL2-By5HB3b-.js} +1 -1
  462. package/web/assets/{chunk-RG4AUYOV-DZXr4Yv3.js → chunk-RG4AUYOV-BQE_DkpL.js} +1 -1
  463. package/web/assets/{classDiagram-KGZ6W3CR-BqpOj8L9.js → classDiagram-KGZ6W3CR-Dj_02GUH.js} +1 -1
  464. package/web/assets/{classDiagram-v2-72OJOZXJ-FmElywK2.js → classDiagram-v2-72OJOZXJ-D-NArMpf.js} +1 -1
  465. package/web/assets/{diagram-3NCE3AQN-BWtJXMDq.js → diagram-3NCE3AQN-VXtXDO95.js} +1 -1
  466. package/web/assets/{diagram-GF46GFSD-Hh-fChxU.js → diagram-GF46GFSD-B1qab2Ah.js} +1 -1
  467. package/web/assets/{diagram-QXG6HAR7-DYeQHxGU.js → diagram-QXG6HAR7-BSCHGzzT.js} +1 -1
  468. package/web/assets/{diagram-WEQXMOUZ-DYGU4T0y.js → diagram-WEQXMOUZ-DHtknmNT.js} +1 -1
  469. package/web/assets/{erDiagram-L5TCEMPS-bN3wlP2A.js → erDiagram-L5TCEMPS-Db-IYTmm.js} +1 -1
  470. package/web/assets/{flowDiagram-H6V6AXG4-YACVtF3-.js → flowDiagram-H6V6AXG4-BHDoyVoW.js} +1 -1
  471. package/web/assets/{index-BhnAdWTt.js → index-BR0IhgbR.js} +10 -10
  472. package/web/assets/{infoDiagram-3YFTVSEB-BWBzD28-.js → infoDiagram-3YFTVSEB-6h8wbWEe.js} +1 -1
  473. package/web/assets/{ishikawaDiagram-BNXS4ZKH-B8qYT-j9.js → ishikawaDiagram-BNXS4ZKH-Dx2OkPk1.js} +1 -1
  474. package/web/assets/{kanban-definition-75IXJCU3-BeoPr5Tl.js → kanban-definition-75IXJCU3-CIIEZfqV.js} +1 -1
  475. package/web/assets/{mindmap-definition-2TDM6QVE-CdLLN_so.js → mindmap-definition-2TDM6QVE-DUAqydRq.js} +1 -1
  476. package/web/assets/{pieDiagram-CU6KROY3-DEd2a_k_.js → pieDiagram-CU6KROY3-BntYuYZa.js} +1 -1
  477. package/web/assets/{requirementDiagram-JXO7QTGE-QNeTo5C_.js → requirementDiagram-JXO7QTGE-QCD6I29n.js} +1 -1
  478. package/web/assets/{sequenceDiagram-VS2MUI6T-BHC7q7yJ.js → sequenceDiagram-VS2MUI6T-DScFwLz2.js} +1 -1
  479. package/web/assets/{stateDiagram-7D4R322I-KONnc2Px.js → stateDiagram-7D4R322I-AkRAm6Hl.js} +1 -1
  480. package/web/assets/{stateDiagram-v2-36443NZ5-C2QfuMlu.js → stateDiagram-v2-36443NZ5-BCK1vigR.js} +1 -1
  481. package/web/assets/{timeline-definition-O6YCAMPW-D4t4NJx1.js → timeline-definition-O6YCAMPW-BvpIVXjX.js} +1 -1
  482. package/web/assets/{vennDiagram-MWXL3ELB-6bctC9Yg.js → vennDiagram-MWXL3ELB-BYGWk6dK.js} +1 -1
  483. package/web/assets/{wardleyDiagram-CUQ6CDDI-BPZYNTvC.js → wardleyDiagram-CUQ6CDDI-Dk1z7H2T.js} +1 -1
  484. package/web/assets/{xychartDiagram-N2JHSOCM-lBI9O6DW.js → xychartDiagram-N2JHSOCM-2N6NCSWN.js} +1 -1
  485. package/web/index.html +1 -1
  486. package/dist/_shared/scope-resolution/shadow/aggregate.d.ts +0 -63
  487. package/dist/_shared/scope-resolution/shadow/aggregate.d.ts.map +0 -1
  488. package/dist/_shared/scope-resolution/shadow/aggregate.js +0 -122
  489. package/dist/_shared/scope-resolution/shadow/aggregate.js.map +0 -1
  490. package/dist/_shared/scope-resolution/shadow/diff.d.ts +0 -59
  491. package/dist/_shared/scope-resolution/shadow/diff.d.ts.map +0 -1
  492. package/dist/_shared/scope-resolution/shadow/diff.js +0 -79
  493. package/dist/_shared/scope-resolution/shadow/diff.js.map +0 -1
  494. package/dist/core/ingestion/ast-cache.d.ts +0 -26
  495. package/dist/core/ingestion/ast-cache.js +0 -48
  496. package/dist/core/ingestion/heritage-extractors/configs/go.d.ts +0 -13
  497. package/dist/core/ingestion/heritage-extractors/configs/go.js +0 -20
  498. package/dist/core/ingestion/heritage-extractors/configs/ruby.d.ts +0 -18
  499. package/dist/core/ingestion/heritage-extractors/configs/ruby.js +0 -65
  500. package/dist/core/ingestion/heritage-extractors/generic.d.ts +0 -23
  501. package/dist/core/ingestion/heritage-extractors/generic.js +0 -47
  502. package/dist/core/ingestion/heritage-processor.d.ts +0 -54
  503. package/dist/core/ingestion/heritage-processor.js +0 -367
  504. package/dist/core/ingestion/heritage-types.d.ts +0 -73
  505. package/dist/core/ingestion/heritage-types.js +0 -2
  506. package/dist/core/ingestion/import-processor.d.ts +0 -23
  507. package/dist/core/ingestion/import-processor.js +0 -377
  508. package/dist/core/ingestion/model/heritage-map.d.ts +0 -105
  509. package/dist/core/ingestion/model/heritage-map.js +0 -294
  510. package/dist/core/ingestion/model/resolution-context.d.ts +0 -93
  511. package/dist/core/ingestion/model/resolution-context.js +0 -337
  512. package/dist/core/ingestion/named-bindings/csharp.d.ts +0 -3
  513. package/dist/core/ingestion/named-bindings/csharp.js +0 -37
  514. package/dist/core/ingestion/named-bindings/java.d.ts +0 -3
  515. package/dist/core/ingestion/named-bindings/java.js +0 -29
  516. package/dist/core/ingestion/named-bindings/kotlin.d.ts +0 -3
  517. package/dist/core/ingestion/named-bindings/kotlin.js +0 -36
  518. package/dist/core/ingestion/named-bindings/php.d.ts +0 -3
  519. package/dist/core/ingestion/named-bindings/php.js +0 -61
  520. package/dist/core/ingestion/named-bindings/python.d.ts +0 -3
  521. package/dist/core/ingestion/named-bindings/python.js +0 -49
  522. package/dist/core/ingestion/named-bindings/rust.d.ts +0 -3
  523. package/dist/core/ingestion/named-bindings/rust.js +0 -66
  524. package/dist/core/ingestion/named-bindings/types.d.ts +0 -16
  525. package/dist/core/ingestion/named-bindings/types.js +0 -6
  526. package/dist/core/ingestion/named-bindings/typescript.d.ts +0 -3
  527. package/dist/core/ingestion/named-bindings/typescript.js +0 -58
  528. package/dist/core/ingestion/pipeline-phases/cross-file-impl.d.ts +0 -17
  529. package/dist/core/ingestion/pipeline-phases/cross-file-impl.js +0 -209
  530. package/dist/core/ingestion/pipeline-phases/orm-extraction.d.ts +0 -22
  531. package/dist/core/ingestion/pipeline-phases/orm-extraction.js +0 -92
  532. package/dist/core/ingestion/pipeline-phases/wildcard-synthesis.d.ts +0 -70
  533. package/dist/core/ingestion/pipeline-phases/wildcard-synthesis.js +0 -312
  534. package/dist/core/ingestion/registry-primary-flag.d.ts +0 -89
  535. package/dist/core/ingestion/registry-primary-flag.js +0 -122
  536. package/dist/core/ingestion/shadow-harness.d.ts +0 -113
  537. package/dist/core/ingestion/shadow-harness.js +0 -148
  538. package/dist/core/ingestion/utils/ruby-self-call.d.ts +0 -52
  539. package/dist/core/ingestion/utils/ruby-self-call.js +0 -59
  540. package/scripts/ci-list-migrated-languages.ts +0 -24
  541. package/scripts/run-parity.ts +0 -128
@@ -1,312 +0,0 @@
1
- /**
2
- * Wildcard import binding synthesis.
3
- *
4
- * Languages with whole-module import semantics (Go, Ruby, C/C++, Swift)
5
- * import all exported symbols from a file, not specific named symbols.
6
- * After parsing, we know which symbols each file exports (via graph
7
- * `isExported`), so we can expand IMPORTS edges into per-symbol bindings
8
- * that the cross-file propagation phase can use for type resolution.
9
- *
10
- * Also builds Python module-alias maps for namespace-import languages
11
- * (`import models` → `models.User()` resolves to `models.py:User`).
12
- *
13
- * @module
14
- */
15
- import { getLanguageFromFilename } from '../../../_shared/index.js';
16
- import { providers, getProviderForFile } from '../languages/index.js';
17
- // ── Constants ──────────────────────────────────────────────────────────────
18
- /** Node labels that represent top-level importable symbols. */
19
- const IMPORTABLE_SYMBOL_LABELS = new Set([
20
- 'Function',
21
- 'Class',
22
- 'Interface',
23
- 'Struct',
24
- 'Enum',
25
- 'Trait',
26
- 'TypeAlias',
27
- 'Const',
28
- 'Static',
29
- 'Record',
30
- 'Union',
31
- 'Typedef',
32
- 'Macro',
33
- ]);
34
- /** Max synthetic bindings per importing file — prevents memory bloat
35
- * for C/C++ files that include many large headers. */
36
- const MAX_SYNTHETIC_BINDINGS_PER_FILE = 1000;
37
- /** Max files allowed in a single transitive include closure. Guards against
38
- * OOM on pathological C/C++ codebases (boost, Linux kernel-style monoheaders)
39
- * where a single translation unit can transitively reach many thousands of
40
- * headers. When the cap is hit, BFS expansion stops early — the file still
41
- * synthesizes bindings from the partial closure rather than failing. */
42
- const MAX_TRANSITIVE_CLOSURE_SIZE = 5000;
43
- /** Import semantics tags whose languages need synthesis of whole-module imports.
44
- * `wildcard-transitive` (C/C++) and `wildcard-leaf` (Go, Ruby, Swift, Dart) are
45
- * the file-based wildcard strategies. `explicit-reexport` is a scaffold tag —
46
- * no provider uses it yet, but it goes through the same leaf-style synthesis
47
- * path today because a re-exporter is still an importer; only the extra DAG
48
- * walk to surface re-exported symbols is missing (future work). */
49
- const WILDCARD_SEMANTICS = new Set([
50
- 'wildcard-transitive',
51
- 'wildcard-leaf',
52
- 'explicit-reexport',
53
- ]);
54
- /** Languages with whole-module import semantics (derived from providers at module load). */
55
- const WILDCARD_LANGUAGES = new Set(Object.values(providers)
56
- .filter((p) => WILDCARD_SEMANTICS.has(p.importSemantics))
57
- .map((p) => p.id));
58
- /** Languages that need binding synthesis before call resolution. */
59
- const SYNTHESIS_LANGUAGES = new Set(Object.values(providers)
60
- .filter((p) => p.importSemantics !== 'named')
61
- .map((p) => p.id));
62
- /** Check if a language uses wildcard (whole-module) import semantics. */
63
- export function isWildcardImportLanguage(lang) {
64
- return WILDCARD_LANGUAGES.has(lang);
65
- }
66
- /** Check if a language needs synthesis before call resolution.
67
- * True for wildcard-import languages AND namespace-import languages (Python). */
68
- export function needsSynthesis(lang) {
69
- return SYNTHESIS_LANGUAGES.has(lang);
70
- }
71
- // ── Strategy implementations ───────────────────────────────────────────────
72
- /**
73
- * Strategy implementation for `importSemantics: 'wildcard-transitive'` (C, C++).
74
- *
75
- * Textual-include languages chain symbols through files: if `dict.c` includes
76
- * `server.h` and `server.h` includes `dict.h`, then `dict.c` sees symbols from
77
- * all three files. This helper walks the include graph (combining both the
78
- * ingestion-context `importMap` and the graph-level IMPORTS edges) until the
79
- * closure is stable.
80
- *
81
- * **Order matters.** The returned `Set` preserves iteration order (insertion
82
- * order). `synthesizeWildcardImportBindings` dedupes bindings by symbol name
83
- * on a first-seen-wins basis, so this closure's ordering determines which
84
- * declaration wins when multiple headers export the same name (e.g. overloaded
85
- * free functions like `write_audit()` vs `write_audit(const char*)` in
86
- * different headers). We therefore:
87
- * 1. Seed the closure with direct imports in declaration order (matches the
88
- * order of `#include` directives in the source file).
89
- * 2. Use FIFO / true BFS (`queue.shift()`) for transitive expansion, so
90
- * closer headers are seen before deeper ones.
91
- *
92
- * Cycle-safe: the `closure.has(file)` guard prevents infinite loops on circular
93
- * header includes, which are valid C/C++ when paired with `#pragma once` or
94
- * include guards.
95
- *
96
- * Size-bounded: the closure is capped at `MAX_TRANSITIVE_CLOSURE_SIZE` files to
97
- * prevent OOM on pathological codebases (e.g. boost, monoheader kernel code)
98
- * where one translation unit can transitively reach tens of thousands of
99
- * headers. Partial closures still yield useful bindings for the cluster of
100
- * headers closest to the importer, which is what overload resolution and
101
- * cross-file call resolution care about.
102
- *
103
- * Queue implementation: uses a head-index over a growing array (O(1) dequeue)
104
- * instead of `Array.prototype.shift()` (O(n)) so deep chains stay linear.
105
- */
106
- export function expandTransitiveIncludeClosure(directImports, importMap, graphImports) {
107
- const closure = new Set();
108
- const queue = [];
109
- let head = 0; // O(1) dequeue: advance the head index instead of shift()-ing.
110
- const tryEnqueue = (file) => {
111
- if (closure.has(file))
112
- return true;
113
- if (closure.size >= MAX_TRANSITIVE_CLOSURE_SIZE)
114
- return false;
115
- closure.add(file);
116
- queue.push(file);
117
- return true;
118
- };
119
- // Seed direct imports in declaration order (see JSDoc on order-sensitivity).
120
- for (const f of directImports) {
121
- if (!tryEnqueue(f))
122
- break;
123
- }
124
- // True BFS for transitive reach: head-index FIFO preserves the "closer
125
- // headers first" ordering that overload resolution depends on.
126
- while (head < queue.length) {
127
- if (closure.size >= MAX_TRANSITIVE_CLOSURE_SIZE)
128
- break;
129
- const file = queue[head++];
130
- const nested = importMap.get(file);
131
- if (nested) {
132
- for (const n of nested) {
133
- if (!tryEnqueue(n))
134
- break;
135
- }
136
- }
137
- const nestedGraph = graphImports.get(file);
138
- if (nestedGraph) {
139
- for (const n of nestedGraph) {
140
- if (!tryEnqueue(n))
141
- break;
142
- }
143
- }
144
- }
145
- return closure;
146
- }
147
- // ── Main synthesis function ────────────────────────────────────────────────
148
- /**
149
- * Synthesize namedImportMap entries for languages with whole-module imports.
150
- *
151
- * For each file that imports another file via wildcard semantics:
152
- * 1. Look up all exported symbols from the imported file (via graph nodes)
153
- * 2. Create synthetic named bindings: `{ name → { sourcePath, exportedName } }`
154
- * 3. Build Python module-alias maps for namespace-import languages
155
- *
156
- * @param graph The knowledge graph with parsed symbol nodes
157
- * @param ctx Resolution context with importMap and namedImportMap
158
- * @returns Number of synthetic bindings created
159
- */
160
- export function synthesizeWildcardImportBindings(graph, ctx) {
161
- // Build exported symbols index from graph nodes (single pass)
162
- const exportedSymbolsByFile = new Map();
163
- graph.forEachNode((node) => {
164
- if (!node.properties?.isExported)
165
- return;
166
- if (!IMPORTABLE_SYMBOL_LABELS.has(node.label))
167
- return;
168
- const fp = node.properties.filePath;
169
- const name = node.properties.name;
170
- if (!fp || !name)
171
- return;
172
- let symbols = exportedSymbolsByFile.get(fp);
173
- if (!symbols) {
174
- symbols = [];
175
- exportedSymbolsByFile.set(fp, symbols);
176
- }
177
- symbols.push({ name, filePath: fp });
178
- });
179
- if (exportedSymbolsByFile.size === 0)
180
- return 0;
181
- // Collect graph-level IMPORTS edges for wildcard languages missing from ctx.importMap
182
- const FILE_PREFIX = 'File:';
183
- const graphImports = new Map();
184
- graph.forEachRelationship((rel) => {
185
- if (rel.type !== 'IMPORTS')
186
- return;
187
- if (!rel.sourceId.startsWith(FILE_PREFIX) || !rel.targetId.startsWith(FILE_PREFIX))
188
- return;
189
- const srcFile = rel.sourceId.slice(FILE_PREFIX.length);
190
- const tgtFile = rel.targetId.slice(FILE_PREFIX.length);
191
- const lang = getLanguageFromFilename(srcFile);
192
- if (!lang || !isWildcardImportLanguage(lang))
193
- return;
194
- if (ctx.importMap.get(srcFile)?.has(tgtFile))
195
- return;
196
- let set = graphImports.get(srcFile);
197
- if (!set) {
198
- set = new Set();
199
- graphImports.set(srcFile, set);
200
- }
201
- set.add(tgtFile);
202
- });
203
- let totalSynthesized = 0;
204
- const synthesizeForFile = (filePath, importedFiles) => {
205
- let fileBindings = ctx.namedImportMap.get(filePath);
206
- let fileCount = fileBindings?.size ?? 0;
207
- for (const importedFile of importedFiles) {
208
- const exportedSymbols = exportedSymbolsByFile.get(importedFile);
209
- if (!exportedSymbols)
210
- continue;
211
- for (const sym of exportedSymbols) {
212
- if (fileCount >= MAX_SYNTHETIC_BINDINGS_PER_FILE)
213
- return;
214
- if (fileBindings?.has(sym.name))
215
- continue;
216
- if (!fileBindings) {
217
- fileBindings = new Map();
218
- ctx.namedImportMap.set(filePath, fileBindings);
219
- }
220
- fileBindings.set(sym.name, {
221
- sourcePath: importedFile,
222
- exportedName: sym.name,
223
- });
224
- fileCount++;
225
- totalSynthesized++;
226
- }
227
- }
228
- };
229
- /**
230
- * Dispatch wildcard synthesis by the file's language provider strategy.
231
- *
232
- * Strategy tags (see `ImportSemantics`):
233
- * - `wildcard-transitive`: expand the include closure first (C/C++ #include
234
- * chains — e.g. `dict.c` → `server.h` → `dict.h` so `dictFind` resolves
235
- * across header chains)
236
- * - `wildcard-leaf`: synthesize from direct imports only (Go, Ruby, Swift, Dart)
237
- * - `explicit-reexport`: scaffold tag; falls through to leaf behavior.
238
- * TODO(#821): implement re-export DAG walk for TS `export *` / Rust
239
- * `pub use`. The leaf fallthrough preserves today's TS/Rust behavior
240
- * (their direct imports still synthesize correctly); only the extra
241
- * re-export DAG walk for barrel-file correctness is missing.
242
- * - `namespace` / `named`: no-op here (namespace handled in Loop 3 below,
243
- * named needs no synthesis).
244
- *
245
- * Used by both Loop 1 (ctx.importMap) and Loop 2 (graphImports) so a future
246
- * transitive-import language whose edges arrive via graphImports gets closure
247
- * expansion consistently regardless of edge source.
248
- */
249
- const dispatchSynthesis = (filePath, importedFiles, provider) => {
250
- switch (provider.importSemantics) {
251
- case 'wildcard-transitive':
252
- synthesizeForFile(filePath, expandTransitiveIncludeClosure(importedFiles, ctx.importMap, graphImports));
253
- return;
254
- case 'wildcard-leaf':
255
- case 'explicit-reexport':
256
- synthesizeForFile(filePath, importedFiles);
257
- return;
258
- case 'namespace':
259
- case 'named':
260
- return;
261
- default: {
262
- const _exhaustive = provider.importSemantics;
263
- void _exhaustive;
264
- }
265
- }
266
- };
267
- // Loop 1: synthesize from ctx.importMap (Ruby, C/C++, Swift, Dart file-based imports).
268
- for (const [filePath, importedFiles] of ctx.importMap) {
269
- const lang = getLanguageFromFilename(filePath);
270
- if (!lang || !isWildcardImportLanguage(lang))
271
- continue;
272
- const provider = getProviderForFile(filePath);
273
- if (!provider)
274
- continue;
275
- dispatchSynthesis(filePath, importedFiles, provider);
276
- }
277
- // Loop 2: synthesize from graph IMPORTS edges (Go and other wildcard-import
278
- // languages whose edges live in the graph rather than ctx.importMap).
279
- for (const [filePath, importedFiles] of graphImports) {
280
- const provider = getProviderForFile(filePath);
281
- if (!provider)
282
- continue;
283
- dispatchSynthesis(filePath, importedFiles, provider);
284
- }
285
- // Build Python module-alias maps for namespace-import languages.
286
- // `import models` in app.py → moduleAliasMap['app.py']['models'] = 'models.py'
287
- // Enables `models.User()` to resolve without ambiguous symbol expansion.
288
- for (const [filePath, importedFiles] of ctx.importMap) {
289
- const provider = getProviderForFile(filePath);
290
- if (!provider || provider.importSemantics !== 'namespace')
291
- continue;
292
- buildPythonModuleAliasForFile(ctx, filePath, importedFiles);
293
- }
294
- return totalSynthesized;
295
- }
296
- /** Build module alias entries for namespace-import files (e.g. Python). */
297
- function buildPythonModuleAliasForFile(ctx, callerFile, importedFiles) {
298
- let aliasMap = ctx.moduleAliasMap.get(callerFile);
299
- for (const importedFile of importedFiles) {
300
- const lastSlash = importedFile.lastIndexOf('/');
301
- const base = lastSlash >= 0 ? importedFile.slice(lastSlash + 1) : importedFile;
302
- const dot = base.lastIndexOf('.');
303
- const stem = dot >= 0 ? base.slice(0, dot) : base;
304
- if (!stem)
305
- continue;
306
- if (!aliasMap) {
307
- aliasMap = new Map();
308
- ctx.moduleAliasMap.set(callerFile, aliasMap);
309
- }
310
- aliasMap.set(stem, importedFile);
311
- }
312
- }
@@ -1,89 +0,0 @@
1
- /**
2
- * `REGISTRY_PRIMARY_<LANG>` per-language feature flags for the scope-based
3
- * resolution rollout (RFC §6.1 Ring 3; Ring 2 PKG #924).
4
- *
5
- * This module is the single source of truth for whether a given language
6
- * has been flipped to registry-primary call resolution. When a language's
7
- * flag is true, its files route through `Registry.lookup` (RFC §4) instead
8
- * of the legacy call-resolution DAG; when false (the default), the legacy
9
- * DAG runs unchanged.
10
- *
11
- * ## Contract
12
- *
13
- * - Env-var name per language: `REGISTRY_PRIMARY_<UPPER(enum-value)>`.
14
- * Example: `SupportedLanguages.Python` → `REGISTRY_PRIMARY_PYTHON`;
15
- * `SupportedLanguages.CPlusPlus` (value `'cpp'`) → `REGISTRY_PRIMARY_CPP`.
16
- * `SupportedLanguages.Cobol` (value `'cobol'`) → `REGISTRY_PRIMARY_COBOL`.
17
- * - Truthy values: `'true'`, `'1'`, `'yes'` (case-insensitive,
18
- * whitespace-trimmed). Anything else — including `undefined`, empty
19
- * string, or unknown tokens — is `false`.
20
- * - No per-process caching. `process.env` is read on every call. The
21
- * flag is consulted once per file at call-resolution time, so the
22
- * overhead is negligible; skipping caching keeps test isolation
23
- * trivial (no `resetFlagCache()` coordination needed).
24
- *
25
- * ## Integration site
26
- *
27
- * `call-processor.ts` integration lands in **#921** (`finalize-orchestrator`)
28
- * where the `SemanticModel` becomes accessible and `Registry.lookup` can
29
- * actually be called with a populated context. This module ships the flag
30
- * primitive in isolation so #921 has a clean, tested utility to consult.
31
- *
32
- * ## Shadow mode is orthogonal
33
- *
34
- * Shadow mode (`GITNEXUS_SHADOW_MODE=1`, introduced in #923) runs BOTH
35
- * legacy and registry paths regardless of the per-language flag, so the
36
- * parity dashboard has signal even for un-flipped languages. That logic
37
- * lives in `shadow-harness.ts` (#923), not here.
38
- */
39
- import { SupportedLanguages } from '../../_shared/index.js';
40
- /**
41
- * Languages whose RFC #909 Ring 3 scope-resolution migration is complete.
42
- *
43
- * This is the single source of truth for "migrated" — the list drives:
44
- *
45
- * 1. **Production default behavior.** `isRegistryPrimary(lang)` returns
46
- * `true` by default for languages in this set (env-var override to
47
- * any falsy value still wins — e.g. `REGISTRY_PRIMARY_PYTHON=0`).
48
- * 2. **CI parity gate.** `.github/workflows/ci-scope-parity.yml` auto-
49
- * discovers this set and, for every language in it, runs the
50
- * resolver integration test at `test/integration/resolvers/<slug>.test.ts`
51
- * TWICE on every PR — once with the legacy DAG (flag forced off)
52
- * and once with the registry-primary path (flag forced on). BOTH
53
- * must pass. Adding a language is automatic — no workflow edit,
54
- * no JSON registry.
55
- * 3. **Legacy-path gating.** `call-processor.ts` / `import-processor.ts`
56
- * skip per-language work when `isRegistryPrimary(lang)` is `true`,
57
- * so this set also controls what gets silenced in the legacy DAG.
58
- *
59
- * Add a language here ONLY after shadow parity ≥ 99% fixtures / ≥ 98%
60
- * corpus per RFC §6.4. TypeScript is temporarily accepted under the
61
- * Ring 3 CI parity gate while corpus-level shadow-mode wiring is tracked
62
- * in #927 for this migration.
63
- *
64
- * The set is intentionally a static TypeScript literal (not a JSON import,
65
- * not an env lookup) so CI can discover it via `tsx` without a build step
66
- * and reviewers see the change inline with the code that consumes it.
67
- */
68
- export declare const MIGRATED_LANGUAGES: ReadonlySet<SupportedLanguages>;
69
- /**
70
- * Return the env-var name that controls a given language's registry-
71
- * primary flag. Exported for test assertions and for the PR-labeling
72
- * CI job that cross-references per-language flag changes.
73
- */
74
- export declare function envVarNameFor(lang: SupportedLanguages): string;
75
- /**
76
- * Whether `lang` runs through the registry-primary call-resolution path.
77
- *
78
- * Resolution order: an explicit env-var value wins (so operators and CI
79
- * can force either path for a given run), and the default falls back to
80
- * `MIGRATED_LANGUAGES.has(lang)` — so languages whose migration is
81
- * complete default to registry-primary without touching any env.
82
- */
83
- export declare function isRegistryPrimary(lang: SupportedLanguages): boolean;
84
- /**
85
- * All languages whose registry-primary flag is currently on. Useful for
86
- * startup-time logging + the shadow-harness dashboard, which wants to
87
- * distinguish "primary: legacy" from "primary: registry" rows.
88
- */
89
- export declare function primaryLanguages(): ReadonlySet<SupportedLanguages>;
@@ -1,122 +0,0 @@
1
- /**
2
- * `REGISTRY_PRIMARY_<LANG>` per-language feature flags for the scope-based
3
- * resolution rollout (RFC §6.1 Ring 3; Ring 2 PKG #924).
4
- *
5
- * This module is the single source of truth for whether a given language
6
- * has been flipped to registry-primary call resolution. When a language's
7
- * flag is true, its files route through `Registry.lookup` (RFC §4) instead
8
- * of the legacy call-resolution DAG; when false (the default), the legacy
9
- * DAG runs unchanged.
10
- *
11
- * ## Contract
12
- *
13
- * - Env-var name per language: `REGISTRY_PRIMARY_<UPPER(enum-value)>`.
14
- * Example: `SupportedLanguages.Python` → `REGISTRY_PRIMARY_PYTHON`;
15
- * `SupportedLanguages.CPlusPlus` (value `'cpp'`) → `REGISTRY_PRIMARY_CPP`.
16
- * `SupportedLanguages.Cobol` (value `'cobol'`) → `REGISTRY_PRIMARY_COBOL`.
17
- * - Truthy values: `'true'`, `'1'`, `'yes'` (case-insensitive,
18
- * whitespace-trimmed). Anything else — including `undefined`, empty
19
- * string, or unknown tokens — is `false`.
20
- * - No per-process caching. `process.env` is read on every call. The
21
- * flag is consulted once per file at call-resolution time, so the
22
- * overhead is negligible; skipping caching keeps test isolation
23
- * trivial (no `resetFlagCache()` coordination needed).
24
- *
25
- * ## Integration site
26
- *
27
- * `call-processor.ts` integration lands in **#921** (`finalize-orchestrator`)
28
- * where the `SemanticModel` becomes accessible and `Registry.lookup` can
29
- * actually be called with a populated context. This module ships the flag
30
- * primitive in isolation so #921 has a clean, tested utility to consult.
31
- *
32
- * ## Shadow mode is orthogonal
33
- *
34
- * Shadow mode (`GITNEXUS_SHADOW_MODE=1`, introduced in #923) runs BOTH
35
- * legacy and registry paths regardless of the per-language flag, so the
36
- * parity dashboard has signal even for un-flipped languages. That logic
37
- * lives in `shadow-harness.ts` (#923), not here.
38
- */
39
- import { SupportedLanguages } from '../../_shared/index.js';
40
- import { parseTruthyEnv } from './utils/env.js';
41
- /**
42
- * Languages whose RFC #909 Ring 3 scope-resolution migration is complete.
43
- *
44
- * This is the single source of truth for "migrated" — the list drives:
45
- *
46
- * 1. **Production default behavior.** `isRegistryPrimary(lang)` returns
47
- * `true` by default for languages in this set (env-var override to
48
- * any falsy value still wins — e.g. `REGISTRY_PRIMARY_PYTHON=0`).
49
- * 2. **CI parity gate.** `.github/workflows/ci-scope-parity.yml` auto-
50
- * discovers this set and, for every language in it, runs the
51
- * resolver integration test at `test/integration/resolvers/<slug>.test.ts`
52
- * TWICE on every PR — once with the legacy DAG (flag forced off)
53
- * and once with the registry-primary path (flag forced on). BOTH
54
- * must pass. Adding a language is automatic — no workflow edit,
55
- * no JSON registry.
56
- * 3. **Legacy-path gating.** `call-processor.ts` / `import-processor.ts`
57
- * skip per-language work when `isRegistryPrimary(lang)` is `true`,
58
- * so this set also controls what gets silenced in the legacy DAG.
59
- *
60
- * Add a language here ONLY after shadow parity ≥ 99% fixtures / ≥ 98%
61
- * corpus per RFC §6.4. TypeScript is temporarily accepted under the
62
- * Ring 3 CI parity gate while corpus-level shadow-mode wiring is tracked
63
- * in #927 for this migration.
64
- *
65
- * The set is intentionally a static TypeScript literal (not a JSON import,
66
- * not an env lookup) so CI can discover it via `tsx` without a build step
67
- * and reviewers see the change inline with the code that consumes it.
68
- */
69
- export const MIGRATED_LANGUAGES = new Set([
70
- SupportedLanguages.Python,
71
- SupportedLanguages.CSharp,
72
- SupportedLanguages.TypeScript,
73
- SupportedLanguages.Go,
74
- SupportedLanguages.C,
75
- SupportedLanguages.CPlusPlus,
76
- SupportedLanguages.PHP,
77
- SupportedLanguages.JavaScript,
78
- SupportedLanguages.Kotlin,
79
- SupportedLanguages.Java,
80
- SupportedLanguages.Rust,
81
- SupportedLanguages.Ruby,
82
- SupportedLanguages.Cobol,
83
- ]);
84
- /**
85
- * Return the env-var name that controls a given language's registry-
86
- * primary flag. Exported for test assertions and for the PR-labeling
87
- * CI job that cross-references per-language flag changes.
88
- */
89
- export function envVarNameFor(lang) {
90
- return `REGISTRY_PRIMARY_${lang.toUpperCase()}`;
91
- }
92
- /**
93
- * Whether `lang` runs through the registry-primary call-resolution path.
94
- *
95
- * Resolution order: an explicit env-var value wins (so operators and CI
96
- * can force either path for a given run), and the default falls back to
97
- * `MIGRATED_LANGUAGES.has(lang)` — so languages whose migration is
98
- * complete default to registry-primary without touching any env.
99
- */
100
- export function isRegistryPrimary(lang) {
101
- const raw = process.env[envVarNameFor(lang)];
102
- if (raw !== undefined)
103
- return parseFlag(raw);
104
- return MIGRATED_LANGUAGES.has(lang);
105
- }
106
- /**
107
- * All languages whose registry-primary flag is currently on. Useful for
108
- * startup-time logging + the shadow-harness dashboard, which wants to
109
- * distinguish "primary: legacy" from "primary: registry" rows.
110
- */
111
- export function primaryLanguages() {
112
- const out = new Set();
113
- for (const lang of Object.values(SupportedLanguages)) {
114
- if (isRegistryPrimary(lang))
115
- out.add(lang);
116
- }
117
- return out;
118
- }
119
- // ─── Internal ───────────────────────────────────────────────────────────────
120
- function parseFlag(raw) {
121
- return parseTruthyEnv(raw);
122
- }
@@ -1,113 +0,0 @@
1
- /**
2
- * Shadow-mode parity harness — dual-run observability for the RFC #909
3
- * registry rollout (RFC §6.3; Ring 2 PKG #923).
4
- *
5
- * ## What it does
6
- *
7
- * - Exposes `record({ language, callsite, legacy, newResult })` for
8
- * every call site where the caller has BOTH a legacy-DAG resolution
9
- * and a new `Registry.lookup` resolution.
10
- * - Computes a `ShadowDiff` per record via shared `diffResolutions`
11
- * (#918) and accumulates them in a per-language bucket.
12
- * - At the end of a run, aggregates into a `ShadowParityReport` via
13
- * shared `aggregateDiffs` (#918) — per-language parity %,
14
- * evidence-kind breakdown of divergences, grand-total overall row.
15
- * - Optionally persists the report as JSON under
16
- * `.gitnexus/shadow-parity/` so the static dashboard at
17
- * `gitnexus/shadow-parity-dashboard/` can render it offline.
18
- *
19
- * ## What it does NOT do
20
- *
21
- * - **Invoke either resolution path itself.** The caller must run
22
- * legacy + `Registry.lookup` and pass results in. The harness is a
23
- * side-car, not a dispatcher — this keeps call-processor integration
24
- * surgical when it lands (tracked as a follow-up; the shared model
25
- * doesn't dual-invoke on its own).
26
- * - **Flip anything.** `REGISTRY_PRIMARY_<LANG>` lives in
27
- * `registry-primary-flag.ts` (#924); the harness records the
28
- * caller-supplied "which side is primary" bit for each record so the
29
- * dashboard can label rows, but it does not consult the flag itself.
30
- *
31
- * ## Activation
32
- *
33
- * `GITNEXUS_SHADOW_MODE=1` (or `'true'`, `'yes'`, case-insensitive,
34
- * trimmed) enables the harness. When disabled, `record()` is a cheap
35
- * no-op: no accumulation, no allocation beyond the harness object
36
- * itself. Callers can always construct a harness and hand it through;
37
- * the "off" overhead is near-zero.
38
- *
39
- * ## Persistence shape
40
- *
41
- * When `persist()` is called, the harness writes TWO files:
42
- *
43
- * - `<outputDir>/<runId>.json` — the timestamped snapshot (immutable)
44
- * - `<outputDir>/latest.json` — a pointer that the dashboard reads
45
- *
46
- * Both files contain the same `PersistedShadowReport` payload:
47
- *
48
- * {
49
- * schemaVersion: 1,
50
- * runId: "<iso-8601>-<rand>",
51
- * generatedAt: "<iso-8601>",
52
- * primaryByLanguage: { [lang]: "legacy" | "registry" },
53
- * report: <ShadowParityReport>
54
- * }
55
- *
56
- * Schema-version-gated so future format changes don't silently confuse
57
- * older dashboards. The dashboard renders `report.perLanguage` rows and
58
- * annotates each with `primaryByLanguage[lang]`.
59
- */
60
- import { type Resolution, type ShadowCallsite, type ShadowParityReport, type SupportedLanguages } from '../../_shared/index.js';
61
- /** Which side of the dual-run is considered authoritative for this language. */
62
- export type PrimarySide = 'legacy' | 'registry';
63
- /** One record per call site the caller dual-runs. */
64
- export interface ShadowRecordInput {
65
- readonly language: SupportedLanguages;
66
- readonly callsite: ShadowCallsite;
67
- readonly legacy: readonly Resolution[];
68
- readonly newResult: readonly Resolution[];
69
- /**
70
- * Which side drove the actual runtime answer for this record. Lets the
71
- * dashboard distinguish "registry-primary, legacy is shadow" from the
72
- * default "legacy-primary, registry is shadow" without re-reading
73
- * `REGISTRY_PRIMARY_<LANG>` env vars at render time.
74
- */
75
- readonly primary: PrimarySide;
76
- }
77
- /** Persisted JSON shape. Schema-versioned for future migrations. */
78
- export interface PersistedShadowReport {
79
- readonly schemaVersion: 1;
80
- readonly runId: string;
81
- readonly generatedAt: string;
82
- readonly primaryByLanguage: Readonly<Partial<Record<SupportedLanguages, PrimarySide>>>;
83
- readonly report: ShadowParityReport;
84
- }
85
- export interface ShadowHarness {
86
- /** `true` iff `GITNEXUS_SHADOW_MODE` is truthy. When `false`, `record()` is a no-op. */
87
- readonly enabled: boolean;
88
- /** Accumulate a dual-run observation. No-op when `enabled === false`. */
89
- record(input: ShadowRecordInput): void;
90
- /** Number of records accumulated so far. Useful for diagnostics / tests. */
91
- size(): number;
92
- /**
93
- * Aggregate the accumulated records into a `ShadowParityReport`
94
- * without persisting. Returns a deterministic snapshot each call;
95
- * idempotent with respect to `record()` ordering.
96
- */
97
- snapshot(now?: Date): ShadowParityReport;
98
- /**
99
- * Write the aggregated snapshot to JSON. Resolves to the path of the
100
- * per-run file. Also writes/overwrites `latest.json` alongside.
101
- *
102
- * Creates `outputDir` if it doesn't exist.
103
- */
104
- persist(outputDir: string, now?: Date): Promise<string>;
105
- /** Reset the accumulator. Preserves `enabled`. */
106
- clear(): void;
107
- }
108
- /**
109
- * Construct a harness. Reads `GITNEXUS_SHADOW_MODE` at construction time
110
- * (not per-`record()` call) so repeated no-op records don't re-check the
111
- * env var in the hot path.
112
- */
113
- export declare function createShadowHarness(): ShadowHarness;