Skip to content

feat(mcp-server): add TDD execution continuity rules to prevent RED phase halt#467

Merged
JeremyDev87 merged 1 commit intomasterfrom
feat/tdd-execution-continuity-463
Feb 17, 2026
Merged

feat(mcp-server): add TDD execution continuity rules to prevent RED phase halt#467
JeremyDev87 merged 1 commit intomasterfrom
feat/tdd-execution-continuity-463

Conversation

@JeremyDev87
Copy link
Owner

Summary

Closes #463

Adds a 4-layer defense strategy to prevent AI agents from halting implementation when encountering expected RED phase test failures during TDD workflow. The RED→GREEN→REFACTOR cycle is now treated as one atomic operation across all instruction layers.

Changes

  • .claude/rules/custom-instructions.md — Add TDD_CONTINUITY_RULE project-level override with test failure classification table (Expected RED vs Unexpected Failure) and explicit plan execution step handling that overrides external skill's "STOP on test fail" rule
  • apps/mcp-server/src/shared/keyword-core.ts — Add TDD continuity guidance to ACT base instructions (single source of truth for standalone/serverless consumers)
  • apps/mcp-server/src/keyword/keyword.service.ts — Add TDD continuity rule with stronger emphasis to ACT enriched instructions in DEFAULT_CONFIG (used as fallback when config loading fails)
  • packages/rules/.ai-rules/rules/core.md — Expand TDD cycle description with failure classification rules, shared across all AI assistants (Cursor, Claude Code, Codex, Q, Kiro, Antigravity)
  • apps/mcp-server/src/shared/keyword-core.spec.ts — Add test verifying ACT base instructions contain TDD continuity keywords
  • apps/mcp-server/src/keyword/keyword.service.spec.ts — Add test using fallback service (rejected loadConfigFn) to verify DEFAULT_CONFIG enriched instructions contain TDD continuity rule

4-Layer Defense Strategy

Layer File Purpose
1 .claude/rules/custom-instructions.md Project-level override for Claude Code (highest priority)
2 keyword-core.ts (base) Standalone/serverless consumers
3 keyword.service.ts (enriched) NestJS MCP server with stronger emphasis
4 core.md (shared rules) Cross-tool consistency for all AI assistants

Test Plan

  • keyword-core.spec.ts — ACT base instructions contain RED phase test failures are expected, do not stop, atomic operation
  • keyword.service.spec.ts — ACT enriched instructions (via DEFAULT_CONFIG fallback) contain RED phase test failures are EXPECTED, do NOT stop, atomic operation
  • All 3,602 existing tests pass with no regressions
  • tsc --noEmit type check passes

@vercel
Copy link

vercel bot commented Feb 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
codingbuddy-landing Ready Ready Preview, Comment Feb 17, 2026 10:14am

…hase halt (#463)

Add 4-layer defense strategy ensuring AI agents treat RED→GREEN→REFACTOR
as one atomic operation and never stop on expected TDD RED phase failures.

- Add TDD_CONTINUITY_RULE override in .claude/rules/custom-instructions.md
- Add TDD continuity to ACT base instructions in keyword-core.ts
- Add TDD continuity to ACT enriched instructions in keyword.service.ts
- Add failure classification to TDD cycle in core.md
- Add tests for both base and enriched instruction paths
@JeremyDev87 JeremyDev87 force-pushed the feat/tdd-execution-continuity-463 branch from 4d9d790 to 3e7897c Compare February 17, 2026 10:13
@JeremyDev87 JeremyDev87 merged commit 9d6cb2b into master Feb 17, 2026
25 checks passed
@JeremyDev87 JeremyDev87 deleted the feat/tdd-execution-continuity-463 branch February 17, 2026 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] TDD Execution Continuity: Prevent implementation halt on RED phase test failures

1 participant