@brainervirus/workit-codex 8.0.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": "8.0.0",
3
+ "version": "8.0.1",
4
4
  "description": "Adaptive engineering workflow rails for Codex",
5
5
  "author": {
6
6
  "name": "BrainerVirus"
@@ -6624,12 +6624,12 @@ var require_dist = __commonJS(function(exports, module) {
6624
6624
  import { existsSync as existsSync9, realpathSync as realpathSync7, statSync as statSync3 } from "node:fs";
6625
6625
  import path21 from "node:path";
6626
6626
 
6627
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core.ts
6627
+ // packages/workit-core/src/core.ts
6628
6628
  import { spawnSync as spawnSync12 } from "node:child_process";
6629
6629
  import { existsSync as existsSync7, realpathSync as realpathSync5 } from "node:fs";
6630
6630
  import path19 from "node:path";
6631
6631
 
6632
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-contract.ts
6632
+ // packages/workit-core/src/core/task-contract.ts
6633
6633
  import { createHash, randomUUID } from "node:crypto";
6634
6634
 
6635
6635
  // node_modules/zod/v4/core/util.js
@@ -14203,7 +14203,7 @@ function preprocess(fn, schema) {
14203
14203
  function datetime2(params) {
14204
14204
  return _isoDateTime(ZodISODateTime, params);
14205
14205
  }
14206
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-contract.ts
14206
+ // packages/workit-core/src/core/task-contract.ts
14207
14207
  var SCHEMA_VERSION = 1;
14208
14208
  var POLICY_VERSION = "1.0.0";
14209
14209
  var OPERATION_FAMILIES = [
@@ -15058,7 +15058,7 @@ function requirementId(input) {
15058
15058
  }
15059
15059
  });
15060
15060
  }
15061
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/operation-input.ts
15061
+ // packages/workit-core/src/core/operation-input.ts
15062
15062
  var str = (d, values) => ({
15063
15063
  type: "string",
15064
15064
  ...values ? { enum: values } : {},
@@ -15454,7 +15454,7 @@ function parseAdvertisedOperation(family, input, host) {
15454
15454
  }))
15455
15455
  });
15456
15456
  }
15457
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-store.ts
15457
+ // packages/workit-core/src/core/task-store.ts
15458
15458
  import { createHash as createHash4, randomUUID as randomUUID3 } from "node:crypto";
15459
15459
  import * as fs7 from "node:fs";
15460
15460
  import path6 from "node:path";
@@ -16060,7 +16060,7 @@ function acquireFileLockSync(targetPath, options) {
16060
16060
  }
16061
16061
  }
16062
16062
  }
16063
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/package-root.ts
16063
+ // packages/workit-core/src/core/package-root.ts
16064
16064
  import { existsSync } from "node:fs";
16065
16065
  import path3 from "node:path";
16066
16066
  import { fileURLToPath } from "node:url";
@@ -16079,12 +16079,12 @@ var assetRoot = () => {
16079
16079
  return existsSync(assets) ? assets : root;
16080
16080
  };
16081
16081
 
16082
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/store-lock.ts
16082
+ // packages/workit-core/src/core/store-lock.ts
16083
16083
  import { spawnSync as spawnSync2 } from "node:child_process";
16084
16084
  import fs5 from "node:fs";
16085
16085
  import { hostname } from "node:os";
16086
16086
 
16087
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/store/paths.ts
16087
+ // packages/workit-core/src/store/paths.ts
16088
16088
  import { spawnSync } from "node:child_process";
16089
16089
  import { createHash as createHash2 } from "node:crypto";
16090
16090
  import fs4 from "node:fs";
@@ -16364,7 +16364,7 @@ var checkoutSlug = (root) => {
16364
16364
  return `${base}-${shortHash(canonical)}`;
16365
16365
  };
16366
16366
 
