Skip to content

feat+docs: ralph-loop dependency declaration + runtime detect (Plan tier) - #36

Merged
kiki830621 merged 8 commits into
mainfrom
idd/28-feature-docs-idd-verify-loop-idd-all-una
May 7, 2026
Merged

kiki830621 merged 8 commits into
mainfrom
idd/28-feature-docs-idd-verify-loop-idd-all-una

Conversation

@kiki830621

Copy link
Copy Markdown
Member

Refs #28

Summary

3-layer implementation 解決 issue-driven-dev 隱性依賴 ralph-loop 的文件 + runtime gap:

  • Layer 1 (docs): plugin README 加 ### Required for specific modes matrix,4 row 涵蓋所有 mode/flag 對 ralph-loop 的依賴 + behavior-if-missing 說明
  • Layer 2 (runtime detect): scripts/check-ralph-loop.sh 新 helper + idd-verify --loop Step 0a fail-fast + idd-all Phase 0.6 graceful degrade
  • Layer 3 (forward-compat): plugin.json 加 dependencies.optional_for_modes.ralph-loop self-documenting field(等 Claude Code schema 升級即可 machine-enforce)

Verification

Plan tier (EnterPlanMode) approval gate 已通過。Helper script 3-case smoke test PASS:

  • ralph-loop installed → exit 0
  • rename to simulate missing → exit 1 + structured message
  • IDD_SKIP_RALPH_CHECK=1 bypass → exit 0

