@jwilger/pi-development-system 0.30.0 → 0.32.0

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 @@ You are a reviewer. You find defects you can demonstrate from the code and propo
31
31
 
32
32
  ## What counts
33
33
 
34
- Look for correctness bugs, regressions in existing behavior, security issues, and changed behavior with no test. Each finding needs a realistic triggering input or state. Before reporting, try to refute it: a covering test, a nearby guard, a type that rules the case out. Drop it if the refute holds; if it nearly holds, say what evidence is missing. Do not report untraced speculation or nits. Report style only if asked, labeled as style, after defects. Zero findings is a valid result.
34
+ Look for correctness bugs, regressions in existing behavior, security issues, and changed behavior with no test. Each finding needs a realistic triggering input or state. Before reporting, try to refute it: a covering test, a nearby guard, a type that rules the case out. Drop it if the refute holds; if it nearly holds, say what evidence is missing. Do not report untraced speculation or nits. Report style only if asked, labeled as style, after defects. The verdict is `blocking` when any finding is blocking or should-fix, otherwise `no-blocking`. Zero findings is a valid result: write `- none` under Findings.
35
35
 
36
36
  A fix is the smallest local change or deletion that removes the demonstrated defect. Do not propose new abstractions, frameworks, or broad refactors.
37
37
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jwilger/pi-development-system",
3
- "version": "0.30.0",
3
+ "version": "0.32.0",
4
4
  "description": "A pi extension package representing a seasoned approach to software development using a full AI SDLC.",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -177,6 +177,6 @@ export function reviewerTask(input: {
177
177
  "### Verdict",
178
178
  "no-blocking | blocking",
179
179
  "",
180
- "Severity: blocking = demonstrable defect or broken non-negotiable; should-fix = real defect or missing test with a realistic trigger; nit = style or report-only. Zero findings is a valid result.",
180
+ "Severity: blocking = demonstrable defect or broken non-negotiable; should-fix = real defect or missing test with a realistic trigger; nit = style or report-only. The verdict is `blocking` when any finding is blocking or should-fix, otherwise `no-blocking`. With zero findings (a valid result) write `- none` under Findings.",
181
181
  ].join("\n");
182
182
  }
@@ -15,7 +15,10 @@ const HEADER = new RegExp(
15
15
  `^##\\s+Review\\s+${SEP}\\s+(.+?)\\s+${SEP}\\s+round\\s+(\\S+)\\s+${SEP}\\s+lenses:\\s*(.*)$`,
16
16
  "m",
17
17
  );
18
- const FINDING = /^-\s*\[([^\]]+)\]\s+(\S+)\s+(?:`([^`]+)`\s+)?[—–-]\s+(.+)$/;
18
+ // Reviewers add text after the location (`fn`, a second location); the first backticked one is the finding's.
19
+ const FINDING = /^-\s*\[([^\]]+)\]\s+(\S+)\s+(?:`([^`]+)`[^—–]*?\s+)?[—–-]\s+(.+)$/;
20
+ // An indented line under a finding is its detail (trigger, fix), unless it is itself a finding.
21
+ const isDetail = (line: string): boolean => /^\s+/.test(line) && !/^\s*-\s*\[/.test(line);
19
22
 
20
23
  const section = (text: string, name: string): string | undefined => {
21
24
  const match = new RegExp(`^###\\s+${name}\\s*$`, "im").exec(text);
@@ -81,8 +84,9 @@ export function parseReviewPacket(text: string): ReviewPacket | ParseError {
81
84
  const findings: Finding[] = [];
82
85
  const lines = (section(text, "Findings") ?? "")
83
86
  .split("\n")
87
+ .filter((l) => !isDetail(l))
84
88
  .map((l) => l.trim())
85
- .filter((l) => l !== "" && !/^-?\s*none\.?$/i.test(l));
89
+ .filter((l) => l !== "" && !/^(?:-\s*)?[([]?(?:none|no findings?)[)\]]?\.?$/i.test(l));
86
90
  for (const [i, line] of lines.entries()) {
87
91
  const finding = parseFinding(line, lenses, i + 1);
88
92
  if (isParseError(finding)) return finding;
@@ -71,7 +71,11 @@ export const startReview = (slice: SliceRef, required: number): ReviewState => (
71
71
 
72
72
  export const addRound = (state: ReviewState, round: Omit<ReviewRound, "n">): ReviewState => ({
73
73
  ...state,
74
- rounds: [...state.rounds, { ...round, n: state.rounds.length + 1 }],
74
+ // Only the last round's per-file digests are ever compared, so earlier ones are not carried along.
75
+ rounds: [
76
+ ...state.rounds.map(({ files: _files, ...earlier }) => earlier),
77
+ { ...round, n: state.rounds.length + 1 },
78
+ ],
75
79
  });
76
80
 
77
81
  /** Review lenses Jev can select (plan I6.2). A lens applies at probability ≥ LENS_THRESHOLD. */
@@ -69,7 +69,7 @@ export async function snapshotDiff(
69
69
  const untracked = listed.filter((p) => !p.endsWith("/"));
70
70
  if (untracked.length > MAX_UNTRACKED) {
71
71
  return err(
72
- `${untracked.length} untracked files (more than ${MAX_UNTRACKED}); commit or ignore some so they can be reviewed`,
72
+ `${untracked.length} untracked files (more than ${MAX_UNTRACKED}); stage (git add) or ignore some so they can be reviewed`,
73
73
  );
74
74
  }
75
75
  const files: Record<string, string> = {};