"Vibe-Trading: Your Personal Trading Agent"
Python ai-agentalgorithmic-tradingbacktestingfintechllmmcpmulti-agentpythonquantitative-financetrading
fix(grounding): a CJK month may list several days
Haozhe Wu0de75aab04ee
diff --git a/agent/src/agent/grounding/figures.py b/agent/src/agent/grounding/figures.pyindex cc54ceb95..635c5f66c 100644--- a/agent/src/agent/grounding/figures.py+++ b/agent/src/agent/grounding/figures.py@@ -45,8 +45,8 @@ _DATE_RE = re.compile(# A year-less MM-DD / MM/DD; see _short_date_is_structural.r"|(?P<short>(?<![\d.])(?:0[1-9]|1[0-2])[-/](?:0[1-9]|[12]\d|3[01])(?!\d|\.\d))"r"|(?<![\d.:])(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?![\d:]|\.\d)"- # A month alone ("6月初"), a day, or a day range ("8月17–18日").- r"|(?<![\d.])\d{1,2}\s*月(?:\s*\d{1,2}(?:\s*[-–—~~]\s*\d{1,2})?\s*[日号])?"+ # A month alone ("6月初"), a day, a day range ("8月17–18日") or a day list ("9月11/14日").+ r"|(?<![\d.])\d{1,2}\s*月(?:\s*\d{1,2}(?:\s*[-–—~~/、]\s*\d{1,2})*\s*[日号])?"r"|(?:19|20)\d{2}\s*年"# A bare year or compact YYYYMMDD loses to a measurement mark ("$2050").r"|(?P<soft>(?<![\d.])(?:19|20)\d{2}(?:(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01]))?(?!\d|\.\d))"diff --git a/agent/tests/test_grounding_figures_contract.py b/agent/tests/test_grounding_figures_contract.pyindex 16aa4340a..2be7cdbe7 100644--- a/agent/tests/test_grounding_figures_contract.py+++ b/agent/tests/test_grounding_figures_contract.py@@ -277,6 +277,7 @@ def _shapes(text: str) -> dict[str, str]:"3. First conclusion", # ordered-list marker, English"8月17–18日高点", # CJK month with a day range (real run)"6月初低点,8月中旬平台", # CJK month alone (real run)+ "| 次级支撑 | 9月11/14日盘中低点 |", # CJK month with a day list (real run)"| 阻力 | 含义 |\n|---|---|\n| 前高 | 8月17–18日高点 |", # in a table cell"2026-09-11 / 09-14 两次盘中低点", # zero-padded MM-DD after a full date"09-14 收盘", # zero-padded MM-DD alone