Critical verify catch: Layer 2 helper 初版 path schema 漏 <version>/ segment,smoke test 發現後改用 glob,正驗證了 plan-tier Risk 判斷(#35 watch-list 在 plan 階段已先行 file)。

JSON syntax for plugin.json validated (jq . clean).

Checklist

  • Diagnose ✓ (Plan complexity, V1=2 V4=3)
  • Plan tier approval gate ✓ (EnterPlanMode → ExitPlanMode user-approved)
  • Implement (5 commits across 3 layers)
  • Verify (run /idd-verify --pr for 6-AI ensemble; lightweight self-verify already done in implement)
  • Pending: human review of this PR + /idd-close after merge

Related


🤖 Generated by /idd-plan + /idd-implement (Plan tier). Do NOT add 'Closes #28' — IDD discipline requires manual /idd-close after merge.

@kiki830621

Copy link
Copy Markdown
Member Author

Verify Report — PR #36 / Issue #28

Engine

6-AI ensemble: Agent Team (5 Claude reviewers — requirements / logic / security / regression / devils-advocate) + Codex CLI (gpt-5.5 xhigh, independent gpt family)

Aggregate

FAIL — 1 P0 + 2 P1 + 2 P2 / P3 blocking findings, cross-AI consensus on multiple

Scope coverage

PR refs: #28 (primary) + #26/#29/#34/#35 (related). Verified scope: #28 (3-layer ralph-loop dependency).


Findings

# Severity Finding Source Action
F1 P0 plugin.json 的 dependencies field 現在就 validate-fail — Claude CLI 已將此 field 視為既有 (expects string[]),IDD 寫成 nested object → Invalid input: expected array, received object。claude plugin validate plugins/issue-driven-dev 失敗 = plugin 無法 update / tag / install Codex (gpt-5.5 independent) Blocking
F2 P1 idd-all Phase 0.6 graceful-degrade gate 太晚:Phase 0.5 已 git checkout -b idd/<N>-<slug> 建好 feature branch,Phase 0.6 才偵測 ralph-loop missing → degrade 時 BRANCH=$(git branch --show-current) 設成剛建的 feature branch,user 預期 commits 落 main / 自己 branch 但實際落 dangling idd/<N>-<slug>。Phase 0.6 沒 unwind logic Devils-Advocate (NEW finding,4 reviewer 都沒抓) + Codex (P1) Blocking
F3 P1 scripts/check-ralph-loop.sh:29 for f in $DETECT_GLOB 未 quote → HOME 含空白(macOS Mobile Documents、display-name account)時 word-splitting → false-negative。即使 ralph-loop 已裝,idd-verify --loop 會 fail-fast abort,idd-all (PR, unattended) 會 silent degrade — 直接破壞 v2.40.0 backward-compat 設計。SC2086 shellcheck disable 反而 forfeit 警告 Logic + Security + Codex (cross-AI consensus) Blocking
F4 P2 IDD_SKIP_RALPH_CHECK=1 bypass 路徑完全 silent(無 stderr warning),且 README + idd-verify SKILL.md 都沒文件化此 env var。CI 誤設或 hostile container base image 可導致「fake green CI」(--loop 跑了但無 ralph-loop driver) Security Should-fix
F5 P3 Manifest plugin.json version 仍 2.52.0,但新加內容多處標 v2.53+(README + idd-verify SKILL.md + idd-all SKILL.md) → 若直接發 release,新功能不會被版本化交付,使用者看到 v2.52 但行為已變 Codex Should-fix

Cross-AI Consensus

3 個 reviewer 獨立抓到 F3 (HOME spaces):logic 從 edge-case 角度、security 從 trust-boundary 角度、Codex 從跨模型 reproduce。Cross-AI consensus = high confidence = real bug。

DA 反駁了 requirements 的「Layer 3 FULLY addressed」結論 — 發現 brightdata-plugin (Anthropic 官方) 已用 dependencies: ["curl", "jq"] (string[]) 格式,IDD 的 nested object 格式 schema clash。Codex 之後驗證 claude plugin validate 也確認 fail。

Verdict per reviewer

  • Requirements: PASS (對齊 plan,但沒驗 plan 對齊 ecosystem)
  • Logic: 3 P1 + 4 P2 (HOME spaces / SKILL.md instruction misuse / dead code)
  • Security: APPROVE WITH CHANGES (F1 = HOME spaces blocker, F3 = silent bypass)
  • Regression: PASS with version-string note (F5)
  • Devils-Advocate: SUSTAINED 2 NEW findings (F2 BRANCH bug, F1 schema clash) — 4 reviewer 共同盲點
  • Codex (independent gpt-5.5): FAIL — P0 plugin.json validate-fail + P1 phase order + P3 manifest

Recommended round-2 fixes (before merge)

  1. F1 (P0) — Remove or restructure plugin.json dependencies field:
    • Option A: 完全移除(Layer 3 退到「README only」)— 最保守
    • Option B: 改成 dependencies: ["claude-plugins-official/ralph-loop"] (string[]) 對齊 brightdata pattern,但失去 IDD 想加的 metadata 細節
    • Option C: 把 metadata 搬到非標欄位(如 _idd_dependencies underscore prefix)讓 schema validator 忽略
  2. F2 (P1) — Phase 0.6 degrade 時必須:
    • git checkout $DEFAULT_BRANCH 切回原 branch
    • git branch -d idd/<N>-<slug> 清掉剛建的 branch
    • 然後才 set PATH_AXIS=direct-commit + 印 warning
  3. F3 (P1) — scripts/check-ralph-loop.sh 改用 shopt -s nullglob + bash array:
    shopt -s nullglob
    files=( "${HOME}/.claude/plugins/cache/claude-plugins-official/ralph-loop"/*/.claude-plugin/plugin.json )
    shopt -u nullglob
    if (( ${#files[@]} > 0 )); then exit 0; fi
  4. F4 (P2) — bypass 觸發時 echo "⚠ IDD_SKIP_RALPH_CHECK=1 set — skipping ralph-loop detection (advanced override)" >&2
  5. F5 (P3) — bump plugin.json version 2.52.0 → 2.53.0(這是 minor feature release)

Sister observations (no follow-up issue needed)

  • idd-verify Step 0a "$CLAUDE_PLUGIN_ROOT/scripts/check-ralph-loop.sh" || exit 1 寫法假設 skill runtime 會 source 這段 — logic reviewer 質疑是否真會 abort skill execution。Implementation 階段需驗證
  • DA R1.b 提到 brightdata-plugin 的 dependencies schema 是 forward-compat 評估 input —已併入 F1

Next action

PR #36 不該 merge as-is。建議 round-2 fix 後 re-verify。或選擇:

  • Quick path: revert Layer 3 (remove plugin.json dependencies),保留 Layer 1 + 2,Layer 1 R3 docs note 補丁 → re-verify
  • Full path: 修全部 5 finding,re-verify

@kiki830621

Copy link
Copy Markdown
Member Author

Round-2 Fix Complete (responding to verify FAIL)

3 fix commits address all 5 verify findings:

Finding Severity Fix Commit
F1 P0 Remove plugin.json dependencies field entirely (schema validator rejects unknown keys, including _idd_ prefix). Layer 3 retreats to README-only documentation per option A. claude plugin validate now ✓ passes 96bdb6e
F5 P3 Bump plugin.json version 2.52.0 → 2.53.0 to match v2.53+ content tags 96bdb6e
F3 P1 scripts/check-ralph-loop.sh 改用 shopt -s nullglob + bash array (HOME-with-spaces no longer breaks glob) f2366bc
F4 P2 IDD_SKIP_RALPH_CHECK=1 bypass 加 stderr warning(audit trail) f2366bc
F2 P1 idd-all Phase 0.6 graceful-degrade 加 unwind logic:git checkout $DEFAULT + git branch -d $BRANCH 清掉 Phase 0.5 建好的 feature branch,degrade 後 commits 才會落在正確 branch 5f9b672

Self-verify

  • claude plugin validate plugins/issue-driven-dev → ✓ Validation passed (CLAUDE.md warning is pre-existing, not introduced by this PR)
  • helper script 4-case smoke test PASS:installed (exit 0) / HOME-with-spaces installed (exit 0,F3 regression case) / missing (exit 1) / IDD_SKIP_RALPH_CHECK=1 + missing (exit 0 + warning,F4)
  • Phase 0.6 unwind logic 寫入 SKILL.md 含 edge-case 處理(commits-already-present case 不 swallow,refuse + abort)
  • Trace 4 example 同步更新含 unwind output

Cross-AI consensus claims status

  • Logic + Security + Codex 共抓的 F3 (HOME spaces): fixed
  • DA NEW finding F2 (BRANCH bug): fixed with explicit unwind 邏輯
  • Codex P0 F1: fixed by removal (退到 README-only)
  • DA R1.b (dependencies schema clash with brightdata-plugin): resolved by F1 fix
  • F5 version mismatch: fixed

Remaining concerns from original verify

  • DA R1.c "spec drift (user wrote fail-fast, plan changed to graceful-degrade)" — acknowledged in plan B4,non-blocking design choice approved at Plan tier
  • Logic P2-x notes about $CLAUDE_PLUGIN_ROOT runtime invocation — inherited Claude Code skill convention,not changed in this PR
  • Pre-existing CLAUDE.md root warning — out of scope (warning was there before this PR)

Ready for re-verify or direct merge per IDD discipline。

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.

feature+docs: idd-verify --loop / idd-all unattended 隱性依賴 ralph-loop — 應宣告 + auto-detect + 內建探索

1 participant