@brainervirus/workit-cursor 7.7.0 → 8.0.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": "7.7.0",
5
+ "version": "8.0.1",
6
6
  "author": {
7
7
  "name": "Cristhofer Pincetti"
8
8
  },
@@ -9056,7 +9056,7 @@ function authorSessions(cwd, rows, branch, range = { base: null, head: null }) {
9056
9056
  sessions.add(session);
9057
9057
  return sessions;
9058
9058
  }
9059
- function effectiveOf(rows, authors) {
9059
+ function effectiveOf(rows, authors, sameCode) {
9060
9060
  let effective = null;
9061
9061
  for (const row of rows) {
9062
9062
  if (!effective) {
@@ -9067,7 +9067,7 @@ function effectiveOf(rows, authors) {
9067
9067
  const effIndependent = independenceReasons(effective, authors).length === 0;
9068
9068
  if (effIndependent && !rowIndependent)
9069
9069
  continue;
9070
- if (effIndependent && FAILING.has(String(effective.result)) && row.actor.session === effective.actor.session)
9070
+ if (effIndependent && FAILING.has(String(effective.result)) && row.actor.session === effective.actor.session && sameCode(effective, row))
9071
9071
  continue;
9072
9072
  effective = row;
9073
9073
  }
@@ -9098,16 +9098,22 @@ function checkVerdicts(cwd, branch, rows) {
9098
9098
  const head = branchHead(cwd, branch);
9099
9099
  const fallbackBase = defaultBase(cwd);
9100
9100
  const keyCache = new Map;
9101
- const keyFor = (base) => {
9102
- if (!base || !head)
9101
+ const keysAt = (base, at) => {
9102
+ if (!base || !at)
9103
9103
  return { patchId: null, diffHash: null };
9104
- let key = keyCache.get(base);
9104
+ const cacheKey = `${base}\x00${at}`;
9105
+ let key = keyCache.get(cacheKey);
9105
9106
  if (!key) {
9106
- key = { patchId: patchId(cwd, base, head), diffHash: diffHash(cwd, base, head) };
9107
- keyCache.set(base, key);
9107
+ key = { patchId: patchId(cwd, base, at), diffHash: diffHash(cwd, base, at) };
9108
+ keyCache.set(cacheKey, key);
9108
9109
  }
9109
9110
  return key;
9110
9111
  };
9112
+ const keyFor = (base) => keysAt(base, head);
9113
+ const sameCode = (failed, row) => verdictBasis(failed, {
9114
+ head: row.head,
9115
+ ...keysAt(failed.base ?? fallbackBase, row.head)
9116
+ }) !== "stale" || restackCarries(rows, branch, failed.head, row.head);
9111
9117
  const authors = authorSessions(cwd, rows, branch, { base: fallbackBase, head });
9112
9118
  const byKind = new Map;
9113
9119
  for (const row of rows)
@@ -9117,7 +9123,7 @@ function checkVerdicts(cwd, branch, rows) {
9117
9123
  }
9118
9124
  const verdicts = [];
9119
9125
  for (const [kind, list] of byKind) {
9120
- const row = effectiveOf(list, authors);
9126
+ const row = effectiveOf(list, authors, sameCode);
9121
9127
  if (!row)
9122
9128
  continue;
9123
9129
  let basis = verdictBasis(row, { head, ...keyFor(row.base ?? fallbackBase) });
@@ -9143,11 +9149,11 @@ function checkVerdicts(cwd, branch, rows) {
9143
9149
  verdicts.sort((a, b) => a.verdict.seq - b.verdict.seq);
9144
9150
  const newestCurrent = verdicts.findLast((entry) => entry.current) ?? verdicts.at(-1) ?? null;
9145
9151
  const failing = verdicts.find((entry) => entry.current && entry.independent && FAILING.has(String(entry.verdict.result)));
9146
- const newestAccepted = verdicts.findLast((entry) => entry.accepted) ?? null;
9152
+ const newestAccepted = verdicts.findLast((entry) => entry.accepted && STRONG_RESULTS.has(String(entry.verdict.result))) ?? null;
9147
9153
  const accepted = newestAccepted && !failing ? { accepted: true, verdict: newestAccepted.verdict, reasons: [] } : {
9148
9154
  accepted: false,
9149
9155
  verdict: failing?.verdict ?? null,
9150
- reasons: failing ? ["failing_verdict"] : newestCurrent?.reasons ?? ["no_verdict"]
9156
+ reasons: failing ? ["failing_verdict"] : !newestCurrent ? ["no_verdict"] : newestCurrent.reasons.length ? newestCurrent.reasons : ["type_check_only"]
9151
9157
  };
9152
9158
  const selfEntry = failing ? undefined : verdicts.findLast((entry) => entry.current && !entry.independent && STRONG_RESULTS.has(String(entry.verdict.result)));
9153
9159
  return {
@@ -9229,7 +9235,7 @@ var init_ledger = __esm(() => {
9229
9235
  1196443219,
9230
9236
  198183888
9231
9237
  ]);
9232
- OBSERVED_ONLY = new Set(["check", ...PR_ROW_TYPES]);
9238
+ OBSERVED_ONLY = new Set(["check", "merge.unverified", ...PR_ROW_TYPES]);
9233
9239
  });
9234
9240
 
9235
9241
  // packages/workit-core/src/core/policy/derive.ts
@@ -21564,7 +21564,7 @@ var independenceReasons = (row, authors) => {
21564
21564
  reasons.push("self");
21565
21565
  return reasons;
21566
21566
  };
21567
- function effectiveOf(rows, authors) {
21567
+ function effectiveOf(rows, authors, sameCode) {
21568
21568
  let effective = null;
21569
21569
  for (const row of rows) {
21570
21570
  if (!effective) {
@@ -21575,7 +21575,7 @@ function effectiveOf(rows, authors) {
21575
21575
  const effIndependent = independenceReasons(effective, authors).length === 0;
21576
21576
  if (effIndependent && !rowIndependent)
21577
21577
  continue;
21578
- if (effIndependent && FAILING.has(String(effective.result)) && row.actor.session === effective.actor.session)
21578
+ if (effIndependent && FAILING.has(String(effective.result)) && row.actor.session === effective.actor.session && sameCode(effective, row))
21579
21579
  continue;
21580
21580
  effective = row;
21581
21581
  }
@@ -21606,16 +21606,22 @@ function checkVerdicts(cwd, branch, rows) {
21606
21606
  const head = branchHead(cwd, branch);
21607
21607
  const fallbackBase = defaultBase(cwd);
21608
21608
  const keyCache = new Map;
21609
- const keyFor = (base) => {
21610
- if (!base || !head)
21609
+ const keysAt = (base, at) => {
21610
+ if (!base || !at)
21611
21611
  return { patchId: null, diffHash: null };
21612
- let key = keyCache.get(base);
21612
+ const cacheKey = `${base}\x00${at}`;
21613
+ let key = keyCache.get(cacheKey);
21613
21614
  if (!key) {
21614
- key = { patchId: patchId(cwd, base, head), diffHash: diffHash(cwd, base, head) };
21615
- keyCache.set(base, key);
21615
+ key = { patchId: patchId(cwd, base, at), diffHash: diffHash(cwd, base, at) };
21616
+ keyCache.set(cacheKey, key);
21616
21617
  }
21617
21618
  return key;
21618
21619
  };
21620
+ const keyFor = (base) => keysAt(base, head);
21621
+ const sameCode = (failed, row) => verdictBasis(failed, {
21622
+ head: row.head,
21623
+ ...keysAt(failed.base ?? fallbackBase, row.head)
21624
+ }) !== "stale" || restackCarries(rows, branch, failed.head, row.head);
21619
21625
  const authors = authorSessions(cwd, rows, branch, { base: fallbackBase, head });
21620
21626
  const byKind = new Map;
21621
21627
  for (const row of rows)
@@ -21625,7 +21631,7 @@ function checkVerdicts(cwd, branch, rows) {
21625
21631
  }
21626
21632
  const verdicts = [];
21627
21633
  for (const [kind, list] of byKind) {
21628
- const row = effectiveOf(list, authors);
21634
+ const row = effectiveOf(list, authors, sameCode);
21629
21635
  if (!row)
21630
21636
  continue;
21631
21637
  let basis = verdictBasis(row, { head, ...keyFor(row.base ?? fallbackBase) });
@@ -21651,11 +21657,11 @@ function checkVerdicts(cwd, branch, rows) {
21651
21657
  verdicts.sort((a, b) => a.verdict.seq - b.verdict.seq);
21652
21658
  const newestCurrent = verdicts.findLast((entry) => entry.current) ?? verdicts.at(-1) ?? null;
21653
21659
  const failing = verdicts.find((entry) => entry.current && entry.independent && FAILING.has(String(entry.verdict.result)));
21654
- const newestAccepted = verdicts.findLast((entry) => entry.accepted) ?? null;
21660
+ const newestAccepted = verdicts.findLast((entry) => entry.accepted && STRONG_RESULTS.has(String(entry.verdict.result))) ?? null;
21655
21661
  const accepted = newestAccepted && !failing ? { accepted: true, verdict: newestAccepted.verdict, reasons: [] } : {
21656
21662
  accepted: false,
21657
21663
  verdict: failing?.verdict ?? null,
21658
- reasons: failing ? ["failing_verdict"] : newestCurrent?.reasons ?? ["no_verdict"]
21664
+ reasons: failing ? ["failing_verdict"] : !newestCurrent ? ["no_verdict"] : newestCurrent.reasons.length ? newestCurrent.reasons : ["type_check_only"]
21659
21665
  };
21660
21666
  const selfEntry = failing ? undefined : verdicts.findLast((entry) => entry.current && !entry.independent && STRONG_RESULTS.has(String(entry.verdict.result)));
21661
21667
  return {
@@ -21671,7 +21677,7 @@ function checkVerdicts(cwd, branch, rows) {
21671
21677
  authors: [...authors].toSorted()
21672
21678
  };
21673
21679
  }
21674
- var OBSERVED_ONLY = new Set(["check", ...PR_ROW_TYPES]);
21680
+ var OBSERVED_ONLY = new Set(["check", "merge.unverified", ...PR_ROW_TYPES]);
21675
21681
 
21676
21682
  // packages/workit-core/src/core/policy/derive.ts
21677
21683
  var RULES = {
@@ -9055,7 +9055,7 @@ var independenceReasons = (row, authors) => {
9055
9055
  reasons.push("self");
9056
9056
  return reasons;
9057
9057
  };
9058
- function effectiveOf(rows, authors) {
9058
+ function effectiveOf(rows, authors, sameCode) {
9059
9059
  let effective = null;
9060
9060
  for (const row of rows) {
9061
9061
  if (!effective) {
@@ -9066,7 +9066,7 @@ function effectiveOf(rows, authors) {
9066
9066
  const effIndependent = independenceReasons(effective, authors).length === 0;
9067
9067
  if (effIndependent && !rowIndependent)
9068
9068
  continue;
9069
- if (effIndependent && FAILING.has(String(effective.result)) && row.actor.session === effective.actor.session)
9069
+ if (effIndependent && FAILING.has(String(effective.result)) && row.actor.session === effective.actor.session && sameCode(effective, row))
9070
9070
  continue;
9071
9071
  effective = row;
9072
9072
  }
@@ -9097,16 +9097,22 @@ function checkVerdicts(cwd, branch, rows) {
9097
9097
  const head = branchHead(cwd, branch);
9098
9098
  const fallbackBase = defaultBase(cwd);
9099
9099
  const keyCache = new Map;
9100
- const keyFor = (base) => {
9101
- if (!base || !head)
9100
+ const keysAt = (base, at) => {
9101
+ if (!base || !at)
9102
9102
  return { patchId: null, diffHash: null };
9103
- let key = keyCache.get(base);
9103
+ const cacheKey = `${base}\x00${at}`;
9104
+ let key = keyCache.get(cacheKey);
9104
9105
  if (!key) {
9105
- key = { patchId: patchId(cwd, base, head), diffHash: diffHash(cwd, base, head) };
9106
- keyCache.set(base, key);
9106
+ key = { patchId: patchId(cwd, base, at), diffHash: diffHash(cwd, base, at) };
9107
+ keyCache.set(cacheKey, key);
9107
9108
  }
9108
9109
  return key;
9109
9110
  };
9111
+ const keyFor = (base) => keysAt(base, head);
9112
+ const sameCode = (failed, row) => verdictBasis(failed, {
9113
+ head: row.head,
9114
+ ...keysAt(failed.base ?? fallbackBase, row.head)
9115
+ }) !== "stale" || restackCarries(rows, branch, failed.head, row.head);
9110
9116
  const authors = authorSessions(cwd, rows, branch, { base: fallbackBase, head });
9111
9117
  const byKind = new Map;
9112
9118
  for (const row of rows)
@@ -9116,7 +9122,7 @@ function checkVerdicts(cwd, branch, rows) {
9116
9122
  }
9117
9123
  const verdicts = [];
9118
9124
  for (const [kind, list] of byKind) {
9119
- const row = effectiveOf(list, authors);
9125
+ const row = effectiveOf(list, authors, sameCode);
9120
9126
  if (!row)
9121
9127
  continue;
9122
9128
  let basis = verdictBasis(row, { head, ...keyFor(row.base ?? fallbackBase) });
@@ -9142,11 +9148,11 @@ function checkVerdicts(cwd, branch, rows) {
9142
9148
  verdicts.sort((a, b) => a.verdict.seq - b.verdict.seq);
9143
9149
  const newestCurrent = verdicts.findLast((entry) => entry.current) ?? verdicts.at(-1) ?? null;
9144
9150
  const failing = verdicts.find((entry) => entry.current && entry.independent && FAILING.has(String(entry.verdict.result)));
9145
- const newestAccepted = verdicts.findLast((entry) => entry.accepted) ?? null;
9151
+ const newestAccepted = verdicts.findLast((entry) => entry.accepted && STRONG_RESULTS.has(String(entry.verdict.result))) ?? null;
9146
9152
  const accepted = newestAccepted && !failing ? { accepted: true, verdict: newestAccepted.verdict, reasons: [] } : {
9147
9153
  accepted: false,
9148
9154
  verdict: failing?.verdict ?? null,
9149
- reasons: failing ? ["failing_verdict"] : newestCurrent?.reasons ?? ["no_verdict"]
9155
+ reasons: failing ? ["failing_verdict"] : !newestCurrent ? ["no_verdict"] : newestCurrent.reasons.length ? newestCurrent.reasons : ["type_check_only"]
9150
9156
  };
9151
9157
  const selfEntry = failing ? undefined : verdicts.findLast((entry) => entry.current && !entry.independent && STRONG_RESULTS.has(String(entry.verdict.result)));
9152
9158
  return {
@@ -9162,7 +9168,7 @@ function checkVerdicts(cwd, branch, rows) {
9162
9168
  authors: [...authors].toSorted()
9163
9169
  };
9164
9170
  }
9165
- var OBSERVED_ONLY = new Set(["check", ...PR_ROW_TYPES]);
9171
+ var OBSERVED_ONLY = new Set(["check", "merge.unverified", ...PR_ROW_TYPES]);
9166
9172
 
9167
9173
  // packages/workit-core/src/core/policy/derive.ts
9168
9174
  var RULES = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainervirus/workit-cursor",
3
- "version": "7.7.0",
3
+ "version": "8.0.1",
4
4
  "private": false,
5
5
  "description": "Workit Cursor plugin — shared MCP transport, native hooks, and sixteen method skills",
6
6
  "keywords": [
@@ -44,8 +44,8 @@
44
44
  "build": "bun scripts/build.ts"
45
45
  },
46
46
  "dependencies": {
47
- "@brainervirus/workit-core": "^7.7.0",
48
- "@brainervirus/workit-mcp": "^7.7.0"
47
+ "@brainervirus/workit-core": "^8.0.1",
48
+ "@brainervirus/workit-mcp": "^8.0.1"
49
49
  },
50
50
  "engines": {
51
51
  "node": ">=24"
@@ -51,8 +51,8 @@ the base keeps moving, or after 3 failed fix attempts on the same check.
51
51
  flake|infra` per head. Real: reproduce with `workit check`, fix the root
52
52
  cause, batch fixes into one push.
53
53
  6. **Verified.** After the last push a non-author records a verdict
54
- (read the `workit-review` skill's SKILL.md and follow it). Land only when granted: `workit stack land` (the
55
- contiguous verified run from the root) or `workit pr merge`.
54
+ (read the `workit-review` skill's SKILL.md and follow it). Land only when granted: `workit stack land` (verified run
55
+ from the root) or `workit pr merge`; `--unverified --reason` only if user-asked.
56
56
  7. **Observe it landed:** `workit verify-delivery pr` or `merge`. After a failed
57
57
  verdict or a check red 3+ times, at any endpoint: offer `/wk-retro` in one
58
58
  line of the final or stop report; never pause the babysit loop for it.