@rulvar/core 1.65.0 → 1.66.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
@@ -5577,7 +5577,31 @@ interface CostReport {
5577
5577
  type RunOutcome<R> = {
5578
5578
  status: "ok" | "error" | "cancelled" | "exhausted" | "suspended";
5579
5579
  value?: R;
5580
- error?: WireError; /** Pipeline drops and onError:'null' losses; silent losses are forbidden. */
5580
+ error?: WireError;
5581
+ /**
5582
+ * The semantic completion lift, mirrored from `run:end` (RV-207 tail;
5583
+ * the 1.65.0 experiment review, P0.5): present when the workflow
5584
+ * reported semantic completion through the completion envelope
5585
+ * contract, an `ok`/`exhausted` run whose result value is an object
5586
+ * carrying a valid `completion` literal, or an `error` run whose typed
5587
+ * error data carries one (the orchestrator acceptance path emits
5588
+ * both). Transport status says whether the run ran; completion says
5589
+ * whether the work is COMPLETE: an accepted degraded run is `status:
5590
+ * 'ok'` with `completion: 'partial'`. The engine computes the lift
5591
+ * ONCE and both surfaces spread the same object, so the outcome and
5592
+ * the event can never disagree; a host reads completeness here
5593
+ * without parsing workflow-specific value shapes on the accepted path
5594
+ * or digging typed error data on the rejected one. Absent when the
5595
+ * workflow makes no completion claim.
5596
+ */
5597
+ completion?: "complete" | "partial" | "rejected";
5598
+ /**
5599
+ * Settled child statuses by status name, lifted from the same
5600
+ * envelope (or typed error data) when it carries a valid record of
5601
+ * nonnegative integers; the mirror of the `run:end` field. Absent
5602
+ * otherwise.
5603
+ */
5604
+ childStatusCounts?: Record<string, number>; /** Pipeline drops and onError:'null' losses; silent losses are forbidden. */
5581
5605
  dropped: DroppedItem[]; /** Suspensions open at settle time (M2). */
5582
5606
  pending: PendingExternal[];
5583
5607
  usage: Usage;
package/dist/index.js CHANGED
@@ -18488,6 +18488,11 @@ function createEngine(options) {
18488
18488
  };
18489
18489
  if (value !== void 0 && (status === "ok" || status === "exhausted")) outcome.value = value;
18490
18490
  if (wireError !== void 0) outcome.error = wireError;
18491
+ const lifted = liftRunCompletion(status === "ok" || status === "exhausted" ? outcome.value : status === "error" ? wireError?.data : void 0);
18492
+ if (lifted !== void 0) {
18493
+ outcome.completion = lifted.completion;
18494
+ if (lifted.childStatusCounts !== void 0) outcome.childStatusCounts = lifted.childStatusCounts;
18495
+ }
18491
18496
  let settlementFailure;
18492
18497
  if (resumeCtx?.strict !== true) {
18493
18498
  const priorCount = resumeCtx?.priorEntries.length ?? 0;
@@ -18532,7 +18537,6 @@ function createEngine(options) {
18532
18537
  level: "warn",
18533
18538
  msg: `settlement write failed (${settlementFailure.stage}); handle.result rejects with SettlementError; resume re-settles by replay without a provider call`
18534
18539
  }, rootSpanId);
18535
- const lifted = liftRunCompletion(status === "ok" || status === "exhausted" ? outcome.value : status === "error" ? wireError?.data : void 0);
18536
18540
  bus.emit({
18537
18541
  type: "run:end",
18538
18542
  status,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rulvar/core",
3
- "version": "1.65.0",
3
+ "version": "1.66.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",