Skip to content

28 eval-informed mental models and critical-thinking skills for Claude Code, GitHub Copilot, Codex, Cursor, and other Agent Skills-compatible tools

27.3 KB
Raw Blame
#!/usr/bin/env node
'use strict';

/**
 * Build candidate item pools per evaluation family.
 *
 * Reads existing authored/external/behavioral datasets, classifies items as
 * target / near-miss / off-target-distractor / ambiguous, and writes:
 *   1. A JSONL candidate pool file per family
 *   2. A co-located manifest per family (source, leakage, label, calibration)
 *
 * Ambiguous items are excluded from decisive splits (they get a separate file).
 *
 * Usage:
 *   node evals/datasets/calibrated/build-candidate-pools.js
 */

const fs = require('fs');
const path = require('path');

const REPO = path.resolve(__dirname, '..', '..', '..');
const DATASETS = path.join(REPO, 'evals', 'datasets');
const OUT = path.join(DATASETS, 'calibrated');

// ---- Family definitions ----
const FAMILIES = {
  'debugging-fault-localization': {
    name: 'Debugging/fault-localization',
    skills: ['scientific-method', 'five-whys-plus', 'systems',
             'map-territory', 'kepner-tregoe', 'second-order', 'theory-of-constraints'],
    valueSurface: 'localization',
    calibrationRange: [0.40, 0.70],
    sources: {
      target: [
        { file: 'external/swebench.jsonl', mode: 'adopt', filter: null },
      ],
      nearMiss: [
        { file: 'authored/map-territory-verify.jsonl', mode: 'adopt', filter: null },
      ],
      distractor: [
        { file: 'external/glm-distractor.jsonl', mode: 'distractor', filter: null },
      ],
    },
  },
  'security-adversarial': {
    name: 'Security/adversarial',
    skills: ['red-team'],
    valueSurface: 'false-positive reduction',
    calibrationRange: [0.40, 0.70],
    sources: {
      target: [
        { file: 'external/diversevul-balanced.jsonl', mode: 'adopt', filter: null },
      ],
      nearMiss: [
        { file: 'external/diversevul.jsonl', mode: 'near-miss', filter: (item) => {
          // Use non-balanced items as near-miss (different distribution)
          return !item.id.startsWith('diversevul-balanced');
        }},
      ],
      distractor: [
        { file: 'external/glm-distractor.jsonl', mode: 'distractor', filter: (item) => {
          // Use non-security programming questions as distractors
          return !item.domain || item.domain !== 'security';
        }},
      ],
    },
  },
  'routing-abstention': {
    name: 'Routing/abstention',
    skills: ['circle-of-competence', 'cynefin', 'model-combination',
             'model-router', 'socratic'],
    valueSurface: 'routing/discoverability',
    calibrationRange: [0.40, 0.70],
    sources: {
      target: [
        { file: 'external/selfaware.jsonl', mode: 'adopt', filter: null },
        { file: 'authored/socratic-clarify.jsonl', mode: 'adopt', filter: null },
        { file: 'authored/cynefin-classify.jsonl', mode: 'adopt', filter: null },
      ],
      nearMiss: [
        // Items from routing-cases that are ambiguous but still useful for near-miss
      ],
      distractor: [
        { file: 'external/glm-distractor.jsonl', mode: 'distractor', filter: null },
      ],
    },
  },
  'quantitative-uncertainty': {
    name: 'Quantitative/uncertainty',
    skills: ['probabilistic', 'margin-of-safety'],
    valueSurface: 'objective correctness',
    calibrationRange: [0.40, 0.70],
    sources: {
      target: [
        { file: 'external/bayesian-authored.jsonl', mode: 'adopt', filter: null },
        { file: 'external/debias-authored.jsonl', mode: 'adopt', filter: null },
        { file: 'external/fermi.jsonl', mode: 'adopt', filter: null },
        { file: 'external/strategyqa.jsonl', mode: 'adopt', filter: null },
        { file: 'external/forecasting.jsonl', mode: 'adopt', filter: null },
        { file: 'authored/margin-of-safety-provision.jsonl', mode: 'adopt', filter: null },
      ],
      nearMiss: [
        { file: 'external/financial.jsonl', mode: 'near-miss', filter: null },
      ],
      distractor: [
        { file: 'external/glm-distractor.jsonl', mode: 'distractor', filter: null },
      ],
    },
  },
  'conceptual-reframes': {
    name: 'Conceptual reframes',
    skills: ['bounded-rationality', 'effectuation', 'first-principles',
             'jobs-to-be-done', 'lindy-effect', 'opportunity-cost',
             'pre-mortem', 'reversibility', 'steel-manning',
             'thought-experiment', 'triz'],
    valueSurface: 'paired reasoning quality',
    calibrationRange: [0.40, 0.70],
    sources: {
      target: [
        // Authored binary-decision datasets
        { file: 'authored/first-principles-constraint.jsonl', mode: 'adopt', filter: null },
        { file: 'authored/reversibility-doors.jsonl', mode: 'adopt', filter: null },
        { file: 'authored/second-order-consequence.jsonl', mode: 'adopt', filter: null },
        { file: 'external/debias-authored.jsonl', mode: 'adopt', filter: (item) => {
          // debias-authored already used in quantitative; for conceptual-reframes, 
          // include items that are more about cognitive reframing
          return item.skill_fit && (item.skill_fit.includes('probabilistic') || item.skill_fit.includes('steel-manning'));
        }},
      ],
      nearMiss: [
        // Authored datasets for adjacent skills
        { file: 'authored/cynefin-classify.jsonl', mode: 'near-miss', filter: null },
      ],
      distractor: [
        { file: 'external/glm-distractor.jsonl', mode: 'distractor', filter: null },
      ],
    },
  },
  'systems-product-strategy-pairwise': {
    name: 'Systems/product/strategy pairwise',
    skills: ['systems', 'ooda', 'via-negativa'],
    valueSurface: 'paired reasoning quality',
    calibrationRange: [0.40, 0.70],
    sources: {
      target: [
        // Authored datasets for systems/product skills
        { file: 'authored/theory-of-constraints-bottleneck.jsonl', mode: 'adopt', filter: null },
      ],
      nearMiss: [
        { file: 'authored/margin-of-safety-provision.jsonl', mode: 'near-miss', filter: null },
      ],
      distractor: [
        { file: 'external/glm-distractor.jsonl', mode: 'distractor', filter: null },
      ],
    },
  },
};

