dexbot 1.4.21 → 1.4.22

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 (595) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +1 -1
  3. package/analysis/ama_fitting/analyze_ama_price_changes.ts +7 -3
  4. package/analysis/ama_fitting/analyze_lambda_vs_slow.ts +3 -3
  5. package/analysis/ama_fitting/calibrate_convergence_er.ts +7 -5
  6. package/analysis/ama_fitting/fetch_lp_candles.ts +8 -3
  7. package/analysis/ama_fitting/generate_unified_comparison_chart.ts +30 -67
  8. package/analysis/ama_fitting/optimizer_high_resolution.ts +22 -13
  9. package/analysis/ama_fitting/package.json +1 -1
  10. package/analysis/analyze_derivatives.ts +4 -4
  11. package/analysis/analyze_dynamic_weight.ts +21 -5
  12. package/analysis/analyze_kalman.ts +54 -25
  13. package/analysis/analyze_regime.ts +2 -2
  14. package/analysis/analyze_regime_windows.ts +27 -19
  15. package/analysis/analyze_risk_profile.ts +3 -3
  16. package/analysis/analyze_trade_heatmap.ts +3 -3
  17. package/analysis/analyze_volatility.ts +2 -2
  18. package/analysis/bot_fitting/README.md +93 -19
  19. package/analysis/bot_fitting/backtest_ama_sweep.ts +316 -199
  20. package/analysis/bot_fitting/backtest_bot_fitting.ts +520 -85
  21. package/analysis/bot_fitting/shared_utils.ts +15 -9
  22. package/analysis/bot_key_utils.ts +13 -6
  23. package/analysis/bot_usage/discover_bot_accounts.ts +5 -3
  24. package/analysis/bot_usage/kibana_bot_queries.ts +1 -1
  25. package/analysis/chart_css.ts +6 -4
  26. package/analysis/chart_ui.ts +0 -1
  27. package/analysis/chart_utils.ts +11 -2
  28. package/analysis/derivative_chart_generator.ts +2 -2
  29. package/analysis/price_sources.ts +8 -2
  30. package/analysis/resolve_source.ts +1 -1
  31. package/analysis/results/ama_sweep_results_lp_pool_133_1h.json +2455 -0
  32. package/analysis/results/bot_fitting_results_lp_pool_133_1h.json +218 -0
  33. package/analysis/trade_profitability.ts +61 -28
  34. package/analysis/tradingview/analyze_tradingview.ts +1 -1
  35. package/analysis/tradingview/h-bts_tradingview.html +1570 -0
  36. package/analysis/tradingview/t-bts_tradingview.html +1570 -0
  37. package/analysis/tradingview/tradingview_uplot_chart_generator.ts +302 -74
  38. package/analysis/trend_detection/DYNAMIC_WEIGHT_RESEARCH.md +1 -1
  39. package/analysis/trend_detection/derivative_analyzer.ts +12 -3
  40. package/analysis/trend_detection/dynamic_weight_chart_generator.ts +25 -27
  41. package/analysis/trend_detection/hurst_analyzer.ts +1 -1
  42. package/analysis/trend_detection/kalman_chart_generator.ts +42 -14
  43. package/analysis/trend_detection/package.json +1 -1
  44. package/analysis/trend_detection/regime_chart_generator.ts +39 -19
  45. package/analysis/trend_detection/tests/test_kalman_trend.ts +1 -1
  46. package/analysis/trend_detection/tests/test_kalman_velocity_smoothing.ts +1 -1
  47. package/analysis/trend_detection/volatility_chart_generator.ts +1 -1
  48. package/claw/index.ts +1 -1
  49. package/claw/modules/claw_bridge.ts +3 -3
  50. package/claw/modules/claw_catalog.ts +1 -1
  51. package/claw/modules/claw_launcher.ts +1 -1
  52. package/claw/modules/claw_skill_md.ts +7 -10
  53. package/claw/modules/credit_runtime_adapter.ts +1 -1
  54. package/claw/modules/decision_loop.ts +5 -9
  55. package/claw/modules/dexbot_bridge.ts +7 -7
  56. package/claw/modules/feed_price_source.ts +1 -1
  57. package/claw/modules/kibana_price_source.ts +1 -1
  58. package/claw/modules/launcher_mode_detector.ts +1 -1
  59. package/claw/modules/launcher_paths.ts +1 -1
  60. package/claw/modules/position_discovery.ts +1 -1
  61. package/claw/modules/position_health.ts +1 -1
  62. package/claw/package.json +3 -3
  63. package/claw/runtimes/openclaw-plugin/openclaw.plugin.json +1 -1
  64. package/claw/runtimes/openclaw-plugin/package.json +1 -1
  65. package/claw/skills/launcher-ops/references/launcher-workflow.md +2 -2
  66. package/claw/tests/package.json +1 -1
  67. package/claw/tests/test_claw_bridge.ts +45 -21
  68. package/claw/tests/test_claw_catalog_and_credentials.ts +8 -4
  69. package/claw/tests/test_claw_chain_layer.ts +39 -19
  70. package/claw/tests/test_claw_data_flow.ts +28 -20
  71. package/claw/tests/test_claw_domain_logic.ts +25 -19
  72. package/claw/tests/test_claw_manifest_and_matrix.ts +23 -3
  73. package/claw/tests/test_claw_mcp_transport.ts +13 -8
  74. package/claw/tests/test_claw_regressions.ts +254 -128
  75. package/claw/tests/test_claw_skill_generation.ts +1 -1
  76. package/claw/tests/test_nullclaw_tmp_integration.ts +2 -3
  77. package/claw/tests/test_position_health.ts +1 -77
  78. package/claw/tests/test_position_manager.ts +20 -18
  79. package/claw/tests/test_position_manager_watch_health.ts +39 -43
  80. package/claw/tests/test_short_mpa_strategy.ts +20 -17
  81. package/claw/tsconfig.json +4 -3
  82. package/dist/analysis/ama_fitting/analyze_ama_price_changes.js +7 -3
  83. package/dist/analysis/ama_fitting/analyze_ama_price_changes.js.map +1 -1
  84. package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.js +3 -3
  85. package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.js.map +1 -1
  86. package/dist/analysis/ama_fitting/calibrate_convergence_er.js +7 -5
  87. package/dist/analysis/ama_fitting/calibrate_convergence_er.js.map +1 -1
  88. package/dist/analysis/ama_fitting/fetch_lp_candles.js +8 -3
  89. package/dist/analysis/ama_fitting/fetch_lp_candles.js.map +1 -1
  90. package/dist/analysis/ama_fitting/generate_unified_comparison_chart.d.ts +2 -2
  91. package/dist/analysis/ama_fitting/generate_unified_comparison_chart.d.ts.map +1 -1
  92. package/dist/analysis/ama_fitting/generate_unified_comparison_chart.js +31 -75
  93. package/dist/analysis/ama_fitting/generate_unified_comparison_chart.js.map +1 -1
  94. package/dist/analysis/ama_fitting/optimizer_high_resolution.d.ts.map +1 -1
  95. package/dist/analysis/ama_fitting/optimizer_high_resolution.js +21 -13
  96. package/dist/analysis/ama_fitting/optimizer_high_resolution.js.map +1 -1
  97. package/dist/analysis/analyze_derivatives.d.ts +0 -18
  98. package/dist/analysis/analyze_derivatives.d.ts.map +1 -1
  99. package/dist/analysis/analyze_derivatives.js +4 -4
  100. package/dist/analysis/analyze_derivatives.js.map +1 -1
  101. package/dist/analysis/analyze_dynamic_weight.d.ts +0 -11
  102. package/dist/analysis/analyze_dynamic_weight.d.ts.map +1 -1
  103. package/dist/analysis/analyze_dynamic_weight.js +19 -5
  104. package/dist/analysis/analyze_dynamic_weight.js.map +1 -1
  105. package/dist/analysis/analyze_kalman.d.ts +0 -10
  106. package/dist/analysis/analyze_kalman.d.ts.map +1 -1
  107. package/dist/analysis/analyze_kalman.js +51 -26
  108. package/dist/analysis/analyze_kalman.js.map +1 -1
  109. package/dist/analysis/analyze_regime.d.ts +0 -17
  110. package/dist/analysis/analyze_regime.d.ts.map +1 -1
  111. package/dist/analysis/analyze_regime.js +2 -2
  112. package/dist/analysis/analyze_regime.js.map +1 -1
  113. package/dist/analysis/analyze_regime_windows.d.ts +0 -16
  114. package/dist/analysis/analyze_regime_windows.d.ts.map +1 -1
  115. package/dist/analysis/analyze_regime_windows.js +28 -21
  116. package/dist/analysis/analyze_regime_windows.js.map +1 -1
  117. package/dist/analysis/analyze_risk_profile.js +3 -3
  118. package/dist/analysis/analyze_risk_profile.js.map +1 -1
  119. package/dist/analysis/analyze_trade_heatmap.js +3 -3
  120. package/dist/analysis/analyze_trade_heatmap.js.map +1 -1
  121. package/dist/analysis/analyze_volatility.d.ts +0 -19
  122. package/dist/analysis/analyze_volatility.d.ts.map +1 -1
  123. package/dist/analysis/analyze_volatility.js +2 -2
  124. package/dist/analysis/analyze_volatility.js.map +1 -1
  125. package/dist/analysis/bot_fitting/backtest_ama_sweep.d.ts +30 -14
  126. package/dist/analysis/bot_fitting/backtest_ama_sweep.d.ts.map +1 -1
  127. package/dist/analysis/bot_fitting/backtest_ama_sweep.js +330 -193
  128. package/dist/analysis/bot_fitting/backtest_ama_sweep.js.map +1 -1
  129. package/dist/analysis/bot_fitting/backtest_bot_fitting.d.ts +136 -1
  130. package/dist/analysis/bot_fitting/backtest_bot_fitting.d.ts.map +1 -1
  131. package/dist/analysis/bot_fitting/backtest_bot_fitting.js +527 -83
  132. package/dist/analysis/bot_fitting/backtest_bot_fitting.js.map +1 -1
  133. package/dist/analysis/bot_fitting/shared_utils.d.ts +1 -1
  134. package/dist/analysis/bot_fitting/shared_utils.d.ts.map +1 -1
  135. package/dist/analysis/bot_fitting/shared_utils.js +14 -8
  136. package/dist/analysis/bot_fitting/shared_utils.js.map +1 -1
  137. package/dist/analysis/bot_key_utils.d.ts.map +1 -1
  138. package/dist/analysis/bot_key_utils.js +13 -6
  139. package/dist/analysis/bot_key_utils.js.map +1 -1
  140. package/dist/analysis/bot_usage/discover_bot_accounts.js +5 -3
  141. package/dist/analysis/bot_usage/discover_bot_accounts.js.map +1 -1
  142. package/dist/analysis/bot_usage/kibana_bot_queries.d.ts.map +1 -1
  143. package/dist/analysis/bot_usage/kibana_bot_queries.js +1 -1
  144. package/dist/analysis/bot_usage/kibana_bot_queries.js.map +1 -1
  145. package/dist/analysis/chart_css.d.ts +3 -1
  146. package/dist/analysis/chart_css.d.ts.map +1 -1
  147. package/dist/analysis/chart_css.js +6 -3
  148. package/dist/analysis/chart_css.js.map +1 -1
  149. package/dist/analysis/chart_ui.d.ts.map +1 -1
  150. package/dist/analysis/chart_ui.js.map +1 -1
  151. package/dist/analysis/chart_utils.d.ts.map +1 -1
  152. package/dist/analysis/chart_utils.js +15 -2
  153. package/dist/analysis/chart_utils.js.map +1 -1
  154. package/dist/analysis/derivative_chart_generator.js +2 -2
  155. package/dist/analysis/derivative_chart_generator.js.map +1 -1
  156. package/dist/analysis/price_sources.d.ts +1 -0
  157. package/dist/analysis/price_sources.d.ts.map +1 -1
  158. package/dist/analysis/price_sources.js +8 -2
  159. package/dist/analysis/price_sources.js.map +1 -1
  160. package/dist/analysis/resolve_source.d.ts.map +1 -1
  161. package/dist/analysis/resolve_source.js +1 -1
  162. package/dist/analysis/resolve_source.js.map +1 -1
  163. package/dist/analysis/trade_profitability.d.ts.map +1 -1
  164. package/dist/analysis/trade_profitability.js +58 -29
  165. package/dist/analysis/trade_profitability.js.map +1 -1
  166. package/dist/analysis/tradingview/analyze_tradingview.js +1 -1
  167. package/dist/analysis/tradingview/analyze_tradingview.js.map +1 -1
  168. package/dist/analysis/tradingview/tradingview_uplot_chart_generator.d.ts.map +1 -1
  169. package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js +302 -74
  170. package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js.map +1 -1
  171. package/dist/analysis/trend_detection/derivative_analyzer.d.ts +1 -0
  172. package/dist/analysis/trend_detection/derivative_analyzer.d.ts.map +1 -1
  173. package/dist/analysis/trend_detection/derivative_analyzer.js +12 -3
  174. package/dist/analysis/trend_detection/derivative_analyzer.js.map +1 -1
  175. package/dist/analysis/trend_detection/dynamic_weight_chart_generator.d.ts.map +1 -1
  176. package/dist/analysis/trend_detection/dynamic_weight_chart_generator.js +26 -27
  177. package/dist/analysis/trend_detection/dynamic_weight_chart_generator.js.map +1 -1
  178. package/dist/analysis/trend_detection/hurst_analyzer.d.ts +1 -1
  179. package/dist/analysis/trend_detection/hurst_analyzer.d.ts.map +1 -1
  180. package/dist/analysis/trend_detection/hurst_analyzer.js +1 -1
  181. package/dist/analysis/trend_detection/hurst_analyzer.js.map +1 -1
  182. package/dist/analysis/trend_detection/kalman_chart_generator.d.ts.map +1 -1
  183. package/dist/analysis/trend_detection/kalman_chart_generator.js +41 -13
  184. package/dist/analysis/trend_detection/kalman_chart_generator.js.map +1 -1
  185. package/dist/analysis/trend_detection/regime_chart_generator.d.ts.map +1 -1
  186. package/dist/analysis/trend_detection/regime_chart_generator.js +38 -19
  187. package/dist/analysis/trend_detection/regime_chart_generator.js.map +1 -1
  188. package/dist/analysis/trend_detection/tests/test_kalman_trend.js +1 -1
  189. package/dist/analysis/trend_detection/tests/test_kalman_trend.js.map +1 -1
  190. package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.js +1 -1
  191. package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.js.map +1 -1
  192. package/dist/analysis/trend_detection/volatility_chart_generator.js +1 -1
  193. package/dist/analysis/trend_detection/volatility_chart_generator.js.map +1 -1
  194. package/dist/bot.js +1 -1
  195. package/dist/bot.js.map +1 -1
  196. package/dist/credential-daemon.d.ts +1 -1
  197. package/dist/credential-daemon.js +1 -1
  198. package/dist/dexbot.d.ts.map +1 -1
  199. package/dist/dexbot.js +7 -8
  200. package/dist/dexbot.js.map +1 -1
  201. package/dist/market_adapter/ama_signal_runner.js +3 -1
  202. package/dist/market_adapter/ama_signal_runner.js.map +1 -1
  203. package/dist/market_adapter/candle_utils.d.ts +1 -3
  204. package/dist/market_adapter/candle_utils.d.ts.map +1 -1
  205. package/dist/market_adapter/candle_utils.js +1 -11
  206. package/dist/market_adapter/candle_utils.js.map +1 -1
  207. package/dist/market_adapter/core/asymmetric_bounds.d.ts.map +1 -1
  208. package/dist/market_adapter/core/asymmetric_bounds.js +33 -30
  209. package/dist/market_adapter/core/asymmetric_bounds.js.map +1 -1
  210. package/dist/market_adapter/core/config_normalizers.d.ts.map +1 -1
  211. package/dist/market_adapter/core/config_normalizers.js +10 -1
  212. package/dist/market_adapter/core/config_normalizers.js.map +1 -1
  213. package/dist/market_adapter/core/kibana_candles.d.ts +18 -42
  214. package/dist/market_adapter/core/kibana_candles.d.ts.map +1 -1
  215. package/dist/market_adapter/core/kibana_candles.js +101 -7
  216. package/dist/market_adapter/core/kibana_candles.js.map +1 -1
  217. package/dist/market_adapter/core/kibana_client.d.ts +0 -14
  218. package/dist/market_adapter/core/kibana_client.d.ts.map +1 -1
  219. package/dist/market_adapter/core/kibana_client.js +39 -6
  220. package/dist/market_adapter/core/kibana_client.js.map +1 -1
  221. package/dist/market_adapter/core/kibana_market_candles.d.ts +0 -27
  222. package/dist/market_adapter/core/kibana_market_candles.d.ts.map +1 -1
  223. package/dist/market_adapter/core/kibana_market_candles.js +1 -1
  224. package/dist/market_adapter/core/kibana_market_candles.js.map +1 -1
  225. package/dist/market_adapter/core/market_adapter_service.d.ts +21 -11
  226. package/dist/market_adapter/core/market_adapter_service.d.ts.map +1 -1
  227. package/dist/market_adapter/core/market_adapter_service.js +95 -37
  228. package/dist/market_adapter/core/market_adapter_service.js.map +1 -1
  229. package/dist/market_adapter/core/signals/hurst_analyzer.d.ts +10 -1
  230. package/dist/market_adapter/core/signals/hurst_analyzer.d.ts.map +1 -1
  231. package/dist/market_adapter/core/signals/hurst_analyzer.js +28 -17
  232. package/dist/market_adapter/core/signals/hurst_analyzer.js.map +1 -1
  233. package/dist/market_adapter/core/signals/kalman_trend_analyzer.d.ts +5 -0
  234. package/dist/market_adapter/core/signals/kalman_trend_analyzer.d.ts.map +1 -1
  235. package/dist/market_adapter/core/signals/kalman_trend_analyzer.js +24 -24
  236. package/dist/market_adapter/core/signals/kalman_trend_analyzer.js.map +1 -1
  237. package/dist/market_adapter/core/signals/kalman_velocity_smoothing.d.ts.map +1 -1
  238. package/dist/market_adapter/core/signals/kalman_velocity_smoothing.js +5 -1
  239. package/dist/market_adapter/core/signals/kalman_velocity_smoothing.js.map +1 -1
  240. package/dist/market_adapter/core/signals/permutation_entropy_analyzer.d.ts.map +1 -1
  241. package/dist/market_adapter/core/signals/permutation_entropy_analyzer.js +20 -3
  242. package/dist/market_adapter/core/signals/permutation_entropy_analyzer.js.map +1 -1
  243. package/dist/market_adapter/core/strategies/ama.js +1 -1
  244. package/dist/market_adapter/core/strategies/ama.js.map +1 -1
  245. package/dist/market_adapter/core/strategies/ama_slope_model.d.ts +2 -2
  246. package/dist/market_adapter/core/strategies/ama_slope_model.d.ts.map +1 -1
  247. package/dist/market_adapter/core/strategies/ama_slope_model.js +16 -4
  248. package/dist/market_adapter/core/strategies/ama_slope_model.js.map +1 -1
  249. package/dist/market_adapter/core/strategies/atr/calculator.d.ts +4 -3
  250. package/dist/market_adapter/core/strategies/atr/calculator.d.ts.map +1 -1
  251. package/dist/market_adapter/core/strategies/atr/calculator.js +16 -8
  252. package/dist/market_adapter/core/strategies/atr/calculator.js.map +1 -1
  253. package/dist/market_adapter/core/strategies/collateral_manager.d.ts.map +1 -1
  254. package/dist/market_adapter/core/strategies/collateral_manager.js +8 -3
  255. package/dist/market_adapter/core/strategies/collateral_manager.js.map +1 -1
  256. package/dist/market_adapter/core/strategies/dynamic_weight_series.d.ts +40 -1
  257. package/dist/market_adapter/core/strategies/dynamic_weight_series.d.ts.map +1 -1
  258. package/dist/market_adapter/core/strategies/dynamic_weight_series.js +116 -2
  259. package/dist/market_adapter/core/strategies/dynamic_weight_series.js.map +1 -1
  260. package/dist/market_adapter/core/strategies/regime_gate.d.ts.map +1 -1
  261. package/dist/market_adapter/core/strategies/regime_gate.js +26 -20
  262. package/dist/market_adapter/core/strategies/regime_gate.js.map +1 -1
  263. package/dist/market_adapter/core/strategies/volatility_shift.d.ts.map +1 -1
  264. package/dist/market_adapter/core/strategies/volatility_shift.js +3 -0
  265. package/dist/market_adapter/core/strategies/volatility_shift.js.map +1 -1
  266. package/dist/market_adapter/inputs/fetch_cex_synthetic_data.js +69 -55
  267. package/dist/market_adapter/inputs/fetch_cex_synthetic_data.js.map +1 -1
  268. package/dist/market_adapter/inputs/fetch_lp_data.d.ts +0 -26
  269. package/dist/market_adapter/inputs/fetch_lp_data.d.ts.map +1 -1
  270. package/dist/market_adapter/inputs/fetch_lp_data.js +67 -14
  271. package/dist/market_adapter/inputs/fetch_lp_data.js.map +1 -1
  272. package/dist/market_adapter/inputs/kibana_source.d.ts +4 -28
  273. package/dist/market_adapter/inputs/kibana_source.d.ts.map +1 -1
  274. package/dist/market_adapter/inputs/kibana_source.js +5 -2
  275. package/dist/market_adapter/inputs/kibana_source.js.map +1 -1
  276. package/dist/market_adapter/lp_chart_core.js +1 -1
  277. package/dist/market_adapter/lp_chart_core.js.map +1 -1
  278. package/dist/market_adapter/lp_chart_runner.d.ts +10 -1
  279. package/dist/market_adapter/lp_chart_runner.d.ts.map +1 -1
  280. package/dist/market_adapter/lp_chart_runner.js +2 -2
  281. package/dist/market_adapter/lp_chart_runner.js.map +1 -1
  282. package/dist/market_adapter/lp_chart_strategy_loader.js +1 -1
  283. package/dist/market_adapter/lp_chart_strategy_loader.js.map +1 -1
  284. package/dist/market_adapter/market_adapter.d.ts +1 -2
  285. package/dist/market_adapter/market_adapter.d.ts.map +1 -1
  286. package/dist/market_adapter/market_adapter.js +3 -6
  287. package/dist/market_adapter/market_adapter.js.map +1 -1
  288. package/dist/market_adapter/test_helpers.d.ts +3 -3
  289. package/dist/market_adapter/test_helpers.d.ts.map +1 -1
  290. package/dist/market_adapter/test_helpers.js +3 -3
  291. package/dist/market_adapter/test_helpers.js.map +1 -1
  292. package/dist/market_adapter/utils/adapter_client.js +1 -1
  293. package/dist/market_adapter/utils/adapter_client.js.map +1 -1
  294. package/dist/market_adapter/utils/atomic_write.js +1 -1
  295. package/dist/market_adapter/utils/atomic_write.js.map +1 -1
  296. package/dist/market_adapter/utils/chain.d.ts +0 -2
  297. package/dist/market_adapter/utils/chain.d.ts.map +1 -1
  298. package/dist/market_adapter/utils/chain.js +2 -3
  299. package/dist/market_adapter/utils/chain.js.map +1 -1
  300. package/dist/market_adapter/utils/data_discovery.d.ts.map +1 -1
  301. package/dist/market_adapter/utils/data_discovery.js +24 -8
  302. package/dist/market_adapter/utils/data_discovery.js.map +1 -1
  303. package/dist/market_adapter/utils/dynamic_grid_snapshot.d.ts.map +1 -1
  304. package/dist/market_adapter/utils/dynamic_grid_snapshot.js +2 -5
  305. package/dist/market_adapter/utils/dynamic_grid_snapshot.js.map +1 -1
  306. package/dist/market_adapter/utils/file_lock.d.ts +4 -1
  307. package/dist/market_adapter/utils/file_lock.d.ts.map +1 -1
  308. package/dist/market_adapter/utils/file_lock.js +89 -25
  309. package/dist/market_adapter/utils/file_lock.js.map +1 -1
  310. package/dist/market_adapter/utils/native_history.d.ts.map +1 -1
  311. package/dist/market_adapter/utils/native_history.js +5 -1
  312. package/dist/market_adapter/utils/native_history.js.map +1 -1
  313. package/dist/modules/account_bots.js +1 -1
  314. package/dist/modules/account_bots.js.map +1 -1
  315. package/dist/modules/authority_resolver.js +1 -1
  316. package/dist/modules/authority_resolver.js.map +1 -1
  317. package/dist/modules/bitshares-native/chain_client.js +1 -1
  318. package/dist/modules/bitshares-native/chain_client.js.map +1 -1
  319. package/dist/modules/bitshares-native/crypto/ecc.browser.d.ts +0 -12
  320. package/dist/modules/bitshares-native/crypto/ecc.browser.d.ts.map +1 -1
  321. package/dist/modules/bitshares-native/crypto/ecc.browser.js +1 -1
  322. package/dist/modules/bitshares-native/crypto/ecc.browser.js.map +1 -1
  323. package/dist/modules/bitshares-native/crypto/ecc_selector.js +1 -1
  324. package/dist/modules/bitshares-native/crypto/ecc_selector.js.map +1 -1
  325. package/dist/modules/bitshares-native/index.d.ts.map +1 -1
  326. package/dist/modules/bitshares-native/index.js +1 -1
  327. package/dist/modules/bitshares-native/index.js.map +1 -1
  328. package/dist/modules/bitshares-native/lru_cache.js +1 -1
  329. package/dist/modules/bitshares-native/lru_cache.js.map +1 -1
  330. package/dist/modules/bitshares-native/resolvers.d.ts +0 -2
  331. package/dist/modules/bitshares-native/resolvers.d.ts.map +1 -1
  332. package/dist/modules/bitshares-native/resolvers.js +18 -4
  333. package/dist/modules/bitshares-native/resolvers.js.map +1 -1
  334. package/dist/modules/bitshares-native/serial/chain_constants.js +1 -1
  335. package/dist/modules/bitshares-native/serial/chain_constants.js.map +1 -1
  336. package/dist/modules/bitshares-native/serial/index.d.ts.map +1 -1
  337. package/dist/modules/bitshares-native/serial/index.js +1 -1
  338. package/dist/modules/bitshares-native/serial/index.js.map +1 -1
  339. package/dist/modules/bitshares-native/serial/operations.js +1 -1
  340. package/dist/modules/bitshares-native/serial/operations.js.map +1 -1
  341. package/dist/modules/bitshares-native/serial/serializer.js +1 -1
  342. package/dist/modules/bitshares-native/serial/serializer.js.map +1 -1
  343. package/dist/modules/bitshares-native/serial/types.js +1 -1
  344. package/dist/modules/bitshares-native/serial/types.js.map +1 -1
  345. package/dist/modules/bitshares-native/signing_client.js +2 -2
  346. package/dist/modules/bitshares-native/signing_client.js.map +1 -1
  347. package/dist/modules/bitshares-native/subscriptions.d.ts.map +1 -1
  348. package/dist/modules/bitshares-native/subscriptions.js +5 -14
  349. package/dist/modules/bitshares-native/subscriptions.js.map +1 -1
  350. package/dist/modules/bitshares-native/transport.js +1 -1
  351. package/dist/modules/bitshares-native/transport.js.map +1 -1
  352. package/dist/modules/bitshares-native/tx/builder.js +1 -1
  353. package/dist/modules/bitshares-native/tx/builder.js.map +1 -1
  354. package/dist/modules/bitshares-native/tx/tx_cache.d.ts +3 -2
  355. package/dist/modules/bitshares-native/tx/tx_cache.d.ts.map +1 -1
  356. package/dist/modules/bitshares-native/tx/tx_cache.js +7 -4
  357. package/dist/modules/bitshares-native/tx/tx_cache.js.map +1 -1
  358. package/dist/modules/bitshares_client.js +10 -10
  359. package/dist/modules/bitshares_client.js.map +1 -1
  360. package/dist/modules/bot_settings.d.ts.map +1 -1
  361. package/dist/modules/bot_settings.js +11 -18
  362. package/dist/modules/bot_settings.js.map +1 -1
  363. package/dist/modules/bots_file_lock.d.ts +1 -1
  364. package/dist/modules/bots_file_lock.js +1 -1
  365. package/dist/modules/broadcast_failure.d.ts +13 -0
  366. package/dist/modules/broadcast_failure.d.ts.map +1 -1
  367. package/dist/modules/broadcast_failure.js +0 -13
  368. package/dist/modules/broadcast_failure.js.map +1 -1
  369. package/dist/modules/chain_orders.d.ts.map +1 -1
  370. package/dist/modules/chain_orders.js +15 -17
  371. package/dist/modules/chain_orders.js.map +1 -1
  372. package/dist/modules/config.js +1 -1
  373. package/dist/modules/config.js.map +1 -1
  374. package/dist/modules/constants.d.ts +21 -20
  375. package/dist/modules/constants.d.ts.map +1 -1
  376. package/dist/modules/constants.js +53 -56
  377. package/dist/modules/constants.js.map +1 -1
  378. package/dist/modules/cr_planner.d.ts +1 -7
  379. package/dist/modules/cr_planner.d.ts.map +1 -1
  380. package/dist/modules/cr_planner.js +3 -77
  381. package/dist/modules/cr_planner.js.map +1 -1
  382. package/dist/modules/credential_policy.d.ts +0 -4
  383. package/dist/modules/credential_policy.d.ts.map +1 -1
  384. package/dist/modules/credential_policy.js +17 -2
  385. package/dist/modules/credential_policy.js.map +1 -1
  386. package/dist/modules/credit_runtime.d.ts +0 -7
  387. package/dist/modules/credit_runtime.d.ts.map +1 -1
  388. package/dist/modules/credit_runtime.js +21 -60
  389. package/dist/modules/credit_runtime.js.map +1 -1
  390. package/dist/modules/crypto/index.d.ts +0 -2
  391. package/dist/modules/crypto/index.d.ts.map +1 -1
  392. package/dist/modules/crypto/index.js +0 -2
  393. package/dist/modules/crypto/index.js.map +1 -1
  394. package/dist/modules/crypto/sync.js.map +1 -1
  395. package/dist/modules/daemon_node_health.js +1 -1
  396. package/dist/modules/daemon_node_health.js.map +1 -1
  397. package/dist/modules/dexbot_class.d.ts +8 -134
  398. package/dist/modules/dexbot_class.d.ts.map +1 -1
  399. package/dist/modules/dexbot_class.js +36 -197
  400. package/dist/modules/dexbot_class.js.map +1 -1
  401. package/dist/modules/dexbot_credential_client.js +1 -1
  402. package/dist/modules/dexbot_credential_client.js.map +1 -1
  403. package/dist/modules/dexbot_fill_runtime.d.ts.map +1 -1
  404. package/dist/modules/dexbot_fill_runtime.js +3 -6
  405. package/dist/modules/dexbot_fill_runtime.js.map +1 -1
  406. package/dist/modules/dexbot_maintenance_runtime.d.ts +6 -34
  407. package/dist/modules/dexbot_maintenance_runtime.d.ts.map +1 -1
  408. package/dist/modules/dexbot_maintenance_runtime.js +27 -19
  409. package/dist/modules/dexbot_maintenance_runtime.js.map +1 -1
  410. package/dist/modules/dexbot_startup_runtime.d.ts.map +1 -1
  411. package/dist/modules/dexbot_startup_runtime.js +31 -15
  412. package/dist/modules/dexbot_startup_runtime.js.map +1 -1
  413. package/dist/modules/dexbot_state_recovery.d.ts +2 -2
  414. package/dist/modules/dexbot_state_recovery.d.ts.map +1 -1
  415. package/dist/modules/dexbot_state_recovery.js +9 -6
  416. package/dist/modules/dexbot_state_recovery.js.map +1 -1
  417. package/dist/modules/fund_registry.d.ts.map +1 -1
  418. package/dist/modules/fund_registry.js +19 -4
  419. package/dist/modules/fund_registry.js.map +1 -1
  420. package/dist/modules/general_settings.d.ts +1 -2
  421. package/dist/modules/general_settings.d.ts.map +1 -1
  422. package/dist/modules/general_settings.js +1 -2
  423. package/dist/modules/general_settings.js.map +1 -1
  424. package/dist/modules/graceful_shutdown.d.ts.map +1 -1
  425. package/dist/modules/graceful_shutdown.js +10 -1
  426. package/dist/modules/graceful_shutdown.js.map +1 -1
  427. package/dist/modules/grid_price_source.d.ts +19 -0
  428. package/dist/modules/grid_price_source.d.ts.map +1 -0
  429. package/dist/modules/grid_price_source.js +23 -0
  430. package/dist/modules/grid_price_source.js.map +1 -0
  431. package/dist/modules/key_store.d.ts +0 -5
  432. package/dist/modules/key_store.d.ts.map +1 -1
  433. package/dist/modules/key_store.js +1 -14
  434. package/dist/modules/key_store.js.map +1 -1
  435. package/dist/modules/launcher/bot_supervisor.d.ts.map +1 -1
  436. package/dist/modules/launcher/bot_supervisor.js +9 -19
  437. package/dist/modules/launcher/bot_supervisor.js.map +1 -1
  438. package/dist/modules/launcher/child_env.d.ts +1 -2
  439. package/dist/modules/launcher/child_env.d.ts.map +1 -1
  440. package/dist/modules/launcher/child_env.js +1 -1
  441. package/dist/modules/launcher/child_env.js.map +1 -1
  442. package/dist/modules/launcher/foreign_cred_daemon.d.ts.map +1 -1
  443. package/dist/modules/launcher/foreign_cred_daemon.js +2 -14
  444. package/dist/modules/launcher/foreign_cred_daemon.js.map +1 -1
  445. package/dist/modules/launcher/market_adapter_runtime.d.ts +1 -1
  446. package/dist/modules/launcher/market_adapter_runtime.d.ts.map +1 -1
  447. package/dist/modules/launcher/market_adapter_runtime.js +3 -14
  448. package/dist/modules/launcher/market_adapter_runtime.js.map +1 -1
  449. package/dist/modules/launcher/market_adapter_watchdog.d.ts.map +1 -1
  450. package/dist/modules/launcher/market_adapter_watchdog.js +3 -2
  451. package/dist/modules/launcher/market_adapter_watchdog.js.map +1 -1
  452. package/dist/modules/launcher/monolithic_runtime.d.ts +0 -1
  453. package/dist/modules/launcher/monolithic_runtime.d.ts.map +1 -1
  454. package/dist/modules/launcher/monolithic_runtime.js +3 -18
  455. package/dist/modules/launcher/monolithic_runtime.js.map +1 -1
  456. package/dist/modules/launcher/runtime_entry.d.ts.map +1 -1
  457. package/dist/modules/launcher/runtime_entry.js +4 -5
  458. package/dist/modules/launcher/runtime_entry.js.map +1 -1
  459. package/dist/modules/launcher/status_reporting.js +1 -1
  460. package/dist/modules/launcher/status_reporting.js.map +1 -1
  461. package/dist/modules/launcher/supervisor_control.js +1 -1
  462. package/dist/modules/launcher/supervisor_control.js.map +1 -1
  463. package/dist/modules/market_adapter_whitelist.d.ts +2 -2
  464. package/dist/modules/market_adapter_whitelist.d.ts.map +1 -1
  465. package/dist/modules/market_adapter_whitelist.js +12 -6
  466. package/dist/modules/market_adapter_whitelist.js.map +1 -1
  467. package/dist/modules/node_failure_ledger.d.ts +23 -0
  468. package/dist/modules/node_failure_ledger.d.ts.map +1 -1
  469. package/dist/modules/node_failure_ledger.js +0 -23
  470. package/dist/modules/node_failure_ledger.js.map +1 -1
  471. package/dist/modules/node_manager.d.ts.map +1 -1
  472. package/dist/modules/node_manager.js +3 -3
  473. package/dist/modules/node_manager.js.map +1 -1
  474. package/dist/modules/order/accounting.js +1 -1
  475. package/dist/modules/order/accounting.js.map +1 -1
  476. package/dist/modules/order/async_lock.d.ts +6 -0
  477. package/dist/modules/order/async_lock.d.ts.map +1 -1
  478. package/dist/modules/order/async_lock.js +11 -0
  479. package/dist/modules/order/async_lock.js.map +1 -1
  480. package/dist/modules/order/export.d.ts +1 -1
  481. package/dist/modules/order/export.js +10 -10
  482. package/dist/modules/order/export.js.map +1 -1
  483. package/dist/modules/order/format.d.ts +1 -0
  484. package/dist/modules/order/format.d.ts.map +1 -1
  485. package/dist/modules/order/format.js +0 -6
  486. package/dist/modules/order/format.js.map +1 -1
  487. package/dist/modules/order/grid.d.ts +2 -12
  488. package/dist/modules/order/grid.d.ts.map +1 -1
  489. package/dist/modules/order/grid.js +23 -24
  490. package/dist/modules/order/grid.js.map +1 -1
  491. package/dist/modules/order/grid_reconcile.d.ts +1 -1
  492. package/dist/modules/order/grid_reconcile.js +1 -1
  493. package/dist/modules/order/grid_reconcile_internal.js +1 -1
  494. package/dist/modules/order/grid_reconcile_internal.js.map +1 -1
  495. package/dist/modules/order/logger.d.ts +3 -0
  496. package/dist/modules/order/logger.d.ts.map +1 -1
  497. package/dist/modules/order/logger.js +22 -13
  498. package/dist/modules/order/logger.js.map +1 -1
  499. package/dist/modules/order/logger_state.d.ts +4 -9
  500. package/dist/modules/order/logger_state.d.ts.map +1 -1
  501. package/dist/modules/order/logger_state.js +5 -14
  502. package/dist/modules/order/logger_state.js.map +1 -1
  503. package/dist/modules/order/manager.d.ts +1 -4
  504. package/dist/modules/order/manager.d.ts.map +1 -1
  505. package/dist/modules/order/manager.js +34 -33
  506. package/dist/modules/order/manager.js.map +1 -1
  507. package/dist/modules/order/processed_fill_store.d.ts.map +1 -1
  508. package/dist/modules/order/processed_fill_store.js +9 -3
  509. package/dist/modules/order/processed_fill_store.js.map +1 -1
  510. package/dist/modules/order/strategy.d.ts +6 -4
  511. package/dist/modules/order/strategy.d.ts.map +1 -1
  512. package/dist/modules/order/strategy.js +6 -4
  513. package/dist/modules/order/strategy.js.map +1 -1
  514. package/dist/modules/order/sync_engine.js +7 -7
  515. package/dist/modules/order/sync_engine.js.map +1 -1
  516. package/dist/modules/order/utils/order.d.ts.map +1 -1
  517. package/dist/modules/order/utils/order.js +1 -2
  518. package/dist/modules/order/utils/order.js.map +1 -1
  519. package/dist/modules/order/utils/system.d.ts +3 -8
  520. package/dist/modules/order/utils/system.d.ts.map +1 -1
  521. package/dist/modules/order/utils/system.js +14 -4
  522. package/dist/modules/order/utils/system.js.map +1 -1
  523. package/dist/modules/order/utils/validate.js +1 -1
  524. package/dist/modules/order/utils/validate.js.map +1 -1
  525. package/dist/modules/path_api.js +1 -1
  526. package/dist/modules/path_api.js.map +1 -1
  527. package/dist/modules/paths.d.ts +1 -7
  528. package/dist/modules/paths.d.ts.map +1 -1
  529. package/dist/modules/paths.js +1 -1
  530. package/dist/modules/paths.js.map +1 -1
  531. package/dist/modules/process_discovery.d.ts +3 -0
  532. package/dist/modules/process_discovery.d.ts.map +1 -1
  533. package/dist/modules/process_discovery.js +15 -1
  534. package/dist/modules/process_discovery.js.map +1 -1
  535. package/dist/modules/runtime_settings.js +1 -1
  536. package/dist/modules/runtime_settings.js.map +1 -1
  537. package/dist/modules/settings_merge.d.ts +5 -1
  538. package/dist/modules/settings_merge.d.ts.map +1 -1
  539. package/dist/modules/settings_merge.js +14 -3
  540. package/dist/modules/settings_merge.js.map +1 -1
  541. package/dist/modules/socket_json_client.d.ts.map +1 -1
  542. package/dist/modules/socket_json_client.js +12 -2
  543. package/dist/modules/socket_json_client.js.map +1 -1
  544. package/dist/modules/storage/browser_adapter.d.ts.map +1 -1
  545. package/dist/modules/storage/browser_adapter.js +5 -3
  546. package/dist/modules/storage/browser_adapter.js.map +1 -1
  547. package/dist/modules/storage/index.d.ts +1 -1
  548. package/dist/modules/storage/index.js +1 -1
  549. package/dist/modules/types.d.ts +1 -1
  550. package/dist/modules/types.d.ts.map +1 -1
  551. package/dist/modules/validate_profiles.d.ts.map +1 -1
  552. package/dist/modules/validate_profiles.js +6 -8
  553. package/dist/modules/validate_profiles.js.map +1 -1
  554. package/dist/pm2.d.ts.map +1 -1
  555. package/dist/pm2.js +2 -3
  556. package/dist/pm2.js.map +1 -1
  557. package/dist/scripts/analyze-git.d.ts +1 -1
  558. package/dist/scripts/analyze-git.js +1 -1
  559. package/dist/scripts/analyze-orders.d.ts.map +1 -1
  560. package/dist/scripts/analyze-orders.js +35 -16
  561. package/dist/scripts/analyze-orders.js.map +1 -1
  562. package/dist/scripts/diagnose-pool-history.js +1 -1
  563. package/dist/scripts/divergence-calc.d.ts +1 -1
  564. package/dist/scripts/divergence-calc.js +3 -3
  565. package/dist/scripts/native_release_gates.js +4 -2
  566. package/dist/scripts/native_release_gates.js.map +1 -1
  567. package/dist/scripts/print_grid.d.ts +1 -1
  568. package/dist/scripts/print_grid.js +1 -1
  569. package/dist/scripts/run-tests.js +38 -19
  570. package/dist/scripts/run-tests.js.map +1 -1
  571. package/dist/scripts/runner.d.ts +3 -5
  572. package/dist/scripts/runner.d.ts.map +1 -1
  573. package/dist/scripts/runner.js +3 -5
  574. package/dist/scripts/runner.js.map +1 -1
  575. package/dist/scripts/sync-version.d.ts +2 -2
  576. package/dist/scripts/sync-version.js +2 -2
  577. package/dist/scripts/update.d.ts +1 -1
  578. package/dist/scripts/update.js +1 -1
  579. package/dist/scripts/validate_bots.d.ts +1 -1
  580. package/dist/scripts/validate_bots.js +1 -1
  581. package/dist/scripts/verify-browser-bundle.d.ts +1 -1
  582. package/dist/scripts/verify-browser-bundle.js +1 -1
  583. package/dist/unlock.js +4 -4
  584. package/dist/unlock.js.map +1 -1
  585. package/docs/COPY_ON_WRITE_MASTER_PLAN.md +9 -9
  586. package/docs/DEXBOT_COMPARISON.md +4 -4
  587. package/docs/EVOLUTION.md +16 -43
  588. package/docs/FUND_MOVEMENT_AND_ACCOUNTING.md +1 -1
  589. package/docs/README.md +1 -1
  590. package/docs/architecture.md +5 -5
  591. package/docs/developer_guide.md +6 -6
  592. package/package.json +22 -14
  593. package/scripts/README.md +33 -7
  594. package/scripts/clean-dist.js +10 -2
  595. package/tests/README.md +4 -3
