Commit Graph
422 Commits
Author SHA1 Message Date
Haozhe Wu 2cd47cd166 fix(core): narrow backtest subprocess environment
Closes #332

Summary:
- Narrow generated-backtest subprocess environment inheritance to OS/Python basics, proxy/certificate settings, allowed run-root config, and read-only market-data settings.
- Avoid forwarding LLM provider keys, API auth tokens, shell-tool switches, broker trading secrets, and live/advisory toggles into generated strategy code.
- Document the generated backtest trust boundary in README and SECURITY.

Validation:
- PYTHONPATH=agent pytest agent/tests/test_runner_env.py agent/tests/test_run_card.py agent/tests/test_path_safety.py agent/tests/test_file_tool_sandbox_security.py -q
- python -m ruff check agent/src/core/runner.py agent/tests/test_runner_env.py
- python -m compileall -q agent/src/core/runner.py agent/tests/test_runner_env.py
- git diff --check
- GitHub Actions CI passed
2026-07-02 15:23:41 +08:00
shadowinlife 6ec6bd1314 fix(channels): add IM session reset commands
Closes #371.

- Add channel-agnostic /new, /reset, and /newsession handling in ChannelRuntime so IM users can start a fresh session without leaving the chat.
- Preserve existing session history while clearing only the channel session mapping.
- Document in-chat slash commands across README locales.
- Normalize pairing slash-command parsing so the documented case-insensitive command behavior matches runtime behavior.

Validation:
- PYTHONPATH=agent pytest agent/tests/test_channels_runtime.py -q
- python -m compileall -q agent/src/channels/runtime.py agent/src/channels/pairing/store.py agent/tests/test_channels_runtime.py
- git diff --check
- GitHub Actions CI: test
2026-07-02 14:45:09 +08:00
Haozhe Wu 4709f4c33c docs: add July 1 news 2026-07-01 16:21:19 +08:00
Haozhe Wu 87e675c344 fix(frontend): update echarts security patch 2026-07-01 15:49:20 +08:00
Matt Van Horn d8f88d45da fix(wiki): harden alpha-library CSP by externalizing inline scripts 2026-07-01 15:40:27 +08:00
Haozhe Wu e22e06ac89 fix(frontend): update vulnerable frontend dependencies 2026-07-01 15:40:07 +08:00
Haozhe Wu 041e1cf643 fix(frontend): reconcile channel proxy and zh-CN i18n 2026-07-01 15:26:04 +08:00
hoc.s 18d97e8bef fix(i18n): fix zh-CN language switching and LanguageSwitcher display
1. Remove nonExplicitSupportedLngs — it strips region codes from compound
   language keys (zh-CN → zh) causing isSupportedCode to reject them and
   fall back to English.

2. Add /channels to Vite proxy paths — Settings page calls /channels/status
   via Promise.all with getLLMSettings and getDataSourceSettings; without a
   proxy rule these requests return index.html causing JSON parse errors.

3. Fix LanguageSwitcher always showing 'English' — i18n.languages (plural)
   always includes the fallback 'en', and SUPPORTED_LANGUAGES has 'en' first
   so .find() always matched 'en'. Fixed by checking i18n.language (singular)
   first.

Signed-off-by: hoc.s <a615828a615828@outlook.com>
2026-07-01 15:23:34 +08:00
opj161 80c811eadd fix(frontend): make channel settings robust against API failures and proxy channel requests
Signed-off-by: opj161 <opj161@outlook.com>
2026-07-01 15:23:34 +08:00
Haozhe Wu 1b9a6700cb Merge pull request #349 from digger-yu/feat/cli-setup-dev
fix(cli): dev pre-checks frontend deps to surface clear error
2026-07-01 14:59:03 +08:00
Haozhe Wu fda61aa4c5 Merge pull request #351 from shadowinlife/fix/frontend-loopback-port-334
fix(docker): bind frontend dev port to loopback for consistency with backend
2026-07-01 14:58:57 +08:00
Haozhe Wu 3b78745b1f Merge pull request #338 from Robin1987China/safe-bind-default
fix(api): default bind to 127.0.0.1 and warn on non-loopback without API_AUTH_KEY
2026-07-01 14:58:50 +08:00
Robin1987China 3234a82e45 fix(api): default bind to 127.0.0.1 and warn on non-loopback without API_AUTH_KEY
Default the --host bind address to 127.0.0.1 instead of 0.0.0.0 to
match the secure-by-default posture already used in docker-compose.
Add a startup warning when binding to a non-loopback address without
API_AUTH_KEY configured — the existing loopback peer-IP and
DNS-rebinding checks still reject remote requests, but the warning
surfaces the misconfiguration at startup.

