weavatrix 0.3.13 → 1.0.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 (303) hide show
  1. package/LICENSE +1 -0
  2. package/README.md +231 -199
  3. package/bin/native/darwin-arm64/weavatrix +0 -0
  4. package/bin/native/darwin-x64/weavatrix +0 -0
  5. package/bin/native/linux-arm64/weavatrix +0 -0
  6. package/bin/native/linux-x64/weavatrix +0 -0
  7. package/bin/native/win32-arm64/weavatrix.exe +0 -0
  8. package/bin/native/win32-x64/weavatrix.exe +0 -0
  9. package/bin/resolve-binary.mjs +73 -0
  10. package/bin/run-native.mjs +26 -0
  11. package/bin/weavatrix-mcp.mjs +7 -6
  12. package/bin/weavatrix.mjs +5 -0
  13. package/package.json +8 -65
  14. package/skill/SKILL.md +62 -374
  15. package/skill/agents/openai.yaml +4 -0
  16. package/skill/references/tool-routing.md +45 -0
  17. package/SECURITY.md +0 -101
  18. package/docs/adr/0001-v0.3-offline-online-split.md +0 -60
  19. package/docs/agent-task-benchmark.md +0 -58
  20. package/docs/releases/v0.2.19.md +0 -33
  21. package/docs/releases/v0.3.0.md +0 -43
  22. package/docs/releases/v0.3.1.md +0 -30
  23. package/docs/releases/v0.3.10.md +0 -76
  24. package/docs/releases/v0.3.11.md +0 -55
  25. package/docs/releases/v0.3.12.md +0 -44
  26. package/docs/releases/v0.3.13.md +0 -34
  27. package/docs/releases/v0.3.2.md +0 -15
  28. package/docs/releases/v0.3.3.md +0 -25
  29. package/docs/releases/v0.3.4.md +0 -40
  30. package/docs/releases/v0.3.5.md +0 -50
  31. package/docs/releases/v0.3.6.md +0 -44
  32. package/docs/releases/v0.3.7.md +0 -37
  33. package/docs/releases/v0.3.8.md +0 -21
  34. package/docs/releases/v0.3.9.md +0 -36
  35. package/scripts/run-agent-task-benchmark.mjs +0 -118
  36. package/src/analysis/allowed-test-runner.js +0 -70
  37. package/src/analysis/architecture/contract-graph.js +0 -119
  38. package/src/analysis/architecture/contract-schema.js +0 -110
  39. package/src/analysis/architecture/contract-storage.js +0 -35
  40. package/src/analysis/architecture/contract-verification.js +0 -168
  41. package/src/analysis/architecture-contract.js +0 -16
  42. package/src/analysis/audit-debt.js +0 -94
  43. package/src/analysis/audit-extensions.js +0 -60
  44. package/src/analysis/cargo-dependency-evidence.js +0 -108
  45. package/src/analysis/cargo-manifests.js +0 -81
  46. package/src/analysis/change-classification/diff-parser.js +0 -103
  47. package/src/analysis/change-classification/options.js +0 -40
  48. package/src/analysis/change-classification/symbol-classifier.js +0 -177
  49. package/src/analysis/change-classification.js +0 -188
  50. package/src/analysis/coverage-reports.js +0 -235
  51. package/src/analysis/cycle-route.js +0 -14
  52. package/src/analysis/data-flow-evidence.js +0 -114
  53. package/src/analysis/dead-check.js +0 -300
  54. package/src/analysis/dead-code-review/candidates.js +0 -194
  55. package/src/analysis/dead-code-review/policy.js +0 -23
  56. package/src/analysis/dead-code-review.js +0 -119
  57. package/src/analysis/dep-check-ecosystems.js +0 -205
  58. package/src/analysis/dep-check.js +0 -290
  59. package/src/analysis/dep-rules.js +0 -10
  60. package/src/analysis/dependency/conventions.js +0 -16
  61. package/src/analysis/dependency/scoped-dependencies.js +0 -51
  62. package/src/analysis/dependency/source-references.js +0 -21
  63. package/src/analysis/duplicate-groups.js +0 -104
  64. package/src/analysis/duplicates-worker.js +0 -11
  65. package/src/analysis/duplicates.compute.js +0 -269
  66. package/src/analysis/duplicates.js +0 -15
  67. package/src/analysis/duplicates.run.js +0 -52
  68. package/src/analysis/duplicates.tokenize.js +0 -199
  69. package/src/analysis/endpoints/common.js +0 -62
  70. package/src/analysis/endpoints/extract.js +0 -107
  71. package/src/analysis/endpoints/inventory.js +0 -84
  72. package/src/analysis/endpoints/mounts.js +0 -129
  73. package/src/analysis/endpoints-java.js +0 -260
  74. package/src/analysis/endpoints-rust.js +0 -124
  75. package/src/analysis/endpoints.js +0 -3
  76. package/src/analysis/findings.js +0 -70
  77. package/src/analysis/git-history/analytics.js +0 -177
  78. package/src/analysis/git-history/collector.js +0 -67
  79. package/src/analysis/git-history/options.js +0 -66
  80. package/src/analysis/git-history.js +0 -143
  81. package/src/analysis/git-ref-graph.js +0 -76
  82. package/src/analysis/go-dependency-evidence.js +0 -62
  83. package/src/analysis/graph-analysis.aggregate.js +0 -295
  84. package/src/analysis/graph-analysis.edges.js +0 -24
  85. package/src/analysis/graph-analysis.js +0 -7
  86. package/src/analysis/graph-analysis.refs.js +0 -154
  87. package/src/analysis/graph-analysis.summaries.js +0 -65
  88. package/src/analysis/health-capabilities.js +0 -83
  89. package/src/analysis/hot-path-review.js +0 -266
  90. package/src/analysis/http-contract-wrappers.js +0 -241
  91. package/src/analysis/http-contracts/analysis.js +0 -179
  92. package/src/analysis/http-contracts/client-call-detection.js +0 -82
  93. package/src/analysis/http-contracts/client-call-parser.js +0 -273
  94. package/src/analysis/http-contracts/graph-context.js +0 -143
  95. package/src/analysis/http-contracts/matching.js +0 -61
  96. package/src/analysis/http-contracts/shared.js +0 -85
  97. package/src/analysis/http-contracts.js +0 -6
  98. package/src/analysis/internal-audit/dependency-health.js +0 -113
  99. package/src/analysis/internal-audit/python-manifests.js +0 -78
  100. package/src/analysis/internal-audit/repo-files.js +0 -50
  101. package/src/analysis/internal-audit/supply-chain.js +0 -149
  102. package/src/analysis/internal-audit.collect.js +0 -213
  103. package/src/analysis/internal-audit.js +0 -9
  104. package/src/analysis/internal-audit.reach.js +0 -173
  105. package/src/analysis/internal-audit.run.js +0 -256
  106. package/src/analysis/java-source.js +0 -36
  107. package/src/analysis/jvm-artifact-index.js +0 -87
  108. package/src/analysis/jvm-dependency-evidence.js +0 -138
  109. package/src/analysis/jvm-manifests.js +0 -114
  110. package/src/analysis/manifests.js +0 -123
  111. package/src/analysis/package-reachability.js +0 -39
  112. package/src/analysis/source-complexity.ast.js +0 -97
  113. package/src/analysis/source-complexity.constants.js +0 -55
  114. package/src/analysis/source-complexity.js +0 -14
  115. package/src/analysis/source-complexity.report.js +0 -81
  116. package/src/analysis/source-complexity.walk.js +0 -228
  117. package/src/analysis/source-correctness/retry-patterns.js +0 -93
  118. package/src/analysis/source-correctness.js +0 -222
  119. package/src/analysis/static-test-reachability.js +0 -150
  120. package/src/analysis/structure/dependency-graph.js +0 -151
  121. package/src/analysis/structure/findings.js +0 -162
  122. package/src/analysis/task-retrieval.js +0 -107
  123. package/src/analysis/transport-contracts.js +0 -224
  124. package/src/analysis/transport-runtime-evidence.js +0 -155
  125. package/src/analysis-kit.mjs +0 -17
  126. package/src/bounds.js +0 -4
  127. package/src/build-graph.js +0 -209
  128. package/src/child-env.js +0 -7
  129. package/src/config.js +0 -5
  130. package/src/extension/local-services.mjs +0 -75
  131. package/src/git-exec.js +0 -67
  132. package/src/graph/build-worker.js +0 -49
  133. package/src/graph/builder/go-receiver-resolution.js +0 -112
  134. package/src/graph/builder/js/dynamic-import.js +0 -26
  135. package/src/graph/builder/js/queries.js +0 -48
  136. package/src/graph/builder/lang-csharp.js +0 -40
  137. package/src/graph/builder/lang-css.js +0 -29
  138. package/src/graph/builder/lang-go.js +0 -140
  139. package/src/graph/builder/lang-html.js +0 -29
  140. package/src/graph/builder/lang-java-calls.js +0 -142
  141. package/src/graph/builder/lang-java.js +0 -215
  142. package/src/graph/builder/lang-js.js +0 -291
  143. package/src/graph/builder/lang-python.js +0 -235
  144. package/src/graph/builder/lang-rust-calls.js +0 -63
  145. package/src/graph/builder/lang-rust.js +0 -299
  146. package/src/graph/builder/lang-solidity.js +0 -126
  147. package/src/graph/builder/lang-sql.js +0 -263
  148. package/src/graph/builder/pass2-resolution.js +0 -81
  149. package/src/graph/builder/spec-pkg.js +0 -87
  150. package/src/graph/community.js +0 -27
  151. package/src/graph/edge-provenance.js +0 -31
  152. package/src/graph/file-lock.js +0 -69
  153. package/src/graph/freshness-probe.js +0 -142
  154. package/src/graph/graph-filter.js +0 -63
  155. package/src/graph/incremental-refresh.js +0 -235
  156. package/src/graph/internal-builder.barrels.js +0 -235
  157. package/src/graph/internal-builder.build.js +0 -300
  158. package/src/graph/internal-builder.java.js +0 -33
  159. package/src/graph/internal-builder.js +0 -12
  160. package/src/graph/internal-builder.langs.js +0 -157
  161. package/src/graph/internal-builder.pass2.js +0 -163
  162. package/src/graph/internal-builder.resolvers.js +0 -286
  163. package/src/graph/layout.js +0 -51
  164. package/src/graph/node-id.js +0 -7
  165. package/src/graph/parser-artifact-boundary.js +0 -55
  166. package/src/graph/relations.js +0 -4
  167. package/src/graph/repo-registry.js +0 -124
  168. package/src/graph/resolvers/rust.js +0 -117
  169. package/src/infra/infra-items.js +0 -255
  170. package/src/infra/infra-registry.js +0 -184
  171. package/src/infra/infra.detect.js +0 -119
  172. package/src/infra/infra.js +0 -38
  173. package/src/infra/infra.match.js +0 -102
  174. package/src/infra/infra.scan.js +0 -93
  175. package/src/mcp/actions/graph-lifecycle.mjs +0 -148
  176. package/src/mcp/architecture-bootstrap.mjs +0 -168
  177. package/src/mcp/architecture-starter.mjs +0 -234
  178. package/src/mcp/catalog.mjs +0 -233
  179. package/src/mcp/company-contract-page.mjs +0 -142
  180. package/src/mcp/company-contract-reconcile.mjs +0 -87
  181. package/src/mcp/company-contract-verdict.mjs +0 -42
  182. package/src/mcp/evidence/bun-lock-graph.mjs +0 -209
  183. package/src/mcp/evidence/duplicate-member-order.mjs +0 -8
  184. package/src/mcp/evidence/package-graph-common.mjs +0 -115
  185. package/src/mcp/evidence/package-lock-graph.mjs +0 -92
  186. package/src/mcp/evidence-snapshot.architecture.mjs +0 -80
  187. package/src/mcp/evidence-snapshot.common.mjs +0 -158
  188. package/src/mcp/evidence-snapshot.duplicates.mjs +0 -213
  189. package/src/mcp/evidence-snapshot.health.mjs +0 -102
  190. package/src/mcp/evidence-snapshot.inventory.mjs +0 -148
  191. package/src/mcp/evidence-snapshot.mjs +0 -50
  192. package/src/mcp/evidence-snapshot.package-graph.mjs +0 -34
  193. package/src/mcp/evidence-snapshot.structure.mjs +0 -84
  194. package/src/mcp/extension-api.mjs +0 -77
  195. package/src/mcp/git-output.mjs +0 -7
  196. package/src/mcp/graph/context-core.mjs +0 -111
  197. package/src/mcp/graph/context-seeds.mjs +0 -207
  198. package/src/mcp/graph/context-state.mjs +0 -85
  199. package/src/mcp/graph/reverse-reach.mjs +0 -42
  200. package/src/mcp/graph/tools-core.mjs +0 -143
  201. package/src/mcp/graph/tools-query.mjs +0 -276
  202. package/src/mcp/graph-context.mjs +0 -5
  203. package/src/mcp/graph-diff.mjs +0 -218
  204. package/src/mcp/health/audit-format.mjs +0 -199
  205. package/src/mcp/health/audit.mjs +0 -174
  206. package/src/mcp/health/dead-code.mjs +0 -110
  207. package/src/mcp/health/duplicates.mjs +0 -85
  208. package/src/mcp/health/endpoints.mjs +0 -71
  209. package/src/mcp/health/structure.mjs +0 -219
  210. package/src/mcp/runtime-version.mjs +0 -31
  211. package/src/mcp/server/auto-refresh.mjs +0 -66
  212. package/src/mcp/server/runtime-config.mjs +0 -43
  213. package/src/mcp/server/shutdown.mjs +0 -40
  214. package/src/mcp/staleness-notice.mjs +0 -20
  215. package/src/mcp/sync/evidence-architecture.mjs +0 -54
  216. package/src/mcp/sync/evidence-common.mjs +0 -88
  217. package/src/mcp/sync/evidence-duplicates.mjs +0 -97
  218. package/src/mcp/sync/evidence-health.mjs +0 -56
  219. package/src/mcp/sync/evidence-packages.mjs +0 -95
  220. package/src/mcp/sync/payload-common.mjs +0 -97
  221. package/src/mcp/sync/payload-v2.mjs +0 -54
  222. package/src/mcp/sync/payload-v3.mjs +0 -79
  223. package/src/mcp/sync-evidence.mjs +0 -23
  224. package/src/mcp/sync-payload.mjs +0 -70
  225. package/src/mcp/tool-result.mjs +0 -54
  226. package/src/mcp/tools-actions.mjs +0 -11
  227. package/src/mcp/tools-architecture.mjs +0 -177
  228. package/src/mcp/tools-company.mjs +0 -251
  229. package/src/mcp/tools-context.mjs +0 -222
  230. package/src/mcp/tools-endpoints.mjs +0 -207
  231. package/src/mcp/tools-graph-hubs.mjs +0 -78
  232. package/src/mcp/tools-graph.mjs +0 -17
  233. package/src/mcp/tools-health.mjs +0 -24
  234. package/src/mcp/tools-history.mjs +0 -28
  235. package/src/mcp/tools-impact-change.mjs +0 -220
  236. package/src/mcp/tools-impact-precision.mjs +0 -89
  237. package/src/mcp/tools-impact.mjs +0 -169
  238. package/src/mcp/tools-source.mjs +0 -238
  239. package/src/mcp/tools-verified-change.mjs +0 -200
  240. package/src/mcp-rg.mjs +0 -50
  241. package/src/mcp-runtime.mjs +0 -2
  242. package/src/mcp-server.mjs +0 -298
  243. package/src/mcp-source-tools.mjs +0 -163
  244. package/src/path-classification.js +0 -220
  245. package/src/path-ignore.js +0 -69
  246. package/src/precision/lsp-client/constants.js +0 -12
  247. package/src/precision/lsp-client/environment.js +0 -20
  248. package/src/precision/lsp-client/errors.js +0 -15
  249. package/src/precision/lsp-client/lifecycle.js +0 -114
  250. package/src/precision/lsp-client/message-parser.js +0 -81
  251. package/src/precision/lsp-client/protocol.js +0 -212
  252. package/src/precision/lsp-client/registry.js +0 -59
  253. package/src/precision/lsp-client/repo-uri.js +0 -60
  254. package/src/precision/lsp-client/stdio-client.js +0 -140
  255. package/src/precision/lsp-client.js +0 -10
  256. package/src/precision/lsp-overlay/budget-policy.js +0 -78
  257. package/src/precision/lsp-overlay/build.js +0 -261
  258. package/src/precision/lsp-overlay/contract.js +0 -61
  259. package/src/precision/lsp-overlay/reference-results.js +0 -108
  260. package/src/precision/lsp-overlay/semantic-inputs.js +0 -62
  261. package/src/precision/lsp-overlay/source-session.js +0 -142
  262. package/src/precision/lsp-overlay/store.js +0 -150
  263. package/src/precision/lsp-overlay/target-index.js +0 -152
  264. package/src/precision/lsp-overlay/target-query.js +0 -55
  265. package/src/precision/lsp-overlay.js +0 -11
  266. package/src/precision/symbol-query.js +0 -224
  267. package/src/precision/typescript-lsp-provider.js +0 -12
  268. package/src/precision/typescript-provider/client.js +0 -89
  269. package/src/precision/typescript-provider/discovery.js +0 -124
  270. package/src/precision/typescript-provider/isolated-runtime.js +0 -39
  271. package/src/precision/typescript-provider/project-host.js +0 -254
  272. package/src/precision/typescript-provider/project-safety.js +0 -166
  273. package/src/precision/typescript-provider/reference-usage.js +0 -53
  274. package/src/process.js +0 -95
  275. package/src/repo-path.js +0 -53
  276. package/src/scan/discover.inventory.js +0 -78
  277. package/src/scan/discover.js +0 -5
  278. package/src/scan/discover.list.js +0 -79
  279. package/src/scan/discover.stack.js +0 -227
  280. package/src/scan/search.core.js +0 -24
  281. package/src/scan/search.git.js +0 -102
  282. package/src/scan/search.js +0 -9
  283. package/src/scan/search.node.js +0 -83
  284. package/src/scan/search.preview.js +0 -49
  285. package/src/scan/search.rg.js +0 -145
  286. package/src/security/advisory-store.js +0 -172
  287. package/src/security/installed-jvm-rust.js +0 -46
  288. package/src/security/installed.js +0 -280
  289. package/src/security/malware-file-heuristics.js +0 -121
  290. package/src/security/malware-heuristics.exclusions.js +0 -134
  291. package/src/security/malware-heuristics.js +0 -15
  292. package/src/security/malware-heuristics.roots.js +0 -145
  293. package/src/security/malware-heuristics.scan.js +0 -89
  294. package/src/security/malware-heuristics.sweep.js +0 -122
  295. package/src/security/malware-scoring.js +0 -105
  296. package/src/security/match.js +0 -85
  297. package/src/security/registry-sig.classify.js +0 -137
  298. package/src/security/registry-sig.js +0 -18
  299. package/src/security/registry-sig.rules.js +0 -192
  300. package/src/security/rust-advisory-report.js +0 -60
  301. package/src/security/typosquat.js +0 -81
  302. package/src/util.js +0 -40
  303. package/src/version.js +0 -7
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "weavatrix",
3
- "version": "0.3.13",
4
- "type": "module",
5
- "description": "Local repository intelligence MCP for AI coding agents: an always-fresh architecture graph with production-first evidence — blast radius, dead code, endpoints, clones, history, Health and architecture safeguards, with honestly labeled precision.",
3
+ "version": "1.0.0",
4
+ "weavatrixEngineVersion": "1.0.2",
5
+ "description": "Native Rust repository intelligence for coding agents: 39 read-only MCP tools for graphs, impact, APIs, architecture, health, search, semantics, and memory.",
6
6
  "author": "Sergii Ziborov <sergii.ziborov@gmail.com>",
