Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions frequi/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export {}
/* prettier-ignore */
declare module 'vue' {
export interface GlobalComponents {
AgentScorecard: typeof import('./components/ai/AgentScorecard.vue')['default']
AIDashboard: typeof import('./components/ai/AIDashboard.vue')['default']
AISignalPanel: typeof import('./components/ai/AISignalPanel.vue')['default']
AutonomyLevel: typeof import('./components/ai/AutonomyLevel.vue')['default']
Expand Down Expand Up @@ -147,6 +148,7 @@ declare module 'vue' {
MultiSelect: typeof import('primevue/multiselect')['default']
NavBar: typeof import('./components/layout/NavBar.vue')['default']
NavFooter: typeof import('./components/layout/NavFooter.vue')['default']
OrganismHealth: typeof import('./components/ai/OrganismHealth.vue')['default']
Paginator: typeof import('primevue/paginator')['default']
PairlistConfigActions: typeof import('./components/ftbot/PairlistConfigActions.vue')['default']
PairlistConfigBlacklist: typeof import('./components/ftbot/PairlistConfigBlacklist.vue')['default']
Expand All @@ -170,8 +172,10 @@ declare module 'vue' {
ProfitSymbol: typeof import('./components/general/ProfitSymbol.vue')['default']
ProgressBar: typeof import('primevue/progressbar')['default']
ProgressSpinner: typeof import('primevue/progressspinner')['default']
PromotionGate: typeof import('./components/ai/PromotionGate.vue')['default']
RadioButton: typeof import('primevue/radiobutton')['default']
RadioButtonGroup: typeof import('primevue/radiobuttongroup')['default']
RegimeWatch: typeof import('./components/ai/RegimeWatch.vue')['default']
ReloadControl: typeof import('./components/ftbot/ReloadControl.vue')['default']
RiskPanel: typeof import('./components/ai/RiskPanel.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
Expand Down
6 changes: 3 additions & 3 deletions frequi/src/components/ai/TradeReasoning.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
</div>

<TabView>
<TabPanel header="Structural Analysis">
<TabPanel header="Structural Analysis" value="1">
<div class="bg-gray-50 dark:bg-gray-800 p-4 rounded-lg whitespace-pre-wrap leading-relaxed border dark:border-gray-700 text-sm break-words">
{{ signal.reasoning || 'No reasoning provided by the AI for this decision.' }}
</div>
</TabPanel>

<TabPanel header="Parameters">
<TabPanel header="Parameters" value="2">
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div class="p-3 border rounded-lg dark:border-gray-700 bg-white dark:bg-gray-900 flex flex-col items-center">
<div class="text-sm text-gray-600 dark:text-gray-400 mb-2">Confidence Score</div>
Expand All @@ -34,7 +34,7 @@
</div>
</TabPanel>

<TabPanel header="Market Context">
<TabPanel header="Market Context" value="3">
<SentimentDisplay :pair="signal.pair" :sentiment="pairSentiment" />
</TabPanel>
</TabView>
Expand Down
1 change: 1 addition & 0 deletions frequi/src/stores/ftbot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,7 @@ export function createBotSubStore(botId: string, botName: string) {
this.sysInfo = data;
return Promise.resolve(data);
} catch (err) {
console.error("Failed to fetch sysinfo: ", err);
return Promise.reject(err);
Comment on lines +1146 to 1147
}
},
Expand Down
5 changes: 1 addition & 4 deletions frequi/src/stores/ftbotwrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,7 @@ export const useBotStore = defineStore('ftbot-wrapper', {
},
addBot(bot: BotDescriptor) {
if (Object.keys(this.availableBots).includes(bot.botId)) {
// throw 'Bot already present';
// TODO: handle error!
console.log('Bot already present');
console.error('Bot already present');
return;
}
console.log('add bot', bot);
Expand All @@ -247,7 +245,6 @@ export const useBotStore = defineStore('ftbot-wrapper', {
updateBot(botId: string, bot: Partial<BotDescriptor>) {
const botInstance = this.botStores[botId];
if (!botInstance) {
// TODO: handle error!
console.error('Bot not found');
return;
}
Expand Down
2 changes: 2 additions & 0 deletions user_data/scripts/audit_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ def run_one(spec_path: Path) -> Dict[str, Any]:
row = conn.execute(spec["sql"]).fetchone()
v = (row[0] if row else 0)
expected = spec.get("expected", 0)
expected = float(expected)
v = float(v)
op = spec.get("op", "eq")
ok = (op == "eq" and v == expected) or (op == "lte" and v <= expected) or \
(op == "gte" and v >= expected)
Expand Down
22 changes: 22 additions & 0 deletions user_data/scripts/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,26 @@ def init_db():
content TEXT, context TEXT, score REAL DEFAULT 0.0,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP)''')

try:
c.execute('ALTER TABLE ai_lessons ADD COLUMN decision_id TEXT')
except sqlite3.OperationalError:
pass
try:
c.execute('ALTER TABLE ai_lessons ADD COLUMN pair TEXT')
except sqlite3.OperationalError:
pass

c.execute('''CREATE TABLE IF NOT EXISTS trades (
id INTEGER PRIMARY KEY AUTOINCREMENT)''')

try:
c.execute('ALTER TABLE trades ADD COLUMN stake_amount REAL')
except sqlite3.OperationalError:
pass
try:
c.execute('ALTER TABLE trades ADD COLUMN open_date DATETIME')
except sqlite3.OperationalError:
pass
# Canonical autonomy_state schema (matches autonomy_manager.AutonomyManager).
# api_ai.py reads level/promoted_at/sharpe_estimate/max_drawdown_pct/days_at_level;
# the old (current_level/trust_alpha/trust_beta/successful_trades) schema was
Expand Down Expand Up @@ -1483,6 +1503,8 @@ def init_db():
worst_drawdown_30d REAL,
eligible INTEGER DEFAULT 0,
ts DATETIME DEFAULT CURRENT_TIMESTAMP)''')
if c.execute("SELECT COUNT(*) FROM autonomy_diagnostics").fetchone()[0] == 0:
c.execute("INSERT INTO autonomy_diagnostics (level) VALUES (1)")

# B.6: Provider capabilities + B.5 adaptive concurrency
c.execute('''CREATE TABLE IF NOT EXISTS provider_capabilities (
Expand Down
Loading