@brainervirus/workit-cursor 8.30.0 → 8.31.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.
@@ -2,7 +2,7 @@
2
2
  "name": "workit",
3
3
  "displayName": "Workit",
4
4
  "description": "Adaptive Workit workflow with shared MCP tools and native Cursor hooks",
5
- "version": "8.30.0",
5
+ "version": "8.31.1",
6
6
  "author": {
7
7
  "name": "Cristhofer Pincetti"
8
8
  },
@@ -10166,6 +10166,18 @@ function diffHash(cwd, base, head) {
10166
10166
  }
10167
10167
  return `sha256:${hash.digest("hex")}`;
10168
10168
  }
10169
+ function cleanRebase(cwd, range) {
10170
+ if (!Object.values(range).every(safeRef2))
10171
+ return false;
10172
+ const fromFork = git3(cwd, ["merge-base", range.fromBase, range.from]);
10173
+ const toFork = git3(cwd, ["merge-base", range.toBase, range.to]);
10174
+ if (!fromFork || !toFork || fromFork === toFork)
10175
+ return false;
10176
+ const merged = gitRun2(cwd, ["merge-tree", "--write-tree", "--no-messages", `--merge-base=${fromFork}`, toFork, range.from], GIT_TIMEOUTS.worktree);
10177
+ const tree = merged.ok ? merged.stdout.split(`
10178
+ `)[0]?.trim() : null;
10179
+ return Boolean(tree) && tree === git3(cwd, ["rev-parse", "--verify", "-q", `${range.to}^{tree}`]);
10180
+ }
10169
10181
  function storeRoot(cwd) {
10170
10182
  const location = resolveStore(path10.resolve(cwd));
10171
10183
  if (location instanceof Error)
@@ -10624,23 +10636,24 @@ function checkVerdicts(cwd, branch, ledgerRows) {
10624
10636
  return drift;
10625
10637
  };
10626
10638
  const exactCache = new Map;
10627
- const exactCarry = (row) => {
10628
- if (FAILING.has(String(row.result)))
10629
- return true;
10639
+ const exactMatch = (row) => {
10630
10640
  let exact = exactCache.get(row);
10631
10641
  if (exact === undefined) {
10632
10642
  const toBase = row.base ?? fallbackBase;
10633
10643
  const toBaseSha = toBase ? resolveCommit(cwd, toBase) : null;
10634
10644
  const fromBase = row.baseSha ?? toBaseSha;
10635
- exact = Boolean(row.head && head && toBaseSha && fromBase && sameOwnChange(cwd, { from: row.head, to: head, fromBase, toBase: toBaseSha }));
10645
+ const range = row.head && head && toBaseSha && fromBase ? { from: row.head, to: head, fromBase, toBase: toBaseSha } : null;
10646
+ exact = !range ? null : sameOwnChange(cwd, range) ? "same" : cleanRebase(cwd, range) ? "rebase" : null;
10636
10647
  exactCache.set(row, exact);
10637
10648
  }
10638
10649
  return exact;
10639
10650
  };
10651
+ const exactCarry = (row) => FAILING.has(String(row.result)) || exactMatch(row) !== null;
10640
10652
  const keyBasis = (row) => {
10641
10653
  const basis = verdictBasis(row, { head, ...keyFor(row.base ?? fallbackBase) });
10642
10654
  return basis === "carried" && !exactCarry(row) ? "stale" : basis;
10643
10655
  };
10656
+ const rebaseNote = (row) => row.head && head && row.head !== head && !FAILING.has(String(row.result)) && keyBasis(row) === "carried" && exactMatch(row) === "rebase" ? { rule: "rebase", since: row.head, files: [] } : null;
10644
10657
  const restacked = (row) => restackCarries(FAILING.has(String(row.result)) ? null : cwd, rows, branch, row.head, head);
10645
10658
  const carryOf = (row) => {
10646
10659
  if (keyBasis(row) !== "stale")
@@ -10718,7 +10731,7 @@ function checkVerdicts(cwd, branch, ledgerRows) {
10718
10731
  independent: independence.length === 0,
10719
10732
  accepted: reasons.length === 0,
10720
10733
  reasons,
10721
- carry: basis === "carried" ? carryOf(row) : null,
10734
+ carry: basis === "carried" ? rebaseNote(row) ?? carryOf(row) : null,
10722
10735
  verdict: row
10723
10736
  });
10724
10737
  if (reasons.length === 0) {
@@ -22593,6 +22593,18 @@ function diffHash(cwd, base, head) {
22593
22593
  }
22594
22594
  return `sha256:${hash.digest("hex")}`;
22595
22595
  }
22596
+ function cleanRebase(cwd, range) {
22597
+ if (!Object.values(range).every(safeRef2))
22598
+ return false;
22599
+ const fromFork = git4(cwd, ["merge-base", range.fromBase, range.from]);
22600
+ const toFork = git4(cwd, ["merge-base", range.toBase, range.to]);
22601
+ if (!fromFork || !toFork || fromFork === toFork)
22602
+ return false;
22603
+ const merged = gitRun2(cwd, ["merge-tree", "--write-tree", "--no-messages", `--merge-base=${fromFork}`, toFork, range.from], GIT_TIMEOUTS.worktree);
22604
+ const tree = merged.ok ? merged.stdout.split(`
22605
+ `)[0]?.trim() : null;
22606
+ return Boolean(tree) && tree === git4(cwd, ["rev-parse", "--verify", "-q", `${range.to}^{tree}`]);
22607
+ }
22596
22608
  function storeRoot(cwd) {
22597
22609
  const location = resolveStore(path15.resolve(cwd));
22598
22610
  if (location instanceof Error)
@@ -23253,23 +23265,24 @@ function checkVerdicts(cwd, branch, ledgerRows) {
23253
23265
  return drift;
23254
23266
  };
23255
23267
  const exactCache = new Map;
23256
- const exactCarry = (row) => {
23257
- if (FAILING.has(String(row.result)))
23258
- return true;
23268
+ const exactMatch = (row) => {
23259
23269
  let exact = exactCache.get(row);
23260
23270
  if (exact === undefined) {
23261
23271
  const toBase = row.base ?? fallbackBase;
23262
23272
  const toBaseSha = toBase ? resolveCommit(cwd, toBase) : null;
23263
23273
  const fromBase = row.baseSha ?? toBaseSha;
23264
- exact = Boolean(row.head && head && toBaseSha && fromBase && sameOwnChange(cwd, { from: row.head, to: head, fromBase, toBase: toBaseSha }));
23274
+ const range = row.head && head && toBaseSha && fromBase ? { from: row.head, to: head, fromBase, toBase: toBaseSha } : null;
23275
+ exact = !range ? null : sameOwnChange(cwd, range) ? "same" : cleanRebase(cwd, range) ? "rebase" : null;
23265
23276
  exactCache.set(row, exact);
23266
23277
  }
23267
23278
  return exact;
23268
23279
  };
23280
+ const exactCarry = (row) => FAILING.has(String(row.result)) || exactMatch(row) !== null;
23269
23281
  const keyBasis = (row) => {
23270
23282
  const basis = verdictBasis(row, { head, ...keyFor(row.base ?? fallbackBase) });
23271
23283
  return basis === "carried" && !exactCarry(row) ? "stale" : basis;
23272
23284
  };
23285
+ const rebaseNote = (row) => row.head && head && row.head !== head && !FAILING.has(String(row.result)) && keyBasis(row) === "carried" && exactMatch(row) === "rebase" ? { rule: "rebase", since: row.head, files: [] } : null;
23273
23286
  const restacked = (row) => restackCarries(FAILING.has(String(row.result)) ? null : cwd, rows, branch, row.head, head);
23274
23287
  const carryOf = (row) => {
23275
23288
  if (keyBasis(row) !== "stale")
@@ -23347,7 +23360,7 @@ function checkVerdicts(cwd, branch, ledgerRows) {
23347
23360
  independent: independence.length === 0,
23348
23361
  accepted: reasons.length === 0,
23349
23362
  reasons,
23350
- carry: basis === "carried" ? carryOf(row) : null,
23363
+ carry: basis === "carried" ? rebaseNote(row) ?? carryOf(row) : null,
23351
23364
  verdict: row
23352
23365
  });
23353
23366
  if (reasons.length === 0) {
@@ -10175,6 +10175,18 @@ function diffHash(cwd, base, head) {
10175
10175
  }
10176
10176
  return `sha256:${hash.digest("hex")}`;
10177
10177
  }
10178
+ function cleanRebase(cwd, range) {
10179
+ if (!Object.values(range).every(safeRef2))
10180
+ return false;
10181
+ const fromFork = git3(cwd, ["merge-base", range.fromBase, range.from]);
10182
+ const toFork = git3(cwd, ["merge-base", range.toBase, range.to]);
10183
+ if (!fromFork || !toFork || fromFork === toFork)
10184
+ return false;
10185
+ const merged = gitRun2(cwd, ["merge-tree", "--write-tree", "--no-messages", `--merge-base=${fromFork}`, toFork, range.from], GIT_TIMEOUTS.worktree);
10186
+ const tree = merged.ok ? merged.stdout.split(`
10187
+ `)[0]?.trim() : null;
10188
+ return Boolean(tree) && tree === git3(cwd, ["rev-parse", "--verify", "-q", `${range.to}^{tree}`]);
10189
+ }
10178
10190
  function storeRoot(cwd) {
10179
10191
  const location = resolveStore(path10.resolve(cwd));
10180
10192
  if (location instanceof Error)
@@ -10838,23 +10850,24 @@ function checkVerdicts(cwd, branch, ledgerRows) {
10838
10850
  return drift;
10839
10851
  };
10840
10852
  const exactCache = new Map;
10841
- const exactCarry = (row) => {
10842
- if (FAILING.has(String(row.result)))
10843
- return true;
10853
+ const exactMatch = (row) => {
10844
10854
  let exact = exactCache.get(row);
10845
10855
  if (exact === undefined) {
10846
10856
  const toBase = row.base ?? fallbackBase;
10847
10857
  const toBaseSha = toBase ? resolveCommit(cwd, toBase) : null;
10848
10858
  const fromBase = row.baseSha ?? toBaseSha;
10849
- exact = Boolean(row.head && head && toBaseSha && fromBase && sameOwnChange(cwd, { from: row.head, to: head, fromBase, toBase: toBaseSha }));
10859
+ const range = row.head && head && toBaseSha && fromBase ? { from: row.head, to: head, fromBase, toBase: toBaseSha } : null;
10860
+ exact = !range ? null : sameOwnChange(cwd, range) ? "same" : cleanRebase(cwd, range) ? "rebase" : null;
10850
10861
  exactCache.set(row, exact);
10851
10862
  }
10852
10863
  return exact;
10853
10864
  };
10865
+ const exactCarry = (row) => FAILING.has(String(row.result)) || exactMatch(row) !== null;
10854
10866
  const keyBasis = (row) => {
10855
10867
  const basis = verdictBasis(row, { head, ...keyFor(row.base ?? fallbackBase) });
10856
10868
  return basis === "carried" && !exactCarry(row) ? "stale" : basis;
10857
10869
  };
10870
+ const rebaseNote = (row) => row.head && head && row.head !== head && !FAILING.has(String(row.result)) && keyBasis(row) === "carried" && exactMatch(row) === "rebase" ? { rule: "rebase", since: row.head, files: [] } : null;
10858
10871
  const restacked = (row) => restackCarries(FAILING.has(String(row.result)) ? null : cwd, rows, branch, row.head, head);
10859
10872
  const carryOf = (row) => {
10860
10873
  if (keyBasis(row) !== "stale")
@@ -10932,7 +10945,7 @@ function checkVerdicts(cwd, branch, ledgerRows) {
10932
10945
  independent: independence.length === 0,
10933
10946
  accepted: reasons.length === 0,
10934
10947
  reasons,
10935
- carry: basis === "carried" ? carryOf(row) : null,
10948
+ carry: basis === "carried" ? rebaseNote(row) ?? carryOf(row) : null,
10936
10949
  verdict: row
10937
10950
  });
10938
10951
  if (reasons.length === 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainervirus/workit-cursor",
3
- "version": "8.30.0",
3
+ "version": "8.31.1",
4
4
  "private": false,
5
5
  "description": "Workit Cursor plugin — shared MCP transport, native hooks, and sixteen method skills",
6
6
  "keywords": [
@@ -46,8 +46,8 @@
46
46
  "build": "bun scripts/build.ts"
47
47
  },
48
48
  "devDependencies": {
49
- "@brainervirus/workit-core": "^8.30.0",
50
- "@brainervirus/workit-mcp": "^8.30.0"
49
+ "@brainervirus/workit-core": "^8.31.1",
50
+ "@brainervirus/workit-mcp": "^8.31.1"
51
51
  },
52
52
  "engines": {
53
53
  "node": ">=24"