@warmdrift/kgauto-compiler 2.0.0-alpha.92 → 2.0.0-alpha.93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/chunk-BTP5WK3B.mjs +3448 -0
  2. package/dist/{chunk-4G73BYES.mjs → chunk-S4PA2BDB.mjs} +1 -1
  3. package/dist/{chunk-QOQV66PU.mjs → chunk-WFLDRRY7.mjs} +1 -1
  4. package/dist/{chunk-T53ISC2F.mjs → chunk-YO2ZLPSD.mjs} +10 -0
  5. package/dist/compile-BlMXv6QT.d.ts +53 -0
  6. package/dist/compile-C2IfAGV1.d.mts +53 -0
  7. package/dist/glassbox/index.d.mts +3 -3
  8. package/dist/glassbox/index.d.ts +3 -3
  9. package/dist/glassbox-routes/format.d.mts +2 -2
  10. package/dist/glassbox-routes/format.d.ts +2 -2
  11. package/dist/glassbox-routes/index.d.mts +4 -4
  12. package/dist/glassbox-routes/index.d.ts +4 -4
  13. package/dist/glassbox-routes/index.mjs +2 -2
  14. package/dist/glassbox-routes/react/index.d.mts +2 -2
  15. package/dist/glassbox-routes/react/index.d.ts +2 -2
  16. package/dist/index.d.mts +8 -55
  17. package/dist/index.d.ts +8 -55
  18. package/dist/index.js +7 -1
  19. package/dist/index.mjs +158 -3457
  20. package/dist/{ir-BWnE6LaB.d.ts → ir-DbvOFKF-.d.ts} +1 -1
  21. package/dist/{ir-BPYh68mv.d.mts → ir-DyMJ84je.d.mts} +1 -1
  22. package/dist/key-health.js +1 -1
  23. package/dist/key-health.mjs +1 -1
  24. package/dist/probe.d.mts +46 -0
  25. package/dist/probe.d.ts +46 -0
  26. package/dist/probe.js +5767 -0
  27. package/dist/probe.mjs +45 -0
  28. package/dist/profiles.d.mts +30 -2
  29. package/dist/profiles.d.ts +30 -2
  30. package/dist/profiles.js +11 -0
  31. package/dist/profiles.mjs +3 -1
  32. package/dist/{types-BCHv34P7.d.ts → types-5TqjBeZD.d.ts} +1 -1
  33. package/dist/{types-BhxC4hdx.d.ts → types-BlrbNQfj.d.ts} +1 -1
  34. package/dist/{types-eLelJBj-.d.mts → types-D441T-KC.d.mts} +1 -1
  35. package/dist/{types-BgvLmT3s.d.mts → types-_myk4bxn.d.mts} +1 -1
  36. package/package.json +7 -2
@@ -2,7 +2,7 @@ import {
2
2
  allProfiles,
3
3
  resolveModelAlias,
4
4
  tryGetProfile
5
- } from "./chunk-T53ISC2F.mjs";
5
+ } from "./chunk-YO2ZLPSD.mjs";
6
6
 
7
7
  // src/brain-query.ts