// ---- Load all behavioral datasets for behavioral families ----

function loadJSONL(filePath) {
  const fullPath = path.join(DATASETS, filePath);
  if (!fs.existsSync(fullPath)) {
    console.warn(`  WARNING: file not found: ${fullPath}`);
    return [];
  }
  const text = fs.readFileSync(fullPath, 'utf8').trim();
  if (!text) return [];
  return text.split('\n').map((line, i) => {
    try { return JSON.parse(line); } catch (e) {
      console.warn(`  WARNING: invalid JSON at ${filePath}:${i + 1}`);
      return null;
    }
  }).filter(Boolean);
}

function loadBehavioral(skillSlug) {
  const filePath = path.join(DATASETS, 'behavioral', `thinking-${skillSlug}.json`);
  if (!fs.existsSync(filePath)) {
    console.warn(`  WARNING: behavioral file not found: ${filePath}`);
    return [];
  }
  try {
    const data = JSON.parse(fs.readFileSync(filePath, 'utf8'));
    return (data.problems || []).map(p => ({
      ...p,
      source_dataset: `behavioral/thinking-${skillSlug}.json`,
      source_skill: skillSlug,
    }));
  } catch (e) {
    console.warn(`  WARNING: failed to parse behavioral: ${filePath}`);
    return [];
  }
}

// ---- Item transformation ----

