fix(loop): resolve P0-1 (B-7) git diff CWD isolation and untracked file capture (20/20 PASS)
This commit is contained in:
@@ -10,6 +10,8 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
REPO_ROOT="$(cd "$SCRIPT_DIR/../../../.." && pwd)"
|
||||
# shellcheck disable=SC1091
|
||||
source "$REPO_ROOT/.agents/skills/lib.sh"
|
||||
# shellcheck disable=SC1091
|
||||
source "$REPO_ROOT/.agents/skills/multi-agent-mux-loop/scripts/diff_collect.sh"
|
||||
|
||||
# Default configuration parameters
|
||||
PLAN_MODE=false
|
||||
@@ -428,7 +430,7 @@ log_info "=== Phase 2: Code Implementation ==="
|
||||
|
||||
# Fix the pre-implementation commit as the diff baseline so review diffs stay
|
||||
# cumulative and non-empty even after the Creator commits per DoD (P0-1).
|
||||
BASE_COMMIT=$(git rev-parse HEAD 2>/dev/null || echo "")
|
||||
BASE_COMMIT=$(cd -P "$REPO_ROOT" 2>/dev/null && git rev-parse HEAD 2>/dev/null || echo "")
|
||||
|
||||
EXECUTION_PROMPT="계획서가 존재하지 않으므로, 작업자(Creator)의 판단하에 스스로 구현 계획 및 설계를 수립한 뒤, 이를 바탕으로 코드를 구현하고 다음 작업 목표를 완성해주세요. 작업 목표: $TASK"
|
||||
if [ -n "$CURRENT_PLAN" ]; then
|
||||
@@ -520,6 +522,12 @@ while [ "$loop_count" -le "$MAX_LOOP" ]; do
|
||||
else
|
||||
log_info "Active reviewers: ${REVIEWERS[*]}"
|
||||
|
||||
CHANGES_DIFF=$(mam_collect_changes_diff "$REPO_ROOT" "$BASE_COMMIT") || {
|
||||
log_error "Could not determine the change set; refusing to request a review on no evidence."
|
||||
log_error "$CHANGES_DIFF"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# We use space-separated lists or simple loops to bypass bash-4 associative array requirement (M-7 macOS compatibility)
|
||||
declare -a JOB_IDS=()
|
||||
declare -a JOB_REVS=()
|
||||
@@ -530,14 +538,6 @@ while [ "$loop_count" -le "$MAX_LOOP" ]; do
|
||||
|
||||
for rev in "${REVIEWERS[@]}"; do
|
||||
log_info "Requesting code review from Reviewer '$rev'..."
|
||||
# Cumulative diff since BASE_COMMIT (M-6): includes committed AND
|
||||
# uncommitted changes, so it stays non-empty even after the Creator
|
||||
# commits per the documented DoD (bare `git diff` alone would not).
|
||||
if [ -n "$BASE_COMMIT" ]; then
|
||||
CHANGES_DIFF=$(git diff "$BASE_COMMIT" 2>/dev/null || echo "No git diff available")
|
||||
else
|
||||
CHANGES_DIFF=$(git diff 2>/dev/null || echo "No git diff available")
|
||||
fi
|
||||
|
||||
REV_OUTPUT=$(delegate_job_safe submit \
|
||||
--agent-session "herdr:$rev" \
|
||||
|
||||
Reference in New Issue
Block a user