@warmdrift/kgauto-compiler 2.0.0-alpha.97 → 2.0.0-alpha.99

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 (37) hide show
  1. package/dist/{chunk-77AHSX6Y.mjs → chunk-2YCTWV4S.mjs} +1 -1
  2. package/dist/{chunk-AFYBZRQV.mjs → chunk-G33BUB43.mjs} +96 -20
  3. package/dist/{chunk-IEEROFZW.mjs → chunk-L3VBUB4I.mjs} +1 -1
  4. package/dist/{chunk-HHIXHL4O.mjs → chunk-PY4CBZFF.mjs} +12 -2
  5. package/dist/{compile-C2IfAGV1.d.mts → compile-hh_l7COL.d.mts} +1 -1
  6. package/dist/{compile-BlMXv6QT.d.ts → compile-nNpq-6yu.d.ts} +1 -1
  7. package/dist/glassbox/index.d.mts +3 -3
  8. package/dist/glassbox/index.d.ts +3 -3
  9. package/dist/glassbox-routes/format.d.mts +2 -2
  10. package/dist/glassbox-routes/format.d.ts +2 -2
  11. package/dist/glassbox-routes/index.d.mts +4 -4
  12. package/dist/glassbox-routes/index.d.ts +4 -4
  13. package/dist/glassbox-routes/index.js +12 -2
  14. package/dist/glassbox-routes/index.mjs +2 -2
  15. package/dist/glassbox-routes/react/index.d.mts +2 -2
  16. package/dist/glassbox-routes/react/index.d.ts +2 -2
  17. package/dist/index.d.mts +74 -9
  18. package/dist/index.d.ts +74 -9
  19. package/dist/index.js +109 -23
  20. package/dist/index.mjs +6 -6
  21. package/dist/{ir-DyMJ84je.d.mts → ir-BZ2qOPMp.d.mts} +13 -0
  22. package/dist/{ir-DbvOFKF-.d.ts → ir-CpkidtAd.d.ts} +13 -0
  23. package/dist/key-health.js +1 -1
  24. package/dist/key-health.mjs +1 -1
  25. package/dist/probe.d.mts +2 -2
  26. package/dist/probe.d.ts +2 -2
  27. package/dist/probe.js +106 -20
  28. package/dist/probe.mjs +3 -3
  29. package/dist/profiles.d.mts +1 -1
  30. package/dist/profiles.d.ts +1 -1
  31. package/dist/profiles.js +12 -2
  32. package/dist/profiles.mjs +1 -1
  33. package/dist/{types-D441T-KC.d.mts → types-BkdfoONZ.d.mts} +1 -1
  34. package/dist/{types-5TqjBeZD.d.ts → types-Bn-zF0S4.d.ts} +1 -1
  35. package/dist/{types-_myk4bxn.d.mts → types-DJFlO7ux.d.mts} +1 -1
  36. package/dist/{types-BlrbNQfj.d.ts → types-uWypgaAU.d.ts} +1 -1
  37. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { C as CompileOptions } from './compile-BlMXv6QT.js';