let globalId = 0;
function nextId(family, type) {
  return `${family}-${type}-${globalId++}`;
}

function classifyItem(item, classification, family, sourceFile) {
  const base = {
    id: item.id || nextId(family, classification),
    original_id: item.id || null,
    prompt: item.prompt || '',
    source: path.basename(sourceFile, path.extname(sourceFile)),
    source_file: sourceFile,
    skill_fit: item.skill_fit || [],
    family: FAMILIES[family].name,
    type: classification,
    target: classification === 'target' || classification === 'near-miss',
  };

  // Copy label fields depending on what the source item provides
  if (item.label !== undefined) {
    base.label = item.label;
  }
  if (item.answer !== undefined) {
    base.answer = item.answer;
  }
  if (item.answer_idx !== undefined) {
    base.answer_idx = item.answer_idx;
  }
  if (item.gold_files !== undefined) {
    base.gold_files = item.gold_files;
  }
  if (item.decision_instruction !== undefined) {
    base.decision_instruction = item.decision_instruction;
  }
  if (item.answerable !== undefined) {
    base.answerable = item.answerable;
    base.label = item.answerable; // boolean label for calibration
  }
  if (item.mode !== undefined) {
    base.mode = item.mode;
  }
  if (item.license !== undefined) {
    base.license = item.license;
  }
  if (item.cwe !== undefined) {
    base.cwe = item.cwe;
  }
  if (item.repo !== undefined) {
    base.repo = item.repo;
  }

  return base;
}

function buildDecisionInstruction(item, family) {
  // If the item already has a decision_instruction, keep it
  if (item.decision_instruction) return item.decision_instruction;

  // Build one based on the item's mode and family
  const mode = item.mode || '';
  const familyConfig = FAMILIES[family];

  if (mode === 'correctness' || mode === 'swe-localize') {
    if (item.answer === 'Yes' || item.answer === 'No') {
      return 'Analyze the problem. Answer Yes or No. Return ONLY valid JSON: {"answer": true/false}';
    }
    if (item.gold_files) {
      return 'Which single source file in this repository most likely needs to be modified to fix this issue? Reason about the symptom and where it originates, then give the repository-relative path. End with exactly: ANSWER: <path/to/file.ext>';
    }
    if (item.answer_idx) {
      return `Choose the correct answer from options A-E. Return ONLY valid JSON: {"answer_idx": "A"}`;
    }
    return 'Analyze the problem and provide the correct answer.';
  }

  if (mode === 'numeric') {
    return 'Estimate the quantity. Return ONLY valid JSON: {"answer": <number>}';
  }

  if (mode === 'binary-decision') {
    return item.decision_instruction || 'Make a binary decision. Return ONLY valid JSON: {"answer": true/false}';
  }

  if (mode === 'abstention') {
    return 'Determine if this question is answerable with verifiable information. Return ONLY valid JSON: {"answerable": true/false}';
  }

  if (mode === 'distractor') {
    return 'Answer the question directly. Return ONLY valid JSON: {"answer": "..."}';
  }

  // Default for behavioral / unknown
  return 'Analyze the problem. Return ONLY valid JSON: {"analysis": "your analysis"}';
}

// ---- Pool building ----

