Skip to content

Commit 9199b85

Browse files
committed
fix: disable auto-update by default, fix update script exit code & stash leak
Auto-update being ON by default is surprising and risky for a financial system — a bot handling real funds should never silently change its code without explicit operator opt-in. ## Update script hardening - **Exit code 2 → 0** on "already up to date": PM2's `cron_restart` treats non-zero exits as failures, causing false-positive error logs on every successful no-op tick. (`scripts/update.ts:262`) - **Ref-specific `git stash pop`**: captures the stash ref by message ("dexbot-update-auto") after push and pops by that exact ref, preventing cross-contamination with other stash entries. Uses `git diff --name-only --diff-filter=U` after pop to detect any unmerged paths (including asymmetric variants AU, UA, DU, UD). Logs the error object on failure. (`scripts/update.ts:284-332`) ## Default change - **`UPDATER.ACTIVE: true` → `false`**: auto-update is now opt-in. Existing installations with `UPDATER.ACTIVE: true` in their `general.settings.json` are unaffected. (`modules/constants.ts:1127`) ## Chore - Bump version to 1.0.2 via sync-version.ts (14 files across manifests, docs, and tests) - Add v1.0.2 changelog entry and evolution doc update ## Testing Notes - `npx tsx scripts/sync-version.ts --check` passes - No behavioral change to existing tests (the test fixture explicitly sets `ACTIVE: true`)
1 parent 0b2fdca commit 9199b85

14 files changed

Lines changed: 75 additions & 24 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [1.0.2] - 2026-06-25 - Auto-Update Default & Update Script Hardening
6+
7+
### 2026-06-25
8+
9+
- **Chore**: disable auto-update by default (`UPDATER.ACTIVE: true``false`) — a DEX bot handling real funds should never silently change its code without explicit operator opt-in (`modules/constants.ts:1127`).
10+
- Existing installations with a pre-existing `UPDATER.ACTIVE: true` in `general.settings.json` are unaffected; the new default only applies to fresh installs or users who remove the `UPDATER` key from their settings.
11+
- **Fix**: exit code 2 → 0 on "already up to date" — PM2's `cron_restart` treats non-zero exits as failures, causing false-positive error logs on every successful no-op tick (`scripts/update.ts:262`).
12+
- **Fix**: restore stashed local changes after `git pull` with ref-specific pop — uses the exact stash ref (matched by message) instead of bare `git stash pop`, preventing cross-contamination with other stash entries. Also checks `git status --porcelain` for unmerged paths after pop and logs the error object on failure (`scripts/update.ts:299-307`).
13+
514
## [1.0.1] - 2026-06-24 - Bootstrap Fill Pipeline, AccountOrders Simplification & Timer Guard
615

716
### 2026-06-24

analysis/ama_fitting/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ama_fitting",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Tools for fitting AMA parameters to market data",
55
"main": "../../dist/analysis/ama_fitting/optimizer_high_resolution.js",
66
"scripts": {

claw/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dexbot2-claw",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"private": true,
55
"description": "Claw bridge and runtime integration layer for BitShares and DEXBot2.",
66
"type": "commonjs",

claw/runtimes/openclaw-plugin/openclaw.plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "bitshares-claw",
33
"name": "BitShares Claw",
44
"description": "Native BitShares and DEXBot2 tools from the DEXBot2 claw integration",
5-
"version": "1.0.1",
5+
"version": "1.0.2",
66
"skills": [
77
"skills"
88
],
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "bitshares-claw-openclaw-plugin",
33
"private": true,
4-
"version": "1.0.1",
4+
"version": "1.0.2",
55
"type": "commonjs",
66
"main": "index.js"
77
}

claw/tests/test_claw_mcp_transport.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ async function testParserAcceptsJsonlAcrossChunksAndSingleBuffer() {
3030
capabilities: {},
3131
clientInfo: {
3232
name: 'claw-mcp-transport-test',
33-
version: '1.0.1'
33+
version: '1.0.2'
3434
},
3535
protocolVersion: '2024-11-05'
3636
}
@@ -181,7 +181,7 @@ async function testMainEntrypointHandlesRealProcessInitialize() {
181181
capabilities: {},
182182
clientInfo: {
183183
name: 'claw-mcp-transport-test',
184-
version: '1.0.1'
184+
version: '1.0.2'
185185
},
186186
protocolVersion: '2024-11-05'
187187
}

docs/DEXBOT_COMPARISON.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# DEXBot vs DEXBot2 — Detailed Comparison Report
22

