@warmdrift/kgauto-compiler 2.0.0-alpha.81 → 2.0.0-alpha.83

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/index.mjs CHANGED
@@ -19,7 +19,7 @@ import {
19
19
  LIBRARY_VERSION,
20
20
  createKeyHealthRoute,
21
21
  keyFingerprint
22
- } from "./chunk-OZNAGO4U.mjs";
22
+ } from "./chunk-QEFIAAE7.mjs";
23
23
  import {
24
24
  ABSOLUTE_FLOOR,
25
25
  ARCHETYPE_FLOOR_DEFAULT,
@@ -2506,6 +2506,20 @@ function detectSingleModelArray(ir, policy) {
2506
2506
  }
2507
2507
  ];
2508
2508
  }
2509
+ function suppressedRecommendationReason(ir, archetype, altProfile) {
2510
+ if (getMeasuredFailureVerdict({ appId: ir.appId, archetype, model: altProfile.id })?.gated === true) {
2511
+ return "measured-failure-gate";
2512
+ }
2513
+ if (ir.constraints?.structuredOutput && effectiveConventions(altProfile).some(
2514
+ (c) => c.archetype === archetype && c.structuredOutputHint === "avoid"
2515
+ )) {
2516
+ return "schema-weakness-convention";
2517
+ }
2518
+ if (getRecentRollback({ appId: ir.appId, archetype, model: altProfile.id }) !== void 0) {
2519
+ return "recent-rollback";
2520
+ }
2521
+ return void 0;
2522
+ }
2509
2523
  function openPostureRemedyClause(archetype, recommended, resolveProfile) {
2510
2524
  const openChain = getDefaultFallbackChain({ archetype, posture: "open" });
2511
2525
  const openPrimaryId = openChain[0];
@@ -2543,25 +2557,7 @@ function detectCostMismatchedArchetype(ir, profile, phase2) {
2543
2557
  if (altScore.score < QUALITY_FLOOR_FOR_RECOMMENDATION) continue;
2544
2558
  if (altScore.score < chosenScore.score) continue;
2545
2559
  if (altProfile.costInputPer1m >= profile.costInputPer1m) continue;
2546
- if (getMeasuredFailureVerdict({
2547
- appId: ir.appId,
2548
- archetype,
2549
- model: altProfile.id
2550
- })?.gated === true) {
2551
- continue;
2552
- }
2553
- if (ir.constraints?.structuredOutput && effectiveConventions(altProfile).some(
2554
- (c) => c.archetype === archetype && c.structuredOutputHint === "avoid"
2555
- )) {
2556
- continue;
2557
- }
2558
- if (getRecentRollback({
2559
- appId: ir.appId,
2560
- archetype,
2561
- model: altProfile.id
2562
- }) !== void 0) {
2563
- continue;
2564
- }
2560
+ if (suppressedRecommendationReason(ir, archetype, altProfile)) continue;
2565
2561
  if (!bestAlt || altScore.score > bestAlt.score.score || altScore.score === bestAlt.score.score && altProfile.costInputPer1m < bestAlt.profile.costInputPer1m) {
2566
2562
  bestAlt = { id: altId, profile: altProfile, score: altScore };
2567
2563
  }
@@ -2619,6 +2615,7 @@ function detectTierDown(ir, profile, phase2) {
2619
2615
  if (altScore.score < QUALITY_FLOOR_FOR_RECOMMENDATION) continue;
2620
2616
  if (altScore.score < chosenScore.score) continue;
2621
2617
  if (altProfile.costInputPer1m > chosenCost * TIER_DOWN_COST_RATIO) continue;
2618
+ if (suppressedRecommendationReason(ir, archetype, altProfile)) continue;
2622
2619
  if (!bestAlt || altProfile.costInputPer1m < bestAlt.profile.costInputPer1m || altProfile.costInputPer1m === bestAlt.profile.costInputPer1m && altScore.score > bestAlt.score.score) {
2623
2620
  bestAlt = { id: altId, profile: altProfile, score: altScore };
2624
2621
  }
@@ -2665,7 +2662,18 @@ function detectArchetypePerfFloorBreach(ir, profile) {
2665
2662
  // library pick" endorsement could land on a materially pricier
2666
2663
  // primary. The floor recommendation stands; the axis is now named,
2667
2664
  // and the cost-ordered variant is offered alongside it.
2668
- suggestion: `Swap to a model whose archetypePerf for ${ir.intent.archetype} clears the floor. Use \`getModelCompatibility(candidateId, { archetype: '${ir.intent.archetype}' })\` to vet candidates, or \`getDefaultFallbackChain({ archetype: '${ir.intent.archetype}', posture: 'open' })\` for a library-picked chain that respects the floor by construction \u2014 note that chain is ordered by archetype performance, NOT cost, so it may select a pricier primary than you run today. Add \`optimizeFor: 'cost'\` for a chain that clears the same floor cheapest-first.`,
2665
+ //
2666
+ // alpha.82 (cc-Cairn 2026-07-29, follow-on 1): the suggestion read as
2667
+ // advice about the ARCHETYPE when it is a fact about ONE CALL. Model
2668
+ // selection is input-size dependent, so a rule that fires on the
2669
+ // small-payload tail of a path whose typical case clears the floor
2670
+ // reads as "your primary is wrong" when the accurate statement is
2671
+ // "this call landed here." Ground truth for the wording: tt-intel's
2672
+ // open critical is `gemini-2.5-flash-lite` (ask, 5/10) selected at
2673
+ // ~2.1K tokens_in, while `claude-opus-5` served the same archetype at
2674
+ // ~22K the same day — cc read the evidence set as self-contradictory
2675
+ // precisely because the text did not say which call it described.
2676
+ suggestion: `This fired for \`${profile.id}\`, the model selected for THIS call \u2014 selection is input-size dependent, so other calls on \`${ir.intent.archetype}\` may pick a different model that clears the floor. Swap to a model whose archetypePerf for ${ir.intent.archetype} clears the floor. Use \`getModelCompatibility(candidateId, { archetype: '${ir.intent.archetype}' })\` to vet candidates, or \`getDefaultFallbackChain({ archetype: '${ir.intent.archetype}', posture: 'open' })\` for a library-picked chain that respects the floor by construction \u2014 note that chain is ordered by archetype performance, NOT cost, so it may select a pricier primary than you run today. Add \`optimizeFor: 'cost'\` for a chain that clears the same floor cheapest-first. To stop this model being selected at all, pass \`policy.blockedModels: ['${profile.id}']\`.`,
2669
2677
  recommendationType: "model-swap",
2670
2678
  docsUrl: "https://github.com/stue/command-center/blob/main/interfaces/kgauto.md#best-practice-advisories"
2671
2679
  }
@@ -3959,13 +3967,16 @@ var FAILED = /* @__PURE__ */ Symbol("parse-failed");
3959
3967
 
3960
3968
  // src/ir.ts
3961
3969
  function mutationId(m) {
3962
- return typeof m === "string" ? m : m.id;
3970
+ if (m == null) return void 0;
3971
+ if (typeof m === "string") return m;
3972
+ return typeof m.id === "string" ? m.id : void 0;
3963
3973
  }
3964
3974
  function hasMutation(list, idOrPrefix) {
3965
3975
  if (!Array.isArray(list)) return false;
3966
3976
  const prefix = idOrPrefix.endsWith("*") ? idOrPrefix.slice(0, -1) : void 0;
3967
3977
  return list.some((m) => {
3968
3978
  const id = mutationId(m);
3979
+ if (id === void 0) return false;
3969
3980
  return prefix !== void 0 ? id.startsWith(prefix) : id === idOrPrefix;
3970
3981
  });
3971
3982
  }
@@ -5641,6 +5652,13 @@ function combineOrderSwappedVerdicts(run1, run2) {
5641
5652
  if (run1 === run2) return run1;
5642
5653
  return "tied";
5643
5654
  }
5655
+ var ALT_STRATEGY_IDS = [
5656
+ "discipline-gates-v1-alt",
5657
+ "discipline-gates-v1-alt-blind"
5658
+ ];
5659
+ function isAltStrategy(id) {
5660
+ return id !== void 0 && ALT_STRATEGY_IDS.includes(id);
5661
+ }
5644
5662
  function replayRetryDelayMs(errorCode) {
5645
5663
  return errorCode === "rate_limit" ? 65e3 : 2e3;
5646
5664
  }
@@ -5694,7 +5712,34 @@ function altGatesBlockFor(args) {
5694
5712
  ...shapeAltering
5695
5713
  ]);
5696
5714
  }
5715
+ var ALT_BLIND_TOKEN_BUDGET_BREACH = {
5716
+ ceilingTokens: 264,
5717
+ measuredTokensTextWithTools: 285,
5718
+ note: "Blind arm exceeds the stated 264-token ceiling on text+tools (285) and costs ~2.4x the v1-alt arm. Not corrected: compressing it would require editing prose the arm depends on NOT having been edited by this seat. Read a blind-arm LOSS as confounded by token tax; a WIN is unaffected."
5719
+ };
5720
+ var DISCIPLINE_GATES_V1_ALT_BLIND_HEADER = "Before stating any conclusion, run this check:";
5721
+ var ALT_BLIND_BULLETS = {
5722
+ falsify: "- Before committing to an approach, state in one line what evidence would prove it wrong and how you would notice it. If nothing could falsify the approach, you hold a preference, not a plan \u2014 rework it until something could.",
5723
+ deviation: "- When you choose not to follow an applicable instruction, say so explicitly: name the instruction, why you are deviating, and what you are doing instead. Silent deviation is forbidden \u2014 an override is only legitimate when it is visible.",
5724
+ toolPredict: "- When using tools: before each call, state the result you expect. On mismatch, treat the gap as evidence your model of the system is wrong \u2014 revise the model before acting again; never silently retry.",
5725
+ verifyDelegated: "- Verify every delegated or sub-agent result before composing it into an answer: spot-check it against the source or an independent probe. An unverified sub-result is a claim you are repeating, not a fact you know.",
5726
+ markAssumed: '- In the final answer, keep verified claims and assumptions visibly distinct: mark anything unchecked as "assumed" or "unverified". Never let an assumption borrow the confidence of the verified claims beside it.'
5727
+ };
5728
+ function altBlindGatesBlockFor(args) {
5729
+ const parts = [
5730
+ "falsify",
5731
+ "deviation",
5732
+ ...args.hasTools ? ["toolPredict"] : [],
5733
+ "verifyDelegated",
5734
+ ...args.outputMode === "text" ? ["markAssumed"] : []
5735
+ ];
5736
+ return [
5737
+ DISCIPLINE_GATES_V1_ALT_BLIND_HEADER,
5738
+ ...parts.map((p) => ALT_BLIND_BULLETS[p])
5739
+ ].join("\n");
5740
+ }
5697
5741
  var STRATEGY_ALT_SECTION_ID = "__kgauto_strategy_eval_gates_alt__";
5742
+ var STRATEGY_ALT_BLIND_SECTION_ID = "__kgauto_strategy_eval_gates_alt_blind__";
5698
5743
  function withAltDisciplineContract(ir) {
5699
5744
  const outputMode = resolveOutputMode({
5700
5745
  declared: ir.constraints?.outputMode,
@@ -5713,6 +5758,28 @@ function withAltDisciplineContract(ir) {
5713
5758
  ]
5714
5759
  };
5715
5760
  }
5761
+ function withAltBlindDisciplineContract(ir) {
5762
+ const outputMode = resolveOutputMode({
5763
+ declared: ir.constraints?.outputMode,
5764
+ structuredOutput: ir.constraints?.structuredOutput,
5765
+ toolCount: ir.tools?.length ?? 0
5766
+ });
5767
+ const hasTools = (ir.tools?.length ?? 0) > 0;
5768
+ return {
5769
+ ...ir,
5770
+ sections: [
5771
+ ...ir.sections ?? [],
5772
+ {
5773
+ id: STRATEGY_ALT_BLIND_SECTION_ID,
5774
+ text: altBlindGatesBlockFor({ outputMode, hasTools })
5775
+ }
5776
+ ]
5777
+ };
5778
+ }
5779
+ var ALT_SECTION_ID_BY_STRATEGY = {
5780
+ "discipline-gates-v1-alt": STRATEGY_ALT_SECTION_ID,
5781
+ "discipline-gates-v1-alt-blind": STRATEGY_ALT_BLIND_SECTION_ID
5782
+ };
5716
5783
  async function runGoldenEval(opts) {
5717
5784
  const fetchFn = opts.fetchImpl ?? fetch;
5718
5785
  const progress = opts.onProgress ?? (() => {
@@ -5780,7 +5847,9 @@ async function runGoldenEval(opts) {
5780
5847
  }
5781
5848
  const armBIr = (ir) => {
5782
5849
  if (axis !== "strategy") return ir;
5783
- return strategyId === "discipline-gates-v1-alt" ? withAltDisciplineContract(ir) : withDisciplineContract(ir);
5850
+ if (strategyId === "discipline-gates-v1-alt") return withAltDisciplineContract(ir);
5851
+ if (strategyId === "discipline-gates-v1-alt-blind") return withAltBlindDisciplineContract(ir);
5852
+ return withDisciplineContract(ir);
5784
5853
  };
5785
5854
  const replay = async (ir, model, captureGates = false) => {
5786
5855
  let gates;
@@ -5792,13 +5861,14 @@ async function runGoldenEval(opts) {
5792
5861
  };
5793
5862
  const compiled = compile(evalIr);
5794
5863
  if (captureGates) {
5795
- if (strategyId === "discipline-gates-v1-alt") {
5864
+ if (isAltStrategy(strategyId)) {
5865
+ const altSectionId = ALT_SECTION_ID_BY_STRATEGY[strategyId];
5796
5866
  const altSection = (evalIr.sections ?? []).find(
5797
- (s) => s.id === STRATEGY_ALT_SECTION_ID
5867
+ (s) => s.id === altSectionId
5798
5868
  );
5799
5869
  gates = {
5800
5870
  fired: altSection !== void 0 && altSection.text.length > 0,
5801
- rule: "discipline-gates-v1-alt",
5871
+ rule: strategyId,
5802
5872
  gateTokens: altSection ? countTokens(`${altSection.text}
5803
5873
 
5804
5874
  `) : 0
@@ -6229,7 +6299,8 @@ function classifyStrategyOutcome(r) {
6229
6299
  if (r.losses > r.wins) return "loses";
6230
6300
  return "ties";
6231
6301
  }
6232
- var STRATEGY_AUTHORSHIP_LIMITATION = "Both gate wordings share one author (kgauto-Cairn); a shared blind spot is invisible to this experiment. Strong verdicts: both-lose (mechanism) and v1-loses/alt-wins (wording). An independently-authored alt would strengthen every other cell.";
6302
+ var STRATEGY_AUTHORSHIP_LIMITATION = "Only the v1 wording was measured on this run; no re-wording arm was triggered, so this result says nothing about whether the wording or the mechanism produced it.";
6303
+ var STRATEGY_AUTHORSHIP_INDEPENDENT = "Three arms: v1 and one re-wording by this seat, plus an independently authored arm (context-free subagent, no repo access, no knowledge of the experiment). A both-lose verdict therefore spans independent authorship and is not explained by one author's blind spot. Residual limitation: all three arms encode a similar set of underlying principles, so a wrong CHOICE of principles remains harder to see than a wrong wording of them.";
6233
6304
  async function runStrategyEvalWithAttribution(opts) {
6234
6305
  const primary = await runGoldenEval({
6235
6306
  ...opts,
@@ -6246,9 +6317,20 @@ async function runStrategyEvalWithAttribution(opts) {
6246
6317
  axis: "strategy",
6247
6318
  strategy: "discipline-gates-v1-alt"
6248
6319
  });
6249
- const altOutcome = classifyStrategyOutcome(alt);
6250
- const attribution = altOutcome === "wins" ? "wording-failure" : altOutcome === "loses" ? "mechanism-failure" : "wording-inconclusive";
6251
- return { attribution, primary, alt, limitation: STRATEGY_AUTHORSHIP_LIMITATION };
6320
+ const altBlind = await runGoldenEval({
6321
+ ...opts,
6322
+ axis: "strategy",
6323
+ strategy: "discipline-gates-v1-alt-blind"
6324
+ });
6325
+ const outcomes = [classifyStrategyOutcome(alt), classifyStrategyOutcome(altBlind)];
6326
+ const attribution = outcomes.includes("wins") ? "wording-failure" : outcomes.every((o) => o === "loses") ? "mechanism-failure" : "wording-inconclusive";
6327
+ return {
6328
+ attribution,
6329
+ primary,
6330
+ alt,
6331
+ altBlind,
6332
+ limitation: STRATEGY_AUTHORSHIP_INDEPENDENT
6333
+ };
6252
6334
  }
6253
6335
 
6254
6336
  // src/oracle.ts
@@ -6505,6 +6587,30 @@ function createDelegate(opts) {
6505
6587
  }
6506
6588
 
6507
6589
  // src/advisories-api.ts
6590
+ var BURST_SPAN_MS = 5 * 60 * 1e3;
6591
+ function classifyEvidenceWindow(row) {
6592
+ const { evidence_first_at: first, evidence_last_at: last, evidence_n: n } = row;
6593
+ if (typeof first !== "string" || typeof last !== "string") return null;
6594
+ if (typeof n !== "number" || !Number.isFinite(n) || n <= 0) return null;
6595
+ const t0 = Date.parse(first);
6596
+ const t1 = Date.parse(last);
6597
+ if (Number.isNaN(t0) || Number.isNaN(t1)) return null;
6598
+ const spanMs = Math.max(0, t1 - t0);
6599
+ return { firstAt: first, lastAt: last, n, spanMs, isBurst: spanMs < BURST_SPAN_MS };
6600
+ }
6601
+ function formatEvidenceSpan(spanMs) {
6602
+ if (spanMs < 1e3) return `${spanMs}ms`;
6603
+ const s = Math.round(spanMs / 1e3);
6604
+ if (s < 90) return `${s}s`;
6605
+ const m = Math.round(s / 60);
6606
+ if (m < 90) return `${m}m`;
6607
+ const h = Math.round(m / 60);
6608
+ if (h < 48) return `${h}h`;
6609
+ return `${Math.round(h / 24)}d`;
6610
+ }
6611
+ function burstCaveat(w) {
6612
+ return `Evidence is ${w.n} observation${w.n === 1 ? "" : "s"} spanning ${formatEvidenceSpan(w.spanMs)} (${w.firstAt} \u2192 ${w.lastAt}) \u2014 that is a single burst, not a standing rate. Check it against your own deploy log before acting: a cluster this tight is usually one incident, and may already be fixed.`;
6613
+ }
6508
6614
  var SEVERITY_SET = /* @__PURE__ */ new Set(["info", "warn", "critical"]);
6509
6615
  var STATUS_SET = /* @__PURE__ */ new Set(["open", "snoozed", "resolved"]);
6510
6616
  var RESOLUTION_SOURCE_SET = /* @__PURE__ */ new Set([
@@ -6544,10 +6650,18 @@ function rowToAdvisory(row) {
6544
6650
  if (docsLink) suggestedFix.docsLink = docsLink;
6545
6651
  if (suggestion) suggestedFix.before = suggestion;
6546
6652
  }
6653
+ const evidenceWindow = classifyEvidenceWindow(
6654
+ row
6655
+ );
6656
+ const declaredSeverity = asSeverity(row.severity);
6657
+ const downgraded = evidenceWindow?.isBurst === true && declaredSeverity === "critical";
6658
+ const effectiveSeverity = downgraded ? "warn" : declaredSeverity;
6547
6659
  const out = {
6548
6660
  id: typeof row.id === "string" ? row.id : "",
6549
6661
  rule: typeof row.rule === "string" ? row.rule : "",
6550
- severity: asSeverity(row.severity),
6662
+ severity: effectiveSeverity,
6663
+ evidenceWindow,
6664
+ ...downgraded ? { severityBeforeBurstDowngrade: declaredSeverity } : {},
6551
6665
  openedAt: typeof row.opened_at === "string" ? row.opened_at : "",
6552
6666
  lastObservedAt: typeof row.last_observed_at === "string" ? row.last_observed_at : "",
6553
6667
  observationCount: typeof row.observation_count === "number" ? row.observation_count : 0,
@@ -6555,7 +6669,13 @@ function rowToAdvisory(row) {
6555
6669
  ...archetype ? { archetype } : {},
6556
6670
  ...model ? { model } : {}
6557
6671
  },
6558
- message: typeof row.message === "string" ? row.message : "",
6672
+ // The caveat goes INLINE in the message, not only in `evidenceWindow`.
6673
+ // A structured field a consumer must think to read is the same defect
6674
+ // one layer along: the substrate knowing and not telling. The whole
6675
+ // point is that the check costs a glance rather than a query.
6676
+ message: (typeof row.message === "string" ? row.message : "") + (evidenceWindow?.isBurst ? `
6677
+
6678
+ ${burstCaveat(evidenceWindow)}` : ""),
6559
6679
  suggestedFix,
6560
6680
  autoApplicable: false,
6561
6681
  // reserved — alpha.30+
@@ -7092,9 +7212,12 @@ export {
7092
7212
  ABSOLUTE_FLOOR,
7093
7213
  ALIASES,
7094
7214
  ALL_ARCHETYPES,
7215
+ ALT_BLIND_TOKEN_BUDGET_BREACH,
7216
+ ALT_STRATEGY_IDS,
7095
7217
  ARCHETYPE_FAMILY_FITS,
7096
7218
  ARCHETYPE_FLOOR_DEFAULT,
7097
7219
  BRAIN_READ_ENV_NAMES,
7220
+ BURST_SPAN_MS,
7098
7221
  COACH_CFG,
7099
7222
  COST_RANKING_REFERENCE_SHAPE,
7100
7223
  CallError,
@@ -7105,6 +7228,7 @@ export {
7105
7228
  DEFAULT_PROMOTIONS_ENDPOINT,
7106
7229
  DELEGATE_TOOL_DEFINITION,
7107
7230
  DIALECT_VERSION,
7231
+ DISCIPLINE_GATES_V1_ALT_BLIND_HEADER,
7108
7232
  DISCIPLINE_GATES_V1_ALT_HEADER,
7109
7233
  FamilyResolutionError,
7110
7234
  INTENT_ARCHETYPES,
@@ -7121,6 +7245,7 @@ export {
7121
7245
  RULE_DISCIPLINE_GATES_V1,
7122
7246
  RULE_DISCIPLINE_GATES_V1_STRUCTURED,
7123
7247
  RULE_SEQUENTIAL_TOOL_CLIFF,
7248
+ STRATEGY_AUTHORSHIP_INDEPENDENT,
7124
7249
  STRATEGY_AUTHORSHIP_LIMITATION,
7125
7250
  TRANSLATOR_FLOOR,
7126
7251
  _testResetMeasuredFailure,
@@ -7128,6 +7253,7 @@ export {
7128
7253
  _testWaitForMeasuredFailureRefresh,
7129
7254
  _testWaitForPromotionsRefresh,
7130
7255
  allProfiles,
7256
+ altBlindGatesBlockFor,
7131
7257
  altGatesBlockFor,
7132
7258
  applyArchetypeConvention,
7133
7259
  applySectionRewrites,
@@ -7141,9 +7267,11 @@ export {
7141
7267
  buildLLMJudge,
7142
7268
  buildPairwiseJudgePrompt,
7143
7269
  buildShadowProbeRow,
7270
+ burstCaveat,
7144
7271
  call,
7145
7272
  captureGoldenIr,
7146
7273
  chainProviderSpread,
7274
+ classifyEvidenceWindow,
7147
7275
  classifyStrategyOutcome,
7148
7276
  clearBrain,
7149
7277
  combineOrderSwappedVerdicts,
@@ -7163,6 +7291,7 @@ export {
7163
7291
  execute,
7164
7292
  findBetterFit,
7165
7293
  flushBrainDeadLetter,
7294
+ formatEvidenceSpan,
7166
7295
  getActionableAdvisories,
7167
7296
  getAllStarterChains,
7168
7297
  getAllStarterChainsWithGrounding,
@@ -7184,6 +7313,7 @@ export {
7184
7313
  getStarterChainWithGrounding,
7185
7314
  hasMutation,
7186
7315
  hashShape,
7316
+ isAltStrategy,
7187
7317
  isArchetype,
7188
7318
  isAutoPromoteEnabledFromEnv,
7189
7319
  isBrainQueryActiveFor,
@@ -7229,6 +7359,7 @@ export {
7229
7359
  resolveGoldenCaptureRate,
7230
7360
  resolvePricingAt,
7231
7361
  resolveProviderKey,
7362
+ rowToAdvisory,
7232
7363
  rubricFor,
7233
7364
  runAdvisor,
7234
7365
  runGoldenEval,
@@ -7237,6 +7368,7 @@ export {
7237
7368
  shouldCaptureGolden,
7238
7369
  tryGetProfile,
7239
7370
  wilsonLowerBound,
7371
+ withAltBlindDisciplineContract,
7240
7372
  withAltDisciplineContract,
7241
7373
  withDisciplineContract
7242
7374
  };
@@ -454,7 +454,7 @@ type MutationApplied = {
454
454
  * type can change without breaking a live consumer, so the fix is an
455
455
  * accessor that is correct on both.
456
456
  */
457
- declare function mutationId(m: string | MutationApplied): string;
457
+ declare function mutationId(m: string | MutationApplied | null | undefined): string | undefined;
458
458
  /**
459
459
  * alpha.78 — does any mutation in the list match `idOrPrefix` (exact id, or
460
460
  * prefix when it ends with `*`)? Works on both `mutationsApplied` element
@@ -454,7 +454,7 @@ type MutationApplied = {
454
454
  * type can change without breaking a live consumer, so the fix is an
455
455
  * accessor that is correct on both.
456
456
  */
457
- declare function mutationId(m: string | MutationApplied): string;
457
+ declare function mutationId(m: string | MutationApplied | null | undefined): string | undefined;
458
458
  /**
459
459
  * alpha.78 — does any mutation in the list match `idOrPrefix` (exact id, or
460
460
  * prefix when it ends with `*`)? Works on both `mutationsApplied` element
@@ -28,7 +28,7 @@ __export(key_health_exports, {
28
28
  module.exports = __toCommonJS(key_health_exports);
29
29
 
30
30
  // src/version.ts
31
- var LIBRARY_VERSION = "2.0.0-alpha.81";
31
+ var LIBRARY_VERSION = "2.0.0-alpha.83";
32
32
 
33
33
  // src/key-health.ts
34
34
  var JSON_HEADERS = { "Content-Type": "application/json" };
@@ -3,7 +3,7 @@ import {
3
3
  KEY_FINGERPRINT_LENGTH,
4
4
  createKeyHealthRoute,
5
5
  keyFingerprint
6
- } from "./chunk-OZNAGO4U.mjs";
6
+ } from "./chunk-QEFIAAE7.mjs";
7
7
  export {
8
8
  KEY_FINGERPRINT_DOMAIN,
9
9
  KEY_FINGERPRINT_LENGTH,
@@ -1,4 +1,4 @@
1
- import { k as Provider } from './ir-BFwWhj2s.mjs';
1
+ import { k as Provider } from './ir-D4S9R816.mjs';
2
2
  import { IntentArchetypeName } from './dialect.mjs';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { k as Provider } from './ir-DZKS1tI7.js';
1
+ import { k as Provider } from './ir-Cx9hJj0B.js';
2
2
  import { IntentArchetypeName } from './dialect.js';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { s as MutationApplied, B as BestPracticeAdvisory, F as FallbackReason, m as CallAttempt } from './ir-DZKS1tI7.js';
1
+ import { s as MutationApplied, B as BestPracticeAdvisory, F as FallbackReason, m as CallAttempt } from './ir-Cx9hJj0B.js';
2
2
 
3
3
  /**
4
4
  * Glass-Box observability types (alpha.17).
@@ -1,4 +1,4 @@
1
- import { s as MutationApplied, B as BestPracticeAdvisory, F as FallbackReason, m as CallAttempt } from './ir-BFwWhj2s.mjs';
1
+ import { s as MutationApplied, B as BestPracticeAdvisory, F as FallbackReason, m as CallAttempt } from './ir-D4S9R816.mjs';
2
2
 
3
3
  /**
4
4
  * Glass-Box observability types (alpha.17).
@@ -1,4 +1,4 @@
1
- import { i as Adapter, F as FallbackReason, x as SectionKind } from './ir-DZKS1tI7.js';
1
+ import { i as Adapter, F as FallbackReason, x as SectionKind } from './ir-Cx9hJj0B.js';
2
2
 
3
3
  /**
4
4
  * Wire contract for the Glass-Box Chrome extension's brain-poll endpoint.
@@ -1,4 +1,4 @@
1
- import { i as Adapter, F as FallbackReason, x as SectionKind } from './ir-BFwWhj2s.mjs';
1
+ import { i as Adapter, F as FallbackReason, x as SectionKind } from './ir-D4S9R816.mjs';
2
2
 
3
3
  /**
4
4
  * Wire contract for the Glass-Box Chrome extension's brain-poll endpoint.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warmdrift/kgauto-compiler",
3
- "version": "2.0.0-alpha.81",
3
+ "version": "2.0.0-alpha.83",
4
4
  "description": "Prompt compiler with executable provider knowledge for multi-model AI apps: normalized multi-provider transport with fallback chains, compile-time cliff guards, a curated model registry, and a telemetry flight recorder. Swap models without rewriting prompts.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -60,6 +60,7 @@
60
60
  "build": "tsup src/index.ts src/dialect.ts src/profiles.ts src/brain-proxy.ts src/key-health.ts src/glassbox/index.ts src/glassbox-routes/index.ts src/glassbox-routes/format.ts src/glassbox-routes/react/index.ts --format cjs,esm --dts --clean --external react --external react-dom",
61
61
  "test": "vitest run",
62
62
  "test:watch": "vitest",
63
+ "test:stress": "node scripts/stress-test.mjs",
63
64
  "typecheck": "tsc --noEmit",
64
65
  "prepublishOnly": "npm run typecheck && npm run test && npm run build"
65
66
  },