8
8
  var FRESH_SNAPSHOT = {
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var LIBRARY_VERSION = "2.0.0-alpha.92";
2
+ var LIBRARY_VERSION = "2.0.0-alpha.93";
3
3
 
4
4
  // src/key-health.ts
5
5
  var JSON_HEADERS = { "Content-Type": "application/json" };
@@ -1,4 +1,13 @@
1
1
  // src/profiles.ts
2
+ function deriveCliffEvidenceClass(rule) {
3
+ if (rule.evidence?.class) return rule.evidence.class;
4
+ const r = rule.reason.toLowerCase();
5
+ if (/inherited|conservative|assume|likely degrades|preemptive|starter hypothesis|same drain risk/.test(r)) {
6
+ return "assumed";
7
+ }
8
+ if (/observed|measured|\d+\/\d+ empty|replayed into/.test(r)) return "observed";
9
+ return "asserted";
10
+ }
2
11
  var LATENCY_TIER_MS = {
3
12
  fast: 4e3,
4
13
  medium: 11e3,
@@ -1991,6 +2000,7 @@ function profilesByProvider(provider) {
1991
2000
  }
1992
2001
 
1993
2002
  export {
2003
+ deriveCliffEvidenceClass,
1994
2004
  LATENCY_TIER_MS,
1995
2005
  latencyTierOf,
1996
2006
  ALIASES,
@@ -0,0 +1,53 @@
1
+ import { a as CompilePolicy } from './ir-DbvOFKF-.js';
2
+ import { ModelProfile } from './profiles.js';
3
+
4
+ /**
5
+ * compile() — the main orchestrator.
6
+ *
7
+ * Runs all passes in order, picks a target, lowers to wire format, returns
8
+ * a CompileResult the caller uses to make the actual provider call.
9
+ *
10
+ * Pure function in v2.0.0-alpha.1: no network, no I/O, no mutation cache yet.
11
+ * Mutation cache will be added in v2.1 when the brain has data to push.
12
+ */
13
+
14
+ interface CompileOptions {
15
+ /** Custom profile resolver — for tests or custom profile sets. */
16
+ profileResolver?: (id: string) => ModelProfile;
17
+ /** Tool relevance threshold (default 0.2). */
18
+ toolRelevanceThreshold?: number;
19
+ /** History compression — turns count threshold (default 8). */
20
+ compressHistoryAfter?: number;
21
+ /**
22
+ * History compression — token threshold (alpha.7). When total history
23
+ * tokens exceed this AND there are more recent turns to keep, compress
24
+ * even when count threshold is below `compressHistoryAfter`. Catches
25
+ * fat-message bloat (tool-using agents pack many tool-call/result pairs
26
+ * into single assistant messages — count stays low, tokens explode).
27
+ * Default undefined (disabled — backward-compatible).
28
+ */
29
+ compressHistoryAboveTokens?: number;
30
+ /**
31
+ * Consumer-declared policy. Filters blocked models, enforces cost
32
+ * ceiling, boosts preferred. See CompilePolicy in ir.ts.
33
+ */
34
+ policy?: CompilePolicy;
35
+ /**
36
+ * alpha.68 / Release A (delegation-fanout-accelerator §5.0, R0 linkage) —
37
+ * transport for the fan-out parent handle. Threaded from
38
+ * `CallOptions.parentHandle` on the call() path (and settable directly on the
39
+ * public compile() path). Release A does NOT route on it — it only labels the
40
+ * outcome row (fanout_role / trace_id / parent_handle) at record-registration
41
+ * time. `registerCompile` reads it to derive the linkage. Absent ⇒ root call.
42
+ */
43
+ parentHandle?: string;
44
+ /**
45
+ * alpha.92 — lower for a gateway route (execute-leg contract). Threaded
46
+ * from `CallOptions.route`. The canonical profile drives every pass
47
+ * (cliffs, scoring, budgets) unchanged; only the wire destination and the
48
+ * learning-key encoding change. Absent ⇒ direct vendor wire.
49
+ */
50
+ route?: 'direct' | 'openrouter';
51
+ }
52
+
53
+ export type { CompileOptions as C };
@@ -0,0 +1,53 @@
1
+ import { a as CompilePolicy } from './ir-DyMJ84je.mjs';
2
+ import { ModelProfile } from './profiles.mjs';
3
+
4
+ /**
5
+ * compile() — the main orchestrator.
6
+ *
7
+ * Runs all passes in order, picks a target, lowers to wire format, returns
8
+ * a CompileResult the caller uses to make the actual provider call.
9
+ *
10
+ * Pure function in v2.0.0-alpha.1: no network, no I/O, no mutation cache yet.
11
+ * Mutation cache will be added in v2.1 when the brain has data to push.
12
+ */
13
+
14
+ interface CompileOptions {
15
+ /** Custom profile resolver — for tests or custom profile sets. */
16
+ profileResolver?: (id: string) => ModelProfile;
17
+ /** Tool relevance threshold (default 0.2). */
18
+ toolRelevanceThreshold?: number;
19
+ /** History compression — turns count threshold (default 8). */
20
+ compressHistoryAfter?: number;
21
+ /**
22
+ * History compression — token threshold (alpha.7). When total history
23
+ * tokens exceed this AND there are more recent turns to keep, compress
24
+ * even when count threshold is below `compressHistoryAfter`. Catches
25
+ * fat-message bloat (tool-using agents pack many tool-call/result pairs
26
+ * into single assistant messages — count stays low, tokens explode).
27
+ * Default undefined (disabled — backward-compatible).
28
+ */
29
+ compressHistoryAboveTokens?: number;
30
+ /**
31
+ * Consumer-declared policy. Filters blocked models, enforces cost
32
+ * ceiling, boosts preferred. See CompilePolicy in ir.ts.
33
+ */
34
+ policy?: CompilePolicy;
35
+ /**
36
+ * alpha.68 / Release A (delegation-fanout-accelerator §5.0, R0 linkage) —
37
+ * transport for the fan-out parent handle. Threaded from
38
+ * `CallOptions.parentHandle` on the call() path (and settable directly on the
39
+ * public compile() path). Release A does NOT route on it — it only labels the
40
+ * outcome row (fanout_role / trace_id / parent_handle) at record-registration
41
+ * time. `registerCompile` reads it to derive the linkage. Absent ⇒ root call.
42
+ */
43
+ parentHandle?: string;
44
+ /**
45
+ * alpha.92 — lower for a gateway route (execute-leg contract). Threaded
46
+ * from `CallOptions.route`. The canonical profile drives every pass
47
+ * (cliffs, scoring, budgets) unchanged; only the wire destination and the
48
+ * learning-key encoding change. Absent ⇒ direct vendor wire.
49
+ */
50
+ route?: 'direct' | 'openrouter';
51
+ }
52
+
53
+ export type { CompileOptions as C };
@@ -1,6 +1,6 @@
1
- import { G as GlassboxEvent } from '../types-BgvLmT3s.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-BgvLmT3s.mjs';
3
- import '../ir-BPYh68mv.mjs';
1
+ import { G as GlassboxEvent } from '../types-_myk4bxn.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-_myk4bxn.mjs';
3
+ import '../ir-DyMJ84je.mjs';
4
4
  import '../dialect.mjs';
5
5
 
6
6
  /**
@@ -1,6 +1,6 @@
1
- import { G as GlassboxEvent } from '../types-BhxC4hdx.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-BhxC4hdx.js';
3
- import '../ir-BWnE6LaB.js';
1
+ import { G as GlassboxEvent } from '../types-BlrbNQfj.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-BlrbNQfj.js';
3
+ import '../ir-DbvOFKF-.js';
4
4
  import '../dialect.js';
5
5
 
6
6
  /**
@@ -1,5 +1,5 @@
1
- import { T as TraceHealth } from '../types-eLelJBj-.mjs';
2
- import '../ir-BPYh68mv.mjs';
1
+ import { T as TraceHealth } from '../types-D441T-KC.mjs';
2
+ import '../ir-DyMJ84je.mjs';
3
3
  import '../dialect.mjs';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
- import { T as TraceHealth } from '../types-BCHv34P7.js';
2
- import '../ir-BWnE6LaB.js';
1
+ import { T as TraceHealth } from '../types-5TqjBeZD.js';
2
+ import '../ir-DbvOFKF-.js';
3
3
  import '../dialect.js';
4
4
 
5
5
  /**
@@ -1,7 +1,7 @@
1
- import { G as GlassboxEvent } from '../types-BgvLmT3s.mjs';
2
- import { a as TraceDetail, b as TraceSummary, c as TraceCounterfactual } from '../types-eLelJBj-.mjs';
3
- export { A as AdvisoryRecord, T as TraceHealth, d as TraceSectionRewrite } from '../types-eLelJBj-.mjs';
4
- import '../ir-BPYh68mv.mjs';
1
+ import { G as GlassboxEvent } from '../types-_myk4bxn.mjs';
2
+ import { a as TraceDetail, b as TraceSummary, c as TraceCounterfactual } from '../types-D441T-KC.mjs';
3
+ export { A as AdvisoryRecord, T as TraceHealth, d as TraceSectionRewrite } from '../types-D441T-KC.mjs';
4
+ import '../ir-DyMJ84je.mjs';
5
5
  import '../dialect.mjs';
6
6
 
7
7
  /**
@@ -1,7 +1,7 @@
1
- import { G as GlassboxEvent } from '../types-BhxC4hdx.js';
2
- import { a as TraceDetail, b as TraceSummary, c as TraceCounterfactual } from '../types-BCHv34P7.js';
3
- export { A as AdvisoryRecord, T as TraceHealth, d as TraceSectionRewrite } from '../types-BCHv34P7.js';
4
- import '../ir-BWnE6LaB.js';
1
+ import { G as GlassboxEvent } from '../types-BlrbNQfj.js';
2
+ import { a as TraceDetail, b as TraceSummary, c as TraceCounterfactual } from '../types-5TqjBeZD.js';
3
+ export { A as AdvisoryRecord, T as TraceHealth, d as TraceSectionRewrite } from '../types-5TqjBeZD.js';
4
+ import '../ir-DbvOFKF-.js';
5
5
  import '../dialect.js';
6
6
 
7
7
  /**
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  ARCHETYPE_FLOOR_DEFAULT,
3
3
  getDefaultFallbackChain
4
- } from "../chunk-4G73BYES.mjs";
4
+ } from "../chunk-S4PA2BDB.mjs";
5
5
  import {
6
6
  tryGetProfile
7
- } from "../chunk-T53ISC2F.mjs";
7
+ } from "../chunk-YO2ZLPSD.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-eLelJBj-.mjs';
3
- import '../../ir-BPYh68mv.mjs';
2
+ import { a as TraceDetail } from '../../types-D441T-KC.mjs';
3
+ import '../../ir-DyMJ84je.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-BCHv34P7.js';
3
- import '../../ir-BWnE6LaB.js';
2
+ import { a as TraceDetail } from '../../types-5TqjBeZD.js';
3
+ import '../../ir-DbvOFKF-.js';
4
4
  import '../../dialect.js';
5
5
 
6
6
  /**
package/dist/index.d.mts CHANGED
@@ -1,61 +1,13 @@
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 OutcomeSource, i as OracleScore, j as Adapter, k as PerAxisMetrics, l as Provider, m as ChainEntry, G as Grounding } from './ir-BPYh68mv.mjs';
2
- export { n as CallAttempt, o as CallError, p as ChainModelEntry, q as ChainWithGrounding, r as Constraints, E as EffortLevel, s as GoldenCaptureOptions, H as HistoryCachePolicy, I as IntentDeclaration, M as Message, t as MutationApplied, u as NormalizedTokens, v as OutcomeKind, w as PerAxisMetricsByModel, x as PromptSection, y as SectionKind, z as ShadowProbeConfig, T as ToolCall, D as ToolDefinition, J as captureGoldenIr, K as hasMutation, L as mutationId, Q as parseGoldenCaptureRate, U as resolveGoldenCaptureRate, V as shouldCaptureGolden } from './ir-BPYh68mv.mjs';
3
- import { ModelProfile, ArchetypeConvention } from './profiles.mjs';
4
- export { ALIASES, CacheStrategy, CliffRule, LATENCY_TIER_MS, LatencyTier, LoweringSpec, RecoveryRule, StructuredOutputCapability, SystemPromptMode, _testClearConsumerProfiles, allProfiles, bestEffortProfile, getProfile, inferProviderFromId, latencyTierOf, profilesByProvider, registerProfiles, resolveModelAlias, tryGetProfile } from './profiles.mjs';
1
+ import { C as CompileOptions } from './compile-C2IfAGV1.mjs';
2
+ import { N as NormalizedResponse, A as ApiKeys, P as ProviderOverrides, C as CompiledRequest, a as CompilePolicy, b as PromptIR, c as CallOptions, d as CallResult, S as SystemModelMessage, e as CompileResult, B as BestPracticeAdvisory, F as FallbackReason, f as SectionRewrite, R as RecordInput, g as RecordOutcomeInput, O as OutcomeResult, h as OutcomeSource, i as OracleScore, j as Adapter, k as PerAxisMetrics, l as Provider, m as ChainEntry, G as Grounding } from './ir-DyMJ84je.mjs';
3
+ export { n as CallAttempt, o as CallError, p as ChainModelEntry, q as ChainWithGrounding, r as Constraints, E as EffortLevel, s as GoldenCaptureOptions, H as HistoryCachePolicy, I as IntentDeclaration, M as Message, t as MutationApplied, u as NormalizedTokens, v as OutcomeKind, w as PerAxisMetricsByModel, x as PromptSection, y as SectionKind, z as ShadowProbeConfig, T as ToolCall, D as ToolDefinition, J as captureGoldenIr, K as hasMutation, L as mutationId, Q as parseGoldenCaptureRate, U as resolveGoldenCaptureRate, V as shouldCaptureGolden } from './ir-DyMJ84je.mjs';
5
4
  export { BrainForwardConfig, BrainForwardRoutes, createBrainForwardRoutes } from './brain-proxy.mjs';
6
5
  export { KEY_FINGERPRINT_DOMAIN, KEY_FINGERPRINT_LENGTH, KeyHealthConfig, KeyHealthProvider, KeyHealthResponseBody, KeyHealthResult, KeyHealthRoute, createKeyHealthRoute, keyFingerprint } from './key-health.mjs';
6
+ import { ModelProfile, ArchetypeConvention } from './profiles.mjs';
7
+ export { ALIASES, CacheStrategy, CliffRule, LATENCY_TIER_MS, LatencyTier, LoweringSpec, RecoveryRule, StructuredOutputCapability, SystemPromptMode, _testClearConsumerProfiles, allProfiles, bestEffortProfile, getProfile, inferProviderFromId, latencyTierOf, profilesByProvider, registerProfiles, resolveModelAlias, tryGetProfile } from './profiles.mjs';
7
8
  import { IntentArchetypeName, OutputMode } from './dialect.mjs';
8
9
  export { ALL_ARCHETYPES, ContextBucket, DIALECT_VERSION, HistoryDepth, INTENT_ARCHETYPES, ShapeSignature, ToolCountBucket, bucketContext, bucketHistory, bucketToolCount, hashShape, isArchetype, learningKey } from './dialect.mjs';
9
10
 
10
- /**
11
- * compile() — the main orchestrator.
12
- *
13
- * Runs all passes in order, picks a target, lowers to wire format, returns
14
- * a CompileResult the caller uses to make the actual provider call.
15
- *
16
- * Pure function in v2.0.0-alpha.1: no network, no I/O, no mutation cache yet.
17
- * Mutation cache will be added in v2.1 when the brain has data to push.
18
- */
19
-
20
- interface CompileOptions {
21
- /** Custom profile resolver — for tests or custom profile sets. */
22
- profileResolver?: (id: string) => ModelProfile;
23
- /** Tool relevance threshold (default 0.2). */
24
- toolRelevanceThreshold?: number;
25
- /** History compression — turns count threshold (default 8). */
26
- compressHistoryAfter?: number;
27
- /**
28
- * History compression — token threshold (alpha.7). When total history
29
- * tokens exceed this AND there are more recent turns to keep, compress
30
- * even when count threshold is below `compressHistoryAfter`. Catches
31
- * fat-message bloat (tool-using agents pack many tool-call/result pairs
32
- * into single assistant messages — count stays low, tokens explode).
33
- * Default undefined (disabled — backward-compatible).
34
- */
35
- compressHistoryAboveTokens?: number;
36
- /**
37
- * Consumer-declared policy. Filters blocked models, enforces cost
38
- * ceiling, boosts preferred. See CompilePolicy in ir.ts.
39
- */
40
- policy?: CompilePolicy;
41
- /**
42
- * alpha.68 / Release A (delegation-fanout-accelerator §5.0, R0 linkage) —
43
- * transport for the fan-out parent handle. Threaded from
44
- * `CallOptions.parentHandle` on the call() path (and settable directly on the
45
- * public compile() path). Release A does NOT route on it — it only labels the
46
- * outcome row (fanout_role / trace_id / parent_handle) at record-registration
47
- * time. `registerCompile` reads it to derive the linkage. Absent ⇒ root call.
48
- */
49
- parentHandle?: string;
50
- /**
51
- * alpha.92 — lower for a gateway route (execute-leg contract). Threaded
52
- * from `CallOptions.route`. The canonical profile drives every pass
53
- * (cliffs, scoring, budgets) unchanged; only the wire destination and the
54
- * learning-key encoding change. Absent ⇒ direct vendor wire.
55
- */
56
- route?: 'direct' | 'openrouter';
57
- }
58
-
59
11
  /**
60
12
  * execute() — fire a CompiledRequest at the right provider, normalize the
61
13
  * response shape across providers.
@@ -873,6 +825,7 @@ declare function buildShadowProbeRow(input: ShadowProbeRecordInput): {
873
825
  latency_candidate_ms: number | null;
874
826
  prompt_fidelity: number;
875
827
  replay_source: 'inline-full-ir';
828
+ evidence_basis: 'controlled';
876
829
  outcome: 'completed' | 'aborted_latency_budget' | 'skipped_slow_tier_sync' | 'candidate_error';
877
830
  error_class: string | null;
878
831
  };
@@ -1281,7 +1234,7 @@ declare function runStrategyEvalWithAttribution(opts: Omit<GoldenEvalOptions, 'a
1281
1234
  * guard in `tests/version.test.ts` fails the suite (and therefore
1282
1235
  * `prepublishOnly`) when they diverge — a stale constant cannot reach npm.
1283
1236
  */
1284
- declare const LIBRARY_VERSION = "2.0.0-alpha.92";
1237
+ declare const LIBRARY_VERSION = "2.0.0-alpha.93";
1285
1238
 
1286
1239
  /**
1287
1240
  * Oracle contract — how an app tells the brain whether a response was good.
@@ -4102,4 +4055,4 @@ declare function planDecomposition(args: PlanDecompositionArgs): DecompositionPl
4102
4055
  */
4103
4056
  declare function compile(ir: PromptIR, opts?: CompileOptions): CompileResult;
4104
4057
 
4105
- 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_JUDGE_MODEL, 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, _testResetOutcomeSourceWarning, _testResetPromotions, _testWaitForMeasuredFailureRefresh, _testWaitForPromotionsRefresh, altBlindGatesBlockFor, altGatesBlockFor, applyArchetypeConvention, applySectionRewrites, attachCacheControlToStreamTextInput, awaitMeasuredFailureReady, awaitPromotionsReady, 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, prefetchPromotions, probeShadow, profileToRow, readBrainReadEnv, record, recordGoldenIr, recordOutcome, recordShadowProbe, renderIrForJudge, resetTokenizer, resolveConventionsForProfile, resolveOutcomeSource, resolvePricingAt, resolveProviderKey, rowToAdvisory, rubricFor, runAdvisor, runGoldenEval, runStrategyEvalWithAttribution, setTokenizer, wilsonLowerBound, withAltBlindDisciplineContract, withAltDisciplineContract, withDisciplineContract };
4058
+ 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, CompileOptions, CompilePolicy, CompileResult, CompiledRequest, type CreateDelegateOpts, DECOMPOSITION_TEMPLATES, DECOMPOSITION_TEMPLATES_VERSION, DEFAULT_FINDINGS_ENDPOINT, DEFAULT_JUDGE_MODEL, 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, _testResetOutcomeSourceWarning, _testResetPromotions, _testWaitForMeasuredFailureRefresh, _testWaitForPromotionsRefresh, altBlindGatesBlockFor, altGatesBlockFor, applyArchetypeConvention, applySectionRewrites, attachCacheControlToStreamTextInput, awaitMeasuredFailureReady, awaitPromotionsReady, 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, prefetchPromotions, probeShadow, profileToRow, readBrainReadEnv, record, recordGoldenIr, recordOutcome, recordShadowProbe, renderIrForJudge, resetTokenizer, resolveConventionsForProfile, resolveOutcomeSource, resolvePricingAt, resolveProviderKey, rowToAdvisory, rubricFor, runAdvisor, runGoldenEval, runStrategyEvalWithAttribution, setTokenizer, wilsonLowerBound, withAltBlindDisciplineContract, withAltDisciplineContract, withDisciplineContract };
package/dist/index.d.ts CHANGED
@@ -1,61 +1,13 @@
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 OutcomeSource, i as OracleScore, j as Adapter, k as PerAxisMetrics, l as Provider, m as ChainEntry, G as Grounding } from './ir-BWnE6LaB.js';
2
- export { n as CallAttempt, o as CallError, p as ChainModelEntry, q as ChainWithGrounding, r as Constraints, E as EffortLevel, s as GoldenCaptureOptions, H as HistoryCachePolicy, I as IntentDeclaration, M as Message, t as MutationApplied, u as NormalizedTokens, v as OutcomeKind, w as PerAxisMetricsByModel, x as PromptSection, y as SectionKind, z as ShadowProbeConfig, T as ToolCall, D as ToolDefinition, J as captureGoldenIr, K as hasMutation, L as mutationId, Q as parseGoldenCaptureRate, U as resolveGoldenCaptureRate, V as shouldCaptureGolden } from './ir-BWnE6LaB.js';
3
- import { ModelProfile, ArchetypeConvention } from './profiles.js';
4
- export { ALIASES, CacheStrategy, CliffRule, LATENCY_TIER_MS, LatencyTier, LoweringSpec, RecoveryRule, StructuredOutputCapability, SystemPromptMode, _testClearConsumerProfiles, allProfiles, bestEffortProfile, getProfile, inferProviderFromId, latencyTierOf, profilesByProvider, registerProfiles, resolveModelAlias, tryGetProfile } from './profiles.js';
1
+ import { C as CompileOptions } from './compile-BlMXv6QT.js';
2
+ import { N as NormalizedResponse, A as ApiKeys, P as ProviderOverrides, C as CompiledRequest, a as CompilePolicy, b as PromptIR, c as CallOptions, d as CallResult, S as SystemModelMessage, e as CompileResult, B as BestPracticeAdvisory, F as FallbackReason, f as SectionRewrite, R as RecordInput, g as RecordOutcomeInput, O as OutcomeResult, h as OutcomeSource, i as OracleScore, j as Adapter, k as PerAxisMetrics, l as Provider, m as ChainEntry, G as Grounding } from './ir-DbvOFKF-.js';
3
+ export { n as CallAttempt, o as CallError, p as ChainModelEntry, q as ChainWithGrounding, r as Constraints, E as EffortLevel, s as GoldenCaptureOptions, H as HistoryCachePolicy, I as IntentDeclaration, M as Message, t as MutationApplied, u as NormalizedTokens, v as OutcomeKind, w as PerAxisMetricsByModel, x as PromptSection, y as SectionKind, z as ShadowProbeConfig, T as ToolCall, D as ToolDefinition, J as captureGoldenIr, K as hasMutation, L as mutationId, Q as parseGoldenCaptureRate, U as resolveGoldenCaptureRate, V as shouldCaptureGolden } from './ir-DbvOFKF-.js';
5
4
  export { BrainForwardConfig, BrainForwardRoutes, createBrainForwardRoutes } from './brain-proxy.js';
