diff --git a/.github/workflows/kompass-pr-review.yml b/.github/workflows/kompass-pr-review.yml index 2ed528e..a7f7143 100644 --- a/.github/workflows/kompass-pr-review.yml +++ b/.github/workflows/kompass-pr-review.yml @@ -20,6 +20,7 @@ jobs: uses: actions/checkout@v4 with: token: ${{ steps.token.outputs.token }} + ref: ${{ github.head_ref }} - name: Setup Bun uses: oven-sh/setup-bun@v1 diff --git a/packages/core/commands/pr/fix.md b/packages/core/commands/pr/fix.md index 24a97a8..01ae30d 100644 --- a/packages/core/commands/pr/fix.md +++ b/packages/core/commands/pr/fix.md @@ -31,11 +31,13 @@ $ARGUMENTS ### Align Local Branch - If `` is unavailable, STOP and report that the PR head branch could not be determined -- If `` differs from ``: +- If `` equals ``, store `` as `` +- Otherwise, if `` is unavailable and `` equals ``, store `` as `` because the repository is already aligned to the PR head in detached `HEAD` mode +- Otherwise: + - Run `git fetch origin ` to ensure the branch is available locally before checkout - Checkout `` before analyzing repository files or making code changes for this PR - After checkout, store the active branch as `` - If checkout fails, STOP and report that the PR branch could not be checked out locally -- Otherwise, store `` as `` - Do not inspect or modify local code for this PR until `` equals `` ### Analyze Feedback diff --git a/packages/core/commands/pr/review.md b/packages/core/commands/pr/review.md index 01fbf7e..78dbb31 100644 --- a/packages/core/commands/pr/review.md +++ b/packages/core/commands/pr/review.md @@ -27,11 +27,13 @@ $ARGUMENTS ### Align Local Branch - If `` is unavailable, STOP and report that the PR head branch could not be determined -- If `` differs from ``: +- If `` equals ``, store `` as `` +- Otherwise, if `` is unavailable and `` equals ``, store `` as `` because the repository is already aligned to the PR head in detached `HEAD` mode +- Otherwise: + - Run `git fetch origin ` to ensure the branch is available locally before checkout - Checkout `` before inspecting local repository files for this PR review - After checkout, store the active branch as `` - If checkout fails, STOP and report that the PR branch could not be checked out locally -- Otherwise, store `` as `` - Do not inspect local repository code for this PR until `` equals `` ### Load Ticket Context diff --git a/packages/core/components/load-pr.md b/packages/core/components/load-pr.md index b980349..832adb9 100644 --- a/packages/core/components/load-pr.md +++ b/packages/core/components/load-pr.md @@ -5,6 +5,7 @@ - Store the result as `<%= it.result %>` - Store the PR head branch as `` from `<%= it.result %>.pr.headRefName` when it is available - Run `git branch --show-current` and store the trimmed result as `` when it is available +- Run `git rev-parse HEAD` and store the trimmed result as `` when it is available - Treat the loaded PR body, discussion, review history, and any attachments or linked artifacts returned by the loader as part of the source context - Review attached images, screenshots, videos, PDFs, and other linked files whenever they can affect the requested fix, review outcome, reproduction steps, or acceptance criteria - If any relevant attachment cannot be accessed, note that gap and continue only when the remaining PR context is still sufficient to proceed reliably diff --git a/packages/opencode/.opencode/commands/pr/fix.md b/packages/opencode/.opencode/commands/pr/fix.md index d940f8f..51c1ba1 100644 --- a/packages/opencode/.opencode/commands/pr/fix.md +++ b/packages/opencode/.opencode/commands/pr/fix.md @@ -38,6 +38,7 @@ $ARGUMENTS - Store the result as `` - Store the PR head branch as `` from `.pr.headRefName` when it is available - Run `git branch --show-current` and store the trimmed result as `` when it is available +- Run `git rev-parse HEAD` and store the trimmed result as `` when it is available - Treat the loaded PR body, discussion, review history, and any attachments or linked artifacts returned by the loader as part of the source context - Review attached images, screenshots, videos, PDFs, and other linked files whenever they can affect the requested fix, review outcome, reproduction steps, or acceptance criteria - If any relevant attachment cannot be accessed, note that gap and continue only when the remaining PR context is still sufficient to proceed reliably @@ -45,11 +46,13 @@ $ARGUMENTS ### Align Local Branch - If `` is unavailable, STOP and report that the PR head branch could not be determined -- If `` differs from ``: +- If `` equals ``, store `` as `` +- Otherwise, if `` is unavailable and `` equals ``, store `` as `` because the repository is already aligned to the PR head in detached `HEAD` mode +- Otherwise: + - Run `git fetch origin ` to ensure the branch is available locally before checkout - Checkout `` before analyzing repository files or making code changes for this PR - After checkout, store the active branch as `` - If checkout fails, STOP and report that the PR branch could not be checked out locally -- Otherwise, store `` as `` - Do not inspect or modify local code for this PR until `` equals `` ### Analyze Feedback diff --git a/packages/opencode/.opencode/commands/pr/review.md b/packages/opencode/.opencode/commands/pr/review.md index 8566573..102dc3e 100644 --- a/packages/opencode/.opencode/commands/pr/review.md +++ b/packages/opencode/.opencode/commands/pr/review.md @@ -34,6 +34,7 @@ $ARGUMENTS - Store the result as `` - Store the PR head branch as `` from `.pr.headRefName` when it is available - Run `git branch --show-current` and store the trimmed result as `` when it is available +- Run `git rev-parse HEAD` and store the trimmed result as `` when it is available - Treat the loaded PR body, discussion, review history, and any attachments or linked artifacts returned by the loader as part of the source context - Review attached images, screenshots, videos, PDFs, and other linked files whenever they can affect the requested fix, review outcome, reproduction steps, or acceptance criteria - If any relevant attachment cannot be accessed, note that gap and continue only when the remaining PR context is still sufficient to proceed reliably @@ -41,11 +42,13 @@ $ARGUMENTS ### Align Local Branch - If `` is unavailable, STOP and report that the PR head branch could not be determined -- If `` differs from ``: +- If `` equals ``, store `` as `` +- Otherwise, if `` is unavailable and `` equals ``, store `` as `` because the repository is already aligned to the PR head in detached `HEAD` mode +- Otherwise: + - Run `git fetch origin ` to ensure the branch is available locally before checkout - Checkout `` before inspecting local repository files for this PR review - After checkout, store the active branch as `` - If checkout fails, STOP and report that the PR branch could not be checked out locally -- Otherwise, store `` as `` - Do not inspect local repository code for this PR until `` equals `` ### Load Ticket Context