@workit-dev/codex 2.16.1 → 2.16.2

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.16.1",
3
+ "version": "2.16.2",
4
4
  "description": "Adaptive engineering workflow rails for Codex",
5
5
  "author": {
6
6
  "name": "BrainerVirus"
@@ -6623,6 +6623,9 @@ function resolveRef(cwd, ref) {
6623
6623
  function originHeadRef(cwd) {
6624
6624
  return line(git(cwd, ["symbolic-ref", "-q", "--short", "refs/remotes/origin/HEAD"]));
6625
6625
  }
6626
+ function worktreeTop(cwd) {
6627
+ return gitDirs(cwd)?.top ?? null;
6628
+ }
6626
6629
  function ownChangeDrift(cwd, range) {
6627
6630
  const before = diffRaw(cwd, range.fromFork, range.from);
6628
6631
  const after = diffRaw(cwd, range.toFork, range.to);
@@ -13251,10 +13254,12 @@ function judgeBranch(cwd) {
13251
13254
  const branch = currentBranch(cwd);
13252
13255
  return branch && !isProtectedTarget(cwd, branch) ? branch : null;
13253
13256
  }
13257
+ var shellQuote = (value) => /^[\w@%+=:,./-]+$/u.test(value) ? value : `'${value.replaceAll("'", `'\\''`)}'`;
13254
13258
  function verdictCommand(options) {
13255
13259
  const kind = options.judge === "verifier" ? "<live|unit>" : options.judge === "reviewer" ? "review" : "<live|unit|review>";
13256
13260
  return [
13257
13261
  "workit ledger verdict <verified|failed|blocked>",
13262
+ options.cwd ? `--cwd ${shellQuote(options.cwd)}` : null,
13258
13263
  `--kind ${kind}`,
13259
13264
  `--branch ${options.branch ?? "<branch>"}`,
13260
13265
  options.session ? `--session ${options.session}` : null,
@@ -17786,9 +17791,9 @@ var autocorrected = (name, config) => {
17786
17791
  }
17787
17792
  return tie ? null : best;
17788
17793
  };
17789
- var shellQuote = (word) => `'${word.replaceAll("'", "'\\''")}'`;
17794
+ var shellQuote2 = (word) => `'${word.replaceAll("'", "'\\''")}'`;
17790
17795
  var positional = (script, args) => {
17791
- const word = (arg) => /^[\w./@+:=-]+$/.test(arg) ? arg : shellQuote(arg);
17796
+ const word = (arg) => /^[\w./@+:=-]+$/.test(arg) ? arg : shellQuote2(arg);
17792
17797
  return script.replace(/\$\{?([1-9])\}?/g, (_, n) => word(args[Number(n) - 1] ?? "")).replace(/\$\{?[@*]\}?/g, args.map(word).join(" "));
17793
17798
  };
17794
17799
  var expandGitAliases = (root, invocation, cache = new Map, depth = 0) => {
@@ -17805,7 +17810,7 @@ var expandGitAliases = (root, invocation, cache = new Map, depth = 0) => {
17805
17810
  return corrected ? [{ ...invocation, args: [corrected, ...invocation.args.slice(1)] }] : [invocation];
17806
17811
  }
17807
17812
  const rest = invocation.args.slice(1);
17808
- const expanded = alias.startsWith("!") ? rawInvocations([positional(alias.slice(1), rest), ...rest.map(shellQuote)].join(" ")).map((inner) => ({
17813
+ const expanded = alias.startsWith("!") ? rawInvocations([positional(alias.slice(1), rest), ...rest.map(shellQuote2)].join(" ")).map((inner) => ({
17809
17814
  ...inner,
17810
17815
  dir: rebase(invocation.dir, inner.dir),
17811
17816
  ...inner.tool === "git" && (invocation.config || inner.config) ? { config: [...invocation.config ?? [], ...inner.config ?? []] } : {},
@@ -18132,7 +18137,7 @@ var policyDeclared = () => {
18132
18137
  return false;
18133
18138
  }
18134
18139
  };
18135
- var word = (text) => /^[\w./@%+:,=-]+$/u.test(text) ? text : shellQuote(text);
18140
+ var word = (text) => /^[\w./@%+:,=-]+$/u.test(text) ? text : shellQuote2(text);
18136
18141
  var HEREDOC = /^cat <<(['"])(\w+)\1\n([\s\S]*)\n\2\n?$/u;
18137
18142
  var messageOf = (segment, index) => {
18138
18143
  const text = segment.words[index];
@@ -18216,7 +18221,7 @@ var cdCommitCall = (input, command, target, repo) => {
18216
18221
  }
18217
18222
  return [
18218
18223
  `workit git --cwd ${word(target)} commit`,
18219
- ...messages.map((message) => `-m ${shellQuote(message)}`),
18224
+ ...messages.map((message) => `-m ${shellQuote2(message)}`),
18220
18225
  ...allowEmpty ? ["--allow-empty"] : [],
18221
18226
  all ? "--all" : `-- ${[...new Set(paths)].map(word).join(" ")}`
18222
18227
  ].join(" ");
@@ -18706,6 +18711,7 @@ var workitBypassFlag = (command, dialect = "posix") => {
18706
18711
  }
18707
18712
  return null;
18708
18713
  };
18714
+ var helpOnly = (call, needle) => call.length > needle.length && needle.every((word, index) => call[index] === word) && call.slice(needle.length).every((word) => word === "--help" || word === "-h");
18709
18715
  var userOnlyWorkitCall = (command, dialect = "posix") => {
18710
18716
  if (!mayRunUserOnly(command))
18711
18717
  return null;
@@ -18732,7 +18738,7 @@ var userOnlyWorkitCall = (command, dialect = "posix") => {
18732
18738
  }
18733
18739
  const call = args.slice(at);
18734
18740
  const found = WORKIT_USER_ONLY.find((needle) => call[0] === needle[0] && hasWordsInOrder(call, needle));
18735
- if (found)
18741
+ if (found && !helpOnly(call, found))
18736
18742
  return [...found];
18737
18743
  }
18738
18744
  return null;
@@ -24715,14 +24721,15 @@ ${subagentStartText({ ...input, cwd: "" }, descriptor, event)}`;
24715
24721
  const judge = event.agentType.endsWith("reviewer") ? "reviewer" : "verifier";
24716
24722
  const pick = judge === "verifier" ? ", --kind live when you drove the real surface" : "";
24717
24723
  const branch = judgeBranch(cwd);
24724
+ const at = currentBranch(cwd) === null ? null : worktreeTop(cwd) ?? null;
24718
24725
  const checks = judgeChecksLine(cwd);
24719
24726
  const checksText = checks ? ` ${checks}` : "";
24720
24727
  if (descriptor.host === "codex_cli" || descriptor.host === "codex_desktop")
24721
- return `${readOnly} Its shell already acts as its own Workit session, so the ledger tells its verdicts apart from the author's. Record the verdict with exactly this command (pick the result${pick}, name the candidate branch if it differs, say what you ran): \`${verdictCommand({ branch, judge })}\`.${JUDGE_CWD} Add no session or token option to it, and never set WORKIT_SESSION_ID by hand.${checksText}`;
24728
+ return `${readOnly} Its shell already acts as its own Workit session, so the ledger tells its verdicts apart from the author's. Record the verdict with exactly this command (pick the result${pick}, name the candidate branch if it differs, say what you ran): \`${verdictCommand({ branch, judge, cwd: at })}\`.${JUDGE_CWD} Add no session or token option to it, and never set WORKIT_SESSION_ID by hand.${checksText}`;
24722
24729
  const token = session ? recordIssuedSession(cwd, session, own) : null;
24723
24730
  if (session && !token)
24724
24731
  return `${readOnly} ${own} was already issued to an earlier subagent, so no token is handed out again and a verdict under it would be refused (unbound_session). Record no verdict as ${own}: spawn a fresh verifier or reviewer, which gets its own session and token.`;
24725
- const line = verdictCommand({ branch, judge, session: own, token });
24732
+ const line = verdictCommand({ branch, judge, session: own, token, cwd: at });
24726
24733
  return `${readOnly} Its own Workit session is ${own}, so the ledger tells its verdicts apart from the author's. Record the verdict with exactly this command (pick the result${pick}, name the candidate branch if it differs, say what you ran): \`${line}\`.${JUDGE_CWD}${token ? " The token is this subagent's alone: never write it into a report, a file or a commit. --token needs a workit CLI at least as new as this plugin; if the CLI answers that --token is an unknown option, update the workit CLI (workit upgrade --cli) and record again." : ""}${checksText}`;
24727
24734
  };
24728
24735
  var PRE_TOOL = new Set(["shell.pre", "write.pre", "tool.pre"]);
@@ -24823,12 +24830,12 @@ function decide(input, deps) {
24823
24830
  if (input.host === "claude_code")
24824
24831
  return {
24825
24832
  kind: "ask",
24826
- reason: `Only the user runs \`workit ${userOnly.join(" ")}\`: the user decides this call.`
24833
+ reason: `Only the user runs \`workit ${userOnly.join(" ")}\`: the user decides this call (its help: \`workit help ${userOnly.join(" ")}\`).`
24827
24834
  };
24828
24835
  if (canDeny && ["cursor", "codex_cli", "codex_desktop", "pi"].includes(input.host))
24829
24836
  return {
24830
24837
  kind: "deny",
24831
- reason: `Only the user runs \`workit ${userOnly.join(" ")}\`: run it in your own terminal.`,
24838
+ reason: `Only the user runs \`workit ${userOnly.join(" ")}\`: run it in your own terminal (its help: \`workit help ${userOnly.join(" ")}\`).`,
24832
24839
  unblock: null
24833
24840
  };
24834
24841
  }
@@ -101,7 +101,7 @@ if (quiet) {
101
101
  `);
102
102
  } else {
103
103
  try {
104
- const { runCodexHook } = await import("./workit-hook-y2n74h79.js");
104
+ const { runCodexHook } = await import("./workit-hook-4vkgc2zt.js");
105
105
  await runCodexHook([payload]);
106
106
  } catch (error) {
107
107
  const { answerRuntimeFailure } = await import("./workit-hook-9k8dtngs.js");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workit-dev/codex",
3
- "version": "2.16.1",
3
+ "version": "2.16.2",
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.16.1",
45
- "@workit-dev/mcp": "^2.16.1"
44
+ "@workit-dev/core": "^2.16.2",
45
+ "@workit-dev/mcp": "^2.16.2"
46
46
  },
47
47
  "engines": {
48
48
  "node": ">=24"
@@ -31,7 +31,7 @@ denial, a review comment that needs a product decision, a required update
31
31
  that repeats because the base keeps moving, or after 3 failed fix attempts on
32
32
  the same check. Fix round and recheck both failed: the decider agent (read the `workit-fanout` skill's SKILL.md and follow it).
33
33
 
34
- 1. **Open.** Last before the PR, if `workit grant show` has `changelog: update|create`: write the Unreleased entry with `workit changelog apply`, commit it; with `docs: when-user-facing` fix only docs the diff made false (`references/changelog.md`).
34
+ 1. **Open.** Last before the PR, if `workit grant show` has `changelog: update|create`: pass the Unreleased entry as `workit pr create … --changelog "<Section>: <entry>"` (it commits and pushes it); with `docs: when-user-facing` fix only docs the diff made false (`references/changelog.md`).
35
35
  Full local check (`workit check ci` when `.workit/checks.json` has a `ci` group), push once: `workit git push`, then `workit pr template` and fill the template it prints: every heading, each `<!-- -->` replaced (Workit's: `references/pr-body.md`).
36
36
  `workit pr create --title "<title>" --body-file <f|->` refuses a body that leaves a repo template (or `prTemplate: workit`) unfilled; add `--issue <#n|ID>` (`--refs`: no close; `workit pr edit`).
37
37
  YouTrack issue work: `workit youtrack …` (`--help`; the `ytrack` skill for the rest). A draft that needs the user's yes (YouTrack text, release notes, a PR body they asked to review): paste it whole in chat before asking, never only its path, and again after every edit (the verb prints the diff and the new text).
@@ -17,19 +17,23 @@ belongs to). Otherwise:
17
17
  do, not with internals: "Added: `workit pr create --no-changelog <reason>`
18
18
  skips the changelog check with a recorded reason", not "refactor gate
19
19
  module".
20
- 2. Apply it only with `workit changelog apply --entries '{"Added": ["…"]}'`
21
- (categories: Added, Changed, Deprecated, Removed, Fixed, Security), adding
22
- `--path <file>` when the file is not the root CHANGELOG.md. It
23
- merges into `## [Unreleased]` and creates the Keep a Changelog file when it
24
- is missing. Never clobber CHANGELOG.md: never rewrite, reorder or delete an
20
+ 2. Open the PR with the entry in the same call:
21
+ `workit pr create … --changelog "<Section>: <entry>"` (sections: Added,
22
+ Changed, Deprecated, Removed, Fixed, Security). It merges the bullet into
23
+ `## [Unreleased]` of the right file (creating a missing Keep a Changelog
24
+ file), commits it with a subject commitlint accepts, pushes and opens the
25
+ PR. Never clobber CHANGELOG.md: never rewrite, reorder or delete an
25
26
  existing entry, and never hand-edit released sections.
26
- 3. Commit it (`workit git commit -m "<message>" -- <file>`)
27
- with the change, then push.
27
+ 3. With no PR to open yet, apply it alone with
28
+ `workit changelog apply --entries '{"Added": ["…"]}'` (`--path <file>` when
29
+ it is not the root CHANGELOG.md), then commit it
30
+ (`workit git commit -m "<message>" -- <file>`) with the change and push.
28
31
 
29
32
  `workit pr create` refuses a user-facing PR without a new Unreleased bullet
30
- (`changelog_required`) and prints the exact `workit changelog apply` command.
31
- When the PR truly needs no entry, pass `--no-changelog "<why>"`: the reason is
32
- written into the PR body.
33
+ (`changelog_required`); its `Retry as:` line is your call plus
34
+ `--changelog "<Section>: <what users can now do>"`: fill in the entry and run
35
+ it. When the PR truly needs no entry, pass `--no-changelog "<why>"`: the
36
+ reason is written into the PR body.
33
37
 
34
38
  ## Docs (`docs: when-user-facing`)
35
39