ceulen 0.30.0 → 0.31.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/CHANGELOG.md CHANGED
@@ -1628,3 +1628,28 @@ Wave 1: first two production modules merged into the bundle.
1628
1628
  ## 0.1.0 — 2026-09-21
1629
1629
 
1630
1630
  Name reservation + bundle scaffold.
1631
+ ## 0.31.0 — 2026-11-23
1632
+
1633
+ DeepSeek V4 tool-selection guidance stops overriding a prerequisite read, and
1634
+ the `bash`-first hint stops mis-firing on "after" clauses.
1635
+
1636
+ - **Selection guidance** (`steering.selectionGuidance`, DeepSeek V4 only) no
1637
+ longer pushes one `codemode` script for every batch. It now says "use a
1638
+ direct call for one simple step; batch independent calls in one round
1639
+ (parallel direct calls, **or** codemode with `Promise.allSettled` to filter
1640
+ or compute in place)". Live Herdr run on `router/combo/deepseek-v4.1-flash`:
1641
+ the four-file sum task dropped from 2 tool rounds to 1 (four parallel
1642
+ `read` calls, then one `bash`), which the previous codemode-first wording
1643
+ never produced.
1644
+ - **`runTaskFirstToolHint`** used to fire on any execution verb anywhere in the
1645
+ prompt, so "Read `fixtures/runbook.txt`, then run its command" got a
1646
+ "FIRST tool call MUST be bash … Do NOT call read first" hint that directly
1647
+ contradicted the read the task requires (live-observed: Flash read the file,
1648
+ then re-read it because the reminder demanded compliance). Suppressed when a
1649
+ read/open/review/check precedes the first execution verb, and when an
1650
+ `after you read` / `after reading` clause makes the read a prerequisite.
1651
+ - **Scoped to the first execution clause**: "Run the tests, then deploy after
1652
+ reviewing the results" keeps the `bash`-first hint — the review gates the
1653
+ deploy, not the tests. An earlier revision scanned the whole suffix and
1654
+ silently dropped the hint there.
1655
+
@@ -42,7 +42,7 @@ export function deepSeekSelectionGuidance(activeTools: readonly string[], direct
42
42
  has("serena_find_symbol") && "Named code symbol → serena_find_symbol",
43
43
  has("serena_find_referencing_symbols") && "Symbol usages → serena_find_referencing_symbols",
44
44
  has("serena_get_symbols_overview") && "File symbol outline → serena_get_symbols_overview",
45
- directTools.includes("codemode") && "Batch independent calls (e.g. reads of known paths) in one codemode script with Promise.allSettled; await dependencies in order. For one simple call, use the direct tool if declared.",
45
+ directTools.includes("codemode") && "Use a direct call for one simple step. Batch independent calls in one round (parallel direct calls, or codemode with Promise.allSettled to filter or compute in place). Await dependencies in order.",
46
46
  directTools.includes("codemode") && directTools.length < activeTools.length && "For tools not declared directly, call them through codemode (tools.<name>(args)).",
47
47
  directTools.includes("tool_search") && "To load a deferred tool for direct use, make one targeted tool_search, then call the match.",
48
48
  ].filter(Boolean);
@@ -80,6 +80,8 @@ export function applyPatchPreferenceGuidance(activeTools: readonly string[]): st
80
80
 
81
81
  // ── Prompt-aware first-tool hints ──
82
82
 