Also default the Typer `serve` command's --host to 127.0.0.1 so every
serve entry point agrees (the console script and `python -m cli` already
bound loopback; this covers the `python -m cli.main` path too).

Tests: _is_loopback_bind_host truth table (IPv4/IPv6/hostname/edge),
loopback default, and the warning firing only on a non-loopback bind
without a configured key.

Refs #333

Signed-off-by: Robin1987China <41602358+Robin1987China@users.noreply.github.com>
2026-06-30 19:50:20 +08:00
shadowinlife 2b9647a5be fix(docker): bind frontend dev port to loopback for consistency with backend
The frontend dev service published port 5899 on all interfaces
(0.0.0.0) while the backend was correctly bound to 127.0.0.1:8899.
On a shared/LAN network, this exposed the Vite dev server (source,
module graph, HMR websocket) to other hosts unnecessarily.

Add the 127.0.0.1 prefix to the frontend port mapping so both
services share the same loopback-only exposure discipline.

Closes #334

Co-Authored-By: OpenCode <noreply@opencode.ai>
AI-Model: qwen3.7-max
Co-Authored-By: opencode <noreply@ai-tool.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
AI-Contributed/Feature: 2/2
AI-Contributed/UT: 0/0
2026-06-30 17:05:15 +08:00
digger yu df6b760ea4 fix(cli): dev pre-checks frontend deps to surface clear error
`vibe-trading dev` previously assumed the user had already run
`vibe-trading setup`. When they hadn't, the Vite spawn failed with
npm's confusing "vite is not a command" message and the user had to
know to install dependencies separately.

Add a quick `frontend/node_modules/.bin/vite` (or vite.cmd) existence
check before spawning. If missing, fail fast with a clear panel that
points the user at `vibe-trading setup`.

