@workit-dev/pi 1.7.0 → 1.7.1
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/workit.js +12 -4
- package/package.json +1 -1
package/dist/workit.js
CHANGED
|
@@ -20659,9 +20659,15 @@ var messageOf = (segment, index) => {
|
|
|
20659
20659
|
return null;
|
|
20660
20660
|
return match[3].replace(/\n+$/u, "");
|
|
20661
20661
|
};
|
|
20662
|
+
var sameGitDir = (a, b, platform = process.platform) => {
|
|
20663
|
+
if (platform !== "win32")
|
|
20664
|
+
return path27.posix.resolve(a) === path27.posix.resolve(b);
|
|
20665
|
+
const fold = (value) => path27.win32.resolve(value).toLowerCase();
|
|
20666
|
+
return fold(a) === fold(b);
|
|
20667
|
+
};
|
|
20662
20668
|
var cdCommitCall = (input, command, target, repo) => {
|
|
20663
20669
|
const { top, git, dir: store } = repo.location;
|
|
20664
|
-
if (!top || !git || git.gitDir
|
|
20670
|
+
if (!top || !git || sameGitDir(git.gitDir, path27.dirname(store)) || repoAt(input.cwd)?.location.top === top)
|
|
20665
20671
|
return null;
|
|
20666
20672
|
const bare = command.replaceAll(/'[^']*'|"(?:[^"\\]|\\.)*"/gu, "").replaceAll("&&", "");
|
|
20667
20673
|
if (/[;|&<>`$()\n\\]/u.test(bare))
|
|
@@ -28318,10 +28324,12 @@ var substitutingHeredoc = (command) => {
|
|
|
28318
28324
|
}
|
|
28319
28325
|
return false;
|
|
28320
28326
|
};
|
|
28321
|
-
var judgeDeny = (input, what) => {
|
|
28327
|
+
var judgeDeny = (input, what, target) => {
|
|
28322
28328
|
const role = input.session.agentType?.endsWith("reviewer") ? "reviewer" : "verifier";
|
|
28323
28329
|
const root = checkoutOf2(input.cwd)?.root;
|
|
28324
|
-
const
|
|
28330
|
+
const candidate = target ? checkoutOf2(target)?.root : undefined;
|
|
28331
|
+
const also = root && candidate && candidate !== root && commonDir(candidate) === commonDir(root) ? ` or ${path42.join(candidate, SCRATCH)}` : "";
|
|
28332
|
+
const scratch = root ? `${path42.join(root, SCRATCH)}${also}` : `${SCRATCH}/ at the root of the checkout you judge`;
|
|
28325
28333
|
const unblock = `Write only under ${scratch} (mkdir -p it): put a generated case in a file there with a quoted heredoc (<<'EOF') and never run it in the shell. Reads, \`workit check\` and \`workit ledger verdict|finding\` stay allowed; a change the candidate needs is a finding, not an edit.`;
|
|
28326
28334
|
return {
|
|
28327
28335
|
kind: "deny",
|
|
@@ -28342,7 +28350,7 @@ function confineJudge(input, targets) {
|
|
|
28342
28350
|
if (inScratch(canonical4(target), repo))
|
|
28343
28351
|
continue;
|
|
28344
28352
|
const runner = runnerAt(target);
|
|
28345
|
-
return judgeDeny(input, runner === null ? `${shown(target)} is outside it` : `\`${runner}\` runs in ${shown(target)}, outside it
|
|
28353
|
+
return judgeDeny(input, runner === null ? `${shown(target)} is outside it` : `\`${runner}\` runs in ${shown(target)}, outside it`, target);
|
|
28346
28354
|
}
|
|
28347
28355
|
return NONE5;
|
|
28348
28356
|
} catch {
|