"Vibe-Trading: Your Personal Trading Agent"
Python ai-agentalgorithmic-tradingbacktestingfintechllmmcpmulti-agentpythonquantitative-financetrading
fix(grounding): drop 研究 as an attribution subject; it is a self-claim
cgycorey934274840a46
diff --git a/agent/src/agent/grounding.py b/agent/src/agent/grounding.pyindex 0fc93e285..e4d1857d3 100644--- a/agent/src/agent/grounding.py+++ b/agent/src/agent/grounding.py@@ -269,7 +269,7 @@ _ATTRIBUTION_RE = re.compile(r"|notes?|cites?|mentions?|reveals?|discloses?|publishes?|found"r"|calculated|computed|derived)\b"r"|"- r"(?:论文|文献|研究|分析师|研究机构|学者)"+ r"(?:论文|文献|分析师|研究机构|学者)"r"[^。,\n]{0,6}?(?:报告|显示|表明|指出|称|估计|发现)"r")",re.IGNORECASE,diff --git a/agent/tests/test_agent_grounding.py b/agent/tests/test_agent_grounding.pyindex 909fbc7e2..805fe845d 100644--- a/agent/tests/test_agent_grounding.py+++ b/agent/tests/test_agent_grounding.py@@ -3299,7 +3299,8 @@ def test_analysis_gates_accept_attributed_paper_restatement(tmp_path: Path) -> Nfor answer in ("The paper reports a Sharpe ratio of 1.8 for the momentum factor.","该论文报告其策略夏普比率为 1.8。",- "研究显示该策略年化收益 18.2%。",+ "研究机构指出该策略年化收益 18.2%。",+ "文献指出因子年化收益 18.2%。","Analysts estimate an annualized volatility of 22%.",):ledger = GroundingLedger(run_dir=tmp_path, user_message="Research the factor.")@@ -3356,6 +3357,10 @@ def test_attribution_exemption_cannot_launders_self_claims(tmp_path: Path) -> No"数据显示策略夏普比率为 3.5。","根据本次回测,年化波动率 18.2%。","The strategy reports a Sharpe ratio of 1.8.",+ "研究显示策略年化收益 25%。",+ "研究报告显示策略年化收益 25%。",+ "回测研究显示策略年化收益 25%。",+ "投资者普遍认为其年化收益 25%。",# citation in clause 1, invented sibling in clause 2"The paper reports a Sharpe ratio of 1.8, and our strategy achieved ""an annualized return of 47.3%.",