{"version":201,"agent":"autosettle","message":"Auto-settle (#19): the open server's advice now comes from Clef, Cloudflare's decision model, by default. On project abso's 33 replayed past holds, Clef settled none wrong at confidence 0.5 or more, where the Llama text model was wrong once at 1.00 (it kept only theirs and would have dropped a 403 guard). A lean to one side under AUTOSETTLE_AT (0.5 unless set) is advice for an agent, marked unsure; AUTOSETTLE_MODEL picks clef-flash or a text model instead. Clef answers in about 0.3 s. The System One questions live in server/src/autosettle.ts, and scripts/autosettle/jev.ts asks Jev the same ones.","time":1792024417177,"timeIso":"2026-10-15T00:33:37.177Z","changes":7,"change":3415,"files":["client/src/api-answers.ts","client/src/publish-commands.ts","scripts/autosettle/jev.ts","server/src/autosettle.ts","server/src/env.ts","server/src/router.ts","server/test/autosettle.test.ts"],"draft":null,"diff":[{"path":"client/src/api-answers.ts","added":3,"removed":3,"diff":"--- a/client/src/api-answers.ts\n+++ b/client/src/api-answers.ts\n@@ -91,14 +91,14 @@\n \t| { ok: false; collisions: readonly Collision[]; reason?: string; advice?: readonly (Advice | null)[] };\n /**\n  * A server's first opinion on one collision of a held push (#19), when it runs AUTOSETTLE: which settle fits,\n- * how sure, and why. `by`: rule (code decided), model (Workers AI), or turned down (the model's pick would break\n- * the file, so an agent settles).\n+ * how sure, and why. `by`: rule (code decided), model (Workers AI), turned down (the model's pick would break\n+ * the file, so an agent settles), or unsure (the model leaned to a side under the server's threshold).\n  */\n export interface Advice {\n \treadonly pick: \"yours\" | \"theirs\" | \"both\" | \"agent\";\n \treadonly confidence: number;\n \treadonly reason: string;\n-\treadonly by: \"rule\" | \"model\" | \"turned down\";\n+\treadonly by: \"rule\" | \"model\" | \"turned down\" | \"unsure\";\n \treadonly modelPick?: string;\n \treadonly model?: string;\n \treadonly ms: number;"},{"path":"client/src/publish-commands.ts","added":3,"removed":1,"diff":"--- a/client/src/publish-commands.ts\n+++ b/client/src/publish-commands.ts\n@@ -505,7 +505,9 @@\n \t\t\t? \"by a check in code\"\n \t\t\t: a.by === \"turned down\"\n \t\t\t\t? `the model said keep ${a.modelPick}, turned down`\n-\t\t\t\t: `${a.confidence.toFixed(2)} of samples agree`;\n+\t\t\t\t: a.by === \"unsure\"\n+\t\t\t\t\t? `the model leaned to keep ${a.modelPick} at ${a.confidence.toFixed(2)}`\n+\t\t\t\t\t: `confidence ${a.confidence.toFixed(2)}`;\n \treturn `${what} (${how}): ${a.reason}`;\n }\n "},{"path":"scripts/autosettle/jev.ts","added":4,"removed":69,"diff":"--- a/scripts/autosettle/jev.ts\n+++ b/scripts/autosettle/jev.ts\n@@ -7,7 +7,11 @@\n // is never printed or written anywhere.\n \n import { execFileSync } from \"node:child_process\";\n+import { confidenceOf, SIGNS, systemOneBody } from \"../../server/src/autosettle.ts\";\n \n+// The questions are the open server's own (server/src/autosettle.ts), so Jev and Clef are asked alike.\n+export { systemOneBody };\n+\n export const ENDPOINT = \"https://api.typesafe.ai/v1/systemone\";\n \n /** abso's settle choices, plus a hand edit by an agent. */\n@@ -67,79 +71,10 @@\n \t}\n }\n \n-const text = (lines: readonly string[]): string => (lines.length === 0 ? \"(no lines)\" : lines.join(\"\\n\"));\n-\n-function stateOf(h: Hold): Record<string, unknown> {\n-\treturn {\n-\t\tfile: h.file,\n-\t\tlines_above: text(h.before),\n-\t\tbefore_either_change: text(h.base),\n-\t\tyours: text(h.yours),\n-\t\ttheirs: text(h.theirs),\n-\t\tlines_below: text(h.after),\n-\t\tyour_push: { agent: h.yourAgent ?? \"you\", message: h.yourMessage ?? \"(no message)\" },\n-\t\ttheir_push: { agent: h.theirAgent ?? \"the other agent\", message: h.theirMessage ?? \"(no message)\" },\n-\t\t...(h.issue ? { issue: h.issue } : {}),\n-\t};\n-}\n-\n-const INSTRUCTIONS =\n-\t\"Two agents changed the same lines of `file`. Both started from `before_either_change`. \" +\n-\t\"`yours` is what the held agent wrote, for the reason in `your_push`; `theirs` was pushed first, for the reason in `their_push`. \" +\n-\t\"The region sits between `lines_above` and `lines_below`. \" +\n-\t\"Which result is correct code that does what both pushes meant?\";\n-\n-const CRITERIA: Record<Pick, string> = {\n-\tyours: \"Keep `yours` only: `yours` already does what `theirs` meant, or `theirs` is wrong or out of date.\",\n-\ttheirs: \"Keep `theirs` only: `theirs` already does what `yours` meant, or `yours` is wrong or out of date.\",\n-\tboth: \"Keep both unchanged, `yours` then `theirs`: they add separate things that work side by side, and nothing is duplicated or contradicts.\",\n-\tagent:\n-\t\t\"Neither side alone and not both unchanged: the sides change the same thing in different ways (such as two different values for one setting), or keeping both would duplicate or contradict, so a correct result needs a hand edit.\",\n-};\n-\n-function choice(order: readonly Pick[]) {\n-\treturn {\n-\t\ttype: \"choice\",\n-\t\tinstructions: INSTRUCTIONS,\n-\t\tcriteria: Object.fromEntries(order.map((p) => [p, CRITERIA[p]])),\n-\t};\n-}\n-\n-const SIGNS: Record<string, string> = {\n-\tsame_setting_different_values:\n-\t\t\"Do `yours` and `theirs` set the same setting, constant or value to two different values?\",\n-\ttheirs_covers_yours: \"Does `theirs` already do everything `yours` was changed to do?\",\n-\tyours_covers_theirs: \"Does `yours` already do everything `theirs` was changed to do?\",\n-\tboth_unchanged_compiles:\n-\t\t\"If `yours` were placed directly above `theirs`, unchanged, would the file still be correct code with nothing defined twice?\",\n-};\n-\n-function confidenceOf(p: Record<Pick, number>): number {\n-\tconst max = Math.max(...PICKS.map((k) => p[k]));\n-\tconst even = 1 / PICKS.length;\n-\treturn Math.max(0, (max - even) / (1 - even));\n-}\n-\n function top(p: Record<Pick, number>): Pick {\n \treturn PICKS.reduce((a, b) => (p[b] > p[a] ? b : a));\n }\n \n-/**\n- * One System One request (TypeSafe's API, which Cloudflare's Clef also takes): the choice in two option orders\n- * (Jev's docs warn order can sway a Choice) and the side questions.\n- */\n-export function systemOneBody(h: Hold, model: string) {\n-\treturn {\n-\t\tmodel,\n-\t\tstate: stateOf(h),\n-\t\tquestions: {\n-\t\t\tsettle: choice(PICKS),\n-\t\t\tsettle_reversed: choice([...PICKS].reverse()),\n-\t\t\t...Object.fromEntries(Object.entries(SIGNS).map(([id, q]) => [id, { type: \"noul\", instructions: q }])),\n-\t\t},\n-\t};\n-}\n-\n export interface SystemOneAnswer {\n \tmodel: string;\n \tanswers: Record<string, { type: string; probabilities?: Record<string, number>; noul?: number; choice?: string }>;"},{"path":"server/src/autosettle.ts","added":142,"removed":17,"diff":"--- a/server/src/autosettle.ts\n+++ b/server/src/autosettle.ts\n@@ -30,8 +30,11 @@\n \t/** The share of samples that agree, or 1 for a pick code made. */\n \treadonly confidence: number;\n \treadonly reason: string;\n-\t/** rule: code decided without the model. turned down: the model's pick would break the file. */\n-\treadonly by: \"rule\" | \"model\" | \"turned down\";\n+\t/**\n+\t * rule: code decided without the model. turned down: the model's pick would break the file. unsure: the model\n+\t * leaned to a side under the threshold, so an agent settles.\n+\t */\n+\treadonly by: \"rule\" | \"model\" | \"turned down\" | \"unsure\";\n \treadonly modelPick?: Pick;\n \treadonly model?: string;\n \treadonly ms: number;\n@@ -168,13 +171,130 @@\n \t};\n }\n \n+const text = (lines: readonly string[]): string => (lines.length === 0 ? \"(no lines)\" : lines.join(\"\\n\"));\n+\n+/** A hold as a System One state: the content the questions point at by name. */\n+export function stateOf(h: Hold): Record<string, unknown> {\n+\treturn {\n+\t\tfile: h.file,\n+\t\tlines_above: text(h.before),\n+\t\tbefore_either_change: h.base.length === 0 && h.before.length === 0 ? \"(not given)\" : text(h.base),\n+\t\tyours: text(h.yours),\n+\t\ttheirs: text(h.theirs),\n+\t\tlines_below: text(h.after),\n+\t\tyour_push: { agent: h.yourAgent ?? \"you\", message: h.yourMessage ?? \"(no message)\" },\n+\t\ttheir_push: { agent: h.theirAgent ?? \"the other agent\", message: h.theirMessage ?? \"(no message)\" },\n+\t\t...(h.issue ? { issue: h.issue } : {}),\n+\t};\n+}\n+\n+const INSTRUCTIONS =\n+\t\"Two agents changed the same lines of `file`. Both started from `before_either_change`. \" +\n+\t\"`yours` is what the held agent wrote, for the reason in `your_push`; `theirs` was pushed first, for the reason in `their_push`. \" +\n+\t\"The region sits between `lines_above` and `lines_below`. \" +\n+\t\"Which result is correct code that does what both pushes meant?\";\n+\n+const CRITERIA: Record<Pick, string> = {\n+\tyours: \"Keep `yours` only: `yours` already does what `theirs` meant, or `theirs` is wrong or out of date.\",\n+\ttheirs: \"Keep `theirs` only: `theirs` already does what `yours` meant, or `yours` is wrong or out of date.\",\n+\tboth: \"Keep both unchanged, `yours` then `theirs`: they add separate things that work side by side, and nothing is duplicated or contradicts.\",\n+\tagent:\n+\t\t\"Neither side alone and not both unchanged: the sides change the same thing in different ways (such as two different values for one setting), or keeping both would duplicate or contradict, so a correct result needs a hand edit.\",\n+};\n+\n+const choice = (order: readonly Pick[]) => ({\n+\ttype: \"choice\",\n+\tinstructions: INSTRUCTIONS,\n+\tcriteria: Object.fromEntries(order.map((p) => [p, CRITERIA[p]])),\n+});\n+\n+/** Side questions asked with the choice, for the record (yes-probabilities). */\n+export const SIGNS: Record<string, string> = {\n+\tsame_setting_different_values:\n+\t\t\"Do `yours` and `theirs` set the same setting, constant or value to two different values?\",\n+\ttheirs_covers_yours: \"Does `theirs` already do everything `yours` was changed to do?\",\n+\tyours_covers_theirs: \"Does `yours` already do everything `theirs` was changed to do?\",\n+\tboth_unchanged_compiles:\n+\t\t\"If `yours` were placed directly above `theirs`, unchanged, would the file still be correct code with nothing defined twice?\",\n+};\n+\n+/**\n+ * A System One request (TypeSafe's Jev and Cloudflare's Clef both take it): the choice in two option orders, since\n+ * Jev's docs warn order can sway a Choice, and the side questions.\n+ */\n+export function systemOneBody(h: Hold, model: string) {\n+\treturn {\n+\t\tmodel,\n+\t\tstate: stateOf(h),\n+\t\tquestions: {\n+\t\t\tsettle: choice(PICKS),\n+\t\t\tsettle_reversed: choice([...PICKS].reverse()),\n+\t\t\t...Object.fromEntries(Object.entries(SIGNS).map(([id, q]) => [id, { type: \"noul\", instructions: q }])),\n+\t\t},\n+\t};\n+}\n+\n+/** Choice confidence: how far the top probability sits above an even split, 0 to 1 (TypeSafe's formula). */\n+export function confidenceOf(p: Record<Pick, number>): number {\n+\tconst max = Math.max(...PICKS.map((k) => p[k]));\n+\tconst even = 1 / PICKS.length;\n+\treturn Math.max(0, (max - even) / (1 - even));\n+}\n+\n+/** Clef's pick: the two orders' probabilities averaged. */\n+export async function clefPick(\n+\tai: Ai,\n+\th: Hold,\n+\tmodel: string,\n+): Promise<{ pick: Pick; confidence: number; reason: string; probabilities: Record<Pick, number> }> {\n+\tconst out = (await ai.run(model === \"clef-flash\" ? \"@cf/cloudflare/clef-flash\" : \"@cf/cloudflare/clef\", {\n+\t\t...systemOneBody(h, model === \"clef-flash\" ? \"clef-flash\" : \"clef\"),\n+\t})) as { answers?: Record<string, { probabilities?: Record<string, number> }> };\n+\tconst orders = [\"settle\", \"settle_reversed\"].map((id) => out.answers?.[id]?.probabilities);\n+\tif (orders.some((p) => !p)) throw new Error(\"Clef answered without the settle choice\");\n+\tconst probabilities = Object.fromEntries(\n+\t\tPICKS.map((k) => [k, ((orders[0]![k] ?? 0) + (orders[1]![k] ?? 0)) / 2]),\n+\t) as Record<Pick, number>;\n+\tconst pick = PICKS.reduce((a, b) => (probabilities[b] > probabilities[a] ? b : a));\n+\tconst words: Record<Pick, string> = {\n+\t\tyours: \"keep yours\",\n+\t\ttheirs: \"keep theirs\",\n+\t\tboth: \"keep both\",\n+\t\tagent: \"an agent\",\n+\t};\n+\treturn {\n+\t\tpick,\n+\t\tconfidence: confidenceOf(probabilities),\n+\t\tprobabilities,\n+\t\treason: `Clef's probabilities: ${PICKS.map((k) => `${words[k]} ${probabilities[k].toFixed(2)}`).join(\", \")}`,\n+\t};\n+}\n+\n /** Code's rules first, then the model, then code's check on what the model picked. */\n-export async function advise(ai: Ai, h: Hold, opts: { model?: string; samples?: number } = {}): Promise<Advice> {\n+export async function advise(\n+\tai: Ai,\n+\th: Hold,\n+\topts: { model?: string; samples?: number; at?: number } = {},\n+): Promise<Advice> {\n \tconst started = Date.now();\n \tconst rule = ruled(h);\n \tif (rule) return { ...rule, confidence: 1, by: \"rule\", ms: 0 };\n-\tconst m = await modelPick(ai, h, opts);\n-\tconst model = opts.model ?? MODEL;\n+\t// Clef unless a text model is named: on project abso's 33 past holds it settled nothing wrong at 0.5 or more,\n+\t// where the text model was wrong once at 1.00 (#19).\n+\tconst clef = !opts.model || opts.model.startsWith(\"clef\");\n+\tconst m = clef ? await clefPick(ai, h, opts.model ?? \"clef\") : await modelPick(ai, h, opts);\n+\tconst model = clef ? `@cf/cloudflare/${opts.model ?? \"clef\"}` : (opts.model ?? MODEL);\n+\tconst at = opts.at ?? 0.5;\n+\tif (m.pick !== \"agent\" && m.confidence < at)\n+\t\treturn {\n+\t\t\tpick: \"agent\",\n+\t\t\tconfidence: m.confidence,\n+\t\t\treason: `${m.reason}; under ${at}, so an agent settles`,\n+\t\t\tby: \"unsure\",\n+\t\t\tmodelPick: m.pick,\n+\t\t\tmodel,\n+\t\t\tms: Date.now() - started,\n+\t\t};\n \tconst no = refused(h, m.pick);\n \treturn no\n \t\t? {\n@@ -207,24 +327,29 @@\n \tai: Ai,\n \tcollisions: readonly HeldCollision[],\n \theld: { agent: string; message: string },\n+\topts: { model?: string; at?: number } = {},\n ): Promise<(Advice | null)[]> {\n \tconst lines = (text: string) => (text === \"\" ? [] : text.replace(/\\r?\\n$/, \"\").split(/\\r?\\n/));\n \treturn Promise.all(\n \t\tcollisions.map(async (c) => {\n \t\t\tif (c.kind !== \"lines\" || c.untouched || c.marked) return null;\n \t\t\ttry {\n-\t\t\t\treturn await advise(ai, {\n-\t\t\t\t\tfile: c.file,\n-\t\t\t\t\tbase: [],\n-\t\t\t\t\tyours: lines(c.yours.text),\n-\t\t\t\t\ttheirs: lines(c.theirs.text),\n-\t\t\t\t\tbefore: [],\n-\t\t\t\t\tafter: [],\n-\t\t\t\t\tyourAgent: held.agent,\n-\t\t\t\t\tyourMessage: held.message,\n-\t\t\t\t\ttheirAgent: c.theirs.agent,\n-\t\t\t\t\ttheirMessage: c.theirs.message,\n-\t\t\t\t});\n+\t\t\t\treturn await advise(\n+\t\t\t\t\tai,\n+\t\t\t\t\t{\n+\t\t\t\t\t\tfile: c.file,\n+\t\t\t\t\t\tbase: [],\n+\t\t\t\t\t\tyours: lines(c.yours.text),\n+\t\t\t\t\t\ttheirs: lines(c.theirs.text),\n+\t\t\t\t\t\tbefore: [],\n+\t\t\t\t\t\tafter: [],\n+\t\t\t\t\t\tyourAgent: held.agent,\n+\t\t\t\t\t\tyourMessage: held.message,\n+\t\t\t\t\t\ttheirAgent: c.theirs.agent,\n+\t\t\t\t\t\ttheirMessage: c.theirs.message,\n+\t\t\t\t\t},\n+\t\t\t\t\topts,\n+\t\t\t\t);\n \t\t\t} catch (e) {\n \t\t\t\tconsole.error(`autosettle: ${c.file}: ${e instanceof Error ? e.message : String(e)}`);\n \t\t\t\treturn null;"},{"path":"server/src/env.ts","added":4,"removed":0,"diff":"--- a/server/src/env.ts\n+++ b/server/src/env.ts\n@@ -26,6 +26,10 @@\n \tKEY_HMAC_SECRET?: string;\n \t/** \"on\" gives a held push a first opinion on each collision from Workers AI (#19); needs the AI binding. */\n \tAUTOSETTLE?: string;\n+\t/** Which model advises: clef (the default), clef-flash, or a Workers AI text model's id. */\n+\tAUTOSETTLE_MODEL?: string;\n+\t/** The confidence under which a lean to one side is left to an agent: 0.5 unless set. */\n+\tAUTOSETTLE_AT?: string;\n \t/** Workers AI, for AUTOSETTLE. Unbound unless wrangler.jsonc names it. */\n \tAI?: { run(model: string, input: unknown): Promise<unknown> };\n }"},{"path":"server/src/router.ts","added":9,"removed":1,"diff":"--- a/server/src/router.ts\n+++ b/server/src/router.ts\n@@ -274,7 +274,15 @@\n \t\t\tconst held = a.body as { ok?: boolean; collisions?: Parameters<typeof adviseHeld>[1] };\n \t\t\tif (held.ok === false && held.collisions && held.collisions.length > 0) {\n \t\t\t\tconst message = String((body as { message?: unknown } | undefined)?.message ?? \"\");\n-\t\t\t\tconst advice = await adviseHeld(env.AI, held.collisions, { agent, message });\n+\t\t\t\tconst advice = await adviseHeld(\n+\t\t\t\t\tenv.AI,\n+\t\t\t\t\theld.collisions,\n+\t\t\t\t\t{ agent, message },\n+\t\t\t\t\t{\n+\t\t\t\t\t\t...(env.AUTOSETTLE_MODEL ? { model: env.AUTOSETTLE_MODEL } : {}),\n+\t\t\t\t\t\t...(Number(env.AUTOSETTLE_AT) > 0 ? { at: Number(env.AUTOSETTLE_AT) } : {}),\n+\t\t\t\t\t},\n+\t\t\t\t);\n \t\t\t\tif (advice.some((x) => x !== null)) return json(a.status, { ...held, advice });\n \t\t\t}\n \t\t}"},{"path":"server/test/autosettle.test.ts","added":42,"removed":15,"diff":"--- a/server/test/autosettle.test.ts\n+++ b/server/test/autosettle.test.ts\n@@ -2,12 +2,26 @@\n import { test } from \"node:test\";\n import { type Ai, adviseHeld, refused, ruled } from \"../src/autosettle.ts\";\n \n-/** A stand-in for Workers AI that always answers `pick`, and counts its calls. */\n-function fakeAi(pick: string): Ai & { calls: number } {\n+/**\n+ * A stand-in for Workers AI that always leans to `pick`: a System One answer for Clef (`top` on `pick`, the rest\n+ * spread evenly) or a JSON-mode answer for a text model. It counts its calls.\n+ */\n+function fakeAi(pick: string, top = 0.85): Ai & { calls: number } {\n \tconst ai = {\n \t\tcalls: 0,\n-\t\tasync run() {\n+\t\tasync run(_model: string, input: unknown) {\n \t\t\tai.calls++;\n+\t\t\tif ((input as { questions?: unknown }).questions) {\n+\t\t\t\tconst probabilities = Object.fromEntries(\n+\t\t\t\t\t[\"yours\", \"theirs\", \"both\", \"agent\"].map((k) => [k, k === pick ? top : (1 - top) / 3]),\n+\t\t\t\t);\n+\t\t\t\treturn {\n+\t\t\t\t\tanswers: {\n+\t\t\t\t\t\tsettle: { type: \"choice\", probabilities },\n+\t\t\t\t\t\tsettle_reversed: { type: \"choice\", probabilities },\n+\t\t\t\t\t},\n+\t\t\t\t};\n+\t\t\t}\n \t\t\treturn { response: { pick, confidence: 0.9, reason: \"a fixed answer\" }, usage: { prompt_tokens: 10 } };\n \t\t},\n \t};\n@@ -20,13 +34,12 @@\n \tyours: { lines: [3, 3] as [number, number], text: yours },\n \ttheirs: { agent: \"other\", message: \"their reason\", text: theirs },\n });\n+const routes = held('\\t\"/blame\": blame,\\n', '\\t\"/search\": search,\\n');\n+const me = { agent: \"me\", message: \"my reason\" };\n \n test(\"code settles when one side's lines are all in the other's, without asking the model\", async () => {\n \tconst ai = fakeAi(\"both\");\n-\tconst [a] = await adviseHeld(ai, [held(\"\\ttimeoutMs: 30000,\\n\", \"\\ttimeoutMs: 30000,\\n\\tretries: 2,\\n\")], {\n-\t\tagent: \"me\",\n-\t\tmessage: \"my reason\",\n-\t});\n+\tconst [a] = await adviseHeld(ai, [held(\"\\ttimeoutMs: 30000,\\n\", \"\\ttimeoutMs: 30000,\\n\\tretries: 2,\\n\")], me);\n \tassert.equal(a?.pick, \"theirs\");\n \tassert.equal(a?.by, \"rule\");\n \tassert.equal(ai.calls, 0);\n@@ -43,17 +56,31 @@\n \tassert.equal(ruled(hold(['\\t\"/blame\": blame,'], ['\\t\"/search\": search,'])), undefined);\n });\n \n-test(\"the model's pick comes back with how many samples agree, and other kinds get no advice\", async () => {\n+test(\"Clef advises by default: one call, its confidence from the probabilities, and other kinds get no advice\", async () => {\n \tconst ai = fakeAi(\"both\");\n-\tconst advice = await adviseHeld(\n-\t\tai,\n-\t\t[held('\\t\"/blame\": blame,\\n', '\\t\"/search\": search,\\n'), held(\"x\", \"y\", \"definition\")],\n-\t\t{ agent: \"me\", message: \"my reason\" },\n-\t);\n+\tconst advice = await adviseHeld(ai, [routes, held(\"x\", \"y\", \"definition\")], me);\n \tassert.equal(advice[0]?.pick, \"both\");\n \tassert.equal(advice[0]?.by, \"model\");\n-\tassert.equal(advice[0]?.confidence, 1);\n+\tassert.equal(advice[0]?.model, \"@cf/cloudflare/clef\");\n+\tassert.equal(advice[0]?.confidence.toFixed(2), \"0.80\");\n \tassert.equal(advice[1], null);\n+\tassert.equal(ai.calls, 1);\n+});\n+\n+test(\"a lean to one side under the threshold goes to an agent, saying which side it leaned to\", async () => {\n+\tconst [a] = await adviseHeld(fakeAi(\"both\", 0.55), [routes], me);\n+\tassert.equal(a?.pick, \"agent\");\n+\tassert.equal(a?.by, \"unsure\");\n+\tassert.equal(a?.modelPick, \"both\");\n+\tconst [b] = await adviseHeld(fakeAi(\"both\", 0.55), [routes], me, { at: 0.3 });\n+\tassert.equal(b?.pick, \"both\");\n+});\n+\n+test(\"a text model named instead takes 5 samples, its confidence the share that agree\", async () => {\n+\tconst ai = fakeAi(\"both\");\n+\tconst [a] = await adviseHeld(ai, [routes], me, { model: \"@cf/meta/llama-3.3-70b-instruct-fp8-fast\" });\n+\tassert.equal(a?.pick, \"both\");\n+\tassert.equal(a?.confidence, 1);\n \tassert.equal(ai.calls, 5);\n });\n \n@@ -63,6 +90,6 @@\n \t\t\tthrow new Error(\"Workers AI is down\");\n \t\t},\n \t};\n-\tconst [a] = await adviseHeld(ai, [held(\"a = 1\", \"b = 2\")], { agent: \"me\", message: \"m\" });\n+\tconst [a] = await adviseHeld(ai, [held(\"a = 1\", \"b = 2\")], me);\n \tassert.equal(a, null);\n });"}],"ci":null}