@warmdrift/kgauto-compiler 2.0.0-alpha.70 → 2.0.0-alpha.71
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.
- package/dist/{chunk-FR4DNGLW.mjs → chunk-URFQR3SB.mjs} +1 -1
- package/dist/glassbox/index.d.mts +3 -3
- package/dist/glassbox/index.d.ts +3 -3
- package/dist/glassbox-routes/format.d.mts +2 -2
- package/dist/glassbox-routes/format.d.ts +2 -2
- package/dist/glassbox-routes/index.d.mts +4 -4
- package/dist/glassbox-routes/index.d.ts +4 -4
- package/dist/glassbox-routes/react/index.d.mts +2 -2
- package/dist/glassbox-routes/react/index.d.ts +2 -2
- package/dist/index.d.mts +9 -3
- package/dist/index.d.ts +9 -3
- package/dist/index.js +27 -2
- package/dist/index.mjs +27 -2
- package/dist/{ir-Bvlkw5ja.d.ts → ir-BEQ28muo.d.ts} +25 -0
- package/dist/{ir-Bqn1RVdV.d.mts → ir-CnnJST_N.d.mts} +25 -0
- package/dist/key-health.js +1 -1
- package/dist/key-health.mjs +1 -1
- package/dist/profiles.d.mts +1 -1
- package/dist/profiles.d.ts +1 -1
- package/dist/{types-Bon96eyc.d.ts → types-B--CYzMo.d.ts} +1 -1
- package/dist/{types-DsEq35WY.d.mts → types-BDFrJkma.d.mts} +1 -1
- package/dist/{types-DIxRZ3Dj.d.ts → types-DSeJJ6tt.d.ts} +1 -1
- package/dist/{types-CwGhacGT.d.mts → types-DeGRCTlJ.d.mts} +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { G as GlassboxEvent } from '../types-
|
|
2
|
-
export { A as AdvisoryFiredData, C as CompileDoneData, a as CompileStartData, E as ExecuteAttemptData, b as ExecuteSuccessData, F as FallbackWalkedData, c as GLASSBOX_STREAM_TTL_MS, d as GlassboxEventKind, e as GlassboxPubSub } from '../types-
|
|
3
|
-
import '../ir-
|
|
1
|
+
import { G as GlassboxEvent } from '../types-BDFrJkma.mjs';
|
|
2
|
+
export { A as AdvisoryFiredData, C as CompileDoneData, a as CompileStartData, E as ExecuteAttemptData, b as ExecuteSuccessData, F as FallbackWalkedData, c as GLASSBOX_STREAM_TTL_MS, d as GlassboxEventKind, e as GlassboxPubSub } from '../types-BDFrJkma.mjs';
|
|
3
|
+
import '../ir-CnnJST_N.mjs';
|
|
4
4
|
import '../dialect.mjs';
|
|
5
5
|
|
|
6
6
|
/**
|
package/dist/glassbox/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { G as GlassboxEvent } from '../types-
|
|
2
|
-
export { A as AdvisoryFiredData, C as CompileDoneData, a as CompileStartData, E as ExecuteAttemptData, b as ExecuteSuccessData, F as FallbackWalkedData, c as GLASSBOX_STREAM_TTL_MS, d as GlassboxEventKind, e as GlassboxPubSub } from '../types-
|
|
3
|
-
import '../ir-
|
|
1
|
+
import { G as GlassboxEvent } from '../types-B--CYzMo.js';
|
|
2
|
+
export { A as AdvisoryFiredData, C as CompileDoneData, a as CompileStartData, E as ExecuteAttemptData, b as ExecuteSuccessData, F as FallbackWalkedData, c as GLASSBOX_STREAM_TTL_MS, d as GlassboxEventKind, e as GlassboxPubSub } from '../types-B--CYzMo.js';
|
|
3
|
+
import '../ir-BEQ28muo.js';
|
|
4
4
|
import '../dialect.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { G as GlassboxEvent } from '../types-
|
|
2
|
-
import { a as TraceDetail, b as TraceSummary, c as TraceCounterfactual } from '../types-
|
|
3
|
-
export { A as AdvisoryRecord, T as TraceHealth, d as TraceSectionRewrite } from '../types-
|
|
4
|
-
import '../ir-
|
|
1
|
+
import { G as GlassboxEvent } from '../types-BDFrJkma.mjs';
|
|
2
|
+
import { a as TraceDetail, b as TraceSummary, c as TraceCounterfactual } from '../types-DeGRCTlJ.mjs';
|
|
3
|
+
export { A as AdvisoryRecord, T as TraceHealth, d as TraceSectionRewrite } from '../types-DeGRCTlJ.mjs';
|
|
4
|
+
import '../ir-CnnJST_N.mjs';
|
|
5
5
|
import '../dialect.mjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { G as GlassboxEvent } from '../types-
|
|
2
|
-
import { a as TraceDetail, b as TraceSummary, c as TraceCounterfactual } from '../types-
|
|
3
|
-
export { A as AdvisoryRecord, T as TraceHealth, d as TraceSectionRewrite } from '../types-
|
|
4
|
-
import '../ir-
|
|
1
|
+
import { G as GlassboxEvent } from '../types-B--CYzMo.js';
|
|
2
|
+
import { a as TraceDetail, b as TraceSummary, c as TraceCounterfactual } from '../types-DSeJJ6tt.js';
|
|
3
|
+
export { A as AdvisoryRecord, T as TraceHealth, d as TraceSectionRewrite } from '../types-DSeJJ6tt.js';
|
|
4
|
+
import '../ir-BEQ28muo.js';
|
|
5
5
|
import '../dialect.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { a as TraceDetail } from '../../types-
|
|
3
|
-
import '../../ir-
|
|
2
|
+
import { a as TraceDetail } from '../../types-DeGRCTlJ.mjs';
|
|
3
|
+
import '../../ir-CnnJST_N.mjs';
|
|
4
4
|
import '../../dialect.mjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { a as TraceDetail } from '../../types-
|
|
3
|
-
import '../../ir-
|
|
2
|
+
import { a as TraceDetail } from '../../types-DSeJJ6tt.js';
|
|
3
|
+
import '../../ir-BEQ28muo.js';
|
|
4
4
|
import '../../dialect.js';
|
|
5
5
|
|
|
6
6
|
/**
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CompilePolicy, N as NormalizedResponse, A as ApiKeys, P as ProviderOverrides, a as CompiledRequest, b as PromptIR, c as CallOptions, d as CallResult, S as SystemModelMessage, e as CompileResult, B as BestPracticeAdvisory, f as SectionRewrite, R as RecordInput, g as RecordOutcomeInput, O as OutcomeResult, h as OracleScore, i as Adapter, j as PerAxisMetrics, k as Provider, l as ChainEntry, G as Grounding } from './ir-
|
|
2
|
-
export { m as CallAttempt, n as CallError, o as ChainModelEntry, p as ChainWithGrounding, q as Constraints, E as EffortLevel, F as FallbackReason, r as GoldenCaptureOptions, H as HistoryCachePolicy, I as IntentDeclaration, M as Message, s as MutationApplied, t as NormalizedTokens, u as OutcomeKind, v as PerAxisMetricsByModel, w as PromptSection, x as SectionKind, y as ShadowProbeConfig, T as ToolCall, z as ToolDefinition, D as captureGoldenIr, J as parseGoldenCaptureRate, K as resolveGoldenCaptureRate, L as shouldCaptureGolden } from './ir-
|
|
1
|
+
import { C as CompilePolicy, N as NormalizedResponse, A as ApiKeys, P as ProviderOverrides, a as CompiledRequest, b as PromptIR, c as CallOptions, d as CallResult, S as SystemModelMessage, e as CompileResult, B as BestPracticeAdvisory, f as SectionRewrite, R as RecordInput, g as RecordOutcomeInput, O as OutcomeResult, h as OracleScore, i as Adapter, j as PerAxisMetrics, k as Provider, l as ChainEntry, G as Grounding } from './ir-CnnJST_N.mjs';
|
|
2
|
+
export { m as CallAttempt, n as CallError, o as ChainModelEntry, p as ChainWithGrounding, q as Constraints, E as EffortLevel, F as FallbackReason, r as GoldenCaptureOptions, H as HistoryCachePolicy, I as IntentDeclaration, M as Message, s as MutationApplied, t as NormalizedTokens, u as OutcomeKind, v as PerAxisMetricsByModel, w as PromptSection, x as SectionKind, y as ShadowProbeConfig, T as ToolCall, z as ToolDefinition, D as captureGoldenIr, J as parseGoldenCaptureRate, K as resolveGoldenCaptureRate, L as shouldCaptureGolden } from './ir-CnnJST_N.mjs';
|
|
3
3
|
import { ModelProfile, ArchetypeConvention } from './profiles.mjs';
|
|
4
4
|
export { ALIASES, CacheStrategy, CliffRule, LATENCY_TIER_MS, LatencyTier, LoweringSpec, RecoveryRule, StructuredOutputCapability, SystemPromptMode, allProfiles, getProfile, latencyTierOf, profilesByProvider, tryGetProfile } from './profiles.mjs';
|
|
5
5
|
export { BrainForwardConfig, BrainForwardRoutes, createBrainForwardRoutes } from './brain-proxy.mjs';
|
|
@@ -649,6 +649,12 @@ interface OutcomePayload {
|
|
|
649
649
|
system_prompt_chars?: number;
|
|
650
650
|
fell_over_from?: string;
|
|
651
651
|
fallback_reason?: 'rate_limit' | 'provider_auth_failed' | 'provider_error' | 'cliff' | 'cost_cap' | 'contract_violation';
|
|
652
|
+
/**
|
|
653
|
+
* alpha.71 (migration 044) — the precise `errorCode` behind
|
|
654
|
+
* `fallback_reason`. Key OMITTED when no fallback fired, so brains that
|
|
655
|
+
* haven't applied 044 never see it.
|
|
656
|
+
*/
|
|
657
|
+
fell_over_error_code?: string;
|
|
652
658
|
/**
|
|
653
659
|
* True when the same-model retry (CallOptions.sameModelRetry) fired
|
|
654
660
|
* during this call. Key OMITTED (not false) when no retry fired — safe
|
|
@@ -1003,7 +1009,7 @@ declare function runGoldenEval(opts: GoldenEvalOptions): Promise<GoldenEvalRunRe
|
|
|
1003
1009
|
* guard in `tests/version.test.ts` fails the suite (and therefore
|
|
1004
1010
|
* `prepublishOnly`) when they diverge — a stale constant cannot reach npm.
|
|
1005
1011
|
*/
|
|
1006
|
-
declare const LIBRARY_VERSION = "2.0.0-alpha.
|
|
1012
|
+
declare const LIBRARY_VERSION = "2.0.0-alpha.71";
|
|
1007
1013
|
|
|
1008
1014
|
/**
|
|
1009
1015
|
* Oracle contract — how an app tells the brain whether a response was good.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CompilePolicy, N as NormalizedResponse, A as ApiKeys, P as ProviderOverrides, a as CompiledRequest, b as PromptIR, c as CallOptions, d as CallResult, S as SystemModelMessage, e as CompileResult, B as BestPracticeAdvisory, f as SectionRewrite, R as RecordInput, g as RecordOutcomeInput, O as OutcomeResult, h as OracleScore, i as Adapter, j as PerAxisMetrics, k as Provider, l as ChainEntry, G as Grounding } from './ir-
|
|
2
|
-
export { m as CallAttempt, n as CallError, o as ChainModelEntry, p as ChainWithGrounding, q as Constraints, E as EffortLevel, F as FallbackReason, r as GoldenCaptureOptions, H as HistoryCachePolicy, I as IntentDeclaration, M as Message, s as MutationApplied, t as NormalizedTokens, u as OutcomeKind, v as PerAxisMetricsByModel, w as PromptSection, x as SectionKind, y as ShadowProbeConfig, T as ToolCall, z as ToolDefinition, D as captureGoldenIr, J as parseGoldenCaptureRate, K as resolveGoldenCaptureRate, L as shouldCaptureGolden } from './ir-
|
|
1
|
+
import { C as CompilePolicy, N as NormalizedResponse, A as ApiKeys, P as ProviderOverrides, a as CompiledRequest, b as PromptIR, c as CallOptions, d as CallResult, S as SystemModelMessage, e as CompileResult, B as BestPracticeAdvisory, f as SectionRewrite, R as RecordInput, g as RecordOutcomeInput, O as OutcomeResult, h as OracleScore, i as Adapter, j as PerAxisMetrics, k as Provider, l as ChainEntry, G as Grounding } from './ir-BEQ28muo.js';
|
|
2
|
+
export { m as CallAttempt, n as CallError, o as ChainModelEntry, p as ChainWithGrounding, q as Constraints, E as EffortLevel, F as FallbackReason, r as GoldenCaptureOptions, H as HistoryCachePolicy, I as IntentDeclaration, M as Message, s as MutationApplied, t as NormalizedTokens, u as OutcomeKind, v as PerAxisMetricsByModel, w as PromptSection, x as SectionKind, y as ShadowProbeConfig, T as ToolCall, z as ToolDefinition, D as captureGoldenIr, J as parseGoldenCaptureRate, K as resolveGoldenCaptureRate, L as shouldCaptureGolden } from './ir-BEQ28muo.js';
|
|
3
3
|
import { ModelProfile, ArchetypeConvention } from './profiles.js';
|
|
4
4
|
export { ALIASES, CacheStrategy, CliffRule, LATENCY_TIER_MS, LatencyTier, LoweringSpec, RecoveryRule, StructuredOutputCapability, SystemPromptMode, allProfiles, getProfile, latencyTierOf, profilesByProvider, tryGetProfile } from './profiles.js';
|
|
5
5
|
export { BrainForwardConfig, BrainForwardRoutes, createBrainForwardRoutes } from './brain-proxy.js';
|
|
@@ -649,6 +649,12 @@ interface OutcomePayload {
|
|
|
649
649
|
system_prompt_chars?: number;
|
|
650
650
|
fell_over_from?: string;
|
|
651
651
|
fallback_reason?: 'rate_limit' | 'provider_auth_failed' | 'provider_error' | 'cliff' | 'cost_cap' | 'contract_violation';
|
|
652
|
+
/**
|
|
653
|
+
* alpha.71 (migration 044) — the precise `errorCode` behind
|
|
654
|
+
* `fallback_reason`. Key OMITTED when no fallback fired, so brains that
|
|
655
|
+
* haven't applied 044 never see it.
|
|
656
|
+
*/
|
|
657
|
+
fell_over_error_code?: string;
|
|
652
658
|
/**
|
|
653
659
|
* True when the same-model retry (CallOptions.sameModelRetry) fired
|
|
654
660
|
* during this call. Key OMITTED (not false) when no retry fired — safe
|
|
@@ -1003,7 +1009,7 @@ declare function runGoldenEval(opts: GoldenEvalOptions): Promise<GoldenEvalRunRe
|
|
|
1003
1009
|
* guard in `tests/version.test.ts` fails the suite (and therefore
|
|
1004
1010
|
* `prepublishOnly`) when they diverge — a stale constant cannot reach npm.
|
|
1005
1011
|
*/
|
|
1006
|
-
declare const LIBRARY_VERSION = "2.0.0-alpha.
|
|
1012
|
+
declare const LIBRARY_VERSION = "2.0.0-alpha.71";
|
|
1007
1013
|
|
|
1008
1014
|
/**
|
|
1009
1015
|
* Oracle contract — how an app tells the brain whether a response was good.
|
package/dist/index.js
CHANGED
|
@@ -5548,6 +5548,10 @@ function buildPayload(input, reg) {
|
|
|
5548
5548
|
system_prompt_chars: input.systemPromptChars ?? reg?.systemPromptChars,
|
|
5549
5549
|
fell_over_from: fellOverFrom,
|
|
5550
5550
|
fallback_reason: fallbackReason,
|
|
5551
|
+
// alpha.71 — migration 044. The PRECISE code behind `fallback_reason`,
|
|
5552
|
+
// which collapses two opposite-remedy failures into 'cliff'. Omitted
|
|
5553
|
+
// (not null) when no fallback fired, so pre-044 brains never see the key.
|
|
5554
|
+
fell_over_error_code: fellOverFrom ? input.fellOverErrorCode : void 0,
|
|
5551
5555
|
// alpha.66 — omitted-undefined keeps the key out of the JSON body
|
|
5552
5556
|
// entirely for non-retry rows (pre-migration-039 brain safety).
|
|
5553
5557
|
retried_same_model: input.retriedSameModel,
|
|
@@ -7353,6 +7357,7 @@ async function call(ir, opts = {}) {
|
|
|
7353
7357
|
);
|
|
7354
7358
|
const fellOver = targetModel !== initial.target;
|
|
7355
7359
|
const fallbackReason = fellOver ? normalizeFallbackReason(attempts) : void 0;
|
|
7360
|
+
const fellOverErrorCode = fellOver ? firstFailureErrorCode(attempts) : void 0;
|
|
7356
7361
|
const goldenRate = resolveGoldenCaptureRate(opts.goldenCapture?.sampleRate);
|
|
7357
7362
|
const goldenShapeKey = goldenRate > 0 ? peekRegisteredShapeKey(initial.handle) : void 0;
|
|
7358
7363
|
await record({
|
|
@@ -7379,6 +7384,9 @@ async function call(ir, opts = {}) {
|
|
|
7379
7384
|
totalMs: latencyMs2,
|
|
7380
7385
|
fellOverFrom: fellOver ? initial.target : void 0,
|
|
7381
7386
|
fallbackReason,
|
|
7387
|
+
// alpha.71 — migration 044. Omitted when no fallback fired, so
|
|
7388
|
+
// pre-044 brains never see the key.
|
|
7389
|
+
fellOverErrorCode,
|
|
7382
7390
|
// alpha.66 — migration 039. Omitted (not false) when no retry fired
|
|
7383
7391
|
// so pre-039 brains never see the key.
|
|
7384
7392
|
retriedSameModel: retriedSameModel || void 0
|
|
@@ -7439,6 +7447,7 @@ async function call(ir, opts = {}) {
|
|
|
7439
7447
|
servedBy: targetModel,
|
|
7440
7448
|
fellOverFrom: fellOver ? initial.target : void 0,
|
|
7441
7449
|
fallbackReason,
|
|
7450
|
+
fellOverErrorCode,
|
|
7442
7451
|
retriedSameModel: retriedSameModel || void 0,
|
|
7443
7452
|
unreachableFiltered,
|
|
7444
7453
|
policyBlockedFiltered,
|
|
@@ -7774,6 +7783,9 @@ function raiseOutputBudget(request, profile) {
|
|
|
7774
7783
|
}
|
|
7775
7784
|
return request;
|
|
7776
7785
|
}
|
|
7786
|
+
function firstFailureErrorCode(attempts) {
|
|
7787
|
+
return attempts.find((a) => a.status !== "success")?.errorCode;
|
|
7788
|
+
}
|
|
7777
7789
|
function normalizeFallbackReason(attempts) {
|
|
7778
7790
|
const first = attempts.find((a) => a.status !== "success");
|
|
7779
7791
|
if (!first) return void 0;
|
|
@@ -8159,7 +8171,20 @@ async function runGoldenEval(opts) {
|
|
|
8159
8171
|
})
|
|
8160
8172
|
},
|
|
8161
8173
|
models: [judgeModel],
|
|
8162
|
-
|
|
8174
|
+
// alpha.70 — declare the judge's output shape truthfully. The role
|
|
8175
|
+
// section says "You output only JSON" and `parseJudgeVerdict` parses
|
|
8176
|
+
// exactly that, but nothing in the IR SAID so: no `structuredOutput`,
|
|
8177
|
+
// no tools ⇒ `resolveOutputMode` inferred 'text'. That made the judge
|
|
8178
|
+
// eligible for the alpha.68 shape-altering discipline gates — inside
|
|
8179
|
+
// the very engine Release B would use to measure those gates, where a
|
|
8180
|
+
// gate-induced parse failure would be attributed to the gates.
|
|
8181
|
+
//
|
|
8182
|
+
// Deliberately `outputMode`, NOT `structuredOutput: true`: the latter
|
|
8183
|
+
// would switch on kgauto's structured-output validation and change the
|
|
8184
|
+
// lowered wire contract (response_format), altering judge behaviour.
|
|
8185
|
+
// This declares the shape for screening purposes only — which is the
|
|
8186
|
+
// exact reason the alpha.69 hatch is a separate field.
|
|
8187
|
+
constraints: { forceModel: judgeModel, outputMode: "json" }
|
|
8163
8188
|
};
|
|
8164
8189
|
try {
|
|
8165
8190
|
const compiled = compile(judgeIr);
|
|
@@ -8602,7 +8627,7 @@ function createBrainForwardRoutes(config) {
|
|
|
8602
8627
|
}
|
|
8603
8628
|
|
|
8604
8629
|
// src/version.ts
|
|
8605
|
-
var LIBRARY_VERSION = "2.0.0-alpha.
|
|
8630
|
+
var LIBRARY_VERSION = "2.0.0-alpha.71";
|
|
8606
8631
|
|
|
8607
8632
|
// src/key-health.ts
|
|
8608
8633
|
var JSON_HEADERS2 = { "Content-Type": "application/json" };
|
package/dist/index.mjs
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
import {
|
|
17
17
|
LIBRARY_VERSION,
|
|
18
18
|
createKeyHealthRoute
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-URFQR3SB.mjs";
|
|
20
20
|
import {
|
|
21
21
|
ABSOLUTE_FLOOR,
|
|
22
22
|
ARCHETYPE_FLOOR_DEFAULT,
|
|
@@ -3515,6 +3515,10 @@ function buildPayload(input, reg) {
|
|
|
3515
3515
|
system_prompt_chars: input.systemPromptChars ?? reg?.systemPromptChars,
|
|
3516
3516
|
fell_over_from: fellOverFrom,
|
|
3517
3517
|
fallback_reason: fallbackReason,
|
|
3518
|
+
// alpha.71 — migration 044. The PRECISE code behind `fallback_reason`,
|
|
3519
|
+
// which collapses two opposite-remedy failures into 'cliff'. Omitted
|
|
3520
|
+
// (not null) when no fallback fired, so pre-044 brains never see the key.
|
|
3521
|
+
fell_over_error_code: fellOverFrom ? input.fellOverErrorCode : void 0,
|
|
3518
3522
|
// alpha.66 — omitted-undefined keeps the key out of the JSON body
|
|
3519
3523
|
// entirely for non-retry rows (pre-migration-039 brain safety).
|
|
3520
3524
|
retried_same_model: input.retriedSameModel,
|
|
@@ -4581,6 +4585,7 @@ async function call(ir, opts = {}) {
|
|
|
4581
4585
|
);
|
|
4582
4586
|
const fellOver = targetModel !== initial.target;
|
|
4583
4587
|
const fallbackReason = fellOver ? normalizeFallbackReason(attempts) : void 0;
|
|
4588
|
+
const fellOverErrorCode = fellOver ? firstFailureErrorCode(attempts) : void 0;
|
|
4584
4589
|
const goldenRate = resolveGoldenCaptureRate(opts.goldenCapture?.sampleRate);
|
|
4585
4590
|
const goldenShapeKey = goldenRate > 0 ? peekRegisteredShapeKey(initial.handle) : void 0;
|
|
4586
4591
|
await record({
|
|
@@ -4607,6 +4612,9 @@ async function call(ir, opts = {}) {
|
|
|
4607
4612
|
totalMs: latencyMs2,
|
|
4608
4613
|
fellOverFrom: fellOver ? initial.target : void 0,
|
|
4609
4614
|
fallbackReason,
|
|
4615
|
+
// alpha.71 — migration 044. Omitted when no fallback fired, so
|
|
4616
|
+
// pre-044 brains never see the key.
|
|
4617
|
+
fellOverErrorCode,
|
|
4610
4618
|
// alpha.66 — migration 039. Omitted (not false) when no retry fired
|
|
4611
4619
|
// so pre-039 brains never see the key.
|
|
4612
4620
|
retriedSameModel: retriedSameModel || void 0
|
|
@@ -4667,6 +4675,7 @@ async function call(ir, opts = {}) {
|
|
|
4667
4675
|
servedBy: targetModel,
|
|
4668
4676
|
fellOverFrom: fellOver ? initial.target : void 0,
|
|
4669
4677
|
fallbackReason,
|
|
4678
|
+
fellOverErrorCode,
|
|
4670
4679
|
retriedSameModel: retriedSameModel || void 0,
|
|
4671
4680
|
unreachableFiltered,
|
|
4672
4681
|
policyBlockedFiltered,
|
|
@@ -5002,6 +5011,9 @@ function raiseOutputBudget(request, profile) {
|
|
|
5002
5011
|
}
|
|
5003
5012
|
return request;
|
|
5004
5013
|
}
|
|
5014
|
+
function firstFailureErrorCode(attempts) {
|
|
5015
|
+
return attempts.find((a) => a.status !== "success")?.errorCode;
|
|
5016
|
+
}
|
|
5005
5017
|
function normalizeFallbackReason(attempts) {
|
|
5006
5018
|
const first = attempts.find((a) => a.status !== "success");
|
|
5007
5019
|
if (!first) return void 0;
|
|
@@ -5387,7 +5399,20 @@ async function runGoldenEval(opts) {
|
|
|
5387
5399
|
})
|
|
5388
5400
|
},
|
|
5389
5401
|
models: [judgeModel],
|
|
5390
|
-
|
|
5402
|
+
// alpha.70 — declare the judge's output shape truthfully. The role
|
|
5403
|
+
// section says "You output only JSON" and `parseJudgeVerdict` parses
|
|
5404
|
+
// exactly that, but nothing in the IR SAID so: no `structuredOutput`,
|
|
5405
|
+
// no tools ⇒ `resolveOutputMode` inferred 'text'. That made the judge
|
|
5406
|
+
// eligible for the alpha.68 shape-altering discipline gates — inside
|
|
5407
|
+
// the very engine Release B would use to measure those gates, where a
|
|
5408
|
+
// gate-induced parse failure would be attributed to the gates.
|
|
5409
|
+
//
|
|
5410
|
+
// Deliberately `outputMode`, NOT `structuredOutput: true`: the latter
|
|
5411
|
+
// would switch on kgauto's structured-output validation and change the
|
|
5412
|
+
// lowered wire contract (response_format), altering judge behaviour.
|
|
5413
|
+
// This declares the shape for screening purposes only — which is the
|
|
5414
|
+
// exact reason the alpha.69 hatch is a separate field.
|
|
5415
|
+
constraints: { forceModel: judgeModel, outputMode: "json" }
|
|
5391
5416
|
};
|
|
5392
5417
|
try {
|
|
5393
5418
|
const compiled = compile(judgeIr);
|
|
@@ -1212,6 +1212,24 @@ interface CallResult {
|
|
|
1212
1212
|
fellOverFrom?: string;
|
|
1213
1213
|
/** Set only when fallback fired. Normalized cause. */
|
|
1214
1214
|
fallbackReason?: FallbackReason;
|
|
1215
|
+
/**
|
|
1216
|
+
* alpha.71 — the PRECISE `errorCode` of the attempt that drove the chain,
|
|
1217
|
+
* unnormalized. `fallbackReason` is a six-value summary and one of its
|
|
1218
|
+
* values, `'cliff'`, absorbs two failures with OPPOSITE remedies:
|
|
1219
|
+
*
|
|
1220
|
+
* - `max_tokens_on_structured_output` — the output budget was too small
|
|
1221
|
+
* for the requested shape ⇒ raise the cap / add an output-budget cliff.
|
|
1222
|
+
* - `structured_output_parse_failed` — the model emitted non-JSON ⇒ its
|
|
1223
|
+
* declared `structuredOutput` capability is wrong for this shape.
|
|
1224
|
+
*
|
|
1225
|
+
* The code was already computed in `attempts[]` and thrown away at record
|
|
1226
|
+
* time, so a surface could accumulate a dozen identical `'cliff'` rows that
|
|
1227
|
+
* still could not tell an operator which fix applies. (Found diagnosing
|
|
1228
|
+
* claude-haiku-4-5's 12-of-12 failures on playbacksam/summarize, where the
|
|
1229
|
+
* measured-failure gate correctly stopped the bleeding but the evidence
|
|
1230
|
+
* could not name the cause.)
|
|
1231
|
+
*/
|
|
1232
|
+
fellOverErrorCode?: string;
|
|
1215
1233
|
/**
|
|
1216
1234
|
* alpha.66 — true when the one-shot same-model retry
|
|
1217
1235
|
* (CallOptions.sameModelRetry) fired during this call, regardless of
|
|
@@ -1424,6 +1442,13 @@ interface RecordInput {
|
|
|
1424
1442
|
* how often the retry rescued the call vs the chain walking anyway.
|
|
1425
1443
|
*/
|
|
1426
1444
|
retriedSameModel?: boolean;
|
|
1445
|
+
/**
|
|
1446
|
+
* alpha.71 — the precise `errorCode` of the attempt that drove the chain
|
|
1447
|
+
* (migration 044). Set automatically by `call()`; a consumer driving
|
|
1448
|
+
* `record()` by hand may pass it. See `CallResult.fellOverErrorCode` for
|
|
1449
|
+
* why the normalized `fallbackReason` is insufficient on its own.
|
|
1450
|
+
*/
|
|
1451
|
+
fellOverErrorCode?: string;
|
|
1427
1452
|
}
|
|
1428
1453
|
/**
|
|
1429
1454
|
* alpha.20 Entry 4: kinds of consumer-declared outcomes feeding the quality
|
|
@@ -1212,6 +1212,24 @@ interface CallResult {
|
|
|
1212
1212
|
fellOverFrom?: string;
|
|
1213
1213
|
/** Set only when fallback fired. Normalized cause. */
|
|
1214
1214
|
fallbackReason?: FallbackReason;
|
|
1215
|
+
/**
|
|
1216
|
+
* alpha.71 — the PRECISE `errorCode` of the attempt that drove the chain,
|
|
1217
|
+
* unnormalized. `fallbackReason` is a six-value summary and one of its
|
|
1218
|
+
* values, `'cliff'`, absorbs two failures with OPPOSITE remedies:
|
|
1219
|
+
*
|
|
1220
|
+
* - `max_tokens_on_structured_output` — the output budget was too small
|
|
1221
|
+
* for the requested shape ⇒ raise the cap / add an output-budget cliff.
|
|
1222
|
+
* - `structured_output_parse_failed` — the model emitted non-JSON ⇒ its
|
|
1223
|
+
* declared `structuredOutput` capability is wrong for this shape.
|
|
1224
|
+
*
|
|
1225
|
+
* The code was already computed in `attempts[]` and thrown away at record
|
|
1226
|
+
* time, so a surface could accumulate a dozen identical `'cliff'` rows that
|
|
1227
|
+
* still could not tell an operator which fix applies. (Found diagnosing
|
|
1228
|
+
* claude-haiku-4-5's 12-of-12 failures on playbacksam/summarize, where the
|
|
1229
|
+
* measured-failure gate correctly stopped the bleeding but the evidence
|
|
1230
|
+
* could not name the cause.)
|
|
1231
|
+
*/
|
|
1232
|
+
fellOverErrorCode?: string;
|
|
1215
1233
|
/**
|
|
1216
1234
|
* alpha.66 — true when the one-shot same-model retry
|
|
1217
1235
|
* (CallOptions.sameModelRetry) fired during this call, regardless of
|
|
@@ -1424,6 +1442,13 @@ interface RecordInput {
|
|
|
1424
1442
|
* how often the retry rescued the call vs the chain walking anyway.
|
|
1425
1443
|
*/
|
|
1426
1444
|
retriedSameModel?: boolean;
|
|
1445
|
+
/**
|
|
1446
|
+
* alpha.71 — the precise `errorCode` of the attempt that drove the chain
|
|
1447
|
+
* (migration 044). Set automatically by `call()`; a consumer driving
|
|
1448
|
+
* `record()` by hand may pass it. See `CallResult.fellOverErrorCode` for
|
|
1449
|
+
* why the normalized `fallbackReason` is insufficient on its own.
|
|
1450
|
+
*/
|
|
1451
|
+
fellOverErrorCode?: string;
|
|
1427
1452
|
}
|
|
1428
1453
|
/**
|
|
1429
1454
|
* alpha.20 Entry 4: kinds of consumer-declared outcomes feeding the quality
|
package/dist/key-health.js
CHANGED
|
@@ -25,7 +25,7 @@ __export(key_health_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(key_health_exports);
|
|
26
26
|
|
|
27
27
|
// src/version.ts
|
|
28
|
-
var LIBRARY_VERSION = "2.0.0-alpha.
|
|
28
|
+
var LIBRARY_VERSION = "2.0.0-alpha.71";
|
|
29
29
|
|
|
30
30
|
// src/key-health.ts
|
|
31
31
|
var JSON_HEADERS = { "Content-Type": "application/json" };
|
package/dist/key-health.mjs
CHANGED
package/dist/profiles.d.mts
CHANGED
package/dist/profiles.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as MutationApplied, B as BestPracticeAdvisory, F as FallbackReason, m as CallAttempt } from './ir-
|
|
1
|
+
import { s as MutationApplied, B as BestPracticeAdvisory, F as FallbackReason, m as CallAttempt } from './ir-BEQ28muo.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Glass-Box observability types (alpha.17).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as MutationApplied, B as BestPracticeAdvisory, F as FallbackReason, m as CallAttempt } from './ir-
|
|
1
|
+
import { s as MutationApplied, B as BestPracticeAdvisory, F as FallbackReason, m as CallAttempt } from './ir-CnnJST_N.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Glass-Box observability types (alpha.17).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@warmdrift/kgauto-compiler",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.71",
|
|
4
4
|
"description": "Prompt compiler with executable provider knowledge for multi-model AI apps: normalized multi-provider transport with fallback chains, compile-time cliff guards, a curated model registry, and a telemetry flight recorder. Swap models without rewriting prompts.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|