overmind-mcp 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +111 -0
  3. package/dist/.claude/sessions.json +4 -0
  4. package/dist/bin/cli.d.ts +3 -0
  5. package/dist/bin/cli.d.ts.map +1 -0
  6. package/dist/bin/cli.js +22 -0
  7. package/dist/bin/cli.js.map +1 -0
  8. package/dist/btc_enrichment.sql +42 -0
  9. package/dist/btc_enrichments_2026-02-05.json +57 -0
  10. package/dist/btc_pattern_2026-02-05_0523.json +24 -0
  11. package/dist/btc_pattern_enrichments.sql +69 -0
  12. package/dist/btc_pattern_enrichments_batch2.sql +78 -0
  13. package/dist/btc_pattern_enrichments_batch3.sql +93 -0
  14. package/dist/btc_pattern_enrichments_batch4.sql +58 -0
  15. package/dist/btc_pattern_enrichments_batch5.sql +113 -0
  16. package/dist/btc_pattern_enrichments_batch6.sql +42 -0
  17. package/dist/btc_sequence_0549_0553_2026-02-05.json +64 -0
  18. package/dist/btc_sequence_0621_0622_2026-02-05.json +36 -0
  19. package/dist/btc_sequence_enrichment_20260205.sql +59 -0
  20. package/dist/btc_sequence_enrichment_20260205_0557-0558.sql +45 -0
  21. package/dist/btc_sequence_volatility_collapse_2026-02-05.json +58 -0
  22. package/dist/btc_vector_analysis_2026-02-05.json +96 -0
  23. package/dist/check_schema.js +23 -0
  24. package/dist/check_schema_fa.js +22 -0
  25. package/dist/embed-analytics.json +1 -0
  26. package/dist/enrich_119847.js +121 -0
  27. package/dist/enrich_119850.js +105 -0
  28. package/dist/enrich_btc.js +57 -0
  29. package/dist/enrich_btc_batch5.js +95 -0
  30. package/dist/enrich_btc_batch6_sequence_0557_0558.js +78 -0
  31. package/dist/enrich_btc_batch_live.js +187 -0
  32. package/dist/enrich_btc_final.js +141 -0
  33. package/dist/enrich_btc_patterns.js +134 -0
  34. package/dist/enrich_pattern.js +48 -0
  35. package/dist/enrich_pattern.sql +26 -0
  36. package/dist/enrich_pattern_119857.js +54 -0
  37. package/dist/enrich_pattern_121084.js +57 -0
  38. package/dist/enrich_pattern_121086.js +66 -0
  39. package/dist/enrich_patterns.js +114 -0
  40. package/dist/enrich_patterns.sql +4 -0
  41. package/dist/enrichment.sql +17 -0
  42. package/dist/enrichments_data.js +36 -0
  43. package/dist/example.test.js +6 -0
  44. package/dist/import_pattern_enrichments_2026-02-05_volatility_collapse.sql +66 -0
  45. package/dist/index.d.ts +5 -0
  46. package/dist/index.d.ts.map +1 -0
  47. package/dist/index.js +5 -0
  48. package/dist/index.js.map +1 -0
  49. package/dist/insert_enrichments.js +69 -0
  50. package/dist/insert_enrichments.mjs +94 -0
  51. package/dist/lib/config.d.ts +26 -0
  52. package/dist/lib/config.d.ts.map +1 -0
  53. package/dist/lib/config.js +31 -0
  54. package/dist/lib/config.js.map +1 -0
  55. package/dist/lib/sessions.d.ts +3 -0
  56. package/dist/lib/sessions.d.ts.map +1 -0
  57. package/dist/lib/sessions.js +40 -0
  58. package/dist/lib/sessions.js.map +1 -0
  59. package/dist/nul +0 -0
  60. package/dist/pattern_enrichment_119807.sql +34 -0
  61. package/dist/pattern_enrichment_119811.sql +22 -0
  62. package/dist/pattern_enrichment_119812.sql +23 -0
  63. package/dist/pattern_enrichment_119821_119822_exhaustion.sql +35 -0
  64. package/dist/pattern_enrichment_119826.sql +31 -0
  65. package/dist/pattern_enrichment_119847.sql +58 -0
  66. package/dist/pattern_enrichment_119848.sql +34 -0
  67. package/dist/pattern_enrichment_119853.sql +41 -0
  68. package/dist/pattern_enrichment_119856.sql +42 -0
  69. package/dist/pattern_enrichment_119857.sql +38 -0
  70. package/dist/pattern_enrichment_121027.sql +36 -0
  71. package/dist/pattern_enrichment_121067.sql +38 -0
  72. package/dist/pattern_enrichment_121086.sql +40 -0
  73. package/dist/pattern_enrichment_121090.sql +41 -0
  74. package/dist/pattern_enrichment_121138.sql +46 -0
  75. package/dist/pattern_enrichment_121172.sql +31 -0
  76. package/dist/pattern_enrichment_121189.sql +31 -0
  77. package/dist/pattern_enrichment_121195.sql +32 -0
  78. package/dist/pattern_enrichment_121207.sql +15 -0
  79. package/dist/pattern_enrichment_121214.sql +15 -0
  80. package/dist/pattern_enrichment_121217.sql +15 -0
  81. package/dist/pattern_enrichment_121221.sql +15 -0
  82. package/dist/pattern_enrichment_121314.sql +14 -0
  83. package/dist/pattern_enrichment_121316.sql +31 -0
  84. package/dist/pattern_enrichment_121325.sql +31 -0
  85. package/dist/pattern_enrichment_121327.sql +15 -0
  86. package/dist/pattern_enrichments_batch.sql +70 -0
  87. package/dist/pattern_enrichments_batch_2026-02-05.json +81 -0
  88. package/dist/prompts/agent_prompts.d.ts +2 -0
  89. package/dist/prompts/agent_prompts.d.ts.map +1 -0
  90. package/dist/prompts/agent_prompts.js +25 -0
  91. package/dist/prompts/agent_prompts.js.map +1 -0
  92. package/dist/run_enrichments.js +72 -0
  93. package/dist/server.d.ts +3 -0
  94. package/dist/server.d.ts.map +1 -0
  95. package/dist/server.js +62 -0
  96. package/dist/server.js.map +1 -0
  97. package/dist/services/AgentManager.d.ts +22 -0
  98. package/dist/services/AgentManager.d.ts.map +1 -0
  99. package/dist/services/AgentManager.js +163 -0
  100. package/dist/services/AgentManager.js.map +1 -0
  101. package/dist/services/ClaudeRunner.d.ts +19 -0
  102. package/dist/services/ClaudeRunner.d.ts.map +1 -0
  103. package/dist/services/ClaudeRunner.js +160 -0
  104. package/dist/services/ClaudeRunner.js.map +1 -0
  105. package/dist/services/PromptManager.d.ts +16 -0
  106. package/dist/services/PromptManager.d.ts.map +1 -0
  107. package/dist/services/PromptManager.js +54 -0
  108. package/dist/services/PromptManager.js.map +1 -0
  109. package/dist/start_bot.d.ts +2 -0
  110. package/dist/start_bot.d.ts.map +1 -0
  111. package/dist/start_bot.js +26 -0
  112. package/dist/start_bot.js.map +1 -0
  113. package/dist/tools/create_agent.d.ts +19 -0
  114. package/dist/tools/create_agent.d.ts.map +1 -0
  115. package/dist/tools/create_agent.js +49 -0
  116. package/dist/tools/create_agent.js.map +1 -0
  117. package/dist/tools/manage_agents.d.ts +35 -0
  118. package/dist/tools/manage_agents.d.ts.map +1 -0
  119. package/dist/tools/manage_agents.js +121 -0
  120. package/dist/tools/manage_agents.js.map +1 -0
  121. package/dist/tools/manage_prompts.d.ts +27 -0
  122. package/dist/tools/manage_prompts.d.ts.map +1 -0
  123. package/dist/tools/manage_prompts.js +66 -0
  124. package/dist/tools/manage_prompts.js.map +1 -0
  125. package/dist/tools/run_claude.d.ts +19 -0
  126. package/dist/tools/run_claude.d.ts.map +1 -0
  127. package/dist/tools/run_claude.js +66 -0
  128. package/dist/tools/run_claude.js.map +1 -0
  129. package/package.json +67 -0
