@rulvar/core 1.198.0 → 1.199.0

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.d.ts CHANGED
@@ -12973,6 +12973,15 @@ interface PreflightReport {
12973
12973
  * synthesis reserve, matching the runtime that then commits none.
12974
12974
  */
12975
12975
  synthesisReserveUsd: number;
12976
+ /**
12977
+ * The smallest run ceiling that seats the WHOLE declared wave
12978
+ * (RV1907): every row's reserve plus the finalization and synthesis
12979
+ * carve-outs. Children admit strictly below exact fill, so a viable
12980
+ * ceiling must sit strictly ABOVE this figure; the four-role
12981
+ * benchmark's $6.00 sat $0.98 below it and lost its third and
12982
+ * fourth workers. Present whenever the wave has rows.
12983
+ */
12984
+ requiredMinimumCeilingUsd?: number;
12976
12985
  wave: PreflightAdmissionRow[];
12977
12986
  admitted: number;
12978
12987
  denied: number;
@@ -12985,7 +12994,18 @@ interface PreflightReport {
12985
12994
  * documented overshoot bound is one turn per in-flight agent; real
12986
12995
  * turns grow with the prompt, so this is the floor of that bound.
12987
12996
  */
12988
- overshootOneTurnFloorUsd?: number; /** Per-provider first-wave demand at the declared estimates. */
12997
+ overshootOneTurnFloorUsd?: number;
12998
+ /**
12999
+ * The smallest in-flight exposure cap under which the declared wave
13000
+ * can breathe (RV1907): the finalization and synthesis carve-outs
13001
+ * plus the turn floors of the maxInFlight most expensive declared
13002
+ * dispatches, the orchestrator's own turn among them. Below it the
13003
+ * root's next turn is refused beside a full child wave, the
13004
+ * recovery arm's exact death; the RV1902 wait recovers the run, but
13005
+ * only a cap at or above this floor avoids the stall entirely.
13006
+ * Absent when no declared turn prices.
13007
+ */
13008
+ requiredMinimumExposureUsd?: number; /** Per-provider first-wave demand at the declared estimates. */
12989
13009
  perProvider: Record<string, {
12990
13010
  inFlight: number;
12991
13011
  requestsPerWave: number;
package/dist/index.js CHANGED
@@ -24550,6 +24550,7 @@ function preflightEstimate(input) {
24550
24550
  }
24551
24551
  const admitted = wave.filter((row) => row.admitted).length;
24552
24552
  const denied = wave.length - admitted;
24553
+ const requiredMinimumCeilingUsd = wave.length === 0 ? void 0 : wave.reduce((sum, row) => sum + row.reserveUsd, 0) + reservedForFinalizationUsd + synthesisHoldUsd;
24553
24554
  if (wave.length > 0 && denied > 0) {
24554
24555
  const deniedLabels = wave.filter((row) => !row.admitted).map((row) => row.label);
24555
24556
  if (admitted === 0) say({
@@ -24614,6 +24615,12 @@ function preflightEstimate(input) {
24614
24615
  code: "in-flight-exposure-cap",
24615
24616
  message: `RunOptions.maxInFlightExposureUsd ${exposureCapUsd.toFixed(4)} USD bounds spent money plus live dispatch estimates: a dispatch whose estimate does not fit is refused typed before the provider call, so the worst concurrent overshoot past the cap is the estimate error of the in-flight turns, not one whole turn per agent`
24616
24617
  });
24618
+ const requiredMinimumExposureUsd = overshootOneTurnFloorUsd === void 0 ? void 0 : reservedForFinalizationUsd + synthesisHoldUsd + overshootOneTurnFloorUsd;
24619
+ if (exposureCapUsd !== void 0 && overshootOneTurnFloorUsd !== void 0 && requiredMinimumExposureUsd !== void 0 && requiredMinimumExposureUsd > exposureCapUsd) say({
24620
+ severity: "warning",
24621
+ code: "exposure-cap-tight",
24622
+ message: `maxInFlightExposureUsd ${exposureCapUsd.toFixed(4)} USD sits below the declared wave's breathing floor ${requiredMinimumExposureUsd.toFixed(4)} USD (finalize + synthesis reserves ${(reservedForFinalizationUsd + synthesisHoldUsd).toFixed(4)} plus the ${String(pricedTurns.length)} most expensive concurrent turn floors ${overshootOneTurnFloorUsd.toFixed(4)}): a coordinating turn beside a full child wave will be refused pre-wire and park until a hold releases (RV1902); raise the cap to at least the floor to avoid the stall entirely`
24623
+ });
24617
24624
  const quotaConfigured = engine.quota !== void 0;
24618
24625
  if (!quotaConfigured && maxInFlight > 1 && units.length > 0) say({
24619
24626
  severity: "info",
@@ -24800,6 +24807,7 @@ function preflightEstimate(input) {
24800
24807
  ...ceilingUsd === void 0 ? {} : { ceilingUsd },
24801
24808
  reservedForFinalizationUsd,
24802
24809
  synthesisReserveUsd: synthesisHoldUsd,
24810
+ ...requiredMinimumCeilingUsd === void 0 ? {} : { requiredMinimumCeilingUsd },
24803
24811
  wave,
24804
24812
  admitted,
24805
24813
  denied
@@ -24807,6 +24815,7 @@ function preflightEstimate(input) {
24807
24815
  exposure: {
24808
24816
  maxInFlight,
24809
24817
  ...overshootOneTurnFloorUsd === void 0 ? {} : { overshootOneTurnFloorUsd },
24818
+ ...requiredMinimumExposureUsd === void 0 ? {} : { requiredMinimumExposureUsd },
24810
24819
  perProvider,
24811
24820
  ...runCeiling === void 0 ? {} : { runCeiling }
24812
24821
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rulvar/core",
3
- "version": "1.198.0",
3
+ "version": "1.199.0",
4
4
  "description": "Rulvar core: L0 contracts, journal kernel, ctx primitives, agent runtime, model router, tool system, dynamic orchestrator, InMemory and JSONL stores, event stream.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",