@jwilger/pi-development-system 0.24.0 → 0.26.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jwilger/pi-development-system",
3
- "version": "0.24.0",
3
+ "version": "0.26.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"
@@ -6,5 +6,5 @@ Review the work in progress with the code-review skill.
6
6
 
7
7
  1. Call `devsys_review_start` (slice and diff range: $ARGUMENTS; omit either to use the active slice and `HEAD`).
8
8
  2. Run the `agent_spawn` payload it returns, unchanged.
9
- 3. Pass the reviewer's packet verbatim to `devsys_review_record`.
9
+ 3. Pass the reviewer's packet verbatim to `devsys_review_record` with the same `diffDigest` and `diffRange` the start reply gave.
10
10
  4. Report `review: N/R clean` and the next action. If the next action is `fix-findings`, list each blocking and should-fix finding with its `path:line`.
@@ -17,7 +17,8 @@ Review is a soft gate (`review.unsatisfied`): skipping it needs a recorded depar
17
17
  2. Run that `agent_spawn` unchanged. The reviewer is a top-level agent, not a
18
18
  child of this conversation, so it does not inherit your context.
19
19
  3. Pass the reviewer's packet, verbatim, to `devsys_review_record` with the
20
- `diffDigest` the start reply gave (`packets: [...]`; all lens packets of one
20
+ `diffDigest` the start reply gave, and the same `diffRange` if you gave one
21
+ (`packets: [...]`; all lens packets of one
21
22
  round in one call). A packet is recorded once, in the round its header names;
22
23
  if the diff changed since the start, the round is refused: start again.
23
24
  4. Read the reply: `review: N/R clean` and `next:`.
@@ -59,7 +60,7 @@ commit keeps the clean rounds already earned unless findings come back.
59
60
  ## Rules of thumb
60
61
 
61
62
  - Fix the findings before the next round. Do not argue a finding away; if it is
62
- wrong, the reviewer or Jev marks it a false positive with evidence.
63
+ wrong, the reviewer marks it a false positive with evidence (Jev can only suggest).
63
64
  - Do not widen a review into an audit of the tree. The reviewer reads the diff and
64
65
  what it depends on.
65
66
  - Never edit the packet to make it pass.
@@ -14,7 +14,9 @@ const ciLabel = (state: DevsysState): string | undefined => {
14
14
  };
15
15
 
16
16
  const activeReview = (state: DevsysState): string | undefined => {
17
- const review = state.activeSlice === undefined ? undefined : reviewOf(state, state.activeSlice);
17
+ // Without an active slice (before /devsys-start exists) show the most recent review instead of nothing.
18
+ const review =
19
+ state.activeSlice === undefined ? state.reviews?.at(-1) : reviewOf(state, state.activeSlice);
18
20
  return review === undefined ? undefined : reviewLabel(review);
19
21
  };
20
22
 
@@ -33,7 +33,20 @@ export async function snapshotDiff(
33
33
  try {
34
34
  // Plain, parseable output whatever the user's git config says: an external diff driver or
35
35
  // forced colour removes the `diff --git` headers the per-file digests are cut from.
36
- const plain = ["-c", "core.quotePath=false", "diff", "--no-ext-diff", "--no-color"];
36
+ const plain = [
37
+ "-c",
38
+ "core.quotePath=false",
39
+ "diff",
40
+ "--no-ext-diff",
41
+ "--no-color",
42
+ // diff.mnemonicPrefix / diff.noprefix change the `a/` `b/` header prefixes the file keys are cut from.
43
+ "--src-prefix=a/",
44
+ "--dst-prefix=b/",
45
+ // Every changed path gets a `diff --git` section: no submodule log summaries, no textconv that
46
+ // can hide an edit whose converted text is unchanged.
47
+ "--submodule=short",
48
+ "--no-textconv",
49
+ ];
37
50
  const [diff, stat, others] = await Promise.all([
38
51
  exec("git", [...plain, "--full-index", "--no-renames", range], { cwd, timeout: 15_000 }),
39
52
  exec("git", [...plain, "--stat", range], { cwd, timeout: 15_000 }),
@@ -127,6 +127,14 @@ export function createReviewStartTool(
127
127
  );
128
128
  }
129
129
 
130
+ if (action === "fix-findings") {
131
+ return reply(
132
+ `${reviewLabel(review)}. Round ${review.rounds.length} of ${slice} has blocking or should-fix findings and the diff has not changed since: fix them first, then start again. ` +
133
+ "Re-running the review on unchanged code does not clear a finding. If a finding is wrong, record a `review.unsatisfied` departure with the evidence (devsys_record_departure).",
134
+ true,
135
+ );
136
+ }
137
+
130
138
  const round = review.rounds.length + 1;
131
139
  const resolved = resolveSlot(
132
140
  config.value.models,
@@ -146,7 +154,7 @@ export function createReviewStartTool(
146
154
  [
147
155
  `${reviewLabel(review)}; round ${round}; diff ${snap.value.digest}. ${basis}`,
148
156
  `lenses: ${lenses.join(", ")}`,
149
- `Spawn the reviewer with agent_spawn using exactly this payload, then pass its packet to devsys_review_record with diffDigest "${snap.value.digest}":`,
157
+ `Spawn the reviewer with agent_spawn using exactly this payload, then pass its packet to devsys_review_record with diffDigest "${snap.value.digest}"${range === "HEAD" ? "" : ` and diffRange "${range}"`}:`,
150
158
  JSON.stringify(spawn),
151
159
  ].join("\n"),
152
160
  );