7
7
  "license": "MIT",
8
8
  "homepage": "https://weavatrix.com",
@@ -14,85 +14,28 @@
14
14
  "url": "https://github.com/sergii-ziborov/weavatrix/issues"
15
15
  },
16
16
  "mcpName": "io.github.sergii-ziborov/weavatrix",
17
+ "type": "module",
17
18
  "engines": {
18
19
  "node": ">=18"
19
20
  },
20
21
  "bin": {
22
+ "weavatrix": "bin/weavatrix.mjs",
21
23
  "weavatrix-mcp": "bin/weavatrix-mcp.mjs"
22
24
  },
23
- "exports": {
24
- "./mcp-runtime": "./src/mcp-runtime.mjs",
25
- "./extension-api": "./src/mcp/extension-api.mjs",
26
- "./extension/local-services": "./src/extension/local-services.mjs",
27
- "./analysis-kit": "./src/analysis-kit.mjs",
28
- "./package.json": "./package.json"
29
- },
30
25
  "files": [
31
26
  "bin",
32
- "src",
33
27
  "skill",
34
- "scripts/run-agent-task-benchmark.mjs",
35
- "docs/agent-task-benchmark.md",
36
- "docs/adr/0001-v0.3-offline-online-split.md",
37
- "docs/releases/v0.3.0.md",
38
- "docs/releases/v0.3.1.md",
39
- "docs/releases/v0.3.2.md",
40
- "docs/releases/v0.3.3.md",
41
- "docs/releases/v0.3.4.md",
42
- "docs/releases/v0.3.5.md",
43
- "docs/releases/v0.3.6.md",
44
- "docs/releases/v0.3.7.md",
45
- "docs/releases/v0.3.8.md",
46
- "docs/releases/v0.3.9.md",
47
- "docs/releases/v0.3.10.md",
48
- "docs/releases/v0.3.11.md",
49
- "docs/releases/v0.3.12.md",
50
- "docs/releases/v0.3.13.md",
51
- "docs/releases/v0.2.19.md",
52
28
  "README.md",
53
- "SECURITY.md",
54
29
  "LICENSE"
55
30
  ],