package/docs/EVOLUTION.md CHANGED
@@ -2,14 +2,14 @@
2
2
 
3
3
  ## Executive Summary
4
4
 
5
- DEXBot2 is a sophisticated decentralized exchange trading bot for the BitShares blockchain. This report documents the complete evolution of the project from its inception in December 2025 through the current 1.4.21 stable release.
5
+ DEXBot2 is a sophisticated decentralized exchange trading bot for the BitShares blockchain. This report documents the complete evolution of the project from its inception in December 2025 through the current 1.4.22 stable release.
6
6
 
7
7
  ### Key Milestones
8
8
  - **Project Inception**: December 2, 2025
9
- - **Growth Phase**: 2,068 commits over ~9 active months
9
+ - **Growth Phase**: 2,073 commits over ~9 active months
10
10
  - **Code Maturity**: Evolution from basic utilities to a ~70,000+ LoC intelligent TypeScript system
11
- - **Stability**: Progression from manual testing to a suite of 252 automated test files
12
- - **Releases**: 98 release entries (v0.1.0 to v1.4.21)
11
+ - **Stability**: Progression from manual testing to a suite of 238 automated test files
12
+ - **Releases**: 99 release entries (v0.1.0 to v1.4.22)
13
13
 
14
14
  ---
15
15
 
