@brainervirus/workit-pi 8.31.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.
Files changed (2) hide show
  1. package/dist/workit.js +18 -5
  2. package/package.json +1 -1
package/dist/workit.js CHANGED
@@ -14144,6 +14144,18 @@ function diffHash(cwd, base, head) {
14144
14144
  }
14145
14145
  return `sha256:${hash.digest("hex")}`;
14146
14146
  }
14147
+ function cleanRebase(cwd, range) {
14148
+ if (!Object.values(range).every(safeRef2))
14149
+ return false;
14150
+ const fromFork = git4(cwd, ["merge-base", range.fromBase, range.from]);
14151
+ const toFork = git4(cwd, ["merge-base", range.toBase, range.to]);
14152
+ if (!fromFork || !toFork || fromFork === toFork)
14153
+ return false;
14154
+ const merged = gitRun2(cwd, ["merge-tree", "--write-tree", "--no-messages", `--merge-base=${fromFork}`, toFork, range.from], GIT_TIMEOUTS.worktree);
14155
+ const tree = merged.ok ? merged.stdout.split(`
14156
+ `)[0]?.trim() : null;
14157
+ return Boolean(tree) && tree === git4(cwd, ["rev-parse", "--verify", "-q", `${range.to}^{tree}`]);
14158
+ }
14147
14159
  function storeRoot(cwd) {
14148
14160
  const location = resolveStore(path16.resolve(cwd));
14149
14161
  if (location instanceof Error)
@@ -14807,23 +14819,24 @@ function checkVerdicts(cwd, branch, ledgerRows) {
14807
14819
  return drift;
14808
14820
  };
14809
14821
  const exactCache = new Map;
14810
- const exactCarry = (row) => {
14811
- if (FAILING.has(String(row.result)))
14812
- return true;
14822
+ const exactMatch = (row) => {
14813
14823
  let exact = exactCache.get(row);
14814
14824
  if (exact === undefined) {
14815
14825
  const toBase = row.base ?? fallbackBase;
14816
14826
  const toBaseSha = toBase ? resolveCommit(cwd, toBase) : null;
14817
14827
  const fromBase = row.baseSha ?? toBaseSha;
14818
- exact = Boolean(row.head && head && toBaseSha && fromBase && sameOwnChange(cwd, { from: row.head, to: head, fromBase, toBase: toBaseSha }));
14828
+ const range = row.head && head && toBaseSha && fromBase ? { from: row.head, to: head, fromBase, toBase: toBaseSha } : null;
14829
+ exact = !range ? null : sameOwnChange(cwd, range) ? "same" : cleanRebase(cwd, range) ? "rebase" : null;
14819
14830
  exactCache.set(row, exact);
14820
14831
  }
14821
14832
  return exact;
14822
14833
  };
14834
+ const exactCarry = (row) => FAILING.has(String(row.result)) || exactMatch(row) !== null;
14823
14835
  const keyBasis = (row) => {
14824
14836
  const basis = verdictBasis(row, { head, ...keyFor(row.base ?? fallbackBase) });
14825
14837
  return basis === "carried" && !exactCarry(row) ? "stale" : basis;
14826
14838
  };
14839
+ 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;
14827
14840
  const restacked = (row) => restackCarries(FAILING.has(String(row.result)) ? null : cwd, rows, branch, row.head, head);
14828
14841
  const carryOf = (row) => {
14829
14842
  if (keyBasis(row) !== "stale")
@@ -14901,7 +14914,7 @@ function checkVerdicts(cwd, branch, ledgerRows) {
14901
14914
  independent: independence.length === 0,
14902
14915
  accepted: reasons.length === 0,
14903
14916
  reasons,
14904
- carry: basis === "carried" ? carryOf(row) : null,
14917
+ carry: basis === "carried" ? rebaseNote(row) ?? carryOf(row) : null,
14905
14918
  verdict: row
14906
14919
  });
14907
14920
  if (reasons.length === 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainervirus/workit-pi",
3
- "version": "8.31.0",
3
+ "version": "8.31.1",
4
4
  "description": "Workit native extension for Pi — tools, method skills, and session continuity",
5
5
  "keywords": [
6
6
  "agentic-coding",