@brainervirus/workit-codex 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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "workit",
3
- "version": "7.7.0",
3
+ "version": "8.0.1",
4
4
  "description": "Adaptive engineering workflow rails for Codex",
5
5
  "author": {
6
6
  "name": "BrainerVirus"
@@ -19186,7 +19186,7 @@ var independenceReasons = (row, authors) => {
19186
19186
  reasons.push("self");
19187
19187
  return reasons;
19188
19188
  };
19189
- function effectiveOf(rows, authors) {
19189
+ function effectiveOf(rows, authors, sameCode) {
19190
19190
  let effective = null;
19191
19191
  for (const row of rows) {
19192
19192
  if (!effective) {
@@ -19197,7 +19197,7 @@ function effectiveOf(rows, authors) {
19197
19197
  const effIndependent = independenceReasons(effective, authors).length === 0;
19198
19198
  if (effIndependent && !rowIndependent)
19199
19199
  continue;
19200
- if (effIndependent && FAILING.has(String(effective.result)) && row.actor.session === effective.actor.session)
19200
+ if (effIndependent && FAILING.has(String(effective.result)) && row.actor.session === effective.actor.session && sameCode(effective, row))
19201
19201
  continue;
19202
19202
  effective = row;
19203
19203
  }
@@ -19228,16 +19228,22 @@ function checkVerdicts(cwd, branch, rows) {
19228
19228
  const head = branchHead(cwd, branch);
19229
19229
  const fallbackBase = defaultBase(cwd);
19230
19230
  const keyCache = new Map;
19231
- const keyFor = (base) => {
19232
- if (!base || !head)
19231
+ const keysAt = (base, at) => {
19232
+ if (!base || !at)
19233
19233
  return { patchId: null, diffHash: null };
19234
- let key = keyCache.get(base);
19234
+ const cacheKey = `${base}\x00${at}`;
19235
+ let key = keyCache.get(cacheKey);
19235
19236
  if (!key) {
19236
- key = { patchId: patchId(cwd, base, head), diffHash: diffHash(cwd, base, head) };
19237
- keyCache.set(base, key);
19237
+ key = { patchId: patchId(cwd, base, at), diffHash: diffHash(cwd, base, at) };
19238
+ keyCache.set(cacheKey, key);
19238
19239
  }
19239
19240
  return key;
19240
19241
  };
19242
+ const keyFor = (base) => keysAt(base, head);
19243
+ const sameCode = (failed, row) => verdictBasis(failed, {
19244
+ head: row.head,
19245
+ ...keysAt(failed.base ?? fallbackBase, row.head)
19246
+ }) !== "stale" || restackCarries(rows, branch, failed.head, row.head);
19241
19247
  const authors = authorSessions(cwd, rows, branch, { base: fallbackBase, head });
19242
19248
  const byKind = new Map;
19243
19249
  for (const row of rows)
@@ -19247,7 +19253,7 @@ function checkVerdicts(cwd, branch, rows) {
19247
19253
  }
19248
19254
  const verdicts = [];
19249
19255
  for (const [kind, list] of byKind) {
19250
- const row = effectiveOf(list, authors);
19256
+ const row = effectiveOf(list, authors, sameCode);
19251
19257
  if (!row)
19252
19258
  continue;
19253
19259
  let basis = verdictBasis(row, { head, ...keyFor(row.base ?? fallbackBase) });
@@ -19273,11 +19279,11 @@ function checkVerdicts(cwd, branch, rows) {
19273
19279
  verdicts.sort((a, b) => a.verdict.seq - b.verdict.seq);
19274
19280
  const newestCurrent = verdicts.findLast((entry) => entry.current) ?? verdicts.at(-1) ?? null;
19275
19281
  const failing = verdicts.find((entry) => entry.current && entry.independent && FAILING.has(String(entry.verdict.result)));
19276
- const newestAccepted = verdicts.findLast((entry) => entry.accepted) ?? null;
19282
+ const newestAccepted = verdicts.findLast((entry) => entry.accepted && STRONG_RESULTS.has(String(entry.verdict.result))) ?? null;
19277
19283
  const accepted = newestAccepted && !failing ? { accepted: true, verdict: newestAccepted.verdict, reasons: [] } : {
19278
19284
  accepted: false,
19279
19285
  verdict: failing?.verdict ?? null,
19280
- reasons: failing ? ["failing_verdict"] : newestCurrent?.reasons ?? ["no_verdict"]
19286
+ reasons: failing ? ["failing_verdict"] : !newestCurrent ? ["no_verdict"] : newestCurrent.reasons.length ? newestCurrent.reasons : ["type_check_only"]
19281
19287
  };
19282
19288
  const selfEntry = failing ? undefined : verdicts.findLast((entry) => entry.current && !entry.independent && STRONG_RESULTS.has(String(entry.verdict.result)));
19283
19289
  return {
@@ -19293,7 +19299,7 @@ function checkVerdicts(cwd, branch, rows) {
19293
19299
  authors: [...authors].toSorted()
19294
19300
  };
19295
19301
  }
19296
- var OBSERVED_ONLY = new Set(["check", ...PR_ROW_TYPES]);
19302
+ var OBSERVED_ONLY = new Set(["check", "merge.unverified", ...PR_ROW_TYPES]);
19297
19303
 
19298
19304
  // packages/workit-core/src/core/policy/derive.ts
19299
19305
  var RULES = {
@@ -12200,7 +12200,7 @@ var independenceReasons = (row, authors) => {
12200
12200
  reasons.push("self");
12201
12201
  return reasons;
12202
12202
  };
12203
- function effectiveOf(rows, authors) {
12203
+ function effectiveOf(rows, authors, sameCode) {
12204
12204
  let effective = null;
12205
12205
  for (const row of rows) {
12206
12206
  if (!effective) {
@@ -12211,7 +12211,7 @@ function effectiveOf(rows, authors) {
12211
12211
  const effIndependent = independenceReasons(effective, authors).length === 0;
12212
12212
  if (effIndependent && !rowIndependent)
12213
12213
  continue;
12214
- if (effIndependent && FAILING.has(String(effective.result)) && row.actor.session === effective.actor.session)
12214
+ if (effIndependent && FAILING.has(String(effective.result)) && row.actor.session === effective.actor.session && sameCode(effective, row))
12215
12215
  continue;
12216
12216
  effective = row;
12217
12217
  }
@@ -12242,16 +12242,22 @@ function checkVerdicts(cwd, branch, rows) {
12242
12242
  const head = branchHead(cwd, branch);
12243
12243
  const fallbackBase = defaultBase(cwd);
12244
12244
  const keyCache = new Map;
12245
- const keyFor = (base) => {
12246
- if (!base || !head)
12245
+ const keysAt = (base, at) => {
12246
+ if (!base || !at)
12247
12247
  return { patchId: null, diffHash: null };
12248
- let key = keyCache.get(base);
12248
+ const cacheKey = `${base}\x00${at}`;
12249
+ let key = keyCache.get(cacheKey);
12249
12250
  if (!key) {
12250
- key = { patchId: patchId(cwd, base, head), diffHash: diffHash(cwd, base, head) };
12251
- keyCache.set(base, key);
12251
+ key = { patchId: patchId(cwd, base, at), diffHash: diffHash(cwd, base, at) };
12252
+ keyCache.set(cacheKey, key);
12252
12253
  }
12253
12254
  return key;
12254
12255
  };
12256
+ const keyFor = (base) => keysAt(base, head);
12257
+ const sameCode = (failed, row) => verdictBasis(failed, {
12258
+ head: row.head,
12259
+ ...keysAt(failed.base ?? fallbackBase, row.head)
12260
+ }) !== "stale" || restackCarries(rows, branch, failed.head, row.head);
12255
12261
  const authors = authorSessions(cwd, rows, branch, { base: fallbackBase, head });
12256
12262
  const byKind = new Map;
12257
12263
  for (const row of rows)
@@ -12261,7 +12267,7 @@ function checkVerdicts(cwd, branch, rows) {
12261
12267
  }
12262
12268
  const verdicts = [];
12263
12269
  for (const [kind, list] of byKind) {
12264
- const row = effectiveOf(list, authors);
12270
+ const row = effectiveOf(list, authors, sameCode);
12265
12271
  if (!row)
12266
12272
  continue;
12267
12273
  let basis = verdictBasis(row, { head, ...keyFor(row.base ?? fallbackBase) });
@@ -12287,11 +12293,11 @@ function checkVerdicts(cwd, branch, rows) {
12287
12293
  verdicts.sort((a, b) => a.verdict.seq - b.verdict.seq);
12288
12294
  const newestCurrent = verdicts.findLast((entry) => entry.current) ?? verdicts.at(-1) ?? null;
12289
12295
  const failing = verdicts.find((entry) => entry.current && entry.independent && FAILING.has(String(entry.verdict.result)));
12290
- const newestAccepted = verdicts.findLast((entry) => entry.accepted) ?? null;
12296
+ const newestAccepted = verdicts.findLast((entry) => entry.accepted && STRONG_RESULTS.has(String(entry.verdict.result))) ?? null;
12291
12297
  const accepted = newestAccepted && !failing ? { accepted: true, verdict: newestAccepted.verdict, reasons: [] } : {
12292
12298
  accepted: false,
12293
12299
  verdict: failing?.verdict ?? null,
12294
- reasons: failing ? ["failing_verdict"] : newestCurrent?.reasons ?? ["no_verdict"]
12300
+ reasons: failing ? ["failing_verdict"] : !newestCurrent ? ["no_verdict"] : newestCurrent.reasons.length ? newestCurrent.reasons : ["type_check_only"]
12295
12301
  };
12296
12302
  const selfEntry = failing ? undefined : verdicts.findLast((entry) => entry.current && !entry.independent && STRONG_RESULTS.has(String(entry.verdict.result)));
12297
12303
  return {
@@ -12307,7 +12313,7 @@ function checkVerdicts(cwd, branch, rows) {
12307
12313
  authors: [...authors].toSorted()
12308
12314
  };
12309
12315
  }
12310
- var OBSERVED_ONLY = new Set(["check", ...PR_ROW_TYPES]);
12316
+ var OBSERVED_ONLY = new Set(["check", "merge.unverified", ...PR_ROW_TYPES]);
12311
12317
 
12312
12318
  // packages/workit-core/src/core/policy/derive.ts
12313
12319
  var RULES = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainervirus/workit-codex",
3
- "version": "7.7.0",
3
+ "version": "8.0.1",
4
4
  "private": false,
5
5
  "description": "Workit Codex CLI/desktop plugin — shared MCP transport, hooks, and sixteen method skills",
6
6
  "keywords": [
@@ -38,8 +38,8 @@
38
38
  "build": "bun scripts/build.ts"
39
39
  },
40
40
  "dependencies": {
41
- "@brainervirus/workit-core": "^7.7.0",
42
- "@brainervirus/workit-mcp": "^7.7.0"
41
+ "@brainervirus/workit-core": "^8.0.1",
42
+ "@brainervirus/workit-mcp": "^8.0.1"
43
43
  },
44
44
  "engines": {
45
45
  "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.