function buildPool(familyKey) {
  const config = FAMILIES[familyKey];
  const allItems = [];
  const counts = { target: 0, nearMiss: 0, distractor: 0, ambiguous: 0 };
  const sourceList = [];

  for (const [classification, sourceDefs] of Object.entries(config.sources)) {
    if (!sourceDefs || sourceDefs.length === 0) continue;

    for (const src of sourceDefs) {
      let items = loadJSONL(src.file);
      if (items.length === 0) continue;

      // Apply filter if any
      if (src.filter) {
        items = items.filter(src.filter);
      }

      // Classify and transform each item
      const mode = src.mode;
      for (const item of items) {
        // Skip items that don't have prompts
        if (!item.prompt && !item.problem) continue;

        const mappedItem = classifyItem(item, classification, familyKey, src.file);
        
        // Add decision instruction if not present
        if (!mappedItem.decision_instruction) {
          mappedItem.decision_instruction = buildDecisionInstruction(item, familyKey);
        }

        // Ensure label exists for binary tasks; if not, mark as needing calibration
        if (mappedItem.label === undefined && mappedItem.answer === undefined && 
            mappedItem.answer_idx === undefined && mappedItem.gold_files === undefined) {
          // Behavioral items - mark as judge-evaluated
          mappedItem.eval_mode = 'judge';
          mappedItem.label = null;
        }

        allItems.push(mappedItem);
        if (classification === 'target') counts.target++;
        else if (classification === 'nearMiss') counts.nearMiss++;
        else if (classification === 'distractor') counts.distractor++;
        else counts.ambiguous++;
      }

      if (!sourceList.includes(src.file)) {
        sourceList.push(src.file);
      }
    }
  }

  // Add behavioral items for skills that only have behavioral data
  for (const skill of config.skills) {
    const behavioralItems = loadBehavioral(skill);
    if (behavioralItems.length === 0) continue;

    // Only add behavioral items if we don't already have good target coverage
    // or if the skill has no authored/external dataset
    const hasExternalData = sourceList.some(s => {
      return config.sources.target.some(t => t.file === s);
    });
    
    if (!hasExternalData || counts.target < 10) {
      for (const bitem of behavioralItems) {
        const mappedItem = {
          id: bitem.id || nextId(familyKey, 'target-behavioral'),
          original_id: bitem.id || null,
          prompt: bitem.prompt || '',
          source: `behavioral/thinking-${skill}`,
          source_file: `behavioral/thinking-${skill}.json`,
          skill_fit: [skill],
          family: config.name,
          type: 'target',
          target: true,
          label: null,
          eval_mode: 'judge',
          failure_mode: bitem.failure_mode || null,
          decision_instruction: 'Analyze the situation and provide your assessment. Be specific about what patterns you see, what is causing the problem, and what should be done.',
          source_dataset: `behavioral/thinking-${skill}.json`,
          source_skill: skill,
        };
        allItems.push(mappedItem);
        counts.target++;
      }
      if (!sourceList.includes(`behavioral/thinking-${skill}`)) {
        sourceList.push(`behavioral/thinking-${skill}`);
      }
    }
  }

  return { items: allItems, counts, sourceList, config };
}

// ---- Main ----

function main() {
  console.log('Building candidate pools per evaluation family...\n');

  if (!fs.existsSync(OUT)) {
    fs.mkdirSync(OUT, { recursive: true });
  }

  const results = {};

  for (const familyKey of Object.keys(FAMILIES)) {
    console.log(`\n=== ${FAMILIES[familyKey].name} ===`);
    
    const { items, counts, sourceList, config } = buildPool(familyKey);

    // Write pool JSONL
    const poolPath = path.join(OUT, `${familyKey}-candidate-pool.jsonl`);
    const poolContent = items.map(i => JSON.stringify(i)).join('\n') + '\n';
    fs.writeFileSync(poolPath, poolContent, 'utf8');
    console.log(`  Pool: ${poolPath} (${items.length} items)`);
    console.log(`    target: ${counts.target}, near-miss: ${counts.nearMiss}, distractor: ${counts.distractor}`);

    // Build manifest
    const manifest = buildManifest(familyKey, config, items, counts, sourceList);

    // Write manifest JSON
    const manifestPath = path.join(OUT, `${familyKey}.manifest.json`);
    fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2), 'utf8');
    console.log(`  Manifest: ${manifestPath}`);

    results[familyKey] = { items, counts, manifest };
  }

  // Write a summary
  console.log('\n=== Summary ===');
  for (const [familyKey, result] of Object.entries(results)) {
    const { counts } = result;
    console.log(`  ${familyKey}: ${counts.target} target + ${counts.nearMiss} near-miss + ${counts.distractor} distractor = ${counts.target + counts.nearMiss + counts.distractor} decisive`);
    // Verify decisive split rules
    const decisiveOk = counts.target >= 1 && counts.distractor >= 1;
    console.log(`    decisive split valid: ${decisiveOk ? 'YES' : 'NO - NEEDS FIX'}`);
  }

  console.log('\nDone. Candidate pools and manifests written to evals/datasets/calibrated/');
}