16367
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/store-lock.ts
16367
+ // packages/workit-core/src/core/store-lock.ts
16368
16368
  var metadataLockSchema = object({
16369
16369
  pid: number2().int().nonnegative().safe(),
16370
16370
  processStart: string2().nullable(),
@@ -16495,7 +16495,7 @@ var clearAbandonedReclaimGuard = (lockPath, nowMs = Date.now()) => {
16495
16495
  }
16496
16496
  };
16497
16497
 
16498
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/store/event-log.ts
16498
+ // packages/workit-core/src/store/event-log.ts
16499
16499
  import { randomUUID as randomUUID2 } from "node:crypto";
16500
16500
  import fs6 from "node:fs";
16501
16501
  import path5 from "node:path";
@@ -16655,7 +16655,7 @@ var retryTransient = (run) => {
16655
16655
  };
16656
16656
  var renameWithRetry = (from, to) => retryTransient(() => fs6.renameSync(from, to));
16657
16657
 
16658
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/store/patch.ts
16658
+ // packages/workit-core/src/store/patch.ts
16659
16659
  var isPlainObject2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
16660
16660
  var equal = (left, right) => {
16661
16661
  if (left === right)
@@ -16765,7 +16765,7 @@ var isPatch = (value) => Array.isArray(value) && value.every((op) => {
16765
16765
  return false;
16766
16766
  });
16767
16767
 
16768
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/store/reduce.ts
16768
+ // packages/workit-core/src/store/reduce.ts
16769
16769
  import { createHash as createHash3 } from "node:crypto";
16770
16770
  var OPENING_TYPES = new Set([
16771
16771
  "task.opened",
@@ -16896,7 +16896,7 @@ function eventType(before, after) {
16896
16896
  return "task.updated";
16897
16897
  }
16898
16898
 
16899
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/store/notes.ts
16899
+ // packages/workit-core/src/store/notes.ts
16900
16900
  var SLOT = Symbol.for("workit.migrationReporter");
16901
16901
  var reportMigration = (report) => {
16902
16902
  try {
@@ -16907,7 +16907,7 @@ var reportMigration = (report) => {
16907
16907
  };
16908
16908
  var migrationReporterInstalled = () => typeof globalThis[SLOT] === "function";
16909
16909
 
16910
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-store.ts
16910
+ // packages/workit-core/src/core/task-store.ts
16911
16911
  var MIGRATION_PENDING = "workit migration pending";
16912
16912
  var STORE_FORMAT = 3;
16913
16913
  var STORE_MIN_RUNTIME = "3.0.0";
@@ -18543,18 +18543,18 @@ class TaskStore {
18543
18543
  return failure2(recovery ? "recovery_required" : "storage_error", `lock operation failed: ${String(error)}`, { path: lockPath });
18544
18544
  }
18545
18545
  }
18546
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/workers.ts
18546
+ // packages/workit-core/src/core/workers.ts
18547
18547
  var UNCERTAIN_WORKER_STATES = ["dispatching", "running", "cancelling", "unknown"];
18548
18548
  var isUncertainWorker = (state) => UNCERTAIN_WORKER_STATES.includes(state);
18549
18549
  var workerBlocksTransition = (transition, state) => transition === "pause" ? false : isUncertainWorker(state);
18550
18550
 
18551
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-evaluation.ts
18551
+ // packages/workit-core/src/core/task-evaluation.ts
18552
18552
  import { createHash as createHash7 } from "node:crypto";
18553
18553
  import * as fs11 from "node:fs";
18554
18554
  import { spawnSync as spawnSync6 } from "node:child_process";
18555
18555
  import path11 from "node:path";
18556
18556
 
18557
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/check-config.ts
18557
+ // packages/workit-core/src/check-config.ts
18558
18558
  import { spawnSync as spawnSync3 } from "node:child_process";
18559
18559
  import fs8 from "node:fs";
18560
18560
  import path7 from "node:path";
@@ -18759,7 +18759,7 @@ function checkCommand(args, version, onPath = workitAvailable()) {
18759
18759
  return onPath ? `workit check ${args}` : `npx -y @brainervirus/workit-cli@${version} check ${args}`;
18760
18760
  }
18761
18761
 
18762
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/git/rev.ts
18762
+ // packages/workit-core/src/git/rev.ts
18763
18763
  import { spawnSync as spawnSync4 } from "node:child_process";
18764
18764
  import { createHash as createHash5 } from "node:crypto";
18765
18765
  import fs9 from "node:fs";
@@ -18940,11 +18940,11 @@ function pushRemoteName(cwd, branch) {
18940
18940
  return remotes.length === 1 ? remotes[0] : null;
18941
18941
  }
18942
18942
 
18943
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/policy/derive.ts
18943
+ // packages/workit-core/src/core/policy/derive.ts
18944
18944
  import { existsSync as existsSync3 } from "node:fs";
18945
18945
  import path10 from "node:path";
18946
18946
 
18947
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/ledger.ts
18947
+ // packages/workit-core/src/ledger.ts
18948
18948
  import { spawnSync as spawnSync5 } from "node:child_process";
18949
18949
  import { createHash as createHash6, randomBytes as randomBytes2 } from "node:crypto";
18950
18950
  import fs10 from "node:fs";
@@ -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,9 +19299,9 @@ 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
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/policy/derive.ts
19304
+ // packages/workit-core/src/core/policy/derive.ts
19299
19305
  var RULES = {
19300
19306
  test: "check:test",
19301
19307
  self: "verdict:self",
@@ -19483,7 +19489,7 @@ function derivedRuleStatus(task, requirement, root, ledger) {
19483
19489
  }
19484
19490
  }
19485
19491
 
19486
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-evaluation.ts
19492
+ // packages/workit-core/src/core/task-evaluation.ts
19487
19493
  var digestBytes = (value) => createHash7("sha256").update(value).digest("hex");
19488
19494
  var inside = (root, candidate) => candidate === root || candidate.startsWith(`${root}${path11.sep}`);
19489
19495
  var relative = (root, candidate) => path11.relative(root, candidate).split(path11.sep).join("/") || ".";
@@ -20149,7 +20155,7 @@ function evaluateClosure(requestedOutcome, view) {
20149
20155
  });
20150
20156
  }
20151
20157
 
20152
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/methods.ts
20158
+ // packages/workit-core/src/core/methods.ts
20153
20159
  var METHODS = {
20154
20160
  "workit-shape": { dimensions: ["challenge", "decisions", "artifacts", "continuity"] },
20155
20161
  "workit-bdd": { dimensions: ["testing"] },
@@ -20195,7 +20201,7 @@ function selectMethods(policy, capabilities) {
20195
20201
  });
20196
20202
  }
20197
20203
 
20198
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-context.ts
20204
+ // packages/workit-core/src/core/task-context.ts
20199
20205
  function reconcileResume(view, observations = []) {
20200
20206
  if (observations.length > 0)
20201
20207
  return failure2("permission_denied", "worker observations require native host verification");
@@ -20309,7 +20315,7 @@ var exportDigest = (bundle) => sha256({
20309
20315
  sourceWorkspaceId: bundle.sourceWorkspaceId,
20310
20316
  task: bundle.task
20311
20317
  });
20312
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/git.ts
20318
+ // packages/workit-core/src/core/git.ts
20313
20319
  import { execFileSync } from "node:child_process";
20314
20320
  var run = (cwd, args) => {
20315
20321
  try {
@@ -20377,7 +20383,7 @@ var gitContext = (workspaceRoot, paths = []) => {
20377
20383
  };
20378
20384
  };
20379
20385
 
20380
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/config.ts
20386
+ // packages/workit-core/src/core/config.ts
20381
20387
  import {
20382
20388
  copyFileSync as copyFileSync2,
20383
20389
  cpSync as cpSync2,
@@ -20390,7 +20396,7 @@ import {
20390
20396
  import os2 from "node:os";
20391
20397
  import path12 from "node:path";
20392
20398
 
20393
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/boundary.ts
20399
+ // packages/workit-core/src/core/boundary.ts
20394
20400
  import { statSync as statSync2 } from "node:fs";
20395
20401
  var EVENT = {
20396
20402
  initialization: "initialization",
@@ -20426,7 +20432,7 @@ var changedSourcesSinceLoad = (marker) => {
20426
20432
  return changed;
20427
20433
  };
20428
20434
 
20429
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/config.ts
20435
+ // packages/workit-core/src/core/config.ts
20430
20436
  var diagnosticLogger;
20431
20437
  var PRESETS = {
20432
20438
  gitflow: {
@@ -20579,7 +20585,7 @@ var COMMIT_PRESETS = [
20579
20585
  "auto"
20580
20586
  ];
20581
20587
 
20582
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/workspaces.ts
20588
+ // packages/workit-core/src/core/workspaces.ts
20583
20589
  import { createHash as createHash8 } from "node:crypto";
20584
20590
  import { readFileSync as readFileSync4, realpathSync as realpathSync3 } from "node:fs";
20585
20591
  import path13 from "node:path";
@@ -20988,12 +20994,12 @@ function workspaceDefaultTarget(cwd, globalDefault) {
20988
20994
  return String(ws?.vcs?.defaultTargetBranch ?? (hasWorkspacePolicy ? policyDefault : globalDefault ?? policyDefault) ?? "develop");
20989
20995
  }
20990
20996
 
20991
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/vcs-config.ts
20997
+ // packages/workit-core/src/core/vcs-config.ts
20992
20998
  import fs12 from "node:fs";
20993
20999
  import path14 from "node:path";
20994
21000
  import { spawnSync as spawnSync8 } from "node:child_process";
20995
21001
 
20996
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/release-tracks.ts
21002
+ // packages/workit-core/src/core/release-tracks.ts
20997
21003
  import { createHash as createHash9 } from "node:crypto";
20998
21004
  import { spawnSync as spawnSync7 } from "node:child_process";
20999
21005
  var KNOWN_FIELDS = new Set([
@@ -21378,7 +21384,7 @@ function resolveTrackFor(cwd, options) {
21378
21384
  return resolution;
21379
21385
  }
21380
21386
 
21381
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/vcs-config.ts
21387
+ // packages/workit-core/src/core/vcs-config.ts
21382
21388
  var workspacesPath = () => path14.join(configDir(), "workspaces.json");
21383
21389
  var vcsCwd = (cwd) => cwd ?? process.env.WORKFLOW_WORKSPACE_ROOT ?? process.cwd();
21384
21390
  var remoteProvider = (cwd) => {
@@ -21659,10 +21665,10 @@ function mergedPrStyle(limit = 6, cwd) {
21659
21665
  examples
21660
21666
  };
21661
21667
  }
21662
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-engine.ts
21668
+ // packages/workit-core/src/core/task-engine.ts
21663
21669
  import { realpathSync as realpathSync4 } from "node:fs";
21664
21670
 
21665
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/policy-resolver.ts
21671
+ // packages/workit-core/src/core/policy-resolver.ts
21666
21672
  function resolvePolicy(input) {
21667
21673
  const ids = input.constraints.map((constraint) => constraint.id);
21668
21674
  if (new Set(ids).size !== ids.length)
@@ -21718,7 +21724,7 @@ function diffPolicy(previous, next, reason, now) {
21718
21724
  return parsed.data;
21719
21725
  }
21720
21726
 
21721
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/policy/judgment.ts
21727
+ // packages/workit-core/src/core/policy/judgment.ts
21722
21728
  var isObject6 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
21723
21729
  var squash = (key) => key.toLowerCase().replace(/[_-]/g, "");
21724
21730
  var ALIASES = {
@@ -21842,7 +21848,7 @@ function normalizeJudgment(raw, previous) {
21842
21848
  return success(null, null, { judgment: parsed.data, ignored, legacy });
21843
21849
  }
21844
21850
 
21845
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/autonomy.ts
21851
+ // packages/workit-core/src/autonomy.ts
21846
21852
  import os3 from "node:os";
21847
21853
  import path15 from "node:path";
21848
21854
  var accountHome = () => {
@@ -21979,7 +21985,7 @@ function resolveAutonomy(cwd) {
21979
21985
  var suggested = (kind) => kind === "merge" ? "verified" : "true";
21980
21986
  var grantHint = (workspace, kind) => `ask the user to run, in their own terminal: workit grant set ${workspace ?? "<workspace>"} ${kind}=${suggested(kind)}`;
21981
21987
 
21982
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-engine.ts
21988
+ // packages/workit-core/src/core/task-engine.ts
21983
21989
  var workspaceVerification = (root) => {
21984
21990
  try {
21985
21991
  return resolveAutonomy(root).verification;
@@ -23564,7 +23570,7 @@ class WorkitCore {
23564
23570
  return this.summary(changed.data.task);
23565
23571
  }
23566
23572
  }
23567
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/repo-context.ts
23573
+ // packages/workit-core/src/core/repo-context.ts
23568
23574
  import { spawnSync as spawnSync9 } from "node:child_process";
23569
23575
  import { existsSync as existsSync6, readFileSync as readFileSync5, readdirSync as readdirSync4 } from "node:fs";
23570
23576
  import path16 from "node:path";
@@ -24034,20 +24040,20 @@ function releaseNotesContext(root, rangeOrTag) {
24034
24040
  return { stdout, stderr: "", exitCode: 0, cwd };
24035
24041
  }
24036
24042
 
24037
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/tracker-issues.ts
24043
+ // packages/workit-core/src/core/tracker-issues.ts
24038
24044
  import { spawnSync as spawnSync11 } from "node:child_process";
24039
24045
 
24040
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/pr-create.ts
24046
+ // packages/workit-core/src/core/pr-create.ts
24041
24047
  import fs13 from "node:fs";
24042
24048
  import path17 from "node:path";
24043
24049
  import { spawnSync as spawnSync10 } from "node:child_process";
24044
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/forge/pr-body.ts
24050
+ // packages/workit-core/src/forge/pr-body.ts
24045
24051
  function parseGhIssue(value) {
24046
24052
  const m = /issues\/(\d+)/.exec(value);
24047
24053
  return m ? m[1] : String(value).trim().replace(/^#/, "");
24048
24054
  }
24049
24055
 
24050
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/pr-create.ts
24056
+ // packages/workit-core/src/core/pr-create.ts
24051
24057
  function whichOnPath(tool) {
24052
24058
  const names = process.platform === "win32" ? [tool, `${tool}.exe`, `${tool}.cmd`] : [tool];
24053
24059
  for (const dir of (process.env.PATH ?? "").split(path17.delimiter)) {
@@ -24075,7 +24081,7 @@ var pushRemote = (cwd) => {
24075
24081
  return urls.length === 1 ? urls[0] : null;
24076
24082
  };
24077
24083
 
24078
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/tracker-issues.ts
24084
+ // packages/workit-core/src/core/tracker-issues.ts
24079
24085
  var repoPathFromRemote = (remote) => {
24080
24086
  let rest = (remote || "").trim().replace(/\/+$/, "");
24081
24087
  if (!rest)
@@ -24173,19 +24179,19 @@ var fetchGitLabIssueBody = async (ref, root, deps = {}) => {
24173
24179
  return tryCliTriple(deps.cli ?? defaultCli("glab", hostingCliAvailable("gitlab")), "glab", ["issue", "view", id, "-R", repoArg, "-F", "json"], root, id, ["iid"], ["description"]);
24174
24180
  };
24175
24181
 
24176
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/youtrack.ts
24182
+ // packages/workit-core/src/core/youtrack.ts
24177
24183
  import fs14 from "node:fs";
24178
24184
  import path18 from "node:path";
24179
24185
 
24180
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/templates.ts
24186
+ // packages/workit-core/src/core/templates.ts
24181
24187
  var repoRoot2 = assetRoot();
24182
24188
 
24183
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/scripts.ts
24189
+ // packages/workit-core/src/core/scripts.ts
24184
24190
  var PLUGIN_ROOT = packageRoot();
24185
24191
  var ASSET_ROOT = assetRoot();
24186
24192
  var resolveWorkspaceRoot = (explicit) => explicit || process.cwd();
24187
24193
 
24188
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/youtrack.ts
24194
+ // packages/workit-core/src/core/youtrack.ts
24189
24195
  var ISSUE_RE = /^[A-Z]+-\d+$/;
24190
24196
  var TOKEN_PLACEHOLDER = "YOUR_TOKEN_HERE";
24191
24197
  var youTrackConfigPath = () => process.env.WORKFLOW_YOUTRACK_CONFIG ?? path18.join(configDir(), "youtrack.json");
@@ -24476,7 +24482,7 @@ var fetchYouTrackIssueBody = async (issue, creds = youTrackToken, request = youT
24476
24482
  }
24477
24483
  };
24478
24484
 
24479
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/context-read.ts
24485
+ // packages/workit-core/src/core/context-read.ts
24480
24486
  var contextReadSchema = object({
24481
24487
  kind: _enum([
24482
24488
  "git",
@@ -24571,7 +24577,7 @@ var readExternalContext = async (root, payload) => {
24571
24577
  }
24572
24578
  }
24573
24579
  };
24574
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core.ts
24580
+ // packages/workit-core/src/core.ts
24575
24581
  var revision2 = /^[A-Za-z0-9@][A-Za-z0-9@._/~^{}-]*$/;
24576
24582
  function gitRevisionParts(value) {
24577
24583
  if (!value || value.startsWith("-") || /[\s\\'"`$;|&<>]/.test(value)) {
@@ -24627,7 +24633,7 @@ function run2(root, executable, args, env = {}) {
24627
24633
  };
24628
24634
  }
24629
24635
 
24630
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/support-matrix.ts
24636
+ // packages/workit-core/src/core/support-matrix.ts
24631
24637
  var SUPPORT_MATRIX = {
24632
24638
  bun: "1.4.1",
24633
24639
  node: { minimum: "24", current: "24.20.0" },
@@ -24637,7 +24643,7 @@ var SUPPORT_MATRIX = {
24637
24643
  os: ["ubuntu-latest", "macos-latest", "windows-latest"]
24638
24644
  };
24639
24645
 
24640
- // packages/workit-codex/node_modules/@brainervirus/workit-mcp/src/server.ts
24646
+ // packages/workit-mcp/src/server.ts
24641
24647
  import { existsSync as existsSync8, readFileSync as readFileSync6, realpathSync as realpathSync6 } from "node:fs";
24642
24648
  import path20 from "node:path";
24643
24649
  // node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
@@ -27014,10 +27020,10 @@ class StdioServerTransport {
27014
27020
  }
27015
27021
  }
27016
27022
 
27017
- // packages/workit-codex/node_modules/@brainervirus/workit-mcp/src/server.ts
27023
+ // packages/workit-mcp/src/server.ts
27018
27024
  import { fileURLToPath as fileURLToPath2 } from "node:url";
27019
27025
 
27020
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/logger.ts
27026
+ // packages/workit-core/src/core/logger.ts
27021
27027
  import os4 from "node:os";
27022
27028
  var REDACTED = "[REDACTED]";
27023
27029
  var SECRET_VALUE = /\b(?:Bearer|Basic|Digest|Token)\s+\S+/gi;
@@ -27074,7 +27080,7 @@ var applyPatterns = (value) => {
27074
27080
  };
27075
27081
  var redactSecrets = (value) => applyPatterns(value);
27076
27082
 
27077
- // packages/workit-codex/node_modules/@brainervirus/workit-mcp/src/server.ts
27083
+ // packages/workit-mcp/src/server.ts
27078
27084
  class McpCapabilityUnavailableError extends Error {
27079
27085
  capability;
27080
27086
  constructor(capability) {
@@ -27369,7 +27375,7 @@ async function runStdioServer(host, contextProvider = defaultContextProvider(hos
27369
27375
  await server.connect(new StdioServerTransport);
27370
27376
  return server;
27371
27377
  }
27372
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/descriptor.ts
27378
+ // packages/workit-core/src/hooks/descriptor.ts
27373
27379
  var support = (descriptor, axis) => {
27374
27380
  if (axis.startsWith("event:"))
27375
27381
  return descriptor.events[axis.slice("event:".length)].support;
@@ -27393,14 +27399,14 @@ var capabilitiesFor = (descriptor, observed = {}) => descriptor.capabilities.map
27393
27399
  refs: rule.refs.map((handle) => ({ kind: "host", host: descriptor.host, handle }))
27394
27400
  };
27395
27401
  });
27396
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/context.ts
27402
+ // packages/workit-core/src/hooks/context.ts
27397
27403
  var signals = new Map;
27398
27404
  var cache = new Map;
27399
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/write-gate.ts
27405
+ // packages/workit-core/src/hooks/write-gate.ts
27400
27406
  var CASE_INSENSITIVE = process.platform === "darwin" || process.platform === "win32";
27401
27407
  var PREFIXES = new Set(["sudo", "command", "env", "nohup", "time", "exec", "xargs"]);
27402
27408
  var cache2 = new Map;
27403
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/hosts/fields.ts
27409
+ // packages/workit-core/src/hooks/hosts/fields.ts
27404
27410
  var SHELLS = new Set(["sh", "bash", "zsh", "dash", "pwsh", "powershell", "cmd"]);
27405
27411
  var WRITE_TOOLS = new Set([
27406
27412
  "write",
@@ -27421,15 +27427,15 @@ var WRITE_TOOLS = new Set([
27421
27427
  "editfile",
27422
27428
  "writefile"
27423
27429
  ]);
27424
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/handle.ts
27430
+ // packages/workit-core/src/hooks/handle.ts
27425
27431
  var offered = new Set;
27426
27432
  var CLAUDE_JUDGES = new Set(["workit:verifier", "workit:reviewer"]);
27427
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/hosts/claude-code.ts
27433
+ // packages/workit-core/src/hooks/hosts/claude-code.ts
27428
27434
  var SOURCES = new Set(["startup", "resume", "clear", "compact", "fork"]);
27429
27435
  var SHELL_TOOLS = new Set(["Bash", "PowerShell"]);
27430
27436
  var CONTEXT_EVENTS = new Set(["SessionStart", "UserPromptSubmit", "SubagentStart"]);
27431
27437
 
27432
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/hosts/codex.ts
27438
+ // packages/workit-core/src/hooks/hosts/codex.ts
27433
27439
  function detectCodexSurface(env) {
27434
27440
  return env.CODEX_INTERNAL_ORIGINATOR_OVERRIDE === "Codex Desktop" || Boolean(env.CODEX_ELECTRON_RESOURCES_PATH) ? "codex_desktop" : "codex_cli";
27435
27441
  }
@@ -27534,10 +27540,10 @@ var codexDescriptor = (host) => ({ ...CODEX_DESCRIPTOR, host });
27534
27540
  var SHELL_TOOLS2 = new Set(["bash", "unified-exec"]);
27535
27541
  var SOURCES2 = new Set(["startup", "resume", "clear", "compact"]);
27536
27542
 
27537
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/hosts/cursor.ts
27543
+ // packages/workit-core/src/hooks/hosts/cursor.ts
27538
27544
  var BLOCKING = new Set(["preToolUse", "beforeShellExecution", "subagentStart"]);
27539
27545
 
27540
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/run.ts
27546
+ // packages/workit-core/src/hooks/run.ts
27541
27547
  if (false) {}
27542
27548
  // packages/workit-codex/hooks/workit-hook.ts
27543
27549
  var codexCapabilities = (host, availability = {}) => capabilitiesFor(codexDescriptor(host), {
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from "node:module";
3
3
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
4
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/descriptor.ts
4
+ // packages/workit-core/src/hooks/descriptor.ts
5
5
  var support = (descriptor, axis) => {
6
6
  if (axis.startsWith("event:"))
7
7
  return descriptor.events[axis.slice("event:".length)].support;
@@ -25,10 +25,10 @@ var capabilitiesFor = (descriptor, observed = {}) => descriptor.capabilities.map
25
25
  refs: rule.refs.map((handle) => ({ kind: "host", host: descriptor.host, handle }))
26
26
  };
27
27
  });
28
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/context.ts
28
+ // packages/workit-core/src/hooks/context.ts
29
29
  import path15 from "node:path";
30
30
 
31
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/methods.ts
31
+ // packages/workit-core/src/core/methods.ts
32
32
  var METHODS = {
33
33
  "workit-shape": { dimensions: ["challenge", "decisions", "artifacts", "continuity"] },
34
34
  "workit-bdd": { dimensions: ["testing"] },
@@ -136,7 +136,7 @@ Skills: load the skill, never act from memory of it (slash aliases /wk-<name>).
136
136
  - architecture, deepen modules (user-invoked; offer it): workit-architecture
137
137
  `.trim();
138
138
 
139
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-contract.ts
139
+ // packages/workit-core/src/core/task-contract.ts
140
140
  import { createHash, randomUUID } from "node:crypto";
141
141
 
142
142
  // node_modules/zod/v4/core/util.js
@@ -7650,7 +7650,7 @@ function refine(fn, _params = {}) {
7650
7650
  function superRefine(fn, params) {
7651
7651
  return _superRefine(fn, params);
7652
7652
  }
7653
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-contract.ts
7653
+ // packages/workit-core/src/core/task-contract.ts
7654
7654
  var SCHEMA_VERSION = 1;
7655
7655
  var POLICY_VERSION = "1.0.0";
7656
7656
  var OPERATION_FAMILIES = [
@@ -8506,13 +8506,13 @@ function requirementId(input) {
8506
8506
  });
8507
8507
  }
8508
8508
 
8509
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-evaluation.ts
8509
+ // packages/workit-core/src/core/task-evaluation.ts
8510
8510
  import { createHash as createHash7 } from "node:crypto";
8511
8511
  import * as fs11 from "node:fs";
8512
8512
  import { spawnSync as spawnSync6 } from "node:child_process";
8513
8513
  import path11 from "node:path";
8514
8514
 
8515
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/check-config.ts
8515
+ // packages/workit-core/src/check-config.ts
8516
8516
  import { spawnSync } from "node:child_process";
8517
8517
  import fs from "node:fs";
8518
8518
  import path from "node:path";
@@ -8717,7 +8717,7 @@ function checkCommand(args, version, onPath = workitAvailable()) {
8717
8717
  return onPath ? `workit check ${args}` : `npx -y @brainervirus/workit-cli@${version} check ${args}`;
8718
8718
  }
8719
8719
 
8720
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/git/rev.ts
8720
+ // packages/workit-core/src/git/rev.ts
8721
8721
  import { spawnSync as spawnSync2 } from "node:child_process";
8722
8722
  import { createHash as createHash2 } from "node:crypto";
8723
8723
  import fs2 from "node:fs";
@@ -8869,7 +8869,7 @@ function currentBranch(cwd) {
8869
8869
  return line(git2(cwd, ["symbolic-ref", "--short", "-q", "HEAD"]));
8870
8870
  }
8871
8871
 
8872
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-store.ts
8872
+ // packages/workit-core/src/core/task-store.ts
8873
8873
  import { createHash as createHash5, randomUUID as randomUUID3 } from "node:crypto";
8874
8874
  import * as fs9 from "node:fs";
8875
8875
  import path8 from "node:path";
@@ -9475,7 +9475,7 @@ function acquireFileLockSync(targetPath, options) {
9475
9475
  }
9476
9476
  }
9477
9477
  }
9478
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/package-root.ts
9478
+ // packages/workit-core/src/core/package-root.ts
9479
9479
  import { existsSync } from "node:fs";
9480
9480
  import path5 from "node:path";
9481
9481
  import { fileURLToPath } from "node:url";
@@ -9489,12 +9489,12 @@ var packageRoot = () => {
9489
9489
  }
9490
9490
  };
9491
9491
 
9492
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/store-lock.ts
9492
+ // packages/workit-core/src/core/store-lock.ts
9493
9493
  import { spawnSync as spawnSync4 } from "node:child_process";
9494
9494
  import fs7 from "node:fs";
9495
9495
  import { hostname } from "node:os";
9496
9496
 
9497
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/store/paths.ts
9497
+ // packages/workit-core/src/store/paths.ts
9498
9498
  import { spawnSync as spawnSync3 } from "node:child_process";
9499
9499
  import { createHash as createHash3 } from "node:crypto";
9500
9500
  import fs6 from "node:fs";
@@ -9774,7 +9774,7 @@ var checkoutSlug = (root) => {
9774
9774
  return `${base}-${shortHash(canonical)}`;
9775
9775
  };
9776
9776
 
9777
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/store-lock.ts
9777
+ // packages/workit-core/src/core/store-lock.ts
9778
9778
  var metadataLockSchema = object({
9779
9779
  pid: number2().int().nonnegative().safe(),
9780
9780
  processStart: string2().nullable(),
@@ -9905,7 +9905,7 @@ var clearAbandonedReclaimGuard = (lockPath, nowMs = Date.now()) => {
9905
9905
  }
9906
9906
  };
9907
9907
 
9908
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/store/event-log.ts
9908
+ // packages/workit-core/src/store/event-log.ts
9909
9909
  import { randomUUID as randomUUID2 } from "node:crypto";
9910
9910
  import fs8 from "node:fs";
9911
9911
  import path7 from "node:path";
@@ -10065,7 +10065,7 @@ var retryTransient = (run) => {
10065
10065
  };
10066
10066
  var renameWithRetry = (from, to) => retryTransient(() => fs8.renameSync(from, to));
10067
10067
 
10068
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/store/patch.ts
10068
+ // packages/workit-core/src/store/patch.ts
10069
10069
  var isPlainObject2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
10070
10070
  var equal = (left, right) => {
10071
10071
  if (left === right)
@@ -10175,7 +10175,7 @@ var isPatch = (value) => Array.isArray(value) && value.every((op) => {
10175
10175
  return false;
10176
10176
  });
10177
10177
 
10178
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/store/reduce.ts
10178
+ // packages/workit-core/src/store/reduce.ts
10179
10179
  import { createHash as createHash4 } from "node:crypto";
10180
10180
  var OPENING_TYPES = new Set([
10181
10181
  "task.opened",
@@ -10306,7 +10306,7 @@ function eventType(before, after) {
10306
10306
  return "task.updated";
10307
10307
  }
10308
10308
 
10309
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/store/notes.ts
10309
+ // packages/workit-core/src/store/notes.ts
10310
10310
  var SLOT = Symbol.for("workit.migrationReporter");
10311
10311
  var reportMigration = (report) => {
10312
10312
  try {
@@ -10317,7 +10317,7 @@ var reportMigration = (report) => {
10317
10317
  };
10318
10318
  var migrationReporterInstalled = () => typeof globalThis[SLOT] === "function";
10319
10319
 
10320
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-store.ts
10320
+ // packages/workit-core/src/core/task-store.ts
10321
10321
  var MIGRATION_PENDING = "workit migration pending";
10322
10322
  var STORE_FORMAT = 3;
10323
10323
  var STORE_MIN_RUNTIME = "3.0.0";
@@ -11954,11 +11954,11 @@ class TaskStore {
11954
11954
  }
11955
11955
  }
11956
11956
 
11957
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/policy/derive.ts
11957
+ // packages/workit-core/src/core/policy/derive.ts
11958
11958
  import { existsSync as existsSync3 } from "node:fs";
11959
11959
  import path10 from "node:path";
11960
11960
 
11961
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/ledger.ts
11961
+ // packages/workit-core/src/ledger.ts
11962
11962
  import { spawnSync as spawnSync5 } from "node:child_process";
11963
11963
  import { createHash as createHash6, randomBytes as randomBytes2 } from "node:crypto";
11964
11964
  import fs10 from "node:fs";
@@ -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,9 +12313,9 @@ 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
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/policy/derive.ts
12318
+ // packages/workit-core/src/core/policy/derive.ts
12313
12319
  var RULES = {
12314
12320
  test: "check:test",
12315
12321
  self: "verdict:self",
@@ -12508,7 +12514,7 @@ function writeBlockers(task, root) {
12508
12514
  });
12509
12515
  }
12510
12516
 
12511
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-evaluation.ts
12517
+ // packages/workit-core/src/core/task-evaluation.ts
12512
12518
  var digestBytes = (value) => createHash7("sha256").update(value).digest("hex");
12513
12519
  var inside = (root, candidate) => candidate === root || candidate.startsWith(`${root}${path11.sep}`);
12514
12520
  var relative = (root, candidate) => path11.relative(root, candidate).split(path11.sep).join("/") || ".";
@@ -13174,10 +13180,10 @@ function evaluateClosure(requestedOutcome, view) {
13174
13180
  });
13175
13181
  }
13176
13182
 
13177
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-engine.ts
13183
+ // packages/workit-core/src/core/task-engine.ts
13178
13184
  import { realpathSync as realpathSync4 } from "node:fs";
13179
13185
 
13180
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/policy-resolver.ts
13186
+ // packages/workit-core/src/core/policy-resolver.ts
13181
13187
  function resolvePolicy(input) {
13182
13188
  const ids = input.constraints.map((constraint) => constraint.id);
13183
13189
  if (new Set(ids).size !== ids.length)
@@ -13233,7 +13239,7 @@ function diffPolicy(previous, next, reason, now) {
13233
13239
  return parsed.data;
13234
13240
  }
13235
13241
 
13236
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/operation-input.ts
13242
+ // packages/workit-core/src/core/operation-input.ts
13237
13243
  var str2 = (d, values) => ({
13238
13244
  type: "string",
13239
13245
  ...values ? { enum: values } : {},
@@ -13579,7 +13585,7 @@ function normalizeOperationInput(family, input, host) {
13579
13585
  return request;
13580
13586
  }
13581
13587
 
13582
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/policy/judgment.ts
13588
+ // packages/workit-core/src/core/policy/judgment.ts
13583
13589
  var isObject6 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
13584
13590
  var squash = (key) => key.toLowerCase().replace(/[_-]/g, "");
13585
13591
  var ALIASES = {
@@ -13703,11 +13709,11 @@ function normalizeJudgment(raw, previous) {
13703
13709
  return success(null, null, { judgment: parsed.data, ignored, legacy });
13704
13710
  }
13705
13711
 
13706
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/autonomy.ts
13712
+ // packages/workit-core/src/autonomy.ts
13707
13713
  import os3 from "node:os";
13708
13714
  import path14 from "node:path";
13709
13715
 
13710
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/config.ts
13716
+ // packages/workit-core/src/core/config.ts
13711
13717
  import {
13712
13718
  copyFileSync as copyFileSync2,
13713
13719
  cpSync as cpSync2,
@@ -13720,7 +13726,7 @@ import {
13720
13726
  import os2 from "node:os";
13721
13727
  import path12 from "node:path";
13722
13728
 
13723
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/boundary.ts
13729
+ // packages/workit-core/src/core/boundary.ts
13724
13730
  var EVENT = {
13725
13731
  initialization: "initialization",
13726
13732
  provenance: "provenance",
@@ -13741,7 +13747,7 @@ var errorDetail = (err) => {
13741
13747
  return { error_name: "unknown", error: String(err) };
13742
13748
  };
13743
13749
 
13744
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/config.ts
13750
+ // packages/workit-core/src/core/config.ts
13745
13751
  var diagnosticLogger;
13746
13752
  var PRESETS = {
13747
13753
  gitflow: {
@@ -13903,7 +13909,7 @@ var resolveCommitPolicy = (config, workspace) => {
13903
13909
  return config.commitPolicy ?? { preset: "conventional" };
13904
13910
  };
13905
13911
 
13906
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/workspaces.ts
13912
+ // packages/workit-core/src/core/workspaces.ts
13907
13913
  import { createHash as createHash8 } from "node:crypto";
13908
13914
  import { readFileSync as readFileSync4, realpathSync as realpathSync3 } from "node:fs";
13909
13915
  import path13 from "node:path";
@@ -14303,7 +14309,7 @@ var resolveRuntimeWorkspacePolicy = (cwd, kind, requestedProfile) => {
14303
14309
  };
14304
14310
  };
14305
14311
 
14306
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/autonomy.ts
14312
+ // packages/workit-core/src/autonomy.ts
14307
14313
  var accountHome = () => {
14308
14314
  try {
14309
14315
  return os3.userInfo().homedir;
@@ -14438,12 +14444,12 @@ function resolveAutonomy(cwd) {
14438
14444
  var suggested = (kind) => kind === "merge" ? "verified" : "true";
14439
14445
  var grantHint = (workspace, kind) => `ask the user to run, in their own terminal: workit grant set ${workspace ?? "<workspace>"} ${kind}=${suggested(kind)}`;
14440
14446
 
14441
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/workers.ts
14447
+ // packages/workit-core/src/core/workers.ts
14442
14448
  var UNCERTAIN_WORKER_STATES = ["dispatching", "running", "cancelling", "unknown"];
14443
14449
  var isUncertainWorker = (state) => UNCERTAIN_WORKER_STATES.includes(state);
14444
14450
  var workerBlocksTransition = (transition, state) => transition === "pause" ? false : isUncertainWorker(state);
14445
14451
 
14446
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-context.ts
14452
+ // packages/workit-core/src/core/task-context.ts
14447
14453
  function reconcileResume(view, observations = []) {
14448
14454
  if (observations.length > 0)
14449
14455
  return failure2("permission_denied", "worker observations require native host verification");
@@ -14558,7 +14564,7 @@ var exportDigest = (bundle) => sha256({
14558
14564
  task: bundle.task
14559
14565
  });
14560
14566
 
14561
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-engine.ts
14567
+ // packages/workit-core/src/core/task-engine.ts
14562
14568
  var workspaceVerification = (root) => {
14563
14569
  try {
14564
14570
  return resolveAutonomy(root).verification;
@@ -16144,7 +16150,7 @@ class WorkitCore {
16144
16150
  }
16145
16151
  }
16146
16152
 
16147
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/context.ts
16153
+ // packages/workit-core/src/hooks/context.ts
16148
16154
  var MIGRATION_PENDING_NOTE = "workit migration pending — run `workit task status`";
16149
16155
  var migrationPending = (result) => !result.ok && result.code === "needs_input" && (result.error ?? "").startsWith(MIGRATION_PENDING);
16150
16156
  var boundTo = (entry, session) => entry.sessions.some((item) => item.host === session.host && item.handle === session.handle);
@@ -16291,10 +16297,10 @@ var turnContextText = (input, descriptor) => {
16291
16297
  return null;
16292
16298
  }
16293
16299
  };
16294
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/branch.ts
16300
+ // packages/workit-core/src/core/branch.ts
16295
16301
  import { createHash as createHash9 } from "node:crypto";
16296
16302
 
16297
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/release-tracks.ts
16303
+ // packages/workit-core/src/core/release-tracks.ts
16298
16304
  class ReleaseTrackError extends Error {
16299
16305
  }
16300
16306
  var KNOWN_FIELDS = new Set([
@@ -16433,7 +16439,7 @@ function workspaceReleaseTracks(cwd) {
16433
16439
  }
16434
16440
  var memo3 = new Map;
16435
16441
 
16436
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/branch.ts
16442
+ // packages/workit-core/src/core/branch.ts
16437
16443
  var withReleaseTracks = (workspaceRoot, policy) => {
16438
16444
  const read = workspaceReleaseTracks(workspaceRoot);
16439
16445
  if (read.error)
@@ -16526,7 +16532,7 @@ var validateBranchNameFor = (workspaceRoot, name) => {
16526
16532
  }
16527
16533
  };
16528
16534
 
16529
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/route-intent.ts
16535
+ // packages/workit-core/src/core/route-intent.ts
16530
16536
  var shellBranchTarget = (command) => {
16531
16537
  if (!command.trim() || /[\r\n;&|<>`'"$()\\*?{}~!#]/u.test(command) || command.includes("[") || command.includes("]"))
16532
16538
  return null;
@@ -16542,12 +16548,12 @@ var shellBranchPolicyViolation = (root, command) => {
16542
16548
  return target === null ? null : validateBranchNameFor(root, target);
16543
16549
  };
16544
16550
 
16545
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/policy.ts
16551
+ // packages/workit-core/src/hooks/policy.ts
16546
16552
  var shellPolicy = (cwd, command) => {
16547
16553
  const policy = shellBranchPolicyViolation(cwd, command);
16548
16554
  return policy && !policy.ok ? { kind: "deny", reason: `branch_policy_denied: ${policy.error}`, unblock: null } : { kind: "none" };
16549
16555
  };
16550
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/write-gate.ts
16556
+ // packages/workit-core/src/hooks/write-gate.ts
16551
16557
  import { realpathSync as realpathSync5 } from "node:fs";
16552
16558
  import path16 from "node:path";
16553
16559
  var NONE2 = { kind: "none" };
@@ -16808,7 +16814,7 @@ function writeGate(cwd, paths) {
16808
16814
  return NONE2;
16809
16815
  }
16810
16816
  }
16811
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/hosts/fields.ts
16817
+ // packages/workit-core/src/hooks/hosts/fields.ts
16812
16818
  import { existsSync as existsSync6, realpathSync as realpathSync6, statSync as statSync2 } from "node:fs";
16813
16819
  import path17 from "node:path";
16814
16820
  var isRecord4 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
@@ -16876,7 +16882,7 @@ var writePaths = (input) => {
16876
16882
  paths.push(match[1].trim());
16877
16883
  return [...new Set(paths)];
16878
16884
  };
16879
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/handle.ts
16885
+ // packages/workit-core/src/hooks/handle.ts
16880
16886
  var usable2 = (value) => value === "native" || value === "partial";
16881
16887
  var NONE3 = { kind: "none" };
16882
16888
  var offered = new Set;
@@ -16972,7 +16978,7 @@ var dispatchHook = (adapter, raw, env = process.env) => {
16972
16978
  };
16973
16979
  }
16974
16980
  };
16975
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/hosts/claude-code.ts
16981
+ // packages/workit-core/src/hooks/hosts/claude-code.ts
16976
16982
  var CLAUDE_CODE_DESCRIPTOR = {
16977
16983
  host: "claude_code",
16978
16984
  label: "Claude Code",
@@ -17215,7 +17221,7 @@ var claudeCodeAdapter = {
17215
17221
  render
17216
17222
  };
17217
17223
 
17218
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/hosts/codex.ts
17224
+ // packages/workit-core/src/hooks/hosts/codex.ts
17219
17225
  function detectCodexSurface(env) {
17220
17226
  return env.CODEX_INTERNAL_ORIGINATOR_OVERRIDE === "Codex Desktop" || Boolean(env.CODEX_ELECTRON_RESOURCES_PATH) ? "codex_desktop" : "codex_cli";
17221
17227
  }
@@ -17444,7 +17450,7 @@ var codexAdapter = {
17444
17450
  addendum: (input) => `<workit-codex-mutations>Codex MCP is read-only: unattested callers cannot mutate. Run workit verbs with the workit CLI on the shell (node_modules/.bin/workit, or npx -y @brainervirus/workit-cli): check, git branch|commit|push, pr, ci, stack, ledger, handoff; task-family mutations take --json${input.session.id ? ` --actor ${input.session.id}` : ""}. A verifier or reviewer records workit ledger verdict under a session the lead assigns (WORKIT_SESSION_ID=<lead>-v<n>), never the author's. Merge and release need a workspace grant (workit grant show); a question answer is not host permission.</workit-codex-mutations>`
17445
17451
  };
17446
17452
 
17447
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/hosts/cursor.ts
17453
+ // packages/workit-core/src/hooks/hosts/cursor.ts
17448
17454
  import path18 from "node:path";
17449
17455
  var undocumented2 = { support: "undocumented", native: null };
17450
17456
  var none = { support: "none", native: null };
@@ -17688,7 +17694,7 @@ var cursorAdapter = {
17688
17694
  render: render3
17689
17695
  };
17690
17696
 
17691
- // packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/run.ts
17697
+ // packages/workit-core/src/hooks/run.ts
17692
17698
  var HOOK_ADAPTERS = {
17693
17699
  claude_code: claudeCodeAdapter,
17694
17700
  codex_cli: codexAdapter,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainervirus/workit-codex",
3
- "version": "8.0.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": "^8.0.0",
42
- "@brainervirus/workit-mcp": "^8.0.0"
41
+ "@brainervirus/workit-core": "^8.0.1",
42
+ "@brainervirus/workit-mcp": "^8.0.1"
43
43
  },
44
44
  "engines": {
45
45
  "node": ">=24"