6
5
  export { KEY_FINGERPRINT_DOMAIN, KEY_FINGERPRINT_LENGTH, KeyHealthConfig, KeyHealthProvider, KeyHealthResponseBody, KeyHealthResult, KeyHealthRoute, createKeyHealthRoute, keyFingerprint } from './key-health.js';
6
+ import { ModelProfile, ArchetypeConvention } from './profiles.js';
7
+ export { ALIASES, CacheStrategy, CliffRule, LATENCY_TIER_MS, LatencyTier, LoweringSpec, RecoveryRule, StructuredOutputCapability, SystemPromptMode, _testClearConsumerProfiles, allProfiles, bestEffortProfile, getProfile, inferProviderFromId, latencyTierOf, profilesByProvider, registerProfiles, resolveModelAlias, tryGetProfile } from './profiles.js';
7
8
  import { IntentArchetypeName, OutputMode } from './dialect.js';
8
9
  export { ALL_ARCHETYPES, ContextBucket, DIALECT_VERSION, HistoryDepth, INTENT_ARCHETYPES, ShapeSignature, ToolCountBucket, bucketContext, bucketHistory, bucketToolCount, hashShape, isArchetype, learningKey } from './dialect.js';
9
10
 
10
- /**
11
- * compile() — the main orchestrator.
12
- *
13
- * Runs all passes in order, picks a target, lowers to wire format, returns
14
- * a CompileResult the caller uses to make the actual provider call.
15
- *
16
- * Pure function in v2.0.0-alpha.1: no network, no I/O, no mutation cache yet.
17
- * Mutation cache will be added in v2.1 when the brain has data to push.
18
- */
19
-
20
- interface CompileOptions {
21
- /** Custom profile resolver — for tests or custom profile sets. */
22
- profileResolver?: (id: string) => ModelProfile;
23
- /** Tool relevance threshold (default 0.2). */
24
- toolRelevanceThreshold?: number;
25
- /** History compression — turns count threshold (default 8). */
26
- compressHistoryAfter?: number;
27
- /**
28
- * History compression — token threshold (alpha.7). When total history
29
- * tokens exceed this AND there are more recent turns to keep, compress
30
- * even when count threshold is below `compressHistoryAfter`. Catches
31
- * fat-message bloat (tool-using agents pack many tool-call/result pairs
32
- * into single assistant messages — count stays low, tokens explode).
33
- * Default undefined (disabled — backward-compatible).
34
- */
35
- compressHistoryAboveTokens?: number;
36
- /**
37
- * Consumer-declared policy. Filters blocked models, enforces cost
38
- * ceiling, boosts preferred. See CompilePolicy in ir.ts.
39
- */
40
- policy?: CompilePolicy;
41
- /**
42
- * alpha.68 / Release A (delegation-fanout-accelerator §5.0, R0 linkage) —
43
- * transport for the fan-out parent handle. Threaded from
44
- * `CallOptions.parentHandle` on the call() path (and settable directly on the
45
- * public compile() path). Release A does NOT route on it — it only labels the
46
- * outcome row (fanout_role / trace_id / parent_handle) at record-registration
47
- * time. `registerCompile` reads it to derive the linkage. Absent ⇒ root call.
48
- */
49
- parentHandle?: string;
50
- /**
51
- * alpha.92 — lower for a gateway route (execute-leg contract). Threaded
52
- * from `CallOptions.route`. The canonical profile drives every pass
53
- * (cliffs, scoring, budgets) unchanged; only the wire destination and the
54
- * learning-key encoding change. Absent ⇒ direct vendor wire.
55
- */
56
- route?: 'direct' | 'openrouter';
57
- }
58
-
59
11
  /**
60
12
  * execute() — fire a CompiledRequest at the right provider, normalize the
61
13
  * response shape across providers.
@@ -873,6 +825,7 @@ declare function buildShadowProbeRow(input: ShadowProbeRecordInput): {
873
825
  latency_candidate_ms: number | null;
874
826
  prompt_fidelity: number;
875
827
  replay_source: 'inline-full-ir';
828
+ evidence_basis: 'controlled';
876
829
  outcome: 'completed' | 'aborted_latency_budget' | 'skipped_slow_tier_sync' | 'candidate_error';
877
830
  error_class: string | null;
878
831
  };
@@ -1281,7 +1234,7 @@ declare function runStrategyEvalWithAttribution(opts: Omit<GoldenEvalOptions, 'a
1281
1234
  * guard in `tests/version.test.ts` fails the suite (and therefore
1282
1235
  * `prepublishOnly`) when they diverge — a stale constant cannot reach npm.
1283
1236
  */