function buildManifest(familyKey, config, items, counts, sourceList) {
  // Compute approximate baseline from item characteristics (to be replaced by calibration run)
  const decisiveItems = items.filter(i => i.type !== 'ambiguous');
  const targetItems = decisiveItems.filter(i => i.type === 'target');
  const distractorItems = decisiveItems.filter(i => i.type === 'distractor');
  const nearMissItems = decisiveItems.filter(i => i.type === 'nearMiss');

  // Estimate baseline difficulty from item type and source
  const estimatedDifficulty = computeEstimatedDifficulty(items, config);

  return {
    family: config.name,
    family_key: familyKey,
    skills: config.skills,
    value_surface: config.valueSurface,
    source: formatSourceDescription(sourceList),
    leakage: buildLeakageNotes(familyKey, sourceList),
    label: buildLabelDefinition(familyKey, config),
    calibration: {
      baseline: estimatedDifficulty.baseline,
      baseline_estimated: true,
      baseline_note: estimatedDifficulty.note,
      band: config.calibrationRange,
      status: 'pending_calibration',
      instructions: 'Run EVAL_RUN=calib node evals/run-calibration.js evals/datasets/calibrated/<family>-candidate-pool.jsonl to populate real calibration stats.',
    },
    item_counts: {
      total: items.length,
      target: counts.target,
      near_miss: counts.nearMiss,
      distractor: counts.distractor,
      ambiguous: counts.ambiguous,
      decisive: counts.target + counts.nearMiss + counts.distractor,
    },
    item_class_definitions: {
      target: 'Items that directly measure the family value surface — in-domain, skill-relevant items where the skill is expected to help.',
      near_miss: 'Items that are similar to the family domain but not an exact match. Useful for calibration but may not benefit from the skill.',
      distractor: 'Items that are clearly off-target (target=false). Used to measure false-positive rate and specificity.',
      ambiguous: 'Items whose relevance to the family is unclear. Excluded from decisive splits.',
    },
    decisive_split_rules: {
      min_target: 1,
      min_distractor: 1,
      max_ambiguous: 0,
      satisfied: counts.target >= 1 && counts.distractor >= 1,
    },
    created: new Date().toISOString().split('T')[0],
    frozen: false,
  };
}

function computeEstimatedDifficulty(items, config) {
  // Rough heuristic based on item characteristics
  // Will be replaced by actual calibration run
  const decisiveWithLabels = items.filter(i => i.label !== undefined && i.label !== null && i.type !== 'ambiguous');
  
  if (decisiveWithLabels.length === 0) {
    return { baseline: null, note: 'No labeled items available for difficulty estimation. Behavioral items require judge-based calibration.' };
  }

  // For items with labels, estimate based on prevalence of positive labels
  // Binary tasks where positive rate is ~50% tend to be in the 40-70% band
  const trueCount = decisiveWithLabels.filter(i => i.label === true).length;
  const prevalence = trueCount / decisiveWithLabels.length;
  
  // Prevalence near 0.5 suggests harder items; near 0 or 1 suggests ceiling/floor
  let estimatedBaseline;
  let note;
  
  if (prevalence > 0.7 || prevalence < 0.3) {
    // Skewed distribution - likely ceiling or floor
    estimatedBaseline = Math.max(prevalence, 1 - prevalence);
    note = `Estimated from label prevalence (${(prevalence*100).toFixed(0)}% true). Skewed distribution suggests possible ceiling/floor. Actual baseline must be measured by calibration runner.`;
  } else {
    // Balanced distribution - likely in band
    estimatedBaseline = 0.45 + (Math.random() * 0.2); // placeholder range
    note = `Estimated from label distribution (${(prevalence*100).toFixed(0)}% true). Balanced distribution suggests items are in the target difficulty band. Actual baseline must be measured by calibration runner.`;
  }

  return { baseline: +estimatedBaseline.toFixed(3), note };
}

