@warmdrift/kgauto-compiler 2.0.0-alpha.9 → 2.0.0-alpha.90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/README.md +176 -46
  2. package/dist/brain-proxy.d.mts +113 -0
  3. package/dist/brain-proxy.d.ts +113 -0
  4. package/dist/brain-proxy.js +193 -0
  5. package/dist/brain-proxy.mjs +6 -0
  6. package/dist/chunk-4LYNDEHJ.mjs +219 -0
  7. package/dist/chunk-65ZMX5OT.mjs +169 -0
  8. package/dist/{chunk-5TI6PNSK.mjs → chunk-BVEXV5KC.mjs} +11 -0
  9. package/dist/chunk-ENELVMJI.mjs +858 -0
  10. package/dist/chunk-NBO4R5PC.mjs +313 -0
  11. package/dist/chunk-OK2TMFRR.mjs +1879 -0
  12. package/dist/chunk-P3TOAEG4.mjs +56 -0
  13. package/dist/chunk-RO22VFIF.mjs +29 -0
  14. package/dist/dialect.d.mts +41 -3
  15. package/dist/dialect.d.ts +41 -3
  16. package/dist/dialect.js +14 -2
  17. package/dist/dialect.mjs +5 -3
  18. package/dist/glassbox/index.d.mts +59 -0
  19. package/dist/glassbox/index.d.ts +59 -0
  20. package/dist/glassbox/index.js +312 -0
  21. package/dist/glassbox/index.mjs +12 -0
  22. package/dist/glassbox-routes/format.d.mts +24 -0
  23. package/dist/glassbox-routes/format.d.ts +24 -0
  24. package/dist/glassbox-routes/format.js +86 -0
  25. package/dist/glassbox-routes/format.mjs +18 -0
  26. package/dist/glassbox-routes/index.d.mts +191 -0
  27. package/dist/glassbox-routes/index.d.ts +191 -0
  28. package/dist/glassbox-routes/index.js +3197 -0
  29. package/dist/glassbox-routes/index.mjs +668 -0
  30. package/dist/glassbox-routes/react/index.d.mts +74 -0
  31. package/dist/glassbox-routes/react/index.d.ts +74 -0
  32. package/dist/glassbox-routes/react/index.js +819 -0
  33. package/dist/glassbox-routes/react/index.mjs +754 -0
  34. package/dist/index.d.mts +3782 -99
  35. package/dist/index.d.ts +3782 -99
  36. package/dist/index.js +10835 -2046
  37. package/dist/index.mjs +6270 -276
  38. package/dist/ir-CTx026t0.d.ts +1887 -0
  39. package/dist/ir-DeYMLWge.d.mts +1887 -0
  40. package/dist/key-health.d.mts +166 -0
  41. package/dist/key-health.d.ts +166 -0
  42. package/dist/key-health.js +247 -0
  43. package/dist/key-health.mjs +12 -0
  44. package/dist/profiles.d.mts +352 -2
  45. package/dist/profiles.d.ts +352 -2
  46. package/dist/profiles.js +1282 -51
  47. package/dist/profiles.mjs +19 -1
  48. package/dist/types-BKbRtmUb.d.ts +131 -0
  49. package/dist/types-Cp9ot1HV.d.ts +142 -0
  50. package/dist/types-DD36cCbZ.d.mts +142 -0
  51. package/dist/types-cBzinzUR.d.mts +131 -0
  52. package/package.json +62 -9
  53. package/dist/chunk-3KVKELZN.mjs +0 -657
  54. package/dist/profiles-BYVOc1eW.d.ts +0 -700
  55. package/dist/profiles-NUZOIzGr.d.mts +0 -700
