@damiangilgonzalez/harness 1.3.11 → 1.3.12

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/manifest.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.3.11",
2
+ "version": "1.3.12",
3
3
  "counts": {
4
4
  "skills": 291,
5
5
  "agents": 33,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@damiangilgonzalez/harness",
3
- "version": "1.3.11",
3
+ "version": "1.3.12",
4
4
  "description": "A guided harness builder that turns your goal into a minimal, verified AI-agent setup using strict best practices.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -313,7 +313,13 @@ export function capture(input = {}) {
313
313
  if (input.event === 'start' && !existing) return { record: null, path: null, notice: null, compactionHint: false };
314
314
 
315
315
  const repo = snapshot(cwd, anchor.baselineHead);
316
- const editCount = Math.max(0, (existing?.editCount || 0) + (finiteOrNull(input.editDelta, true) || 0));
316
+ // Compaction closes a context window, so the edit budget starts again from zero.
317
+ const previousEdits = input.event === 'compact' ? 0 : (existing?.editCount || 0);
318
+ const editCount = Math.max(0, previousEdits + (finiteOrNull(input.editDelta, true) || 0));
319
+ // Hint once per threshold crossed, and only on the edit that crosses it: re-emitting on
320
+ // every later event (Stop in particular) wakes the model again and loops.
321
+ const crossedThreshold = editCount > previousEdits
322
+ && Math.floor(editCount / config.editThreshold) > Math.floor(previousEdits / config.editThreshold);
317
323
  const baselineFiles = new Set(anchor.baselineFiles || []);
318
324
  const newDirtyPath = repo.files.some((path) => !baselineFiles.has(path));
319
325
  const baselineFingerprints = anchor.baselineFingerprints || {};
@@ -356,7 +362,7 @@ export function capture(input = {}) {
356
362
  record,
357
363
  path: recordPath,
358
364
  notice: consumeNotice(store),
359
- compactionHint: Boolean(config.compactionHint && editCount >= config.editThreshold),
365
+ compactionHint: Boolean(config.compactionHint && crossedThreshold),
360
366
  };
361
367
  }
362
368