rralph 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/rralph/parser.rb +8 -4
- data/lib/rralph/runner.rb +7 -1
- data/lib/rralph.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2e6f657f4d4105579bcc44c846bb182d9f6637fc6a530fdf01490c51b994cf0e
|
|
4
|
+
data.tar.gz: b4ad22a14bb0de01d4ba50399fe2e4ed867a40ecc274c9a865ae8c948e8dcfa0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 597dbd3a4bd200b39ee9bcc7ae8cbe7872826dd90e345b7c24a8b7a92623ddfeeb96d225ea8341ee68f8ca948264ef0dc206c61d66225cabdf54020d41f5e28a
|
|
7
|
+
data.tar.gz: 7915ff47830f6cf13a54d0b2d8eb9086c1fb773964eb47dcbc493bda21416a6da3e986f4b985486c833892f3f6c7d3224caf95a73354e6523d032024e0f57447
|
data/README.md
CHANGED
|
@@ -155,7 +155,7 @@ Learnings: 6 lines
|
|
|
155
155
|
1. **Read** — `rralph` reads `plan.md`, `learnings.md`, and `todo.md`
|
|
156
156
|
2. **Prompt** — Builds a prompt with file contents and sends to LLM
|
|
157
157
|
3. **Parse** — Analyzes AI response for:
|
|
158
|
-
- `
|
|
158
|
+
- `TASK_FAILURE` keyword (case-sensitive, whole word)
|
|
159
159
|
- New learnings to extract
|
|
160
160
|
4. **Update** — On success:
|
|
161
161
|
- Marks current task as complete in `todo.md`
|
|
@@ -165,7 +165,7 @@ Learnings: 6 lines
|
|
|
165
165
|
|
|
166
166
|
### Failure Handling
|
|
167
167
|
|
|
168
|
-
- Each `
|
|
168
|
+
- Each `TASK_FAILURE` response increments a counter
|
|
169
169
|
- Non-failure responses reset the counter to 0
|
|
170
170
|
- When max failures reached, `rralph` exits with error:
|
|
171
171
|
- ```
|
data/lib/rralph/parser.rb
CHANGED
|
@@ -58,7 +58,11 @@ module Rralph
|
|
|
58
58
|
end
|
|
59
59
|
|
|
60
60
|
def failure_detected?(response)
|
|
61
|
-
response.match?(/\
|
|
61
|
+
response.match?(/\bTASK_FAILURE\b/)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def task_completed?(response)
|
|
65
|
+
response.match?(/\bTASK_DONE\b/)
|
|
62
66
|
end
|
|
63
67
|
|
|
64
68
|
def extract_learnings(response)
|
|
@@ -117,15 +121,15 @@ module Rralph
|
|
|
117
121
|
2. Write a unit test for it
|
|
118
122
|
3. Run the test
|
|
119
123
|
4. Respond with exactly one of:
|
|
120
|
-
- "
|
|
121
|
-
- "
|
|
124
|
+
- "TASK_DONE" if the task is complete and test passes
|
|
125
|
+
- "TASK_FAILURE" if the test fails after your best effort
|
|
122
126
|
5. Optionally add learnings as: "Learning: <insight>"
|
|
123
127
|
|
|
124
128
|
IMPORTANT RULES:
|
|
125
129
|
- Work on ONE task only - the one shown above
|
|
126
130
|
- Do NOT implement other tasks from the todo list
|
|
127
131
|
- Do NOT mark tasks as done yourself
|
|
128
|
-
- After you respond "
|
|
132
|
+
- After you respond "TASK_DONE", the system will mark this task complete
|
|
129
133
|
- Then you will receive the next task
|
|
130
134
|
|
|
131
135
|
--- plan.md (context) ---
|
data/lib/rralph/runner.rb
CHANGED
|
@@ -104,7 +104,13 @@ module Rralph
|
|
|
104
104
|
|
|
105
105
|
if @parser.failure_detected?(response)
|
|
106
106
|
@failure_count += 1
|
|
107
|
-
log("❌ [Cycle #{@cycle_count}]
|
|
107
|
+
log("❌ [Cycle #{@cycle_count}] TASK_FAILURE detected. Failures: #{@failure_count}/#{@max_failures}")
|
|
108
|
+
return handle_failure
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
unless @parser.task_completed?(response)
|
|
112
|
+
@failure_count += 1
|
|
113
|
+
log("❌ [Cycle #{@cycle_count}] Neither TASK_DONE nor TASK_FAILURE found. Failures: #{@failure_count}/#{@max_failures}")
|
|
108
114
|
return handle_failure
|
|
109
115
|
end
|
|
110
116
|
|
data/lib/rralph.rb
CHANGED