Skip to content

research: citation_graph claim text truncated at decimal numbers #274

Description

@oQAQo1

What happened?

The citation_graph entries in research responses get truncated at decimal numbers: when a synthesized report sentence contains a decimal like "$62.3 billion" or "27.7 percent", the citation-graph claim text loses the part before the decimal point.

Example — a synthesized research report contained:

"...record quarterly data center revenue reaching $62.3 billion in Q4 FY2026..."

but the corresponding citation_graph entry came back as:

"claim": "3 billion in Q4 FY2026, up 75 percent year over year [7]."

Other observed truncations: $5.8 billion8 billion, $54.6 billion6 billion, 1.6 million6 million, 27.7 percent7 percent.

The report body itself is intact — only the citation_graph claim strings (and potentially sentence splitting elsewhere) are affected. source_indices and confidence remain correct.

Root cause

In src/research/citation-graph.ts, sentences are split with:

const sentenceMatches = synthesisText.match(/[^.!?]+[.!?]+(?:\s|$)/g);

The regex treats the . inside a decimal number as a sentence-boundary candidate. For $62.3 billion, the engine tries to match 62. + (non-whitespace) → fails, backtracks, and the final match starts after the decimal point, dropping the numeric prefix. I reproduced this locally with Node:

"$62.3 billion in Q4 FY2026 [7]."  →  "3 billion in Q4 FY2026 [7]."

Suggested fix

Protect decimal points before splitting, then restore them:

const dotProtected = synthesisText.replace(/(\d)\.(\d)/g, "$1\uE000$2");
const sentenceMatches = dotProtected.match(/[^.!?]+[.!?]+(?:\s|$)/g);
const sentences = sentenceMatches
  ? sentenceMatches.map((s) => s.trim().replace(/\uE000/g, "."))
  : [synthesisText.trim()];

I verified this fixes the truncation (decimals like $62.3 billion, $5.8 billion, $54.6 billion are fully preserved). Note that a lone . after $ (e.g. $.5) and abbreviations ("e.g.", "U.S.") may need consideration depending on how strict the sentence split should be.

Command / tool call

{ "tool": "research", "question": "2026 AI chip market competition...", "depth": "standard" }

wigolo version

0.2.1

OS + Node version

Windows · Node 24.14.1

Output of npx wigolo doctor (if relevant)

Browser/embeddings/reranker all ok; not related to the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions