feat(sdd): add configurable search strategy for code-reading phases#267
feat(sdd): add configurable search strategy for code-reading phases#267Lotto724 wants to merge 2 commits intoGentleman-Programming:mainfrom
Conversation
Add search_strategy config (grep|hybrid) to SDD skill system, enabling MCP RAG-based semantic code search with grep fallback for code-reading phases (sdd-explore, sdd-apply, sdd-verify). - Section E in sdd-phase-common.md: cascade protocol (RAG → Grep → Read) - Step 3.5 in sdd-init: auto-detection of MCP RAG tools - Config schema: search_strategy.mode + rag.mcp_tool + rag.reindex_tool - Consumer phases reference Section E for code search - Reindex hook in sdd-apply: fire-and-forget after batch - Backwards compatible: missing config = grep = current behavior Closes Gentleman-Programming#266
Alan-TheGentleman
left a comment
There was a problem hiding this comment.
Review: feat(sdd): add configurable search strategy for code-reading phases
Nice work on the overall design — the pattern reuse from strict_tdd, backwards compatibility, and graceful degradation are all solid. One critical gap before this can merge:
Critical: Missing orchestrator forwarding
The search_strategy config is detected in sdd-init and consumed by sdd-explore/sdd-apply/sdd-verify, but the orchestrator instruction files (internal/assets/*/sdd-orchestrator.md) are not updated. There is no "Search Strategy Forwarding" section analogous to the existing "Strict TDD Forwarding (MANDATORY)" block.
Without this, the orchestrator will never pass search_strategy to sub-agents — they start with a fresh context and can't discover the config on their own.
Fix: Add a forwarding section to all 7 engine orchestrator files, mirroring the strict TDD forwarding pattern. Search for sdd-init/{project}, extract search_strategy, inject it into prompts for the 3 code-reading phases.
Minor suggestions
-
sdd-apply Step 2 item 3: Dense run-on sentence. Consider splitting into 3a (read search_strategy + cache) and 3b (read existing code via Section E).
-
Reindex hook placement: Sits between Step 6 and Step 7 without a step number. A "Step 6b" label would be more consistent.
-
Auto-detection heuristic: Consider noting that the tool description should mention "semantic"/"vector"/"embedding" to avoid false positives on generic
code_searchtools. -
Section E ">=2 relevant snippets": Threshold is subjective — consider clarifying what "relevant" means or dropping the number.
The critical fix is mechanical (7 orchestrator files + goldens), then this is good to go.
|
Updated the PR to address all review feedback:\n- Added mandatory search_strategy forwarding in all orchestrator instructions (mirrors strict TDD forwarding).\n- Clarified sdd-apply Step 2 (split 3a/3b) and labeled reindex as Step 6b.
Ready for re-review. |
Summary
search_strategyconfig (grep|hybrid) to SDD skill system, enabling MCP RAG-based semantic code search with grep fallbacksdd-phase-common.mddefines the cascade protocol: RAG → Grep → targeted Readsdd-initauto-detects MCP RAG tools (same pattern asstrict_tdd— no interactive prompts)reindex_toolfires once persdd-applybatch (fire-and-forget)grepmode = current behavior unchangedCloses #266
Changes
_shared/sdd-phase-common.md_shared/persistence-contract.mdsearch_strategyschema in sub-agent contextsdd-init/SKILL.mdsdd-explore/SKILL.mdsdd-apply/SKILL.mdsdd-verify/SKILL.mdtestdata/golden/sdd-*-init.goldenDesign decisions
grep/hybrid) — no standaloneragmode (too risky without fallback)strict_tddpattern: detect in sdd-init → persist → phases branch on configTest plan
sdd-initwithout RAG MCP server → confirmgrepdefault, zero changesdd-initwith RAG MCP server → confirmhybridauto-detectedsdd-explorein hybrid mode → confirm RAG → grep fallback cascade