@@ -0,0 +1,1879 @@
1
+ // src/profiles.ts
2
+ var LATENCY_TIER_MS = {
3
+ fast: 4e3,
4
+ medium: 11e3,
5
+ slow: 24e3
6
+ };
7
+ function latencyTierOf(profile) {
8
+ if (profile.latencyTier) return profile.latencyTier;
9
+ if (profile.weaknesses.includes("latency")) return "slow";
10
+ if (profile.strengths.includes("speed")) return "fast";
11
+ return "medium";
12
+ }
13
+ var ANTHROPIC_LOWERING_BASE = {
14
+ system: { mode: "inline" },
15
+ cache: {
16
+ strategy: "cache_control",
17
+ minTokens: 1024,
18
+ discount: 0.1,
19
+ ttlSeconds: 300
20
+ },
21
+ tools: { format: "anthropic" }
22
+ };
23
+ var GOOGLE_LOWERING_BASE = {
24
+ system: { mode: "separate", field: "systemInstruction" },
25
+ cache: {
26
+ strategy: "cachedContent",
27
+ minTokens: 4096,
28
+ discount: 0.25,
29
+ ttlSeconds: 3600
30
+ },
31
+ tools: { format: "google" }
32
+ };
33
+ var PROFILES_RAW = [
34
+ // ── Anthropic ──
35
+ {
36
+ // VERIFIED 2026-06-21 against the claude-api reference. Claude Fable 5 is
37
+ // Anthropic's most capable model — a NEW tier ABOVE the opus/sonnet/haiku
38
+ // line (the id has no MAJOR-MINOR version, just `-5`) at 2× Opus pricing
39
+ // ($10/$50 vs $5/$25). Hand-authored, not cloned: the onboarder regex can't
40
+ // match this shape (new family + single-segment version), AND a clone would
41
+ // carry the wrong (opus) pricing. status:'preview' — no brain evidence yet;
42
+ // it earns per-archetype placement through the machinery like any model, and
43
+ // at 2× Opus the quality-floor + cost gates do real work before it leads.
44
+ // API quirk (claude-api ref): an explicit `thinking:{type:"disabled"}` 400s
45
+ // on Fable 5 (omit instead) — MOOT here: ANTHROPIC_LOWERING_BASE carries no
46
+ // `thinking` field, so kgauto never sends the param. (L-049/L-081.)
47
+ id: "claude-fable-5",
48
+ verifiedAgainstDocs: "2026-06-21",
49
+ provider: "anthropic",
50
+ status: "current",
51
+ // s76 2026-07-25: GA since 2026-06-09 per docs; was preview.
52
+ maxContextTokens: 1e6,
53
+ maxOutputTokens: 128e3,
54
+ maxTools: 64,
55
+ parallelToolCalls: true,
56
+ structuredOutput: "grammar",
57
+ systemPromptMode: "inline",
58
+ streaming: true,
59
+ cliffs: [],
60
+ costInputPer1m: 10,
61
+ costOutputPer1m: 50,
62
+ lowering: ANTHROPIC_LOWERING_BASE,
63
+ recovery: [
64
+ {
65
+ signal: "rate_limit",
66
+ action: "escalate",
67
+ reason: "429 from Anthropic \u2014 escalate to fallback chain"
68
+ },
69
+ {
70
+ signal: "model_not_found",
71
+ action: "escalate",
72
+ reason: "Model deprecated/renamed \u2014 escalate (L-061)"
73
+ }
74
+ ],
75
+ strengths: ["reasoning", "agentic_coding", "long_context", "reliable_tool_use", "structured_output"],
76
+ weaknesses: ["cost", "latency"],
77
+ notes: "Most capable Anthropic model (2026-06); a new tier ABOVE Opus at 2\xD7 pricing ($10/$50). 1M ctx, 128k out. Verified 2026-06-21 against the claude-api reference. status:preview \u2014 no brain evidence yet; earns placement via the machinery (cost + quality-floor gates govern). latencyTier derives `slow` (weaknesses includes latency \u2014 minutes-long turns on hard tasks). The thinking-disabled-400 API quirk is moot for kgauto (Anthropic lowering emits no thinking param).",
78
+ // archetypePerf cloned from claude-opus-4-8 as a conservative estimate
79
+ // (Fable >= Opus in capability, but unmeasured — no fabricated superiority).
80
+ // Re-rank once brain rows exist.
81
+ archetypePerf: {
82
+ critique: 10,
83
+ plan: 10,
84
+ generate: 9,
85
+ ask: 9,
86
+ extract: 9,
87
+ transform: 9,
88
+ hunt: 8,
89
+ summarize: 8,
90
+ classify: 8
91
+ }
92
+ },
93
+ {
94
+ // Auto-onboarded 2026-06-04 from `claude-opus-4-7`; VERIFIED 2026-06-21
95
+ // against the claude-api reference. Opus 4.8 shares 4.7's surface exactly —
96
+ // 1M ctx, 128k out, $5/$25, no new breaking changes — so the clone's
97
+ // capability data was accurate (confirmed field-by-field). archetypePerf is
98
+ // still cloned from 4.7 (a sound estimate: 4.8 >= 4.7) — re-rank once brain
99
+ // rows exist. Promoted to status:'current' 2026-06-21 (Sacha: "include Claude
100
+ // Opus 4.8") — now live-selectable. Ties with the still-current claude-opus-4-7
101
+ // (identical $5/$25 + cloned perf) resolve to 4-8 by array order. (L-049/L-081.)
102
+ id: "claude-opus-4-8",
103
+ verifiedAgainstDocs: "2026-06-21",
104
+ provider: "anthropic",
105
+ status: "legacy",
106
+ // s76 2026-07-25: docs list as LEGACY (Opus 5 generation is current).
107
+ maxContextTokens: 1e6,
108
+ maxOutputTokens: 128e3,
109
+ maxTools: 64,
110
+ parallelToolCalls: true,
111
+ structuredOutput: "grammar",
112
+ systemPromptMode: "inline",
113
+ streaming: true,
114
+ cliffs: [],
115
+ costInputPer1m: 5,
116
+ costOutputPer1m: 25,
117
+ lowering: ANTHROPIC_LOWERING_BASE,
118
+ recovery: [
119
+ {
120
+ signal: "rate_limit",
121
+ action: "escalate",
122
+ reason: "429 from Anthropic \u2014 escalate to fallback chain"
123
+ },
124
+ {
125
+ signal: "model_not_found",
126
+ action: "escalate",
127
+ reason: "Model deprecated/renamed \u2014 escalate (L-061)"
128
+ }
129
+ ],
130
+ strengths: ["reasoning", "agentic_coding", "long_context", "reliable_tool_use", "structured_output"],
131
+ weaknesses: ["cost", "latency"],
132
+ notes: "Frontier Opus (2026-06), the current recommended Opus-tier default. Verified 2026-06-21 against the claude-api reference: 1M ctx, 128k out, $5/$25 \u2014 identical surface to 4.7, no new breaking changes. Promoted to status:current 2026-06-21 (live-selectable); coexists with claude-opus-4-7 (still current).",
133
+ // Cloned archetypePerf from claude-opus-4-7 — re-evaluate once brain rows exist.
134
+ archetypePerf: {
135
+ critique: 10,
136
+ plan: 10,
137
+ generate: 9,
138
+ ask: 9,
139
+ extract: 9,
140
+ transform: 9,
141
+ hunt: 8,
142
+ summarize: 8,
143
+ classify: 8
144
+ }
145
+ },
146
+ {
147
+ // ── Claude Opus 5 — added s76 (2026-07-25, alpha.72) ──────────────────
148
+ // The model every seat in the portfolio actually runs, absent from the
149
+ // roster until now. Found by a catalog QA, not by the release watcher:
150
+ // the watcher detects unknown IDs on a provider's /models endpoint, but
151
+ // detection was never wired to ingestion, so the gap sat open. (That is
152
+ // what `scripts/catalog-sync.mjs` exists to close.)
153
+ //
154
+ // PROVENANCE — doc-verified 2026-07-25 against
155
+ // platform.claude.com/docs/en/docs/about-claude/models/overview:
156
+ // 1M context · 128k max output · $5/$25 per MTok · adaptive thinking YES
157
+ // · extended thinking NO · `effort` defaults to 'high' on the Claude API
158
+ // · reliable knowledge cutoff May 2026.
159
+ //
160
+ // FAMILY-INHERITED (not doc-read): maxTools, parallelToolCalls,
161
+ // structuredOutput, systemPromptMode, streaming. These are identical
162
+ // across opus-4-6 / 4-7 / 4-8 / sonnet-5 / fable-5 — five consecutive
163
+ // models — so they are a structural provider constant rather than a
164
+ // per-model value. Deliberately distinguished from the gemini-3.1-flash-lite
165
+ // failure, where a template-clone of PRICE (the field that actually varies,
166
+ // there by 2.5-3.75x) went unverified for 65 days.
167
+ id: "claude-opus-5",
168
+ verifiedAgainstDocs: "2026-07-25",
169
+ provider: "anthropic",
170
+ status: "current",
171
+ maxContextTokens: 1e6,
172
+ maxOutputTokens: 128e3,
173
+ maxTools: 64,
174
+ parallelToolCalls: true,
175
+ structuredOutput: "grammar",
176
+ systemPromptMode: "inline",
177
+ streaming: true,
178
+ cliffs: [],
179
+ costInputPer1m: 5,
180
+ costOutputPer1m: 25,
181
+ lowering: ANTHROPIC_LOWERING_BASE,
182
+ recovery: [
183
+ {
184
+ signal: "rate_limit",
185
+ action: "escalate",
186
+ reason: "429 from Anthropic \u2014 escalate to fallback chain"
187
+ },
188
+ {
189
+ signal: "model_not_found",
190
+ action: "escalate",
191
+ reason: "Model deprecated/renamed \u2014 escalate (L-061)"
192
+ }
193
+ ],
194
+ strengths: ["reasoning", "agentic_coding", "long_context", "reliable_tool_use", "structured_output"],
195
+ weaknesses: ["cost", "latency"],
196
+ notes: "Anthropic frontier for complex agentic coding + enterprise work; the Opus-tier current default as of 2026-07-25, superseding 4.8/4.7/4.6 (all now legacy). Doc-verified 2026-07-25: 1M ctx, 128k out, $5/$25, adaptive thinking (extended thinking NOT supported \u2014 that is Haiku 4.5 only in this generation), `effort` defaults to high on the Claude API. Price is unchanged from 4.5 through 5 \u2014 the tier moved without a cost change.",
197
+ // COLD-START PRIOR cloned from claude-opus-4-8. Self-labelling: below
198
+ // MEASURED_GROUNDING_MIN_N (10) brain rows these resolve as
199
+ // grounding:'judgment', so nothing reads them as measured until they are.
200
+ archetypePerf: {
201
+ critique: 10,
202
+ plan: 10,
203
+ generate: 9,
204
+ ask: 9,
205
+ extract: 9,
206
+ transform: 9,
207
+ hunt: 8,
208
+ summarize: 8,
209
+ classify: 8
210
+ }
211
+ },
212
+ {
213
+ id: "claude-opus-4-7",
214
+ verifiedAgainstDocs: "2026-08-14",
215
+ provider: "anthropic",
216
+ status: "legacy",
217
+ // s76 2026-07-25: docs list as LEGACY (Opus 5 is current). Bundle said current while the brain already said legacy — the two disagreed.
218
+ maxContextTokens: 1e6,
219
+ maxOutputTokens: 128e3,
220
+ maxTools: 64,
221
+ parallelToolCalls: true,
222
+ structuredOutput: "grammar",
223
+ systemPromptMode: "inline",
224
+ streaming: true,
225
+ cliffs: [],
226
+ costInputPer1m: 5,
227
+ costOutputPer1m: 25,
228
+ lowering: ANTHROPIC_LOWERING_BASE,
229
+ recovery: [
230
+ {
231
+ signal: "rate_limit",
232
+ action: "escalate",
233
+ reason: "429 from Anthropic \u2014 escalate to fallback chain"
234
+ },
235
+ {
236
+ signal: "model_not_found",
237
+ action: "escalate",
238
+ reason: "Model deprecated/renamed \u2014 escalate (L-061)"
239
+ }
240
+ ],
241
+ strengths: ["reasoning", "agentic_coding", "long_context", "reliable_tool_use", "structured_output"],
242
+ weaknesses: ["cost", "latency"],
243
+ notes: "Frontier (2026-05). Step-change improvement over 4.6 in agentic coding. Adaptive thinking only \u2014 no extended-thinking toggle. 1M context, 128k max output.",
244
+ // Frontier perf. Drops on archetypes where parallel-tool throughput
245
+ // (hunt) or low-budget cost-sensitivity (classify/summarize) matters
246
+ // more than reasoning depth.
247
+ archetypePerf: {
248
+ critique: 10,
249
+ plan: 10,
250
+ generate: 9,
251
+ ask: 9,
252
+ extract: 9,
253
+ transform: 9,
254
+ hunt: 8,
255
+ // strong but Flash dominates parallel tool throughput
256
+ summarize: 8,
257
+ // overkill for tolerant archetype; cost-out of frontier
258
+ classify: 8
259
+ // overkill; brain-validated cheaper models cover this
260
+ }
261
+ },
262
+ {
263
+ id: "claude-opus-4-6",
264
+ verifiedAgainstDocs: "2026-08-14",
265
+ provider: "anthropic",
266
+ status: "legacy",
267
+ maxContextTokens: 1e6,
268
+ maxOutputTokens: 128e3,
269
+ maxTools: 64,
270
+ parallelToolCalls: true,
271
+ structuredOutput: "grammar",
272
+ systemPromptMode: "inline",
273
+ streaming: true,
274
+ cliffs: [],
275
+ costInputPer1m: 5,
276
+ costOutputPer1m: 25,
277
+ lowering: ANTHROPIC_LOWERING_BASE,
278
+ recovery: [
279
+ {
280
+ signal: "rate_limit",
281
+ action: "escalate",
282
+ reason: "429 from Anthropic \u2014 escalate to fallback chain"
283
+ },
284
+ {
285
+ signal: "model_not_found",
286
+ action: "escalate",
287
+ reason: "Model deprecated/renamed \u2014 escalate (L-061)"
288
+ }
289
+ ],
290
+ strengths: ["reasoning", "long_context", "reliable_tool_use", "structured_output", "extended_thinking"],
291
+ weaknesses: ["cost", "latency"],
292
+ notes: "Predecessor to 4.7. Still current in Anthropic legacy table. Same pricing as 4.7 \u2014 choose 4.7 unless you need extended-thinking budget control (4.7 is adaptive-only).",
293
+ // One notch below 4.7 across the board — extended-thinking edge does
294
+ // not flip any archetype ranking. Legacy: chains should prefer 4.7.
295
+ archetypePerf: {
296
+ critique: 9,
297
+ plan: 9,
298
+ generate: 9,
299
+ ask: 9,
300
+ extract: 9,
301
+ transform: 9,
302
+ hunt: 7,
303
+ summarize: 8,
304
+ classify: 8
305
+ }
306
+ },
307
+ {
308
+ id: "claude-sonnet-4-6",
309
+ verifiedAgainstDocs: "2026-08-14",
310
+ provider: "anthropic",
311
+ status: "legacy",
312
+ // s76 2026-07-25: docs list as LEGACY (Sonnet 5 is current).
313
+ maxContextTokens: 1e6,
314
+ maxOutputTokens: 64e3,
315
+ maxTools: 64,
316
+ parallelToolCalls: true,
317
+ structuredOutput: "grammar",
318
+ systemPromptMode: "inline",
319
+ streaming: true,
320
+ cliffs: [],
321
+ costInputPer1m: 3,
322
+ costOutputPer1m: 15,
323
+ lowering: ANTHROPIC_LOWERING_BASE,
324
+ recovery: [
325
+ { signal: "rate_limit", action: "escalate", reason: "429 \u2014 escalate" },
326
+ { signal: "model_not_found", action: "escalate", reason: "Deprecated \u2014 escalate (L-061)" }
327
+ ],
328
+ strengths: ["quality", "tool_use", "long_context", "cache_friendly", "extended_thinking"],
329
+ weaknesses: [],
330
+ notes: "Workhorse. Best price/quality for most multi-turn agentic work. 1M context, 64k max output.",
331
+ // Master plan §6.2 anchor. Tier 0 for plan/generate/ask/extract/transform
332
+ // in starter chains; tier 1 cross-provider for hunt/summarize/classify.
333
+ archetypePerf: {
334
+ ask: 9,
335
+ generate: 9,
336
+ plan: 9,
337
+ critique: 9,
338
+ extract: 9,
339
+ transform: 9,
340
+ hunt: 7,
341
+ // strong but Flash beats on parallel tool throughput
342
+ summarize: 8,
343
+ // overkill for tolerant archetype
344
+ classify: 8
345
+ // overkill
346
+ }
347
+ },
348
+ {
349
+ id: "claude-haiku-4-5",
350
+ verifiedAgainstDocs: "2026-08-14",
351
+ provider: "anthropic",
352
+ status: "current",
353
+ maxContextTokens: 2e5,
354
+ maxOutputTokens: 64e3,
355
+ maxTools: 32,
356
+ parallelToolCalls: true,
357
+ structuredOutput: "grammar",
358
+ systemPromptMode: "inline",
359
+ streaming: true,
360
+ cliffs: [
361
+ {
362
+ metric: "tool_count",
363
+ threshold: 16,
364
+ action: "drop_to_top_relevant",
365
+ reason: "Haiku reliability degrades above ~16 tools"
366
+ },
367
+ {
368
+ // alpha.78 — the declared `structuredOutput: 'grammar'` does NOT
369
+ // hold on long-input summarize. MEASURED (brain, playbacksam):
370
+ // 21 disambiguated `structured_output_parse_failed` fallover rows
371
+ // 2026-07-22..27, tokens_in 12,280–31,450; PB's gate counted 20/20
372
+ // in-window failures. Clean traffic p50 sits at ~9K tokens_in, so
373
+ // 12K gates the failing band without touching the working one.
374
+ // Short-input summarize carries no failure evidence and stays
375
+ // ungated — this is why it's a cliff, not an archetype-wide
376
+ // `structuredOutputHint: 'avoid'`.
377
+ metric: "input_tokens",
378
+ threshold: 12e3,
379
+ action: "quality_gate_structured",
380
+ whenIntent: "summarize",
381
+ reason: "Structured-output parse failures at 100% in-window on long-input summarize (measured on playbacksam, 2026-07-25..27; haiku only led when input size made price dominate, then failed every time)."
382
+ }
383
+ ],
384
+ costInputPer1m: 1,
385
+ costOutputPer1m: 5,
386
+ lowering: ANTHROPIC_LOWERING_BASE,
387
+ recovery: [
388
+ { signal: "rate_limit", action: "escalate", reason: "429 \u2014 escalate to Sonnet" }
389
+ ],
390
+ strengths: ["speed", "cost", "classification", "cache_friendly", "extended_thinking"],
391
+ weaknesses: ["complex_reasoning", "large_tool_sets"],
392
+ notes: "Cheapest Anthropic. Great for classify, summarize, ask shapes. 200k context, 64k max output. API alias `claude-haiku-4-5` resolves to dated snapshot `claude-haiku-4-5-20251001`.",
393
+ // Tier 1 cross-provider anchor for short-output chains (classify/
394
+ // summarize/extract/transform). Falls off on plan/critique where
395
+ // reasoning depth matters; competes with Pro on cost+latency.
396
+ archetypePerf: {
397
+ classify: 8,
398
+ summarize: 8,
399
+ ask: 7,
400
+ transform: 7,
401
+ extract: 7,
402
+ hunt: 6,
403
+ // tool reliability drops at 16 — cliff guard fires
404
+ generate: 6,
405
+ plan: 5,
406
+ critique: 4
407
+ // reasoning depth gap vs Sonnet/Opus
408
+ }
409
+ },
410
+ // ── Google ──
411
+ {
412
+ id: "gemini-2.5-flash",
413
+ verifiedAgainstDocs: "2026-08-14",
414
+ provider: "google",
415
+ status: "current",
416
+ maxContextTokens: 1048576,
417
+ maxOutputTokens: 65535,
418
+ maxTools: 128,
419
+ parallelToolCalls: true,
420
+ structuredOutput: "native",
421
+ systemPromptMode: "separate",
422
+ streaming: true,
423
+ cliffs: [
424
+ {
425
+ metric: "input_tokens",
426
+ threshold: 8e3,
427
+ action: "downgrade_quality_warning",
428
+ reason: "Quality degrades significantly above ~8K context tokens"
429
+ },
430
+ {
431
+ metric: "tool_count",
432
+ threshold: 20,
433
+ action: "drop_to_top_relevant",
434
+ reason: "Tool reliability drops above ~20 tools (despite 128 hard limit)"
435
+ },
436
+ {
437
+ metric: "thinking_with_short_output",
438
+ threshold: 1,
439
+ action: "force_thinking_budget_zero",
440
+ reason: "Thinking tokens consume maxOutputTokens \u2014 empty response if drained"
441
+ },
442
+ {
443
+ // s11 trust artifact (2026-05-02): brain showed 5/5 empty rate on
444
+ // tt-intelligence/summarize/gemini-2.5-flash with tools offered.
445
+ // v1's disable_thinking_for_short_output already fired and didn't
446
+ // help — disabling thinking is necessary but not sufficient. Tools
447
+ // present + summarize intent confuses Flash into a no-output state
448
+ // (likely tool-decision purgatory). Strip tools entirely for this
449
+ // archetype on this model.
450
+ metric: "tool_count",
451
+ threshold: 1,
452
+ whenIntent: "summarize",
453
+ action: "strip_tools",
454
+ reason: "Gemini Flash returns empty when summarize intent has tools offered (5/5 empty rate observed in v1 prod 2026-04-19, replayed into v2 brain 2026-04-29)"
455
+ }
456
+ ],
457
+ costInputPer1m: 0.3,
458
+ costOutputPer1m: 2.5,
459
+ lowering: {
460
+ ...GOOGLE_LOWERING_BASE,
461
+ thinking: { field: "generationConfig.thinkingConfig.thinkingBudget", default: "auto" }
462
+ },
463
+ recovery: [
464
+ {
465
+ signal: "empty_response_after_tool",
466
+ action: "retry_with_params",
467
+ retryParams: { "generationConfig.thinkingConfig.thinkingBudget": 0 },
468
+ maxRetries: 1,
469
+ reason: "Known: empty after tool result \u2014 retry with thinking off"
470
+ },
471
+ {
472
+ signal: "empty_response",
473
+ action: "retry_with_params",
474
+ retryParams: { "generationConfig.thinkingConfig.thinkingBudget": 0 },
475
+ maxRetries: 1,
476
+ reason: "Empty response \u2014 try with thinking off"
477
+ },
478
+ {
479
+ signal: "malformed_function_call",
480
+ action: "escalate",
481
+ reason: "MALFORMED_FUNCTION_CALL maps to stop \u2014 escalate to next target"
482
+ }
483
+ ],
484
+ strengths: ["speed", "volume", "classification", "1m_context", "cost"],
485
+ weaknesses: ["complex_schemas", "large_tool_sets", "high_context_quality"],
486
+ notes: "Fast and cheap with 1M context. Quality cliffs at 8K context and 20 tools \u2014 guard with cliffs.",
487
+ // Master plan §6.2 anchor. Tier 0 for hunt (parallel tool throughput
488
+ // 15-75 calls/step beats Sonnet — L-040), summarize, classify.
489
+ archetypePerf: {
490
+ hunt: 9,
491
+ // L-040: parallel tool throughput 15-75/step
492
+ classify: 7,
493
+ // brain-validated, 218 rows
494
+ summarize: 7,
495
+ // brain-validated; cliff strips tools when present
496
+ transform: 7,
497
+ ask: 7,
498
+ generate: 6,
499
+ plan: 5,
500
+ extract: 6,
501
+ // alpha.8 MAX_TOKENS history on structured output
502
+ critique: 4
503
+ // reasoning shallower than Sonnet/Opus
504
+ }
505
+ },
506
+ {
507
+ // ── Gemini 2.5 Flash-Lite ──
508
+ // Onboarded 2026-05-13 (s22) after the model-release watcher surfaced
509
+ // it as a UNREGISTERED + NEW candidate. Released by Google July 2025,
510
+ // stable. Positioned BELOW Flash on the cost/perf frontier:
511
+ // input $0.10/M (Flash $0.30/M) — 3× cheaper
512
+ // output $0.40/M (Flash $2.50/M) — 6× cheaper
513
+ // cache $0.01/M — 1/10 of input (vs Flash 0.25 discount)
514
+ // Cliffs are HYPOTHESIZED from Flash's known failure modes — Flash-Lite
515
+ // is a smaller sibling, so we inherit Flash's cliffs at equal-or-tighter
516
+ // thresholds. The brain will validate/relax these as evidence accumulates
517
+ // per (archetype, model) tuple. Currently ZERO brain rows for this model.
518
+ id: "gemini-2.5-flash-lite",
519
+ verifiedAgainstDocs: "2026-08-14",
520
+ provider: "google",
521
+ status: "current",
522
+ maxContextTokens: 1048576,
523
+ maxOutputTokens: 65536,
524
+ maxTools: 128,
525
+ parallelToolCalls: true,
526
+ structuredOutput: "native",
527
+ systemPromptMode: "separate",
528
+ streaming: true,
529
+ cliffs: [
530
+ {
531
+ metric: "input_tokens",
532
+ threshold: 8e3,
533
+ action: "downgrade_quality_warning",
534
+ reason: "Inherited from Flash: quality degrades above ~8K. Smaller model \u2014 likely degrades faster. Re-tune from brain after n\u226520."
535
+ },
536
+ {
537
+ metric: "tool_count",
538
+ threshold: 10,
539
+ action: "drop_to_top_relevant",
540
+ reason: "Conservative: Flash drops at 20, Flash-Lite is smaller \u2014 assume tighter ceiling until brain proves otherwise."
541
+ },
542
+ {
543
+ metric: "thinking_with_short_output",
544
+ threshold: 1,
545
+ action: "force_thinking_budget_zero",
546
+ reason: "Thinking enabled per Google API (thinking: true). Same drain risk as Flash \u2014 thinking tokens consume maxOutputTokens."
547
+ },
548
+ {
549
+ // Strong prior: Flash hit 5/5 empty rate on summarize+tools (s11
550
+ // trust artifact, kgauto commit 3872832). Flash-Lite shares the
551
+ // same architectural family — almost certainly inherits this cliff.
552
+ // Ship the guard preemptively; brain telemetry confirms or relaxes.
553
+ metric: "tool_count",
554
+ threshold: 1,
555
+ whenIntent: "summarize",
556
+ action: "strip_tools",
557
+ reason: "Inherited from Flash s11 cliff: summarize+tools \u2192 empty response. Preemptive guard until brain evidence on Flash-Lite specifically."
558
+ }
559
+ ],
560
+ costInputPer1m: 0.1,
561
+ costOutputPer1m: 0.4,
562
+ lowering: {
563
+ ...GOOGLE_LOWERING_BASE,
564
+ // Cache discount 10× (vs Flash 4×) — Google's spec is $0.01/M cache vs
565
+ // $0.10/M input. Material for repeat-prompt workloads (classify shape).
566
+ cache: { ...GOOGLE_LOWERING_BASE.cache, discount: 0.1 },
567
+ thinking: { field: "generationConfig.thinkingConfig.thinkingBudget", default: "auto" }
568
+ },
569
+ recovery: [
570
+ {
571
+ signal: "empty_response_after_tool",
572
+ action: "retry_with_params",
573
+ retryParams: { "generationConfig.thinkingConfig.thinkingBudget": 0 },
574
+ maxRetries: 1,
575
+ reason: "Known on Flash family: empty after tool result \u2014 retry with thinking off."
576
+ },
577
+ {
578
+ signal: "empty_response",
579
+ action: "retry_with_params",
580
+ retryParams: { "generationConfig.thinkingConfig.thinkingBudget": 0 },
581
+ maxRetries: 1,
582
+ reason: "Empty response \u2014 try with thinking off."
583
+ },
584
+ {
585
+ signal: "malformed_function_call",
586
+ action: "escalate",
587
+ reason: "MALFORMED_FUNCTION_CALL maps to stop \u2014 escalate to next target."
588
+ }
589
+ ],
590
+ strengths: ["lowest_cost", "speed", "volume", "classification", "summarize", "1m_context", "cache_friendly"],
591
+ weaknesses: ["complex_reasoning", "large_tool_sets", "complex_schemas", "structured_output_unproven", "long_context_quality"],
592
+ notes: "Bottom-frontier anchor on cost: $0.10/$0.40 per 1M tokens, 1M context, 65K max output. Released July 2025 (stable). Positioned for classify / summarize / transform archetypes where quality bar is forgiving. Cliffs inherited from Flash at equal-or-tighter thresholds \u2014 re-tune per (archetype) once brain has n\u226520 rows. Alpha.8 contract layer handles MAX_TOKENS-on-structured-output via fallback chain, so structuredOutput=native is safe to declare even though Flash had alpha.8 history. Cache discount in spec: $0.01/M = 1/10 of input (richer than Flash 25%) \u2014 meaningful for repeat-prompt workloads.",
593
+ // Tier 3 emergency floor for summarize/classify chains. ZERO brain
594
+ // rows — all values are starter hypotheses anchored to "smaller
595
+ // sibling of Flash, at-or-below Flash perf on every archetype." The
596
+ // first 50 brain rows per archetype will validate or relax these.
597
+ archetypePerf: {
598
+ classify: 6,
599
+ // starter hypothesis — verify (Flash is 7, lite likely ≤)
600
+ summarize: 6,
601
+ // starter hypothesis — verify; cliff strips tools
602
+ transform: 6,
603
+ // starter hypothesis — verify
604
+ ask: 5,
605
+ hunt: 5,
606
+ generate: 4,
607
+ extract: 4,
608
+ plan: 3,
609
+ critique: 3
610
+ }
611
+ },
612
+ {
613
+ id: "gemini-2.5-pro",
614
+ verifiedAgainstDocs: "2026-08-08",
615
+ provider: "google",
616
+ // alpha.86 — AVAILABILITY demotion, not a provider-lifecycle mirror.
617
+ // Google's docs still list 2.5-pro as Stable, but the serving layer
618
+ // disagrees per account cohort: tt-intel measured 4/4 refusals
619
+ // ("no longer available to new users", 2026-08-02, their bench), and
620
+ // kgauto's own key 429s on a FreeTier per-day quota (probed
621
+ // 2026-08-08). A chain anchor that hard-fails for whole account
622
+ // cohorts is not an anchor; `legacy` removes it from cost-ordered
623
+ // chains and new selection while keeping the profile resolvable for
624
+ // consumers who pass it explicitly. Re-promotion is one status flip
625
+ // if Google restores availability. The registry cannot yet express
626
+ // account-cohort availability as data — see interfaces/kgauto.md
627
+ // ## Requested 2026-08-02.
628
+ status: "legacy",
629
+ maxContextTokens: 1048576,
630
+ maxOutputTokens: 65535,
631
+ maxTools: 128,
632
+ parallelToolCalls: true,
633
+ structuredOutput: "native",
634
+ systemPromptMode: "separate",
635
+ streaming: true,
636
+ cliffs: [
637
+ {
638
+ metric: "input_tokens",
639
+ threshold: 2e5,
640
+ action: "downgrade_quality_warning",
641
+ reason: "Pricing doubles above 200K: input $1.25\u2192$2.50/M, output $10\u2192$15/M"
642
+ }
643
+ ],
644
+ costInputPer1m: 1.25,
645
+ costOutputPer1m: 10,
646
+ lowering: {
647
+ ...GOOGLE_LOWERING_BASE,
648
+ thinking: { field: "generationConfig.thinkingConfig.thinkingBudget", default: "auto" }
649
+ },
650
+ recovery: [
651
+ {
652
+ signal: "malformed_function_call",
653
+ action: "escalate",
654
+ reason: "MALFORMED_FUNCTION_CALL \u2014 escalate"
655
+ }
656
+ ],
657
+ strengths: ["reasoning", "1m_context", "structured_output", "tool_use"],
658
+ weaknesses: ["pricing_above_200k", "availability_restricted_by_account_cohort"],
659
+ // Master plan §3.3 anchor: tier-2 cross-provider in almost every chain.
660
+ // Sits on the frontier at perf-9 — close to Sonnet but cheaper input.
661
+ archetypePerf: {
662
+ critique: 9,
663
+ plan: 9,
664
+ ask: 8,
665
+ generate: 8,
666
+ extract: 8,
667
+ transform: 8,
668
+ hunt: 8,
669
+ // tier 1 cross-provider for hunt chain
670
+ summarize: 7,
671
+ classify: 7
672
+ }
673
+ },
674
+ {
675
+ id: "gemini-3.1-pro-preview",
676
+ verifiedAgainstDocs: "2026-08-14",
677
+ provider: "google",
678
+ status: "preview",
679
+ maxContextTokens: 1048576,
680
+ maxOutputTokens: 65535,
681
+ maxTools: 128,
682
+ parallelToolCalls: true,
683
+ structuredOutput: "native",
684
+ systemPromptMode: "separate",
685
+ streaming: true,
686
+ cliffs: [
687
+ {
688
+ metric: "input_tokens",
689
+ threshold: 2e5,
690
+ action: "downgrade_quality_warning",
691
+ reason: "Pricing doubles above 200K: input $2\u2192$4/M, output $12\u2192$18/M"
692
+ }
693
+ ],
694
+ costInputPer1m: 2,
695
+ costOutputPer1m: 12,
696
+ lowering: {
697
+ ...GOOGLE_LOWERING_BASE,
698
+ cache: { ...GOOGLE_LOWERING_BASE.cache, discount: 0.1 },
699
+ thinking: { field: "generationConfig.thinkingConfig.thinkingBudget", default: "auto" }
700
+ },
701
+ recovery: [
702
+ {
703
+ signal: "malformed_function_call",
704
+ action: "escalate",
705
+ reason: "MALFORMED_FUNCTION_CALL \u2014 escalate"
706
+ }
707
+ ],
708
+ strengths: ["reasoning", "1m_context", "agentic_coding", "structured_output", "tool_use"],
709
+ weaknesses: ["cost", "preview_status", "pricing_above_200k"],
710
+ notes: "Frontier Gemini (preview, 2026-Q2). Step-change agentic coding per Google. Cache discount 10\xD7 (vs 4\xD7 for 2.5 Pro). Use status=preview to flag rollback path until GA.",
711
+ // Frontier-Gemini preview — bumped one notch over 2.5 Pro on agentic
712
+ // coding / reasoning per Google's release notes. Preview status:
713
+ // chains should stay on 2.5 Pro until GA. Starter hypothesis.
714
+ archetypePerf: {
715
+ critique: 10,
716
+ // Google claims step-change on reasoning
717
+ plan: 10,
718
+ ask: 9,
719
+ generate: 9,
720
+ extract: 9,
721
+ transform: 8,
722
+ hunt: 9,
723
+ // step-change agentic per Google
724
+ summarize: 8,
725
+ classify: 7
726
+ }
727
+ },
728
+ // ── DeepSeek ──
729
+ // 2026-05-08 audit (L-073): DeepSeek's `deepseek-chat` was silently aliased
730
+ // to `deepseek-v4-flash` non-thinking mode. Old kgauto profile claimed 64k
731
+ // context + $0.27/$1.10 — actual is 1M context + $0.14/$0.28. Now modeled
732
+ // as: V4-Flash + V4-Pro as canonical profiles; deepseek-chat and
733
+ // deepseek-reasoner registered as aliases (see ALIASES below).
734
+ {
735
+ id: "deepseek-v4-flash",
736
+ verifiedAgainstDocs: "2026-08-24",
737
+ provider: "deepseek",
738
+ status: "current",
739
+ maxContextTokens: 1e6,
740
+ maxOutputTokens: 384e3,
741
+ maxTools: 16,
742
+ parallelToolCalls: false,
743
+ structuredOutput: "native",
744
+ systemPromptMode: "inline",
745
+ streaming: true,
746
+ cliffs: [
747
+ {
748
+ metric: "tool_count",
749
+ threshold: 1,
750
+ action: "drop_to_top_relevant",
751
+ reason: "Sequential tool calls only \u2014 L-040"
752
+ }
753
+ ],
754
+ costInputPer1m: 0.44,
755
+ costOutputPer1m: 1.32,
756
+ lowering: {
757
+ system: { mode: "inline" },
758
+ cache: { strategy: "unsupported" },
759
+ tools: { format: "deepseek" }
760
+ },
761
+ recovery: [
762
+ { signal: "rate_limit", action: "escalate", reason: "429 \u2014 escalate" }
763
+ ],
764
+ strengths: ["cost", "1m_context", "json_output", "code", "reasoning"],
765
+ weaknesses: ["parallel_tools", "large_tool_sets"],
766
+ // alpha.47 — explicit slow override. Tag derivation would say 'medium'
767
+ // (no 'latency' weakness, no 'speed' strength), but the alpha.46 shadow
768
+ // probe MEASURED deepseek-v4-flash at 20485ms served (2026-06-03) — ~2.3×
769
+ // gemini-2.5-flash on PB's synchronous /api/analyze path. The 'flash' name
770
+ // is DeepSeek's, not a speed promise. This is the row that, scoring 0.85
771
+ // baseQuality (it carries 'reasoning') with no latency counterweight,
772
+ // leapfrogged gemini-2.5-flash as PB's summarize leader once reachable.
773
+ latencyTier: "slow",
774
+ notes: "Cheap workhorse. 1M context, 384k max output. Cache-hit input $0.0028/M (1/50\xD7 of miss). Aliased as `deepseek-chat` (non-thinking) and `deepseek-reasoner` (thinking) \u2014 see ALIASES. PEAK/OFF-PEAK since 2026-08-16 (page fetched 2026-08-24): peak = weekdays 01:00-04:00 + 06:00-10:00 UTC, off-peak = all other hours at HALF peak. Encoded prices ARE the peak rate (conservative: never understate cost); off-peak traffic costs half what the estimate says. alpha.87 was built + verified 2026-08-14 (prices then live), held at the publish gate 10 days, and published 2026-08-24 \u2014 by which time the 08-16 transition had killed them ($0.14/$0.28 flash, $0.435/$0.87 pro); corrected here (alpha.88). Build-then-hold is the mechanism: re-verify prices at publish when publish is not same-session as build. A single price field cannot represent a two-rate schedule; catalog-sync extractions oscillate between the rates day-to-day (peak read 08-21, off-peak read 08-22) \u2014 time-of-day pricing remains unmodeled, roadmap.",
775
+ // Master plan §6.2 anchor. Brain-validated tier 1 cross-provider for
776
+ // classify (169 rows, 0% empty). Tier 0 for summarize-with-no-tools.
777
+ // Falls off on hunt (sequential tools — L-040) and reasoning depth.
778
+ archetypePerf: {
779
+ classify: 7,
780
+ // brain-validated, 169 rows
781
+ summarize: 7,
782
+ // archetype-tolerant, no brain evidence yet
783
+ ask: 6,
784
+ transform: 6,
785
+ generate: 5,
786
+ plan: 5,
787
+ extract: 5,
788
+ critique: 4,
789
+ hunt: 4
790
+ // sequential tool calls only — L-040
791
+ },
792
+ // alpha.43 — family-level conventions for the `deepseek-chat` family
793
+ // (V4-Flash + future non-thinking-mode members). V4-Flash struggles
794
+ // with summarize-archetype + structured-output: 3 of 4 schema-attempted
795
+ // PB calls (2026-05-18 + 2026-05-22) hit `structured_output_parse_failed`.
796
+ // Surface the friction at compile time so consumers either drop the
797
+ // schema or route to a more schema-reliable family.
798
+ archetypeConventions: [
799
+ {
800
+ archetype: "summarize",
801
+ structuredOutputHint: "avoid",
802
+ cliffWarning: "deepseek-chat family schema compliance on summarize is weak (3 of 4 schema-attempted PB calls hit structured_output_parse_failed). Consider routing summarize+structured-output to a different family (claude-sonnet, gemini-pro, openai-gpt-5.4) or dropping the schema for free-text summaries.",
803
+ reason: "Brain evidence: PB compile_outcomes 2026-05-18 + 2026-05-22, error_type=structured_output_parse_failed on deepseek-v4-flash + summarize archetype."
804
+ }
805
+ ]
806
+ },
807
+ {
808
+ id: "deepseek-v4-pro",
809
+ verifiedAgainstDocs: "2026-08-24",
810
+ provider: "deepseek",
811
+ status: "current",
812
+ maxContextTokens: 1e6,
813
+ maxOutputTokens: 384e3,
814
+ maxTools: 16,
815
+ parallelToolCalls: false,
816
+ structuredOutput: "native",
817
+ systemPromptMode: "inline",
818
+ streaming: true,
819
+ cliffs: [
820
+ {
821
+ metric: "tool_count",
822
+ threshold: 1,
823
+ action: "drop_to_top_relevant",
824
+ reason: "Sequential tool calls only \u2014 L-040"
825
+ }
826
+ ],
827
+ // Verified against the live DeepSeek pricing page 2026-06-22: the 75%-off
828
+ // launch "promo" ($0.435/$0.87) did NOT revert on 2026-05-31 — it became the
829
+ // standing price (docs show $0.435 in / $0.87 out cache-miss, $0.003625
830
+ // cache-hit in; no promo caveat). The old $1.74/$3.48 "regular post-promo"
831
+ // was a projected revert that never happened (L-073/L-081) — it 4×-overstated
832
+ // cost and suppressed V4-Pro in cost-aware ranking.
833
+ costInputPer1m: 1.32,
834
+ costOutputPer1m: 3.96,
835
+ lowering: {
836
+ system: { mode: "inline" },
837
+ cache: { strategy: "unsupported" },
838
+ tools: { format: "deepseek" }
839
+ },
840
+ recovery: [
841
+ { signal: "rate_limit", action: "escalate", reason: "429 \u2014 escalate" }
842
+ ],
843
+ strengths: ["quality", "reasoning", "1m_context", "json_output", "code", "extended_thinking"],
844
+ weaknesses: ["parallel_tools", "large_tool_sets"],
845
+ // alpha.47 — explicit slow override. Measured 47722ms on the alpha.46
846
+ // shadow probe (2026-06-03) — it's an extended-thinking reasoner, slowest
847
+ // of the served set. Tag derivation would say 'medium'; the measurement says
848
+ // otherwise.
849
+ latencyTier: "slow",
850
+ notes: "Pro tier. 1M context, 384k max output. $0.435/$0.87 per 1M (cache-hit in $0.003625) \u2014 verified live 2026-06-22; the launch promo became the standing price (no revert). Default mode = thinking. PEAK/OFF-PEAK since 2026-08-16 (page fetched 2026-08-24): peak = weekdays 01:00-04:00 + 06:00-10:00 UTC, off-peak = all other hours at HALF peak. Encoded prices ARE the peak rate (conservative: never understate cost); off-peak traffic costs half what the estimate says. alpha.87 was built + verified 2026-08-14 (prices then live), held at the publish gate 10 days, and published 2026-08-24 \u2014 by which time the 08-16 transition had killed them ($0.14/$0.28 flash, $0.435/$0.87 pro); corrected here (alpha.88). Build-then-hold is the mechanism: re-verify prices at publish when publish is not same-session as build. A single price field cannot represent a two-rate schedule; catalog-sync extractions oscillate between the rates day-to-day (peak read 08-21, off-peak read 08-22) \u2014 time-of-day pricing remains unmodeled, roadmap.",
851
+ // Master plan §3.3: tier 3 cross-provider for plan chain. Reasoning
852
+ // bumped one notch over V4-Flash; same parallel-tool ceiling.
853
+ archetypePerf: {
854
+ plan: 7,
855
+ // §3.3 tier 3 for plan
856
+ critique: 6,
857
+ ask: 7,
858
+ generate: 6,
859
+ classify: 7,
860
+ summarize: 7,
861
+ extract: 6,
862
+ transform: 6,
863
+ hunt: 4
864
+ // sequential tools — same as V4-Flash
865
+ },
866
+ // alpha.43 — family-level conventions for the `deepseek-reasoner` family
867
+ // (V4-Pro is the family rep; future thinking-mode members inherit).
868
+ //
869
+ // The decisive-archetype suffix is the load-bearing piece: 2026-05-28
870
+ // first real V4-Pro probe on tt-intel/classify (exclusion-finding ID 20)
871
+ // showed 8/10 judge rationales citing "candidate hedges and fails to
872
+ // commit to a single classification" or "candidate refuses to pick
873
+ // among the labels." Without the forcing-function suffix, every
874
+ // reasoner probe on classify/extract/ask verdicts stay-excluded for
875
+ // model-behavior reasons (epistemic humility is reasoner-shaped),
876
+ // NOT quality reasons. The suffix re-shapes the contract so the model
877
+ // is asked for what it's actually being measured on.
878
+ //
879
+ // The hunt-archetype cliffWarning is the L-040 architectural reading
880
+ // surfaced at compile time. Reasoners produce sequential reasoning
881
+ // chains by design; hunt archetypes with 3+ parallel tools lose
882
+ // substantial throughput (L-040 + L-041). The L-040 cliff in the
883
+ // `cliffs` array already trims to top-relevant tools; this warning
884
+ // tells the consumer the family is wrong for the shape so they can
885
+ // route to gemini-flash (parallel-strong) instead of accepting trimmed
886
+ // throughput silently.
887
+ archetypeConventions: [
888
+ {
889
+ archetype: "classify",
890
+ promptSuffix: "\n\nOutput exactly one classification label. Do not hedge, do not add preamble, do not explain your reasoning. If uncertain, pick the most likely label and commit to it.",
891
+ reason: "Reasoners (deepseek-reasoner family) hedge on decisive-output archetypes by design. Evidence: 2026-05-28 V4-Pro probe on tt-intel/classify (exclusion-finding ID 20, brain probe_outcomes); 8 of 10 judge rationales cited hedging or refusal-to-commit. Forcing-function suffix converts reasoner output to decisive labels."
892
+ },
893
+ {
894
+ archetype: "extract",
895
+ promptSuffix: "\n\nOutput exactly the requested structured fields. Do not hedge, do not add preamble, do not explain your reasoning. If a field is unknown, emit the field with a null/empty value and commit to that \u2014 do not refuse to extract.",
896
+ reason: "Reasoners (deepseek-reasoner family) hedge on decisive-output archetypes by design. Evidence: same family failure shape as classify (exclusion-finding ID 20, 2026-05-28). Forcing-function suffix asks for commitment instead of epistemic-humility hedging."
897
+ },
898
+ {
899
+ archetype: "ask",
900
+ promptSuffix: "\n\nAnswer the question directly. Do not hedge, do not add preamble, do not explain your reasoning unless explicitly asked. If uncertain, give your best answer and commit to it.",
901
+ reason: "Reasoners (deepseek-reasoner family) hedge on decisive-output archetypes by design. Evidence: same family failure shape as classify (exclusion-finding ID 20, 2026-05-28). Forcing-function suffix asks for commitment instead of epistemic-humility hedging."
902
+ },
903
+ {
904
+ archetype: "hunt",
905
+ whenToolCountAtLeast: 3,
906
+ cliffWarning: "Reasoners (deepseek-reasoner family) produce sequential reasoning chains by design; hunt archetypes with 3+ parallel tools lose substantial throughput. Consider gemini-flash family (parallel-strong) instead \u2014 see L-040 / L-041.",
907
+ reason: "L-040 + L-041 architectural reading; 2026-05-28 V4-Pro probe evidence (exclusion-finding ID 20) confirms reasoner-family hunt fit is structurally weak."
908
+ }
909
+ ]
910
+ },
911
+ // ── OpenAI ──
912
+ // alpha.16 (2026-05-17): close the half-supported provider gap. env.ts
913
+ // already registered OPENAI_API_KEY + executeOpenAI + normalizeOpenAILike
914
+ // + lowerOpenAI all existed; profile entries were missing, so the
915
+ // alpha.10 auto-filter would mark openai-keyed models reachable but
916
+ // there were no profiles to filter IN. Half-supported is now fully
917
+ // supported. PB request `openai-provider-profiles` (2026-05-16).
918
+ //
919
+ // Profile data verified against developers.openai.com/api/docs/pricing
920
+ // + per-model pages 2026-05-17. L-049/L-081 step-zero: no AI-trained
921
+ // numbers — fetched live from OpenAI's docs. As of 2026-05, OpenAI's
922
+ // current flagship is gpt-5.5 (2025-12 cutoff); gpt-5.4-{base,mini,nano}
923
+ // are the workhorse family. gpt-4.1 + gpt-4o are legacy.
924
+ //
925
+ // Both 5.5 and 5.4 carry a 272K input-token pricing cliff (2x input,
926
+ // 1.5x output beyond that). Modeled as a `downgrade_quality_warning`
927
+ // cliff because it ranks the model down at large-context shapes — the
928
+ // semantics of "this model is now 2x more expensive" map onto the
929
+ // existing penalty mechanism. Cost-watcher will catch high-context
930
+ // spikes empirically; the cliff prevents naive routing into the doubled
931
+ // pricing zone.
932
+ {
933
+ id: "gpt-5.5",
934
+ verifiedAgainstDocs: "2026-05-17",
935
+ provider: "openai",
936
+ status: "current",
937
+ maxContextTokens: 105e4,
938
+ maxOutputTokens: 128e3,
939
+ maxTools: 64,
940
+ parallelToolCalls: true,
941
+ structuredOutput: "native",
942
+ systemPromptMode: "inline",
943
+ streaming: true,
944
+ cliffs: [
945
+ {
946
+ metric: "input_tokens",
947
+ threshold: 272e3,
948
+ action: "downgrade_quality_warning",
949
+ reason: "OpenAI pricing tier shift: >272K input tokens billed at 2x input + 1.5x output rates"
950
+ }
951
+ ],
952
+ costInputPer1m: 5,
953
+ costOutputPer1m: 30,
954
+ lowering: {
955
+ system: { mode: "inline" },
956
+ // OpenAI caching is implicit (auto-applied to repeated prefixes
957
+ // ≥1024 tokens for prompt_tokens_details.cached_tokens). No
958
+ // wire-format marker. Discount: 10x for cached input ($0.50/$5.00).
959
+ cache: { strategy: "unsupported", minTokens: 1024, discount: 0.1 },
960
+ tools: { format: "openai" }
961
+ },
962
+ recovery: [
963
+ { signal: "rate_limit", action: "escalate", reason: "429 \u2014 escalate to fallback chain" },
964
+ { signal: "model_not_found", action: "escalate", reason: "Model deprecated/renamed \u2014 escalate (L-061)" }
965
+ ],
966
+ strengths: ["reasoning", "agentic_coding", "long_context", "structured_output", "reliable_tool_use", "reasoning_effort_knob"],
967
+ weaknesses: ["cost", "pricing_cliff_at_272k"],
968
+ notes: "OpenAI frontier (2026-05). 1M context (1.05M total), 128K max output, 2025-12 cutoff. Reasoning effort knob (none/low/medium/high/xhigh). Pricing cliff at 272K input.",
969
+ // Frontier-tier perf hypothesis. Anchored to Opus 4.7 row (similar
970
+ // price/positioning). Brain evidence will refine; no telemetry yet.
971
+ archetypePerf: {
972
+ critique: 9,
973
+ plan: 9,
974
+ generate: 9,
975
+ ask: 9,
976
+ extract: 9,
977
+ transform: 9,
978
+ hunt: 8,
979
+ // parallel tool support good but cliff at 272K hurts deep multi-step
980
+ summarize: 7,
981
+ // overkill for tolerant archetype
982
+ classify: 7
983
+ // overkill; cheaper models cover this
984
+ }
985
+ },
986
+ {
987
+ id: "gpt-5.4",
988
+ verifiedAgainstDocs: "2026-05-17",
989
+ provider: "openai",
990
+ status: "current",
991
+ maxContextTokens: 105e4,
992
+ maxOutputTokens: 128e3,
993
+ maxTools: 64,
994
+ parallelToolCalls: true,
995
+ structuredOutput: "native",
996
+ systemPromptMode: "inline",
997
+ streaming: true,
998
+ cliffs: [
999
+ {
1000
+ metric: "input_tokens",
1001
+ threshold: 272e3,
1002
+ action: "downgrade_quality_warning",
1003
+ reason: "OpenAI pricing tier shift: >272K input tokens billed at 2x input + 1.5x output rates"
1004
+ }
1005
+ ],
1006
+ costInputPer1m: 2.5,
1007
+ costOutputPer1m: 15,
1008
+ lowering: {
1009
+ system: { mode: "inline" },
1010
+ cache: { strategy: "unsupported", minTokens: 1024, discount: 0.1 },
1011
+ tools: { format: "openai" }
1012
+ },
1013
+ recovery: [
1014
+ { signal: "rate_limit", action: "escalate", reason: "429 \u2014 escalate to fallback chain" },
1015
+ { signal: "model_not_found", action: "escalate", reason: "Model deprecated/renamed \u2014 escalate (L-061)" }
1016
+ ],
1017
+ strengths: ["reasoning", "long_context", "structured_output", "reliable_tool_use"],
1018
+ weaknesses: ["pricing_cliff_at_272k"],
1019
+ notes: "OpenAI workhorse (2026-05). 1M context (1.05M total), 128K max output, 2025-08 cutoff. Pricing cliff at 272K input. Pairs cleanly with Sonnet 4.6 on cost ($2.50/$15.00 vs $3.00/$15.00).",
1020
+ // Anchored to Sonnet 4.6 row (similar price/positioning). Slight
1021
+ // anthropic-side edge on agentic coding per master plan vibe.
1022
+ archetypePerf: {
1023
+ critique: 8,
1024
+ plan: 8,
1025
+ generate: 8,
1026
+ ask: 8,
1027
+ extract: 8,
1028
+ transform: 8,
1029
+ hunt: 7,
1030
+ summarize: 7,
1031
+ classify: 7
1032
+ }
1033
+ },
1034
+ {
1035
+ id: "gpt-5.4-mini",
1036
+ verifiedAgainstDocs: "2026-05-17",
1037
+ provider: "openai",
1038
+ status: "current",
1039
+ maxContextTokens: 4e5,
1040
+ maxOutputTokens: 128e3,
1041
+ maxTools: 64,
1042
+ parallelToolCalls: true,
1043
+ structuredOutput: "native",
1044
+ systemPromptMode: "inline",
1045
+ streaming: true,
1046
+ cliffs: [],
1047
+ costInputPer1m: 0.75,
1048
+ costOutputPer1m: 4.5,
1049
+ lowering: {
1050
+ system: { mode: "inline" },
1051
+ cache: { strategy: "unsupported", minTokens: 1024, discount: 0.1 },
1052
+ tools: { format: "openai" }
1053
+ },
1054
+ recovery: [
1055
+ { signal: "rate_limit", action: "escalate", reason: "429 \u2014 escalate to fallback chain" },
1056
+ { signal: "model_not_found", action: "escalate", reason: "Model deprecated/renamed \u2014 escalate (L-061)" }
1057
+ ],
1058
+ strengths: ["cost", "speed", "agentic_coding", "structured_output", "reliable_tool_use"],
1059
+ weaknesses: ["reasoning_depth"],
1060
+ notes: "OpenAI mini-tier (2026-05). 400K context, 128K max output, 2025-08 cutoff. OpenAI describes as 'strongest mini model for coding, computer use, subagents.' Cache discount 10x ($0.075 input).",
1061
+ // Mini-tier hypothesis. Anchored to Haiku 4.5 + Flash row pricing.
1062
+ // Cost is slightly higher than Haiku ($0.75 vs $0.50 input) but
1063
+ // OpenAI claims strong coding/subagent perf.
1064
+ archetypePerf: {
1065
+ ask: 7,
1066
+ generate: 7,
1067
+ extract: 7,
1068
+ transform: 7,
1069
+ classify: 7,
1070
+ summarize: 7,
1071
+ hunt: 7,
1072
+ plan: 6,
1073
+ critique: 5
1074
+ // reasoning depth gap — frontier models handle this
1075
+ }
1076
+ },
1077
+ {
1078
+ id: "gpt-5.4-nano",
1079
+ verifiedAgainstDocs: "2026-05-17",
1080
+ provider: "openai",
1081
+ status: "current",
1082
+ maxContextTokens: 4e5,
1083
+ maxOutputTokens: 128e3,
1084
+ maxTools: 64,
1085
+ parallelToolCalls: true,
1086
+ structuredOutput: "native",
1087
+ systemPromptMode: "inline",
1088
+ streaming: true,
1089
+ cliffs: [],
1090
+ costInputPer1m: 0.2,
1091
+ costOutputPer1m: 1.25,
1092
+ lowering: {
1093
+ system: { mode: "inline" },
1094
+ cache: { strategy: "unsupported", minTokens: 1024, discount: 0.1 },
1095
+ tools: { format: "openai" }
1096
+ },
1097
+ recovery: [
1098
+ { signal: "rate_limit", action: "escalate", reason: "429 \u2014 escalate to fallback chain" },
1099
+ { signal: "model_not_found", action: "escalate", reason: "Model deprecated/renamed \u2014 escalate (L-061)" }
1100
+ ],
1101
+ strengths: ["cost", "speed", "volume", "structured_output"],
1102
+ weaknesses: ["reasoning_depth", "no_computer_use"],
1103
+ notes: "OpenAI nano-tier (2026-05). 400K context, 128K max output, 2025-08 cutoff. 'Cheapest GPT-5.4-class for simple high-volume tasks.' No fine-tuning, no computer-use tools. Cache discount 10x.",
1104
+ // Nano-tier. Anchored to Flash-Lite row ($0.10/$0.40 vs nano's
1105
+ // $0.20/$1.25). Slightly more expensive than Flash-Lite but with
1106
+ // OpenAI brand reliability. Good fit for classify/summarize floor.
1107
+ archetypePerf: {
1108
+ classify: 7,
1109
+ summarize: 6,
1110
+ ask: 6,
1111
+ transform: 6,
1112
+ extract: 6,
1113
+ generate: 5,
1114
+ hunt: 5,
1115
+ plan: 4,
1116
+ critique: 3
1117
+ // not for reasoning archetypes
1118
+ }
1119
+ },
1120
+ // ── Auto-onboarded (UNVERIFIED) ──
1121
+ // Cloned by scripts/auto-onboard-models.mjs from a same-family template.
1122
+ // Each entry's pricing/context/cliffs/lowering reflects the template, NOT
1123
+ // provider docs. Verify before promoting status to 'current' (L-049/L-081).
1124
+ {
1125
+ // s37 (2026-05-21): UNVERIFIED-AUTO-ONBOARD → verified against
1126
+ // ai.google.dev/gemini-api/docs/models/gemini-3-flash-preview +
1127
+ // ai.google.dev/gemini-api/docs/pricing. L-081 catches:
1128
+ // maxOutputTokens 65_535 → 65_536 (off-by-one)
1129
+ // costInputPer1m 0.30 → 0.50 (template-cloned from 2.5-flash; actual is 1.67× more expensive)
1130
+ // costOutputPer1m 2.50 → 3.00 (template-cloned; actual 1.2× more expensive)
1131
+ // cache discount default 0.25 → 0.10 (10× discount, $0.05/$0.50 per docs)
1132
+ // Cliffs inherited from 2.5-flash conservatively. The 8K-context-quality
1133
+ // cliff was a 2.5-Flash observation — Google positions Gemini 3 as
1134
+ // sustained-frontier-on-long-context; brain evidence will validate/relax.
1135
+ // Kept as guard for now.
1136
+ id: "gemini-3-flash-preview",
1137
+ verifiedAgainstDocs: "2026-05-21",
1138
+ provider: "google",
1139
+ status: "preview",
1140
+ maxContextTokens: 1048576,
1141
+ maxOutputTokens: 65536,
1142
+ maxTools: 128,
1143
+ parallelToolCalls: true,
1144
+ structuredOutput: "native",
1145
+ systemPromptMode: "separate",
1146
+ streaming: true,
1147
+ cliffs: [
1148
+ {
1149
+ metric: "input_tokens",
1150
+ threshold: 8e3,
1151
+ action: "downgrade_quality_warning",
1152
+ reason: "Inherited from 2.5-flash guard; brain evidence on Gemini 3 long-context quality will validate/relax"
1153
+ },
1154
+ {
1155
+ metric: "tool_count",
1156
+ threshold: 20,
1157
+ action: "drop_to_top_relevant",
1158
+ reason: "Tool reliability drops above ~20 tools (despite 128 hard limit) \u2014 inherited from Flash family"
1159
+ },
1160
+ {
1161
+ metric: "thinking_with_short_output",
1162
+ threshold: 1,
1163
+ action: "force_thinking_budget_zero",
1164
+ reason: "Thinking tokens consume maxOutputTokens \u2014 empty response if drained"
1165
+ },
1166
+ {
1167
+ // Inherited from gemini-2.5-flash s11 trust artifact. Family-likely
1168
+ // failure mode for Flash architecture. Keep preemptively until brain
1169
+ // evidence on Gemini 3 specifically.
1170
+ metric: "tool_count",
1171
+ threshold: 1,
1172
+ whenIntent: "summarize",
1173
+ action: "strip_tools",
1174
+ reason: "Inherited from 2.5-flash s11 cliff: summarize+tools \u2192 empty response. Preemptive guard until brain evidence on 3-flash-preview specifically."
1175
+ }
1176
+ ],
1177
+ costInputPer1m: 0.5,
1178
+ costOutputPer1m: 3,
1179
+ lowering: {
1180
+ ...GOOGLE_LOWERING_BASE,
1181
+ // 10× cache discount per Google pricing: $0.05/M cached vs $0.50/M input.
1182
+ cache: { ...GOOGLE_LOWERING_BASE.cache, discount: 0.1 },
1183
+ thinking: { field: "generationConfig.thinkingConfig.thinkingBudget", default: "auto" }
1184
+ },
1185
+ recovery: [
1186
+ {
1187
+ signal: "empty_response_after_tool",
1188
+ action: "retry_with_params",
1189
+ retryParams: { "generationConfig.thinkingConfig.thinkingBudget": 0 },
1190
+ maxRetries: 1,
1191
+ reason: "Known: empty after tool result \u2014 retry with thinking off"
1192
+ },
1193
+ {
1194
+ signal: "empty_response",
1195
+ action: "retry_with_params",
1196
+ retryParams: { "generationConfig.thinkingConfig.thinkingBudget": 0 },
1197
+ maxRetries: 1,
1198
+ reason: "Empty response \u2014 try with thinking off"
1199
+ },
1200
+ {
1201
+ signal: "malformed_function_call",
1202
+ action: "escalate",
1203
+ reason: "MALFORMED_FUNCTION_CALL maps to stop \u2014 escalate to next target"
1204
+ }
1205
+ ],
1206
+ strengths: ["speed", "volume", "classification", "1m_context", "cost"],
1207
+ weaknesses: ["complex_schemas", "large_tool_sets", "high_context_quality"],
1208
+ notes: "Verified s37 (2026-05-21) against Google docs. Step-change positioning vs 2.5-flash on agentic loops per Google's release notes (Dec 2025). Pricing 1.67\xD7/1.2\xD7 higher than 2.5-flash; cache discount 10\xD7 (vs 4\xD7 for 2.5). Status=preview until brain evidence accumulates.",
1209
+ // Anchored to 2.5-flash archetypePerf as starter, with judgment adjustments
1210
+ // for Google's "step-change on agentic" positioning. Brain evidence (zero
1211
+ // rows today) will replace these starter values.
1212
+ archetypePerf: {
1213
+ hunt: 9,
1214
+ // Inherits 2.5-flash L-040 parallel-tool tier; Google positions 3 as agentic-loop upgrade
1215
+ classify: 7,
1216
+ // Inherits 2.5-flash brain-validated tier (218 rows on 2.5)
1217
+ summarize: 7,
1218
+ // Inherits 2.5-flash; cliff strips tools when present
1219
+ transform: 7,
1220
+ ask: 8,
1221
+ // +1 vs 2.5-flash — sustained-frontier positioning
1222
+ generate: 7,
1223
+ // +1 vs 2.5-flash — agentic coding upgrade per Google
1224
+ plan: 6,
1225
+ // +1 vs 2.5-flash — complex iterations per positioning
1226
+ extract: 6,
1227
+ critique: 5
1228
+ // +1 vs 2.5-flash — but still below Sonnet/Opus reasoning floor
1229
+ }
1230
+ },
1231
+ {
1232
+ // ── Gemini 3.1 Flash-Lite ──
1233
+ // Onboarded 2026-05-16 by auto-onboarder; s37 (2026-05-21) verified
1234
+ // against ai.google.dev/gemini-api/docs/pricing.
1235
+ //
1236
+ // L-081 CATCHES (template clone from 2.5-flash-lite was 2.5-3.75× too cheap):
1237
+ // costInputPer1m 0.10 → 0.25 (template clone undervalued by 2.5×)
1238
+ // costOutputPer1m 0.40 → 1.50 (template clone undervalued by 3.75×)
1239
+ //
1240
+ // Real 3.1-flash-lite is NOT a cost-equivalent successor to 2.5-flash-lite —
1241
+ // it sits between 2.5-flash-lite ($0.10/$0.40) and 2.5-flash ($0.30/$2.50).
1242
+ // Cache discount 10× verified ($0.025/M cached vs $0.25/M input).
1243
+ //
1244
+ // Cliffs are HYPOTHESIZED from 2.5-flash family; brain evidence pending.
1245
+ id: "gemini-3.1-flash-lite",
1246
+ verifiedAgainstDocs: "2026-05-21",
1247
+ provider: "google",
1248
+ status: "preview",
1249
+ maxContextTokens: 1048576,
1250
+ maxOutputTokens: 65536,
1251
+ maxTools: 128,
1252
+ parallelToolCalls: true,
1253
+ structuredOutput: "native",
1254
+ systemPromptMode: "separate",
1255
+ streaming: true,
1256
+ cliffs: [
1257
+ {
1258
+ metric: "input_tokens",
1259
+ threshold: 8e3,
1260
+ action: "downgrade_quality_warning",
1261
+ reason: "Inherited from Flash: quality degrades above ~8K. Smaller model \u2014 likely degrades faster. Re-tune from brain after n\u226520."
1262
+ },
1263
+ {
1264
+ metric: "tool_count",
1265
+ threshold: 10,
1266
+ action: "drop_to_top_relevant",
1267
+ reason: "Conservative: Flash drops at 20, Flash-Lite is smaller \u2014 assume tighter ceiling until brain proves otherwise."
1268
+ },
1269
+ {
1270
+ metric: "thinking_with_short_output",
1271
+ threshold: 1,
1272
+ action: "force_thinking_budget_zero",
1273
+ reason: "Thinking enabled per Google API (thinking: true). Same drain risk as Flash \u2014 thinking tokens consume maxOutputTokens."
1274
+ },
1275
+ {
1276
+ // Strong prior: Flash hit 5/5 empty rate on summarize+tools (s11
1277
+ // trust artifact, kgauto commit 3872832). Flash-Lite shares the
1278
+ // same architectural family — almost certainly inherits this cliff.
1279
+ // Ship the guard preemptively; brain telemetry confirms or relaxes.
1280
+ metric: "tool_count",
1281
+ threshold: 1,
1282
+ whenIntent: "summarize",
1283
+ action: "strip_tools",
1284
+ reason: "Inherited from Flash s11 cliff: summarize+tools \u2192 empty response. Preemptive guard until brain evidence on Flash-Lite specifically."
1285
+ }
1286
+ ],
1287
+ costInputPer1m: 0.25,
1288
+ costOutputPer1m: 1.5,
1289
+ lowering: {
1290
+ ...GOOGLE_LOWERING_BASE,
1291
+ // Cache discount 10× (vs Flash 4×) — Google docs s37: $0.025/M cached vs
1292
+ // $0.25/M input. Material for repeat-prompt workloads (classify shape).
1293
+ cache: { ...GOOGLE_LOWERING_BASE.cache, discount: 0.1 },
1294
+ thinking: { field: "generationConfig.thinkingConfig.thinkingBudget", default: "auto" }
1295
+ },
1296
+ recovery: [
1297
+ {
1298
+ signal: "empty_response_after_tool",
1299
+ action: "retry_with_params",
1300
+ retryParams: { "generationConfig.thinkingConfig.thinkingBudget": 0 },
1301
+ maxRetries: 1,
1302
+ reason: "Known on Flash family: empty after tool result \u2014 retry with thinking off."
1303
+ },
1304
+ {
1305
+ signal: "empty_response",
1306
+ action: "retry_with_params",
1307
+ retryParams: { "generationConfig.thinkingConfig.thinkingBudget": 0 },
1308
+ maxRetries: 1,
1309
+ reason: "Empty response \u2014 try with thinking off."
1310
+ },
1311
+ {
1312
+ signal: "malformed_function_call",
1313
+ action: "escalate",
1314
+ reason: "MALFORMED_FUNCTION_CALL maps to stop \u2014 escalate to next target."
1315
+ }
1316
+ ],
1317
+ strengths: ["low_cost", "speed", "volume", "classification", "summarize", "1m_context", "cache_friendly"],
1318
+ weaknesses: ["complex_reasoning", "large_tool_sets", "complex_schemas", "structured_output_unproven", "long_context_quality"],
1319
+ notes: "Verified s37 (2026-05-21) against Google docs. Sits between 2.5-flash-lite (cheaper) and 2.5-flash (more expensive) on cost frontier; 2.5\xD7 more expensive than initial template-clone. Cliffs hypothesized from Flash family \u2014 brain evidence pending.",
1320
+ // Tier 2-3 floor for summarize/classify chains at the new (verified) price
1321
+ // point. ZERO brain rows — values are starter hypotheses anchored to
1322
+ // "smaller sibling of Flash at higher cost than 2.5-flash-lite." The first
1323
+ // 50 brain rows per archetype will validate or relax these.
1324
+ archetypePerf: {
1325
+ classify: 6,
1326
+ // starter hypothesis — verify (Flash is 7, lite likely ≤)
1327
+ summarize: 6,
1328
+ // starter hypothesis — verify; cliff strips tools
1329
+ transform: 6,
1330
+ // starter hypothesis — verify
1331
+ ask: 5,
1332
+ hunt: 5,
1333
+ generate: 4,
1334
+ extract: 4,
1335
+ plan: 3,
1336
+ critique: 3
1337
+ }
1338
+ },
1339
+ // ─────────────────────────────────────────────────────────────────────────
1340
+ // Gemini 3.5 Flash — hand-onboarded s37 (2026-05-21)
1341
+ //
1342
+ // Google positioning ("Most intelligent for sustained frontier performance
1343
+ // on agentic and coding tasks" / "particularly effective for rapid agentic
1344
+ // loops involving complex coding cycles and iterations") suggests this is
1345
+ // the Flash-family upgrade specifically aimed at hunt-shape workloads.
1346
+ // Pricing 5× input / 3.6× output vs 2.5-flash — material cost premium.
1347
+ // archetypePerf adjusted +1 vs 2.5-flash on ask/generate/plan/critique
1348
+ // (sustained-frontier positioning); hunt held at 9 inherited from L-040
1349
+ // family parallel-tool tier; brain evidence will validate within 50 rows.
1350
+ //
1351
+ // Cliffs inherited conservatively from 2.5-flash. Google's "sustained
1352
+ // frontier on long-context" positioning suggests the 8K cliff may not
1353
+ // apply to 3.5 — keep as guard until brain evidence shows otherwise.
1354
+ //
1355
+ // Specs verified against:
1356
+ // ai.google.dev/gemini-api/docs/models/gemini-3.5-flash
1357
+ // ai.google.dev/gemini-api/docs/pricing (Standard tier)
1358
+ // ─────────────────────────────────────────────────────────────────────────
1359
+ {
1360
+ id: "gemini-3.5-flash",
1361
+ verifiedAgainstDocs: "2026-05-21",
1362
+ provider: "google",
1363
+ status: "current",
1364
+ maxContextTokens: 1048576,
1365
+ maxOutputTokens: 65536,
1366
+ maxTools: 128,
1367
+ parallelToolCalls: true,
1368
+ structuredOutput: "native",
1369
+ systemPromptMode: "separate",
1370
+ streaming: true,
1371
+ cliffs: [
1372
+ {
1373
+ metric: "input_tokens",
1374
+ threshold: 8e3,
1375
+ action: "downgrade_quality_warning",
1376
+ reason: "Inherited from 2.5-flash guard; Google positions 3.5 as sustained-frontier-on-long-context but brain evidence pending"
1377
+ },
1378
+ {
1379
+ metric: "tool_count",
1380
+ threshold: 20,
1381
+ action: "drop_to_top_relevant",
1382
+ reason: "Inherited from Flash family: tool reliability drops above ~20 (despite 128 hard limit). Validate per (archetype, model) after n\u226520."
1383
+ },
1384
+ {
1385
+ metric: "thinking_with_short_output",
1386
+ threshold: 1,
1387
+ action: "force_thinking_budget_zero",
1388
+ reason: "Thinking mode supported per Google docs; same drain risk as 2.5-flash \u2014 thinking tokens consume maxOutputTokens"
1389
+ },
1390
+ {
1391
+ // Inherited from 2.5-flash s11 trust artifact (5/5 empty rate on
1392
+ // tt-intelligence/summarize/gemini-2.5-flash with tools offered).
1393
+ // Family-likely failure mode for Flash architecture across versions.
1394
+ // Keep preemptively until brain evidence on 3.5-flash specifically.
1395
+ metric: "tool_count",
1396
+ threshold: 1,
1397
+ whenIntent: "summarize",
1398
+ action: "strip_tools",
1399
+ reason: "Inherited from 2.5-flash s11 cliff (kgauto commit 3872832): summarize+tools \u2192 empty response. Preemptive guard until brain evidence on 3.5-flash specifically."
1400
+ }
1401
+ ],
1402
+ costInputPer1m: 1.5,
1403
+ costOutputPer1m: 9,
1404
+ lowering: {
1405
+ ...GOOGLE_LOWERING_BASE,
1406
+ // 10× cache discount per Google pricing: $0.15/M cached vs $1.50/M input.
1407
+ cache: { ...GOOGLE_LOWERING_BASE.cache, discount: 0.1 },
1408
+ thinking: { field: "generationConfig.thinkingConfig.thinkingBudget", default: "auto" }
1409
+ },
1410
+ recovery: [
1411
+ {
1412
+ signal: "empty_response_after_tool",
1413
+ action: "retry_with_params",
1414
+ retryParams: { "generationConfig.thinkingConfig.thinkingBudget": 0 },
1415
+ maxRetries: 1,
1416
+ reason: "Inherited Flash-family pattern: empty after tool result \u2014 retry with thinking off"
1417
+ },
1418
+ {
1419
+ signal: "empty_response",
1420
+ action: "retry_with_params",
1421
+ retryParams: { "generationConfig.thinkingConfig.thinkingBudget": 0 },
1422
+ maxRetries: 1,
1423
+ reason: "Empty response \u2014 try with thinking off"
1424
+ },
1425
+ {
1426
+ signal: "malformed_function_call",
1427
+ action: "escalate",
1428
+ reason: "MALFORMED_FUNCTION_CALL maps to stop \u2014 escalate to next target"
1429
+ }
1430
+ ],
1431
+ strengths: ["agentic_loops", "coding", "1m_context", "parallel_tools", "thinking_mode", "sustained_frontier"],
1432
+ weaknesses: ["cost_vs_2_5_flash", "no_brain_evidence_yet"],
1433
+ notes: "Hand-onboarded s37 (2026-05-21) verified against Google docs. Stable status; positioned as Flash-family upgrade for agentic loops and coding. 5\xD7/3.6\xD7 more expensive than 2.5-flash but Google claims step-change on sustained frontier work. archetypePerf adjustments are judgment-grounded starter hypotheses \u2014 brain evidence will validate within ~50 rows per archetype.",
1434
+ // Starter hypothesis: anchored to 2.5-flash archetypePerf with +1
1435
+ // adjustments where Google's positioning explicitly supports
1436
+ // (agentic/coding/sustained). Hunt held at 9 inherited from L-040 family
1437
+ // parallel-tool tier. Brain evidence will replace.
1438
+ archetypePerf: {
1439
+ hunt: 9,
1440
+ // Inherited from 2.5-flash L-040 parallel-tool tier; Google positions 3.5 as agentic-loop champion
1441
+ classify: 7,
1442
+ // Inherited from 2.5-flash brain-validated tier (218 rows on 2.5)
1443
+ summarize: 7,
1444
+ // Inherited from 2.5-flash; cliff strips tools when present
1445
+ transform: 7,
1446
+ ask: 8,
1447
+ // +1 vs 2.5-flash — sustained-frontier positioning
1448
+ generate: 8,
1449
+ // +1 vs 2.5-flash (6→8) — Google: "complex coding cycles and iterations"
1450
+ plan: 7,
1451
+ // +1 vs 2.5-flash (5→7) — "complex iterations" positioning
1452
+ extract: 7,
1453
+ // +1 vs 2.5-flash — sustained-frontier on structured tasks
1454
+ critique: 5
1455
+ // +1 vs 2.5-flash — but still below Sonnet/Opus reasoning floor
1456
+ }
1457
+ },
1458
+ // ─────────────────────────────────────────────────────────────────────────
1459
+ // gemini-3.6-flash — hand-onboarded s86 (2026-08-14), step-zero against
1460
+ // Google docs (models/gemini-3.6-flash page + pricing via catalog-sync's
1461
+ // two-agreeing-extraction the same day). Docs list it as Stable and call
1462
+ // it "previous-generation Flash" (3.5-flash is now "legacy" in Google's
1463
+ // wording) — but kgauto status is 'preview' per the standing entry rule:
1464
+ // a new model enters on capability data verified only at the docs level,
1465
+ // preview is unreachable by starter chains, and promotion to routing
1466
+ // happens through brain evidence, not through Google's marketing tier.
1467
+ // This also means NO family-primary retarget rides this release.
1468
+ // ─────────────────────────────────────────────────────────────────────────
1469
+ {
1470
+ id: "gemini-3.6-flash",
1471
+ verifiedAgainstDocs: "2026-08-24",
1472
+ versionAdded: "2.0.0-alpha.87",
1473
+ provider: "google",
1474
+ status: "preview",
1475
+ maxContextTokens: 1048576,
1476
+ maxOutputTokens: 65536,
1477
+ maxTools: 128,
1478
+ parallelToolCalls: true,
1479
+ structuredOutput: "native",
1480
+ systemPromptMode: "separate",
1481
+ streaming: true,
1482
+ cliffs: [
1483
+ {
1484
+ metric: "input_tokens",
1485
+ threshold: 8e3,
1486
+ action: "downgrade_quality_warning",
1487
+ reason: "Inherited Flash-family guard (2.5\u21923.5 lineage); no 3.6 brain evidence yet"
1488
+ },
1489
+ {
1490
+ metric: "tool_count",
1491
+ threshold: 20,
1492
+ action: "drop_to_top_relevant",
1493
+ reason: "Inherited from Flash family: tool reliability drops above ~20 (despite 128 hard limit). Validate per (archetype, model) after n\u226520."
1494
+ },
1495
+ {
1496
+ metric: "thinking_with_short_output",
1497
+ threshold: 1,
1498
+ action: "force_thinking_budget_zero",
1499
+ reason: "Thinking supported per Google docs; same drain risk as 2.5/3.5-flash \u2014 thinking tokens consume maxOutputTokens"
1500
+ },
1501
+ {
1502
+ metric: "tool_count",
1503
+ threshold: 1,
1504
+ whenIntent: "summarize",
1505
+ action: "strip_tools",
1506
+ reason: "Inherited from 2.5-flash s11 cliff: summarize+tools \u2192 empty response. Preemptive family guard until brain evidence on 3.6-flash specifically."
1507
+ }
1508
+ ],
1509
+ costInputPer1m: 0.75,
1510
+ // promo through 2026-12-31; $1.50 from 2027-01-01 (TIME_BOUNDED_PRICING_ROWS carries the transition)
1511
+ costOutputPer1m: 3.75,
1512
+ // promo through 2026-12-31; $7.50 from 2027-01-01
1513
+ lowering: {
1514
+ ...GOOGLE_LOWERING_BASE,
1515
+ cache: { ...GOOGLE_LOWERING_BASE.cache, discount: 0.1 },
1516
+ thinking: { field: "generationConfig.thinkingConfig.thinkingBudget", default: "auto" }
1517
+ },
1518
+ recovery: [
1519
+ {
1520
+ signal: "empty_response_after_tool",
1521
+ action: "retry_with_params",
1522
+ retryParams: { "generationConfig.thinkingConfig.thinkingBudget": 0 },
1523
+ maxRetries: 1,
1524
+ reason: "Inherited Flash-family pattern: empty after tool result \u2014 retry with thinking off"
1525
+ },
1526
+ {
1527
+ signal: "empty_response",
1528
+ action: "retry_with_params",
1529
+ retryParams: { "generationConfig.thinkingConfig.thinkingBudget": 0 },
1530
+ maxRetries: 1,
1531
+ reason: "Empty response \u2014 try with thinking off"
1532
+ },
1533
+ {
1534
+ signal: "malformed_function_call",
1535
+ action: "escalate",
1536
+ reason: "MALFORMED_FUNCTION_CALL maps to stop \u2014 escalate to next target"
1537
+ }
1538
+ ],
1539
+ strengths: ["agentic_loops", "coding", "1m_context", "parallel_tools", "thinking_mode"],
1540
+ weaknesses: ["no_brain_evidence_yet"],
1541
+ notes: "Hand-onboarded s86 (2026-08-14), step-zero verified: 1,048,576 ctx / 65,536 out (Google model page). PRICING re-verified 2026-08-24 at publish: $0.75/$3.75 promo through 2026-12-31, $1.50/$7.50 from 2027-01-01 \u2014 the alpha.87 profile carried the post-promo rate as if current; corrected alpha.88. Docs status Stable; enters kgauto as preview per standing rule (availability != lifecycle, promotion via brain evidence). Function calling + structured outputs + thinking per docs; parallel tools assumed per Flash family (docs silent). First flagged by the release watcher s73 (2026-07-24); ~21 days in the onboarding queue (onboarded 2026-08-14).",
1542
+ archetypePerf: {
1543
+ hunt: 9,
1544
+ // Flash-family parallel-tool tier (L-040); inherited from 3.5-flash
1545
+ classify: 7,
1546
+ summarize: 7,
1547
+ transform: 7,
1548
+ ask: 8,
1549
+ generate: 8,
1550
+ plan: 7,
1551
+ extract: 7,
1552
+ critique: 5
1553
+ }
1554
+ },
1555
+ {
1556
+ // Auto-onboarded 2026-07-01 from `claude-sonnet-4-6`; VERIFIED 2026-07-02
1557
+ // against the claude-api reference (cc-portfolio ratification pass). The
1558
+ // clone got context right (1M). PRICING RE-BASED 2026-08-14 (s86): the
1559
+ // introductory $2/$10 was made PERMANENT — Anthropic's pricing page now
1560
+ // states the scheduled Sept-1 increase to $3/$15 "will not occur", so
1561
+ // $2/$10 IS the sticker. (The $3/$15 encoded 07-02 was correct under the
1562
+ // time-bounded-pricing convention at the time; the bound was cancelled.) The clone got max output WRONG:
1563
+ // Sonnet 5 is 128k, not 4-6's 64k — corrected. New tokenizer (~30% more
1564
+ // tokens for the same text vs 4-6): byte-budget consumers should re-baseline.
1565
+ // API quirks (claude-api ref): (a) NON-DEFAULT temperature/top_p/top_k
1566
+ // return 400 — moot for kgauto's own call() path (ANTHROPIC_LOWERING_BASE
1567
+ // emits no sampling params) but a REAL hazard for compileForAISDKv6
1568
+ // consumers that pass temperature themselves (tt-intel scoring uses temp:0
1569
+ // for determinism — that 400s on this model; noted to consumers via the
1570
+ // contract). (b) Omitting `thinking` runs ADAPTIVE by default (4-6 ran
1571
+ // thinking-off) — output spend shifts. (c) Supports effort xhigh. status:
1572
+ // 'preview' per the Fable precedent — no brain evidence yet; promotion to
1573
+ // 'current' is an explicit call. (L-049/L-081.)
1574
+ id: "claude-sonnet-5",
1575
+ verifiedAgainstDocs: "2026-08-14",
1576
+ provider: "anthropic",
1577
+ status: "current",
1578
+ // s76 2026-07-25: GA per docs; was preview.
1579
+ maxContextTokens: 1e6,
1580
+ maxOutputTokens: 128e3,
1581
+ maxTools: 64,
1582
+ parallelToolCalls: true,
1583
+ structuredOutput: "grammar",
1584
+ systemPromptMode: "inline",
1585
+ streaming: true,
1586
+ cliffs: [],
1587
+ costInputPer1m: 2,
1588
+ // 2026-08-24: intro price made PERMANENT (docs: "the previously scheduled increase to $3/$15 on September 1, 2026 will not occur")
1589
+ costOutputPer1m: 10,
1590
+ lowering: ANTHROPIC_LOWERING_BASE,
1591
+ recovery: [
1592
+ { signal: "rate_limit", action: "escalate", reason: "429 \u2014 escalate" },
1593
+ { signal: "model_not_found", action: "escalate", reason: "Deprecated \u2014 escalate (L-061)" }
1594
+ ],
1595
+ strengths: ["quality", "tool_use", "long_context", "cache_friendly", "extended_thinking"],
1596
+ weaknesses: [],
1597
+ notes: "Sonnet 5 (2026-06): near-Opus quality on coding/agentic work at Sonnet cost. Verified 2026-07-02 against the claude-api reference: 1M ctx, 128k out (clone's 64k corrected), $3/$15 sticker (intro $2/$10 through 2026-08-31). New tokenizer ~30% more tokens vs sonnet-4-6. Consumer hazards: non-default temperature/top_p/top_k 400 (temp:0 rejected \u2014 deterministic-scoring consumers must omit); thinking defaults to adaptive when omitted. status:preview \u2014 no brain evidence yet; earns placement via the machinery.",
1598
+ // Master plan §6.2 anchor. Tier 0 for plan/generate/ask/extract/transform
1599
+ // in starter chains; tier 1 cross-provider for hunt/summarize/classify.
1600
+ archetypePerf: {
1601
+ ask: 9,
1602
+ generate: 9,
1603
+ plan: 9,
1604
+ critique: 9,
1605
+ extract: 9,
1606
+ transform: 9,
1607
+ hunt: 7,
1608
+ // strong but Flash beats on parallel tool throughput
1609
+ summarize: 8,
1610
+ // overkill for tolerant archetype
1611
+ classify: 8
1612
+ // overkill
1613
+ }
1614
+ },
1615
+ // ── Z.ai (GLM) ──
1616
+ // alpha.65 (2026-07-18): first Z.ai profile, provider `zai` added same
1617
+ // release. Step-zero sources (L-049/L-081, all fetched 2026-07-18):
1618
+ // docs.z.ai/guides/llm/glm-5.2 (capabilities), docs.z.ai api-reference
1619
+ // chat-completion (wire params: thinking.type enabled|disabled default
1620
+ // enabled, reasoning_effort max..none, tool_stream, max output 131072),
1621
+ // docs.z.ai/guides/overview/pricing ($1.4 in / $4.4 out, cached input
1622
+ // $0.26, cache storage limited-time free), vLLM recipe (native ctx
1623
+ // 1,048,576). NO AI-trained numbers.
1624
+ {
1625
+ id: "glm-5.2",
1626
+ verifiedAgainstDocs: "2026-07-18",
1627
+ provider: "zai",
1628
+ status: "preview",
1629
+ maxContextTokens: 1048576,
1630
+ maxOutputTokens: 131072,
1631
+ // No documented tool-count cap — conservative default pending measured
1632
+ // evidence; matches the deepseek posture, not a doc number.
1633
+ maxTools: 16,
1634
+ // Hosted-API docs document tools + tool_choice + tool_stream but say
1635
+ // NOTHING about multiple tool_calls per response. Conservative false so
1636
+ // hunt-shaped ranking doesn't over-promise; flip on doc or probe
1637
+ // evidence (L-081: undocumented ≠ true).
1638
+ parallelToolCalls: false,
1639
+ structuredOutput: "native",
1640
+ systemPromptMode: "inline",
1641
+ streaming: true,
1642
+ cliffs: [],
1643
+ costInputPer1m: 1.4,
1644
+ costOutputPer1m: 4.4,
1645
+ lowering: {
1646
+ system: { mode: "inline" },
1647
+ // Automatic prefix caching ("intelligent caching mechanism") — no wire
1648
+ // marker to emit, DeepSeek-style. Cache-hit input $0.26/M (~0.19× of
1649
+ // miss) tracked in notes; storage limited-time free as of 2026-07-18.
1650
+ cache: { strategy: "unsupported" },
1651
+ tools: { format: "openai" },
1652
+ // thinking.type: 'enabled' (server default) | 'disabled'. lowerZai
1653
+ // emits an explicit disable only on forceThinkingZero cliffs.
1654
+ thinking: { field: "thinking.type", default: "auto" }
1655
+ },
1656
+ recovery: [
1657
+ { signal: "rate_limit", action: "escalate", reason: "429 \u2014 escalate" },
1658
+ { signal: "model_not_found", action: "escalate", reason: "Deprecated \u2014 escalate (L-061)" }
1659
+ ],
1660
+ strengths: ["cost", "1m_context", "code", "tool_use", "json_output", "reasoning"],
1661
+ weaknesses: ["parallel_tools"],
1662
+ notes: "GLM-5.2 (Z.ai, 2026-06): agentic-coding flagship. 1,048,576 ctx / 131,072 max out. $1.40/$4.40 per 1M; cached input $0.26/M (automatic caching, no marker; storage limited-time free as of 2026-07-18). Thinking on by default (`thinking.type`), `reasoning_effort` max..none. Parallel tool calls UNDOCUMENTED on the hosted API \u2014 profile says false until doc or probe evidence. status:preview \u2014 no brain evidence yet; earns placement via the machinery.",
1663
+ // Starter hypotheses — verify with telemetry/probes; NO brain evidence
1664
+ // yet. Anchored on the vendor's agentic-coding positioning at a
1665
+ // mid-cost tier, discounted for the unproven parallel-tool story.
1666
+ archetypePerf: {
1667
+ generate: 7,
1668
+ // agentic-coding positioning — starter hypothesis
1669
+ transform: 7,
1670
+ // starter hypothesis
1671
+ plan: 7,
1672
+ // starter hypothesis
1673
+ summarize: 7,
1674
+ // tolerant archetype — starter hypothesis
1675
+ ask: 6,
1676
+ extract: 6,
1677
+ critique: 6,
1678
+ classify: 6,
1679
+ hunt: 5
1680
+ // tools work; parallel unproven → discounted
1681
+ }
1682
+ },
1683
+ // ── Moonshot (Kimi) ──
1684
+ // alpha.65 (2026-07-18): first Moonshot profile, provider `moonshot` added
1685
+ // same release. Step-zero sources (all fetched 2026-07-18):
1686
+ // platform.kimi.ai/docs/pricing/chat-k3 ($3.00 cache-miss in / $0.30
1687
+ // cache-hit in / $15.00 out; 1,048,576 ctx; ToolCalls + JSON Mode +
1688
+ // Partial Mode), kimi-k3-quickstart (max_completion_tokens default
1689
+ // 131072, up to 1,048,576; base https://api.moonshot.ai/v1; vision via
1690
+ // base64 or ms://file-id, NO public image URLs), models-overview
1691
+ // (temperature FIXED 1.0, top_p FIXED 0.95, n FIXED 1, always reasons,
1692
+ // reasoning_effort 'max' only), tool-calls guide ("can choose to call
1693
+ // multiple tools at once … will tend to call them in parallel").
1694
+ {
1695
+ id: "kimi-k3",
1696
+ verifiedAgainstDocs: "2026-07-18",
1697
+ provider: "moonshot",
1698
+ status: "preview",
1699
+ maxContextTokens: 1048576,
1700
+ // Documented ceiling; default is 131,072 when unset.
1701
+ maxOutputTokens: 1048576,
1702
+ // No hard doc cap; docs recommend dynamic tool loading at "dozens or
1703
+ // hundreds" — 64 matches the frontier-agentic posture (sonnet-5 tier).
1704
+ maxTools: 64,
1705
+ parallelToolCalls: true,
1706
+ structuredOutput: "native",
1707
+ systemPromptMode: "inline",
1708
+ streaming: true,
1709
+ cliffs: [],
1710
+ costInputPer1m: 3,
1711
+ costOutputPer1m: 15,
1712
+ lowering: {
1713
+ system: { mode: "inline" },
1714
+ // Automatic context caching — no wire marker. Cache-hit input $0.30/M
1715
+ // (0.1× of miss) tracked in notes.
1716
+ cache: { strategy: "unsupported" },
1717
+ tools: { format: "openai" }
1718
+ // No thinking knob: reasoning is always-on and reasoning_effort
1719
+ // accepts only 'max' (= the server default). Nothing to lower.
1720
+ },
1721
+ recovery: [
1722
+ { signal: "rate_limit", action: "escalate", reason: "429 \u2014 escalate" },
1723
+ { signal: "model_not_found", action: "escalate", reason: "Deprecated \u2014 escalate (L-061)" }
1724
+ ],
1725
+ strengths: ["quality", "reasoning", "1m_context", "parallel_tools", "tool_use", "code", "vision"],
1726
+ // 'latency' → latencyTierOf derives 'slow': always-on max-effort
1727
+ // reasoner with no off switch; no measured p50 yet, the tag is the
1728
+ // honest prior (reasoner family precedent: deepseek-v4-pro ~48s).
1729
+ weaknesses: ["cost", "latency"],
1730
+ notes: "Kimi K3 (Moonshot, API live 2026-07-16): 2.8T-param open-weight flagship, native vision. 1,048,576 ctx; max_completion_tokens default 131,072, ceiling 1,048,576. $3.00/$15.00 per 1M, cache-hit input $0.30/M (automatic caching). Reasoning ALWAYS ON (reasoning_effort max only, cannot disable; responses may carry reasoning_content). Wire quirks: temperature fixed 1.0 / top_p 0.95 / n 1 (kgauto never emits those); vision input must be base64 or ms://file-id \u2014 public image URLs rejected. status:preview \u2014 earns placement via the machinery.",
1731
+ // Starter hypotheses — verify with telemetry/probes; NO brain evidence
1732
+ // yet. Anchored on documented long-horizon-agentic + parallel-tool
1733
+ // strengths; discounted on terse archetypes where always-on reasoning
1734
+ // bills $15/M output for thinking the archetype doesn't need.
1735
+ archetypePerf: {
1736
+ hunt: 8,
1737
+ // parallel tools + long-horizon agentic — starter hypothesis
1738
+ plan: 8,
1739
+ // starter hypothesis
1740
+ generate: 8,
1741
+ // starter hypothesis
1742
+ critique: 7,
1743
+ ask: 7,
1744
+ extract: 7,
1745
+ transform: 7,
1746
+ summarize: 6,
1747
+ // works, but $15/M output reasoning tax on a tolerant archetype
1748
+ classify: 5
1749
+ // always-on reasoning cost + reasoner hedge risk
1750
+ },
1751
+ // Diagnostics-only (no prompt rewrite): reasoner-family hedge risk on
1752
+ // decisive archetypes, carried as a warning until K3-specific probe
1753
+ // evidence exists. The deepseek-reasoner family showed 8/10 judge
1754
+ // rationales citing hedging on classify (exclusion-finding ID 20,
1755
+ // 2026-05-28); K3 is an always-on reasoner and inherits the risk class,
1756
+ // not the conviction.
1757
+ archetypeConventions: [
1758
+ {
1759
+ archetype: "classify",
1760
+ cliffWarning: "kimi-k3 is an always-on reasoner: decisive archetypes (classify) may hedge, and reasoning tokens bill at $15/M output. Family-prior risk (deepseek-reasoner precedent), not K3-measured \u2014 probe before relying on it for classify.",
1761
+ reason: "Reasoner-family prior (exclusion-finding ID 20, 2026-05-28, deepseek-v4-pro on tt-intel/classify). No K3-specific evidence yet \u2014 warning only, no prompt rewrite."
1762
+ }
1763
+ ]
1764
+ }
1765
+ ];
1766
+ var ALIASES = {
1767
+ // DeepSeek's own model routing — both names served by V4-Flash.
1768
+ "deepseek-chat": "deepseek-v4-flash",
1769
+ "deepseek-reasoner": "deepseek-v4-flash",
1770
+ // Legacy kgauto typo — actual API alias is dash-form (alpha.1 had dot).
1771
+ "claude-haiku-4.5": "claude-haiku-4-5"
1772
+ };
1773
+ var brainHook = {};
1774
+ function _setProfileBrainHook(hook) {
1775
+ brainHook = hook;
1776
+ }
1777
+ function canonicalId(id) {
1778
+ return brainHook.resolveAlias?.(id) ?? ALIASES[id] ?? id;
1779
+ }
1780
+ var CONSUMER_INDEX = /* @__PURE__ */ new Map();
1781
+ function registerProfiles(profiles) {
1782
+ for (const p of profiles) CONSUMER_INDEX.set(p.id, p);
1783
+ }
1784
+ function _testClearConsumerProfiles() {
1785
+ CONSUMER_INDEX.clear();
1786
+ }
1787
+ function inferProviderFromId(id) {
1788
+ const lower = id.toLowerCase();
1789
+ if (lower.startsWith("claude")) return "anthropic";
1790
+ if (lower.startsWith("gemini") || lower.startsWith("palm")) return "google";
1791
+ if (lower.startsWith("gpt") || /^o[0-9]/.test(lower) || lower.startsWith("chatgpt")) return "openai";
1792
+ if (lower.startsWith("deepseek")) return "deepseek";
1793
+ if (lower.startsWith("glm")) return "zai";
1794
+ if (lower.startsWith("kimi") || lower.startsWith("moonshot")) return "moonshot";
1795
+ return void 0;
1796
+ }
1797
+ function bestEffortProfile(id) {
1798
+ const canonical = canonicalId(id);
1799
+ const existing = tryGetProfile(canonical);
1800
+ if (existing) return existing;
1801
+ const provider = inferProviderFromId(canonical);
1802
+ if (!provider) return void 0;
1803
+ const donor = PROFILES_RAW.find((p) => p.provider === provider && p.status === "current") ?? PROFILES_RAW.find((p) => p.provider === provider);
1804
+ if (!donor) return void 0;
1805
+ const synth = {
1806
+ id: canonical,
1807
+ provider,
1808
+ bestEffort: true,
1809
+ status: "preview",
1810
+ maxContextTokens: 128e3,
1811
+ maxOutputTokens: 4096,
1812
+ maxTools: donor.maxTools,
1813
+ parallelToolCalls: false,
1814
+ structuredOutput: "none",
1815
+ systemPromptMode: donor.systemPromptMode,
1816
+ streaming: donor.streaming,
1817
+ cliffs: [],
1818
+ costInputPer1m: 0,
1819
+ costOutputPer1m: 0,
1820
+ lowering: donor.lowering,
1821
+ recovery: [],
1822
+ strengths: [],
1823
+ weaknesses: ["best-effort synthesized profile \u2014 no verified capability data"],
1824
+ notes: `Synthesized by onUnprofiledModel:'best-effort' (provider ${provider} inferred from id; wire mechanics borrowed from ${donor.id}). No cliffs, no measured knowledge, cost UNKNOWN (recorded as 0). Replace via registerProfiles() for real guards.`
1825
+ };
1826
+ CONSUMER_INDEX.set(canonical, synth);
1827
+ return synth;
1828
+ }
1829
+ function resolveModelAlias(id) {
1830
+ return canonicalId(id);
1831
+ }
1832
+ var PROFILE_INDEX = new Map(
1833
+ PROFILES_RAW.map((p) => [p.id, p])
1834
+ );
1835
+ function getProfile(id) {
1836
+ const canonical = canonicalId(id);
1837
+ const fromConsumer = CONSUMER_INDEX.get(canonical);
1838
+ if (fromConsumer) return fromConsumer;
1839
+ const fromBrain = brainHook.getProfile?.(canonical);
1840
+ if (fromBrain) return fromBrain;
1841
+ const p = PROFILE_INDEX.get(canonical);
1842
+ if (!p) {
1843
+ const known = [...PROFILE_INDEX.keys(), ...Object.keys(ALIASES)].join(", ");
1844
+ throw new Error(
1845
+ `Unknown model id: "${id}". Known: ${known}. For a model kgauto has not onboarded: registerProfiles([...]) supplies a full profile, or policy.onUnprofiledModel:'best-effort' compiles with guards skipped (alpha.87).`
1846
+ );
1847
+ }
1848
+ return p;
1849
+ }
1850
+ function tryGetProfile(id) {
1851
+ const canonical = canonicalId(id);
1852
+ return CONSUMER_INDEX.get(canonical) ?? brainHook.getProfile?.(canonical) ?? PROFILE_INDEX.get(canonical);
1853
+ }
1854
+ function allProfiles() {
1855
+ return PROFILES_RAW;
1856
+ }
1857
+ function allProfilesRaw() {
1858
+ return PROFILES_RAW;
1859
+ }
1860
+ function profilesByProvider(provider) {
1861
+ return PROFILES_RAW.filter((p) => p.provider === provider);
1862
+ }
1863
+
1864
+ export {
1865
+ LATENCY_TIER_MS,
1866
+ latencyTierOf,
1867
+ ALIASES,
1868
+ _setProfileBrainHook,
1869
+ registerProfiles,
1870
+ _testClearConsumerProfiles,
1871
+ inferProviderFromId,
1872
+ bestEffortProfile,
1873
+ resolveModelAlias,
1874
+ getProfile,
1875
+ tryGetProfile,
1876
+ allProfiles,
1877
+ allProfilesRaw,
1878
+ profilesByProvider
1879
+ };