@workit-dev/pi 2.29.3 → 2.29.4

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.
package/dist/worker.js CHANGED
@@ -8374,7 +8374,9 @@ Autonomy contract:
8374
8374
  - Continue to the requested endpoint without asking "continue?", running
8375
8375
  checks and repairs.
8376
8376
  Stop only for a new consequential choice, a host denial, a conflicting edit
8377
- or an unresolved blocker; report open gaps and uncertain workers.
8377
+ or an unresolved blocker; report open gaps and uncertain workers. A
8378
+ classifier denying a chained granted verb: rerun it once alone, verb first;
8379
+ a plain call denied: ask in chat, never a terminal hand-off.
8378
8380
  - No endpoint named: stop at a local commit on a policy-compliant branch and
8379
8381
  state the next command. If the request implies delivery (fix, implement,
8380
8382
  ship), go to the effective endpoint in \`workit grant show\`: \`pr\` stops
@@ -9630,6 +9632,7 @@ var FLAGS = {
9630
9632
  // packages/workit-core/src/approvals/inline.ts
9631
9633
  var DIR2 = "<dir>";
9632
9634
  var OPAQUE_RELEASE_FIX = `workit release --cwd ${DIR2} notes approve <version>`;
9635
+ var OPAQUE_RELEASE_FIRST = `workit release notes approve --cwd ${DIR2} <version>`;
9633
9636
 
9634
9637
  // packages/workit-core/src/hooks/hosts/fields.ts
9635
9638
  var SHELLS2 = new Set(["sh", "bash", "zsh", "dash", "pwsh", "powershell", "cmd"]);
package/dist/workit.js CHANGED
@@ -18843,7 +18843,9 @@ Autonomy contract:
18843
18843
  - Continue to the requested endpoint without asking "continue?", running
18844
18844
  checks and repairs.
18845
18845
  Stop only for a new consequential choice, a host denial, a conflicting edit
18846
- or an unresolved blocker; report open gaps and uncertain workers.
18846
+ or an unresolved blocker; report open gaps and uncertain workers. A
18847
+ classifier denying a chained granted verb: rerun it once alone, verb first;
18848
+ a plain call denied: ask in chat, never a terminal hand-off.
18847
18849
  - No endpoint named: stop at a local commit on a policy-compliant branch and
18848
18850
  state the next command. If the request implies delivery (fix, implement,
18849
18851
  ship), go to the effective endpoint in \`workit grant show\`: \`pr\` stops
@@ -31809,7 +31811,9 @@ var fixDir = (cwd, literal, cd, dialect) => {
31809
31811
  return cd === undefined || cd === DIR2 ? DIR2 : paths.join(cd, cwd);
31810
31812
  };
31811
31813
  var OPAQUE_RELEASE_FIX = `workit release --cwd ${DIR2} notes approve <version>`;
31812
- var inlineCallIn = (command, dialect = "posix") => {
31814
+ var SUB_VERB = /^[a-z][a-z-]*$/u;
31815
+ var OPAQUE_RELEASE_FIRST = `workit release notes approve --cwd ${DIR2} <version>`;
31816
+ var inlineCallIn = (command, dialect = "posix", wrapped = false) => {
31813
31817
  if (!/\bworkit\b/u.test(command))
31814
31818
  return null;
31815
31819
  const segments = segmentsOf(command, dialect, { spans: true });
@@ -31820,8 +31824,11 @@ var inlineCallIn = (command, dialect = "posix") => {
31820
31824
  if ((words[0] ?? "").endsWith("sh"))
31821
31825
  for (const word of words.slice(1)) {
31822
31826
  const inner = /\s/u.test(word) ? inlineCallIn(word, dialect) : null;
31823
- if (inner?.plain)
31824
- return { plain: false, fix: word.trim(), words: inner.words };
31827
+ const own = inner?.plain ? inlineCallIn(word, dialect, true) : null;
31828
+ if (inner?.plain) {
31829
+ const first = own?.plain === false ? own.first : word.trim();
31830
+ return { plain: false, fix: word.trim(), first, words: inner.words };
31831
+ }
31825
31832
  if (inner)
31826
31833
  return inner;
31827
31834
  }
@@ -31836,10 +31843,10 @@ var inlineCallIn = (command, dialect = "posix") => {
31836
31843
  const call = verb.words;
31837
31844
  const release = isReleaseNotesCall(call);
31838
31845
  if (release && (ODD_SPACE.test(command) || words.some((word) => UNSAFE_TEXT.test(word))))
31839
- return { plain: false, fix: OPAQUE_RELEASE_FIX, words: call };
31846
+ return { plain: false, fix: OPAQUE_RELEASE_FIX, first: OPAQUE_RELEASE_FIRST, words: call };
31840
31847
  const cwds = cwdIndexes(words, start + 1, at);
31841
31848
  const literal = (index) => literalDir((words[index] ?? "").replace(/^--cwd=/u, ""), segment.expands?.includes(index) ?? false);
31842
- const plain = (segments.length === 1 || position === 0 && onlyFiltersAfter(segments)) && start === 0 && words[0] === "workit" && cwds.every(literal) && !segment.redirects.length && !segment.subs?.length && !segment.stdin?.length && !segment.expands?.length && !segment.group;
31849
+ const plain = !wrapped && (segments.length === 1 || position === 0 && onlyFiltersAfter(segments)) && start === 0 && words[0] === "workit" && cwds.every(literal) && !segment.redirects.length && !segment.subs?.length && !segment.stdin?.length && !segment.expands?.length && !segment.group;
31843
31850
  if (plain)
31844
31851
  return { plain: true, words: routed(call, words.slice(1, at)), cwd: verb.cwd };
31845
31852
  const last = cwds.at(-1);
@@ -31859,29 +31866,35 @@ var inlineCallIn = (command, dialect = "posix") => {
31859
31866
  texts.push(local ? `<path of $${local[1]}>` : writtenWord(command, segment, index));
31860
31867
  }
31861
31868
  const file = producedFile(command, before, words) ?? undefined;
31862
- const done = (fix) => ({
31869
+ const done = (fix, first = fix) => ({
31863
31870
  plain: false,
31864
31871
  fix,
31872
+ first,
31865
31873
  words: call,
31866
31874
  ...file && { file }
31867
31875
  });
31868
31876
  if (texts.includes(null)) {
31869
31877
  const verbs = call.slice(0, 2).join(" ");
31870
- return done(release ? OPAQUE_RELEASE_FIX : `workit ${verbs} <its other words as you wrote them>`);
31878
+ const opaque = `workit ${verbs} <its other words as you wrote them>`;
31879
+ return release ? done(OPAQUE_RELEASE_FIX, OPAQUE_RELEASE_FIRST) : done(opaque);
31871
31880
  }
31872
31881
  const [head = "", ...rest] = texts;
31873
31882
  const cwdTexts = cwds.map((index) => writtenWord(command, segment, index));
31874
31883
  const uncertain = !rest.every((text) => cwdIndependent(text)) || cwdTexts.some((text) => text === null || !cwdIndependent(text.replace(/^--cwd=/u, "")));
31884
+ const cdLost = cd === undefined && !command.includes("||") && before.some((step) => step.words[0] === "cd");
31885
+ const cwd = cdLost && verb.cwd === null ? DIR2 : fixDir(verb.cwd, lastLiteral, cd, dialect);
31886
+ const where = cwd === null ? [] : ["--cwd", cwd === DIR2 ? DIR2 : quote2(cwd, dialect)];
31887
+ const subs = release ? 3 : 2;
31888
+ const subWords = texts.slice(1, subs);
31889
+ const literalSubs = subWords.length === subs - 1 && subWords.every((w) => SUB_VERB.test(w));
31890
+ const first = literalSubs ? ["workit", ...texts.slice(0, subs), ...where, ...texts.slice(subs)].join(" ") : ["workit", head, ...where, ...rest].join(" ");
31875
31891
  if (cd && cd !== DIR2 && uncertain) {
31876
31892
  const dir = before[0] ? writtenWord(command, before[0], 1) : null;
31877
31893
  const all = writtenWords(command, segment, Array.from({ length: words.length - start - 1 }, (_, n) => start + 1 + n));
31878
31894
  if (dir !== null && all)
31879
31895
  return done(`cd ${dir} && workit ${all.join(" ")}`);
31880
31896
  }
31881
- const cdLost = cd === undefined && !command.includes("||") && before.some((step) => step.words[0] === "cd");
31882
- const cwd = cdLost && verb.cwd === null ? DIR2 : fixDir(verb.cwd, lastLiteral, cd, dialect);
31883
- const where = cwd === null ? [] : ["--cwd", cwd === DIR2 ? DIR2 : quote2(cwd, dialect)];
31884
- return done(["workit", head, ...where, ...rest].join(" "));
31897
+ return done(["workit", head, ...where, ...rest].join(" "), first);
31885
31898
  }
31886
31899
  return null;
31887
31900
  };
@@ -31897,7 +31910,7 @@ var inlineCallDeny = (fix, file) => {
31897
31910
  const first = file ? `An earlier step in this command writes ${showable(file) && !file.includes(`
31898
31911
  `) ? `\`${file}\`` : "the file the call reads"}; run that step as its own call first, then run ${run}` : `Run ${run}`;
31899
31912
  const segments = segmentsOf(fix.replace(/<[^>\n]*>/gu, "x"));
31900
- const expands = segments.length > 1 || segments.some((segment) => segment.expands?.length) || /(?:^|\s)~[^/\s]/u.test(fix);
31913
+ const expands = segments.length > 1 || segments.some((segment) => segment.expands?.length || segment.subs?.length) || /(?:^|\s)~[^/\s]/u.test(fix);
31901
31914
  return expands ? `${first} Spell out each word the shell would expand ($…, a glob, a cd): the host asks only on a call its text fixes.` : first;
31902
31915
  };
31903
31916
 
@@ -36436,7 +36449,7 @@ var enforceToolPolicy = (event, ctx) => {
36436
36449
  return approveInDialog(approve.ids, event, ctx);
36437
36450
  const inline = typeof command === "string" ? inlineCallIn(command) : null;
36438
36451
  if (inline && !inline.plain)
36439
- return { block: true, reason: inlineCallDeny(inline.fix, inline.file) };
36452
+ return { block: true, reason: inlineCallDeny(inline.first, inline.file) };
36440
36453
  if (inline?.plain && ctx.mode === "tui" && ctx.hasUI) {
36441
36454
  const gated = isReleaseNotesCall(inline.words) && inlineAskFor(inline.words, inlineCallCwd(inline, ctx.cwd)) ? undefined : gate({
36442
36455
  kind: "shell.pre",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workit-dev/pi",
3
- "version": "2.29.3",
3
+ "version": "2.29.4",
4
4
  "description": "Workit native extension for Pi — tools, method skills, and session continuity",
5
5
  "keywords": [
6
6
  "agentic-coding",
@@ -53,7 +53,7 @@ the same check. Fix round and recheck both failed: the decider agent (read the `
53
53
  with `workit check`, fix the root cause, batch every fix in one push, one focused commit per fix (unrelated hunks in one file: `workit git stage --patch <file>`, then `workit git commit -m "<msg>" --staged`). A tool warning is a finding: fix it in this PR in the right layer, or record the false positive with evidence; pre-existing ones get their own PR.
