@rulvar/planner 1.22.0 → 1.23.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 +18 -3
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { n as compileScript, r as scriptDiagnosticsOf, t as SANDBOX_GLOBALS } from "./compile-BtCY9wfO.js";
2
- import { ConfigError, InMemoryStore, SandboxError, ScriptRejected, createEngine, createSandboxBridge, defineWorkflow, toJournalValue } from "@rulvar/core";
2
+ import { ConfigError, InMemoryStore, SANDBOX_AGENT_OPT_KEYS, SandboxError, ScriptRejected, createEngine, createSandboxBridge, defineWorkflow, toJournalValue } from "@rulvar/core";
3
3
  import { createHash } from "node:crypto";
4
4
  import { Linter } from "eslint";
5
5
  import { toJsonDiagnostics, workflowsConfig } from "eslint-plugin-rulvar";
@@ -11,6 +11,13 @@ import { MessageChannel, Worker } from "node:worker_threads";
11
11
  * pure constant, byte-stable across runs; plan() (M6-T05) composes it
12
12
  * with profileCard(registry) and the goal. The usage examples are
13
13
  * distilled from the runnable examples/ corpus (M5-T09).
14
+ *
15
+ * The agent opts line is GENERATED from the runtime allowlist
16
+ * (`SANDBOX_AGENT_OPT_KEYS` in @rulvar/core), so the card can never
17
+ * drift from what the sandbox bridge actually accepts (v1.22.0 review
18
+ * P2-4: the hand-maintained list had silently fallen three options
19
+ * behind, and the card claimed identical calls journal as one result,
20
+ * which the ordinal semantics contradict).
14
21
  */
15
22
  const CARD = [
16
23
  "You write ONE JavaScript async-function BODY (the workflow script).",
@@ -18,11 +25,15 @@ const CARD = [
18
25
  "",
19
26
  "Available globals (the COMPLETE list; nothing else exists):",
20
27
  "- agent(prompt, opts?) -> Promise<value>: one subagent call.",
21
- " opts (JSON only): { agentType?, model?, effort?, schema?, tools?, onError?, label?, key?, estCost?, limits?, escalation?, fallback?, result? }",
28
+ ` opts (JSON only): { ${SANDBOX_AGENT_OPT_KEYS.map((key) => `${key}?`).join(", ")} }`,
22
29
  " - schema: a JSON Schema LITERAL (never a library value); the result is the validated object.",
23
30
  " - tools: an array of registered profile NAMES (strings only).",
24
31
  " - onError: 'throw' | 'null' (default 'null'; a failed call yields null and the loss is recorded).",
25
32
  " - model: a string; agentType: a registered profile name from the profile card.",
33
+ " - routing: a JSON map of invocation role to a model ref from the profile card",
34
+ " (e.g. { summarize: '<model ref>' }); wins over the profile's own routing.",
35
+ " - memoizeOutcome: true journals this exact outcome for replay on resume EVEN when it failed (default: failures rerun).",
36
+ " - replay: 'cache' | 'never'; 'never' forces a fresh live call on every resume, 'cache' reuses any matching prior.",
26
37
  "- parallel(fns, opts?) -> Promise<values[]>: concurrent branches; fns is an array of async functions.",
27
38
  " opts: { settle?: true } returns settled outcomes instead of throwing on the first failure.",
28
39
  "- pipeline(items, ...stageFns, opts?) -> Promise<results[]>: streams items through stages.",
@@ -42,7 +53,11 @@ const CARD = [
42
53
  "- Date.now() and Math.random() ARE the seeded shims; still prefer now() and random().",
43
54
  "- Never put functions inside option objects; options are pure JSON.",
44
55
  "- Policies are declarative JSON rule tables; ladders are JSON.",
45
- "- Identical calls with identical arguments journal as ONE result; pass { key } to repeat deliberately.",
56
+ "- Every call journals as its OWN operation: identical calls share a content key but take",
57
+ " sequential ordinals (0, 1, 2, ...), so repeats always RUN, never dedupe.",
58
+ "- For deliberate repeats still pass a distinguishing { key }: it binds each result to its",
59
+ " call by identity instead of position, so editing or reordering the script cannot attach",
60
+ " an old result to the wrong call on resume.",
46
61
  "",
47
62
  "Patterns (from the runnable corpus):",
48
63
  "- Adversarial panel:",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rulvar/planner",
3
- "version": "1.22.0",
3
+ "version": "1.23.0",
4
4
  "description": "Rulvar flagship hybrid mode: plan agent, compileScript, WorkerSandboxRunner, self-repair loop.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -23,14 +23,14 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "eslint": "^9.39.4",
26
- "eslint-plugin-rulvar": "1.22.0",
27
- "@rulvar/core": "1.22.0"
26
+ "eslint-plugin-rulvar": "1.23.0",
27
+ "@rulvar/core": "1.23.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/node": "^22.20.0",
31
31
  "tsdown": "^0.22.3",
32
32
  "typescript": "~6.0.3",
33
- "@rulvar/testing": "1.22.0"
33
+ "@rulvar/testing": "1.23.0"
34
34
  },
35
35
  "repository": {
36
36
  "type": "git",