@drico2008/fincli 0.2.2 → 0.3.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.
@@ -1,3 +1,3 @@
1
1
  """FinCLI package."""
2
2
 
3
- __version__ = "0.2.2"
3
+ __version__ = "0.3.0"
@@ -8,8 +8,10 @@ Rules:
8
8
  - Treat the provided Signal Assessment as a rule-based candidate signal, not a guaranteed trade instruction.
9
9
  - Treat the provided User Gameplay Profile as a risk constraint for SL/TP sizing and scenario wording.
10
10
  - Do not invent prices, news, fundamentals, or certainty.
11
- - If data is missing, state that data quality is insufficient.
12
- - Use probabilistic scenario language, not guaranteed entry signals.
11
+ - If data is missing, state that data quality is insufficient.
12
+ - Use the AI Grounding Guard before conclusions: check data_quality, provider reliability, missing data, and provider metrics.
13
+ - If reliability is not ok, missing data exists, or provider metrics show weak success/error performance, reduce confidence and say what must be verified.
14
+ - Use probabilistic scenario language, not guaranteed entry signals.
13
15
  - If discussing buy/sell, phrase it as candidate bias with confirmation and invalidation conditions.
14
16
  - Do not promise profit.
15
17
  - Keep the output structured and concise.
@@ -19,6 +21,9 @@ Required output:
19
21
  Instrument:
20
22
  Timeframe:
21
23
  Data Quality:
24
+ Provider Reliability:
25
+ Missing Data:
26
+ Provider Metrics:
22
27
  Market Summary:
23
28
  Trend Bias:
24
29
  Key Levels:
@@ -25,6 +25,7 @@ def build_market_analysis_prompt(
25
25
  news_context: str = "No news/fundamental context provided.",
26
26
  user_gameplay_context: str = "User Gameplay Profile: not configured.",
27
27
  trading_methods_context: str = "",
28
+ grounding_context: str = "",
28
29
  ) -> str:
29
30
  """Build a structured AI prompt from market data and computed indicators."""
30
31
  recent = candles[-10:]
@@ -54,10 +55,13 @@ def build_market_analysis_prompt(
54
55
  debate = run_technical_debate(technical, structure, candles) if structure is not None else None
55
56
  return (
56
57
  f"{market_analysis_prompt()}\n\n"
57
- f"Instrument: {symbol}\n"
58
- f"Timeframe: {timeframe}\n"
59
- f"Data Quality: {len(candles)} candles available from provider.\n\n"
60
- "Recent OHLCV:\n"
58
+ f"Instrument: {symbol}\n"
59
+ f"Timeframe: {timeframe}\n"
60
+ f"Data Quality: {len(candles)} candles available from provider.\n\n"
61
+ "AI Grounding Guard:\n"
62
+ f"{grounding_context or 'Data Quality: unknown; Provider Reliability: unknown; Missing Data: unknown; Provider Metrics: unavailable.'}\n"
63
+ "Instruction: If reliability is not ok, missing data exists, or provider metrics are weak, reduce confidence before conclusion.\n\n"
64
+ "Recent OHLCV:\n"
61
65
  f"{chr(10).join(ohlcv_lines)}\n\n"
62
66
  "Computed Indicators:\n"
63
67
  f"{chr(10).join(indicator_lines)}\n\n"
@@ -6,7 +6,7 @@ import re
6
6
 
7
7
 
8
8
  FINCLI_ASSISTANT_SYSTEM_PROMPT = """
9
- You are FinCLI AI Assistance, the embedded assistant inside FinCLI v0.2.2.
9
+ You are FinCLI AI Assistance, the embedded assistant inside FinCLI v0.3.0.
10
10
 
11
11
  Identity and scope:
12
12
  - FinCLI is a terminal-first financial dashboard for market data, news/fundamentals, technical analysis, watchlists, portfolios, journals, and provider configuration.
@@ -31,6 +31,10 @@ COMMANDS: tuple[CommandSpec, ...] = (
31
31
  CommandSpec("/profile set", "Simpan profil gameplay lokal.", '/profile set "Budi" 350 USD 1:100 1.5', "Profile"),
32
32
  CommandSpec("/doctor", "Cek kesehatan konfigurasi, provider, database, dan command inti.", "/doctor", "System"),
33
33
  CommandSpec("/setup", "Panduan setup lokal untuk API key, provider, dan profile.", "/setup", "System"),
34
+ CommandSpec("/secrets status", "Audit status secret lokal tanpa menampilkan nilai.", "/secrets status", "Security"),
35
+ CommandSpec("/secrets clear", "Hapus semua API key lokal dari secret store.", "/secrets clear", "Security"),
36
+ CommandSpec("/privacy status", "Tampilkan ringkasan state lokal sensitif.", "/privacy status", "Security"),
37
+ CommandSpec("/privacy purge", "Bersihkan secrets, history session, dan cache lokal.", "/privacy purge", "Security"),
34
38
  CommandSpec("/agent", "Lihat agent framework FinCLI.", "/agent list", "AI"),
35
39
  CommandSpec("/agent show", "Tampilkan detail agent framework.", "/agent show buffett", "AI"),
36
40
  CommandSpec("/connector", "Lihat catalog data connector.", "/connector list macro", "Provider"),
@@ -50,8 +54,9 @@ COMMANDS: tuple[CommandSpec, ...] = (
50
54
  CommandSpec("/watchlist remove", "Hapus instrumen dari watchlist.", "/watchlist remove AAPL", "Watchlist"),
51
55
  CommandSpec("/portfolio", "Tampilkan portfolio lokal.", "/portfolio", "Portfolio"),
52
56
  CommandSpec("/portfolio add", "Tambahkan posisi/aset.", "/portfolio add BTC-USD 0.05 65000", "Portfolio"),
53
- CommandSpec("/portfolio remove", "Hapus posisi/aset.", "/portfolio remove BTC-USD", "Portfolio"),
54
- CommandSpec("/portfolio performance", "Tampilkan performa portfolio.", "/portfolio performance", "Portfolio"),
57
+ CommandSpec("/portfolio remove", "Hapus posisi/aset.", "/portfolio remove BTC-USD", "Portfolio"),
58
+ CommandSpec("/portfolio performance", "Tampilkan performa portfolio.", "/portfolio performance", "Portfolio"),
59
+ CommandSpec("/portfolio risk", "Portfolio Risk v2: exposure, concentration, PnL, dan health score.", "/portfolio risk", "Portfolio"),
55
60
  CommandSpec("/tx", "Tampilkan transaction ledger.", "/tx list", "Portfolio"),
56
61
  CommandSpec("/tx add", "Tambahkan transaksi buy/sell.", "/tx add buy AAPL 10 185", "Portfolio"),
57
62
  CommandSpec("/journal", "Tampilkan journal trading/investasi.", "/journal", "Journal"),