@really-knows-ai/foundry 3.6.2 → 3.6.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.6.3] - 2026-05-26
4
+
5
+ ### Fixed
6
+
7
+ - Validator script crashes now surface a single clear error ("Validator produced no valid output — check the script for syntax errors") instead of 20+ individual "Invalid JSON" parse errors from the stack trace.
8
+
3
9
  ## [3.6.2] - 2026-05-25
4
10
 
5
11
  ### Fixed
@@ -197,6 +197,23 @@ export function collectValidatorResult(parseResult, lawId, validatorId, results)
197
197
  }
198
198
  }
199
199
 
200
+ /**
201
+ * If every line of output was unparseable, the validator script itself is
202
+ * broken (syntax error, runtime crash, etc.). Replace the noise of 20+
203
+ * individual "Invalid JSON" errors with a single actionable message.
204
+ */
205
+ export function checkForValidatorCrash(result) {
206
+ if (result.items.length === 0 && result.parseErrors.length > 0) {
207
+ return {
208
+ ...result,
209
+ parseErrors: [
210
+ `Validator produced no valid output (${result.parseErrors.length} unparseable lines). Check the validator script for syntax errors.`,
211
+ ],
212
+ };
213
+ }
214
+ return result;
215
+ }
216
+
200
217
  /**
201
218
  * Execute a validator command and parse its JSONL output.
202
219
  */
@@ -209,14 +226,18 @@ export async function executeValidator(expanded, worktree, patterns) {
209
226
  });
210
227
  const { Readable } = await import('stream');
211
228
  const stream = Readable.from([output]);
212
- return await parseValidatorJsonl(stream, patterns);
229
+ return checkForValidatorCrash(
230
+ await parseValidatorJsonl(stream, patterns),
231
+ );
213
232
  } catch (err) {
214
233
  // Validator command failed — prefer stdout for JSONL
215
234
  // (tools like rg exit 1 with results on stdout)
216
235
  const output = (err.stdout || err.stderr || err.message || '').trim();
217
236
  const { Readable } = await import('stream');
218
237
  const stream = Readable.from([output]);
219
- return await parseValidatorJsonl(stream, patterns);
238
+ return checkForValidatorCrash(
239
+ await parseValidatorJsonl(stream, patterns),
240
+ );
220
241
  }
221
242
  }
222
243
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@really-knows-ai/foundry",
3
- "version": "3.6.2",
3
+ "version": "3.6.3",
4
4
  "description": "A skill-driven framework for governed artefact generation with AI coding tools. Define your own artefact types, laws, and flows — Foundry handles the forge → quench → appraise pipeline with deterministic routing, quality gates, and iterative refinement.",
5
5
  "type": "module",
6
6
  "main": "dist/.opencode/plugins/foundry.js",