Joshua Duffill
0782b5bdf0
fix: prevent infinite self-discuss loop in auto/headless mode ( #1426 )
...
When running in --auto or headless mode, the discuss step could loop
indefinitely — each pass reads its own CONTEXT.md, finds "gaps" in
referenced types/interfaces, creates new decisions to fill them, and
repeats. Observed: 34 passes, 167 decisions, 7 hours, zero code written.
Fixes:
- Add max_discuss_passes config (default: 3) to WorkflowConfig
- Add single-pass guard instruction to SDK self-discuss prompt
- Add pass cap documentation to CLI discuss-phase workflow
- Add pass guard step to SDK headless discuss-phase prompt
- Add stall detection note to autonomous workflow
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-31 09:25:03 +02:00
odmrs
39d8688245
fix(sdk): skip advance step when verification finds gaps
...
Previously, the advance step ran unconditionally after verify,
marking phases as complete in ROADMAP.md even when gaps_found.
This caused subsequent auto runs to skip unfinished phases.
Now checks if all verify steps passed before advancing. When
verification fails, the phase remains incomplete so the next
auto run re-attempts it.
2026-03-28 11:53:41 -03:00
TÂCHES
38c18ac68a
feat: Headless prompt overhaul — SDK drives full lifecycle without interactive patterns ( #1419 )
...
* fix: Created 10 headless prompt files (5 workflows + 5 agents) in sdk/p…
- "sdk/prompts/workflows/execute-plan.md"
- "sdk/prompts/workflows/research-phase.md"
- "sdk/prompts/workflows/plan-phase.md"
- "sdk/prompts/workflows/verify-phase.md"
- "sdk/prompts/workflows/discuss-phase.md"
- "sdk/prompts/agents/gsd-executor.md"
- "sdk/prompts/agents/gsd-phase-researcher.md"
- "sdk/prompts/agents/gsd-planner.md"
GSD-Task: S01/T02
* feat: Created prompt-sanitizer.ts, wired headless prompt loading into P…
- "sdk/src/prompt-sanitizer.ts"
- "sdk/src/phase-prompt.ts"
- "sdk/src/gsd-tools.ts"
- "sdk/src/gsd-tools.test.ts"
- "sdk/src/phase-runner-types.test.ts"
GSD-Task: S01/T01
* test: Added 111 unit tests covering sanitizePrompt(), headless prompt l…
- "sdk/src/prompt-sanitizer.test.ts"
- "sdk/src/headless-prompts.test.ts"
- "sdk/src/phase-prompt.test.ts"
GSD-Task: S01/T03
* feat: Wired sdkPromptsDir preference and sanitizePrompt into InitRunner…
- "sdk/src/init-runner.ts"
- "sdk/package.json"
GSD-Task: S02/T01
* feat: add --init flag to auto command for single-command PRD-to-execution
gsd-sdk auto --init @path/to/prd.md now bootstraps the project (init)
then immediately runs the autonomous phase execution loop.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
* chore: add remaining headless prompt files and templates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
* test: Extended init-runner.test.ts with 7 sdkPromptsDir preference and…
- "sdk/src/init-runner.test.ts"
GSD-Task: S02/T03
* test: Created sdk/src/assembled-prompts.test.ts with 74 tests verifying…
- "sdk/src/assembled-prompts.test.ts"
GSD-Task: S03/T01
* chore: auto-commit after complete-milestone
GSD-Unit: M003-75c8bo
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-27 01:00:04 -06:00
TÂCHES
89f95c43ba
feat: auto --init flag, headless prompts, and prompt sanitizer ( #1417 )
...
* fix: Created 10 headless prompt files (5 workflows + 5 agents) in sdk/p…
- "sdk/prompts/workflows/execute-plan.md"
- "sdk/prompts/workflows/research-phase.md"
- "sdk/prompts/workflows/plan-phase.md"
- "sdk/prompts/workflows/verify-phase.md"
- "sdk/prompts/workflows/discuss-phase.md"
- "sdk/prompts/agents/gsd-executor.md"
- "sdk/prompts/agents/gsd-phase-researcher.md"
- "sdk/prompts/agents/gsd-planner.md"
GSD-Task: S01/T02
* feat: Created prompt-sanitizer.ts, wired headless prompt loading into P…
- "sdk/src/prompt-sanitizer.ts"
- "sdk/src/phase-prompt.ts"
- "sdk/src/gsd-tools.ts"
- "sdk/src/gsd-tools.test.ts"
- "sdk/src/phase-runner-types.test.ts"
GSD-Task: S01/T01
* test: Added 111 unit tests covering sanitizePrompt(), headless prompt l…
- "sdk/src/prompt-sanitizer.test.ts"
- "sdk/src/headless-prompts.test.ts"
- "sdk/src/phase-prompt.test.ts"
GSD-Task: S01/T03
* feat: Wired sdkPromptsDir preference and sanitizePrompt into InitRunner…
- "sdk/src/init-runner.ts"
- "sdk/package.json"
GSD-Task: S02/T01
* feat: add --init flag to auto command for single-command PRD-to-execution
gsd-sdk auto --init @path/to/prd.md now bootstraps the project (init)
then immediately runs the autonomous phase execution loop.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
* chore: add remaining headless prompt files and templates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
* test: Extended init-runner.test.ts with 7 sdkPromptsDir preference and…
- "sdk/src/init-runner.test.ts"
GSD-Task: S02/T03
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-26 22:40:34 -06:00
TÂCHES
596ce2d252
feat: GSD SDK — headless CLI with init + auto commands ( #1407 )
...
* test: Bootstrapped sdk/ as TypeScript ESM package with full GSD-1 PLAN.…
- "sdk/package.json"
- "sdk/tsconfig.json"
- "sdk/vitest.config.ts"
- "sdk/src/types.ts"
- "sdk/src/plan-parser.ts"
- "sdk/src/plan-parser.test.ts"
GSD-Task: S01/T01
* test: Implemented config reader and gsd-tools bridge with 25 unit tests…
- "sdk/src/config.ts"
- "sdk/src/config.test.ts"
- "sdk/src/gsd-tools.ts"
- "sdk/src/gsd-tools.test.ts"
GSD-Task: S01/T02
* test: Built prompt-builder, session-runner, and GSD class — 85 total un…
- "sdk/src/prompt-builder.ts"
- "sdk/src/prompt-builder.test.ts"
- "sdk/src/session-runner.ts"
- "sdk/src/index.ts"
- "sdk/src/types.ts"
GSD-Task: S01/T03
* test: Created E2E integration test with fixtures proving full SDK pipel…
- "sdk/src/e2e.integration.test.ts"
- "sdk/test-fixtures/sample-plan.md"
- "sdk/test-fixtures/.planning/config.json"
- "sdk/test-fixtures/.planning/STATE.md"
- "vitest.config.ts"
- "tsconfig.json"
GSD-Task: S01/T04
* test: Added PhaseType/GSDEventType enums, 16-variant GSDEvent union, GS…
- "sdk/src/types.ts"
- "sdk/src/event-stream.ts"
- "sdk/src/logger.ts"
- "sdk/src/event-stream.test.ts"
- "sdk/src/logger.test.ts"
GSD-Task: S02/T01
* test: Built ContextEngine for phase-aware context file resolution, getT…
- "sdk/src/context-engine.ts"
- "sdk/src/tool-scoping.ts"
- "sdk/src/phase-prompt.ts"
- "sdk/src/context-engine.test.ts"
- "sdk/src/tool-scoping.test.ts"
- "sdk/src/phase-prompt.test.ts"
GSD-Task: S02/T02
* test: Wired event stream into session runner, added onEvent()/addTransp…
- "sdk/src/session-runner.ts"
- "sdk/src/index.ts"
- "sdk/src/e2e.integration.test.ts"
GSD-Task: S02/T03
* feat: Added PhaseStepType enum, PhaseOpInfo interface, phase lifecycle…
- "sdk/src/types.ts"
- "sdk/src/gsd-tools.ts"
- "sdk/src/session-runner.ts"
- "sdk/src/index.ts"
- "sdk/src/phase-runner-types.test.ts"
GSD-Task: S03/T01
* test: Implemented PhaseRunner state machine with 39 unit tests covering…
- "sdk/src/phase-runner.ts"
- "sdk/src/phase-runner.test.ts"
GSD-Task: S03/T02
* test: Wired PhaseRunner into GSD.runPhase() public API with full re-exp…
- "sdk/src/index.ts"
- "sdk/src/phase-runner.integration.test.ts"
- "sdk/src/phase-runner.ts"
GSD-Task: S03/T03
* test: Expanded runVerifyStep with full gap closure cycle (plan → execut…
- "sdk/src/types.ts"
- "sdk/src/phase-runner.ts"
- "sdk/src/phase-runner.test.ts"
GSD-Task: S04/T02
* fix: Added 3 integration tests proving phasePlanIndex returns correct t…
- "sdk/src/phase-runner.integration.test.ts"
- "sdk/src/index.ts"
GSD-Task: S04/T03
* test: Add milestone-level types, typed roadmapAnalyze(), GSD.run() orch…
- "sdk/src/types.ts"
- "sdk/src/gsd-tools.ts"
- "sdk/src/index.ts"
- "sdk/src/milestone-runner.test.ts"
GSD-Task: S05/T01
* test: Added CLITransport (structured stdout log lines) and WSTransport…
- "sdk/src/cli-transport.ts"
- "sdk/src/cli-transport.test.ts"
- "sdk/src/ws-transport.ts"
- "sdk/src/ws-transport.test.ts"
- "sdk/src/index.ts"
- "sdk/package.json"
GSD-Task: S05/T02
* test: Added gsd-sdk CLI entry point with argument parsing, bin field, p…
- "sdk/src/cli.ts"
- "sdk/src/cli.test.ts"
- "sdk/package.json"
GSD-Task: S05/T03
* feat: Add InitNewProjectInfo type, initNewProject()/configSet() GSDTool…
- "sdk/src/types.ts"
- "sdk/src/gsd-tools.ts"
- "sdk/src/cli.ts"
- "sdk/src/cli.test.ts"
- "sdk/src/gsd-tools.test.ts"
GSD-Task: S01/T01
* chore: Created InitRunner orchestrator with setup → config → PROJECT.md…
- "sdk/src/init-runner.ts"
- "sdk/src/types.ts"
- "sdk/src/index.ts"
GSD-Task: S01/T02
* test: Wired InitRunner into CLI main() for full gsd-sdk init dispatch a…
- "sdk/src/cli.ts"
- "sdk/src/init-runner.test.ts"
- "sdk/src/cli.test.ts"
GSD-Task: S01/T03
* test: Add PlanCheck step, AI self-discuss, and retryOnce wrapper to Pha…
- "sdk/src/types.ts"
- "sdk/src/phase-runner.ts"
- "sdk/src/session-runner.ts"
- "sdk/src/phase-runner.test.ts"
- "sdk/src/phase-runner-types.test.ts"
GSD-Task: S02/T01
* feat: Rewrite CLITransport with ANSI colors, phase banners, spawn indic…
- "sdk/src/cli-transport.ts"
- "sdk/src/cli-transport.test.ts"
GSD-Task: S02/T02
* test: Add `gsd-sdk auto` command with autoMode config override, USAGE t…
- "sdk/src/cli.ts"
- "sdk/src/cli.test.ts"
- "sdk/src/index.ts"
- "sdk/src/types.ts"
GSD-Task: S02/T03
* fix: CLI shebang + gsd-tools non-JSON output handling
Three bugs found during first real gsd-sdk run:
1. cli.ts shebang was commented out — shell executed JS as bash,
triggering ImageMagick's import command instead of Node
2. configSet() called exec() which JSON.parse()d the output, but
gsd-tools config-set returns 'key=value' text, not JSON.
Added execRaw() method for commands that return plain text.
3. Same JSON parse bug affected commit() (returns git SHA),
stateLoad(), verifySummary(), initExecutePhase(), stateBeginPhase(),
and phaseComplete(). All switched to execRaw().
Tests updated to match real gsd-tools output format (plain text
instead of mocked JSON). 376/376 tests pass.
2026-03-26 20:27:51 -06:00