@@ -45,7 +45,7 @@ Consolidated the market adapter with split data sources, AMA-derived grid center
45
45
 
46
46
  ### Phase 5: Signal Intelligence, Stable Release & Browser Compatibility (March – June 2026)
47
47
 
48
- The project entered its most transformative phase: a derivative signal engine (dynamic trend-weighting, volatility scaling, regime classification) and a credit/debt MPA runtime were added, the codebase shed all external runtime dependencies while migrating fully to TypeScript, and a security audit of the unlock/daemon stack culminated in the first stable release — v1.0.0 on Jun 16 (profile validation, shared-account fund registry, proportional collateral). A browser-compatibility pass (portable abstractions, pure-JS crypto, storage-adapter I/O) made 140+ files browser-safe. This produced the multi-layered runtime that still shapes the project: COW order core, signal pipeline, credit/debt MPA runtime, and a browser-compatible core.
48
+ The project entered its most transformative phase: a derivative signal engine (dynamic trend-weighting, volatility scaling, regime classification) and a credit/debt MPA runtime were added, the codebase shed all external runtime dependencies while migrating fully to TypeScript, and a security audit of the unlock/daemon stack culminated in the first stable release — v1.0.0 on Jun 16 (profile validation, shared-account fund registry, proportional collateral). A browser-compatibility pass (portable abstractions, pure-JS crypto, storage-adapter I/O) made 140+ files browser-safe.
49
49
 
