← All writing

Testing

Writing

export async function compare(variants, cases, check) {
  const results = {};
  for (const [name, run] of Object.entries(variants)) {
    const rows = [];
    for (const c of cases) {
      let output;

A small test harness for prompts: same cases, every change

About forty lines of code that run the same cases against several variants and count passes, failures and missing results separately. Tried on our semantic search and on a small local model, where it caught a problem nobody was looking for.

AI applicationsTestingEvaluation
function summarize(successes, assessed, unresolved) {
  const total = assessed + unresolved;
  return {
    observed: assessed ? successes / assessed : null,
    lower: total ? successes / total : null,
    upper: total ? (successes + unresolved) / total : null,

Eight correct answers: is that really 100%?

What happens to a score when unanswered cases are left out, and how to report it honestly.

EvaluationTestingAI applications
export function decide(x) {
  if (x.privateSource) return 'private';
  if (x.sensitive) return 'review';
  if (!x.evidence) return 'reject';
  return x.confidence >= 0.9 ? 'publish' : 'review';
}

AI sounds certain. Should we publish it?

A small experiment that separates three questions a confidence score cannot answer on its own: is it supported, is it sensitive, and may it be shared?

AI applicationsReliabilityTesting