@warmdrift/kgauto-compiler 2.0.0-alpha.83 → 2.0.0-alpha.85
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-VVRDFE6T.mjs → chunk-FD3NFXDC.mjs} +4 -0
- package/dist/{chunk-XPD4I3Q5.mjs → chunk-LO2JXTGG.mjs} +19 -5
- package/dist/{chunk-QEFIAAE7.mjs → chunk-WXN7FNXP.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/index.js +16 -2
- package/dist/glassbox-routes/index.mjs +2 -2
- 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 +217 -131
- package/dist/index.d.ts +217 -131
- package/dist/index.js +140 -27
- package/dist/index.mjs +124 -25
- package/dist/{ir-Cx9hJj0B.d.ts → ir-DfrM71pA.d.ts} +49 -0
- package/dist/{ir-D4S9R816.d.mts → ir-JUoybVM-.d.mts} +49 -0
- package/dist/key-health.js +1 -1
- package/dist/key-health.mjs +1 -1
- package/dist/profiles.d.mts +11 -2
- package/dist/profiles.d.ts +11 -2
- package/dist/profiles.js +5 -0
- package/dist/profiles.mjs +3 -1
- package/dist/{types-DHi4FcUu.d.mts → types-BGH_KAHu.d.mts} +1 -1
- package/dist/{types-CAs9-0S4.d.ts → types-BqTKRECa.d.ts} +1 -1
- package/dist/{types-Cvd6kRNv.d.ts → types-DLDJbCha.d.ts} +1 -1
- package/dist/{types-CRXaR7nJ.d.mts → types-y42mwdvM.d.mts} +1 -1
- package/package.json +1 -1
|
@@ -1666,6 +1666,9 @@ function _setProfileBrainHook(hook) {
|
|
|
1666
1666
|
function canonicalId(id) {
|
|
1667
1667
|
return brainHook.resolveAlias?.(id) ?? ALIASES[id] ?? id;
|
|
1668
1668
|
}
|
|
1669
|
+
function resolveModelAlias(id) {
|
|
1670
|
+
return canonicalId(id);
|
|
1671
|
+
}
|
|
1669
1672
|
var PROFILE_INDEX = new Map(
|
|
1670
1673
|
PROFILES_RAW.map((p) => [p.id, p])
|
|
1671
1674
|
);
|
|
@@ -1699,6 +1702,7 @@ export {
|
|
|
1699
1702
|
latencyTierOf,
|
|
1700
1703
|
ALIASES,
|
|
1701
1704
|
_setProfileBrainHook,
|
|
1705
|
+
resolveModelAlias,
|
|
1702
1706
|
getProfile,
|
|
1703
1707
|
tryGetProfile,
|
|
1704
1708
|
allProfiles,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
allProfiles,
|
|
3
|
+
resolveModelAlias,
|
|
3
4
|
tryGetProfile
|
|
4
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-FD3NFXDC.mjs";
|
|
5
6
|
|
|
6
7
|
// src/brain-query.ts
|
|
7
8
|
var FRESH_SNAPSHOT = {
|
|
@@ -407,6 +408,17 @@ function isSameModelRetryEnabledFromEnv(envSource = defaultEnv()) {
|
|
|
407
408
|
return raw === "1" || raw === "true";
|
|
408
409
|
}
|
|
409
410
|
|
|
411
|
+
// src/policy-match.ts
|
|
412
|
+
function canonicalPolicySet(ids) {
|
|
413
|
+
const set = /* @__PURE__ */ new Set();
|
|
414
|
+
for (const id of ids ?? []) set.add(resolveModelAlias(id));
|
|
415
|
+
return set;
|
|
416
|
+
}
|
|
417
|
+
function policySetHas(set, modelId) {
|
|
418
|
+
if (set.size === 0) return false;
|
|
419
|
+
return set.has(resolveModelAlias(modelId));
|
|
420
|
+
}
|
|
421
|
+
|
|
410
422
|
// src/fallback.ts
|
|
411
423
|
var COST_RANKING_REFERENCE_SHAPE = {
|
|
412
424
|
inputTokens: 4e3,
|
|
@@ -599,8 +611,8 @@ function getDefaultFallbackChain(opts) {
|
|
|
599
611
|
chain = [...starter];
|
|
600
612
|
}
|
|
601
613
|
if (policy?.blockedModels && policy.blockedModels.length > 0) {
|
|
602
|
-
const blocked =
|
|
603
|
-
chain = chain.filter((id) => !blocked
|
|
614
|
+
const blocked = canonicalPolicySet(policy.blockedModels);
|
|
615
|
+
chain = chain.filter((id) => !policySetHas(blocked, id));
|
|
604
616
|
}
|
|
605
617
|
const seen = /* @__PURE__ */ new Set();
|
|
606
618
|
const deduped = [];
|
|
@@ -703,8 +715,8 @@ function getDefaultFallbackChainWithGrounding(opts) {
|
|
|
703
715
|
chain = [...starter];
|
|
704
716
|
}
|
|
705
717
|
if (policy?.blockedModels && policy.blockedModels.length > 0) {
|
|
706
|
-
const blocked =
|
|
707
|
-
chain = chain.filter((e) => !blocked
|
|
718
|
+
const blocked = canonicalPolicySet(policy.blockedModels);
|
|
719
|
+
chain = chain.filter((e) => !policySetHas(blocked, e.id));
|
|
708
720
|
}
|
|
709
721
|
const seen = /* @__PURE__ */ new Set();
|
|
710
722
|
const deduped = [];
|
|
@@ -803,6 +815,8 @@ export {
|
|
|
803
815
|
ARCHETYPE_FLOOR_DEFAULT,
|
|
804
816
|
ABSOLUTE_FLOOR,
|
|
805
817
|
getModelCompatibility,
|
|
818
|
+
canonicalPolicySet,
|
|
819
|
+
policySetHas,
|
|
806
820
|
loadArchetypePerfFromBrain,
|
|
807
821
|
loadArchetypePerfNFromBrain,
|
|
808
822
|
MEASURED_GROUNDING_MIN_N,
|
|
@@ -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-y42mwdvM.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-y42mwdvM.mjs';
|
|
3
|
+
import '../ir-JUoybVM-.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-BqTKRECa.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-BqTKRECa.js';
|
|
3
|
+
import '../ir-DfrM71pA.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-y42mwdvM.mjs';
|
|
2
|
+
import { a as TraceDetail, b as TraceSummary, c as TraceCounterfactual } from '../types-BGH_KAHu.mjs';
|
|
3
|
+
export { A as AdvisoryRecord, T as TraceHealth, d as TraceSectionRewrite } from '../types-BGH_KAHu.mjs';
|
|
4
|
+
import '../ir-JUoybVM-.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-BqTKRECa.js';
|
|
2
|
+
import { a as TraceDetail, b as TraceSummary, c as TraceCounterfactual } from '../types-DLDJbCha.js';
|
|
3
|
+
export { A as AdvisoryRecord, T as TraceHealth, d as TraceSectionRewrite } from '../types-DLDJbCha.js';
|
|
4
|
+
import '../ir-DfrM71pA.js';
|
|
5
5
|
import '../dialect.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -1717,6 +1717,9 @@ var brainHook = {};
|
|
|
1717
1717
|
function canonicalId(id) {
|
|
1718
1718
|
return brainHook.resolveAlias?.(id) ?? ALIASES[id] ?? id;
|
|
1719
1719
|
}
|
|
1720
|
+
function resolveModelAlias(id) {
|
|
1721
|
+
return canonicalId(id);
|
|
1722
|
+
}
|
|
1720
1723
|
var PROFILE_INDEX = new Map(
|
|
1721
1724
|
PROFILES_RAW.map((p) => [p.id, p])
|
|
1722
1725
|
);
|
|
@@ -1891,6 +1894,17 @@ var loadChainsFromBrain = createBrainQueryCache({
|
|
|
1891
1894
|
bundledFallback: getAllStarterChains
|
|
1892
1895
|
});
|
|
1893
1896
|
|
|
1897
|
+
// src/policy-match.ts
|
|
1898
|
+
function canonicalPolicySet(ids) {
|
|
1899
|
+
const set = /* @__PURE__ */ new Set();
|
|
1900
|
+
for (const id of ids ?? []) set.add(resolveModelAlias(id));
|
|
1901
|
+
return set;
|
|
1902
|
+
}
|
|
1903
|
+
function policySetHas(set, modelId) {
|
|
1904
|
+
if (set.size === 0) return false;
|
|
1905
|
+
return set.has(resolveModelAlias(modelId));
|
|
1906
|
+
}
|
|
1907
|
+
|
|
1894
1908
|
// src/archetype-perf-brain.ts
|
|
1895
1909
|
function isPerfRow(x) {
|
|
1896
1910
|
if (!x || typeof x !== "object") return false;
|
|
@@ -2135,8 +2149,8 @@ function getDefaultFallbackChain(opts) {
|
|
|
2135
2149
|
chain = [...starter];
|
|
2136
2150
|
}
|
|
2137
2151
|
if (policy?.blockedModels && policy.blockedModels.length > 0) {
|
|
2138
|
-
const blocked =
|
|
2139
|
-
chain = chain.filter((id) => !blocked
|
|
2152
|
+
const blocked = canonicalPolicySet(policy.blockedModels);
|
|
2153
|
+
chain = chain.filter((id) => !policySetHas(blocked, id));
|
|
2140
2154
|
}
|
|
2141
2155
|
const seen = /* @__PURE__ */ new Set();
|
|
2142
2156
|
const deduped = [];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ARCHETYPE_FLOOR_DEFAULT,
|
|
3
3
|
getDefaultFallbackChain
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-LO2JXTGG.mjs";
|
|
5
5
|
import {
|
|
6
6
|
tryGetProfile
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-FD3NFXDC.mjs";
|
|
8
8
|
import {
|
|
9
9
|
subscribe,
|
|
10
10
|
subscribeApp
|
|
@@ -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-BGH_KAHu.mjs';
|
|
3
|
+
import '../../ir-JUoybVM-.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-DLDJbCha.js';
|
|
3
|
+
import '../../ir-DfrM71pA.js';
|
|
4
4
|
import '../../dialect.js';
|
|
5
5
|
|
|
6
6
|
/**
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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 FallbackReason, 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, 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 hasMutation, K as mutationId, L as parseGoldenCaptureRate, Q as resolveGoldenCaptureRate, U 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 FallbackReason, 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-JUoybVM-.mjs';
|
|
2
|
+
export { m as CallAttempt, n as CallError, o as ChainModelEntry, p as ChainWithGrounding, q as Constraints, E as EffortLevel, 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 hasMutation, K as mutationId, L as parseGoldenCaptureRate, Q as resolveGoldenCaptureRate, U as shouldCaptureGolden } from './ir-JUoybVM-.mjs';
|
|
3
3
|
import { ModelProfile, ArchetypeConvention } from './profiles.mjs';
|
|
4
|
-
export { ALIASES, CacheStrategy, CliffRule, LATENCY_TIER_MS, LatencyTier, LoweringSpec, RecoveryRule, StructuredOutputCapability, SystemPromptMode, allProfiles, getProfile, latencyTierOf, profilesByProvider, tryGetProfile } from './profiles.mjs';
|
|
4
|
+
export { ALIASES, CacheStrategy, CliffRule, LATENCY_TIER_MS, LatencyTier, LoweringSpec, RecoveryRule, StructuredOutputCapability, SystemPromptMode, allProfiles, getProfile, latencyTierOf, profilesByProvider, resolveModelAlias, tryGetProfile } from './profiles.mjs';
|
|
5
5
|
export { BrainForwardConfig, BrainForwardRoutes, createBrainForwardRoutes } from './brain-proxy.mjs';
|
|
6
6
|
export { KEY_FINGERPRINT_DOMAIN, KEY_FINGERPRINT_LENGTH, KeyHealthConfig, KeyHealthProvider, KeyHealthResponseBody, KeyHealthResult, KeyHealthRoute, createKeyHealthRoute, keyFingerprint } from './key-health.mjs';
|
|
7
7
|
import { IntentArchetypeName, OutputMode } from './dialect.mjs';
|
|
@@ -1226,7 +1226,7 @@ declare function runStrategyEvalWithAttribution(opts: Omit<GoldenEvalOptions, 'a
|
|
|
1226
1226
|
* guard in `tests/version.test.ts` fails the suite (and therefore
|
|
1227
1227
|
* `prepublishOnly`) when they diverge — a stale constant cannot reach npm.
|
|
1228
1228
|
*/
|
|
1229
|
-
declare const LIBRARY_VERSION = "2.0.0-alpha.
|
|
1229
|
+
declare const LIBRARY_VERSION = "2.0.0-alpha.85";
|
|
1230
1230
|
|
|
1231
1231
|
/**
|
|
1232
1232
|
* Oracle contract — how an app tells the brain whether a response was good.
|
|
@@ -1645,6 +1645,218 @@ declare function deriveOwnership(code: string, selfDeclared?: 'consumer-actionab
|
|
|
1645
1645
|
*/
|
|
1646
1646
|
declare function runAdvisor(ir: PromptIR, result: AdvisorContext, profile: ModelProfile, policy?: CompilePolicy, phase2?: RunAdvisorPhase2Context): BestPracticeAdvisory[];
|
|
1647
1647
|
|
|
1648
|
+
/**
|
|
1649
|
+
* promote-ready-brain — alpha.41 substrate.
|
|
1650
|
+
*
|
|
1651
|
+
* Per-tenant SWR cache for the `promote_ready_findings` table populated by
|
|
1652
|
+
* the autonomous `promotion-probe-watcher` (Mode 2). Mirrors
|
|
1653
|
+
* `exclusion-findings-brain.ts` shape byte-for-byte where applicable; this
|
|
1654
|
+
* is the read-side substrate for the compile-time `promote-ready` advisor
|
|
1655
|
+
* rule.
|
|
1656
|
+
*
|
|
1657
|
+
* Architecture (mirror of exclusion-findings-brain):
|
|
1658
|
+
*
|
|
1659
|
+
* - **Sync API surface.** `getPromoteReadyFindings({ appId, archetype,
|
|
1660
|
+
* family })` returns `PromoteReadyFindingRow[]` immediately. First call
|
|
1661
|
+
* returns the bundled fallback (empty array); async refresh fires in
|
|
1662
|
+
* background; subsequent calls within TTL return brain data.
|
|
1663
|
+
*
|
|
1664
|
+
* - **Per-appId snapshot.** Each appId gets its own cache entry. One fetch
|
|
1665
|
+
* per appId per TTL window. Tests reset between cases via
|
|
1666
|
+
* `_testResetPromoteReadyFindings()`.
|
|
1667
|
+
*
|
|
1668
|
+
* - **Tolerant.** Brain down / endpoint misconfigured / unexpected shape →
|
|
1669
|
+
* silent bundled fallback (empty array). Never throws. Warns once per
|
|
1670
|
+
* process per error to avoid log spam.
|
|
1671
|
+
*
|
|
1672
|
+
* - **Opt-in.** Activation gated on `configurePromoteReadyBrain()` having
|
|
1673
|
+
* been called with a runtime. The public `configureBrain()` in brain.ts
|
|
1674
|
+
* wires this up automatically when
|
|
1675
|
+
* `BrainConfig.brainQuery.findingsPromoteReady !== false`.
|
|
1676
|
+
*
|
|
1677
|
+
* Plus: `markPromoteReadyHandled` — direct PostgREST PATCH against the
|
|
1678
|
+
* brain (no kgauto proxy). Mirrors `markExclusionFindingHandled` shape
|
|
1679
|
+
* byte-for-byte. Idempotent on `resolved_at=is.null` filter.
|
|
1680
|
+
*
|
|
1681
|
+
* Default endpoint:
|
|
1682
|
+
* `https://kgauto-dashboard.vercel.app/api/kgauto-v2/findings/promote-ready`
|
|
1683
|
+
* The route accepts `?app_id=X` and returns a JSON array of findings
|
|
1684
|
+
* for that app filtered to `resolved_at IS NULL`.
|
|
1685
|
+
*/
|
|
1686
|
+
|
|
1687
|
+
/**
|
|
1688
|
+
* Shape of one row from the `promote_ready_findings` cache table. Mirrors
|
|
1689
|
+
* the snake_case JSONB returned by the brain endpoint, mapped to camelCase
|
|
1690
|
+
* at the boundary (rowToFinding) so the in-memory shape stays consistent
|
|
1691
|
+
* with the rest of the library.
|
|
1692
|
+
*/
|
|
1693
|
+
interface PromoteReadyFindingRow {
|
|
1694
|
+
/** Intent archetype the finding applies to. */
|
|
1695
|
+
archetype: string;
|
|
1696
|
+
/** Model family (e.g. 'claude-opus', 'gemini-flash'). */
|
|
1697
|
+
family: string;
|
|
1698
|
+
/** The candidate model that the probe validated. */
|
|
1699
|
+
candidateModel: string;
|
|
1700
|
+
/** The current production model the candidate was compared against. */
|
|
1701
|
+
currentModel: string;
|
|
1702
|
+
/** Sample size of the probe run (typically 10). */
|
|
1703
|
+
sampleN: number;
|
|
1704
|
+
/** Fraction of probes where the judge verdict was 'candidate-better' or
|
|
1705
|
+
* 'tied'. 0.000 to 1.000. */
|
|
1706
|
+
judgePassRate: number;
|
|
1707
|
+
/** Mean judge score across the probe sample. 1.00 to 5.00. */
|
|
1708
|
+
judgeAvgScore: number;
|
|
1709
|
+
/** Signed cost delta as a fraction (negative = candidate is cheaper).
|
|
1710
|
+
* Null when pricing data was incomplete at probe time. */
|
|
1711
|
+
costDeltaPct: number | null;
|
|
1712
|
+
/** ISO timestamp of detection (when the probe wrote the row). */
|
|
1713
|
+
detectedAt: string;
|
|
1714
|
+
}
|
|
1715
|
+
/**
|
|
1716
|
+
* Resolution sources supported by alpha.41 `markPromoteReadyHandled`. The
|
|
1717
|
+
* three values map to the three CHECK-constrained resolution values on
|
|
1718
|
+
* `promote_ready_findings.resolution`:
|
|
1719
|
+
*
|
|
1720
|
+
* - `'promoted'` — consumer migrated to the candidate model. Strong
|
|
1721
|
+
* positive signal; the probe was right.
|
|
1722
|
+
* - `'declined'` — consumer evaluated and chose not to promote.
|
|
1723
|
+
* Strong negative signal; revisit only on new
|
|
1724
|
+
* family entries or material score swings.
|
|
1725
|
+
* - `'still-evaluating'` — consumer acknowledges the finding but defers
|
|
1726
|
+
* the decision. Acknowledges-without-deciding;
|
|
1727
|
+
* finding silences this cycle but next probe may
|
|
1728
|
+
* re-surface.
|
|
1729
|
+
*/
|
|
1730
|
+
type PromoteReadyResolution = 'promoted' | 'declined' | 'still-evaluating';
|
|
1731
|
+
interface MarkPromoteReadyHandledOptions {
|
|
1732
|
+
/** App id the finding belongs to. Required (RLS scopes writes by this). */
|
|
1733
|
+
appId: string;
|
|
1734
|
+
/** Archetype the finding applies to (e.g. 'hunt', 'classify'). */
|
|
1735
|
+
archetype: IntentArchetypeName | string;
|
|
1736
|
+
/** Model family the finding applies to (e.g. 'claude-opus'). */
|
|
1737
|
+
family: string;
|
|
1738
|
+
/** Resolution semantics — see `PromoteReadyResolution`. */
|
|
1739
|
+
resolution: PromoteReadyResolution;
|
|
1740
|
+
/** Optional free-form note explaining the decision. */
|
|
1741
|
+
resolutionNote?: string;
|
|
1742
|
+
/** Brain Supabase URL base (e.g. `https://<project>.supabase.co`). */
|
|
1743
|
+
brainEndpoint: string;
|
|
1744
|
+
/** Consumer-scoped JWT carrying the `app_id` claim. */
|
|
1745
|
+
brainJwt: string;
|
|
1746
|
+
/** Supabase anon key for the `apikey` header. */
|
|
1747
|
+
brainAnonKey: string;
|
|
1748
|
+
/** Injected fetch for tests. Defaults to global fetch. */
|
|
1749
|
+
fetch?: typeof fetch;
|
|
1750
|
+
}
|
|
1751
|
+
/**
|
|
1752
|
+
* Mark a probe-validated promote-ready finding as handled. Returns an
|
|
1753
|
+
* `ok/reason` envelope matching `markExclusionFindingHandled`.
|
|
1754
|
+
*
|
|
1755
|
+
* Idempotent: if no row matches the (app_id, archetype, family) tuple
|
|
1756
|
+
* (already resolved, never existed, watcher not yet UPSERTed), PostgREST
|
|
1757
|
+
* returns 200/204 with zero affected rows and we return `{ ok: true }`.
|
|
1758
|
+
*
|
|
1759
|
+
* Reasons surfaced on failure:
|
|
1760
|
+
* - `app_id_required` / `archetype_required` / `family_required`
|
|
1761
|
+
* - `resolution_invalid` — not one of the three documented values
|
|
1762
|
+
* - `brain_auth_misconfig` — 401/403
|
|
1763
|
+
* - `brain_unavailable` — 5xx
|
|
1764
|
+
* - `network_error:<message>` — fetch threw
|
|
1765
|
+
* - `patch_failed:<status>` — anything else non-2xx
|
|
1766
|
+
*/
|
|
1767
|
+
declare function markPromoteReadyHandled(opts: MarkPromoteReadyHandledOptions): Promise<{
|
|
1768
|
+
ok: true;
|
|
1769
|
+
} | {
|
|
1770
|
+
ok: false;
|
|
1771
|
+
reason: string;
|
|
1772
|
+
}>;
|
|
1773
|
+
|
|
1774
|
+
/**
|
|
1775
|
+
* blocked-model-drift — advisor rule for the two ways a consumer's
|
|
1776
|
+
* `CompilePolicy.blockedModels` can stop meaning what the consumer meant,
|
|
1777
|
+
* without anything anywhere reporting a problem.
|
|
1778
|
+
*
|
|
1779
|
+
* ── The incidents this is grounded in (tt-intel s113 + s119) ─────────────
|
|
1780
|
+
*
|
|
1781
|
+
* (Correction, s83: an earlier draft cited "claude-sonnet-5 served 30% of
|
|
1782
|
+
* tt-intel's ask traffic" as the motivating incident. That number was a
|
|
1783
|
+
* FOSSIL — tt-intel's own L-188 traced all 11 calls to a 29-second burst
|
|
1784
|
+
* from their own prior spend-gate experiment, fixed minutes later, and
|
|
1785
|
+
* their block was in fact working. Do not resurrect it.)
|
|
1786
|
+
*
|
|
1787
|
+
* The real, verified incidents:
|
|
1788
|
+
*
|
|
1789
|
+
* 1. alpha.72 retargeted the curated `claude-sonnet` family primary from
|
|
1790
|
+
* `claude-sonnet-4-6` (now `legacy`) to `claude-sonnet-5` (now
|
|
1791
|
+
* `current`), and tt-intel's literal-id gate STOPPED MATCHING the
|
|
1792
|
+
* family's routed traffic — their s113 response was to build
|
|
1793
|
+
* consumer-side family→concrete-id resolution (`parseBlockedModels`)
|
|
1794
|
+
* before ids reach kgauto. Every consumer without that local machinery
|
|
1795
|
+
* is exposed to the same silent retarget: `blockedModels` is matched by
|
|
1796
|
+
* exact id, so a block written against yesterday's primary says nothing
|
|
1797
|
+
* about today's.
|
|
1798
|
+
*
|
|
1799
|
+
* 2. tt-intel s119 (2026-07-29 filing): a blocked model SERVED when an
|
|
1800
|
+
* unblocked ALIAS of it sat in the candidate set (`deepseek-chat` ≡
|
|
1801
|
+
* `deepseek-v4-flash`). That one was a kgauto correctness bug, fixed in
|
|
1802
|
+
* alpha.85 by canonical matching (`policy-match.ts`) — but it proved
|
|
1803
|
+
* the class: a block-list meaning drifts whenever the roster's id
|
|
1804
|
+
* surface moves under it, and no layer errors.
|
|
1805
|
+
*
|
|
1806
|
+
* ── What this rule is NOT ────────────────────────────────────────────────
|
|
1807
|
+
*
|
|
1808
|
+
* It does not change matching semantics. Exact-ID matching is arguably the
|
|
1809
|
+
* correct contract: family-glob matching would silently widen every
|
|
1810
|
+
* existing consumer's block-list, which is a breaking semantic change and
|
|
1811
|
+
* not kgauto's to make unilaterally. The gap here is silence, not
|
|
1812
|
+
* semantics — so the fix is a signal, not a behavior change. Selection is
|
|
1813
|
+
* untouched; a consumer who blocked one exact id still gets exactly that
|
|
1814
|
+
* id blocked and nothing else.
|
|
1815
|
+
*
|
|
1816
|
+
* ── The two branches ─────────────────────────────────────────────────────
|
|
1817
|
+
*
|
|
1818
|
+
* (a) `blocked-model-not-in-roster` — a `blockedModels` entry resolves to
|
|
1819
|
+
* no model in the current roster (after alias resolution). The block is
|
|
1820
|
+
* inert: it can never match anything. Causes are a typo, a model
|
|
1821
|
+
* retired out of the roster, or a stale env var carried forward. There
|
|
1822
|
+
* is no reading under which an entry matching nothing is what the
|
|
1823
|
+
* consumer wanted, so this is unambiguous.
|
|
1824
|
+
*
|
|
1825
|
+
* (b) `blocked-model-family-sibling-served` — the model selected for THIS
|
|
1826
|
+
* call is in the same family as a blocked entry but is a different
|
|
1827
|
+
* exact id. This is the tt-intel shape. Unlike (a) it IS ambiguous:
|
|
1828
|
+
* "block `claude-sonnet-4-6` specifically, `claude-sonnet-5` is fine"
|
|
1829
|
+
* is a legitimate and common intent. So the message states both
|
|
1830
|
+
* readings and says how to act on either. It escalates its wording —
|
|
1831
|
+
* not its level — when the blocked sibling is `legacy`/`deprecated` and
|
|
1832
|
+
* the served sibling is `current`, because that combination is the
|
|
1833
|
+
* signature of a roster lifecycle move rather than a deliberate
|
|
1834
|
+
* per-generation block.
|
|
1835
|
+
*
|
|
1836
|
+
* Both fire at `warn`, and both fire regardless of `policy.posture`.
|
|
1837
|
+
* `posture: 'locked'` means "do not recommend models to me" — these are not
|
|
1838
|
+
* recommendations, they are reports that the consumer's own declared
|
|
1839
|
+
* constraint is not doing what its author expects. Same reasoning as the
|
|
1840
|
+
* alpha.28 `archetype-perf-floor-breach` cliff advisor, which is also
|
|
1841
|
+
* posture-independent because it reports a structural fact rather than a
|
|
1842
|
+
* preference.
|
|
1843
|
+
*
|
|
1844
|
+
* Companion watcher: `v2/scripts/blocked-model-drift-watch.mjs` rolls the
|
|
1845
|
+
* same two branches up across a consumer's recent traffic from the brain,
|
|
1846
|
+
* so the signal survives a consumer who never reads `result.advisories[]`.
|
|
1847
|
+
*
|
|
1848
|
+
* L-073 family ("no errors = healthy"): as with DeepSeek's `deepseek-chat`
|
|
1849
|
+
* compat alias and the alpha.47/.43 field-drop chain, nothing errored,
|
|
1850
|
+
* nothing 404'd, latency did not move — and the cached intent was wrong for
|
|
1851
|
+
* an unknown duration. The detection loop has to be built deliberately
|
|
1852
|
+
* because the failure emits no natural signal.
|
|
1853
|
+
*/
|
|
1854
|
+
|
|
1855
|
+
/** Stable rule code — branch (a). Written to `compile_outcome_advisories.code`. */
|
|
1856
|
+
declare const BLOCKED_MODEL_NOT_IN_ROSTER_CODE = "blocked-model-not-in-roster";
|
|
1857
|
+
/** Stable rule code — branch (b). Written to `compile_outcome_advisories.code`. */
|
|
1858
|
+
declare const BLOCKED_MODEL_FAMILY_SIBLING_SERVED_CODE = "blocked-model-family-sibling-served";
|
|
1859
|
+
|
|
1648
1860
|
/**
|
|
1649
1861
|
* Translator primitive — alpha.31.
|
|
1650
1862
|
*
|
|
@@ -3241,132 +3453,6 @@ declare function deriveFamilyFromModelId(modelId: string): string | null;
|
|
|
3241
3453
|
*/
|
|
3242
3454
|
declare function getRecommendedPrimary(opts: GetRecommendedPrimaryOptions): string;
|
|
3243
3455
|
|
|
3244
|
-
/**
|
|
3245
|
-
* promote-ready-brain — alpha.41 substrate.
|
|
3246
|
-
*
|
|
3247
|
-
* Per-tenant SWR cache for the `promote_ready_findings` table populated by
|
|
3248
|
-
* the autonomous `promotion-probe-watcher` (Mode 2). Mirrors
|
|
3249
|
-
* `exclusion-findings-brain.ts` shape byte-for-byte where applicable; this
|
|
3250
|
-
* is the read-side substrate for the compile-time `promote-ready` advisor
|
|
3251
|
-
* rule.
|
|
3252
|
-
*
|
|
3253
|
-
* Architecture (mirror of exclusion-findings-brain):
|
|
3254
|
-
*
|
|
3255
|
-
* - **Sync API surface.** `getPromoteReadyFindings({ appId, archetype,
|
|
3256
|
-
* family })` returns `PromoteReadyFindingRow[]` immediately. First call
|
|
3257
|
-
* returns the bundled fallback (empty array); async refresh fires in
|
|
3258
|
-
* background; subsequent calls within TTL return brain data.
|
|
3259
|
-
*
|
|
3260
|
-
* - **Per-appId snapshot.** Each appId gets its own cache entry. One fetch
|
|
3261
|
-
* per appId per TTL window. Tests reset between cases via
|
|
3262
|
-
* `_testResetPromoteReadyFindings()`.
|
|
3263
|
-
*
|
|
3264
|
-
* - **Tolerant.** Brain down / endpoint misconfigured / unexpected shape →
|
|
3265
|
-
* silent bundled fallback (empty array). Never throws. Warns once per
|
|
3266
|
-
* process per error to avoid log spam.
|
|
3267
|
-
*
|
|
3268
|
-
* - **Opt-in.** Activation gated on `configurePromoteReadyBrain()` having
|
|
3269
|
-
* been called with a runtime. The public `configureBrain()` in brain.ts
|
|
3270
|
-
* wires this up automatically when
|
|
3271
|
-
* `BrainConfig.brainQuery.findingsPromoteReady !== false`.
|
|
3272
|
-
*
|
|
3273
|
-
* Plus: `markPromoteReadyHandled` — direct PostgREST PATCH against the
|
|
3274
|
-
* brain (no kgauto proxy). Mirrors `markExclusionFindingHandled` shape
|
|
3275
|
-
* byte-for-byte. Idempotent on `resolved_at=is.null` filter.
|
|
3276
|
-
*
|
|
3277
|
-
* Default endpoint:
|
|
3278
|
-
* `https://kgauto-dashboard.vercel.app/api/kgauto-v2/findings/promote-ready`
|
|
3279
|
-
* The route accepts `?app_id=X` and returns a JSON array of findings
|
|
3280
|
-
* for that app filtered to `resolved_at IS NULL`.
|
|
3281
|
-
*/
|
|
3282
|
-
|
|
3283
|
-
/**
|
|
3284
|
-
* Shape of one row from the `promote_ready_findings` cache table. Mirrors
|
|
3285
|
-
* the snake_case JSONB returned by the brain endpoint, mapped to camelCase
|
|
3286
|
-
* at the boundary (rowToFinding) so the in-memory shape stays consistent
|
|
3287
|
-
* with the rest of the library.
|
|
3288
|
-
*/
|
|
3289
|
-
interface PromoteReadyFindingRow {
|
|
3290
|
-
/** Intent archetype the finding applies to. */
|
|
3291
|
-
archetype: string;
|
|
3292
|
-
/** Model family (e.g. 'claude-opus', 'gemini-flash'). */
|
|
3293
|
-
family: string;
|
|
3294
|
-
/** The candidate model that the probe validated. */
|
|
3295
|
-
candidateModel: string;
|
|
3296
|
-
/** The current production model the candidate was compared against. */
|
|
3297
|
-
currentModel: string;
|
|
3298
|
-
/** Sample size of the probe run (typically 10). */
|
|
3299
|
-
sampleN: number;
|
|
3300
|
-
/** Fraction of probes where the judge verdict was 'candidate-better' or
|
|
3301
|
-
* 'tied'. 0.000 to 1.000. */
|
|
3302
|
-
judgePassRate: number;
|
|
3303
|
-
/** Mean judge score across the probe sample. 1.00 to 5.00. */
|
|
3304
|
-
judgeAvgScore: number;
|
|
3305
|
-
/** Signed cost delta as a fraction (negative = candidate is cheaper).
|
|
3306
|
-
* Null when pricing data was incomplete at probe time. */
|
|
3307
|
-
costDeltaPct: number | null;
|
|
3308
|
-
/** ISO timestamp of detection (when the probe wrote the row). */
|
|
3309
|
-
detectedAt: string;
|
|
3310
|
-
}
|
|
3311
|
-
/**
|
|
3312
|
-
* Resolution sources supported by alpha.41 `markPromoteReadyHandled`. The
|
|
3313
|
-
* three values map to the three CHECK-constrained resolution values on
|
|
3314
|
-
* `promote_ready_findings.resolution`:
|
|
3315
|
-
*
|
|
3316
|
-
* - `'promoted'` — consumer migrated to the candidate model. Strong
|
|
3317
|
-
* positive signal; the probe was right.
|
|
3318
|
-
* - `'declined'` — consumer evaluated and chose not to promote.
|
|
3319
|
-
* Strong negative signal; revisit only on new
|
|
3320
|
-
* family entries or material score swings.
|
|
3321
|
-
* - `'still-evaluating'` — consumer acknowledges the finding but defers
|
|
3322
|
-
* the decision. Acknowledges-without-deciding;
|
|
3323
|
-
* finding silences this cycle but next probe may
|
|
3324
|
-
* re-surface.
|
|
3325
|
-
*/
|
|
3326
|
-
type PromoteReadyResolution = 'promoted' | 'declined' | 'still-evaluating';
|
|
3327
|
-
interface MarkPromoteReadyHandledOptions {
|
|
3328
|
-
/** App id the finding belongs to. Required (RLS scopes writes by this). */
|
|
3329
|
-
appId: string;
|
|
3330
|
-
/** Archetype the finding applies to (e.g. 'hunt', 'classify'). */
|
|
3331
|
-
archetype: IntentArchetypeName | string;
|
|
3332
|
-
/** Model family the finding applies to (e.g. 'claude-opus'). */
|
|
3333
|
-
family: string;
|
|
3334
|
-
/** Resolution semantics — see `PromoteReadyResolution`. */
|
|
3335
|
-
resolution: PromoteReadyResolution;
|
|
3336
|
-
/** Optional free-form note explaining the decision. */
|
|
3337
|
-
resolutionNote?: string;
|
|
3338
|
-
/** Brain Supabase URL base (e.g. `https://<project>.supabase.co`). */
|
|
3339
|
-
brainEndpoint: string;
|
|
3340
|
-
/** Consumer-scoped JWT carrying the `app_id` claim. */
|
|
3341
|
-
brainJwt: string;
|
|
3342
|
-
/** Supabase anon key for the `apikey` header. */
|
|
3343
|
-
brainAnonKey: string;
|
|
3344
|
-
/** Injected fetch for tests. Defaults to global fetch. */
|
|
3345
|
-
fetch?: typeof fetch;
|
|
3346
|
-
}
|
|
3347
|
-
/**
|
|
3348
|
-
* Mark a probe-validated promote-ready finding as handled. Returns an
|
|
3349
|
-
* `ok/reason` envelope matching `markExclusionFindingHandled`.
|
|
3350
|
-
*
|
|
3351
|
-
* Idempotent: if no row matches the (app_id, archetype, family) tuple
|
|
3352
|
-
* (already resolved, never existed, watcher not yet UPSERTed), PostgREST
|
|
3353
|
-
* returns 200/204 with zero affected rows and we return `{ ok: true }`.
|
|
3354
|
-
*
|
|
3355
|
-
* Reasons surfaced on failure:
|
|
3356
|
-
* - `app_id_required` / `archetype_required` / `family_required`
|
|
3357
|
-
* - `resolution_invalid` — not one of the three documented values
|
|
3358
|
-
* - `brain_auth_misconfig` — 401/403
|
|
3359
|
-
* - `brain_unavailable` — 5xx
|
|
3360
|
-
* - `network_error:<message>` — fetch threw
|
|
3361
|
-
* - `patch_failed:<status>` — anything else non-2xx
|
|
3362
|
-
*/
|
|
3363
|
-
declare function markPromoteReadyHandled(opts: MarkPromoteReadyHandledOptions): Promise<{
|
|
3364
|
-
ok: true;
|
|
3365
|
-
} | {
|
|
3366
|
-
ok: false;
|
|
3367
|
-
reason: string;
|
|
3368
|
-
}>;
|
|
3369
|
-
|
|
3370
3456
|
/**
|
|
3371
3457
|
* promotions-brain — alpha.64 Stage-2 substrate.
|
|
3372
3458
|
*
|
|
@@ -3929,4 +4015,4 @@ declare function planDecomposition(args: PlanDecompositionArgs): DecompositionPl
|
|
|
3929
4015
|
*/
|
|
3930
4016
|
declare function compile(ir: PromptIR, opts?: CompileOptions): CompileResult;
|
|
3931
4017
|
|
|
3932
|
-
export { ABSOLUTE_FLOOR, type AISDKConvertedMessage, ALT_BLIND_TOKEN_BUDGET_BREACH, ALT_STRATEGY_IDS, ARCHETYPE_FAMILY_FITS, ARCHETYPE_FLOOR_DEFAULT, type ActionableAdvisory, Adapter, type AdvisoryEvidenceWindow, type AdvisoryResolutionSource, type AdvisorySeverity, type AdvisoryStatus, type AdvisorySuggestedFix, ApiKeys, type AppOracle, type ApplySectionRewritesArgs, type ApplySectionRewritesResult, ArchetypeConvention, type ArchetypeFamilyFit, type ArchetypePerfMap, type ArchetypePerfNMap, type ArchetypePerfScoreResult, type AttachCacheControlResult, BRAIN_READ_ENV_NAMES, BURST_SPAN_MS, BestPracticeAdvisory, type BrainConfig, type BrainDeadLetterEntry, type BrainHealthSnapshot, type BrainQueryConfig, type BrainReadEnv, COACH_CFG, COST_RANKING_REFERENCE_SHAPE, CallOptions, CallResult, ChainEntry, type CompatibilityIntent, type CompileForAISDKv6Result, type CompileOptions, CompilePolicy, CompileResult, CompiledRequest, type CreateDelegateOpts, DECOMPOSITION_TEMPLATES, DECOMPOSITION_TEMPLATES_VERSION, DEFAULT_FINDINGS_ENDPOINT, DEFAULT_MEASURED_FAILURE_ENDPOINT, DEFAULT_PROMOTIONS_ENDPOINT, DELEGATE_TOOL_DEFINITION, DISCIPLINE_GATES_V1_ALT_BLIND_HEADER, DISCIPLINE_GATES_V1_ALT_HEADER, type DecompositionPlan, type DecompositionStep, type DecompositionTemplate, type DelegateHandle, type DelegateRefusalReason, type DelegateResult, type DelegateToolArgs, type ExclusionFindingRow, type ExclusionResolutionSource, type ExecuteErr, type ExecuteOk, type ExecuteOptions, type ExecuteResult, type ExecutorCandidate, type FallbackPosture, FallbackReason, FamilyResolutionError, type GetActionableAdvisoriesOptions, type GetApplicablePromotionOpts, type GetDefaultFallbackChainOpts, type GetMeasuredFailureOpts, type GetPerAxisMetricsOpts, type GetRecommendedPrimaryOptions, type GoldenEvalAxis, type GoldenEvalCase, type GoldenEvalOptions, type GoldenEvalRunResult, type GoldenEvalStrategyId, type GoldenIrRecordInput, Grounding, IntentArchetypeName, JUDGE_RUBRICS, LIBRARY_VERSION, type LLMJudgeOptions, MEASURED_FAILURE_CFG, MEASURED_GROUNDING_MIN_N, type MarkAdvisoryResolvedOptions, type MarkExclusionFindingHandledOptions, type MarkPromoteReadyHandledOptions, type MeasuredFailureRuntime, type MeasuredFailureVerdict, type ModelBrainRow, type ModelCompatibility, ModelProfile, NormalizedResponse, type OracleContext, OracleScore, type OutcomePayload, OutcomeResult, OutputMode, PRODUCER_OWNED_RULE_CODES, PROVIDER_ENV_KEYS, PerAxisMetrics, type PlannedStep, type PricingRow, type ProbeShadowOptions, type ProbeShadowServed, type ProfileToRowOptions, type PromoteReadyFindingRow, type PromoteReadyResolution, type PromotionRow, type PromotionsRuntime, PromptIR, Provider, ProviderOverrides, type ProviderReachability, ROLLBACK_SUPPRESSION_WINDOW_DAYS, RULE_DISCIPLINE_GATES_V1, RULE_DISCIPLINE_GATES_V1_STRUCTURED, RULE_SEQUENTIAL_TOOL_CLIFF, type ReachabilityOpts, RecordInput, RecordOutcomeInput, type RunAdvisorPhase2Context, STRATEGY_AUTHORSHIP_INDEPENDENT, STRATEGY_AUTHORSHIP_LIMITATION, SectionRewrite, type ShadowProbeRecordInput, type StrategyAttribution, type StrategyAttributionResult, type StrategyOutcome, type SupportedProvider, type SurfaceFailureRow, type SurfaceStats, SystemModelMessage, TRANSLATOR_FLOOR, _testResetMeasuredFailure, _testResetPromotions, _testWaitForMeasuredFailureRefresh, _testWaitForPromotionsRefresh, altBlindGatesBlockFor, altGatesBlockFor, applyArchetypeConvention, applySectionRewrites, attachCacheControlToStreamTextInput, awaitMeasuredFailureReady, brainHealth, buildGoldenIrRow, buildLLMJudge, buildPairwiseJudgePrompt, buildShadowProbeRow, burstCaveat, call, chainProviderSpread, classifyEvidenceWindow, classifyStrategyOutcome, clearBrain, combineOrderSwappedVerdicts, compile, compileForAISDKv6, configureBrain, configureMeasuredFailureBrain, configurePromotionsBrain, countTokens, createDelegate, deriveFamilyFromModelId, deriveOwnership, estimateChainCostUsd, estimateModelCostUsd, execute, findBetterFit, flushBrainDeadLetter, formatEvidenceSpan, getActionableAdvisories, getAllStarterChains, getAllStarterChainsWithGrounding, getApplicablePromotion, getArchetypePerfScore, getDefaultFallbackChain, getDefaultFallbackChainWithGrounding, getMeasuredFailureVerdict, getModelCompatibility, getPerAxisMetrics, getReachabilityDiagnostic, getRecentRollback, getRecommendedPrimary, getSequentialStarterChain, getSequentialStarterChainWithGrounding, getStaleExclusionFindings, getStarterChain, getStarterChainWithGrounding, isAltStrategy, isAutoPromoteEnabledFromEnv, isBrainQueryActiveFor, isBrainSync, isDelegateEnabledFromEnv, isExclusionFindingsBrainActive, isMeasuredFailureBrainActive, isMeasuredFailureGateEnabledFromEnv, isModelReachable, isPromotionsBrainActive, isProviderReachable, judgeMeasuredFailure, loadAliasesFromBrain, loadArchetypePerfFromBrain, loadArchetypePerfNFromBrain, loadChainsFromBrain, loadModelsFromBrain, loadPricingFromBrain, mapMeasuredFailureRows, markAdvisoryResolved, markExclusionFindingHandled, markPromoteReadyHandled, parseJudgeVerdict, peekBrainDeadLetter, planDecomposition, prefetchMeasuredFailure, probeShadow, profileToRow, readBrainReadEnv, record, recordGoldenIr, recordOutcome, recordShadowProbe, renderIrForJudge, resetTokenizer, resolveConventionsForProfile, resolvePricingAt, resolveProviderKey, rowToAdvisory, rubricFor, runAdvisor, runGoldenEval, runStrategyEvalWithAttribution, setTokenizer, wilsonLowerBound, withAltBlindDisciplineContract, withAltDisciplineContract, withDisciplineContract };
|
|
4018
|
+
export { ABSOLUTE_FLOOR, type AISDKConvertedMessage, ALT_BLIND_TOKEN_BUDGET_BREACH, ALT_STRATEGY_IDS, ARCHETYPE_FAMILY_FITS, ARCHETYPE_FLOOR_DEFAULT, type ActionableAdvisory, Adapter, type AdvisoryEvidenceWindow, type AdvisoryResolutionSource, type AdvisorySeverity, type AdvisoryStatus, type AdvisorySuggestedFix, ApiKeys, type AppOracle, type ApplySectionRewritesArgs, type ApplySectionRewritesResult, ArchetypeConvention, type ArchetypeFamilyFit, type ArchetypePerfMap, type ArchetypePerfNMap, type ArchetypePerfScoreResult, type AttachCacheControlResult, BLOCKED_MODEL_FAMILY_SIBLING_SERVED_CODE, BLOCKED_MODEL_NOT_IN_ROSTER_CODE, BRAIN_READ_ENV_NAMES, BURST_SPAN_MS, BestPracticeAdvisory, type BrainConfig, type BrainDeadLetterEntry, type BrainHealthSnapshot, type BrainQueryConfig, type BrainReadEnv, COACH_CFG, COST_RANKING_REFERENCE_SHAPE, CallOptions, CallResult, ChainEntry, type CompatibilityIntent, type CompileForAISDKv6Result, type CompileOptions, CompilePolicy, CompileResult, CompiledRequest, type CreateDelegateOpts, DECOMPOSITION_TEMPLATES, DECOMPOSITION_TEMPLATES_VERSION, DEFAULT_FINDINGS_ENDPOINT, DEFAULT_MEASURED_FAILURE_ENDPOINT, DEFAULT_PROMOTIONS_ENDPOINT, DELEGATE_TOOL_DEFINITION, DISCIPLINE_GATES_V1_ALT_BLIND_HEADER, DISCIPLINE_GATES_V1_ALT_HEADER, type DecompositionPlan, type DecompositionStep, type DecompositionTemplate, type DelegateHandle, type DelegateRefusalReason, type DelegateResult, type DelegateToolArgs, type ExclusionFindingRow, type ExclusionResolutionSource, type ExecuteErr, type ExecuteOk, type ExecuteOptions, type ExecuteResult, type ExecutorCandidate, type FallbackPosture, FallbackReason, FamilyResolutionError, type GetActionableAdvisoriesOptions, type GetApplicablePromotionOpts, type GetDefaultFallbackChainOpts, type GetMeasuredFailureOpts, type GetPerAxisMetricsOpts, type GetRecommendedPrimaryOptions, type GoldenEvalAxis, type GoldenEvalCase, type GoldenEvalOptions, type GoldenEvalRunResult, type GoldenEvalStrategyId, type GoldenIrRecordInput, Grounding, IntentArchetypeName, JUDGE_RUBRICS, LIBRARY_VERSION, type LLMJudgeOptions, MEASURED_FAILURE_CFG, MEASURED_GROUNDING_MIN_N, type MarkAdvisoryResolvedOptions, type MarkExclusionFindingHandledOptions, type MarkPromoteReadyHandledOptions, type MeasuredFailureRuntime, type MeasuredFailureVerdict, type ModelBrainRow, type ModelCompatibility, ModelProfile, NormalizedResponse, type OracleContext, OracleScore, type OutcomePayload, OutcomeResult, OutputMode, PRODUCER_OWNED_RULE_CODES, PROVIDER_ENV_KEYS, PerAxisMetrics, type PlannedStep, type PricingRow, type ProbeShadowOptions, type ProbeShadowServed, type ProfileToRowOptions, type PromoteReadyFindingRow, type PromoteReadyResolution, type PromotionRow, type PromotionsRuntime, PromptIR, Provider, ProviderOverrides, type ProviderReachability, ROLLBACK_SUPPRESSION_WINDOW_DAYS, RULE_DISCIPLINE_GATES_V1, RULE_DISCIPLINE_GATES_V1_STRUCTURED, RULE_SEQUENTIAL_TOOL_CLIFF, type ReachabilityOpts, RecordInput, RecordOutcomeInput, type RunAdvisorPhase2Context, STRATEGY_AUTHORSHIP_INDEPENDENT, STRATEGY_AUTHORSHIP_LIMITATION, SectionRewrite, type ShadowProbeRecordInput, type StrategyAttribution, type StrategyAttributionResult, type StrategyOutcome, type SupportedProvider, type SurfaceFailureRow, type SurfaceStats, SystemModelMessage, TRANSLATOR_FLOOR, _testResetMeasuredFailure, _testResetPromotions, _testWaitForMeasuredFailureRefresh, _testWaitForPromotionsRefresh, altBlindGatesBlockFor, altGatesBlockFor, applyArchetypeConvention, applySectionRewrites, attachCacheControlToStreamTextInput, awaitMeasuredFailureReady, brainHealth, buildGoldenIrRow, buildLLMJudge, buildPairwiseJudgePrompt, buildShadowProbeRow, burstCaveat, call, chainProviderSpread, classifyEvidenceWindow, classifyStrategyOutcome, clearBrain, combineOrderSwappedVerdicts, compile, compileForAISDKv6, configureBrain, configureMeasuredFailureBrain, configurePromotionsBrain, countTokens, createDelegate, deriveFamilyFromModelId, deriveOwnership, estimateChainCostUsd, estimateModelCostUsd, execute, findBetterFit, flushBrainDeadLetter, formatEvidenceSpan, getActionableAdvisories, getAllStarterChains, getAllStarterChainsWithGrounding, getApplicablePromotion, getArchetypePerfScore, getDefaultFallbackChain, getDefaultFallbackChainWithGrounding, getMeasuredFailureVerdict, getModelCompatibility, getPerAxisMetrics, getReachabilityDiagnostic, getRecentRollback, getRecommendedPrimary, getSequentialStarterChain, getSequentialStarterChainWithGrounding, getStaleExclusionFindings, getStarterChain, getStarterChainWithGrounding, isAltStrategy, isAutoPromoteEnabledFromEnv, isBrainQueryActiveFor, isBrainSync, isDelegateEnabledFromEnv, isExclusionFindingsBrainActive, isMeasuredFailureBrainActive, isMeasuredFailureGateEnabledFromEnv, isModelReachable, isPromotionsBrainActive, isProviderReachable, judgeMeasuredFailure, loadAliasesFromBrain, loadArchetypePerfFromBrain, loadArchetypePerfNFromBrain, loadChainsFromBrain, loadModelsFromBrain, loadPricingFromBrain, mapMeasuredFailureRows, markAdvisoryResolved, markExclusionFindingHandled, markPromoteReadyHandled, parseJudgeVerdict, peekBrainDeadLetter, planDecomposition, prefetchMeasuredFailure, probeShadow, profileToRow, readBrainReadEnv, record, recordGoldenIr, recordOutcome, recordShadowProbe, renderIrForJudge, resetTokenizer, resolveConventionsForProfile, resolvePricingAt, resolveProviderKey, rowToAdvisory, rubricFor, runAdvisor, runGoldenEval, runStrategyEvalWithAttribution, setTokenizer, wilsonLowerBound, withAltBlindDisciplineContract, withAltDisciplineContract, withDisciplineContract };
|