50
50
  ### Phase 6: Production Hardening & Iterative Refinement (June – July 2026)
51
51
 
@@ -53,21 +53,15 @@ Post-stable work focused on reliability: subscription watchdogs, broadcast deadl
53
53
 
54
54
  ### Phase 7: COW Concurrency & Uncertain-Broadcast Hardening (Late July 2026)
55
55
 
56
- After the CJS→ESM migration and strict-mode zero-errors completed the module transition, the v1.4.x releases corrected the COW concurrency model — centralized `withBlockchainRetry` with node failover, a 4-layer duplicate CREATE guard, lock-hierarchy reorder, AsyncLock forceRelease safety, and fund-accounting race hardening — fixing stale COW fund snapshots, phantom-order inflation, and the create-cancel loop. v1.4.8 then closed the uncertain-broadcast and truncated-read ambiguity classes: broadcasts are never blindly re-signed (the credential daemon retries only provably-untransmitted failures), uncertain outcomes surface as typed errors so the COW runtime verifies chain inclusion before re-broadcasting, and truncate-ambiguous `get_full_accounts` reads defer cancel/discard decisions instead of freeing slots or capital for possibly-live orders.
56
+ After the CJS→ESM migration completed the module transition, the early v1.4.x releases corrected the COW concurrency model — centralized `withBlockchainRetry` with node failover, duplicate-CREATE guards, lock-hierarchy fixes, and fund-accounting race hardening — eliminating stale fund snapshots, phantom-order inflation, and the create-cancel loop. v1.4.8 then closed the uncertain-broadcast and truncated-read ambiguity classes: broadcasts are never blindly re-signed (retries only after verifying chain inclusion), and truncate-ambiguous reads defer cancel/discard decisions instead of freeing slots or capital for possibly-live orders.
57
57
 