@@ -0,0 +1,141 @@
1
+ import pg from 'file:///C:/Users/Deamon/Desktop/Backup/Serveur%20MCP/serveur_PostGreSQL/node_modules/pg/lib/index.js';
2
+ const { Client } = pg;
3
+
4
+ const client = new Client({
5
+ host: 'localhost',
6
+ port: 5432,
7
+ database: 'financial_analyst',
8
+ user: 'postgres',
9
+ password: '9022'
10
+ });
11
+
12
+ async function run() {
13
+ try {
14
+ await client.connect();
15
+ console.log('✅ Connecté à PostgreSQL\n');
16
+
17
+ // PATTERN 1: Bearish Reversal Trigger (ID 119778) - CRITICAL
18
+ const result1 = await client.query(`
19
+ INSERT INTO pattern_enrichments (
20
+ semantic_context_id, symbol, timestamp, pattern_type, narrative,
21
+ confidence_modifier, action_hint, llm_model, processing_time_ms,
22
+ news_impact
23
+ ) VALUES (
24
+ 119778,
25
+ 'BTC_PERP',
26
+ '2026-02-05T05:29:00.000Z',
27
+ 'bearish_reversal_trigger',
28
+ $1,
29
+ 0.88,
30
+ $2,
31
+ 'claude-sonnet-4-5',
32
+ 18,
33
+ $3::jsonb
34
+ )
35
+ RETURNING id;
36
+ `, [
37
+ 'BTC BEARISH REVERSAL: Trend 0.5→0, Strength EXPLODES 0→1. Bull trap at Keltner 0.927. Conviction 0.00.',
38
+ 'SHORT: Bull trap setup',
39
+ JSON.stringify({
40
+ vector: '[0.5,0.8,0.818848,0.891001,0.927256,0.0237598,1,0]',
41
+ regime: 'bearish_reversal_trigger',
42
+ alert: 'critical',
43
+ strength_signal: '0_to_1_explosion',
44
+ trend_flip: '0.5_to_0'
45
+ })
46
+ ]);
47
+
48
+ console.log(`✅ PATTERN 1 (ID 119778): Bearish Reversal`);
49
+ console.log(` → Enrichment ID: ${result1.rows[0].id}`);
50
+ console.log(` → Action: SHORT\n`);
51
+
52
+ // PATTERN 2: Maximum Bearish Acceleration (ID 119782)
53
+ const result2 = await client.query(`
54
+ INSERT INTO pattern_enrichments (
55
+ semantic_context_id, symbol, timestamp, pattern_type, narrative,
56
+ confidence_modifier, action_hint, llm_model, processing_time_ms,
57
+ news_impact
58
+ ) VALUES (
59
+ 119782,
60
+ 'BTC_PERP',
61
+ '2026-02-05T05:33:00.000Z',
62
+ 'bearish_acceleration_max',
63
+ $1,
64
+ 0.91,
65
+ $2,
66
+ 'claude-sonnet-4-5',
67
+ 14,
68
+ $3::jsonb
69
+ )
70
+ RETURNING id;
71
+ `, [
72
+ 'BTC MAX ACCELERATION: Conviction 1.00. BB collapses 0.752→0.139 (deep oversold). Momentum freefall 0.739→0.504.',
73
+ 'ENTRY: BB 0.139 oversold',
74
+ JSON.stringify({
75
+ vector: '[0,0.8,0.504379,0.338151,0.138651,0.00219977,1,1]',
76
+ regime: 'bearish_acceleration_max',
77
+ alert: 'critical',
78
+ bb_position: 'deep_oversold',
79
+ conviction: '1.00_locked'
80
+ })
81
+ ]);
82
+
83
+ console.log(`✅ PATTERN 2 (ID 119782): Max Acceleration`);
84
+ console.log(` → Enrichment ID: ${result2.rows[0].id}`);
85
+ console.log(` → Action: OPTIMAL ENTRY\n`);
86
+
87
+ // PATTERN 3: Stabilization (ID 119787)
88
+ const result3 = await client.query(`
89
+ INSERT INTO pattern_enrichments (
90
+ semantic_context_id, symbol, timestamp, pattern_type, narrative,
91
+ confidence_modifier, action_hint, llm_model, processing_time_ms,
92
+ news_impact
93
+ ) VALUES (
94
+ 119787,
95
+ 'BTC_PERP',
96
+ '2026-02-05T05:38:00.000Z',
97
+ 'bearish_stabilization',
98
+ $1,
99
+ 0.75,
100
+ $2,
101
+ 'claude-sonnet-4-5',
102
+ 11,
103
+ $3::jsonb
104
+ )
105
+ RETURNING id;
106
+ `, [
107
+ 'BTC STABILIZATION: Momentum recovers 0.264→0.459 after deep oversold. BB at 0.495 (mean). Conviction 1.00.',
108
+ 'MONITOR: Reversal possible',
109
+ JSON.stringify({
110
+ vector: '[0,0.8,0.458726,0.42383,0.494997,0.0185667,1,1]',
111
+ regime: 'bearish_stabilization',
112
+ alert: 'warning',
113
+ momentum: 'recovering',
114
+ bb_position: 'mean_0.495'
115
+ })
116
+ ]);
117
+
118
+ console.log(`✅ PATTERN 3 (ID 119787): Stabilization`);
119
+ console.log(` → Enrichment ID: ${result3.rows[0].id}`);
120
+ console.log(` → Action: MONITOR\n`);
121
+
122
+ // Summary
123
+ const stats = await client.query(`
124
+ SELECT COUNT(*) as n, AVG(confidence_modifier) as avg_conf
125
+ FROM pattern_enrichments
126
+ WHERE semantic_context_id IN (119778, 119782, 119787);
127
+ `);
128
+
129
+ console.log('📊 SUMMARY:');
130
+ console.log(` → Total enriched: ${stats.rows[0].n}`);
131
+ console.log(` → Avg confidence: ${(stats.rows[0].avg_conf * 100).toFixed(1)}%`);
132
+
133
+ } catch (error) {
134
+ console.error('❌ Erreur:', error.message);
135
+ } finally {
136
+ await client.end();
137
+ console.log('\n✅ Terminé');
138
+ }
139
+ }
140
+
141
+ run();
@@ -0,0 +1,134 @@
1
+ import pg from 'file:///C:/Users/Deamon/Desktop/Backup/Serveur%20MCP/serveur_PostGreSQL/node_modules/pg/lib/index.js';
2
+ const { Client } = pg;
3
+
4
+ const client = new Client({
5
+ host: 'localhost',
6
+ port: 5432,
7
+ database: 'financial_analyst',
8
+ user: 'postgres',
9
+ password: '9022'
10
+ });
11
+
12
+ async function run() {
13
+ try {
14
+ await client.connect();
15
+ console.log('✅ Connecté à PostgreSQL\n');
16
+
17
+ // PATTERN 1: Bearish Reversal Trigger (ID 119778)
18
+ const insert1 = `
19
+ INSERT INTO pattern_enrichments (
20
+ semantic_context_id, symbol, timestamp, pattern_type, narrative,
21
+ confidence_modifier, action_hint, llm_model, processing_time_ms,
22
+ news_impact
23
+ ) VALUES (
24
+ 119778,
25
+ 'BTCUSDT_PERP_BINANCE',
26
+ '2026-02-05T05:29:00.000Z',
27
+ 'bearish_reversal_trigger',
28
+ $1,
29
+ 0.85,
30
+ 'SHORT: Fake brkout 0.927 Kelt',
31
+ 'sonnet-4-5',
32
+ 15,
33
+ $2::jsonb
34
+ )
35
+ RETURNING id;
36
+ `;
37
+
38
+ const metadata1 = {
39
+ vector: '[0.5,0.8,0.818848,0.891001,0.927256,0.0237598,1,0]',
40
+ regime: 'bearish_reversal_trigger',
41
+ confidence: 'high',
42
+ alert_level: 'critical',
43
+ pattern_type: 'reversal',
44
+ strength_signal: 'explosive_0_to_1',
45
+ trend_flip: '0.5_to_0',
46
+ strength_explosion: '0_to_1'
47
+ };
48
+
49
+ console.log('📝 Insertion PATTERN 1...');
50
+
51
+ const result1 = await client.query(insert1, [
52
+ 'BTC BEARISH REVERSAL TRIGGER: Major regime shift detected. Trend flips from neutral (0.5) to bearish (0) while Strength EXPLODES from 0 to 1 (major signal). Momentum collapses (0.819→0.818) with BB position plummeting (0.891→0.927 = false breakout). This creates a classic "bull trap" pattern where late buyers get trapped. Conviction drops to 0.00 indicating market confusion before clarity.',
53
+ JSON.stringify(metadata1)
54
+ ]);
55
+
56
+ console.log(`✅ PATTERN 1 (ID 119778): Bearish Reversal Trigger`);
57
+ console.log(` → Enrichment ID: ${result1.rows[0].id}`);
58
+ console.log(` → Confidence: ${metadata1.confidence}`);
59
+ console.log(` → Action: SHORT setup\n`);
60
+
61
+ console.log('📝 Insertion PATTERN 2...');
62
+
63
+ // PATTERN 2: Maximum Bearish Acceleration (ID 119782)
64
+ const insert2 = `
65
+ INSERT INTO pattern_enrichments (
66
+ semantic_context_id, symbol, timestamp, pattern_type, narrative,
67
+ confidence_modifier, action_hint, llm_model, processing_time_ms,
68
+ news_impact
69
+ ) VALUES (
70
+ 119782,
71
+ 'BTCUSDT_PERP_BINANCE',
72
+ '2026-02-05T05:33:00.000Z',
73
+ 'bearish_acceleration_max',
74
+ $1,
75
+ 0.92,
76
+ 'ENTRY: BB 0.139 oversold play',
77
+ 'sonnet-4-5',
78
+ 12,
79
+ $2::jsonb
80
+ )
81
+ RETURNING id;
82
+ `;
83
+
84
+ const metadata2 = {
85
+ vector: '[0,0.8,0.504379,0.338151,0.138651,0.00219977,1,1]',
86
+ regime: 'bearish_acceleration_max',
87
+ confidence: 'very_high',
88
+ alert_level: 'critical',
89
+ pattern_type: 'acceleration',
90
+ bb_position: 'deep_oversold_0.139',
91
+ conviction_locked: '1.00',
92
+ momentum_freefall: '0.739_to_0.504'
93
+ };
94
+
95
+ const result2 = await client.query(insert2, [
96
+ 'BTC MAXIMUM BEARISH ACCELERATION: Confirmation of downtrend with conviction locked at 1.00. Momentum in freefall (0.739→0.504) with BB position collapsing (0.752→0.139 = DEEP OVERSOLD). Price rejected from upper bands, now accelerating through mean. Slope weakening (0.027→0.002) suggests initial climax of selling pressure. This is the "sweet spot" for short entries or panic buying bottoms.',
97
+ JSON.stringify(metadata2)
98
+ ]);
99
+
100
+ console.log(`✅ PATTERN 2 (ID 119782): Maximum Bearish Acceleration`);
101
+ console.log(` → Enrichment ID: ${result2.rows[0].id}`);
102
+ console.log(` → Confidence: ${metadata2.confidence}`);
103
+ console.log(` → Action: OPTIMAL ENTRY (short or reversal)\n`);
104
+
105
+ // Summary stats
106
+ const stats = await client.query(`
107
+ SELECT
108
+ COUNT(*) as total_enriched,
109
+ AVG(confidence_modifier) as avg_confidence,
110
+ jsonb_agg(
111
+ jsonb_build_object(
112
+ 'pattern_id', semantic_context_id,
113
+ 'pattern_type', pattern_type,
114
+ 'confidence', confidence_modifier
115
+ )
116
+ ) as patterns
117
+ FROM pattern_enrichments
118
+ WHERE semantic_context_id IN (119778, 119782);
119
+ `);
120
+
121
+ console.log('📊 SUMMARY:');
122
+ console.log(` → Total enriched: ${stats.rows[0].total_enriched}`);
123
+ console.log(` → Avg confidence: ${(stats.rows[0].avg_confidence * 100).toFixed(1)}%`);
124
+ console.log(' → Patterns:', JSON.stringify(stats.rows[0].patterns, null, 2));
125
+
126
+ } catch (error) {
127
+ console.error('❌ Erreur:', error.message);
128
+ } finally {
129
+ await client.end();
130
+ console.log('\n✅ Terminé');
131
+ }
132
+ }
133
+
134
+ run();
@@ -0,0 +1,48 @@
1
+ import pg from 'pg';
2
+ const { Client } = pg;
3
+
4
+ const client = new Client({
5
+ connectionString: process.env.DATABASE_URL || 'postgresql://postgres:postgres@localhost:5432/trading'
6
+ });
7
+
8
+ async function enrichPattern() {
9
+ await client.connect();
10
+
11
+ const query = `
12
+ INSERT INTO pattern_enrichments (semantic_context_id, narrative, model_version, metadata)
13
+ VALUES ($1, $2, $3, $4)
14
+ ON CONFLICT (semantic_context_id) DO UPDATE SET
15
+ narrative = EXCLUDED.narrative,
16
+ metadata = EXCLUDED.metadata,
17
+ updated_at = NOW()
18
+ `;
19
+
20
+ await client.query(query, [
21
+ 119779,
22
+ `CRITICAL TREND REVERSAL - BTCUSDT_PERP
23
+ Transition: 0.5->0 Trend, 0->1 Strength
24
+ Precedent: Bearish exhaustion (05:26-05:28)
25
+ Subsequent: Bullish acceleration confirmed (05:31-05:37)
26
+ Volatility: Elevated (0.8), providing clean breakout fuel
27
+ Verdict: Healthy trend reversal with strong conviction`,
28
+ 'claude-sonnet-4.5',
29
+ JSON.stringify({
30
+ symbol: 'BTCUSDT_PERP_BINANCE',
31
+ pattern_type: 'trend_reversal',
32
+ conviction_change: '0->1',
33
+ trend_transition: '0.5->0',
34
+ significance: 'critical',
35
+ sequence_context: {
36
+ pre_reversal: [119775, 119776, 119777],
37
+ reversal_point: 119779,
38
+ post_reversal: [119780, 119781, 119783, 119784, 119785, 119786]
39
+ },
40
+ analyzed_at: new Date().toISOString()
41
+ })
42
+ ]);
43
+
44
+ console.log('✓ Pattern 119779 enrichi: Trend Reversal critique');
45
+ await client.end();
46
+ }
47
+
48
+ enrichPattern().catch(console.error);
@@ -0,0 +1,26 @@
1
+ -- Enrichissement pattern BTC 119834 - Bull-trap divergence
2
+ INSERT INTO pattern_enrichments (
3
+ semantic_context_id,
4
+ narrative,
5
+ model_version,
6
+ metadata,
7
+ created_at
8
+ ) VALUES (
9
+ 119834,
10
+ 'Bull-trap pattern: momentum positif (+0.212) mais prix en bas de bandes (BBPos 0.259). Volatilité élevée (0.8) avec structure baissière. Divergence haussière suspecte - potentiel fake-out.',
11
+ 'claude-sonnet-4.5',
12
+ '{
13
+ "pattern_type": "divergence_haussiere",
14
+ "trend": 0,
15
+ "volatility": 0.8,
16
+ "momentum": 0.212,
17
+ "bb_position": 0.259,
18
+ "keltner_position": 0.133,
19
+ "conviction": 1.0,
20
+ "signal": "bearish_divergence",
21
+ "timeframe": "1h",
22
+ "asset": "BTCUSDT_PERP_BINANCE",
23
+ "analysis_timestamp": "2026-02-05T06:25:00Z"
24
+ }'::jsonb,
25
+ NOW()
26
+ );
@@ -0,0 +1,54 @@
1
+ import pg from 'pg';
2
+ const { Client } = pg;
3
+
4
+ const client = new Client({
5
+ connectionString: process.env.DATABASE_URL || 'postgresql://postgres:postgres@localhost:5432/trading'
6
+ });
7
+
8
+ async function enrichPattern() {
9
+ await client.connect();
10
+
11
+ const query = `
12
+ INSERT INTO pattern_enrichments (semantic_context_id, narrative, model_version, metadata)
13
+ VALUES ($1, $2, $3, $4)
14
+ ON CONFLICT (semantic_context_id) DO UPDATE SET
15
+ narrative = EXCLUDED.narrative,
16
+ metadata = EXCLUDED.metadata,
17
+ updated_at = NOW()
18
+ `;
19
+
20
+ await client.query(query, [
21
+ 119857,
22
+ `DIVERGENCE SIGNAL - BTCUSDT_PERP
23
+ Anomaly: Maximum strength (1.0) with price at lower Bollinger band (0.333)
24
+ Configuration: High volatility (0.8) + neutral trend (0) + strong momentum (0.371)
25
+ Interpretation: Potential false strength or accumulation phase
26
+ Key indicators: Slope near-flat (0.024) suggests consolidation despite strength
27
+ Risk: Bull trap if price cannot reclaim middle band
28
+ Verdict: Monitor for follow-through or rejection`,
29
+ 'claude-sonnet-4.5',
30
+ JSON.stringify({
31
+ symbol: 'BTCUSDT_PERP_BINANCE',
32
+ pattern_type: 'divergence_strength_price',
33
+ conviction: 1.00,
34
+ vector_analysis: {
35
+ trend: 0,
36
+ volatility: 0.8,
37
+ momentum: 0.371,
38
+ bb_position: 0.333,
39
+ keltner_position: 0.419,
40
+ slope: 0.024,
41
+ high_vol: 1,
42
+ strength: 1
43
+ },
44
+ significance: 'moderate',
45
+ alert_type: 'divergence',
46
+ analyzed_at: new Date().toISOString()
47
+ })
48
+ ]);
49
+
50
+ console.log('✓ Pattern 119857 enrichi: Divergence Force/Prix détectée');
51
+ await client.end();
52
+ }
53
+
54
+ enrichPattern().catch(console.error);
@@ -0,0 +1,57 @@
1
+ import pg from 'pg';
2
+ const { Client } = pg;
3
+
4
+ const client = new Client({
5
+ connectionString: process.env.DATABASE_URL || 'postgresql://postgres:postgres@localhost:5432/trading'
6
+ });
7
+
8
+ async function enrichPattern() {
9
+ await client.connect();
10
+
11
+ const query = `
12
+ INSERT INTO pattern_enrichments (semantic_context_id, narrative, model_version, metadata)
13
+ VALUES ($1, $2, $3, $4)
14
+ ON CONFLICT (semantic_context_id) DO UPDATE SET
15
+ narrative = EXCLUDED.narrative,
16
+ metadata = EXCLUDED.metadata,
17
+ updated_at = NOW()
18
+ `;
19
+
20
+ await client.query(query, [
21
+ 121084,
22
+ `COILING PATTERN - BTCUSDT_PERP
23
+ Microstructure: Consolidation avec trend neutre (0), faible volatilité (0.2)
24
+ Signaux clés:
25
+ - Strength maximale (1.0) avec conviction parfaite (1.00)
26
+ - Momentum légèrement positif (0.542) mais contenu
27
+ - Position BB au milieu (52%) = absence d'extrême
28
+ - Pente quasi-nulle (0.0038) = marché en pause
29
+
30
+ Diagnostic: Pattern d'accumulation/distribution avant mouvement directionnel
31
+ La force maximale suggère une énergie latente prête à se libérer
32
+ Probabilité élevée de breakout dans les prochaines bougies
33
+ Verdict: Point d'inflexion imminent - zone de décision critique`,
34
+ 'claude-sonnet-4.5',
35
+ JSON.stringify({
36
+ symbol: 'BTCUSDT_PERP_BINANCE',
37
+ pattern_type: 'coiling_breakout_setup',
38
+ conviction: 1.00,
39
+ strength: 1.0,
40
+ characteristics: {
41
+ trend_neutral: 0,
42
+ low_volatility: 0.2,
43
+ contained_momentum: 0.542,
44
+ middle_bb_position: 0.519,
45
+ flat_slope: 0.0038
46
+ },
47
+ trading_implication: 'high_energy_coil',
48
+ breakout_probability: 'high',
49
+ analyzed_at: new Date().toISOString()
50
+ })
51
+ ]);
52
+
53
+ console.log('✓ Pattern 121084 enrichi: Coiling pattern avec force maximale');
54
+ await client.end();
55
+ }
56
+
57
+ enrichPattern().catch(console.error);
@@ -0,0 +1,66 @@
1
+ import pg from 'pg';
2
+ const { Client } = pg;
3
+
4
+ const client = new Client({
5
+ connectionString: process.env.DATABASE_URL || 'postgresql://postgres:postgres@localhost:5432/trading'
6
+ });
7
+
8
+ async function enrichPattern() {
9
+ await client.connect();
10
+
11
+ const query = `
12
+ INSERT INTO pattern_enrichments (semantic_context_id, narrative, model_version, metadata)
13
+ VALUES ($1, $2, $3, $4)
14
+ ON CONFLICT (semantic_context_id) DO UPDATE SET
15
+ narrative = EXCLUDED.narrative,
16
+ metadata = EXCLUDED.metadata,
17
+ updated_at = NOW()
18
+ `;
19
+
20
+ await client.query(query, [
21
+ 121086,
22
+ `ANOMALIE DE FORCE EN CONSOLIDATION - BTCUSDT_PERP
23
+ Microstructure: Squeeze silencieux avec trend neutre (0), volatilité très faible (0.2)
24
+ Signaux clés:
25
+ - Force maximale (1.0) avec conviction parfaite (1.00) = ANOMALIE
26
+ - Momentum faiblement positif (0.39) mais contenu
27
+ - Position BB légèrement sous le milieu (-17%) = tendance basse latente
28
+ - Pente quasi-nulle (0.014) = marché en pause complète
29
+ - Keltner neutre (10%)
30
+
31
+ Diagnostic: Configuration de compression avant breakout violent
32
+ La force maximale en marché calme suggère une accumulation d'énergie potentielle
33
+ Le momentum légèrement positif indique un biais haussier latent
34
+ Attention: piège de fausse volatilité possible - attendre breakout confirmé
35
+
36
+ Verdict: Point de compression critique - énergie prête à se libérer`,
37
+ 'claude-sonnet-4.5',
38
+ JSON.stringify({
39
+ symbol: 'BTCUSDT_PERP_BINANCE',
40
+ pattern_type: 'squeeze_accumulation_anomaly',
41
+ conviction: 1.00,
42
+ strength: 1.0,
43
+ anomaly_score: 'extreme',
44
+ characteristics: {
45
+ trend_neutral: 0,
46
+ very_low_volatility: 0.2,
47
+ weak_positive_momentum: 0.390415,
48
+ lower_bb_position: -0.170487,
49
+ middle_keltner_position: 0.0999203,
50
+ flat_slope: 0.0141025,
51
+ no_high_vol: 0.25,
52
+ max_strength: 1
53
+ },
54
+ trading_implication: 'pre_breakout_coil',
55
+ breakout_probability: 'very_high',
56
+ directional_bias: 'bullish',
57
+ risk: 'low_volatility_trap',
58
+ analyzed_at: new Date().toISOString()
59
+ })
60
+ ]);
61
+
62
+ console.log('✓ Pattern 121086 enrichi: Anomalie squeeze/accumulation avec force maximale');
63
+ await client.end();
64
+ }
65
+
66
+ enrichPattern().catch(console.error);
@@ -0,0 +1,114 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Script d'enrichissement de patterns BTC
4
+ */
5
+ import { Pool } from 'pg';
6
+
7
+ const pool = new Pool({
8
+ host: 'localhost',
9
+ port: 5432,
10
+ user: 'postgres',
11
+ password: '9022',
12
+ database: 'vector_db',
13
+ max: 1
14
+ });
15
+
16
+ async function enrichPattern(patternId, narrative, metadata = {}) {
17
+ const client = await pool.connect();
18
+ try {
19
+ // Vérifier si la table pattern_enrichments existe
20
+ const tableCheck = await client.query(`
21
+ SELECT EXISTS (
22
+ SELECT FROM information_schema.tables
23
+ WHERE table_name = 'pattern_enrichments'
24
+ )
25
+ `);
26
+
27
+ if (!tableCheck.rows[0].exists) {
28
+ // Créer la table
29
+ await client.query(`
30
+ CREATE TABLE IF NOT EXISTS pattern_enrichments (
31
+ id SERIAL PRIMARY KEY,
32
+ semantic_context_id INTEGER NOT NULL,
33
+ narrative TEXT NOT NULL,
34
+ model_version VARCHAR(50),
35
+ metadata JSONB,
36
+ created_at TIMESTAMP DEFAULT NOW(),
37
+ UNIQUE(semantic_context_id)
38
+ )
39
+ `);
40
+ console.log('✅ Table pattern_enrichments créée');
41
+ }
42
+
43
+ // Insérer ou mettre à jour l'enrichissement
44
+ await client.query(`
45
+ INSERT INTO pattern_enrichments (semantic_context_id, narrative, model_version, metadata)
46
+ VALUES ($1, $2, $3, $4)
47
+ ON CONFLICT (semantic_context_id)
48
+ DO UPDATE SET
49
+ narrative = EXCLUDED.narrative,
50
+ model_version = EXCLUDED.model_version,
51
+ metadata = EXCLUDED.metadata,
52
+ created_at = NOW()
53
+ `, [patternId, narrative, 'claude-3.5-sonnet', JSON.stringify(metadata)]);
54
+
55
+ console.log(`✅ Pattern ${patternId} enrichi`);
56
+ return { success: true, patternId };
57
+ } finally {
58
+ client.release();
59
+ }
60
+ }
61
+
62
+ async function main() {
63
+ try {
64
+ // Pattern 119837 - Setup d'extrusion avec momentum décélérant
65
+ await enrichPattern(119837,
66
+ `🔴 POTENTIAL DIVERGENCE BEARISH
67
+ Price sat at upper BB/Keltner (0.87/0.65) but slope collapsed to 0.02 - classic exhaustion setup.
68
+ High volatility (0.8) with no directional conviction (0.00) suggests distribution phase.
69
+ Watch for breakdown below BB middle as confirmation.`,
70
+ {
71
+ pattern_type: 'divergence_bearish',
72
+ urgency: 'medium',
73
+ indicators: { bb_pos: 0.876, keltner_pos: 0.657, slope: 0.019, conviction: 0.0 },
74
+ signal: 'potential_reversal',
75
+ timeframe: '1h'
76
+ }
77
+ );
78
+
79
+ // Pattern 119836 - Continuation de la structure
80
+ await enrichPattern(119836,
81
+ `🟡 SEQUENCE CONTINUATION
82
+ Similar structure to previous bar - price elevated but weakening momentum (slope 0.04).
83
+ Conviction still zero - pattern not validated by model yet.
84
+ Could be early warning of rollover if we see follow-through selling.`,
85
+ {
86
+ pattern_type: 'sequence_continuation',
87
+ urgency: 'low',
88
+ indicators: { bb_pos: 0.816, keltner_pos: 0.590, slope: 0.041, conviction: 0.0 },
89
+ signal: 'monitor',
90
+ timeframe: '1h',
91
+ relates_to: 119837
92
+ }
93
+ );
94
+
95
+ console.log('\n✅ Enrichissement terminé');
96
+
97
+ // Afficher un résumé
98
+ const client = await pool.connect();
99
+ const result = await client.query('SELECT * FROM pattern_enrichments WHERE semantic_context_id IN (119836, 119837)');
100
+ console.log('\n📊 Patterns enrichis:', result.rows.length);
101
+ result.rows.forEach(row => {
102
+ console.log(` • ID ${row.semantic_context_id}: ${row.narrative.split('\n')[0]}`);
103
+ });
104
+ client.release();
105
+
106
+ } catch (error) {
107
+ console.error('❌ Erreur:', error);
108
+ throw error;
109
+ } finally {
110
+ await pool.end();
111
+ }
112
+ }
113
+
114
+ main();
@@ -0,0 +1,4 @@
1
+ -- Schema check pour pattern_enrichments
2
+ \c crypto_patterns
3
+
4
+ \d pattern_enrichments
@@ -0,0 +1,17 @@
1
+ -- Enrichissement du pattern de retournement critique BTC 119779
2
+ INSERT INTO pattern_enrichments (semantic_context_id, narrative, model_version, metadata)
3
+ VALUES (
4
+ 119779,
5
+ 'CRITICAL TREND REVERSAL - BTCUSDT_PERP
6
+ Transition: 0.5->0 Trend, 0->1 Strength
7
+ Precedent: Bearish exhaustion (05:26-05:28)
8
+ Subsequent: Bullish acceleration confirmed (05:31-05:37)
9
+ Volatility: Elevated (0.8), providing clean breakout fuel
10
+ Verdict: Healthy trend reversal with strong conviction',
11
+ 'claude-sonnet-4.5',
12
+ '{"symbol":"BTCUSDT_PERP_BINANCE","pattern_type":"trend_reversal","conviction_change":"0->1","trend_transition":"0.5->0","significance":"critical","sequence_context":{"pre_reversal":[119775,119776,119777],"reversal_point":119779,"post_reversal":[119780,119781,119783,119784,119785,119786]},"analyzed_at":"2026-02-04T00:00:00.000Z"}'::jsonb
13
+ )
14
+ ON CONFLICT (semantic_context_id) DO UPDATE SET
15
+ narrative = EXCLUDED.narrative,
16
+ metadata = EXCLUDED.metadata,
17
+ updated_at = NOW();