@brainervirus/workit-codex 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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "workit",
3
- "version": "8.31.0",
3
+ "version": "8.31.1",
4
4
  "description": "Adaptive engineering workflow rails for Codex",
5
5
  "author": {
6
6
  "name": "BrainerVirus"
@@ -20240,6 +20240,18 @@ function diffHash(cwd, base, head) {
20240
20240
  }
20241
20241
  return `sha256:${hash.digest("hex")}`;
20242
20242
  }
20243
+ function cleanRebase(cwd, range) {
20244
+ if (!Object.values(range).every(safeRef2))
20245
+ return false;
20246
+ const fromFork = git4(cwd, ["merge-base", range.fromBase, range.from]);
20247
+ const toFork = git4(cwd, ["merge-base", range.toBase, range.to]);
20248
+ if (!fromFork || !toFork || fromFork === toFork)
20249
+ return false;
20250
+ const merged = gitRun2(cwd, ["merge-tree", "--write-tree", "--no-messages", `--merge-base=${fromFork}`, toFork, range.from], GIT_TIMEOUTS.worktree);
20251
+ const tree = merged.ok ? merged.stdout.split(`
20252
+ `)[0]?.trim() : null;
20253
+ return Boolean(tree) && tree === git4(cwd, ["rev-parse", "--verify", "-q", `${range.to}^{tree}`]);
20254
+ }
20243
20255
  function storeRoot(cwd) {
20244
20256
  const location = resolveStore(path15.resolve(cwd));
20245
20257
  if (location instanceof Error)
@@ -20900,23 +20912,24 @@ function checkVerdicts(cwd, branch, ledgerRows) {
20900
20912
  return drift;
20901
20913
  };
20902
20914
  const exactCache = new Map;
20903
- const exactCarry = (row) => {
20904
- if (FAILING.has(String(row.result)))
20905
- return true;
20915
+ const exactMatch = (row) => {
20906
20916
  let exact = exactCache.get(row);
20907
20917
  if (exact === undefined) {
20908
20918
  const toBase = row.base ?? fallbackBase;
20909
20919
  const toBaseSha = toBase ? resolveCommit(cwd, toBase) : null;
20910
20920
  const fromBase = row.baseSha ?? toBaseSha;
20911
- exact = Boolean(row.head && head && toBaseSha && fromBase && sameOwnChange(cwd, { from: row.head, to: head, fromBase, toBase: toBaseSha }));
20921
+ const range = row.head && head && toBaseSha && fromBase ? { from: row.head, to: head, fromBase, toBase: toBaseSha } : null;
20922
+ exact = !range ? null : sameOwnChange(cwd, range) ? "same" : cleanRebase(cwd, range) ? "rebase" : null;
20912
20923
  exactCache.set(row, exact);
20913
20924
  }
20914
20925
  return exact;
20915
20926
  };
20927
+ const exactCarry = (row) => FAILING.has(String(row.result)) || exactMatch(row) !== null;
20916
20928
  const keyBasis = (row) => {
20917
20929
  const basis = verdictBasis(row, { head, ...keyFor(row.base ?? fallbackBase) });
20918
20930
  return basis === "carried" && !exactCarry(row) ? "stale" : basis;
20919
20931
  };
20932
+ 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;
20920
20933
  const restacked = (row) => restackCarries(FAILING.has(String(row.result)) ? null : cwd, rows, branch, row.head, head);
20921
20934
  const carryOf = (row) => {
20922
20935
  if (keyBasis(row) !== "stale")
@@ -20994,7 +21007,7 @@ function checkVerdicts(cwd, branch, ledgerRows) {
20994
21007
  independent: independence.length === 0,
20995
21008
  accepted: reasons.length === 0,
20996
21009
  reasons,
20997
- carry: basis === "carried" ? carryOf(row) : null,
21010
+ carry: basis === "carried" ? rebaseNote(row) ?? carryOf(row) : null,
20998
21011
  verdict: row
20999
21012
  });
21000
21013
  if (reasons.length === 0) {
@@ -13049,6 +13049,18 @@ function diffHash(cwd, base, head) {
13049
13049
  }
13050
13050
  return `sha256:${hash.digest("hex")}`;
13051
13051
  }
13052
+ function cleanRebase(cwd, range) {
13053
+ if (!Object.values(range).every(safeRef2))
13054
+ return false;
13055
+ const fromFork = git3(cwd, ["merge-base", range.fromBase, range.from]);
13056
+ const toFork = git3(cwd, ["merge-base", range.toBase, range.to]);
13057
+ if (!fromFork || !toFork || fromFork === toFork)
13058
+ return false;
13059
+ const merged = gitRun2(cwd, ["merge-tree", "--write-tree", "--no-messages", `--merge-base=${fromFork}`, toFork, range.from], GIT_TIMEOUTS.worktree);
13060
+ const tree = merged.ok ? merged.stdout.split(`
13061
+ `)[0]?.trim() : null;
13062
+ return Boolean(tree) && tree === git3(cwd, ["rev-parse", "--verify", "-q", `${range.to}^{tree}`]);
13063
+ }
13052
13064
  function storeRoot(cwd) {
13053
13065
  const location = resolveStore(path14.resolve(cwd));
13054
13066
  if (location instanceof Error)
@@ -13712,23 +13724,24 @@ function checkVerdicts(cwd, branch, ledgerRows) {
13712
13724
  return drift;
13713
13725
  };
13714
13726
  const exactCache = new Map;
13715
- const exactCarry = (row) => {
13716
- if (FAILING.has(String(row.result)))
13717
- return true;
13727
+ const exactMatch = (row) => {
13718
13728
  let exact = exactCache.get(row);
13719
13729
  if (exact === undefined) {
13720
13730
  const toBase = row.base ?? fallbackBase;
13721
13731
  const toBaseSha = toBase ? resolveCommit(cwd, toBase) : null;
13722
13732
  const fromBase = row.baseSha ?? toBaseSha;
13723
- exact = Boolean(row.head && head && toBaseSha && fromBase && sameOwnChange(cwd, { from: row.head, to: head, fromBase, toBase: toBaseSha }));
13733
+ const range = row.head && head && toBaseSha && fromBase ? { from: row.head, to: head, fromBase, toBase: toBaseSha } : null;
13734
+ exact = !range ? null : sameOwnChange(cwd, range) ? "same" : cleanRebase(cwd, range) ? "rebase" : null;
13724
13735
  exactCache.set(row, exact);
13725
13736
  }
13726
13737
  return exact;
13727
13738
  };
13739
+ const exactCarry = (row) => FAILING.has(String(row.result)) || exactMatch(row) !== null;
13728
13740
  const keyBasis = (row) => {
13729
13741
  const basis = verdictBasis(row, { head, ...keyFor(row.base ?? fallbackBase) });
13730
13742
  return basis === "carried" && !exactCarry(row) ? "stale" : basis;
13731
13743
  };
13744
+ 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;
13732
13745
  const restacked = (row) => restackCarries(FAILING.has(String(row.result)) ? null : cwd, rows, branch, row.head, head);
13733
13746
  const carryOf = (row) => {
13734
13747
  if (keyBasis(row) !== "stale")
@@ -13806,7 +13819,7 @@ function checkVerdicts(cwd, branch, ledgerRows) {
13806
13819
  independent: independence.length === 0,
13807
13820
  accepted: reasons.length === 0,
13808
13821
  reasons,
13809
- carry: basis === "carried" ? carryOf(row) : null,
13822
+ carry: basis === "carried" ? rebaseNote(row) ?? carryOf(row) : null,
13810
13823
  verdict: row
13811
13824
  });
13812
13825
  if (reasons.length === 0) {
@@ -79,6 +79,6 @@ if (quiet)
79
79
  process.stdout.write(`${JSON.stringify({ hookSpecificOutput: { hookEventName: quiet } })}
80
80
  `);
81
81
  else {
82
- const { runCodexHook } = await import("./workit-hook-he62a8pe.js");
82
+ const { runCodexHook } = await import("./workit-hook-9tnjrhr5.js");
83
83
  await runCodexHook([payload]);
84
84
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainervirus/workit-codex",
3
- "version": "8.31.0",
3
+ "version": "8.31.1",
4
4
  "private": false,
5
5
  "description": "Workit Codex CLI/desktop plugin — shared MCP transport, hooks, method skills, and verifier/reviewer/implementer agents",
6
6
  "keywords": [
@@ -39,8 +39,8 @@
39
39
  "build": "bun scripts/build.ts"
40
40
  },
41
41
  "devDependencies": {
42
- "@brainervirus/workit-core": "^8.31.0",
43
- "@brainervirus/workit-mcp": "^8.31.0"
42
+ "@brainervirus/workit-core": "^8.31.1",
43
+ "@brainervirus/workit-mcp": "^8.31.1"
44
44
  },
45
45
  "engines": {
46
46
  "node": ">=24"