* Localizzazione italiana di tutte le pagine (Stato, Audit, Equity,
Storico, Posizione) e della home; date relative ("5s fa", "12m fa").
* Logo Cerbero (cane a tre teste) in src/cerbero_bite/gui/assets/
cerbero_logo.png — sostituisce l'emoji 🐺 (lupo, semanticamente
errata) sia come favicon (`page_icon`) sia in sidebar e header.
* Caricamento automatico di `.env` dal CWD all'avvio della CLI (skip
sotto pytest tramite PYTEST_CURRENT_TEST), evitando di doversi
esportare manualmente le 4 URL MCP. Aggiunto python-dotenv come
dipendenza, `.env.example` committato come template, `.env` resta
ignorato da git.
* Pagina Stato: nuovo pannello "Saldi exchange" che fa fetch live
via gateway MCP (Deribit USDC + USDT, Hyperliquid USDC + opzionale
USDT spot) con cache TTL 60s e bottone refresh; tile riassuntivi
totale USD / EUR / cambio.
* Pagina Stato: nuovo pannello "Forza ciclo" con tre bottoni
(entry/monitor/health) che accodano azioni `run_cycle` nella tabella
manual_actions; il consumer dell'engine — quando in esecuzione —
dispatcha al `Orchestrator.run_*` corrispondente.
* manual_actions: nuovo `kind="run_cycle"` nello schema
ManualAction; consumer accetta dict di cycle_runners che
l'orchestrator popola in install_scheduler. 3 nuovi test (dispatch
entry, ciclo sconosciuto, fallback senza runner).
* gui/live_data.py — modulo dedicato al fetch MCP dalla GUI
(relax controllato della regola "no MCP from GUI" solo per i saldi,
non per i dati di trading).
363/363 tests pass; ruff clean; mypy strict src clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds the analytics surface of the dashboard:
* gui/data_layer.py — extended with load_closed_positions (windowed
filter on closed_at) and three pure-function aggregators:
compute_equity_curve, compute_kpis, compute_monthly_stats. Drawdown
is measured against the running peak of cumulative realised P&L.
* gui/pages/3_📈_Equity.py — KPI strip, plotly cumulative-PnL line,
drawdown area below, P&L histogram by close_reason, per-month table
with win-rate.
* gui/pages/4_📜_History.py — windowed table of closed trades with
multiselect close-reason and winners/losers radio filters, six-tile
KPI strip, CSV export button.
* pyproject.toml — relax mypy on plotly + pandas (no shipped stubs).
Validated with synthetic data: 3 trades, 67% win rate, $50 total,
max drawdown $30 — all matching expected math. GUI launches, HTTP 200
on / and /_stcore/health.
353/353 tests still pass; ruff clean; mypy strict src clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Implements the foundation of the local observation dashboard described
in docs/11-gui-streamlit.md:
* gui/data_layer.py — read-only wrappers over Repository (system_state,
open positions) and audit_log (tail iteration, chain verify). The GUI
never imports runtime/ nor calls MCP services.
* gui/main.py — Streamlit entry point with sidebar (engine health
badge, kill switch banner, last health check age), home overview.
* gui/pages/1_📊_Status.py — engine status with colored health banner,
kill switch detail, audit anchor, open positions table.
* gui/pages/2_🔍_Audit.py — live audit log stream (newest-first),
event filters, hash-chain integrity verify button.
* cli.py gui — replaces the placeholder with os.execvpe to
`python -m streamlit run` bound to 127.0.0.1, --browser.gatherUsageStats
false; --db / --audit paths exported via env to the GUI process.
* pyproject.toml — N999 ignore for src/cerbero_bite/gui/pages/* (Streamlit
auto-discovers pages whose filename contains numbers and emoji icons).
Smoke test: GUI launches, HTTP 200 on / and /_stcore/health, data layer
correctly reflects current testnet state (engine=running, kill_switch
disarmed, 0 open positions, audit chain integra 7 entries).
353/353 tests still pass; ruff clean; mypy strict src clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Wrapper async tipizzati sui sei servizi MCP HTTP che Cerbero Bite
consuma in autonomia. 277 test pass, copertura clients 93%, mypy
strict pulito, ruff clean.
Base layer:
- clients/_base.py: HttpToolClient con httpx + tenacity (retry
esponenziale 3x, timeout 8s, mapping HTTP→eccezioni tipizzate).
- clients/_exceptions.py: McpAuthError, McpServerError, McpToolError,
McpDataAnomalyError, McpNotFoundError, McpTimeoutError.
- config/mcp_endpoints.py: risoluzione URL via Docker DNS
(mcp-deribit:9011, ...) con override per servizio via env var;
caricamento bearer token da secrets/core.token o
CERBERO_BITE_CORE_TOKEN_FILE.
Wrapper:
- clients/macro.py: next_high_severity_within() per filtro entry §2.5.
- clients/sentiment.py: funding_cross_median_annualized() con
annualizzazione per period nativo per exchange (Binance/Bybit/OKX
1095, Hyperliquid 8760).
- clients/hyperliquid.py: funding_rate_annualized() per filtro §2.6.
- clients/portfolio.py: total_equity_eur(), asset_pct_of_portfolio()
per sizing engine + filtro §2.7.
- clients/telegram.py: notify-only (no callback queue, no
conferme — Bite auto-execute).
- clients/deribit.py: environment_info, index_price_eth,
latest_dvol, options_chain, get_tickers, orderbook_depth_top3,
get_account_summary, get_positions, place_combo_order (combo
atomico), cancel_order.
CLI:
- cerbero-bite ping: health-check parallelo di tutti gli MCP con
tabella rich (OK/FAIL/SKIPPED).
Docker:
- Dockerfile multi-stage Python 3.13 + uv, user non-root.
- docker-compose.yml con rete external "cerbero-suite", secret
core_token montato a /run/secrets/core_token, env per ogni MCP.
- secrets/README.md documenta il setup del token.
Documentazione di intervento:
- docs/12-mcp-deribit-changes.md: spec delle modifiche apportate
al server mcp-deribit (place_combo_order + override testnet via
DERIBIT_TESTNET).
Dipendenze:
- aggiunto pytest-httpx per i test HTTP.
- rimosso mcp>=1.0 (non usiamo l'SDK MCP, parliamo via HTTP REST).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Implementa i sette algoritmi puri di docs/03-algorithms.md con
disciplina TDD: 112 test, copertura statement+branch al 100% su
core/ e config/, mypy --strict pulito, ruff pulito.
Moduli:
- config/schema.py: StrategyConfig Pydantic v2 con validatori di
consistenza (kelly, delta, OTM, spread width, profit/stop).
- core/types.py: OptionQuote e OptionLeg condivisi.
- core/entry_validator.py: validate_entry (accumula motivi) e
compute_bias (bull_put/bear_call/iron_condor/None).
- core/liquidity_gate.py: check OI/volume/spread/depth + slippage
stimato in % del credito.
- core/sizing_engine.py: Quarter Kelly con cap 200/1000 EUR e
bande DVOL.
- core/combo_builder.py: select_strikes (DTE/OTM/delta/width/credit)
e build (ComboProposal con credit/max_loss/breakeven).
- core/greeks_aggregator.py: somma firmata BUY/SELL, theta in USD.
- core/exit_decision.py: 6 trigger ordinati con eccezione skip-time
vicino a profit (mark in (50%,70%] credito).
- core/kelly_recalibration.py: full/quarter Kelly, confidence per
sample size, blend medio in fascia 30-99 trade.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>