56
- "scripts": {
57
- "test": "node --test",
58
- "benchmark": "node scripts/run-benchmark.mjs",
59
- "benchmark:quick": "node scripts/run-benchmark.mjs --quick",
60
- "benchmark:real": "node scripts/run-real-benchmark.mjs",
61
- "benchmark:real:release": "node scripts/run-real-benchmark.mjs --require-all",
62
- "benchmark:agent": "node scripts/run-agent-task-benchmark.mjs",
63
- "benchmark:agent:release": "node scripts/run-agent-task-benchmark.mjs --require-independent",
64
- "build:mcpb": "node scripts/build-mcpb.mjs",
65
- "verify:release": "node scripts/verify-release.mjs"
66
- },
67
- "publishConfig": {
68
- "access": "public"
69
- },
70
31
  "keywords": [
71
32
  "mcp",
72
33
  "model-context-protocol",
34
+ "repository-intelligence",
73
35
  "code-graph",
74
- "impact-analysis",
75
- "blast-radius",
76
36
  "static-analysis",
77
- "dead-code",
78
- "dependency-graph",
79
- "tree-sitter",
80
37
  "claude",
81
38
  "codex",
82
- "openai-codex",
83
- "coding-agents",
84
- "ai-agents"
85
- ],
86
- "dependencies": {
87
- "tree-sitter-wasms": "0.1.13",
88
- "typescript": "5.9.3",
89
- "typescript-language-server": "4.4.1",
90
- "web-tree-sitter": "0.25.10"
91
- },
92
- "devDependencies": {
93
- "@anthropic-ai/mcpb": "2.1.2"
94
- },
95
- "overrides": {
96
- "tmp": "0.2.7"
97
- }
39
+ "rust"
40
+ ]
98
41
  }
