0Pricing
Claude Architect · Leçon

Données et dates contradictoires

Annotez les contradictions ; les dates permettent de résoudre les incohérences apparentes.

Données et dates contradictoires est une leçon Claude Architect gratuite sur CoddyKit. Ceci est la leçon 2 sur 4. Tu peux lire la leçon complète ci-dessous gratuitement — puis la pratiquer en direct dans le navigateur avec un éditeur de code intégré et un tuteur IA 24/7. Elle fait partie du parcours d'apprentissage Claude Architect, et ta progression se synchronise sur le web et l'application CoddyKit. Le cours Claude Architect comprend 4 leçons au total.

Certaines parties de cette leçon n'ont pas encore été traduites et s'affichent en anglais.

When Sources Disagree

In a multi-agent research system, two subagents can return facts that flatly contradict each other. One source says a company has 8,000 employees; another says 12,000. The naive move is to silently pick one and report it as truth.

That is an anti-pattern. The architect-grade answer is to annotate the conflict and preserve both claims with their provenance, so a human (or a downstream model) can adjudicate. This lesson teaches how conflicting data is surfaced, and how dates often resolve apparent contradictions that look irreconcilable at first glance.

Provenance Is the Foundation

You cannot annotate a conflict you cannot trace. Provenance means keeping a claim → source mapping for every fact: the URL or document name, the exact quote, and crucially the publication date.

Without this mapping, a contradiction is just noise. With it, you can show the user precisely where each number came from and when it was published — the raw material for resolving disagreement.

claim = {
    "statement": "Headcount is 12,000",
    "source_name": "Q4 2025 Annual Report",
    "url": "https://example.com/ar-2025.pdf",
    "quote": "As of Dec 31, 2025, we employed 12,000 people.",
    "published": "2026-02-15",
}

Annotate, Don't Arbitrate

The core rule: annotate conflicting stats rather than arbitrarily picking one. When sources disagree, the system should NOT collapse them into a single "winner" by coin-flip, recency-bias, or whichever subagent answered last.

Instead, render both claims side by side, each tagged with its source and date, and explicitly flag that they conflict. The model's job is to surface the disagreement with enough context that a human can decide — not to hide it.

Dates Resolve Apparent Contradictions

Here is the key insight of this lesson: many "contradictions" are not contradictions at all — they are two correct snapshots from different points in time.

"Revenue is $4.2B" (FY2023) and "Revenue is $5.1B" (FY2025) do not conflict. They are both true, on their own dates. Once you attach publication and as-of dates to each claim, the apparent contradiction dissolves into a timeline. This is why the publication date is a first-class field in provenance.

Structured Output for Conflict Records

To make conflict annotation reliable, force the model into a JSON Schema via tool_use. This eliminates syntax errors and enforces required fields. A conflict record should carry every claim with its value, source, and date — plus a resolution note.

Set tool_choice: "any" when you must guarantee structured output (the model must call some tool rather than reply with free text).

tools = [{
    "name": "record_conflict",
    "description": "Record two or more conflicting claims with provenance and a date-based resolution.",
    "input_schema": {
        "type": "object",
        "properties": {
            "metric": {"type": "string"},
            "claims": {"type": "array", "items": {"type": "object"}},
            "resolution": {"type": "string"},
        },
        "required": ["metric", "claims"],
    },
}]
# Force structured output
resp = client.messages.create(
    model="claude-sonnet-4-5",
    max_tokens=1024,
    tools=tools,
    tool_choice={"type": "any"},
    messages=messages,
)

Never Require a Possibly-Absent Field

A subtle but exam-critical schema rule: mark a field required only if it is always present. If a source genuinely lacks a publication date, do NOT make published required — a required-but-absent field pushes the model to fabricate one, which silently destroys your date-based resolution.

In the conflict schema above, metric and claims are required; resolution and each claim's published date are optional. Better an honest null than a hallucinated date.

"properties": {
    "value": {"type": "string"},
    "source_name": {"type": "string"},
    "published": {"type": "string", "description": "ISO date if stated; omit if absent"},
},
"required": ["value", "source_name"]  # published intentionally NOT required

Explicit Criteria Beat Vague Instructions

How you instruct the model matters. "Be careful with conflicting data" is vague and inconsistent. An explicit criterion is far stronger:

  • "Flag two values as conflicting only when they describe the same metric for the same entity."
  • "Before flagging, compare their as-of dates; if the dates differ, treat them as a time series, not a contradiction."

Explicit, testable criteria produce repeatable conflict detection. Vague adjectives do not.

Few-Shot the Date Distinction

Conflict-vs-timeline is exactly the kind of ambiguity where 2–4 targeted few-shot examples shine. The model generalizes from them — it doesn't just memorize the specific numbers.

Give one example of a genuine conflict (same date, different values → flag it) and one example of a date-resolved non-conflict (different dates → report as a timeline). The model learns the decision boundary and applies it to unseen metrics.

