pi-goal-list-loop-audit 0.28.30 → 0.28.31

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.
@@ -4185,6 +4185,64 @@ function cmdLog(args: string, ctx: ExtensionContext): void {
4185
4185
  ctx.ui.notify(`Ledger tail (last ${tail.length}${all ? "" : " non-noise"} events — /glla log <N> for more, /glla log all to include noise):\n${lines.join("\n")}`, "info");
4186
4186
  }
4187
4187
 
4188
+ /**
4189
+ * v0.28.31: /glla reset — ONE confirmed command that leaves a project with
4190
+ * zero live glla state. User directive: "make sure we only have one goal or
4191
+ * loop or list at a time — many of my older projects have leftovers" (the
4192
+ * fleet scan found queued lists up to 56 deep, held loops at iter 50, and
4193
+ * paused goals across ~10 projects). The goal is archived HONESTLY (aborted
4194
+ * — lands in goals/ + the archive, reviewer's abort-suppression applies),
4195
+ * the list is cleared, the loop record is wiped after a graceful stop.
4196
+ * History stays in .pi-glla; only the live state goes.
4197
+ */
4198
+ async function cmdGllaReset(ctx: ExtensionContext): Promise<void> {
4199
+ const g = state.goal;
4200
+ const live = g && (g.status === "active" || g.status === "paused" || g.status === "auditing");
4201
+ const n = listQueue().length;
4202
+ const loop = state.loop;
4203
+ if (!g && n === 0 && !loop) {
4204
+ ctx.ui.notify("glla state is already clean — no goal, no list, no loop.", "info");
4205
+ return;
4206
+ }
4207
+ const parts: string[] = [];
4208
+ if (live) parts.push(`goal archived as aborted: ${g!.objective.replace(/\s+/g, " ").slice(0, 70)}`);
4209
+ else if (g) parts.push(`terminal goal record cleared (${g.status})`);
4210
+ if (n > 0) parts.push(`list cleared (${n} item${n === 1 ? "" : "s"})`);
4211
+ if (loop) parts.push(`loop ${loop.active ? "stopped" : "cleared"} (iter ${loop.iteration}${loop.bestValue !== null && loop.bestValue !== undefined ? `, best ${loop.bestValue}` : ""})`);
4212
+ if (ctx.hasUI) {
4213
+ try {
4214
+ const ok = await ctx.ui.confirm("Reset glla state?", `${parts.map((p) => ` ${p}`).join("\n")}\n\nHistory stays in .pi-glla (archive + ledger); the live state is wiped.`);
4215
+ if (!ok) {
4216
+ ctx.ui.notify("Reset cancelled.", "info");
4217
+ return;
4218
+ }
4219
+ } catch {
4220
+ ctx.ui.notify("Reset cancelled.", "info");
4221
+ return;
4222
+ }
4223
+ }
4224
+ appendLedger(ctx.cwd, "glla_reset", { goalId: live ? g!.id : undefined, listCleared: n, loop: loop ? { iteration: loop.iteration, active: loop.active } : undefined });
4225
+ if (live) {
4226
+ archiveCurrentGoal(ctx, "aborted", "user reset (/glla reset)");
4227
+ ctx.abort();
4228
+ } else if (g) {
4229
+ state = { ...state, goal: null };
4230
+ }
4231
+ if (n > 0) {
4232
+ state = { ...state, list: [] };
4233
+ appendLedger(ctx.cwd, "list_cleared", { via: "glla_reset" });
4234
+ }
4235
+ if (loop) {
4236
+ clearLoopTimer();
4237
+ state.loop = undefined;
4238
+ await finishLoopGit(ctx, loop);
4239
+ appendLedger(ctx.cwd, "loop_stopped", { reason: "user reset (/glla reset)", iterations: loop.iteration, best: loop.bestValue });
4240
+ }
4241
+ persistState(ctx);
4242
+ ctx.ui.notify(`glla reset done: ${parts.join(" · ")}. Clean slate.`, "info");
4243
+ notifyExternal(ctx, "glla state reset by user — clean slate.");
4244
+ }
4245
+
4188
4246
  function cmdAudits(args: string, ctx: ExtensionContext): void {
4189
4247
  const full = /\bfull\b/.test(args);
4190
4248
  const all = /\b(?:all|global|log)\b/.test(args);
@@ -4242,6 +4300,11 @@ async function cmdSettings(args: string, ctx: ExtensionContext): Promise<void> {
4242
4300
  cmdLog(trimmed.slice("log".length).trim(), ctx);
4243
4301
  return;
4244
4302
  }
4303
+ // v0.28.31: /glla reset — one-shot clean slate for leftover-laden projects.
4304
+ if (/^reset\b/.test(trimmed)) {
4305
+ await cmdGllaReset(ctx);
4306
+ return;
4307
+ }
4245
4308
  if (/^reviewer\b/.test(trimmed)) {
4246
4309
  await cmdReviewerSettings(ctx);
4247
4310
  return;
@@ -4633,6 +4696,7 @@ export default function (pi: ExtensionAPI): void {
4633
4696
  ["decisionpopup=", "on|off: decision pauses pop the select() picker (default on; the widget card always lists the options, /goal decide reopens the picker)"],
4634
4697
  ["auditcap=", "N: pause goal after N consecutive auditor disapprovals (default 5, 0 = unlimited)"],
4635
4698
  ["log", "event-trail tail: /glla log [N] — who created/resumed/paused what, from where (v0.28.28)"],
4699
+ ["reset", "wipe live glla state (goal archived, list cleared, loop stopped) — one-shot cleanup for leftover-laden projects"],
4636
4700
  ["auditfeedbackchars=", "cap on executor-visible disapproval report chars (0 = full report, the default)"],
4637
4701
  ["aggressivemode=", "on: keep-going defaults — autoResume, cap 10, stuck 10, wedge off, quota auto-retry, cap→TODOs"],
4638
4702
  ["quotaretryminutes=", "N: minutes before auto-retrying a quota-exhausted auditor (default 60)"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-goal-list-loop-audit",
3
- "version": "0.28.30",
3
+ "version": "0.28.31",
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",