Signed-off-by: digger yu <digger-yu@outlook.com>
2026-06-30 16:30:05 +08:00
Haozhe Wu 2d08b9550c docs: add IM channel README coverage (#343) 2026-06-30 15:09:46 +08:00
Haozhe Wu 101306e916 feat: wire IM channel runtime
Merge IM channel runtime wiring, controls, dependency gates, tests, and legacy-name cleanup.
2026-06-30 14:31:26 +08:00
Haozhe Wu 6f6b1794a3 docs: add 2026-06-29 news to all 5 READMEs (live advisory + Trading 212 + fixes) 2026-06-29 17:15:49 +08:00
Haozhe Wu 4ad497dfc4 Merge pull request #321 from mvanhorn/fix/309-trading212-readonly-connector
feat: read-only Trading 212 broker connector
2026-06-29 16:55:33 +08:00
Matt Van Horn eb1c23db48 feat: read-only Trading 212 broker connector
Fixes #309
2026-06-29 16:44:19 +08:00
Haozhe Wu 2416a82373 Merge branch 'fix/gemini-thought-signature-replay-local' 2026-06-29 16:12:30 +08:00
Haozhe Wu 59a1dc1853 Merge branch 'patch1' 2026-06-29 16:12:23 +08:00
Haozhe Wu ddb44e0be2 Merge branch 'feat/advisory-interface' 2026-06-29 16:12:18 +08:00
mvanhorn 4ac49e8582 fix: preserve Gemini thought_signature across AgentLoop dict-history replay 2026-06-29 16:09:40 +08:00
digger yu b17ad71761 fix(i18n): polish language switcher semantics 2026-06-29 16:02:41 +08:00
shadowinlife 6ed89f6a94 test(live): assert advisory reviews stay observational 2026-06-29 15:59:59 +08:00
Haozhe Wu b4430b3b40 fix(tools): route US statements to SEC EDGAR 2026-06-29 15:51:47 +08:00
Haozhe Wu 399b5b4e23 fix(wiki): harden alpha library hydration 2026-06-29 15:51:47 +08:00
Haozhe Wu 7ec94c6d2a Merge pull request #329 from hannibal-lee/fix/pandas-3-windows-crash
Fix pandas version constraint
2026-06-29 15:51:23 +08:00
hannibal-lee d46db51750 Fix pandas version constraint 2026-06-29 13:58:57 +08:00
shadowinlife e5ca46aa6a fix(live): advisory provider registry, public enforcement aliases, exception sanitization
Address review findings from PR #328:

- Add module-level provider registry (register/clear/get_advisory_providers)
  replacing the hardcoded AdvisoryOrchestrator([]) dead-code path
- Add public aliases in enforcement.py for 3 private helpers used by advisory
- Replace monkeypatch __init__ in test #9 with registry-based injection
- Sanitize exception messages: str(exc) → type(exc).__name__ in audit dicts
- Add exc_info=True to logger.warning for full traceback in logs only
- Add logger.info when advisory enabled but no providers registered
- Rename account_drawdown → utilization_ratio (semantic accuracy)

Co-Authored-By: OpenCode <noreply@opencode.ai>
AI-Model: qwen3.7-max
Co-Authored-By: opencode <noreply@ai-tool.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
AI-Contributed/Feature: 85/85
AI-Contributed/UT: 57/57
2026-06-29 12:02:38 +08:00
shadowinlife 866d4e5683 test(live): add advisory interface and gate integration tests (#317)
9 test cases covering:
- Verdict enum members (4 values matching invinoveritas contract)
- AdvisoryContext frozen dataclass
- AdvisoryResult auto-timestamp
- MockAdvisory default approve, configurable verdict, raise_on_review
- AdvisoryOrchestrator fail-open on provider exception
- Gate advisory disabled by default (no advisory in gate_decision)
- Gate advisory enabled with mock provider (verdict embedded in audit)

All tests pass, ruff clean, no network dependencies.


Signed-off-by: shadowinlife <shadowinlife@gmail.com>
2026-06-29 11:36:59 +08:00
shadowinlife 20ea6d6f5a feat(live): wire advisory layer into order gate (opt-in, observational) (#317)
Add advisory review hook to LiveOrderGuardTool._allow() behind an opt-in
environment variable (VIBE_TRADING_ENABLE_ADVISORY). Advisory verdicts are
embedded in gate_decision['advisory'] for audit visibility but never block
or alter order execution.

- _advisory_review() builds AdvisoryContext from intent/positions/balance
- Fail-open: any exception → REVIEW_UNAVAILABLE, order proceeds
- Default off: env var unset = no advisory field in gate_decision
- _allow() accepts positions/balance kwargs threaded from execute()


Signed-off-by: shadowinlife <shadowinlife@gmail.com>
2026-06-29 11:36:53 +08:00
shadowinlife 2c92714340 feat(live): add MockAdvisory for advisory interface testing (#317)
Configurable in-memory advisory provider for test suites. Supports verdict
injection, optional delay, forced failure, and call-history recording —
everything needed to exercise the orchestrator and gate integration without
any network dependency.


Signed-off-by: shadowinlife <shadowinlife@gmail.com>
2026-06-29 11:36:47 +08:00
shadowinlife 1bcb8ee336 feat(live): add PreTradeAdvisoryInterface and advisory data models (#317)
Add broker-agnostic advisory interface for external risk assessment services
to provide observational pre-trade opinions. Purely additive — never blocks
or alters order execution.

- Verdict enum: APPROVE, APPROVE_WITH_CONCERNS, REJECT, REVIEW_UNAVAILABLE
- AdvisoryContext: frozen dataclass with 8 normalized fields
- AdvisoryResult: frozen dataclass with auto-filled UTC timestamp
- PreTradeAdvisoryInterface: abstract base with provider_id + review()
- AdvisoryOrchestrator: sequential provider execution, fail-open aggregation
- AggregatedVerdict: worst-case verdict with flattened concerns


Signed-off-by: shadowinlife <shadowinlife@gmail.com>
2026-06-29 11:36:41 +08:00
digger yu ae9aee9282 feat(i18n): add ja/ko/ar locales, RTL layout, LanguageSwitcher, and i18n tests
Add Japanese, Korean, and Arabic locales to match the README set,
replace the two-option zh/en toggle with a full language dropdown,
and add comprehensive i18n parity tests.

i18n core
- New ja/ko/ar.json (634 keys each, 100% parity with en.json).
- SUPPORTED_LANGUAGES registry + isRtl()/applyDocumentDirection()
  helpers; navigator as secondary detector with Node.js 21+ guard;
  nonExplicitSupportedLngs for regional variant matching.
- New i18next.d.ts for strict t() key type-checking at compile time.

Components
- LanguageSwitcher dropdown in Layout.tsx: position: fixed + JS-measured
  coords (resists overflow/clipping/RTL direction), full ARIA, touchstart
  + Escape dismiss, i18n.languages array for regional code matching.
- WelcomeScreen: fix double-prefix bug — CATEGORIES/CAPABILITY keys now
  carry full i18n paths with `as const`.
- AlphaZoo: 10 dynamic t() calls use `as any` + defaultValue fallback.
- APP_VERSION constant removed; version string sourced from t('app.version').

RTL & theme
- Logical properties throughout (border-e, ps/pe, border-s-2) +
  rtl:flex-row-reverse on main layout.
- --popover CSS variable defined (light + dark); bg-popover was producing
  no color before, making every popover transparent.
- [dir="rtl"] .rtl\:flip-x rule for mirroring directional icons.

Tests (i18n.test.ts — 231 total, all passing)
- Key parity: 5 locales × 2 directions (missing + extra) + sanity check.
- Interpolation variable parity across all locales.
- isRtl: base codes, regional variants (ar-EG/ar-SA), unknown codes.
- SUPPORTED_LANGUAGES registry integrity.

zh-CN.json
- Translation refinements ("A股回测"→"多市场回测", description alignment
  with en.json); key ordering aligned to en.json structure.

Signed-off-by: digger yu <digger-yu@outlook.com>
2026-06-29 09:28:59 +08:00
Haozhe Wu 5bde656fbf docs: update June 28 news 2026-06-28 22:18:03 +08:00
Haozhe Wu e1feee31af fix(tools): clean file tool sandbox imports 2026-06-28 17:02:16 +08:00
Haozhe Wu 8633bc51dd Merge pull request #299 from skloxo/contrib/fix-file-tools-tilde 2026-06-28 17:01:23 +08:00
Haozhe Wu b5246ca999 fix(frontend): guard runtime status polling
Fixes #322
2026-06-28 16:39:51 +08:00
Haozhe Wu cb1aa92f7c Merge pull request #292 from digger-yu/patch1
feat(cli): add `setup` and `dev` commands for cross-platform frontend…
2026-06-28 16:36:33 +08:00
Haozhe Wu 1a3cee4012 fix(mcp): sanitize OAuth cache keys
Fixes #313
2026-06-28 11:31:11 +08:00
Haozhe Wu d1aab2be76 fix(cli): align legacy OpenAI default model 2026-06-28 03:35:54 +08:00
Haozhe Wu 53135139f3 Merge remote-tracking branch 'refs/remotes/pr/319' 2026-06-28 03:35:09 +08:00
Haozhe Wu efff920eee Merge remote-tracking branch 'refs/remotes/pr/320' 2026-06-28 03:35:03 +08:00
Matt Van Horn 9a9e4da5b2 fix: clearer Robinhood agent.json validation and safe seed config surfacing
Fixes #312
2026-06-27 09:44:36 -07:00
Matt Van Horn 454bceed6c fix: resolve default OpenAI model to an available id (gpt-5.5-instant unavailable)
Fixes #311
2026-06-27 09:39:00 -07:00
Haozhe Wu 3f7a3c8b4d docs: update June 27 news 2026-06-27 21:40:11 +08:00
shadowinlife 022d042c6a fix(providers): tolerate content-filtered LLM responses
Skip individual content-filtered LLM responses instead of aborting event-driven analysis or swarm workers, surface high filter-rate warnings in run cards, and recognize Gemini safety finish reasons alongside OpenAI content_filter.

Closes #307.

Thanks @shadowinlife.
2026-06-27 21:39:13 +08:00
卫斯李 f5900c5f33 refactor(shadow-account): centralize price feature contract
Centralize Shadow Account price feature names in models.PRICE_FEATURES so extractor and codegen cannot drift, and keep price-context bounds at four decimals to avoid losing small return thresholds.

Includes regression coverage for feature-name sharing and prior_5d_return precision.

Thanks @Robin1987China.
2026-06-27 21:39:02 +08:00