1284
- declare const LIBRARY_VERSION = "2.0.0-alpha.92";
1237
+ declare const LIBRARY_VERSION = "2.0.0-alpha.93";
1285
1238
 
1286
1239
  /**
1287
1240
  * Oracle contract — how an app tells the brain whether a response was good.
@@ -4102,4 +4055,4 @@ declare function planDecomposition(args: PlanDecompositionArgs): DecompositionPl
4102
4055
  */
4103
4056
  declare function compile(ir: PromptIR, opts?: CompileOptions): CompileResult;
4104
4057
 
4105
- 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_JUDGE_MODEL, 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, _testResetOutcomeSourceWarning, _testResetPromotions, _testWaitForMeasuredFailureRefresh, _testWaitForPromotionsRefresh, altBlindGatesBlockFor, altGatesBlockFor, applyArchetypeConvention, applySectionRewrites, attachCacheControlToStreamTextInput, awaitMeasuredFailureReady, awaitPromotionsReady, 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, prefetchPromotions, probeShadow, profileToRow, readBrainReadEnv, record, recordGoldenIr, recordOutcome, recordShadowProbe, renderIrForJudge, resetTokenizer, resolveConventionsForProfile, resolveOutcomeSource, resolvePricingAt, resolveProviderKey, rowToAdvisory, rubricFor, runAdvisor, runGoldenEval, runStrategyEvalWithAttribution, setTokenizer, wilsonLowerBound, withAltBlindDisciplineContract, withAltDisciplineContract, withDisciplineContract };
4058
+ 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, CompileOptions, CompilePolicy, CompileResult, CompiledRequest, type CreateDelegateOpts, DECOMPOSITION_TEMPLATES, DECOMPOSITION_TEMPLATES_VERSION, DEFAULT_FINDINGS_ENDPOINT, DEFAULT_JUDGE_MODEL, 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, _testResetOutcomeSourceWarning, _testResetPromotions, _testWaitForMeasuredFailureRefresh, _testWaitForPromotionsRefresh, altBlindGatesBlockFor, altGatesBlockFor, applyArchetypeConvention, applySectionRewrites, attachCacheControlToStreamTextInput, awaitMeasuredFailureReady, awaitPromotionsReady, 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, prefetchPromotions, probeShadow, profileToRow, readBrainReadEnv, record, recordGoldenIr, recordOutcome, recordShadowProbe, renderIrForJudge, resetTokenizer, resolveConventionsForProfile, resolveOutcomeSource, resolvePricingAt, resolveProviderKey, rowToAdvisory, rubricFor, runAdvisor, runGoldenEval, runStrategyEvalWithAttribution, setTokenizer, wilsonLowerBound, withAltBlindDisciplineContract, withAltDisciplineContract, withDisciplineContract };
package/dist/index.js CHANGED
@@ -6464,7 +6464,7 @@ function validateFinalFit(ir, profile, tokens) {
6464
6464
  }
6465
6465
 
6466
6466
  // src/version.ts
6467
- var LIBRARY_VERSION = "2.0.0-alpha.92";
6467
+ var LIBRARY_VERSION = "2.0.0-alpha.93";
6468
6468
 
6469
6469
  // src/pricing-brain.ts
6470
6470
  function isPricingRow(x) {
@@ -7163,6 +7163,12 @@ function buildShadowProbeRow(input) {
7163
7163
  // prompt-fidelity guard never fires on these rows.
7164
7164
  prompt_fidelity: 1,
7165
7165
  replay_source: "inline-full-ir",
7166
+ // alpha.93 (migration 068) — shadow probes replay the SAME full IR to
7167
+ // the candidate: controlled by construction. Written at write time, per
7168
+ // the mig-057 lesson (a marker inferred later can disagree with itself).
7169
+ // The column default is 'observational' precisely so only writers that
7170
+ // KNOW they are controlled say so.
7171
+ evidence_basis: "controlled",
7166
7172
  // alpha — migration 029. 'completed' is the default completed-probe shape;
7167
7173
  // diagnostic rows (aborted/skipped/errored) pass the explicit class.
7168
7174
  outcome: input.outcome ?? "completed",