33
> **Date:** 2026-06-16 *(metrics refreshed against local source trees)*
4-
> **Scope:** Full architectural, functional, and operational comparison between the original [DEXBot](https://github.com/Codaone/DEXBot) (Python, v1.0.0) and DEXBot2 (TypeScript, v1.0.1).
4+
> **Scope:** Full architectural, functional, and operational comparison between the original [DEXBot](https://github.com/Codaone/DEXBot) (Python, v1.0.0) and DEXBot2 (TypeScript, v1.0.2).
55
> **Audience:** Developers, contributors, and operators evaluating or migrating between the two projects.
66
77
---
@@ -36,7 +36,7 @@
3636

3737
| Attribute | DEXBot (original) | DEXBot2 |
3838
|---|---|---|
39-
| **Release Track** | 1.0.0 | v1.0.1 |
39+
| **Release Track** | 1.0.0 | v1.0.2 |
4040
| **Language** | Python 3.6+ | TypeScript 5.x |
4141
| **Status** | Released 1.0.0, unmaintained | Active development |
4242
| **Last Repo Activity** | May 23, 2020 | 2026-06-16 |
@@ -774,7 +774,7 @@ Where:
774774

775775
| Metric | DEXBot | DEXBot2 |
776776
|---|---|---|
777-
| **Release Track** | 1.0.0 | v1.0.1 |
777+
| **Release Track** | 1.0.0 | v1.0.2 |
778778
| **Active Since** | ~2018 | December 2025 |
779779
| **Last Commit** | May 23, 2020 | 2026-06-22 |
780780
| **Total Commits** | 2281 | 1648 at current HEAD |

docs/EVOLUTION.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
## Executive Summary
44

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.0.1 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.0.2 stable release.
66

77
### Key Milestones
88
- **Project Inception**: December 2, 2025
99
- **Growth Phase**: 1,600+ commits over ~6 active months
1010
- **Code Maturity**: Evolution from basic utilities to a ~58,000+ LoC intelligent TypeScript system
1111
- **Stability**: Progression from manual testing to a suite of 200+ automated test files
12-
- **Releases**: 36 release entries (v0.1.0 to v1.0.1)
12+
- **Releases**: 37 release entries (v0.1.0 to v1.0.2)
1313

1414
---
1515

@@ -159,13 +159,16 @@ First stable release. Profile validation, logging overhaul, AMA delta threshold,
159159
### v1.0.0 → v1.0.1 (4 commits)
160160
Bootstrap fill pipeline refactored to use the standard same-side replacement path via `_processFillsWithBatching`, eliminating the only cross-side rotation in the codebase. AccountOrders simplified to one bot per file, removing the `{bots: {[key]: ...}}` wrapper that caused doubled-entry bugs during bot-id migration. Deferred maintenance timer guard prevents rare null/undefined spread errors during periodic blockchain fetches.
161161

162+
### v1.0.1 → v1.0.2 (3 changes)
163+
Auto-update disabled by default (`ACTIVE: true``false`) — explicit operator opt-in required for unattended code changes on financial systems. Update script hardened: exit code 2 → 0 on "already up to date" stops PM2 false-positive error logging, and `git stash pop` added after pull to restore previously stashed uncommitted work.
164+
162165
---
163166

164167

165168

166169
## Development Statistics
167170

168-
200+ automated test files (all TypeScript), 36 release entries. See **Version History** for commit breakdown by release.
171+
200+ automated test files (all TypeScript), 37 release entries. See **Version History** for commit breakdown by release.
169172

170173
---
171174

@@ -207,7 +210,7 @@ DEXBot2 has matured from a basic grid bot into a signal-intelligent, production-
207210
---
208211

209212
**Report Originally Generated**: February 19, 2026
210-
**Last Updated**: June 24, 2026
211-
**Total Commits**: 1652
212-
**Date Range**: December 2, 2025 - June 24, 2026 (ongoing)
213+
**Last Updated**: June 25, 2026
214+
**Total Commits**: 1656
215+
**Date Range**: December 2, 2025 - June 25, 2026 (ongoing)
213216
**Repository**: DEXBot2 (BitShares DEX Trading Bot)

docs/FUND_MOVEMENT_AND_ACCOUNTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,4 +825,4 @@ To prevent "Time-of-Check to Time-of-Use" errors:
825825
3. **Bootstrapping:** Fills arriving during startup (`isBootstrapping=true`) are queued until the grid is fully reconciled.
826826

827827
---
828-
*Technical Reference for DEXBot2 v1.0.1 release*
828+
*Technical Reference for DEXBot2 v1.0.2 release*

docs/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This directory contains the comprehensive technical documentation for the DEXBot2 trading bot. It is designed to guide developers from high-level architecture down to the nuances of fund accounting and state management.
44

5-
**Version context:** v1.0.1 is the current release.
5+
**Version context:** v1.0.2 is the current release.
66

77
---
88

@@ -108,7 +108,7 @@ This directory contains the comprehensive technical documentation for the DEXBot
108108

109109
### 🧭 [Evolution Report](EVOLUTION.md)
110110
*Project timeline and major architecture phases.*
111-
- **Coverage**: Historical milestones from the initial December 2025 bootstrap through the v1.0.1 stable release, including credit maintenance hardening
111+
- **Coverage**: Historical milestones from the initial December 2025 bootstrap through the v1.0.2 stable release, including credit maintenance hardening
112112
- **Focus**: Architecture evolution, release history, test growth, and documentation changes
113113

114114
### 🗒️ [Changelog](../CHANGELOG.md)

0 commit comments

Comments
 (0)