Files
automaton/tasks/fix-prompt-consistency/SPEC.md
T

81 lines
3.7 KiB
Markdown
Raw Normal View History

# Fix Prompt Consistency
## Goal
Fix three categories of inconsistency in the prompt files: missing stop conditions, deprecated task paths, and a blind spot in the prompt-path test.
## Requirements
### R1. Add stop condition to `bug_finder.md`
`prompts/bug_finder.md` (47 lines) is the only delivery-style prompt that has neither a `## Stop Condition (MANDATORY)` block nor requires a `CONTRACT_MET` output. Every other delivery prompt (research, design, test_design, implement, doc_review, referee, decompose) has this block.
**Fix**: Append the standard block at the end of `prompts/bug_finder.md`:
```
## Stop Condition (MANDATORY)
You are not allowed to end this session until you have produced the BUG_REPORT.md file AND output the exact phrase "CONTRACT_MET".
Until then, continue working or ask clarifying questions.
```
### R2. Add stop condition to `adversarial_bug_find.md`
`prompts/adversarial_bug_find.md` outputs `ADVERSARIAL_BUG_FIND_COMPLETE` instead of `CONTRACT_MET`. This is a non-standard completion signal. While the orchestrator spec (orchestrate.md:340) says it checks for "CONTRACT_MET or the phase's stop condition," the inconsistency is error-prone.
**Fix**: Add the standard block after line 18 and update the existing output line to also require `CONTRACT_MET`:
```
## Stop Condition (MANDATORY)
You are not allowed to end this session until you have produced the ADVERSARIAL_BUG_REPORT.md file AND output the exact phrase "CONTRACT_MET".
Until then, continue working or ask clarifying questions.
```
### R3. Fix deprecated task path in `onboarding.md`
`prompts/onboarding.md:67` uses the deprecated `{project}/tasks/onboarding/` path instead of the canonical `{project}/.automaton/tasks/onboarding/`.
**Fix**: Change line 67 from:
```
Then produce a file called ONBOARDING_REPORT.md at {project}/tasks/onboarding/ONBOARDING_REPORT.md
```
to:
```
Then produce a file called ONBOARDING_REPORT.md at {project}/.automaton/tasks/onboarding/ONBOARDING_REPORT.md
```
Also update line 101-102 which references the deprecated location in documentation:
```
- If `{project}/tasks/` exists but `{project}/.automaton/tasks/` does not, tasks need to be moved.
```
This is correct as-is — it references the legacy location for migration detection. Keep it.
### R4. Fix `test_prompt_paths.py` regex to catch concrete deprecated paths
`tests/test_prompt_paths.py:13` uses:
```python
LEGACY_PATH = re.compile(r"\{project\}/tasks/\{task-name\}/")
```
This only matches the literal placeholder `{task-name}`. It misses concrete task names like `{project}/tasks/onboarding/`.
**Fix**: Add a second pattern that catches any kebab-case name in the deprecated location:
```python
CONCRETE_LEGACY_PATH = re.compile(r"\{project\}/tasks/[\w-]+/")
```
Add a new test that asserts zero matches of this pattern in prompts.
### R5. Verify no other deprecated paths exist
Run the updated test across all prompt files to ensure `onboarding.md` was the only violation.
## Acceptance Criteria
- [ ] `prompts/bug_finder.md` ends with `## Stop Condition (MANDATORY)` block
- [ ] `prompts/adversarial_bug_find.md` ends with `## Stop Condition (MANDATORY)` block
- [ ] `prompts/onboarding.md` uses `{project}/.automaton/tasks/onboarding/` not `{project}/tasks/onboarding/`
- [ ] `tests/test_prompt_paths.py` has a new test for concrete deprecated paths
- [ ] Running `python -m pytest tests/test_prompt_paths.py -v` catches `{project}/tasks/onboarding/` in onboarding.md BEFORE the fix and passes AFTER
- [ ] All existing prompt tests still pass
## Non-Goals
- Not standardizing all stop signals to CONTRACT_MET (compaction.md uses COMPACTION_COMPLETE by design — the orchestrator handles custom signals)
- Not rewriting onboarding.md to use the migration script (that's a separate task)