Skip to content

fix(grounding): mask line-leading ordered-list markers from number ex… - #1063

Open
zzz607 wants to merge 1 commit into
HKUDS:mainfrom
zzz607:feature/hikyuu-source
Open

fix(grounding): mask line-leading ordered-list markers from number ex…#1063
zzz607 wants to merge 1 commit into
HKUDS:mainfrom
zzz607:feature/hikyuu-source

Conversation

@zzz607

@zzz607 zzz607 commented Aug 11, 2026

Copy link
Copy Markdown

…traction

Markdown ordered-list markers (e.g. "1. 标题") were parsed as floats by _NUMBER_RE and rejected downstream as numeric_claim_conflict against the observed OHLC range.

Add _MD_LIST_ITEM_RE and strip "^\s*\d+[.)]\s+" at the head of _numbers_without_dates_or_percent's mask chain, so list markers are removed at the number-extraction entry point across all numeric paths, not just price comparison. In-text decimals like 1.5 are unaffected (digit after the dot).

Add tests in test_agent_grounding.py covering marker masking, conflict check not weakened, and in-text decimal survival.

Summary

Why

Changes

Test Plan

  • Existing tests pass (pytest --ignore=agent/tests/e2e_backtest --tb=short -q)
  • New tests added (if applicable)
  • Tested manually (describe below)

Checklist

  • No changes to protected areas (src/agent/, src/session/, src/providers/) without prior discussion
  • No hardcoded values (API keys, file paths, magic numbers)
  • Code follows CONTRIBUTING.md guidelines
  • Documentation updated (if user-facing change)

…traction

Markdown ordered-list markers (e.g. "1. **标题**") were parsed as floats
by _NUMBER_RE and rejected downstream as numeric_claim_conflict against the
observed OHLC range.

Add _MD_LIST_ITEM_RE and strip "^\s*\d+[.)]\s+" at the head of
_numbers_without_dates_or_percent's mask chain, so list markers are removed at
the number-extraction entry point across all numeric paths, not just price
comparison. In-text decimals like 1.5 are unaffected (digit after the dot).

Add tests in test_agent_grounding.py covering marker masking, conflict check
not weakened, and in-text decimal survival.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant