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

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.74";
2
+ var LIBRARY_VERSION = "2.0.0-alpha.75";
3
3
 
4
4
  // src/key-health.ts
5
5
  var JSON_HEADERS = { "Content-Type": "application/json" };
package/dist/index.d.mts CHANGED
@@ -927,10 +927,39 @@ declare function parseJudgeVerdict(raw: string): {
927
927
  * noise reads as a tie, never as a win).
928
928
  */
929
929
  declare function combineOrderSwappedVerdicts(run1: 'candidate-better' | 'current-better' | 'tied', run2: 'candidate-better' | 'current-better' | 'tied'): 'candidate-better' | 'current-better' | 'tied';
930
+ /**
931
+ * Release B — the eval's comparison primitive is arm-agnostic: a MODEL
932
+ * comparison varies `model` and holds `ir`; a STRATEGY comparison varies
933
+ * `ir` and holds `model`. Same replay, same judge, same order-swap, same
934
+ * floors.
935
+ */
936
+ type GoldenEvalAxis = 'model' | 'strategy';
937
+ /** Strategies the eval can measure. Closed set — a strategy is only
938
+ * measurable against its exact frozen bytes. The `-alt` wording is
939
+ * EVAL-ONLY: it exists to attribute a v1 loss to wording vs mechanism
940
+ * (§6) and never ships in a production compile. */
941
+ type GoldenEvalStrategyId = 'discipline-gates-v1' | 'discipline-gates-v1-alt';
930
942
  interface GoldenEvalOptions {
931
943
  appId: string;
932
944
  archetype: string;
933
- candidateModel: string;
945
+ /**
946
+ * Release B — comparison axis. Default 'model' (alpha.62 behavior,
947
+ * unchanged). On 'strategy': arm A = the golden IR as stored (gates-off),
948
+ * arm B = the same IR with a `discipline_contract` section appended
949
+ * (gates-on), both replayed on ONE model (`strategyModel` or the resolved
950
+ * incumbent). `candidateModel` is ignored on the strategy axis;
951
+ * `strategy` is required.
952
+ */
953
+ axis?: GoldenEvalAxis;
954
+ /** Required when axis==='strategy': the strategy under measurement. */
955
+ strategy?: GoldenEvalStrategyId;
956
+ /**
957
+ * axis==='strategy' only: the model both arms run on. Default: the
958
+ * resolved incumbent (most-captured model in the golden set).
959
+ */
960
+ strategyModel?: string;
961
+ /** Required when axis is 'model' (the default). */
962
+ candidateModel?: string;
934
963
  /**
935
964
  * Incumbent to compare against. Default: the most frequent incumbent_model
936
965
  * across the loaded golden set (the surface's de-facto leader).
@@ -961,6 +990,18 @@ interface GoldenEvalOptions {
961
990
  interface GoldenEvalCase {
962
991
  goldenIrId: number;
963
992
  verdict: 'candidate-better' | 'tied' | 'current-better' | 'inconclusive';
993
+ /**
994
+ * Release B — the RAW order-swapped pair, in incumbent/candidate terms,
995
+ * BEFORE `combineOrderSwappedVerdicts` folds disagreement into 'tied'.
996
+ * The fold is public API and unchanged; this records what it discards,
997
+ * because positional DISAGREEMENT RATE is an objective reliability metric
998
+ * needing no ground truth (§4.0 — the strategy experiment's primary
999
+ * metric is positional consistency, not judge quality).
1000
+ */
1001
+ orderVerdicts?: {
1002
+ run1: 'candidate-better' | 'current-better' | 'tied';
1003
+ run2: 'candidate-better' | 'current-better' | 'tied';
1004
+ };
964
1005
  judgeRationale?: string;
965
1006
  /** Hard-floor violations on the candidate side for this case. */
966
1007
  floorViolations: Array<'empty' | 'schema' | 'candidate_error'>;
@@ -983,6 +1024,15 @@ interface GoldenEvalCase {
983
1024
  interface GoldenEvalRunResult {
984
1025
  verdict: 'promote-ready' | 'not-inferior' | 'inconclusive';
985
1026
  runId?: number;
1027
+ /**
1028
+ * Release B — which axis produced this verdict. Load-bearing, not
1029
+ * cosmetic: a results table that can't tell you which axis produced a
1030
+ * verdict is a false-attribution engine. On 'strategy',
1031
+ * incumbentModel === candidateModel (the model held constant) and
1032
+ * `strategy` names the arm-B mutation.
1033
+ */
1034
+ axis: GoldenEvalAxis;
1035
+ strategy?: GoldenEvalStrategyId;
986
1036
  appId: string;
987
1037
  archetype: string;
988
1038
  incumbentModel: string;
@@ -1002,7 +1052,59 @@ interface GoldenEvalRunResult {
1002
1052
  cases: GoldenEvalCase[];
1003
1053
  notes: string[];
1004
1054
  }
1055
+ declare function withDisciplineContract(ir: PromptIR): PromptIR;
1056
+ declare const DISCIPLINE_GATES_V1_ALT_HEADER = "Before stating any conclusion, run this check:";
1057
+ declare function altGatesBlockFor(args: {
1058
+ outputMode: 'text' | 'json' | 'tool_call';
1059
+ hasTools: boolean;
1060
+ }): string;
1061
+ /**
1062
+ * The alt arm injects its block DIRECTLY as an untagged section — it must
1063
+ * not carry `kind: 'discipline_contract'`, or the translator would prepend
1064
+ * the v1 bytes on top and the arm would measure both wordings at once. The
1065
+ * variant choice mirrors matchRule()'s exactly (same outputMode + hasTools
1066
+ * inputs), so the alt arm no-ops nowhere v1 fires and fires nowhere v1
1067
+ * no-ops — the attribution is about WORDING, and everything else is held.
1068
+ */
1069
+ declare function withAltDisciplineContract(ir: PromptIR): PromptIR;
1005
1070
  declare function runGoldenEval(opts: GoldenEvalOptions): Promise<GoldenEvalRunResult>;
1071
+ /**
1072
+ * Aggregate outcome of one strategy run, in gates-on terms. 'loses' is the
1073
+ * only branch that costs a third replay — and the only one where wording
1074
+ * attribution matters.
1075
+ */
1076
+ type StrategyOutcome = 'wins' | 'ties' | 'loses' | 'inconclusive';
1077
+ declare function classifyStrategyOutcome(r: GoldenEvalRunResult): StrategyOutcome;
1078
+ /**
1079
+ * The §6 attribution matrix. The load-bearing distinction: a WORDING failure
1080
+ * recorded as a mechanism failure would let Factor B permanently disable a
1081
+ * real capability on evidence about one author's prose.
1082
+ *
1083
+ * v1 vs off | alt vs off | attribution
1084
+ * ----------+------------+----------------------------------------------
1085
+ * wins | (not run) | mechanism-works — ship
1086
+ * ties | (not run) | no-lift — inconclusive at this n, re-eval later
1087
+ * loses | wins | wording-failure — do NOT disable the mechanism
1088
+ * loses | loses | mechanism-failure — well-evidenced; Factor B may disable
1089
+ * loses | ties/inc. | wording-inconclusive — no disable on ambiguity
1090
+ */
1091
+ type StrategyAttribution = 'mechanism-works' | 'no-lift' | 'wording-failure' | 'mechanism-failure' | 'wording-inconclusive' | 'inconclusive';
1092
+ interface StrategyAttributionResult {
1093
+ attribution: StrategyAttribution;
1094
+ primary: GoldenEvalRunResult;
1095
+ /** Present ONLY when the primary lost (the loss-triggered third arm). */
1096
+ alt?: GoldenEvalRunResult;
1097
+ /** The authorship limitation, restated on every result so no downstream
1098
+ * reader can cite an attribution without it. */
1099
+ limitation: string;
1100
+ }
1101
+ declare const STRATEGY_AUTHORSHIP_LIMITATION: string;
1102
+ /**
1103
+ * Run the strategy eval with loss-triggered wording attribution: v1 first;
1104
+ * the alt arm replays ONLY on a v1 loss (mirrors the engine's retry
1105
+ * posture — don't pay for extra evidence until a result demands it).
1106
+ */
1107
+ declare function runStrategyEvalWithAttribution(opts: Omit<GoldenEvalOptions, 'axis' | 'strategy' | 'candidateModel'>): Promise<StrategyAttributionResult>;
1006
1108
 
1007
1109
  /**
1008
1110
  * alpha.60 — the library's own version, baked as a constant so Edge/Worker
@@ -1017,7 +1119,7 @@ declare function runGoldenEval(opts: GoldenEvalOptions): Promise<GoldenEvalRunRe
1017
1119
  * guard in `tests/version.test.ts` fails the suite (and therefore
1018
1120
  * `prepublishOnly`) when they diverge — a stale constant cannot reach npm.
1019
1121
  */
1020
- declare const LIBRARY_VERSION = "2.0.0-alpha.74";
1122
+ declare const LIBRARY_VERSION = "2.0.0-alpha.75";
1021
1123
 
1022
1124
  /**
1023
1125
  * Oracle contract — how an app tells the brain whether a response was good.
@@ -1351,6 +1453,32 @@ declare const TRANSLATOR_FLOOR = 6;
1351
1453
  * fingerprint — both stay byte-stable across releases.
1352
1454
  */
1353
1455
  declare const RULE_SEQUENTIAL_TOOL_CLIFF = "sequential-tool-cliff-below-floor";
1456
+ /**
1457
+ * alpha.68 / Release A — stable identifier of the discipline-gates rule.
1458
+ * Fires on `discipline_contract` sections that pass the two-factor eligibility
1459
+ * screen (Factor A archetype + Factor C output-shape). Surfaces on
1460
+ * `SectionRewrite.rule` and in brain aggregates.
1461
+ *
1462
+ * Versioned (`v1`) deliberately: Factor B evidence (Release B) is only valid
1463
+ * against the EXACT bytes that produced it, so a silent gate edit would
1464
+ * invalidate every standing verdict. A real gate change bumps this to `v2` and
1465
+ * resets Factor B to unmeasured for every tuple.
1466
+ */
1467
+ declare const RULE_DISCIPLINE_GATES_V1 = "discipline-gates-v1";
1468
+ /**
1469
+ * Release B — stable identifier of the STRUCTURED-SAFE discipline-gates
1470
+ * variant (design contract §5.D second clause, discharged via §4.0's merge:
1471
+ * "the judge must run gates 1–4 only — which IS Path 1's structured-safe
1472
+ * variant, arrived at as a subset-drop of frozen bytes rather than new
1473
+ * prose"). Fires where the full block is Factor-C-forbidden: `json` and
1474
+ * `tool_call` surfaces, where gates 5+6 are shape-altering and would
1475
+ * manufacture the structured-output violations alpha.66 retries.
1476
+ *
1477
+ * Versioned with the SAME v1 stamp as its parent: its bytes are a strict
1478
+ * subset of `discipline-gates-v1`'s, so a v1 wording change is a variant
1479
+ * wording change by construction, and both bump together.
1480
+ */
1481
+ declare const RULE_DISCIPLINE_GATES_V1_STRUCTURED = "discipline-gates-v1-structured";
1354
1482
  interface ApplySectionRewritesArgs {
1355
1483
  ir: PromptIR;
1356
1484
  profile: ModelProfile;
@@ -2807,11 +2935,40 @@ declare function markPromoteReadyHandled(opts: MarkPromoteReadyHandledOptions):
2807
2935
  * One active surface promotion, camelCase-mapped at the boundary from the
2808
2936
  * snake_case endpoint row (typed-boundary-transformer convention).
2809
2937
  */
2938
+ /**
2939
+ * Release B (alpha.75): `kgauto_promotions` carries two logical channels
2940
+ * sharing one table and one lifecycle (migration 047). `mode` is the
2941
+ * discriminator, and each mode has exactly ONE consumption site:
2942
+ *
2943
+ * mode reader effect
2944
+ * ---------- ---------------------------------- -------------------
2945
+ * downswap passScoreTargets (compile pass 5) which MODEL runs
2946
+ * strategy applySectionRewrites (pass 6.5) which IR runs
2947
+ *
2948
+ * The resolver is mode-filtered and no unfiltered accessor exists — an
2949
+ * unfiltered `.find()` was the §7 read-path bug: a strategy row has
2950
+ * promoted_model === incumbent_model, so one reaching the model-boost code
2951
+ * would boost the incumbent and could suppress the alpha.49 quality gate on
2952
+ * evidence that was never about quality-gating.
2953
+ */
2954
+ type PromotionMode = 'downswap' | 'strategy';
2810
2955
  interface PromotionRow {
2811
2956
  /** Brain row id — cited in the `promotion-applied` mutation for Glass-Box. */
2812
2957
  id: number;
2813
2958
  /** Intent archetype the promotion applies to. */
2814
2959
  archetype: string;
2960
+ /**
2961
+ * Channel discriminator (migration 047). Rows from a pre-047 endpoint
2962
+ * carry no `mode` on the wire and map to 'downswap' — every pre-047 row
2963
+ * IS a downswap, and strategy rows can only be written by post-047 code
2964
+ * whose endpoint serves the column.
2965
+ */
2966
+ mode: PromotionMode;
2967
+ /**
2968
+ * The strategy id for mode='strategy' rows (e.g. 'discipline-gates-v1');
2969
+ * null on downswaps. DB CHECK: (mode='strategy') = (strategy IS NOT NULL).
2970
+ */
2971
+ strategy: string | null;
2815
2972
  /** The model this surface now routes to. */
2816
2973
  promotedModel: string;
2817
2974
  /** The model it replaced (the eval's incumbent). */
@@ -2821,7 +2978,8 @@ interface PromotionRow {
2821
2978
  /**
2822
2979
  * Evidence-supersedes-judgment: skip the alpha.49 schema-weak
2823
2980
  * quality-gate penalty for the promoted model on this surface (the eval
2824
- * measured the schema floor holding on real workload).
2981
+ * measured the schema floor holding on real workload). Always false on
2982
+ * strategy rows (DB CHECK kgauto_promotions_strategy_no_suppress).
2825
2983
  */
2826
2984
  suppressQualityGate: boolean;
2827
2985
  /** ISO timestamp the promotion went active. */
@@ -2861,13 +3019,21 @@ interface GetApplicablePromotionOpts {
2861
3019
  appId: string;
2862
3020
  /** Archetype of the compile in flight. Required. */
2863
3021
  archetype: IntentArchetypeName | string;
3022
+ /**
3023
+ * Channel to read (migration 047). Required — there is deliberately no
3024
+ * unfiltered accessor: with one active row per (surface, mode) legal, an
3025
+ * unfiltered first-match-wins `.find()` returns an arbitrary channel's
3026
+ * row, and a strategy row reaching the model-boost reader is the §7
3027
+ * read-path bug.
3028
+ */
3029
+ mode: PromotionMode;
2864
3030
  }
2865
3031
  /**
2866
- * Sync reader. Returns the active promotion for `(appId, archetype)` or
2867
- * undefined. First call returns undefined and triggers async refresh;
3032
+ * Sync reader. Returns the active promotion for `(appId, archetype, mode)`
3033
+ * or undefined. First call returns undefined and triggers async refresh;
2868
3034
  * subsequent calls within TTL return brain data. The brain enforces one
2869
- * active promotion per surface (partial unique index), so at most one row
2870
- * matches.
3035
+ * active promotion per (surface, mode) (partial unique index), so at most
3036
+ * one row matches.
2871
3037
  *
2872
3038
  * NEVER throws. Not configured / brain down / cold → undefined.
2873
3039
  */
@@ -3102,4 +3268,4 @@ declare function _testWaitForMeasuredFailureRefresh(): Promise<void>;
3102
3268
  */
3103
3269
  declare function compile(ir: PromptIR, opts?: CompileOptions): CompileResult;
3104
3270
 
3105
- 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, 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 GoldenEvalCase, type GoldenEvalOptions, type GoldenEvalRunResult, 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_SEQUENTIAL_TOOL_CLIFF, type ReachabilityOpts, RecordInput, RecordOutcomeInput, type RunAdvisorPhase2Context, SectionRewrite, type ShadowProbeRecordInput, type SupportedProvider, type SurfaceFailureRow, SystemModelMessage, TRANSLATOR_FLOOR, _testResetMeasuredFailure, _testResetPromotions, _testWaitForMeasuredFailureRefresh, _testWaitForPromotionsRefresh, applyArchetypeConvention, applySectionRewrites, attachCacheControlToStreamTextInput, awaitMeasuredFailureReady, brainHealth, buildGoldenIrRow, buildLLMJudge, buildPairwiseJudgePrompt, buildShadowProbeRow, call, 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, setTokenizer, wilsonLowerBound };
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 };
package/dist/index.d.ts CHANGED
@@ -927,10 +927,39 @@ declare function parseJudgeVerdict(raw: string): {
927
927
  * noise reads as a tie, never as a win).
928
928
  */
929
929
  declare function combineOrderSwappedVerdicts(run1: 'candidate-better' | 'current-better' | 'tied', run2: 'candidate-better' | 'current-better' | 'tied'): 'candidate-better' | 'current-better' | 'tied';
930
+ /**
931
+ * Release B — the eval's comparison primitive is arm-agnostic: a MODEL
932
+ * comparison varies `model` and holds `ir`; a STRATEGY comparison varies
933
+ * `ir` and holds `model`. Same replay, same judge, same order-swap, same
934
+ * floors.
935
+ */
936
+ type GoldenEvalAxis = 'model' | 'strategy';
937
+ /** Strategies the eval can measure. Closed set — a strategy is only
938
+ * measurable against its exact frozen bytes. The `-alt` wording is
939
+ * EVAL-ONLY: it exists to attribute a v1 loss to wording vs mechanism
940
+ * (§6) and never ships in a production compile. */
941
+ type GoldenEvalStrategyId = 'discipline-gates-v1' | 'discipline-gates-v1-alt';
930
942
  interface GoldenEvalOptions {
931
943
  appId: string;
932
944
  archetype: string;
933
- candidateModel: string;
945
+ /**
946
+ * Release B — comparison axis. Default 'model' (alpha.62 behavior,
947
+ * unchanged). On 'strategy': arm A = the golden IR as stored (gates-off),
948
+ * arm B = the same IR with a `discipline_contract` section appended
949
+ * (gates-on), both replayed on ONE model (`strategyModel` or the resolved
950
+ * incumbent). `candidateModel` is ignored on the strategy axis;
951
+ * `strategy` is required.
952
+ */
953
+ axis?: GoldenEvalAxis;
954
+ /** Required when axis==='strategy': the strategy under measurement. */
955
+ strategy?: GoldenEvalStrategyId;
956
+ /**
957
+ * axis==='strategy' only: the model both arms run on. Default: the
958
+ * resolved incumbent (most-captured model in the golden set).
959
+ */
960
+ strategyModel?: string;
961
+ /** Required when axis is 'model' (the default). */
962
+ candidateModel?: string;
934
963
  /**
935
964
  * Incumbent to compare against. Default: the most frequent incumbent_model
936
965
  * across the loaded golden set (the surface's de-facto leader).
@@ -961,6 +990,18 @@ interface GoldenEvalOptions {
961
990
  interface GoldenEvalCase {
962
991
  goldenIrId: number;
963
992
  verdict: 'candidate-better' | 'tied' | 'current-better' | 'inconclusive';
993
+ /**
994
+ * Release B — the RAW order-swapped pair, in incumbent/candidate terms,
995
+ * BEFORE `combineOrderSwappedVerdicts` folds disagreement into 'tied'.
996
+ * The fold is public API and unchanged; this records what it discards,
997
+ * because positional DISAGREEMENT RATE is an objective reliability metric
998
+ * needing no ground truth (§4.0 — the strategy experiment's primary
999
+ * metric is positional consistency, not judge quality).
1000
+ */
1001
+ orderVerdicts?: {
1002
+ run1: 'candidate-better' | 'current-better' | 'tied';
1003
+ run2: 'candidate-better' | 'current-better' | 'tied';
1004
+ };
964
1005
  judgeRationale?: string;
965
1006
  /** Hard-floor violations on the candidate side for this case. */
966
1007
  floorViolations: Array<'empty' | 'schema' | 'candidate_error'>;
@@ -983,6 +1024,15 @@ interface GoldenEvalCase {
983
1024
  interface GoldenEvalRunResult {
984
1025
  verdict: 'promote-ready' | 'not-inferior' | 'inconclusive';
985
1026
  runId?: number;
1027
+ /**
1028
+ * Release B — which axis produced this verdict. Load-bearing, not
1029
+ * cosmetic: a results table that can't tell you which axis produced a
1030
+ * verdict is a false-attribution engine. On 'strategy',
1031
+ * incumbentModel === candidateModel (the model held constant) and
1032
+ * `strategy` names the arm-B mutation.
1033
+ */
1034
+ axis: GoldenEvalAxis;
1035
+ strategy?: GoldenEvalStrategyId;
986
1036
  appId: string;
987
1037
  archetype: string;
988
1038
  incumbentModel: string;
@@ -1002,7 +1052,59 @@ interface GoldenEvalRunResult {
1002
1052
  cases: GoldenEvalCase[];
1003
1053
  notes: string[];
1004
1054
  }
1055
+ declare function withDisciplineContract(ir: PromptIR): PromptIR;
1056
+ declare const DISCIPLINE_GATES_V1_ALT_HEADER = "Before stating any conclusion, run this check:";
1057
+ declare function altGatesBlockFor(args: {
1058
+ outputMode: 'text' | 'json' | 'tool_call';
1059
+ hasTools: boolean;
1060
+ }): string;
1061
+ /**
1062
+ * The alt arm injects its block DIRECTLY as an untagged section — it must
1063
+ * not carry `kind: 'discipline_contract'`, or the translator would prepend
1064
+ * the v1 bytes on top and the arm would measure both wordings at once. The
1065
+ * variant choice mirrors matchRule()'s exactly (same outputMode + hasTools
1066
+ * inputs), so the alt arm no-ops nowhere v1 fires and fires nowhere v1
1067
+ * no-ops — the attribution is about WORDING, and everything else is held.
1068
+ */
1069
+ declare function withAltDisciplineContract(ir: PromptIR): PromptIR;
1005
1070
  declare function runGoldenEval(opts: GoldenEvalOptions): Promise<GoldenEvalRunResult>;
1071
+ /**
1072
+ * Aggregate outcome of one strategy run, in gates-on terms. 'loses' is the
1073
+ * only branch that costs a third replay — and the only one where wording
1074
+ * attribution matters.
1075
+ */
1076
+ type StrategyOutcome = 'wins' | 'ties' | 'loses' | 'inconclusive';
1077
+ declare function classifyStrategyOutcome(r: GoldenEvalRunResult): StrategyOutcome;
1078
+ /**
1079
+ * The §6 attribution matrix. The load-bearing distinction: a WORDING failure
1080
+ * recorded as a mechanism failure would let Factor B permanently disable a
1081
+ * real capability on evidence about one author's prose.
1082
+ *
1083
+ * v1 vs off | alt vs off | attribution
1084
+ * ----------+------------+----------------------------------------------
1085
+ * wins | (not run) | mechanism-works — ship
1086
+ * ties | (not run) | no-lift — inconclusive at this n, re-eval later
1087
+ * loses | wins | wording-failure — do NOT disable the mechanism
1088
+ * loses | loses | mechanism-failure — well-evidenced; Factor B may disable
1089
+ * loses | ties/inc. | wording-inconclusive — no disable on ambiguity
1090
+ */
1091
+ type StrategyAttribution = 'mechanism-works' | 'no-lift' | 'wording-failure' | 'mechanism-failure' | 'wording-inconclusive' | 'inconclusive';
1092
+ interface StrategyAttributionResult {
1093
+ attribution: StrategyAttribution;
1094
+ primary: GoldenEvalRunResult;
1095
+ /** Present ONLY when the primary lost (the loss-triggered third arm). */
1096
+ alt?: GoldenEvalRunResult;
1097
+ /** The authorship limitation, restated on every result so no downstream
1098
+ * reader can cite an attribution without it. */
1099
+ limitation: string;
1100
+ }
1101
+ declare const STRATEGY_AUTHORSHIP_LIMITATION: string;
1102
+ /**
1103
+ * Run the strategy eval with loss-triggered wording attribution: v1 first;
1104
+ * the alt arm replays ONLY on a v1 loss (mirrors the engine's retry
1105
+ * posture — don't pay for extra evidence until a result demands it).
1106
+ */
1107
+ declare function runStrategyEvalWithAttribution(opts: Omit<GoldenEvalOptions, 'axis' | 'strategy' | 'candidateModel'>): Promise<StrategyAttributionResult>;
1006
1108
 
1007
1109
  /**
1008
1110
  * alpha.60 — the library's own version, baked as a constant so Edge/Worker
@@ -1017,7 +1119,7 @@ declare function runGoldenEval(opts: GoldenEvalOptions): Promise<GoldenEvalRunRe
1017
1119
  * guard in `tests/version.test.ts` fails the suite (and therefore
1018
1120
  * `prepublishOnly`) when they diverge — a stale constant cannot reach npm.
1019
1121
  */
1020
- declare const LIBRARY_VERSION = "2.0.0-alpha.74";
1122
+ declare const LIBRARY_VERSION = "2.0.0-alpha.75";
1021
1123
 
1022
1124
  /**
1023
1125
  * Oracle contract — how an app tells the brain whether a response was good.
@@ -1351,6 +1453,32 @@ declare const TRANSLATOR_FLOOR = 6;
1351
1453
  * fingerprint — both stay byte-stable across releases.
1352
1454
  */
1353
1455
  declare const RULE_SEQUENTIAL_TOOL_CLIFF = "sequential-tool-cliff-below-floor";
1456
+ /**
1457
+ * alpha.68 / Release A — stable identifier of the discipline-gates rule.
1458
+ * Fires on `discipline_contract` sections that pass the two-factor eligibility
1459
+ * screen (Factor A archetype + Factor C output-shape). Surfaces on
1460
+ * `SectionRewrite.rule` and in brain aggregates.
1461
+ *
1462
+ * Versioned (`v1`) deliberately: Factor B evidence (Release B) is only valid
1463
+ * against the EXACT bytes that produced it, so a silent gate edit would
1464
+ * invalidate every standing verdict. A real gate change bumps this to `v2` and
1465
+ * resets Factor B to unmeasured for every tuple.
1466
+ */
1467
+ declare const RULE_DISCIPLINE_GATES_V1 = "discipline-gates-v1";
1468
+ /**
1469
+ * Release B — stable identifier of the STRUCTURED-SAFE discipline-gates
1470
+ * variant (design contract §5.D second clause, discharged via §4.0's merge:
1471
+ * "the judge must run gates 1–4 only — which IS Path 1's structured-safe
1472
+ * variant, arrived at as a subset-drop of frozen bytes rather than new
1473
+ * prose"). Fires where the full block is Factor-C-forbidden: `json` and
1474
+ * `tool_call` surfaces, where gates 5+6 are shape-altering and would
1475
+ * manufacture the structured-output violations alpha.66 retries.
1476
+ *
1477
+ * Versioned with the SAME v1 stamp as its parent: its bytes are a strict
1478
+ * subset of `discipline-gates-v1`'s, so a v1 wording change is a variant
1479
+ * wording change by construction, and both bump together.
1480
+ */
1481
+ declare const RULE_DISCIPLINE_GATES_V1_STRUCTURED = "discipline-gates-v1-structured";
1354
1482
  interface ApplySectionRewritesArgs {
1355
1483
  ir: PromptIR;
1356
1484
  profile: ModelProfile;
@@ -2807,11 +2935,40 @@ declare function markPromoteReadyHandled(opts: MarkPromoteReadyHandledOptions):
2807
2935
  * One active surface promotion, camelCase-mapped at the boundary from the
2808
2936
  * snake_case endpoint row (typed-boundary-transformer convention).
2809
2937
  */
2938
+ /**
2939
+ * Release B (alpha.75): `kgauto_promotions` carries two logical channels
2940
+ * sharing one table and one lifecycle (migration 047). `mode` is the
2941
+ * discriminator, and each mode has exactly ONE consumption site:
2942
+ *
2943
+ * mode reader effect
2944
+ * ---------- ---------------------------------- -------------------
2945
+ * downswap passScoreTargets (compile pass 5) which MODEL runs
2946
+ * strategy applySectionRewrites (pass 6.5) which IR runs
2947
+ *
2948
+ * The resolver is mode-filtered and no unfiltered accessor exists — an
2949
+ * unfiltered `.find()` was the §7 read-path bug: a strategy row has
2950
+ * promoted_model === incumbent_model, so one reaching the model-boost code
2951
+ * would boost the incumbent and could suppress the alpha.49 quality gate on
2952
+ * evidence that was never about quality-gating.
2953
+ */
2954
+ type PromotionMode = 'downswap' | 'strategy';
2810
2955
  interface PromotionRow {
2811
2956
  /** Brain row id — cited in the `promotion-applied` mutation for Glass-Box. */
2812
2957
  id: number;
2813
2958
  /** Intent archetype the promotion applies to. */
2814
2959
  archetype: string;
2960
+ /**
2961
+ * Channel discriminator (migration 047). Rows from a pre-047 endpoint
2962
+ * carry no `mode` on the wire and map to 'downswap' — every pre-047 row
2963
+ * IS a downswap, and strategy rows can only be written by post-047 code
2964
+ * whose endpoint serves the column.
2965
+ */
2966
+ mode: PromotionMode;
2967
+ /**
2968
+ * The strategy id for mode='strategy' rows (e.g. 'discipline-gates-v1');
2969
+ * null on downswaps. DB CHECK: (mode='strategy') = (strategy IS NOT NULL).
2970
+ */
2971
+ strategy: string | null;
2815
2972
  /** The model this surface now routes to. */
2816
2973
  promotedModel: string;
2817
2974
  /** The model it replaced (the eval's incumbent). */
@@ -2821,7 +2978,8 @@ interface PromotionRow {
2821
2978
  /**
2822
2979
  * Evidence-supersedes-judgment: skip the alpha.49 schema-weak
2823
2980
  * quality-gate penalty for the promoted model on this surface (the eval
2824
- * measured the schema floor holding on real workload).
2981
+ * measured the schema floor holding on real workload). Always false on
2982
+ * strategy rows (DB CHECK kgauto_promotions_strategy_no_suppress).
2825
2983
  */
2826
2984
  suppressQualityGate: boolean;
2827
2985
  /** ISO timestamp the promotion went active. */
@@ -2861,13 +3019,21 @@ interface GetApplicablePromotionOpts {
2861
3019
  appId: string;
2862
3020
  /** Archetype of the compile in flight. Required. */
2863
3021
  archetype: IntentArchetypeName | string;
3022
+ /**
3023
+ * Channel to read (migration 047). Required — there is deliberately no
3024
+ * unfiltered accessor: with one active row per (surface, mode) legal, an
3025
+ * unfiltered first-match-wins `.find()` returns an arbitrary channel's
3026
+ * row, and a strategy row reaching the model-boost reader is the §7
3027
+ * read-path bug.
3028
+ */
3029
+ mode: PromotionMode;
2864
3030
  }
2865
3031
  /**
2866
- * Sync reader. Returns the active promotion for `(appId, archetype)` or
2867
- * undefined. First call returns undefined and triggers async refresh;
3032
+ * Sync reader. Returns the active promotion for `(appId, archetype, mode)`
3033
+ * or undefined. First call returns undefined and triggers async refresh;
2868
3034
  * subsequent calls within TTL return brain data. The brain enforces one
2869
- * active promotion per surface (partial unique index), so at most one row
2870
- * matches.
3035
+ * active promotion per (surface, mode) (partial unique index), so at most
3036
+ * one row matches.
2871
3037
  *
2872
3038
  * NEVER throws. Not configured / brain down / cold → undefined.
2873
3039
  */
@@ -3102,4 +3268,4 @@ declare function _testWaitForMeasuredFailureRefresh(): Promise<void>;
3102
3268
  */
3103
3269
  declare function compile(ir: PromptIR, opts?: CompileOptions): CompileResult;
3104
3270
 
3105
- 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, 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 GoldenEvalCase, type GoldenEvalOptions, type GoldenEvalRunResult, 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_SEQUENTIAL_TOOL_CLIFF, type ReachabilityOpts, RecordInput, RecordOutcomeInput, type RunAdvisorPhase2Context, SectionRewrite, type ShadowProbeRecordInput, type SupportedProvider, type SurfaceFailureRow, SystemModelMessage, TRANSLATOR_FLOOR, _testResetMeasuredFailure, _testResetPromotions, _testWaitForMeasuredFailureRefresh, _testWaitForPromotionsRefresh, applyArchetypeConvention, applySectionRewrites, attachCacheControlToStreamTextInput, awaitMeasuredFailureReady, brainHealth, buildGoldenIrRow, buildLLMJudge, buildPairwiseJudgePrompt, buildShadowProbeRow, call, 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, setTokenizer, wilsonLowerBound };
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 };