From 97f27f17ce13c044ce2915828ad6ce5fa026885b Mon Sep 17 00:00:00 2001 From: Lex Christopherson Date: Wed, 11 Mar 2026 10:57:19 -0600 Subject: [PATCH] fix: prevent discuss prompt loop and refresh star history link --- README.md | 8 +++- .../extensions/gsd/prompts/discuss.md | 4 +- .../gsd/tests/discuss-prompt.test.ts | 38 +++++++++++++++++++ 3 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 src/resources/extensions/gsd/tests/discuss-prompt.test.ts diff --git a/README.md b/README.md index 998465003..b9c0e6081 100644 --- a/README.md +++ b/README.md @@ -412,7 +412,13 @@ Use expensive models where quality matters (planning, complex execution) and che ## Star History -[![Star History Chart](https://api.star-history.com/svg?repos=gsd-build/GSD-2&type=Date)](https://star-history.com/#gsd-build/GSD-2&Date) + + + + + Star History Chart + + --- diff --git a/src/resources/extensions/gsd/prompts/discuss.md b/src/resources/extensions/gsd/prompts/discuss.md index f315c8224..0e8f52845 100644 --- a/src/resources/extensions/gsd/prompts/discuss.md +++ b/src/resources/extensions/gsd/prompts/discuss.md @@ -1,6 +1,8 @@ {{preamble}} -Say exactly: "What's the vision?" — nothing else. Wait for the user's answer. +Ask: "What's the vision?" once, and then use whatever the user replies with as the vision input to continue. + +Special handling: if the user message is not a project description (for example, they ask about status, branch state, or other clarifications), treat it as the vision input and proceed with discussion logic instead of repeating "What's the vision?". ## Discussion Phase diff --git a/src/resources/extensions/gsd/tests/discuss-prompt.test.ts b/src/resources/extensions/gsd/tests/discuss-prompt.test.ts new file mode 100644 index 000000000..cab45aaca --- /dev/null +++ b/src/resources/extensions/gsd/tests/discuss-prompt.test.ts @@ -0,0 +1,38 @@ +import { readFileSync } from 'node:fs'; +import { join } from 'node:path'; + +let passed = 0; +let failed = 0; + +function assert(condition: boolean, message: string): void { + if (condition) passed++; + else { + failed++; + console.error(` FAIL: ${message}`); + } +} + +const promptPath = join(process.cwd(), 'src/resources/extensions/gsd/prompts/discuss.md'); +const discussPrompt = readFileSync(promptPath, 'utf-8'); + +console.log('\n=== discuss prompt: resilient vision framing ==='); +{ + const hardenedPattern = /Say exactly:\s*"What's the vision\?"/; + assert(!hardenedPattern.test(discussPrompt), 'prompt no longer uses exact-verbosity lock'); + assert( + discussPrompt.includes('Ask: "What\'s the vision?" once'), + 'prompt asks for vision exactly once', + ); + assert( + discussPrompt.includes('Special handling'), + 'prompt documents special handling for non-vision user messages', + ); + assert( + discussPrompt.includes('instead of repeating "What\'s the vision?"'), + 'prompt forbids repeating the vision question', + ); +} + +console.log(`\nResults: ${passed} passed, ${failed} failed`); +if (failed > 0) process.exit(1); +console.log('All tests passed ✓');