@rulvar/cli 1.1.0 → 1.2.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-TjsY28AR.js";
2
+ import { r as runCli, t as processIo } from "./io-poGpn70r.js";
3
3
  //#region src/cli.ts
4
4
  /**
5
5
  * The `rulvar` bin entry: thin wrapper over runCli with process io.
@@ -14,9 +14,9 @@ var __esmMin = (fn, res, err) => () => {
14
14
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
15
15
  var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
16
16
  //#endregion
17
- //#region ../planner/dist/compile-CfWgGVyz.js
17
+ //#region ../planner/dist/compile-BtCY9wfO.js
18
18
  /**
19
- * The exact curated sandbox global set, in docs order (docs/06, 8.2).
19
+ * The exact curated sandbox global set, in canonical order.
20
20
  * The worker binds the ctx methods as bare globals under these names and
21
21
  * the API card teaches exactly this list.
22
22
  */
@@ -180,11 +180,11 @@ function scanImports(source, blanked, allowImports) {
180
180
  return diagnostics;
181
181
  }
182
182
  /**
183
- * Validates and compiles planner-generated source into a CompiledWorkflow
184
- * (docs/06, 8.3). The source is an async function body over the sandbox
183
+ * Validates and compiles planner-generated source into a CompiledWorkflow.
184
+ * The source is an async function body over the sandbox
185
185
  * globals; its `return` value is the workflow result. The compiled form is
186
186
  * pure data (the source is evaluated only inside the worker sandbox);
187
- * machine scripts run under errorPolicy 'lenient' (docs/06, Appendix A).
187
+ * machine scripts run under errorPolicy 'lenient'.
188
188
  */
