homegraph 1.5.1 → 1.5.3

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 (382) hide show
  1. package/CHANGELOG.md +131 -0
  2. package/LICENSE +21 -21
  3. package/README.md +312 -305
  4. package/dist/arkui/index.d.ts +4 -0
  5. package/dist/arkui/index.d.ts.map +1 -0
  6. package/dist/arkui/index.js +23 -0
  7. package/dist/arkui/index.js.map +1 -0
  8. package/dist/arkui/migrate-passage.d.ts +28 -0
  9. package/dist/arkui/migrate-passage.d.ts.map +1 -0
  10. package/dist/arkui/migrate-passage.js +310 -0
  11. package/dist/arkui/migrate-passage.js.map +1 -0
  12. package/dist/arkui/migrate-semantics.d.ts +47 -0
  13. package/dist/arkui/migrate-semantics.d.ts.map +1 -0
  14. package/dist/arkui/migrate-semantics.js +229 -0
  15. package/dist/arkui/migrate-semantics.js.map +1 -0
  16. package/dist/arkui/migrate-snapshot.d.ts +79 -0
  17. package/dist/arkui/migrate-snapshot.d.ts.map +1 -0
  18. package/dist/arkui/migrate-snapshot.js +340 -0
  19. package/dist/arkui/migrate-snapshot.js.map +1 -0
  20. package/dist/bin/fatal-handler.js +2 -2
  21. package/dist/bin/homegraph.js +111 -162
  22. package/dist/bin/homegraph.js.map +1 -1
  23. package/dist/bin/node-version-check.d.ts +6 -15
  24. package/dist/bin/node-version-check.d.ts.map +1 -1
  25. package/dist/bin/node-version-check.js +8 -37
  26. package/dist/bin/node-version-check.js.map +1 -1
  27. package/dist/db/index.d.ts +36 -1
  28. package/dist/db/index.d.ts.map +1 -1
  29. package/dist/db/index.js +124 -38
  30. package/dist/db/index.js.map +1 -1
  31. package/dist/db/migrations.d.ts +1 -1
  32. package/dist/db/migrations.d.ts.map +1 -1
  33. package/dist/db/migrations.js +52 -38
  34. package/dist/db/migrations.js.map +1 -1
  35. package/dist/db/queries.d.ts +42 -0
  36. package/dist/db/queries.d.ts.map +1 -1
  37. package/dist/db/queries.js +330 -163
  38. package/dist/db/queries.js.map +1 -1
  39. package/dist/db/schema.sql +208 -203
  40. package/dist/db/sqlite-adapter.d.ts +8 -3
  41. package/dist/db/sqlite-adapter.d.ts.map +1 -1
  42. package/dist/db/sqlite-adapter.js +45 -3
  43. package/dist/db/sqlite-adapter.js.map +1 -1
  44. package/dist/directory.js +5 -5
  45. package/dist/extraction/extraction-version.d.ts +1 -1
  46. package/dist/extraction/extraction-version.js +1 -1
  47. package/dist/extraction/generated-detection.d.ts +42 -11
  48. package/dist/extraction/generated-detection.d.ts.map +1 -1
  49. package/dist/extraction/generated-detection.js +141 -20
  50. package/dist/extraction/generated-detection.js.map +1 -1
  51. package/dist/extraction/index.d.ts +43 -1
  52. package/dist/extraction/index.d.ts.map +1 -1
  53. package/dist/extraction/index.js +150 -43
  54. package/dist/extraction/index.js.map +1 -1
  55. package/dist/extraction/languages/arkts.d.ts +70 -6
  56. package/dist/extraction/languages/arkts.d.ts.map +1 -1
  57. package/dist/extraction/languages/arkts.js +958 -108
  58. package/dist/extraction/languages/arkts.js.map +1 -1
  59. package/dist/extraction/wasm/tree-sitter-c_sharp.wasm +0 -0
  60. package/dist/extraction/wasm/tree-sitter-cfml.wasm +0 -0
  61. package/dist/extraction/wasm/tree-sitter-cfquery.wasm +0 -0
  62. package/dist/extraction/wasm/tree-sitter-cfscript.wasm +0 -0
  63. package/dist/extraction/wasm/tree-sitter-cobol.wasm +0 -0
  64. package/dist/extraction/wasm/tree-sitter-erlang.wasm +0 -0
  65. package/dist/extraction/wasm/tree-sitter-nix.wasm +0 -0
  66. package/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
  67. package/dist/extraction/wasm/tree-sitter-vbnet.wasm +0 -0
  68. package/dist/extraction/wasm-runtime-flags.d.ts.map +1 -1
  69. package/dist/extraction/wasm-runtime-flags.js +9 -6
  70. package/dist/extraction/wasm-runtime-flags.js.map +1 -1
  71. package/dist/graph-sources.d.ts +41 -0
  72. package/dist/graph-sources.d.ts.map +1 -0
  73. package/dist/graph-sources.js +82 -0
  74. package/dist/graph-sources.js.map +1 -0
  75. package/dist/index.d.ts +19 -1
  76. package/dist/index.d.ts.map +1 -1
  77. package/dist/index.js +80 -9
  78. package/dist/index.js.map +1 -1
  79. package/dist/installer/index.d.ts.map +1 -1
  80. package/dist/installer/index.js +0 -48
  81. package/dist/installer/index.js.map +1 -1
  82. package/dist/installer/instructions-template.js +9 -9
  83. package/dist/installer/targets/antigravity.js +1 -1
  84. package/dist/installer/targets/antigravity.js.map +1 -1
  85. package/dist/installer/targets/deveco.js +1 -1
  86. package/dist/installer/targets/deveco.js.map +1 -1
  87. package/dist/installer/targets/hermes.d.ts +1 -1
  88. package/dist/installer/targets/hermes.js +2 -2
  89. package/dist/installer/targets/hermes.js.map +1 -1
  90. package/dist/installer/targets/opencode.js +1 -1
  91. package/dist/installer/targets/opencode.js.map +1 -1
  92. package/dist/installer/targets/shared.js +1 -1
  93. package/dist/installer/targets/shared.js.map +1 -1
  94. package/dist/mcp/daemon-paths.d.ts +5 -4
  95. package/dist/mcp/daemon-paths.d.ts.map +1 -1
  96. package/dist/mcp/daemon-paths.js +28 -13
  97. package/dist/mcp/daemon-paths.js.map +1 -1
  98. package/dist/mcp/daemon-registry.d.ts.map +1 -1
  99. package/dist/mcp/daemon-registry.js +4 -1
  100. package/dist/mcp/daemon-registry.js.map +1 -1
  101. package/dist/mcp/daemon.d.ts +1 -1
  102. package/dist/mcp/daemon.js +1 -1
  103. package/dist/mcp/diff-impact.d.ts +131 -0
  104. package/dist/mcp/diff-impact.d.ts.map +1 -0
  105. package/dist/mcp/diff-impact.js +385 -0
  106. package/dist/mcp/diff-impact.js.map +1 -0
  107. package/dist/mcp/engine.d.ts.map +1 -1
  108. package/dist/mcp/engine.js +12 -3
  109. package/dist/mcp/engine.js.map +1 -1
  110. package/dist/mcp/explore-dedup.d.ts +137 -0
  111. package/dist/mcp/explore-dedup.d.ts.map +1 -0
  112. package/dist/mcp/explore-dedup.js +236 -0
  113. package/dist/mcp/explore-dedup.js.map +1 -0
  114. package/dist/mcp/explore-session-state.d.ts +217 -0
  115. package/dist/mcp/explore-session-state.d.ts.map +1 -0
  116. package/dist/mcp/explore-session-state.js +322 -0
  117. package/dist/mcp/explore-session-state.js.map +1 -0
  118. package/dist/mcp/index.d.ts.map +1 -1
  119. package/dist/mcp/index.js +4 -7
  120. package/dist/mcp/index.js.map +1 -1
  121. package/dist/mcp/liveness-watchdog.js +51 -51
  122. package/dist/mcp/proxy.d.ts.map +1 -1
  123. package/dist/mcp/proxy.js +5 -14
  124. package/dist/mcp/proxy.js.map +1 -1
  125. package/dist/mcp/query-worker.d.ts +1 -1
  126. package/dist/mcp/query-worker.js +1 -1
  127. package/dist/mcp/server-instructions.d.ts +7 -2
  128. package/dist/mcp/server-instructions.d.ts.map +1 -1
  129. package/dist/mcp/server-instructions.js +125 -47
  130. package/dist/mcp/server-instructions.js.map +1 -1
  131. package/dist/mcp/session.d.ts +14 -3
  132. package/dist/mcp/session.d.ts.map +1 -1
  133. package/dist/mcp/session.js +17 -14
  134. package/dist/mcp/session.js.map +1 -1
  135. package/dist/mcp/startup-handshake.d.ts +1 -1
  136. package/dist/mcp/startup-handshake.js +1 -1
  137. package/dist/mcp/tools.d.ts +138 -12
  138. package/dist/mcp/tools.d.ts.map +1 -1
  139. package/dist/mcp/tools.js +3279 -476
  140. package/dist/mcp/tools.js.map +1 -1
  141. package/dist/resolution/callback-synthesizer.d.ts +2 -1
  142. package/dist/resolution/callback-synthesizer.d.ts.map +1 -1
  143. package/dist/resolution/callback-synthesizer.js +153 -53
  144. package/dist/resolution/callback-synthesizer.js.map +1 -1
  145. package/dist/resolution/frameworks/arkts-entry.d.ts.map +1 -1
  146. package/dist/resolution/frameworks/arkts-entry.js +20 -9
  147. package/dist/resolution/frameworks/arkts-entry.js.map +1 -1
  148. package/dist/resolution/frameworks/arkts-napi.d.ts +14 -0
  149. package/dist/resolution/frameworks/arkts-napi.d.ts.map +1 -1
  150. package/dist/resolution/frameworks/arkts-napi.js +169 -49
  151. package/dist/resolution/frameworks/arkts-napi.js.map +1 -1
  152. package/dist/resolution/index.d.ts.map +1 -1
  153. package/dist/resolution/index.js +1 -1
  154. package/dist/resolution/index.js.map +1 -1
  155. package/dist/resolution/memory-budget.d.ts +33 -0
  156. package/dist/resolution/memory-budget.d.ts.map +1 -1
  157. package/dist/resolution/memory-budget.js +58 -0
  158. package/dist/resolution/memory-budget.js.map +1 -1
  159. package/dist/resolution/resolver-pool.d.ts +2 -0
  160. package/dist/resolution/resolver-pool.d.ts.map +1 -1
  161. package/dist/resolution/resolver-pool.js +4 -0
  162. package/dist/resolution/resolver-pool.js.map +1 -1
  163. package/dist/search/query-utils.d.ts +116 -4
  164. package/dist/search/query-utils.d.ts.map +1 -1
  165. package/dist/search/query-utils.js +869 -60
  166. package/dist/search/query-utils.js.map +1 -1
  167. package/dist/spec/db/commit-node.js +4 -4
  168. package/dist/spec/db/fragment-node.js +10 -10
  169. package/dist/spec/db/fts.js +8 -8
  170. package/dist/spec/db/relations.js +88 -88
  171. package/dist/spec/db/schema.js +6 -6
  172. package/dist/spec/db/schema.sql +121 -121
  173. package/dist/spec/db/spec-node.js +4 -4
  174. package/dist/spec/llm/prompts.js +53 -53
  175. package/dist/types.d.ts +8 -0
  176. package/dist/types.d.ts.map +1 -1
  177. package/dist/ui/shimmer-progress.d.ts.map +1 -1
  178. package/dist/ui/shimmer-progress.js +4 -1
  179. package/dist/ui/shimmer-progress.js.map +1 -1
  180. package/dist/upgrade/index.d.ts +14 -26
  181. package/dist/upgrade/index.d.ts.map +1 -1
  182. package/dist/upgrade/index.js +28 -123
  183. package/dist/upgrade/index.js.map +1 -1
  184. package/dist/upgrade/remove-binary.d.ts +19 -19
  185. package/dist/upgrade/remove-binary.d.ts.map +1 -1
  186. package/dist/upgrade/remove-binary.js +20 -21
  187. package/dist/upgrade/remove-binary.js.map +1 -1
  188. package/dist/upgrade/update-check.d.ts +4 -3
  189. package/dist/upgrade/update-check.d.ts.map +1 -1
  190. package/dist/upgrade/update-check.js +4 -3
  191. package/dist/upgrade/update-check.js.map +1 -1
  192. package/package.json +65 -62
  193. package/dist/extraction/languages/arkts-viewtree.d.ts +0 -22
  194. package/dist/extraction/languages/arkts-viewtree.d.ts.map +0 -1
  195. package/dist/extraction/languages/arkts-viewtree.js +0 -133
  196. package/dist/extraction/languages/arkts-viewtree.js.map +0 -1
  197. package/dist/reasoning/config.d.ts +0 -45
  198. package/dist/reasoning/config.d.ts.map +0 -1
  199. package/dist/reasoning/config.js +0 -171
  200. package/dist/reasoning/config.js.map +0 -1
  201. package/dist/reasoning/credentials.d.ts +0 -5
  202. package/dist/reasoning/credentials.d.ts.map +0 -1
  203. package/dist/reasoning/credentials.js +0 -83
  204. package/dist/reasoning/credentials.js.map +0 -1
  205. package/dist/reasoning/login.d.ts +0 -21
  206. package/dist/reasoning/login.d.ts.map +0 -1
  207. package/dist/reasoning/login.js +0 -85
  208. package/dist/reasoning/login.js.map +0 -1
  209. package/dist/reasoning/reasoner.d.ts +0 -43
  210. package/dist/reasoning/reasoner.d.ts.map +0 -1
  211. package/dist/reasoning/reasoner.js +0 -308
  212. package/dist/reasoning/reasoner.js.map +0 -1
  213. package/dist/spec/evolve/llm-client.d.ts +0 -50
  214. package/dist/spec/evolve/llm-client.d.ts.map +0 -1
  215. package/dist/spec/evolve/llm-client.js +0 -176
  216. package/dist/spec/evolve/llm-client.js.map +0 -1
  217. package/dist/spec/evolve/logic-checker.d.ts +0 -12
  218. package/dist/spec/evolve/logic-checker.d.ts.map +0 -1
  219. package/dist/spec/evolve/logic-checker.js +0 -24
  220. package/dist/spec/evolve/logic-checker.js.map +0 -1
  221. package/dist/spec/llm/index.d.ts +0 -3
  222. package/dist/spec/llm/index.d.ts.map +0 -1
  223. package/dist/spec/llm/index.js +0 -11
  224. package/dist/spec/llm/index.js.map +0 -1
  225. package/dist/spec/mining/diff-parser.d.ts +0 -33
  226. package/dist/spec/mining/diff-parser.d.ts.map +0 -1
  227. package/dist/spec/mining/diff-parser.js +0 -166
  228. package/dist/spec/mining/diff-parser.js.map +0 -1
  229. package/dist/spec/mining/git-scanner.d.ts +0 -103
  230. package/dist/spec/mining/git-scanner.d.ts.map +0 -1
  231. package/dist/spec/mining/git-scanner.js +0 -307
  232. package/dist/spec/mining/git-scanner.js.map +0 -1
  233. package/dist/spec/mining/pipeline.d.ts +0 -53
  234. package/dist/spec/mining/pipeline.d.ts.map +0 -1
  235. package/dist/spec/mining/pipeline.js +0 -178
  236. package/dist/spec/mining/pipeline.js.map +0 -1
  237. package/dist/spec/mining/scope-resolver.d.ts +0 -45
  238. package/dist/spec/mining/scope-resolver.d.ts.map +0 -1
  239. package/dist/spec/mining/scope-resolver.js +0 -103
  240. package/dist/spec/mining/scope-resolver.js.map +0 -1
  241. package/dist/spec/mining/spec-extractor.d.ts +0 -69
  242. package/dist/spec/mining/spec-extractor.d.ts.map +0 -1
  243. package/dist/spec/mining/spec-extractor.js +0 -369
  244. package/dist/spec/mining/spec-extractor.js.map +0 -1
  245. package/dist/spec/utils.d.ts +0 -167
  246. package/dist/spec/utils.d.ts.map +0 -1
  247. package/dist/spec/utils.js +0 -463
  248. package/dist/spec/utils.js.map +0 -1
  249. package/dist/telemetry/index.d.ts +0 -143
  250. package/dist/telemetry/index.d.ts.map +0 -1
  251. package/dist/telemetry/index.js +0 -541
  252. package/dist/telemetry/index.js.map +0 -1
  253. package/scripts/_tmp-cfwk-resolve.log +0 -0
  254. package/scripts/_tmp-cfwk-sig.log +0 -0
  255. package/scripts/_tmp-cfwk-vt.log +0 -0
  256. package/scripts/add-lang/bench.sh +0 -60
  257. package/scripts/add-lang/check-grammar.mjs +0 -75
  258. package/scripts/add-lang/dump-ast.mjs +0 -103
  259. package/scripts/add-lang/verify-extraction.mjs +0 -70
  260. package/scripts/agent-eval/ab-adoption.sh +0 -91
  261. package/scripts/agent-eval/ab-hook.sh +0 -86
  262. package/scripts/agent-eval/ab-impl.sh +0 -78
  263. package/scripts/agent-eval/ab-new-vs-baseline.sh +0 -102
  264. package/scripts/agent-eval/ab-sufficiency.sh +0 -78
  265. package/scripts/agent-eval/arms-F.sh +0 -21
  266. package/scripts/agent-eval/arms-matrix.sh +0 -37
  267. package/scripts/agent-eval/audit.sh +0 -68
  268. package/scripts/agent-eval/bench-readme.sh +0 -28
  269. package/scripts/agent-eval/bench-why-repo.sh +0 -22
  270. package/scripts/agent-eval/block-read-hook.sh +0 -19
  271. package/scripts/agent-eval/hook-settings.json +0 -15
  272. package/scripts/agent-eval/itrun.sh +0 -120
  273. package/scripts/agent-eval/offload-eval-3arm.sh +0 -72
  274. package/scripts/agent-eval/offload-eval-cost.mjs +0 -133
  275. package/scripts/agent-eval/offload-eval-effort.mjs +0 -108
  276. package/scripts/agent-eval/offload-eval-frontload-matrix.sh +0 -25
  277. package/scripts/agent-eval/offload-eval-frontload.sh +0 -47
  278. package/scripts/agent-eval/offload-eval-ground-truth.json +0 -18
  279. package/scripts/agent-eval/offload-eval-hook.mjs +0 -84
  280. package/scripts/agent-eval/offload-eval-judge.mjs +0 -103
  281. package/scripts/agent-eval/offload-eval-matrix.sh +0 -20
  282. package/scripts/agent-eval/offload-eval-metrics.mjs +0 -94
  283. package/scripts/agent-eval/offload-eval-refs1.sh +0 -50
  284. package/scripts/agent-eval/offload-eval-setup.sh +0 -24
  285. package/scripts/agent-eval/offload-eval-styles.sh +0 -72
  286. package/scripts/agent-eval/offload-eval-summarize.mjs +0 -68
  287. package/scripts/agent-eval/offload-eval.md +0 -76
  288. package/scripts/agent-eval/parse-arms.mjs +0 -116
  289. package/scripts/agent-eval/parse-bench-readme.mjs +0 -84
  290. package/scripts/agent-eval/parse-run.mjs +0 -45
  291. package/scripts/agent-eval/parse-session.mjs +0 -93
  292. package/scripts/agent-eval/probe-context.mjs +0 -21
  293. package/scripts/agent-eval/probe-explore.mjs +0 -40
  294. package/scripts/agent-eval/probe-node.mjs +0 -20
  295. package/scripts/agent-eval/probe-sweep.mjs +0 -119
  296. package/scripts/agent-eval/probe-trace.mjs +0 -20
  297. package/scripts/agent-eval/redirect-read-hook.sh +0 -38
  298. package/scripts/agent-eval/repro-concurrent-explore.mjs +0 -119
  299. package/scripts/agent-eval/repro-daemon-clients.mjs +0 -125
  300. package/scripts/agent-eval/run-agent.sh +0 -34
  301. package/scripts/agent-eval/run-all.sh +0 -75
  302. package/scripts/agent-eval/run-arms.sh +0 -56
  303. package/scripts/agent-eval/seq-matrix.mjs +0 -137
  304. package/scripts/bench-arkts-init-rss.log +0 -0
  305. package/scripts/build-bundle.sh +0 -123
  306. package/scripts/exp_boundary_eval/README.md +0 -247
  307. package/scripts/exp_boundary_eval/__pycache__/_utils.cpython-310.pyc +0 -0
  308. package/scripts/exp_boundary_eval/__pycache__/_utils.cpython-38.pyc +0 -0
  309. package/scripts/exp_boundary_eval/__pycache__/analyze.cpython-310.pyc +0 -0
  310. package/scripts/exp_boundary_eval/__pycache__/analyze.cpython-38.pyc +0 -0
  311. package/scripts/exp_boundary_eval/__pycache__/deveco_arm.cpython-38.pyc +0 -0
  312. package/scripts/exp_boundary_eval/__pycache__/run_all.cpython-310.pyc +0 -0
  313. package/scripts/exp_boundary_eval/__pycache__/run_all.cpython-38.pyc +0 -0
  314. package/scripts/exp_boundary_eval/__pycache__/run_one.cpython-310.pyc +0 -0
  315. package/scripts/exp_boundary_eval/__pycache__/run_one.cpython-38.pyc +0 -0
  316. package/scripts/exp_boundary_eval/__pycache__/run_session.cpython-310.pyc +0 -0
  317. package/scripts/exp_boundary_eval/__pycache__/run_session.cpython-38.pyc +0 -0
  318. package/scripts/exp_boundary_eval/__pycache__/setup.cpython-310.pyc +0 -0
  319. package/scripts/exp_boundary_eval/__pycache__/setup.cpython-38.pyc +0 -0
  320. package/scripts/exp_boundary_eval/__pycache__/win_mcp_launcher.cpython-38.pyc +0 -0
  321. package/scripts/exp_boundary_eval/_test_mcp_chain.py +0 -78
  322. package/scripts/exp_boundary_eval/_test_stdin.py +0 -8
  323. package/scripts/exp_boundary_eval/_utils.py +0 -1116
  324. package/scripts/exp_boundary_eval/analyze.py +0 -1313
  325. package/scripts/exp_boundary_eval/deveco_arm.py +0 -519
  326. package/scripts/exp_boundary_eval/run_all.py +0 -378
  327. package/scripts/exp_boundary_eval/run_one.py +0 -165
  328. package/scripts/exp_boundary_eval/run_session.py +0 -158
  329. package/scripts/exp_boundary_eval/setup.py +0 -120
  330. package/scripts/exp_boundary_eval/win_mcp_launcher.py +0 -73
  331. package/scripts/exp_boundary_eval/win_mcp_stdio_wrap.js +0 -36
  332. package/scripts/exp_boundary_eval/win_node_launcher.py +0 -24
  333. package/scripts/extract-release-notes.mjs +0 -130
  334. package/scripts/local-install.sh +0 -41
  335. package/scripts/npm-sdk.js +0 -75
  336. package/scripts/npm-shim.js +0 -275
  337. package/scripts/ohos-sdk-publish.mjs +0 -133
  338. package/scripts/pack-npm.sh +0 -119
  339. package/scripts/prepare-release.mjs +0 -270
  340. package/scripts/probe-arkts-mem-why-run.log +0 -0
  341. package/scripts/probe-banner-livecard-ir.log +0 -0
  342. package/scripts/probe-cfwk-ast.stderr.log +0 -0
  343. package/scripts/probe-cfwk-ast.stdout.log +0 -0
  344. package/scripts/probe-cfwk-attr-shape.log +0 -0
  345. package/scripts/probe-cfwk-cfgdump.stderr.log +0 -0
  346. package/scripts/probe-cfwk-cfgdump.stdout.log +0 -0
  347. package/scripts/probe-cfwk-cvc.stderr.log +0 -0
  348. package/scripts/probe-cfwk-cvc.stdout.log +0 -0
  349. package/scripts/probe-cfwk-diag2.log +0 -0
  350. package/scripts/probe-cfwk-diag3.log +0 -0
  351. package/scripts/probe-cfwk-fedbg.stderr.log +0 -0
  352. package/scripts/probe-cfwk-fedbg.stdout.log +0 -0
  353. package/scripts/probe-cfwk-fileresult.log +0 -0
  354. package/scripts/probe-cfwk-fix.stderr.log +0 -0
  355. package/scripts/probe-cfwk-fix.stdout.log +0 -0
  356. package/scripts/probe-cfwk-fix2.stderr.log +0 -0
  357. package/scripts/probe-cfwk-fix2.stdout.log +0 -0
  358. package/scripts/probe-cfwk-fix3.stderr.log +0 -0
  359. package/scripts/probe-cfwk-fix3.stdout.log +0 -0
  360. package/scripts/probe-cfwk-foreach.log +0 -0
  361. package/scripts/probe-cfwk-getmethod-throw.log +0 -0
  362. package/scripts/probe-cfwk-hg-extract.log +0 -0
  363. package/scripts/probe-cfwk-pr1003-noprior.stderr.log +0 -0
  364. package/scripts/probe-cfwk-pr1003-noprior.stdout.log +0 -0
  365. package/scripts/probe-cfwk-pr1003.stderr.log +0 -0
  366. package/scripts/probe-cfwk-pr1003.stdout.log +0 -0
  367. package/scripts/probe-cfwk-preroot-noprior.stderr.log +0 -0
  368. package/scripts/probe-cfwk-preroot-noprior.stdout.log +0 -0
  369. package/scripts/probe-cfwk-preroot-prior.stderr.log +0 -0
  370. package/scripts/probe-cfwk-preroot-prior.stdout.log +0 -0
  371. package/scripts/probe-cfwk-preroot-skipstate.stderr.log +0 -0
  372. package/scripts/probe-cfwk-preroot-skipstate.stdout.log +0 -0
  373. package/scripts/probe-cfwk-resolve-sim.log +0 -0
  374. package/scripts/probe-cfwk-tree-shape.log +0 -0
  375. package/scripts/probe-cfwk-walk-abort.log +0 -0
  376. package/scripts/probe-cfwk.log +0 -0
  377. package/scripts/probe-force-index.log +0 -0
  378. package/scripts/probe-no-force-index.log +0 -0
  379. package/scripts/probe-samefile-ir.stderr.log +0 -0
  380. package/scripts/probe-samefile-ir.stdout.log +0 -224
  381. package/scripts/probe-sdk-vs-project.log +0 -0
  382. package/scripts/probe-viewtree-downgrade.log +0 -0
