21 Commits
Author SHA1 Message Date
Haozhe Wu 4da7579065 ci: keep internal documents out of tracked files 2026-10-15 21:14:09 +08:00
Haozhe Wu 6894824b26 refactor(agent): isolate final-answer grounding orchestration 2026-10-13 15:46:21 +08:00
Haozhe Wu 7a8b1d86c9 refactor(grounding): declare role and provenance checks with exact firing attribution 2026-10-13 15:40:22 +08:00
Haozhe Wu 6965c2884b Complete UTF-8 recovery, channel review, pinned portfolio surfaces and validation repairs 2026-10-10 23:05:38 +08:00
lorenzozanee ed2ba90fcf docs: add option evidence to broker bring-up checklist
Signed-off-by: lorenzozanee <wyz0707@proton.me>
2026-10-10 05:16:55 +08:00
Haozhe Wu f1fee5d35f Fix causal option pricing, channel refresh state, and market routing
Preserve scientific-notation amounts and add regression coverage for the five review findings. Update README News after successful backend, frontend, and contract checks.

Signed-off-by: Haozhe Wu <haozhe_wu@connect.hku.hk>
2026-10-09 19:18:19 +08:00
Haozhe Wu ce73fff5a4 Finish thirteen-PR integration and repair uncovered boundary cases
Signed-off-by: Haozhe Wu <haozhe_wu@connect.hku.hk>
2026-10-09 18:42:52 +08:00
Haozhe Wu 2620a3962f Fix analysis data fallback and recoverable research workflows
Signed-off-by: Haozhe Wu <haozhe_wu@connect.hku.hk>
2026-10-08 21:31:44 +08:00
Haozhe Wu 3bb01ebed9 Improve UI responsiveness and task navigation
Signed-off-by: Haozhe Wu <haozhe_wu@connect.hku.hk>
2026-10-08 19:52:42 +08:00
Haozhe Wu f6e72428b7 fix: finish research prompts and grouped validation boundaries 2026-10-05 11:16:24 +08:00
Haozhe Wu 98600e4c33 Merge PR #1630: enforce channel authoring contract 2026-10-05 11:01:38 +08:00
Haozhe Wu dec2c0e6b8 fix: complete September 28 reliability reviews and broker documentation
Bound BaoStock messages and serialize SDK sessions; verify Copilot credential
lookup expiry without changing the SDK's per-call credential resolution.
Run public-loader health checks in isolated, credential-free processes and a
separate dependency environment, with explicit failure reports and a weekly
workflow. Render broker capabilities per profile and document verification
requirements. Update September 28 News in all seven README languages.

Closes #1626
Closes #1623
Closes #1617
Closes #1492
2026-09-28 16:07:06 +08:00
Yufeng He a57a71e16d feat(channels): pin the channel-authoring contract and document the recipe
The contract mostly existed (BaseChannel abstracts, config_meta field hints
with fail-safe secret masking, token_probe) but nothing enforced it, so a new
channel could ship a scalar config key with no form hint or an unmasked
credential-shaped value. test_channel_authoring_contract.py walks every
registry-discovered channel and fails on exactly those, and CONTRIBUTING gets
the "Adding a Channel" quickstart that names the recipe pieces.

