Skip to content

Commit df99960

Browse files
committed
fix: correct idd-verify auto_tag snippet — walk-up config + snapshot=HEAD (#85)
Self-review of PR #250 found two defects in the idd-verify Step 4.5 prose: - $CONFIG_PATH was undefined (idd-verify has no find_idd_config, unlike idd-issue) — now resolves the walked-up config inline (new path first, legacy fallback). - $INPUT_SOURCE / $PR_HEAD_SHA were undefined AND unnecessary: tag_verified runs before restore_working_tree, so HEAD is already the PR head in PR mode (gh pr checkout done in Step 0.5) and the verified tree in local mode. Snapshot simplifies to HEAD. Drift-guard stays 27/27. Refs #85
1 parent 0aa17a5 commit df99960

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

  • plugins/issue-driven-dev/skills/idd-verify

plugins/issue-driven-dev/skills/idd-verify/SKILL.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -921,15 +921,19 @@ Master report 貼出、且 **Aggregate PASS** 後,`tag_verified` step 在 revi
921921
```bash
922922
# Only when Aggregate verdict == PASS
923923
[ "$AGGREGATE_VERDICT" != "PASS" ] && { echo "→ verify FAIL — no verified tag"; } # FAIL: no snapshot tag
924+
# resolve the walked-up IDD config (new path first, legacy fallback — see the Configuration section)
925+
CONFIG_PATH=$(d="$PWD"; while [ "$d" != / ]; do for f in "$d/.claude/.idd/local.json" "$d/.claude/issue-driven-dev.local.json"; do [ -f "$f" ] && { echo "$f"; break 2; }; done; d=$(dirname "$d"); done)
924926
AUTO_TAG_ENABLED=$(jq -r '.auto_tag.enabled // true' "$CONFIG_PATH" 2>/dev/null || echo true)
925927
[ "$AUTO_TAG_ENABLED" = "false" ] && { echo "→ auto_tag disabled — skipping verified tag"; } # opt-out
926928
927929
VERIFIED_FMT=$(jq -r '.auto_tag.verified_format // "idd-{N}-verified"' "$CONFIG_PATH" 2>/dev/null || echo "idd-{N}-verified")
928930
PUSH_REMOTE=$(jq -r '.auto_tag.push_remote // "origin"' "$CONFIG_PATH" 2>/dev/null || echo origin)
929-
# snapshot target: PR head (PR mode) / current HEAD (local mode)
930-
SNAPSHOT=$([ "$INPUT_SOURCE" = "pr" ] && echo "$PR_HEAD_SHA" || echo HEAD)
931+
# snapshot = HEAD. tag_verified runs BEFORE restore_working_tree, so in PR mode
932+
# HEAD is still the PR head (Step 0.5 already ran `gh pr checkout`); in local
933+
# mode (--commits / --since) HEAD is the tree just verified. Either way = HEAD.
934+
SNAPSHOT=HEAD
931935
932-
for N in $ISSUE_NUMBERS; do # cluster: tag each ref'd #N
936+
for N in $ISSUE_NUMBERS; do # cluster: tag each ref'd issue (#N set from Step 0.5)
933937
TAG="${VERIFIED_FMT/\{N\}/$N}" # idd-{N}-verified → idd-42-verified
934938
if git rev-parse -q --verify "refs/tags/$TAG" >/dev/null; then
935939
echo "→ $TAG already exists — skip (idempotent)" # re-verify never re-tags

0 commit comments

Comments
 (0)