@warmdrift/kgauto-compiler 2.0.0-alpha.75 → 2.0.0-alpha.77

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.
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var LIBRARY_VERSION = "2.0.0-alpha.75";
2
+ var LIBRARY_VERSION = "2.0.0-alpha.77";
3
3
 
4
4
  // src/key-health.ts
5
5
  var JSON_HEADERS = { "Content-Type": "application/json" };
@@ -1,6 +1,6 @@
1
- import { G as GlassboxEvent } from '../types-BgJ5iQB_.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-BgJ5iQB_.mjs';
3
- import '../ir-CZukZvDn.mjs';
1
+ import { G as GlassboxEvent } from '../types-Caq-hOIj.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-Caq-hOIj.mjs';
3
+ import '../ir-CRV1_taF.mjs';
4
4
  import '../dialect.mjs';
5
5
 
6
6
  /**
@@ -1,6 +1,6 @@
1
- import { G as GlassboxEvent } from '../types-D-PuKCWk.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-D-PuKCWk.js';
3
- import '../ir-B0v2f9NY.js';
1
+ import { G as GlassboxEvent } from '../types-C5BX9bzi.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-C5BX9bzi.js';
3
+ import '../ir-C02EIElQ.js';
4
4
  import '../dialect.js';
5
5
 
6
6
  /**
@@ -1,5 +1,5 @@
1
- import { T as TraceHealth } from '../types-BOTLfJOp.mjs';
2
- import '../ir-CZukZvDn.mjs';
1
+ import { T as TraceHealth } from '../types-3WdGMqin.mjs';
2
+ import '../ir-CRV1_taF.mjs';
3
3
  import '../dialect.mjs';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
- import { T as TraceHealth } from '../types-Ba68lIs1.js';
2
- import '../ir-B0v2f9NY.js';
1
+ import { T as TraceHealth } from '../types-CkRvjxrI.js';
2
+ import '../ir-C02EIElQ.js';
3
3
  import '../dialect.js';
4
4
 
5
5
  /**
@@ -1,7 +1,7 @@
1
- import { G as GlassboxEvent } from '../types-BgJ5iQB_.mjs';
2
- import { a as TraceDetail, b as TraceSummary, c as TraceCounterfactual } from '../types-BOTLfJOp.mjs';
3
- export { A as AdvisoryRecord, T as TraceHealth, d as TraceSectionRewrite } from '../types-BOTLfJOp.mjs';
4
- import '../ir-CZukZvDn.mjs';
1
+ import { G as GlassboxEvent } from '../types-Caq-hOIj.mjs';
2
+ import { a as TraceDetail, b as TraceSummary, c as TraceCounterfactual } from '../types-3WdGMqin.mjs';
3
+ export { A as AdvisoryRecord, T as TraceHealth, d as TraceSectionRewrite } from '../types-3WdGMqin.mjs';
4
+ import '../ir-CRV1_taF.mjs';
5
5
  import '../dialect.mjs';
6
6
 
7
7
  /**
@@ -1,7 +1,7 @@
1
- import { G as GlassboxEvent } from '../types-D-PuKCWk.js';
2
- import { a as TraceDetail, b as TraceSummary, c as TraceCounterfactual } from '../types-Ba68lIs1.js';
3
- export { A as AdvisoryRecord, T as TraceHealth, d as TraceSectionRewrite } from '../types-Ba68lIs1.js';
4
- import '../ir-B0v2f9NY.js';
1
+ import { G as GlassboxEvent } from '../types-C5BX9bzi.js';
2
+ import { a as TraceDetail, b as TraceSummary, c as TraceCounterfactual } from '../types-CkRvjxrI.js';
3
+ export { A as AdvisoryRecord, T as TraceHealth, d as TraceSectionRewrite } from '../types-CkRvjxrI.js';
4
+ import '../ir-C02EIElQ.js';
5
5
  import '../dialect.js';
6
6
 
7
7
  /**
@@ -2249,6 +2249,7 @@ var CACHE_RATIO_YELLOW = 0.1;
2249
2249
  var FALLBACK_REASONS = /* @__PURE__ */ new Set([
2250
2250
  "rate_limit",
2251
2251
  "provider_auth_failed",
2252
+ "provider_billing_exhausted",
2252
2253
  "provider_error",
2253
2254
  "cliff",
2254
2255
  "cost_cap",
@@ -237,6 +237,7 @@ var CACHE_RATIO_YELLOW = 0.1;
237
237
  var FALLBACK_REASONS = /* @__PURE__ */ new Set([
238
238
  "rate_limit",
239
239
  "provider_auth_failed",
240
+ "provider_billing_exhausted",
240
241
  "provider_error",
241
242
  "cliff",
242
243
  "cost_cap",
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { a as TraceDetail } from '../../types-BOTLfJOp.mjs';
3
- import '../../ir-CZukZvDn.mjs';
2
+ import { a as TraceDetail } from '../../types-3WdGMqin.mjs';
3
+ import '../../ir-CRV1_taF.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-Ba68lIs1.js';
3
- import '../../ir-B0v2f9NY.js';
2
+ import { a as TraceDetail } from '../../types-CkRvjxrI.js';
3
+ import '../../ir-C02EIElQ.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-CZukZvDn.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-CZukZvDn.mjs';
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-CRV1_taF.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 parseGoldenCaptureRate, K as resolveGoldenCaptureRate, L as shouldCaptureGolden } from './ir-CRV1_taF.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';
@@ -656,7 +656,7 @@ interface OutcomePayload {
656
656
  history_depth?: number;
657
657
  system_prompt_chars?: number;
658
658
  fell_over_from?: string;
659
- fallback_reason?: 'rate_limit' | 'provider_auth_failed' | 'provider_error' | 'cliff' | 'cost_cap' | 'contract_violation';
659
+ fallback_reason?: FallbackReason;
660
660
  /**
661
661
  * alpha.71 (migration 044) — the precise `errorCode` behind
662
662
  * `fallback_reason`. Key OMITTED when no fallback fired, so brains that
@@ -1119,7 +1119,7 @@ declare function runStrategyEvalWithAttribution(opts: Omit<GoldenEvalOptions, 'a
1119
1119
  * guard in `tests/version.test.ts` fails the suite (and therefore
1120
1120
  * `prepublishOnly`) when they diverge — a stale constant cannot reach npm.
1121
1121
  */
1122
- declare const LIBRARY_VERSION = "2.0.0-alpha.75";
1122
+ declare const LIBRARY_VERSION = "2.0.0-alpha.77";
1123
1123
 
1124
1124
  /**
1125
1125
  * Oracle contract — how an app tells the brain whether a response was good.
@@ -3222,6 +3222,142 @@ declare function getMeasuredFailureVerdict(opts: GetMeasuredFailureOpts): Measur
3222
3222
  declare function _testResetMeasuredFailure(): void;
3223
3223
  declare function _testWaitForMeasuredFailureRefresh(): Promise<void>;
3224
3224
 
3225
+ /**
3226
+ * Release C (Rung 1) — the decomposition coach's planning engine.
3227
+ *
3228
+ * Design contract §5.1: evidence-backed advisories on the existing surface —
3229
+ * "you're paying frontier prices for grunt work; here's the measured split."
3230
+ * No contract change; nothing here executes a fan-out. This module is PURE:
3231
+ * templates + arithmetic. The operator script feeds it measured surface
3232
+ * stats and evidence-picked executors; Release D's `delegate` primitive will
3233
+ * consume the SAME templates, so they live in the library, versioned.
3234
+ *
3235
+ * Honesty posture (the roster-with-receipts rule, applied to ourselves):
3236
+ *
3237
+ * - The per-step token SHARES are JUDGMENT v1 numbers — labelled as such
3238
+ * in every plan (`assumptions[]`), versioned so a future measured
3239
+ * replacement invalidates nothing silently. No consumer has fan-out
3240
+ * traffic yet (R0 shipped alpha.68, zero adopters), so there is nothing
3241
+ * to measure them from; the moment branch traffic exists, these
3242
+ * graduate per surface.
3243
+ * - Executor grounding is carried per step: 'measured' when the portfolio
3244
+ * corpus has real outcomes for (model, sub-archetype), 'judgment' when
3245
+ * the roster's archetypePerf is all we have.
3246
+ * - The coach's most credible output at low volume is "KEEP THE MONOLITH"
3247
+ * with the break-even volume stated — the never-worse floor in coach
3248
+ * form. The advisory only files when the split is MATERIAL (same $5/mo
3249
+ * felt-utility floor as promotions); the demo report renders every
3250
+ * analysis either way.
3251
+ */
3252
+
3253
+ declare const DECOMPOSITION_TEMPLATES_VERSION = "decomposition-templates-v1";
3254
+ interface DecompositionStep {
3255
+ /** Human-readable step name (stable — appears in advisories/recipes). */
3256
+ role: string;
3257
+ /** The sub-archetype this step runs as (its own learning_key downstream). */
3258
+ archetype: IntentArchetypeName;
3259
+ /**
3260
+ * Which tier runs the step. 'delegate' steps are the grunt work the coach
3261
+ * proposes moving to a cheap executor; 'anchor' steps stay on the
3262
+ * incumbent (composition is where fan-outs die — §7a — so the composer
3263
+ * anchors on the strong model by design).
3264
+ */
3265
+ tier: 'delegate' | 'anchor';
3266
+ /** Share of the monolith's INPUT tokens this step reads. JUDGMENT v1. */
3267
+ inputShare: number;
3268
+ /**
3269
+ * Tokens this step EMITS, as a share of the monolith's input (for
3270
+ * intermediate artifacts like extraction notes) — the next anchor step
3271
+ * reads these instead of the raw input. JUDGMENT v1.
3272
+ */
3273
+ emitsShareOfInput: number;
3274
+ /** Share of the monolith's OUTPUT tokens this step produces (0 for
3275
+ * intermediate steps; the anchor composer typically carries 1). */
3276
+ outputShare: number;
3277
+ }
3278
+ interface DecompositionTemplate {
3279
+ archetype: IntentArchetypeName;
3280
+ steps: DecompositionStep[];
3281
+ rationale: string;
3282
+ version: typeof DECOMPOSITION_TEMPLATES_VERSION;
3283
+ }
3284
+ /**
3285
+ * v1 covers the three judgment-heavy archetypes with a clear split shape.
3286
+ * Every share number below is a judgment estimate, stated in the plan's
3287
+ * assumptions — they exist to make the ARITHMETIC honest, not to claim
3288
+ * precision the corpus doesn't have yet.
3289
+ */
3290
+ declare const DECOMPOSITION_TEMPLATES: Partial<Record<IntentArchetypeName, DecompositionTemplate>>;
3291
+ interface SurfaceStats {
3292
+ appId: string;
3293
+ archetype: IntentArchetypeName | string;
3294
+ /** The model serving the monolith today (most-served in the window). */
3295
+ incumbentModel: string;
3296
+ nCalls: number;
3297
+ windowDays: number;
3298
+ avgTokensIn: number;
3299
+ avgTokensOut: number;
3300
+ }
3301
+ interface ExecutorCandidate {
3302
+ modelId: string;
3303
+ /** archetypePerf score on the STEP's archetype. */
3304
+ perfScore: number;
3305
+ grounding: 'measured' | 'judgment';
3306
+ costInputPer1m: number;
3307
+ costOutputPer1m: number;
3308
+ }
3309
+ interface ModelPricing {
3310
+ costInputPer1m: number;
3311
+ costOutputPer1m: number;
3312
+ }
3313
+ interface PlannedStep extends DecompositionStep {
3314
+ /** The picked executor ('delegate' steps) or the incumbent ('anchor'). */
3315
+ executorModel: string;
3316
+ executorGrounding: 'measured' | 'judgment';
3317
+ executorPerfScore: number | null;
3318
+ projectedCostPerCallUsd: number;
3319
+ }
3320
+ interface DecompositionPlan {
3321
+ appId: string;
3322
+ archetype: string;
3323
+ incumbentModel: string;
3324
+ template: DecompositionTemplate;
3325
+ steps: PlannedStep[];
3326
+ monolithCostPerCallUsd: number;
3327
+ splitCostPerCallUsd: number;
3328
+ savingPerCallUsd: number;
3329
+ monthlyCalls: number;
3330
+ projectedMonthlySavingUsd: number;
3331
+ /** Monthly calls at which the split clears the materiality floor. null
3332
+ * when the split doesn't save per-call at all (then no volume helps). */
3333
+ breakEvenMonthlyCalls: number | null;
3334
+ verdict: 'split-pays' | 'keep-monolith';
3335
+ verdictReason: string;
3336
+ /** Judgment inputs, stated. Every number that is not measured is here. */
3337
+ assumptions: string[];
3338
+ }
3339
+ declare const COACH_CFG: {
3340
+ /** Same felt-utility floor as promotions (alpha.67 family). */
3341
+ minMonthlySavingUsd: number;
3342
+ /** Executor must clear this archetypePerf on the step's archetype —
3343
+ * same floor as the translator/advisor (ARCHETYPE_FLOOR_DEFAULT). */
3344
+ executorPerfFloor: number;
3345
+ daysPerMonth: number;
3346
+ };
3347
+ interface PlanDecompositionArgs {
3348
+ stats: SurfaceStats;
3349
+ incumbentPricing: ModelPricing;
3350
+ /**
3351
+ * Evidence-picked executor per step archetype. Return undefined when no
3352
+ * candidate clears the perf floor — the plan then keeps that step on the
3353
+ * incumbent and says so (a coach must not route grunt work to a model
3354
+ * that can't do it just because it is cheap).
3355
+ */
3356
+ pickExecutor: (archetype: IntentArchetypeName) => ExecutorCandidate | undefined;
3357
+ cfg?: Partial<typeof COACH_CFG>;
3358
+ }
3359
+ declare function planDecomposition(args: PlanDecompositionArgs): DecompositionPlan | undefined;
3360
+
3225
3361
  /**
3226
3362
  * @warmdrift/kgauto v2 — prompt compiler + central learning brain.
3227
3363
  *
@@ -3268,4 +3404,4 @@ declare function _testWaitForMeasuredFailureRefresh(): Promise<void>;
3268
3404
  */
3269
3405
  declare function compile(ir: PromptIR, opts?: CompileOptions): CompileResult;
3270
3406
 
3271
- export { ABSOLUTE_FLOOR, type AISDKConvertedMessage, ARCHETYPE_FAMILY_FITS, ARCHETYPE_FLOOR_DEFAULT, type ActionableAdvisory, Adapter, 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, BestPracticeAdvisory, type BrainConfig, type BrainDeadLetterEntry, type BrainHealthSnapshot, type BrainQueryConfig, type BrainReadEnv, CallOptions, CallResult, ChainEntry, type CompatibilityIntent, type CompileForAISDKv6Result, type CompileOptions, CompilePolicy, CompileResult, CompiledRequest, DEFAULT_FINDINGS_ENDPOINT, DEFAULT_MEASURED_FAILURE_ENDPOINT, DEFAULT_PROMOTIONS_ENDPOINT, DISCIPLINE_GATES_V1_ALT_HEADER, type ExclusionFindingRow, type ExclusionResolutionSource, type ExecuteErr, type ExecuteOk, type ExecuteOptions, type ExecuteResult, type FallbackPosture, 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 PricingRow, type ProbeShadowOptions, type ProbeShadowServed, type ProfileToRowOptions, type PromoteReadyFindingRow, type PromoteReadyResolution, type PromotionRow, type PromotionsRuntime, PromptIR, Provider, ProviderOverrides, type ProviderReachability, RULE_DISCIPLINE_GATES_V1, RULE_DISCIPLINE_GATES_V1_STRUCTURED, RULE_SEQUENTIAL_TOOL_CLIFF, type ReachabilityOpts, RecordInput, RecordOutcomeInput, type RunAdvisorPhase2Context, STRATEGY_AUTHORSHIP_LIMITATION, SectionRewrite, type ShadowProbeRecordInput, type StrategyAttribution, type StrategyAttributionResult, type StrategyOutcome, type SupportedProvider, type SurfaceFailureRow, SystemModelMessage, TRANSLATOR_FLOOR, _testResetMeasuredFailure, _testResetPromotions, _testWaitForMeasuredFailureRefresh, _testWaitForPromotionsRefresh, altGatesBlockFor, applyArchetypeConvention, applySectionRewrites, attachCacheControlToStreamTextInput, awaitMeasuredFailureReady, brainHealth, buildGoldenIrRow, buildLLMJudge, buildPairwiseJudgePrompt, buildShadowProbeRow, call, classifyStrategyOutcome, clearBrain, combineOrderSwappedVerdicts, compile, compileForAISDKv6, configureBrain, configureMeasuredFailureBrain, configurePromotionsBrain, countTokens, deriveFamilyFromModelId, deriveOwnership, execute, findBetterFit, flushBrainDeadLetter, getActionableAdvisories, getAllStarterChains, getAllStarterChainsWithGrounding, getApplicablePromotion, getArchetypePerfScore, getDefaultFallbackChain, getDefaultFallbackChainWithGrounding, getMeasuredFailureVerdict, getModelCompatibility, getPerAxisMetrics, getReachabilityDiagnostic, getRecommendedPrimary, getSequentialStarterChain, getSequentialStarterChainWithGrounding, getStaleExclusionFindings, getStarterChain, getStarterChainWithGrounding, isAutoPromoteEnabledFromEnv, isBrainQueryActiveFor, isBrainSync, isExclusionFindingsBrainActive, isMeasuredFailureBrainActive, isMeasuredFailureGateEnabledFromEnv, isModelReachable, isPromotionsBrainActive, isProviderReachable, judgeMeasuredFailure, loadAliasesFromBrain, loadArchetypePerfFromBrain, loadArchetypePerfNFromBrain, loadChainsFromBrain, loadModelsFromBrain, loadPricingFromBrain, markAdvisoryResolved, markExclusionFindingHandled, markPromoteReadyHandled, parseJudgeVerdict, peekBrainDeadLetter, prefetchMeasuredFailure, probeShadow, profileToRow, readBrainReadEnv, record, recordGoldenIr, recordOutcome, recordShadowProbe, renderIrForJudge, resetTokenizer, resolveConventionsForProfile, resolvePricingAt, resolveProviderKey, rubricFor, runAdvisor, runGoldenEval, runStrategyEvalWithAttribution, setTokenizer, wilsonLowerBound, withAltDisciplineContract, withDisciplineContract };
3407
+ export { ABSOLUTE_FLOOR, type AISDKConvertedMessage, ARCHETYPE_FAMILY_FITS, ARCHETYPE_FLOOR_DEFAULT, type ActionableAdvisory, Adapter, 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, BestPracticeAdvisory, type BrainConfig, type BrainDeadLetterEntry, type BrainHealthSnapshot, type BrainQueryConfig, type BrainReadEnv, COACH_CFG, CallOptions, CallResult, ChainEntry, type CompatibilityIntent, type CompileForAISDKv6Result, type CompileOptions, CompilePolicy, CompileResult, CompiledRequest, DECOMPOSITION_TEMPLATES, DECOMPOSITION_TEMPLATES_VERSION, DEFAULT_FINDINGS_ENDPOINT, DEFAULT_MEASURED_FAILURE_ENDPOINT, DEFAULT_PROMOTIONS_ENDPOINT, DISCIPLINE_GATES_V1_ALT_HEADER, type DecompositionPlan, type DecompositionStep, type DecompositionTemplate, 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, RULE_DISCIPLINE_GATES_V1, RULE_DISCIPLINE_GATES_V1_STRUCTURED, RULE_SEQUENTIAL_TOOL_CLIFF, type ReachabilityOpts, RecordInput, RecordOutcomeInput, type RunAdvisorPhase2Context, 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, altGatesBlockFor, applyArchetypeConvention, applySectionRewrites, attachCacheControlToStreamTextInput, awaitMeasuredFailureReady, brainHealth, buildGoldenIrRow, buildLLMJudge, buildPairwiseJudgePrompt, buildShadowProbeRow, call, classifyStrategyOutcome, clearBrain, combineOrderSwappedVerdicts, compile, compileForAISDKv6, configureBrain, configureMeasuredFailureBrain, configurePromotionsBrain, countTokens, deriveFamilyFromModelId, deriveOwnership, execute, findBetterFit, flushBrainDeadLetter, getActionableAdvisories, getAllStarterChains, getAllStarterChainsWithGrounding, getApplicablePromotion, getArchetypePerfScore, getDefaultFallbackChain, getDefaultFallbackChainWithGrounding, getMeasuredFailureVerdict, getModelCompatibility, getPerAxisMetrics, getReachabilityDiagnostic, getRecommendedPrimary, getSequentialStarterChain, getSequentialStarterChainWithGrounding, getStaleExclusionFindings, getStarterChain, getStarterChainWithGrounding, isAutoPromoteEnabledFromEnv, isBrainQueryActiveFor, isBrainSync, isExclusionFindingsBrainActive, isMeasuredFailureBrainActive, isMeasuredFailureGateEnabledFromEnv, isModelReachable, isPromotionsBrainActive, isProviderReachable, judgeMeasuredFailure, loadAliasesFromBrain, loadArchetypePerfFromBrain, loadArchetypePerfNFromBrain, loadChainsFromBrain, loadModelsFromBrain, loadPricingFromBrain, markAdvisoryResolved, markExclusionFindingHandled, markPromoteReadyHandled, parseJudgeVerdict, peekBrainDeadLetter, planDecomposition, prefetchMeasuredFailure, probeShadow, profileToRow, readBrainReadEnv, record, recordGoldenIr, recordOutcome, recordShadowProbe, renderIrForJudge, resetTokenizer, resolveConventionsForProfile, resolvePricingAt, resolveProviderKey, rubricFor, runAdvisor, runGoldenEval, runStrategyEvalWithAttribution, setTokenizer, wilsonLowerBound, withAltDisciplineContract, withDisciplineContract };
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-B0v2f9NY.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-B0v2f9NY.js';
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-C02EIElQ.js';
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 parseGoldenCaptureRate, K as resolveGoldenCaptureRate, L as shouldCaptureGolden } from './ir-C02EIElQ.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';
@@ -656,7 +656,7 @@ interface OutcomePayload {
656
656
  history_depth?: number;
657
657
  system_prompt_chars?: number;
658
658
  fell_over_from?: string;
659
- fallback_reason?: 'rate_limit' | 'provider_auth_failed' | 'provider_error' | 'cliff' | 'cost_cap' | 'contract_violation';
659
+ fallback_reason?: FallbackReason;
660
660
  /**
661
661
  * alpha.71 (migration 044) — the precise `errorCode` behind
662
662
  * `fallback_reason`. Key OMITTED when no fallback fired, so brains that
@@ -1119,7 +1119,7 @@ declare function runStrategyEvalWithAttribution(opts: Omit<GoldenEvalOptions, 'a
1119
1119
  * guard in `tests/version.test.ts` fails the suite (and therefore
1120
1120
  * `prepublishOnly`) when they diverge — a stale constant cannot reach npm.
1121
1121
  */
1122
- declare const LIBRARY_VERSION = "2.0.0-alpha.75";
1122
+ declare const LIBRARY_VERSION = "2.0.0-alpha.77";
1123
1123
 
1124
1124
  /**
1125
1125
  * Oracle contract — how an app tells the brain whether a response was good.
@@ -3222,6 +3222,142 @@ declare function getMeasuredFailureVerdict(opts: GetMeasuredFailureOpts): Measur
3222
3222
  declare function _testResetMeasuredFailure(): void;
3223
3223
  declare function _testWaitForMeasuredFailureRefresh(): Promise<void>;
3224
3224
 
3225
+ /**
3226
+ * Release C (Rung 1) — the decomposition coach's planning engine.
3227
+ *
3228
+ * Design contract §5.1: evidence-backed advisories on the existing surface —
3229
+ * "you're paying frontier prices for grunt work; here's the measured split."
3230
+ * No contract change; nothing here executes a fan-out. This module is PURE:
3231
+ * templates + arithmetic. The operator script feeds it measured surface
3232
+ * stats and evidence-picked executors; Release D's `delegate` primitive will
3233
+ * consume the SAME templates, so they live in the library, versioned.
3234
+ *
3235
+ * Honesty posture (the roster-with-receipts rule, applied to ourselves):
3236
+ *
3237
+ * - The per-step token SHARES are JUDGMENT v1 numbers — labelled as such
3238
+ * in every plan (`assumptions[]`), versioned so a future measured
3239
+ * replacement invalidates nothing silently. No consumer has fan-out
3240
+ * traffic yet (R0 shipped alpha.68, zero adopters), so there is nothing
3241
+ * to measure them from; the moment branch traffic exists, these
3242
+ * graduate per surface.
3243
+ * - Executor grounding is carried per step: 'measured' when the portfolio
3244
+ * corpus has real outcomes for (model, sub-archetype), 'judgment' when
3245
+ * the roster's archetypePerf is all we have.
3246
+ * - The coach's most credible output at low volume is "KEEP THE MONOLITH"
3247
+ * with the break-even volume stated — the never-worse floor in coach
3248
+ * form. The advisory only files when the split is MATERIAL (same $5/mo
3249
+ * felt-utility floor as promotions); the demo report renders every
3250
+ * analysis either way.
3251
+ */
3252
+
3253
+ declare const DECOMPOSITION_TEMPLATES_VERSION = "decomposition-templates-v1";
3254
+ interface DecompositionStep {
3255
+ /** Human-readable step name (stable — appears in advisories/recipes). */
3256
+ role: string;
3257
+ /** The sub-archetype this step runs as (its own learning_key downstream). */
3258
+ archetype: IntentArchetypeName;
3259
+ /**
3260
+ * Which tier runs the step. 'delegate' steps are the grunt work the coach
3261
+ * proposes moving to a cheap executor; 'anchor' steps stay on the
3262
+ * incumbent (composition is where fan-outs die — §7a — so the composer
3263
+ * anchors on the strong model by design).
3264
+ */
3265
+ tier: 'delegate' | 'anchor';
3266
+ /** Share of the monolith's INPUT tokens this step reads. JUDGMENT v1. */
3267
+ inputShare: number;
3268
+ /**
3269
+ * Tokens this step EMITS, as a share of the monolith's input (for
3270
+ * intermediate artifacts like extraction notes) — the next anchor step
3271
+ * reads these instead of the raw input. JUDGMENT v1.
3272
+ */
3273
+ emitsShareOfInput: number;
3274
+ /** Share of the monolith's OUTPUT tokens this step produces (0 for
3275
+ * intermediate steps; the anchor composer typically carries 1). */
3276
+ outputShare: number;
3277
+ }
3278
+ interface DecompositionTemplate {
3279
+ archetype: IntentArchetypeName;
3280
+ steps: DecompositionStep[];
3281
+ rationale: string;
3282
+ version: typeof DECOMPOSITION_TEMPLATES_VERSION;
3283
+ }
3284
+ /**
3285
+ * v1 covers the three judgment-heavy archetypes with a clear split shape.
3286
+ * Every share number below is a judgment estimate, stated in the plan's
3287
+ * assumptions — they exist to make the ARITHMETIC honest, not to claim
3288
+ * precision the corpus doesn't have yet.
3289
+ */
3290
+ declare const DECOMPOSITION_TEMPLATES: Partial<Record<IntentArchetypeName, DecompositionTemplate>>;
3291
+ interface SurfaceStats {
3292
+ appId: string;
3293
+ archetype: IntentArchetypeName | string;
3294
+ /** The model serving the monolith today (most-served in the window). */
3295
+ incumbentModel: string;
3296
+ nCalls: number;
3297
+ windowDays: number;
3298
+ avgTokensIn: number;
3299
+ avgTokensOut: number;
3300
+ }
3301
+ interface ExecutorCandidate {
3302
+ modelId: string;
3303
+ /** archetypePerf score on the STEP's archetype. */
3304
+ perfScore: number;
3305
+ grounding: 'measured' | 'judgment';
3306
+ costInputPer1m: number;
3307
+ costOutputPer1m: number;
3308
+ }
3309
+ interface ModelPricing {
3310
+ costInputPer1m: number;
3311
+ costOutputPer1m: number;
3312
+ }
3313
+ interface PlannedStep extends DecompositionStep {
3314
+ /** The picked executor ('delegate' steps) or the incumbent ('anchor'). */
3315
+ executorModel: string;
3316
+ executorGrounding: 'measured' | 'judgment';
3317
+ executorPerfScore: number | null;
3318
+ projectedCostPerCallUsd: number;
3319
+ }
3320
+ interface DecompositionPlan {
3321
+ appId: string;
3322
+ archetype: string;
3323
+ incumbentModel: string;
3324
+ template: DecompositionTemplate;
3325
+ steps: PlannedStep[];
3326
+ monolithCostPerCallUsd: number;
3327
+ splitCostPerCallUsd: number;
3328
+ savingPerCallUsd: number;
3329
+ monthlyCalls: number;
3330
+ projectedMonthlySavingUsd: number;
3331
+ /** Monthly calls at which the split clears the materiality floor. null
3332
+ * when the split doesn't save per-call at all (then no volume helps). */
3333
+ breakEvenMonthlyCalls: number | null;
3334
+ verdict: 'split-pays' | 'keep-monolith';
3335
+ verdictReason: string;
3336
+ /** Judgment inputs, stated. Every number that is not measured is here. */
3337
+ assumptions: string[];
3338
+ }
3339
+ declare const COACH_CFG: {
3340
+ /** Same felt-utility floor as promotions (alpha.67 family). */
3341
+ minMonthlySavingUsd: number;
3342
+ /** Executor must clear this archetypePerf on the step's archetype —
3343
+ * same floor as the translator/advisor (ARCHETYPE_FLOOR_DEFAULT). */
3344
+ executorPerfFloor: number;
3345
+ daysPerMonth: number;
3346
+ };
3347
+ interface PlanDecompositionArgs {
3348
+ stats: SurfaceStats;
3349
+ incumbentPricing: ModelPricing;
3350
+ /**
3351
+ * Evidence-picked executor per step archetype. Return undefined when no
3352
+ * candidate clears the perf floor — the plan then keeps that step on the
3353
+ * incumbent and says so (a coach must not route grunt work to a model
3354
+ * that can't do it just because it is cheap).
3355
+ */
3356
+ pickExecutor: (archetype: IntentArchetypeName) => ExecutorCandidate | undefined;
3357
+ cfg?: Partial<typeof COACH_CFG>;
3358
+ }
3359
+ declare function planDecomposition(args: PlanDecompositionArgs): DecompositionPlan | undefined;
3360
+
3225
3361
  /**
3226
3362
  * @warmdrift/kgauto v2 — prompt compiler + central learning brain.
3227
3363
  *
@@ -3268,4 +3404,4 @@ declare function _testWaitForMeasuredFailureRefresh(): Promise<void>;
3268
3404
  */
3269
3405
  declare function compile(ir: PromptIR, opts?: CompileOptions): CompileResult;
3270
3406
 
3271
- export { ABSOLUTE_FLOOR, type AISDKConvertedMessage, ARCHETYPE_FAMILY_FITS, ARCHETYPE_FLOOR_DEFAULT, type ActionableAdvisory, Adapter, 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, BestPracticeAdvisory, type BrainConfig, type BrainDeadLetterEntry, type BrainHealthSnapshot, type BrainQueryConfig, type BrainReadEnv, CallOptions, CallResult, ChainEntry, type CompatibilityIntent, type CompileForAISDKv6Result, type CompileOptions, CompilePolicy, CompileResult, CompiledRequest, DEFAULT_FINDINGS_ENDPOINT, DEFAULT_MEASURED_FAILURE_ENDPOINT, DEFAULT_PROMOTIONS_ENDPOINT, DISCIPLINE_GATES_V1_ALT_HEADER, type ExclusionFindingRow, type ExclusionResolutionSource, type ExecuteErr, type ExecuteOk, type ExecuteOptions, type ExecuteResult, type FallbackPosture, 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 PricingRow, type ProbeShadowOptions, type ProbeShadowServed, type ProfileToRowOptions, type PromoteReadyFindingRow, type PromoteReadyResolution, type PromotionRow, type PromotionsRuntime, PromptIR, Provider, ProviderOverrides, type ProviderReachability, RULE_DISCIPLINE_GATES_V1, RULE_DISCIPLINE_GATES_V1_STRUCTURED, RULE_SEQUENTIAL_TOOL_CLIFF, type ReachabilityOpts, RecordInput, RecordOutcomeInput, type RunAdvisorPhase2Context, STRATEGY_AUTHORSHIP_LIMITATION, SectionRewrite, type ShadowProbeRecordInput, type StrategyAttribution, type StrategyAttributionResult, type StrategyOutcome, type SupportedProvider, type SurfaceFailureRow, SystemModelMessage, TRANSLATOR_FLOOR, _testResetMeasuredFailure, _testResetPromotions, _testWaitForMeasuredFailureRefresh, _testWaitForPromotionsRefresh, altGatesBlockFor, applyArchetypeConvention, applySectionRewrites, attachCacheControlToStreamTextInput, awaitMeasuredFailureReady, brainHealth, buildGoldenIrRow, buildLLMJudge, buildPairwiseJudgePrompt, buildShadowProbeRow, call, classifyStrategyOutcome, clearBrain, combineOrderSwappedVerdicts, compile, compileForAISDKv6, configureBrain, configureMeasuredFailureBrain, configurePromotionsBrain, countTokens, deriveFamilyFromModelId, deriveOwnership, execute, findBetterFit, flushBrainDeadLetter, getActionableAdvisories, getAllStarterChains, getAllStarterChainsWithGrounding, getApplicablePromotion, getArchetypePerfScore, getDefaultFallbackChain, getDefaultFallbackChainWithGrounding, getMeasuredFailureVerdict, getModelCompatibility, getPerAxisMetrics, getReachabilityDiagnostic, getRecommendedPrimary, getSequentialStarterChain, getSequentialStarterChainWithGrounding, getStaleExclusionFindings, getStarterChain, getStarterChainWithGrounding, isAutoPromoteEnabledFromEnv, isBrainQueryActiveFor, isBrainSync, isExclusionFindingsBrainActive, isMeasuredFailureBrainActive, isMeasuredFailureGateEnabledFromEnv, isModelReachable, isPromotionsBrainActive, isProviderReachable, judgeMeasuredFailure, loadAliasesFromBrain, loadArchetypePerfFromBrain, loadArchetypePerfNFromBrain, loadChainsFromBrain, loadModelsFromBrain, loadPricingFromBrain, markAdvisoryResolved, markExclusionFindingHandled, markPromoteReadyHandled, parseJudgeVerdict, peekBrainDeadLetter, prefetchMeasuredFailure, probeShadow, profileToRow, readBrainReadEnv, record, recordGoldenIr, recordOutcome, recordShadowProbe, renderIrForJudge, resetTokenizer, resolveConventionsForProfile, resolvePricingAt, resolveProviderKey, rubricFor, runAdvisor, runGoldenEval, runStrategyEvalWithAttribution, setTokenizer, wilsonLowerBound, withAltDisciplineContract, withDisciplineContract };
3407
+ export { ABSOLUTE_FLOOR, type AISDKConvertedMessage, ARCHETYPE_FAMILY_FITS, ARCHETYPE_FLOOR_DEFAULT, type ActionableAdvisory, Adapter, 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, BestPracticeAdvisory, type BrainConfig, type BrainDeadLetterEntry, type BrainHealthSnapshot, type BrainQueryConfig, type BrainReadEnv, COACH_CFG, CallOptions, CallResult, ChainEntry, type CompatibilityIntent, type CompileForAISDKv6Result, type CompileOptions, CompilePolicy, CompileResult, CompiledRequest, DECOMPOSITION_TEMPLATES, DECOMPOSITION_TEMPLATES_VERSION, DEFAULT_FINDINGS_ENDPOINT, DEFAULT_MEASURED_FAILURE_ENDPOINT, DEFAULT_PROMOTIONS_ENDPOINT, DISCIPLINE_GATES_V1_ALT_HEADER, type DecompositionPlan, type DecompositionStep, type DecompositionTemplate, 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, RULE_DISCIPLINE_GATES_V1, RULE_DISCIPLINE_GATES_V1_STRUCTURED, RULE_SEQUENTIAL_TOOL_CLIFF, type ReachabilityOpts, RecordInput, RecordOutcomeInput, type RunAdvisorPhase2Context, 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, altGatesBlockFor, applyArchetypeConvention, applySectionRewrites, attachCacheControlToStreamTextInput, awaitMeasuredFailureReady, brainHealth, buildGoldenIrRow, buildLLMJudge, buildPairwiseJudgePrompt, buildShadowProbeRow, call, classifyStrategyOutcome, clearBrain, combineOrderSwappedVerdicts, compile, compileForAISDKv6, configureBrain, configureMeasuredFailureBrain, configurePromotionsBrain, countTokens, deriveFamilyFromModelId, deriveOwnership, execute, findBetterFit, flushBrainDeadLetter, getActionableAdvisories, getAllStarterChains, getAllStarterChainsWithGrounding, getApplicablePromotion, getArchetypePerfScore, getDefaultFallbackChain, getDefaultFallbackChainWithGrounding, getMeasuredFailureVerdict, getModelCompatibility, getPerAxisMetrics, getReachabilityDiagnostic, getRecommendedPrimary, getSequentialStarterChain, getSequentialStarterChainWithGrounding, getStaleExclusionFindings, getStarterChain, getStarterChainWithGrounding, isAutoPromoteEnabledFromEnv, isBrainQueryActiveFor, isBrainSync, isExclusionFindingsBrainActive, isMeasuredFailureBrainActive, isMeasuredFailureGateEnabledFromEnv, isModelReachable, isPromotionsBrainActive, isProviderReachable, judgeMeasuredFailure, loadAliasesFromBrain, loadArchetypePerfFromBrain, loadArchetypePerfNFromBrain, loadChainsFromBrain, loadModelsFromBrain, loadPricingFromBrain, markAdvisoryResolved, markExclusionFindingHandled, markPromoteReadyHandled, parseJudgeVerdict, peekBrainDeadLetter, planDecomposition, prefetchMeasuredFailure, probeShadow, profileToRow, readBrainReadEnv, record, recordGoldenIr, recordOutcome, recordShadowProbe, renderIrForJudge, resetTokenizer, resolveConventionsForProfile, resolvePricingAt, resolveProviderKey, rubricFor, runAdvisor, runGoldenEval, runStrategyEvalWithAttribution, setTokenizer, wilsonLowerBound, withAltDisciplineContract, withDisciplineContract };