54
54
  6. **Verified.** The lane in `workit pr status` decides: none, no verdict; self, your `--self` verdict; focused or full (or `verification: self|independent`), one non-author verifier per PR after the last push, never per push (read the `workit-review` skill's SKILL.md and follow it), on Claude Code with the `model` and `effort` of `workit models show --role verifier`. A docs-only push (or test-only under a unit verdict) keeps the verdict (`carried`); `reverify: focused` re-checks only the new diff, reusing green CI; one verdict at a stack's top covers its unchanged lower PRs. Land only when
55
55
  granted: `workit stack land` or `workit pr merge`; `--unverified --reason` if user-asked.
56
- Never pipe a delivery verb through `grep`, `tail` or `head`: read its exit code, or use `--json`. Trunk CI after a merge: `workit ci wait --branch <trunk>`.
56
+ Never pipe a delivery verb through `grep`, `tail` or `head`: read its exit code, or use `--json`. Trunk CI after a merge: `workit ci wait --branch <trunk>`. Run each delivery verb alone, verb first (`workit pr merge --cwd <dir> …`), never chained. A classifier denial of a chained granted verb: rerun it once alone; a plain call denied: ask the user in chat, never hand it to their terminal.
57
57
  7. **Observe it landed:** `workit verify-delivery pr` or `merge`. After a failed
58
58
  verdict or a check red 3+ times, at any endpoint: offer `/wk-retro` in one
59
59
  line of the final or stop report; never pause the babysit loop for it.