@brainervirus/workit-opencode 8.31.0 → 8.32.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.
Files changed (2) hide show
  1. package/dist/plugin.js +19 -5
  2. package/package.json +2 -2
package/dist/plugin.js CHANGED
@@ -8521,6 +8521,7 @@ var workspaceConfigSchema = object({
8521
8521
  verification: _enum(["proportional", "self", "independent"]).optional(),
8522
8522
  delegation: unknown().optional(),
8523
8523
  trailers: boolean2().optional(),
8524
+ deleteBranch: boolean2().optional(),
8524
8525
  liveSessionGuard: boolean2().optional(),
8525
8526
  fanout: object({ tierModels: unknown().optional() }).passthrough().optional(),
8526
8527
  models: object({ roles: unknown().optional() }).passthrough().optional(),
@@ -14149,6 +14150,18 @@ function diffHash(cwd, base, head) {
14149
14150
  }
14150
14151
  return `sha256:${hash.digest("hex")}`;
14151
14152
  }
14153
+ function cleanRebase(cwd, range) {
14154
+ if (!Object.values(range).every(safeRef2))
14155
+ return false;
14156
+ const fromFork = git4(cwd, ["merge-base", range.fromBase, range.from]);
14157
+ const toFork = git4(cwd, ["merge-base", range.toBase, range.to]);
14158
+ if (!fromFork || !toFork || fromFork === toFork)
14159
+ return false;
14160
+ const merged = gitRun2(cwd, ["merge-tree", "--write-tree", "--no-messages", `--merge-base=${fromFork}`, toFork, range.from], GIT_TIMEOUTS.worktree);
14161
+ const tree = merged.ok ? merged.stdout.split(`
14162
+ `)[0]?.trim() : null;
14163
+ return Boolean(tree) && tree === git4(cwd, ["rev-parse", "--verify", "-q", `${range.to}^{tree}`]);
14164
+ }
14152
14165
  function storeRoot(cwd) {
14153
14166
  const location = resolveStore(path16.resolve(cwd));
14154
14167
  if (location instanceof Error)
@@ -14812,23 +14825,24 @@ function checkVerdicts(cwd, branch, ledgerRows) {
14812
14825
  return drift;
14813
14826
  };
14814
14827
  const exactCache = new Map;
14815
- const exactCarry = (row) => {
14816
- if (FAILING.has(String(row.result)))
14817
- return true;
14828
+ const exactMatch = (row) => {
14818
14829
  let exact = exactCache.get(row);
14819
14830
  if (exact === undefined) {
14820
14831
  const toBase = row.base ?? fallbackBase;
14821
14832
  const toBaseSha = toBase ? resolveCommit(cwd, toBase) : null;
14822
14833
  const fromBase = row.baseSha ?? toBaseSha;
14823
- exact = Boolean(row.head && head && toBaseSha && fromBase && sameOwnChange(cwd, { from: row.head, to: head, fromBase, toBase: toBaseSha }));
14834
+ const range = row.head && head && toBaseSha && fromBase ? { from: row.head, to: head, fromBase, toBase: toBaseSha } : null;
14835
+ exact = !range ? null : sameOwnChange(cwd, range) ? "same" : cleanRebase(cwd, range) ? "rebase" : null;
14824
14836
  exactCache.set(row, exact);
14825
14837
  }
14826
14838
  return exact;
14827
14839
  };
14840
+ const exactCarry = (row) => FAILING.has(String(row.result)) || exactMatch(row) !== null;
14828
14841
  const keyBasis = (row) => {
14829
14842
  const basis = verdictBasis(row, { head, ...keyFor(row.base ?? fallbackBase) });
14830
14843
  return basis === "carried" && !exactCarry(row) ? "stale" : basis;
14831
14844
  };
14845
+ 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;
14832
14846
  const restacked = (row) => restackCarries(FAILING.has(String(row.result)) ? null : cwd, rows, branch, row.head, head);
14833
14847
  const carryOf = (row) => {
14834
14848
  if (keyBasis(row) !== "stale")
@@ -14906,7 +14920,7 @@ function checkVerdicts(cwd, branch, ledgerRows) {
14906
14920
  independent: independence.length === 0,
14907
14921
  accepted: reasons.length === 0,
14908
14922
  reasons,
14909
- carry: basis === "carried" ? carryOf(row) : null,
14923
+ carry: basis === "carried" ? rebaseNote(row) ?? carryOf(row) : null,
14910
14924
  verdict: row
14911
14925
  });
14912
14926
  if (reasons.length === 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainervirus/workit-opencode",
3
- "version": "8.31.0",
3
+ "version": "8.32.0",
4
4
  "private": false,
5
5
  "description": "Workit OpenCode plugin — native tools, adaptive policy, and sixteen method skills",
6
6
  "keywords": [
@@ -39,7 +39,7 @@
39
39
  "typecheck": "tsc --noEmit"
40
40
  },
41
41
  "devDependencies": {
42
- "@brainervirus/workit-core": "^8.31.0",
42
+ "@brainervirus/workit-core": "^8.32.0",
43
43
  "@opencode/plugin": "2.0.18"
44
44
  },
45
45
  "engines": {