@brainervirus/workit-pi 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.
- package/dist/worker.js +1 -0
- package/dist/workit.js +19 -5
- package/package.json +1 -1
package/dist/worker.js
CHANGED
|
@@ -6860,6 +6860,7 @@ var workspaceConfigSchema = object({
|
|
|
6860
6860
|
verification: _enum(["proportional", "self", "independent"]).optional(),
|
|
6861
6861
|
delegation: unknown().optional(),
|
|
6862
6862
|
trailers: boolean2().optional(),
|
|
6863
|
+
deleteBranch: boolean2().optional(),
|
|
6863
6864
|
liveSessionGuard: boolean2().optional(),
|
|
6864
6865
|
fanout: object({ tierModels: unknown().optional() }).passthrough().optional(),
|
|
6865
6866
|
models: object({ roles: unknown().optional() }).passthrough().optional(),
|
package/dist/workit.js
CHANGED
|
@@ -8493,6 +8493,7 @@ var workspaceConfigSchema = object({
|
|
|
8493
8493
|
verification: _enum(["proportional", "self", "independent"]).optional(),
|
|
8494
8494
|
delegation: unknown().optional(),
|
|
8495
8495
|
trailers: boolean2().optional(),
|
|
8496
|
+
deleteBranch: boolean2().optional(),
|
|
8496
8497
|
liveSessionGuard: boolean2().optional(),
|
|
8497
8498
|
fanout: object({ tierModels: unknown().optional() }).passthrough().optional(),
|
|
8498
8499
|
models: object({ roles: unknown().optional() }).passthrough().optional(),
|
|
@@ -14144,6 +14145,18 @@ function diffHash(cwd, base, head) {
|
|
|
14144
14145
|
}
|
|
14145
14146
|
return `sha256:${hash.digest("hex")}`;
|
|
14146
14147
|
}
|
|
14148
|
+
function cleanRebase(cwd, range) {
|
|
14149
|
+
if (!Object.values(range).every(safeRef2))
|
|
14150
|
+
return false;
|
|
14151
|
+
const fromFork = git4(cwd, ["merge-base", range.fromBase, range.from]);
|
|
14152
|
+
const toFork = git4(cwd, ["merge-base", range.toBase, range.to]);
|
|
14153
|
+
if (!fromFork || !toFork || fromFork === toFork)
|
|
14154
|
+
return false;
|
|
14155
|
+
const merged = gitRun2(cwd, ["merge-tree", "--write-tree", "--no-messages", `--merge-base=${fromFork}`, toFork, range.from], GIT_TIMEOUTS.worktree);
|
|
14156
|
+
const tree = merged.ok ? merged.stdout.split(`
|
|
14157
|
+
`)[0]?.trim() : null;
|
|
14158
|
+
return Boolean(tree) && tree === git4(cwd, ["rev-parse", "--verify", "-q", `${range.to}^{tree}`]);
|
|
14159
|
+
}
|
|
14147
14160
|
function storeRoot(cwd) {
|
|
14148
14161
|
const location = resolveStore(path16.resolve(cwd));
|
|
14149
14162
|
if (location instanceof Error)
|
|
@@ -14807,23 +14820,24 @@ function checkVerdicts(cwd, branch, ledgerRows) {
|
|
|
14807
14820
|
return drift;
|
|
14808
14821
|
};
|
|
14809
14822
|
const exactCache = new Map;
|
|
14810
|
-
const
|
|
14811
|
-
if (FAILING.has(String(row.result)))
|
|
14812
|
-
return true;
|
|
14823
|
+
const exactMatch = (row) => {
|
|
14813
14824
|
let exact = exactCache.get(row);
|
|
14814
14825
|
if (exact === undefined) {
|
|
14815
14826
|
const toBase = row.base ?? fallbackBase;
|
|
14816
14827
|
const toBaseSha = toBase ? resolveCommit(cwd, toBase) : null;
|
|
14817
14828
|
const fromBase = row.baseSha ?? toBaseSha;
|
|
14818
|
-
|
|
14829
|
+
const range = row.head && head && toBaseSha && fromBase ? { from: row.head, to: head, fromBase, toBase: toBaseSha } : null;
|
|
14830
|
+
exact = !range ? null : sameOwnChange(cwd, range) ? "same" : cleanRebase(cwd, range) ? "rebase" : null;
|
|
14819
14831
|
exactCache.set(row, exact);
|
|
14820
14832
|
}
|
|
14821
14833
|
return exact;
|
|
14822
14834
|
};
|
|
14835
|
+
const exactCarry = (row) => FAILING.has(String(row.result)) || exactMatch(row) !== null;
|
|
14823
14836
|
const keyBasis = (row) => {
|
|
14824
14837
|
const basis = verdictBasis(row, { head, ...keyFor(row.base ?? fallbackBase) });
|
|
14825
14838
|
return basis === "carried" && !exactCarry(row) ? "stale" : basis;
|
|
14826
14839
|
};
|
|
14840
|
+
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
14841
|
const restacked = (row) => restackCarries(FAILING.has(String(row.result)) ? null : cwd, rows, branch, row.head, head);
|
|
14828
14842
|
const carryOf = (row) => {
|
|
14829
14843
|
if (keyBasis(row) !== "stale")
|
|
@@ -14901,7 +14915,7 @@ function checkVerdicts(cwd, branch, ledgerRows) {
|
|
|
14901
14915
|
independent: independence.length === 0,
|
|
14902
14916
|
accepted: reasons.length === 0,
|
|
14903
14917
|
reasons,
|
|
14904
|
-
carry: basis === "carried" ? carryOf(row) : null,
|
|
14918
|
+
carry: basis === "carried" ? rebaseNote(row) ?? carryOf(row) : null,
|
|
14905
14919
|
verdict: row
|
|
14906
14920
|
});
|
|
14907
14921
|
if (reasons.length === 0) {
|