diff --git a/autoplan/SKILL.md b/autoplan/SKILL.md index 49db38ff9..2e4888b3b 100644 --- a/autoplan/SKILL.md +++ b/autoplan/SKILL.md @@ -1637,8 +1637,11 @@ if command -v jq >/dev/null 2>&1; then # Filter to current branch + recent commits, then keep records for the # latest run_id only. (Single phase may have multiple files if the user # re-ran the review; aggregator takes the newest.) + # Bind the record's .commit to $c BEFORE entering the split-array pipe — + # inside ($commits | split("|") | ...) the input is the array, so a bare + # index(.commit) would index the array with the string "commit" and error. jq -c --arg branch "$BRANCH" --arg commits "$COMMITS_RECENT" \ - 'select(.branch == $branch and ($commits | split("|") | index(.commit) != null))' \ + 'select(.branch == $branch and (.commit as $c | ($commits | split("|") | index($c)) != null))' \ "$f" 2>/dev/null >> "$ALL_JSONL" || true done < <(find "$TASKS_DIR" -maxdepth 1 -name "tasks-$phase-*.jsonl" 2>/dev/null | sort) # Reduce to latest run_id per phase diff --git a/scripts/resolvers/tasks-section.ts b/scripts/resolvers/tasks-section.ts index 2f86f588b..13bc72d86 100644 --- a/scripts/resolvers/tasks-section.ts +++ b/scripts/resolvers/tasks-section.ts @@ -118,8 +118,11 @@ if command -v jq >/dev/null 2>&1; then # Filter to current branch + recent commits, then keep records for the # latest run_id only. (Single phase may have multiple files if the user # re-ran the review; aggregator takes the newest.) + # Bind the record's .commit to \$c BEFORE entering the split-array pipe — + # inside (\$commits | split("|") | ...) the input is the array, so a bare + # index(.commit) would index the array with the string "commit" and error. jq -c --arg branch "$BRANCH" --arg commits "$COMMITS_RECENT" \\ - 'select(.branch == $branch and ($commits | split("|") | index(.commit) != null))' \\ + 'select(.branch == $branch and (.commit as $c | ($commits | split("|") | index($c)) != null))' \\ "$f" 2>/dev/null >> "$ALL_JSONL" || true done < <(find "$TASKS_DIR" -maxdepth 1 -name "tasks-$phase-*.jsonl" 2>/dev/null | sort) # Reduce to latest run_id per phase