"Vibe-Trading: Your Personal Trading Agent"
Python ai-agentalgorithmic-tradingbacktestingfintechllmmcpmulti-agentpythonquantitative-financetrading
Merge PR #1544: feat(channels): guided Web UI config for Email and WebSocket
Haozhe Wu62842f4f4b45
diff --cc CHANGELOG.mdindex 30af8c55d,609e50350..521abe7c6--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -176,50 -189,27 +202,71 @@@ This project adheres to [Semantic Versi### Fixed-- **The Email channel verifies TLS certificates by default** (a follow-up- to #1544). The implicit-SSL paths (`IMAP4_SSL` / `SMTP_SSL`) in both the- connection probe and the polling/send adapter used Python's default- unverified context (`CERT_NONE`, no hostname check), so the mailbox- password travelled to a server whose certificate was never checked — an- active network attacker between the operator and their mail provider could- harvest it. All four call sites now build their context through a shared- `email_tls_context()` that verifies the certificate and hostname against- the system CA bundle, matching the STARTTLS path, which already did. A new- `verify_tls` field (default `true`, surfaced in the guided Email setup in- all nine locales) is the documented opt-out for self-signed or internal-CA- servers.-- **Settings-write routes reject cross-site browser requests** (a follow-up- to #1544). `require_settings_write_auth` did not apply the cross-site guard- that its siblings `require_auth` and `require_event_stream_auth` enforce on- unsafe methods, so a malicious web page could attempt a CSRF write against- any settings route — including the new `POST /channels/email/test`, which- merges stored credentials with a caller-supplied patch and could be steered- to send the stored mailbox password to an attacker-chosen host. The guard- now runs first on every settings-write route; same-origin Web UI calls and+- **A tail-risk figure names its own field once a session holds more than one**+ (#1425, after #1444). A call- or tool-scoped ref (`ref x1`) pooled every+ tail-risk field that call returned, and an undeclared tail-risk percent pooled+ every tail-risk value in the session, so an ES 95% could quote the VaR 95%+ value and pass. The rule is read off the evidence, never off prose:+ `tail_risk_identity()` takes (measure, confidence) from the field name a tool+ returned, so `var_95` and `es_95` are two identities while `cvar_99` and+ `es_99` are one. When a scope holds two or more and the figure's value matches+ one of them, it is refused with `tail_risk_needs_field_ref`, whose correction+ names every identity the session holds; a figure matching no tail-risk value+ keeps its old reason, so a fabricated number is still a mismatch rather than a+ missing ref. Accepted cost, stated in the issue: an undeclared VaR 95% beside a+ VaR 99% is correct today and now costs one correction round. The system prompt+ states the rule so a risk report declares the ref on its first attempt.+- **Mean-variance style optimizers size a short by its own expected return**+ (#1548). The optimizers scored every position as if it were held long, so the+ strongest shorts (most negative drift) looked worst and got the least capital.+ `BaseOptimizer.optimize` now negates a short's column before building the+ context, so `mu` is the position's expected return AND `cov` is the position+ covariance `D Σ D`: a long and a short of two +0.92 correlated names hedge+ instead of reading as correlated (the old objective put the whole book on the+ long, the new one splits it 0.514 / -0.486). Risk-parity and+ max-diversification contexts get the position covariance with it;+ volatility-only contexts are unchanged, since std(-r) == std(r).+- **Monte-Carlo validation annualises at the venue's bars per year** (#1546). It+ hardcoded 252 while `bootstrap_sharpe_ci` and `walk_forward_analysis` in the+ same report used the resolved value, so a crypto (365) or forex (260) run+ published two disagreeing Sharpes.+- **A futures order on a negative-price bar is no longer rejected outright**+ (#1547). `FuturesBaseEngine` dropped the `abs(price)` its base class relies on+ under `allow_nonpositive_prices`, so size came out negative and the caller's+ `size <= 0` guard refused every order.+- **A factor's IC ratio is unset for a negative baseline** (#1549). Dividing two+ negative IC means gives a positive ratio, so a rolling IC that got further+ below zero reported as improvement. The signal itself took the worst of the+ available metrics and was not fooled; the published number was.+- **Two memories sharing a title keep separate index rows and links** (#1545).+ Under `VT_MEMORY_HIERARCHY` an entry lives at `{memory_type}/{slug}.md`, so+ two entries with one title had the same `path.name`: the second `add()`+ overwrote the first's `MEMORY.md` row, and the semantic-link block beside it+ excluded the other entry as "self" and wrote an ambiguous target. Both key on+ the path relative to the memory dir now; a sidecar written earlier, with a+ bare filename or an absolute path, is still read.-++- **The Email channel verifies TLS certificates by default** (#1544). The++ implicit-SSL paths (`IMAP4_SSL` / `SMTP_SSL`) in both the connection probe++ and the polling/send adapter used Python's default unverified context++ (`CERT_NONE`, no hostname check), so the mailbox password travelled to a++ server whose certificate was never checked — an active network attacker++ between the operator and their mail provider could harvest it. All four call++ sites now build their context through a shared `email_tls_context()` that++ verifies the certificate and hostname against the system CA bundle, matching++ the STARTTLS path, which already did. A new `verify_tls` field (default++ `true`, surfaced in the guided Email setup in all nine locales) is the++ documented opt-out for self-signed or internal-CA servers. **Upgrade note:**++ a mail server with such a certificate connected before this change and now++ fails the TLS handshake until `verify_tls` is set to `false` for it.++- **Settings-write routes reject cross-site browser requests** (#1544).++ `require_settings_write_auth` did not apply the cross-site guard that its++ siblings `require_auth` and `require_event_stream_auth` enforce on unsafe++ methods, so a malicious web page could attempt a CSRF write against any++ settings route — including the new `POST /channels/email/test`, which merges++ stored credentials with a caller-supplied patch and could be steered to send++ the stored mailbox password to an attacker-chosen host. The guard now runs++ first on every settings-write route; same-origin Web UI calls and+ non-browser clients (CLI/curl, no `Origin`) are unaffected.- **Read-only results lost to context compaction are restored, not refetched**(#1488). A successful read-only call whose payload compaction removed isreplayed from the run's own cache, at most six times a run; past the cap it