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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ea4f06957671b88207938c10e6bb9a00e0a7524cea7d679b950dde54d4c99c85
4
- data.tar.gz: d3182ee683101ee606d781093a6aba536dd25c811513520464146f60a93064bf
3
+ metadata.gz: 2e6f657f4d4105579bcc44c846bb182d9f6637fc6a530fdf01490c51b994cf0e
4
+ data.tar.gz: b4ad22a14bb0de01d4ba50399fe2e4ed867a40ecc274c9a865ae8c948e8dcfa0
5
5
  SHA512:
6
- metadata.gz: 2bf09138e994351d3c374ce4f1a11505ad12138138227cb7d28774b2f49ca0a257a2f0d33f1e2f2730d185284a632545fd86336d54d07dd33a4dfc06095373ff
7
- data.tar.gz: dc175e3a19ce97b1f8fd43f1420a7e556cd99da7c7e92ae7fc2ef4fd5e390341024fca79e3eb1a9d20a6e37a2cee7ea5b772416e2fd10ec0a1d8bcf00b1c85a0
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
- - `FAILURE` keyword (case-insensitive, whole word)
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 `FAILURE` response increments a counter
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?(/\bFAILURE\b/i)
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
- - "DONE" if the task is complete and test passes
121
- - "FAILURE" if the test fails after your best effort
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 "DONE", the system will mark this task complete
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}] FAILURE detected. Failures: #{@failure_count}/#{@max_failures}")
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
@@ -1,5 +1,5 @@
1
1
  module Rralph
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
 
4
4
  class Error < StandardError; end
5
5
  class FileNotFound < Error; end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rralph
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - rralph