examples = [
  {"a": "Rev $4.2B (FY2023)", "b": "Rev $5.1B (FY2025)",
   "verdict": "NOT a conflict — different fiscal years; report as timeline"},
  {"a": "Headcount 8,000 (as of 2026-01)", "b": "Headcount 12,000 (as of 2026-01)",
   "verdict": "CONFLICT — same date, same metric; annotate both with sources"},
]

Keep Dates Verbatim in Case Facts

Long research runs get summarized to fit the context window — and progressive summarization makes numbers, percentages, and dates vague. "Published in early 2026" is useless when the whole resolution hinges on Q1 vs Q3.

The fix: pull transactional facts — exact values, sources, and dates — into a separate "case facts" block kept verbatim outside the summary. Summarize the prose; never summarize the dates you need to resolve conflicts.

case_facts = (
    "VERBATIM — DO NOT SUMMARIZE:\n"
    "- Headcount 8,000 | src: 10-K | published 2025-03-01\n"
    "- Headcount 12,000 | src: Press release | published 2026-02-15\n"
)
# Keep separate from the rolling conversation summary

Self-Correction Detects Discrepancies

To catch conflicts mechanically, have the model extract competing values explicitly rather than emitting a single blended figure. In extraction this is the calculated_total vs stated_total pattern; in research it is value-from-source-A vs value-from-source-B.

Once both are surfaced as distinct fields, a Pydantic-style validator can compare them, detect the mismatch, and trigger the conflict-annotation path — no silent averaging.

from pydantic import BaseModel

class MetricClaim(BaseModel):
    source: str
    value: float
    published: str | None = None

def detect_conflict(a: MetricClaim, b: MetricClaim) -> bool:
    if a.published and b.published and a.published != b.published:
        return False  # date resolves it: timeline, not conflict
    return a.value != b.value

Render by Content Type

Once conflicts are annotated and dates reconciled, present the result so a human can adjudicate fast. Match the rendering to the content type:

  • Tables for financials and competing numeric claims — one row per source, columns for value, source, and date.
  • Prose for news and narrative context.
  • Lists for technical findings.

A side-by-side table makes a same-date conflict jump out, and a date-ordered table reveals a timeline instantly — turning raw provenance into an oversight-ready view.

Quick Check: Two Numbers, Two Dates

A research subagent returns: Source X says ARR is $40M (published Mar 2024); Source Y says ARR is $58M (published Feb 2026). Your aggregator must report this to the user. What is the correct architecture-grade behavior?

Recap: Conflicts & Dates

Key takeaways for conflicting data and provenance:

  • Annotate, don't arbitrate — surface conflicting claims with sources; never silently pick one.
  • Dates resolve apparent contradictions — different as-of dates mean a timeline, not a conflict.
  • Provenance is mandatory — keep claim → source mappings with URL, quote, and publication date.
  • Keep dates verbatim in a separate case-facts block; summarization makes dates vague.
  • Don't require absent fields — an optional null date beats a fabricated one.
  • Render by type — tables for numbers so conflicts and timelines are obvious to the human reviewer.

Questions Fréquemment Posées

La leçon « Données et dates contradictoires » est-elle gratuite ?

Oui — le texte complet de « Données et dates contradictoires » est gratuit à lire ici sur le web. Pour la pratiquer de manière interactive (un éditeur de code intégré et un tuteur IA 24/7) et déverrouiller le reste du cours Claude Architect, passe à CoddyKit PRO. Le cours Claude Architect comprend 4 leçons au total.

Qu'est-ce que j'apprendrai dans « Données et dates contradictoires » ?

Annotez les contradictions ; les dates permettent de résoudre les incohérences apparentes. Tu pratiques Claude Architect avec du code pratique que tu exécutes directement dans le navigateur, et un tuteur IA 24/7 répond à tes questions au fur et à mesure que tu avances dans la leçon.

Dois-je avoir de l'expérience pour commencer Claude Architect ?

Aucune expérience préalable n'est requise. Claude Architect sur CoddyKit est structuré pour les débutants jusqu'aux apprenants avancés, donc tu peux commencer ici ou depuis le début et avancer à ton rythme. Ceci est la leçon 2 sur 4.

Combien de temps prend la leçon « Données et dates contradictoires » ?

La plupart des leçons CoddyKit prennent environ 5–10 minutes. Chacune est courte et interactive, tu progresses régulièrement et tu repiques exactement où tu t'es arrêté sur le web et l'app.

Peux-tu écrire et exécuter du code dans cette leçon Claude Architect ?

Oui. Chaque leçon Claude Architect inclut un éditeur de code intégré, tu écris et exécutes du vrai code directement dans ton navigateur et tu reçois des retours IA instantanés — aucune configuration locale requise.

Toutes les leçons de ce cours

  1. Correspondances entre affirmations et sources
  2. Données et dates contradictoires
  3. Les indicateurs agrégés dissimulent les échecs
  4. Échantillonnage stratifié et étalonnage
← Retour à Claude Architect