Skip to content

fix: process-attachments.md .gitignore example keeps _manifest.json trackable (#432) - #450

Open
kiki830621 wants to merge 3 commits into
mainfrom
idd/432-rules-process-attachments-md-gitignore-m
Open

kiki830621 wants to merge 3 commits into
mainfrom
idd/432-rules-process-attachments-md-gitignore-m

Conversation

@kiki830621

Copy link
Copy Markdown
Member

Refs #432

Summary

rules/process-attachments.md 的 .gitignore 範例原本用 .claude/.idd/attachments/** 加 !.claude/.idd/attachments/**/_manifest.json。問題是 ** 也會匹配 issue-N/ 這個目錄本身,而 git 沒辦法在已被排除的目錄底下再撈回檔案,所以 manifest 也一起被忽略了,git add .claude/.idd/attachments/issue-N 會失敗。

  • 範例改成 .claude/.idd/attachments/*/* 加 !.claude/.idd/attachments/*/_manifest.json,並說明為什麼不能用 **
  • 補寫涵蓋範圍:只涵蓋 issue-N/ 底下,也就是 IDD 唯一會寫入的位置
  • 補寫前提:如果前面已有規則排除 .claude/ 或 .claude/.idd/(包括 Stage 4.5 的 run-log carve-out chain),manifest 仍然撈不回來;並寫出要怎麼加回來
  • 新增 suite scripts/tests/attachments-gitignore-example/:從規則檔逐字抽出範例,放到不受使用者 git 設定影響的暫存 repo 裡驗證,fixture 包含無副檔名、隱藏檔與子目錄的檔案

Verification

Claude-only verification PASS(這是雲端 session,Codex 那一路沒有跑,屬降級驗證)。詳見 issue #432 的 Verify comment:#432 (comment)

  • 新 suite 10/10。舊範例會失敗 3 項;較弱的 attachments/*/*.*、在 block 裡插入 ## 都會被抓到;使用者的 excludes 檔不影響結果
  • run-all-tests.sh 中失敗的 idd-repo-map、idd-tree-lock,在乾淨的 main 上以 root 執行也一樣失敗,與本 PR 無關

Checklist

  • Diagnose ✓
  • Implement(3 commits)
  • Verify ✓
  • Verify-gated: verify PASS — ready to merge → after merge, run /idd-close to finalize this issue (manual gate + closing summary; no auto-close trailer)

Related


🤖 Generated by /idd-all. Do NOT add a GitHub close trailer (Closes/Fixes/Resolves) — IDD discipline requires manual /idd-close after merge to enforce checklist gate + closing summary.


Generated by Claude Code

…rackable (#432)

`.claude/.idd/attachments/**` also matches the issue-N/ directory, and git
cannot re-include a file under an excluded directory, so the
`!…/**/_manifest.json` line never took effect. The example is now
`attachments/*/*` + `!attachments/*/_manifest.json`, with a sentence on why
`**` cannot work. The new attachments-gitignore-example suite extracts the
fenced block from the rule file and checks it in a throwaway repo: manifest
not ignored, binaries ignored, `git add issue-N/` stages only the manifest.

Refs #432

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TdBi8k2uM27M7TAdunMnmo
…432's attachment manifest

Refs #432

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TdBi8k2uM27M7TAdunMnmo
…the example (#432)

From the /idd-verify report on #432 (all In-scope, no blocking):
- the example's awk extraction stops at `## ` only outside the code block
- the test is isolated from the caller's git: no GIT_DIR / GIT_INDEX_FILE
  inherited, no global or system config, core.excludesFile=/dev/null (the
  per-user ~/.config/git/ignore is read even with GIT_CONFIG_GLOBAL=/dev/null)
- a failed mktemp stops the test instead of running git in the caller's repo
- fixtures add an extensionless file (GitHub image attachments have none), a
  .docx, a hidden file and a subdirectory: `attachments/*/*.*` now fails
- the rule says what the pair covers (inside issue-N/ only) and that an
  earlier rule excluding .claude/ or .claude/.idd/ — including Stage 4.5's
  run-log carve-out chain — keeps the manifest ignored, and how to fix it

Refs #432

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TdBi8k2uM27M7TAdunMnmo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants