refactor(naming): remove @ prefix from on-disk filenames (#131)

* refactor(naming): remove @ prefix from on-disk filenames

BREAKING CHANGE: Renames @fix_plan.md → fix_plan.md and @AGENT.md → AGENT.md

This change improves POSIX compliance and compatibility with command-line tools.
The @ prefix was originally used to avoid naming conflicts, but with the .ralph/
folder structure introduced in v0.10.0, this convention is no longer necessary.

Changes:
- Update all scripts to use new naming (fix_plan.md, AGENT.md)
- Update migration script to handle both old and new naming conventions
- Update templates to use new naming
- Update all documentation references
- Update all 420 tests to expect new naming (TDD approach)

Migration:
- Existing projects with @-prefixed files will be automatically renamed
  when running ralph-migrate
- Projects already using the new naming will continue to work unchanged

* docs(claude): update file naming conventions section

* fix(migrate): prevent orphaned @-prefixed files during migration

When both root/@fix_plan.md and .ralph/@fix_plan.md exist, the root file
now takes priority and the .ralph/@fix_plan.md is removed (backup exists).
This prevents orphaned legacy files after migration.

---------

Co-authored-by: Test User <test@example.com>
This commit is contained in:
Frank Bria 2026-01-26 15:40:27 -07:00 committed by GitHub
parent 05c57207f3
commit c7e7a1c6a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 288 additions and 236 deletions

View file

@ -88,7 +88,7 @@ Loop 1-10: Normal (CLOSED state, progress detected)
Loop 11-13: No file changes detected (transition to HALF-OPEN)
Loop 14: Still no progress (transition to OPEN, halt execution)
Output: "⚠️ Circuit breaker opened: No progress detected in 4 loops.
Last file change: loop #10. Please review @fix_plan.md."
Last file change: loop #10. Please review fix_plan.md."
RECOMMENDATION:
Implement Circuit Breaker with these triggers:
@ -173,7 +173,7 @@ IMPACT: Makes Ralph's outputs parseable and actionable
From PROMPT.md lines 38-45:
"If you believe the project is complete or nearly complete:
- Update @fix_plan.md to reflect completion status"
- Update fix_plan.md to reflect completion status"
This requirement violates SMART criteria:
- Specific: ❌ "believe" is subjective
@ -183,10 +183,10 @@ This requirement violates SMART criteria:
- Timely: ❌ No timeframe
Better requirement:
"When all tasks in @fix_plan.md are marked [x] AND no errors are present
"When all tasks in fix_plan.md are marked [x] AND no errors are present
in the last test run AND you have nothing left to implement from specs/:
- Output: EXIT_SIGNAL=true
- Update @fix_plan.md with completion summary
- Update fix_plan.md with completion summary
- List any deferred items in ## Deferred section"
This is:
@ -232,7 +232,7 @@ Current state: Abstract instructions
Required state: Concrete examples
Example 1: Successful Completion
Given: All @fix_plan.md items are checked [x]
Given: All fix_plan.md items are checked [x]
And: Last test run shows 100% passing
And: No errors in logs/
When: Claude evaluates project status
@ -334,7 +334,7 @@ Extensions (Error Handling):
2. Ralph exits with "no_progress" signal
RECOMMENDATION:
Document use cases in @AGENT.md or new USE_CASES.md file.
Document use cases in AGENT.md or new USE_CASES.md file.
Define all actors, goals, success criteria, and failure modes.
This provides design clarity and testing scenarios.

View file

@ -106,7 +106,7 @@ RECOMMENDATION: <one line summary>
**Clear Exit Criteria**:
Claude sets `EXIT_SIGNAL: true` only when ALL conditions met:
1. All @fix_plan.md items marked [x]
1. All fix_plan.md items marked [x]
2. All tests passing (or no tests needed)
3. No errors/warnings in last execution
4. All specs/ requirements implemented

View file

@ -30,7 +30,7 @@ Successfully implemented all Phase 2 recommendations from the expert panel revie
Six concrete scenarios using Given/When/Then format:
**Scenario 1: Successful Project Completion**
- **Given**: All @fix_plan.md items marked [x], tests passing, no errors
- **Given**: All fix_plan.md items marked [x], tests passing, no errors
- **Then**: OUTPUT EXIT_SIGNAL=true with COMPLETE status
- **Ralph's Action**: Gracefully exits loop with success message
@ -87,7 +87,7 @@ Six concrete scenarios using Given/When/Then format:
#### Six Primary Use Cases
**UC-1: Execute Development Loop** (Main workflow)
- **Preconditions**: PROMPT.md exists, @fix_plan.md has tasks
- **Preconditions**: PROMPT.md exists, fix_plan.md has tasks
- **Success**: Task completed, files modified/committed, status tracked
- **14-step main scenario** with extensions for:
- Circuit breaker OPEN → halt with guidance

View file

@ -23,7 +23,7 @@
### ✅ 75 Tests (100% Pass)
1. **Unit Tests** (35 tests)
- **Rate Limiting** (15 tests): can_make_call(), increment_call_counter(), edge cases
- **Exit Detection** (20 tests): test saturation, done signals, completion indicators, @fix_plan.md validation, error handling
- **Exit Detection** (20 tests): test saturation, done signals, completion indicators, fix_plan.md validation, error handling
2. **Integration Tests** (40 tests)
- **Loop Execution** (20 tests): response analyzer detection, circuit breaker states, full loop integration, exit signal detection

View file

@ -32,7 +32,7 @@
- `tests/helpers/fixtures.bash` - Test data fixtures
- Sample PRD documents (MD, JSON)
- Sample PROMPT.md, @fix_plan.md, @AGENT.md
- Sample PROMPT.md, fix_plan.md, AGENT.md
- Sample status.json and progress.json
- Sample Claude Code outputs
- Complete test project creation
@ -83,7 +83,7 @@ Test Categories:
- Threshold boundaries (1, 2 indicators)
- Project completion detection
- @fix_plan.md completion (5 tests)
- fix_plan.md completion (5 tests)
- All items complete
- Partial completion
- Missing file

View file

@ -32,7 +32,7 @@
- Cannot modify project requirements
- Must respect API rate limits
- Cannot override circuit breaker when open
- Requires valid PROMPT.md and @fix_plan.md
- Requires valid PROMPT.md and fix_plan.md
---
@ -58,7 +58,7 @@
**Type**: Human
**Goal**: Initiate Ralph, review results, intervene when needed
**Capabilities**:
- Create PROMPT.md and @fix_plan.md
- Create PROMPT.md and fix_plan.md
- Start/stop Ralph execution
- Reset circuit breaker
- Review code changes
@ -89,7 +89,7 @@
**Stakeholders**: Human Developer (wants progress), Claude Code (executor)
**Preconditions**:
- PROMPT.md exists and is valid
- @fix_plan.md exists with at least one task
- fix_plan.md exists with at least one task
- Claude Code CLI is installed and accessible
- git repository is initialized
@ -105,7 +105,7 @@
2. Ralph checks circuit breaker state (must be CLOSED or HALF_OPEN)
3. Ralph verifies rate limit allows execution
4. Ralph executes Claude Code with PROMPT.md
5. Claude Code reads @fix_plan.md and selects task
5. Claude Code reads fix_plan.md and selects task
6. Claude Code implements task (files modified)
7. Claude Code runs relevant tests
8. Claude Code outputs RALPH_STATUS block
@ -400,7 +400,7 @@
**Main Success Scenario**:
1. User identifies circuit breaker opened (from ralph-monitor or logs)
2. User reviews logs/ralph.log to understand cause
3. User fixes underlying issue (updates @fix_plan.md, fixes error, etc.)
3. User fixes underlying issue (updates fix_plan.md, fixes error, etc.)
4. User runs: `ralph --reset-circuit`
5. Ralph loads circuit_breaker.sh functions
6. Ralph calls reset_circuit_breaker("Manual reset by user")

View file

@ -47,7 +47,7 @@ fi
```
**Attack Vector**:
If `@fix_plan.md` or `.response_analysis` contains malicious content like:
If `fix_plan.md` or `.response_analysis` contains malicious content like:
```
"; rm -rf /; echo "
```