Skip to content

fix(grounding): retain comma-grouped document integers - #2135

Merged
he-yufeng merged 1 commit into
HKUDS:mainfrom
remote-controlled-man:codex/prflow-c3079991434b
Nov 1, 2026
Merged

he-yufeng merged 1 commit into
HKUDS:mainfrom
remote-controlled-man:codex/prflow-c3079991434b

Conversation

@remote-controlled-man

Copy link
Copy Markdown
Contributor

Summary

  • Preserve the grouping marker when the shared numeric scanner reads comma-grouped integers such as 165,200.
  • Let numbers quoted from ordinary document text enter the existing measured-evidence path, just as decimal values and Markdown table cells already do.
  • Add nine answer-level regression cases and document the source-evidence behavior.

Why

Refs #2126. The numeric value was parsed correctly, but its thousands-grouping marker was discarded. An integer copied from a plain PDF text line was therefore classified as bare and omitted from document evidence, so a correctly sourced answer table could be rejected.

This corrects the shared scanner classification: comma-grouped integers in answer prose also receive the existing declaration, streaming and release checks. Unmarked integers in running prose, structural dates, source binding, generated-document exclusions and evidence limits keep their existing behavior.

Test Plan

  • All 32 grounding test modules: 1318 passed, no skips (9 dependency deprecation warnings).
  • New document cases: two plain-text cases fail on original code; the Markdown-table control passes. All nine new cases pass after the fix.
  • Ruff, Black changed-line checks, ci_private_files_gate.py, ci_grep_gates.sh, and git diff --check pass.
  • Whole-file Black reports existing formatting differences; only the changed line ranges were formatted and checked to avoid unrelated cleanup.
  • Tests use synthetic document-reader envelopes. The full repository suite, frontend, real PDF extraction, live providers and broker flows were not run.

Scope and risk

The change is in the shared grounding scanner, discussed in #2126. It changes numeric classification without adding evidence sources or changing broker, credential or network behavior. Roll back with git revert 022f1b6.

  • Existing grounding tests and new regression cases pass.
  • DCO sign-off included.
  • No runtime secrets or hardcoded runtime paths.
  • README updated.

Signed-off-by: Steven Huang <134844631+remote-controlled-man@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 31, 2026 17:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@he-yufeng he-yufeng left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked this against the issue and against the narrower evidence.py-only attempt in #2139.

This is the better fix. The numeric scanner already classifies a grouped integer as marked when it preserves the grouping token, so the figure takes the existing measured-evidence path instead of adding another admission rule at ingest. The tests cover the plain-text table shape, the Markdown control, source binding, generated artifacts, and the cases that must stay excluded.

Verification on 022f1b6a2c05dcdac81fde1d8caec14bc7204c23: the complete grounding suite passes 1329 with 8 existing skips, ci_private_files_gate.py and git diff --check pass, and CI is green on all ten checks.

This fixes #2126 and supersedes #2139. Approving.

@he-yufeng
he-yufeng merged commit 09f90ea into HKUDS:main Nov 1, 2026
10 checks passed
warren618 pushed a commit that referenced this pull request Nov 11, 2026
A five-digit bare integer a source document states ('股东总数 76175') is a
stated figure, not layout: it enters the evidence ledger and grounds the
quoted table cell, closing the residual boundary left when #2135 retained
comma-grouped integers only. Years, page numbers and four-digit headcounts
('员工总数 3400') keep their existing exclusion.

Fixes #2126 (reopened)
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.

3 participants