pi-goal-list-loop-audit 0.28.26 → 0.28.27
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/README.md +1 -0
- package/extensions/goal-loop-core.ts +2 -2
- package/extensions/loops/goal.ts +42 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -39,6 +39,7 @@ Five top-level commands — `/goal`, `/list`, `/loop`, `/glla`, `/review`:
|
|
|
39
39
|
/goal resume # resume
|
|
40
40
|
/goal cancel # abort
|
|
41
41
|
/goal decide # re-open the decision picker (v0.28.23)
|
|
42
|
+
/goal audit # run the isolated auditor on the current goal now — no agent turn (v0.28.27)
|
|
42
43
|
/goal tweak "<new objective>" # edit in place (Confirm dialog)
|
|
43
44
|
/goal archive # archived goals, newest first
|
|
44
45
|
/glla # settings UI table · /glla key=value · /glla stats · /glla audits [N|full] · /glla postaudit · /glla autoaccept=on
|
|
@@ -212,9 +212,9 @@ export interface Goal {
|
|
|
212
212
|
export type GoalRoute =
|
|
213
213
|
| { kind: "draft" }
|
|
214
214
|
| { kind: "set"; text: string }
|
|
215
|
-
| { kind: "sub"; name: "status" | "pause" | "resume" | "cancel" | "decide" | "tweak" | "archive" | "start"; rest: string };
|
|
215
|
+
| { kind: "sub"; name: "status" | "pause" | "resume" | "cancel" | "decide" | "audit" | "tweak" | "archive" | "start"; rest: string };
|
|
216
216
|
|
|
217
|
-
const GOAL_EXACT_SUBS = new Set(["status", "pause", "resume", "cancel", "decide"]);
|
|
217
|
+
const GOAL_EXACT_SUBS = new Set(["status", "pause", "resume", "cancel", "decide", "audit"]);
|
|
218
218
|
const GOAL_ARG_SUBS = new Set(["tweak", "archive", "start"]);
|
|
219
219
|
|
|
220
220
|
export function routeGoalArgs(raw: string): GoalRoute {
|
package/extensions/loops/goal.ts
CHANGED
|
@@ -568,6 +568,12 @@ function heartbeatTick(): void {
|
|
|
568
568
|
// machinery below stays quiet for 3 minutes while the replaced session
|
|
569
569
|
// settles (latch watchdog, wedge alert, refire counting all resume after).
|
|
570
570
|
if (Date.now() < compactionGraceUntil) return;
|
|
571
|
+
// v0.28.27: a stale (session-replaced) handle can never land a send —
|
|
572
|
+
// the terminal warning already fired once. ALL stall machinery stays
|
|
573
|
+
// quiet from here on: refiring into a dead process is misleading, and
|
|
574
|
+
// worse, the stall escalation would PAUSE the goal — silently cancelling
|
|
575
|
+
// the interruptedAt → auto-resume-on-restart promise the footer shows.
|
|
576
|
+
if (extensionApiStale) return;
|
|
571
577
|
// v0.26.5: pending-latch watchdog — a queued continuation whose turn
|
|
572
578
|
// trigger was dropped (field-observed post-compaction: continuation
|
|
573
579
|
// ACCEPTED at compact+0s, then 22 minutes of silence). The stuck latch
|
|
@@ -963,15 +969,17 @@ function archiveCurrentGoal(ctx: ExtensionContext, status: Status, stopReason?:
|
|
|
963
969
|
* infra) → hand back to the agent: resume active + continuation, verdict
|
|
964
970
|
* durable in auditHistory.
|
|
965
971
|
*/
|
|
966
|
-
async function retryStoredCompletionAudit(ctx: ExtensionContext): Promise<void> {
|
|
972
|
+
async function retryStoredCompletionAudit(ctx: ExtensionContext, origin: "quota-retry" | "manual" = "quota-retry"): Promise<void> {
|
|
967
973
|
const goal = state.goal;
|
|
968
974
|
if (!goal?.pendingCompletion) return;
|
|
969
975
|
if (completionAuditInFlight) return;
|
|
970
976
|
const liveCtx = freshCtx() ?? ctx;
|
|
971
977
|
const claim = goal.pendingCompletion;
|
|
972
978
|
updateGoal({ status: "auditing" }, liveCtx);
|
|
973
|
-
appendLedger(liveCtx.cwd, "goal_resumed", { via: "quota-retry-direct-audit" });
|
|
974
|
-
liveCtx.ui.notify(
|
|
979
|
+
appendLedger(liveCtx.cwd, "goal_resumed", { via: origin === "manual" ? "manual-audit" : "quota-retry-direct-audit" });
|
|
980
|
+
liveCtx.ui.notify(origin === "manual"
|
|
981
|
+
? "Manual /goal audit — running the isolated auditor now (no agent turn needed)."
|
|
982
|
+
: "Auditor quota window elapsed — retrying the audit with your stored completion claim (no agent turn needed).", "info");
|
|
975
983
|
const settings = loadSettings(liveCtx.cwd);
|
|
976
984
|
const { model: auditorModel, error: modelError, via } = resolveAuditorModel(liveCtx, settings.auditorModel);
|
|
977
985
|
if (modelError) liveCtx.ui.notify(`Auditor model issue: ${modelError}`, "warning");
|
|
@@ -1027,9 +1035,9 @@ async function retryStoredCompletionAudit(ctx: ExtensionContext): Promise<void>
|
|
|
1027
1035
|
if (result.approved) {
|
|
1028
1036
|
updateGoal({ auditHistory: history, pendingCompletion: undefined }, liveCtx);
|
|
1029
1037
|
const objective = state.goal.objective;
|
|
1030
|
-
archiveCurrentGoal(liveCtx, "complete", `auditor ${result.model} approved (
|
|
1031
|
-
liveCtx.ui.notify(`Goal complete — auditor ${result.model} approved on the quota retry.`, "info");
|
|
1032
|
-
notifyExternal(liveCtx, `Goal complete (auditor approved
|
|
1038
|
+
archiveCurrentGoal(liveCtx, "complete", `auditor ${result.model} approved (${origin})`);
|
|
1039
|
+
liveCtx.ui.notify(`Goal complete — auditor ${result.model} approved${origin === "manual" ? " on /goal audit" : " on the quota retry"}.`, "info");
|
|
1040
|
+
notifyExternal(liveCtx, `Goal complete (auditor approved, ${origin}): ${objective.slice(0, 120)}`);
|
|
1033
1041
|
return;
|
|
1034
1042
|
}
|
|
1035
1043
|
|
|
@@ -1051,7 +1059,7 @@ async function retryStoredCompletionAudit(ctx: ExtensionContext): Promise<void>
|
|
|
1051
1059
|
liveCtx.ui.notify(`Auditor still quota-limited — next auto-retry in ${retryMin}m (your completion claim is stored; no action needed).`, "warning");
|
|
1052
1060
|
scheduleQuotaRetry(liveCtx, quota.retryAfterSec, result.error, () => {
|
|
1053
1061
|
if (state.goal && state.goal.status === "paused" && (state.goal.pauseReason ?? "").startsWith("auditor quota:") && state.goal.pendingCompletion) {
|
|
1054
|
-
void retryStoredCompletionAudit(liveCtx);
|
|
1062
|
+
void retryStoredCompletionAudit(liveCtx, origin);
|
|
1055
1063
|
}
|
|
1056
1064
|
});
|
|
1057
1065
|
return;
|
|
@@ -1072,10 +1080,10 @@ async function retryStoredCompletionAudit(ctx: ExtensionContext): Promise<void>
|
|
|
1072
1080
|
}, liveCtx);
|
|
1073
1081
|
liveCtx.ui.notify(
|
|
1074
1082
|
result.disapproved
|
|
1075
|
-
? `Auditor (
|
|
1083
|
+
? `Auditor (${origin}) DISAPPROVED — resuming; the report is in /goal status.`
|
|
1076
1084
|
: result.impossible
|
|
1077
|
-
? `Auditor (
|
|
1078
|
-
: `Auditor (
|
|
1085
|
+
? `Auditor (${origin}): goal IMPOSSIBLE — ${(result.impossibleReason ?? "").slice(0, 100)}. Resuming; consider /goal tweak.`
|
|
1086
|
+
: `Auditor (${origin}) hit an infrastructure error — resuming; re-call complete_goal when ready.`,
|
|
1079
1087
|
"warning",
|
|
1080
1088
|
);
|
|
1081
1089
|
appendLedger(liveCtx.cwd, "quota_retry_audit_verdict", {
|
|
@@ -1309,6 +1317,30 @@ async function cmdGoal(args: string, ctx: ExtensionContext): Promise<void> {
|
|
|
1309
1317
|
if (!shown) ctx.ui.notify("No pending decision — the goal isn't paused on a choice (or no UI).", "info");
|
|
1310
1318
|
return;
|
|
1311
1319
|
}
|
|
1320
|
+
// v0.28.27: /goal audit — run the isolated auditor on the current goal
|
|
1321
|
+
// RIGHT NOW, without engaging the agent. The user's "the work looks
|
|
1322
|
+
// done — just verify it" handle (and the manual counterpart of the
|
|
1323
|
+
// v0.28.26 stored-claim quota retry). Seeds a synthesized claim so a
|
|
1324
|
+
// quota block falls into the same pendingCompletion retry machinery.
|
|
1325
|
+
if (route.name === "audit") {
|
|
1326
|
+
if (!state.goal) {
|
|
1327
|
+
ctx.ui.notify("No active goal — /goal audit needs a goal to verify.", "warning");
|
|
1328
|
+
return;
|
|
1329
|
+
}
|
|
1330
|
+
if (completionAuditInFlight) {
|
|
1331
|
+
ctx.ui.notify("An audit is already running…", "info");
|
|
1332
|
+
return;
|
|
1333
|
+
}
|
|
1334
|
+
updateGoal({
|
|
1335
|
+
pendingCompletion: {
|
|
1336
|
+
completionSummary: "Manual audit requested by the user via /goal audit (no agent completion claim). Verify the objective against the repo directly.",
|
|
1337
|
+
at: nowIso(),
|
|
1338
|
+
},
|
|
1339
|
+
}, ctx);
|
|
1340
|
+
appendLedger(ctx.cwd, "manual_audit_requested", { goalId: state.goal.id });
|
|
1341
|
+
void retryStoredCompletionAudit(ctx, "manual");
|
|
1342
|
+
return;
|
|
1343
|
+
}
|
|
1312
1344
|
if (route.name === "tweak") return cmdTweak(route.rest, ctx);
|
|
1313
1345
|
if (route.name === "archive") return cmdGoals(ctx);
|
|
1314
1346
|
// v0.16.0: /goal start <objective> — explicit skip-draft. Activates
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-goal-list-loop-audit",
|
|
3
|
-
"version": "0.28.
|
|
3
|
+
"version": "0.28.27",
|
|
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",
|