fix(prompt): resolve contradiction blocking without test output#97
fix(prompt): resolve contradiction blocking without test output#97mlugo-apx wants to merge 1 commit into
Conversation
…st output Remove "No test output captured" from example block reasons — it contradicts the decision value definition where null means "insufficient information to determine." Add matching approval reason for missing test output. Without this fix, projects using custom/browser-based test frameworks (or any framework without a supported reporter) get blocked on every implementation edit because test.json is never created. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Hi @mlugo-apx, Thanks for putting this together. I see the issue you're running into. My concern is that the fix affects more than the "no reporter installed" case. The validator can't distinguish that from "no tests have run yet this session." Both look the same from the prompt's side. Flipping the default would let an agent skip straight to implementation on every new session, before any test has been written or run. That violates TDD. I also don't read the current prompt as contradictory. The null definition is the general rule, and the block example is a deliberate override for cases where the uncertainty itself is suspicious. The underlying issue is still worth solving though. I think the right answer is to add the reporter rather than weaken the prompt. Which framework are you hitting this with? Might be worth adding a reporter for it. Thanks again. |
Summary
Fix prompt contradiction in
response.tsthat causes incorrect blocking when no test reporter is installed.null= "insufficient information to determine")Problem
The
response.tsprompt has a contradiction between decision value definitions and example block reasons:nullas: "Changes follow TDD principles OR insufficient information to determine"When no test reporter is installed (custom/browser-based frameworks, Mocha, unittest, etc.),
test.jsonis never created. The validator model sees no test section in its prompt, follows the example block reason, and blocks every implementation edit — even after the developer has manually written and verified a failing test.This makes tdd-guard unusable for any project without a supported reporter.
Fix
One line removed from example block reasons, one line added to example approval reasons. No code logic changes. Only affects users without a reporter installed — users WITH reporters always have test output and are unaffected.
Test plan
Related
processHookData.tscode (before reaching the AI validator) and return a non-blocking informational message