@infinitedusky/indusk-mcp 1.19.0 → 1.20.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.
@@ -226,15 +226,48 @@ syslog(
226
226
  );
227
227
 
228
228
  const syslogPath = resolve(projectRoot, ".indusk", "eval", "system.log");
229
+ // NOTE: this inline script runs with --input-type=module (see spawn below).
230
+ // ESM scope — use static imports from node: specifiers only. CJS module
231
+ // resolution throws ReferenceError in ESM scope at parse, and stdio:"ignore"
232
+ // on the detached spawn would swallow the error. For the full history see
233
+ // .indusk/planning/archive/bug-fix-eval-agent/diagnosis.md
229
234
  const evaluatorScript = `
230
- const fs = require("fs");
231
- const path = require("path");
235
+ import { mkdirSync, appendFileSync } from "node:fs";
236
+ import { dirname, join } from "node:path";
232
237
  function syslog(msg) {
233
238
  try {
234
- fs.mkdirSync(path.dirname("${syslogPath}"), { recursive: true });
235
- fs.appendFileSync("${syslogPath}", new Date().toISOString() + " " + msg + "\\n");
239
+ mkdirSync(dirname("${syslogPath}"), { recursive: true });
240
+ appendFileSync("${syslogPath}", new Date().toISOString() + " " + msg + "\\n");
236
241
  } catch {}
237
242
  }
243
+ // Belt-and-suspenders: if the evaluator crashes with an unhandled exception
244
+ // or rejection, write a loud error entry to results.log before exit so the
245
+ // failure is never silent again.
246
+ function writeErrorResult(message) {
247
+ try {
248
+ const logPath = join(${JSON.stringify(projectRoot)}, ".indusk", "eval", "results.log");
249
+ mkdirSync(dirname(logPath), { recursive: true });
250
+ const entry = JSON.stringify({
251
+ version: 1,
252
+ timestamp: new Date().toISOString(),
253
+ mode: "eval",
254
+ changeId: ${JSON.stringify(changeId)},
255
+ error: true,
256
+ message,
257
+ });
258
+ appendFileSync(logPath, entry + "\\n", "utf8");
259
+ } catch {}
260
+ }
261
+ process.on("uncaughtException", (err) => {
262
+ syslog("evaluator uncaughtException — " + (err && err.message ? err.message : String(err)));
263
+ writeErrorResult("uncaughtException: " + (err && err.message ? err.message : String(err)));
264
+ process.exit(1);
265
+ });
266
+ process.on("unhandledRejection", (reason) => {
267
+ syslog("evaluator unhandledRejection — " + (reason && reason.message ? reason.message : String(reason)));
268
+ writeErrorResult("unhandledRejection: " + (reason && reason.message ? reason.message : String(reason)));
269
+ process.exit(1);
270
+ });
238
271
  syslog("evaluator process started — changeId: ${changeId}");
239
272
  import("${useModule}")
240
273
  .then(m => {
@@ -254,17 +287,7 @@ import("${useModule}")
254
287
  })
255
288
  .catch(err => {
256
289
  syslog("evaluator crashed — " + (err.message || String(err)));
257
- const logPath = path.join(${JSON.stringify(projectRoot)}, ".indusk", "eval", "results.log");
258
- fs.mkdirSync(path.dirname(logPath), { recursive: true });
259
- const entry = JSON.stringify({
260
- version: 1,
261
- timestamp: new Date().toISOString(),
262
- mode: "eval",
263
- changeId: ${JSON.stringify(changeId)},
264
- error: true,
265
- message: err.message || String(err),
266
- });
267
- fs.appendFileSync(logPath, entry + "\\n", "utf8");
290
+ writeErrorResult(err.message || String(err));
268
291
  process.exit(1);
269
292
  });
270
293
  `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infinitedusky/indusk-mcp",
3
- "version": "1.19.0",
3
+ "version": "1.20.0",
4
4
  "description": "InDusk development system — skills, MCP tools, and CLI for structured AI-assisted development",
5
5
  "type": "module",
6
6
  "files": [
package/skills/planner.md CHANGED
@@ -202,6 +202,12 @@ status: proposed | accepted | deprecated | superseded | abandoned
202
202
 
203
203
  # {Title}
204
204
 
205
+ ## Goal
206
+
207
+ **{One sentence. The headline outcome, in plain language. What will be true when this ADR's decisions ship that isn't true today.}**
208
+
209
+ {One short paragraph — 2-4 sentences — grounding the goal in concrete user-visible terms. Name at least one specific current failure this fixes, so a reader arriving cold can tell what problem the rest of the ADR is solving. The Y-statement below formalizes the decision; this section lets a reader skim the headline without hunting through seven clauses first.}
210
+
205
211
  ## Y-Statement
206
212
 
207
213
  **In the context of:**