pi-goal-list-loop-audit 0.28.15 → 0.28.16

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.
@@ -213,12 +213,22 @@ export interface ReviewerOutcome {
213
213
  reportPath?: string;
214
214
  enqueued: number;
215
215
  proposed: number;
216
- /** v0.27.5: the cascade step that actually fired (notify-and-idle | convert-findings-to-list | queue-leftovers | fire-audit-on-clean | propose-goal | aggressive-relaunch | report-only) — surfaces in /goal status and tests. */
216
+ /** v0.27.5: the cascade step that actually fired (notify-and-idle | convert-findings-to-list | queue-leftovers | fire-audit-on-clean | propose-goal | aggressive-relaunch | duplicate-suppressed) — surfaces in /goal status and tests. v0.28.16: "duplicate-suppressed" = the clean completion WAS a regression scan, so the follow-up scan was deduped. */
217
217
  cascadeStep?: string;
218
218
  }
219
219
 
220
220
  export const REVIEWER_REFIRE_WINDOW_MS = 5 * 60_000;
221
221
 
222
+ /** v0.28.16: normalize an objective for duplicate-compare — lowercase,
223
+ * goal-ids (yyyyMMddHHmmss-xxxxxx) become <id>, whitespace collapses. */
224
+ export function normalizeObjective(s: string): string {
225
+ return s
226
+ .toLowerCase()
227
+ .replace(/\b\d{14}-[a-z0-9]{6}\b/g, "<id>")
228
+ .replace(/\s+/g, " ")
229
+ .trim();
230
+ }
231
+
222
232
  /** The reviewer lifecycle (contract item 1). */
223
233
  export function runReviewer(
224
234
  config: ReviewerConfig,
@@ -310,7 +320,16 @@ export function runReviewer(
310
320
  // aggressive mode → relaunch the audit goal directly (no Confirm).
311
321
  if (findings.length === 0 && config.cascade.includes("fire-audit-on-clean")) {
312
322
  const auditObjective = `Post-completion regression scan after ${source.goalId} (${config.auditScope})`;
313
- if (aggressive) {
323
+ // v0.28.16: duplicate-scan dedupe — the reviewer fires ON completion,
324
+ // so source.objective IS the most recent completion. If the goal that
325
+ // just completed was itself this same scan (normalized: goal-ids
326
+ // stripped), the proposal would be a scan-of-a-scan — the cascade loop
327
+ // that fired twice on 2026-07-28. Suppress the proposal/enqueue (the
328
+ // report is still written; the ledger records the reason).
329
+ if (normalizeObjective(source.objective) === normalizeObjective(auditObjective)) {
330
+ deps.ledger("reviewer_suppressed", { reason: "duplicate-scan", goalId: source.goalId, objective: auditObjective });
331
+ cascadeStep = "duplicate-suppressed";
332
+ } else if (aggressive) {
314
333
  if (deps.proposeGoal(auditObjective, "aggressive postaudit: clean completion — relaunching the regression scan as /goal")) {
315
334
  proposed++;
316
335
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-goal-list-loop-audit",
3
- "version": "0.28.15",
3
+ "version": "0.28.16",
4
4
  "description": "Goal. Loop. Audit. Done. \u2014 a pi-coding-agent extension that supervises long-running work, with isolated auditor on each completion. Beat bamboozling by design: the auditor runs in a fresh session with no extensions, no skills, no editor \u2014 only the read tools needed to verify your goal.",
5
5
  "license": "MIT",
6
6
  "author": "dracon",