@rulvar/plan 1.44.1 → 1.46.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.
Files changed (2) hide show
  1. package/dist/index.js +10 -2
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { AdmissionRejectedError, BudgetExhaustedError, CURRENT_HASH_VERSION, ConfigError, DedupIndex, FailRunError, InMemoryStore, LEGACY_LTID_PREFIX, LEGACY_SIGNATURE_INPUTS, LineageIndex, PlanInvariantError, ROOT_ACCOUNT, ReplayPlanHashMismatch, TerminationAccount, approachSigCoarse, buildTerminationInitValue, canonicalIsolationTag, canonicalizeLadder, checkpointRefFor, countsAgainstLimit, createEngine, defineWorkflow, deriverV2, evaluateReuse, foldTermination, kMaxOf, knowledgeHash, ladderLengthOf, ladderRungChoice, makeOrchestratorWorkflow, nodeLinkKey, normalizeApproachTag, orchestrate, planNodeScope, profileRegistrySnapshotHash, tool, validateTerminationLimits } from "@rulvar/core";
1
+ import { AdmissionRejectedError, BudgetExhaustedError, CURRENT_HASH_VERSION, ConfigError, DedupIndex, FailRunError, InMemoryStore, LEGACY_LTID_PREFIX, LEGACY_SIGNATURE_INPUTS, LeaseHeldError, LineageIndex, PlanInvariantError, ROOT_ACCOUNT, ReplayPlanHashMismatch, TerminationAccount, approachSigCoarse, buildTerminationInitValue, canonicalIsolationTag, canonicalizeLadder, checkpointRefFor, countsAgainstLimit, createEngine, defineWorkflow, deriverV2, evaluateReuse, foldTermination, kMaxOf, knowledgeHash, ladderLengthOf, ladderRungChoice, makeOrchestratorWorkflow, nodeLinkKey, normalizeApproachTag, orchestrate, planNodeScope, profileRegistrySnapshotHash, tool, validateTerminationLimits } from "@rulvar/core";
2
2
  //#region src/plan-state.ts
3
3
  /**
4
4
  * Plan scope substrate (M7-T01): TaskPlan as engine-owned typed data, the
@@ -4700,7 +4700,15 @@ async function runQueueFailoverDuringForcedFinish(deps) {
4700
4700
  budget: TINY_CAP,
4701
4701
  extension: planRunner({})
4702
4702
  });
4703
- if ((await engineWith(cassetteAdapter(capScript(finishTurn)), store, { worker: { description: "w" } }).resume(handle.runId, failoverWorkflow(), { lease: leaseA }).result).status === "ok") throw new Error("queue-failover: the stale writer was not fenced");
4703
+ const stale = engineWith(cassetteAdapter(capScript(finishTurn)), store, { worker: { description: "w" } }).resume(handle.runId, failoverWorkflow(), { lease: leaseA });
4704
+ let staleFenced = false;
4705
+ try {
4706
+ if ((await stale.result).status === "ok") throw new Error("queue-failover: the stale writer was not fenced");
4707
+ } catch (thrown) {
4708
+ if (!(thrown instanceof LeaseHeldError)) throw thrown;
4709
+ staleFenced = true;
4710
+ }
4711
+ if (!staleFenced) throw new Error("queue-failover: the stale boot meta write was not refused typed");
4704
4712
  if ((await store.load(handle.runId)).length !== before) throw new Error("queue-failover: stale appends became visible");
4705
4713
  const outcome = await engineWith(cassetteAdapter(capScript(finishTurn)), store, { worker: { description: "w" } }).resume(handle.runId, failoverWorkflow(), { lease: leaseB }).result;
4706
4714
  if (outcome.status !== "ok") throw new Error(`queue-failover: worker B ended '${outcome.status}'`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rulvar/plan",
3
- "version": "1.44.1",
3
+ "version": "1.46.0",
4
4
  "description": "Rulvar adaptive orchestration extension: PlanRunner, RunLedger, escalation extensions, ModelLadder configuration.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -22,13 +22,13 @@
22
22
  "access": "public"
23
23
  },
24
24
  "dependencies": {
25
- "@rulvar/core": "1.44.1"
25
+ "@rulvar/core": "1.46.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/node": "^22.20.0",
29
29
  "tsdown": "^0.22.3",
30
30
  "typescript": "~6.0.3",
31
- "@rulvar/store-sqlite": "1.44.1"
31
+ "@rulvar/store-sqlite": "1.46.0"
32
32
  },
33
33
  "repository": {
34
34
  "type": "git",