@specverse/engines 6.0.16 → 6.0.17

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.
@@ -1173,9 +1173,12 @@ import { existsSync, mkdirSync, cpSync, statSync, readdirSync } from 'fs';`,
1173
1173
 
1174
1174
  // Copy source into outputDir/input/ (excluding noisy indices) so the
1175
1175
  // run dir is self-contained.
1176
+ // Skip the copy when sourceAbs IS already the input dir \u2014 orchestrators
1177
+ // (e.g. the eval harness) may pre-materialize source and pass it in.
1176
1178
  const inDir = inputDir(outputDir);
1177
1179
  const stat = statSync(sourceAbs);
1178
- if (stat.isDirectory()) {
1180
+ const sourceIsInput = sourceAbs === inDir;
1181
+ if (stat.isDirectory() && !sourceIsInput) {
1179
1182
  if (existsSync(inDir)) {
1180
1183
  // Replace the empty stub from ensureSubdirs with the real copy.
1181
1184
  try { cpSync(sourceAbs, inDir, { recursive: true, force: true }); }
@@ -1183,17 +1186,17 @@ import { existsSync, mkdirSync, cpSync, statSync, readdirSync } from 'fs';`,
1183
1186
  console.error('Failed to copy source into input/: ' + err.message);
1184
1187
  process.exit(1);
1185
1188
  }
1186
- // Strip noise.
1187
- for (const noise of ['.gitnexus', 'node_modules', '.DS_Store']) {
1188
- const p = resolve(inDir, noise);
1189
- try { if (existsSync(p)) require('fs').rmSync(p, { recursive: true, force: true }); } catch {}
1190
- }
1191
1189
  }
1192
- } else {
1190
+ } else if (!stat.isDirectory()) {
1193
1191
  // Single-file source \u2014 copy it into input/ as-is.
1194
1192
  mkdirSync(inDir, { recursive: true });
1195
1193
  cpSync(sourceAbs, resolve(inDir, basename(sourceAbs)));
1196
1194
  }
1195
+ // Always strip noise (handles both fresh-copy and pre-populated cases).
1196
+ for (const noise of ['.gitnexus', 'node_modules', '.DS_Store']) {
1197
+ const p = resolve(inDir, noise);
1198
+ try { if (existsSync(p)) require('fs').rmSync(p, { recursive: true, force: true }); } catch {}
1199
+ }
1197
1200
 
1198
1201
  console.log(' source: ' + sourceAbs);
1199
1202
  console.log(' output: ' + outputDir);
@@ -1228,9 +1228,12 @@ import { existsSync, mkdirSync, cpSync, statSync, readdirSync } from 'fs';`,
1228
1228
 
1229
1229
  // Copy source into outputDir/input/ (excluding noisy indices) so the
1230
1230
  // run dir is self-contained.
1231
+ // Skip the copy when sourceAbs IS already the input dir — orchestrators
1232
+ // (e.g. the eval harness) may pre-materialize source and pass it in.
1231
1233
  const inDir = inputDir(outputDir);
1232
1234
  const stat = statSync(sourceAbs);
1233
- if (stat.isDirectory()) {
1235
+ const sourceIsInput = sourceAbs === inDir;
1236
+ if (stat.isDirectory() && !sourceIsInput) {
1234
1237
  if (existsSync(inDir)) {
1235
1238
  // Replace the empty stub from ensureSubdirs with the real copy.
1236
1239
  try { cpSync(sourceAbs, inDir, { recursive: true, force: true }); }
@@ -1238,17 +1241,17 @@ import { existsSync, mkdirSync, cpSync, statSync, readdirSync } from 'fs';`,
1238
1241
  console.error('Failed to copy source into input/: ' + err.message);
1239
1242
  process.exit(1);
1240
1243
  }
1241
- // Strip noise.
1242
- for (const noise of ['.gitnexus', 'node_modules', '.DS_Store']) {
1243
- const p = resolve(inDir, noise);
1244
- try { if (existsSync(p)) require('fs').rmSync(p, { recursive: true, force: true }); } catch {}
1245
- }
1246
1244
  }
1247
- } else {
1245
+ } else if (!stat.isDirectory()) {
1248
1246
  // Single-file source — copy it into input/ as-is.
1249
1247
  mkdirSync(inDir, { recursive: true });
1250
1248
  cpSync(sourceAbs, resolve(inDir, basename(sourceAbs)));
1251
1249
  }
1250
+ // Always strip noise (handles both fresh-copy and pre-populated cases).
1251
+ for (const noise of ['.gitnexus', 'node_modules', '.DS_Store']) {
1252
+ const p = resolve(inDir, noise);
1253
+ try { if (existsSync(p)) require('fs').rmSync(p, { recursive: true, force: true }); } catch {}
1254
+ }
1252
1255
 
1253
1256
  console.log(' source: ' + sourceAbs);
1254
1257
  console.log(' output: ' + outputDir);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@specverse/engines",
3
- "version": "6.0.16",
3
+ "version": "6.0.17",
4
4
  "description": "SpecVerse toolchain — parser, inference, realize, generators, AI, registry, bundles",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",