@workit-dev/codex 2.23.2 → 2.25.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.25.0",
4
4
  "description": "Adaptive engineering workflow rails for Codex",
5
5
  "author": {
6
6
  "name": "BrainerVirus"
@@ -14836,6 +14836,7 @@ var workspaceConfigSchema = looseObject({
14836
14836
  cleanup: described(optional(unknown()), "What happens when work finishes: `auto` (default) removes the delivered branch's clean Workit worktree and local branch, switches a clean checkout on it back to the trunk, and stops the processes registered inside them; `keep` removes and stops nothing. A value Workit does not know reads as `keep`."),
14837
14837
  feedback: described(optional(unknown()), '`workit feedback` for this workspace: `off` hides its contract line and makes the verb refuse; `{ "account": "<login>" }` names the GitHub login it posts with; workspaces inside this one inherit it.'),
14838
14838
  liveSessionGuard: described(optional(boolean2()), "Whether the live-session guard denies edits in a checkout another live agent session owns (default true)."),
14839
+ shared: described(optional(boolean2()), "Whether this workspace's repos are shared with a team that must not see Workit named (default false): `workit pr create` and `workit pr edit` then warn, never block, when the PR title, body or a new doc names it."),
14839
14840
  fanout: described(optional(looseObject({
14840
14841
  tierModels: described(optional(unknown()), "The model per slice TIER (mundane, standard, hard), as one name or per host."),
14841
14842
  deps: described(optional(unknown()), "How `workit fanout worktree create` gives a slice worktree node_modules: `install` (default: its own frozen install of its lockfile) or `link` (links into the main checkout's installed packages, for a repo too slow to install per slice). `--deps` overrides it."),
@@ -14845,6 +14846,7 @@ var workspaceConfigSchema = looseObject({
14845
14846
  resources: described(optional(unknown()), "Heavy-check limits on this machine: slots, scope, heavy, light, memoryMax, cpuQuota, wait."),
14846
14847
  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
14848
  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."),
14849
+ 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
14850
  autonomy: described(optional(looseObject(Object.fromEntries(["push", "pr", "merge", "release", "rerun"].map((kind) => [
14849
14851
  kind,
14850
14852
  described(optional(union([boolean2(), literal("verified")])), `The ${kind} grant: true, false, or "verified" (only after a verdict).`)
@@ -21417,6 +21419,7 @@ var WORD2 = /[\w./:@=+,-]+/uy;
21417
21419
  var QUOTED = /"[^"$`\\]*"/uy;
21418
21420
  var COMMAND = /^[\w.+][\w./+-]*$/u;
21419
21421
  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(" "));
21422
+ var EFFECTFUL = /^(?:curl|wget|npx|bunx|gh|dlx|push|publish|deploy)$/iu;
21420
21423
  var FALLBACK = new Set(["echo", "true"]);
21421
21424
  var FORM = 'more than && <command> or && (<command> || echo "<text>")';
21422
21425
  var OUTSIDE = '(outside plain words and "double-quoted text")';
@@ -21477,9 +21480,11 @@ function masking(before, appended) {
21477
21480
  return FORM;
21478
21481
  if (names ? !names.has(name.word) : SHELL_STATE.has(name.word.toLowerCase()))
21479
21482
  return names ? FORM : `the shell command ${name.word}`;
21480
- index += 1;
21481
- for (let token = list[index];token && !("op" in token); token = list[index])
21483
+ for (let token = list[index];token && !("op" in token); token = list[index]) {
21484
+ if ("word" in token && EFFECTFUL.test(token.word))
21485
+ return `the effectful command ${token.word}`;
21482
21486
  index += 1;
21487
+ }
21483
21488
  return null;
21484
21489
  };
21485
21490
  while (index < list.length) {
@@ -24489,6 +24494,7 @@ var ENTRY_KEYS = [
24489
24494
  "glob",
24490
24495
  "remotes",
24491
24496
  "externalRepos",
24497
+ "additiveRiskPaths",
24492
24498
  "vcs",
24493
24499
  "autonomy",
24494
24500
  "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 {
@@ -4183,6 +4183,7 @@ var workspaceConfigSchema = looseObject({
4183
4183
  cleanup: described(optional(unknown()), "What happens when work finishes: `auto` (default) removes the delivered branch's clean Workit worktree and local branch, switches a clean checkout on it back to the trunk, and stops the processes registered inside them; `keep` removes and stops nothing. A value Workit does not know reads as `keep`."),
4184
4184
  feedback: described(optional(unknown()), '`workit feedback` for this workspace: `off` hides its contract line and makes the verb refuse; `{ "account": "<login>" }` names the GitHub login it posts with; workspaces inside this one inherit it.'),
4185
4185
  liveSessionGuard: described(optional(boolean2()), "Whether the live-session guard denies edits in a checkout another live agent session owns (default true)."),
4186
+ shared: described(optional(boolean2()), "Whether this workspace's repos are shared with a team that must not see Workit named (default false): `workit pr create` and `workit pr edit` then warn, never block, when the PR title, body or a new doc names it."),
4186
4187
  fanout: described(optional(looseObject({
4187
4188
  tierModels: described(optional(unknown()), "The model per slice TIER (mundane, standard, hard), as one name or per host."),
4188
4189
  deps: described(optional(unknown()), "How `workit fanout worktree create` gives a slice worktree node_modules: `install` (default: its own frozen install of its lockfile) or `link` (links into the main checkout's installed packages, for a repo too slow to install per slice). `--deps` overrides it."),
@@ -4192,6 +4193,7 @@ var workspaceConfigSchema = looseObject({
4192
4193
  resources: described(optional(unknown()), "Heavy-check limits on this machine: slots, scope, heavy, light, memoryMax, cpuQuota, wait."),
4193
4194
  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
4195
  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."),
4196
+ 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
4197
  autonomy: described(optional(looseObject(Object.fromEntries(["push", "pr", "merge", "release", "rerun"].map((kind) => [
4196
4198
  kind,
4197
4199
  described(optional(union([boolean2(), literal("verified")])), `The ${kind} grant: true, false, or "verified" (only after a verdict).`)
@@ -10322,6 +10324,7 @@ var WORD2 = /[\w./:@=+,-]+/uy;
10322
10324
  var QUOTED = /"[^"$`\\]*"/uy;
10323
10325
  var COMMAND = /^[\w.+][\w./+-]*$/u;
10324
10326
  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(" "));
10327
+ var EFFECTFUL = /^(?:curl|wget|npx|bunx|gh|dlx|push|publish|deploy)$/iu;
10325
10328
  var FALLBACK = new Set(["echo", "true"]);
10326
10329
  var FORM = 'more than && <command> or && (<command> || echo "<text>")';
10327
10330
  var OUTSIDE = '(outside plain words and "double-quoted text")';
@@ -10382,9 +10385,11 @@ function masking(before, appended) {
10382
10385
  return FORM;
10383
10386
  if (names ? !names.has(name.word) : SHELL_STATE.has(name.word.toLowerCase()))
10384
10387
  return names ? FORM : `the shell command ${name.word}`;
10385
- index += 1;
10386
- for (let token = list[index];token && !("op" in token); token = list[index])
10388
+ for (let token = list[index];token && !("op" in token); token = list[index]) {
10389
+ if ("word" in token && EFFECTFUL.test(token.word))
10390
+ return `the effectful command ${token.word}`;
10387
10391
  index += 1;
10392
+ }
10388
10393
  return null;
10389
10394
  };
10390
10395
  while (index < list.length) {
@@ -13292,6 +13297,7 @@ var ENTRY_KEYS = [
13292
13297
  "glob",
13293
13298
  "remotes",
13294
13299
  "externalRepos",
13300
+ "additiveRiskPaths",
13295
13301
  "vcs",
13296
13302
  "autonomy",
13297
13303
  "autoApprove",
@@ -17852,7 +17858,7 @@ var WRAPPERS3 = {
17852
17858
  };
17853
17859
  var INTERPRETERS = /^(?:python[\d.]*|node|bun|deno|ruby|perl|php|tsx|ts-node)$/;
17854
17860
  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)));
17861
+ var isRoot = (file) => isConfigDir(file) || /^(?:issued[^\\/]*|approvals|verdicts)$/.test(path30.relative(canonical5(resolveStateDir()), canonical5(file)));
17856
17862
  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
17863
  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
17864
  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 +18945,7 @@ var globbed = (cwd, target, state, configs) => {
18939
18945
  };
18940
18946
  let roots = [];
18941
18947
  try {
18942
- roots = readdirSync3(state).filter((name) => /^(?:issued|approvals$)/.test(name));
18948
+ roots = readdirSync3(state).filter((name) => /^(?:issued|approvals$|verdicts$)/.test(name));
18943
18949
  } catch {}
18944
18950
  return [
18945
18951
  ...roots.map((name) => path30.join(state, name)).filter((root) => hit(root, true)),
@@ -18964,8 +18970,10 @@ var guardedInodes = (state, configs) => {
18964
18970
  for (const name of CONFIG_FILES)
18965
18971
  add(path30.join(dir, name), "grants");
18966
18972
  for (const name of readdirSync3(state))
18967
- if (/^(?:issued|approvals$)/.test(name))
18968
- add(path30.join(state, name), name === "approvals" ? "approvals" : "issued");
18973
+ if (/^(?:issued|approvals$|verdicts$)/.test(name))
18974
+ add(path30.join(state, name), name === "approvals" ? "approvals" : name === "verdicts" ? "ledger" : "issued");
18975
+ for (const slug of readdirSync3(path30.join(state, "folders")))
18976
+ add(path30.join(state, "folders", slug, "ledger"), "ledger");
18969
18977
  } catch {}
18970
18978
  return seen;
18971
18979
  };
@@ -18992,7 +19000,7 @@ var registryTarget = (cwd, targets) => {
18992
19000
  const viaGlob = glob === undefined ? null : registryTarget(cwd, [glob]);
18993
19001
  if (viaGlob)
18994
19002
  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);
19003
+ 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
19004
  if (registry)
18997
19005
  return { file: target, registry };
18998
19006
  }
@@ -19007,9 +19015,12 @@ var partsUnder = (dir, cwd, target, platform, real) => {
19007
19015
  return relative.startsWith("..") || p.isAbsolute(relative) ? null : relative.split(p.sep);
19008
19016
  };
19009
19017
  var underRegistry = (state, cwd, target, platform = process.platform, real = (file) => file) => {
19010
- const first = partsUnder(state, cwd, target, platform, real)?.[0];
19018
+ const parts = partsUnder(state, cwd, target, platform, real) ?? [];
19019
+ const first = parts[0];
19011
19020
  if (first?.startsWith("issued"))
19012
19021
  return "issued";
19022
+ if (first === "verdicts" || first === "folders" && parts[2] === "ledger")
19023
+ return "ledger";
19013
19024
  return first === "approvals" ? "approvals" : null;
19014
19025
  };
19015
19026
  var underConfig = (dir, cwd, target, platform = process.platform, real = (file) => file) => {
@@ -19023,7 +19034,9 @@ var unquotedWindowsRegistry = (command, platform = process.platform) => {
19023
19034
  const text = flat(command);
19024
19035
  const state = flat(resolveStateDir());
19025
19036
  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;
19037
+ const folders = `${state}/folders/`;
19038
+ 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));
19039
+ const registry = text.includes(`${state}/issued`) ? "issued" : text.includes(`${state}/approvals`) ? "approvals" : ledger(text) ? "ledger" : configs.some((dir) => text.includes(dir)) ? "grants" : null;
19027
19040
  if (!registry)
19028
19041
  return null;
19029
19042
  const spans = command.replace(/[^\s'"|;&<>()]*\\[^\s'"|;&<>()]*/g, (word) => word.replaceAll("\\", "/"));
@@ -19034,7 +19047,7 @@ var unquotedWindowsRegistry = (command, platform = process.platform) => {
19034
19047
  ];
19035
19048
  const named = (target) => moved.some((dir) => {
19036
19049
  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}`);
19050
+ 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
19051
  });
19039
19052
  return writes.writes && (writes.targets === null || writes.targets.some(named)) ? registry : null;
19040
19053
  };
@@ -19054,6 +19067,11 @@ var REGISTRY_DENY = {
19054
19067
  what: "Workit's host-approval state",
19055
19068
  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
19069
  },
19070
+ ledger: {
19071
+ label: "ledger guard",
19072
+ what: "a Workit ledger",
19073
+ unblock: "Only the workit CLI writes it (`workit ledger …`); never edit it by hand."
19074
+ },
19057
19075
  grants: {
19058
19076
  label: "config guard",
19059
19077
  what: "the user's Workit config (grants, roles, youtrack.writes)",
@@ -19345,6 +19363,8 @@ var unverified = (cwd, branch, all, descriptor, verification, head) => {
19345
19363
  const check = checkVerdicts(cwd, branch, all);
19346
19364
  if (check.accepted.accepted || check.accepted.reasons.includes("failing_verdict"))
19347
19365
  return null;
19366
+ if (all.some((row) => row.type === "pr.gate" && row.branch === branch && row.head === check.head))
19367
+ return null;
19348
19368
  const judgment = currentJudgment(cwd);
19349
19369
  const high = judgment?.riskTier === "high";
19350
19370
  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-bjjyhgz2.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.25.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.25.0",
45
+ "@workit-dev/mcp": "^2.25.0"
46
46
  },
47
47
  "engines": {
48
48
  "node": ">=24"