"Vibe-Trading: Your Personal Trading Agent"
Python ai-agentalgorithmic-tradingbacktestingfintechllmmcpmulti-agentpythonquantitative-financetrading
release: 0.1.13 — expose quantlib_call over MCP, repair two unreachable modules
Haozhe Wuc33133f4fd5e
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex e6e69b16c..f4a13005b 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -5,47 +5,373 @@ This project adheres to [Semantic Versioning](https://semver.org/).## [Unreleased]-### Added-- **`vibe-trading update`** — new CLI subcommand that checks PyPI for a newer `vibe-trading-ai` release and upgrades in place via pip when one exists (no confirmation prompt). Editable/development installs and uninstalled checkouts are detected and answered with the right manual instruction (`git pull` + reinstall) instead of a pip upgrade that would silently replace the dev install with a released wheel.-- **Memory Tier 2: Structural Organization** — four independently-gated modules for memory lifecycle enhancement:- - H-MEM hierarchical directory routing (`VT_MEMORY_HIERARCHY`)- - A-MEM semantic linking via BM25 (`VT_MEMORY_LINKS`)- - Auto-compression pipeline with TF-IDF key-sentence extraction (`VT_MEMORY_COMPRESSION`)- - FTS5 full-text search index with CJK bigram tokenization (`VT_MEMORY_FTS_INDEX`)-- **`VT_MEMORY=off|on|full` preset** — one-line business-friendly configuration replacing 7 individual flags- - `off`: no lifecycle management (default)- - `on`: quality scoring + auto-decay + garbage collection (Tier 1)- - `full`: all features including hierarchy, links, compression, and FTS (Tier 1 + Tier 2)- - Individual `VT_MEMORY_*` flags still work as explicit overrides-- Dependency-conflict warnings when `VT_MEMORY_COMPRESSION=true` without `VT_MEMORY_GC`-- Lazy FTS5 auto-rebuild on first search when index is empty-- 9 end-to-end integration tests + 23 benchmark tests against real production corpus--## [0.1.13] — 2026-08-01+## [0.1.13] — 2026-08-10++Rolls up 408 commits / 162 merged pull requests since 0.1.12.### Added-- **Read-only sentiment tool** (#939): local lexicon scoring for arbitrary text- plus the crypto Fear & Greed Index from Alternative.me's free, no-auth API.+- **`src/quantlib` — a tested finance-math layer** (265 functions across 19+ modules): one+ implementation each of Black-Scholes price/greeks/IV inversion, bond math ++ Nelson-Siegel/Svensson, Altman Z + Merton/KMV, stationarity/cointegration/+ GARCH/bootstrap, VaR/CVaR/EVT, Brinson-Fachler attribution, event studies,+ multiple-testing control, and purged cross-validation. Skills now *import*+ these instead of carrying formulas inside markdown code blocks. Reachable+ from the CLI, the Web UI, the REST API and MCP through the read-only,+ pure-compute `quantlib_call` tool, so the finance math works where `bash` is+ gated off — module allowlist, `__all__`-only, `export_*` refused.+ `attribution` and `impact` were allowlisted but carried no `__all__`, so the+ tool listed zero functions for them; both now export, and a guard test fails+ when any allowlisted module exposes nothing. Econometrics needs the+ `stats` extra (`statsmodels`/`arch`), which the functions lazy-import and+ name.+- **Valuation engine** (`src/quantlib/valuation/`): `run_dcf` (FCFF bridge,+ WACC build, dual terminal value that cross-checks each method against the+ other's implied multiple and implied g, mid-year discounting, net-debt+ bridge, WACC×g grid), `run_comps` (EV bridge, LTM + calendar-year+ calendarisation, multiple matrix — a peer with a non-positive denominator is+ *excluded and reported*, never averaged in as a negative multiple), a linked+ three-statement projection with a hard balance assertion, explicit revolver+ plug and an iterated interest↔debt circularity that must converge or raise,+ plus input-hashed versioned artifacts with xlsx/pptx export. One shared rule+ in `contracts.py`: **a missing input makes a model NOT RUNNABLE and is never+ silently defaulted.**+- **Typed entity + irregular dated cash-flow substrate** (`src/entities/`) —+ the non-bar ingestion path for NAVs, capital calls and coupons, deliberately+ parallel to the bar engines so a `nav` column can never reach one and get+ priced as a close. Surfaced by the read-only `cashflow_performance` tool+ (XIRR / MOIC / DPI / TVPI / TWR / Modified Dietz / MWR over an irregular+ dated series).+- **`orderbook_depth`** (read-only): crypto L2 ladder via ccxt — spread bps,+ depth imbalance, and the impact cost of a stated notional walked through the+ real book in both directions. `fully_filled` and `timestamp_source` must be+ read before quoting anything; equities still have no depth source.+- **Governance wired into every run** (`src/governance/`): a run manifest hashes+ the prompt, skill contents, tool registry and package versions so "what+ methodology produced that number" is answerable, and the audit ledger is+ hash-chained + fsynced so editing or deleting a record is detectable (an edit+ that recomputes its own hash is caught one record later via+ `prev_hash_mismatch`). All 30 swarm presets were re-audited — a deliverable+ no granted tool can compute is now declared as such instead of invented.+- **Four read-only data tools, all on free public sources**:+ `get_institutional_holdings` (SEC 13F-HR; manager / ticker-holders /+ top-managers modes with quarter-over-quarter position diffs, and cover-page+ unit detection because pre-2023 filings report in thousands),+ `etf_holdings` (cross-market look-through — SEC N-PORT for US, and for+ A-shares the semi-annual/annual reports that carry the *full* book rather+ than the quarterly top ten: 510300 returns 342 rows / 98.66% of net assets+ vs 10 rows / 22.74%; `coverage` distinguishes `full_portfolio` from+ `top_n_disclosed` and every response stamps the report period),+ `prediction_market` (event-contract search/event/market/history with prices+ surfaced as labelled implied probability), and `research_papers`+ (arXiv + OpenAlex search/read with source-anchored claim extraction that+ marks what a source does not state instead of inferring it).+- **Institutional research surface**: six slash commands — `/comps` `/dcf`+ `/attrib` `/memo` `/earnings` `/screen` — each carrying a step skeleton and+ an arithmetic-consistent worked example (the Brinson decomposition sums+ exactly to active return; the earnings bridge sums exactly to the EPS delta).+- **Investor lenses** as a standalone skill (`src/skills/investor-lenses/`):+ named-investor reasoning frameworks as stackable analysis overlays, decoupled+ from the data layer. Each lens is an operating procedure — priority signals,+ disqualifying conditions, typical misuse — not a biography, and names no tool.+- **Five ready-to-schedule research playbooks** (premarket brief, earnings-season+ tracker, portfolio checkup, A-share money flow, institutional-holdings diff),+ reachable three ways: auth-gated REST routes beside the existing CRUD, a+ `vibe-trading playbook` CLI subcommand, and a `/playbook` slash command.+ Templates state their data needs in natural language rather than naming+ tools, so coverage can grow without editing them, and every one mandates+ naming a missing input instead of filling it from memory.+- **Desktop shell** — a source-first Electron host that owns the existing+ backend lifecycle (random loopback port, per-launch secret, five-locale+ startup recovery, owned-process cleanup) (#923). Windows packaging assembles+ a checksum-pinned embedded Python 3.12 runtime with x64 NSIS review/signing+ paths, plus Electron `safeStorage` for an allowlisted credential set — the+ renderer can set or clear secrets but never read them, plaintext config+ migrates once, decrypted values reach only the owned backend, and both+ unsigned-review and signed builds fail closed on the wrong signature state+ (#1015). No installer artifact was published from that PR.+- **Canadian equities end to end** (#1024, #1019, #1037, closes #952): `.TO`/`.V`+ symbols classified in CAD, routed Yahoo → yfinance → local, executed under+ Canada-specific GlobalEquity rules, benchmarked against `XIC.TO`, with+ mixed-currency aggregation refused.+- **Korea equity (KRX: KOSPI/KOSDAQ)** as the 9th backtest engine (#693, thanks+ @JungHoonGhae) — execution-time ±30% band on a unified tick grid, structurally+ long-only, config-driven 2026 0.20% securities transaction tax, optional+ `pykrx` loader that rejects non-daily intervals so the runner falls through.+- **eToro connector** with path-separated demo/real profiles (#989); live+ risk-increasing actions remain mandate-gated and audited.+- **OpenBB Workspace bridge** (#817, thanks @shugaoye) — optional `openbb`+ extra registering `/agents.json` + an authenticated `/v1/query`, each request+ replaying the supplied history in an ephemeral session. `pro.openbb.co` is+ not a default CORS origin; opt in via `VIBE_TRADING_EXTRA_CORS_ORIGINS`.+- **Read-only Taiwan snapshot** tool (#848, thanks @TSENGCHIENFENG), registered+ only when `VIBE_TW_STOCK_DB` points at a schema-valid snapshot.+- **Options strategy analytics** (#946, rebuilt from #883, thanks @he-yufeng) —+ analytic expiry P&L extrema, exact breakevens including continuous zero-P&L+ intervals, engine-aligned entry commissions, and spot × IV scenarios through+ Agent and MCP.+- **Read-only `sentiment` tool** (#939, thanks @Robin1987China): local lexicon+ scoring for arbitrary text plus the crypto Fear & Greed Index from+ Alternative.me's free, no-auth API.+- **Read-only `technical_indicators` tool** (#921, refs #920, thanks+ @Robin1987China) — RSI/MACD/Bollinger/SMA/EMA through the existing loaders.+- **Timezone-aware scheduled research** (#954, closes #953, thanks @ngoanpv):+ jobs take an optional IANA `timezone` and evaluate cron on that zone's wall+ clock, so a cadence survives DST — a spring-forward gap is skipped and a+ fall-back ambiguous time runs once. Cron fields gain comma lists and ranges+ (`1,3-5`); jobs without a timezone keep UTC semantics; the web UI gains a+ **Scheduled** page in all five locales.+- **`vibe-trading update`** (#1020) — checks PyPI for a newer release and+ upgrades in place, installing the exact release it checked and verifying+ fresh metadata without downgrading. Editable/source checkouts are detected+ and answered with the right manual instruction (`git pull` + reinstall)+ instead of a pip upgrade that would silently replace the dev install.+- **ModelScope** joins the built-in providers through its official+ OpenAI-compatible hosted-inference endpoint, default `Qwen/Qwen3.5-27B`+ (#1011, thanks @honginp).+- **Live model discovery** in Settings (#924, thanks @QCYTSN) — configured+ providers are queried on demand with stable warning codes and five-locale+ controls, and each reply records and reloads the immutable provider/model/+ reasoning identity that actually served it.+- **`alpha_zoo` + bounded `alpha_bench` on MCP** (#979, thanks @cgycorey) with+ horizon/result/output-path limits and safe report creation; **QVeris**+ discovery/inspect/execute also join the MCP surface (#976, closes #964,+ thanks @shadowinlife), with the cost quote read from the marketplace instead+ of trusted from the caller.+- **The MCP surface grows to 70 tools.** Six read-only analytics tools that had+ reached the agent but never MCP are now mirrored onto it: `quantlib_call`,+ `cashflow_performance`, `orderbook_depth`, `sentiment`,+ `technical_indicators` and `get_fundamentals`. Order-placing tools stay+ structurally un-exposed — the mirrored registration path refuses any class+ whose `is_readonly` is not `True`, so an order tool cannot reach MCP even if+ someone adds it to the source list.+- **Memory Tier 2: structural organization** (#815, thanks @shadowinlife) —+ four independently-gated modules (H-MEM hierarchical routing+ `VT_MEMORY_HIERARCHY`, A-MEM BM25 semantic linking `VT_MEMORY_LINKS`,+ TF-IDF auto-compression `VT_MEMORY_COMPRESSION`, FTS5 index with CJK bigram+ tokenization `VT_MEMORY_FTS_INDEX`), a one-line `VT_MEMORY=off|on|full`+ preset replacing seven individual flags, dependency-conflict warnings, lazy+ FTS5 rebuild on first search, and 9 integration + 23 benchmark tests. All+ off by default (#733, closes #732).+- **SDM lifecycle tools** `sdm_register` / `sdm_status` / `sdm_decay_scan`+ (#457, thanks @shadowinlife) backed by a SQLite artifact store+ (`UNIQUE(name, universe)`, WAL) and an IC/Sharpe decay state machine+ (active → monitoring → decayed → disabled).+- **`alpha bench --strict`** (#796, closes #773, thanks @he-yufeng) finally+ wires the strict same-universe random-control + OOS gate that shipped+ unreachable since 0.1.9; `alpha bench` also discloses CSI300/SP500 sources,+ counts, degraded fallbacks and survivorship bias (#859, closes #845), with+ the `_meta` disclosure forwarded to CLI/HTML (#841, closes #797, thanks+ @AmirF194).+- **Risk x-ray artifacts** (`risk_xray.json`/`.md`) emitted by every portfolio+ backtest with headline concentration/vol/drawdown metrics (#900, thanks+ @he-yufeng), plus rebalance-notes artifacts and turnover metrics (#795).+- **Composable optimizer weight constraints** (#818, thanks @he-yufeng);+ `calc_metrics` reports tracking error and benchmark beta.+- Opt-in **atomic same-direction rebalancing** in backtests with immutable fill+ evidence (#951), and opt-in `position_adjustment=rebalance` for strict USD-M+ historical backtests preserving collateral, funding, fees, realized P&L,+ liquidation behavior and fill evidence across increases and reductions+ (#1019, thanks @honginp).+- **USD-M perpetual realism**: `perpetual_strict` settles historical funding+ before fills and executes isolated/cross margin breaches as real liquidations+ (#903, #889, thanks @honginp), margin state contracts (#798), historical+ funding rates actually consumed rather than fetched-and-ignored (#819, thanks+ @g0rdonL), and ordered fill/funding/risk/liquidation event persistence plus a+ fidelity summary (#936).+- **Final report aggregator stage** for the `quant_strategy_desk` swarm preset+ (#1048, thanks @Robin1987China).++### Changed+- **Rebuilt WebUI** — the guided-minimalism overhaul: no first-frame flash, one+ durable activity object per turn with a live reasoning whisper and a+ reload-safe tool trail, LLM-written session titles, full five-locale parity.+- Sessions, runs, swarm runs and uploads now live under `~/.vibe-trading`+ (relocatable via `VIBE_TRADING_HOME`) with a one-time automatic migration+ (#925, closes #904, thanks @MuggleJinx).+- The frontend moves to **Node 22 + React Router 8**, clearing a high-severity+ advisory; Electron transitive advisories were patched separately.+- Daily price bands are judged **at execution time** — from a pre-fill base+ price against the prospective fill price — never from the decision bar's own+ close (#676, thanks @tyj147454413-cmd).+- A session runs **one attempt at a time** (a second concurrent send is refused+ with HTTP 409), and a user stop is its own terminal state distinct from a+ failure, both live and on reload.+- Trace redaction is now **sink-aware**: `content` is released only in the+ tool-RESULT sink and stays redacted in the fail-closed ARGUMENTS sink used by+ tool-call arguments and the live audit ledger (`env` is never released);+ results also get their string leaves pattern-scrubbed (#675, #913, #911,+ thanks @santhreal). Trace records are fsynced and sidecars made durable+ before the record that references them (#662).+- Oversized tool results are paged by whole record with an explicit total+ instead of being cut mid-JSON; the system prompt drops redundant tool prose.+- Dependency locks refreshed and verified across Python and the frontend+ (#949, #948, #850–#852, #1021, #1023, #1026, #1027); the breaking MCP 2.0+ bump remains unmerged pending a complete lock/runtime migration (#950).### Fixed-- **Agent identity ordering and evidence grounding** (#887/#886): market-sensitive- consumers now require a canonical symbol/venue locked before their assistant- tool-call batch starts, so a resolver and its consumer cannot race in one- parallel batch. Silent exchange-suffix rewrites are rejected, listed-company- evidence cannot be overwritten by model memory, and ambiguous/not-found/- conflicting/invalidated identities are persisted as first-class states.-- **Final numeric consistency gate** (#886): full untruncated OHLC tool results- are recorded as structured evidence with symbol, venue, currency, actual data- source, and explicit conversion status. Contradictory final prices are rejected- before streaming; derived levels require a visible, arithmetically correct- formula anchored to observed inputs, and repeated bad drafts fail closed to- verified observations.- Tool envelopes with `ok: false`, `success: false`, or failed status are no- longer recorded as successful calls.-- **Robinhood Agentic MCP response serialization** (#922): nested FastMCP- dataclasses containing `date`/`datetime` values serialize to JSON instead of- surfacing the misleading `Circular reference detected` error. A representative- Robinhood portfolio/account shape now has an end-to-end regression test.+- **The identity/grounding gate stops refusing answers it has the evidence+ for.** This was the single most user-visible defect in the 0.1.12 line — a+ well-formed run would spend minutes on real tool calls and then return+ *"cannot safely confirm instrument identity or price evidence"*. Root causes,+ each fixed and covered by two-sided guard tests:+ - `.SS` and `.SH` were treated as different instruments, so **every Shanghai+ ticker was permanently ambiguous**. Symbols are now canonicalized+ (`.SS`≡`.SH`, `sh600519`≡`600519.SH`, `700.HK`≡`00700.HK`,+ `BTC/USDT`≡`BTC-USDT`) before comparison, and candidates are collapsed by+ canonical symbol before the ambiguity test.+ - A **failed side query could demote an already-locked identity**; aggregate+ status now keeps a lock unless something genuinely conflicts.+ - Yahoo returns HTTP 400 for every CJK query, which was recorded as a source+ *failure* and escalated to blocking `invalidated`. Non-ASCII queries are+ now declined up front with an explicit skip marker, and a resolution with+ clean sources and no failures resolves to `not_found` rather than+ `invalidated`. All resolver skip markers were unified on one prefix, with a+ cross-module contract test.+ - A hardcoded per-tool whitelist decided which bare tickers could be matched,+ blocking 11 of the 17 documented argument spellings; matching is now by+ uniqueness against the authorized set.+ - Chinese-language answers were rejected for writing `雅虎`/`腾讯` instead of+ the ASCII loader name, and `元` instead of `人民币`. Source and currency+ aliases now cover the user's language.+ - Thousands separators split a clause mid-number, so `¥1,309.22` was compared+ as `1` against the observed range and reported as a price conflict.+ - Conceptual questions with no instrument at all, and comparison reports,+ were dead-ended by the gate.+ - Follows the narrower 0.1.12-line fixes for numbers that were never prices —+ confidence scores, indicator readings, moving-average windows, year-less+ dates like `8/5`, percentage ranges, and a plan's own trigger levels+ (`close ≥ 6.45` is a condition, not a quote) (#1001, #983, #955) — and a+ many-candidate shortlist now counts as an answer rather than a stalled+ resolution. A quote outside recorded OHLC evidence is **still refused**.+ - Ordering, evidence and serialization repairs from the same family: a+ canonical symbol/venue must be locked before a market-sensitive tool-call+ batch starts so a resolver and its consumer cannot race (#887/#886); tool+ envelopes with `ok: false` / `success: false` are no longer recorded as+ successful calls; NaN/inf volume and close no longer crash+ `format_grounding_block` (#1043, thanks @santhreal); the latest close is+ paired with its correct date; and bash-written run-dir OHLC CSVs count as+ observed evidence (#1037, thanks @wiliao).+- **Sandbox gap closed**: generated strategy code can no longer import the+ broker layer, nor reach `socket`/`subprocess`/`os.system`/`ctypes` through a+ renamed binding — both were accepted before. `src.quantlib` still imports.+- **SEC reporting periods are keyed on their `(start, end)` span.** A 10-Q files+ the true quarter and the year-to-date frame under the same end date and+ fiscal period, so `period="annual"` had been returning a single quarter for+ AAPL FY2018–2020 (a 4.2× understatement) and every fiscal-Q4 slot in a+ quarterly series carried the full-year figure. `get_fundamentals("AAPL.US")`+ no longer answers `ok:true` with an all-null panel. PIT fundamentals also+ dedup restated rows and stop the snapshot regressing to an older fiscal+ period on a late restatement (#772, closes #771, thanks @klmtseng).+- **Tushare A-share prices are corporate-action adjusted** in both the factor+ bench and backtests — a raw close-to-close return across an ex-date was off+ by up to 47 percentage points (300750.SZ, 2023-04-26) — and the CSI300 bench+ masks each date to its point-in-time index membership.+- Cross-market composite backtests **refuse a mixed-currency code set** instead+ of summing CNY, USD and KRW into one equity curve; Shadow splits mixed+ markets by settlement currency without invented FX aggregation (#997).+- Option legs are marked at the volatility they were opened at, removing a+ fabricated day-zero P&L of up to +93% of premium; options **partial-close**+ honors the requested quantity instead of flattening the lot.+- `bar_returns` no longer erases the real move across a trading halt longer+ than the forward-fill window — the resumption move was silently recorded as+ 0, understating volatility and inflating Sharpe — and an `inf` prior price+ can no longer read as a clean −100% (#895, thanks @darkknight4563).+ Buy-and-hold returns are sign-safe (#872), the rolling correlation matrix no+ longer forward-fills missing closes (#873, thanks @ddy4633), indicators use+ consecutive unsampled history (#1005), negative-equity drawdown and empty+ insolvent cross accounts are handled (#958, #959), and `inf` from+ `pct_change` on zero equity is replaced (#1041, thanks @santhreal).+- **Annualisation now covers all 24 data sources** at every interval, with a+ coverage test that fails CI when a loader lands without entries (#891, closes+ #884, thanks @Robin1987China). A 19-PR **interval-normalization sweep**+ accepts lowercase `1h/4h/1d/1w` everywhere, fails fast on unsupported+ intervals instead of silently returning daily bars, maps Yahoo `4H`→`1h`, and+ keeps `1H`/`4H` as hour bars across the Tiger/Alpaca/OKX/Shoonya/Longbridge+ connectors (#812–#838, #778–#794, thanks @santhreal); lowercase `4h` returns+ true four-hour bars (#1013).+- **Market-data routing**: partial results complete the missing symbols through+ the fallback chain and fail closed instead of silently shrinking the backtest+ universe (#689, closes #681, thanks @xkam7ar); HK fallback routing repaired+ with a new Tencent HK source (#1000); yfinance crypto routes to the crypto+ engine (#970); OKX bars use `history-candles` with rate-limit retry (#644);+ a Binance loader joins the crypto fallback chain (#643).+- **Providers**: Claude models that deprecate `temperature` (opus-4-7, opus-5,+ sonnet-5) work — the adapter drops the field when the API rejects it, retries+ once, and remembers the model, so no per-release patch is needed (#890,+ closes #856, thanks @yagnikpipaliya). The whole Kimi K-series auto-forces+ `temperature=1` (#701, thanks @sambazhu); endpoint resolution falls back to+ each provider's canonical base URL; mapping-shaped Responses stream events are+ accepted (#1034, thanks @cgycorey); OpenAI Codex OAuth gets a separate+ synchronized credential store and one-shot 401 recovery (#1014); proxy opt-out+ covers sync and async clients (#995); long model slugs stay readable (#1006).+- **MCP**: dataclass results no longer crash on a false+ `Circular reference detected` (#849, #922, thanks @Echoandelementwebsites);+ `factor_analysis` is realigned to the registered tool's real CSV contract so+ calls no longer die on `KeyError` (#715, closes #635, thanks+ @Robin1987China); list/dict arguments tolerate JSON-string clients (#993);+ the network guard accepts IPv6 and case-variant hosts (#750); the specs cache+ key includes remote server identity (#1049, thanks @Shizoqua); nested results+ serialize cleanly.+- **Swarm**: `ok:false` / `success:false` tool failures are detected, not just+ `status:error` (#1028, thanks @Shizoqua); MCP discovery is cached (#704).+- **Scheduled research** isolates malformed records (#1003), fixes+ interval-timezone validation (#1004), and retries transient dispatch failures+ with capped exponential backoff.+- **Memory**: entries are written and recovered with their `.md` suffix (#984);+ FTS5 ranking applies importance decay (#1032, thanks @Shizoqua); exact+ index-anchor matching and a respected result bound (#956, #957, thanks+ @santhreal).+- **Two quantlib modules were allowlisted but unreachable.** `attribution`+ (Brinson-Fachler) and `impact` (market-impact models) carried no `__all__`,+ and `quantlib_call` dispatches on `__all__` alone, so the tool listed **zero**+ functions for both while the package docstring advertised them. Both now+ export, and a guard test fails when any allowlisted module exposes nothing —+ the previous test only asserted each module *imports*, which could never+ catch this.+- **The published MCP manifest under-reported the server.** `SKILL.md`'s tool+ count was derived by counting `@mcp.tool` decorators, which ignores every+ tool registered through the mirrored path — so four institutional-research+ tools were live over MCP and absent from the manifest, and the contract test+ asserted that absence was *correct*. Both tests now measure+ `mcp.list_tools()`.+- **Resource leaks and robustness**: the HTTP throttle sweeps stale bucket+ entries interval-aware, preserving rate-limit spacing (#1047), the rate+ limiter no longer grows unboundedly with unique client IPs (#1039), the+ event bus notifies and removes subscribers on clear (#1046), `_json_loads`+ is guarded against corrupted JSON in database columns (#1045), and Shoonya+ tolerates empty-string numeric fields (#1038) — all thanks @santhreal.+- **Connectors**: the `connector` CLI loads `~/.vibe-trading/.env` so+ env-sourced broker credentials resolve again (#902, closes #901, thanks+ @MuggleJinx); IBKR moves to a thread-local connection pool with snapshot+ quotes, fixing hangs under parallel agent runs (#636, thanks @MikeCer); MT5+ `trading_history` coerces numpy scalars so JSON serialization no longer dies+ on `int64` (#776, closes #774, thanks @shadowinlife); CLI balances show a+ real account label (#843, closes #846).+- **Docker's hash-locked install works again** with a new CI lock check (#858,+ closes #847), and saving Agent LLM settings from the Web UI no longer returns+ HTTP 500 on Windows — the POSIX-only `os.fchmod` hardening is platform-guarded+ (#561, thanks @CRui5in).+- Non-interactive `vibe-trading run` injects a host session id: research-goal+ tools previously failed on every call while the run still reported success+ (#885). The agent now stops when evidence is sufficient (#1010).+- The **vn.py export** skill is repaired for the vn.py 4.x layout, where+ `vnpy.app.cta_strategy` no longer exists upstream — templates import from+ `vnpy_ctastrategy` (#869, thanks @y85998607).+- An **encoding and parsing batch**: UTF-16 BOM decoding in the document reader+ and trade-journal CSVs, currency symbols stripped before numeric coercion,+ `BTCUSDT`-style symbols inferred as crypto, CJK characters preserved in skill+ directory slugs, Eastmoney/Futu/Tonghuashun Excel-serial dates normalized,+ blank/NaN symbol rows skipped, and skill frontmatter parsed at EOF+ (#862–#868, #811, #749, #861, thanks @santhreal and @Robin1987China).+- QQ replies retain source message IDs (#1008); Feishu/CLI markdown table edges+ and indent-preserving channel message splits are fixed (#867).+- The daily-bar validator can opt in to **non-positive prices** — opening on+ negative bars while still rejecting zero (#816, closes #571, thanks+ @darkknight4563).+- Sandboxed runs retain their canonical root (#1012, #1017); persisted run+ state is fsync-durable (#645); Portfolio Studio artifacts are surfaced in run+ detail (#980, #982, #966, #973).## [0.1.12] — 2026-07-22diff --git a/README.md b/README.mdindex df74eaeeb..e198bc98e 100644--- a/README.md+++ b/README.md@@ -52,13 +52,14 @@> ⚠️ **Security warning:** The X account `VibeTrading_HKU`, Virtuals project `101845`, and token contract `0x640BDBF77b6447E8b7DB7894cED84BD1c40571f4` are not official Vibe-Trading assets. We have never launched or endorsed any token or memecoin. Do not buy, connect a wallet, or sign anything. [Details](SECURITY.md#official-channels--impersonation).+- **2026-08-10** 🚀 **v0.1.13 released** ([Release notes](https://github.com/HKUDS/Vibe-Trading/releases/tag/v0.1.13), `pip install -U vibe-trading-ai`): 408 commits and 162 merged pull requests since 0.1.12 — the largest release so far. **The headline is a fix, not a feature: the identity gate stops refusing answers it already had the evidence for.** A well-formed question would spend minutes on real tool calls and then return *"cannot safely confirm instrument identity or price evidence"*. The causes: `.SS` and `.SH` were treated as different instruments, so **every Shanghai ticker was permanently ambiguous**; a failed side query could demote an already-locked identity; Yahoo's HTTP 400 on every CJK query was recorded as a source *failure* instead of "not listed here"; a hardcoded per-tool whitelist blocked 11 of the 17 documented argument spellings; Chinese answers were rejected for writing `雅虎` or `元` rather than the ASCII loader name; and a thousands separator split `¥1,309.22` so `1` was compared against the observed range. Conceptual questions and comparison reports no longer dead-end either. A quote outside recorded OHLC evidence is still refused. **New:** `src/quantlib` — 249 tested functions across 17 modules (options, bonds, credit, econometrics, VaR/CVaR/EVT, attribution, event studies, purged CV) reachable from the CLI, Web UI, REST API and MCP through the read-only `quantlib_call`, so skills import finance math instead of carrying formulas in markdown; a **valuation engine** (`run_dcf` / `run_comps` / three-statement) whose one rule is that a missing input makes a model NOT RUNNABLE rather than silently defaulted; an **entity + irregular cash-flow spine** (XIRR / MOIC / DPI / TVPI, TWR / Modified Dietz via `cashflow_performance`) kept deliberately parallel to the bar engines; **governance in every run** — a hash manifest over prompt, skills, tool registry and package versions, plus a hash-chained fsynced audit ledger where even a self-rehashed edit is caught one record later; four read-only data tools on free public sources (SEC **13F** with quarter-over-quarter diffs, **ETF look-through** where a CSI-300 tracker resolves to 342 positions covering 98.66% of net assets instead of the quarterly top ten, **prediction markets** as labelled implied probability, and **arXiv/OpenAlex** with source-anchored claims); six institutional commands (`/comps` `/dcf` `/attrib` `/memo` `/earnings` `/screen`); investor lenses as a standalone skill; five scheduled-research playbooks; a **desktop Electron shell** with checksum-pinned Windows packaging and `safeStorage`; **eToro** as the 13th broker connector; **Korea (KRX)** as the 9th backtest engine; an **OpenBB Workspace bridge**; Canadian equities end to end; and `sentiment`, `technical_indicators`, `options_payoff`, `orderbook_depth`, ModelScope and `vibe-trading update`. **Correctness:** SEC periods are keyed on their `(start, end)` span — annual figures had been returning a single quarter, a 4.2× understatement; Tushare A-share prices are corporate-action adjusted, where a raw return across an ex-date was off by up to 47 percentage points; `bar_returns` no longer records a trading halt as a 0% move; annualisation covers all 24 data sources; a sandbox gap is closed where generated code could import the broker layer or reach `socket`/`subprocess` through a renamed binding; and mixed-currency composite backtests are refused instead of summed into one equity curve. Thanks @santhreal, @shadowinlife, @Robin1987China, @he-yufeng, @QCYTSN, @Shizoqua, @honginp, @cgycorey, @wiliao, @ngoanpv, @x-lambda, @ofeksh-tr, @00EVA, @zwrong, @yrk111222, @su322, @hhj123123, @dineeshd, @sambazhu, @ddy4633, @tyj147454413-cmd, @y85998607, @JungHoonGhae, @shugaoye, @TSENGCHIENFENG, @darkknight4563, @MuggleJinx, @klmtseng, @ebujinovch, @g0rdonL, @AmirF194, @Echoandelementwebsites, @yagnikpipaliya, @dvirarad and @1anter.- **2026-08-09** 🪟 **Secure Windows packaging, Canada markets, ModelScope, and Alpha Zoo over MCP**: Windows desktop packaging now assembles a checksum-pinned embedded Python 3.12 runtime and x64 NSIS review/signing paths, plus Electron `safeStorage` for an allowlisted credential set. The renderer can set or clear secrets but never read them; plaintext configuration migrates once; decrypted values reach only the owned backend; and both unsigned review and signed builds fail closed on the wrong signature state. No installer artifact was published from this PR ([#1015](https://github.com/HKUDS/Vibe-Trading/pull/1015)). Canadian equities now work end to end: `.TO`/`.V` symbols are classified in CAD, route through Yahoo → yfinance → local fallback, execute under Canada-specific GlobalEquity rules, benchmark against `XIC.TO`, and refuse mixed-currency aggregation. Strict USD-M historical backtests can also opt into `position_adjustment=rebalance` while preserving collateral, funding, fees, realized P&L, liquidation behavior, and immutable fill evidence across increases and reductions ([#1024](https://github.com/HKUDS/Vibe-Trading/pull/1024), [#1019](https://github.com/HKUDS/Vibe-Trading/pull/1019), closes [#952](https://github.com/HKUDS/Vibe-Trading/issues/952)). ModelScope joins the built-in providers through its official OpenAI-compatible hosted-inference endpoint, with `Qwen/Qwen3.5-27B` as the default ([#1011](https://github.com/HKUDS/Vibe-Trading/pull/1011)); the new `vibe-trading update` distinguishes wheel installs from editable/source checkouts, installs the exact release it checked, and verifies fresh metadata without downgrading ([#1020](https://github.com/HKUDS/Vibe-Trading/pull/1020)); and `alpha_zoo` plus bounded `alpha_bench` now reach MCP (64 tools), with horizon/result/output-path limits and safe report creation ([#979](https://github.com/HKUDS/Vibe-Trading/pull/979)). Verified Python and frontend lock refreshes also update grouped dependencies, `postcss`, and `akshare` ([#1021](https://github.com/HKUDS/Vibe-Trading/pull/1021), [#1023](https://github.com/HKUDS/Vibe-Trading/pull/1023), [#1026](https://github.com/HKUDS/Vibe-Trading/pull/1026), [#1027](https://github.com/HKUDS/Vibe-Trading/pull/1027)). Thanks [@QCYTSN](https://github.com/QCYTSN), [@wiliao](https://github.com/wiliao), [@honginp](https://github.com/honginp), [@yrk111222](https://github.com/yrk111222), [@zwrong](https://github.com/zwrong), and [@cgycorey](https://github.com/cgycorey).- **2026-08-08** 🧱 **Desktop shell, eToro, atomic rebalancing, and a broad reliability pass**: A source-first Electron host now owns the existing backend lifecycle — random loopback port, per-launch secret, five-locale startup recovery, and owned-process cleanup — while eToro joins with path-separated demo/real profiles; live risk-increasing actions remain mandate-gated and audited, and API capability surfaces are authenticated under enforced CSP ([#923](https://github.com/HKUDS/Vibe-Trading/pull/923), [#989](https://github.com/HKUDS/Vibe-Trading/pull/989), [#961](https://github.com/HKUDS/Vibe-Trading/pull/961)). Backtests gain opt-in atomic same-direction rebalancing with immutable fill evidence; Shadow splits mixed markets by settlement currency without invented FX aggregation and honors the configured runtime root; indicators use consecutive unsampled history; negative-equity drawdown and empty insolvent cross accounts are handled correctly ([#951](https://github.com/HKUDS/Vibe-Trading/pull/951), [#997](https://github.com/HKUDS/Vibe-Trading/pull/997), [#1017](https://github.com/HKUDS/Vibe-Trading/pull/1017), [#1005](https://github.com/HKUDS/Vibe-Trading/pull/1005), [#958](https://github.com/HKUDS/Vibe-Trading/pull/958), [#959](https://github.com/HKUDS/Vibe-Trading/pull/959)). OpenAI Codex OAuth gets a separate synchronized credential store and one-shot 401 recovery; proxy opt-out covers sync and async clients; sandboxed runs retain their canonical root; scheduled research isolates malformed records and fixes interval-timezone validation; lowercase `4h` requests return true four-hour bars ([#1014](https://github.com/HKUDS/Vibe-Trading/pull/1014), [#995](https://github.com/HKUDS/Vibe-Trading/pull/995), [#1012](https://github.com/HKUDS/Vibe-Trading/pull/1012), [#1003](https://github.com/HKUDS/Vibe-Trading/pull/1003), [#1004](https://github.com/HKUDS/Vibe-Trading/pull/1004), [#1013](https://github.com/HKUDS/Vibe-Trading/pull/1013)). QQ replies retain source message IDs, long model slugs remain readable, and the agent stops when evidence is sufficient ([#1008](https://github.com/HKUDS/Vibe-Trading/pull/1008), [#1006](https://github.com/HKUDS/Vibe-Trading/pull/1006), [#1010](https://github.com/HKUDS/Vibe-Trading/pull/1010)). Thanks [@QCYTSN](https://github.com/QCYTSN), [@Shizoqua](https://github.com/Shizoqua), [@ngoanpv](https://github.com/ngoanpv), [@hhj123123](https://github.com/hhj123123), [@su322](https://github.com/su322), [@Robin1987China](https://github.com/Robin1987China), [@shadowinlife](https://github.com/shadowinlife), [@dineeshd](https://github.com/dineeshd), [@honginp](https://github.com/honginp), [@santhreal](https://github.com/santhreal), [@00EVA](https://github.com/00EVA), [@x-lambda](https://github.com/x-lambda), [@ofeksh-tr](https://github.com/ofeksh-tr).-- **2026-08-07** 🛡️ **Fewer false refusals, a closed sandbox gap, QVeris on MCP**: The grounding gate stops rejecting well-formed answers over numbers that were never prices — confidence scores, indicator readings, moving-average windows, year-less dates like `8/5`, percentage ranges, and a trading plan's own trigger levels (`close ≥ 6.45` is a condition, not a quote) — while a quote outside recorded OHLC evidence is still refused, and a price table dated `08-05` now matches its evidence instead of every cell coming back unavailable ([#1001](https://github.com/HKUDS/Vibe-Trading/issues/1001), [#983](https://github.com/HKUDS/Vibe-Trading/issues/983)). **Sandbox:** generated strategy code can no longer import the broker layer, nor reach `socket`/`subprocess`/`os.system`/`ctypes` through a renamed binding — both were accepted before, and `src.quantlib` still imports. **QVeris** discovery/inspect/execute join the MCP surface (62 tools), with the cost quote read from the marketplace instead of trusted from the caller ([#976](https://github.com/HKUDS/Vibe-Trading/pull/976), closes [#964](https://github.com/HKUDS/Vibe-Trading/issues/964), thanks [@shadowinlife](https://github.com/HKUDS/Vibe-Trading/shadowinlife)). Plus HK market-data fallback routing repaired with a new Tencent HK source, yfinance crypto routed to the crypto engine, memory entries written and recovered with their `.md` suffix, MCP list/dict arguments tolerating JSON-string clients, and Portfolio Studio artifacts surfaced in run detail ([#1000](https://github.com/HKUDS/Vibe-Trading/pull/1000), [#970](https://github.com/HKUDS/Vibe-Trading/pull/970), [#984](https://github.com/HKUDS/Vibe-Trading/pull/984), [#993](https://github.com/HKUDS/Vibe-Trading/pull/993), [#980](https://github.com/HKUDS/Vibe-Trading/pull/980), [#982](https://github.com/HKUDS/Vibe-Trading/pull/982), [#966](https://github.com/HKUDS/Vibe-Trading/pull/966), [#973](https://github.com/HKUDS/Vibe-Trading/pull/973), thanks [@he-yufeng](https://github.com/HKUDS/Vibe-Trading/he-yufeng), [@ngoanpv](https://github.com/HKUDS/Vibe-Trading/ngoanpv), [@sambazhu](https://github.com/HKUDS/Vibe-Trading/sambazhu)).<details><summary>Earlier news</summary>-- **2026-08-06** 🧮 **A tested finance-math layer + valuation engine + irregular cash flows + wired-in governance**: `src/quantlib` replaces the formulas that lived as markdown inside skills with one tested implementation each — options, bonds, credit, econometrics, VaR/CVaR/EVT, attribution, event studies, multiple-testing control, purged cross-validation — ~250 functions, reachable from Web/API/MCP via the new read-only `quantlib_call` tool. A valuation engine (`run_dcf` / `run_comps` / three-statement) refuses to run on a missing input instead of silently defaulting it, and a new entity + cash-flow spine admits NAVs, capital calls, and coupons (XIRR/MOIC/DPI/TVPI and TWR/Modified Dietz via `cashflow_performance`; crypto L2 impact cost via `orderbook_depth`). Every run now writes a hash manifest, the audit ledger is hash-chained so tampering is detectable, and all 30 swarm presets were re-audited — a deliverable no granted tool can compute is now declared as such instead of invented.+- **2026-08-07** 🛡️ **Fewer false refusals, a closed sandbox gap, QVeris on MCP**: The grounding gate stops rejecting well-formed answers over numbers that were never prices — confidence scores, indicator readings, moving-average windows, year-less dates like `8/5`, percentage ranges, and a trading plan's own trigger levels (`close ≥ 6.45` is a condition, not a quote) — while a quote outside recorded OHLC evidence is still refused, and a price table dated `08-05` now matches its evidence instead of every cell coming back unavailable ([#1001](https://github.com/HKUDS/Vibe-Trading/issues/1001), [#983](https://github.com/HKUDS/Vibe-Trading/issues/983)). **Sandbox:** generated strategy code can no longer import the broker layer, nor reach `socket`/`subprocess`/`os.system`/`ctypes` through a renamed binding — both were accepted before, and `src.quantlib` still imports. **QVeris** discovery/inspect/execute join the MCP surface (62 tools), with the cost quote read from the marketplace instead of trusted from the caller ([#976](https://github.com/HKUDS/Vibe-Trading/pull/976), closes [#964](https://github.com/HKUDS/Vibe-Trading/issues/964), thanks [@shadowinlife](https://github.com/HKUDS/Vibe-Trading/shadowinlife)). Plus HK market-data fallback routing repaired with a new Tencent HK source, yfinance crypto routed to the crypto engine, memory entries written and recovered with their `.md` suffix, MCP list/dict arguments tolerating JSON-string clients, and Portfolio Studio artifacts surfaced in run detail ([#1000](https://github.com/HKUDS/Vibe-Trading/pull/1000), [#970](https://github.com/HKUDS/Vibe-Trading/pull/970), [#984](https://github.com/HKUDS/Vibe-Trading/pull/984), [#993](https://github.com/HKUDS/Vibe-Trading/pull/993), [#980](https://github.com/HKUDS/Vibe-Trading/pull/980), [#982](https://github.com/HKUDS/Vibe-Trading/pull/982), [#966](https://github.com/HKUDS/Vibe-Trading/pull/966), [#973](https://github.com/HKUDS/Vibe-Trading/pull/973), thanks [@he-yufeng](https://github.com/HKUDS/Vibe-Trading/he-yufeng), [@ngoanpv](https://github.com/HKUDS/Vibe-Trading/ngoanpv), [@sambazhu](https://github.com/HKUDS/Vibe-Trading/sambazhu)).+- **2026-08-06** 🧮 **A tested finance-math layer + valuation engine + irregular cash flows + wired-in governance**: `src/quantlib` replaces the formulas that lived as markdown inside skills with one tested implementation each — options, bonds, credit, econometrics, VaR/CVaR/EVT, attribution, event studies, multiple-testing control, purged cross-validation — 265 functions, reachable from the CLI, Web UI, REST API and MCP via the new read-only `quantlib_call` tool. A valuation engine (`run_dcf` / `run_comps` / three-statement) refuses to run on a missing input instead of silently defaulting it, and a new entity + cash-flow spine admits NAVs, capital calls, and coupons (XIRR/MOIC/DPI/TVPI and TWR/Modified Dietz via `cashflow_performance`; crypto L2 impact cost via `orderbook_depth`). Every run now writes a hash manifest, the audit ledger is hash-chained so tampering is detectable, and all 30 swarm presets were re-audited — a deliverable no granted tool can compute is now declared as such instead of invented.- **2026-08-05** 🔭 **Institutional holdings, ETF look-through, prediction markets, research papers**: Four read-only data tools, all on free public sources — SEC 13F books with quarter-over-quarter position diffs; ETF constituents across markets (a CSI-300 tracker resolves to 342 positions covering 98.7% of net assets, not the quarterly top ten); event contracts as labelled implied probability; and arXiv/OpenAlex search that marks what a source does not state instead of inferring it. Plus five scheduled-research templates, six institutional commands (`/comps` `/dcf` `/attrib` `/memo` `/earnings` `/screen`), investor lenses as a standalone skill, and an agent core that traces every number back to the tool that produced it.- **2026-08-04** 🔧 **Correctness pass: fundamentals, A-share prices, oversized results**: SEC reporting periods are now keyed on their `(start, end)` span — a 10-Q files the true quarter and the year-to-date frame under the same end date and fiscal period, so `period="annual"` had been returning a single quarter for AAPL FY2018–2020 (a 4.2× understatement) and every fiscal-Q4 slot in a quarterly series carried the full-year figure; `get_fundamentals("AAPL.US")` no longer answers `ok:true` with an all-null panel. Tushare A-share prices are now corporate-action adjusted in both the factor bench and backtests — a raw close-to-close return across an ex-date was off by up to 47 percentage points (300750.SZ, 2023-04-26) — and the CSI300 bench masks each date to its point-in-time index membership. Cross-market composite backtests refuse a mixed-currency code set instead of summing CNY, USD and KRW into one equity curve; option legs are marked at the volatility they were opened at, removing a fabricated day-zero P&L of up to +93% of premium; oversized tool results are paged by whole record with an explicit total instead of being cut mid-JSON; and `calc_metrics` reports tracking error and benchmark beta.- **2026-08-03** ⏰ **Timezone-aware scheduled research + unblocked stock screening**: Scheduled jobs now take an optional IANA `timezone` and evaluate cron on that zone's wall clock, so a cadence survives DST — a spring-forward gap is skipped and a fall-back ambiguous time runs once — while cron fields gain comma lists and ranges (`1,3-5`), jobs without a timezone keep UTC semantics, and the web UI gains a **Scheduled** page in all five locales where it previously had no scheduling surface at all ([#954](https://github.com/HKUDS/Vibe-Trading/pull/954), closes [#953](https://github.com/HKUDS/Vibe-Trading/issues/953), thanks [@ngoanpv](https://github.com/ngoanpv)). A screening request no longer dead-ends: a many-candidate shortlist counts as an answer rather than a stalled resolution and retires once a candidate is locked, and price validation stops reading ticker digits, localized dates, share counts, and position costs as quoted prices — while still refusing any quote outside recorded OHLC evidence (closes [#955](https://github.com/HKUDS/Vibe-Trading/issues/955)). Agent memory also gets exact index-anchor matching and a respected result bound ([#956](https://github.com/HKUDS/Vibe-Trading/pull/956), [#957](https://github.com/HKUDS/Vibe-Trading/pull/957), thanks [@santhreal](https://github.com/santhreal)).@@ -484,7 +485,7 @@ run from a clone (`pip install -e .`).</details><details>-<summary><b>Broker Connectors</b> <sub>12 brokers — read + paper, bounded-live where supported</sub></summary>+<summary><b>Broker Connectors</b> <sub>13 brokers — read + paper, bounded-live where supported</sub></summary>Connector-first profiles. Most do read + paper-account order placement — IBKR is read-only, Robinhood is live-only (no paper account), and Trading 212 refuses order placement entirely, paper included; live order placement is bounded by a user-defined mandate (symbol allowlist, order-size / exposure caps, daily trade cap, instant kill switch) and never holds funds — the broker executes. Order-placing tools stay off MCP (agent + CLI only). Research / backtest paths are structurally barred from any live endpoint.@@ -496,6 +497,7 @@ Connector-first profiles. Most do read + paper-account order placement — IBKR| **Alpaca** | US | read + paper + bounded live (+ TAP credential-isolation mode) || **OKX** · **Binance** | crypto | read + paper + bounded live || **Futu** | HK / US / A | read + paper + bounded live |+| **eToro** | global | read + paper + bounded live (Public API; demo keys reach only `/demo` paths, plus copy-trading workflows) || **MetaTrader 5** | forex / CFD | read + paper + bounded live (Exness-style; demo ⇔ paper identity guard) || **Longbridge** · **Dhan** · **Shoonya** | US / HK · India (NSE/BSE) | read + paper only — no runtime paper/live discriminator, so live order placement is hard-refused || **Trading 212** | UK / EU | fully read-only — `place_order` / `cancel_order` hard-refuse even paper |@@ -571,6 +573,87 @@ Intraday bars: 1m / 5m / 15m / 30m / 1H / 4H / 1D. 15 metrics + benchmark compar</details>+<details>+<summary><b>Quant Library</b> <sub>265 tested functions across 19 modules, callable from every transport</sub></summary>++`src/quantlib` holds one tested implementation of each piece of finance math the+agent needs. Skills **import** these rather than carrying formulas inside+markdown code blocks — if you find a pricing formula living in a `SKILL.md`,+that is a bug, not a pattern.++| Module | What it covers |+|--------|----------------|+| `options` | Black-Scholes price + greeks, implied-volatility inversion |+| `fixedincome` | Bond math, Nelson-Siegel / Svensson curve fitting |+| `credit` | Altman Z-score, Merton / KMV distance-to-default |+| `timeseries` | Stationarity, cointegration, GARCH, bootstrap |+| `risk` · `var_backtest` | VaR / CVaR / EVT and their backtests |+| `attribution` | Brinson-Fachler decomposition |+| `performance` · `fundmath` | TWR / MWR / Modified Dietz; XIRR / MOIC / DPI / TVPI |+| `factormodel` · `eventstudy` | Factor regressions, event studies |+| `multipletesting` · `crossvalidation` | Deflated significance, purged CV |+| `impact` | Market-impact models |++The read-only `quantlib_call` tool reaches all of it through one contract, so the+finance math works on the CLI, the Web UI, the REST API and MCP — including+deployments where `bash` is gated off. It is+structurally not a shell — module allowlist, `__all__`-only dispatch, `export_*`+refused. Econometrics needs the `stats` extra+(`pip install "vibe-trading-ai[stats]"`); those functions lazy-import and tell+you which one is missing.++</details>++<details>+<summary><b>Valuation & Institutional Research</b> <sub>DCF, comps, three-statement, and six research commands</sub></summary>++A valuation engine that refuses to invent its own inputs. The one rule in+`contracts.py`: **a missing input makes a model NOT RUNNABLE and is never+silently defaulted** — every default in a valuation model is an opinion wearing+a constant's clothes.++| Model | Behaviour worth knowing |+|-------|-------------------------|+| `run_dcf` | FCFF bridge, WACC build, mid-year discounting, net-debt bridge, WACC×g sensitivity grid. Dual terminal value: each method is cross-checked against the other's implied multiple and implied g |+| `run_comps` | EV bridge, LTM + calendar-year calendarisation, multiple matrix. A peer with a non-positive denominator is **excluded and reported**, never averaged in as a negative multiple |+| `threestatement` | Linked projection with a hard balance assertion, an explicit revolver plug, and an iterated interest↔debt circularity that must converge or raise |++Artifacts are input-hashed and versioned, with xlsx / pptx export.++Six slash commands drive the workflows — `/comps` `/dcf` `/attrib` `/memo`+`/earnings` `/screen` — each carrying a step skeleton and an+arithmetic-consistent worked example (the Brinson decomposition sums exactly to+active return; the earnings bridge sums exactly to the EPS delta). The+`investor-lenses` skill stacks named-investor reasoning frameworks on top as+analysis overlays: each lens is an operating procedure — priority signals,+disqualifying conditions, typical misuse — not a biography, and names no tool.++Beyond bars, `src/entities` ingests irregular dated cash flows (NAVs, capital+calls, coupons) and `cashflow_performance` reports XIRR / MOIC / DPI / TVPI /+TWR / Modified Dietz / MWR over them. This path is deliberately parallel to the+bar engines so a `nav` column can never reach one and get priced as a close.++</details>++<details>+<summary><b>Governance & Audit Trail</b> <sub>answer "what methodology produced that number?"</sub></summary>++Every run writes a **manifest** hashing the prompt, the skill contents, the tool+registry and the package versions, so a number produced last month can be traced+to the exact methodology that produced it.++The **audit ledger** chains each record to its predecessor's hash and fsyncs, so+editing or deleting a record is detectable — and an edit that recomputes its own+hash is still caught one record later via `prev_hash_mismatch`. Timestamps are+always caller-supplied; no module here calls `datetime.now()`.++Trace redaction is **sink-aware**: tool-call arguments and the live audit ledger+use a fail-closed sink where `content` stays redacted, while the tool-result+sink releases it and pattern-scrubs its string leaves. `env` is never released+in either.++</details>+## 🎬 Demo<div align="center">@@ -1093,7 +1176,7 @@ Posting `{}` schedules a template on its own suggested cadence with its declared## 🔌 MCP Plugin-Vibe-Trading exposes 64 MCP tools for any MCP-compatible client. Runs as a stdio subprocess — no server setup needed. Core research tools work with zero API keys for HK/US/crypto; trading connector tools use the selected connector profile, and `run_swarm` needs an LLM key.+Vibe-Trading exposes 70 MCP tools for any MCP-compatible client. Runs as a stdio subprocess — no server setup needed. Core research tools work with zero API keys for HK/US/crypto; trading connector tools use the selected connector profile, and `run_swarm` needs an LLM key.**Environment variables:** the client spawns the server itself, so a shell `export` never reaches it — set them in the client's `env` block. Generated backtest code is sandboxed to the allowed run roots, so writing results into a workspace of your own needs `VIBE_TRADING_ALLOWED_RUN_ROOTS`:@@ -1162,7 +1245,7 @@ with `--host` / `--port`.</details>-**MCP tools exposed (64):** `list_skills`, `load_skill`, `start_research_goal`, `get_research_goal`, `add_goal_evidence`, `update_research_goal_status`, `backtest`, `factor_analysis`, `alpha_zoo`, `alpha_bench`, `analyze_options`, `analyze_options_payoff`, `pattern_recognition`, `read_url`, `read_document`, `web_search`, `write_file`, `read_file`, `trading_connections`, `trading_select_connection`, `trading_check`, `trading_account`, `trading_positions`, `trading_orders`, `trading_quote`, `trading_history`, `list_swarm_presets`, `run_swarm`, `get_market_data`, `get_fund_flow`, `get_dragon_tiger`, `get_northbound_flow`, `get_margin_trading`, `get_block_trades`, `get_shareholder_count`, `get_lockup_expiry`, `get_sector_info`, `get_research_reports`, `get_stock_news`, `get_sec_filings`, `get_financial_statements`, `get_options_chain`, `get_stock_profile`, `screen_market`, `search_symbol`, `get_macro_series`, `iwencai_search`, `qveris_search`, `qveris_inspect`, `qveris_execute`, `get_institutional_holdings`, `etf_holdings`, `prediction_market`, `research_papers`, `get_swarm_status`, `get_run_result`, `list_runs`, `reap_stale_runs`, `retry_run`, `analyze_trade_journal`, `extract_shadow_strategy`, `run_shadow_backtest`, `render_shadow_report`, `scan_shadow_signals`.+**MCP tools exposed (70):** `list_skills`, `load_skill`, `start_research_goal`, `get_research_goal`, `add_goal_evidence`, `update_research_goal_status`, `backtest`, `factor_analysis`, `alpha_zoo`, `alpha_bench`, `analyze_options`, `analyze_options_payoff`, `pattern_recognition`, `read_url`, `read_document`, `web_search`, `write_file`, `read_file`, `trading_connections`, `trading_select_connection`, `trading_check`, `trading_account`, `trading_positions`, `trading_orders`, `trading_quote`, `trading_history`, `list_swarm_presets`, `run_swarm`, `get_market_data`, `get_fund_flow`, `get_dragon_tiger`, `get_northbound_flow`, `get_margin_trading`, `get_block_trades`, `get_shareholder_count`, `get_lockup_expiry`, `get_sector_info`, `get_research_reports`, `get_stock_news`, `get_sec_filings`, `get_financial_statements`, `get_options_chain`, `get_stock_profile`, `screen_market`, `search_symbol`, `get_macro_series`, `iwencai_search`, `qveris_search`, `qveris_inspect`, `qveris_execute`, `get_institutional_holdings`, `etf_holdings`, `prediction_market`, `research_papers`, `get_swarm_status`, `get_run_result`, `list_runs`, `reap_stale_runs`, `retry_run`, `analyze_trade_journal`, `extract_shadow_strategy`, `run_shadow_backtest`, `render_shadow_report`, `scan_shadow_signals`, `quantlib_call`, `cashflow_performance`, `orderbook_depth`, `sentiment`, `technical_indicators`, `get_fundamentals`.### SWARM external MCP tools@@ -1536,7 +1619,7 @@ Vibe-Trading/├── agent/ # Backend (Python)│ ├── cli/ # CLI package — interactive TUI + subcommands│ ├── api_server.py # FastAPI server — runs, sessions, upload, swarm, SSE-│ ├── mcp_server.py # MCP server — 64 tools for OpenClaw / Claude Desktop+│ ├── mcp_server.py # MCP server — 70 tools for OpenClaw / Claude Desktop│ ││ ├── src/│ │ ├── agent/ # ReAct agent core@@ -1551,7 +1634,7 @@ Vibe-Trading/│ │ ├── memory/ # Cross-session persistent memory│ │ │ └── persistent.py # file-based memory (~/.vibe-trading/memory/)│ │ │-│ │ ├── tools/ # 68 auto-discovered agent tools+│ │ ├── tools/ # 94 auto-discovered agent tools│ │ │ ├── backtest_tool.py # run backtests│ │ │ ├── remember_tool.py # cross-session memory (save/recall/forget)│ │ │ ├── skill_writer_tool.py # skill CRUD (save/patch/delete/file)@@ -1665,7 +1748,38 @@ Want to contribute something bigger? Check the [Roadmap](#-roadmap) above and opThanks to everyone who has contributed to Vibe-Trading!-Recent v0.1.12 cycle contributors and credits:+Recent v0.1.13 cycle contributors and credits:++- @santhreal — a 17-PR correctness and resource-leak sweep: the HTTP throttle now sweeps stale buckets interval-aware so rate-limit spacing survives (#1047), the rate limiter stops growing without bound on unique client IPs (#1039), the event bus notifies and removes subscribers on clear (#1046), `_json_loads` is guarded against corrupted JSON in database columns (#1045), NaN/inf volume and close no longer crash `format_grounding_block` (#1043), `inf` from `pct_change` on zero equity is replaced (#1041), Shoonya tolerates empty-string numerics (#1038), drawdown is computed from the absolute peak on negative equity (#958) and insolvent empty cross accounts are marked liquidated (#959), plus exact memory index anchors (#956/#957) and an A-share code / trade-journal parsing batch (#919, #926–#935)+- @shadowinlife — HK market-data fallback routing repaired with a new Tencent HK source (#1000), Shadow multi-market backtests split per settlement currency (#997), bare US tickers routed to `us_equity` (#994), MCP list/dict arguments tolerating JSON-string clients (#993), generated signal engines passing the backtest sandbox validator (#992), and the memory GC dry-run fix (#973)+- @honginp — the USD-M perpetual lifecycle end to end: funding and liquidation execution (#903), isolated & cross margin liquidation modelling (#889), ordered fidelity evidence persistence (#936), atomic position rebalancing (#951), and strict historical position rebalancing that preserves collateral, funding, fees and fill evidence (#1019)+- @QCYTSN — the desktop Electron shell lifecycle (#923), Windows packaging with a checksum-pinned embedded runtime and `safeStorage` credential handling (#1015), and Settings model discovery + runtime identity UX (#924)+- @Robin1987China — the `technical_indicators` (#921) and `sentiment` (#939) tools, annualisation entries for 15 data sources with a CI coverage gate (#891), indicator inputs read without sampling (#1005), and the `quant_strategy_desk` final report aggregator (#1048)+- @Shizoqua — MCP specs cache keyed on remote server identity (#1049), memory FTS5 ranking with importance decay (#1032), swarm detection of `ok`/`success:false` tool failures (#1028), and lowercase `4h` resampling in the yfinance loader (#1013)+- @ngoanpv — timezone-aware scheduled research (#954, closes #953), one malformed record no longer breaking the whole store (#1003), interval creates without a resolvable zone (#1004), and delete-route job id validation (#980)+- @he-yufeng — risk x-ray artifacts in portfolio runs (#900), Portfolio Studio artifacts surfaced in run detail (#966), yfinance crypto routed to the crypto engine (#970), and hierarchy-routed memory entries keeping their `.md` extension (#984)+- @wiliao — Canadian markets end to end: TSX/TSXV market data (#1024) and symbol support through search fail-fast and CSV grounding (#1037)+- @MuggleJinx — session and run history stored under the user runtime root (#925, closes #904) and `~/.vibe-trading/.env` loaded on the connector command path (#902, closes #901)+- @cgycorey — Alpha Zoo tools reaching MCP (#979) and mapping-shaped Responses stream events accepted (#1034)+- @ofeksh-tr — the eToro Public API connector with path-separated demo/real profiles (#989) — broker connectors 12 → **13**+- @su322 — source message ids threaded into IM outbound so QQ replies stay passive (#1008), and the output principle that stops the agent once evidence is sufficient (#1010)+- @zwrong — the `vibe-trading update` self-upgrade command (#1020)+- @yrk111222 — ModelScope as an OpenAI-compatible provider (#1011)+- @x-lambda — agent proxy opt-out covering sync and async clients (#995)+- @dineeshd — authenticated API capability surfaces under enforced CSP (#961)+- @hhj123123 — the canonical run root preserved after HOME isolation (#1012)+- @00EVA — the Settings model dropdown auto-resizing so long provider/model slugs stay readable (#1006)+- @darkknight4563 — `bar_returns` kept bit-identical for gapped positive series (#895)+- @sambazhu — mootdx config pre-seeded in the sandbox home (#982)+- @yagnikpipaliya — self-healing for Claude models that deprecate the `temperature` field (#890, closes #856)+- @JungHoonGhae — the Korea equity (KRX) market engine (#693)+- @shugaoye — the OpenBB Workspace bridge (#817)+- @TSENGCHIENFENG — the read-only Taiwan snapshot tool (#848)+- @ddy4633, @tyj147454413-cmd, @y85998607, @klmtseng, @ebujinovch, @g0rdonL, @AmirF194, @Echoandelementwebsites, @dvirarad, @1anter — correlation, loader, vn.py-export, PIT-fundamentals and alpha-bench fixes carried into this cycle+- @warren618 / Haozhe Wu — the finance-math layer and valuation engine, the entity + cash-flow spine, run manifests and the hash-chained audit ledger, the four read-only data tools, the institutional commands and investor lenses, the grounding-gate repair, the analytic options payoff tool (#946), Codex OAuth recovery (#1014), the Shadow runtime root fix (#1017), release integration and open-PR/issue triage++<details>+<summary>v0.1.12 cycle contributors</summary>- @santhreal — a 30-PR correctness sweep: strict-JSON / finite-number hardening across metrics, factors, pattern, and options (#764/#765/#766/#767/#739/#740/#744), loader correctness (#761 yahoo 1m bars), and session / journal robustness (#762/#763/#768/#769/#770)- @xkam7ar — broad reliability across packaging, web, scheduler, swarm, and CLI (#584), cancellation before the first AgentLoop iteration (#641, closes #638), QVeris session budget + atomic credit accounting (#685/#686), CI / OOS gates (#630/#632), and journal month-filter / side-parse fixes (#626/#628)@@ -1696,6 +1810,8 @@ Recent v0.1.12 cycle contributors and credits:- @GabbaTauchi — reported the native zai streaming / base-URL bug (#758)- @warren618 / Haozhe Wu — the correlation regime backend integration, the zai provider streaming + base-URL resolution fix (#758), release integration, and open-PR/issue triage+</details>+<details><summary>v0.1.11 cycle contributors</summary>diff --git a/README_ar.md b/README_ar.mdindex bcd96f0e8..1596a955c 100644--- a/README_ar.md+++ b/README_ar.md@@ -52,13 +52,14 @@> ⚠️ **تحذير أمني:** حساب X باسم `VibeTrading_HKU`، ومشروع Virtuals رقم `101845`، وعقد التوكن `0x640BDBF77b6447E8b7DB7894cED84BD1c40571f4` كلّها غير رسمية ولا تتبع Vibe-Trading. لم نُطلق أو نؤيد مطلقًا أي توكن أو عملة ميم. لا تشترِ هذا التوكن، ولا تربط محفظتك، ولا توقّع أي شيء. [التفاصيل](SECURITY.md#official-channels--impersonation).+- **2026-08-10** 🚀 **صدر الإصدار v0.1.13** ([ملاحظات الإصدار](https://github.com/HKUDS/Vibe-Trading/releases/tag/v0.1.13)، `pip install -U vibe-trading-ai`): 408 التزامات و162 طلب دمج منذ 0.1.12 — وهو أكبر إصدار حتى الآن. **البطل إصلاح لا ميزة: بوابة الهوية لم تعد ترفض إجابات تملك أدلتها بالفعل.** كان السؤال السليم الصياغة يقضي دقائق في استدعاءات أدوات حقيقية ثم يعود بـ*«يتعذّر التأكد بأمان من هوية الأداة أو من دليل السعر»*. الأسباب: التعامل مع `.SS` و`.SH` كأداتين مختلفتين، فصار **كل رمز في شنغهاي ملتبساً بشكل دائم**؛ واستعلام جانبي فاشل كان بإمكانه تخفيض هوية مقفلة أصلاً؛ وتسجيل رد Yahoo بـ HTTP 400 على كل استعلام صيني/ياباني/كوري بوصفه *فشلاً* في مصدر البيانات بدل «غير مُدرج هنا»؛ وقائمة سماح مثبّتة لكل أداة حجبت 11 من 17 صيغة وسيطة موثّقة؛ ورفض الإجابات الصينية لأنها كتبت `雅虎` أو `元` بدل اسم المُحمِّل بالحروف اللاتينية؛ وفاصل الآلاف الذي شطر `¥1,309.22` فقُورن `1` بالنطاق المرصود. كما لم تعد الأسئلة المفاهيمية وتقارير المقارنة تصل إلى طريق مسدود. وما زال أي سعر خارج دليل OHLC المسجَّل **مرفوضاً**. **الجديد:** `src/quantlib` — 249 دالة مختبَرة عبر 17 وحدة (خيارات، سندات، ائتمان، اقتصاد قياسي، VaR/CVaR/EVT، تفكيك الأداء، دراسات الأحداث، purged CV) يمكن بلوغها من CLI وWeb UI وREST API وMCP عبر `quantlib_call` للقراءة فقط، فصارت الـ skills تستورد الرياضيات المالية بدل حملها داخل markdown؛ و**محرك تقييم** (`run_dcf` / `run_comps` / ثلاث قوائم مترابطة) قاعدته الوحيدة أن المدخل الناقص يجعل النموذج غير قابل للتشغيل بدل ملئه ضمنياً؛ و**عمود فقري للكيانات والتدفقات النقدية غير المنتظمة** (XIRR / MOIC / DPI / TVPI، وTWR / Modified Dietz عبر `cashflow_performance`) مُبقى عمداً موازياً لمحركات الأشرطة؛ و**حوكمة في كل تشغيل** — manifest يجزّئ الموجّه والـ skills وسجل الأدوات وإصدارات الحزم، مع سجل تدقيق مسلسل بالتجزئة ومُثبَّت بـ fsync يُضبَط فيه حتى التعديل الذي يعيد حساب تجزئته عند القيد التالي؛ وأربع أدوات بيانات للقراءة فقط على مصادر عامة مجانية (**SEC 13F** بفروق المراكز ربعاً بربع، و**اختراق محتويات ETF** حيث يُحَل صندوق يتتبع CSI300 إلى 342 مركزاً تغطي 98.66% من صافي الأصول بدل أكبر عشرة في التقرير الربعي، و**أسواق التنبؤ** كاحتمال ضمني موسوم، و**arXiv/OpenAlex** بادعاءات مثبّتة بالمصدر). يضاف إلى ذلك ستة أوامر بحث مؤسسي (`/comps` `/dcf` `/attrib` `/memo` `/earnings` `/screen`)، وعدسات المستثمرين كـ skill مستقلة، وخمسة playbooks بحثية جاهزة للجدولة، و**غلاف Electron لسطح المكتب** بتغليف Windows مثبَّت بالمجاميع الاختبارية و`safeStorage`، و**eToro** كموصّل الوساطة الثالث عشر، و**كوريا (KRX)** كمحرك الاختبار الرجعي التاسع، و**جسر OpenBB Workspace**، ودعم الأسهم الكندية من طرف إلى طرف، إضافة إلى `sentiment` و`technical_indicators` و`options_payoff` و`orderbook_depth` وModelScope و`vibe-trading update`. **الصحّة:** صارت فترات تقارير SEC تُفهرَس بمجالها `(start, end)` — إذ كان الطلب السنوي يعيد ربعاً واحداً، أي بخس بمقدار 4.2 ضعف؛ وأسعار الأسهم الصينية من tushare صارت معدَّلة لإجراءات الشركات، بعدما كان العائد الخام عبر تاريخ توزيع الحقوق ينحرف حتى 47 نقطة مئوية؛ ولم يعد `bar_returns` يسجّل توقّف التداول كحركة 0%؛ ويغطي التسنين كل مصادر البيانات الـ24؛ وسُدَّت ثغرة في الصندوق الرملي كان الكود المولَّد يستطيع عبرها استيراد طبقة الوساطة أو بلوغ `socket`/`subprocess` عبر ارتباط مُعاد التسمية؛ وتُرفض الاختبارات الرجعية المركّبة متعددة العملات بدل جمعها في منحنى ملكية واحد. شكراً لـ @santhreal و@shadowinlife و@Robin1987China و@he-yufeng و@QCYTSN و@Shizoqua و@honginp و@cgycorey و@wiliao و@ngoanpv و@x-lambda و@ofeksh-tr و@00EVA و@zwrong و@yrk111222 و@su322 و@hhj123123 و@dineeshd و@sambazhu و@ddy4633 و@tyj147454413-cmd و@y85998607 و@JungHoonGhae و@shugaoye و@TSENGCHIENFENG و@darkknight4563 و@MuggleJinx و@klmtseng و@ebujinovch و@g0rdonL و@AmirF194 و@Echoandelementwebsites و@yagnikpipaliya و@dvirarad و@1anter.- **2026-08-09** 🪟 **حزم Windows آمنة وأسواق كندا وModelScope وAlpha Zoo عبر MCP**: أصبح تغليف سطح مكتب Windows يبني بيئة Python 3.12 مضمّنة ومثبّتة بالـ checksum ومساري مراجعة/توقيع x64 NSIS، مع Electron `safeStorage` للاعتمادات المدرجة في قائمة السماح. يستطيع renderer ضبط الأسرار أو مسحها ولا يستطيع قراءتها؛ وتُرحّل الإعدادات النصية مرة واحدة؛ ولا تصل القيم المفكوكة إلا إلى backend المملوك؛ ويفشل كل من build المراجعة غير الموقّع والـ build الموقّع بصورة مغلقة إذا كانت حالة التوقيع خاطئة. لم يُنشر أي installer artifact من هذا PR ([#1015](https://github.com/HKUDS/Vibe-Trading/pull/1015)). تعمل الأسهم الكندية الآن من البداية إلى النهاية: تُصنّف رموز `.TO`/`.V` بعملة CAD، وتمر عبر fallback Yahoo → yfinance → local، وتُنفّذ وفق قواعد GlobalEquity الخاصة بكندا، وتقارن بـ `XIC.TO`، وترفض تجميع العملات المختلطة. ويمكن لاختبارات USD-M التاريخية الصارمة اختيار `position_adjustment=rebalance` مع إبقاء الضمان والتمويل والرسوم والأرباح والخسائر المحققة وسلوك التصفية ودليل التنفيذ غير القابل للتغيير متسقة خلال الزيادة والتخفيض ([#1024](https://github.com/HKUDS/Vibe-Trading/pull/1024)، [#1019](https://github.com/HKUDS/Vibe-Trading/pull/1019)، يغلق [#952](https://github.com/HKUDS/Vibe-Trading/issues/952)). انضم ModelScope إلى providers المضمنة عبر endpoint الاستدلال المستضاف الرسمي المتوافق مع OpenAI، مع `Qwen/Qwen3.5-27B` افتراضيًا ([#1011](https://github.com/HKUDS/Vibe-Trading/pull/1011)). يميّز الأمر الجديد `vibe-trading update` تثبيت wheel عن editable/source checkout، ويثبت الإصدار الدقيق الذي تحقّق منه، ثم يتحقق من metadata في process جديدة من دون downgrade ([#1020](https://github.com/HKUDS/Vibe-Trading/pull/1020)). وأصبحت `alpha_zoo` و`alpha_bench` المحدودة متاحتين عبر MCP (64 أداة)، مع حدود للمدة وعدد النتائج ومسار الإخراج وإنشاء آمن للتقارير ([#979](https://github.com/HKUDS/Vibe-Trading/pull/979)). كما حدّثت عمليات lock الموثقة لـ Python/frontend مجموعات dependencies و`postcss` و`akshare` ([#1021](https://github.com/HKUDS/Vibe-Trading/pull/1021)، [#1023](https://github.com/HKUDS/Vibe-Trading/pull/1023)، [#1026](https://github.com/HKUDS/Vibe-Trading/pull/1026)، [#1027](https://github.com/HKUDS/Vibe-Trading/pull/1027)). شكرًا [@QCYTSN](https://github.com/QCYTSN)، [@wiliao](https://github.com/wiliao)، [@honginp](https://github.com/honginp)، [@yrk111222](https://github.com/yrk111222)، [@zwrong](https://github.com/zwrong)، و[@cgycorey](https://github.com/cgycorey).- **2026-08-08** 🧱 **غلاف سطح المكتب وeToro وإعادة الموازنة الذرّية وتعزيز الموثوقية**: يتولى مضيف Electron المصدري دورة حياة الخلفية الحالية — منفذ loopback عشوائي، وسر لكل تشغيل، واسترداد بدء التشغيل بخمس لغات، وتنظيف العمليات التابعة — وينضم eToro بملفات demo/real مفصولة على مستوى المسار؛ وتبقى الإجراءات الحية التي تزيد المخاطر خلف بوابة التفويض والتدقيق، بينما تتطلب أسطح قدرات API المصادقة وتُطبّق CSP ([#923](https://github.com/HKUDS/Vibe-Trading/pull/923)، [#989](https://github.com/HKUDS/Vibe-Trading/pull/989)، [#961](https://github.com/HKUDS/Vibe-Trading/pull/961)). تضيف الاختبارات الرجعية إعادة موازنة ذرّية اختيارية في الاتجاه نفسه مع أدلة تنفيذ غير قابلة للتغيير؛ ويفصل Shadow الأسواق حسب عملة التسوية بلا تجميع FX مختلق ويلتزم بجذر التشغيل المضبوط؛ وتستخدم المؤشرات تاريخًا متصلًا من دون أخذ عينات متباعدة، وصارت حدود السحب عند الملكية السالبة وتصفية الحسابات المعسرة الخالية صحيحة ([#951](https://github.com/HKUDS/Vibe-Trading/pull/951)، [#997](https://github.com/HKUDS/Vibe-Trading/pull/997)، [#1017](https://github.com/HKUDS/Vibe-Trading/pull/1017)، [#1005](https://github.com/HKUDS/Vibe-Trading/pull/1005)، [#958](https://github.com/HKUDS/Vibe-Trading/pull/958)، [#959](https://github.com/HKUDS/Vibe-Trading/pull/959)). يحصل OpenAI Codex OAuth على مخزن اعتماد مستقل ومتزامن وتعافٍ واحد من 401؛ ويشمل تعطيل proxy العملاء المتزامنين وغير المتزامنين؛ وتحافظ تشغيلات sandbox على جذرها القياسي؛ ويعزل البحث المجدول السجلات التالفة ويصحح تحقق timezone للفواصل؛ وتعيد طلبات `4h` المكتوبة بأحرف صغيرة شموع أربع ساعات حقيقية ([#1014](https://github.com/HKUDS/Vibe-Trading/pull/1014)، [#995](https://github.com/HKUDS/Vibe-Trading/pull/995)، [#1012](https://github.com/HKUDS/Vibe-Trading/pull/1012)، [#1003](https://github.com/HKUDS/Vibe-Trading/pull/1003)، [#1004](https://github.com/HKUDS/Vibe-Trading/pull/1004)، [#1013](https://github.com/HKUDS/Vibe-Trading/pull/1013)). تحتفظ ردود QQ بمعرّف الرسالة الأصلية، وتبقى model slugs الطويلة مقروءة، ويتوقف الوكيل عندما تكفي الأدلة ([#1008](https://github.com/HKUDS/Vibe-Trading/pull/1008)، [#1006](https://github.com/HKUDS/Vibe-Trading/pull/1006)، [#1010](https://github.com/HKUDS/Vibe-Trading/pull/1010)). شكرًا [@QCYTSN](https://github.com/QCYTSN)، [@Shizoqua](https://github.com/Shizoqua)، [@ngoanpv](https://github.com/ngoanpv)، [@hhj123123](https://github.com/hhj123123)، [@su322](https://github.com/su322)، [@Robin1987China](https://github.com/Robin1987China)، [@shadowinlife](https://github.com/shadowinlife)، [@dineeshd](https://github.com/dineeshd)، [@honginp](https://github.com/honginp)، [@santhreal](https://github.com/santhreal)، [@00EVA](https://github.com/00EVA)، [@x-lambda](https://github.com/x-lambda)، [@ofeksh-tr](https://github.com/ofeksh-tr).-- **2026-08-07** 🛡️ **رفض كاذب أقل، وسدّ ثغرة في الصندوق الرملي، وQVeris على MCP**: لم تعد بوابة الإسناد ترفض إجابات سليمة الصياغة بسبب أرقام لم تكن أسعارًا أصلًا — درجات الثقة، وقيم المؤشرات، ونوافذ المتوسطات المتحركة، والتواريخ بلا سنة مثل `8/5`، والنطاقات المئوية، ومستويات التحفيز الخاصة بخطة التداول نفسها (`الإغلاق ≥ 6.45` شرط وليس سعرًا مقتبسًا). في المقابل، ما زال أي سعر خارج أدلة OHLC المسجّلة **مرفوضًا**، وصار جدول الأسعار المؤرَّخ `08-05` يطابق أدلته بدل أن تعود كل خلية بلا إسناد ([#1001](https://github.com/HKUDS/Vibe-Trading/issues/1001)، [#983](https://github.com/HKUDS/Vibe-Trading/issues/983)). **الصندوق الرملي:** لم يعد بإمكان كود الاستراتيجية المولَّد استيراد طبقة الوسيط، ولا الوصول إلى `socket`/`subprocess`/`os.system`/`ctypes` عبر ربط مُعاد التسمية — وكلاهما كان مقبولًا سابقًا — بينما يبقى `src.quantlib` قابلًا للاستيراد. **QVeris**: انضمت أدوات discovery/inspect/execute إلى سطح MCP (62 أداة)، مع قراءة تقدير التكلفة من السوق بدل الوثوق بما يعلنه المستدعي ([#976](https://github.com/HKUDS/Vibe-Trading/pull/976)، closes [#964](https://github.com/HKUDS/Vibe-Trading/issues/964)، شكرًا [@shadowinlife](https://github.com/HKUDS/Vibe-Trading/shadowinlife)). إضافة إلى إصلاح مسار التراجع لبيانات سوق هونغ كونغ مع مصدر Tencent جديد، وتوجيه عملات yfinance المشفّرة إلى محرك الكريبتو، وكتابة واسترجاع مدخلات الذاكرة بلاحقة `.md`، وتسامح وسائط list/dict في MCP مع العملاء الذين يرسلون سلاسل JSON، وإظهار مخرجات Portfolio Studio في تفاصيل التشغيل ([#1000](https://github.com/HKUDS/Vibe-Trading/pull/1000)، [#970](https://github.com/HKUDS/Vibe-Trading/pull/970)، [#984](https://github.com/HKUDS/Vibe-Trading/pull/984)، [#993](https://github.com/HKUDS/Vibe-Trading/pull/993)، [#980](https://github.com/HKUDS/Vibe-Trading/pull/980)، [#982](https://github.com/HKUDS/Vibe-Trading/pull/982)، [#966](https://github.com/HKUDS/Vibe-Trading/pull/966)، [#973](https://github.com/HKUDS/Vibe-Trading/pull/973)، شكرًا [@he-yufeng](https://github.com/HKUDS/Vibe-Trading/he-yufeng)، [@ngoanpv](https://github.com/HKUDS/Vibe-Trading/ngoanpv)، [@sambazhu](https://github.com/HKUDS/Vibe-Trading/sambazhu)).<details><summary>أخبار سابقة</summary>-- **2026-08-06** 🧮 **طبقة رياضيات مالية مُختبَرة + محرك تقييم + تدفقات نقدية غير منتظمة + حوكمة موصولة فعلًا**: يستبدل `src/quantlib` الصيغ التي كانت تعيش كنصوص markdown داخل المهارات بتطبيق مُختبَر واحد لكل منها — الخيارات والسندات والائتمان والاقتصاد القياسي وVaR/CVaR/EVT وإسناد الأداء ودراسات الأحداث وضبط الاختبارات المتعددة والتحقق المتقاطع المنقّى — نحو 250 دالة يمكن الوصول إليها كلها من Web/API/MCP عبر أداة القراءة فقط الجديدة `quantlib_call`. ويرفض محرك التقييم (`run_dcf` / `run_comps` / القوائم الثلاث المترابطة) التشغيل عند غياب مدخل بدل ملئه بقيمة افتراضية صامتة، وتقبل البنية الجديدة للكيانات والتدفقات النقدية صافي قيمة الأصول ونداءات رأس المال والكوبونات (`cashflow_performance` يوفّر XIRR/MOIC/DPI/TVPI وTWR/Modified Dietz، و`orderbook_depth` يحسب كلفة الأثر في دفتر أوامر العملات المشفرة). ويكتب كل تشغيل الآن بيان تجزئات، وسجل التدقيق مسلسل بالتجزئات فيُكشف أي عبث، وأعيد فحص جميع الإعدادات المسبقة الثلاثين للسرب مقابل ما تستطيع أدواتها حسابه فعلًا — فما لا يمكن حسابه يُصرَّح به بدل اختلاق أرقامه.+- **2026-08-07** 🛡️ **رفض كاذب أقل، وسدّ ثغرة في الصندوق الرملي، وQVeris على MCP**: لم تعد بوابة الإسناد ترفض إجابات سليمة الصياغة بسبب أرقام لم تكن أسعارًا أصلًا — درجات الثقة، وقيم المؤشرات، ونوافذ المتوسطات المتحركة، والتواريخ بلا سنة مثل `8/5`، والنطاقات المئوية، ومستويات التحفيز الخاصة بخطة التداول نفسها (`الإغلاق ≥ 6.45` شرط وليس سعرًا مقتبسًا). في المقابل، ما زال أي سعر خارج أدلة OHLC المسجّلة **مرفوضًا**، وصار جدول الأسعار المؤرَّخ `08-05` يطابق أدلته بدل أن تعود كل خلية بلا إسناد ([#1001](https://github.com/HKUDS/Vibe-Trading/issues/1001)، [#983](https://github.com/HKUDS/Vibe-Trading/issues/983)). **الصندوق الرملي:** لم يعد بإمكان كود الاستراتيجية المولَّد استيراد طبقة الوسيط، ولا الوصول إلى `socket`/`subprocess`/`os.system`/`ctypes` عبر ربط مُعاد التسمية — وكلاهما كان مقبولًا سابقًا — بينما يبقى `src.quantlib` قابلًا للاستيراد. **QVeris**: انضمت أدوات discovery/inspect/execute إلى سطح MCP (62 أداة)، مع قراءة تقدير التكلفة من السوق بدل الوثوق بما يعلنه المستدعي ([#976](https://github.com/HKUDS/Vibe-Trading/pull/976)، closes [#964](https://github.com/HKUDS/Vibe-Trading/issues/964)، شكرًا [@shadowinlife](https://github.com/HKUDS/Vibe-Trading/shadowinlife)). إضافة إلى إصلاح مسار التراجع لبيانات سوق هونغ كونغ مع مصدر Tencent جديد، وتوجيه عملات yfinance المشفّرة إلى محرك الكريبتو، وكتابة واسترجاع مدخلات الذاكرة بلاحقة `.md`، وتسامح وسائط list/dict في MCP مع العملاء الذين يرسلون سلاسل JSON، وإظهار مخرجات Portfolio Studio في تفاصيل التشغيل ([#1000](https://github.com/HKUDS/Vibe-Trading/pull/1000)، [#970](https://github.com/HKUDS/Vibe-Trading/pull/970)، [#984](https://github.com/HKUDS/Vibe-Trading/pull/984)، [#993](https://github.com/HKUDS/Vibe-Trading/pull/993)، [#980](https://github.com/HKUDS/Vibe-Trading/pull/980)، [#982](https://github.com/HKUDS/Vibe-Trading/pull/982)، [#966](https://github.com/HKUDS/Vibe-Trading/pull/966)، [#973](https://github.com/HKUDS/Vibe-Trading/pull/973)، شكرًا [@he-yufeng](https://github.com/HKUDS/Vibe-Trading/he-yufeng)، [@ngoanpv](https://github.com/HKUDS/Vibe-Trading/ngoanpv)، [@sambazhu](https://github.com/HKUDS/Vibe-Trading/sambazhu)).+- **2026-08-06** 🧮 **طبقة رياضيات مالية مُختبَرة + محرك تقييم + تدفقات نقدية غير منتظمة + حوكمة موصولة فعلًا**: يستبدل `src/quantlib` الصيغ التي كانت تعيش كنصوص markdown داخل المهارات بتطبيق مُختبَر واحد لكل منها — الخيارات والسندات والائتمان والاقتصاد القياسي وVaR/CVaR/EVT وإسناد الأداء ودراسات الأحداث وضبط الاختبارات المتعددة والتحقق المتقاطع المنقّى — نحو 250 دالة يمكن الوصول إليها كلها من CLI وWeb UI وREST API وMCP عبر أداة القراءة فقط الجديدة `quantlib_call`. ويرفض محرك التقييم (`run_dcf` / `run_comps` / القوائم الثلاث المترابطة) التشغيل عند غياب مدخل بدل ملئه بقيمة افتراضية صامتة، وتقبل البنية الجديدة للكيانات والتدفقات النقدية صافي قيمة الأصول ونداءات رأس المال والكوبونات (`cashflow_performance` يوفّر XIRR/MOIC/DPI/TVPI وTWR/Modified Dietz، و`orderbook_depth` يحسب كلفة الأثر في دفتر أوامر العملات المشفرة). ويكتب كل تشغيل الآن بيان تجزئات، وسجل التدقيق مسلسل بالتجزئات فيُكشف أي عبث، وأعيد فحص جميع الإعدادات المسبقة الثلاثين للسرب مقابل ما تستطيع أدواتها حسابه فعلًا — فما لا يمكن حسابه يُصرَّح به بدل اختلاق أرقامه.- **2026-08-05** 🔭 **حيازات المؤسسات، وتفكيك محافظ ETF، وأسواق التنبؤ، والأوراق البحثية**: أربع أدوات للقراءة فقط تعتمد كلها على مصادر عامة مجانية — حيازات SEC 13F مع فروق المراكز ربعاً بربع؛ ومكوّنات صناديق ETF عبر الأسواق (صندوق يتتبع CSI-300 يعود بـ 342 مركزاً تغطي 98.7% من صافي الأصول بدل العشرة الأوائل الفصلية)؛ وعقود الأحداث معروضة كاحتمال ضمني موسوم بوحدته؛ وبحث arXiv/OpenAlex الذي يعلّم ما لا يذكره المصدر بدل استنتاجه. وإلى جانبها: خمسة قوالب بحث مجدولة، وستة أوامر بحث مؤسسي (`/comps` `/dcf` `/attrib` `/memo` `/earnings` `/screen`)، وinvestor lenses كمهارة مستقلة، ونواة وكيل تُرجع كل رقم إلى الأداة التي أنتجته.- **2026-08-04** 🔧 **إصلاحات صحّة البيانات: الأساسيات وأسعار الأسهم الصينية والنتائج المفرطة الطول**: صارت فترات التقارير في SEC تُعرَّف بمدى `(start, end)`؛ فالنموذج 10-Q يودع الربع الحقيقي والإطار التراكمي منذ بداية السنة تحت التاريخ نفسه والربع المالي نفسه، ولذلك كان `period="annual"` يُعيد ربعًا واحدًا لسهم AAPL في السنوات المالية 2018–2020 (تقليل بمقدار 4.2 ضعف)، وكان كل موضع للربع الرابع في السلسلة الربعية يحمل رقم السنة الكاملة؛ كما لم يعد `get_fundamentals("AAPL.US")` يُرجع `ok:true` مع لوحة فارغة تمامًا. وتُعدَّل الآن أسعار الأسهم الصينية من Tushare لأحداث الشركات في كل من مقعد اختبار العوامل والاختبارات الرجعية — إذ كان العائد الخام بين إغلاقين عبر يوم توزيع الحقوق يخطئ بما يصل إلى 47 نقطة مئوية (300750.SZ، 2023-04-26) — ويقنّع مقعد CSI300 كل تاريخ بمكونات المؤشر في حينه. وترفض الاختبارات الرجعية المركّبة عبر الأسواق مجموعة رموز مختلطة العملات بدل جمع CNY وUSD وKRW في منحنى ملكية واحد؛ وتُقيَّم أرجل الخيارات بالتقلب الذي فُتحت عليه، مما أزال ربحًا وهميًا في اليوم صفر يبلغ +93% من العلاوة؛ وتُقسَّم النتائج المفرطة الطول إلى صفحات بسجلات كاملة مع إظهار العدد الإجمالي بدل قطعها في منتصف JSON؛ ويُبلّغ `calc_metrics` عن خطأ التتبع وبيتا المرجع.- **2026-08-03** ⏰ **بحث مجدول واعٍ بالمنطقة الزمنية + فكّ انسداد فرز الأسهم**: صارت المهام المجدولة تقبل مفتاح `timezone` اختياريًا بمعيار IANA، ويُقيَّم cron على ساعة الحائط لتلك المنطقة، فيبقى الإيقاع صحيحًا عبر تحولات التوقيت الصيفي — تُتخطّى اللحظة المفقودة عند التقديم، وتُنفَّذ اللحظة المكرَّرة عند التأخير مرة واحدة فقط — كما تقبل حقول cron قوائم الفواصل والمدَيات (`1,3-5`)، وتحتفظ المهام بلا منطقة زمنية بدلالات UTC، وأضيفت إلى واجهة الويب صفحة **Scheduled** بخمس لغات بعد أن لم يكن للجدولة أي واجهة أمامية ([#954](https://github.com/HKUDS/Vibe-Trading/pull/954)، closes [#953](https://github.com/HKUDS/Vibe-Trading/issues/953)، شكرًا [@ngoanpv](https://github.com/ngoanpv)). ولم يعد طلب الفرز ينتهي إلى طريق مسدود: تُعدّ القائمة القصيرة متعددة المرشحين إجابةً لا عمليةَ تحليل متوقفة، وتنسحب بمجرد قفل مرشح بعينه، وتوقّف التحقق من الأسعار عن قراءة أرقام رمز السهم والتواريخ المحلية وأعداد الأسهم وتكلفة المركز كأسعار معلنة — مع استمرار رفض أي سعر خارج أدلة OHLC المسجّلة (closes [#955](https://github.com/HKUDS/Vibe-Trading/issues/955)). كذلك حصلت ذاكرة الوكيل على مطابقة دقيقة لمرساة الفهرس وحدٍّ مُحترَم لعدد النتائج ([#956](https://github.com/HKUDS/Vibe-Trading/pull/956)، [#957](https://github.com/HKUDS/Vibe-Trading/pull/957)، شكرًا [@santhreal](https://github.com/santhreal)).@@ -483,7 +484,7 @@ LONGBRIDGE_ACCESS_TOKEN=...</details><details>-<summary><b>موصّلات الوسطاء</b> <sub>12 وسيطاً — قراءة + حساب ورقي، وتداول حي محدود حيثما يُدعم</sub></summary>+<summary><b>موصّلات الوسطاء</b> <sub>13 وسيطاً — قراءة + حساب ورقي، وتداول حي محدود حيثما يُدعم</sub></summary>ملفات تعريف قائمة على الموصّل. يوفّر معظم الموصّلات قراءةً وتنفيذ أوامر على حساب ورقي (paper) — أما IBKR فللقراءة فقط، وRobinhood حيّ فقط (بلا حساب ورقي)، وTrading 212 يرفض تنفيذ الأوامر كلياً بما فيها الورقية؛ أما تنفيذ الأوامر الحية فمحدود بتفويض يحدّده المستخدم (قائمة رموز مسموح بها، وحدود لحجم الأمر / الانكشاف، وحد يومي للصفقات، ومفتاح إيقاف فوري) ولا يحتفظ الموصّل بأي أموال — الوسيط هو من ينفّذ. تبقى أدوات تنفيذ الأوامر خارج MCP (عبر agent + CLI فقط). ومسارات البحث / الاختبار الرجعي محظورة بنيوياً من أي نقطة نهاية حية.@@ -495,6 +496,7 @@ LONGBRIDGE_ACCESS_TOKEN=...| **Alpaca** | US | قراءة + ورقي + تداول حي محدود (+ وضع عزل الاعتماد TAP) || **OKX** · **Binance** | crypto | قراءة + ورقي + تداول حي محدود || **Futu** | HK / US / A | قراءة + ورقي + تداول حي محدود |+| **eToro** | global | قراءة + ورقي + تداول حي محدود (Public API؛ مفاتيح demo لا تصل بنيويًا إلا إلى مسارات `/demo`، مع دعم تدفقات التداول بالنسخ) || **MetaTrader 5** | forex / CFD | قراءة + ورقي + تداول حي محدود (بأسلوب Exness؛ حارس هوية demo ⇔ paper) || **Longbridge** · **Dhan** · **Shoonya** | US / HK · الهند (NSE/BSE) | قراءة + ورقي فقط — لا يوجد مُميِّز وقت-تشغيل بين paper/live، لذا يُرفض تنفيذ الأوامر الحية بشكل صارم || **Trading 212** | UK / EU | قراءة فقط بالكامل — تَرفض `place_order` / `cancel_order` حتى الورقي بشكل صارم |@@ -568,6 +570,78 @@ LONGBRIDGE_ACCESS_TOKEN=...</details>+<details>+<summary><b>Quant Library</b> <sub>265 دالة مختبَرة عبر 19 وحدة، قابلة للاستدعاء من كل المسارات</sub></summary>++يحتفظ `src/quantlib` بتنفيذ مختبَر **واحد فقط** لكل قطعة من الرياضيات المالية التي+يحتاجها الـ agent. صارت الـ skills **تستورد** هذه الدوال بدلاً من حمل الصيغ داخل كتل+شيفرة في markdown — فإن وجدت صيغة تسعير تعيش داخل `SKILL.md` فتلك علة، لا نمط.++| الوحدة | ما تغطّيه |+|--------|-----------|+| `options` | تسعير Black-Scholes + greeks، وعكس التقلب الضمني |+| `fixedincome` | رياضيات السندات، ومواءمة منحنى Nelson-Siegel / Svensson |+| `credit` | Altman Z-score، ومسافة التعثّر Merton / KMV |+| `timeseries` | السكون، والتكامل المشترك، وGARCH، وbootstrap |+| `risk` · `var_backtest` | VaR / CVaR / EVT واختباراتها الرجعية |+| `attribution` | تفكيك Brinson-Fachler |+| `performance` · `fundmath` | TWR / MWR / Modified Dietz؛ XIRR / MOIC / DPI / TVPI |+| `factormodel` · `eventstudy` | انحدارات العوامل، ودراسات الأحداث |+| `multipletesting` · `crossvalidation` | ضبط الدلالة المتعددة، وpurged CV |+| `impact` | نماذج أثر السوق |++تصل الأداة `quantlib_call` للقراءة فقط إلى كل ذلك عبر عقد واحد، فتعمل الرياضيات المالية+على CLI وWeb UI وREST API وMCP حيث يكون `bash` مُقفلاً. وهي بنيوياً **ليست** shell — قائمة وحدات+مسموحة، وإرسال عبر `__all__` فقط، ورفض `export_*`. يحتاج جانب الاقتصاد القياسي إضافة+`stats` (`pip install "vibe-trading-ai[stats]"`)، وتستورد تلك الدوال بتكاسل وتسمّي الناقص.++</details>++<details>+<summary><b>التقييم والبحث المؤسسي</b> <sub>DCF ونظائر وثلاث قوائم مترابطة، وستة أوامر بحثية</sub></summary>++محرك تقييم يرفض اختلاق مدخلاته. القاعدة الوحيدة في `contracts.py`: **المدخل الناقص يجعل+النموذج غير قابل للتشغيل (NOT RUNNABLE) ولا يُملأ ضمنياً بقيمة افتراضية** — فكل قيمة+افتراضية في نموذج تقييم هي رأي يرتدي ثوب ثابت.++| النموذج | سلوك يستحق المعرفة |+|---------|--------------------|+| `run_dcf` | جسر FCFF، وبناء WACC، والخصم منتصف السنة، وجسر صافي الدين، وشبكة حساسية WACC×g. قيمة نهائية مزدوجة: كل طريقة تُراجَع مقابل المضاعف الضمني ومعدل النمو الضمني للأخرى |+| `run_comps` | جسر EV، وتقويم LTM + السنة التقويمية، ومصفوفة المضاعفات. النظير ذو المقام غير الموجب **يُستبعد ويُبلَّغ عنه**، ولا يُدمج أبداً كمضاعف سالب في المتوسط |+| `threestatement` | إسقاط مترابط مع تأكيد توازن صارم، وسدّ ائتماني صريح، ودورة فائدة↔دين تكرارية يجب أن تتقارب وإلا رفعت خطأ |++تُجزّأ المخرجات بتجزئة المدخلات وتُدار بالإصدارات، مع تصدير xlsx / pptx.++تقود ستة أوامر مائلة سير العمل — `/comps` `/dcf` `/attrib` `/memo` `/earnings` `/screen`+— يحمل كل منها هيكل خطوات ومثالاً محلولاً **متسقاً حسابياً** (تفكيك Brinson يُجمَع بدقة+إلى العائد النشط، وجسر الأرباح يُجمَع بدقة إلى فرق EPS). وتُكدّس skill `investor-lenses`+أطر تفكير مستثمرين معروفين كطبقات تحليل: كل عدسة هي إجراء تشغيلي — إشارات أولوية، وشروط+استبعاد، وسوء استخدام شائع — لا سيرة ذاتية، ولا تسمّي أي أداة.++وخارج الأشرطة، يستوعب `src/entities` تدفقات نقدية بتواريخ غير منتظمة (صافي قيمة الأصول،+ونداءات رأس المال، والكوبونات)، ويقدّم `cashflow_performance` فوقها XIRR / MOIC / DPI /+TVPI / TWR / Modified Dietz / MWR. هذا المسار موازٍ عن قصد لمحركات الأشرطة، حتى لا يصل+عمود `nav` إلى أحدها فيُسعَّر كإغلاق.++</details>++<details>+<summary><b>الحوكمة وأثر التدقيق</b> <sub>الإجابة عن: «أي منهجية أنتجت ذلك الرقم؟»</sub></summary>++يكتب كل تشغيل **manifest** يجزّئ الموجّه ومحتوى الـ skills وسجل الأدوات وإصدارات الحزم،+فيبقى رقم أُنتج قبل شهر قابلاً للتتبّع إلى المنهجية الدقيقة التي أنتجته.++ويربط **سجل التدقيق** كل قيد بتجزئة سابقه ويُجري fsync، فيصبح تعديل قيد أو حذفه قابلاً+للكشف — وحتى التعديل الذي يعيد حساب تجزئته يُضبَط عند القيد التالي عبر+`prev_hash_mismatch`. الطوابع الزمنية يوفّرها المتصل دائماً؛ ولا تستدعي أي وحدة هنا+`datetime.now()`.++وتنقيح التتبّع **حسب المصرف (sink)**: وسائط استدعاء الأدوات وسجل التدقيق الحي تستخدم+مصرفاً fail-closed يبقى فيه `content` منقّحاً، بينما يُفرج مصرف نتائج الأدوات عنه ويغسل+أوراقه النصية بالأنماط. ولا يُفرَج عن `env` في أيٍّ منهما.++</details>+## 🎬 العرض التوضيحي<div align="center">@@ -735,6 +809,7 @@ npx clawhub@latest install vibe-trading --force| `VIBE_TRADING_ALLOWED_RUN_ROOTS` | لا | جذور إضافية مفصولة بفواصل لأدلة تشغيل الكود المولد || `VIBE_TW_STOCK_DB` | لا | مسار لقطة SQLite لسوق تايوان؛ تُسجَّل أداة `taiwan_stock_data` للقراءة فقط عندما يكون المخطط صالحًا || `VIBE_TRADING_EXTRA_CORS_ORIGINS` | لا | أصول **تُضاف** إلى إعدادات CORS الافتراضية للحلقة المحلية، مفصولة بفواصل (بينما `CORS_ORIGINS` تستبدلها) |+| `CONTENT_FILTER_WARNING_THRESHOLD` | لا | عتبة نسبة التحذير من مرشّح المحتوى (الافتراضي 0.05 = 5%). عندما تتجاوز نسبة استجابات النموذج المحجوبة بالإشراف على المحتوى هذه القيمة، تُنبّهك بطاقة التشغيل إلى تبديل المزوّد. |<sub>* لا يحتاج Ollama إلى مفتاح API. يستخدم OpenAI Codex ChatGPT OAuth ويخزن الرموز عبر `oauth-cli-kit`، لا داخل `agent/.env`.</sub>@@ -1060,7 +1135,7 @@ curl -X POST http://localhost:8899/scheduled-runs/playbooks/premarket-brief \## 🔌 MCP Plugin-يعرض Vibe-Trading 64 أداة MCP لأي عميل متوافق مع MCP. يعمل كعملية stdio فرعية، دون إعداد خادم. أدوات البحث الأساسية تعمل دون أي مفاتيح API لأسواق HK/US/crypto؛ وأدوات connector للتداول تستخدم profile الموصل المختار، ويحتاج `run_swarm` وحده إلى مفتاح LLM.+يعرض Vibe-Trading 70 أداة MCP لأي عميل متوافق مع MCP. يعمل كعملية stdio فرعية، دون إعداد خادم. أدوات البحث الأساسية تعمل دون أي مفاتيح API لأسواق HK/US/crypto؛ وأدوات connector للتداول تستخدم profile الموصل المختار، ويحتاج `run_swarm` وحده إلى مفتاح LLM.**متغيرات البيئة:** العميل هو من يشغّل الخادم بنفسه، لذا لا يصل إليه `export` من الـ shell أبداً —— اضبطها في كتلة `env` الخاصة بالعميل. كود الاختبار الخلفي المولَّد محصور ضمن جذور التشغيل المسموح بها، لذا تحتاج إلى `VIBE_TRADING_ALLOWED_RUN_ROOTS` لكتابة النتائج في دليل عمل خاص بك:@@ -1116,7 +1191,7 @@ vibe-trading-mcp --transport sse # legacy SSE (deprecated)</details>-**أدوات MCP المعروضة (64):** `list_skills`, `load_skill`, `start_research_goal`, `get_research_goal`, `add_goal_evidence`, `update_research_goal_status`, `backtest`, `factor_analysis`, `alpha_zoo`, `alpha_bench`, `analyze_options`, `analyze_options_payoff`, `pattern_recognition`, `read_url`, `read_document`, `web_search`, `write_file`, `read_file`, `trading_connections`, `trading_select_connection`, `trading_check`, `trading_account`, `trading_positions`, `trading_orders`, `trading_quote`, `trading_history`, `list_swarm_presets`, `run_swarm`, `get_market_data`, `get_fund_flow`, `get_dragon_tiger`, `get_northbound_flow`, `get_margin_trading`, `get_block_trades`, `get_shareholder_count`, `get_lockup_expiry`, `get_sector_info`, `get_research_reports`, `get_stock_news`, `get_sec_filings`, `get_financial_statements`, `get_options_chain`, `get_stock_profile`, `screen_market`, `search_symbol`, `get_macro_series`, `iwencai_search`, `qveris_search`, `qveris_inspect`, `qveris_execute`, `get_institutional_holdings`, `etf_holdings`, `prediction_market`, `research_papers`, `get_swarm_status`, `get_run_result`, `list_runs`, `reap_stale_runs`, `retry_run`, `analyze_trade_journal`, `extract_shadow_strategy`, `run_shadow_backtest`, `render_shadow_report`, `scan_shadow_signals`.+**أدوات MCP المعروضة (70):** `list_skills`, `load_skill`, `start_research_goal`, `get_research_goal`, `add_goal_evidence`, `update_research_goal_status`, `backtest`, `factor_analysis`, `alpha_zoo`, `alpha_bench`, `analyze_options`, `analyze_options_payoff`, `pattern_recognition`, `read_url`, `read_document`, `web_search`, `write_file`, `read_file`, `trading_connections`, `trading_select_connection`, `trading_check`, `trading_account`, `trading_positions`, `trading_orders`, `trading_quote`, `trading_history`, `list_swarm_presets`, `run_swarm`, `get_market_data`, `get_fund_flow`, `get_dragon_tiger`, `get_northbound_flow`, `get_margin_trading`, `get_block_trades`, `get_shareholder_count`, `get_lockup_expiry`, `get_sector_info`, `get_research_reports`, `get_stock_news`, `get_sec_filings`, `get_financial_statements`, `get_options_chain`, `get_stock_profile`, `screen_market`, `search_symbol`, `get_macro_series`, `iwencai_search`, `qveris_search`, `qveris_inspect`, `qveris_execute`, `get_institutional_holdings`, `etf_holdings`, `prediction_market`, `research_papers`, `get_swarm_status`, `get_run_result`, `list_runs`, `reap_stale_runs`, `retry_run`, `analyze_trade_journal`, `extract_shadow_strategy`, `run_shadow_backtest`, `render_shadow_report`, `scan_shadow_signals`, `quantlib_call`, `cashflow_performance`, `orderbook_depth`, `sentiment`, `technical_indicators`, `get_fundamentals`.### أدوات MCP الخارجية في SWARM@@ -1210,6 +1285,45 @@ vibe-trading connector history EURUSD---+## 🔌 موصّل eToro Public API++يتصل بـ [eToro Public API](https://builders.etoro.com/) لحسابات التجربة والحسابات الحقيقية عبر زوج مفاتيح (`x-api-key` + `x-user-key`). بيئتا التجربة والحقيقة مفصولتان **بنيويًا**: مفاتيح التجربة لا تصل إلا إلى مسارات `/demo`.++اضبط `~/.vibe-trading/etoro.json` (أنشئه بنفسك، مع `chmod 600` حيثما يُدعم):++```json+{+ "api_key": "YOUR_PUBLIC_API_KEY",+ "user_key": "YOUR_USER_KEY",+ "profile": "paper"+}+```++بدلاً من ذلك يمكنك ضبط `ETORO_API_KEY` و`ETORO_USER_KEY` في `~/.vibe-trading/.env`.++ثم:++```bash+vibe-trading connector use etoro-paper-sdk+vibe-trading connector check+vibe-trading connector account+vibe-trading connector positions+vibe-trading connector quote BTC+```++| الملف التعريفي | الحساب | الأوامر |+|----------------|--------|---------|+| `etoro-paper-sdk` | تجربة | قراءة فقط |+| `etoro-live-sdk-readonly` | حقيقي | قراءة فقط |+| `etoro-paper-trade` | تجربة | إرسال مباشر على مسارات التجربة |+| `etoro-live-trade` | حقيقي | مُقيَّد بالتفويض ومفتاح الإيقاف |++يستخدم البحث عن الرموز خاصية `internalSymbolFull` في eToro (مثلاً `BTC` ← معرّف الأداة `100000`). استخدم أداة الوكيل `etoro_search_instruments` لحل الرموز قبل التداول.++حدود الأمان: التجربة والحقيقة مفصولتان بالمسار ومقيّدتان بالمفتاح (`paper_guard: path_separated_key_bound`). الإجراءات الحقيقية التي تزيد المخاطر (الفتح وبدء/زيادة النسخ) تتطلب تفويضًا مُصرَّحًا به، وحالة إيقاف صافية، وحسابًا بالدولار مُتحقَّقًا منه لفرض القيمة الاسمية للنسخ. أما الإغلاق الكامل والجزئي المُتحقَّق منه، وإلغاء الأوامر المعلّقة، وإنهاء النسخ فتبقى متاحة أثناء الإيقاف وتُسجَّل في سجل التدقيق. إلغاء إغلاق معلّق وتعديل وقف الخسارة للمركز عمليتان **للتجربة فقط**: المسار الحقيقي يفشل مغلقًا لأنهما قد يزيدان الانكشاف أو ينقلان هامشًا إضافيًا دون بيانات API كافية لقياس المخاطر الدولارية الإضافية. مبالغ النسخ مُقوَّمة بعملة حساب eToro، ويتطلب كل بدء/تعديل نسخ معرّفًا مرجعيًا آمنًا للروابط من 1 إلى 35 حرفًا يوفّره المتصل من أجل الاستعلام. أدوات الكتابة الخاصة بـ eToro (`etoro_close_position` و`etoro_copy_*` وغيرها) هي **أدوات وكيل فقط** — غير مُعرَّضة عبر MCP أو CLI. التراجع: أعِد إلغاء التزامات الموصّل أو عطّل الملفات التعريفية؛ ويمنع الإيقاف أي إجراء حقيقي جديد يزيد المخاطر.++---+## 🔌 تحميل الأدوات من خوادم MCP خارجية (وضع MCP Client)> **هذا هو الاتجاه المعاكس لقسم MCP Plugin أعلاه.**@@ -1437,7 +1551,7 @@ Vibe-Trading/├── agent/ # Backend (Python)│ ├── cli/ # CLI package — interactive TUI + subcommands│ ├── api_server.py # FastAPI server — runs, sessions, upload, swarm, SSE-│ ├── mcp_server.py # MCP server — 64 tools for OpenClaw / Claude Desktop+│ ├── mcp_server.py # MCP server — 70 tools for OpenClaw / Claude Desktop│ ││ ├── src/│ │ ├── agent/ # ReAct agent core@@ -1452,7 +1566,7 @@ Vibe-Trading/│ │ ├── memory/ # Cross-session persistent memory│ │ │ └── persistent.py # file-based memory (~/.vibe-trading/memory/)│ │ │-│ │ ├── tools/ # 68 auto-discovered agent tools+│ │ ├── tools/ # 94 auto-discovered agent tools│ │ │ ├── backtest_tool.py # run backtests│ │ │ ├── remember_tool.py # cross-session memory (save/recall/forget)│ │ │ ├── skill_writer_tool.py # skill CRUD (save/patch/delete/file)@@ -1566,7 +1680,38 @@ Vibe-Trading جزء من نظام وكلاء **[HKUDS](https://github.com/HKUDS)شكراً لكل من ساهم في Vibe-Trading!-مساهمو واعتمادات دورة v0.1.12 الأخيرة:+مساهمو واعتمادات دورة v0.1.13 الأخيرة:++- @santhreal — a 17-PR correctness and resource-leak sweep: the HTTP throttle now sweeps stale buckets interval-aware so rate-limit spacing survives (#1047), the rate limiter stops growing without bound on unique client IPs (#1039), the event bus notifies and removes subscribers on clear (#1046), `_json_loads` is guarded against corrupted JSON in database columns (#1045), NaN/inf volume and close no longer crash `format_grounding_block` (#1043), `inf` from `pct_change` on zero equity is replaced (#1041), Shoonya tolerates empty-string numerics (#1038), drawdown is computed from the absolute peak on negative equity (#958) and insolvent empty cross accounts are marked liquidated (#959), plus exact memory index anchors (#956/#957) and an A-share code / trade-journal parsing batch (#919, #926–#935)+- @shadowinlife — HK market-data fallback routing repaired with a new Tencent HK source (#1000), Shadow multi-market backtests split per settlement currency (#997), bare US tickers routed to `us_equity` (#994), MCP list/dict arguments tolerating JSON-string clients (#993), generated signal engines passing the backtest sandbox validator (#992), and the memory GC dry-run fix (#973)+- @honginp — the USD-M perpetual lifecycle end to end: funding and liquidation execution (#903), isolated & cross margin liquidation modelling (#889), ordered fidelity evidence persistence (#936), atomic position rebalancing (#951), and strict historical position rebalancing that preserves collateral, funding, fees and fill evidence (#1019)+- @QCYTSN — the desktop Electron shell lifecycle (#923), Windows packaging with a checksum-pinned embedded runtime and `safeStorage` credential handling (#1015), and Settings model discovery + runtime identity UX (#924)+- @Robin1987China — the `technical_indicators` (#921) and `sentiment` (#939) tools, annualisation entries for 15 data sources with a CI coverage gate (#891), indicator inputs read without sampling (#1005), and the `quant_strategy_desk` final report aggregator (#1048)+- @Shizoqua — MCP specs cache keyed on remote server identity (#1049), memory FTS5 ranking with importance decay (#1032), swarm detection of `ok`/`success:false` tool failures (#1028), and lowercase `4h` resampling in the yfinance loader (#1013)+- @ngoanpv — timezone-aware scheduled research (#954, closes #953), one malformed record no longer breaking the whole store (#1003), interval creates without a resolvable zone (#1004), and delete-route job id validation (#980)+- @he-yufeng — risk x-ray artifacts in portfolio runs (#900), Portfolio Studio artifacts surfaced in run detail (#966), yfinance crypto routed to the crypto engine (#970), and hierarchy-routed memory entries keeping their `.md` extension (#984)+- @wiliao — Canadian markets end to end: TSX/TSXV market data (#1024) and symbol support through search fail-fast and CSV grounding (#1037)+- @MuggleJinx — session and run history stored under the user runtime root (#925, closes #904) and `~/.vibe-trading/.env` loaded on the connector command path (#902, closes #901)+- @cgycorey — Alpha Zoo tools reaching MCP (#979) and mapping-shaped Responses stream events accepted (#1034)+- @ofeksh-tr — the eToro Public API connector with path-separated demo/real profiles (#989) — broker connectors 12 → **13**+- @su322 — source message ids threaded into IM outbound so QQ replies stay passive (#1008), and the output principle that stops the agent once evidence is sufficient (#1010)+- @zwrong — the `vibe-trading update` self-upgrade command (#1020)+- @yrk111222 — ModelScope as an OpenAI-compatible provider (#1011)+- @x-lambda — agent proxy opt-out covering sync and async clients (#995)+- @dineeshd — authenticated API capability surfaces under enforced CSP (#961)+- @hhj123123 — the canonical run root preserved after HOME isolation (#1012)+- @00EVA — the Settings model dropdown auto-resizing so long provider/model slugs stay readable (#1006)+- @darkknight4563 — `bar_returns` kept bit-identical for gapped positive series (#895)+- @sambazhu — mootdx config pre-seeded in the sandbox home (#982)+- @yagnikpipaliya — self-healing for Claude models that deprecate the `temperature` field (#890, closes #856)+- @JungHoonGhae — the Korea equity (KRX) market engine (#693)+- @shugaoye — the OpenBB Workspace bridge (#817)+- @TSENGCHIENFENG — the read-only Taiwan snapshot tool (#848)+- @ddy4633, @tyj147454413-cmd, @y85998607, @klmtseng, @ebujinovch, @g0rdonL, @AmirF194, @Echoandelementwebsites, @dvirarad, @1anter — correlation, loader, vn.py-export, PIT-fundamentals and alpha-bench fixes carried into this cycle+- @warren618 / Haozhe Wu — the finance-math layer and valuation engine, the entity + cash-flow spine, run manifests and the hash-chained audit ledger, the four read-only data tools, the institutional commands and investor lenses, the grounding-gate repair, the analytic options payoff tool (#946), Codex OAuth recovery (#1014), the Shadow runtime root fix (#1017), release integration and open-PR/issue triage++<details>+<summary>مساهمو دورة v0.1.12</summary>- @santhreal — جولة تصحيح واسعة عبر 30 PR: تقوية strict-JSON / الأرقام المنتهية عبر المقاييس والعوامل والأنماط والخيارات (#764/#765/#766/#767/#739/#740/#744)، وصحّة المحمّل (#761 شموع yahoo بدقّة 1m)، ومتانة الجلسة / السجل (#762/#763/#768/#769/#770)- @xkam7ar — موثوقية واسعة عبر التحزيم والويب والمجدول والـ swarm والـ CLI (#584)، والإلغاء قبل أول تكرار لـ AgentLoop (#641، يغلق #638)، وميزانية جلسة QVeris + محاسبة أرصدة ذرّية (#685/#686)، وبوابات CI / OOS (#630/#632)، وإصلاحات مرشّح شهر السجل / تحليل الاتجاه (#626/#628)@@ -1597,6 +1742,8 @@ Vibe-Trading جزء من نظام وكلاء **[HKUDS](https://github.com/HKUDS)- @GabbaTauchi — أبلغ عن خلل البثّ الأصلي / base-URL في zai (#758)- @warren618 / Haozhe Wu — تكامل خلفية نظام الارتباط، وإصلاح بثّ مزوّد zai + حسم base-URL (#758)، وتكامل الإصدار، وفرز الـ PR/issue المفتوحة+</details>+<details><summary>مساهمو دورة v0.1.11</summary>diff --git a/README_ja.md b/README_ja.mdindex eb550b19c..5bd1665b7 100644--- a/README_ja.md+++ b/README_ja.md@@ -52,13 +52,14 @@> ⚠️ **セキュリティ警告:** Xアカウント `VibeTrading_HKU`、Virtualsプロジェクト `101845`、およびトークンコントラクト `0x640BDBF77b6447E8b7DB7894cED84BD1c40571f4` は、いずれもVibe-Trading公式のものではありません。Vibe-Tradingはこれまで、いかなるトークンやミームコインも発行・公認していません。購入、ウォレットの接続、署名は行わないでください。[詳細](SECURITY.md#official-channels--impersonation)+- **2026-08-10** 🚀 **v0.1.13 リリース**([リリースノート](https://github.com/HKUDS/Vibe-Trading/releases/tag/v0.1.13)、`pip install -U vibe-trading-ai`):0.1.12 以降 408 コミット・162 件のマージ済み PR で、これまでで最大のリリースです。**主役は新機能ではなく修正です:identity ゲートが、すでに証拠を持っている回答を拒否しなくなりました。**以前は整った質問でも実際のツール呼び出しに数分を費やしたうえで*「銘柄の同一性または価格の根拠を安全に確認できません」*と返っていました。原因は、`.SS` と `.SH` が別銘柄として扱われ**上海の銘柄コードがすべて恒久的に ambiguous** になっていたこと、失敗した傍系クエリがロック済みの identity を降格できたこと、Yahoo が CJK クエリすべてに HTTP 400 を返すのを「ここには上場していない」ではなくデータソースの*失敗*として記録していたこと、ツールごとのハードコードされた許可リストがドキュメント記載の 17 通りの引数表記のうち 11 通りを弾いていたこと、日本語・中国語の回答が ASCII のローダー名ではなく `雅虎` や `元` と書いたために拒否されたこと、そして桁区切りが `¥1,309.22` を分断し `1` が観測レンジと比較されていたことです。概念的な質問や比較レポートも行き止まりになりません。記録された OHLC の根拠を外れた価格は**引き続き拒否されます**。**新機能:** `src/quantlib` —— 17 モジュール・249 個のテスト済み関数(オプション、債券、クレジット、計量経済、VaR/CVaR/EVT、要因分解、イベントスタディ、purged CV)を読み取り専用の `quantlib_call` 経由で CLI・Web UI・REST API・MCP から利用でき、skill は markdown に数式を抱え込まず import するようになりました。**バリュエーションエンジン**(`run_dcf` / `run_comps` / 三表連動)は、入力が欠ければ黙ってデフォルトを埋めるのではなくモデルを実行不能にします。**エンティティ + 不規則キャッシュフローの背骨**(XIRR / MOIC / DPI / TVPI、`cashflow_performance` 経由の TWR / Modified Dietz)はバーエンジンとあえて並行に保たれています。**ガバナンスが全実行に組み込まれ**、プロンプト・skill・ツールレジストリ・パッケージバージョンのハッシュ manifest と、自分のハッシュを再計算した改変でも次のレコードで捕捉されるハッシュ連鎖 + fsync の監査台帳が入りました。無料の公開ソースに基づく読み取り専用データツールが 4 つ(四半期比の持高差分付き **SEC 13F**、CSI300 連動 ETF が四半期上位 10 銘柄ではなく純資産の 98.66% にあたる 342 銘柄まで解決する**ETF ルックスルー**、ラベル付き含意確率としての**予測市場**、出典に紐づく主張のみを抜く **arXiv/OpenAlex**)。さらに 6 つの機関投資家向けコマンド(`/comps` `/dcf` `/attrib` `/memo` `/earnings` `/screen`)、独立 skill 化した investor lenses、5 つのスケジュール可能なリサーチ playbook、チェックサム固定の Windows パッケージングと `safeStorage` を備えた**デスクトップ Electron シェル**、13 番目のブローカーコネクタ **eToro**、9 番目のバックテストエンジン **韓国 (KRX)**、**OpenBB Workspace ブリッジ**、カナダ株のエンドツーエンド対応、そして `sentiment`・`technical_indicators`・`options_payoff`・`orderbook_depth`・ModelScope・`vibe-trading update`。**正確性:** SEC の報告期間を `(start, end)` の期間で識別するようにしました —— 年次指定が単一四半期を返しており 4.2 倍の過小評価でした。tushare の A 株価格はコーポレートアクション調整済みになり、権利落ちをまたぐ生のリターンは最大 47 パーセントポイントずれていました。`bar_returns` は売買停止を 0% の変動として記録しなくなり、年率換算は 24 のデータソースすべてを網羅します。生成コードがブローカー層を import できたり、名前を変えた束縛経由で `socket`/`subprocess` に到達できたサンドボックスの穴も塞ぎました。通貨が混在するクロスマーケットのコンポジットバックテストは、1 本のエクイティカーブに合算せず拒否します。@santhreal、@shadowinlife、@Robin1987China、@he-yufeng、@QCYTSN、@Shizoqua、@honginp、@cgycorey、@wiliao、@ngoanpv、@x-lambda、@ofeksh-tr、@00EVA、@zwrong、@yrk111222、@su322、@hhj123123、@dineeshd、@sambazhu、@ddy4633、@tyj147454413-cmd、@y85998607、@JungHoonGhae、@shugaoye、@TSENGCHIENFENG、@darkknight4563、@MuggleJinx、@klmtseng、@ebujinovch、@g0rdonL、@AmirF194、@Echoandelementwebsites、@yagnikpipaliya、@dvirarad、@1anter の皆さんに感謝します。- **2026-08-09** 🪟 **安全な Windows パッケージ、カナダ市場、ModelScope、MCP 上の Alpha Zoo**:Windows デスクトップのパッケージ処理は、checksum 固定の組み込み Python 3.12 runtime と x64 NSIS の review/signing 経路を組み立て、許可リスト内の credential を Electron `safeStorage` に保存できるようになりました。renderer は秘密を設定・消去できますが読み取れず、平文設定の移行は一度だけ、復号値は所有する backend にだけ渡ります。未署名 review build と署名 build は署名状態が違えば fail closed となり、この PR から installer artifact は公開されていません([#1015](https://github.com/HKUDS/Vibe-Trading/pull/1015))。カナダ株は end-to-end で利用可能になり、`.TO`/`.V` を CAD として分類し、Yahoo → yfinance → local の fallback で取得、カナダ固有の GlobalEquity rule で執行し、`XIC.TO` を benchmark とし、通貨混在の集計を拒否します。strict USD-M の過去 backtest でも `position_adjustment=rebalance` を opt-in でき、増減ポジションを通じて collateral、funding、fee、実現 P&L、清算挙動、不変の約定証跡を一貫させます([#1024](https://github.com/HKUDS/Vibe-Trading/pull/1024)、[#1019](https://github.com/HKUDS/Vibe-Trading/pull/1019)、[#952](https://github.com/HKUDS/Vibe-Trading/issues/952) を close)。ModelScope は公式の OpenAI-compatible hosted-inference endpoint を通じて組み込み provider に加わり、default は `Qwen/Qwen3.5-27B` です([#1011](https://github.com/HKUDS/Vibe-Trading/pull/1011))。新しい `vibe-trading update` は wheel install と editable/source checkout を区別し、確認した厳密な release を導入して、新規 process の metadata で検証し、downgrade しません([#1020](https://github.com/HKUDS/Vibe-Trading/pull/1020))。さらに `alpha_zoo` と制限付き `alpha_bench` が MCP(計 64 tools)から利用可能になり、期間・結果数・出力先を制限して report を安全に作成します([#979](https://github.com/HKUDS/Vibe-Trading/pull/979))。検証済みの Python/frontend lock 更新では grouped dependencies、`postcss`、`akshare` も更新されました([#1021](https://github.com/HKUDS/Vibe-Trading/pull/1021)、[#1023](https://github.com/HKUDS/Vibe-Trading/pull/1023)、[#1026](https://github.com/HKUDS/Vibe-Trading/pull/1026)、[#1027](https://github.com/HKUDS/Vibe-Trading/pull/1027))。貢献に感謝します:[@QCYTSN](https://github.com/QCYTSN)、[@wiliao](https://github.com/wiliao)、[@honginp](https://github.com/honginp)、[@yrk111222](https://github.com/yrk111222)、[@zwrong](https://github.com/zwrong)、[@cgycorey](https://github.com/cgycorey)。- **2026-08-08** 🧱 **デスクトップシェル、eToro、アトミック・リバランス、信頼性強化**:ソース版 Electron ホストが既存バックエンドのライフサイクルを担い、ランダムな loopback ポート、起動ごとの秘密鍵、5 言語の起動復旧、所有プロセスの後始末を提供します。eToro は demo/real を経路レベルで分離したコネクタとして加わり、実運用でリスクを増やす操作は引き続き mandate と監査のゲートを通り、API の機能エンドポイントは認証と CSP で保護されます([#923](https://github.com/HKUDS/Vibe-Trading/pull/923)、[#989](https://github.com/HKUDS/Vibe-Trading/pull/989)、[#961](https://github.com/HKUDS/Vibe-Trading/pull/961))。バックテストには不変の約定証跡を残す opt-in の同方向アトミック・リバランスを追加。Shadow は架空の FX 集計をせず決済通貨ごとに市場を分離し、設定済み runtime root に従います。指標は連続した未サンプリング履歴を使い、負の equity における drawdown と空の破産 cross account の清算境界も正しくなりました([#951](https://github.com/HKUDS/Vibe-Trading/pull/951)、[#997](https://github.com/HKUDS/Vibe-Trading/pull/997)、[#1017](https://github.com/HKUDS/Vibe-Trading/pull/1017)、[#1005](https://github.com/HKUDS/Vibe-Trading/pull/1005)、[#958](https://github.com/HKUDS/Vibe-Trading/pull/958)、[#959](https://github.com/HKUDS/Vibe-Trading/pull/959))。OpenAI Codex OAuth は独立した排他制御付き credential store と一度限りの 401 復旧を持ち、proxy 無効化は同期・非同期 client の両方に適用。sandbox run は正規の run root を保持し、定期リサーチは壊れた record を隔離して interval の timezone 検証を修正、lowercase `4h` は真の 4 時間足を返します([#1014](https://github.com/HKUDS/Vibe-Trading/pull/1014)、[#995](https://github.com/HKUDS/Vibe-Trading/pull/995)、[#1012](https://github.com/HKUDS/Vibe-Trading/pull/1012)、[#1003](https://github.com/HKUDS/Vibe-Trading/pull/1003)、[#1004](https://github.com/HKUDS/Vibe-Trading/pull/1004)、[#1013](https://github.com/HKUDS/Vibe-Trading/pull/1013))。QQ 返信は元 message ID を保持し、長い model slug は読めるまま、agent は証拠が十分なら調査を止めます([#1008](https://github.com/HKUDS/Vibe-Trading/pull/1008)、[#1006](https://github.com/HKUDS/Vibe-Trading/pull/1006)、[#1010](https://github.com/HKUDS/Vibe-Trading/pull/1010))。貢献に感謝します:[@QCYTSN](https://github.com/QCYTSN)、[@Shizoqua](https://github.com/Shizoqua)、[@ngoanpv](https://github.com/ngoanpv)、[@hhj123123](https://github.com/hhj123123)、[@su322](https://github.com/su322)、[@Robin1987China](https://github.com/Robin1987China)、[@shadowinlife](https://github.com/shadowinlife)、[@dineeshd](https://github.com/dineeshd)、[@honginp](https://github.com/honginp)、[@santhreal](https://github.com/santhreal)、[@00EVA](https://github.com/00EVA)、[@x-lambda](https://github.com/x-lambda)、[@ofeksh-tr](https://github.com/ofeksh-tr)。-- **2026-08-07** 🛡️ **誤拒否の削減、サンドボックスの穴を封鎖、QVeris を MCP へ**:グラウンディングゲートは「そもそも価格ではない数字」で整形済みの回答を拒否しなくなりました —— 確信度スコア、指標の値、移動平均の期間、`8/5` のような年なし日付、パーセント範囲、そして売買プラン自身のトリガー水準(`終値 ≥6.45` は条件であって提示値ではありません)。一方、記録された OHLC 証拠の範囲外の提示値は**引き続き拒否**され、`08-05` と書かれた価格表も証拠と突き合わせられるようになりました([#1001](https://github.com/HKUDS/Vibe-Trading/issues/1001)、[#983](https://github.com/HKUDS/Vibe-Trading/issues/983))。**サンドボックス**:生成された戦略コードはブローカー層を import できなくなり、リネームした束縛経由で `socket`/`subprocess`/`os.system`/`ctypes` に到達することもできません。いずれも従来は通っていました。戦略が使うべき `src.quantlib` は引き続き import できます。**QVeris** の discovery/inspect/execute が MCP に加わり(62 ツール)、コスト見積もりは呼び出し側の申告ではなくマーケットプレイスに問い合わせます([#976](https://github.com/HKUDS/Vibe-Trading/pull/976)、closes [#964](https://github.com/HKUDS/Vibe-Trading/issues/964)、thanks [@shadowinlife](https://github.com/HKUDS/Vibe-Trading/shadowinlife))。さらに、香港株データのフォールバック経路の修正と Tencent 香港ソースの追加、yfinance の暗号資産をクリプトエンジンへルーティング、メモリ項目の書き込みと復旧に `.md` 拡張子を付与、MCP の list/dict 引数が JSON 文字列クライアントを許容、実行詳細に Portfolio Studio 成果物を表示([#1000](https://github.com/HKUDS/Vibe-Trading/pull/1000)、[#970](https://github.com/HKUDS/Vibe-Trading/pull/970)、[#984](https://github.com/HKUDS/Vibe-Trading/pull/984)、[#993](https://github.com/HKUDS/Vibe-Trading/pull/993)、[#980](https://github.com/HKUDS/Vibe-Trading/pull/980)、[#982](https://github.com/HKUDS/Vibe-Trading/pull/982)、[#966](https://github.com/HKUDS/Vibe-Trading/pull/966)、[#973](https://github.com/HKUDS/Vibe-Trading/pull/973)、thanks [@he-yufeng](https://github.com/HKUDS/Vibe-Trading/he-yufeng)、[@ngoanpv](https://github.com/HKUDS/Vibe-Trading/ngoanpv)、[@sambazhu](https://github.com/HKUDS/Vibe-Trading/sambazhu))。<details><summary>過去のニュース</summary>-- **2026-08-06** 🧮 **テスト済み金融数学レイヤー + バリュエーションエンジン + 不定期キャッシュフロー + 配線済みガバナンス**:`src/quantlib` は skills の markdown に散在していた数式を、それぞれ唯一のテスト済み実装に置き換えました —— オプション、債券、クレジット、計量経済、VaR/CVaR/EVT、パフォーマンス要因分析、イベントスタディ、多重検定制御、purged クロスバリデーション —— 約 250 関数が、新しい読み取り専用ツール `quantlib_call` を通じて Web/API/MCP から利用できます。バリュエーションエンジン(`run_dcf`/`run_comps`/三表連動)は入力が欠けていればデフォルト値で埋めずに「実行不能」と判定します。新しいエンティティ + キャッシュフロー基盤により NAV・キャピタルコール・クーポンが扱えるようになりました(`cashflow_performance` が XIRR/MOIC/DPI/TVPI と TWR/Modified Dietz を、`orderbook_depth` が暗号資産 L2 のインパクトコストを提供)。各実行はハッシュ manifest を書き出し、監査台帳はハッシュチェーンで改ざんを検出可能に。30 の swarm プリセットはツールが実際に計算できる内容と照合して総点検され、計算できない成果物は数値をでっち上げる代わりにその旨を明示します。+- **2026-08-07** 🛡️ **誤拒否の削減、サンドボックスの穴を封鎖、QVeris を MCP へ**:グラウンディングゲートは「そもそも価格ではない数字」で整形済みの回答を拒否しなくなりました —— 確信度スコア、指標の値、移動平均の期間、`8/5` のような年なし日付、パーセント範囲、そして売買プラン自身のトリガー水準(`終値 ≥6.45` は条件であって提示値ではありません)。一方、記録された OHLC 証拠の範囲外の提示値は**引き続き拒否**され、`08-05` と書かれた価格表も証拠と突き合わせられるようになりました([#1001](https://github.com/HKUDS/Vibe-Trading/issues/1001)、[#983](https://github.com/HKUDS/Vibe-Trading/issues/983))。**サンドボックス**:生成された戦略コードはブローカー層を import できなくなり、リネームした束縛経由で `socket`/`subprocess`/`os.system`/`ctypes` に到達することもできません。いずれも従来は通っていました。戦略が使うべき `src.quantlib` は引き続き import できます。**QVeris** の discovery/inspect/execute が MCP に加わり(62 ツール)、コスト見積もりは呼び出し側の申告ではなくマーケットプレイスに問い合わせます([#976](https://github.com/HKUDS/Vibe-Trading/pull/976)、closes [#964](https://github.com/HKUDS/Vibe-Trading/issues/964)、thanks [@shadowinlife](https://github.com/HKUDS/Vibe-Trading/shadowinlife))。さらに、香港株データのフォールバック経路の修正と Tencent 香港ソースの追加、yfinance の暗号資産をクリプトエンジンへルーティング、メモリ項目の書き込みと復旧に `.md` 拡張子を付与、MCP の list/dict 引数が JSON 文字列クライアントを許容、実行詳細に Portfolio Studio 成果物を表示([#1000](https://github.com/HKUDS/Vibe-Trading/pull/1000)、[#970](https://github.com/HKUDS/Vibe-Trading/pull/970)、[#984](https://github.com/HKUDS/Vibe-Trading/pull/984)、[#993](https://github.com/HKUDS/Vibe-Trading/pull/993)、[#980](https://github.com/HKUDS/Vibe-Trading/pull/980)、[#982](https://github.com/HKUDS/Vibe-Trading/pull/982)、[#966](https://github.com/HKUDS/Vibe-Trading/pull/966)、[#973](https://github.com/HKUDS/Vibe-Trading/pull/973)、thanks [@he-yufeng](https://github.com/HKUDS/Vibe-Trading/he-yufeng)、[@ngoanpv](https://github.com/HKUDS/Vibe-Trading/ngoanpv)、[@sambazhu](https://github.com/HKUDS/Vibe-Trading/sambazhu))。+- **2026-08-06** 🧮 **テスト済み金融数学レイヤー + バリュエーションエンジン + 不定期キャッシュフロー + 配線済みガバナンス**:`src/quantlib` は skills の markdown に散在していた数式を、それぞれ唯一のテスト済み実装に置き換えました —— オプション、債券、クレジット、計量経済、VaR/CVaR/EVT、パフォーマンス要因分析、イベントスタディ、多重検定制御、purged クロスバリデーション —— 約 250 関数が、新しい読み取り専用ツール `quantlib_call` を通じて CLI・Web UI・REST API・MCP から利用できます。バリュエーションエンジン(`run_dcf`/`run_comps`/三表連動)は入力が欠けていればデフォルト値で埋めずに「実行不能」と判定します。新しいエンティティ + キャッシュフロー基盤により NAV・キャピタルコール・クーポンが扱えるようになりました(`cashflow_performance` が XIRR/MOIC/DPI/TVPI と TWR/Modified Dietz を、`orderbook_depth` が暗号資産 L2 のインパクトコストを提供)。各実行はハッシュ manifest を書き出し、監査台帳はハッシュチェーンで改ざんを検出可能に。30 の swarm プリセットはツールが実際に計算できる内容と照合して総点検され、計算できない成果物は数値をでっち上げる代わりにその旨を明示します。- **2026-08-05** 🔭 **機関投資家保有、ETF ルックスルー、予測市場、論文検索**:無料の公開データのみを使う読み取り専用ツールが 4 つ —— SEC 13F 保有(四半期比の増減付き)、市場をまたぐ ETF 構成銘柄(CSI300 連動型は四半期開示の上位 10 ではなく 342 銘柄・純資産の 98.7% を返します)、イベント契約を単位付きの含意確率として提示、arXiv/OpenAlex 検索は原典にない値を推測せず「記載なし」と印を付けます。あわせて、定期リサーチのテンプレート 5 本、機関投資家向けコマンド 6 つ(`/comps` `/dcf` `/attrib` `/memo` `/earnings` `/screen`)、独立した skill としての investor lenses、そしてすべての数値を生成元のツールまで辿れる agent core。- **2026-08-04** 🔧 **正確性の修正:ファンダメンタルズ、A 株価格、長すぎるツール結果**:SEC の報告期間は `(start, end)` の期間で識別するようになりました。10-Q は同じ期末日・同じ会計四半期の下に真の四半期と年初来フレームの両方を提出するため、`period="annual"` は AAPL の FY2018〜2020 で単一四半期を返しており(4.2 倍の過少計上)、四半期系列の第 4 四半期の枠にはすべて通年の数値が入っていました。`get_fundamentals("AAPL.US")` も `ok:true` と全 null のパネルを返さなくなります。Tushare の A 株価格はファクターベンチとバックテストの両方で権利落ち調整されるようになり(権利落ち日をまたぐ生の終値騰落率は最大 47 パーセントポイントずれていました。300750.SZ、2023-04-26)、CSI300 ベンチは各日付をその時点の指数構成銘柄でマスクします。クロスマーケットのコンポジットバックテストは、CNY・USD・KRW を 1 本の資産曲線に合算する代わりに、通貨が混在する銘柄セットを拒否します。オプションの各レグは建玉時のボラティリティで評価され、プレミアム比 +93% にも達していた初日の架空損益が解消されました。長すぎるツール結果は JSON の途中で切られる代わりに、総数を明示してレコード単位でページングされます。`calc_metrics` はトラッキングエラーとベンチマークベータを返します。- **2026-08-03** ⏰ **タイムゾーン対応のスケジュール実行 + 銘柄スクリーニングのデッドロック解消**:スケジュールジョブに任意の IANA `timezone` を指定でき、cron はそのゾーンの壁時計で評価されるため、夏時間の切替をまたいでも周期が保たれます(春の存在しない時刻はスキップ、秋の重複する時刻は最初の 1 回だけ実行)。cron の各フィールドはカンマ区切りと範囲(`1,3-5`)に対応し、タイムゾーン未設定のジョブは従来どおり UTC で動作、Web UI にも 5 言語対応の **Scheduled** ページが追加されました(従来フロントエンドにはスケジュール画面が存在しませんでした)([#954](https://github.com/HKUDS/Vibe-Trading/pull/954)、closes [#953](https://github.com/HKUDS/Vibe-Trading/issues/953)、[@ngoanpv](https://github.com/ngoanpv) に感謝)。スクリーニング要求が行き止まりにならなくなりました。多数の候補を含む絞り込み結果は「未解決」ではなく「回答」として扱われ、個別銘柄が確定した時点で役目を終えます。価格チェックは銘柄コードの数字・ローカライズされた日付・株数・建玉コストを価格として読まなくなりましたが、記録済み OHLC の範囲外の価格は従来どおり拒否します(closes [#955](https://github.com/HKUDS/Vibe-Trading/issues/955))。Agent メモリのインデックスアンカー厳密一致と件数上限の修正も含みます([#956](https://github.com/HKUDS/Vibe-Trading/pull/956)、[#957](https://github.com/HKUDS/Vibe-Trading/pull/957)、[@santhreal](https://github.com/santhreal) に感謝)。@@ -483,7 +484,7 @@ clone から実行してください(`pip install -e .`)。</details><details>-<summary><b>ブローカー connectors</b> <sub>12 ブローカー — read + paper、対応先では bounded-live</sub></summary>+<summary><b>ブローカー connectors</b> <sub>13 ブローカー — read + paper、対応先では bounded-live</sub></summary>connector-first のプロファイル。多くは read + ペーパー口座での発注に対応します —— IBKR は読み取り専用、Robinhood はライブのみ(ペーパー口座なし)、Trading 212 はペーパーを含め発注を一切拒否します。ライブ発注はユーザーが定義した mandate(銘柄許可リスト、発注サイズ / エクスポージャー上限、1 日の取引回数上限、即時 kill switch)で制限され、資金を預かることは一切ありません —— 執行するのはブローカーです。発注系ツールは MCP に公開されません(agent + CLI のみ)。リサーチ / バックテスト経路は構造的にあらゆるライブ endpoint から遮断されています。@@ -495,6 +496,7 @@ connector-first のプロファイル。多くは read + ペーパー口座で| **Alpaca** | US | read + paper + bounded live (+ TAP credential-isolation mode) || **OKX** · **Binance** | crypto | read + paper + bounded live || **Futu** | HK / US / A | read + paper + bounded live |+| **eToro** | global | read + paper + bounded live(Public API;demo キーは構造上 `/demo` パスにしか到達せず、コピートレードのワークフローにも対応) || **MetaTrader 5** | forex / CFD | read + paper + bounded live (Exness-style; demo ⇔ paper identity guard) || **Longbridge** · **Dhan** · **Shoonya** | US / HK · India (NSE/BSE) | read + paper only — no runtime paper/live discriminator, so live order placement is hard-refused || **Trading 212** | UK / EU | fully read-only — `place_order` / `cancel_order` hard-refuse even paper |@@ -568,6 +570,83 @@ Intraday bars: 1m / 5m / 15m / 30m / 1H / 4H / 1D. 15 metrics + benchmark compar</details>+<details>+<summary><b>Quant Library</b> <sub>19 モジュール・265 個のテスト済み関数、すべての経路から呼び出し可能</sub></summary>++`src/quantlib` は、agent が必要とする金融数学のそれぞれについて、テスト済みの実装を+**1 つだけ**保持します。skill はこれらを **import** するようになり、markdown コード+ブロックの中に数式を抱え込むことはなくなりました —— `SKILL.md` の中に価格式が住んで+いたら、それはパターンではなくバグです。++| モジュール | カバー範囲 |+|-----------|-----------|+| `options` | Black-Scholes 価格 + greeks、インプライドボラティリティの逆算 |+| `fixedincome` | 債券数学、Nelson-Siegel / Svensson カーブフィッティング |+| `credit` | Altman Z-score、Merton / KMV デフォルト距離 |+| `timeseries` | 定常性、共和分、GARCH、bootstrap |+| `risk` · `var_backtest` | VaR / CVaR / EVT とそのバックテスト |+| `attribution` | Brinson-Fachler 要因分解 |+| `performance` · `fundmath` | TWR / MWR / Modified Dietz、XIRR / MOIC / DPI / TVPI |+| `factormodel` · `eventstudy` | ファクター回帰、イベントスタディ |+| `multipletesting` · `crossvalidation` | 多重検定調整、purged CV |+| `impact` | マーケットインパクトモデル |++読み取り専用の `quantlib_call` ツールが 1 つの契約で全体に到達するため、`bash` が+無効化されている CLI・Web UI・REST API・MCP でも金融数学が使えます。構造的に shell では+**ありません** —— モジュール許可リスト、`__all__` のみのディスパッチ、`export_*` は拒否。+計量経済学の関数は `stats` エクストラ(`pip install "vibe-trading-ai[stats]"`)が必要で、+遅延インポートして不足しているものを名指しします。++</details>++<details>+<summary><b>バリュエーションと機関投資家向けリサーチ</b> <sub>DCF・コンプス・三表連動、および六つのリサーチコマンド</sub></summary>++入力を自分で捏造することを拒むバリュエーションエンジンです。`contracts.py` の唯一の+ルール:**入力が欠けているモデルは実行不能(NOT RUNNABLE)であり、黙ってデフォルト値+を埋めることはない** —— バリュエーションモデルにおけるあらゆるデフォルト値は、定数の+衣をまとった意見だからです。++| モデル | 押さえておくべき挙動 |+|--------|---------------------|+| `run_dcf` | FCFF ブリッジ、WACC 構築、期央割引、ネットデット・ブリッジ、WACC×g 感応度グリッド。デュアル・ターミナルバリュー:各手法を相手方の含意マルチプルと含意 g で相互検証 |+| `run_comps` | EV ブリッジ、LTM + 暦年カレンダリゼーション、マルチプル行列。分母が非正のピアは**除外して報告**し、負のマルチプルとして平均に混ぜません |+| `threestatement` | 連動予測。厳格なバランス検証、明示的なリボルバー・プラグ、収束しなければ raise する金利↔負債の循環反復 |++成果物は入力ハッシュ付きでバージョン管理され、xlsx / pptx にエクスポートできます。++6 つのスラッシュコマンドがワークフローを駆動します —— `/comps` `/dcf` `/attrib`+`/memo` `/earnings` `/screen` —— それぞれが手順スケルトンと**算術的に整合した**+ワークトサンプルを備えています(Brinson 分解はアクティブリターンに厳密に合算され、+業績ブリッジは EPS 差分に厳密に合算されます)。`investor-lenses` skill は著名投資家の+思考フレームワークを分析オーバーレイとして重ねます:各レンズは優先シグナル・失格条件・+典型的な誤用からなる運用手順であり、人物伝ではなく、ツール名も指定しません。++バー以外に、`src/entities` が不規則な日付のキャッシュフロー(NAV、キャピタルコール、+クーポン)を取り込み、`cashflow_performance` が XIRR / MOIC / DPI / TVPI / TWR /+Modified Dietz / MWR を返します。この経路はバーエンジンとあえて**並行**に設計されており、+`nav` 列がバーエンジンに届いて終値として値付けされることは決してありません。++</details>++<details>+<summary><b>ガバナンスと監査証跡</b> <sub>「その数字はどの方法論が生んだのか?」に答える</sub></summary>++すべての実行は、プロンプト・skill の内容・ツールレジストリ・パッケージバージョンを+ハッシュした **manifest** を書き出します。1 か月前に出た数字も、それを生んだ正確な+方法論まで遡れます。++**監査台帳**は各レコードを直前のハッシュに連鎖させて fsync するため、レコードの改変や+削除は検出可能です —— 自分のハッシュを再計算した改変であっても、次のレコードで+`prev_hash_mismatch` として捕捉されます。タイムスタンプは常に呼び出し側が供給し、+このモジュールは `datetime.now()` を呼びません。++トレースの秘匿は **sink 単位**です:ツール呼び出しの引数とライブ監査台帳は+fail-closed sink を使い `content` を秘匿したまま、ツール結果の sink だけが `content` を+解放し、その文字列リーフをパターン洗浄します。`env` はどちらでも解放されません。++</details>+## 🎬 デモ<div align="center">@@ -735,6 +814,7 @@ skill + MCP config が agent の skills directory にダウンロードされま| `VIBE_TRADING_ALLOWED_RUN_ROOTS` | No | generated-code run directories 用の追加 comma-separated roots || `VIBE_TW_STOCK_DB` | No | 台湾市場の SQLite スナップショットのパス。読み取り専用 `taiwan_stock_data` ツールはスキーマ妥当な場合のみ登録されます || `VIBE_TRADING_EXTRA_CORS_ORIGINS` | No | ループバックの CORS 既定値に**追加**するオリジン(カンマ区切り。`CORS_ORIGINS` は置き換え) |+| `CONTENT_FILTER_WARNING_THRESHOLD` | No | コンテンツフィルタ警告の比率しきい値(既定 0.05 = 5%)。コンテンツモデレーションでブロックされた LLM 応答の割合がこれを超えると、run card がプロバイダーの変更を促します。 |<sub>* Ollama は API key 不要です。OpenAI Codex は ChatGPT OAuth を使い、tokens は `agent/.env` ではなく `oauth-cli-kit` 経由で保存します。</sub>@@ -1057,7 +1137,7 @@ curl -X POST http://localhost:8899/scheduled-runs/playbooks/premarket-brief \## 🔌 MCP Plugin-Vibe-Trading は MCP-compatible client 向けに 64 MCP tools を公開します。stdio subprocess として動作し、server setup は不要です。Core research tools は HK/US/crypto で API key なしに動作し、trading connector tools は選択中の connector profile を使います。LLM key が必要なのは `run_swarm` のみです。+Vibe-Trading は MCP-compatible client 向けに 70 MCP tools を公開します。stdio subprocess として動作し、server setup は不要です。Core research tools は HK/US/crypto で API key なしに動作し、trading connector tools は選択中の connector profile を使います。LLM key が必要なのは `run_swarm` のみです。**環境変数:** server は client 自身が spawn するため、shell の `export` は届きません —— client の `env` block に設定してください。生成された backtest code は allowed run roots 内に制限されるので、結果を自分の作業 directory に書き出すには `VIBE_TRADING_ALLOWED_RUN_ROOTS` が必要です:@@ -1113,7 +1193,7 @@ vibe-trading-mcp --transport sse # legacy SSE (deprecated)</details>-**公開される MCP tools(64):** `list_skills`, `load_skill`, `start_research_goal`, `get_research_goal`, `add_goal_evidence`, `update_research_goal_status`, `backtest`, `factor_analysis`, `alpha_zoo`, `alpha_bench`, `analyze_options`, `analyze_options_payoff`, `pattern_recognition`, `read_url`, `read_document`, `web_search`, `write_file`, `read_file`, `list_swarm_presets`, `run_swarm`, `get_market_data`, `get_fund_flow`, `get_dragon_tiger`, `get_northbound_flow`, `get_margin_trading`, `get_block_trades`, `get_shareholder_count`, `get_lockup_expiry`, `get_sector_info`, `get_research_reports`, `get_stock_news`, `get_sec_filings`, `get_financial_statements`, `get_options_chain`, `get_stock_profile`, `screen_market`, `search_symbol`, `get_macro_series`, `iwencai_search`, `qveris_search`, `qveris_inspect`, `qveris_execute`, `get_institutional_holdings`, `etf_holdings`, `prediction_market`, `research_papers`, `get_swarm_status`, `get_run_result`, `list_runs`, `reap_stale_runs`, `retry_run`, `analyze_trade_journal`, `extract_shadow_strategy`, `run_shadow_backtest`, `render_shadow_report`, `scan_shadow_signals`, `trading_connections`, `trading_select_connection`, `trading_check`, `trading_account`, `trading_positions`, `trading_orders`, `trading_quote`, `trading_history`.+**公開される MCP tools(70):** `list_skills`, `load_skill`, `start_research_goal`, `get_research_goal`, `add_goal_evidence`, `update_research_goal_status`, `backtest`, `factor_analysis`, `alpha_zoo`, `alpha_bench`, `analyze_options`, `analyze_options_payoff`, `pattern_recognition`, `read_url`, `read_document`, `web_search`, `write_file`, `read_file`, `list_swarm_presets`, `run_swarm`, `get_market_data`, `get_fund_flow`, `get_dragon_tiger`, `get_northbound_flow`, `get_margin_trading`, `get_block_trades`, `get_shareholder_count`, `get_lockup_expiry`, `get_sector_info`, `get_research_reports`, `get_stock_news`, `get_sec_filings`, `get_financial_statements`, `get_options_chain`, `get_stock_profile`, `screen_market`, `search_symbol`, `get_macro_series`, `iwencai_search`, `qveris_search`, `qveris_inspect`, `qveris_execute`, `get_institutional_holdings`, `etf_holdings`, `prediction_market`, `research_papers`, `get_swarm_status`, `get_run_result`, `list_runs`, `reap_stale_runs`, `retry_run`, `analyze_trade_journal`, `extract_shadow_strategy`, `run_shadow_backtest`, `render_shadow_report`, `scan_shadow_signals`, `trading_connections`, `trading_select_connection`, `trading_check`, `trading_account`, `trading_positions`, `trading_orders`, `trading_quote`, `trading_history`, `quantlib_call`, `cashflow_performance`, `orderbook_depth`, `sentiment`, `technical_indicators`, `get_fundamentals`.### SWARM の外部 MCP tools@@ -1207,6 +1287,45 @@ vibe-trading connector history EURUSD---+## 🔌 eToro Public API コネクタ++API キーペア(`x-api-key` + `x-user-key`)で [eToro Public API](https://builders.etoro.com/) のデモ口座・リアル口座に接続します。デモとリアルは**構造的に**分離されており、デモキーは `/demo` API パスにしか到達しません。++`~/.vibe-trading/etoro.json` を設定します(自分で作成してください。対応環境では `chmod 600`):++```json+{+ "api_key": "YOUR_PUBLIC_API_KEY",+ "user_key": "YOUR_USER_KEY",+ "profile": "paper"+}+```++代わりに `~/.vibe-trading/.env` で `ETORO_API_KEY` と `ETORO_USER_KEY` を設定することもできます。++その後:++```bash+vibe-trading connector use etoro-paper-sdk+vibe-trading connector check+vibe-trading connector account+vibe-trading connector positions+vibe-trading connector quote BTC+```++| プロファイル | 口座 | 発注 |+|-------------|------|------|+| `etoro-paper-sdk` | デモ | 読み取り専用 |+| `etoro-live-sdk-readonly` | リアル | 読み取り専用 |+| `etoro-paper-trade` | デモ | デモパスへの直接発注 |+| `etoro-live-trade` | リアル | mandate + kill switch によるゲート |++銘柄検索は eToro の `internalSymbolFull` 検索を使います(例:`BTC` → instrument id `100000`)。取引前に `etoro_search_instruments` エージェントツールでティッカーを解決してください。++安全境界:デモとリアルはパス分離かつキー束縛です(`paper_guard: path_separated_key_bound`)。リアルでリスクを増やす操作(新規建て、コピー開始/増額)には、認可された mandate、停止していない明確な状態、そしてコピー名目額を制限するための検証済み USD 口座が必要です。検証済みの全決済・部分決済、未約定注文のキャンセル、コピー終了は停止中でも利用でき、すべて監査ログに記録されます。保留中の決済のキャンセルとポジションのストップ編集は**デモ専用**です。これらはエクスポージャーを増やしたり追加証拠金を移動させたりし得る一方、増分の USD リスクを定量化できるだけの API データがないため、リアル経路は fail-closed になります。コピー金額は eToro 口座通貨建てで、コピーの開始・調整のたびに呼び出し側が 1〜35 文字の URL-safe な参照 id を指定する必要があります。eToro 固有の書き込み系ツール(`etoro_close_position`、`etoro_copy_*` など)は**エージェントツール専用**で、MCP や CLI には公開されません。ロールバック:該当コネクタのコミットを revert するかプロファイルを無効化します。halt は新規のリアル・リスク増加操作をブロックします。++---+## 🔌 外部 MCP Server からツールを読み込む(MCP Client モード)> **これは上の MCP Plugin とは逆方向です。**@@ -1440,7 +1559,7 @@ Vibe-Trading/├── agent/ # バックエンド (Python)│ ├── cli/ # CLI パッケージ — インタラクティブ TUI + サブコマンド│ ├── api_server.py # FastAPI サーバー — runs、sessions、upload、swarm、SSE-│ ├── mcp_server.py # MCP サーバー — OpenClaw / Claude Desktop 向け 64 tools+│ ├── mcp_server.py # MCP サーバー — OpenClaw / Claude Desktop 向け 70 tools│ ││ ├── src/│ │ ├── agent/ # ReAct エージェントコア@@ -1455,7 +1574,7 @@ Vibe-Trading/│ │ ├── memory/ # クロスセッション永続メモリ│ │ │ └── persistent.py # ファイルベースメモリ (~/.vibe-trading/memory/)│ │ │-│ │ ├── tools/ # 68 個の自動検出エージェントツール+│ │ ├── tools/ # 94 個の自動検出エージェントツール│ │ │ ├── backtest_tool.py # バックテスト実行│ │ │ ├── remember_tool.py # クロスセッションメモリ (save/recall/forget)│ │ │ ├── skill_writer_tool.py # skill CRUD (save/patch/delete/file)@@ -1569,7 +1688,38 @@ Contributions を歓迎します。ガイドラインは [CONTRIBUTING.md](CONTRVibe-Trading に貢献してくださった皆さまに感謝します。-最近の v0.1.12 サイクルの貢献者とクレジット:+最近の v0.1.13 サイクルの貢献者とクレジット:++- @santhreal — a 17-PR correctness and resource-leak sweep: the HTTP throttle now sweeps stale buckets interval-aware so rate-limit spacing survives (#1047), the rate limiter stops growing without bound on unique client IPs (#1039), the event bus notifies and removes subscribers on clear (#1046), `_json_loads` is guarded against corrupted JSON in database columns (#1045), NaN/inf volume and close no longer crash `format_grounding_block` (#1043), `inf` from `pct_change` on zero equity is replaced (#1041), Shoonya tolerates empty-string numerics (#1038), drawdown is computed from the absolute peak on negative equity (#958) and insolvent empty cross accounts are marked liquidated (#959), plus exact memory index anchors (#956/#957) and an A-share code / trade-journal parsing batch (#919, #926–#935)+- @shadowinlife — HK market-data fallback routing repaired with a new Tencent HK source (#1000), Shadow multi-market backtests split per settlement currency (#997), bare US tickers routed to `us_equity` (#994), MCP list/dict arguments tolerating JSON-string clients (#993), generated signal engines passing the backtest sandbox validator (#992), and the memory GC dry-run fix (#973)+- @honginp — the USD-M perpetual lifecycle end to end: funding and liquidation execution (#903), isolated & cross margin liquidation modelling (#889), ordered fidelity evidence persistence (#936), atomic position rebalancing (#951), and strict historical position rebalancing that preserves collateral, funding, fees and fill evidence (#1019)+- @QCYTSN — the desktop Electron shell lifecycle (#923), Windows packaging with a checksum-pinned embedded runtime and `safeStorage` credential handling (#1015), and Settings model discovery + runtime identity UX (#924)+- @Robin1987China — the `technical_indicators` (#921) and `sentiment` (#939) tools, annualisation entries for 15 data sources with a CI coverage gate (#891), indicator inputs read without sampling (#1005), and the `quant_strategy_desk` final report aggregator (#1048)+- @Shizoqua — MCP specs cache keyed on remote server identity (#1049), memory FTS5 ranking with importance decay (#1032), swarm detection of `ok`/`success:false` tool failures (#1028), and lowercase `4h` resampling in the yfinance loader (#1013)+- @ngoanpv — timezone-aware scheduled research (#954, closes #953), one malformed record no longer breaking the whole store (#1003), interval creates without a resolvable zone (#1004), and delete-route job id validation (#980)+- @he-yufeng — risk x-ray artifacts in portfolio runs (#900), Portfolio Studio artifacts surfaced in run detail (#966), yfinance crypto routed to the crypto engine (#970), and hierarchy-routed memory entries keeping their `.md` extension (#984)+- @wiliao — Canadian markets end to end: TSX/TSXV market data (#1024) and symbol support through search fail-fast and CSV grounding (#1037)+- @MuggleJinx — session and run history stored under the user runtime root (#925, closes #904) and `~/.vibe-trading/.env` loaded on the connector command path (#902, closes #901)+- @cgycorey — Alpha Zoo tools reaching MCP (#979) and mapping-shaped Responses stream events accepted (#1034)+- @ofeksh-tr — the eToro Public API connector with path-separated demo/real profiles (#989) — broker connectors 12 → **13**+- @su322 — source message ids threaded into IM outbound so QQ replies stay passive (#1008), and the output principle that stops the agent once evidence is sufficient (#1010)+- @zwrong — the `vibe-trading update` self-upgrade command (#1020)+- @yrk111222 — ModelScope as an OpenAI-compatible provider (#1011)+- @x-lambda — agent proxy opt-out covering sync and async clients (#995)+- @dineeshd — authenticated API capability surfaces under enforced CSP (#961)+- @hhj123123 — the canonical run root preserved after HOME isolation (#1012)+- @00EVA — the Settings model dropdown auto-resizing so long provider/model slugs stay readable (#1006)+- @darkknight4563 — `bar_returns` kept bit-identical for gapped positive series (#895)+- @sambazhu — mootdx config pre-seeded in the sandbox home (#982)+- @yagnikpipaliya — self-healing for Claude models that deprecate the `temperature` field (#890, closes #856)+- @JungHoonGhae — the Korea equity (KRX) market engine (#693)+- @shugaoye — the OpenBB Workspace bridge (#817)+- @TSENGCHIENFENG — the read-only Taiwan snapshot tool (#848)+- @ddy4633, @tyj147454413-cmd, @y85998607, @klmtseng, @ebujinovch, @g0rdonL, @AmirF194, @Echoandelementwebsites, @dvirarad, @1anter — correlation, loader, vn.py-export, PIT-fundamentals and alpha-bench fixes carried into this cycle+- @warren618 / Haozhe Wu — the finance-math layer and valuation engine, the entity + cash-flow spine, run manifests and the hash-chained audit ledger, the four read-only data tools, the institutional commands and investor lenses, the grounding-gate repair, the analytic options payoff tool (#946), Codex OAuth recovery (#1014), the Shadow runtime root fix (#1017), release integration and open-PR/issue triage++<details>+<summary>v0.1.12 サイクルの貢献者</summary>- @santhreal — a 30-PR correctness sweep: strict-JSON / finite-number hardening across metrics, factors, pattern, and options (#764/#765/#766/#767/#739/#740/#744), loader correctness (#761 yahoo 1m bars), and session / journal robustness (#762/#763/#768/#769/#770)- @xkam7ar — broad reliability across packaging, web, scheduler, swarm, and CLI (#584), cancellation before the first AgentLoop iteration (#641, closes #638), QVeris session budget + atomic credit accounting (#685/#686), CI / OOS gates (#630/#632), and journal month-filter / side-parse fixes (#626/#628)@@ -1600,6 +1750,8 @@ Vibe-Trading に貢献してくださった皆さまに感謝します。- @GabbaTauchi — reported the native zai streaming / base-URL bug (#758)- @warren618 / Haozhe Wu — the correlation regime backend integration, the zai provider streaming + base-URL resolution fix (#758), release integration, and open-PR/issue triage+</details>+<details><summary>v0.1.11 サイクルの貢献者</summary>diff --git a/README_ko.md b/README_ko.mdindex fbd028563..5f36cbc70 100644--- a/README_ko.md+++ b/README_ko.md@@ -52,13 +52,14 @@> ⚠️ **보안 경고:** X 계정 `VibeTrading_HKU`, Virtuals 프로젝트 `101845`, 토큰 컨트랙트 `0x640BDBF77b6447E8b7DB7894cED84BD1c40571f4`는 모두 Vibe-Trading 공식과 무관합니다. Vibe-Trading은 어떠한 토큰이나 밈코인도 발행하거나 공식적으로 지지한 적이 없습니다. 해당 토큰을 구매하거나 지갑을 연결하거나 어떠한 서명도 하지 마세요. [자세히 보기](SECURITY.md#official-channels--impersonation).+- **2026-08-10** 🚀 **v0.1.13 릴리스**([릴리스 노트](https://github.com/HKUDS/Vibe-Trading/releases/tag/v0.1.13), `pip install -U vibe-trading-ai`): 0.1.12 이후 408개 커밋, 162개 병합 PR로 지금까지 가장 큰 릴리스입니다. **주인공은 새 기능이 아니라 수정입니다: identity 게이트가 이미 증거를 확보한 답변을 더 이상 거부하지 않습니다.** 이전에는 형식이 온전한 질문도 실제 도구 호출에 몇 분을 쓴 뒤 *"종목 동일성 또는 가격 근거를 안전하게 확인할 수 없습니다"*를 반환했습니다. 원인은 `.SS`와 `.SH`를 서로 다른 종목으로 취급해 **모든 상하이 티커가 영구적으로 ambiguous**였던 점, 실패한 보조 조회가 이미 잠긴 identity를 강등시킬 수 있었던 점, 모든 CJK 질의에 대한 Yahoo의 HTTP 400을 "여기에 상장되지 않음"이 아니라 데이터 소스 *실패*로 기록한 점, 도구별 하드코딩 허용 목록이 문서화된 17가지 인자 표기 중 11가지를 막은 점, 한중일 답변이 ASCII 로더 이름 대신 `雅虎`·`元`을 썼다는 이유로 거부된 점, 그리고 천 단위 구분자가 `¥1,309.22`를 잘라 `1`이 관측 구간과 비교된 점입니다. 개념적 질문과 비교 리포트도 더 이상 막다른 길에 빠지지 않습니다. 기록된 OHLC 근거를 벗어난 호가는 **여전히 거부됩니다**. **신규:** `src/quantlib` — 17개 모듈 249개 테스트된 함수(옵션, 채권, 신용, 계량경제, VaR/CVaR/EVT, 성과요인 분해, 이벤트 스터디, purged CV)를 읽기 전용 `quantlib_call`로 CLI·Web UI·REST API·MCP에서 호출할 수 있어, skill이 markdown에 수식을 품는 대신 import합니다. **밸류에이션 엔진**(`run_dcf` / `run_comps` / 3-표 연동)의 유일한 규칙은 입력이 빠지면 조용히 기본값을 채우는 대신 모델을 실행 불가로 만든다는 것입니다. **엔티티 + 불규칙 현금흐름 축**(XIRR / MOIC / DPI / TVPI, `cashflow_performance`를 통한 TWR / Modified Dietz)은 바 엔진과 의도적으로 평행하게 유지됩니다. **모든 실행에 거버넌스**가 들어갔습니다 — 프롬프트·skill·도구 레지스트리·패키지 버전에 대한 해시 manifest와, 자기 해시를 다시 계산한 수정조차 다음 레코드에서 잡히는 해시 체인 + fsync 감사 원장입니다. 무료 공개 소스 기반 읽기 전용 데이터 도구 4종(분기 대비 포지션 차이를 담은 **SEC 13F**, CSI300 추종 ETF가 분기 상위 10개가 아니라 순자산의 98.66%에 해당하는 342개 종목으로 해석되는 **ETF 룩스루**, 라벨이 붙은 내재확률로 제공되는 **예측시장**, 출처에 고정된 주장만 뽑는 **arXiv/OpenAlex**)도 추가됐습니다. 여기에 6개 기관 리서치 커맨드(`/comps` `/dcf` `/attrib` `/memo` `/earnings` `/screen`), 독립 skill이 된 investor lenses, 바로 예약 가능한 리서치 playbook 5종, 체크섬 고정 Windows 패키징과 `safeStorage`를 갖춘 **데스크톱 Electron 셸**, 13번째 브로커 커넥터 **eToro**, 9번째 백테스트 엔진 **한국(KRX)**, **OpenBB Workspace 브리지**, 캐나다 주식 엔드투엔드 지원, 그리고 `sentiment`·`technical_indicators`·`options_payoff`·`orderbook_depth`·ModelScope·`vibe-trading update`가 포함됩니다. **정확성:** SEC 보고 기간을 `(start, end)` 구간으로 식별합니다 — 연간 조회가 단일 분기를 반환해 4.2배 과소평가였습니다. tushare A주 가격은 수정주가로 바뀌었고, 배당락을 가로지르는 원시 수익률은 최대 47%p 어긋났습니다. `bar_returns`는 거래정지를 0% 변동으로 기록하지 않으며, 연율화는 24개 데이터 소스를 모두 포괄합니다. 생성된 코드가 브로커 계층을 import하거나 이름을 바꾼 바인딩으로 `socket`/`subprocess`에 닿을 수 있던 샌드박스 구멍도 막았습니다. 통화가 섞인 크로스마켓 컴포지트 백테스트는 하나의 자산곡선으로 합산하지 않고 거부합니다. @santhreal, @shadowinlife, @Robin1987China, @he-yufeng, @QCYTSN, @Shizoqua, @honginp, @cgycorey, @wiliao, @ngoanpv, @x-lambda, @ofeksh-tr, @00EVA, @zwrong, @yrk111222, @su322, @hhj123123, @dineeshd, @sambazhu, @ddy4633, @tyj147454413-cmd, @y85998607, @JungHoonGhae, @shugaoye, @TSENGCHIENFENG, @darkknight4563, @MuggleJinx, @klmtseng, @ebujinovch, @g0rdonL, @AmirF194, @Echoandelementwebsites, @yagnikpipaliya, @dvirarad, @1anter 님께 감사드립니다.- **2026-08-09** 🪟 **안전한 Windows 패키징, 캐나다 시장, ModelScope, MCP의 Alpha Zoo**: Windows 데스크톱 패키징은 checksum으로 고정한 임베디드 Python 3.12 runtime과 x64 NSIS review/signing 경로를 조립하고, 허용 목록의 credential을 Electron `safeStorage`에 보관합니다. renderer는 비밀값을 설정하거나 지울 수 있지만 읽을 수 없고, 평문 설정은 한 번만 이전되며, 복호화 값은 소유 backend에만 전달됩니다. 서명되지 않은 review build와 서명 build는 잘못된 서명 상태에서 fail closed하고, 이 PR에서는 installer artifact를 배포하지 않았습니다([#1015](https://github.com/HKUDS/Vibe-Trading/pull/1015)). 캐나다 주식은 이제 end-to-end로 동작합니다. `.TO`/`.V` symbol을 CAD로 분류하고 Yahoo → yfinance → local fallback으로 가져오며, 캐나다 전용 GlobalEquity rule로 체결하고 `XIC.TO`를 benchmark로 사용하며, 혼합 통화 합산을 거부합니다. strict USD-M 과거 backtest도 `position_adjustment=rebalance`를 opt-in해 증감 포지션 전반에서 collateral, funding, fee, 실현 P&L, 청산 동작, 불변 체결 증거를 일관되게 유지합니다([#1024](https://github.com/HKUDS/Vibe-Trading/pull/1024), [#1019](https://github.com/HKUDS/Vibe-Trading/pull/1019), [#952](https://github.com/HKUDS/Vibe-Trading/issues/952) 종료). ModelScope는 공식 OpenAI-compatible hosted-inference endpoint를 통해 내장 provider에 합류하고 기본값은 `Qwen/Qwen3.5-27B`입니다([#1011](https://github.com/HKUDS/Vibe-Trading/pull/1011)). 새 `vibe-trading update`는 wheel install과 editable/source checkout을 구분하고, 확인한 정확한 release를 설치한 뒤 새 process의 metadata로 검증하며 downgrade하지 않습니다([#1020](https://github.com/HKUDS/Vibe-Trading/pull/1020)). `alpha_zoo`와 제한된 `alpha_bench`도 MCP(총 64 tools)에 노출되어 기간·결과 수·출력 경로를 제한하고 report를 안전하게 생성합니다([#979](https://github.com/HKUDS/Vibe-Trading/pull/979)). 검증된 Python/frontend lock 갱신으로 grouped dependencies, `postcss`, `akshare`도 업데이트했습니다([#1021](https://github.com/HKUDS/Vibe-Trading/pull/1021), [#1023](https://github.com/HKUDS/Vibe-Trading/pull/1023), [#1026](https://github.com/HKUDS/Vibe-Trading/pull/1026), [#1027](https://github.com/HKUDS/Vibe-Trading/pull/1027)). 기여해 주신 [@QCYTSN](https://github.com/QCYTSN), [@wiliao](https://github.com/wiliao), [@honginp](https://github.com/honginp), [@yrk111222](https://github.com/yrk111222), [@zwrong](https://github.com/zwrong), [@cgycorey](https://github.com/cgycorey)에게 감사드립니다.- **2026-08-08** 🧱 **데스크톱 셸, eToro, 원자적 리밸런싱, 신뢰성 강화**: 소스 기반 Electron 호스트가 기존 백엔드 수명주기를 관리하며 무작위 loopback 포트, 실행별 비밀값, 5개 언어의 시작 복구, 소유 프로세스 정리를 제공합니다. eToro는 demo/real 경로가 분리된 커넥터로 합류하고, 실계좌에서 위험을 늘리는 작업은 계속 mandate와 감사 게이트를 통과하며, API 기능 엔드포인트에는 인증과 CSP가 적용됩니다([#923](https://github.com/HKUDS/Vibe-Trading/pull/923), [#989](https://github.com/HKUDS/Vibe-Trading/pull/989), [#961](https://github.com/HKUDS/Vibe-Trading/pull/961)). 백테스트에는 불변 체결 증거를 남기는 opt-in 동일 방향 원자적 리밸런싱이 추가됐습니다. Shadow는 임의의 FX 합산 없이 결제 통화별로 시장을 나누고 설정된 runtime root를 따르며, 지표는 샘플링하지 않은 연속 이력을 사용하고, 음수 equity의 drawdown과 포지션 없이 파산한 cross account의 청산 경계도 바로잡았습니다([#951](https://github.com/HKUDS/Vibe-Trading/pull/951), [#997](https://github.com/HKUDS/Vibe-Trading/pull/997), [#1017](https://github.com/HKUDS/Vibe-Trading/pull/1017), [#1005](https://github.com/HKUDS/Vibe-Trading/pull/1005), [#958](https://github.com/HKUDS/Vibe-Trading/pull/958), [#959](https://github.com/HKUDS/Vibe-Trading/pull/959)). OpenAI Codex OAuth는 독립된 동기화 credential store와 1회 401 복구를 사용하고, proxy 비활성화는 동기·비동기 client 모두에 적용됩니다. sandbox run은 정규 run root를 유지하고, 예약 리서치는 손상 record를 격리하며 interval timezone 검증을 수정했고, 소문자 `4h` 요청은 실제 4시간 봉을 반환합니다([#1014](https://github.com/HKUDS/Vibe-Trading/pull/1014), [#995](https://github.com/HKUDS/Vibe-Trading/pull/995), [#1012](https://github.com/HKUDS/Vibe-Trading/pull/1012), [#1003](https://github.com/HKUDS/Vibe-Trading/pull/1003), [#1004](https://github.com/HKUDS/Vibe-Trading/pull/1004), [#1013](https://github.com/HKUDS/Vibe-Trading/pull/1013)). QQ 답장은 원본 message ID를 유지하고, 긴 model slug는 온전히 읽히며, agent는 증거가 충분하면 조사를 멈춥니다([#1008](https://github.com/HKUDS/Vibe-Trading/pull/1008), [#1006](https://github.com/HKUDS/Vibe-Trading/pull/1006), [#1010](https://github.com/HKUDS/Vibe-Trading/pull/1010)). 기여해 주신 [@QCYTSN](https://github.com/QCYTSN), [@Shizoqua](https://github.com/Shizoqua), [@ngoanpv](https://github.com/ngoanpv), [@hhj123123](https://github.com/hhj123123), [@su322](https://github.com/su322), [@Robin1987China](https://github.com/Robin1987China), [@shadowinlife](https://github.com/shadowinlife), [@dineeshd](https://github.com/dineeshd), [@honginp](https://github.com/honginp), [@santhreal](https://github.com/santhreal), [@00EVA](https://github.com/00EVA), [@x-lambda](https://github.com/x-lambda), [@ofeksh-tr](https://github.com/ofeksh-tr)에게 감사드립니다.-- **2026-08-07** 🛡️ **오탐 거부 감소, 샌드박스 구멍 차단, QVeris의 MCP 노출**: 그라운딩 게이트가 애초에 가격이 아닌 숫자 때문에 형식이 온전한 답변을 거부하지 않습니다 — 확신도 점수, 지표 값, 이동평균 기간, `8/5` 같은 연도 없는 날짜, 백분율 구간, 그리고 매매 계획 자체의 트리거 수준(`종가 ≥6.45`는 조건이지 호가가 아닙니다). 반면 기록된 OHLC 증거를 벗어난 호가는 **여전히 거부**되며, `08-05`로 적힌 가격표도 이제 자신의 증거와 매칭됩니다([#1001](https://github.com/HKUDS/Vibe-Trading/issues/1001), [#983](https://github.com/HKUDS/Vibe-Trading/issues/983)). **샌드박스**: 생성된 전략 코드는 브로커 계층을 import할 수 없고, 이름을 바꾼 바인딩으로 `socket`/`subprocess`/`os.system`/`ctypes`에 도달할 수도 없습니다. 둘 다 이전에는 통과했습니다. 전략이 써야 할 `src.quantlib`는 그대로 import됩니다. **QVeris** discovery/inspect/execute가 MCP 표면에 합류했고(62개 도구), 비용 견적은 호출자의 신고가 아니라 마켓플레이스에서 조회합니다([#976](https://github.com/HKUDS/Vibe-Trading/pull/976), closes [#964](https://github.com/HKUDS/Vibe-Trading/issues/964), thanks [@shadowinlife](https://github.com/HKUDS/Vibe-Trading/shadowinlife)). 그 밖에 홍콩 시세 폴백 라우팅 수정과 Tencent 홍콩 소스 추가, yfinance 암호화폐를 크립토 엔진으로 라우팅, 메모리 항목의 기록과 복구에 `.md` 확장자 부여, MCP의 list/dict 인자가 JSON 문자열 클라이언트를 허용, 실행 상세에 Portfolio Studio 산출물 표시([#1000](https://github.com/HKUDS/Vibe-Trading/pull/1000), [#970](https://github.com/HKUDS/Vibe-Trading/pull/970), [#984](https://github.com/HKUDS/Vibe-Trading/pull/984), [#993](https://github.com/HKUDS/Vibe-Trading/pull/993), [#980](https://github.com/HKUDS/Vibe-Trading/pull/980), [#982](https://github.com/HKUDS/Vibe-Trading/pull/982), [#966](https://github.com/HKUDS/Vibe-Trading/pull/966), [#973](https://github.com/HKUDS/Vibe-Trading/pull/973), thanks [@he-yufeng](https://github.com/HKUDS/Vibe-Trading/he-yufeng), [@ngoanpv](https://github.com/HKUDS/Vibe-Trading/ngoanpv), [@sambazhu](https://github.com/HKUDS/Vibe-Trading/sambazhu)).<details><summary>이전 뉴스</summary>-- **2026-08-06** 🧮 **테스트된 금융수학 레이어 + 밸류에이션 엔진 + 비정기 현금흐름 + 연결된 거버넌스**: `src/quantlib`는 skills의 markdown에 흩어져 있던 수식을 각각 하나의 테스트된 구현으로 교체했습니다 — 옵션, 채권, 크레딧, 계량경제, VaR/CVaR/EVT, 성과 요인분석, 이벤트 스터디, 다중검정 제어, purged 교차검증 — 약 250개 함수를 새 읽기 전용 도구 `quantlib_call`을 통해 Web/API/MCP에서 모두 사용할 수 있습니다. 밸류에이션 엔진(`run_dcf`/`run_comps`/3대 재무제표 연동)은 입력이 빠지면 기본값으로 채우는 대신 실행 불가로 판정합니다. 새 엔티티 + 현금흐름 기반은 NAV, 캐피털 콜, 쿠폰을 받아들이며(`cashflow_performance`가 XIRR/MOIC/DPI/TVPI와 TWR/Modified Dietz를, `orderbook_depth`가 암호화폐 L2 임팩트 비용을 제공), 매 실행은 해시 manifest를 기록하고 감사 원장은 해시 체인으로 변조를 탐지합니다. 30개 swarm 프리셋 전부를 도구가 실제 계산할 수 있는 범위와 대조해 재점검했고, 계산할 수 없는 산출물은 숫자를 지어내는 대신 그 사실을 명시합니다.+- **2026-08-07** 🛡️ **오탐 거부 감소, 샌드박스 구멍 차단, QVeris의 MCP 노출**: 그라운딩 게이트가 애초에 가격이 아닌 숫자 때문에 형식이 온전한 답변을 거부하지 않습니다 — 확신도 점수, 지표 값, 이동평균 기간, `8/5` 같은 연도 없는 날짜, 백분율 구간, 그리고 매매 계획 자체의 트리거 수준(`종가 ≥6.45`는 조건이지 호가가 아닙니다). 반면 기록된 OHLC 증거를 벗어난 호가는 **여전히 거부**되며, `08-05`로 적힌 가격표도 이제 자신의 증거와 매칭됩니다([#1001](https://github.com/HKUDS/Vibe-Trading/issues/1001), [#983](https://github.com/HKUDS/Vibe-Trading/issues/983)). **샌드박스**: 생성된 전략 코드는 브로커 계층을 import할 수 없고, 이름을 바꾼 바인딩으로 `socket`/`subprocess`/`os.system`/`ctypes`에 도달할 수도 없습니다. 둘 다 이전에는 통과했습니다. 전략이 써야 할 `src.quantlib`는 그대로 import됩니다. **QVeris** discovery/inspect/execute가 MCP 표면에 합류했고(62개 도구), 비용 견적은 호출자의 신고가 아니라 마켓플레이스에서 조회합니다([#976](https://github.com/HKUDS/Vibe-Trading/pull/976), closes [#964](https://github.com/HKUDS/Vibe-Trading/issues/964), thanks [@shadowinlife](https://github.com/HKUDS/Vibe-Trading/shadowinlife)). 그 밖에 홍콩 시세 폴백 라우팅 수정과 Tencent 홍콩 소스 추가, yfinance 암호화폐를 크립토 엔진으로 라우팅, 메모리 항목의 기록과 복구에 `.md` 확장자 부여, MCP의 list/dict 인자가 JSON 문자열 클라이언트를 허용, 실행 상세에 Portfolio Studio 산출물 표시([#1000](https://github.com/HKUDS/Vibe-Trading/pull/1000), [#970](https://github.com/HKUDS/Vibe-Trading/pull/970), [#984](https://github.com/HKUDS/Vibe-Trading/pull/984), [#993](https://github.com/HKUDS/Vibe-Trading/pull/993), [#980](https://github.com/HKUDS/Vibe-Trading/pull/980), [#982](https://github.com/HKUDS/Vibe-Trading/pull/982), [#966](https://github.com/HKUDS/Vibe-Trading/pull/966), [#973](https://github.com/HKUDS/Vibe-Trading/pull/973), thanks [@he-yufeng](https://github.com/HKUDS/Vibe-Trading/he-yufeng), [@ngoanpv](https://github.com/HKUDS/Vibe-Trading/ngoanpv), [@sambazhu](https://github.com/HKUDS/Vibe-Trading/sambazhu)).+- **2026-08-06** 🧮 **테스트된 금융수학 레이어 + 밸류에이션 엔진 + 비정기 현금흐름 + 연결된 거버넌스**: `src/quantlib`는 skills의 markdown에 흩어져 있던 수식을 각각 하나의 테스트된 구현으로 교체했습니다 — 옵션, 채권, 크레딧, 계량경제, VaR/CVaR/EVT, 성과 요인분석, 이벤트 스터디, 다중검정 제어, purged 교차검증 — 약 250개 함수를 새 읽기 전용 도구 `quantlib_call`을 통해 CLI·Web UI·REST API·MCP에서 모두 사용할 수 있습니다. 밸류에이션 엔진(`run_dcf`/`run_comps`/3대 재무제표 연동)은 입력이 빠지면 기본값으로 채우는 대신 실행 불가로 판정합니다. 새 엔티티 + 현금흐름 기반은 NAV, 캐피털 콜, 쿠폰을 받아들이며(`cashflow_performance`가 XIRR/MOIC/DPI/TVPI와 TWR/Modified Dietz를, `orderbook_depth`가 암호화폐 L2 임팩트 비용을 제공), 매 실행은 해시 manifest를 기록하고 감사 원장은 해시 체인으로 변조를 탐지합니다. 30개 swarm 프리셋 전부를 도구가 실제 계산할 수 있는 범위와 대조해 재점검했고, 계산할 수 없는 산출물은 숫자를 지어내는 대신 그 사실을 명시합니다.- **2026-08-05** 🔭 **기관 보유, ETF 룩스루, 예측 시장, 논문 검색**: 무료 공개 데이터만 쓰는 읽기 전용 도구 4개 — SEC 13F 보유(분기 대비 증감 포함), 시장을 가로지르는 ETF 구성종목(CSI300 추종 ETF는 분기 공시 상위 10개가 아니라 342개 종목·순자산의 98.7%를 반환), 이벤트 계약을 단위가 표시된 내재확률로 제공, arXiv/OpenAlex 검색은 원문에 없는 값을 추론하지 않고 출처에 없음으로 표시합니다. 여기에 예약 리서치 템플릿 5개, 기관 리서치 명령 6개(`/comps` `/dcf` `/attrib` `/memo` `/earnings` `/screen`), 독립 skill이 된 investor lenses, 그리고 모든 숫자를 만들어낸 도구까지 추적하는 agent core가 더해집니다.- **2026-08-04** 🔧 **정확성 수정: 펀더멘털, A주 가격, 과대한 도구 결과**: SEC 보고 기간을 이제 `(start, end)` 구간으로 식별합니다. 10-Q는 동일한 종료일과 동일한 회계 분기 아래에 실제 분기와 연초 이후 프레임을 함께 제출하므로, `period="annual"`은 AAPL FY2018~2020에 대해 단일 분기를 반환했고(4.2배 과소 계상), 분기 시계열의 회계 4분기 자리에는 모두 연간 수치가 들어 있었습니다. `get_fundamentals("AAPL.US")`도 더 이상 `ok:true`와 전부 null인 패널을 반환하지 않습니다. Tushare A주 가격은 팩터 벤치와 백테스트 양쪽에서 기업 행위 조정이 적용되며(배당락일을 가로지르는 원시 종가 수익률은 최대 47%p 어긋났습니다. 300750.SZ, 2023-04-26), CSI300 벤치는 각 날짜를 그 시점의 지수 구성 종목으로 마스킹합니다. 교차 시장 컴포지트 백테스트는 CNY, USD, KRW를 하나의 자산 곡선에 합산하는 대신 통화가 섞인 종목 집합을 거부합니다. 옵션 레그는 진입 시점의 변동성으로 평가되어 프리미엄 대비 최대 +93%에 이르던 첫날 허위 손익이 사라졌습니다. 과대한 도구 결과는 JSON 중간에서 잘리는 대신 총 개수를 명시하며 레코드 단위로 페이징됩니다. `calc_metrics`는 추적 오차와 벤치마크 베타를 보고합니다.- **2026-08-03** ⏰ **타임존 인식 예약 리서치 + 종목 스크리닝 교착 해소**: 예약 작업에 선택적 IANA `timezone`을 지정할 수 있고 cron이 해당 존의 벽시계 기준으로 평가되므로 서머타임 전환에도 주기가 유지됩니다. 봄철 건너뛰는 시각은 생략되고 가을철 중복되는 시각은 첫 번째 발생에만 실행됩니다. cron 필드는 쉼표 목록과 범위(`1,3-5`)를 지원하며, 타임존이 없는 작업은 기존 UTC 의미를 유지하고, 웹 UI에는 5개 언어를 갖춘 **Scheduled** 페이지가 추가되었습니다(이전에는 프런트엔드에 예약 화면이 전혀 없었습니다) ([#954](https://github.com/HKUDS/Vibe-Trading/pull/954), closes [#953](https://github.com/HKUDS/Vibe-Trading/issues/953), [@ngoanpv](https://github.com/ngoanpv)에게 감사). 스크리닝 요청이 더 이상 막다른 길로 가지 않습니다. 후보가 여럿인 1차 선별 결과는 미해결 상태가 아니라 답변으로 취급되고, 개별 종목이 확정되면 역할을 마칩니다. 가격 검증은 종목 코드 숫자, 현지화된 날짜, 주식 수, 포지션 원가를 호가로 읽지 않지만, 기록된 OHLC 범위를 벗어난 호가는 여전히 거부합니다 (closes [#955](https://github.com/HKUDS/Vibe-Trading/issues/955)). 에이전트 메모리의 인덱스 앵커 정확 일치와 결과 상한 처리도 함께 수정되었습니다 ([#956](https://github.com/HKUDS/Vibe-Trading/pull/956), [#957](https://github.com/HKUDS/Vibe-Trading/pull/957), [@santhreal](https://github.com/santhreal)에게 감사).@@ -483,7 +484,7 @@ clone에서 실행하세요(`pip install -e .`).</details><details>-<summary><b>브로커 커넥터</b> <sub>12개 브로커 — read + paper, 지원 시 bounded-live</sub></summary>+<summary><b>브로커 커넥터</b> <sub>13개 브로커 — read + paper, 지원 시 bounded-live</sub></summary>connector-first 프로필. 대부분의 브로커가 read + 페이퍼 계정 주문 실행을 지원하지만 IBKR은 읽기 전용이고, Robinhood는 페이퍼 계정 없이 실거래 전용이며, Trading 212는 페이퍼를 포함해 주문 실행을 모두 거부하고, 실거래 주문 실행은 사용자 정의 mandate(심볼 허용목록, 주문 크기 / 익스포저 상한, 일일 거래 한도, 즉시 kill switch)로 제한되고 자금을 보관하지 않습니다 — 실행은 브로커가 합니다. 주문 실행 도구는 MCP에 노출되지 않습니다(agent + CLI 전용). 리서치 / 백테스트 경로는 구조적으로 모든 실거래 엔드포인트에서 차단됩니다.@@ -495,6 +496,7 @@ connector-first 프로필. 대부분의 브로커가 read + 페이퍼 계정 주| **Alpaca** | US | read + paper + bounded live (+ TAP credential-isolation mode) || **OKX** · **Binance** | crypto | read + paper + bounded live || **Futu** | HK / US / A | read + paper + bounded live |+| **eToro** | global | read + paper + bounded live (Public API; demo 키는 구조적으로 `/demo` 경로에만 도달하며, 카피 트레이딩 워크플로도 지원) || **MetaTrader 5** | forex / CFD | read + paper + bounded live (Exness-style; demo ⇔ paper identity guard) || **Longbridge** · **Dhan** · **Shoonya** | US / HK · India (NSE/BSE) | read + paper only — no runtime paper/live discriminator, so live order placement is hard-refused || **Trading 212** | UK / EU | fully read-only — `place_order` / `cancel_order` hard-refuse even paper |@@ -568,6 +570,81 @@ Intraday bars: 1m / 5m / 15m / 30m / 1H / 4H / 1D. 15 metrics + benchmark compar</details>+<details>+<summary><b>Quant Library</b> <sub>19개 모듈 265개의 테스트된 함수, 모든 경로에서 호출 가능</sub></summary>++`src/quantlib`는 agent가 필요로 하는 각 금융 수학에 대해 테스트된 구현을 **하나씩만**+보유합니다. skill은 이제 이 함수들을 **import**하며, markdown 코드 블록 안에 수식을+품고 있지 않습니다 — `SKILL.md` 안에 가격 산식이 살고 있다면 그것은 패턴이 아니라+버그입니다.++| 모듈 | 다루는 범위 |+|------|------------|+| `options` | Black-Scholes 가격 + greeks, 내재변동성 역산 |+| `fixedincome` | 채권 수학, Nelson-Siegel / Svensson 커브 피팅 |+| `credit` | Altman Z-score, Merton / KMV 부도거리 |+| `timeseries` | 정상성, 공적분, GARCH, bootstrap |+| `risk` · `var_backtest` | VaR / CVaR / EVT 및 그 백테스트 |+| `attribution` | Brinson-Fachler 성과요인 분해 |+| `performance` · `fundmath` | TWR / MWR / Modified Dietz; XIRR / MOIC / DPI / TVPI |+| `factormodel` · `eventstudy` | 팩터 회귀, 이벤트 스터디 |+| `multipletesting` · `crossvalidation` | 다중검정 보정, purged CV |+| `impact` | 시장충격 모델 |++읽기 전용 `quantlib_call` 도구가 하나의 계약으로 전체에 도달하므로, `bash`가 차단된+CLI·Web UI·REST API·MCP에서도 금융 수학이 동작합니다. 구조적으로 shell이 **아닙니다** —+모듈 허용 목록, `__all__` 전용 디스패치, `export_*` 거부. 계량경제 함수는 `stats`+엑스트라(`pip install "vibe-trading-ai[stats]"`)가 필요하며, 지연 임포트하면서 무엇이+빠졌는지 알려줍니다.++</details>++<details>+<summary><b>밸류에이션 & 기관 리서치</b> <sub>DCF, 컴프스, 재무제표 연동, 그리고 여섯 개의 리서치 커맨드</sub></summary>++입력을 스스로 지어내기를 거부하는 밸류에이션 엔진입니다. `contracts.py`의 유일한+규칙: **입력이 빠지면 모델은 실행 불가(NOT RUNNABLE)이며, 조용히 기본값으로 채우지+않는다** — 밸류에이션 모델의 모든 기본값은 상수의 옷을 입은 견해이기 때문입니다.++| 모델 | 알아둘 동작 |+|------|------------|+| `run_dcf` | FCFF 브리지, WACC 구성, 기중 할인, 순부채 브리지, WACC×g 민감도 그리드. 이중 터미널 밸류: 각 방식을 상대 방식의 내재 배수와 내재 g로 교차 검증 |+| `run_comps` | EV 브리지, LTM + 역년 캘린더화, 배수 행렬. 분모가 양수가 아닌 피어는 **제외하고 보고**하며, 음수 배수로 평균에 섞지 않습니다 |+| `threestatement` | 연동 추정. 강제 밸런스 단언, 명시적 리볼버 플러그, 수렴하지 않으면 raise하는 이자↔부채 순환 반복 |++산출물은 입력 해시 기반으로 버전 관리되며 xlsx / pptx로 내보낼 수 있습니다.++6개의 슬래시 커맨드가 워크플로를 구동합니다 — `/comps` `/dcf` `/attrib` `/memo`+`/earnings` `/screen` — 각각 단계 골격과 **산술적으로 정합한** 예시를 갖고 있습니다+(Brinson 분해는 액티브 리턴에 정확히 합산되고, 실적 브리지는 EPS 변화에 정확히+합산됩니다). `investor-lenses` skill은 유명 투자자의 사고 프레임워크를 분석 오버레이로+쌓습니다: 각 렌즈는 우선 신호·탈락 조건·전형적 오용으로 이루어진 운영 절차이며,+인물 전기가 아니고 어떤 도구도 지목하지 않습니다.++바 외에도 `src/entities`가 불규칙 일자의 현금흐름(NAV, 캐피털 콜, 쿠폰)을 수집하고,+`cashflow_performance`가 그 위에서 XIRR / MOIC / DPI / TVPI / TWR / Modified Dietz /+MWR를 산출합니다. 이 경로는 바 엔진과 의도적으로 **평행**하게 설계되어, `nav` 컬럼이+바 엔진에 도달해 종가로 가격이 매겨지는 일이 결코 없습니다.++</details>++<details>+<summary><b>거버넌스 & 감사 추적</b> <sub>"그 숫자는 어떤 방법론이 만들었나?"에 답하기</sub></summary>++모든 실행은 프롬프트, skill 내용, 도구 레지스트리, 패키지 버전을 해시한 **manifest**를+기록합니다. 한 달 전에 나온 숫자도 그것을 만든 정확한 방법론까지 추적할 수 있습니다.++**감사 원장**은 각 레코드를 직전 레코드의 해시에 연결하고 fsync하므로, 레코드의 수정이나+삭제를 탐지할 수 있습니다 — 자신의 해시까지 다시 계산한 수정이라도 바로 다음 레코드에서+`prev_hash_mismatch`로 잡힙니다. 타임스탬프는 항상 호출자가 제공하며, 이 모듈은+`datetime.now()`를 호출하지 않습니다.++트레이스 마스킹은 **sink 단위**입니다: 도구 호출 인자와 실시간 감사 원장은 fail-closed+sink를 사용해 `content`를 마스킹된 상태로 두고, 도구 결과 sink만 `content`를 해제하며+그 문자열 리프를 패턴 세척합니다. `env`는 어느 쪽에서도 해제되지 않습니다.++</details>+## 🎬 데모<div align="center">@@ -735,6 +812,7 @@ skill + MCP config가 agent의 skills directory에 다운로드됩니다. 자세| `VIBE_TRADING_ALLOWED_RUN_ROOTS` | No | generated-code run directory용 추가 comma-separated roots || `VIBE_TW_STOCK_DB` | No | 대만 시장 SQLite 스냅샷 경로. 읽기 전용 `taiwan_stock_data` 도구는 스키마가 유효할 때만 등록됩니다 || `VIBE_TRADING_EXTRA_CORS_ORIGINS` | No | 루프백 CORS 기본값에 **추가**되는 오리진(쉼표 구분). `CORS_ORIGINS`는 대체 |+| `CONTENT_FILTER_WARNING_THRESHOLD` | No | 콘텐츠 필터 경고 비율 임계값(기본 0.05 = 5%). 콘텐츠 검열로 차단된 LLM 응답 비율이 이를 넘으면 run card가 프로바이더 변경을 권고합니다. |<sub>* Ollama는 API key가 필요 없습니다. OpenAI Codex는 ChatGPT OAuth를 사용하며 token을 `agent/.env`가 아니라 `oauth-cli-kit`을 통해 저장합니다.</sub>@@ -1060,7 +1138,7 @@ curl -X POST http://localhost:8899/scheduled-runs/playbooks/premarket-brief \## 🔌 MCP Plugin-Vibe-Trading은 모든 MCP-compatible client를 위해 64개 MCP tools를 제공합니다. stdio subprocess로 실행되므로 server setup이 필요 없습니다. 핵심 research tools는 HK/US/crypto에서 API key 없이 작동하고, trading connector tools는 선택된 connector profile을 사용하며, `run_swarm`만 LLM key가 필요합니다.+Vibe-Trading은 모든 MCP-compatible client를 위해 70개 MCP tools를 제공합니다. stdio subprocess로 실행되므로 server setup이 필요 없습니다. 핵심 research tools는 HK/US/crypto에서 API key 없이 작동하고, trading connector tools는 선택된 connector profile을 사용하며, `run_swarm`만 LLM key가 필요합니다.**환경 변수:** server는 client가 직접 spawn하므로 shell의 `export`는 전달되지 않습니다 —— client의 `env` block에 설정하세요. 생성된 backtest code는 allowed run roots 안으로 제한되므로, 결과를 자신의 작업 directory에 쓰려면 `VIBE_TRADING_ALLOWED_RUN_ROOTS`가 필요합니다:@@ -1116,7 +1194,7 @@ vibe-trading-mcp --transport sse # legacy SSE (deprecated)</details>-**노출되는 MCP tools(64):** `list_skills`, `load_skill`, `start_research_goal`, `get_research_goal`, `add_goal_evidence`, `update_research_goal_status`, `backtest`, `factor_analysis`, `alpha_zoo`, `alpha_bench`, `analyze_options`, `analyze_options_payoff`, `pattern_recognition`, `read_url`, `read_document`, `web_search`, `write_file`, `read_file`, `trading_connections`, `trading_select_connection`, `trading_check`, `trading_account`, `trading_positions`, `trading_orders`, `trading_quote`, `trading_history`, `list_swarm_presets`, `run_swarm`, `get_market_data`, `get_fund_flow`, `get_dragon_tiger`, `get_northbound_flow`, `get_margin_trading`, `get_block_trades`, `get_shareholder_count`, `get_lockup_expiry`, `get_sector_info`, `get_research_reports`, `get_stock_news`, `get_sec_filings`, `get_financial_statements`, `get_options_chain`, `get_stock_profile`, `screen_market`, `search_symbol`, `get_macro_series`, `iwencai_search`, `qveris_search`, `qveris_inspect`, `qveris_execute`, `get_institutional_holdings`, `etf_holdings`, `prediction_market`, `research_papers`, `get_swarm_status`, `get_run_result`, `list_runs`, `reap_stale_runs`, `retry_run`, `analyze_trade_journal`, `extract_shadow_strategy`, `run_shadow_backtest`, `render_shadow_report`, `scan_shadow_signals`.+**노출되는 MCP tools(70):** `list_skills`, `load_skill`, `start_research_goal`, `get_research_goal`, `add_goal_evidence`, `update_research_goal_status`, `backtest`, `factor_analysis`, `alpha_zoo`, `alpha_bench`, `analyze_options`, `analyze_options_payoff`, `pattern_recognition`, `read_url`, `read_document`, `web_search`, `write_file`, `read_file`, `trading_connections`, `trading_select_connection`, `trading_check`, `trading_account`, `trading_positions`, `trading_orders`, `trading_quote`, `trading_history`, `list_swarm_presets`, `run_swarm`, `get_market_data`, `get_fund_flow`, `get_dragon_tiger`, `get_northbound_flow`, `get_margin_trading`, `get_block_trades`, `get_shareholder_count`, `get_lockup_expiry`, `get_sector_info`, `get_research_reports`, `get_stock_news`, `get_sec_filings`, `get_financial_statements`, `get_options_chain`, `get_stock_profile`, `screen_market`, `search_symbol`, `get_macro_series`, `iwencai_search`, `qveris_search`, `qveris_inspect`, `qveris_execute`, `get_institutional_holdings`, `etf_holdings`, `prediction_market`, `research_papers`, `get_swarm_status`, `get_run_result`, `list_runs`, `reap_stale_runs`, `retry_run`, `analyze_trade_journal`, `extract_shadow_strategy`, `run_shadow_backtest`, `render_shadow_report`, `scan_shadow_signals`, `quantlib_call`, `cashflow_performance`, `orderbook_depth`, `sentiment`, `technical_indicators`, `get_fundamentals`.### SWARM 외부 MCP tools@@ -1210,6 +1288,45 @@ vibe-trading connector history EURUSD---+## 🔌 eToro Public API 커넥터++API 키 쌍(`x-api-key` + `x-user-key`)으로 [eToro Public API](https://builders.etoro.com/)의 데모·실계좌에 연결합니다. 데모와 실계좌는 **구조적으로** 분리되어 있으며, 데모 키는 `/demo` API 경로에만 도달합니다.++`~/.vibe-trading/etoro.json`을 설정하세요(직접 생성; 지원되는 환경에서는 `chmod 600`):++```json+{+ "api_key": "YOUR_PUBLIC_API_KEY",+ "user_key": "YOUR_USER_KEY",+ "profile": "paper"+}+```++또는 `~/.vibe-trading/.env`에 `ETORO_API_KEY`와 `ETORO_USER_KEY`를 설정해도 됩니다.++그다음:++```bash+vibe-trading connector use etoro-paper-sdk+vibe-trading connector check+vibe-trading connector account+vibe-trading connector positions+vibe-trading connector quote BTC+```++| 프로파일 | 계좌 | 주문 |+|---------|------|------|+| `etoro-paper-sdk` | 데모 | 읽기 전용 |+| `etoro-live-sdk-readonly` | 실계좌 | 읽기 전용 |+| `etoro-paper-trade` | 데모 | 데모 경로에 직접 주문 |+| `etoro-live-trade` | 실계좌 | mandate + kill switch 게이트 |++심볼 조회는 eToro의 `internalSymbolFull` 검색을 사용합니다(예: `BTC` → instrument id `100000`). 거래 전에 `etoro_search_instruments` 에이전트 도구로 티커를 해석하세요.++안전 경계: 데모와 실계좌는 경로 분리 + 키 바인딩입니다(`paper_guard: path_separated_key_bound`). 실계좌에서 리스크를 늘리는 동작(신규 진입, 카피 시작/증액)에는 인가된 mandate, 중단되지 않은 명확한 상태, 그리고 카피 명목금액 제한을 위한 검증된 USD 계좌가 필요합니다. 검증된 전량·부분 청산, 미체결 주문 취소, 카피 종료는 중단 상태에서도 사용할 수 있으며 모두 감사 로그에 남습니다. 대기 중인 청산의 취소와 포지션 스톱 수정은 **데모 전용**입니다. 두 동작은 익스포저를 늘리거나 추가 증거금을 이전할 수 있는데 증분 USD 리스크를 정량화할 만큼의 API 데이터가 없어, 실계좌 경로는 fail-closed됩니다. 카피 금액은 eToro 계좌 통화로 표시되며, 카피 시작·조정마다 호출자가 1~35자 URL-safe 참조 id를 제공해야 폴링할 수 있습니다. eToro 전용 쓰기 도구(`etoro_close_position`, `etoro_copy_*` 등)는 **에이전트 도구 전용**으로 MCP나 CLI에 노출되지 않습니다. 롤백: 해당 커넥터 커밋을 revert하거나 프로파일을 비활성화하세요. halt는 새로운 실계좌 리스크 증가 동작을 차단합니다.++---+## 🔌 외부 MCP 서버에서 도구 불러오기 (MCP Client 모드)> **위의 MCP Plugin과는 반대 방향입니다.**@@ -1439,7 +1556,7 @@ Vibe-Trading/├── agent/ # Backend (Python)│ ├── cli/ # CLI package — interactive TUI + subcommands│ ├── api_server.py # FastAPI server — runs, sessions, upload, swarm, SSE-│ ├── mcp_server.py # MCP server — 64 tools for OpenClaw / Claude Desktop+│ ├── mcp_server.py # MCP server — 70 tools for OpenClaw / Claude Desktop│ ││ ├── src/│ │ ├── agent/ # ReAct agent core@@ -1454,7 +1571,7 @@ Vibe-Trading/│ │ ├── memory/ # Cross-session persistent memory│ │ │ └── persistent.py # file-based memory (~/.vibe-trading/memory/)│ │ │-│ │ ├── tools/ # 68 auto-discovered agent tools+│ │ ├── tools/ # 94 auto-discovered agent tools│ │ │ ├── backtest_tool.py # run backtests│ │ │ ├── remember_tool.py # cross-session memory (save/recall/forget)│ │ │ ├── skill_writer_tool.py # skill CRUD (save/patch/delete/file)@@ -1568,7 +1685,38 @@ Vibe-Trading은 **[HKUDS](https://github.com/HKUDS)** agent ecosystem의 일부Vibe-Trading에 기여해 주신 모든 분께 감사드립니다!-최근 v0.1.12 사이클 기여자 및 크레딧:+최근 v0.1.13 사이클 기여자 및 크레딧:++- @santhreal — a 17-PR correctness and resource-leak sweep: the HTTP throttle now sweeps stale buckets interval-aware so rate-limit spacing survives (#1047), the rate limiter stops growing without bound on unique client IPs (#1039), the event bus notifies and removes subscribers on clear (#1046), `_json_loads` is guarded against corrupted JSON in database columns (#1045), NaN/inf volume and close no longer crash `format_grounding_block` (#1043), `inf` from `pct_change` on zero equity is replaced (#1041), Shoonya tolerates empty-string numerics (#1038), drawdown is computed from the absolute peak on negative equity (#958) and insolvent empty cross accounts are marked liquidated (#959), plus exact memory index anchors (#956/#957) and an A-share code / trade-journal parsing batch (#919, #926–#935)+- @shadowinlife — HK market-data fallback routing repaired with a new Tencent HK source (#1000), Shadow multi-market backtests split per settlement currency (#997), bare US tickers routed to `us_equity` (#994), MCP list/dict arguments tolerating JSON-string clients (#993), generated signal engines passing the backtest sandbox validator (#992), and the memory GC dry-run fix (#973)+- @honginp — the USD-M perpetual lifecycle end to end: funding and liquidation execution (#903), isolated & cross margin liquidation modelling (#889), ordered fidelity evidence persistence (#936), atomic position rebalancing (#951), and strict historical position rebalancing that preserves collateral, funding, fees and fill evidence (#1019)+- @QCYTSN — the desktop Electron shell lifecycle (#923), Windows packaging with a checksum-pinned embedded runtime and `safeStorage` credential handling (#1015), and Settings model discovery + runtime identity UX (#924)+- @Robin1987China — the `technical_indicators` (#921) and `sentiment` (#939) tools, annualisation entries for 15 data sources with a CI coverage gate (#891), indicator inputs read without sampling (#1005), and the `quant_strategy_desk` final report aggregator (#1048)+- @Shizoqua — MCP specs cache keyed on remote server identity (#1049), memory FTS5 ranking with importance decay (#1032), swarm detection of `ok`/`success:false` tool failures (#1028), and lowercase `4h` resampling in the yfinance loader (#1013)+- @ngoanpv — timezone-aware scheduled research (#954, closes #953), one malformed record no longer breaking the whole store (#1003), interval creates without a resolvable zone (#1004), and delete-route job id validation (#980)+- @he-yufeng — risk x-ray artifacts in portfolio runs (#900), Portfolio Studio artifacts surfaced in run detail (#966), yfinance crypto routed to the crypto engine (#970), and hierarchy-routed memory entries keeping their `.md` extension (#984)+- @wiliao — Canadian markets end to end: TSX/TSXV market data (#1024) and symbol support through search fail-fast and CSV grounding (#1037)+- @MuggleJinx — session and run history stored under the user runtime root (#925, closes #904) and `~/.vibe-trading/.env` loaded on the connector command path (#902, closes #901)+- @cgycorey — Alpha Zoo tools reaching MCP (#979) and mapping-shaped Responses stream events accepted (#1034)+- @ofeksh-tr — the eToro Public API connector with path-separated demo/real profiles (#989) — broker connectors 12 → **13**+- @su322 — source message ids threaded into IM outbound so QQ replies stay passive (#1008), and the output principle that stops the agent once evidence is sufficient (#1010)+- @zwrong — the `vibe-trading update` self-upgrade command (#1020)+- @yrk111222 — ModelScope as an OpenAI-compatible provider (#1011)+- @x-lambda — agent proxy opt-out covering sync and async clients (#995)+- @dineeshd — authenticated API capability surfaces under enforced CSP (#961)+- @hhj123123 — the canonical run root preserved after HOME isolation (#1012)+- @00EVA — the Settings model dropdown auto-resizing so long provider/model slugs stay readable (#1006)+- @darkknight4563 — `bar_returns` kept bit-identical for gapped positive series (#895)+- @sambazhu — mootdx config pre-seeded in the sandbox home (#982)+- @yagnikpipaliya — self-healing for Claude models that deprecate the `temperature` field (#890, closes #856)+- @JungHoonGhae — the Korea equity (KRX) market engine (#693)+- @shugaoye — the OpenBB Workspace bridge (#817)+- @TSENGCHIENFENG — the read-only Taiwan snapshot tool (#848)+- @ddy4633, @tyj147454413-cmd, @y85998607, @klmtseng, @ebujinovch, @g0rdonL, @AmirF194, @Echoandelementwebsites, @dvirarad, @1anter — correlation, loader, vn.py-export, PIT-fundamentals and alpha-bench fixes carried into this cycle+- @warren618 / Haozhe Wu — the finance-math layer and valuation engine, the entity + cash-flow spine, run manifests and the hash-chained audit ledger, the four read-only data tools, the institutional commands and investor lenses, the grounding-gate repair, the analytic options payoff tool (#946), Codex OAuth recovery (#1014), the Shadow runtime root fix (#1017), release integration and open-PR/issue triage++<details>+<summary>v0.1.12 사이클 기여자</summary>- @santhreal — a 30-PR correctness sweep: strict-JSON / finite-number hardening across metrics, factors, pattern, and options (#764/#765/#766/#767/#739/#740/#744), loader correctness (#761 yahoo 1m bars), and session / journal robustness (#762/#763/#768/#769/#770)- @xkam7ar — broad reliability across packaging, web, scheduler, swarm, and CLI (#584), cancellation before the first AgentLoop iteration (#641, closes #638), QVeris session budget + atomic credit accounting (#685/#686), CI / OOS gates (#630/#632), and journal month-filter / side-parse fixes (#626/#628)@@ -1599,6 +1747,8 @@ Vibe-Trading에 기여해 주신 모든 분께 감사드립니다!- @GabbaTauchi — reported the native zai streaming / base-URL bug (#758)- @warren618 / Haozhe Wu — the correlation regime backend integration, the zai provider streaming + base-URL resolution fix (#758), release integration, and open-PR/issue triage+</details>+<details><summary>v0.1.11 사이클 기여자</summary>diff --git a/README_zh.md b/README_zh.mdindex 9046c56ae..ce275a759 100644--- a/README_zh.md+++ b/README_zh.md@@ -52,13 +52,14 @@> ⚠️ **安全警告:** X 账号 `VibeTrading_HKU`、Virtuals 项目 `101845` 及代币合约 `0x640BDBF77b6447E8b7DB7894cED84BD1c40571f4` 均非 Vibe-Trading 官方。我们从未发行或背书任何代币或 meme 币。请勿购买、连接钱包或签名。[详细说明](SECURITY.md#official-channels--impersonation)。+- **2026-08-10** 🚀 **v0.1.13 发布**([Release notes](https://github.com/HKUDS/Vibe-Trading/releases/tag/v0.1.13),`pip install -U vibe-trading-ai`):自 0.1.12 以来 408 个 commit、162 个已合并 PR,是迄今最大的一次发布。**主角是一个修复而非新功能:身份闸门不再拒绝它本来已经拿到证据的回答。**此前一个格式完全正确的问题会真跑几分钟工具调用,然后返回*「当前无法安全确认标的身份或价格证据」*。根因是:`.SS` 与 `.SH` 被当成两个不同标的,于是**每一个上交所代码都永久处于 ambiguous**;一次失败的旁路查询能把已经锁定的身份降级;Yahoo 对所有中日韩文查询返回 HTTP 400,被记成数据源*失败*而不是「此处未上市」;一张写死的按工具白名单挡掉了 17 种已写进文档的参数写法中的 11 种;中文回答因为写了 `雅虎`、`元` 而不是 ASCII 数据源名被拒;千位分隔符把 `¥1,309.22` 从中间切开,导致拿 `1` 去和实测区间比对。概念性问题和对比报告也不再走进死胡同。超出已记录 OHLC 证据的报价**仍然会被拒绝**。**新增:** `src/quantlib`——17 个模块 249 个经测试的函数(期权、债券、信用、计量经济、VaR/CVaR/EVT、业绩归因、事件研究、purged CV),通过只读的 `quantlib_call` 在 CLI、Web UI、REST API 与 MCP 上均可触达,skill 从此 import 金融数学,而不再把公式抄在 markdown 里;一个**估值引擎**(`run_dcf` / `run_comps` / 三表联动),唯一规则是输入缺失就让模型「不可运行」,绝不静默填默认值;一条**实体 + 不规则现金流主干**(XIRR / MOIC / DPI / TVPI,以及经 `cashflow_performance` 的 TWR / Modified Dietz),刻意与 bar 引擎保持平行;**治理写进每一次运行**——对 prompt、skill、工具注册表与依赖版本做哈希 manifest,外加哈希链式并 fsync 的审计账本,即便一次编辑同时重算了自己的哈希也会在下一条记录被抓到;四个基于免费公开数据源的只读数据工具(**SEC 13F** 带季度环比持仓差异;**ETF 穿透**——沪深300 ETF 解析出 342 个持仓、覆盖净值的 98.66%,而非季报前十大;**预测市场**以标注单位的隐含概率呈现;**arXiv/OpenAlex** 只抽取原文锚定的结论);六个机构研究命令(`/comps` `/dcf` `/attrib` `/memo` `/earnings` `/screen`);投资人透镜独立成 skill;五个可直接排期的研究 playbook;带校验和固定 Windows 打包与 `safeStorage` 的**桌面 Electron 外壳**;**eToro** 成为第 13 个券商连接器;**韩国 KRX** 成为第 9 个回测引擎;一个 **OpenBB Workspace 桥接**;加拿大股票全链路打通;以及 `sentiment`、`technical_indicators`、`options_payoff`、`orderbook_depth`、ModelScope 和 `vibe-trading update`。**正确性:** SEC 报告期改按 `(start, end)` 区间取帧——此前年度口径实际只返回了单个季度,低估 4.2 倍;tushare A 股价格改为复权,此前跨除权日的原始收益率最多偏离 47 个百分点;`bar_returns` 不再把停牌记成 0% 的波动;年化换算覆盖全部 24 个数据源;补上了一个沙箱缺口——生成代码此前可以 import 券商层,或通过改名绑定触达 `socket`/`subprocess`;跨市场组合回测遇到混合币种直接拒绝,而不是把不同货币加总成一条净值曲线。感谢 @santhreal、@shadowinlife、@Robin1987China、@he-yufeng、@QCYTSN、@Shizoqua、@honginp、@cgycorey、@wiliao、@ngoanpv、@x-lambda、@ofeksh-tr、@00EVA、@zwrong、@yrk111222、@su322、@hhj123123、@dineeshd、@sambazhu、@ddy4633、@tyj147454413-cmd、@y85998607、@JungHoonGhae、@shugaoye、@TSENGCHIENFENG、@darkknight4563、@MuggleJinx、@klmtseng、@ebujinovch、@g0rdonL、@AmirF194、@Echoandelementwebsites、@yagnikpipaliya、@dvirarad 和 @1anter。- **2026-08-09** 🪟 **安全的 Windows 打包、加拿大市场、ModelScope 与 MCP Alpha Zoo**:Windows 桌面打包现可组装校验和锁定的嵌入式 Python 3.12 运行时及 x64 NSIS 评审/签名流程,并用 Electron `safeStorage` 保存白名单内的凭据。渲染进程只能设置或清除密钥、不能读取;明文配置仅迁移一次;解密值只会注入所属后端;未签名评审构建与签名构建遇到错误签名状态都会关闭失败。本 PR 未发布任何安装包产物([#1015](https://github.com/HKUDS/Vibe-Trading/pull/1015))。加拿大股票现在全链路可用:`.TO`/`.V` 代码按 CAD 分类,经 Yahoo → yfinance → local 回退链取数,使用加拿大专属 GlobalEquity 规则执行,以 `XIC.TO` 为基准,并拒绝混合币种聚合。严格 USD-M 历史回测也可选择 `position_adjustment=rebalance`,在增减仓过程中保持抵押品、资金费、手续费、已实现盈亏、清算行为与不可变成交证据一致([#1024](https://github.com/HKUDS/Vibe-Trading/pull/1024)、[#1019](https://github.com/HKUDS/Vibe-Trading/pull/1019),关闭 [#952](https://github.com/HKUDS/Vibe-Trading/issues/952))。ModelScope 通过官方 OpenAI-compatible 托管推理端点成为内置 provider,默认模型为 `Qwen/Qwen3.5-27B`([#1011](https://github.com/HKUDS/Vibe-Trading/pull/1011));新命令 `vibe-trading update` 会区分 wheel 安装与 editable/源码检出,安装刚刚检查到的精确版本,并从新进程验证 metadata、绝不降级([#1020](https://github.com/HKUDS/Vibe-Trading/pull/1020));`alpha_zoo` 与受限的 `alpha_bench` 也进入 MCP(共 64 个工具),对时间跨度、结果数量、输出路径和报告创建实施安全边界([#979](https://github.com/HKUDS/Vibe-Trading/pull/979))。经验证的 Python 与前端锁文件刷新还更新了分组依赖、`postcss` 和 `akshare`([#1021](https://github.com/HKUDS/Vibe-Trading/pull/1021)、[#1023](https://github.com/HKUDS/Vibe-Trading/pull/1023)、[#1026](https://github.com/HKUDS/Vibe-Trading/pull/1026)、[#1027](https://github.com/HKUDS/Vibe-Trading/pull/1027))。感谢 [@QCYTSN](https://github.com/QCYTSN)、[@wiliao](https://github.com/wiliao)、[@honginp](https://github.com/honginp)、[@yrk111222](https://github.com/yrk111222)、[@zwrong](https://github.com/zwrong) 与 [@cgycorey](https://github.com/cgycorey)。- **2026-08-08** 🧱 **桌面壳、eToro、原子化再平衡与可靠性加固**:新增源码版 Electron 宿主,接管现有后端的完整生命周期——随机回环端口、每次启动独立密钥、五语启动恢复与所属进程清理;eToro 以严格分离的模拟/真实账户配置加入连接器,实盘增险操作仍须通过授权边界并写入审计,API 能力入口也已要求认证并执行 CSP([#923](https://github.com/HKUDS/Vibe-Trading/pull/923)、[#989](https://github.com/HKUDS/Vibe-Trading/pull/989)、[#961](https://github.com/HKUDS/Vibe-Trading/pull/961))。回测新增可选的原子化同向再平衡与不可变成交证据;Shadow 按结算币种拆分跨市场运行、绝不虚构汇率聚合,并遵循配置的运行根目录;技术指标改用连续、未抽样历史,负权益回撤和空仓破产账户的清算边界也得到纠正([#951](https://github.com/HKUDS/Vibe-Trading/pull/951)、[#997](https://github.com/HKUDS/Vibe-Trading/pull/997)、[#1017](https://github.com/HKUDS/Vibe-Trading/pull/1017)、[#1005](https://github.com/HKUDS/Vibe-Trading/pull/1005)、[#958](https://github.com/HKUDS/Vibe-Trading/pull/958)、[#959](https://github.com/HKUDS/Vibe-Trading/pull/959))。OpenAI Codex OAuth 使用独立且并发安全的凭据存储,并可从一次后端 401 恢复;禁用代理同时覆盖同步与异步客户端;沙箱子进程保留规范运行目录;定时研究隔离损坏记录并修正 interval 时区校验;小写 `4h` 现在返回真正的四小时 K 线([#1014](https://github.com/HKUDS/Vibe-Trading/pull/1014)、[#995](https://github.com/HKUDS/Vibe-Trading/pull/995)、[#1012](https://github.com/HKUDS/Vibe-Trading/pull/1012)、[#1003](https://github.com/HKUDS/Vibe-Trading/pull/1003)、[#1004](https://github.com/HKUDS/Vibe-Trading/pull/1004)、[#1013](https://github.com/HKUDS/Vibe-Trading/pull/1013))。QQ 被动回复携带原消息 ID,长模型 slug 完整可读,Agent 在证据充分时停止扩展调查([#1008](https://github.com/HKUDS/Vibe-Trading/pull/1008)、[#1006](https://github.com/HKUDS/Vibe-Trading/pull/1006)、[#1010](https://github.com/HKUDS/Vibe-Trading/pull/1010))。感谢 [@QCYTSN](https://github.com/QCYTSN)、[@Shizoqua](https://github.com/Shizoqua)、[@ngoanpv](https://github.com/ngoanpv)、[@hhj123123](https://github.com/hhj123123)、[@su322](https://github.com/su322)、[@Robin1987China](https://github.com/Robin1987China)、[@shadowinlife](https://github.com/shadowinlife)、[@dineeshd](https://github.com/dineeshd)、[@honginp](https://github.com/honginp)、[@santhreal](https://github.com/santhreal)、[@00EVA](https://github.com/00EVA)、[@x-lambda](https://github.com/x-lambda)、[@ofeksh-tr](https://github.com/ofeksh-tr)。-- **2026-08-07** 🛡️ **更少的误拒、补上的沙箱缺口、QVeris 上 MCP**:接地闸门不再因为「从来就不是价格的数字」而拒掉格式良好的答案 —— 置信度评分、指标读数、均线窗口、`8/5` 这类无年份日期、百分比区间,以及交易计划自己的触发位(`收盘 ≥6.45` 是条件,不是报价);同时,超出已记录 OHLC 证据的报价**依然会被拒**,而日期写作 `08-05` 的价格表现在能匹配上自己的证据,不再整行判为无出处([#1001](https://github.com/HKUDS/Vibe-Trading/issues/1001)、[#983](https://github.com/HKUDS/Vibe-Trading/issues/983))。**沙箱**:生成的策略代码不能再导入券商层,也不能通过重命名绑定触达 `socket`/`subprocess`/`os.system`/`ctypes` —— 这两条此前都是放行的,而策略应当使用的 `src.quantlib` 仍可导入。**QVeris** 的 discovery/inspect/execute 进入 MCP 界面(62 个工具),成本报价改为向市场查询而非信任调用方声明([#976](https://github.com/HKUDS/Vibe-Trading/pull/976),closes [#964](https://github.com/HKUDS/Vibe-Trading/issues/964),感谢 [@shadowinlife](https://github.com/HKUDS/Vibe-Trading/shadowinlife))。另外:修复港股行情的回退链路由并新增腾讯港股数据源、yfinance 加密货币改由加密引擎处理、内存条目写入与找回都带上 `.md` 后缀、MCP 的 list/dict 参数兼容发送 JSON 字符串的客户端、运行详情页展示 Portfolio Studio 产物([#1000](https://github.com/HKUDS/Vibe-Trading/pull/1000)、[#970](https://github.com/HKUDS/Vibe-Trading/pull/970)、[#984](https://github.com/HKUDS/Vibe-Trading/pull/984)、[#993](https://github.com/HKUDS/Vibe-Trading/pull/993)、[#980](https://github.com/HKUDS/Vibe-Trading/pull/980)、[#982](https://github.com/HKUDS/Vibe-Trading/pull/982)、[#966](https://github.com/HKUDS/Vibe-Trading/pull/966)、[#973](https://github.com/HKUDS/Vibe-Trading/pull/973),感谢 [@he-yufeng](https://github.com/HKUDS/Vibe-Trading/he-yufeng)、[@ngoanpv](https://github.com/HKUDS/Vibe-Trading/ngoanpv)、[@sambazhu](https://github.com/HKUDS/Vibe-Trading/sambazhu))。<details><summary>更早的新闻</summary>-- **2026-08-06** 🧮 **带测试的金融数学层 + 估值引擎 + 不规则现金流 + 接线的治理**:`src/quantlib` 把散落在 skills markdown 里的公式换成各自唯一的带测试实现 —— 期权、债券、信用、计量经济、VaR/CVaR/EVT、业绩归因、事件研究、多重检验控制、purged 交叉验证 —— 约 250 个函数,经新的只读工具 `quantlib_call` 在 Web/API/MCP 全部可达。估值引擎(`run_dcf`/`run_comps`/三表联动)遇到缺失输入直接判定不可运行,绝不静默填默认值;新的实体与现金流 spine 让净值、认缴出资、票息进入系统(`cashflow_performance` 提供 XIRR/MOIC/DPI/TVPI 与 TWR/Modified Dietz,`orderbook_depth` 计算加密货币 L2 冲击成本)。每次运行写入哈希 manifest,审计账本哈希链式串联、篡改可检测;30 个 swarm preset 按其工具真实能算什么全部重审 —— 算不出的交付物现在如实声明,而不是编造数字。+- **2026-08-07** 🛡️ **更少的误拒、补上的沙箱缺口、QVeris 上 MCP**:接地闸门不再因为「从来就不是价格的数字」而拒掉格式良好的答案 —— 置信度评分、指标读数、均线窗口、`8/5` 这类无年份日期、百分比区间,以及交易计划自己的触发位(`收盘 ≥6.45` 是条件,不是报价);同时,超出已记录 OHLC 证据的报价**依然会被拒**,而日期写作 `08-05` 的价格表现在能匹配上自己的证据,不再整行判为无出处([#1001](https://github.com/HKUDS/Vibe-Trading/issues/1001)、[#983](https://github.com/HKUDS/Vibe-Trading/issues/983))。**沙箱**:生成的策略代码不能再导入券商层,也不能通过重命名绑定触达 `socket`/`subprocess`/`os.system`/`ctypes` —— 这两条此前都是放行的,而策略应当使用的 `src.quantlib` 仍可导入。**QVeris** 的 discovery/inspect/execute 进入 MCP 界面(62 个工具),成本报价改为向市场查询而非信任调用方声明([#976](https://github.com/HKUDS/Vibe-Trading/pull/976),closes [#964](https://github.com/HKUDS/Vibe-Trading/issues/964),感谢 [@shadowinlife](https://github.com/HKUDS/Vibe-Trading/shadowinlife))。另外:修复港股行情的回退链路由并新增腾讯港股数据源、yfinance 加密货币改由加密引擎处理、内存条目写入与找回都带上 `.md` 后缀、MCP 的 list/dict 参数兼容发送 JSON 字符串的客户端、运行详情页展示 Portfolio Studio 产物([#1000](https://github.com/HKUDS/Vibe-Trading/pull/1000)、[#970](https://github.com/HKUDS/Vibe-Trading/pull/970)、[#984](https://github.com/HKUDS/Vibe-Trading/pull/984)、[#993](https://github.com/HKUDS/Vibe-Trading/pull/993)、[#980](https://github.com/HKUDS/Vibe-Trading/pull/980)、[#982](https://github.com/HKUDS/Vibe-Trading/pull/982)、[#966](https://github.com/HKUDS/Vibe-Trading/pull/966)、[#973](https://github.com/HKUDS/Vibe-Trading/pull/973),感谢 [@he-yufeng](https://github.com/HKUDS/Vibe-Trading/he-yufeng)、[@ngoanpv](https://github.com/HKUDS/Vibe-Trading/ngoanpv)、[@sambazhu](https://github.com/HKUDS/Vibe-Trading/sambazhu))。+- **2026-08-06** 🧮 **带测试的金融数学层 + 估值引擎 + 不规则现金流 + 接线的治理**:`src/quantlib` 把散落在 skills markdown 里的公式换成各自唯一的带测试实现 —— 期权、债券、信用、计量经济、VaR/CVaR/EVT、业绩归因、事件研究、多重检验控制、purged 交叉验证 —— 约 250 个函数,经新的只读工具 `quantlib_call` 在 CLI、Web UI、REST API 与 MCP 上全部可达。估值引擎(`run_dcf`/`run_comps`/三表联动)遇到缺失输入直接判定不可运行,绝不静默填默认值;新的实体与现金流 spine 让净值、认缴出资、票息进入系统(`cashflow_performance` 提供 XIRR/MOIC/DPI/TVPI 与 TWR/Modified Dietz,`orderbook_depth` 计算加密货币 L2 冲击成本)。每次运行写入哈希 manifest,审计账本哈希链式串联、篡改可检测;30 个 swarm preset 按其工具真实能算什么全部重审 —— 算不出的交付物现在如实声明,而不是编造数字。- **2026-08-05** 🔭 **机构持仓、ETF 穿透、预测市场、论文检索**:四个只读数据工具,全部基于免费公开数据源 —— SEC 13F 持仓(含季度环比变动);跨市场 ETF 成分穿透(沪深 300 ETF 解析出 342 个持仓、覆盖 98.7% 净值,而非季报前十);事件合约以标注单位的隐含概率呈现;arXiv/OpenAlex 检索对原文未写明的内容标注缺失,而不是推断。另有五个定时研究模板、六个机构研究命令(`/comps` `/dcf` `/attrib` `/memo` `/earnings` `/screen`)、独立成 skill 的投资人透镜,以及每个数字都能追溯回产出它的工具的 agent 内核。- **2026-08-04** 🔧 **正确性修复:基本面、A股价格、超长工具返回**:SEC 报表期间现在以 `(start, end)` 区间为键——一份 10-Q 会把真实季度和年初至今帧填在同一个截止日与同一个财季下,因此 `period="annual"` 此前对 AAPL FY2018–2020 返回的是单个季度(低报 4.2 倍),而季度序列里每个财年 Q4 槽位放的都是整年值;`get_fundamentals("AAPL.US")` 也不再返回 `ok:true` 加全空面板。Tushare 的 A 股价格在因子基准与回测两条路径上都做了复权——除权日的原始收盘收益率此前最多偏离 47 个百分点(300750.SZ,2023-04-26)——CSI300 基准则按每个交易日的时点成分股做掩码。跨市场组合回测遇到混合币种的代码集会直接拒绝,而不是把 CNY、USD、KRW 加进同一条净值曲线;期权腿按开仓时的波动率盯市,消除了最高达权利金 +93% 的首日虚假盈亏;超长工具返回改为按完整记录分页并给出总数,不再从 JSON 中间截断;`calc_metrics` 新增跟踪误差与基准 beta。- **2026-08-03** ⏰ **时区感知的定时研究 + 解除选股任务死锁**:定时任务现在支持可选的 IANA `timezone`,cron 按该时区的墙钟时间求值,因此节奏能穿越夏令时切换——春季跳变的时刻会被跳过,秋季重复的时刻只在第一次出现时运行;cron 字段新增逗号列表与区间(`1,3-5`),未设置时区的任务保持 UTC 语义,Web UI 也新增了五语齐备的 **Scheduled** 页面(此前前端完全没有定时入口)([#954](https://github.com/HKUDS/Vibe-Trading/pull/954),closes [#953](https://github.com/HKUDS/Vibe-Trading/issues/953),感谢 [@ngoanpv](https://github.com/ngoanpv))。选股请求不再走进死胡同:多候选的初筛结果被视为答案而非未完成的解析,并在锁定具体标的后退场;价格校验不再把股票代码数字、本地化日期、股数与持仓成本当作报价——同时仍然拒绝任何超出已记录 OHLC 证据的报价(closes [#955](https://github.com/HKUDS/Vibe-Trading/issues/955))。Agent 记忆另有索引锚点精确匹配与结果上限修复([#956](https://github.com/HKUDS/Vibe-Trading/pull/956)、[#957](https://github.com/HKUDS/Vibe-Trading/pull/957),感谢 [@santhreal](https://github.com/santhreal))。@@ -480,7 +481,7 @@ LONGBRIDGE_ACCESS_TOKEN=...</details><details>-<summary><b>Broker Connectors</b> <sub>12 家券商——读取 + 模拟盘,支持的券商可受约束实盘</sub></summary>+<summary><b>Broker Connectors</b> <sub>13 家券商——读取 + 模拟盘,支持的券商可受约束实盘</sub></summary>连接器优先(connector-first)的配置档。多数连接器支持读取 + 模拟盘下单 —— IBKR 只读,Robinhood 只有实盘(没有模拟盘),Trading 212 连模拟盘下单也一律拒绝;实盘下单受用户定义的 mandate 约束(标的白名单、下单规模 / 敞口上限、每日交易次数上限、即时 kill switch),且从不托管资金——由券商执行。下单类工具不经 MCP 暴露(仅 agent + CLI)。研究 / 回测路径在结构上被隔离,无法触达任何实盘端点。@@ -492,6 +493,7 @@ LONGBRIDGE_ACCESS_TOKEN=...| **Alpaca** | US | 读取 + 模拟盘 + 受约束实盘(+ TAP 密钥隔离模式) || **OKX** · **Binance** | crypto | 读取 + 模拟盘 + 受约束实盘 || **Futu** | HK / US / A | 读取 + 模拟盘 + 受约束实盘 |+| **eToro** | global | 读取 + 模拟盘 + 受约束实盘(Public API;demo 密钥在结构上只能访问 `/demo` 路径,另支持跟单交易流程) || **MetaTrader 5** | forex / CFD | 读取 + 模拟盘 + 受约束实盘(Exness 风格;demo ⇔ 模拟盘身份守卫) || **Longbridge** · **Dhan** · **Shoonya** | US / HK · India (NSE/BSE) | 仅读取 + 模拟盘——无运行时模拟/实盘判别标识,因此实盘下单被硬拒 || **Trading 212** | UK / EU | 完全只读——`place_order` / `cancel_order` 连模拟盘也硬拒 |@@ -565,6 +567,75 @@ LONGBRIDGE_ACCESS_TOKEN=...</details>+<details>+<summary><b>Quant Library</b> <sub>19 个模块 265 个经测试的函数,四条通路皆可调用</sub></summary>++`src/quantlib` 为 agent 需要的每一块金融数学各提供**一份**经测试的实现。skill 现在是+**import** 这些函数,而不再把公式抄在 markdown 代码块里——如果你在某个 `SKILL.md`+里发现了定价公式,那是 bug,不是范式。++| 模块 | 覆盖内容 |+|------|----------|+| `options` | Black-Scholes 定价 + greeks、隐含波动率反解 |+| `fixedincome` | 债券数学、Nelson-Siegel / Svensson 曲线拟合 |+| `credit` | Altman Z-score、Merton / KMV 违约距离 |+| `timeseries` | 平稳性、协整、GARCH、bootstrap |+| `risk` · `var_backtest` | VaR / CVaR / EVT 及其回测 |+| `attribution` | Brinson-Fachler 归因分解 |+| `performance` · `fundmath` | TWR / MWR / Modified Dietz;XIRR / MOIC / DPI / TVPI |+| `factormodel` · `eventstudy` | 因子回归、事件研究 |+| `multipletesting` · `crossvalidation` | 去偏显著性、purged CV |+| `impact` | 市场冲击模型 |++只读工具 `quantlib_call` 用一份契约触达全部函数,因此在 `bash` 被关闭的 CLI、Web UI、+REST API 与 MCP 上金融数学照样可用。它在结构上**不是 shell**——模块白名单、只按 `__all__` 分派、+`export_*` 一律拒绝。计量经济学部分需要 `stats` 额外依赖+(`pip install "vibe-trading-ai[stats]"`),相关函数惰性导入并会告诉你缺哪个。++</details>++<details>+<summary><b>估值与机构研究</b> <sub>DCF、可比公司、三表联动,以及六个研究命令</sub></summary>++一个拒绝自行编造输入的估值引擎。`contracts.py` 里只有一条规则:**输入缺失就让模型+「不可运行」,绝不静默填默认值**——估值模型里的每一个默认值,都是披着常量外衣的观点。++| 模型 | 值得知道的行为 |+|------|----------------|+| `run_dcf` | FCFF 桥、WACC 构建、期中折现、净债务桥、WACC×g 敏感性网格。双终值法:两种方法互相用对方的隐含倍数与隐含 g 交叉校验 |+| `run_comps` | EV 桥、LTM + 日历年归一、倍数矩阵。分母非正的可比公司会被**剔除并报告**,绝不作为负倍数混进均值 |+| `threestatement` | 联动预测,带硬性平衡断言、显式循环贷 plug,以及必须收敛否则抛错的利息↔负债循环迭代 |++产出物按输入哈希并做版本化,支持 xlsx / pptx 导出。++六个 slash 命令驱动工作流——`/comps` `/dcf` `/attrib` `/memo` `/earnings` `/screen`+——每个都自带步骤骨架和一个**算术自洽**的样例(Brinson 分解精确加总为主动收益;+盈利桥精确加总为 EPS 变动)。`investor-lenses` skill 把知名投资人的推理框架叠加成+分析透镜:每个透镜是一套操作规程——优先信号、否决条件、常见误用——而不是人物传记,+且不指定任何工具。++在 bar 之外,`src/entities` 摄入不规则日期的现金流(NAV、capital call、票息),+`cashflow_performance` 在其上给出 XIRR / MOIC / DPI / TVPI / TWR / Modified Dietz / MWR。+这条通路刻意与 bar 引擎**平行**,以确保 `nav` 列永远不会流进 bar 引擎被当成收盘价定价。++</details>++<details>+<summary><b>治理与审计链</b> <sub>回答「那个数字是哪套方法算出来的?」</sub></summary>++每次运行都会写一份 **manifest**,对 prompt、skill 内容、工具注册表和依赖包版本做哈希,+因此一个月前产出的数字仍能追溯到当时确切的方法学。++**审计账本**把每条记录链到前一条的哈希并 fsync,因此篡改或删除记录是可检出的——+即使一次编辑同时重算了自己的哈希,也会在下一条记录处被 `prev_hash_mismatch` 抓到。+时间戳一律由调用方传入,本模块不调用 `datetime.now()`。++trace 脱敏是**分 sink 的**:工具调用参数与实时审计账本走 fail-closed sink,`content`+保持脱敏;工具结果 sink 才释放 `content`,并对其字符串叶子做模式清洗。两个 sink 都+永不释放 `env`。++</details>+## 🎬 Demo<div align="center">@@ -732,6 +803,7 @@ skill + MCP config 会下载到你的智能体 skills 目录。详情见 [ClawHu| `VIBE_TRADING_ALLOWED_RUN_ROOTS` | No | 生成代码 run directories 额外允许的逗号分隔 roots || `VIBE_TW_STOCK_DB` | No | 台湾市场 SQLite 快照路径;只读的 `taiwan_stock_data` 工具仅在 schema 合法时才注册 || `VIBE_TRADING_EXTRA_CORS_ORIGINS` | No | 在回环 CORS 默认值之上**追加**的源,逗号分隔(`CORS_ORIGINS` 则是整体替换) |+| `CONTENT_FILTER_WARNING_THRESHOLD` | No | 内容过滤告警比例阈值(默认 0.05 = 5%)。当被内容审核拦截的 LLM 响应占比超过该值时,run card 会提示你更换 provider。 |<sub>* Ollama 不需要 API key。OpenAI Codex 使用 ChatGPT OAuth,并通过 `oauth-cli-kit` 存储 token,不写入 `agent/.env`。</sub>@@ -1054,7 +1126,7 @@ POST `{}` 即按模板自身的建议节奏和默认变量排程。渲染后的## 🔌 MCP Plugin-Vibe-Trading 为任何 MCP-compatible client 暴露 64 个 MCP tools。它作为 stdio subprocess 运行,无需 server setup。核心 research tools 对港股/美股/加密零 API key 可用;trading connector tools 使用当前选择的 connector profile;只有 `run_swarm` 需要 LLM key。+Vibe-Trading 为任何 MCP-compatible client 暴露 70 个 MCP tools。它作为 stdio subprocess 运行,无需 server setup。核心 research tools 对港股/美股/加密零 API key 可用;trading connector tools 使用当前选择的 connector profile;只有 `run_swarm` 需要 LLM key。**环境变量:** server 由 client 自己 spawn,因此在 shell 里 `export` 永远传不进去 —— 请写在 client 的 `env` 块里。生成的回测代码被限制在 allowed run roots 内,所以要把结果写进你自己的工作目录,需要 `VIBE_TRADING_ALLOWED_RUN_ROOTS`:@@ -1110,7 +1182,7 @@ vibe-trading-mcp --transport sse # legacy SSE (deprecated)</details>-**暴露的 MCP tools(64):** `list_skills`, `load_skill`, `start_research_goal`, `get_research_goal`, `add_goal_evidence`, `update_research_goal_status`, `backtest`, `factor_analysis`, `alpha_zoo`, `alpha_bench`, `analyze_options`, `analyze_options_payoff`, `pattern_recognition`, `read_url`, `read_document`, `web_search`, `write_file`, `read_file`, `list_swarm_presets`, `run_swarm`, `get_market_data`, `get_fund_flow`, `get_dragon_tiger`, `get_northbound_flow`, `get_margin_trading`, `get_block_trades`, `get_shareholder_count`, `get_lockup_expiry`, `get_sector_info`, `get_research_reports`, `get_stock_news`, `get_sec_filings`, `get_financial_statements`, `get_options_chain`, `get_stock_profile`, `screen_market`, `search_symbol`, `get_macro_series`, `iwencai_search`, `qveris_search`, `qveris_inspect`, `qveris_execute`, `get_institutional_holdings`, `etf_holdings`, `prediction_market`, `research_papers`, `get_swarm_status`, `get_run_result`, `list_runs`, `reap_stale_runs`, `retry_run`, `analyze_trade_journal`, `extract_shadow_strategy`, `run_shadow_backtest`, `render_shadow_report`, `scan_shadow_signals`, `trading_connections`, `trading_select_connection`, `trading_check`, `trading_account`, `trading_positions`, `trading_orders`, `trading_quote`, `trading_history`.+**暴露的 MCP tools(70):** `list_skills`, `load_skill`, `start_research_goal`, `get_research_goal`, `add_goal_evidence`, `update_research_goal_status`, `backtest`, `factor_analysis`, `alpha_zoo`, `alpha_bench`, `analyze_options`, `analyze_options_payoff`, `pattern_recognition`, `read_url`, `read_document`, `web_search`, `write_file`, `read_file`, `list_swarm_presets`, `run_swarm`, `get_market_data`, `get_fund_flow`, `get_dragon_tiger`, `get_northbound_flow`, `get_margin_trading`, `get_block_trades`, `get_shareholder_count`, `get_lockup_expiry`, `get_sector_info`, `get_research_reports`, `get_stock_news`, `get_sec_filings`, `get_financial_statements`, `get_options_chain`, `get_stock_profile`, `screen_market`, `search_symbol`, `get_macro_series`, `iwencai_search`, `qveris_search`, `qveris_inspect`, `qveris_execute`, `get_institutional_holdings`, `etf_holdings`, `prediction_market`, `research_papers`, `get_swarm_status`, `get_run_result`, `list_runs`, `reap_stale_runs`, `retry_run`, `analyze_trade_journal`, `extract_shadow_strategy`, `run_shadow_backtest`, `render_shadow_report`, `scan_shadow_signals`, `trading_connections`, `trading_select_connection`, `trading_check`, `trading_account`, `trading_positions`, `trading_orders`, `trading_quote`, `trading_history`, `quantlib_call`, `cashflow_performance`, `orderbook_depth`, `sentiment`, `technical_indicators`, `get_fundamentals`.### SWARM 的外部 MCP tools@@ -1204,6 +1276,45 @@ vibe-trading connector history EURUSD---+## 🔌 eToro Public API 连接器++通过 API 密钥对(`x-api-key` + `x-user-key`)连接 [eToro Public API](https://builders.etoro.com/) 的模拟盘与实盘账户。模拟与实盘在**结构上**分离:demo 密钥只能访问 `/demo` API 路径。++配置 `~/.vibe-trading/etoro.json`(需自行创建;支持的平台上请 `chmod 600`):++```json+{+ "api_key": "YOUR_PUBLIC_API_KEY",+ "user_key": "YOUR_USER_KEY",+ "profile": "paper"+}+```++也可以在 `~/.vibe-trading/.env` 里设置 `ETORO_API_KEY` 和 `ETORO_USER_KEY`。++然后:++```bash+vibe-trading connector use etoro-paper-sdk+vibe-trading connector check+vibe-trading connector account+vibe-trading connector positions+vibe-trading connector quote BTC+```++| 配置档 | 账户 | 下单 |+|--------|------|------|+| `etoro-paper-sdk` | demo | 只读 |+| `etoro-live-sdk-readonly` | 实盘 | 只读 |+| `etoro-paper-trade` | demo | 在 demo 路径上直接下单 |+| `etoro-live-trade` | 实盘 | 受 mandate + kill switch 约束 |++标的查找走 eToro 的 `internalSymbolFull` 搜索(例如 `BTC` → instrument id `100000`)。交易前请用 `etoro_search_instruments` agent 工具解析代码。++安全边界:模拟与实盘按路径分离且与密钥绑定(`paper_guard: path_separated_key_bound`)。实盘的风险增加类操作(开仓、跟单启动/加仓)需要已授权的 mandate、清晰的未暂停状态,以及一个已验证的 USD 账户用于跟单名义金额的约束。已校验的全部/部分平仓、撤销挂单与跟单平仓在暂停状态下仍可用,并全部记入审计日志。撤销一笔待执行的平仓、以及修改持仓止损止盈是**仅限模拟盘**的:实盘路径 fail-closed,因为这些操作可能增加敞口或额外划转保证金,而 API 数据不足以量化增量 USD 风险。跟单金额以 eToro 账户币种计价,每次跟单启动/调整都需要调用方提供一个 1-35 字符的 URL-safe 引用 id 用于轮询。eToro 专属的写操作工具(`etoro_close_position`、`etoro_copy_*` 等)**仅为 agent 工具**——不经 MCP 或 CLI 暴露。回滚方式:revert 相关 connector commit 或停用配置档;halt 会阻断新的实盘风险增加类操作。++---+## 🔌 从外部 MCP Server 加载工具(MCP Client 模式)> **这与上面的 MCP Plugin 方向相反。**@@ -1427,7 +1538,7 @@ Vibe-Trading/├── agent/ # 后端(Python)│ ├── cli/ # CLI 包 —— 交互式 TUI + 子命令│ ├── api_server.py # FastAPI server —— runs、sessions、upload、swarm、SSE-│ ├── mcp_server.py # MCP server —— 64 个工具,面向 OpenClaw / Claude Desktop+│ ├── mcp_server.py # MCP server —— 70 个工具,面向 OpenClaw / Claude Desktop│ ││ ├── src/│ │ ├── agent/ # ReAct agent 内核@@ -1442,7 +1553,7 @@ Vibe-Trading/│ │ ├── memory/ # 跨 session 持久记忆│ │ │ └── persistent.py # 基于文件的记忆(~/.vibe-trading/memory/)│ │ │-│ │ ├── tools/ # 68 个自动发现的 agent 工具+│ │ ├── tools/ # 94 个自动发现的 agent 工具│ │ │ ├── backtest_tool.py # 运行回测│ │ │ ├── remember_tool.py # 跨 session 记忆(save/recall/forget)│ │ │ ├── skill_writer_tool.py # skill CRUD(save/patch/delete/file)@@ -1556,7 +1667,38 @@ Vibe-Trading 是 **[HKUDS](https://github.com/HKUDS)** 智能体生态的一部感谢所有为 Vibe-Trading 做出贡献的人!-近期 v0.1.12 周期贡献者与致谢:+近期 v0.1.13 周期贡献者与致谢:++- @santhreal — a 17-PR correctness and resource-leak sweep: the HTTP throttle now sweeps stale buckets interval-aware so rate-limit spacing survives (#1047), the rate limiter stops growing without bound on unique client IPs (#1039), the event bus notifies and removes subscribers on clear (#1046), `_json_loads` is guarded against corrupted JSON in database columns (#1045), NaN/inf volume and close no longer crash `format_grounding_block` (#1043), `inf` from `pct_change` on zero equity is replaced (#1041), Shoonya tolerates empty-string numerics (#1038), drawdown is computed from the absolute peak on negative equity (#958) and insolvent empty cross accounts are marked liquidated (#959), plus exact memory index anchors (#956/#957) and an A-share code / trade-journal parsing batch (#919, #926–#935)+- @shadowinlife — HK market-data fallback routing repaired with a new Tencent HK source (#1000), Shadow multi-market backtests split per settlement currency (#997), bare US tickers routed to `us_equity` (#994), MCP list/dict arguments tolerating JSON-string clients (#993), generated signal engines passing the backtest sandbox validator (#992), and the memory GC dry-run fix (#973)+- @honginp — the USD-M perpetual lifecycle end to end: funding and liquidation execution (#903), isolated & cross margin liquidation modelling (#889), ordered fidelity evidence persistence (#936), atomic position rebalancing (#951), and strict historical position rebalancing that preserves collateral, funding, fees and fill evidence (#1019)+- @QCYTSN — the desktop Electron shell lifecycle (#923), Windows packaging with a checksum-pinned embedded runtime and `safeStorage` credential handling (#1015), and Settings model discovery + runtime identity UX (#924)+- @Robin1987China — the `technical_indicators` (#921) and `sentiment` (#939) tools, annualisation entries for 15 data sources with a CI coverage gate (#891), indicator inputs read without sampling (#1005), and the `quant_strategy_desk` final report aggregator (#1048)+- @Shizoqua — MCP specs cache keyed on remote server identity (#1049), memory FTS5 ranking with importance decay (#1032), swarm detection of `ok`/`success:false` tool failures (#1028), and lowercase `4h` resampling in the yfinance loader (#1013)+- @ngoanpv — timezone-aware scheduled research (#954, closes #953), one malformed record no longer breaking the whole store (#1003), interval creates without a resolvable zone (#1004), and delete-route job id validation (#980)+- @he-yufeng — risk x-ray artifacts in portfolio runs (#900), Portfolio Studio artifacts surfaced in run detail (#966), yfinance crypto routed to the crypto engine (#970), and hierarchy-routed memory entries keeping their `.md` extension (#984)+- @wiliao — Canadian markets end to end: TSX/TSXV market data (#1024) and symbol support through search fail-fast and CSV grounding (#1037)+- @MuggleJinx — session and run history stored under the user runtime root (#925, closes #904) and `~/.vibe-trading/.env` loaded on the connector command path (#902, closes #901)+- @cgycorey — Alpha Zoo tools reaching MCP (#979) and mapping-shaped Responses stream events accepted (#1034)+- @ofeksh-tr — the eToro Public API connector with path-separated demo/real profiles (#989) — broker connectors 12 → **13**+- @su322 — source message ids threaded into IM outbound so QQ replies stay passive (#1008), and the output principle that stops the agent once evidence is sufficient (#1010)+- @zwrong — the `vibe-trading update` self-upgrade command (#1020)+- @yrk111222 — ModelScope as an OpenAI-compatible provider (#1011)+- @x-lambda — agent proxy opt-out covering sync and async clients (#995)+- @dineeshd — authenticated API capability surfaces under enforced CSP (#961)+- @hhj123123 — the canonical run root preserved after HOME isolation (#1012)+- @00EVA — the Settings model dropdown auto-resizing so long provider/model slugs stay readable (#1006)+- @darkknight4563 — `bar_returns` kept bit-identical for gapped positive series (#895)+- @sambazhu — mootdx config pre-seeded in the sandbox home (#982)+- @yagnikpipaliya — self-healing for Claude models that deprecate the `temperature` field (#890, closes #856)+- @JungHoonGhae — the Korea equity (KRX) market engine (#693)+- @shugaoye — the OpenBB Workspace bridge (#817)+- @TSENGCHIENFENG — the read-only Taiwan snapshot tool (#848)+- @ddy4633, @tyj147454413-cmd, @y85998607, @klmtseng, @ebujinovch, @g0rdonL, @AmirF194, @Echoandelementwebsites, @dvirarad, @1anter — correlation, loader, vn.py-export, PIT-fundamentals and alpha-bench fixes carried into this cycle+- @warren618 / Haozhe Wu — the finance-math layer and valuation engine, the entity + cash-flow spine, run manifests and the hash-chained audit ledger, the four read-only data tools, the institutional commands and investor lenses, the grounding-gate repair, the analytic options payoff tool (#946), Codex OAuth recovery (#1014), the Shadow runtime root fix (#1017), release integration and open-PR/issue triage++<details>+<summary>v0.1.12 周期贡献者</summary>- @santhreal — 一次跨 30 个 PR 的正确性扫荡:跨 metrics、factors、pattern 与 options 的 strict-JSON / 有限数值加固(#764/#765/#766/#767/#739/#740/#744)、loader 正确性(#761 yahoo 1m bars),以及 session / journal 健壮性(#762/#763/#768/#769/#770)- @xkam7ar — 跨打包、web、scheduler、swarm 与 CLI 的广泛可靠性改进(#584)、AgentLoop 首轮迭代前的取消(#641,关闭 #638)、QVeris session 预算 + 原子化 credit 计账(#685/#686)、CI / OOS 门禁(#630/#632),以及 journal 月份过滤 / side 解析修复(#626/#628)@@ -1587,6 +1729,8 @@ Vibe-Trading 是 **[HKUDS](https://github.com/HKUDS)** 智能体生态的一部- @GabbaTauchi — 报告了原生 zai 流式 / base-URL bug(#758)- @warren618 / Haozhe Wu — correlation regime 后端集成、zai provider 流式 + base-URL 解析修复(#758)、发布集成,以及开放 PR/issue 分诊+</details>+<details><summary>v0.1.11 周期贡献者</summary>diff --git a/agent/SKILL.md b/agent/SKILL.mdindex 3842a05c9..a6c8a6d24 100644--- a/agent/SKILL.md+++ b/agent/SKILL.md@@ -3,7 +3,7 @@ name: vibe-tradingversion: 0.1.13description: Professional finance research toolkit — backtesting (9 engines + benchmark comparison panel), factor analysis, Alpha Zoo (462 pre-built alphas across qlib158/alpha101/gtja191/academic/fundamental), options pricing, 89 finance skills, 30 multi-agent swarm teams, Trade Journal analyzer, and Shadow Account (extract → backtest → render) across 24 market-data sources (tushare, yfinance, okx, binance, akshare, baostock, tencent, mootdx, ccxt, futu, mt5, local, eastmoney, sina, stooq, yahoo, pykrx, india_broker, qveris, longbridge, plus optional-key finnhub/alphavantage/tiingo/fmp).dependencies:- python: ">=3.11"+ python: ">=3.11,<3.14"pip:- vibe-trading-aienv:@@ -118,7 +118,7 @@ One-line cross-sectional IC / IR / alive-reversed-dead categorisation across fivEach alpha ships with `__alpha_meta__` (formula LaTeX + theme + universe + warmup + columns required), guarded by an AST purity gate + 300-row lookahead sentinel test. Use the `vibe-trading alpha {list,show,bench,compare,export-manifest}` CLI, the `/alpha/*` REST routes (browser at `/alpha-zoo`), or compose multi-factor signals via `ZooSignalEngine.from_zoo(...)`.-### Finance Skills (88)+### Finance Skills (89)Comprehensive knowledge base covering:- Technical analysis (candlestick, Elliott wave, Ichimoku, SMC, harmonic, chanlun)- Quantitative methods (factor research, ML strategy, pair trading, multi-factor)@@ -131,7 +131,7 @@ Comprehensive knowledge base covering:Use `load_skill(name)` to access full methodology docs with code templates.-## Available MCP Tools (60)+## Available MCP Tools (70)| Tool | Description | API Key ||------|-------------|---------|@@ -195,6 +195,16 @@ Use `load_skill(name)` to access full methodology docs with code templates.| `trading_orders` | Read open orders from selected connector | Connector app/OAuth || `trading_quote` | Read a quote snapshot from selected connector | Connector app/OAuth || `trading_history` | Read historical bars from selected connector | Connector app/OAuth |+| `get_institutional_holdings` | SEC 13F-HR holdings by manager/ticker + quarter-over-quarter position diffs | None |+| `etf_holdings` | ETF look-through — SEC N-PORT (US) and full-book A-share fund reports | None |+| `prediction_market` | Event-contract search/market/history as labelled implied probability | None |+| `research_papers` | arXiv + OpenAlex search/read with source-anchored claim extraction | None |+| `quantlib_call` | Pure-compute finance math — 265 functions across 19 quantlib modules | None |+| `cashflow_performance` | XIRR / MOIC / DPI / TVPI / TWR / Modified Dietz over dated cash flows | None |+| `orderbook_depth` | Crypto L2 ladder — spread bps, depth imbalance, impact cost | None |+| `sentiment` | Local lexicon text scoring + crypto Fear & Greed Index | None |+| `technical_indicators` | RSI / MACD / Bollinger / SMA / EMA through the existing loaders | None* |+| `get_fundamentals` | PIT-safe SEC fundamentals panels (filed-date anchored) | None |<sub>*A-share symbols require `TUSHARE_TOKEN`. HK/US/Canada/crypto are free. Trading connector rows use the selected connector profile, e.g. IBKR local TWS/Gateway or Robinhood MCP OAuth.</sub>diff --git a/agent/mcp_server.py b/agent/mcp_server.pyindex 8137ca335..f7e52b262 100644--- a/agent/mcp_server.py+++ b/agent/mcp_server.py@@ -6,7 +6,7 @@ Zero API key required for HK/US/crypto research markets (yfinance, OKX,AKShare are free). Trading connector tools are profile-scoped and require theselected connector's own local app or OAuth setup.-Surfaces 64 tools: skills, research goals, backtest/factor/options/pattern+Surfaces 70 tools: skills, research goals, backtest/factor/options/patternanalysis, market data, fundamentals & capital-flow & news & discovery(get_fund_flow / get_dragon_tiger / get_northbound_flow / get_margin_trading /get_block_trades / get_shareholder_count / get_lockup_expiry / get_sector_info /@@ -15,7 +15,9 @@ get_financial_statements / get_options_chain / get_stock_profile /screen_market / search_symbol / get_macro_series / iwencai_search /qveris_search / qveris_inspect / qveris_execute),institutional-research and alternative data (get_institutional_holdings /-etf_holdings / prediction_market / research_papers), read-only+etf_holdings / prediction_market / research_papers), read-only finance math and+market analytics (quantlib_call / cashflow_performance / orderbook_depth /+sentiment / technical_indicators / get_fundamentals), read-onlytrading-connector reads, swarm orchestration, trade-journal and shadow-accountanalysis. Every exposed tool is read-only or research-only; no order-placing ororder-cancelling tool is ever surfaced via MCP. The QVeris tools additionally@@ -2155,6 +2157,16 @@ _MIRRORED_TOOL_SOURCES = (("src.tools.etf_holdings_tool", "EtfHoldingsTool"),("src.tools.prediction_market_tool", "PredictionMarketTool"),("src.tools.research_papers_tool", "ResearchPapersTool"),+ # Read-only compute and market-data tools that had reached the agent but+ # not MCP. Mirroring is the right path for all of them: each already owns a+ # multi-mode ``parameters`` schema, so re-declaring Python signatures here+ # would create the second definition this block exists to avoid.+ ("src.tools.quantlib_tool", "QuantlibCallTool"),+ ("src.tools.cashflow_analytics_tool", "CashFlowPerformanceTool"),+ ("src.tools.orderbook_depth_tool", "OrderBookDepthTool"),+ ("src.tools.sentiment_tool", "SentimentTool"),+ ("src.tools.technical_indicator_tool", "TechnicalIndicatorTool"),+ ("src.tools.get_fundamentals_tool", "GetFundamentalsTool"),)diff --git a/agent/src/quantlib/attribution.py b/agent/src/quantlib/attribution.pyindex 5fae8aa1e..cb71fd929 100644--- a/agent/src/quantlib/attribution.py+++ b/agent/src/quantlib/attribution.py@@ -45,6 +45,20 @@ import mathfrom collections.abc import Mapping, Sequencefrom dataclasses import dataclass+#: Public surface. `quantlib_call` dispatches on ``__all__`` alone, so a module+#: without it is unreachable from Web / API / MCP even when the tool allowlists+#: it — which is exactly what happened to this module until 0.1.13.+__all__ = [+ "DEFAULT_WEIGHT_SUM_TOLERANCE",+ "BrinsonResult",+ "LinkedAttribution",+ "LinkedSectorEffect",+ "SectorEffect",+ "brinson_fachler",+ "carino_factor",+ "carino_link",+]+#: Largest tolerated difference between the portfolio and benchmark weight sums.#: Beyond this the Brinson identity stops holding, so it is an error, not a warning.DEFAULT_WEIGHT_SUM_TOLERANCE = 1e-9diff --git a/agent/src/quantlib/impact.py b/agent/src/quantlib/impact.pyindex b56d6cd40..7d0f64eb4 100644--- a/agent/src/quantlib/impact.py+++ b/agent/src/quantlib/impact.py@@ -38,6 +38,20 @@ import numpy as npimport pandas as pdfrom numpy.typing import ArrayLike+#: Public surface. `quantlib_call` dispatches on ``__all__`` alone, so a module+#: without it is unreachable from Web / API / MCP even when the tool allowlists+#: it — which is exactly what happened to this module until 0.1.13.+__all__ = [+ "DEFAULT_DELAY_BARS",+ "DEFAULT_LINEAR_IMPACT_COEFF",+ "DEFAULT_SLIPPAGE_BPS",+ "DEFAULT_SQRT_IMPACT_ETA",+ "delayed_execution",+ "fixed_slippage",+ "linear_impact",+ "sqrt_impact",+]+#: Default fixed slippage in basis points (1bp = 0.01%).DEFAULT_SLIPPAGE_BPS = 5.0diff --git a/agent/tests/test_distribution_skill_manifest.py b/agent/tests/test_distribution_skill_manifest.pyindex 3cfd96675..e8d132ae5 100644--- a/agent/tests/test_distribution_skill_manifest.py+++ b/agent/tests/test_distribution_skill_manifest.py@@ -36,6 +36,23 @@ def _literal_assignment(path: Path, name: str) -> object:raise AssertionError(f"{name} not found in {path}")+def _live_mcp_tool_count() -> int:+ """Return how many tools the MCP server actually serves.++ Returns:+ Length of ``mcp.list_tools()`` — decorator-registered wrappers plus+ every mirrored tool.+ """+ import asyncio+ import sys++ if str(AGENT_ROOT) not in sys.path:+ sys.path.insert(0, str(AGENT_ROOT))+ import mcp_server++ return len(asyncio.run(mcp_server.mcp.list_tools()))++def _assert_all_counts(pattern: str, expected: int) -> None:counts = [int(value)@@ -93,10 +110,12 @@ def test_market_data_source_count_matches_loader_registry() -> None:def test_mcp_tool_heading_matches_registered_tools() -> None:- registered = len(- re.findall(- r"(?m)^@mcp\.tool(?:\(\))?\s*$",- MCP_SERVER_PATH.read_text(encoding="utf-8"),- )- )- _assert_all_counts(r"Available MCP Tools\s*\((\d+)\)", registered)+ """The manifest heading must match the tools the server actually serves.++ Counting ``@mcp.tool`` decorators counts only the hand-written wrappers and+ silently ignores every tool registered through ``_MIRRORED_TOOL_SOURCES``.+ That proxy is what let the heading sit at 60 while the surface served 64:+ the four institutional-research tools were absent from the published+ manifest and no test could see it. Ask the server.+ """+ _assert_all_counts(r"Available MCP Tools\s*\((\d+)\)", _live_mcp_tool_count())diff --git a/agent/tests/test_mcp_alpha_zoo_contract.py b/agent/tests/test_mcp_alpha_zoo_contract.pyindex 711a2d77c..ad4c93f71 100644--- a/agent/tests/test_mcp_alpha_zoo_contract.py+++ b/agent/tests/test_mcp_alpha_zoo_contract.py@@ -95,22 +95,34 @@ def test_alpha_bench_forwards_selection(monkeypatch) -> None:]-def test_skill_inventory_matches_static_mcp_registration() -> None:+def test_skill_inventory_matches_the_whole_mcp_surface() -> None:+ """The published manifest must list every tool the server serves.++ This previously compared the manifest against ``registered - mirrored``,+ which made a mirrored tool's absence from SKILL.md the expected state. The+ manifest is what a ClawHub reader uses to decide what installing gets them,+ so excluding a served tool under-reports the product: the four+ institutional-research tools were live over MCP and absent from the+ manifest, and the contract said that was correct. Mirroring is a+ schema-sourcing detail, not a reason to hide a tool from its own manifest.+ """# Given the runtime MCP registration and the bundled SKILL inventory.registered = {tool.name for tool in asyncio.run(mcp_server.mcp.list_tools())}- mirrored = {tool_cls.name for tool_cls in mcp_server._mirrored_tool_classes()}- static = registered - mirroredskill_text = (Path(mcp_server.__file__).parent / "SKILL.md").read_text(encoding="utf-8")# When the SKILL header and table are read.header = re.search(r"^## Available MCP Tools \((\d+)\)$", skill_text, re.MULTILINE)- # Then they describe exactly the non-mirrored MCP surface.+ # Then they describe exactly the MCP surface, mirrored tools included.assert header is not Nonetool_section = skill_text[header.end() :].split("\n## ", maxsplit=1)[0]listed = set(re.findall(r"^\| `([a-z_]+)` \|", tool_section, re.MULTILINE))- assert int(header.group(1)) == len(static)- assert listed == static+ assert listed == registered, (+ f"manifest/surface mismatch — missing from SKILL.md: "+ f"{sorted(registered - listed)}; listed but not served: "+ f"{sorted(listed - registered)}"+ )+ assert int(header.group(1)) == len(registered)def test_alpha_bench_requires_a_bounded_selection(monkeypatch) -> None:diff --git a/agent/tests/test_mcp_new_tools.py b/agent/tests/test_mcp_new_tools.pyindex 412aa6433..68a175e00 100644--- a/agent/tests/test_mcp_new_tools.py+++ b/agent/tests/test_mcp_new_tools.py@@ -306,12 +306,17 @@ def test_mirrored_tool_round_trips_over_a_real_mcp_session(monkeypatch) -> None:def test_one_broken_tool_module_costs_only_its_own_tool(monkeypatch, caplog) -> None:- """A broken tool module must not take the other three down with it.+ """A broken tool module must not take the other mirrored tools down with it.- Regression: importing all four classes in one ``from ... import`` block- made a single SyntaxError / missing optional dependency raise out of- ``_mirrored_tool_classes()``, so the MCP surface silently lost all four- institutional-research tools instead of one.+ Regression: importing every class in one ``from ... import`` block made a+ single SyntaxError / missing optional dependency raise out of+ ``_mirrored_tool_classes()``, so the MCP surface silently lost all of the+ mirrored tools instead of one.++ The expected survivor set is derived from ``_MIRRORED_TOOL_SOURCES`` rather+ than written out: this asserts the isolation property, and pinning the+ membership here would just fail every time a tool joins the surface,+ training the next reader to edit the number instead of the behaviour."""mod = _import_mcp_server()@@ -325,11 +330,16 @@ def test_one_broken_tool_module_costs_only_its_own_tool(monkeypatch, caplog) ->with caplog.at_level("ERROR"):surviving = {cls.name for cls in mod._mirrored_tool_classes()}- assert surviving == {- "get_institutional_holdings",- "etf_holdings",- "prediction_market",- }, f"one broken module took down more than its own tool: survivors={sorted(surviving)}"+ expected = {+ getattr(importlib.import_module(path), cls).name+ for path, cls in mod._MIRRORED_TOOL_SOURCES+ if not path.endswith("research_papers_tool")+ }+ assert expected, "no mirrored tools to isolate — the source list is empty"+ assert surviving == expected, (+ f"one broken module took down more than its own tool: "+ f"survivors={sorted(surviving)}, expected={sorted(expected)}"+ )assert any("research_papers_tool" in record.message for record in caplog.records)diff --git a/agent/tests/test_quantlib_tool.py b/agent/tests/test_quantlib_tool.pyindex ce6bde43c..42a9d0200 100644--- a/agent/tests/test_quantlib_tool.py+++ b/agent/tests/test_quantlib_tool.py@@ -74,6 +74,28 @@ def test_every_allowlisted_module_actually_imports(tool):assert result["ok"] is True, f"{short} failed to list: {result}"+def test_every_allowlisted_module_exposes_at_least_one_function(tool):+ """An allowlisted module that lists nothing is unreachable, not merely empty.++ Importing cleanly is not the same as being callable: dispatch is+ ``__all__``-only, so a module without ``__all__`` lists zero functions while+ still passing the import check above. `attribution` and `impact` shipped+ that way — allowlisted, documented in the package docstring, and reachable+ from nowhere. Asserting `ok is True` could never catch it; asserting the+ listing is non-empty does.+ """+ empty = [+ short+ for short in ALLOWED_MODULES+ if not call(tool, action="list", module=short)["functions"]+ ]+ assert not empty, (+ f"allowlisted but exposing no callables: {empty}. Add `__all__` to the "+ f"module, or drop it from ALLOWED_MODULES — advertising a module the "+ f"tool cannot dispatch to is worse than not listing it."+ )++# --- discovery ---diff --git a/agent/tests/test_readme_counts.py b/agent/tests/test_readme_counts.pyindex f0d1297f7..a4118fe44 100644--- a/agent/tests/test_readme_counts.py+++ b/agent/tests/test_readme_counts.py@@ -53,13 +53,20 @@ READMES = (# Feature badges in the order they appear in every README. Each entry is the# badge's position among numeric <sub> badges and a callable returning the# count the code actually ships.-BADGE_ORDER = ("skills", "brokers", "presets", "alphas", "engines")+BADGE_ORDER = ("skills", "brokers", "presets", "alphas", "engines", "quantlib")# Brokers are a curated product claim (which venues we support), not something# countable from a single directory — connectors, profiles and the read-only# caps do not map one-to-one. It is pinned here so a reader-facing number still# has one owner, and updating it is a deliberate edit.-EXPECTED_BROKERS = 12+#+# The pin is guarded against silent drift by+# `test_the_pinned_broker_count_matches_the_shipped_connectors`: this constant+# must equal the number of distinct connectors the profile registry exposes.+# Without that guard the count tests only prove the five READMEs agree with+# each other, which they did while all five were uniformly wrong — eToro+# shipped as the 13th connector and the pin stayed at 12.+EXPECTED_BROKERS = 13def _read(name: str) -> str:@@ -118,6 +125,32 @@ def _engine_count() -> int:)+def _quantlib_export_count() -> int:+ """Count the public functions `src/quantlib` exports.++ The Quant Library badge states this number, and the whole point of the+ layer is that a formula has exactly one implementation — so the badge is+ derived from `__all__` rather than pinned, and a module landing without+ `__all__` simply does not count toward the reader-facing claim.++ Returns:+ Total names exported across every `quantlib` submodule.+ """+ import importlib+ import pkgutil++ if str(AGENT_DIR) not in sys.path:+ sys.path.insert(0, str(AGENT_DIR))+ quantlib = importlib.import_module("src.quantlib")++ total = 0+ for module in pkgutil.walk_packages(quantlib.__path__, "src.quantlib."):+ exported = getattr(importlib.import_module(module.name), "__all__", None)+ if exported:+ total += len(exported)+ return total++def _counts() -> dict[str, int]:"""Return every code-derived count the READMEs state.@@ -131,6 +164,7 @@ def _counts() -> dict[str, int]:"alphas": len([p for p in (AGENT_DIR / "src" / "factors" / "zoo").rglob("*.py")if p.stem != "__init__"]),"engines": _engine_count(),+ "quantlib": _quantlib_export_count(),}@@ -331,6 +365,61 @@ def test_brokers_without_paper_trading_are_named_as_exceptions(name: str) -> Non)+def test_the_pinned_broker_count_matches_the_shipped_connectors() -> None:+ """`EXPECTED_BROKERS` must equal the connectors the profile registry ships.++ Every other broker-count assertion compares a README against this pin, so+ the pin going stale makes all five READMEs agree on a wrong number and the+ suite still passes. That is exactly what happened: eToro landed as the 13th+ connector while the pin stayed at 12. Anchoring the pin to the registry+ turns the next such omission into a failing test at the moment the+ connector lands, instead of a number a reader has to disprove.+ """+ if str(AGENT_DIR) not in sys.path:+ sys.path.insert(0, str(AGENT_DIR))+ from src.trading.service import list_profiles++ shipped = sorted({profile.connector for profile in list_profiles()})+ assert EXPECTED_BROKERS == len(shipped), (+ f"EXPECTED_BROKERS is {EXPECTED_BROKERS} but the profile registry ships "+ f"{len(shipped)} connectors: {shipped}. Update the pin and the broker "+ f"badge + table in all five READMEs together."+ )++[email protected]("name", READMES)+def test_every_shipped_connector_appears_in_the_broker_table(name: str) -> None:+ """The broker table must name every connector, not just the count.++ A correct badge over an incomplete table is the same defect one layer+ down: eToro shipped, got its own README section, and was still absent from+ the table a reader scans to decide whether their broker is supported.+ """+ if str(AGENT_DIR) not in sys.path:+ sys.path.insert(0, str(AGENT_DIR))+ from src.trading.service import list_profiles++ # Brokers are written under their product name, which is not always the+ # connector id. Broker names stay in Latin script in all five locales, so+ # one alias map covers every README.+ display_names = {"mt5": "metatrader5"}++ text = _read(name)+ lines = text.splitlines()+ badges = [i for i, line in enumerate(lines) if SUMMARY_BADGE.search(line)]+ # BADGE_ORDER[1] is the broker badge; the table runs to the closing </details>.+ start = badges[1]+ end = next(i for i in range(start, len(lines)) if lines[i].strip() == "</details>")+ table = "".join(lines[start:end]).replace(" ", "").lower()++ missing = [+ connector+ for connector in sorted({p.connector for p in list_profiles()})+ if display_names.get(connector, connector.replace("_", "")) not in table+ ]+ assert not missing, f"{name}: connectors absent from the broker table: {missing}"++def test_the_skill_category_table_matches_the_frontmatter() -> None:"""Each category row must carry the number of skills declaring it."""counts: dict[str, int] = {}