58
58
  ### Phase 8: Native ESM Runtime, Broadcast Serialization & Onboarding (August 2026)
59
59
 
60
- v1.4.12 completed the module transition to native ES modules (root + claw `"type": "module"`, Node >= 22 native WebSocket, dist-first ESM entry shims), removed the remaining legacy-compat shims, and pruned dead code — followed by fixes for the migration's rough edges (Node 22.14 require-cycle boot deadlock, phantom residuals, stranded dust, duplicate-orphan double-cancel). v1.4.13 added a single-flight guard that serializes overlapping COW broadcasts (preventing orphan fills), closed fill-lock bypasses, hardened the no-ALS AsyncLock fallback and ESM packaging gaps, promoted `dexbot start` to the canonical launch command, and added a BitShares onboarding tutorial.
60
+ v1.4.12 completed the module transition to native ES modules (root + claw `"type": "module"`, Node >= 22 native WebSocket), removed the remaining legacy-compat shims, and pruned dead code. v1.4.13 followed with a single-flight guard that serializes overlapping COW broadcasts (preventing orphan fills), fill-lock bypass closures, `dexbot start` as the canonical launch command, and a BitShares onboarding tutorial.
61
61
 
62
62
  ### Phase 9: Post-ESM Cleanup, Consolidation & Hardening (August 2026)