2
- import { N as NormalizedResponse, A as ApiKeys, P as ProviderOverrides, C as CompiledRequest, a as CompilePolicy, b as PromptIR, c as CallOptions, d as CallResult, S as SystemModelMessage, e as CompileResult, B as BestPracticeAdvisory, F as FallbackReason, f as SectionRewrite, R as RecordInput, g as RecordOutcomeInput, O as OutcomeResult, h as OutcomeSource, i as OracleScore, j as Adapter, k as PerAxisMetrics, l as Provider, m as ChainEntry, G as Grounding } from './ir-DbvOFKF-.js';
3
- export { n as CallAttempt, o as CallError, p as ChainModelEntry, q as ChainWithGrounding, r as Constraints, E as EffortLevel, s as GoldenCaptureOptions, H as HistoryCachePolicy, I as IntentDeclaration, M as Message, t as MutationApplied, u as NormalizedTokens, v as OutcomeKind, w as PerAxisMetricsByModel, x as PromptSection, y as SectionKind, z as ShadowProbeConfig, T as ToolCall, D as ToolDefinition, J as captureGoldenIr, K as hasMutation, L as mutationId, Q as parseGoldenCaptureRate, U as resolveGoldenCaptureRate, V as shouldCaptureGolden } from './ir-DbvOFKF-.js';
1
+ import { C as CompileOptions } from './compile-nNpq-6yu.js';
2
+ import { N as NormalizedResponse, A as ApiKeys, P as ProviderOverrides, C as CompiledRequest, a as CompilePolicy, b as PromptIR, c as CallOptions, d as CallResult, S as SystemModelMessage, e as CompileResult, B as BestPracticeAdvisory, F as FallbackReason, f as SectionRewrite, R as RecordInput, g as RecordOutcomeInput, O as OutcomeResult, h as OutcomeSource, i as OracleScore, j as Adapter, k as PerAxisMetrics, l as Provider, m as ChainEntry, G as Grounding } from './ir-CpkidtAd.js';
3
+ export { n as CallAttempt, o as CallError, p as ChainModelEntry, q as ChainWithGrounding, r as Constraints, E as EffortLevel, s as GoldenCaptureOptions, H as HistoryCachePolicy, I as IntentDeclaration, M as Message, t as MutationApplied, u as NormalizedTokens, v as OutcomeKind, w as PerAxisMetricsByModel, x as PromptSection, y as SectionKind, z as ShadowProbeConfig, T as ToolCall, D as ToolDefinition, J as captureGoldenIr, K as hasMutation, L as mutationId, Q as parseGoldenCaptureRate, U as resolveGoldenCaptureRate, V as shouldCaptureGolden } from './ir-CpkidtAd.js';
4
4
  export { BrainForwardConfig, BrainForwardRoutes, createBrainForwardRoutes } from './brain-proxy.js';
5
5
  export { KEY_FINGERPRINT_DOMAIN, KEY_FINGERPRINT_LENGTH, KeyHealthConfig, KeyHealthProvider, KeyHealthResponseBody, KeyHealthResult, KeyHealthRoute, createKeyHealthRoute, keyFingerprint } from './key-health.js';
6
6
  import { ModelProfile, ArchetypeConvention, ProbedLimit } from './profiles.js';
@@ -1241,7 +1241,7 @@ declare function runStrategyEvalWithAttribution(opts: Omit<GoldenEvalOptions, 'a
1241
1241
  * guard in `tests/version.test.ts` fails the suite (and therefore
1242
1242
  * `prepublishOnly`) when they diverge — a stale constant cannot reach npm.
1243
1243
  */
1244
- declare const LIBRARY_VERSION = "2.0.0-alpha.97";
1244
+ declare const LIBRARY_VERSION = "2.0.0-alpha.99";
1245
1245
 
1246
1246
  /**
1247
1247
  * Oracle contract — how an app tells the brain whether a response was good.
@@ -3735,10 +3735,26 @@ declare function _testWaitForPromotionsRefresh(): Promise<void>;
3735
3735
  interface SurfaceFailureRow {
3736
3736
  archetype: string;
3737
3737
  model: string;
3738
- /** Total attempts in-window (served + quality walkaways). */
3738
+ /**
3739
+ * QUALITY-axis denominator: attempts that produced something judgeable
3740
+ * (served + quality walkaways). Excludes calls that never reached an
3741
+ * answer — a 429 is not a trial of the model's quality. See migration 071.
3742
+ */
3739
3743
  n: number;
3740
3744
  /** Attempts that failed on the quality axis. */
3741
3745
  nFail: number;
3746
+ /**
3747
+ * alpha.98 — AVAILABILITY-axis denominator: every served attempt is a
3748
+ * trial of whether the model can be reached at all.
3749
+ */
3750
+ nAttempted: number;
3751
+ /** Attempts that never reached an answer — 429, auth, timeout, transport. */
3752
+ nUnavailable: number;
3753
+ /**
3754
+ * Failures in NEITHER vocabulary. Carried so the taxonomy's blind spot is
3755
+ * a number rather than silence; not gated on.
3756
+ */
3757
+ nUnclassified: number;
3742
3758
  }
