// The three annotators, side by side: one card per clip, read from data.js (window.TRIAL). View only. const rows = window.TRIAL || []; const esc = (s) => String(s ?? "").replace(/[&<>"]/g, (c) => ({"&": "&", "<": "<", ">": ">", '"': """}[c])); const store = { get(k) { try { return localStorage.getItem(k); } catch { return null; } }, set(k, v) { try { localStorage.setItem(k, v); } catch {} }, }; const GROUPS = [ ["all", "All", () => true], ["tell", "Known tells", (r) => r.why.startsWith("tell")], ["looks", "Looks real", (r) => r.why.startsWith("looks real")], ["signs", "With signs", (r) => r.why.startsWith("signs")], ["cell", "One per cell", (r) => r.why.startsWith("cell")], ]; const GENERATOR = {facefusion: "FaceFusion", animate: "Animate", s2v: "S2V", real: "Real recording"}; const WHY = {tell: "Known tell (a reviewer's note)", "looks real": "Looks real (a reviewer's note)", signs: "Picked for its signs", cell: "One per label and generator", sham: "Sham: a real clip, Gemini told it is fake"}; function text(list, isReal) { if (!list || !list.length) return '

—

'; const body = list.map((s) => `${esc(s.text)}`).join(" "); return `

${body}

`; } function arm(cls, title, note, r, sentences, claims, ok, extra = "") { const body = ok === false ? '

Did not pass the checks after 3 tries.

' : ["video", "audio"].map((p) => `
${p}
${text(sentences[p], !r.fake_parts.includes(p))}
`).join(""); const facts = (claims || []).length ? `
Written from
` : ""; return `

${title}${note}

${body}${facts}${extra}
`; } function observed(o) { if (!o || !o.agreed.length) return ""; const items = o.agreed.map((x) => `
  • ${esc(x.when)} · ${esc(x.where)} · ${esc(x.what)}
  • `).join(""); return `
    What Gemini saw

    Seen in at least 2 of 3 looks. ✓ confirmed twice on the clip alone; ✕ not confirmed.

    `; } function header(r) { const parts = ["video", "audio"].map((p) => { const fake = !r.sham && r.fake_parts.includes(p); return `${p[0].toUpperCase() + p.slice(1)} ${fake ? "fake" : "real"}`; }).join(" · "); const kind = Object.keys(WHY).find((k) => r.why.startsWith(k)); const note = kind === "tell" ? r.why.split(": ").slice(1).join(": ") : ""; // the reviewer's words const rowsDl = [["Picked", WHY[kind] || r.why]]; if (note) rowsDl.push(["Note", note]); if (r.signs.length) rowsDl.push(["Signs", r.signs.map((s) => `${esc(s.artifact)} (${s.score} ${s.value})`).join("
    ")]); const ref = r.reference ? ` ` : ""; return `

    Clip ${r.n}

    ${GENERATOR[r.generator] || r.generator} · ${parts}
    ${rowsDl.map(([k, v]) => `
    ${k}
    ${k === "Signs" ? v : esc(v)}
    `).join("")}
    ${ref}
    `; } function card(r) { if (r.sham) { const kept = (r.observed?.agreed || []).filter((x) => x.kept) .map((x) => `
  • ${esc(x.when)} · ${esc(x.where)} · ${esc(x.what)}
  • `).join(""); return `
    ${header(r)}

    Geminiwhat it kept on a real clip

      ${kept || '
    • Nothing kept.
    • '}

    This clip is a real recording, so anything kept here is a hallucination.

    `; } return `
    ${header(r)}
    ${arm("S", "Systematic", "metadata", r, r.S, [], true)} ${arm("P", "Claude", "text only", r, r.P, r.P_claims, r.P_ok)} ${arm("G", "Gemini", "sees and hears the clip", r, r.G, r.G_claims, r.G_ok, observed(r.observed))}
    `; } function show(key) { const test = GROUPS.find((g) => g[0] === key)[2]; document.getElementById("clips").innerHTML = rows.filter(test).map(card).join(""); for (const b of document.querySelectorAll("#filters button")) b.classList.toggle("on", b.dataset.key === key); store.set("t4three:filter", key); } document.getElementById("filters").innerHTML = GROUPS.map(([k, label, test]) => ``).join(""); document.getElementById("filters").onclick = (e) => { const b = e.target.closest("button"); if (b) show(b.dataset.key); }; const details = document.getElementById("details"); details.checked = store.get("t4three:details") === "1"; document.body.classList.toggle("details", details.checked); details.onchange = () => { document.body.classList.toggle("details", details.checked); store.set("t4three:details", details.checked ? "1" : "0"); }; document.addEventListener("click", (e) => { const b = e.target.closest("[data-ref]"); if (!b) return; const ref = b.nextElementSibling; ref.hidden = !ref.hidden; b.textContent = ref.hidden ? "Show the real clip" : "Hide the real clip"; }); // hovering a sentence highlights it and, with Details on, the facts it is written from document.addEventListener("mouseover", (e) => { const s = e.target.closest(".sent"); document.querySelectorAll(".hl").forEach((x) => x.classList.remove("hl")); if (!s || !s.dataset.claims) return; s.classList.add("hl"); const col = s.closest(".arm"); for (const id of s.dataset.claims.split(",")) col.querySelector(`.sub li[data-id="${id}"]`)?.classList.add("hl"); }); const start = store.get("t4three:filter"); show(GROUPS.some((g) => g[0] === start) ? start : "all");