pi-goal-list-loop-audit 0.31.7 → 0.31.8

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.
@@ -31,7 +31,7 @@ export interface Settings {
31
31
  * the first-order defense either way; diversity is the second-order one
32
32
  * the user may deliberately trade away. */
33
33
  auditorSameSessionSwap?: boolean;
34
- auditorThinkingLevel?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh";
34
+ auditorThinkingLevel?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
35
35
  /** Shell command run on goal complete / goal pause / loop stop; message passed as $1. */
36
36
  notifyCmd?: string;
37
37
  /** Per-goal token budget; crossing it pauses the goal. Off by default
@@ -1380,7 +1380,7 @@ async function retryStoredCompletionAudit(ctx: ExtensionContext, origin: "quota-
1380
1380
  completionSummary: claim.completionSummary,
1381
1381
  verificationSummary: claim.verificationSummary,
1382
1382
  model: auditorModel,
1383
- thinkingLevel: settings.auditorThinkingLevel ?? "high",
1383
+ thinkingLevel: (settings.auditorThinkingLevel ?? "high") as any, // may be "max" — pi ≥0.83 understands it; the dev-types predate it
1384
1384
  onProgress: (progress) => {
1385
1385
  latestAuditProgress = { currentTool: progress.currentTool, label: progress.label, elapsedMs: progress.elapsedMs, lastEventAt: Date.now() };
1386
1386
  refreshUI(liveCtx);
@@ -3188,7 +3188,7 @@ function registerAgentTools(pi: any, ctx: ExtensionContext): void {
3188
3188
  completionSummary: p.completionSummary,
3189
3189
  verificationSummary: p.verificationSummary,
3190
3190
  model: auditorModel,
3191
- thinkingLevel: settings.auditorThinkingLevel ?? "high",
3191
+ thinkingLevel: (settings.auditorThinkingLevel ?? "high") as any, // may be "max" — pi ≥0.83 understands it; the dev-types predate it
3192
3192
  signal: signal ?? undefined,
3193
3193
  onProgress: (progress) => {
3194
3194
  latestAuditProgress = {
@@ -4229,6 +4229,24 @@ function registerAgentTools(pi: any, ctx: ExtensionContext): void {
4229
4229
  * bought; it lasted one version). Every hop is LOUD (ledger + notify): the
4230
4230
  * v0.9.12 no-SILENT-substitution law.
4231
4231
  */
4232
+ /** v0.31.8: the auditor thinking options are derived from the PICKED
4233
+ * model, not a hardcoded list — same rule as pi's own thinking selector
4234
+ * (pi-ai getSupportedThinkingLevels): non-reasoning models expose only
4235
+ * "off"; xhigh/max exist only when the model maps them (thinkingLevelMap).
4236
+ * Replicated inline so the extension's older pi-ai dev-types don't matter —
4237
+ * the fields are read at runtime from the user's installed pi. */
4238
+ function auditorThinkingLevels(model: any): string[] {
4239
+ const ALL = ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
4240
+ if (!model?.reasoning) return ["off"];
4241
+ const map = model.thinkingLevelMap as Record<string, string | null> | undefined;
4242
+ return ALL.filter((level) => {
4243
+ const mapped = map?.[level];
4244
+ if (mapped === null) return false;
4245
+ if (level === "xhigh" || level === "max") return mapped !== undefined;
4246
+ return true;
4247
+ });
4248
+ }
4249
+
4232
4250
  function resolveAuditorModel(ctx: ExtensionContext, ref?: string, fallbackRef?: string, sameSessionSwap = true): { model: any; error?: string; via?: string } {
4233
4251
  const sessionModel = ctx.model as any;
4234
4252
  const tryRef = (trimmed: string): { model?: any; reason?: string } => {
@@ -4443,17 +4461,26 @@ export async function handleSettingChoice(id: string, ctx: ExtensionContext): Pr
4443
4461
  // v0.31.7: the select must be UNMISTAKABLY the auditor's — the user
4444
4462
  // Esc'd through it because it read like pi's own (general) thinking
4445
4463
  // dialog, and nothing was ever saved.
4464
+ // v0.31.8: the options come from the PICKED MODEL's info (user: "we
4465
+ // are not using the model information cause it has no max") — a model
4466
+ // that maps xhigh/max offers them; a non-reasoning model is told, not asked.
4467
+ let pickedModel: any = pick.kind === "session" ? (ctx.model as any) : undefined;
4468
+ if (pick.kind === "ref" && pick.ref) {
4469
+ const parts = pick.ref.split("/");
4470
+ try {
4471
+ pickedModel = parts.length === 2 ? (ctx.modelRegistry?.find?.(parts[0]!, parts[1]!) as any) : (ctx.modelRegistry?.getAvailable?.().filter((m: any) => m.id === pick.ref)[0] as any);
4472
+ } catch { pickedModel = undefined; } // levels fall back to the full ladder below
4473
+ }
4446
4474
  const curThinking = loadSettings(ctx.cwd).auditorThinkingLevel;
4475
+ const levels = auditorThinkingLevels(pickedModel);
4476
+ if (levels.length <= 1) {
4477
+ ctx.ui.notify(`Auditor model: ${pick.kind === "session" ? "session model (override cleared)" : pick.ref} — this model exposes no thinking levels (auditor runs with thinking off).`, "info");
4478
+ return;
4479
+ }
4480
+ const DESCR: Record<string, string> = { off: "no reasoning", minimal: "~1k tokens", low: "~2k tokens", medium: "~8k tokens", high: "the default; the gate must not ride the session's coding dial", xhigh: "~32k tokens", max: "maximum reasoning" };
4447
4481
  const t = await ctx.ui.select(
4448
4482
  "Auditor thinking — ISOLATED auditor session ONLY (your session model's thinking is untouched)",
4449
- [
4450
- `high — the default; the gate must not ride the session's coding dial${curThinking === undefined || curThinking === "high" ? " (current)" : ""}`,
4451
- `medium${curThinking === "medium" ? " (current)" : ""}`,
4452
- `low${curThinking === "low" ? " (current)" : ""}`,
4453
- `minimal${curThinking === "minimal" ? " (current)" : ""}`,
4454
- `xhigh${curThinking === "xhigh" ? " (current)" : ""}`,
4455
- `off${curThinking === "off" ? " (current)" : ""}`,
4456
- ],
4483
+ levels.map((lv) => `${lv} — ${DESCR[lv] ?? ""}${lv === "high" && curThinking === undefined ? " (current)" : curThinking === lv ? " (current)" : ""}`),
4457
4484
  );
4458
4485
  if (t) saveSettings("global", ctx.cwd, { auditorThinkingLevel: t.split(" ")[0] as Settings["auditorThinkingLevel"] });
4459
4486
  ctx.ui.notify(`Auditor model: ${pick.kind === "session" ? "session model (override cleared)" : pick.ref}${t ? ` · thinking ${t.split(" ")[0]}` : ""}`, "info");
@@ -5370,7 +5397,7 @@ async function cmdSettings(args: string, ctx: ExtensionContext): Promise<void> {
5370
5397
  }
5371
5398
  }
5372
5399
  } else if (key === "thinking" || key === "auditorthinkinglevel") {
5373
- if (["off", "minimal", "low", "medium", "high", "xhigh"].includes(value)) {
5400
+ if (["off", "minimal", "low", "medium", "high", "xhigh", "max"].includes(value)) {
5374
5401
  patch.auditorThinkingLevel = value as Settings["auditorThinkingLevel"];
5375
5402
  changed = true;
5376
5403
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-goal-list-loop-audit",
3
- "version": "0.31.7",
3
+ "version": "0.31.8",
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",