package/skill/SKILL.md CHANGED
@@ -1,378 +1,66 @@
1
1
  ---
2
2
  name: weavatrix
3
- description: "Use the Weavatrix MCP as a reusable local repository-intelligence layer: understand unfamiliar applications with a bounded code graph, reduce repeated context, review Health, dead code, duplicates and history, trace endpoints and blast radius, enforce target architecture, and verify changes before a PR."
3
+ description: Use the native Weavatrix MCP for local repository intelligence across Rust, JavaScript, TypeScript, Python, Go, Java, C, C++, C#, SQL, GraphQL, Protobuf, infrastructure, and event transports. Trigger for codebase orientation, source search, dependency and call graphs, endpoint or transport tracing, cross-repository impact, dead-code and duplicate review, Health audits, architecture checks, Git history, coverage, vector or semantic search, SEO links, and temporal memory.
4
4
  ---
5
5
 
6
- # weavatrix MCP
7
-
8
- Structure-analysis tools over a prebuilt code graph plus the weavatrix analysis engines. The default
9
- `offline` profile contains no HTTP tool and permits repository switching only through an
10
- explicit local `open_repo` call. Use `pinned` when a shared MCP process must never change or inspect
11
- outside its startup repository.
12
-
13
- ## Step 0 — if the tools are missing
14
-
15
- Tools are named `mcp__weavatrix__…`. If none are available, ask the user to register the server
16
- (`claude mcp add -s user weavatrix -- npx -y weavatrix <repoRoot>`; Codex:
17
- `codex mcp add weavatrix -- npx -y weavatrix <repoRoot>`), then retry.
18
-
19
- First compare the selected profile with the `graph_stats` runtime line. Expected catalogs are 31
20
- tools for `pinned` and 34 for `offline`. Weavatrix refuses
21
- `initialize`, `tools/list`, and tool calls when the running package version differs from the
22
- `package.json` version on disk, with a loud `STALE_RUNTIME` error; restart/reconnect rather than using
23
- an old daemon. `WEAVATRIX_ALLOW_STALE_RUNTIME=1` is only for deliberate source development. A custom
24
- capability list needs `crossrepo` for `trace_api_contract`. Legacy network profile names fail loudly
25
- and direct the user to the separate `weavatrix-online` package.
26
-
27
- Profiles use the same npm package and binary:
28
-
29
- - `offline` (default): all local analysis and explicit `open_repo`; no HTTP tools.
30
- - `pinned`: local analysis with no `open_repo`, no global/cross-repository graph access, and no HTTP tools.
31
-
32
- ## Intent router
33
-
34
- Weavatrix is not one report or three fixed workflows. Its 34 methods expose different bounded views
35
- and analyses over the same reusable graph. Start from the task and choose the smallest sufficient
36
- projection; expand only when the answer requires it.
37
-
38
- ### Graph views and application understanding
39
-
40
- - **Confirm repository, graph freshness and build mode**: `graph_stats`; use `rebuild_graph` only for
41
- a reported fallback/error or an intentional mode/precision change.
42
- - **Switch or inventory local repositories**: `list_known_repos` -> `open_repo` -> `graph_stats`.
43
- - **See production module topology**: `module_map`; use this first for a large unfamiliar application.
44
- - **See discovered communities and their members**: `list_communities` -> `get_community`.
45
- - **Find high-coupling hubs**: `god_nodes`; repeated call sites do not inflate unique connectivity.
46
- - **Inspect one graph entity**: `get_node`; pass an exact node ID when labels are ambiguous.
47
- - **Inspect direct one-hop relations**: `get_neighbors`; do not confuse it with transitive impact.
48
- - **Find a connectivity path between two concepts**: `shortest_path`. It traverses the graph as
49
- undirected reachability, so it is not proof of call/dependency direction; confirm direction with
50
- `get_neighbors` and `read_source`.
51
- - **Explore an unknown entry point or architectural question**: `query_graph`; pin `seed_files` or
52
- exact `seed_symbols` when known. Use `relation_filter` plus `flow_direction` for a bounded event,
53
- worker, queue, cron, CLI, or data-flow view; keep a broad natural-language result as orientation
54
- evidence.
55
- - **Inspect one exact symbol deeply**: `context_bundle` for the bounded edit workset;
56
- `inspect_symbol` for the raw point query and on-demand JS/TS reference evidence.
57
- - **Confirm graph evidence in source**: `read_source`; use `search_code` only for a narrow regex/glob
58
- check. Search is supporting evidence, not the repository-intelligence layer.
59
-
60
- ### Runtime, API and change scenarios
61
-
62
- - **Inventory HTTP routes**: `list_endpoints` for declared/reachable composed paths and mount proof.
63
- - **Trace one endpoint through the application**: `trace_endpoint` for route -> handler -> bounded
64
- downstream call flow with edge-centered excerpts.
65
- - **Trace an API contract across repositories**: `list_known_repos` -> `trace_api_contract` with an
66
- explicit backend/client set; prefer this over separate per-repository endpoint/search passes when
67
- a backend change may affect registered clients, and inspect each graph reconciliation state before
68
- using the verdict.
69
- - **Measure one symbol's transitive blast radius**: `get_dependents`.
70
- - **Review the current branch, diff, or external patch**: `change_impact`; its explicit baseline
71
- parameter is `base`, not the `base_ref` used by audit/diff/verification tools. It distinguishes
72
- additive exports from signature/body/removal risk and separates runtime/type-only radius plus
73
- available measured coverage or explicitly static reachability.
74
- - **Compare structural graph revisions**: `graph_diff base_ref=<merge-base>` for module edges, cycles,
75
- orphans and lost callers; without `base_ref`, compare the last rebuild snapshots.
76
- - **Use behavioral history**: `git_history` for churn x connectivity, hidden co-change and expected
77
- test/source coupling from bounded local Git numstat evidence.
78
- - **Plan and verify a serious change or pre-commit gate**:
79
- `verified_change task=<same-task> phase=plan base_ref=<merge-base>` -> edit ->
80
- `verified_change task=<same-task> phase=verify base_ref=<same-ref>`. It composes exact context, impact, graph,
81
- architecture, duplicate, optional API and test proof into one PASS/BLOCKED/UNKNOWN envelope. It is
82
- a proof layer around an agent's edit, not a source editor or hidden auto-fix.
83
-
84
- ### Health, debt and testing scenarios
85
-
86
- - **Run a whole-repository Health review**: `run_audit debt=all`, then read its capability matrix.
87
- `STRUCTURE CHECKED` and `DEPENDENCIES CHECKED` do not imply runtime or concurrency correctness.
88
- - **Gate only newly introduced branch debt**: `run_audit base_ref=<merge-base> debt=new`; old debt in
89
- a changed file remains existing.
90
- - **Review dependency declarations/imports**: `run_audit category=dependencies`; it includes missing,
91
- unused, duplicate, unresolved-import and lockfile-drift evidence without relabelling identities.
92
- Maven/Gradle imports are mapped to exact artifact ownership when the referenced class is present in
93
- an already installed local JAR. Missing artifacts, ambiguous class owners, version catalogs or
94
- dynamic build logic remain `PARTIAL`/`NOT_SUPPORTED`, never a false clean `0 declared / 0 external`.
95
- - **Review vulnerability evidence**: `run_audit category=vulnerability`. `NOT_CHECKED` is unknown,
96
- never clean; remote refresh is an explicit `weavatrix-online` workflow.
97
- - **Review dead files, functions, methods and symbols**: `find_dead_code`; every result remains a
98
- review candidate with framework/dynamic/public-API caveats, never an auto-delete verdict.
99
- - **Trace dynamic GraphQL/gRPC/Kafka contracts**: export a source-free
100
- `weavatrix.transport-runtime.v1` JSON report (normalized observations or OTLP `resourceSpans`) to
101
- `.weavatrix/transport-runtime.json`, rebuild the graph, and call `trace_api_contract`. Only a
102
- fresh report whose `repositoryRevision` matches `graphRevision` and whose observation maps to the
103
- dynamic file/line resolves that `UNKNOWN`; missing capture remains unknown.
104
- - **Review clone families or same-name divergence**: `find_duplicates`; framework router boilerplate
105
- and immutable declarative catalog shapes stay suppressed unless explicitly included.
106
- - **Map measured coverage or honest static test reachability**: `coverage_map`; unavailable measured
107
- coverage is not 0%.
108
- - **Prioritize local performance-review candidates**: `hot_path_review`; confirm with a profiler or
109
- benchmark before changing runtime behavior.
110
-
111
- ### Intended architecture
112
-
113
- - **Read or establish intended architecture**: `get_architecture_contract`. A returned starter adapts
114
- to Maven/Gradle source roots and monorepos and proposes product-code territories plus observed
115
- dependency directions labelled `OBSERVED_NOT_ENFORCED`; oversized Java branches split only at real
116
- child packages. Only runtime-cycle and 300-line file guards are active by default; generic
117
- complexity/cohesion thresholds are `CANDIDATE_NOT_ENFORCED`. None becomes policy automatically.
118
- - **Bootstrap local policy safely**: `get_architecture_contract action=preview` with an optional
119
- reviewed `candidate_contract` and `baseline_mode=none|accept-current`; inspect the exact content,
120
- verification and patch, then call `action=approve confirm_token=<exact-token>`. Approval creates
121
- only a missing `.weavatrix/architecture.json`, rechecks graph identity, and never overwrites policy.
122
- - **Select rules before editing**: `prepare_change`; **enforce the ratchet after editing**:
123
- `verify_architecture`.
124
- - **Understand or request an exception**: `explain_architecture_violation` ->
125
- `propose_architecture_exception`; proposals never mutate policy automatically. After human approval,
126
- the owner must add the returned proposal to the local contract's `exceptions`; remote governance
127
- belongs to `weavatrix-online`.
128
-
129
- Across every scenario, treat `PARTIAL`, `UNAVAILABLE`, `OFF`, `NOT_SUPPORTED`, `NOT_CHECKED`,
130
- `ERROR`, or capped evidence as incomplete rather than success. Java and Rust exact language-server
131
- providers are not bundled, so their edges never become `EXACT_LSP` even when a mixed repository has
132
- a complete TypeScript/JavaScript overlay. Java and Go receiver-type call edges are parser-resolved
133
- and explicitly `INFERRED`; Go resolution uses parameter, local, constructor-return, imported and
134
- struct-field types. These edges improve cross-file flow without claiming compiler-exact overload,
135
- interface dispatch, reflection, or runtime behavior.
136
-
137
- ## Ground rules
138
-
139
- - **No hidden source mutation**: Weavatrix builds derived graph/cache artifacts and can run explicitly
140
- authorized tests, but it does not edit repository source, auto-delete debt, merge clones, or rewrite
141
- architecture policy. The coding agent remains responsible for the change and its tests.
142
- - **Evidence, not verdicts**: treat audit, hub, orphan and duplicate output as hypotheses. Confirm a
143
- finding in source and check framework/runtime conventions before deleting, merging or redesigning
144
- code. A same-name/different-body pair is a divergence candidate, not proof of duplication.
145
- - **Freshness**: the graph is always fresh at answer time — no watcher process and no manual refresh
146
- step exists or is needed. Every graph/health call runs a debounced Git freshness probe and, when the
147
- repository changed, refreshes before answering (bounded incremental reparse of changed files plus
148
- reverse importers for JS/TS; full rebuild for config/export-surface/barrel changes and other
149
- languages). Cross-repository tracing reconciles every selected registered graph the same way. Read
150
- the structured `refresh` / `graphReconciliation` status: `none`, `incremental`, `full`, or
151
- explicitly `PARTIAL`. Use `rebuild_graph` only when automatic reconciliation reports a
152
- fallback/error or when intentionally changing build mode. A normal `open_repo` builds missing graphs
153
- and upgrades legacy schemas; `build:false` deliberately refuses that upgrade.
154
- - **Ambiguity**: `get_node`/`get_neighbors`/`get_dependents` disclose `matched N nodes; using the
155
- best-connected` — read that note before trusting the answer; pass an exact node id to pin it.
156
- - **Runtime versus compile time**: keep runtime cycles separate from TypeScript type-only and
157
- language compile-only coupling (Rust `mod`/`use`/`pub use`, Java imports). `module_map`,
158
- `change_impact` and `graph_diff` label the distinction; `god_nodes` ranks unique connectivity and
159
- reports repeated references separately. Do not schedule a runtime-cycle refactor from
160
- compile-time-only edges.
161
- - **Edge provenance**: distinguish how an edge was established from legacy confidence. The parser
162
- emits `EXTRACTED`, `RESOLVED`, and `INFERRED`; the bundled bounded TypeScript/JavaScript language
163
- server emits `EXACT_LSP` only for references it confirms. `CONFLICT` means evidence disagrees.
164
- Treat `INFERRED`, `CONFLICT`, `PARTIAL`, `UNAVAILABLE`, and `OFF` as review signals rather than
165
- compiler-exact facts; an `UNKNOWN` count or revision-mismatched overlay in `graph_stats` requires
166
- a rebuild before precision-sensitive work.
167
- - **Repository universe**: in Git repositories, graph and duplicate scans include tracked plus
168
- non-ignored untracked files. If an old graph still contains packaged/generated output, rebuild it
169
- before interpreting the result. Repository-root `.weavatrixignore` applies the same tracked-file
170
- exclusions to graph, audit and duplicate passes; use it for generated/e2e fixtures that must stay
171
- committed. `no-tests` also recognizes Cypress, Playwright, `test-e2e`, acceptance and integration
172
- roots. Dead-code/clone/audit review also suppresses `benchmarks/**` and `**/__temp/**` as classified
173
- non-production surfaces. A verified production benchmark can opt back in narrowly through
174
- `.weavatrix.json` `classify.product`, for example `{"classify":{"product":["benchmarks/core/**"]}}`.
175
- Rust inline tests (`#[cfg(test)]` modules, `#[test]`/`#[bench]` items) are classified per symbol via
176
- the node-level `test_surface` flag even though they live in production `.rs` files; dead-code,
177
- query, hot-path and hub tools treat them like path-classified tests (`include_tests` /
178
- `include_classified` and a test-term question opt back in).
179
- - **Architectural queries**: broad bootstrap/tool-execution/routing questions rank conventional
180
- production and graph-declared entry points ahead of classified docs, sites, benchmarks and
181
- fixtures. Production-first classification also applies during traversal. A class term in the
182
- question enables only that class; `include_classified=true` enables all classified paths. Exact
183
- non-product `seed_files` remain pinned. Unmatched unreferenced constant/field leaves are suppressed
184
- unless `include_low_signal=true`. Inspect the returned seeds/policy before trusting the traversal.
185
- - **Coverage**: `coverage_map` reads an existing report. `unavailable` means no supported report was
186
- found, not 0% coverage; do not rank testing risk from that state.
187
- - **Local hot paths**: `hot_path_review` ranks parser-derived local syntax cost and reports graph
188
- fan-in/fan-out plus test evidence separately. `actualCoverage: NOT_AVAILABLE` is not zero coverage,
189
- and the score is not profiler data or an interprocedural Big-O proof. The default queue uses
190
- `min_score=85` plus a narrow strong-local fallback; use `min_score=0` only for full diagnostics.
191
- Inspect its line evidence and measure runtime before scheduling a performance rewrite.
192
- - **Audit completeness**: read the top-level Health capability matrix first: structure, dependencies,
193
- runtime correctness, concurrency, advisories, malware and measured coverage each have independent
194
- status/completeness. The bounded Go/Java correctness patterns can flag a fixed-index slice hazard,
195
- discriminator mismatch, lost Java interrupt or unbounded retry candidate, but they are not a
196
- compiler, race detector, runtime trace, CFG, or proof of race freedom. Then read
197
- `dependencyReport.status`, ecosystem support, unused/missing counts, each npm finding's
198
- `verification` (manifest, indexed source, scripts/config, unresolved dynamic usage), and
199
- `checks.osv.status` / `checks.malware.status`. A dependency result from a partial or unsupported
200
- ecosystem is not a repository-wide clean zero. For OSV, `OK` is
201
- complete for the recorded dependency fingerprint; `PARTIAL` is incomplete or stale,
202
- `NOT_CHECKED` has no repository-specific result, and `ERROR` means the local check failed. Treat
203
- the same non-`OK` states as incomplete for malware scanning. Remote OSV refresh belongs to the
204
- separate `weavatrix-online` package; this MIT core reads only its validated local cache.
205
- - **Offline by design**: scans and graph queries use local files; the semantic overlay may launch
206
- Weavatrix's bundled read-only TypeScript language-server child process, but it never runs repository
207
- scripts or downloads a provider. Coverage tools read existing reports and never run tests. The
208
- package contains no network-touching tool or network-enabled profile. Online/Cloud/Enterprise work
209
- uses the separate `weavatrix-online` superset, which depends on this core and may add tools, skills
210
- and local analyzer providers without replacing core implementations.
211
- - **Repository boundary**: source reads and graph-derived paths are realpath-contained. `open_repo`
212
- intentionally changes the active boundary through an explicit offline tool call. It is included in
213
- `offline`, absent from `pinned`, and available in a custom registration only when `retarget` is
214
- named. Concurrent non-mutating calls retain the graph/root snapshot with which they started.
215
-
216
- - **Test execution is separately authorized**: `verified_change` only executes named
217
- `package.json` test/check/verify scripts when the call has `run_tests:true` and the server was
218
- started with `WEAVATRIX_ALLOW_TEST_RUNS=1`. It never accepts arbitrary shell commands. Without
219
- both gates it returns a plan or `UNKNOWN` evidence state.
220
-
221
- ## Recipes
222
-
223
- - **Proof-carrying refactor**: `verified_change task=<same-task> phase=plan base_ref=<merge-base>` -> edit ->
224
- `verified_change task=<same-task> phase=verify base_ref=<same-ref> tests=[{"script":"test","args":[...]}]`.
225
- Repeat `task` on both calls; it is required and is not retained between invocations.
226
- Add `run_tests:true` only when test execution was authorized. `BLOCKED` means an evidenced ratchet
227
- or test failure; `UNKNOWN` means at least one required proof is incomplete.
228
-
229
- - **Orient in the configured repo**: `module_map` → `list_communities` → `god_nodes`. Hub ranking
230
- is production-only by default; use `include_classified:true` only when tests/generated/build
231
- surfaces are deliberately part of the question.
232
- - **Refactor safety for one symbol**: `context_bundle` → optional `inspect_symbol` when raw LSP
233
- occurrences, ambiguity details or the larger source window are needed → `get_dependents` →
234
- `coverage_map` (low coverage × many dependents ⇒ write tests first) → edit →
235
- `verified_change task=<task> phase=verify base_ref=<merge-base>`.
236
- - **Performance review**: `hot_path_review` → inspect its local evidence with `read_source` → use
237
- `get_dependents` for change risk → confirm with the repository's profiler/benchmark before editing.
238
- - **Pre-PR review of your current changes**: `change_impact` (auto merge-base; includes uncommitted
239
- and untracked work, coverage attached, untested hotspots called out) → drill with `get_dependents`.
240
- - **Impact of a PR that is NOT checked out**: pass its changed-file list explicitly —
241
- `change_impact files=[…]` — same blast-radius + coverage view, no checkout.
242
- - **Validate a refactor structurally**: call `graph_diff base_ref=HEAD~1` (or `main` / `origin/main`)
243
- to build an immutable baseline without checkout and compare it with the current graph. Alternatively,
244
- edit → `rebuild_graph`, then use `graph_diff` without `base_ref` to compare `graph.prev.json` with
245
- the rebuilt graph. Either route can be scoped by `path`; look for cycle, module-dependency and
246
- orphan drift rather than raw edge counts.
247
- - **Health sweep**: for a branch/PR review prefer
248
- `run_audit base_ref=<merge-base> debt=new changed_files=[…]`; for repository maintenance use
249
- `run_audit debt=all`. Then call `find_dead_code`, `find_duplicates`, `coverage_map` and
250
- `hot_path_review`. A changed-file-only audit is
251
- scope, not proof of new debt. Inspect the source behind shortlisted findings before proposing edits.
252
- - **Dead-code and dead-method review**: call `find_dead_code` for a bounded production-code queue of
253
- files, functions, methods and symbols. Narrow with `path` or `kinds=["method"]`; keep the default
254
- `min_confidence=medium` for actionable internal candidates. Use `min_confidence=low` only when the
255
- task explicitly needs public/exported, framework, dynamic-loading or reflection-sensitive review,
256
- and carry each returned caveat into the recommendation. Pair it with
257
- `run_audit category=unused debt=all` (or `base_ref=<merge-base> debt=new`) for unused exports and
258
- dependencies. Before deletion, run `read_source`, `get_dependents`, exact `search_code`, inspect
259
- framework discovery/annotations, package scripts, CLI/Docker/manifests, generated consumers and
260
- test-only use, then run the repository tests. Use `evidenceTier` and `remainingChecks` to order the
261
- review; even `STRONG_STATIC_EVIDENCE` is exact zero-reference evidence, not deletion permission.
262
- `REVIEW_REQUIRED` and `autoDelete:false` are hard
263
- safety semantics, not boilerplate. Use `.weavatrix-deps.json` entrypoints/nonRuntimeRoots only for
264
- verified conventions.
265
- - **API inventory**: `list_endpoints` (including mount provenance, Next.js App Router, Rust axum and
266
- actix-web). Spring endpoint rows also expose conditional activation and whether the controller is
267
- inactive by default. When one exact route is known, use `trace_endpoint` for its composed mount
268
- chain, handler and bounded production call graph instead of broad natural-language traversal.
269
- - **CLI, worker, queue, cron or event flow**: identify the exact listener/handler/registration symbol,
270
- then call `query_graph seed_symbols=[...] relation_filter=["calls","references"]
271
- flow_direction="both"`; use `context_bundle` for production-first inbound/outbound containers and
272
- diverse call-site excerpts, then `get_dependents` / `read_source` for decisive evidence. If the
273
- symbol is unknown, use a narrow `search_code` registration check once and pin what it finds. Do not
274
- force a non-HTTP flow through endpoint tools or begin with an unconstrained natural-language seed.
275
- - **Cross-repository API impact**: ensure both repositories are in `list_known_repos`, then call
276
- `trace_api_contract backend=<uuid-or-label> clients=[<uuid-or-label>]`; narrow with `method`, `path`,
277
- or backend `changed_files`. `path` may be a segment-aligned fragment (`/query` can select
278
- `/edgeAnalytics/query/...`), and bounded constant prefixes in template URLs are resolved. The tool
279
- recognizes configured and conservatively auto-discovered HTTP wrappers; use per-repository
280
- `.weavatrix.json` `httpContracts` configuration for durable custom client names/wrappers, or
281
- `client_names` / `client_wrappers` for one trace. `NOT_DEAD_EXTERNAL_USE` requires medium/high
282
- confidence; only an unambiguously resolved handler node can suppress a dead-method candidate.
283
- `POSSIBLE_EXTERNAL_USE`, `UNKNOWN`, and remaining unresolved/dynamic URLs are incomplete evidence,
284
- never proof that a method is dead.
285
- - **Release regression gate**: for a Weavatrix source checkout, use `npm test` for the full
286
- unit/integration suite, `npm run benchmark:quick` for the quick six-language golden corpus, and
287
- `npm run benchmark` before release for the golden corpus plus the real MCP
288
- `full -> incremental -> none -> reconnect/none` lifecycle, bounded output and active-target checks.
289
- Use `npm run benchmark:real` for available manifest repositories and
290
- `npm run benchmark:real:release` only when all six source checkouts are present; `MISSING`,
291
- `UNBASELINED` and `STALE` are explicit incomplete states, not green results.
292
- A green Java/Rust fixture proves only its declared representative signals, not compiler-exact
293
- coverage of arbitrary repositories.
294
- - **Target architecture before editing**: if no contract exists, call
295
- `get_architecture_contract action=preview baseline_mode=none` and inspect the adaptive product
296
- territories, observed-but-not-enforced directions and verification. Pass a reviewed
297
- `candidate_contract` when the desired target differs. Only after explicit owner approval call
298
- `get_architecture_contract action=approve confirm_token=<exact-token>`. Use
299
- `baseline_mode=accept-current` only when the owner intentionally accepts current deterministic
300
- debt into the ratchet. Then run `prepare_change` with intended files → edit/rebuild →
301
- `verify_architecture`. An approved exception is still applied by adding the exact returned proposal
302
- to `exceptions` and verifying again. Existing contracts are never overwritten; Hosted contracts
303
- are pulled only after explicit opt-in. No tool silently changes an active policy.
304
- - **Behavioral architecture**: `git_history` ranks churn × connectivity hotspots and hidden
305
- co-change coupling from bounded local numstat history. Always set `top_n`; it is enforced across
306
- every returned structured collection and JSON reports per-collection truncation. Use it as review
307
- evidence, not proof that two files must be merged.
308
- - **Machine output**: keep the default `output_format:"text"` for concise agent conversations; opt
309
- into `output_format:"json"` only when a workflow consumes the full `weavatrix.tool.v1` envelope.
310
- - **Find code**: `search_code` (regex + glob) →
311
- `read_source path=<match-path> start_line=<match-line>`; add `get_node` / `get_neighbors` only after
312
- identifying an exact graph symbol.
313
- - **Another repo**: `list_known_repos` → `open_repo <path>`
314
- (builds or upgrades the graph when needed; `build:false` probes without building).
315
-
316
- ## Repository-specific conventions
317
-
318
- Weavatrix understands nearest workspace manifests, nested `tsconfig`/`jsconfig` aliases,
319
- framework-owned runtime peers such as Next.js + `react-dom`, generated NAPI-RS platform loaders,
320
- and Next.js App Router route exports. Use repository-root `.weavatrix.json` to correct ambiguous
321
- production classification without deleting graph evidence:
322
-
323
- ```json
324
- {
325
- "classify": {
326
- "generated": ["src/generated/**"],
327
- "test": ["qa/**"],
328
- "product": ["benchmarks/core/**"]
329
- },
330
- "exclude": ["resources/snapshots/**"]
331
- }
332
- ```
333
-
334
- Use `generated` / `test` (or `e2e`, `mock`, `story`, `docs`, `benchmark`, `temp`) for non-production
335
- code, top-level `exclude` for resource/catalog roots that should stay visible in the graph but not
336
- drive production-first Health/query ranking, and `product` only to opt a verified benchmark/temp path
337
- back into production review. `product` does not override an explicit generated/test classification or
338
- `exclude`. Use `.weavatrixignore` instead only when a path must be removed consistently from graph,
339
- audit and duplicate scans.
340
-
341
- For project-specific entry points, reusable template catalogs, or Python dependencies supplied by an
342
- external runtime, add `.weavatrix-deps.json` at the repository root:
343
-
344
- ```json
345
- {
346
- "entrypoints": ["scripts/publish-release.mjs"],
347
- "nonRuntimeRoots": ["library", "catalogs/examples"],
348
- "python": {
349
- "managedDependencies": ["numpy", "openvino-genai"],
350
- "ignoreDependencies": ["vendor-sdk"]
351
- }
352
- }
353
- ```
354
-
355
- Keep exceptions narrow. `nonRuntimeRoots` (alias `templateRoots`) marks reusable examples that are
356
- not one deployed application. It suppresses orphan/dead/unused-export noise and missing/unresolved
357
- dependency findings when every use is inside those roots; graph edges, cycles and boundaries remain
358
- visible. `managedDependencies` documents modules provided outside the repo's Python manifest;
359
- `ignoreDependencies` suppresses intentionally unresolved imports.
360
-
361
- ## Online extensions
362
-
363
- This package is the MIT, network-free core. If `refresh_advisories`, `online_status`, `preview_sync`,
364
- `pull_architecture_contract` or `sync_graph` is required, use the separately installed
365
- `weavatrix-online` MCP and follow its skill. Do not attempt to enable a legacy profile here: the
366
- `online`, `osv`, `hosted` and `full` names fail loudly and cannot add network code to this artifact.
367
-
368
- ## Troubleshooting
369
-
370
- - `Graph unavailable` → `rebuild_graph`; normal graph/health calls automatically refresh an existing
371
- graph and report `none`, `incremental`, or `full`. `open_repo` can select another valid repository path unless
372
- the registration deliberately omitted `retarget`.
373
- - An Online-only tool is unavailable → keep this core registration network-free and configure the
374
- separate `weavatrix-online` MCP only when the user actually wants Cloud or Enterprise integration.
375
- - `No coverage report` → run the repo's own tests with coverage (`vitest run --coverage`,
376
- `jest --coverage`, `pytest --cov --cov-report=json`, `go test -coverprofile=coverage.out`),
377
- then re-call.
378
- - `change_impact` says files are "not in the graph" → they're new/renamed; `rebuild_graph` and retry.
6
+ # Weavatrix
7
+
8
+ Use Weavatrix as the evidence layer for repository work. Start with the
9
+ smallest graph query that answers the task, inspect decisive source spans, and
10
+ then use repository-native tests or benchmarks for behavioral proof.
11
+
12
+ ## Start
13
+
14
+ 1. Call `graph_stats` to confirm the active repository and graph revision.
15
+ 2. Use `module_map` for orientation or `search_code` for a known literal.
16
+ 3. Pin an exact symbol with `inspect_symbol` or `context_bundle`.
17
+ 4. Expand only with `get_neighbors`, `get_dependents`, `query_graph`, or
18
+ `shortest_path` when the task needs relationship evidence.
19
+
20
+ Call `rebuild_graph` only when the active repository changed before the
21
+ server's refresh completed or when deliberately changing graph mode.
22
+
23
+ ## Route the task
24
+
25
+ - API inventory: `list_endpoints`; one request path: `trace_endpoint`.
26
+ - GraphQL, gRPC/Protobuf, Kafka, RabbitMQ/AMQP, NATS, SNS/SQS, or JMS across
27
+ repositories: `list_known_repos`, then `trace_api_contract` with an explicit
28
+ backend, clients, and transport.
29
+ - Cross-repository Git evidence: `cross_repo_git`.
30
+ - Branch or patch impact: `change_impact`; transitive symbol risk:
31
+ `get_dependents`; structural drift: `graph_diff`.
32
+ - Repository health: `run_audit`, then targeted `find_dead_code`,
33
+ `find_duplicates`, `coverage_map`, and `hot_path_review`.
34
+ - Intended architecture: `get_architecture_contract`, `prepare_change`, then
35
+ `verify_architecture`; explain or propose an exception only for a concrete
36
+ violation fingerprint.
37
+ - Change gate: use `verified_change` with the same task and base revision in
38
+ plan and verify phases.
39
+ - Vector, semantic, SEO, and temporal context: `vector_search`,
40
+ `semantic_link`, `seo_link_suggestions`, and `memory_context`.
41
+
42
+ Read [references/tool-routing.md](references/tool-routing.md) when selecting
43
+ among similar tools or reviewing transport evidence.
44
+
45
+ ## Evidence rules
46
+
47
+ - Treat source spans, extractor identity, graph revision, relation type, and
48
+ confidence as part of every finding.
49
+ - Distinguish static reachability from measured coverage.
50
+ - Confirm dead-code and clone candidates in source and framework registration
51
+ points before editing.
52
+ - Preserve exact transport identity. Do not merge AMQP, RabbitMQ, NATS, Kafka,
53
+ SNS/SQS, JMS, GraphQL, or gRPC evidence merely because operations share
54
+ names such as `publish`, `send`, or `subscribe`.
55
+ - For dynamic JavaScript or Python dispatch, narrow with repository
56
+ configuration, imports, call receivers, literals, runtime evidence, and
57
+ source spans. Never guess a transport or call target.
58
+ - Use `output_format:"text"` for compact interaction and JSON for automation
59
+ or retained evidence.
60
+
61
+ ## Safety
62
+
63
+ The core is read-only and offline: it may read local source, Git objects,
64
+ coverage, and derived graph state, but it does not edit source or perform
65
+ network security scans. Use `weavatrix-refactor` only for explicitly approved
66
+ write plans and `weavatrix-online` only for explicitly approved network work.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Weavatrix"
3
+ short_description: "Native repository intelligence for coding agents"
4
+ default_prompt: "Use $weavatrix to inspect this repository with graph, health, impact, and source evidence."
@@ -0,0 +1,45 @@
1
+ # Tool routing
2
+
3
+ ## Graph and source
4
+
5
+ - `graph_stats`: repository identity, freshness, counts, and evidence.
6
+ - `module_map`, `list_communities`, `get_community`, `god_nodes`: topology.
7
+ - `get_node`, `get_neighbors`, `inspect_symbol`, `context_bundle`: exact
8
+ entities and local evidence.
9
+ - `query_graph`, `shortest_path`, `get_dependents`: bounded traversal.
10
+ - `search_code`, `read_source`: lexical and source confirmation.
11
+
12
+ ## Change and history
13
+
14
+ - `change_impact`: current diff, explicit files, or supplied patch.
15
+ - `graph_diff`: structural comparison with an immutable Git revision.
16
+ - `git_history`: churn and co-change in one repository.
17
+ - `cross_repo_git`: histories, shared commits, or diffs across repositories.
18
+ - `verified_change`: composite plan/verify evidence envelope.
19
+
20
+ ## Runtime contracts
21
+
22
+ - `list_endpoints` and `trace_endpoint`: HTTP routes and handlers.
23
+ - `trace_api_contract`: HTTP, GraphQL, Protobuf/gRPC, and event transports
24
+ across registered repositories.
25
+ - Select `transport:"event"` for Kafka, RabbitMQ/AMQP, NATS, SNS/SQS, and JMS;
26
+ retain the concrete transport, topic/queue/subject, operation, source span,
27
+ and producer/consumer direction from each evidence row.
28
+
29
+ ## Quality and architecture
30
+
31
+ - `run_audit`: repository Health and evidence completeness.
32
+ - `find_dead_code`: conservative production-symbol review queue.
33
+ - `find_duplicates`: Type-1, Type-2, and Type-3 clone families.
34
+ - `coverage_map`: measured reports and separately labeled static reachability.
35
+ - `hot_path_review`: static performance-review candidates.
36
+ - `get_architecture_contract`, `prepare_change`, `verify_architecture`,
37
+ `explain_architecture_violation`, `propose_architecture_exception`:
38
+ architecture workflow.
39
+
40
+ ## Repository and optional analysis
41
+
42
+ - `open_repo`, `list_known_repos`: local retargeting and cross-repository set.
43
+ - `rebuild_graph`: explicit graph refresh or mode change.
44
+ - `vector_search`, `semantic_link`, `seo_link_suggestions`, `memory_context`:
45
+ supplied-vector and supplied-event workflows.