pi-supernova 0.3.0 → 0.3.1

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/docs/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.1] - 2026-09-06
4
+
5
+ ### Fixed
6
+
7
+ - Preserve post-edit coordinates for patch deletions, including zero-length new ranges. After an earlier hunk inserts lines, the edit result now opens the actual deletion region rather than an unrelated earlier source window. File mutation semantics are unchanged.
8
+
9
+ ### Tests
10
+
11
+ - Add a focused shifted-deletion regression and an opt-in stress runner that can target an isolated npm installation. Cover concurrent programs, 129-read batches, contended writes, cancellation after confirmed staging, immutable progress frames, source fidelity and cold lookup across 5,000 files.
12
+
3
13
  ## [0.3.0] - 2026-09-05
4
14
 
5
15
  ### Source operations
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-supernova",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "One CodeMode invocation for Pi and OMP, with four guest commands, automatic read batching and source context.",
5
5
  "type": "module",
6
6
  "author": "AdityaVG13",
package/src/fs/diff.js CHANGED
@@ -74,10 +74,11 @@ export function buildPatchDiff(filePath, patchText) {
74
74
  let inHunk = false;
75
75
 
76
76
  for (const patchLine of patchLines) {
77
- const headerMatch = (/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)/).exec(patchLine);
77
+ const headerMatch = (/^@@\s+-(\d+)(?:,(\d+))?\s+\+(\d+)(?:,(\d+))?/).exec(patchLine);
78
78
  if (headerMatch) {
79
- oldLineNum = Number(headerMatch[1]);
80
- newLineNum = Number(headerMatch[2]);
79
+ // A zero-length range names the line before the insertion/deletion point.
80
+ oldLineNum = Number(headerMatch[1]) + Number(headerMatch[2] === "0");
81
+ newLineNum = Number(headerMatch[3]) + Number(headerMatch[4] === "0");
81
82
  inHunk = true;
82
83
  continue;
83
84
  }
@@ -86,7 +87,7 @@ export function buildPatchDiff(filePath, patchText) {
86
87
  if (!kind) continue;
87
88
  if (kind === "remove") {
88
89
  removed += 1;
89
- lines.push({ type: "remove", lineNum: oldLineNum, text: patchLine.slice(1) });
90
+ lines.push({ type: "remove", lineNum: oldLineNum, newLineNum, text: patchLine.slice(1) });
90
91
  oldLineNum += 1;
91
92
  } else if (kind === "add") {
92
93
  added += 1;