63
63
 
64
- v1.4.16 centralized all user/runtime state onto a single resolver-derived profiles dir (`~/.config/dexbot2/profiles`) so it survives re-clones and npm updates and never lands in a read-only package dir, turned divergence surplus-cancel + hole-create pairs into in-place order rotations, and added an npm auto-update flow. v1.4.17 consolidated duplicate code (EC math, Base58Check, settings merge, asset resolution), trimmed `modules/types.ts` from 875 lines to the Order union, purged dead exports, and centralized the analysis tooling under strict TypeScript. v1.4.19 capped COW broadcasts at `MAX_OPS_PER_BROADCAST` (4) with chunked retry-on-uncertain broadcasting, fixed a spread-collapse regression via the shared `isSlotInRail` helper, lowered the AMA slope grid-reset threshold to 8, and added editor price feedback plus a `docs/LIFECYCLE.md` onboarding walkthrough. v1.4.20 hardened spread-correction boundary promotion with a MIN_SPREAD_ORDERS reserve floor and commit-time validation, gated persisted-boundary restore against self-legalizing overrun poison, aligned dynamic-weight clip parity between the live service and the research chart, centralized chart slider ranges, and moved all analysis outputs onto the central path resolver. v1.4.21 fixed silent-failure runtime defects surfaced by a modules-wide audit (NaN fund-invariant tolerance, always-flush fill store, double-decremented fill guard, config num() defaults), aligned the two boundary writers on a shared sell-rail ceiling enforced at commit and restore time, deduplicated claw shared logic while hardening error paths (secret redaction, EPIPE guards, spawn-error surfacing), corrected launcher supervisor/runtime lifecycle bugs, made the browser storage adapter persist deletions and flush debounced, extended editor green/red live color feedback to funds and price inputs, stopped docs/error messages from hardcoding repo-relative profile paths, and pruned dead code across analysis/market_adapter/claw/logging.
65
-
66
- ---
67
-
68
- ## Development Statistics
69
-
70
- The project has accumulated 252 automated test files across 98 release entries. See the **Version History** below for a per-release commit breakdown.
64
+ The post-ESM releases consolidated state, code, and tooling while hardening the grid engine. **State & packaging** (v1.4.14–v1.4.17): all user/runtime state centralized on a resolver-derived profiles dir (`~/.config/dexbot2/profiles`) safe from re-clones, read-only prefixes, and npm wipes; divergence surplus/hole pairs became in-place order rotations; npm auto-update shipped; duplicated EC-crypto/settings/asset-resolution code collapsed; dead exports purged; analysis tooling moved under strict TypeScript. **Grid hardening** (v1.4.19–v1.4.21): COW broadcasts capped at `MAX_OPS_PER_BROADCAST` (4) with chunked retry-on-uncertain; boundary promotion and persisted-boundary restore gated against gap-floor overrun poison behind a shared sell-rail ceiling enforced at commit and restore time; spread-collapse fixed via the shared `isSlotInRail` filter; silent-failure runtime defects from a modules-wide audit fixed (NaN fund-invariant tolerance, always-flush fill store, double-decremented fill guard). **Tooling & UX** (v1.4.20–v1.4.22): live/research clip parity with centralized chart sliders and analysis outputs on the central path resolver; claw logic deduplicated with hardened error paths; browser storage adapter persists deletions; editor green/red input feedback extended to funds and prices; compile-first runtime completed — tsx removed entirely, every entry point and the test suite running compiled dist under plain node through frozen-ESM-safe seams, plus exact AMA cold-start bootstrap sizing and research tools unified onto production slope/bounds math. Post-v1.4.22 work followed the same themes: bot-fitting backtests re-modeled on the production grid lifecycle (slot rotation with realized-only scoring), analysis tooling consolidated onto market_adapter sources with folder-audit bug fixes, a Kibana client hardened against proxy connection resets, and TradingView-style price-axis interaction added to the chart exporter.
71
65
 
72
66
  ---
73
67
 
@@ -86,37 +80,15 @@ The project has accumulated 252 automated test files across 98 release entries.
86
80
 
87
81
  ## Documentation & Testing
88
82
 
89
- Evolved from a basic README to a comprehensive framework (50+ docs entries, 80%+ JSDoc coverage, AGENTS.md). Testing matured from manual blockchain trials → Jest → lightweight Node.js assert across a 252-file suite covering unit, integration, simulation, and COW architectural guard tests.
83
+ Evolved from a basic README to a comprehensive framework (50+ docs entries, 80%+ JSDoc coverage, AGENTS.md). Testing matured from manual blockchain trials → Jest → lightweight Node.js assert across the current suite covering unit, integration, simulation, and COW architectural guard tests.
90
84
 
91
85
  ---
92
86
 
93
- ## Conclusion
94
-
95
- DEXBot2 has matured from a basic grid bot into a signal-intelligent, production-ready trading system.
96
-
97
- ---
98
-
99
- ## Post-1.0.0: Completed
100
-
101
- - **Browser Compatibility**: Portable abstractions, pure-JS crypto, 140+ file refactor for browser-safe surface
102
- - **Credit/MPA Runtime**: Multi-asset collateral support, stale reborrow fixes, oversize deal splitting with per-operation caps
103
- - **I/O Centralization**: Full pipeline routed through storage adapter, shared atomic utilities across 20+ files
104
- - **Self-Healing**: Structural resync, subscription watchdog, broadcast deadlock recovery at both bot and daemon level
105
- - **Performance Analytics**: Kibana-driven FIFO/sequential trade PnL with 16 metrics
106
- - **AMA Refits**: Multi-round parameter optimization with per-market weights and distance scaling
107
- - **System Invariants**: Comprehensive documented invariants across all subsystems (COW, sync, grid, reconciliation)
108
- - **Bot Identity**: Unique name enforcement with migration support
109
- - **Credit-Only Mode**: Runtime-only operation for MPA/credit workflows without grid trading infrastructure
110
- - **Docker Support**: Container build, release images, and secure container startup guidance
111
- - **npm Package**: Published as npm package with versioned releases, lockfile sync, and dependency management
112
- - **Grid Order Engine Hardening**: COW pipeline, zero-amount order prevention, fill batching, dust detection, spread correction, and deadlock recovery
87
+ ## Post-1.0.0 Status
113
88
 
114
- ## Post-1.0.0: Planned
89
+ **Completed**: browser-safe core (140+ files, portable abstractions, pure-JS crypto); credit/MPA runtime (multi-asset collateral, oversize deal splitting); storage-adapter I/O centralization; self-healing (structural resync, subscription watchdog, bot/daemon broadcast-deadlock recovery); Kibana-driven trade PnL analytics; multi-round AMA refits; documented subsystem invariants; bot identity enforcement; credit-only mode; Docker support; npm package with lockfile sync; hardened grid order engine (COW pipeline, zero-amount prevention, fill batching, dust detection, spread correction).
115
90
 