3743
3759
  declare const MEASURED_FAILURE_CFG: {
3744
3760
  /**
@@ -3760,6 +3776,23 @@ declare const MEASURED_FAILURE_CFG: {
3760
3776
  readonly z: 1.96;
3761
3777
  /** Must match the view's window. Documented here for the advisory text. */
3762
3778
  readonly windowDays: 28;
3779
+ /**
3780
+ * alpha.98 — the AVAILABILITY axis. Same statistic, separate vocabulary,
3781
+ * separate verdict, because a 429 and a parse-failure send an operator in
3782
+ * opposite directions (fund or throttle the account vs. distrust the
3783
+ * model's declared structuredOutput). Merging them into one "failure rate"
3784
+ * is the s75 normalization defect.
3785
+ *
3786
+ * Thresholds match the quality axis deliberately: "we are 95% confident
3787
+ * this model is unreachable more often than not" is the same unarguable
3788
+ * bar, and a de-rank is the same remedy. Kept as a distinct config block
3789
+ * so the two can be tuned apart when evidence says they should be.
3790
+ */
3791
+ readonly availability: {
3792
+ readonly minSample: 5;
3793
+ readonly lowerBoundThreshold: 0.5;
3794
+ readonly z: 1.96;
3795
+ };
3763
3796
  };
3764
3797
  /**
3765
3798
  * Wilson score interval, lower bound. Preferred over the normal
@@ -3771,16 +3804,45 @@ declare const MEASURED_FAILURE_CFG: {
3771
3804
  * Returns 0 for n <= 0.
3772
3805
  */
3773
3806
  declare function wilsonLowerBound(failures: number, n: number, z?: number): number;
3807
+ /** One axis's numbers. Same statistic, different vocabulary. */
3808
+ interface FailureAxisVerdict {
3809
+ /** Observed failure rate in-window on this axis. */
3810
+ rate: number;
3811
+ /** 95% lower confidence bound on that rate — what the gate tests. */
3812
+ lowerBound: number;
3813
+ /** Attempts backing this axis. */
3814
+ n: number;
3815
+ /** Failures on this axis. */
3816
+ nFail: number;
3817
+ /** Whether this axis on its own clears the bar. */
3818
+ gated: boolean;
3819
+ }
3774
3820
  interface MeasuredFailureVerdict {
3775
- /** Whether the measured-failure quality gate fires for this tuple. */
3821
+ /** Whether a measured-failure gate fires for this tuple, on EITHER axis. */
3776
3822
  gated: boolean;
3777
- /** Observed failure rate in-window. */
3823
+ /**
3824
+ * alpha.98 — which axis fired. Undefined when `gated` is false. Read this
3825
+ * before rendering `rate`/`n`: the same number means "answered badly" on
3826
+ * one axis and "could not be reached" on the other, and the fixes differ.
3827
+ * When both axes fire, `'quality'` wins the label — the model is reachable
3828
+ * enough to have been judged, so its answers are the actionable half.
3829
+ */
3830
+ axis?: 'quality' | 'availability';
3831
+ /**
3832
+ * The numbers that JUSTIFY the gate — i.e. drawn from `axis` when gated,
3833
+ * and from the quality axis otherwise. Deliberately not always-quality:
3834
+ * a consumer printing "gated: 0% over 16" for a model that 429'd 42 times
3835
+ * would be reporting a true number as an explanation of the wrong thing.
3836
+ */
3778
3837
  rate: number;
3779
- /** 95% lower confidence bound on that rate — what the gate tests. */
3780
3838
  lowerBound: number;
3781
- /** Attempts backing the verdict. */
3782
3839
  n: number;
3783
3840
  nFail: number;
3841
+ /** Both axes, always present, so a caller never has to infer one. */
3842
+ quality: FailureAxisVerdict;
3843
+ availability: FailureAxisVerdict;
3844
+ /** Failures in neither vocabulary. Not gated on; surfaced for visibility. */
3845
+ nUnclassified: number;
3784
3846
  }
3785
3847
  /**
3786
3848
  * alpha.78 — public row normalizer (PB 2026-07-25 trap): the counts
@@ -3805,6 +3867,9 @@ declare function judgeMeasuredFailure(row: SurfaceFailureRow | {
3805
3867
  model: string;
3806
3868
  n: number | string;
3807
3869
  n_fail: number | string;
3870
+ n_attempted?: number | string;
3871
+ n_unavailable?: number | string;
3872
+ n_unclassified?: number | string;
3808
3873
  } | undefined, cfg?: typeof MEASURED_FAILURE_CFG): MeasuredFailureVerdict | undefined;
3809
3874
  interface MeasuredFailureRuntime {
3810
3875
  /** Endpoint base URL. The library appends `?app_id=<id>`. */
