@activate-core/test-forge 0.9.4 → 0.9.6

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.
@@ -215,6 +215,15 @@ export async function runGenerate(docsDir, useAI = true, force = false, only, ar
215
215
  if (harnessByArea.has(area))
216
216
  return harnessByArea.get(area) ?? undefined;
217
217
  const info = harnessInfo(areaDir, framework, ext);
218
+ // REUSE an existing testkit instead of regenerating it. This is what
219
+ // makes one-by-one (`generate --journey X`) cheap: the first journey
220
+ // in an area builds the testkit, every later journey reuses it — no
221
+ // extra AI call (and no risk of that call eating the token limit).
222
+ // Pass --force to rebuild a stale testkit (e.g. after upgrading).
223
+ if (!force && existsSync(info.path)) {
224
+ harnessByArea.set(area, info.path);
225
+ return info.path;
226
+ }
218
227
  const kit = await generateValidatedAsync(() => generateHarnessAsync(info.path, framework), ext.endsWith('.js') ? '.js' : '.ts');
219
228
  if (kit === null) {
220
229
  harnessByArea.set(area, null);
@@ -358,8 +367,14 @@ export async function runGenerate(docsDir, useAI = true, force = false, only, ar
358
367
  const degraded = useAI && (status === 'basic' || seedStatus === 'failed');
359
368
  if (!degraded) {
360
369
  cache[file] = hash;
361
- saveCache(CACHE_PATH, cache);
362
370
  }
371
+ else {
372
+ // Actively UN-mark a degraded journey (even under --force, which may
373
+ // be re-processing a stale "done" from an earlier buggy run), so the
374
+ // next `generate` re-does it instead of skipping a thin fallback.
375
+ delete cache[file];
376
+ }
377
+ saveCache(CACHE_PATH, cache);
363
378
  results.push({
364
379
  journeyName: journey.name,
365
380
  testDir,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@activate-core/test-forge",
3
- "version": "0.9.4",
3
+ "version": "0.9.6",
4
4
  "description": "AI-powered QA automation. Scans a project, drafts journey docs, and generates seeded Jest/Playwright tests. Works in any project, with any AI CLI.",
5
5
  "type": "module",
6
6
  "bin": {