perf(workflow): include Depends on phases in prior-phase context (#1969)
Per approved spec in #1969, the planner must include CONTEXT.md and SUMMARY.md from any phases listed in the current phase's 'Depends on:' field in ROADMAP.md, in addition to the 3 most recent completed phases. This ensures explicit dependencies are always visible to the planner regardless of recency — e.g., Phase 7 declaring 'Depends on: Phase 2' always sees Phase 2's context, not just when Phase 2 is among the 3 most recent. Review feedback on #2058 from @trek-e.
This commit is contained in:
@@ -34,7 +34,7 @@ AGENT_SKILLS_CHECKER=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" agen
|
||||
CONTEXT_WINDOW=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" config-get context_window 2>/dev/null || echo "200000")
|
||||
```
|
||||
|
||||
When `CONTEXT_WINDOW >= 500000`, the planner prompt includes the 3 most recent prior phase CONTEXT.md and SUMMARY.md files so cross-phase decisions are consistent (e.g., "use library X for all data fetching" from Phase 2 is visible to Phase 5's planner). Limited to 3 to stay within context budget on large projects.
|
||||
When `CONTEXT_WINDOW >= 500000`, the planner prompt includes the 3 most recent prior phase CONTEXT.md and SUMMARY.md files PLUS any phases explicitly listed in the current phase's `Depends on:` field in ROADMAP.md. Explicit dependencies always load regardless of recency (e.g., Phase 7 declaring `Depends on: Phase 2` always sees Phase 2's context). Bounded recency keeps the planner's context budget focused on recent work.
|
||||
|
||||
Parse JSON for: `researcher_model`, `planner_model`, `checker_model`, `research_enabled`, `plan_checker_enabled`, `nyquist_validation_enabled`, `commit_docs`, `text_mode`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `padded_phase`, `has_research`, `has_context`, `has_reviews`, `has_plans`, `plan_count`, `planning_exists`, `roadmap_exists`, `phase_req_ids`, `response_language`.
|
||||
|
||||
@@ -642,10 +642,11 @@ Planner prompt:
|
||||
- {reviews_path} (Cross-AI Review Feedback - if --reviews)
|
||||
- {UI_SPEC_PATH} (UI Design Contract — visual/interaction specs, if exists)
|
||||
${CONTEXT_WINDOW >= 500000 ? `
|
||||
**Cross-phase context (1M model enrichment — 3 most recent prior phases only):**
|
||||
**Cross-phase context (1M model enrichment):**
|
||||
- CONTEXT.md files from the 3 most recent completed phases (locked decisions — maintain consistency)
|
||||
- SUMMARY.md files from the 3 most recent completed phases (what was built — reuse patterns, avoid duplication)
|
||||
- Skip phases older than the 3 most recent to stay within context budget
|
||||
- CONTEXT.md and SUMMARY.md from any phases listed in the current phase's "Depends on:" field in ROADMAP.md (regardless of recency — explicit dependencies always load, deduplicated against the 3 most recent)
|
||||
- Skip all other prior phases to stay within context budget
|
||||
` : ''}
|
||||
</files_to_read>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user