feat(skill): union-of-scopes детект изменений для code-режима

- Зачем:
  - типичный PR-флоу: ветка ahead of base + (часто) локальный твик поверх. Прежняя логика смотрела только unstaged/staged и пропускала коммиты ветки, давая пустое или неполное ревью.
- Что:
  - Step 1 auto-detect: добавлен третий независимый scope `git diff <base>...HEAD` с резолвом base (`symbolic-ref refs/remotes/origin/HEAD` → `origin/main` → `origin/master` → `main` → `master`).
  - Step 2 dispatch: briefing для `code` и `code-vs-plan` переписан с fallback на union трёх скоупов, явное "do not skip branch-vs-base because working tree is non-empty".
  - reviewer-prompt.md: `{ARTIFACT}` placeholder теперь спеллует все три scope (a)(b)(c) с инструкцией про labeling mixed-state.
  - README.md: таблица "Three modes" и пояснение синхронизированы с union-семантикой.
- Проверка:
  - на ветке feat/cross-platform-receiving-review одновременно непустые `git diff` и `git diff origin/main...HEAD` — финальная формулировка прошла Codex review (3 раунда, VERDICT: APPROVED).
This commit is contained in:
2026-05-15 16:25:23 +03:00
parent 657e7c3507
commit 933c48fb3c
3 changed files with 56 additions and 10 deletions
+22 -2
View File
@@ -27,8 +27,28 @@ is a real weakness.
{ARTIFACT}
# For mode=plan: path to plan file, OR full inline plan text
# For mode=code: "Use git status / git diff to find changes."
# For mode=code-vs-plan: plan path or inline plan + "use git for code changes"
# For mode=code: "Find the changes via git. Review the UNION of
# three independent scopes — do not stop after
# the first non-empty one:
# (a) unstaged: `git diff`
# (b) staged: `git diff --cached`
# (c) branch-vs-base: resolve <base> by
# trying `git symbolic-ref
# refs/remotes/origin/HEAD`, then
# `origin/main`, `origin/master`, `main`,
# `master`; then
# `git diff <base>...HEAD` plus
# `git log <base>..HEAD` for commit context.
# Do not skip (c) because (a) or (b) are
# non-empty — the typical PR has commits on the
# branch and an in-progress local tweak on top,
# and the operator is asking about both. If the
# scopes are mixed (e.g., committed changes plus
# unstaged ones), label findings by scope where
# it matters and surface the mixed state in the
# summary."
# For mode=code-vs-plan: plan path or inline plan + the same union git
# lookup instruction as mode=code
## Round