116
- - **Backtesting Engine**: Historical candle replay through the trading engine via exchange abstraction
117
- - **Injectable Interfaces**: Dependency inversion at call boundaries for improved testability
118
- - **Database + Validation**: SQLite persistence with Zod schema validation at the blockchain boundary
119
- - **Telegram Bot**: planned but **not yet implemented** — owner-gated monitoring (`/status`, `/orders`, `/grid`, `/balance`) and opt-in+confirm gated control (`/start`, `/stop`, `/pause`); DEXBot is the only writer, private keys never reach the module. Config via a `TELEGRAM` block + `DEXBOT_TELEGRAM_TOKEN` env.
91
+ **Planned**: backtesting engine (historical candle replay via exchange abstraction); injectable interfaces at call boundaries; SQLite persistence + Zod validation at the blockchain boundary; Telegram bot (**not yet implemented**) — owner-gated monitoring (`/status`, `/orders`, `/grid`, `/balance`) and opt-in+confirm gated control (`/start`, `/stop`, `/pause`); DEXBot is the only writer, private keys never reach the module (`TELEGRAM` block + `DEXBOT_TELEGRAM_TOKEN` env).
120
92
 
121
93
  ## Version History
122
94
 
@@ -133,11 +105,12 @@ Compact, era-level view; per-release commit detail lives in [CHANGELOG.md](../CH
133
105
  | v1.4.13 → v1.4.19 | 36 | Profile-state centralization, code consolidation, per-broadcast op cap |
134
106
  | v1.4.19 → v1.4.20 | 5 | Grid boundary promotion hardening, recovery poison gate, analysis output centralization |
135
107
  | v1.4.20 → v1.4.21 | 15 | Runtime audit fixes, claw dedup hardening, boundary ceiling alignment, editor color feedback |
108
+ | v1.4.21 → v1.4.22 | 4 | tsx removal completion (dist-only runtime + tests), exact AMA bootstrap sizing, research-tool production parity |
136
109
 
137
110
  ---
138
111
 
139
112
  **Report Originally Generated**: February 19, 2026
140
- **Last Updated**: August 24, 2026 (v1.4.21)
141
- **Total Commits**: 2,068
142
- **Date Range**: December 2, 2025 – August 24, 2026
113
+ **Last Updated**: August 26, 2026
114
+ **Total Commits**: 2,084
115
+ **Date Range**: December 2, 2025 – August 26, 2026
143
116
  **Repository**: DEXBot2 (BitShares DEX Trading Bot)
@@ -792,4 +792,4 @@ To prevent "Time-of-Check to Time-of-Use" errors:
792
792
  **TOCTOU protection in `processFillAccounting`.** `_buildBtsDeferredRefundAdjustment` reads `btsFeeState` from `mgr.orders` while the order lock is held — the lock is acquired before accounting runs, and the POST-RESET and BOOTSTRAP tracked-fill accounting paths follow the same locking pattern.
793
793
 
794
794
  ---
795
- *Technical Reference for DEXBot2 v1.4.21 release*
795
+ *Technical Reference for DEXBot2 v1.4.22 release*
package/docs/README.md CHANGED
@@ -144,7 +144,7 @@ This directory contains the comprehensive technical documentation for the DEXBot
144
144
 
145
145
  ### 🧭 [Evolution Report](EVOLUTION.md)
146
146
  *Project timeline and major architecture phases.*
147
- - **Coverage**: Historical milestones from the initial December 2025 bootstrap through the v1.4.21 stable release (grid persistence safety, dust pipeline fix, net inventory lots); credit/debt runtime and maintenance hardening are covered under Phase 5 (Mar–Jun 2026)
147
+ - **Coverage**: Historical milestones from the initial December 2025 bootstrap through the v1.4.22 stable release (grid persistence safety, dust pipeline fix, net inventory lots); credit/debt runtime and maintenance hardening are covered under Phase 5 (Mar–Jun 2026)
148
148
  - **Focus**: Architecture evolution, release history, test growth, and documentation changes
149
149
 
150
150
  ### 🗒️ [Changelog](../CHANGELOG.md)
@@ -1239,15 +1239,15 @@ graph LR
1239
1239
  npm test
1240
1240
 
1241
1241
  # Specific logic area
1242
- tsx tests/test_accounting_logic.ts
1242
+ node dist/tests/test_accounting_logic.js
1243
1243
 
1244
1244
  # Signal tests
1245
- tsx tests/test_market_adapter_signal_gates.ts
1246
- tsx tests/test_dynamic_weight_override_wiring.ts
1245
+ node dist/tests/test_market_adapter_signal_gates.js
1246
+ node dist/tests/test_dynamic_weight_override_wiring.js
1247
1247
 
1248
1248
  # Credit/debt tests
1249
- tsx tests/test_cr_planner.ts
1250
- tsx tests/test_dexbot_credit_wiring.ts
1249
+ node dist/tests/test_cr_planner.js
1250
+ node dist/tests/test_dexbot_credit_wiring.js
1251
1251
  ```
1252
1252
 
1253
1253
  ### Test Quality Metrics
@@ -1627,10 +1627,10 @@ The test suite validates the following fund-related behaviors:
1627
1627
  npm test
1628
1628
 
1629
1629
  # Specific logic area
1630
- tsx tests/test_accounting_logic.ts
1630
+ node dist/tests/test_accounting_logic.js
1631
1631
 
1632
1632
  # Specific integration test
1633
- tsx tests/test_fills.ts
1633
+ node dist/tests/test_fills.js
1634
1634
  ```
1635
1635
 
1636
1636
  ### Understanding Test Structure
@@ -1797,13 +1797,13 @@ The test suite provides comprehensive coverage of fund calculations and rebalanc
1797
1797
  **Running Tests**:
1798
1798
  ```bash
1799
1799
  # Test strategy rebalancing
1800
- tsx tests/test_strategy_logic.ts
1800
+ node dist/tests/test_strategy_logic.js
1801
1801
 
1802
1802
  # Test grid divergence
1803
- tsx tests/test_grid_logic.ts
1803
+ node dist/tests/test_grid_logic.js
1804
1804
 
1805
1805
  # Test accounting precision
1806
- tsx tests/test_accounting_logic.ts
1806
+ node dist/tests/test_accounting_logic.js
1807
1807
 
1808
1808
  # Run full suite
1809
1809
  npm test
@@ -1858,7 +1858,7 @@ A: Check if it's locked (`isOrderLocked()`), in exclusion list, or below dust th
1858
1858
  A: Follow the "How to Add New Features" section above.
1859
1859
 
1860
1860
  **Q: Where are the tests?**
1861
- A: All tests are in the `tests/` directory. Run `npm test` for the full suite, or `tsx tests/<file>.ts` for individual test files.
1861
+ A: All tests are in the `tests/` directory. Run `npm test` for the full suite, or `npm run build:tests && node dist/tests/<file>.js` for individual test files.
1862
1862
 
1863
1863
  ---
1864
1864
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dexbot",
3
- "version": "1.4.21",
3
+ "version": "1.4.22",
4
4
  "description": "The first open source trading bot with zero runtime dependencies and a fully adaptive market making strategy.",
5
5
  "main": "dist/modules/dexbot_class.js",
6
6
  "exports": {
@@ -89,25 +89,27 @@
89
89
  "ama:chart:lp-local": "npm run build && node dist/analysis/ama_fitting/generate_unified_comparison_chart.js",
90
90
  "analysis:derivatives": "npm run build && node dist/analysis/analyze_derivatives.js",
91
91
  "analysis:trade-pnl": "npm run build && node dist/analysis/trade_profitability.js",
92
- "native:release-gates": "npm run build && node dist/scripts/native_release_gates.js",
93
- "native:serial-snapshots": "tsx tests/test_native_serial_ops.ts",
94
- "native:ecc-invariants": "tsx tests/test_native_ecc.ts",
92
+ "native:release-gates": "npm run build && npm run build:tests && node dist/scripts/native_release_gates.js",
93
+ "native:serial-snapshots": "npm run build && npm run build:tests && node dist/tests/test_native_serial_ops.js",
94
+ "native:ecc-invariants": "npm run build && npm run build:tests && node dist/tests/test_native_ecc.js",
95
95
  "native:corpus": "npm run build && node dist/scripts/generate_mainnet_corpus_report.js",
96
96
  "test:credit-renewal": "npm run build && node dist/scripts/test-credit-renewal.js",
97
97
  "version:sync": "npm run build && node dist/scripts/sync-version.js",
98
98
  "version:check": "npm run build && node dist/scripts/sync-version.js --check",
99
99
  "verify:browser-bundle": "npm run build && node dist/scripts/verify-browser-bundle.js",
100
- "pretest": "tsc --noEmit",
101
- "test": "node --import tsx scripts/run-tests.ts",
102
- "test:live": "RUN_LIVE_BITSHARES_TESTS=1 node --import tsx scripts/run-tests.ts",
100
+ "test": "npm run build && npm run build:tests && npm run build --prefix claw && node dist/scripts/run-tests.js",
101
+ "test:live": "RUN_LIVE_BITSHARES_TESTS=1 npm run build && npm run build:tests && npm run build --prefix claw && node dist/scripts/run-tests.js",
103
102
  "clean": "node scripts/clean-dist.js",
104
- "build": "npm run clean && tsc && chmod +x dist/dexbot.js dist/bot.js dist/unlock.js dist/pm2.js dist/credential-daemon.js",
103
+ "build": "tsc && chmod +x dist/dexbot.js dist/bot.js dist/unlock.js dist/pm2.js dist/credential-daemon.js",
104
+ "build:clean": "npm run clean && npm run build",
105
+ "build:tests": "tsc -p tsconfig.tests.json && cp tests/package.json dist/tests/package.json && cp tests/helpers/esm_mock_hooks.mjs tests/helpers/esm_mock_loader.mjs dist/tests/helpers/",
105
106
  "typecheck": "tsc --noEmit",
107
+ "typecheck:tests": "tsc -p tsconfig.tests.json --noEmit",
106
108
  "build:watch": "tsc --watch",
107
- "version": "npm run version:sync && npm run build",
108
- "postversion": "npm run build",
109
- "prepack": "npm run build",
110
- "prepare": "npm run build",
109
+ "version": "npm run version:sync && npm run build:clean",
110
+ "postversion": "npm run build:clean",
111
+ "prepack": "npm run build:clean",
112
+ "prepare": "npm run build:clean",
111
113
  "postinstall": "node scripts/postinstall.js"
112
114
  },
113
115
  "repository": {
@@ -168,7 +170,14 @@
168
170
  "./dist/modules/order/utils/system.js": false,
169
171
  "./dist/market_adapter/market_adapter.js": false,
170
172
  "./dist/market_adapter/lp_chart_runner.js": false,
171
- "./dist/market_adapter/ama_signal_runner.js": false
173
+ "./dist/market_adapter/ama_signal_runner.js": false,
174
+ "./dist/modules/runtime_settings.js": false,
175
+ "./dist/modules/bitshares-native/transport.js": false,
176
+ "./dist/modules/bitshares-native/signing_client.js": false,
177
+ "./dist/modules/bitshares-native/subscriptions.js": false,
178
+ "./dist/modules/bitshares-native/tx/builder.js": false,
179
+ "./dist/modules/bitshares-native/tx/tx_cache.js": false,
180
+ "./dist/market_adapter/utils/chain.js": false
172
181
  },
173
182
  "bugs": {
174
183
  "url": "https://github.com/froooze/DEXBot2/issues"
@@ -177,7 +186,6 @@
177
186
  "dependencies": {},
178
187
  "devDependencies": {
179
188
  "@types/node": "^25.9.1",
180
- "tsx": "^4.22.3",
181
189
  "typescript": "^6.0.3"
182
190
  }
183
191
  }
package/scripts/README.md CHANGED
@@ -7,7 +7,7 @@ This guide provides a terminal-focused reference for the maintenance and diagnos
7
7
  ## 🛠️ CORE MAINTENANCE
8
8
 
9
9
  ### Update DEXBot2
10
- **File:** `update.ts`
10
+ **File:** `update.ts` (shim: `update.js`)
11
11
  **Purpose:** Perform a safe, production-ready update.
12
12
  ```bash
13
13
  # Pull latest code, install deps, and restart PM2
@@ -174,6 +174,18 @@ LIVE_BOT_NAME=my-bot CALC_CYCLES=10 CALC_DELAY_MS=1000 node dist/scripts/runner.
174
174
  Useful for verifying config produces the expected grid, testing price derivation, and debugging fund allocation.
175
175
  Requires a live BitShares connection (asset metadata lookups and price derivation are on-chain).
176
176
 
177
+ ### Native Release Gates
178
+ **File:** `native_release_gates.ts` (+ `generate_mainnet_corpus_report.ts`)
179
+ **Purpose:** Prove the native serialization layer matches the chain byte-for-byte before release.
180
+ ```bash
181
+ # Generate the mainnet corpus report (needs a live node + 50+ blocks)
182
+ npm run native:corpus
183
+
184
+ # Run serializer snapshots + ECC invariants and assert the corpus report
185
+ npm run native:release-gates
186
+ ```
187
+ The corpus report lands in `<profiles>/native_validation/mainnet_corpus_report.json`. The gates fail unless the report has `passed=true` and `transactionCount>=50`.
188
+
177
189
  ---
178
190
 
179
191
  ## 🔍 GIT & DEVELOPMENT WORKFLOW
@@ -209,7 +221,10 @@ Inside file viewer: `f` full file, `d` diff view, `q` back to search, `b` main m
209
221
  ## 💻 DEVELOPMENT UTILITIES
210
222
 
211
223
  ### Test Suite Setup
212
- Tests run with native Node `assert` — no test framework needed. See [tests/README.md](../tests/README.md) for details.
224
+ Tests use native Node `assert` — no test framework needed. Sources compile to
225
+ `dist/tests/` via `npm run build:tests`, and `npm test` runs them sequentially
226
+ through `dist/scripts/run-tests.js` (with a per-test watchdog and diagnostics
227
+ summary). See [tests/README.md](../tests/README.md) for details.
213
228
 
214
229
  ### Repository Statistics Analyzer
215
230
  **File:** `analyze-git.ts`
@@ -298,8 +313,8 @@ The following scripts allow you to call `dexbot` commands directly from the `scr
298
313
  | `scripts/bots` | `dexbot bots` | `./scripts/bots` |
299
314
  | `scripts/keys` | `dexbot keys` | `./scripts/keys` |
300
315
  | `scripts/dexbot` | `dexbot` | `./scripts/dexbot <cmd>` |
301
- | `scripts/unlock` | `unlock.ts` / `dist/unlock.js` | `./scripts/unlock` |
302
- | `scripts/pm2` | `pm2.ts` / `dist/pm2.js` | `./scripts/pm2` |
316
+ | `scripts/unlock` | `dist/unlock.js` | `./scripts/unlock` |
317
+ | `scripts/pm2` | `dist/pm2.js` | `./scripts/pm2` |
303
318
 
304
319
  ---
305
320
 
@@ -308,12 +323,15 @@ The following scripts allow you to call `dexbot` commands directly from the `scr
308
323
  ### Build & Test
309
324
  | Command | Purpose |
310
325
  |:---|:---|
311
- | `npm run build` | Clean + compile TypeScript |
326
+ | `npm run build` | Compile TypeScript to `dist/` (plain node — no tsx) |
327
+ | `npm run build:clean` | Remove stale `dist/` + tsbuildinfo caches, then build |
328
+ | `npm run build:tests` | Compile `tests/` to `dist/tests/` (required by `npm test` and `native:*`) |
312
329
  | `npm run clean` | Remove compiled `dist/` output |
313
330
  | `npm run typecheck` | TypeScript type checking (`tsc --noEmit`) |
331
+ | `npm run typecheck:tests` | Type check the test suite (`tsc -p tsconfig.tests.json --noEmit`) |
314
332
  | `npm run build:watch` | TypeScript incremental build watcher |
315
- | `npm test` | Run full test suite (excludes live-chain tests) |
316
- | `npm run test:live` | Run full test suite including live-chain tests |
333
+ | `npm test` | Build + compile tests + run full suite (excludes live-chain tests) |
334
+ | `npm run test:live` | Build + compile tests + run full suite including live-chain tests |
317
335
 
318
336
  ### Runtime
319
337
  | Command | Purpose |
@@ -351,6 +369,14 @@ The following scripts allow you to call `dexbot` commands directly from the `scr
351
369
  | `npm run test:credit-renewal` | Test credit offer renewal for a specific bot |
352
370
  | `npm run verify:browser-bundle` | Verify browser-safe surface bundles correctly |
353
371
 
372
+ ### Native Release Gates
373
+ | Command | Purpose |
374
+ |:---|:---|
375
+ | `npm run native:corpus` | Build mainnet corpus report proving byte-for-byte native serialization parity |
376
+ | `npm run native:serial-snapshots` | Run native serializer snapshot tests |
377
+ | `npm run native:ecc-invariants` | Run native ECC key/sign/verify invariant tests |
378
+ | `npm run native:release-gates` | Run serial + ECC gates and assert a valid mainnet corpus report |
379
+
354
380
  ---
355
381
 
356
382
  ## 📈 CHART GENERATION
@@ -4,6 +4,14 @@ import { dirname, join } from 'path';
4
4
  import { fileURLToPath } from 'url';
5
5
 
6
6
  const __dirname = dirname(fileURLToPath(import.meta.url));
7
- const distDir = join(__dirname, '..', 'dist');
7
+ const rootDir = join(__dirname, '..');
8
+ const distDir = join(rootDir, 'dist');
9
+ const tscCacheDir = join(rootDir, 'node_modules', '.cache');
8
10
 
9
- rmSync(distDir, { recursive: true, force: true });
11
+ rmSync(distDir, { recursive: true, force: true });
12
+
13
+ // Incremental tsbuildinfo files live outside dist/, so a stale cache would
14
+ // make the next `tsc` believe everything is up to date and emit nothing.
15
+ for (const info of ['tsc-prod.tsbuildinfo', 'tsc-tests.tsbuildinfo', 'tsc-claw.tsbuildinfo']) {
16
+ rmSync(join(tscCacheDir, info), { force: true });
17
+ }
package/tests/README.md CHANGED
@@ -1,15 +1,16 @@
1
1
  # DEXBot2 Test Suite
2
2
 
3
- Tests live as standalone `.ts` files in this directory. Each file is runnable directly via `tsx`. The suite uses Node's native `assert` — no test framework dependency.
3
+ Tests live as standalone `.ts` files in this directory. They are compiled to `dist/tests/` by the build and run from there with plain `node` — no test framework, no TypeScript loader. The suite uses Node's native `assert`.
4
4
 
5
5
  ## Quick Start
6
6
 
7
7
  ```bash
8
- # Run all tests
8
+ # Run all tests (builds production code + tests first)
9
9
  npm test
10
10
 
11
11
  # Run a single test file
12
- node --import tsx tests/<file>.ts
12
+ npm run build:tests
13
+ node dist/tests/<file>.js
13
14
  ```
14
15
 
15
16
  ## Directory Layout