Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
fix(contradictions): judge prompt v3 — temporal verdicts need two different times; look-alike names are different entities (N2-3)
garrytan89a4f8a9ec16
diff --git a/docs/contradictions.md b/docs/contradictions.mdindex a02386cd00..3a374f1199 100644--- a/docs/contradictions.md+++ b/docs/contradictions.md@@ -167,7 +167,9 @@ negation_artifact`), and `pages.effective_date` is threaded into the judgeprompt so the probe doesn't cry wolf on facts that simply changed. Onlycontent dates (frontmatter or filename) count; a page whose date is therecorded-time `fallback` reaches the judge as `(date unknown)` and leaves-the text-date pre-filter in charge.+the text-date pre-filter in charge. A temporal verdict needs two different+times: same-date or undated value conflicts are contradictions. Claims about+two entities whose names merely look alike are never contradictions.The trajectory substrate builds on the same signal:`gbrain eval trajectory <entity>` shows the chronological typed-claimdiff --git a/src/core/eval-contradictions/judge.ts b/src/core/eval-contradictions/judge.tsindex 673bb15f43..95f88028ef 100644--- a/src/core/eval-contradictions/judge.ts+++ b/src/core/eval-contradictions/judge.ts@@ -358,6 +358,13 @@ export function buildJudgePrompt(opts: {'- Use contradiction ONLY for genuinely conflicting claims at the same point',' in time, where the dates do not explain the difference.','- Use no_contradiction when the statements are compatible.',+ '- The three temporal verdicts need two DIFFERENT times: different (from:)',+ ' dates, or different dates stated in the text. When both sides carry the',+ ' same date, or nothing dates either side, time does not explain the',+ ' difference: two values for the same fact are a contradiction.',+ '- Only claims about the SAME entity can conflict. Two entities whose names',+ ' merely look alike (e.g. "Northwind" vs "Northgate") are',+ ' different entities: use no_contradiction for their differing values.','','- Subjective opinions held at different times by the SAME holder may be',' a contradiction (a flip). Opinions held by DIFFERENT holders are not.',diff --git a/src/core/eval-contradictions/types.ts b/src/core/eval-contradictions/types.tsindex c93faaa615..37a0af419e 100644--- a/src/core/eval-contradictions/types.ts+++ b/src/core/eval-contradictions/types.ts@@ -20,8 +20,10 @@ export const SCHEMA_VERSION = 1 as const;** v2 (Lane A1, 2026-05): judge prompt now receives `Statement A (from: YYYY-MM-DD)`* or `(date unknown)` per side. Old v1 verdicts are silently invalidated.+ * v3 (N2-3, 2026-10): temporal verdicts need two different times; look-alike+ * names are different entities.*/-export const PROMPT_VERSION = '2' as const;+export const PROMPT_VERSION = '3' as const;/** Truncation policy string baked into the cache key. */export const TRUNCATION_POLICY = '1500-chars-utf8-safe' as const;diff --git a/test/eval-contradictions-judge.test.ts b/test/eval-contradictions-judge.test.tsindex cf72634ff2..d72d4f9ec4 100644--- a/test/eval-contradictions-judge.test.ts+++ b/test/eval-contradictions-judge.test.ts@@ -21,6 +21,7 @@ import {DEFAULT_MAX_PAIR_CHARS,} from '../src/core/eval-contradictions/judge.ts';import type { ChatOpts, ChatResult } from '../src/core/ai/gateway.ts';+import { PROMPT_VERSION } from '../src/core/eval-contradictions/types.ts';function mkResult(text: string, overrides: Partial<ChatResult> = {}): ChatResult {return {@@ -107,6 +108,19 @@ describe('buildJudgePrompt', () => {});expect(p).toContain('holder garry');});++ test('N2-3: temporal verdicts need two different times; look-alike names are different entities', () => {+ const p = buildJudgePrompt({+ query: 'headcount',+ a: { slug: 'a', text: 'A', effective_date: '2025-01-16' },+ b: { slug: 'b', text: 'B', effective_date: '2025-01-16' },+ maxPairChars: 1500,+ });+ expect(p).toContain('The three temporal verdicts need two DIFFERENT times');+ expect(p).toContain('time does not explain the');+ expect(p).toContain('Only claims about the SAME entity can conflict.');+ expect(PROMPT_VERSION).toBe('3');+ });});describe('normalizeVerdict', () => {