README.md
# Fact Check (AgentRove native agent)
`agentrove.fact-check` 0.1.2 · MIT · Node.js >= 20 · no npm dependencies · offline
Published by AgentRove (provisional, configurable name). Package identifiers keep the agentrove prefix for compatibility.
Checks claims against sources **you provide** and labels each one `supported`, `unsupported` or
`needs_review`, showing the exact source sentences it relied on and flagging mismatched numbers and
dates. It never marks a claim supported without at least one matching source excerpt. It is
deterministic and uses no AI model.
## Tool
| Tool | Side effects | What it does |
| --- | --- | --- |
| `check_claims` | none | Input: `claims` (strings or `{text, source_url?, sources?}`, one factual statement each), a `script` (its `claims` list, e.g. from video-script) and/or `text` (a paragraph to check), plus `sources` (a `source_list` with `text` or `excerpt`). Output: a `fact_check_report`. |
Each verdict covers one statement. Claim text with several sentences, and the optional top-level
`text`, are split into one claim per sentence (each keeps the citation it came with and is marked
`split_from`, for example `"claims[0]"` or `"text"`); questions are skipped and listed in `notes`.
### Verdict rules
For each claim, every source sentence (and the source title) is compared with the claim:
- **coverage**: share of the claim's content words (stopwords removed, light stemming) that
appear in the sentence.
- **figures**: percentages, currency amounts, numbers with thousand/million/billion, years and dates
in the claim must appear in the sentence. A different figure of the same kind is a **mismatch**
(for example claim 45% vs source 30%). A different year next to other figures is treated as a
different period, not a contradiction.
- **polarity**: a negation in one but not the other ("approved" vs "did not approve") conflicts.
- **direction of change**: common rise/fall verbs are compared as a direction, not as words, so
"grew 30%" matches "rose 30%", "fell 30%" contradicts "rose 30%", and a claimed rise is not
supported by a sentence that states no direction. A figure in the source that the claim does not
mention (for example a comparison value) is not treated as a contradiction.
| Verdict | When |
| --- | --- |
| `supported` | At least one sentence has coverage >= `support_threshold` (default 0.8), at least 3 matching content words (or all of them for short claims), every figure matches, polarity and direction of change match, no provided sentence contradicts it, and, if the claim cites a source, that source is one of the supporting ones. |
| `unsupported` | No sentence reaches `review_threshold` (default 0.5), or the only close sentences clearly contradict the claim. `unsupported` means "not supported by these sources", not "false". |
| `needs_review` | Anything in between: partial matches, figures missing from the source, supporting and contradicting sentences together, support from a different source than the one cited, or a claim with no checkable words. |
Each claim in the report has `evidence` (URLs; empty when unsupported), `excerpts`
(`{url, text, relation: supports|conflicts|partial, coverage}`), `reasons` and
`number_mismatches` (`{claim_value, source_values, url}`).
## Usage (Node CLI)
```sh
node bin/cli.js --help
node bin/cli.js check_claims --input check-input.json
```
`check-input.json`:
```json
{
"claims": ["Heat pump sales in Europe grew 30% in 2025."],
"sources": [
{ "url": "https://energy.example.org/a", "text": "Heat pump sales in Europe grew 30% in 2025, according to the industry association." }
]
}
```
To check a script from the video-script agent, pass `{"script": <script>, "sources": [...]}`. Use the
same sources that the research brief was built from.
## Use as an MCP server
```sh
claude mcp add fact-check -- node /absolute/path/to/fact-check/bin/mcp.js
```
```json
{ "mcpServers": { "fact-check": { "command": "node", "args": ["/absolute/path/to/fact-check/bin/mcp.js"] } } }
```
`claude-code/SKILL.md` is a Claude Code skill that drives the CLI.
## Testing status
Tested with Node.js (Vitest, `tests/fact-check.test.ts`, fixture claims and sources only). It has
**not yet been verified inside Claude Code** or any other MCP client by AgentRove.
## Limitations
- It checks consistency with the sources you supply, not truth in the world. It does not search the
web or judge source reliability.
- Matching is lexical. Apart from common rise/fall verbs, paraphrases and synonyms ("bought" vs
"purchased") lower coverage and can produce `needs_review` or `unsupported` for claims a person
would accept. Claims that span two source
sentences are not combined.
- Figures: number words ("three"), ranges ("20-30%"), approximations ("about 30%" vs "29.7%") and
units other than %, currency symbols and thousand/million/billion are not interpreted.
- English-oriented stopwords, negations and stemming.
- Always read the excerpts before relying on a verdict.