seer-mcp 0.1.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 (371) hide show
  1. package/.vscode/settings.json +3 -0
  2. package/LICENSE +176 -0
  3. package/README.md +272 -0
  4. package/README_dev.md +199 -0
  5. package/dist/bundle/ci.d.ts +47 -0
  6. package/dist/bundle/ci.d.ts.map +1 -0
  7. package/dist/bundle/ci.js +113 -0
  8. package/dist/bundle/ci.js.map +1 -0
  9. package/dist/bundle/contract.d.ts +111 -0
  10. package/dist/bundle/contract.d.ts.map +1 -0
  11. package/dist/bundle/contract.js +352 -0
  12. package/dist/bundle/contract.js.map +1 -0
  13. package/dist/bundle/export.d.ts +36 -0
  14. package/dist/bundle/export.d.ts.map +1 -0
  15. package/dist/bundle/export.js +152 -0
  16. package/dist/bundle/export.js.map +1 -0
  17. package/dist/bundle/external.d.ts +66 -0
  18. package/dist/bundle/external.d.ts.map +1 -0
  19. package/dist/bundle/external.js +238 -0
  20. package/dist/bundle/external.js.map +1 -0
  21. package/dist/bundle/format.d.ts +94 -0
  22. package/dist/bundle/format.d.ts.map +1 -0
  23. package/dist/bundle/format.js +42 -0
  24. package/dist/bundle/format.js.map +1 -0
  25. package/dist/bundle/import.d.ts +49 -0
  26. package/dist/bundle/import.d.ts.map +1 -0
  27. package/dist/bundle/import.js +116 -0
  28. package/dist/bundle/import.js.map +1 -0
  29. package/dist/cli/index.d.ts +3 -0
  30. package/dist/cli/index.d.ts.map +1 -0
  31. package/dist/cli/index.js +1402 -0
  32. package/dist/cli/index.js.map +1 -0
  33. package/dist/cli/init.d.ts +48 -0
  34. package/dist/cli/init.d.ts.map +1 -0
  35. package/dist/cli/init.js +284 -0
  36. package/dist/cli/init.js.map +1 -0
  37. package/dist/db/schema.d.ts +3 -0
  38. package/dist/db/schema.d.ts.map +1 -0
  39. package/dist/db/schema.js +616 -0
  40. package/dist/db/schema.js.map +1 -0
  41. package/dist/db/store.d.ts +1011 -0
  42. package/dist/db/store.d.ts.map +1 -0
  43. package/dist/db/store.js +3888 -0
  44. package/dist/db/store.js.map +1 -0
  45. package/dist/graph/pagerank.d.ts +9 -0
  46. package/dist/graph/pagerank.d.ts.map +1 -0
  47. package/dist/graph/pagerank.js +47 -0
  48. package/dist/graph/pagerank.js.map +1 -0
  49. package/dist/indexer/architecture.d.ts +72 -0
  50. package/dist/indexer/architecture.d.ts.map +1 -0
  51. package/dist/indexer/architecture.js +112 -0
  52. package/dist/indexer/architecture.js.map +1 -0
  53. package/dist/indexer/behavior.d.ts +75 -0
  54. package/dist/indexer/behavior.d.ts.map +1 -0
  55. package/dist/indexer/behavior.js +395 -0
  56. package/dist/indexer/behavior.js.map +1 -0
  57. package/dist/indexer/boundaries.d.ts +60 -0
  58. package/dist/indexer/boundaries.d.ts.map +1 -0
  59. package/dist/indexer/boundaries.js +366 -0
  60. package/dist/indexer/boundaries.js.map +1 -0
  61. package/dist/indexer/churn.d.ts +15 -0
  62. package/dist/indexer/churn.d.ts.map +1 -0
  63. package/dist/indexer/churn.js +49 -0
  64. package/dist/indexer/churn.js.map +1 -0
  65. package/dist/indexer/classify.d.ts +9 -0
  66. package/dist/indexer/classify.d.ts.map +1 -0
  67. package/dist/indexer/classify.js +90 -0
  68. package/dist/indexer/classify.js.map +1 -0
  69. package/dist/indexer/context.d.ts +176 -0
  70. package/dist/indexer/context.d.ts.map +1 -0
  71. package/dist/indexer/context.js +193 -0
  72. package/dist/indexer/context.js.map +1 -0
  73. package/dist/indexer/continuity.d.ts +67 -0
  74. package/dist/indexer/continuity.d.ts.map +1 -0
  75. package/dist/indexer/continuity.js +288 -0
  76. package/dist/indexer/continuity.js.map +1 -0
  77. package/dist/indexer/detectchanges.d.ts +32 -0
  78. package/dist/indexer/detectchanges.d.ts.map +1 -0
  79. package/dist/indexer/detectchanges.js +74 -0
  80. package/dist/indexer/detectchanges.js.map +1 -0
  81. package/dist/indexer/discovery.d.ts +37 -0
  82. package/dist/indexer/discovery.d.ts.map +1 -0
  83. package/dist/indexer/discovery.js +136 -0
  84. package/dist/indexer/discovery.js.map +1 -0
  85. package/dist/indexer/externaldeps.d.ts +18 -0
  86. package/dist/indexer/externaldeps.d.ts.map +1 -0
  87. package/dist/indexer/externaldeps.js +288 -0
  88. package/dist/indexer/externaldeps.js.map +1 -0
  89. package/dist/indexer/freshness.d.ts +48 -0
  90. package/dist/indexer/freshness.d.ts.map +1 -0
  91. package/dist/indexer/freshness.js +128 -0
  92. package/dist/indexer/freshness.js.map +1 -0
  93. package/dist/indexer/git.d.ts +144 -0
  94. package/dist/indexer/git.d.ts.map +1 -0
  95. package/dist/indexer/git.js +444 -0
  96. package/dist/indexer/git.js.map +1 -0
  97. package/dist/indexer/index.d.ts +145 -0
  98. package/dist/indexer/index.d.ts.map +1 -0
  99. package/dist/indexer/index.js +930 -0
  100. package/dist/indexer/index.js.map +1 -0
  101. package/dist/indexer/modules.d.ts +62 -0
  102. package/dist/indexer/modules.d.ts.map +1 -0
  103. package/dist/indexer/modules.js +293 -0
  104. package/dist/indexer/modules.js.map +1 -0
  105. package/dist/indexer/preflight.d.ts +154 -0
  106. package/dist/indexer/preflight.d.ts.map +1 -0
  107. package/dist/indexer/preflight.js +399 -0
  108. package/dist/indexer/preflight.js.map +1 -0
  109. package/dist/indexer/protoScanner.d.ts +34 -0
  110. package/dist/indexer/protoScanner.d.ts.map +1 -0
  111. package/dist/indexer/protoScanner.js +133 -0
  112. package/dist/indexer/protoScanner.js.map +1 -0
  113. package/dist/indexer/risk.d.ts +115 -0
  114. package/dist/indexer/risk.d.ts.map +1 -0
  115. package/dist/indexer/risk.js +194 -0
  116. package/dist/indexer/risk.js.map +1 -0
  117. package/dist/indexer/serviceHostScanner.d.ts +25 -0
  118. package/dist/indexer/serviceHostScanner.d.ts.map +1 -0
  119. package/dist/indexer/serviceHostScanner.js +95 -0
  120. package/dist/indexer/serviceHostScanner.js.map +1 -0
  121. package/dist/indexer/serviceLinks.d.ts +105 -0
  122. package/dist/indexer/serviceLinks.d.ts.map +1 -0
  123. package/dist/indexer/serviceLinks.js +509 -0
  124. package/dist/indexer/serviceLinks.js.map +1 -0
  125. package/dist/indexer/shapehash.d.ts +98 -0
  126. package/dist/indexer/shapehash.d.ts.map +1 -0
  127. package/dist/indexer/shapehash.js +354 -0
  128. package/dist/indexer/shapehash.js.map +1 -0
  129. package/dist/indexer/skeleton.d.ts +15 -0
  130. package/dist/indexer/skeleton.d.ts.map +1 -0
  131. package/dist/indexer/skeleton.js +136 -0
  132. package/dist/indexer/skeleton.js.map +1 -0
  133. package/dist/indexer/symbolhistory.d.ts +41 -0
  134. package/dist/indexer/symbolhistory.d.ts.map +1 -0
  135. package/dist/indexer/symbolhistory.js +124 -0
  136. package/dist/indexer/symbolhistory.js.map +1 -0
  137. package/dist/indexer/watcher.d.ts +68 -0
  138. package/dist/indexer/watcher.d.ts.map +1 -0
  139. package/dist/indexer/watcher.js +179 -0
  140. package/dist/indexer/watcher.js.map +1 -0
  141. package/dist/mcp/server.d.ts +80 -0
  142. package/dist/mcp/server.d.ts.map +1 -0
  143. package/dist/mcp/server.js +1610 -0
  144. package/dist/mcp/server.js.map +1 -0
  145. package/dist/parser/index.d.ts +8 -0
  146. package/dist/parser/index.d.ts.map +1 -0
  147. package/dist/parser/index.js +33 -0
  148. package/dist/parser/index.js.map +1 -0
  149. package/dist/parser/languages/cpp.d.ts +3 -0
  150. package/dist/parser/languages/cpp.d.ts.map +1 -0
  151. package/dist/parser/languages/cpp.js +350 -0
  152. package/dist/parser/languages/cpp.js.map +1 -0
  153. package/dist/parser/languages/csharp.d.ts +3 -0
  154. package/dist/parser/languages/csharp.d.ts.map +1 -0
  155. package/dist/parser/languages/csharp.js +239 -0
  156. package/dist/parser/languages/csharp.js.map +1 -0
  157. package/dist/parser/languages/go.d.ts +3 -0
  158. package/dist/parser/languages/go.d.ts.map +1 -0
  159. package/dist/parser/languages/go.js +259 -0
  160. package/dist/parser/languages/go.js.map +1 -0
  161. package/dist/parser/languages/java.d.ts +3 -0
  162. package/dist/parser/languages/java.d.ts.map +1 -0
  163. package/dist/parser/languages/java.js +391 -0
  164. package/dist/parser/languages/java.js.map +1 -0
  165. package/dist/parser/languages/python.d.ts +3 -0
  166. package/dist/parser/languages/python.d.ts.map +1 -0
  167. package/dist/parser/languages/python.js +396 -0
  168. package/dist/parser/languages/python.js.map +1 -0
  169. package/dist/parser/languages/rust.d.ts +3 -0
  170. package/dist/parser/languages/rust.d.ts.map +1 -0
  171. package/dist/parser/languages/rust.js +159 -0
  172. package/dist/parser/languages/rust.js.map +1 -0
  173. package/dist/parser/languages/typescript.d.ts +3 -0
  174. package/dist/parser/languages/typescript.d.ts.map +1 -0
  175. package/dist/parser/languages/typescript.js +1442 -0
  176. package/dist/parser/languages/typescript.js.map +1 -0
  177. package/dist/parser/parserContext.d.ts +77 -0
  178. package/dist/parser/parserContext.d.ts.map +1 -0
  179. package/dist/parser/parserContext.js +354 -0
  180. package/dist/parser/parserContext.js.map +1 -0
  181. package/dist/parser/walker.d.ts +81 -0
  182. package/dist/parser/walker.d.ts.map +1 -0
  183. package/dist/parser/walker.js +217 -0
  184. package/dist/parser/walker.js.map +1 -0
  185. package/dist/parser/worker.d.ts +66 -0
  186. package/dist/parser/worker.d.ts.map +1 -0
  187. package/dist/parser/worker.js +129 -0
  188. package/dist/parser/worker.js.map +1 -0
  189. package/dist/parser/workerpool.d.ts +107 -0
  190. package/dist/parser/workerpool.d.ts.map +1 -0
  191. package/dist/parser/workerpool.js +383 -0
  192. package/dist/parser/workerpool.js.map +1 -0
  193. package/dist/scip/format.d.ts +87 -0
  194. package/dist/scip/format.d.ts.map +1 -0
  195. package/dist/scip/format.js +31 -0
  196. package/dist/scip/format.js.map +1 -0
  197. package/dist/scip/import.d.ts +37 -0
  198. package/dist/scip/import.d.ts.map +1 -0
  199. package/dist/scip/import.js +180 -0
  200. package/dist/scip/import.js.map +1 -0
  201. package/dist/types.d.ts +392 -0
  202. package/dist/types.d.ts.map +1 -0
  203. package/dist/types.js +4 -0
  204. package/dist/types.js.map +1 -0
  205. package/docs/architecture.md +105 -0
  206. package/docs/benchmarks/methodology.md +134 -0
  207. package/docs/benchmarks/raw-results.md +71 -0
  208. package/docs/benchmarks.md +74 -0
  209. package/docs/cli.md +148 -0
  210. package/docs/examples/behavior-tests.md +70 -0
  211. package/docs/examples/change-history.md +85 -0
  212. package/docs/examples/pre-edit-context.md +81 -0
  213. package/docs/examples/service-links.md +88 -0
  214. package/docs/examples.md +80 -0
  215. package/docs/faq.md +70 -0
  216. package/docs/internals.md +104 -0
  217. package/docs/languages.md +70 -0
  218. package/docs/limits.md +52 -0
  219. package/docs/mcp.md +199 -0
  220. package/docs/quickstart.md +119 -0
  221. package/docs/testing.md +123 -0
  222. package/docs/tools.md +115 -0
  223. package/package.json +52 -0
  224. package/research-codebase.md +578 -0
  225. package/seer-cli-docs.md +326 -0
  226. package/seer-master-guide.md +246 -0
  227. package/src/bundle/ci.ts +141 -0
  228. package/src/bundle/contract.ts +387 -0
  229. package/src/bundle/export.ts +175 -0
  230. package/src/bundle/external.ts +285 -0
  231. package/src/bundle/format.ts +92 -0
  232. package/src/bundle/import.ts +157 -0
  233. package/src/cli/index.ts +1249 -0
  234. package/src/cli/init.ts +389 -0
  235. package/src/db/schema.ts +614 -0
  236. package/src/db/store.ts +4306 -0
  237. package/src/graph/pagerank.ts +53 -0
  238. package/src/indexer/architecture.ts +148 -0
  239. package/src/indexer/behavior.ts +466 -0
  240. package/src/indexer/boundaries.ts +374 -0
  241. package/src/indexer/churn.ts +58 -0
  242. package/src/indexer/classify.ts +96 -0
  243. package/src/indexer/context.ts +340 -0
  244. package/src/indexer/continuity.ts +322 -0
  245. package/src/indexer/detectchanges.ts +94 -0
  246. package/src/indexer/discovery.ts +176 -0
  247. package/src/indexer/externaldeps.ts +243 -0
  248. package/src/indexer/freshness.ts +166 -0
  249. package/src/indexer/git.ts +453 -0
  250. package/src/indexer/index.ts +1092 -0
  251. package/src/indexer/modules.ts +358 -0
  252. package/src/indexer/preflight.ts +548 -0
  253. package/src/indexer/protoScanner.ts +147 -0
  254. package/src/indexer/risk.ts +304 -0
  255. package/src/indexer/serviceHostScanner.ts +92 -0
  256. package/src/indexer/serviceLinks.ts +543 -0
  257. package/src/indexer/shapehash.ts +370 -0
  258. package/src/indexer/skeleton.ts +169 -0
  259. package/src/indexer/symbolhistory.ts +172 -0
  260. package/src/indexer/watcher.ts +206 -0
  261. package/src/mcp/server.ts +1659 -0
  262. package/src/parser/index.ts +37 -0
  263. package/src/parser/languages/cpp.ts +361 -0
  264. package/src/parser/languages/csharp.ts +235 -0
  265. package/src/parser/languages/go.ts +259 -0
  266. package/src/parser/languages/java.ts +382 -0
  267. package/src/parser/languages/python.ts +370 -0
  268. package/src/parser/languages/rust.ts +164 -0
  269. package/src/parser/languages/typescript.ts +1435 -0
  270. package/src/parser/parserContext.ts +392 -0
  271. package/src/parser/walker.ts +306 -0
  272. package/src/parser/worker.ts +181 -0
  273. package/src/parser/workerpool.ts +448 -0
  274. package/src/scip/format.ts +83 -0
  275. package/src/scip/import.ts +216 -0
  276. package/src/types.ts +457 -0
  277. package/tests/benchmark-service-links.ts +244 -0
  278. package/tests/bug-regressions.ts +626 -0
  279. package/tests/filters.ts +264 -0
  280. package/tests/fixtures/Counter.tsx +38 -0
  281. package/tests/fixtures/caller.ts +7 -0
  282. package/tests/fixtures/collisions.ts +23 -0
  283. package/tests/fixtures/local_helper.ts +5 -0
  284. package/tests/fixtures/overloads.java +17 -0
  285. package/tests/fixtures/remote_helper.ts +4 -0
  286. package/tests/fixtures/sample.c +15 -0
  287. package/tests/fixtures/sample.cpp +47 -0
  288. package/tests/fixtures/sample.cs +62 -0
  289. package/tests/fixtures/sample.go +68 -0
  290. package/tests/fixtures/sample.h +30 -0
  291. package/tests/fixtures/sample.java +85 -0
  292. package/tests/fixtures/sample.py +46 -0
  293. package/tests/fixtures/sample.rs +78 -0
  294. package/tests/fixtures/sample.ts +76 -0
  295. package/tests/fixtures-service/HttpClients.cs +30 -0
  296. package/tests/fixtures-service/HttpClients.java +24 -0
  297. package/tests/fixtures-service/billing.ts +15 -0
  298. package/tests/fixtures-service/docker-compose.yml +15 -0
  299. package/tests/fixtures-service/gateway.ts +10 -0
  300. package/tests/fixtures-service/get_user.ts +11 -0
  301. package/tests/fixtures-service/graphql_client.ts +63 -0
  302. package/tests/fixtures-service/graphql_server.ts +30 -0
  303. package/tests/fixtures-service/grpc_client.go +30 -0
  304. package/tests/fixtures-service/http_clients.go +23 -0
  305. package/tests/fixtures-service/http_clients.py +38 -0
  306. package/tests/fixtures-service/http_clients.ts +49 -0
  307. package/tests/fixtures-service/k8s/payment-service.yaml +22 -0
  308. package/tests/fixtures-service/k8s_calls.ts +20 -0
  309. package/tests/fixtures-service/messaging.ts +87 -0
  310. package/tests/fixtures-service/trpc_client.ts +39 -0
  311. package/tests/fixtures-service/trpc_server.ts +39 -0
  312. package/tests/fixtures-service/user_service.proto +33 -0
  313. package/tests/fixtures-trackcd/Cargo.toml +11 -0
  314. package/tests/fixtures-trackcd/SpringController.java +36 -0
  315. package/tests/fixtures-trackcd/auth_service.ts +19 -0
  316. package/tests/fixtures-trackcd/complex_module.py +50 -0
  317. package/tests/fixtures-trackcd/express_app.js +30 -0
  318. package/tests/fixtures-trackcd/fastapi_app.py +49 -0
  319. package/tests/fixtures-trackcd/fastify_object_routes.js +32 -0
  320. package/tests/fixtures-trackcd/go.mod +8 -0
  321. package/tests/fixtures-trackcd/package.json +15 -0
  322. package/tests/fixtures-trackcd/requirements.txt +4 -0
  323. package/tests/fixtures-trackcd/tests/auth_service.test.ts +13 -0
  324. package/tests/fixtures-tracke/auth/AuthService.ts +23 -0
  325. package/tests/fixtures-tracke/auth/crypto.ts +7 -0
  326. package/tests/fixtures-tracke/billing/Billing.ts +20 -0
  327. package/tests/fixtures-tracke/billing/Invoice.ts +10 -0
  328. package/tests/fixtures-tracke/billing/server.ts +17 -0
  329. package/tests/fixtures-tracke/package.json +7 -0
  330. package/tests/fixtures-tracke/tests/auth.test.ts +23 -0
  331. package/tests/fixtures-tracke/tests/billing.test.ts +14 -0
  332. package/tests/fixtures-trackf/package.json +5 -0
  333. package/tests/fixtures-trackf/src/auth.ts +26 -0
  334. package/tests/fixtures-trackf/src/handlers.ts +35 -0
  335. package/tests/fixtures-tracki/billing/routes.ts +12 -0
  336. package/tests/fixtures-tracki/gateway/client.ts +13 -0
  337. package/tests/git-features.ts +267 -0
  338. package/tests/init.ts +141 -0
  339. package/tests/mcp-jit.ts +130 -0
  340. package/tests/mcp-smoke.ts +191 -0
  341. package/tests/mcp-trackcd.ts +169 -0
  342. package/tests/mcp-tracke.ts +229 -0
  343. package/tests/mcp-trackf.ts +330 -0
  344. package/tests/mcp-trackg.ts +219 -0
  345. package/tests/mcp-tracki.ts +174 -0
  346. package/tests/mcp-watcher.ts +126 -0
  347. package/tests/optspec.ts +194 -0
  348. package/tests/parallel-index.ts +333 -0
  349. package/tests/parallel-read.ts +125 -0
  350. package/tests/parallel-recovery.ts +241 -0
  351. package/tests/perf-callers.ts +145 -0
  352. package/tests/query-parity.ts +184 -0
  353. package/tests/query-perf.ts +55 -0
  354. package/tests/scale-parallel-parity.ts +225 -0
  355. package/tests/scale-test.ts +523 -0
  356. package/tests/smoke.ts +396 -0
  357. package/tests/trackcd.ts +325 -0
  358. package/tests/tracke-collisions.ts +255 -0
  359. package/tests/tracke.ts +314 -0
  360. package/tests/trackf-bugs.ts +406 -0
  361. package/tests/trackf.ts +390 -0
  362. package/tests/trackg.ts +1372 -0
  363. package/tests/tracki-boundaries.ts +202 -0
  364. package/tests/tracki-continuity.ts +253 -0
  365. package/tests/tracki-contract-diff.ts +249 -0
  366. package/tests/tracki-external-bundles.ts +341 -0
  367. package/tests/tracki-preflight.ts +251 -0
  368. package/tests/verify-roles.ts +51 -0
  369. package/tests/worker-parity.ts +286 -0
  370. package/tests/worker-pool.ts +262 -0
  371. package/tsconfig.json +20 -0
@@ -0,0 +1,46 @@
1
+ """Sample Python fixture for Seer smoke tests."""
2
+
3
+
4
+ class PaymentService:
5
+ """Handles payment processing."""
6
+
7
+ def __init__(self, gateway):
8
+ self.gateway = gateway
9
+
10
+ def process_payment(self, amount: float, currency: str) -> bool:
11
+ if not validate_amount(amount):
12
+ return False
13
+ charge = self.charge_card(amount, currency)
14
+ return charge is not None
15
+
16
+ def charge_card(self, amount: float, currency: str):
17
+ return self.gateway.charge(amount, currency)
18
+
19
+ def refund(self, transaction_id: str) -> bool:
20
+ return self.gateway.refund(transaction_id)
21
+
22
+
23
+ class OrderService:
24
+ """Manages order lifecycle."""
25
+
26
+ def __init__(self, payment_service: PaymentService):
27
+ self.payment = payment_service
28
+
29
+ def place_order(self, cart, user):
30
+ total = calculate_total(cart)
31
+ ok = self.payment.process_payment(total, "USD")
32
+ if ok:
33
+ notify_user(user, "Order placed!")
34
+ return ok
35
+
36
+
37
+ def validate_amount(amount: float) -> bool:
38
+ return isinstance(amount, (int, float)) and amount > 0
39
+
40
+
41
+ def calculate_total(cart) -> float:
42
+ return sum(item.price * item.quantity for item in cart.items)
43
+
44
+
45
+ def notify_user(user, message: str) -> None:
46
+ print(f"Notify {user.email}: {message}")
@@ -0,0 +1,78 @@
1
+ // Sample Rust fixture for Seer smoke tests
2
+ use std::collections::HashMap;
3
+
4
+ pub trait Repository<T> {
5
+ fn find_by_id(&self, id: &str) -> Option<T>;
6
+ fn save(&mut self, item: T) -> Result<(), String>;
7
+ }
8
+
9
+ pub struct InMemoryUserStore {
10
+ data: HashMap<String, User>,
11
+ }
12
+
13
+ impl InMemoryUserStore {
14
+ pub fn new() -> Self {
15
+ InMemoryUserStore {
16
+ data: HashMap::new(),
17
+ }
18
+ }
19
+ }
20
+
21
+ impl Repository<User> for InMemoryUserStore {
22
+ fn find_by_id(&self, id: &str) -> Option<User> {
23
+ self.data.get(id).cloned()
24
+ }
25
+
26
+ fn save(&mut self, user: User) -> Result<(), String> {
27
+ self.data.insert(user.id.clone(), user);
28
+ Ok(())
29
+ }
30
+ }
31
+
32
+ #[derive(Clone, Debug)]
33
+ pub struct User {
34
+ pub id: String,
35
+ pub email: String,
36
+ pub name: String,
37
+ }
38
+
39
+ pub struct AuthService {
40
+ users: InMemoryUserStore,
41
+ sessions: HashMap<String, String>,
42
+ }
43
+
44
+ impl AuthService {
45
+ pub fn new(users: InMemoryUserStore) -> Self {
46
+ AuthService {
47
+ users,
48
+ sessions: HashMap::new(),
49
+ }
50
+ }
51
+
52
+ pub fn login(&mut self, email: &str, password: &str) -> Option<String> {
53
+ let user = find_user_by_email(&self.users, email)?;
54
+ if verify_password(password, &user.id) {
55
+ let token = generate_token(&user.id);
56
+ self.sessions.insert(token.clone(), user.id.clone());
57
+ Some(token)
58
+ } else {
59
+ None
60
+ }
61
+ }
62
+
63
+ pub fn logout(&mut self, token: &str) {
64
+ self.sessions.remove(token);
65
+ }
66
+ }
67
+
68
+ fn find_user_by_email(store: &InMemoryUserStore, email: &str) -> Option<User> {
69
+ store.data.values().find(|u| u.email == email).cloned()
70
+ }
71
+
72
+ fn verify_password(password: &str, _user_id: &str) -> bool {
73
+ !password.is_empty()
74
+ }
75
+
76
+ fn generate_token(user_id: &str) -> String {
77
+ format!("tok-{}-{}", user_id, 42)
78
+ }
@@ -0,0 +1,76 @@
1
+ // Sample TypeScript fixture for Seer smoke tests
2
+
3
+ interface User {
4
+ id: string;
5
+ email: string;
6
+ name: string;
7
+ }
8
+
9
+ interface Cart {
10
+ items: Array<{ productId: string; quantity: number; price: number }>;
11
+ }
12
+
13
+ class AuthService {
14
+ private tokenStore: Map<string, string>;
15
+
16
+ constructor() {
17
+ this.tokenStore = new Map();
18
+ }
19
+
20
+ authenticate(email: string, password: string): string | null {
21
+ const hash = hashPassword(password);
22
+ const userId = lookupUser(email, hash);
23
+ if (!userId) return null;
24
+ const token = generateToken(userId);
25
+ this.tokenStore.set(token, userId);
26
+ return token;
27
+ }
28
+
29
+ validateToken(token: string): string | null {
30
+ return this.tokenStore.get(token) ?? null;
31
+ }
32
+
33
+ logout(token: string): void {
34
+ this.tokenStore.delete(token);
35
+ }
36
+ }
37
+
38
+ class CartService {
39
+ addItem(cart: Cart, productId: string, qty: number): Cart {
40
+ const price = fetchPrice(productId);
41
+ const existing = cart.items.find(i => i.productId === productId);
42
+ if (existing) {
43
+ existing.quantity += qty;
44
+ } else {
45
+ cart.items.push({ productId, quantity: qty, price });
46
+ }
47
+ return cart;
48
+ }
49
+
50
+ totalPrice(cart: Cart): number {
51
+ return cart.items.reduce((sum, i) => sum + i.price * i.quantity, 0);
52
+ }
53
+ }
54
+
55
+ function hashPassword(password: string): string {
56
+ return Buffer.from(password).toString('base64');
57
+ }
58
+
59
+ function lookupUser(email: string, hash: string): string | null {
60
+ // stub — would query DB
61
+ return `user-${email}`;
62
+ }
63
+
64
+ function generateToken(userId: string): string {
65
+ return `tok-${userId}-${Date.now()}`;
66
+ }
67
+
68
+ function fetchPrice(productId: string): number {
69
+ return 9.99; // stub
70
+ }
71
+
72
+ // Exercises `new X()` extraction — must be tracked as a call edge from
73
+ // createAuthService → AuthService (constructor).
74
+ function createAuthService(): AuthService {
75
+ return new AuthService();
76
+ }
@@ -0,0 +1,30 @@
1
+ using System.Net.Http;
2
+ using System.Threading.Tasks;
3
+
4
+ namespace Svc
5
+ {
6
+ public class HttpClients
7
+ {
8
+ private readonly HttpClient _http;
9
+
10
+ public HttpClients(HttpClient http) { _http = http; }
11
+
12
+ // GetAsync — GET /api/users via HttpClient.
13
+ public Task<HttpResponseMessage> ListUsersAsync()
14
+ {
15
+ return _http.GetAsync("/api/users");
16
+ }
17
+
18
+ // PostAsJsonAsync — POST /api/orders via HttpClient.
19
+ public Task<HttpResponseMessage> CreateOrderAsync(object body)
20
+ {
21
+ return _http.PostAsJsonAsync("/api/orders", body);
22
+ }
23
+
24
+ // DeleteAsync with absolute URL.
25
+ public Task<HttpResponseMessage> DeleteSessionAsync()
26
+ {
27
+ return _http.DeleteAsync("https://auth/api/session");
28
+ }
29
+ }
30
+ }
@@ -0,0 +1,24 @@
1
+ package svc;
2
+
3
+ import java.net.URI;
4
+ import java.net.http.HttpRequest;
5
+ import org.springframework.web.client.RestTemplate;
6
+
7
+ public class HttpClients {
8
+ private final RestTemplate restTemplate = new RestTemplate();
9
+
10
+ // RestTemplate getForObject — should record GET /api/users via spring-rest.
11
+ public String listUsers() {
12
+ return restTemplate.getForObject("/api/users", String.class);
13
+ }
14
+
15
+ // postForObject — POST /api/orders via spring-rest.
16
+ public String createOrder(Object body) {
17
+ return restTemplate.postForObject("/api/orders", body, String.class);
18
+ }
19
+
20
+ // java.net.http HttpRequest.newBuilder(URI.create("..."))
21
+ public HttpRequest buildPing() {
22
+ return HttpRequest.newBuilder(URI.create("https://payment-service/api/ping")).build();
23
+ }
24
+ }
@@ -0,0 +1,15 @@
1
+ // Track G — handler side of the rendezvous. Registers /api/charge.
2
+
3
+ declare const app: any;
4
+
5
+ export function chargeHandler(req: any, res: any): unknown {
6
+ return res.send({ charged: true });
7
+ }
8
+
9
+ app.post('/api/charge', chargeHandler);
10
+
11
+ // And a parameterised route for /users/:id
12
+ export function getUser(req: any, res: any): unknown {
13
+ return res.send({ id: req.params.id });
14
+ }
15
+ app.get('/users/:id', getUser);
@@ -0,0 +1,15 @@
1
+ version: '3.8'
2
+
3
+ services:
4
+ notifier:
5
+ image: notifier:latest
6
+ ports:
7
+ - 8080:8080
8
+ legacy-api:
9
+ image: legacy:latest
10
+ ports:
11
+ - 9000:9000
12
+ payment-service:
13
+ image: payment:latest
14
+ ports:
15
+ - 7000:7000
@@ -0,0 +1,10 @@
1
+ // Track G — caller side of the rendezvous. Calls /api/charge via fetch.
2
+
3
+ declare const fetch: any;
4
+
5
+ export async function processPayment(amount: number): Promise<unknown> {
6
+ return await fetch('/api/charge', {
7
+ method: 'POST',
8
+ body: JSON.stringify({ amount }),
9
+ });
10
+ }
@@ -0,0 +1,11 @@
1
+ // Track G — caller side that needs route_pattern match (/users/123 → /users/:id).
2
+
3
+ declare const fetch: any;
4
+
5
+ export async function loadUser(id: number): Promise<unknown> {
6
+ return await fetch('/users/' + 123); // not really dynamic; literal-ish
7
+ }
8
+
9
+ export async function loadUserLiteral(): Promise<unknown> {
10
+ return await fetch('/users/123');
11
+ }
@@ -0,0 +1,63 @@
1
+ // Fixture: GraphQL client calls — Apollo client + React hooks + gql tagged
2
+ // template literals.
3
+
4
+ declare const client: any;
5
+ declare const apolloClient: any;
6
+ declare function gql(strings: TemplateStringsArray): any;
7
+ declare function useQuery(doc: any, opts?: any): unknown;
8
+ declare function useMutation(doc: any, opts?: any): unknown;
9
+
10
+ // Inline gql tag — operation field = "user", op name = "GetUser".
11
+ const GET_USER = gql`
12
+ query GetUser($id: ID!) {
13
+ user(id: $id) {
14
+ id
15
+ name
16
+ }
17
+ }
18
+ `;
19
+
20
+ const CREATE_USER = gql`
21
+ mutation CreateUser($name: String!) {
22
+ createUser(name: $name) {
23
+ id
24
+ }
25
+ }
26
+ `;
27
+
28
+ const ON_USER_CREATED = gql`
29
+ subscription OnUserCreated {
30
+ onUserCreated {
31
+ id
32
+ }
33
+ }
34
+ `;
35
+
36
+ export async function fetchUser(id: string): Promise<unknown> {
37
+ // operation lifted from GET_USER document — should resolve to field "user"
38
+ return client.query({ query: GET_USER, variables: { id } });
39
+ }
40
+
41
+ export async function createUserViaApollo(name: string): Promise<unknown> {
42
+ return apolloClient.mutate({ mutation: CREATE_USER, variables: { name } });
43
+ }
44
+
45
+ export function useUserHook(id: string): unknown {
46
+ // useQuery hook with inline gql tag — operation = field "users"
47
+ return useQuery(gql`
48
+ query ListAllUsers {
49
+ users {
50
+ id
51
+ name
52
+ }
53
+ }
54
+ `);
55
+ }
56
+
57
+ export function useCreateUserHook(): unknown {
58
+ return useMutation(CREATE_USER);
59
+ }
60
+
61
+ export function useOnUserCreated(): unknown {
62
+ return useQuery(ON_USER_CREATED);
63
+ }
@@ -0,0 +1,30 @@
1
+ // Fixture: Apollo-style resolver map. Each resolver field becomes a route
2
+ // with operation = field name.
3
+
4
+ import { db } from './_helpers';
5
+
6
+ export function userResolver(_: unknown, args: { id: string }): unknown {
7
+ return db.users.find(args.id);
8
+ }
9
+
10
+ export function createUserResolver(_: unknown, args: { name: string }): unknown {
11
+ return db.users.create(args.name);
12
+ }
13
+
14
+ export function onUserCreatedResolver(): AsyncIterableIterator<unknown> {
15
+ return db.users.subscribe();
16
+ }
17
+
18
+ export const resolvers = {
19
+ Query: {
20
+ user: userResolver,
21
+ users: () => db.users.list(),
22
+ },
23
+ Mutation: {
24
+ createUser: createUserResolver,
25
+ deleteUser: (_: unknown, args: { id: string }) => db.users.remove(args.id),
26
+ },
27
+ Subscription: {
28
+ onUserCreated: onUserCreatedResolver,
29
+ },
30
+ };
@@ -0,0 +1,30 @@
1
+ // Fixture: Go gRPC client stub calls.
2
+ package fixtures
3
+
4
+ import (
5
+ "context"
6
+ pb "example.com/proto"
7
+ )
8
+
9
+ // GetUserViaGrpc creates a UserServiceClient and calls GetUser.
10
+ // Operation = "UserService/GetUser".
11
+ func GetUserViaGrpc(ctx context.Context, conn pb.Conn, id string) (*pb.GetUserResponse, error) {
12
+ return pb.NewUserServiceClient(conn).GetUser(ctx, &pb.GetUserRequest{Id: id})
13
+ }
14
+
15
+ // CreateUserViaGrpc — Operation = "UserService/CreateUser".
16
+ func CreateUserViaGrpc(ctx context.Context, conn pb.Conn, name string) (*pb.CreateUserResponse, error) {
17
+ return pb.NewUserServiceClient(conn).CreateUser(ctx, &pb.CreateUserRequest{Name: name})
18
+ }
19
+
20
+ // LoginViaGrpc — operation = "AuthService/Login".
21
+ func LoginViaGrpc(ctx context.Context, conn pb.Conn, u, p string) (*pb.LoginResponse, error) {
22
+ return pb.NewAuthServiceClient(conn).Login(ctx, &pb.LoginRequest{Username: u, Password: p})
23
+ }
24
+
25
+ // CallUnknown — an unresolved gRPC method (NoSuchMethod doesn't exist in our
26
+ // .proto). The call should be recorded as a service_call but NOT produce a
27
+ // service_link.
28
+ func CallUnknown(ctx context.Context, conn pb.Conn) (interface{}, error) {
29
+ return pb.NewUserServiceClient(conn).NoSuchMethod(ctx, &pb.GetUserRequest{})
30
+ }
@@ -0,0 +1,23 @@
1
+ package svc
2
+
3
+ import "net/http"
4
+
5
+ // http.Get — should record GET /api/users via framework=http.
6
+ func ListUsers() (*http.Response, error) {
7
+ return http.Get("/api/users")
8
+ }
9
+
10
+ // http.Post — POST /api/users via framework=http.
11
+ func CreateUser(body interface{}) (*http.Response, error) {
12
+ return http.Post("/api/users", "application/json", nil)
13
+ }
14
+
15
+ // client.Get — generic http-client framework.
16
+ func FetchOrders(client *http.Client) (*http.Response, error) {
17
+ return client.Get("/api/orders")
18
+ }
19
+
20
+ // http.NewRequest("POST", ...) — method derived from first string arg.
21
+ func MakeRequest() (*http.Request, error) {
22
+ return http.NewRequest("POST", "/api/items", nil)
23
+ }
@@ -0,0 +1,38 @@
1
+ # Track G fixtures — HTTP client call sites in Python.
2
+ import os
3
+ import requests
4
+ import httpx
5
+
6
+
7
+ def list_users():
8
+ """requests.get('/health') — must yield framework=requests, method=GET."""
9
+ return requests.get("/health")
10
+
11
+
12
+ def create_user(payload):
13
+ """requests.post('/api/users') — POST method."""
14
+ return requests.post("/api/users", json=payload)
15
+
16
+
17
+ def fetch_orders():
18
+ """httpx.get('/api/orders') — framework=httpx, method=GET."""
19
+ return httpx.get("/api/orders")
20
+
21
+
22
+ class CartService:
23
+ def __init__(self, client):
24
+ self.client = client
25
+
26
+ def add_item(self, item):
27
+ """client.post('/api/cart/items', json=item) — generic http-client."""
28
+ return self.client.post("/api/cart/items", json=item)
29
+
30
+
31
+ def charge_customer(amount):
32
+ """os.environ['PAYMENT_URL'] + '/charge' — recover envKey=PAYMENT_URL + /charge."""
33
+ return requests.post(os.environ["PAYMENT_URL"] + "/charge", json={"amount": amount})
34
+
35
+
36
+ def dynamic_url(url):
37
+ """No literal path — must NOT be recorded."""
38
+ return requests.get(url)
@@ -0,0 +1,49 @@
1
+ // Track G fixtures — HTTP client call sites in TypeScript/JavaScript.
2
+ //
3
+ // This file is consumed by tests/trackg.ts (Step 3 onward) to verify that
4
+ // the TypeScript extractor records ServiceCallDef rows for fetch/axios/etc.
5
+
6
+ declare const fetch: any;
7
+ declare const axios: any;
8
+ declare const apiClient: any;
9
+ declare const process: any;
10
+
11
+ // Simple fetch — should yield { protocol: 'http', framework: 'fetch',
12
+ // method: 'ANY', rawTarget: '/api/users', normalizedPath: '/api/users' }.
13
+ export async function listUsers(): Promise<unknown> {
14
+ return await fetch('/api/users');
15
+ }
16
+
17
+ // fetch with explicit method via options object — method = POST.
18
+ export async function createUser(body: unknown): Promise<unknown> {
19
+ return await fetch('/api/users', { method: 'POST', body: JSON.stringify(body) });
20
+ }
21
+
22
+ // axios.<verb> shorthand — method derived from the verb. Caller attribution
23
+ // must be `checkout`, not module scope.
24
+ export async function checkout(): Promise<unknown> {
25
+ return await axios.post('/checkout', { ok: true });
26
+ }
27
+
28
+ // Generic client.<method>(literalUrl) — should yield framework 'http-client'.
29
+ export function fetchOrders(): unknown {
30
+ return apiClient.get('/api/orders');
31
+ }
32
+
33
+ // Template literal with env var — recovers /charge AND envKey PAYMENT_URL.
34
+ export async function chargeCustomer(amount: number): Promise<unknown> {
35
+ return await fetch(`${process.env.PAYMENT_URL}/charge`, {
36
+ method: 'POST',
37
+ body: JSON.stringify({ amount }),
38
+ });
39
+ }
40
+
41
+ // Dynamic URL with no literal path — should NOT be recorded.
42
+ export async function dynamicUrl(u: string): Promise<unknown> {
43
+ return await fetch(u);
44
+ }
45
+
46
+ // Non-HTTP `.get` (e.g. cache lookup) — first arg is not a string, so dropped.
47
+ export function readCache(key: string): unknown {
48
+ return apiClient.get(key);
49
+ }
@@ -0,0 +1,22 @@
1
+ apiVersion: v1
2
+ kind: Service
3
+ metadata:
4
+ name: payment-service
5
+ namespace: payments
6
+ spec:
7
+ selector:
8
+ app: payment
9
+ ports:
10
+ - port: 80
11
+ targetPort: 8080
12
+ ---
13
+ apiVersion: v1
14
+ kind: Service
15
+ metadata:
16
+ name: billing-service
17
+ spec:
18
+ selector:
19
+ app: billing
20
+ ports:
21
+ - port: 80
22
+ targetPort: 9090
@@ -0,0 +1,20 @@
1
+ // Fixture: HTTP calls that target k8s/Docker-declared service hostnames.
2
+ // The resolver should classify these as match_kind='service_host' when both
3
+ // the host AND the path match a route in the workspace.
4
+
5
+ export async function paymentCall(): Promise<unknown> {
6
+ // payment-service is declared in k8s/payment-service.yaml AND in
7
+ // docker-compose.yml. /api/charge is registered in billing.ts.
8
+ return fetch('http://payment-service/api/charge', { method: 'POST' });
9
+ }
10
+
11
+ export async function unknownHostCall(): Promise<unknown> {
12
+ // No matching k8s/Docker host; falls back to a literal_path link.
13
+ return fetch('http://random-unknown-host/api/charge', { method: 'POST' });
14
+ }
15
+
16
+ export async function hostOnlyCall(): Promise<unknown> {
17
+ // Host is known but path doesn't exist in any workspace route → must NOT
18
+ // link via service_host alone (host alone is not enough evidence).
19
+ return fetch('http://notifier/no-such-path', { method: 'GET' });
20
+ }
@@ -0,0 +1,87 @@
1
+ // Fixture: Messaging producers and consumers across Kafka / SQS / SNS /
2
+ // RabbitMQ / NATS / Redis pub-sub. The resolver should rendezvous each
3
+ // producer with its matching consumer by topic / queue.
4
+
5
+ declare const producer: any;
6
+ declare const consumer: any;
7
+ declare const sqs: any;
8
+ declare const sns: any;
9
+ declare const channel: any;
10
+ declare const nc: any;
11
+ declare const redis: any;
12
+
13
+ // ── Kafka ────────────────────────────────────────────────────────────────────
14
+ export async function produceOrders(): Promise<void> {
15
+ await producer.send({ topic: 'orders', messages: [{ value: 'x' }] });
16
+ }
17
+
18
+ export async function produceShipments(): Promise<void> {
19
+ await producer.send({ topic: 'shipments', messages: [{ value: 'y' }] });
20
+ }
21
+
22
+ export function handleOrder(message: unknown): void { void message; }
23
+
24
+ export async function subscribeOrders(): Promise<void> {
25
+ // Single-topic subscribe.
26
+ await consumer.subscribe({ topic: 'orders' });
27
+ consumer.run({ eachMessage: handleOrder });
28
+ }
29
+
30
+ export async function subscribeMulti(): Promise<void> {
31
+ await consumer.subscribe({ topics: ['shipments', 'invoices'] });
32
+ }
33
+
34
+ // ── SQS ──────────────────────────────────────────────────────────────────────
35
+ export async function enqueueJob(): Promise<void> {
36
+ await sqs.sendMessage({
37
+ QueueUrl: 'https://sqs.us-east-1.amazonaws.com/123456789012/job-queue',
38
+ MessageBody: '{}',
39
+ });
40
+ }
41
+
42
+ export async function consumeJob(): Promise<void> {
43
+ await sqs.receiveMessage({
44
+ QueueUrl: 'https://sqs.us-east-1.amazonaws.com/123456789012/job-queue',
45
+ });
46
+ }
47
+
48
+ // ── SNS ──────────────────────────────────────────────────────────────────────
49
+ export async function notifySubscribers(): Promise<void> {
50
+ await sns.publish({
51
+ TopicArn: 'arn:aws:sns:us-east-1:123456789012:user-events',
52
+ Message: 'created',
53
+ });
54
+ }
55
+
56
+ // ── RabbitMQ ─────────────────────────────────────────────────────────────────
57
+ export function publishEvent(): void {
58
+ channel.publish('events', 'user.created', Buffer.from('{}'));
59
+ }
60
+
61
+ export function pushToQ(): void {
62
+ channel.sendToQueue('mailer-queue', Buffer.from('{}'));
63
+ }
64
+
65
+ export function rabbitHandler(message: unknown): void { void message; }
66
+
67
+ export function subscribeMailer(): void {
68
+ channel.consume('mailer-queue', rabbitHandler);
69
+ }
70
+
71
+ // ── NATS ─────────────────────────────────────────────────────────────────────
72
+ export async function natsPublish(): Promise<void> {
73
+ await nc.publish('user.created', Buffer.from('{}'));
74
+ }
75
+
76
+ export async function natsSubscribe(): Promise<void> {
77
+ await nc.subscribe('user.created');
78
+ }
79
+
80
+ // ── Redis pub-sub ────────────────────────────────────────────────────────────
81
+ export function redisPub(): void {
82
+ redis.publish('chan:notifications', 'hello');
83
+ }
84
+
85
+ export function redisSub(): void {
86
+ redis.subscribe('chan:notifications');
87
+ }