@makerx/yoke 0.17.1 → 0.17.3

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.
Files changed (2) hide show
  1. package/dist/cli.js +33 -3
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -7,7 +7,7 @@ import { Command } from "commander";
7
7
  // package.json
8
8
  var package_default = {
9
9
  name: "@makerx/yoke",
10
- version: "0.17.1",
10
+ version: "0.17.3",
11
11
  description: "Lean, user-invoked Claude Code skills for MakerX AI-assisted delivery, plus the CLI they call.",
12
12
  license: "MIT",
13
13
  author: "MakerX",
@@ -463,12 +463,38 @@ async function fetchPr(number, exec2 = run) {
463
463
  if (!isPullRequest(pr2)) throw new ReviewError("`gh pr view` returned an unexpected response");
464
464
  return pr2;
465
465
  }
466
+ var diffArgsIgnoringGitConfig = [
467
+ "-c",
468
+ "diff.suppressBlankEmpty=false",
469
+ "diff",
470
+ "--no-color",
471
+ "--no-ext-diff",
472
+ "--no-textconv",
473
+ "--submodule=short",
474
+ "--no-relative",
475
+ "--find-renames",
476
+ "--unified=3",
477
+ "--diff-algorithm=myers",
478
+ "--src-prefix=a/",
479
+ "--dst-prefix=b/"
480
+ ];
481
+ async function requireMergeBase(pr2, root, exec2) {
482
+ try {
483
+ await exec2("git", ["merge-base", pr2.baseRefOid, pr2.headRefOid], root);
484
+ } catch {
485
+ throw new ReviewError(
486
+ `#${pr2.number} has no merge base in this checkout, which is likely a shallow clone; fetch full history (e.g. \`git fetch --unshallow\` or \`fetch-depth: 0\`) and run the review again`
487
+ );
488
+ }
489
+ }
466
490
  async function fetchDiff(pr2, exec2 = run) {
467
- const diff = await exec2("gh", ["pr", "diff", String(pr2.number)]);
491
+ const root = (await exec2("git", ["rev-parse", "--show-toplevel"])).trim();
492
+ await exec2("git", ["fetch", "--quiet", await prRemote(pr2, root, exec2), `pull/${pr2.number}/head`, pr2.baseRefOid], root);
468
493
  const current = await fetchPr(String(pr2.number), exec2);
469
494
  if (current.headRefOid !== pr2.headRefOid || current.baseRefOid !== pr2.baseRefOid)
470
495
  throw new ReviewError(`#${pr2.number} changed while its diff was being fetched; run the review again`);
471
- return diff;
496
+ await requireMergeBase(pr2, root, exec2);
497
+ return exec2("git", [...diffArgsIgnoringGitConfig, `${pr2.baseRefOid}...${pr2.headRefOid}`], root);
472
498
  }
473
499
  var commentFields = '{path, line: (.line // .original_line), author: (.user.login // "ghost"), body}';
474
500
  var reviewFields = '{path: null, line: null, author: (.user.login // "ghost"), body}';
@@ -1000,10 +1026,12 @@ This change adds or edits a workflow that calls \`MakerXStudio/yoke/.github/work
1000
1026
  - The \`pull_request_target\` \`labeled\` trigger: a maintainer reads a fork PR's diff, then adds the \`review\` label to run its review with secrets. The reusable workflow runs the review on it only for that label on fork PRs, and refuses to review any commit pushed after the label. Its \`synchronize\` type removes the label when the fork pushes again.
1001
1027
  - The \`actions: write\` and \`statuses: write\` permissions (or \`actions: read\` in older callers): the gate reads earlier runs to find the PR's latest review, records a fork's approved review as a commit status, and re-runs the PR head's gate.
1002
1028
  - Draft PRs being reviewed twice: the reusable workflow already skips drafts.
1029
+ - Not passing \`REVIEW_CI_API_KEY\` from a caller that passes \`azure-client-id\` and \`provider: foundry\` (or a \`provider\` from a variable the diff can't show), even when an older workflow passed it: on Foundry the review signs in with the job's GitHub OIDC token and ignores \`REVIEW_CI_API_KEY\`.
1003
1030
 
1004
1031
  Real defects in it are still findings, such as:
1005
1032
 
1006
1033
  - Passing every secret with \`secrets: inherit\` instead of only \`REVIEW_CI_API_KEY\` (plus \`REVIEW_CI_BASE_URL\` from callers that still pass the URL as a secret).
1034
+ - Not passing \`REVIEW_CI_API_KEY\` from a LiteLLM caller (\`provider\` defaults to \`litellm\`), even one that passes \`azure-client-id\`, or from a Foundry caller without \`azure-client-id\`: both sign in with it.
1007
1035
  - An input the reusable workflow does not declare.
1008
1036
  - No \`permissions:\` block limiting the token to \`actions: write\`, \`contents: read\`, \`pull-requests: write\` and \`statuses: write\`, plus \`id-token: write\` with \`azure-client-id\`. The reusable workflow sets no permissions of its own, so the caller's block is the only limit on the token its agents run with.
1009
1037
  `;
@@ -1714,6 +1742,8 @@ var reviewerPrompt = `You are acting as a reviewer for a proposed code change ma
1714
1742
 
1715
1743
  Your working directory is the repository under review at the PR's head, so you can read any file in it for context beyond the diff. Do not modify any file.
1716
1744
 
1745
+ The base and head commits named in the request, and their merge base, are available in the checkout. You may run read-only git commands such as \`git log\`, \`git blame\`, \`git show\` and \`git diff <base>...<head>\` to understand the surrounding code and its recent changes. Do not run any git command that changes the repository, its refs, index or working tree (no checkout, commit, reset, fetch, stash or similar).
1746
+
1717
1747
  Read the request file, then produce a thorough code review in Markdown.
1718
1748
 
1719
1749
  ## When to flag a finding
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makerx/yoke",
3
- "version": "0.17.1",
3
+ "version": "0.17.3",
4
4
  "description": "Lean, user-invoked Claude Code skills for MakerX AI-assisted delivery, plus the CLI they call.",
5
5
  "license": "MIT",
6
6
  "author": "MakerX",