@timmeck/trading-brain 2.31.81 → 2.31.83

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.
package/README.md CHANGED
@@ -5,9 +5,9 @@
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
6
6
  [![GitHub stars](https://img.shields.io/github/stars/timmeck/brain-ecosystem?style=social)](https://github.com/timmeck/brain-ecosystem)
7
7
 
8
- **Adaptive Trading Intelligence & Signal Learning System for Claude Code — 181 MCP Tools, 72+ Engines**
8
+ **Adaptive Trading Intelligence & Signal Learning System for Claude Code — 181 MCP Tools, 117+ Engines**
9
9
 
10
- Trading Brain is an MCP server that gives Claude Code a persistent trading memory. It learns from every trade outcome — strengthening connections between signals, strategies, and results through a Hebbian synapse network ("signals that win together wire together"). Paper trading with live market data (CoinGecko, Yahoo Finance, CCXT WebSocket). Over time, it develops statistical confidence in signal combinations, adapts calibration parameters, and runs 72+ autonomous engines in a 68-step feedback cycle to discover patterns, reason about causality, evolve strategies genetically, and improve itself. Full intelligence suite: RAG, Knowledge Graph, feedback learning, tool tracking, user model, proactive suggestions. Multi-provider LLM (Anthropic + Ollama). PortfolioOptimizer with Kelly criterion position sizing and HHI diversification scoring. StrategyMutator for evolutionary strategy breeding (mutation, crossover, tournament selection). Engine Governance with formal profiles, runtime influence tracking, 4 anti-pattern detectors, and active control (throttle/cooldown/isolate/escalate/restore). 518 tests. Workflow checkpointing, structured LLM output, observability tracing, agent training, dynamic tool scoping.
10
+ Trading Brain is an MCP server that gives Claude Code a persistent trading memory. It learns from every trade outcome — strengthening connections between signals, strategies, and results through a Hebbian synapse network ("signals that win together wire together"). Paper trading with live market data (CoinGecko, Yahoo Finance, CCXT WebSocket). Over time, it develops statistical confidence in signal combinations, adapts calibration parameters, and runs 117+ autonomous engines in a 68-step feedback cycle to discover patterns, reason about causality, evolve strategies genetically, and improve itself. Full intelligence suite: RAG, Knowledge Graph, feedback learning, tool tracking, user model, proactive suggestions. Multi-provider LLM (Anthropic + Ollama). PortfolioOptimizer with Kelly criterion position sizing and HHI diversification scoring. StrategyMutator for evolutionary strategy breeding (mutation, crossover, tournament selection). Engine Governance with formal profiles, runtime influence tracking, 4 anti-pattern detectors, and active control (throttle/cooldown/isolate/escalate/restore). 518 tests. Workflow checkpointing, structured LLM output, observability tracing, agent training, dynamic tool scoping.
11
11
 
12
12
  ## Quick Start
13
13
 
@@ -52,7 +52,7 @@ That's it. One command configures MCP, hooks, and starts the daemon.
52
52
  - **Rate Limiting** — Per-hour and per-day token budgets with automatic throttling
53
53
  - **Usage Tracking** — Calls, tokens, latency, cache hit rate, cost tracking
54
54
 
55
- ### 72+ Autonomous Engines
55
+ ### 117+ Autonomous Engines
56
56
 
57
57
  The ResearchOrchestrator runs a 51-step feedback cycle every 5 minutes:
58
58
 
@@ -87,7 +87,7 @@ DataMiner bootstraps all historical trades into engines at startup.
87
87
 
88
88
  | Dashboard | Port | What It Shows |
89
89
  |-----------|------|--------------|
90
- | **Command Center** | 7790 | 9-page: Ecosystem, Consciousness, Learning, Trading, Marketing, Intelligence, Cross-Brain, Debates, Infrastructure |
90
+ | **Command Center** | 7790 | 13-page: Overview, Entity, Learning, Trading, Marketing, Intelligence, Cross-Brain, Activity, Debates, Desires, Forge, Infrastructure, Progress |
91
91
 
92
92
  ### Memory & Sessions
93
93
  - **Persistent Memory** — Preferences, decisions, context, facts, goals, lessons
@@ -99,7 +99,7 @@ DataMiner bootstraps all historical trades into engines at startup.
99
99
  - **MCP HTTP/SSE** — For Cursor, Windsurf, Cline, Continue (port 7780)
100
100
  - **REST API** — Full HTTP API on port 7779
101
101
 
102
- ## MCP Tools (128 tools)
102
+ ## MCP Tools (181 tools)
103
103
 
104
104
  **Trading Core**: trading_record_outcome, trading_signal_weights, trading_signal_confidence, trading_explain_signal, trading_dca_multiplier, trading_grid_params, trading_calibration, trading_calibration_history, trading_rules, trading_chains, trading_query, trading_learn, trading_reset
105
105
 
@@ -162,7 +162,7 @@ trading import <file> Import trades from JSON
162
162
  | [Brain](../brain) | Error memory, code intelligence, full autonomy & self-modification | 7777 / 7778 / 7790 |
163
163
  | **Trading Brain** (this) | Adaptive trading intelligence with signal learning & paper trading | **7779** / 7780 |
164
164
  | [Marketing Brain](../marketing-brain) | Content strategy, social engagement & cross-platform optimization | 7781 / 7782 / 7783 |
165
- | [Brain Core](../brain-core) | Shared infrastructure — 72+ engines | — |
165
+ | [Brain Core](../brain-core) | Shared infrastructure — 117+ engines | — |
166
166
 
167
167
  ## Support
168
168
 
@@ -1,7 +1,11 @@
1
1
  import type { SynapseRecord } from '../db/repositories/synapse.repository.js';
2
2
  /**
3
3
  * Hebbian strengthen — "neurons that fire together wire together"
4
- * Asymptotic approach to 1.0: weight += (1 - weight) * learningRate
4
+ * Bounded multiplicative: w_new = min(1.0, w_old * (1 + learningRate))
5
+ *
6
+ * Unlike the old additive formula (w + (1-w)*rate) which saturated to ~1.0
7
+ * too fast, multiplicative growth preserves relative weight differences
8
+ * and doesn't collapse all synapses to the ceiling.
5
9
  */
6
10
  export declare function strengthen(synapse: Omit<SynapseRecord, 'created_at'>, learningRate: number): void;
7
11
  /**
@@ -1,11 +1,15 @@
1
1
  /**
2
2
  * Hebbian strengthen — "neurons that fire together wire together"
3
- * Asymptotic approach to 1.0: weight += (1 - weight) * learningRate
3
+ * Bounded multiplicative: w_new = min(1.0, w_old * (1 + learningRate))
4
+ *
5
+ * Unlike the old additive formula (w + (1-w)*rate) which saturated to ~1.0
6
+ * too fast, multiplicative growth preserves relative weight differences
7
+ * and doesn't collapse all synapses to the ceiling.
4
8
  */
5
9
  export function strengthen(synapse, learningRate) {
6
10
  synapse.wins++;
7
11
  synapse.activations++;
8
- synapse.weight += (1.0 - synapse.weight) * learningRate;
12
+ synapse.weight = Math.min(1.0, synapse.weight * (1 + learningRate));
9
13
  synapse.last_activated = new Date().toISOString();
10
14
  }
11
15
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"hebbian.js","sourceRoot":"","sources":["../../src/synapses/hebbian.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,OAA0C,EAAE,YAAoB;IACzF,OAAO,CAAC,IAAI,EAAE,CAAC;IACf,OAAO,CAAC,WAAW,EAAE,CAAC;IACtB,OAAO,CAAC,MAAM,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,YAAY,CAAC;IACxD,OAAO,CAAC,cAAc,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AACpD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,MAAM,CAAC,OAA0C,EAAE,aAAqB;IACtF,OAAO,CAAC,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,WAAW,EAAE,CAAC;IACtB,OAAO,CAAC,MAAM,IAAI,aAAa,CAAC;IAChC,OAAO,CAAC,cAAc,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AACpD,CAAC"}
1
+ {"version":3,"file":"hebbian.js","sourceRoot":"","sources":["../../src/synapses/hebbian.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAC,OAA0C,EAAE,YAAoB;IACzF,OAAO,CAAC,IAAI,EAAE,CAAC;IACf,OAAO,CAAC,WAAW,EAAE,CAAC;IACtB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC;IACpE,OAAO,CAAC,cAAc,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AACpD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,MAAM,CAAC,OAA0C,EAAE,aAAqB;IACtF,OAAO,CAAC,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,WAAW,EAAE,CAAC;IACtB,OAAO,CAAC,MAAM,IAAI,aAAa,CAAC;IAChC,OAAO,CAAC,cAAc,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AACpD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timmeck/trading-brain",
3
- "version": "2.31.81",
3
+ "version": "2.31.83",
4
4
  "description": "Adaptive trading intelligence system with Hebbian synapses, spreading activation, Wilson Score confidence, and adaptive calibration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@modelcontextprotocol/sdk": "^1.0.0",
44
- "@timmeck/brain-core": "2.36.91",
44
+ "@timmeck/brain-core": "^2.36.92",
45
45
  "better-sqlite3": "^11.7.0",
46
46
  "ccxt": "^4.5.42",
47
47
  "chalk": "^5.6.2",