@rulvar/cli 1.3.2 → 1.4.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/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { r as runCli, t as processIo } from "./io-nATg3Bhx.js";
2
+ import { r as runCli, t as processIo } from "./io-CizJX0rK.js";
3
3
  //#region src/cli.ts
4
4
  /**
5
5
  * The `rulvar` bin entry: thin wrapper over runCli with process io.
@@ -307,11 +307,12 @@ async function commitEvalMeasured(store, claims, options) {
307
307
  }
308
308
  /**
309
309
  * The canary fingerprint (M11-T04; OQ-06). The optional compensation for silent alias
310
- * re-pointing that modelEpoch honestly cannot catch: a FIXED probe set
311
- * at temperature 0, run through the ordinary engine (journaled,
312
- * budgeted, VCR-recordable), hashed over normalized outputs. A
313
- * fingerprint change flips the model's eval claims to stale in one
314
- * command.
310
+ * re-pointing that modelEpoch honestly cannot catch: a FIXED probe set,
311
+ * run through the ordinary engine (journaled, budgeted,
312
+ * VCR-recordable), hashed over normalized outputs. Sampling parameters
313
+ * are not pinned; drift detection rests on the fixed prompts, the
314
+ * normalization, and exact fingerprint comparison. A fingerprint change
315
+ * flips the model's eval claims to stale in one command.
315
316
  *
316
317
  * The committed v1 design (closing OQ-06): the probe set is CALLER
317
318
  * data (fixed, versioned alongside the store); normalization is NFC,
@@ -86992,7 +86992,7 @@ var require_eslint_helpers = /* @__PURE__ */ __commonJSMin(((exports, module) =>
86992
86992
  */
86993
86993
  async function globMatch({ basePath, pattern }) {
86994
86994
  let found = false;
86995
- const { hfs } = await import("./src-pbHnkjmy.js");
86995
+ const { hfs } = await import("./src-W6WrBFFk.js");
86996
86996
  const patternToUse = normalizeToPosix(path$9.relative(basePath, pattern));
86997
86997
  const matcher = new Minimatch(patternToUse, MINIMATCH_OPTIONS);
86998
86998
  const walkSettings = {
@@ -87040,7 +87040,7 @@ var require_eslint_helpers = /* @__PURE__ */ __commonJSMin(((exports, module) =>
87040
87040
  return new Minimatch(patternToUse, MINIMATCH_OPTIONS);
87041
87041
  });
87042
87042
  const unmatchedPatterns = /* @__PURE__ */ new Set([...relativeToPatterns.keys()]);
87043
- const { hfs } = await import("./src-pbHnkjmy.js");
87043
+ const { hfs } = await import("./src-W6WrBFFk.js");
87044
87044
  const walk = hfs.walk(basePath, {
87045
87045
  async directoryFilter(entry) {
87046
87046
  if (!matchers.some((matcher) => matcher.match(entry.path, true))) return false;
@@ -94920,8 +94920,8 @@ function isCtxAgentCall(node) {
94920
94920
  const duplicateIdenticalCall = {
94921
94921
  meta: {
94922
94922
  type: "suggestion",
94923
- docs: { description: "advisory: byte-identical ctx.agent/ctx.workflow calls in one function forward-match to ONE journal entry; pass opts.key to distinguish deliberate repeats" },
94924
- messages: { duplicateCall: "this call is byte-identical to an earlier one in the same function; identical calls share one journal entry via forward-matching, so a deliberate repeat needs a distinguishing opts.key" },
94923
+ docs: { description: "advisory: byte-identical ctx.agent/ctx.workflow calls in one function are told apart only by execution order; pass opts.key to give deliberate repeats stable identities" },
94924
+ messages: { duplicateCall: "this call is byte-identical to an earlier one in the same function; the journal tells identical repeats apart only by execution order, so an edit that reorders or removes one can re-pair recorded results with the wrong call site; give a deliberate repeat a distinguishing opts.key" },
94925
94925
  schema: []
94926
94926
  },
94927
94927
  create(context) {
package/dist/index.d.ts CHANGED
@@ -16,7 +16,7 @@ interface CliIo {
16
16
  declare function processIo(): CliIo;
17
17
  //#endregion
18
18
  //#region src/cli-main.d.ts
19
- declare const HELP = "rulvar: durable multi-agent workflows (https://docs.rulvar.com)\n\n rulvar run <file|name> [--args JSON] [--store PATH] [--budget-usd N]\n rulvar resume <runId> [--store PATH]\n rulvar runs ls [--store PATH]\n rulvar inspect <runId> [--store PATH]\n rulvar plan \"<goal>\" [--dry-run]\n rulvar kb <list | inbox | sweep>\n\nEngine assembly: adapters, defaults, and the workflow registry come from\nrulvar.config.mjs in the working directory (default export\n{ engineOptions?, workflows? }) or from the workflow module's named\nexports. --store selects the JsonlFileStore directory (default .rulvar).\nplan asks the planner model (role plan) to write a workflow script,\nlints and self-repairs it, then runs it in the worker sandbox; --dry-run\nprints the accepted script without running. Requires @rulvar/planner\ninstalled. kb list shows the per-project claim store\n(./rulvar.models.json) with full provenance. kb sweep runs the\nfalsification matrix from the kbSweep section of rulvar.config.mjs\n(fixed pool UNIONED with every model carrying an active negative claim\nplus the re-measure queue; optional canary probes flip drifted claims\nstale first; requires @rulvar/evals installed). kb inbox arrives with\nModelKnowledge phase 3.";
19
+ declare const HELP = "rulvar: durable multi-agent workflows (https://docs.rulvar.com)\n\n rulvar run <file|name> [--args JSON] [--store PATH] [--budget-usd N]\n rulvar resume <runId> [--store PATH]\n rulvar runs ls [--store PATH]\n rulvar inspect <runId> [--store PATH]\n rulvar plan \"<goal>\" [--dry-run]\n rulvar kb <list | inbox | gate | sweep>\n\nEngine assembly: adapters, defaults, and the workflow registry come from\nrulvar.config.mjs in the working directory (default export\n{ engineOptions?, workflows? }) or from the workflow module's named\nexports. --store selects the JsonlFileStore directory (default .rulvar).\nplan asks the planner model (role plan) to write a workflow script,\nlints and self-repairs it, then runs it in the worker sandbox; --dry-run\nprints the accepted script without running. Requires @rulvar/planner\ninstalled. kb list shows the per-project claim store\n(./rulvar.models.json) with full provenance. kb sweep runs the\nfalsification matrix from the kbSweep section of rulvar.config.mjs\n(fixed pool UNIONED with every model carrying an active negative claim\nplus the re-measure queue; optional canary probes flip drifted claims\nstale first; requires @rulvar/evals installed). kb inbox aggregates\nkb_propose proposals from finished runs (14 day TTL); kb gate turns one\ninbox proposal into a committed claim behind a human attestation\n(--approver and --ruled-out are mandatory). inbox and gate require\n@rulvar/plan installed.";
20
20
  declare function runCli(argv: string[], options: {
21
21
  cwd: string;
22
22
  io: CliIo;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as resumeCommand, c as driveRun, d as renderEventLine, f as DEFAULT_STORE_DIR, g as looksLikeFile, h as loadWorkflowModule, i as inspectCommand, l as reportOutcome, m as loadCliConfig, n as HELP, o as runCommand, p as assembleEngine, r as runCli, s as runsLsCommand, t as processIo, u as attachProgress } from "./io-nATg3Bhx.js";
1
+ import { a as resumeCommand, c as driveRun, d as renderEventLine, f as DEFAULT_STORE_DIR, g as looksLikeFile, h as loadWorkflowModule, i as inspectCommand, l as reportOutcome, m as loadCliConfig, n as HELP, o as runCommand, p as assembleEngine, r as runCli, s as runsLsCommand, t as processIo, u as attachProgress } from "./io-CizJX0rK.js";
2
2
  import { ConfigError, InvalidResolutionError, JournalCompatibilityError, LeaseHeldError, Replayer, RulvarError, buildDeriverRegistry, costReportFromJournal, maskSecrets, normalizeEntry, scanJournalCompatibility, validateSchemaSpec } from "@rulvar/core";
3
3
  //#region src/server.ts
4
4
  /**
@@ -695,15 +695,18 @@ async function toOtel(run, tracer, options = {}) {
695
695
  const openBySpanId = /* @__PURE__ */ new Map();
696
696
  const stack = [];
697
697
  let created = 0;
698
+ const { contextApi, setSpan } = options;
698
699
  const startSpan = (event) => {
699
700
  if (event.replayed === true && openBySpanId.has(event.spanId)) {
700
701
  openBySpanId.get(event.spanId)?.span.setAttribute("rulvar.replayed", true);
701
702
  return;
702
703
  }
704
+ const parent = event.parentSpanId === void 0 ? void 0 : openBySpanId.get(event.parentSpanId);
705
+ const parentContext = parent !== void 0 && contextApi !== void 0 && setSpan !== void 0 ? setSpan(contextApi.active(), parent.span) : void 0;
703
706
  const span = tracer.startSpan(spanName(event), {
704
707
  startTime: msOf(event.ts),
705
708
  attributes: openAttributes(event, run.runId)
706
- });
709
+ }, parentContext);
707
710
  created += 1;
708
711
  const open = {
709
712
  span,
@@ -135,10 +135,35 @@ function applyRunProfile(profile, host) {
135
135
  if (profile.permissionPreset !== void 0 && host.defaults?.permissions === void 0) {
136
136
  const compiled = compilePermissionPreset(profile.permissionPreset);
137
137
  merged.defaults = {
138
- ...host.defaults,
138
+ ...merged.defaults,
139
139
  permissions: compiled
140
140
  };
141
141
  }
142
+ if (profile.effortByRole !== void 0 && merged.defaults?.routing !== void 0) {
143
+ const routing = { ...merged.defaults.routing };
144
+ let seeded = false;
145
+ for (const [role, effort] of Object.entries(profile.effortByRole)) {
146
+ const entry = routing[role];
147
+ if (entry === void 0) continue;
148
+ if (typeof entry === "string") {
149
+ routing[role] = {
150
+ model: entry,
151
+ effort
152
+ };
153
+ seeded = true;
154
+ } else if ("model" in entry && entry.effort === void 0) {
155
+ routing[role] = {
156
+ ...entry,
157
+ effort
158
+ };
159
+ seeded = true;
160
+ }
161
+ }
162
+ if (seeded) merged.defaults = {
163
+ ...merged.defaults,
164
+ routing
165
+ };
166
+ }
142
167
  return merged;
143
168
  }
144
169
  //#endregion
@@ -456,7 +481,7 @@ async function planCommand(argv, context) {
456
481
  if (goal === void 0 || parsed.positionals.length > 1) throw new ConfigError("usage: rulvar plan \"<goal>\" [--dry-run]");
457
482
  let plannerModule;
458
483
  try {
459
- plannerModule = await import("./dist-hv4J07hq.js");
484
+ plannerModule = await import("./dist-DbEE-gXg.js");
460
485
  } catch {
461
486
  throw new ConfigError("rulvar plan requires @rulvar/planner (the plan agent, compileScript, and the worker sandbox live there); install it next to the CLI");
462
487
  }
@@ -774,7 +799,7 @@ async function kbSweepCommand(argv, context) {
774
799
  if (sweep === void 0) throw new ConfigError("rulvar kb sweep requires a kbSweep section in rulvar.config.mjs ({ committerId, models, cases })");
775
800
  let evals;
776
801
  try {
777
- evals = await import("./dist-M-vPRtBM.js");
802
+ evals = await import("./dist-CdhvWszV.js");
778
803
  } catch {
779
804
  throw new ConfigError("rulvar kb sweep requires @rulvar/evals (matrix sweeps, the eval-committer identity, and the canary live there); install it next to the CLI");
780
805
  }
@@ -857,7 +882,7 @@ const HELP = `rulvar: durable multi-agent workflows (https://docs.rulvar.com)
857
882
  rulvar runs ls [--store PATH]
858
883
  rulvar inspect <runId> [--store PATH]
859
884
  rulvar plan "<goal>" [--dry-run]
860
- rulvar kb <list | inbox | sweep>
885
+ rulvar kb <list | inbox | gate | sweep>
861
886
 
862
887
  Engine assembly: adapters, defaults, and the workflow registry come from
863
888
  rulvar.config.mjs in the working directory (default export
@@ -871,8 +896,11 @@ installed. kb list shows the per-project claim store
871
896
  falsification matrix from the kbSweep section of rulvar.config.mjs
872
897
  (fixed pool UNIONED with every model carrying an active negative claim
873
898
  plus the re-measure queue; optional canary probes flip drifted claims
874
- stale first; requires @rulvar/evals installed). kb inbox arrives with
875
- ModelKnowledge phase 3.`;
899
+ stale first; requires @rulvar/evals installed). kb inbox aggregates
900
+ kb_propose proposals from finished runs (14 day TTL); kb gate turns one
901
+ inbox proposal into a committed claim behind a human attestation
902
+ (--approver and --ruled-out are mandatory). inbox and gate require
903
+ @rulvar/plan installed.`;
876
904
  async function runCli(argv, options) {
877
905
  const [command, ...rest] = argv;
878
906
  const context = {
@@ -1,4 +1,4 @@
1
- import { t as __esmMin } from "./dist-hv4J07hq.js";
1
+ import { t as __esmMin } from "./dist-DbEE-gXg.js";
2
2
  import path from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import nativeFsp from "node:fs/promises";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rulvar/cli",
3
- "version": "1.3.2",
3
+ "version": "1.4.0",
4
4
  "description": "rulvar shell: run/resume/runs/inspect/plan/kb commands, TUI progress, createServer, createWorker, OTel exporter.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -22,17 +22,17 @@
22
22
  "access": "public"
23
23
  },
24
24
  "dependencies": {
25
- "@rulvar/core": "1.3.2"
25
+ "@rulvar/core": "1.4.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/testing": "1.3.2",
32
- "@rulvar/planner": "1.3.2",
33
- "@rulvar/plan": "1.3.2",
34
- "@rulvar/evals": "1.3.2",
35
- "@rulvar/store-sqlite": "1.3.2"
31
+ "@rulvar/store-sqlite": "1.4.0",
32
+ "@rulvar/testing": "1.4.0",
33
+ "@rulvar/planner": "1.4.0",
34
+ "@rulvar/plan": "1.4.0",
35
+ "@rulvar/evals": "1.4.0"
36
36
  },
37
37
  "bin": {
38
38
  "rulvar": "./dist/cli.js"