83
+ const EXEC_VERBS_RE = /\b(run|running|execute|executing|build|building|compile|compiling|lint|linting|format|typecheck|type-check|deploy|install|start)\b/g;
84
+
83
85
  /**
84
86
  * Detect a clear RUN/BUILD/EXECUTE intent in the user prompt and return a
85
87
  * targeted first-tool hint that forces bash on turn 1. Returns undefined for
@@ -93,10 +95,18 @@ export function runTaskFirstToolHint(prompt: string): string | undefined {
93
95
  const p = (prompt || "").toLowerCase();
94
96
  // Execution verbs. "test" alone is intentionally excluded: "find test files"
95
97
  // is a discovery task, not an execution task.
96
- const hasExecVerb = /\b(run|running|execute|executing|build|building|compile|compiling|lint|linting|format|typecheck|type-check|deploy|install|start)\b/.test(p);
97
- if (!hasExecVerb) return undefined;
98
+ EXEC_VERBS_RE.lastIndex = 0;
99
+ const exec = EXEC_VERBS_RE.exec(p);
100
+ if (!exec) return undefined;
98
101
  // Don't misdirect prompts that are really about locating/explaining/analyzing.
99
102
  if (/\b(find|list|show|where|definition|references|outline|inspect|explain|summarize|analyze|analyse|how (do|does|to)|what)\b/.test(p)) return undefined;
103
+ // A prerequisite read can precede execution in text or follow it in an "after"
104
+ // clause — but only within the FIRST execution clause: "run the tests, then
105
+ // deploy after reviewing" gates the deploy, not the tests.
106
+ if (/\b(read|open|review|check)\b/.test(p.slice(0, exec.index))) return undefined;
107
+ const rest = p.slice(exec.index + exec[0].length);
108
+ const nextClause = /\bthen\b|(?=(?:run|running|execute|executing|build|building|compile|compiling|lint|linting|format|typecheck|type-check|deploy|install|start)\b)/.exec(rest);
109
+ if (/\bafter\s+(?:you\s+)?(?:read|open|review|check|reading|opening|reviewing|checking)\b/.test(nextClause ? rest.slice(0, nextClause.index) : rest)) return undefined;
100
110
  return "⚠️ THIS request is a RUN / BUILD / EXECUTE task → your FIRST tool call MUST be bash (e.g. `npm test`, `cd <pkg> && npm test`, `pytest`, `make`, `npm run <script>`). Do NOT call find / ls / read / grep first — you do not need to locate anything to run a standard command.";
101
111
  }
102
112
 
@@ -70,9 +70,15 @@ describe("runTaskFirstToolHint", () => {
70
70
  assert.ok(runTaskFirstToolHint("Lint the source files."));
71
71
  assert.ok(runTaskFirstToolHint("Execute the test suite."));
72
72
  assert.ok(runTaskFirstToolHint("Compile the TypeScript."));
73
+ assert.ok(runTaskFirstToolHint("Run the tests, then read the report."));
74
+ assert.ok(runTaskFirstToolHint("Run the tests after lunch, then read the report."));
75
+ assert.ok(runTaskFirstToolHint("Run the tests, then deploy after reviewing the results"));
73
76
  });
74
77
 
75
- it("returns undefined for discovery/explanation tasks (no false positives)", () => {
78
+ it("does not force bash for discovery, explanation, or a prerequisite read", () => {
79
+ assert.equal(runTaskFirstToolHint("Read fixtures/runbook.txt, then run its command and report the exact stdout."), undefined);
80
+ assert.equal(runTaskFirstToolHint("Run the command after you read fixtures/runbook.txt"), undefined);
81
+ assert.equal(runTaskFirstToolHint("Run the command after reading fixtures/runbook.txt."), undefined);
76
82
  assert.equal(runTaskFirstToolHint("Find all test files for the project."), undefined);
77
83
  assert.equal(runTaskFirstToolHint("Find TypeScript test files under extensions/test."), undefined);
78
84
  assert.equal(runTaskFirstToolHint("Inspect symbols in index.ts and summarize them."), undefined);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ceulen",
3
- "version": "0.30.0",
3
+ "version": "0.31.0",
4
4
  "description": "Ceulen — the Pi coding agent, fully dressed: one bundle extension carrying the full toolkit with a single /ceulen config command.",
5
5
  "type": "module",
6
6
  "license": "MIT",