Writing the suite surfaced two documented subtleties now pinned by name:
dict-valued config stays file-configured (the generic form cannot edit it),
and a hand-written hint may authoritatively subtract a regex over-match
(websocket's token_* path names).

Refs #1625

Signed-off-by: Yufeng He <40085740+he-yufeng@users.noreply.github.com>
2026-09-28 15:46:30 +08:00
xkam7ar 2ad7036d1c build: install Black and Ruff for contributors
Signed-off-by: xkam7ar <kmoteallemi@icloud.com>
2026-07-16 11:37:48 -07:00
Roger 1a5f096496 docs: add AI contributor guide (#173)
Add AGENT_CONTRIBUTOR_GUIDE.md for AI/automation-assisted contributors: safe
local checks, high-risk broker/MCP/credential surfaces, targeted test hints,
documentation and security rules, PR expectations, and rollback notes. Linked
from CONTRIBUTING.md so agent-assisted contributors see it before changing code.

Adds a guard test (agent/tests/test_agent_guide_paths.py) that parses the guide
for in-repo paths and asserts each still exists, so the guide turns a renamed
test/entry-point into a red CI run instead of silently rotting. pytest --ignore
targets (gitignored e2e suites) and .env do-not-write references are excluded by
design.

Signed-off-by: Haozhe Wu <haozhe_wu@connect.hku.hk>
2026-06-04 18:42:26 +08:00
Haozhe Wu 1676eaa328 feat(factors): Alpha Zoo framework — registry, operators, safety gates
New module agent/src/factors/ providing the foundation for the Alpha
Zoo:

- base.py: 19 cross-sectional + time-series operators on wide
  pd.DataFrame panels (rank/scale/ts_*/delta/decay_linear/signed_power/
  safe_div + market-aware vwap). NaN propagates strictly; delta(d>=1)
  enforced at the operator layer; no negative shifts allowed.
- registry.py: AST-extracts __alpha_meta__ from each zoo .py module
  without importing it; pydantic AlphaMeta (extra="forbid",
  frozen=True). Lazy importlib.import_module on compute(); filesystem-
  loader fallback for plugin/test trees. Sanity gates reject +/-inf,
  NaN ratio > 95%, and shape mismatches.
- factor_analysis_core.py: IC/IR + layered backtest math extracted
  from agent/src/tools/factor_analysis_tool.py so it's reusable from
  CLI, bench tool, and API.
- bench_runner.py: per-alpha compute → IC vs forward return →
  alive/reversed/dead categorisation (mean IC > 0.02, pos_ratio >=
  0.55, |t-stat| > 2). Shared by CLI driver and API worker.

Multi-factor skill gains a panel-style ZooSignalEngine.from_zoo()
factory (cross-sectional standardisation + weighting + optional
top-N / bottom-N long-short conversion). The legacy per-symbol
example_signal_engine.py is left untouched. SKILL.md edits in
multi-factor and factor-research cross-reference the new zoo.

Safety floor:
- test_alpha_purity.py: AST allowlist scan of every zoo/**/*.py
  module. Allowed imports: pandas, numpy, scipy.*, src.factors.base,
  __future__, typing, math, dataclasses. Banned names: os/sys/
  subprocess/socket/urllib/requests/httpx/pathlib/Path/open/eval/exec/
  compile/__import__, plus dunder-access via getattr(_, "__*"),
  breakpoint, input, help, memoryview, globals, locals, vars, and
  the __class__/__bases__/__mro__/__globals__/__builtins__ chain.
  Module-level statements limited to docstring + imports + functions
  + ALPHA_ID/__alpha_meta__ assignments with literal RHS.
- test_lookahead.py: 300-row synthetic panel; corrupt rows >= 270;
  assert factor at probe row 260 unchanged within 1e-9.
- test_base.py + test_registry.py + conftest.py with opt-in
  pytest-socket integration that hard-fails outbound network during
  the factors test suite.
- tools/ci_grep_gates.sh: rejects yaml.load( without safe_load,
  any trademarked-name leak in shipped artifacts, and any per-stock-
  code data leak in wiki/**/*.{json,csv,html}.

Governance:
- CONTRIBUTING.md with the Developer Certificate of Origin trailer
  for community PRs and the alpha PR reviewer checklist.
- NOTICE at the repo root with Apache-2.0 attribution for the
  upstream qlib NOTICE and the formulas-as-mathematical-content
  stance for Kakushadze / GTJA / Fama-French sources.
2026-05-17 20:03:02 +08:00
Haozhe Wu 3981eb53f8 feat: add trust layer run cards 2026-05-12 18:44:19 +08:00
Haozhe Wu fd7384e472 feat(skills): add dividend analysis skill 2026-05-02 17:51:48 +08:00
warren618 4dcb33034a fix(packaging): bundle swarm presets inside src.swarm (#55) + 0.1.6 release
Move 29 preset YAMLs from agent/config/swarm/ to agent/src/swarm/presets/
so they ship as package-data; loader resolves via
Path(__file__).parent / "presets". Identical behavior under editable
installs and built wheels — fixes "No presets available" reported in #55
after pip install / uv tool install vibe-trading-ai 0.1.5.

Root cause: preset YAMLs were declared via [tool.setuptools.data-files],
which lands them under <install-prefix>/.data/data/config/swarm/ rather
than at the <site-packages>/config/swarm/ path the loader expected.

Pinned by a 6-test packaging regression suite. Bump 0.1.5 -> 0.1.6.
SKILL.md and 5 READMEs synced to reality: 72 skills, 22 MCP tools
(adds 5 shadow-account / journal tool names), 6 data sources
(adds Futu). Adds 2026-04-28 v0.1.6 release news rollup.
2026-04-28 17:39:19 +08:00
warren618 1f8f4a005f feat: cross-market composite backtest engine with shared capital pool
- Add CompositeEngine for backtesting portfolios spanning multiple markets
  (e.g. A-shares + crypto) with a single shared capital pool
- Extract on_bar logic (funding fee, liquidation, swap) into _market_hooks.py
  as pure functions, called by both original engines and CompositeEngine
- Fix _align() signal shift bug: shift on each symbol's own trading calendar
  then ffill to unified dates (prevents Monday close-and-reopen for A-shares)
- Add calendar-day annualization for cross-market Sharpe calculation
- Add cross-market-strategy skill with vol-adjusted weighting example
- Update all READMEs (en/zh/ja/ko/ar): news, 69 skills, composite engine
- Update test imports for extracted _market_hooks functions
2026-04-13 22:46:49 +08:00
warren618 b8d544d71d docs: add CONTRIBUTING.md, issue templates, and contribution roadmap
- CONTRIBUTING.md with dev setup, code standards, and difficulty-tiered roadmap
- GitHub issue templates (bug report + feature request) with YAML forms
- README: add Contributing section with contribution areas table
2026-04-10 16:17:19 +08:00