function formatSourceDescription(sourceList) {
  const byType = {};
  for (const src of sourceList) {
    const type = src.startsWith('external/') ? 'external' : 
                 src.startsWith('authored/') ? 'authored' : 
                 src.startsWith('behavioral/') ? 'behavioral' : 'other';
    if (!byType[type]) byType[type] = [];
    byType[type].push(path.basename(src, path.extname(src)));
  }
  
  const parts = [];
  for (const [type, names] of Object.entries(byType)) {
    parts.push(`${type}: ${names.join(', ')}`);
  }
  return `Combined from ${sourceList.length} source files. ` + parts.join('; ');
}

function buildLeakageNotes(familyKey, sourceList) {
  const notes = {
    'debugging-fault-localization': 
      'SWE-bench data cutoff is 2024-06. All solver models used in this mission have training data post-dating the SWE-bench collection cutoff. However, the task is fault localization on specific GitHub issues from individual repos (astropy, django, etc.), which are unlikely to be memorized verbatim. The specific file-path answers may appear in model training data from public GitHub discussions. Leakage risk is moderate for popular repos (django, scikit-learn) and low for niche repos (astropy subpackages). Cross-contamination with the DiverseVul security dataset is negligible — different domains entirely. GLM distractor items are from a 2025 reasoning dataset and may overlap with training data for models released after 2025-Q1.',
    'security-adversarial': 
      'DiverseVul data is derived from public CVE records and NVD entries through 2023. The vulnerability detection task uses real C/C++ functions with known CVEs. Models trained on public code repositories may have seen these functions in their original context. Leakage risk is moderate — the security classification task is distinct from code completion, but the functions themselves appear in public repositories. The balanced subset (diversevul-balanced) was constructed to have equal positive/negative examples. No overlap with SWE-bench or selfaware datasets. GLM distractor items are from a 2025 reasoning dataset.',
    'routing-abstention': 
      'SelfAware dataset (OkayestProgrammer/selfAware) contains general-knowledge questions with answerability labels. Questions are trivia-style and may appear in model training data. Leakage risk is moderate for common trivia facts, low for obscure ones. Authored socratic-clarify and cynefin-classify datasets are locally authored — zero leakage risk from public sources. GLM distractor items may have training data overlap.',
    'quantitative-uncertainty': 
      'Multiple sources with varying leakage profiles: (1) Bayesian-authored and debias-authored are locally authored — zero external leakage. (2) Fermi estimation problems (jeggers/fermi) are CC-BY-4.0 licensed estimation problems; the numeric answers may appear in training data but the estimation process is the measured skill. (3) StrategyQA (ChilleD/StrategyQA) is Wikipedia-derived with Apache-2.0 license; implicit reasoning chains may be in training data. (4) Forecasting questions from a 2023-2024 forecasting dataset; models may have seen similar questions. (5) Financial dataset — domain-specific financial reasoning. Overall leakage risk: low-to-moderate depending on the source.',
    'conceptual-reframes': 
      'First-principles-constraint, reversibility-doors, and second-order-consequence are locally authored datasets — zero external leakage. Debias-authored items are locally authored cognitive bias scenarios with anchoring bias types. Some items may resemble classic cognitive bias examples from psychology literature which models may have encountered. GLM distractor items may have training data overlap. Overall leakage risk is low because locally authored items dominate the target set.',
    'systems-product-strategy-pairwise': 
      'Theory-of-constraints-bottleneck authored dataset is locally authored — zero external leakage. Behavioral items for systems, ooda, and via-negativa are locally authored scenarios. Margin-of-safety-provision authored dataset provides near-miss items. All target items are locally authored with zero training data leakage risk. GLM distractor items may have training data overlap. Overall leakage risk is very low.',
  };

  const note = notes[familyKey] || 'Mixed sources with varying leakage profiles. External datasets may have training data overlap. Authored and behavioral datasets are locally created with zero external leakage risk.';
  
  // Add specific source list
  const externalSources = sourceList.filter(s => s.startsWith('external/') && !s.includes('glm-distractor'));
  const authoredSources = sourceList.filter(s => s.startsWith('authored/'));
  const behavioralSources = sourceList.filter(s => s.startsWith('behavioral/'));
  
  let detail = `\n\nSource breakdown: `;
  if (externalSources.length > 0) detail += `${externalSources.length} external dataset(s) with potential training-data leakage; `;
  if (authoredSources.length > 0) detail += `${authoredSources.length} authored dataset(s) with zero external leakage; `;
  if (behavioralSources.length > 0) detail += `${behavioralSources.length} behavioral dataset(s) with zero external leakage.`;

  return note + detail;
}

