pi-goal-list-loop-audit 0.26.2 → 0.26.4

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.
@@ -595,8 +595,12 @@ function fireReviewer(
595
595
  } catch {
596
596
  /* archive md may not exist for manual review of a live goal */
597
597
  }
598
+ // v0.26.4 source curation: an APPROVED audit report is the executor's
599
+ // own completion claims — meta-text with zero finding signal (the
600
+ // 0.26.2/0.26.3 misfires both mined it). Disapprovals/errors carry the
601
+ // independent auditor's required-fixes — the real findings.
598
602
  const auditTexts = readAuditLog(ctx.cwd)
599
- .filter((e) => e.goalId === source.goalId)
603
+ .filter((e) => e.goalId === source.goalId && (e.verdict === "disapproved" || e.verdict === "error"))
600
604
  .map((e) => e.report);
601
605
  for (const t of auditTexts) sources.push({ name: "audit", text: t });
602
606
  let ledgerEntries: Array<{ type: string; at?: string; value?: any }> = [];
@@ -65,28 +65,51 @@ export interface Finding {
65
65
  /** Leverage classification (contract item 5). Order matters: strategic
66
66
  * and architectural win over bug/refactor — "should we rewrite this
67
67
  * broken schema" is a decision, not a fix. */
68
+ // v0.26.3: the bare words "architectural"/"strategic" are REMOVED — they
69
+ // self-matched the reviewer's own vocabulary ("architectural-class",
70
+ // "architectural findings", the docs' mode matrix) and produced 3 junk
71
+ // findings on the 0.26.2 completion, observed live.
68
72
  const CLASS_PATTERNS: Array<{ class: FindingClass; re: RegExp }> = [
69
- { class: "strategic", re: /\bshould we\b|\bdeprecat|ship this\??|strategic/i },
70
- { class: "architectural", re: /\brewrite\b|new dependency|schema change|architectural|redesign/i },
73
+ { class: "strategic", re: /\bshould we\b|\bdeprecat|ship this\??/i },
74
+ { class: "architectural", re: /\brewrite\b|new dependency|schema change|\bredesign\b/i },
71
75
  { class: "bug", re: /\bTODO\b|\bFIXME\b|\bbug\b|\bissue\b|regression|broken|\bfixme\b/i },
72
76
  { class: "refactor", re: /could be cleaner|consider refactoring|duplicat|refactor|left ?out|follow[\s-]?up|deferred|could be improved|improvement|enhancement|consider adding|would be nice|nice to have/i },
73
77
  ];
74
78
 
79
+ /** v0.26.3: lines that never carry findings — code, markdown tables, and
80
+ * the reviewer's own report/config vocabulary. Observed false positives
81
+ * from the 0.26.2 completion: a test("…architectural…") name, the
82
+ * INSTALL.md mode-matrix row, and ship-doc prose. */
83
+ const SKIP_LINE = /^\s*(test|it|describe|assert|expect)\s*\(|^\s*(const|let|var|function|import|export|require)\b|\{\s*\.\.\.\s*\}|,\s*\.\.\.$|^\s*\||^\s*[{\[\]}]|^\s*['"]/;
84
+ const REVIEWER_VOCAB = /architectural-class|bug-class|refactor-class|strategic-class|reviewer found|cascade step|\*\*Mode\*\*|problems\s*\/\s*\(?(improvements|architectural)/i;
85
+
75
86
  export function classifyFindingText(line: string): FindingClass | undefined {
76
87
  const t = line.trim();
77
88
  if (t.length < 8) return undefined;
89
+ if (SKIP_LINE.test(t) || REVIEWER_VOCAB.test(t)) return undefined;
78
90
  for (const { class: cls, re } of CLASS_PATTERNS) {
79
91
  if (re.test(t)) return cls;
80
92
  }
81
93
  return undefined;
82
94
  }
83
95
 
84
- /** Scan source texts line-by-line for finding-shaped content. */
96
+ /** v0.26.4: remove fenced code blocks and inline code spans. Quoted
97
+ * code is how completion summaries leak vocabulary into extraction —
98
+ * the 0.26.3 misfire matched a backticked reviewer.ts line containing
99
+ * four architectural patterns. */
100
+ export function stripCodeSpans(text: string): string {
101
+ return text
102
+ .replace(/```[\s\S]*?```/g, " ")
103
+ .replace(/`[^`\n]*`/g, " ");
104
+ }
105
+
106
+ /** Scan source texts line-by-line for finding-shaped content. Code
107
+ * spans are stripped first (v0.26.4) — findings live in prose. */
85
108
  export function extractFindings(sources: Array<{ name: string; text: string }>, max: number): Finding[] {
86
109
  const out: Finding[] = [];
87
110
  const seen = new Set<string>();
88
111
  for (const { name, text } of sources) {
89
- for (const line of text.split("\n")) {
112
+ for (const line of stripCodeSpans(text).split("\n")) {
90
113
  const cls = classifyFindingText(line);
91
114
  if (!cls) continue;
92
115
  const clean = line.trim().replace(/^[-*>\s\[\]x]+/, "").slice(0, 200);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-goal-list-loop-audit",
3
- "version": "0.26.2",
3
+ "version": "0.26.4",
4
4
  "description": "Goal. Loop. Audit. Done. — 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 — only the read tools needed to verify your goal.",
5
5
  "license": "MIT",
6
6
  "author": "dracon",