@workit-dev/codex 2.23.2 → 2.24.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "workit",
3
- "version": "2.23.2",
3
+ "version": "2.24.0",
4
4
  "description": "Adaptive engineering workflow rails for Codex",
5
5
  "author": {
6
6
  "name": "BrainerVirus"
@@ -14845,6 +14845,7 @@ var workspaceConfigSchema = looseObject({
14845
14845
  resources: described(optional(unknown()), "Heavy-check limits on this machine: slots, scope, heavy, light, memoryMax, cpuQuota, wait."),
14846
14846
  remotes: described(optional(array(nonBlank.check(refine((pattern) => remotePattern(pattern) !== null, "is not a remote URL (https://host/owner/repo, git@host:owner/repo, a path, or owner/*)")))), "Remote URLs this entry owns: a checkout pushing to or opening PRs on one never exceeds this entry's grants, wherever the folder is (`owner/*` claims a whole owner). Only the user changes it, in their own terminal."),
14847
14847
  externalRepos: described(optional(array(nonBlank.check(_regex(/^[\w-]+(?:\/\w[\w.-]*)*\/(?:\w[\w.-]*|\*)$/u, "is owner/name, group/project or owner/* on the checkout's forge host, without the host")))), "Repositories outside this workspace's own forge owners that `workit issue create|comment|close --repo` may write to: `owner/name`, or `owner/*` for a whole owner. Only the user changes it, in their own terminal."),
14848
+ additiveRiskPaths: described(optional(array(nonBlank)), "Risk-path globs whose purely additive edits follow the review lane of the rest of the diff. Only the user sets it; it counts only while sealed."),
14848
14849
  autonomy: described(optional(looseObject(Object.fromEntries(["push", "pr", "merge", "release", "rerun"].map((kind) => [
14849
14850
  kind,
14850
14851
  described(optional(union([boolean2(), literal("verified")])), `The ${kind} grant: true, false, or "verified" (only after a verdict).`)
@@ -21417,6 +21418,7 @@ var WORD2 = /[\w./:@=+,-]+/uy;
21417
21418
  var QUOTED = /"[^"$`\\]*"/uy;
21418
21419
  var COMMAND = /^[\w.+][\w./+-]*$/u;
21419
21420
  var SHELL_STATE = new Set(". alias bg bind break builtin call caller case cd command compgen complete compopt continue coproc declare dirs disown do done elif else enable esac eval exec exit export fc fg fi for function getopts goto hash help history if in jobs kill let local logout mapfile popd pushd read readarray readonly return select set shift shopt source suspend then time times trap type typeset ulimit umask unalias unset until wait while".split(" "));
21421
+ var EFFECTFUL = /^(?:curl|wget|npx|bunx|gh|dlx|push|publish|deploy)$/iu;
21420
21422
  var FALLBACK = new Set(["echo", "true"]);
21421
21423
  var FORM = 'more than && <command> or && (<command> || echo "<text>")';
21422
21424
  var OUTSIDE = '(outside plain words and "double-quoted text")';
@@ -21477,9 +21479,11 @@ function masking(before, appended) {
21477
21479
  return FORM;
21478
21480
  if (names ? !names.has(name.word) : SHELL_STATE.has(name.word.toLowerCase()))
21479
21481
  return names ? FORM : `the shell command ${name.word}`;
21480
- index += 1;
21481
- for (let token = list[index];token && !("op" in token); token = list[index])
21482
+ for (let token = list[index];token && !("op" in token); token = list[index]) {
21483
+ if ("word" in token && EFFECTFUL.test(token.word))
21484
+ return `the effectful command ${token.word}`;
21482
21485
  index += 1;
21486
+ }
21483
21487
  return null;
21484
21488
  };
21485
21489
  while (index < list.length) {
@@ -24489,6 +24493,7 @@ var ENTRY_KEYS = [
24489
24493
  "glob",
24490
24494
  "remotes",
24491
24495
  "externalRepos",
24496
+ "additiveRiskPaths",
24492
24497
  "vcs",
24493
24498
  "autonomy",
24494
24499
  "autoApprove",
@@ -76,7 +76,7 @@ var reachTests = (dirs) => {
76
76
  };
77
77
  const state = canon(dirs.state);
78
78
  const configs = dirs.configs.map(canon);
79
- const at = (file) => file === LOST || configs.some((dir) => within(dir, file)) || within(state, file) && /^(?:issued[^\\/]*|approvals)(?:[\\/]|$)/.test(path.relative(state, file));
79
+ const at = (file) => file === LOST || configs.some((dir) => within(dir, file)) || within(state, file) && /^(?:issued[^\\/]*|approvals|verdicts|folders[\\/][^\\/]+[\\/]ledger)(?:[\\/]|$)/.test(path.relative(state, file)) || /[\\/]\.git[\\/]workit[\\/]ledger(?:[\\/]|$)/.test(file);
80
80
  const above = (file) => within(file, state) || configs.some((dir) => within(file, dir));
81
81
  const linked = (file) => {
82
82
  try {
@@ -4192,6 +4192,7 @@ var workspaceConfigSchema = looseObject({
4192
4192
  resources: described(optional(unknown()), "Heavy-check limits on this machine: slots, scope, heavy, light, memoryMax, cpuQuota, wait."),
4193
4193
  remotes: described(optional(array(nonBlank.check(refine((pattern) => remotePattern(pattern) !== null, "is not a remote URL (https://host/owner/repo, git@host:owner/repo, a path, or owner/*)")))), "Remote URLs this entry owns: a checkout pushing to or opening PRs on one never exceeds this entry's grants, wherever the folder is (`owner/*` claims a whole owner). Only the user changes it, in their own terminal."),
4194
4194
  externalRepos: described(optional(array(nonBlank.check(_regex(/^[\w-]+(?:\/\w[\w.-]*)*\/(?:\w[\w.-]*|\*)$/u, "is owner/name, group/project or owner/* on the checkout's forge host, without the host")))), "Repositories outside this workspace's own forge owners that `workit issue create|comment|close --repo` may write to: `owner/name`, or `owner/*` for a whole owner. Only the user changes it, in their own terminal."),
4195
+ additiveRiskPaths: described(optional(array(nonBlank)), "Risk-path globs whose purely additive edits follow the review lane of the rest of the diff. Only the user sets it; it counts only while sealed."),
4195
4196
  autonomy: described(optional(looseObject(Object.fromEntries(["push", "pr", "merge", "release", "rerun"].map((kind) => [
4196
4197
  kind,
4197
4198
  described(optional(union([boolean2(), literal("verified")])), `The ${kind} grant: true, false, or "verified" (only after a verdict).`)
@@ -10322,6 +10323,7 @@ var WORD2 = /[\w./:@=+,-]+/uy;
10322
10323
  var QUOTED = /"[^"$`\\]*"/uy;
10323
10324
  var COMMAND = /^[\w.+][\w./+-]*$/u;
10324
10325
  var SHELL_STATE = new Set(". alias bg bind break builtin call caller case cd command compgen complete compopt continue coproc declare dirs disown do done elif else enable esac eval exec exit export fc fg fi for function getopts goto hash help history if in jobs kill let local logout mapfile popd pushd read readarray readonly return select set shift shopt source suspend then time times trap type typeset ulimit umask unalias unset until wait while".split(" "));
10326
+ var EFFECTFUL = /^(?:curl|wget|npx|bunx|gh|dlx|push|publish|deploy)$/iu;
10325
10327
  var FALLBACK = new Set(["echo", "true"]);
10326
10328
  var FORM = 'more than && <command> or && (<command> || echo "<text>")';
10327
10329
  var OUTSIDE = '(outside plain words and "double-quoted text")';
@@ -10382,9 +10384,11 @@ function masking(before, appended) {
10382
10384
  return FORM;
10383
10385
  if (names ? !names.has(name.word) : SHELL_STATE.has(name.word.toLowerCase()))
10384
10386
  return names ? FORM : `the shell command ${name.word}`;
10385
- index += 1;
10386
- for (let token = list[index];token && !("op" in token); token = list[index])
10387
+ for (let token = list[index];token && !("op" in token); token = list[index]) {
10388
+ if ("word" in token && EFFECTFUL.test(token.word))
10389
+ return `the effectful command ${token.word}`;
10387
10390
  index += 1;
10391
+ }
10388
10392
  return null;
10389
10393
  };
10390
10394
  while (index < list.length) {
@@ -13292,6 +13296,7 @@ var ENTRY_KEYS = [
13292
13296
  "glob",
13293
13297
  "remotes",
13294
13298
  "externalRepos",
13299
+ "additiveRiskPaths",
13295
13300
  "vcs",
13296
13301
  "autonomy",
13297
13302
  "autoApprove",
@@ -17852,7 +17857,7 @@ var WRAPPERS3 = {
17852
17857
  };
17853
17858
  var INTERPRETERS = /^(?:python[\d.]*|node|bun|deno|ruby|perl|php|tsx|ts-node)$/;
17854
17859
  var isConfigDir = (file) => configDirs().some((dir) => canonical5(dir) === canonical5(file));
17855
- var isRoot = (file) => isConfigDir(file) || /^(?:issued[^\\/]*|approvals)$/.test(path30.relative(canonical5(resolveStateDir()), canonical5(file)));
17860
+ var isRoot = (file) => isConfigDir(file) || /^(?:issued[^\\/]*|approvals|verdicts)$/.test(path30.relative(canonical5(resolveStateDir()), canonical5(file)));
17856
17861
  var READ_CALLS = /^(?:print|log|info|warn|error|debug|puts|readdir(?:Sync)?|listdir|scandir|iterdir|glob|l?stat(?:Sync)?|exists(?:Sync)?|isdir|isfile|is_dir|is_file|access(?:Sync)?|realpath(?:Sync)?|dirname|basename|relative|str|repr|len)$/;
17857
17862
  var MUTATING_CALLS = /^(?:renames?(?:Sync)?|move|copy(?:2|file|tree|File)?(?:Sync)?|cp(?:Sync)?|rm(?:tree|dir|Sync|dirSync)?|unlink(?:Sync)?|remove(?:dirs)?|mkdirs?(?:Sync)?|makedirs|mkdtemp(?:Sync)?|(?:sym|hard)?link(?:Sync|_to)?|write\w*|append\w*|truncate(?:Sync)?|ch(?:mod|own)(?:Sync)?|touch|open(?:Sync)?|dump|save|extractall|unpack_archive|put_contents|mv|FileUtils)$/;
17858
17863
  var SPAWNS = /subprocess|child_process|WriteStream|tempfile|sqlite|inplace|getattr|spawn|\bvm\b|Function\s*\(|FileIO|ZipFile|tarfile|shelve|FileHandler|filename\s*=|savefig|utime|ch(?:mod|own)|mkfifo|mknod|\.(?:delete|to_\w+)\s*\(|Path\b.*\.replace\(|Bun\.\$|O_(?:WR|RDW|CR|AP|TR)|(?:PYTHON|NODE_)\w*=|-r\b|--(?:require|import|[\w-]*loader)|\bos\.replace|\b(?:system|popen|exec\w*|fork|eval|shutil|(?:unlink|rename|remove)\w*)\b|\]\s*\(|\brequire\s*\(\s*(?!(['"])(?:(?![a-zA-Z]:)[\w@][^'"]*|[^'"]*\.json)\1)/;
@@ -18939,7 +18944,7 @@ var globbed = (cwd, target, state, configs) => {
18939
18944
  };
18940
18945
  let roots = [];
18941
18946
  try {
18942
- roots = readdirSync3(state).filter((name) => /^(?:issued|approvals$)/.test(name));
18947
+ roots = readdirSync3(state).filter((name) => /^(?:issued|approvals$|verdicts$)/.test(name));
18943
18948
  } catch {}
18944
18949
  return [
18945
18950
  ...roots.map((name) => path30.join(state, name)).filter((root) => hit(root, true)),
@@ -18964,8 +18969,10 @@ var guardedInodes = (state, configs) => {
18964
18969
  for (const name of CONFIG_FILES)
18965
18970
  add(path30.join(dir, name), "grants");
18966
18971
  for (const name of readdirSync3(state))
18967
- if (/^(?:issued|approvals$)/.test(name))
18968
- add(path30.join(state, name), name === "approvals" ? "approvals" : "issued");
18972
+ if (/^(?:issued|approvals$|verdicts$)/.test(name))
18973
+ add(path30.join(state, name), name === "approvals" ? "approvals" : name === "verdicts" ? "ledger" : "issued");
18974
+ for (const slug of readdirSync3(path30.join(state, "folders")))
18975
+ add(path30.join(state, "folders", slug, "ledger"), "ledger");
18969
18976
  } catch {}
18970
18977
  return seen;
18971
18978
  };
@@ -18992,7 +18999,7 @@ var registryTarget = (cwd, targets) => {
18992
18999
  const viaGlob = glob === undefined ? null : registryTarget(cwd, [glob]);
18993
19000
  if (viaGlob)
18994
19001
  return { file: target, registry: viaGlob.registry };
18995
- const registry = hardLinked(path30.resolve(cwd, file), state, configs, inodes) ?? underRegistry(state, cwd, file, process.platform, canonical5) ?? (configs.some((dir) => underConfig(dir, cwd, file, process.platform, canonical5)) ? "grants" : null);
19002
+ const registry = hardLinked(path30.resolve(cwd, file), state, configs, inodes) ?? underRegistry(state, cwd, file, process.platform, canonical5) ?? (/[\\/]\.git[\\/]workit[\\/]ledger(?:[\\/]|$)/.test(canonical5(path30.resolve(cwd, file))) ? "ledger" : null) ?? (configs.some((dir) => underConfig(dir, cwd, file, process.platform, canonical5)) ? "grants" : null);
18996
19003
  if (registry)
18997
19004
  return { file: target, registry };
18998
19005
  }
@@ -19007,9 +19014,12 @@ var partsUnder = (dir, cwd, target, platform, real) => {
19007
19014
  return relative.startsWith("..") || p.isAbsolute(relative) ? null : relative.split(p.sep);
19008
19015
  };
19009
19016
  var underRegistry = (state, cwd, target, platform = process.platform, real = (file) => file) => {
19010
- const first = partsUnder(state, cwd, target, platform, real)?.[0];
19017
+ const parts = partsUnder(state, cwd, target, platform, real) ?? [];
19018
+ const first = parts[0];
19011
19019
  if (first?.startsWith("issued"))
19012
19020
  return "issued";
19021
+ if (first === "verdicts" || first === "folders" && parts[2] === "ledger")
19022
+ return "ledger";
19013
19023
  return first === "approvals" ? "approvals" : null;
19014
19024
  };
19015
19025
  var underConfig = (dir, cwd, target, platform = process.platform, real = (file) => file) => {
@@ -19023,7 +19033,9 @@ var unquotedWindowsRegistry = (command, platform = process.platform) => {
19023
19033
  const text = flat(command);
19024
19034
  const state = flat(resolveStateDir());
19025
19035
  const configs = configDirs().map(flat);
19026
- const registry = text.includes(`${state}/issued`) ? "issued" : text.includes(`${state}/approvals`) ? "approvals" : configs.some((dir) => text.includes(dir)) ? "grants" : null;
19036
+ const folders = `${state}/folders/`;
19037
+ const ledger = (at) => at.includes(`${state}/verdicts`) || /\/\.git\/workit\/ledger(?:[/\s'"]|$)/.test(at) || at.split(folders).slice(1).some((rest) => /^[^/\s]+\/ledger(?:[/\s'"]|$)/.test(rest));
19038
+ const registry = text.includes(`${state}/issued`) ? "issued" : text.includes(`${state}/approvals`) ? "approvals" : ledger(text) ? "ledger" : configs.some((dir) => text.includes(dir)) ? "grants" : null;
19027
19039
  if (!registry)
19028
19040
  return null;
19029
19041
  const spans = command.replace(/[^\s'"|;&<>()]*\\[^\s'"|;&<>()]*/g, (word) => word.replaceAll("\\", "/"));
@@ -19034,7 +19046,7 @@ var unquotedWindowsRegistry = (command, platform = process.platform) => {
19034
19046
  ];
19035
19047
  const named = (target) => moved.some((dir) => {
19036
19048
  const at = flat(/^(?:[a-z]:)?\//i.test(target) ? target : dir + target).replace(/\/\.?\//g, "/");
19037
- return registry === "grants" ? configs.some((cfg) => [cfg, `${cfg}/`, ...CONFIG_FILES.map((name) => `${cfg}/${name}`)].includes(at)) : at.includes(`${state}/${registry}`);
19049
+ return registry === "grants" ? configs.some((cfg) => [cfg, `${cfg}/`, ...CONFIG_FILES.map((name) => `${cfg}/${name}`)].includes(at)) : registry === "ledger" ? ledger(at) : at.includes(`${state}/${registry}`);
19038
19050
  });
19039
19051
  return writes.writes && (writes.targets === null || writes.targets.some(named)) ? registry : null;
19040
19052
  };
@@ -19054,6 +19066,11 @@ var REGISTRY_DENY = {
19054
19066
  what: "Workit's host-approval state",
19055
19067
  unblock: "Approval requests and the user's yes are written only by Workit: run `workit approve <id>` as its own call so the host asks the user, or ask the user to run it in their own terminal; never edit the approvals registry by hand."
19056
19068
  },
19069
+ ledger: {
19070
+ label: "ledger guard",
19071
+ what: "a Workit ledger",
19072
+ unblock: "Only the workit CLI writes it (`workit ledger …`); never edit it by hand."
19073
+ },
19057
19074
  grants: {
19058
19075
  label: "config guard",
19059
19076
  what: "the user's Workit config (grants, roles, youtrack.writes)",
@@ -19345,6 +19362,8 @@ var unverified = (cwd, branch, all, descriptor, verification, head) => {
19345
19362
  const check = checkVerdicts(cwd, branch, all);
19346
19363
  if (check.accepted.accepted || check.accepted.reasons.includes("failing_verdict"))
19347
19364
  return null;
19365
+ if (all.some((row) => row.type === "pr.gate" && row.branch === branch && row.head === check.head))
19366
+ return null;
19348
19367
  const judgment = currentJudgment(cwd);
19349
19368
  const high = judgment?.riskTier === "high";
19350
19369
  let independent;
@@ -40,7 +40,7 @@ var { standingPending } = await import("./workit-hook-mk64s4fk.js");
40
40
  var { procNoticeFile } = await import("./workit-hook-dv9s0sjq.js");
41
41
  var { recordHookRun } = await import("./workit-hook-a7qmf2t8.js");
42
42
  var { observeHookBudget } = await import("./workit-hook-3g6cv3hd.js");
43
- var { hasTaskStore, mayReach } = await import("./workit-hook-v7vytjn0.js");
43
+ var { hasTaskStore, mayReach } = await import("./workit-hook-5ke74t8j.js");
44
44
  var YTRACK_WORD = /ytrack(?![\w/-]|\.(?!exe|cmd))/i;
45
45
  var namesYtrack = (text) => {
46
46
  const bare = text.replace(/['"\\]/g, "");
@@ -101,7 +101,7 @@ if (quiet) {
101
101
  `);
102
102
  } else {
103
103
  try {
104
- const { runCodexHook } = await import("./workit-hook-3rq2gw6g.js");
104
+ const { runCodexHook } = await import("./workit-hook-y3cw1pkt.js");
105
105
  await runCodexHook([payload]);
106
106
  } catch (error) {
107
107
  const { answerRuntimeFailure } = await import("./workit-hook-2j7nwxvz.js");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workit-dev/codex",
3
- "version": "2.23.2",
3
+ "version": "2.24.0",
4
4
  "private": false,
5
5
  "description": "Workit Codex CLI/desktop plugin — shared MCP transport, hooks, method skills, and verifier/reviewer/implementer agents",
6
6
  "keywords": [
@@ -41,8 +41,8 @@
41
41
  "build": "bun scripts/build.ts"
42
42
  },
43
43
  "devDependencies": {
44
- "@workit-dev/core": "^2.23.2",
45
- "@workit-dev/mcp": "^2.23.2"
44
+ "@workit-dev/core": "^2.24.0",
45
+ "@workit-dev/mcp": "^2.24.0"
46
46
  },
47
47
  "engines": {
48
48
  "node": ">=24"