189
189
  function compileScript(source, o) {
190
190
  const allowImports = o?.allowImports ?? [];
@@ -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-DVFj9U50.js");
86995
+ const { hfs } = await import("./src-BA7JP7vn.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-DVFj9U50.js");
87043
+ const { hfs } = await import("./src-BA7JP7vn.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;
@@ -94765,7 +94765,7 @@ const CTX_CALL_METHODS = /* @__PURE__ */ new Set([
94765
94765
  "parallel",
94766
94766
  "pipeline"
94767
94767
  ]);
94768
- /** Bare sandbox globals that are ctx calls in compiled scripts (docs/06, 8.2). */
94768
+ /** Bare sandbox globals that are ctx calls in compiled scripts. */
94769
94769
  const SANDBOX_CALL_GLOBALS = /* @__PURE__ */ new Set([
94770
94770
  "agent",
94771
94771
  "workflow",
@@ -94980,8 +94980,7 @@ const plugin = {
94980
94980
  };
94981
94981
  /**
94982
94982
  * The flat-config preset for workflow modules: the determinism bans as
94983
- * errors, the duplicate-identical-call advisory as a warning (docs/06,
94984
- * 8.4).
94983
+ * errors, the duplicate-identical-call advisory as a warning.
94985
94984
  */
94986
94985
  const workflowsConfig = {
94987
94986
  name: "rulvar/workflows",
@@ -95000,7 +94999,7 @@ plugin.configs = { workflows: workflowsConfig };
95000
94999
  //#region ../planner/dist/index.js
95001
95000
  /**
95002
95001
  * The API card (M6-T04): teaches the planner model EXACTLY the sandbox
95003
- * dialect and global set (docs/06, sections 8.2 and 8.3). The card is a
95002
+ * dialect and global set. The card is a
95004
95003
  * pure constant, byte-stable across runs; plan() (M6-T05) composes it
95005
95004
  * with profileCard(registry) and the goal. The usage examples are
95006
95005
  * distilled from the runnable examples/ corpus (M5-T09).
@@ -95052,7 +95051,7 @@ function apiCard() {
95052
95051
  }
95053
95052
  /**
95054
95053
  * The plan agent and the self-repair loop (M6-T05): mode (b), the
95055
- * flagship hybrid (docs/06, section 9.2). plan() asks a planner model
95054
+ * flagship hybrid. plan() asks a planner model
95056
95055
  * (role 'plan') to write a script against the API card and the profile
95057
95056
  * card, lints it with eslint-plugin-rulvar, self-repairs up to
95058
95057
  * repairRounds rounds from the JSON diagnostics, and compiles the
@@ -95063,7 +95062,7 @@ function apiCard() {
95063
95062
  * against the same store REPLAYS the unchanged prefix for free
95064
95063
  * (invariant I1; the M6-T05 acceptance).
95065
95064
  */
95066
- /** The deterministic planner runId: one goal, one journal (docs/06, 9.2). */
95065
+ /** The deterministic planner runId: one goal, one journal. */
95067
95066
  function planRunIdOf(goal) {
95068
95067
  return `plan-${createHash("sha256").update(goal, "utf8").digest("hex").slice(0, 24)}`;
95069
95068
  }
@@ -95196,7 +95195,7 @@ async function plan(engine, goal, o) {
95196
95195
  };
95197
95196
  }
95198
95197
  /**
95199
- * plan-then-run in one call (docs/06, section 9; amended during M6-T05:
95198
+ * plan-then-run in one call (amended during M6-T05:
95200
95199
  * the composition is async because planning itself is a run).
95201
95200
  */
95202
95201
  async function runPlanned(engine, goal, args) {
@@ -95207,19 +95206,19 @@ async function runPlanned(engine, goal, args) {
95207
95206
  * WorkerSandboxRunner (M6-T02): the mandatory runner for machine-generated
95208
95207
  * scripts, mode (b). Owns the worker lifecycle and the dedicated
95209
95208
  * MessageChannel; every primitive call is served by the core sandbox
95210
- * bridge against the canonical run ctx (docs/06, 8.2).
95209
+ * bridge against the canonical run ctx.
95211
95210
  *
95212
95211
  * Port lifecycle: one channel per run; the worker end rides the init
95213
95212
  * transfer list; the host end is referenced while the worker computes and
95214
95213
  * unreferenced while every worker frame is blocked on a host call, so a
95215
- * suspended run lets the process exit (docs/06, 2.7) and a computing
95214
+ * suspended run lets the process exit and a computing
95216
95215
  * worker keeps it alive. Breaching timeoutMs or memoryMb terminates the
95217
95216
  * worker and the run completes with outcome 'error' carrying the typed
95218
- * SandboxError (docs/02, error taxonomy).
95217
+ * SandboxError.
95219
95218
  */
95220
95219
  const DEFAULT_SANDBOX_TIMEOUT_MS = 3e5;
95221
95220
  const DEFAULT_SANDBOX_MEMORY_MB = 512;
95222
- /** Accepts CompiledWorkflow ONLY: feeding a closure is a type error (docs/06, 8). */
95221
+ /** Accepts CompiledWorkflow ONLY: feeding a closure is a type error. */
95223
95222
  var WorkerSandboxRunner = class {
95224
95223
  timeoutMs;
95225
95224
  memoryMb;
@@ -6,9 +6,9 @@ import { createHash } from "node:crypto";
6
6
  * suite runners. A separate quality-measurement package built strictly on
7
7
  * the public APIs (L6).
8
8
  *
9
- * Owning spec: docs/09-observability-testing-spec.md, section
10
- * "@rulvar/evals"; determinism rules in docs/11-testing-strategy.md,
11
- * section "Eval CI": judge graders run THROUGH the engine, so judge calls
9
+ * Determinism rules (https://docs.rulvar.com/guide/evals and
10
+ * https://docs.rulvar.com/guide/testing): judge graders run THROUGH the
11
+ * engine, so judge calls
12
12
  * are journaled, budgeted, and VCR-recordable, and an eval suite replays
13
13
  * deterministically from cassettes with zero live calls.
14
14
  */
@@ -244,14 +244,14 @@ function judgeGrader(options) {
244
244
  };
245
245
  }
246
246
  /**
247
- * The eval-committer identity (M11-T01; docs/05, sections "Data model"
248
- * and "Commit discipline"). The pipeline-side commit path: builds
247
+ * The eval-committer identity (M11-T01; https://docs.rulvar.com/guide/model-knowledge).
248
+ * The pipeline-side commit path: builds
249
249
  * eval-committer-gated ops (the coherence square: class eval-measured,
250
250
  * author eval-pipeline, metrics present) and commits them with the
251
251
  * documented CAS-rebase recipe. Humans never call this; their path is
252
252
  * the human gate and it structurally cannot carry metrics.
253
253
  */
254
- /** One measured claim, TTL applied per the docs/05 decay table. */
254
+ /** One measured claim; claimExpiry applies the TTL from the decay table. */
255
255
  function evalMeasuredClaim(input, committerId) {
256
256
  return {
257
257
  id: input.id,
@@ -306,8 +306,7 @@ async function commitEvalMeasured(store, claims, options) {
306
306
  throw lastCas ?? /* @__PURE__ */ new Error("commitEvalMeasured: unreachable");
307
307
  }
308
308
  /**
309
- * The canary fingerprint (M11-T04; docs/05, section "Grounding and
310
- * decay"; OQ-06). The optional compensation for silent alias
309
+ * The canary fingerprint (M11-T04; OQ-06). The optional compensation for silent alias
311
310
  * re-pointing that modelEpoch honestly cannot catch: a FIXED probe set
312
311
  * at temperature 0, run through the ordinary engine (journaled,
313
312
  * budgeted, VCR-recordable), hashed over normalized outputs. A
@@ -341,9 +340,8 @@ async function canaryFingerprint(engine, probes) {
341
340
  }
342
341
  /**
343
342
  * Flips the model's ACTIVE eval-measured claims to stale when their
344
- * recorded canary fingerprint differs from the fresh one (docs/05:
345
- * "a fingerprint change immediately flips the model's eval claims to
346
- * stale"). Claims without a recorded fingerprint have no baseline and
343
+ * recorded canary fingerprint differs from the fresh one. Claims
344
+ * without a recorded fingerprint have no baseline and
347
345
  * stay untouched (the documented no-probe posture); a second run is
348
346
  * an idempotent noop. CAS-rebased like every maintenance commit.
349
347
  */
@@ -382,9 +380,8 @@ async function flipStaleOnCanaryDrift(store, model, freshFingerprint, options) {
382
380
  throw lastCas ?? /* @__PURE__ */ new Error("flipStaleOnCanaryDrift: unreachable");
383
381
  }
384
382
  /**
385
- * The phases 1-2 measured-value checkpoint (M12-T01; docs/05, section
386
- * "Phases and placement"; the quantitative criteria of OQ-09,
387
- * 14-open-questions.md, closed at M11-T06). The M12 gate: kb_propose
383
+ * The phases 1-2 measured-value checkpoint (M12-T01; the quantitative
384
+ * criteria of OQ-09, closed at M11-T06). The M12 gate: kb_propose
388
385
  * and the proposal loop ship ONLY if the knowledge card demonstrably
389
386
  * improves tier and agentType selection on eval cases.
390
387
  *
@@ -404,7 +401,11 @@ async function flipStaleOnCanaryDrift(store, model, freshFingerprint, options) {
404
401
  * with and without the knowledge store configured (the card docks
405
402
  * into the spawn tool description when configured). Criterion 2
406
403
  * holds when the card-informed arm matches or beats the baseline
407
- * pass rate at no more than 105 percent of its cost.
404
+ * pass rate at no more than 105 percent of its cost, OR beats it
405
+ * by at least 15 points at no more than 115 percent of its cost
406
+ * (the quality branch; OQ-09 as amended 2026-07-12: the baseline
407
+ * fails CHEAPLY, so the flat cost bar tightened exactly when the
408
+ * card was winning on quality).
408
409
  *
409
410
  * The checkpoint PASSES only when both criteria hold. Methodology
410
411
  * guard: the claims the treatment consumes MUST come from a seeding
@@ -413,6 +414,18 @@ async function flipStaleOnCanaryDrift(store, model, freshFingerprint, options) {
413
414
  */
414
415
  /** IEEE754 guard for the rule boundaries (0.8 + 0.05 exceeds 0.85). */
415
416
  const EPSILON = 1e-9;
417
+ /**
418
+ * The OQ-09 criterion 2 rule (as amended 2026-07-12): match-or-beat at
419
+ * 105 percent of baseline cost, OR at least 15 points better at 115
420
+ * percent (the quality branch: the baseline fails cheaply, so the flat
421
+ * bar tightened exactly when the card won on quality). The vacuous-pass
422
+ * guard stays with the caller.
423
+ */
424
+ function agentTypeRuleHolds(baseline, informed) {
425
+ const matchesCheaply = informed.passRate >= baseline.passRate - EPSILON && informed.totalCostUsd <= 1.05 * baseline.totalCostUsd + EPSILON;
426
+ const clearlyBetterNearCost = informed.passRate >= baseline.passRate + .15 - EPSILON && informed.totalCostUsd <= 1.15 * baseline.totalCostUsd + EPSILON;
427
+ return matchesCheaply || clearlyBetterNearCost;
428
+ }
416
429
  /** The OQ-09 cell rule (shared by the per-cell and pooled verdicts). */
417
430
  function rungRuleHolds(baseline, treatment) {
418
431
  const equalOrBetterCheaper = treatment.passRate >= baseline.passRate - EPSILON && treatment.totalCostUsd <= .9 * baseline.totalCostUsd + EPSILON;
@@ -493,7 +506,7 @@ async function runValueCheckpoint(checkpointPool, options) {
493
506
  criterion2 = {
494
507
  baseline,
495
508
  informed,
496
- passed: informed.n > 0 && informed.passRate > 0 && informed.passRate >= baseline.passRate && informed.totalCostUsd <= 1.05 * baseline.totalCostUsd + EPSILON
509
+ passed: informed.n > 0 && informed.passRate > 0 && agentTypeRuleHolds(baseline, informed)
497
510
  };
498
511
  }
499
512
  return {
package/dist/index.d.ts CHANGED
@@ -37,7 +37,7 @@ declare function inspectCommand(argv: string[], context: CommandContext): Promis
37
37
  interface CliConfig {
38
38
  engineOptions?: Partial<CreateEngineOptions>;
39
39
  workflows?: WorkflowRegistry;
40
- /** rulvar kb sweep configuration (M11-T05; docs/05, "Grounding and decay"). */
40
+ /** rulvar kb sweep configuration (M11-T05). */
41
41
  kbSweep?: KbSweepCliConfig;
42
42
  }
43
43
  /**
@@ -95,7 +95,7 @@ interface AssembledCli {
95
95
  engine: Engine;
96
96
  store: JournalStore;
97
97
  workflows: WorkflowRegistry;
98
- /** The journal-fold price function (table wins over caps; docs/04, section 10). */
98
+ /** The journal-fold price function (table wins over caps). */
99
99
  priceUsd: (servedBy: ModelRef, usage: Usage) => number | undefined;
100
100
  }
101
101
  declare function assembleEngine(options: {
@@ -115,7 +115,7 @@ declare function driveRun(options: {
115
115
  engine: Engine;
116
116
  workflow: Workflow<never, unknown>;
117
117
  first: RunHandle<unknown>;
118
- io: CliIo; /** Original run arguments: not journaled in v1, the host re-supplies them (docs/14). */
118
+ io: CliIo; /** Original run arguments: not journaled in v1, the host re-supplies them. */
119
119
  args?: unknown;
120
120
  }): Promise<RunOutcome<unknown>>;
121
121
  /** Renders the settled outcome; returns the process exit code. */
@@ -124,17 +124,17 @@ declare function reportOutcome(outcome: RunOutcome<unknown>, io: CliIo): number;
124
124
  //#region src/server.d.ts
125
125
  interface CreateServerOptions {
126
126
  engine: Engine;
127
- /** The explicit, first-class registry (docs/06, section 10.4). */
127
+ /** The explicit, first-class registry. */
128
128
  workflows: WorkflowRegistry;
129
129
  /**
130
130
  * Prices the journal fold behind GET /runs/:id/cost for runs without a
131
131
  * settled in-process outcome (the host assembles pricing exactly as it
132
132
  * does for the CLI); absent means those usages surface as `unpriced`,
133
- * never a silent zero (docs/04, section 10).
133
+ * never a silent zero.
134
134
  */
135
135
  priceUsd?: (servedBy: ModelRef, usage: Usage) => number | undefined;
136
136
  /**
137
- * Opt-in retention (docs/02, 8.2; OQ-20 executed at M8-T04): evaluated
137
+ * Opt-in retention (OQ-20 executed at M8-T04): evaluated
138
138
  * when a tracked run settles terminally; a true verdict applies
139
139
  * engine.deleteRun (transcript cascade, then the journal) and
140
140
  * untracks the run. Absent means everything persists indefinitely.
@@ -147,7 +147,7 @@ interface RulvarServer {
147
147
  declare function createServer(options: CreateServerOptions): RulvarServer;
148
148
  //#endregion
149
149
  //#region src/worker.d.ts
150
- /** Appendix A: the committed reference lease ttl (docs/06). */
150
+ /** Appendix A: the committed reference lease ttl. */
151
151
  declare const DEFAULT_WORKER_TTL_MS = 6e4;
152
152
  interface CreateWorkerOptions {
153
153
  /**
@@ -162,7 +162,7 @@ interface CreateWorkerOptions {
162
162
  owner?: string;
163
163
  /**
164
164
  * The store's lease ttl; the worker renews at ttl/3 (the normative
165
- * bound, docs/03 12.3). Default: the Appendix A reference 60000 ms.
165
+ * bound). Default: the Appendix A reference 60000 ms.
166
166
  * MUST match the store's configured ttl.
167
167
  */
168
168
  ttlMs?: number;
@@ -179,7 +179,7 @@ interface CreateWorkerOptions {
179
179
  /** Observability hook for per-run failures; never throws into the loop. */
180
180
  onError?: (runId: string, error: unknown) => void;
181
181
  /**
182
- * Opt-in retention (docs/02, 8.3; OQ-20 executed at M8-T04): evaluated
182
+ * Opt-in retention (OQ-20 executed at M8-T04): evaluated
183
183
  * during sweeps over SETTLED runs (terminal meta); a true verdict
184
184
  * applies engine.deleteRun under a briefly held lease. Absent means
185
185
  * everything persists indefinitely.
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
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-TjsY28AR.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-poGpn70r.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
  /**
5
5
  * createServer (M8-T01): the HTTP shell over the public engine API
6
- * (docs/02, section 8.2; FR-702). Canonical signature
6
+ * (FR-702). Canonical signature
7
7
  * `createServer({ engine, workflows })` returning
8
8
  * `{ fetch(req: Request): Promise<Response> }`; the journal store comes
9
- * from the engine (Engine.stores, docs/06 10.2, M8 entry amendment).
9
+ * from the engine (Engine.stores, M8 entry amendment).
10
10
  *
11
11
  * Routes:
12
12
  * POST /runs start a run of a registered workflow
@@ -16,20 +16,19 @@ import { ConfigError, InvalidResolutionError, JournalCompatibilityError, LeaseHe
16
16
  * GET /runs/:id/cost CostReport
17
17
  *
18
18
  * Authentication is explicitly out of scope: the server is host-embedded
19
- * and auth belongs to host middleware (docs/14, OQ-16). SSE reconnection
20
- * maps Last-Event-ID to the event seq (the per-run telemetry counter,
21
- * docs/09, section 1.1); replay is at-least-once by design, matching the
22
- * journal-backed re-emission contract (docs/09, section 1.5: consumers
19
+ * and auth belongs to host middleware (OQ-16). SSE reconnection
20
+ * maps Last-Event-ID to the event seq (the per-run telemetry counter);
21
+ * replay is at-least-once by design, matching the
22
+ * journal-backed re-emission contract (consumers
23
23
  * deduplicate on `replayed`).
24
24
  *
25
25
  * The server is a single-process shell: it tracks the runs it started
26
26
  * (or resumed) in memory and serves everything else from the engine's
27
27
  * stores. A resolution posted for a run that is NOT live in this process
28
- * is the documented offline append (docs/03, section 8: load, compute
28
+ * is the documented offline append (load, compute
29
29
  * next seq, append, under a lease where the store is leasable); such a
30
30
  * run resumes on a queue worker (createWorker, M8-T02), not here,
31
- * because original run arguments are not journaled in v1 (docs/14,
32
- * OQ-21).
31
+ * because original run arguments are not journaled in v1 (OQ-21).
33
32
  */
34
33
  const JSON_HEADERS = { "content-type": "application/json; charset=utf-8" };
35
34
  const wallClock = Date.now.bind(globalThis);
@@ -64,7 +63,7 @@ function isLeasable(store) {
64
63
  const candidate = store;
65
64
  return typeof candidate.acquire === "function" && typeof candidate.renew === "function" && typeof candidate.release === "function";
66
65
  }
67
- /** The approval-suspension resolution key (docs/08, section 3.6). */
66
+ /** The approval-suspension resolution key. */
68
67
  const APPROVAL_KEY_PREFIX = "approval:";
69
68
  function suspensionKeyOf(entry) {
70
69
  if (entry.status !== "suspended") return;
@@ -299,7 +298,7 @@ function createServer(options) {
299
298
  return section;
300
299
  }
301
300
  /**
302
- * The offline path (docs/03, section 8): the run is not live in this
301
+ * The offline path: the run is not live in this
303
302
  * process; append the resolution under a lease where the store is
304
303
  * leasable and leave the resume to a queue worker.
305
304
  */
@@ -433,7 +432,7 @@ function createServer(options) {
433
432
  //#region src/worker.ts
434
433
  /**
435
434
  * createWorker (M8-T02): the queue shell over the public engine API
436
- * (docs/02, section 8.3; FR-703). Canonical signature
435
+ * (FR-703). Canonical signature
437
436
  * `createWorker(engine, { store: LeasableStore, concurrency? })`.
438
437
  *
439
438
  * The worker leases resumable ('running' meta: a crashed or currently
@@ -441,7 +440,7 @@ function createServer(options) {
441
440
  * fencing epoch; acquire on a held lease rejects with LeaseHeldError and
442
441
  * the worker simply moves on. Stateless workers call engine.resume,
443
442
  * passing the lease via ResumeOptions.lease so EVERY engine append of
444
- * the resumed run is fenced (docs/03, section 12.3, M8 entry amendment):
443
+ * the resumed run is fenced (M8 entry amendment):
445
444
  * lease theft is impossible because a stale writer's appends are
446
445
  * rejected by the store and never become visible, whether or not the
447
446
  * stale worker noticed it lost the lease.
@@ -452,23 +451,23 @@ function createServer(options) {
452
451
  * this worker (an older library never writes into a newer journal).
453
452
  *
454
453
  * Queue semantics are honestly at-least-once with deduplication by the
455
- * journal (docs/03, section 13.1): re-leasing a settled or unchanged
454
+ * journal: re-leasing a settled or unchanged
456
455
  * run replays to the same outcome with zero live calls. Workflows
457
456
  * resolve through the engine's defaults.workflows registry plus the
458
- * persisted CompiledWorkflow sources, never through a worker parameter
459
- * (docs/06, section 10.4); original in-process run arguments are not
457
+ * persisted CompiledWorkflow sources, never through a worker parameter;
458
+ * original in-process run arguments are not
460
459
  * journaled in v1, so the host MAY re-supply them per run via `argsFor`
461
- * (docs/14, OQ-21).
460
+ * (OQ-21).
462
461
  *
463
462
  * Appendix A (committed at M8 entry): concurrency defaults to 1 (one
464
463
  * leased run per worker process; hosts scale out by adding workers,
465
464
  * which the fencing epoch makes safe by construction); the renew
466
465
  * cadence is ttl/3 with the reference ttl of 60000 ms. There is no
467
- * distributed cross-process rate limiter in v1 (EXC-14; docs/14,
468
- * OQ-17): divide provider quota per worker or front an external
466
+ * distributed cross-process rate limiter in v1 (EXC-14; OQ-17):
467
+ * divide provider quota per worker or front an external
469
468
  * gateway.
470
469
  */
471
- /** Appendix A: the committed reference lease ttl (docs/06). */
470
+ /** Appendix A: the committed reference lease ttl. */
472
471
  const DEFAULT_WORKER_TTL_MS = 6e4;
473
472
  const CANDIDATE_STATUSES = /* @__PURE__ */ new Set(["running", "suspended"]);
474
473
  let workerOrdinal = 0;
@@ -544,7 +543,7 @@ function createWorker(engine, options) {
544
543
  });
545
544
  await settled;
546
545
  }
547
- /** Opt-in retention over settled runs (docs/02, 8.3; M8-T04). */
546
+ /** Opt-in retention over settled runs (M8-T04). */
548
547
  async function applyRetention(meta) {
549
548
  if (options.retention?.(meta) !== true) return;
550
549
  let lease;
@@ -630,9 +629,9 @@ function createWorker(engine, options) {
630
629
  //#endregion
631
630
  //#region src/otel.ts
632
631
  /**
633
- * OpenTelemetry exporter (M5-T08; docs/09, section 3). `toOtel(run,
632
+ * OpenTelemetry exporter (M5-T08; https://docs.rulvar.com/guide/observability). `toOtel(run,
634
633
  * tracer)` maps the spanId tree of a run 1:1 onto OTel spans: one span
635
- * per rulvar span, parented per the docs/09 1.2 hierarchy (run > phase >
634
+ * per rulvar span, parented per the span hierarchy (run > phase >
636
635
  * agent > tool > child), with start/end timestamps from the lifecycle
637
636
  * events. Events without an own span (log, budget:update) attach as span
638
637
  * events on their enclosing span.
@@ -6,9 +6,9 @@ import { pathToFileURL } from "node:url";
6
6
  import { createInterface } from "node:readline";
7
7
  //#region src/config.ts
8
8
  /**
9
- * CLI configuration convention (shell-owned; the canonical grammar in
10
- * docs/06 section 10.5 says nothing about engine assembly, and the CLI
11
- * builds exclusively from the public API per docs/02 section 4):
9
+ * CLI configuration convention (shell-owned; the canonical CLI grammar
10
+ * says nothing about engine assembly, and the CLI builds exclusively
11
+ * from the public API):
12
12
  *
13
13
  * - `rulvar.config.mjs` (or .js) in the working directory default-exports
14
14
  * `{ engineOptions?, workflows? }`: adapters, stores, defaults come
@@ -68,8 +68,8 @@ function looksLikeFile(target) {
68
68
  //#region src/engine-assembly.ts
69
69
  /**
70
70
  * Engine assembly for CLI commands: the host's config supplies adapters
71
- * and defaults (the CLI depends only on @rulvar/core, docs/02 section
72
- * 4); --store selects the JsonlFileStore directory (default `.rulvar`),
71
+ * and defaults (the CLI depends only on @rulvar/core);
72
+ * --store selects the JsonlFileStore directory (default `.rulvar`),
73
73
  * and an explicit stores entry in engineOptions wins over it.
74
74
  */
75
75
  const DEFAULT_STORE_DIR = ".rulvar";
@@ -279,8 +279,7 @@ function reportOutcome(outcome, io) {
279
279
  //#endregion
280
280
  //#region src/commands.ts
281
281
  /**
282
- * The four M5 commands of the canonical CLI grammar (docs/06, section
283
- * 10.5; no aliases in v1):
282
+ * The four M5 commands of the canonical CLI grammar (no aliases in v1):
284
283
  *
285
284
  * rulvar run <file|name> [--args JSON] [--store PATH] [--budget-usd N]
286
285
  * rulvar resume <runId> [--store PATH]
@@ -288,7 +287,7 @@ function reportOutcome(outcome, io) {
288
287
  * rulvar inspect <runId> [--store PATH]
289
288
  *
290
289
  * `plan` and `kb` land with M6+/M10. Every command builds strictly from
291
- * the public @rulvar/core API (docs/02, section 4).
290
+ * the public @rulvar/core API.
292
291
  */
293
292
  function parseRunFlags(argv) {
294
293
  const { values, positionals } = parseArgs({
@@ -441,9 +440,9 @@ async function inspectCommand(argv, context) {
441
440
  return 0;
442
441
  }
443
442
  /**
444
- * rulvar plan "<goal>" [--dry-run] (docs/06, 10.5; M6-T11): plans a
443
+ * rulvar plan "<goal>" [--dry-run] (M6-T11): plans a
445
444
  * workflow script through @rulvar/planner (loaded dynamically: the CLI's
446
- * static dependency stays @rulvar/core only, docs/02 dependency rules),
445
+ * static dependency stays @rulvar/core only),
447
446
  * prints the accepted script and its advisories, and runs it in the
448
447
  * worker sandbox unless --dry-run.
449
448
  */
@@ -457,7 +456,7 @@ async function planCommand(argv, context) {
457
456
  if (goal === void 0 || parsed.positionals.length > 1) throw new ConfigError("usage: rulvar plan \"<goal>\" [--dry-run]");
458
457
  let plannerModule;
459
458
  try {
460
- plannerModule = await import("./dist-DtuSmcav.js");
459
+ plannerModule = await import("./dist-Cdj5YBRG.js");
461
460
  } catch {
462
461
  throw new ConfigError("rulvar plan requires @rulvar/planner (the plan agent, compileScript, and the worker sandbox live there); install it next to the CLI");
463
462
  }
@@ -484,7 +483,7 @@ async function planCommand(argv, context) {
484
483
  }), context.io);
485
484
  }
486
485
  /**
487
- * rulvar kb list (docs/06, 10.5; docs/05, 4.4; M10-T04): the second
486
+ * rulvar kb list (M10-T04): the second
488
487
  * consumption path. Claims with full provenance for the humans who
489
488
  * author ladders, floors, and profiles; no run and no pin, so model
490
489
  * names render VERBATIM here (only in-run cards are nameless). Reads
@@ -518,7 +517,7 @@ function renderKbList(snapshot, context) {
518
517
  }
519
518
  }
520
519
  /**
521
- * rulvar kb sweep (M11-T05; docs/05, section "Grounding and decay"):
520
+ * rulvar kb sweep (M11-T05):
522
521
  * falsification sweeps, run manually, from CI, or from a user cron,
523
522
  * NEVER engine-scheduled. The matrix is the config's FIXED pool
524
523
  * UNIONED with the store's falsification set: every model carrying an
@@ -534,7 +533,7 @@ async function kbSweepCommand(argv, context) {
534
533
  if (sweep === void 0) throw new ConfigError("rulvar kb sweep requires a kbSweep section in rulvar.config.mjs ({ committerId, models, cases }; docs/05, section 'Grounding and decay')");
535
534
  let evals;
536
535
  try {
537
- evals = await import("./dist-CU6iYxCW.js");
536
+ evals = await import("./dist-M-vPRtBM.js");
538
537
  } catch {
539
538
  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");
540
539
  }
@@ -607,7 +606,7 @@ async function kbSweepCommand(argv, context) {
607
606
  //#endregion
608
607
  //#region src/cli-main.ts
609
608
  /**
610
- * Command dispatch for the canonical grammar (docs/06, section 10.5):
609
+ * Command dispatch for the canonical grammar (https://docs.rulvar.com/guide/cli):
611
610
  * no aliases in v1; unknown commands and flags fail loudly with usage.
612
611
  */
613
612
  const HELP = `rulvar: durable multi-agent workflows (docs/06, section 10.5)
@@ -672,8 +671,8 @@ async function runCli(argv, options) {
672
671
  /**
673
672
  * CLI io seam: every command writes and prompts through this interface
674
673
  * so the e2e suite drives the real command paths in-process with
675
- * scripted stdin and captured output (docs/02, section 8.1: the CLI is
676
- * a shell strictly on top of the public APIs).
674
+ * scripted stdin and captured output (the CLI is a shell strictly on
675
+ * top of the public APIs).
677
676
  */
678
677
  /** The process-backed io the bin entry uses. */
679
678
  function processIo() {
@@ -1,4 +1,4 @@
1
- import { t as __esmMin } from "./dist-DtuSmcav.js";
1
+ import { t as __esmMin } from "./dist-Cdj5YBRG.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.1.0",
3
+ "version": "1.2.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.1.0"
25
+ "@rulvar/core": "1.2.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/planner": "1.1.0",
32
- "@rulvar/plan": "1.1.0",
33
- "@rulvar/evals": "1.1.0",
34
- "@rulvar/testing": "1.1.0",
35
- "@rulvar/store-sqlite": "1.1.0"
31
+ "@rulvar/testing": "1.2.0",
32
+ "@rulvar/store-sqlite": "1.2.0",
33
+ "@rulvar/planner": "1.2.0",
34
+ "@rulvar/evals": "1.2.0",
35
+ "@rulvar/plan": "1.2.0"
36
36
  },
37
37
  "bin": {
38
38
  "rulvar": "./dist/cli.js"