@brainervirus/workit-claude-code 8.24.0 → 8.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,7 +1,7 @@
1
1
  {
2
2
  "name": "workit",
3
3
  "displayName": "Workit",
4
- "version": "8.24.0",
4
+ "version": "8.25.0",
5
5
  "description": "Workflow rails for agentic coding: task context on every session, branch policy on shell commands, and the workit method skills",
6
6
  "author": {
7
7
  "name": "BrainerVirus"
@@ -15,12 +15,13 @@ hand back), standing orders, mode (`new` or `resume`) and the worktree path.
15
15
  If a field is missing, report which and stop.
16
16
 
17
17
  1. Run each git and check command against the worktree, one verb per call:
18
- `workit --cwd <worktree> git commit …`, `workit --cwd <worktree> check <name>`.
18
+ `workit git --cwd <worktree> commit …`, `workit check --cwd <worktree> <name>`
19
+ (verb first, so the host's allow rules match).
19
20
  Never `cd <worktree> && …` chains, `$VAR` paths or compound commands. Edit
20
21
  files by their path under the worktree. Workit's hooks deny an edit or a
21
22
  mutating git command outside it.
22
23
  2. The worktree is already on the brief's branch. If it is not: `MODE: new`,
23
- `workit --cwd <worktree> git branch <branch> --base <base>`; `MODE: resume`
24
+ `workit git --cwd <worktree> branch <branch> --base <base>`; `MODE: resume`
24
25
  (you replace a stopped worker), `git -C <worktree> switch <branch>` and
25
26
  continue from its head. A hook denies protected or non-compliant names;
26
27
  follow the unblock it prints.
@@ -31,8 +32,8 @@ If a field is missing, report which and stop.
31
32
  Stop only for an irreversible or security-sensitive action, or a side effect
32
33
  outside your worktree.
33
34
  5. Commit in small steps with
34
- `workit --cwd <worktree> git commit -m "<conventional message>" -- <paths in scope>`.
35
- 6. Run every verify command as `workit --cwd <worktree> check …` and keep the
35
+ `workit git --cwd <worktree> commit -m "<conventional message>" -- <paths in scope>`.
36
+ 6. Run every verify command as `workit check --cwd <worktree> …` and keep the
36
37
  real exit codes.
37
38
  7. Never record a verdict on your own work and never pass `--self`: a separate
38
39
  verifier judges it. Never push, open a PR, rebase or merge unless the brief
@@ -11,8 +11,8 @@ backward: what must be true, what must exist, what must be wired. The author's
11
11
  summary is a claim, not evidence; assume the goal is not met until you observe
12
12
  it.
13
13
 
14
- 1. Pin the candidate in its own checkout (run workit with `--cwd <worktree>`;
15
- never `cd` first): `git -C <worktree> rev-parse HEAD` and `git -C <worktree> status --short`. A dirty tree
14
+ 1. Pin the candidate in its own checkout (run workit as
15
+ `workit <verb> --cwd <worktree> …`, verb first; never `cd` first): `git -C <worktree> rev-parse HEAD` and `git -C <worktree> status --short`. A dirty tree
16
16
  or a moving HEAD is itself a finding, and the ledger refuses a verdict on it.
17
17
  2. Read the brief: goal, acceptance (Given/When/Then), verify commands.
18
18
  3. Run every verify command through the CLI so the result is observed:
@@ -47,6 +47,15 @@ for await (const chunk of process.stdin) payload += String(chunk);
47
47
  const RAW_TOOLS = /\b(?:git|gh|glab)\b/;
48
48
  const WORKIT_DELIVERY =
49
49
  /(?:^|[\s;&|(])(?:\S*[\\/])?workit(?:-cli)?\s+(?:pr (?:create|merge)|ci wait|git push)\b/;
50
+ // The runtime moves the verb first (`cd <dir> && workit …`, `workit --cwd
51
+ // <dir> <verb>`) so Workit's enumerated allow rules match (hooks/cwd-normalize.ts).
52
+ const WORKIT_REORDER = /^\s*(?:cd\s[^;|&]*&&\s*workit\s|workit\s+(?:--json\s+)*--cwd[\s=])/;
53
+ // A Workit call that may carry a bypass flag, however quoted, goes to the
54
+ // runtime, which asks the user (hooks/delivery-verbs.ts workitBypassFlag).
55
+ const mayBypass = (command) =>
56
+ /\bworkit\b/.test(command) &&
57
+ (/\$['"]/.test(command) ||
58
+ /--unverified|--overwrite-unintegrated/.test(command.replace(/['"\\`]/g, "")));
50
59
  const MAYBE_GATED =
51
60
  /\b(?:git|gh|glab)\b|>|\b(?:tee|touch|mkdir|rm|rmdir|mv|cp|truncate|install|ln|patch|dd|sed|perl|set-content|add-content|out-file|new-item|ni|remove-item|del|copy-item|move-item)\b/i;
52
61
  // What an implementer's confinement also judges (hooks/worktree-confine.ts):
@@ -217,7 +226,8 @@ const fastAllow = (() => {
217
226
  // without a task store (hooks/worktree-confine.ts).
218
227
  const implementer = value.agent_type === "workit:implementer";
219
228
  if (SHELLS.has(value.tool_name) && typeof command === "string") {
220
- if (WORKIT_DELIVERY.test(command)) return false;
229
+ if (WORKIT_DELIVERY.test(command) || WORKIT_REORDER.test(command) || mayBypass(command))
230
+ return false;
221
231
  if (maybeHeavy(command, String(value.cwd ?? "."))) return false;
222
232
  if (!MAYBE_GATED.test(command) && !(implementer && IMPLEMENTER_GATED.test(command)))
223
233
  return true;