@@ -1,75 +0,0 @@
1
- #!/usr/bin/env bash
2
- # With/without A/B (and optional interactive) eval for a homegraph version on a
3
- # repo. Codegraph is the ONLY variable: both arms launch claude with
4
- # --strict-mcp-config — with = homegraph-only MCP (pointed at $CG_BIN),
5
- # without = empty MCP. Built-in Read/Grep/Bash stay available in both arms.
6
- #
7
- # Usage: run-all.sh <repo-path> "<question>" [headless|tmux|all]
8
- # Env: CG_BIN homegraph binary (default: command -v homegraph)
9
- # AGENT_EVAL_OUT output dir (default: /tmp/agent-eval)
10
- # MODEL / EFFORT claude model/effort (default: sonnet / high — the
11
- # standing A/B policy; see CLAUDE.md, don't raise)
12
- set -uo pipefail
13
-
14
- REPO="${1:?usage: run-all.sh <repo-path> \"<question>\" [headless|tmux|all]}"
15
- Q="${2:?question required}"
16
- MODE="${3:-headless}"
17
- CG_BIN="${CG_BIN:-$(command -v homegraph)}"
18
- OUT="${AGENT_EVAL_OUT:-/tmp/agent-eval}"
19
- HARNESS="$(cd "$(dirname "$0")" && pwd)"
20
- mkdir -p "$OUT"
21
-
22
- # Neutralize any ambient HomeGraph prompt-hook (~/.claude) in BOTH arms:
23
- # the hook injects homegraph context into every prompt, which contaminates
24
- # the without-arm (free structural context) and double-counts the with-arm.
25
- # The A/B's only variable must be the MCP server wired below.
26
- export HOMEGRAPH_NO_PROMPT_HOOK=1
27
-
28
- [ -n "$CG_BIN" ] || { echo "no homegraph binary on PATH (set CG_BIN)"; exit 1; }
29
- [ -d "$REPO/.homegraph" ] || { echo "no .homegraph index at $REPO — index it first"; exit 1; }
30
- case "$MODE" in headless|tmux|all) ;; *) echo "mode must be headless|tmux|all (got '$MODE')"; exit 1;; esac
31
-
32
- # MCP config files (path form avoids inline-JSON quoting through tmux).
33
- cat > "$OUT/mcp-homegraph.json" <<JSON
34
- {"mcpServers":{"homegraph":{"command":"$CG_BIN","args":["serve","--mcp","--path","$REPO"]}}}
35
- JSON
36
- echo '{"mcpServers":{}}' > "$OUT/mcp-empty.json"
37
-
38
- echo "###### homegraph: $CG_BIN"
39
- echo "###### repo: $REPO"
40
- echo "###### question: $Q"
41
- echo
42
-
43
- # Headless arm: claude -p with stream-json -> exact tool sequence + tokens/cost.
44
- headless() {
45
- local label="$1" cfg="$2"
46
- echo "############################## HEADLESS [$label] ##############################"
47
- ( cd "$REPO" && claude -p "$Q" \
48
- --output-format stream-json --verbose \
49
- --permission-mode bypassPermissions \
50
- --model "${MODEL:-sonnet}" --effort "${EFFORT:-high}" \
51
- --max-budget-usd 4 \
52
- --strict-mcp-config --mcp-config "$cfg" \
53
- > "$OUT/run-$label.jsonl" 2>"$OUT/run-$label.err" )
54
- echo "exit $? -> $OUT/run-$label.jsonl ($(wc -l < "$OUT/run-$label.jsonl" | tr -d ' ') lines)"
55
- tail -2 "$OUT/run-$label.err" 2>/dev/null
56
- node "$HARNESS/parse-run.mjs" "$OUT/run-$label.jsonl" 2>&1 || true
57
- echo
58
- }
59
-
60
- if [ "$MODE" = headless ] || [ "$MODE" = all ]; then
61
- headless "headless-with" "$OUT/mcp-homegraph.json"
62
- headless "headless-without" "$OUT/mcp-empty.json"
63
- fi
64
-
65
- if [ "$MODE" = tmux ] || [ "$MODE" = all ]; then
66
- echo "############################## INTERACTIVE [with] ##############################"
67
- CLAUDE_EXTRA_ARGS="--model ${MODEL:-sonnet} --effort ${EFFORT:-high} --strict-mcp-config --mcp-config $OUT/mcp-homegraph.json" \
68
- bash "$HARNESS/itrun.sh" "$REPO" "int-with" "$Q" 2>&1 || echo "[itrun WITH failed]"
69
- echo
70
- echo "############################## INTERACTIVE [without] ##############################"
71
- CLAUDE_EXTRA_ARGS="--model ${MODEL:-sonnet} --effort ${EFFORT:-high} --strict-mcp-config --mcp-config $OUT/mcp-empty.json" \
72
- bash "$HARNESS/itrun.sh" "$REPO" "int-without" "$Q" 2>&1 || echo "[itrun WITHOUT failed]"
73
- echo
74
- fi
75
- echo "############################## RUN-ALL COMPLETE ##############################"
@@ -1,56 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Tool-surface ablation — run ONE repo+question under ONE arm.
3
- #
4
- # Arms vary (exposed homegraph tools, trace-first steering). Tools are trimmed
5
- # SERVER-SIDE via HOMEGRAPH_MCP_TOOLS in the MCP config's `env` block, so an
6
- # ablated tool is genuinely absent from ListTools — no deferred-ToolSearch or
7
- # denied-call confound (which --disallowedTools would introduce). Steering is
8
- # injected with --append-system-prompt, so no rebuild of the shipped
9
- # server-instructions is needed to A/B it.
10
- #
11
- # A control all tools no steering
12
- # B steer all tools trace-first
13
- # C no-explore hide explore trace-first
14
- # D trace-centric hide explore+context trace-first
15
- # E control-probe hide explore+context trace-first (caller passes a NON-flow Q)
16
- #
17
- # Usage: run-arms.sh <repo-path> "<question>" <A|B|C|D|E> [run-id]
18
- set -uo pipefail
19
- REPO="${1:?repo path}"; Q="${2:?question}"; ARM="${3:?arm A-E}"; RID="${4:-1}"
20
- CG_BIN="${CG_BIN:-$(command -v homegraph)}"
21
- OUT="${ARMS_OUT:-/tmp/arms}/$(basename "$REPO")"
22
- mkdir -p "$OUT"
23
- [ -n "$CG_BIN" ] || { echo "no homegraph binary (set CG_BIN)"; exit 1; }
24
- [ -d "$REPO/.homegraph" ] || { echo "no .homegraph index at $REPO"; exit 1; }
25
-
26
- STEER='Flow questions ("how does X reach/become Y", "trace the flow", request to handler, state to render): call homegraph_trace(from,to) FIRST — one call returns the whole path. Use homegraph_context/search only to locate the two endpoint symbols if you do not know them. Do NOT reconstruct the path with repeated search/callers/explore.'
27
- KEEP_NO_EXPLORE="trace,search,node,context,callers,callees,impact,files,status"
28
- KEEP_TRACE_CENTRIC="trace,search,node,callers,callees,impact,files,status"
29
-
30
- case "$ARM" in
31
- A|G|H|I) TOOLS=""; STEERING="" ;; # no steering; H = body-trace, I = body-trace + destination callees (sufficiency)
32
- B|F) TOOLS=""; STEERING="$STEER" ;; # F = B's surface, run on the body-inlining trace build
33
- C) TOOLS="$KEEP_NO_EXPLORE"; STEERING="$STEER" ;;
34
- D|E) TOOLS="$KEEP_TRACE_CENTRIC"; STEERING="$STEER" ;;
35
- *) echo "bad arm '$ARM' (want A|B|C|D|E)"; exit 1 ;;
36
- esac
37
-
38
- CFG="$OUT/mcp-$ARM.json"
39
- if [ -n "$TOOLS" ]; then
40
- cat > "$CFG" <<JSON
41
- {"mcpServers":{"homegraph":{"command":"$CG_BIN","args":["serve","--mcp","--path","$REPO"],"env":{"HOMEGRAPH_MCP_TOOLS":"$TOOLS"}}}}
42
- JSON
43
- else
44
- cat > "$CFG" <<JSON
45
- {"mcpServers":{"homegraph":{"command":"$CG_BIN","args":["serve","--mcp","--path","$REPO"]}}}
46
- JSON
47
- fi
48
-
49
- LOG="$OUT/$ARM-r$RID.jsonl"; ERR="$OUT/$ARM-r$RID.err"
50
- ARGS=( -p "$Q" --output-format stream-json --verbose
51
- --permission-mode bypassPermissions --model "${MODEL:-sonnet}" --effort "${EFFORT:-high}" --max-budget-usd 4
52
- --strict-mcp-config --mcp-config "$CFG" )
53
- [ -n "$STEERING" ] && ARGS+=( --append-system-prompt "$STEERING" )
54
-
55
- ( cd "$REPO" && claude "${ARGS[@]}" > "$LOG" 2>"$ERR" )
56
- echo "[$(basename "$REPO") $ARM r$RID] exit $? -> $LOG ($(wc -l < "$LOG" | tr -d ' ') lines)"
@@ -1,137 +0,0 @@
1
- #!/usr/bin/env node
2
- // Mine the surviving A/B stream-json logs (/tmp/ab-matrix/<Cell>/run-headless-*.jsonl)
3
- // for what the aggregate matrix can't see: the call SEQUENCE and per-call output SIZE.
4
- //
5
- // Answers three questions:
6
- // 1. Trace adoption — on a flow question, does the with-arm actually call homegraph_trace?
7
- // 2. Payload size vs repo size — is trace path-scoped (tiny, size-independent) while
8
- // explore is breadth-scoped (grows with the repo / over-returns on small repos)?
9
- // 3. Round-trips — num_turns with vs without (the real wall-clock driver).
10
- //
11
- // Usage: node scripts/agent-eval/seq-matrix.mjs [/tmp/ab-matrix]
12
- import { readFileSync, readdirSync, existsSync } from 'fs';
13
- import { join } from 'path';
14
-
15
- const AB = process.argv[2] || '/tmp/ab-matrix';
16
- const MD = new URL('../../docs/benchmarks/homegraph-ab-matrix.md', import.meta.url).pathname;
17
-
18
- // repo -> {lang,size,files} from the published matrix table
19
- const repoMeta = {};
20
- if (existsSync(MD)) for (const line of readFileSync(MD, 'utf8').split('\n')) {
21
- const m = line.match(/^\|\s*([^|]+?)\s*\|\s*(S|M|L)\s*\|\s*`([^`]+)`\s*\|\s*(\d+)\s*\|/);
22
- if (m) repoMeta[m[3]] = { lang: m[1].trim(), size: m[2], files: +m[4] };
23
- }
24
-
25
- const cgShort = (n) => n.replace('mcp__homegraph__homegraph_', '').replace('mcp__homegraph__', '');
26
- const tag = (n) => n === 'Read' ? 'R' : n === 'Grep' ? 'G' : n === 'Glob' ? 'Gl'
27
- : n === 'Bash' ? 'B' : n === 'Task' ? 'Ag' : n === 'ToolSearch' ? 'TS'
28
- : n.includes('homegraph') ? cgShort(n) : n;
29
-
30
- function parse(file) {
31
- if (!existsSync(file)) return null;
32
- const lines = readFileSync(file, 'utf8').split('\n').filter(Boolean);
33
- const calls = []; let result = null, initCg = 0;
34
- for (const l of lines) {
35
- let ev; try { ev = JSON.parse(l); } catch { continue; }
36
- if (ev.type === 'system' && ev.subtype === 'init') initCg = (ev.tools || []).filter(t => /homegraph/.test(t)).length;
37
- if (ev.type === 'assistant') for (const b of (ev.message?.content || [])) if (b.type === 'tool_use') {
38
- const i = b.input || {};
39
- const q = i.query ?? i.symbol ?? i.task ?? (i.from && i.to ? `${i.from}->${i.to}` : (i.file_path || i.command || ''));
40
- calls.push({ id: b.id, name: b.name, q: String(q ?? '').slice(0, 38), out: 0 });
41
- }
42
- if (ev.type === 'user') for (const b of (ev.message?.content || [])) if (b.type === 'tool_result') {
43
- const c = b.content;
44
- const txt = typeof c === 'string' ? c : Array.isArray(c) ? c.map(x => x?.text || '').join('') : '';
45
- const call = calls.find(k => k.id === b.tool_use_id); if (call) call.out = txt.length;
46
- }
47
- if (ev.type === 'result') result = ev;
48
- }
49
- const cg = calls.filter(c => c.name.includes('homegraph'));
50
- const perTool = {};
51
- for (const c of cg) { const k = cgShort(c.name); (perTool[k] ??= { n: 0, out: 0 }); perTool[k].n++; perTool[k].out += c.out; }
52
- const traceIdx = cg.findIndex(c => c.name.includes('trace'));
53
- const u = result?.usage || {};
54
- return {
55
- initCg, cg, perTool,
56
- cgSeq: cg.map(c => cgShort(c.name)),
57
- seq: calls.map(c => tag(c.name)),
58
- reads: calls.filter(c => c.name === 'Read').length,
59
- greps: calls.filter(c => c.name === 'Grep').length,
60
- cgOut: cg.reduce((s, c) => s + c.out, 0),
61
- traceUsed: traceIdx >= 0,
62
- afterTrace: traceIdx >= 0 ? cg.slice(traceIdx + 1).map(c => cgShort(c.name)) : null,
63
- turns: result?.num_turns ?? null,
64
- dur: result?.duration_ms ? Math.round(result.duration_ms / 1000) : null,
65
- cost: result?.total_cost_usd || 0,
66
- };
67
- }
68
-
69
- const cells = [];
70
- for (const d of readdirSync(AB)) {
71
- const dir = join(AB, d);
72
- if (!existsSync(join(dir, 'run-headless-with.jsonl'))) continue;
73
- const log = existsSync(join(AB, d + '.log')) ? readFileSync(join(AB, d + '.log'), 'utf8') : '';
74
- const repo = (log.match(/repo:\s*\S*\/([^\s/]+)/) || [])[1] || d;
75
- const question = (log.match(/question:\s*(.+)/) || [])[1] || '';
76
- cells.push({ cell: d, repo, question, ...(repoMeta[repo] || {}),
77
- with: parse(join(dir, 'run-headless-with.jsonl')),
78
- without: parse(join(dir, 'run-headless-without.jsonl')) });
79
- }
80
- cells.sort((a, b) => (a.files || 0) - (b.files || 0));
81
-
82
- const k = (n) => (n / 1000).toFixed(1);
83
- const pad = (s, n) => String(s).padEnd(n);
84
-
85
- // ---- per-cell sequence table ----
86
- console.log('\n=== PER-CELL: with-arm homegraph sequence + payload (sorted by repo size) ===');
87
- console.log(pad('repo', 22), pad('files', 6), 'trace', pad('cg-call sequence', 40), pad('cgOutK', 7), 'turns(w/wo)');
88
- for (const c of cells) {
89
- const w = c.with;
90
- console.log(
91
- pad(c.repo, 22), pad(c.files ?? '?', 6),
92
- pad(w.traceUsed ? 'YES' : 'no', 5),
93
- pad(w.cgSeq.join(',') || '(none)', 40),
94
- pad(k(w.cgOut), 7),
95
- `${w.turns}/${c.without?.turns}`,
96
- );
97
- }
98
-
99
- // ---- trace adoption ----
100
- const flow = cells; // every matrix question is a canonical flow question by design
101
- const used = flow.filter(c => c.with.traceUsed);
102
- console.log(`\n=== TRACE ADOPTION (all ${flow.length} cells are flow questions) ===`);
103
- console.log(`trace called in ${used.length}/${flow.length} cells`);
104
- console.log('used trace:', used.map(c => c.repo).join(', ') || '(none)');
105
- if (used.length) console.log('after-trace follow-ups:', used.map(c => `${c.repo}[${c.with.afterTrace.join(',') || 'none'}]`).join(' '));
106
-
107
- // ---- payload size by repo-size tier ----
108
- const tier = (f) => f < 200 ? 'S(<200)' : f < 2000 ? 'M(<2000)' : 'L(>=2000)';
109
- const byTier = {};
110
- for (const c of cells) { (byTier[tier(c.files || 0)] ??= []).push(c.with.cgOut); }
111
- console.log('\n=== with-arm TOTAL homegraph payload by repo-size tier ===');
112
- for (const t of ['S(<200)', 'M(<2000)', 'L(>=2000)']) {
113
- const a = byTier[t] || []; if (!a.length) continue;
114
- const avg = a.reduce((s, x) => s + x, 0) / a.length;
115
- console.log(` ${pad(t, 10)} n=${a.length} avg cgOut=${k(avg)}K range ${k(Math.min(...a))}-${k(Math.max(...a))}K`);
116
- }
117
-
118
- // ---- per-tool usage + avg payload (breadth vs path evidence) ----
119
- const tot = {};
120
- for (const c of cells) for (const [name, v] of Object.entries(c.with.perTool)) {
121
- (tot[name] ??= { n: 0, out: 0 }); tot[name].n += v.n; tot[name].out += v.out;
122
- }
123
- console.log('\n=== homegraph tool usage across all cells (n calls, avg payload/call) ===');
124
- for (const [name, v] of Object.entries(tot).sort((a, b) => b[1].n - a[1].n)) {
125
- console.log(` ${pad(name, 10)} calls=${pad(v.n, 4)} avg=${k(v.out / v.n)}K/call total=${k(v.out)}K`);
126
- }
127
-
128
- // ---- round-trips ----
129
- const sum = (arr, f) => arr.reduce((s, x) => s + (f(x) || 0), 0);
130
- const wTurns = sum(cells, c => c.with.turns), woTurns = sum(cells, c => c.without?.turns);
131
- const wCalls = sum(cells, c => c.with.cg.length);
132
- const tsAll = cells.every(c => c.with.seq[0] === 'TS');
133
- console.log('\n=== ROUND-TRIPS ===');
134
- console.log(`turns: with=${wTurns} without=${woTurns} (${((1 - wTurns / woTurns) * 100).toFixed(0)}% fewer with)`);
135
- console.log(`avg turns/cell: with=${(wTurns / cells.length).toFixed(1)} without=${(woTurns / cells.length).toFixed(1)}`);
136
- console.log(`total homegraph calls=${wCalls} (avg ${(wCalls / cells.length).toFixed(1)}/cell)`);
137
- console.log(`every with-arm opens with a ToolSearch round-trip (deferred tools): ${tsAll ? 'YES — 1 fixed tax/run' : 'no'}`);
Binary file
@@ -1,123 +0,0 @@
1
- #!/usr/bin/env bash
2
- #
3
- # Build a self-contained HomeGraph bundle: an official Node runtime + the
4
- # compiled app + its production deps, so HomeGraph runs with NO system Node and
5
- # NO native build — node:sqlite is built into the bundled Node. One archive per
6
- # platform.
7
- #
8
- # Because dropping better-sqlite3 left zero native addons, the recipe is pure
9
- # file-packaging (download the target's Node, copy the app, archive) — so any
10
- # platform's bundle can be built on any OS. No cross-compile, no native runners.
11
- #
12
- # Usage:
13
- # scripts/build-bundle.sh <target> [node-version]
14
- # target: darwin-arm64 | darwin-x64 | linux-x64 | linux-arm64
15
- # | win32-x64 | win32-arm64
16
- # node-version: e.g. v24.16.0 (default below; pin for reproducible builds)
17
- #
18
- # Output:
19
- # unix: release/homegraph-<target>.tar.gz (launcher: bin/homegraph)
20
- # windows: release/homegraph-<target>.zip (launcher: bin/homegraph.cmd)
21
- set -euo pipefail
22
-
23
- TARGET="${1:?usage: build-bundle.sh <target> [node-version]}"
24
- NODE_VERSION="${2:-v24.16.0}"
25
-
26
- ROOT="$(cd "$(dirname "$0")/.." && pwd)"
27
- OUT="$ROOT/release"
28
- WORK="$(mktemp -d)"
29
- trap 'rm -rf "$WORK"' EXIT
30
-
31
- ARCH="${TARGET##*-}" # x64 | arm64
32
- OSFAM="${TARGET%-*}" # darwin | linux | win32
33
-
34
- echo "[bundle] target=${TARGET} node=${NODE_VERSION}"
35
-
36
- # 1. Download + extract the official Node runtime for the target platform.
37
- if [ "$OSFAM" = "win32" ]; then
38
- NODE_DIST="node-${NODE_VERSION}-win-${ARCH}"
39
- NODE_URL="https://nodejs.org/dist/${NODE_VERSION}/${NODE_DIST}.zip"
40
- echo "[bundle] downloading ${NODE_URL}"
41
- curl -fsSL "$NODE_URL" -o "$WORK/node.zip"
42
- if command -v unzip >/dev/null 2>&1; then
43
- unzip -q "$WORK/node.zip" -d "$WORK"
44
- else
45
- tar -xf "$WORK/node.zip" -C "$WORK" # bsdtar can read zip
46
- fi
47
- NODE_BIN="$WORK/${NODE_DIST}/node.exe"
48
- else
49
- NODE_DIST="node-${NODE_VERSION}-${TARGET}"
50
- NODE_URL="https://nodejs.org/dist/${NODE_VERSION}/${NODE_DIST}.tar.gz"
51
- echo "[bundle] downloading ${NODE_URL}"
52
- curl -fsSL "$NODE_URL" -o "$WORK/node.tar.gz"
53
- tar -xzf "$WORK/node.tar.gz" -C "$WORK"
54
- NODE_BIN="$WORK/${NODE_DIST}/bin/node"
55
- fi
56
- [ -f "$NODE_BIN" ] || { echo "[bundle] error: node binary not found ($NODE_BIN)" >&2; exit 1; }
57
-
58
- # 2. Build the app (compiled JS + copied wasm/schema assets).
59
- echo "[bundle] building app"
60
- ( cd "$ROOT" && npm run build >/dev/null )
61
-
62
- # 3. Stage: app + production-only deps (pure JS/wasm → portable across platforms).
63
- STAGE="$WORK/homegraph-${TARGET}"
64
- mkdir -p "$STAGE/lib" "$STAGE/bin"
65
- cp -R "$ROOT/dist" "$STAGE/lib/dist"
66
- cp "$ROOT/package.json" "$ROOT/package-lock.json" "$STAGE/lib/"
67
- echo "[bundle] installing production dependencies"
68
- ( cd "$STAGE/lib" && npm ci --omit=dev --ignore-scripts >/dev/null 2>&1 )
69
- rm -f "$STAGE/lib/package-lock.json"
70
-
71
- # 4. Vendored Node + launcher (the launcher uses the bundled Node by relative
72
- # path, so no system Node is ever needed).
73
- #
74
- # `--liftoff-only`: keep tree-sitter's large WASM grammars on V8's Liftoff
75
- # baseline compiler so they never reach the turboshaft optimizing tier, whose
76
- # per-compilation Zone arena OOMs the whole process (`Fatal process out of
77
- # memory: Zone`) on Node >= 22 — even with tens of GB free. The flag is read at
78
- # V8 engine init so it must be on node's command line; the parse worker inherits
79
- # it. See issues #293/#298 and src/extraction/wasm-runtime-flags.ts. (The CLI
80
- # also self-relaunches with this flag when launched without it, so non-bundled
81
- # runs are covered too; passing it here avoids that extra spawn.)
82
- if [ "$OSFAM" = "win32" ]; then
83
- cp "$NODE_BIN" "$STAGE/node.exe"
84
- printf '@"%%~dp0..\\node.exe" --liftoff-only "%%~dp0..\\lib\\dist\\bin\\homegraph.js" %%*\r\n' \
85
- > "$STAGE/bin/homegraph.cmd"
86
- else
87
- cp "$NODE_BIN" "$STAGE/node"
88
- cat > "$STAGE/bin/homegraph" <<'LAUNCH'
89
- #!/bin/sh
90
- # Resolve symlinks (e.g. the ~/.local/bin/homegraph link install.sh creates) so
91
- # we find the real bundle dir, not the symlink's location.
92
- SELF="$0"
93
- while [ -L "$SELF" ]; do
94
- target="$(readlink "$SELF")"
95
- case "$target" in
96
- /*) SELF="$target" ;;
97
- *) SELF="$(dirname "$SELF")/$target" ;;
98
- esac
99
- done
100
- DIR="$(cd "$(dirname "$SELF")/.." && pwd)"
101
- # Thread the MCP host's pid to the server's orphan watchdog (issue #1185).
102
- # $PPID is our parent — the host itself when it launched this script directly;
103
- # an already-threaded value (the npm shim sets the true host pid) wins.
104
- HOMEGRAPH_HOST_PPID="${HOMEGRAPH_HOST_PPID:-$PPID}"
105
- export HOMEGRAPH_HOST_PPID
106
- # --liftoff-only: avoid the V8 turboshaft WASM Zone OOM (issues #293/#298).
107
- exec "$DIR/node" --liftoff-only "$DIR/lib/dist/bin/homegraph.js" "$@"
108
- LAUNCH
109
- chmod +x "$STAGE/bin/homegraph"
110
- fi
111
-
112
- # 5. Archive (.zip for Windows, .tar.gz otherwise).
113
- mkdir -p "$OUT"
114
- if [ "$OSFAM" = "win32" ]; then
115
- ARCHIVE="$OUT/homegraph-${TARGET}.zip"
116
- rm -f "$ARCHIVE"
117
- ( cd "$WORK" && zip -rqX "$ARCHIVE" "homegraph-${TARGET}" )
118
- else
119
- ARCHIVE="$OUT/homegraph-${TARGET}.tar.gz"
120
- # --no-xattrs: don't embed macOS xattrs that make GNU tar warn on Linux.
121
- tar --no-xattrs -czf "$ARCHIVE" -C "$WORK" "homegraph-${TARGET}"
122
- fi
123
- echo "[bundle] wrote ${ARCHIVE} ($(du -h "$ARCHIVE" | cut -f1))"
@@ -1,247 +0,0 @@
1
- # 边界评测(exp_boundary_eval)
2
-
3
- 在 OpenHarmony **Photos** 仓库上,对比 Agent **不带 HomeGraph(baseline)** 与 **带 HomeGraph MCP(homegraph)** 的探索行为:档位切换、跨层穿透、幻觉/遗漏风险等。
4
-
5
- 跑完实验后脚本会**自动生成**各组分析报告和 A/B 对比报告(Markdown),路径会在控制台打印。
6
-
7
- ---
8
-
9
- ## 快速开始
10
-
11
- ```powershell
12
- cd D:\code\homegraph
13
- npm run build
14
-
15
- cd D:\code\homegraph\scripts\exp_boundary_eval
16
- # 一条命令:先 index/校验 → homegraph 组 → baseline 组 → 自动出报告
17
- # 不要另开终端同时跑 node … index,会与 index 抢 .homegraph 锁
18
- python run_all.py --both-arms --agent deveco --repo-path D:\code\homegraph\scripts\exp_boundary_eval\data\clone
19
- ```
20
-
21
- **前置条件**
22
-
23
- | 项 | 说明 |
24
- |----|------|
25
- | Python | 3.8+(Windows 建议用本机 Python,不要用 WSL 跑 DevEco) |
26
- | Agent CLI | `deveco` / `claude` 等已在 PATH;DevEco 可用 `DEVECO_BIN` 指定路径 |
27
- | git | 用于 clone / 重置测试仓库 |
28
- | homegraph 组 | 在仓库根目录先执行 `npm run build` |
29
-
30
- **DevEco 模型**:无需在本脚本里配置;使用 DevEco Studio / CLI 里已配好的默认模型即可。
31
-
32
- ---
33
-
34
- ## 目录与文件说明
35
-
36
- ```
37
- scripts/exp_boundary_eval/
38
- ├── README.md ← 本文件
39
- ├── run_all.py ← 主入口:批量跑实验,跑完自动 analyze + 对比报告
40
- ├── run_one.py ← 单个 one-shot 实验
41
- ├── run_session.py ← 多轮会话实验(实验 5)
42
- ├── analyze.py ← 分析脚本(也可单独对历史结果目录运行)
43
- ├── setup.py ← 每次实验前:重置仓库、清 CLAUDE.md、生成 session
44
- ├── _utils.py ← 公共工具:Agent 注册、输出解析、目录创建
45
- │
46
- ├── data/ ← 配置与共用 clone(clone/ 在 .gitignore)
47
- │ ├── experiments.json ← 实验定义:id、标题、prompt、max_turns
48
- │ ├── agents.json ← Agent CLI 定义:binary、flags、parser
49
- │ └── clone/ ← A/B 共用 git clone(run_all --both-arms 自动维护)
50
- │
51
- ├── output/ ← 实验产物与报告(gitignore)
52
- │ ├── baseline/{agent}/{时间戳}/ ← 无 HomeGraph 组
53
- │ │ ├── run_manifest.json
54
- │ │ ├── analysis_report.md ← 单组分析报告(跑完自动生成)
55
- │ │ └── {实验ID}/
56
- │ │ ├── prompt.txt ← 发给 Agent 的 prompt
57
- │ │ ├── stream_output.jsonl ← Agent 原始 JSON 流
58
- │ │ ├── raw_output.txt ← 解析出的文本回复
59
- │ │ └── results.json ← 汇总指标(耗时、工具、Token…)
60
- │ ├── homegraph/{agent}/{时间戳}/ ← 有 HomeGraph 组(结构同上)
61
- │ └── compare/{agent}/{时间戳}/ ← A/B 对比报告(--both-arms 跑完自动生成)
62
- │ ├── ab_compare_report.md
63
- │ └── compare_manifest.json ← 指向两组原始目录与报告
64
- │
65
- └── log/ ← 运行日志与 state(gitignore)
66
- └── {组别}/{agent}/{时间戳}/
67
- ├── run.log
68
- ├── run_manifest.json
69
- └── {实验ID}/state.json
70
- ```
71
-
72
- ### 配置文件
73
-
74
- **`data/experiments.json`** — 每个实验一条记录:
75
-
76
- - `id`:如 `1-1`、`2`、`5`
77
- - `type`:`oneshot`(默认)或 `session`(实验 5)
78
- - `title` / `prompt`:任务描述
79
- - `max_turns`:回合上限(DevEco 无此 flag 时脚本会忽略)
80
-
81
- **`data/agents.json`** — 支持的 Agent:
82
-
83
- - `deveco`、`claude`、`cursor`、`codex`、`opencode`、`generic`、`text`
84
- - 字段 `binary`、`flags`、`parser`、`missing`(不支持的 CLI 参数)
85
-
86
- ---
87
-
88
- ## 常用命令
89
-
90
- ### A/B 完整评测(推荐)
91
-
92
- ```powershell
93
- # 默认跑 1-1、1-2、1-3;自动 clone;跑完出 baseline 报告 + homegraph 报告 + 对比报告
94
- python run_all.py --both-arms --agent deveco
95
-
96
- # 使用本地已有 checkout(跳过 clone)
97
- python run_all.py --both-arms --agent deveco --repo-path D:\path\to\applications_photos
98
- ```
99
-
100
- ### 只跑一组
101
-
102
- ```powershell
103
- python run_all.py --agent deveco --arm baseline
104
- python run_all.py --agent deveco --arm homegraph
105
- ```
106
-
107
- ### 跑全部 11 项实验
108
-
109
- ```powershell
110
- python run_all.py --both-arms --agent deveco 1-1 1-2 1-3 2 3-1 3-2 3-3 4-1 4-2 4-3 5
111
- ```
112
-
113
- ### 单个实验(需先设仓库路径)
114
-
115
- ```powershell
116
- $env:REPO_PATH = "D:\code\homegraph\scripts\exp_boundary_eval\data\clone"
117
- python run_one.py 1-1 --agent deveco
118
- python run_session.py 5 --agent deveco
119
- ```
120
-
121
- ### 手动分析(补跑或只看历史结果)
122
-
123
- ```powershell
124
- python analyze.py output\baseline\deveco\20260627_110832
125
- python analyze.py output\homegraph\deveco\20260627_111331
126
- ```
127
-
128
- 对比报告仅在 `run_all.py --both-arms` 跑完时自动生成;也可在 Python 里调用 `analyze.compare_runs(baseline_dir, homegraph_dir, ...)`。
129
-
130
- ---
131
-
132
- ## 跑完后的报告
133
-
134
- `run_all.py` 结束时控制台会打印类似:
135
-
136
- ```
137
- ==== 报告已生成 ====
138
- Baseline 报告: ...\output\baseline\deveco\...\analysis_report.md
139
- HomeGraph 报告: ...\output\homegraph\deveco\...\analysis_report.md
140
- A/B 对比报告 : ...\output\compare\deveco\...\ab_compare_report.md
141
- ```
142
-
143
- | 报告 | 内容 |
144
- |------|------|
145
- | `analysis_report.md` | 单组:各实验表格、7 维度评分、档位/幻觉/跨层等解读 |
146
- | `ab_compare_report.md` | 两组:墙钟耗时、工具调用、Token、逐实验对比、评分对比 |
147
-
148
- **对比指标**(来自 `results.json` / stream 解析):
149
-
150
- | 指标 | 字段 |
151
- |------|------|
152
- | 单实验耗时 | `duration_s` |
153
- | 工具调用 | `tool_calls` |
154
- | Token | `input_tokens`、`output_tokens` |
155
- | 读取/编辑文件 | `files_read`、`files_edited` |
156
- | Grep/Glob | `tool_names` 中的 search 类工具 |
157
-
158
- **内存**:当前未采集进程内存;对比报告中该列为「未采集」。需要时可自行加外部 profiling。
159
-
160
- ---
161
-
162
- ## 默认实验(1-1 / 1-2 / 1-3)
163
-
164
- 档位切换边界探测:信息缺口从小到大,观察 Agent 是否从「快速检索」升级到「深度探索」。
165
-
166
- ---
167
-
168
- ## 常见问题
169
-
170
- ### WSL 里 `deveco --version` 失败
171
-
172
- DevEco Code **没有 Linux 版**。请在 **Windows** 或 **macOS** 上跑本评测。
173
-
174
- ```powershell
175
- npm install -g @deveco/deveco-code
176
- deveco --version
177
- cd D:\code\homegraph\scripts\exp_boundary_eval
178
- python run_all.py --both-arms --agent deveco
179
- ```
180
-
181
- WSL 内路径仅作诊断,不能真正跑 DevEco:
182
-
183
- ```bash
184
- export DEVECO_BIN=/mnt/c/Users/.../AppData/Roaming/npm/deveco
185
- ```
186
-
187
- ### homegraph 组 indexing 失败
188
-
189
- 在 homegraph 仓库根目录执行:
190
-
191
- ```powershell
192
- cd D:\code\homegraph
193
- npm run build
194
- ```
195
-
196
- ### Python 3.8 on Windows 编码错误
197
-
198
- 脚本已对 JSON 读写和终端输出做 UTF-8 处理;若仍乱码,可在 PowerShell 中先执行 `chcp 65001`。
199
-
200
- ---
201
-
202
- ## A/B 机制(真实对照)
203
-
204
- 两组差异由 `deveco_arm.py` 写入测试仓库的 `.deveco/deveco.jsonc`:
205
-
206
- | 组别 | MCP | Agent Prompt | homegraph 工具 |
207
- |------|-----|--------------|----------------|
208
- | **baseline** | 无 | 仅用 grep/read | `deny` |
209
- | **homegraph** | `homegraph serve --mcp --path <repo>` | 优先 `homegraph_explore` | 启用 |
210
-
211
- - 每次实验前 `setup.py` 会重置仓库并**重新写入**上述配置;`deveco run --dir <repo>` 读取项目级配置。
212
- - homegraph 组的 `git clean` 保留 `.homegraph/` 索引,避免重复 `init -i`。
213
- - 对比报告 **A/B 有效性** 一节检查:baseline 的 HomeGraph 工具调用应为 0,homegraph 组应 > 0。
214
-
215
- ---
216
-
217
- ## 与 HomeGraph 主仓库的关系
218
-
219
- - **homegraph 组**索引策略(`deveco_arm.ensure_homegraph_index`):
220
- - 无 `.homegraph/` → `homegraph init <repo>`(若仍不健康则继续 `homegraph index`)
221
- - 已初始化 → **`homegraph index` 全量重建**(不用 `sync`)
222
- - **`--both-arms`**:**一启动就先** index/校验 `.homegraph/`,再跑 **homegraph → baseline**(先看到 HG 是否生效)
223
- - 单独 `--arm homegraph`:组开头同样阻塞 index
224
- - 每个实验前的 `setup.py` **不再**重复 index
225
- - **不要**在跑 `run_all.py` 的同时另开终端 `node … index`(会并发写 `.homegraph`)
226
-
227
- ### 复用已有 `.homegraph/`(跳过 index)
228
-
229
- **可以**:把整个 `.homegraph/` 目录复制到目标仓库根目录,只要:
230
-
231
- 1. **相同代码** — 同一 git commit(DB 里存的是相对路径 + 文件 content hash,不绑定绝对路径)
232
- 2. **索引完整** — 尤其 Photos 级仓库需含 ArkTS Scene(`homegraph status -j` 里 `struct`/`component` > 0、`languages` 含 `arkts`)
233
- 3. **HomeGraph 版本** — 最好用**同一套** `dist/bin/homegraph.js` 构建;若 extraction 版本落后,`status` 会标 `reindexRecommended`,脚本会拒绝 `--skip-index`
234
-
235
- 复制示例(Windows):
236
-
237
- ```powershell
238
- # 源:已在 Linux/Mac 上 index 成功的 checkout
239
- Copy-Item -Recurse D:\backup\applications_photos\.homegraph D:\code\applications_photos\.homegraph
240
-
241
- # 跑评测,不再 index
242
- python run_all.py --both-arms --agent deveco --repo-path D:\code\applications_photos --skip-index
243
- ```
244
-
245
- 单独 homegraph 组同样支持:`python run_all.py --arm homegraph --skip-index --repo-path …`
246
-
247
- 若仓库相对索引有文件变更,脚本会 **warn** 但仍继续(MCP 可能对改过的文件不准);严重不完整则 **abort** 并提示去掉 `--skip-index` 或 `homegraph sync`。