feat(build): TDD integration — Red→Green enforced by state machine (v1.14.0)#2
Merged
feat(build): TDD integration — Red→Green enforced by state machine (v1.14.0)#2
Conversation
… checkbox in MARK_COMPLETE
TDD Red phase for Phase 4. Tests import detectTestCmd from sub-agents.ts and buildGeminiTestSpecPrompt from cli.ts — both exports not yet implemented. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Observability fix from Codex review M1 finding: silent skip was inconsistent with RUN_TESTS which already warns. Now both log a ⚠ when no test command found. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…eration field) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…dry-run output Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- README.md: add TDD Workflow section (7-step loop, test command detection, --test-cmd usage, 3 new env vars, updated file layout and failure modes) - cli.ts: log 'Test Specification' (not 'writing test spec') so integration test assertion passes and output is consistent with the phase format - parser.test.ts: add TDD checkbox parsing tests (3-checkbox TDD phase, legacy 2-checkbox backward compat, testSpecDone=false for unchecked spec) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- fresh-start line: rm <slug>.lock → <slug>.json (lock prevents concurrent runs; .json holds state) - monorepo --test-cmd example: cd ... && ... → bash -c wrapper (runTests splits on whitespace; cd is a shell builtin) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- wrap JSON.parse in detectTestCmd with try/catch; malformed package.json no longer crashes the orchestrator, falls through to next detector - remove stale Red-phase comment from integration.test.ts Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
runGemini now accepts logPrefix option (default 'gemini'). RUN_GEMINI_FIX passes logPrefix='gemini-fix' so fix iterations write to phase-N-gemini-fix-1.log, not phase-N-gemini-1.log (which collides with implementation iteration logs). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
anbangr
added a commit
that referenced
this pull request
Apr 29, 2026
…it diff - codexFixHistory injection in buildJudgePrompt (positive case) - parseJudgeVerdict with Windows CRLF line endings (\r\n strip) - REASONING regex Fix #3: 'HARDENING:' mid-sentence in prose does not truncate - Hygiene gate (Fix #1/#2): git diff detects test file modification in worktree - Hygiene gate (Fix #1/#2): git diff is empty for source-only worktree changes Coverage: 14/23 → 19/23 (61% → 83%) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
detectTestCmd(cwd)auto-detects test runner (package.json scripts.test, pytest.ini, pyproject.toml, go.mod, Cargo.toml);--test-cmdflag overridestestSpecDone=true)Key files changed
build/SKILL.md.tmpl+build/SKILL.mdbuild/orchestrator/types.tsbuild/orchestrator/parser.ts**Test Specificationcheckbox; backward compat fallbackbuild/orchestrator/phase-runner.tsbuild/orchestrator/sub-agents.tsdetectTestCmd,runGeminiTestSpec,runTests;logPrefixonrunGeminibuild/orchestrator/cli.ts--test-cmdflag;buildGeminiTestSpecPrompt; RUN_GEMINI_FIX log prefixbuild/orchestrator/plan-mutator.tsflipTestSpecCheckboxbuild/orchestrator/README.mdbuild/orchestrator/__tests__/integration.test.tsAdversarial review findings addressed
JSON.parseindetectTestCmdwrapped in try/catch (malformed package.json no longer crashes orchestrator)RUN_GEMINI_FIXnow passeslogPrefix: 'gemini-fix'torunGemini— fix-iteration logs go tophase-N-gemini-fix-1.log, notphase-N-gemini-1.log(fixes collision with implementation logs per README docs)Test plan
HOME=/tmp/gstack-review-home bun test build/orchestrator/__tests__/— 105 pass, 0 failbun build build/orchestrator/cli.ts --target=bun— compiles clean./bin/gstack-build --help— shows--test-cmdflaggstack-build --dry-run --test-cmd "bun test" <3-checkbox-plan>— walks all 7 steps, exits 0🤖 Generated with Claude Code