fix(#3990): state the RED/GREEN/REFACTOR cycle once, embed tdd.md conditionally (#4228)

* test(#3990): the RED/GREEN/REFACTOR cycle is stated once, embedded conditionally

* fix(#3990): state the cycle once — pointers in consumers, conditional tdd.md embeds

Emitted-Drift-Ack-Growth: execute-phase.md — #3990 conditions the tdd.md embed on the dispatch being TDD

* chore(#3990): changeset for the single-statement TDD cycle

* chore(#3990): backfill changeset pr number

* fix(#4228): linear cycle check — the lazy-span regex pinned a Windows core for the whole job cap

* test(#3990): allowlist pin tracks the rebased line

* fix(tests): npm-integrity gate names an empty audit output explicitly — empty stdout crashed the parse as a bare SyntaxError

* fix: name an empty npm-audit stdout explicitly — it crashed the parse as a bare SyntaxError

Observed on CI (several branches, all lanes): spawnSync npm ETIMEDOUT with
empty stdout; the empty string survived the recovery path and surfaced as
'SyntaxError: Unexpected end of JSON input', hiding the captured error. The
recovery path now requires non-empty stdout, and an empty result throws with
the captured stdout/stderr/message so the actual error is on the record.
Root cause of the ETIMEDOUT itself is NOT diagnosed here — this change only
stops masking it.

---------

Co-authored-by: sim <sim@local>
This commit is contained in:
Tom Boucher
2026-09-03 21:41:14 -04:00
committed by GitHub
parent 590edec7a7
commit 97ce61dee2
9 changed files with 134 additions and 24 deletions

View File

@@ -757,7 +757,7 @@ increases monotonically across waves. `{status}` is `complete` (success),
- `~/.claude/gsd-core/workflows/execute-plan.md`
- `~/.claude/gsd-core/templates/summary.md`
- `~/.claude/gsd-core/references/checkpoints.md`
- `~/.claude/gsd-core/references/tdd.md`
${TDD_APPLICABLE ? '- `~/.claude/gsd-core/references/tdd.md`' : ''} # #3990: only when this dispatch is TDD (plan type: tdd, a tdd="true" task, or TDD_MODE=true)
- `~/.claude/gsd-core/references/worktree-path-safety.md`
${CONTEXT_WINDOW < 200000 ? '' : '- `~/.claude/gsd-core/references/executor-examples.md`'}
</execution_context>

View File

@@ -181,7 +181,7 @@ the executor workflow from repository search.
SUMMARY commit semantics and the gitignored-planning skip contract)
- summary.md template
- checkpoints.md
- tdd.md
${TDD_APPLICABLE ? "- tdd.md" : ""} # #3990: only when this dispatch is TDD (plan type: tdd, or TDD_MODE=true)
- worktree-path-safety.md
- agents/gsd-executor.md (the ROLE DEFINITION you are executing — its steps
0/0a/0b per-commit HEAD/cwd-drift/path-guard discipline applies to every

View File

@@ -292,13 +292,12 @@ End with: **Total deviations:** N auto-fixed (breakdown). **Impact:** assessment
For `type: tdd` plans — RED-GREEN-REFACTOR:
1. **Infrastructure** (first TDD plan only): detect project, install framework, config, verify empty suite
2. **RED:** Read `<behavior>` → failing test(s) → run (MUST fail) → commit: `test({phase}-{plan}): add failing test for [feature]`
3. **GREEN:** Read `<implementation>` → minimal code → run (MUST pass) → commit: `feat({phase}-{plan}): implement [feature]`
4. **REFACTOR:** Clean up → tests MUST pass → commit: `refactor({phase}-{plan}): clean up [feature]`
Errors: RED doesn't fail → investigate test/existing feature. GREEN doesn't pass → debug, iterate. REFACTOR breaks → undo.
See `~/.claude/gsd-core/references/tdd.md` for structure.
2. **Cycle (#3990: stated ONCE):** execute RED → GREEN → REFACTOR exactly as specified in the
canonical `~/.claude/gsd-core/references/tdd.md` "Red-Green-Refactor Cycle" section — its
commit-scope contract (`test({phase}-{plan})` → `feat({phase}-{plan})` →
`refactor({phase}-{plan})`, RED must fail, GREEN must pass, REFACTOR commits only on change),
its fail-fast rule, and its error handling. The reference is the single source; do not
improvise a variant.
</tdd_plan_execution>
<precommit_failure_handling>