Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

feat(fact-checker): surface the partial stance in the verdict UI and its image evidence

nirholasa86442289a24
diff --git a/agents/fact-checker/README.md b/agents/fact-checker/README.md
index 970c571c0..e3ebe9df9 100644
--- a/agents/fact-checker/README.md
+++ b/agents/fact-checker/README.md
@@ -9,7 +9,7 @@ For each check, [../../api/x402/fact-check.js](../../api/x402/fact-check.js) dri
1. **Query generation**: `generateSearchQueries()` asks the LLM for 3 distinct search queries approaching the claim from different angles ([src/llm-verdict.js](src/llm-verdict.js)).
2. **Search**: `searchAll()` runs the queries through a fallback chain: Brave, Tavily, Exa, Serper (each only if its key is configured, up to 2 in parallel), then two free keyless fallbacks, Wikipedia full-text search and the DuckDuckGo Instant Answer API, until at least 3 deduplicated results exist ([src/search-sources.js](src/search-sources.js)).
3. **Authority weighting**: `authorityScore()` maps each result URL to a trust weight in [0, 1]: curated domain scores (Reuters 0.85, Wikipedia 0.7, Reddit 0.4, and so on), 0.95 for `.gov`, 0.9 for `.edu`, 0.55 default ([src/source-authority.js](src/source-authority.js)).
-4. **Stance extraction**: `analyzeResults()` makes one LLM call over the top results, returning a 200-character excerpt and a stance (`supports`, `contradicts`, `neutral`) per source.
+4. **Stance extraction**: `analyzeResults()` makes one LLM call over the top results, returning a 200-character excerpt and a stance (`supports`, `contradicts`, `partial`, `neutral`) per source. `partial` marks a source that finds the claim true in one respect and wrong or overstated in another; the consuming endpoint counts it as stance-bearing evidence that takes neither side, which is how a half-true claim reaches a `mixed` verdict without the sources having to disagree with each other.
5. **Image evidence** (optional): `imageEvidence()` sends an attached image to the shared vision helper ([../../api/_lib/vision.js](../../api/_lib/vision.js)), getting a description, transcribed text, and a stance. The result folds into the verdict as one more source with weight 0.6. Fail-open: any vision failure returns `null` and the check proceeds on web sources alone ([src/image-evidence.js](src/image-evidence.js)).
## Key files
diff --git a/agents/fact-checker/src/image-evidence.js b/agents/fact-checker/src/image-evidence.js
index e254cf69e..befcdc0dd 100644
--- a/agents/fact-checker/src/image-evidence.js
+++ b/agents/fact-checker/src/image-evidence.js
@@ -18,7 +18,7 @@ const TIMEOUT_MS = 20_000;
// it sits between a low-authority and a mainstream web source in the weighting.
const IMAGE_SOURCE_WEIGHT = 0.6;
-const STANCES = new Set(['supports', 'contradicts', 'neutral']);
+const STANCES = new Set(['supports', 'contradicts', 'partial', 'neutral']);
function buildPrompt(claim) {
return (
@@ -27,10 +27,12 @@ function buildPrompt(claim) {
'Examine the image and reply ONLY with compact JSON, no prose, in exactly this shape:\n' +
'{"description":"<one sentence describing what the image shows>",' +
'"visible_text":"<any text legible in the image, verbatim; empty string if none>",' +
- '"stance":"supports"|"contradicts"|"neutral",' +
+ '"stance":"supports"|"contradicts"|"partial"|"neutral",' +
'"reason":"<one short clause: how the image relates to the claim>"}\n\n' +
'stance = supports if the image is genuine evidence FOR the claim, contradicts if it ' +
- 'is evidence AGAINST it, neutral if it is unrelated, ambiguous, or clearly manipulated. ' +
+ 'is evidence AGAINST it, partial if it bears out one part of the claim while showing ' +
+ 'another part to be wrong or overstated, neutral if it is unrelated, ambiguous, or ' +
+ 'clearly manipulated. ' +
'Do not speculate beyond what is visibly in the image.'
);
}
diff --git a/pages/fact-checker.html b/pages/fact-checker.html
index c2e4bcdd0..482037b34 100644
--- a/pages/fact-checker.html
+++ b/pages/fact-checker.html
@@ -47,6 +47,7 @@
--verdict-insufficient: #6b7280;
--stance-supports: #22c55e;
--stance-contradicts: #ef4444;
+ --stance-partial: #f59e0b;
--stance-neutral: #6b7280;
--font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
--font-body: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
@@ -684,6 +685,10 @@
background: rgba(239, 68, 68, 0.12);
color: var(--stance-contradicts);
}
+ .stance-pill.partial {
+ background: rgba(245, 158, 11, 0.12);
+ color: var(--stance-partial);
+ }
.stance-pill.neutral {
background: rgba(107, 114, 128, 0.12);
color: var(--stance-neutral);
diff --git a/src/fact-checker-app.js b/src/fact-checker-app.js
index 55a8adc36..1cca672ff 100644
--- a/src/fact-checker-app.js
+++ b/src/fact-checker-app.js
@@ -74,8 +74,17 @@ function faviconUrl(sourceUrl) {
}
function stancePill(stance) {
- const labels = { supports: 'Supports', contradicts: 'Contradicts', neutral: 'Neutral' };
- return `<span class="stance-pill ${stance}">${labels[stance] || stance}</span>`;
+ // `partial` is a source that bears the claim out in one respect and corrects
+ // it in another. It is what drives the `mixed` verdict, so it carries the same
+ // amber the mixed badge does (see .stance-pill.partial in pages/fact-checker.html).
+ const labels = {
+ supports: 'Supports',
+ contradicts: 'Contradicts',
+ partial: 'Partly true',
+ neutral: 'Neutral',
+ };
+ const known = Object.prototype.hasOwnProperty.call(labels, stance) ? stance : 'neutral';
+ return `<span class="stance-pill ${known}">${labels[stance] || stance}</span>`;
}
function renderSources(sources) {