@warmdrift/kgauto-compiler 2.0.0-alpha.27 → 2.0.0-alpha.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-WXCFWUCN.mjs +678 -0
- package/dist/glassbox/index.d.mts +3 -3
- package/dist/glassbox/index.d.ts +3 -3
- package/dist/glassbox-routes/index.d.mts +88 -6
- package/dist/glassbox-routes/index.d.ts +88 -6
- package/dist/glassbox-routes/index.js +1820 -8
- package/dist/glassbox-routes/index.mjs +320 -8
- package/dist/index.d.mts +184 -3
- package/dist/index.d.ts +184 -3
- package/dist/index.js +161 -5
- package/dist/index.mjs +107 -580
- package/dist/{ir-B_XX2LAO.d.ts → ir-5W0efxt9.d.ts} +86 -1
- package/dist/{ir-B9zqlwjH.d.mts → ir-MXCJA8L7.d.mts} +86 -1
- package/dist/profiles.d.mts +1 -1
- package/dist/profiles.d.ts +1 -1
- package/dist/{types-bt0aVJb8.d.ts → types-CiZ9HLIU.d.ts} +1 -1
- package/dist/{types-o9etg93a.d.mts → types-sDZQzPM6.d.mts} +1 -1
- package/package.json +1 -1
|
@@ -346,7 +346,57 @@ interface BestPracticeAdvisory {
|
|
|
346
346
|
* - `'architecture-change'` — the issue isn't fixable at the kgauto layer
|
|
347
347
|
*/
|
|
348
348
|
recommendationType?: 'model-swap' | 'prompt-fix' | 'caching-fix' | 'no-ai-needed' | 'tier-down' | 'architecture-change';
|
|
349
|
+
/**
|
|
350
|
+
* alpha.28 — when a rule wants to surface a specific structural adaptation
|
|
351
|
+
* (not just a swap or a prompt fix), it attaches the adapter shape here.
|
|
352
|
+
* Shape is the canonical {@link Adapter} discriminated union defined in
|
|
353
|
+
* this module; `compatibility.ts` re-exports it so
|
|
354
|
+
* `getModelCompatibility()` and `BestPracticeAdvisory.suggestedAdaptation`
|
|
355
|
+
* share one source of truth.
|
|
356
|
+
*
|
|
357
|
+
* Today fired by `archetype-perf-floor-breach` (alpha.28) when a
|
|
358
|
+
* documented adapter exists for the chosen model's archetype cliff.
|
|
359
|
+
* Absent on rules without a structural adapter (caching-off-on-claude,
|
|
360
|
+
* tool-bloat, etc.) and on the `reject` branch of
|
|
361
|
+
* `archetype-perf-floor-breach` where no adapter would help.
|
|
362
|
+
*
|
|
363
|
+
* CLOSED discriminated union (R3 from consultation doc) — future adapter
|
|
364
|
+
* parameters extend the union in `compatibility.ts` in named alpha
|
|
365
|
+
* releases. No `| string` escape hatch; consumer code can write
|
|
366
|
+
* exhaustive `switch (suggestedAdaptation.parameter)`.
|
|
367
|
+
*
|
|
368
|
+
* Phase 2 cross-builder coherence: Builder A's
|
|
369
|
+
* `AdvisoryRecord.suggestedAdaptation` (in `glassbox-routes/types.ts`)
|
|
370
|
+
* MUST type to the same union. Phase 2 integration verifies.
|
|
371
|
+
*/
|
|
372
|
+
suggestedAdaptation?: Adapter;
|
|
349
373
|
}
|
|
374
|
+
/**
|
|
375
|
+
* alpha.28 — adapter shape attached to advisories and returned by
|
|
376
|
+
* `getModelCompatibility()`. A CLOSED discriminated union: future adapter
|
|
377
|
+
* parameters extend it explicitly in named alpha releases. NO `| string`
|
|
378
|
+
* escape hatch — consumer policy code SHOULD write exhaustive
|
|
379
|
+
* `switch (adapter.parameter)` and rely on the compiler to flag
|
|
380
|
+
* "I added a new adapter parameter and forgot to update consumer policy."
|
|
381
|
+
*
|
|
382
|
+
* Defined here (in `ir.ts`, the foundational types module) and re-exported
|
|
383
|
+
* from `compatibility.ts` for ergonomic consumer imports. Anchoring it
|
|
384
|
+
* here avoids the import cycle that would form if both files tried to be
|
|
385
|
+
* the source of truth (ir.ts → compatibility.ts → profiles.ts → ir.ts).
|
|
386
|
+
*
|
|
387
|
+
* alpha.28 variants:
|
|
388
|
+
* - `{ parameter: 'toolOrchestration'; value: 'sequential'; consequence }`
|
|
389
|
+
* Lifts DeepSeek V4-family on `hunt` from the sequential-tool cliff
|
|
390
|
+
* (L-040). `consequence` is consumer-renderable plain English.
|
|
391
|
+
*
|
|
392
|
+
* Future alpha releases will add e.g. `parallelToolCalls`, `maxTools`,
|
|
393
|
+
* `thinkingBudget` (per tt-intel-Cairn priority list).
|
|
394
|
+
*/
|
|
395
|
+
type Adapter = {
|
|
396
|
+
parameter: 'toolOrchestration';
|
|
397
|
+
value: 'sequential';
|
|
398
|
+
consequence: string;
|
|
399
|
+
};
|
|
350
400
|
interface CompileResult {
|
|
351
401
|
/** Unique handle for this call — pass to record() to correlate the outcome. */
|
|
352
402
|
handle: string;
|
|
@@ -695,6 +745,41 @@ interface RecordInput {
|
|
|
695
745
|
* Empty array / undefined → no second POST fires.
|
|
696
746
|
*/
|
|
697
747
|
advisories?: BestPracticeAdvisory[];
|
|
748
|
+
/**
|
|
749
|
+
* alpha.28 — Glass-Box renderer substrate fields (migration 018).
|
|
750
|
+
*
|
|
751
|
+
* All optional. When omitted, brain stores NULL and the renderer falls
|
|
752
|
+
* back to "—" / hidden rows. Library callers (`call.ts`) populate what
|
|
753
|
+
* they observe; adapter / SDK consumers can populate the rest from their
|
|
754
|
+
* own provider response surface.
|
|
755
|
+
*/
|
|
756
|
+
/**
|
|
757
|
+
* Provider finish reason. Captured from NormalizedResponse.finishReason
|
|
758
|
+
* (Anthropic `stop_reason`, Google `finishReason`, OpenAI `finish_reason`).
|
|
759
|
+
* Lower-case canonicalization is the brain's job; consumers can pass
|
|
760
|
+
* raw provider strings.
|
|
761
|
+
*/
|
|
762
|
+
finishReason?: string;
|
|
763
|
+
/**
|
|
764
|
+
* End-to-end wall-clock latency in ms. Distinct from `latencyMs` only
|
|
765
|
+
* insofar as `latencyMs` was the historical name for the same metric;
|
|
766
|
+
* `totalMs` is the new column on `compile_outcomes` (migration 018).
|
|
767
|
+
* When omitted, brain mirrors `latency_ms`.
|
|
768
|
+
*/
|
|
769
|
+
totalMs?: number;
|
|
770
|
+
/** Tools kept after the tool-relevance pass. */
|
|
771
|
+
toolsCount?: number;
|
|
772
|
+
/** Number of history messages at compile time. */
|
|
773
|
+
historyDepth?: number;
|
|
774
|
+
/** Rendered system prompt size in characters. */
|
|
775
|
+
systemPromptChars?: number;
|
|
776
|
+
/** Model originally targeted when a fallback fired. */
|
|
777
|
+
fellOverFrom?: string;
|
|
778
|
+
/**
|
|
779
|
+
* Why the fallback fired. Closed set mirroring CallResult.fallbackReason —
|
|
780
|
+
* keep in sync with the wire-contract enum (TraceDetail.fallbackReason).
|
|
781
|
+
*/
|
|
782
|
+
fallbackReason?: 'rate_limit' | 'provider_auth_failed' | 'provider_error' | 'cliff' | 'cost_cap' | 'contract_violation';
|
|
698
783
|
}
|
|
699
784
|
/**
|
|
700
785
|
* alpha.20 Entry 4: kinds of consumer-declared outcomes feeding the quality
|
|
@@ -834,4 +919,4 @@ interface PerAxisMetrics {
|
|
|
834
919
|
/** Per-axis metrics keyed by model — used for chain-comparison views. */
|
|
835
920
|
type PerAxisMetricsByModel = Record<string, PerAxisMetrics>;
|
|
836
921
|
|
|
837
|
-
export { type ApiKeys as A, type BestPracticeAdvisory as B, type CompilePolicy as C, type FallbackReason as F, type Grounding as G, type HistoryCachePolicy as H, type IntentDeclaration as I, type Message as M, type NormalizedResponse as N, type OutcomeResult as O, type ProviderOverrides as P, type RecordInput as R, type ToolCall as T, type CompiledRequest as a, type PromptIR as b, type CallOptions as c, type CallResult as d, type RecordOutcomeInput as e, type OracleScore as f, type CompileResult as g, type
|
|
922
|
+
export { type ApiKeys as A, type BestPracticeAdvisory as B, type CompilePolicy as C, type FallbackReason as F, type Grounding as G, type HistoryCachePolicy as H, type IntentDeclaration as I, type Message as M, type NormalizedResponse as N, type OutcomeResult as O, type ProviderOverrides as P, type RecordInput as R, type ToolCall as T, type CompiledRequest as a, type PromptIR as b, type CallOptions as c, type CallResult as d, type RecordOutcomeInput as e, type OracleScore as f, type CompileResult as g, type Adapter as h, type PerAxisMetrics as i, type Provider as j, type ChainEntry as k, type CallAttempt as l, CallError as m, type ChainWithGrounding as n, type Constraints as o, type MutationApplied as p, type NormalizedTokens as q, type OutcomeKind as r, type PerAxisMetricsByModel as s, type PromptSection as t, type ToolDefinition as u };
|
|
@@ -346,7 +346,57 @@ interface BestPracticeAdvisory {
|
|
|
346
346
|
* - `'architecture-change'` — the issue isn't fixable at the kgauto layer
|
|
347
347
|
*/
|
|
348
348
|
recommendationType?: 'model-swap' | 'prompt-fix' | 'caching-fix' | 'no-ai-needed' | 'tier-down' | 'architecture-change';
|
|
349
|
+
/**
|
|
350
|
+
* alpha.28 — when a rule wants to surface a specific structural adaptation
|
|
351
|
+
* (not just a swap or a prompt fix), it attaches the adapter shape here.
|
|
352
|
+
* Shape is the canonical {@link Adapter} discriminated union defined in
|
|
353
|
+
* this module; `compatibility.ts` re-exports it so
|
|
354
|
+
* `getModelCompatibility()` and `BestPracticeAdvisory.suggestedAdaptation`
|
|
355
|
+
* share one source of truth.
|
|
356
|
+
*
|
|
357
|
+
* Today fired by `archetype-perf-floor-breach` (alpha.28) when a
|
|
358
|
+
* documented adapter exists for the chosen model's archetype cliff.
|
|
359
|
+
* Absent on rules without a structural adapter (caching-off-on-claude,
|
|
360
|
+
* tool-bloat, etc.) and on the `reject` branch of
|
|
361
|
+
* `archetype-perf-floor-breach` where no adapter would help.
|
|
362
|
+
*
|
|
363
|
+
* CLOSED discriminated union (R3 from consultation doc) — future adapter
|
|
364
|
+
* parameters extend the union in `compatibility.ts` in named alpha
|
|
365
|
+
* releases. No `| string` escape hatch; consumer code can write
|
|
366
|
+
* exhaustive `switch (suggestedAdaptation.parameter)`.
|
|
367
|
+
*
|
|
368
|
+
* Phase 2 cross-builder coherence: Builder A's
|
|
369
|
+
* `AdvisoryRecord.suggestedAdaptation` (in `glassbox-routes/types.ts`)
|
|
370
|
+
* MUST type to the same union. Phase 2 integration verifies.
|
|
371
|
+
*/
|
|
372
|
+
suggestedAdaptation?: Adapter;
|
|
349
373
|
}
|
|
374
|
+
/**
|
|
375
|
+
* alpha.28 — adapter shape attached to advisories and returned by
|
|
376
|
+
* `getModelCompatibility()`. A CLOSED discriminated union: future adapter
|
|
377
|
+
* parameters extend it explicitly in named alpha releases. NO `| string`
|
|
378
|
+
* escape hatch — consumer policy code SHOULD write exhaustive
|
|
379
|
+
* `switch (adapter.parameter)` and rely on the compiler to flag
|
|
380
|
+
* "I added a new adapter parameter and forgot to update consumer policy."
|
|
381
|
+
*
|
|
382
|
+
* Defined here (in `ir.ts`, the foundational types module) and re-exported
|
|
383
|
+
* from `compatibility.ts` for ergonomic consumer imports. Anchoring it
|
|
384
|
+
* here avoids the import cycle that would form if both files tried to be
|
|
385
|
+
* the source of truth (ir.ts → compatibility.ts → profiles.ts → ir.ts).
|
|
386
|
+
*
|
|
387
|
+
* alpha.28 variants:
|
|
388
|
+
* - `{ parameter: 'toolOrchestration'; value: 'sequential'; consequence }`
|
|
389
|
+
* Lifts DeepSeek V4-family on `hunt` from the sequential-tool cliff
|
|
390
|
+
* (L-040). `consequence` is consumer-renderable plain English.
|
|
391
|
+
*
|
|
392
|
+
* Future alpha releases will add e.g. `parallelToolCalls`, `maxTools`,
|
|
393
|
+
* `thinkingBudget` (per tt-intel-Cairn priority list).
|
|
394
|
+
*/
|
|
395
|
+
type Adapter = {
|
|
396
|
+
parameter: 'toolOrchestration';
|
|
397
|
+
value: 'sequential';
|
|
398
|
+
consequence: string;
|
|
399
|
+
};
|
|
350
400
|
interface CompileResult {
|
|
351
401
|
/** Unique handle for this call — pass to record() to correlate the outcome. */
|
|
352
402
|
handle: string;
|
|
@@ -695,6 +745,41 @@ interface RecordInput {
|
|
|
695
745
|
* Empty array / undefined → no second POST fires.
|
|
696
746
|
*/
|
|
697
747
|
advisories?: BestPracticeAdvisory[];
|
|
748
|
+
/**
|
|
749
|
+
* alpha.28 — Glass-Box renderer substrate fields (migration 018).
|
|
750
|
+
*
|
|
751
|
+
* All optional. When omitted, brain stores NULL and the renderer falls
|
|
752
|
+
* back to "—" / hidden rows. Library callers (`call.ts`) populate what
|
|
753
|
+
* they observe; adapter / SDK consumers can populate the rest from their
|
|
754
|
+
* own provider response surface.
|
|
755
|
+
*/
|
|
756
|
+
/**
|
|
757
|
+
* Provider finish reason. Captured from NormalizedResponse.finishReason
|
|
758
|
+
* (Anthropic `stop_reason`, Google `finishReason`, OpenAI `finish_reason`).
|
|
759
|
+
* Lower-case canonicalization is the brain's job; consumers can pass
|
|
760
|
+
* raw provider strings.
|
|
761
|
+
*/
|
|
762
|
+
finishReason?: string;
|
|
763
|
+
/**
|
|
764
|
+
* End-to-end wall-clock latency in ms. Distinct from `latencyMs` only
|
|
765
|
+
* insofar as `latencyMs` was the historical name for the same metric;
|
|
766
|
+
* `totalMs` is the new column on `compile_outcomes` (migration 018).
|
|
767
|
+
* When omitted, brain mirrors `latency_ms`.
|
|
768
|
+
*/
|
|
769
|
+
totalMs?: number;
|
|
770
|
+
/** Tools kept after the tool-relevance pass. */
|
|
771
|
+
toolsCount?: number;
|
|
772
|
+
/** Number of history messages at compile time. */
|
|
773
|
+
historyDepth?: number;
|
|
774
|
+
/** Rendered system prompt size in characters. */
|
|
775
|
+
systemPromptChars?: number;
|
|
776
|
+
/** Model originally targeted when a fallback fired. */
|
|
777
|
+
fellOverFrom?: string;
|
|
778
|
+
/**
|
|
779
|
+
* Why the fallback fired. Closed set mirroring CallResult.fallbackReason —
|
|
780
|
+
* keep in sync with the wire-contract enum (TraceDetail.fallbackReason).
|
|
781
|
+
*/
|
|
782
|
+
fallbackReason?: 'rate_limit' | 'provider_auth_failed' | 'provider_error' | 'cliff' | 'cost_cap' | 'contract_violation';
|
|
698
783
|
}
|
|
699
784
|
/**
|
|
700
785
|
* alpha.20 Entry 4: kinds of consumer-declared outcomes feeding the quality
|
|
@@ -834,4 +919,4 @@ interface PerAxisMetrics {
|
|
|
834
919
|
/** Per-axis metrics keyed by model — used for chain-comparison views. */
|
|
835
920
|
type PerAxisMetricsByModel = Record<string, PerAxisMetrics>;
|
|
836
921
|
|
|
837
|
-
export { type ApiKeys as A, type BestPracticeAdvisory as B, type CompilePolicy as C, type FallbackReason as F, type Grounding as G, type HistoryCachePolicy as H, type IntentDeclaration as I, type Message as M, type NormalizedResponse as N, type OutcomeResult as O, type ProviderOverrides as P, type RecordInput as R, type ToolCall as T, type CompiledRequest as a, type PromptIR as b, type CallOptions as c, type CallResult as d, type RecordOutcomeInput as e, type OracleScore as f, type CompileResult as g, type
|
|
922
|
+
export { type ApiKeys as A, type BestPracticeAdvisory as B, type CompilePolicy as C, type FallbackReason as F, type Grounding as G, type HistoryCachePolicy as H, type IntentDeclaration as I, type Message as M, type NormalizedResponse as N, type OutcomeResult as O, type ProviderOverrides as P, type RecordInput as R, type ToolCall as T, type CompiledRequest as a, type PromptIR as b, type CallOptions as c, type CallResult as d, type RecordOutcomeInput as e, type OracleScore as f, type CompileResult as g, type Adapter as h, type PerAxisMetrics as i, type Provider as j, type ChainEntry as k, type CallAttempt as l, CallError as m, type ChainWithGrounding as n, type Constraints as o, type MutationApplied as p, type NormalizedTokens as q, type OutcomeKind as r, type PerAxisMetricsByModel as s, type PromptSection as t, type ToolDefinition as u };
|
package/dist/profiles.d.mts
CHANGED
package/dist/profiles.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { p as MutationApplied, B as BestPracticeAdvisory, F as FallbackReason, l as CallAttempt } from './ir-5W0efxt9.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Glass-Box observability types (alpha.17).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { p as MutationApplied, B as BestPracticeAdvisory, F as FallbackReason, l as CallAttempt } from './ir-MXCJA8L7.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Glass-Box observability types (alpha.17).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@warmdrift/kgauto-compiler",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.28",
|
|
4
4
|
"description": "Prompt compiler + central learning brain for multi-model AI apps. Swap models without rewriting prompts.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|