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 3 commits into
Conversation
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. |
Alan-TheGentleman
left a comment
There was a problem hiding this comment.
This touches the SDD search architecture, so process alone is not enough here.
Please add the required type:feature label, refresh CI, and document the design boundary clearly: detection contract, fallback behavior, and why grep remains the safe default.
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
068589a to
537dfbe
Compare
|
Updated the PR again after rebasing on the latest upstream main.\n\nWhat changed:\n- Rebased the branch onto current main and resolved the SDD asset refactors.\n- Moved the code search protocol references to Section F because Section E is now the Review Workload Guard.\n- Extended search_strategy forwarding coverage to all 11 orchestrator assets, including opencode, kiro, kimi, and qwen.\n- Added deterministic contract tests for the search strategy boundary and forwarding behavior.\n- Added docs/sdd-search-strategy.md documenting the detection contract, fallback behavior, why grep remains the safe default, and local grep-style baseline measurements.\n- Regenerated SDD golden files.\n\nValidation run:\n- go test ./internal/assets\n- go test ./internal/components -run TestGoldenSDD\n\nNote: I could not add the type:feature label from this fork due to GitHub label permissions on the upstream repository. |
|
Small permissions update:\n\n- I tried to add the requested type:feature label, but GitHub returned a permissions error for this fork: AddLabelsToLabelable is not allowed for Lotto724. A maintainer will need to add that label from the upstream repository.\n- The latest push did trigger the PR workflows, but both runs are currently marked action_required, which appears to require maintainer approval for forked PR workflows:\n - CI: https://github.com/Gentleman-Programming/gentle-ai/actions/runs/25630593454\n - PR Validation: https://github.com/Gentleman-Programming/gentle-ai/actions/runs/25630593455\n\nEverything else requested in the review has been addressed in the branch. |
|
Heads-up: this PR is now showing a merge conflict against Could you rebase against current git fetch upstream main
git rebase upstream/main
# resolve any conflicts
git push --force-with-leaseOnce it's green again I can review for merge. Sorry for the drift — it's the cost of the cleanup velocity. Thanks for sticking with it. |
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