package/dist/index.js CHANGED
@@ -1170,7 +1170,12 @@ var PROFILES_RAW = [
1170
1170
  // "7-8 calls per step" — which was never a claim that only one tool may be
1171
1171
  // offered. See the note in lower.ts:lowerDeepSeek.
1172
1172
  parallelToolCalls: true,
1173
- structuredOutput: "native",
1173
+ structuredOutput: "grammar",
1174
+ // alpha.99 — MEASURED 2026-08-29: DeepSeek rejects
1175
+ // `response_format: {type:'json_schema'}` outright ("This response_format type is
1176
+ // unavailable now"), so there is no schema-enforced mode for `'native'` to name.
1177
+ // It supports `json_object` only, and only when the prompt contains the literal
1178
+ // word "json" — the lowering emits the instruction that guarantees it.
1174
1179
  systemPromptMode: "inline",
1175
1180
  streaming: true,
1176
1181
  // alpha.96 — the `tool_count@1 -> drop_to_top_relevant` cliff was DELETED.
@@ -1264,7 +1269,12 @@ var PROFILES_RAW = [
1264
1269
  // "7-8 calls per step" — which was never a claim that only one tool may be
1265
1270
  // offered. See the note in lower.ts:lowerDeepSeek.
1266
1271
  parallelToolCalls: true,
1267
- structuredOutput: "native",
1272
+ structuredOutput: "grammar",
1273
+ // alpha.99 — MEASURED 2026-08-29: DeepSeek rejects
1274
+ // `response_format: {type:'json_schema'}` outright ("This response_format type is
1275
+ // unavailable now"), so there is no schema-enforced mode for `'native'` to name.
1276
+ // It supports `json_object` only, and only when the prompt contains the literal
1277
+ // word "json" — the lowering emits the instruction that guarantees it.
1268
1278
  systemPromptMode: "inline",
1269
1279
  streaming: true,
1270
1280
  // alpha.96 — the `tool_count@1 -> drop_to_top_relevant` cliff was DELETED.
@@ -4028,7 +4038,7 @@ function lowerGoogle(ir, profile, hints) {
4028
4038
  if (hints.forceTerseOutput) {
4029
4039
  generationConfig.maxOutputTokens = 200;
4030
4040
  }
4031
- if (ir.constraints?.structuredOutput && profile.structuredOutput === "native") {
4041
+ if (ir.constraints?.structuredOutput && profile.structuredOutput !== "none") {
4032
4042
  generationConfig.responseMimeType = "application/json";
4033
4043
  }
4034
4044
  const contents = buildGoogleContents(ir.history ?? [], ir.currentTurn);
@@ -4087,7 +4097,9 @@ function toGoogleTools(tools) {
4087
4097
  }
4088
4098
  function lowerOpenAI(ir, profile, hints) {
4089
4099
  const ordered = sortSections(ir.sections);
4090
- const systemText = ordered.map((s) => s.text).join("\n\n");
4100
+ const sectionText = ordered.map((s) => s.text).join("\n\n");
4101
+ const jsonInstruction = ir.constraints?.structuredOutput ? "Respond with a single valid JSON value and nothing else. Do not wrap the JSON in a markdown code fence, and do not add any prose before or after it." : "";
4102
+ const systemText = [sectionText, jsonInstruction].filter(Boolean).join("\n\n");
4091
4103
  const systemRole = profile.systemPromptMode === "as_developer" ? "developer" : "system";
4092
4104
  const messages = systemText ? [{ role: systemRole, content: systemText }] : [];
4093
4105
  for (const m of ir.history ?? []) {
@@ -4133,7 +4145,9 @@ function toOpenAITools(tools) {
4133
4145
  }
4134
4146
  function lowerDeepSeek(ir, profile, hints) {
4135
4147
  const ordered = sortSections(ir.sections);
4136
- const systemText = ordered.map((s) => s.text).join("\n\n");
4148
+ const sectionText = ordered.map((s) => s.text).join("\n\n");
4149
+ const jsonInstruction = ir.constraints?.structuredOutput ? "Respond with a single valid JSON value and nothing else. Do not wrap the JSON in a markdown code fence, and do not add any prose before or after it." : "";
4150
+ const systemText = [sectionText, jsonInstruction].filter(Boolean).join("\n\n");
4137
4151
  const messages = systemText ? [{ role: "system", content: systemText }] : [];
4138
4152
  for (const m of ir.history ?? []) {
4139
4153
  if (m.role === "system") continue;
@@ -4153,6 +4167,9 @@ function lowerDeepSeek(ir, profile, hints) {
4153
4167
  provider: "deepseek",
4154
4168
  model: profile.id,
4155
4169
  messages,
4170
+ // Safe only because `jsonInstruction` above guarantees the literal word
4171
+ // "json" reaches the prompt — DeepSeek 400s otherwise (measurement C).
4172
+ response_format: ir.constraints?.structuredOutput ? { type: "json_object" } : void 0,
4156
4173
  // Every tool the IR carries. Never fewer — see the note above.
4157
4174
  tools: ir.tools && ir.tools.length > 0 ? ir.tools.map((t) => ({
4158
4175
  type: "function",
@@ -4172,7 +4189,9 @@ function lowerDeepSeek(ir, profile, hints) {
4172
4189
  }
4173
4190
  function buildOpenAICompatibleParts(ir) {
4174
4191
  const ordered = sortSections(ir.sections);
4175
- const systemText = ordered.map((s) => s.text).join("\n\n");
4192
+ const sectionText = ordered.map((s) => s.text).join("\n\n");
4193
+ const jsonInstruction = ir.constraints?.structuredOutput ? "Respond with a single valid JSON value and nothing else. Do not wrap the JSON in a markdown code fence, and do not add any prose before or after it." : "";
4194
+ const systemText = [sectionText, jsonInstruction].filter(Boolean).join("\n\n");
4176
4195
  const messages = systemText ? [{ role: "system", content: systemText }] : [];
4177
4196
  for (const m of ir.history ?? []) {
4178
4197
  if (m.role === "system") continue;
@@ -4843,12 +4862,19 @@ function mapRows(rows) {
4843
4862
  if (!isRawFailureRow(row)) continue;
4844
4863
  const n = coerceCount(row.n);
4845
4864
  const nFail = coerceCount(row.n_fail) ?? 0;
4846
- if (n === null || n <= 0) continue;
4865
+ const nAttempted = coerceCount(row.n_attempted);
4866
+ const nUnavailable = coerceCount(row.n_unavailable) ?? 0;
4867
+ const nUnclassified = coerceCount(row.n_unclassified) ?? 0;
4868
+ if (n === null) continue;
4869
+ if (n <= 0 && nUnavailable <= 0) continue;
4847
4870
  out.push({
4848
4871
  archetype: row.intent_archetype,
4849
4872
  model: row.model,
4850
4873
  n,
4851
- nFail
4874
+ nFail,
4875
+ nAttempted: nAttempted ?? n,
4876
+ nUnavailable,
4877
+ nUnclassified
4852
4878
  });
4853
4879
  }
4854
4880
  return out;
@@ -4872,7 +4898,24 @@ var MEASURED_FAILURE_CFG = {
4872
4898
  /** 95% one-sided-ish confidence (standard two-sided z at α=0.05). */
4873
4899
  z: 1.96,
4874
4900
  /** Must match the view's window. Documented here for the advisory text. */
4875
- windowDays: 28
4901
+ windowDays: 28,
4902
+ /**
4903
+ * alpha.98 — the AVAILABILITY axis. Same statistic, separate vocabulary,
4904
+ * separate verdict, because a 429 and a parse-failure send an operator in
4905
+ * opposite directions (fund or throttle the account vs. distrust the
4906
+ * model's declared structuredOutput). Merging them into one "failure rate"
4907
+ * is the s75 normalization defect.
4908
+ *
4909
+ * Thresholds match the quality axis deliberately: "we are 95% confident
4910
+ * this model is unreachable more often than not" is the same unarguable
4911
+ * bar, and a de-rank is the same remedy. Kept as a distinct config block
4912
+ * so the two can be tuned apart when evidence says they should be.
4913
+ */
4914
+ availability: {
4915
+ minSample: 5,
4916
+ lowerBoundThreshold: 0.5,
4917
+ z: 1.96
4918
+ }
4876
4919
  };
4877
4920
  function wilsonLowerBound(failures, n, z = MEASURED_FAILURE_CFG.z) {
4878
4921
  if (n <= 0) return 0;
@@ -4889,15 +4932,53 @@ function mapMeasuredFailureRows(rows) {
4889
4932
  }
4890
4933
  function judgeMeasuredFailure(row, cfg = MEASURED_FAILURE_CFG) {
4891
4934
  if (!row) return void 0;
4892
- const normalized = "nFail" in row && typeof row.n === "number" ? row : mapRows([row])[0];
4893
- if (!normalized || normalized.n < cfg.minSample) return void 0;
4894
- const lowerBound = wilsonLowerBound(normalized.nFail, normalized.n, cfg.z);
4935
+ const raw = "nFail" in row && typeof row.n === "number" ? row : mapRows([row])[0];
4936
+ if (!raw) return void 0;
4937
+ const normalized = {
4938
+ ...raw,
4939
+ nAttempted: typeof raw.nAttempted === "number" ? raw.nAttempted : raw.n,
4940
+ nUnavailable: typeof raw.nUnavailable === "number" ? raw.nUnavailable : 0,
4941
+ nUnclassified: typeof raw.nUnclassified === "number" ? raw.nUnclassified : 0
4942
+ };
4943
+ const quality = judgeAxis(
4944
+ normalized.nFail,
4945
+ normalized.n,
4946
+ cfg.minSample,
4947
+ cfg.lowerBoundThreshold,
4948
+ cfg.z
4949
+ );
4950
+ const availability = judgeAxis(
4951
+ normalized.nUnavailable,
4952
+ normalized.nAttempted,
4953
+ cfg.availability.minSample,
4954
+ cfg.availability.lowerBoundThreshold,
4955
+ cfg.availability.z
4956
+ );
4957
+ if (normalized.n < cfg.minSample && normalized.nAttempted < cfg.availability.minSample) {
4958
+ return void 0;
4959
+ }
4960
+ const axis = quality.gated ? "quality" : availability.gated ? "availability" : void 0;
4961
+ const lead = axis === "availability" ? availability : quality;
4962
+ return {
4963
+ gated: quality.gated || availability.gated,
4964
+ axis,
4965
+ rate: lead.rate,
4966
+ lowerBound: lead.lowerBound,
4967
+ n: lead.n,
4968
+ nFail: lead.nFail,
4969
+ quality,
4970
+ availability,
4971
+ nUnclassified: normalized.nUnclassified
4972
+ };
4973
+ }
4974
+ function judgeAxis(failures, n, minSample, threshold, z) {
4975
+ const lowerBound = wilsonLowerBound(failures, n, z);
4895
4976
  return {
4896
- gated: lowerBound > cfg.lowerBoundThreshold,
4897
- rate: normalized.nFail / normalized.n,
4977
+ rate: n > 0 ? failures / n : 0,
4898
4978
  lowerBound,
4899
- n: normalized.n,
4900
- nFail: normalized.nFail
4979
+ n,
4980
+ nFail: failures,
4981
+ gated: n >= minSample && lowerBound > threshold
4901
4982
  };
4902
4983
  }
4903
4984
  var snapshots2 = /* @__PURE__ */ new Map();
@@ -5939,9 +6020,13 @@ function detectSingleModelArray(ir, policy) {
5939
6020
  ];
5940
6021
  }
5941
6022
  function suppressedRecommendationReason(ir, archetype, altProfile) {
5942
- if (getMeasuredFailureVerdict({ appId: ir.appId, archetype, model: altProfile.id })?.gated === true) {
5943
- return "measured-failure-gate";
5944
- }
6023
+ const measured = getMeasuredFailureVerdict({
6024
+ appId: ir.appId,
6025
+ archetype,
6026
+ model: altProfile.id
6027
+ });
6028
+ if (measured?.quality.gated === true) return "measured-failure-gate";
6029
+ if (measured?.availability.gated === true) return "measured-unavailable-gate";
5945
6030
  if (ir.constraints?.structuredOutput && effectiveConventions(altProfile).some(
5946
6031
  (c) => c.archetype === archetype && c.structuredOutputHint === "avoid"
5947
6032
  )) {
@@ -6326,7 +6411,8 @@ function compile(ir, opts = {}) {
6326
6411
  rate: verdict.rate,
6327
6412
  lowerBound: verdict.lowerBound,
6328
6413
  n: verdict.n,
6329
- nFail: verdict.nFail
6414
+ nFail: verdict.nFail,
6415
+ axis: verdict.axis ?? "quality"
6330
6416
  });
6331
6417
  }
6332
6418
  }
@@ -6670,7 +6756,7 @@ function validateFinalFit(ir, profile, tokens) {
6670
6756
  }
6671
6757
 
6672
6758
  // src/version.ts
6673
- var LIBRARY_VERSION = "2.0.0-alpha.97";
6759
+ var LIBRARY_VERSION = "2.0.0-alpha.99";
6674
6760
 
6675
6761
  // src/pricing-brain.ts
6676
6762
  function isPricingRow(x) {
@@ -8816,8 +8902,8 @@ async function call(ir, opts = {}) {
8816
8902
  appId: ir.appId,
8817
8903
  archetype: ir.intent.archetype,
8818
8904
  model: targetModel
8819
- })?.gated === true) {
8820
- retrySuppressionNote = " [sameModelRetry suppressed: this model carries an active measured-failure gate for this archetype \u2014 retrying it would near-certainly bill a second doomed inference; walking the chain instead]";
8905
+ })?.quality.gated === true) {
8906
+ retrySuppressionNote = " [sameModelRetry suppressed: this model carries an active measured-failure gate (quality axis) for this archetype \u2014 retrying it would near-certainly bill a second doomed inference; walking the chain instead]";
8821
8907
  }
8822
8908
  if (!validated.ok && isStructuredContractViolation(validated.errorCode) && sameModelRetryEnabled && !retriedSameModel && !retrySuppressionNote) {
8823
8909
  retriedSameModel = true;
package/dist/index.mjs CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  LIBRARY_VERSION,
8
8
  createKeyHealthRoute,
9
9
  keyFingerprint
10
- } from "./chunk-IEEROFZW.mjs";
10
+ } from "./chunk-L3VBUB4I.mjs";
11
11
  import {
12
12
  ARCHETYPE_FAMILY_FITS,
13
13
  BLOCKED_MODEL_FAMILY_SIBLING_SERVED_CODE,
@@ -63,7 +63,7 @@ import {
63
63
  runAdvisor,
64
64
  setTokenizer,
65
65
  wilsonLowerBound
66
- } from "./chunk-AFYBZRQV.mjs";
66
+ } from "./chunk-G33BUB43.mjs";
67
67
  import {
68
68
  ABSOLUTE_FLOOR,
69
69
  ARCHETYPE_FLOOR_DEFAULT,
@@ -100,7 +100,7 @@ import {
100
100
  policySetHas,
101
101
  readBrainReadEnv,
102
102
  resolveProviderKey
103
- } from "./chunk-77AHSX6Y.mjs";
103
+ } from "./chunk-2YCTWV4S.mjs";
104
104
  import {
105
105
  ALL_ARCHETYPES,
106
106
  DIALECT_VERSION,
@@ -127,7 +127,7 @@ import {
127
127
  registerProfiles,
128
128
  resolveModelAlias,
129
129
  tryGetProfile
130
- } from "./chunk-HHIXHL4O.mjs";
130
+ } from "./chunk-PY4CBZFF.mjs";
131
131
  import {
132
132
  emitAdvisoryFired,
133
133
  emitCompileDone,
@@ -1980,8 +1980,8 @@ async function call(ir, opts = {}) {
1980
1980
  appId: ir.appId,
1981
1981
  archetype: ir.intent.archetype,
1982
1982
  model: targetModel
1983
- })?.gated === true) {
1984
- retrySuppressionNote = " [sameModelRetry suppressed: this model carries an active measured-failure gate for this archetype \u2014 retrying it would near-certainly bill a second doomed inference; walking the chain instead]";
1983
+ })?.quality.gated === true) {
1984
+ retrySuppressionNote = " [sameModelRetry suppressed: this model carries an active measured-failure gate (quality axis) for this archetype \u2014 retrying it would near-certainly bill a second doomed inference; walking the chain instead]";
1985
1985
  }
1986
1986
  if (!validated.ok && isStructuredContractViolation(validated.errorCode) && sameModelRetryEnabled && !retriedSameModel && !retrySuppressionNote) {
1987
1987
  retriedSameModel = true;
@@ -579,6 +579,19 @@ type CompiledRequest = {
579
579
  content: unknown;
580
580
  }>;
581
581
  tools?: unknown[];
582
+ /**
583
+ * alpha.99 — DeepSeek's only structured-output mode. The type could not
584
+ * express this field, so `lowerDeepSeek` could not have emitted it even
585
+ * if someone had noticed it was missing: the omission was enforced by
586
+ * the type, and the typecheck stayed green because nothing tried.
587
+ * Same family as the alpha.68 output-mode screen typed too narrowly to
588
+ * receive the value that triggers it — a type that cannot represent the
589
+ * case is indistinguishable from a case that never arises.
590
+ *
591
+ * `{ type: 'json_object' }` only; `json_schema` is rejected outright
592
+ * (measured 2026-08-29: "This response_format type is unavailable now").
593
+ */
594
+ response_format?: unknown;
582
595
  } | {
583
596
  provider: 'zai';
584
597
  model: string;
@@ -579,6 +579,19 @@ type CompiledRequest = {
579
579
  content: unknown;
580
580
  }>;
581
581
  tools?: unknown[];
582
+ /**
583
+ * alpha.99 — DeepSeek's only structured-output mode. The type could not
584
+ * express this field, so `lowerDeepSeek` could not have emitted it even
585
+ * if someone had noticed it was missing: the omission was enforced by
586
+ * the type, and the typecheck stayed green because nothing tried.
587
+ * Same family as the alpha.68 output-mode screen typed too narrowly to
588
+ * receive the value that triggers it — a type that cannot represent the
589
+ * case is indistinguishable from a case that never arises.
590
+ *
591
+ * `{ type: 'json_object' }` only; `json_schema` is rejected outright
592
+ * (measured 2026-08-29: "This response_format type is unavailable now").
593
+ */
594
+ response_format?: unknown;
582
595
  } | {
583
596
  provider: 'zai';
584
597
  model: string;
@@ -28,7 +28,7 @@ __export(key_health_exports, {
28
28
  module.exports = __toCommonJS(key_health_exports);
29
29
 
30
30
  // src/version.ts
31
- var LIBRARY_VERSION = "2.0.0-alpha.97";
31
+ var LIBRARY_VERSION = "2.0.0-alpha.99";
32
32
 
33
33
  // src/key-health.ts
34
34
  var JSON_HEADERS = { "Content-Type": "application/json" };
@@ -3,7 +3,7 @@ import {
3
3
  KEY_FINGERPRINT_LENGTH,
4
4
  createKeyHealthRoute,
5
5
  keyFingerprint
6
- } from "./chunk-IEEROFZW.mjs";
6
+ } from "./chunk-L3VBUB4I.mjs";
7
7
  export {
8
8
  KEY_FINGERPRINT_DOMAIN,
9
9
  KEY_FINGERPRINT_LENGTH,
package/dist/probe.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { C as CompileOptions } from './compile-C2IfAGV1.mjs';
1
+ import { C as CompileOptions } from './compile-hh_l7COL.mjs';
2
2
  import { CliffRule } from './profiles.mjs';
3
3
  export { CliffEvidence, deriveCliffEvidenceClass } from './profiles.mjs';
4
- import { b as PromptIR, e as CompileResult } from './ir-DyMJ84je.mjs';
4
+ import { b as PromptIR, e as CompileResult } from './ir-BZ2qOPMp.mjs';
5
5
  import './dialect.mjs';
6
6
 
7
7
  /**
package/dist/probe.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { C as CompileOptions } from './compile-BlMXv6QT.js';
1
+ import { C as CompileOptions } from './compile-nNpq-6yu.js';
2
2
  import { CliffRule } from './profiles.js';
3
3
  export { CliffEvidence, deriveCliffEvidenceClass } from './profiles.js';
4
- import { b as PromptIR, e as CompileResult } from './ir-DbvOFKF-.js';
4
+ import { b as PromptIR, e as CompileResult } from './ir-CpkidtAd.js';
5
5
  import './dialect.js';
6
6
 
7
7
  /**