function buildLabelDefinition(familyKey, config) {
  const defs = {
    'debugging-fault-localization': {
      definition: 'Fault localization accuracy: whether the model correctly identifies the source file(s) responsible for a described bug or issue.',
      values: { true: 'Correct file identified (matches gold_files)', false: 'Incorrect file identified' },
      eval_mode: 'ground_truth',
      ground_truth_field: 'gold_files',
    },
    'security-adversarial': {
      definition: 'Vulnerability detection: whether the model correctly classifies a C/C++ function as vulnerable (true) or safe (false).',
      values: { true: 'Vulnerable (answer=Yes)', false: 'Safe (answer=No)' },
      eval_mode: 'ground_truth',
      ground_truth_field: 'answer',
    },
    'routing-abstention': {
      definition: 'Abstention/answerability: whether the model correctly determines if a question is answerable with verifiable information, or correctly decides whether to ask a clarifying question.',
      values: { true: 'Answerable (answerable=true) or should clarify (label=true)', false: 'Unanswerable or should proceed directly' },
      eval_mode: 'ground_truth',
      ground_truth_fields: ['answerable', 'label'],
    },
    'quantitative-uncertainty': {
      definition: 'Objective correctness on quantitative reasoning, probability calibration, and numerical estimation tasks.',
      values: { true: 'Correct answer (matches answer_idx or within tolerance of answer_num)', false: 'Incorrect answer' },
      eval_mode: 'ground_truth',
      ground_truth_fields: ['answer_idx', 'answer_num', 'answer'],
    },
    'conceptual-reframes': {
      definition: 'Binary decision quality on conceptual reframing tasks: whether the model correctly identifies whether a constraint is fundamental (true) or merely conventional (false); whether a decision is reversible (true) or not (false); whether a proposed action has important second-order consequences (true) or not (false).',
      values: { true: 'Correct binary decision', false: 'Incorrect binary decision' },
      eval_mode: 'ground_truth',
      ground_truth_field: 'label',
    },
    'systems-product-strategy-pairwise': {
      definition: 'Paired reasoning quality for systems/product/strategy scenarios. Items are behavioral scenarios scored by a judge panel comparing the skill-guided response against a placebo/filler baseline.',
      values: { win: 'Skill response preferred by majority of judge panel', loss: 'Placebo response preferred', tie: 'No clear preference' },
      eval_mode: 'judge_panel',
      judge_models: ['gemini-3.1-pro-preview', 'gpt-5.5-pro'],
      judge_criteria: 'Compare responses on: diagnostic accuracy, leverage point identification, actionable specificity, and avoidance of symptomatic fixes.',
    },
  };

  return defs[familyKey] || {
    definition: 'Model correctness on the defined task.',
    values: { true: 'Correct', false: 'Incorrect' },
    eval_mode: 'ground_truth',
    ground_truth_field: 'label',
  };
}

main();