ralphctl 0.13.1 → 0.14.0
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.
- package/README.md +42 -13
- package/dist/cli.mjs +3077 -2117
- package/dist/manifest.json +1 -1
- package/dist/prompts/_partials/harness-context.md +9 -3
- package/dist/prompts/apply-feedback/template.md +2 -7
- package/dist/prompts/detect-scripts/template.md +17 -2
- package/dist/prompts/detect-skills/template.md +2 -2
- package/dist/prompts/distill-learnings/template.md +5 -5
- package/dist/prompts/evaluate/template.md +53 -15
- package/dist/prompts/evaluate-continuation/template.md +33 -4
- package/dist/prompts/ideate/template.md +5 -5
- package/dist/prompts/implement/template.md +45 -20
- package/dist/prompts/implement-continuation/template.md +4 -1
- package/dist/prompts/plan/template.md +5 -9
- package/dist/prompts/readiness/template.md +3 -2
- package/dist/prompts/refine/template.md +2 -3
- package/package.json +6 -2
package/dist/manifest.json
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
<harness-context>
|
|
2
|
-
Your context window is managed by the harness —
|
|
3
|
-
compacted
|
|
4
|
-
|
|
2
|
+
Your context window is managed by the harness — as it approaches its limit the session is
|
|
3
|
+
compacted or reset automatically. Treat the durable record of your work as the state you write
|
|
4
|
+
through the harness — your signals and the files your role produces, and (where present) the
|
|
5
|
+
progress journal and git history — not the conversation in your context window, which may be
|
|
6
|
+
compacted away. Keep that external state current and accurate as you go, so a fresh session can
|
|
7
|
+
resume from it cleanly.
|
|
8
|
+
|
|
9
|
+
Do not wrap up early, cut scope, or rush a verdict because you sense the context filling — the
|
|
10
|
+
harness handles compaction; carry the work through to completion within your designated role.
|
|
5
11
|
</harness-context>
|
|
@@ -99,17 +99,12 @@ commands (e.g. `git status`, `git log`) to orient yourself. You cannot commit or
|
|
|
99
99
|
those steps. You cannot run the verify script — the harness runs it after your signal.
|
|
100
100
|
</capabilities>
|
|
101
101
|
|
|
102
|
-
<reasoning>
|
|
103
|
-
Before editing, outline your plan in a `<thinking>` block: restate what the latest round is asking in one or
|
|
104
|
-
two sentences, identify which files you expect to touch, and note any constraints from the feedback log or
|
|
105
|
-
progress that should shape how you apply it. Explicit reasoning produces sharper, more surgical edits.
|
|
106
|
-
</reasoning>
|
|
107
|
-
|
|
108
102
|
## Protocol
|
|
109
103
|
|
|
110
104
|
### Phase 1 — Reconnaissance
|
|
111
105
|
|
|
112
|
-
|
|
106
|
+
Before editing, work through what the latest round is asking, which files you expect to touch, and any
|
|
107
|
+
constraints from the feedback log or progress. Then:
|
|
113
108
|
|
|
114
109
|
1. Run `git status` in the relevant repository — confirm a clean working tree before you start. If the tree
|
|
115
110
|
is dirty, emit `task-blocked` with reason `dirty-tree` and stop.
|
|
@@ -21,6 +21,10 @@ module — so the harness can scope verification to the part of the tree a task
|
|
|
21
21
|
- If no evidence exists for a script class, that signal is absent rather than fabricated.
|
|
22
22
|
- Per-module verify gates appear only when the repository has distinct module roots — a
|
|
23
23
|
single-module repository proposes the verify script alone and no gates.
|
|
24
|
+
- When the project's documented contract names a command for starting the product in a running
|
|
25
|
+
state (a dev-server start script, application entry point, or end-to-end / smoke suite), a
|
|
26
|
+
`note` signal describes it: the exact invocation, what it starts, and any declared port or
|
|
27
|
+
environment prerequisite.
|
|
24
28
|
|
|
25
29
|
</success_criteria>
|
|
26
30
|
|
|
@@ -235,7 +239,7 @@ point:
|
|
|
235
239
|
|
|
236
240
|
### Phase 1 — Inspection
|
|
237
241
|
|
|
238
|
-
|
|
242
|
+
Before writing any output, cover, in order:
|
|
239
243
|
|
|
240
244
|
1. The coding-agent context files you found and the commands they explicitly name. These are your
|
|
241
245
|
primary evidence source — list them before anything else.
|
|
@@ -244,8 +248,14 @@ Open with a `<thinking>...</thinking>` block. Cover, in order:
|
|
|
244
248
|
3. The shape of the repo: single-stack, single-language monorepo, or polyglot monorepo. For
|
|
245
249
|
polyglot layouts, name each sub-tree's path and toolchain.
|
|
246
250
|
4. The candidate setup / verify commands, each with the file that documents it.
|
|
251
|
+
5. The candidate run command — the command that starts the product in a running state for
|
|
252
|
+
interactive or end-to-end use (for example, a dev-server start script, an application
|
|
253
|
+
entry point, or an integration / smoke test runner). A run command is distinct from the
|
|
254
|
+
verify script: the verify script confirms correctness after a change; a run command starts
|
|
255
|
+
the live product so it can be exercised as a real user would. List the command and the file
|
|
256
|
+
that documents it.
|
|
247
257
|
|
|
248
|
-
|
|
258
|
+
Only `signals.json` is read by the harness; all other session output is forensic and not persisted as data.
|
|
249
259
|
|
|
250
260
|
Then read only the configuration and metadata files in scope above. Do NOT read source trees,
|
|
251
261
|
tests, vendored directories, or generated output.
|
|
@@ -257,6 +267,11 @@ both name the same command, the context file wins (it's deliberate author intent
|
|
|
257
267
|
script, prefer chaining the project's own task scripts over re-spelling the underlying tools — the
|
|
258
268
|
project's scripts are the documented contract.
|
|
259
269
|
|
|
270
|
+
When a run command was found in Phase 1 step 5, document it in a `note` signal: include the exact
|
|
271
|
+
invocation, what it starts (dev server at which port, CLI binary, or e2e suite), and any
|
|
272
|
+
environment prerequisite the project's own files declare. Omit the note when the project's files
|
|
273
|
+
name no run command — do not fabricate one from inference.
|
|
274
|
+
|
|
260
275
|
### Phase 3 — Output
|
|
261
276
|
|
|
262
277
|
Write `signals.json` to the output directory as described in `<output_contract>` above.
|
|
@@ -25,7 +25,7 @@ covers that responsibility for this repo.
|
|
|
25
25
|
|
|
26
26
|
<inputs>
|
|
27
27
|
<repository_path>{{REPOSITORY_PATH}}</repository_path>
|
|
28
|
-
<skills_convention>
|
|
28
|
+
<skills_convention>See the full skills convention in the constraints section below.</skills_convention>
|
|
29
29
|
</inputs>
|
|
30
30
|
|
|
31
31
|
{{HARNESS_CONTEXT}}
|
|
@@ -87,7 +87,7 @@ know how to read its output and diagnose failures.
|
|
|
87
87
|
|
|
88
88
|
<inspection_protocol>
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
Before drafting, cover, in order:
|
|
91
91
|
|
|
92
92
|
1. Existing skills you found at the convention path and, for each, the responsibility it already
|
|
93
93
|
covers. State explicitly whether the setup or verify intent is already taken. When no existing
|
|
@@ -7,7 +7,7 @@ Your job is to integrate them cleanly, not to invent new ones.
|
|
|
7
7
|
</role>
|
|
8
8
|
|
|
9
9
|
<goal>
|
|
10
|
-
Update `{{TARGET_FILENAME}}` so that it carries an up-to-date `##
|
|
10
|
+
Update `{{TARGET_FILENAME}}` so that it carries an up-to-date `## {{LEARNINGS_SECTION_HEADING}}` section containing
|
|
11
11
|
the candidate learnings below — folded in idempotently, preserving everything else in the file verbatim.
|
|
12
12
|
</goal>
|
|
13
13
|
|
|
@@ -26,15 +26,15 @@ the candidate learnings below — folded in idempotently, preserving everything
|
|
|
26
26
|
{{HARNESS_CONTEXT}}
|
|
27
27
|
|
|
28
28
|
<owned_section>
|
|
29
|
-
You own exactly one section of `{{TARGET_FILENAME}}` — the one headed `##
|
|
29
|
+
You own exactly one section of `{{TARGET_FILENAME}}` — the one headed `## {{LEARNINGS_SECTION_HEADING}}`. This is
|
|
30
30
|
the only part of the file you may add, reorder, or rewrite. Everything outside that section is
|
|
31
31
|
hand-authored or owned by another tool — preserve it byte-for-byte.
|
|
32
32
|
|
|
33
|
-
- When the file already contains a `##
|
|
33
|
+
- When the file already contains a `## {{LEARNINGS_SECTION_HEADING}}` section, treat its current bullets as the
|
|
34
34
|
prior state and reconcile the candidates against them (see the idempotency rule below).
|
|
35
35
|
- When the file has no such section yet, append one at the end of the file — after the last existing
|
|
36
36
|
section, separated by a single blank line.
|
|
37
|
-
- Never create a second `##
|
|
37
|
+
- Never create a second `## {{LEARNINGS_SECTION_HEADING}}` section — there must be exactly one.
|
|
38
38
|
</owned_section>
|
|
39
39
|
|
|
40
40
|
<idempotency_rule>
|
|
@@ -87,7 +87,7 @@ as "when present"; many repositories do not have one, and a learning must not as
|
|
|
87
87
|
|
|
88
88
|
<output_contract>
|
|
89
89
|
|
|
90
|
-
1. Read the existing context file body above and locate the `##
|
|
90
|
+
1. Read the existing context file body above and locate the `## {{LEARNINGS_SECTION_HEADING}}` section, if any.
|
|
91
91
|
2. Reconcile the candidate learnings against the owned section per the idempotency rule.
|
|
92
92
|
3. Write the COMPLETE, updated `{{TARGET_FILENAME}}` back to disk at its original path — the full file, not
|
|
93
93
|
a diff and not only the section. Everything outside the owned section must be unchanged.
|
|
@@ -72,6 +72,10 @@ output contract section at the bottom of this prompt.
|
|
|
72
72
|
- Every `auto` criterion in `<task_specification>` run via shell command; verbatim output in
|
|
73
73
|
`executionEvidence` field of the matching dimension.
|
|
74
74
|
- Every `manual` criterion graded with a `path:line` citation or equivalent behavioural evidence.
|
|
75
|
+
- Every criterion recorded in the structured `criteria` array of the `evaluation` signal — its `id`,
|
|
76
|
+
a `passed` boolean, and a one-line `evidence` citation — so the harness persists a durable
|
|
77
|
+
per-criterion checklist, not only prose. This is in ADDITION to the floor `dimensions`, not a
|
|
78
|
+
replacement.
|
|
75
79
|
- A FAIL on any dimension or criterion sets `status: "failed"`.
|
|
76
80
|
- The critique (when `status: "failed"`) names each failed item using the (a/b/c/d) format defined in
|
|
77
81
|
`<constraints>`.
|
|
@@ -92,6 +96,13 @@ The block below mirrors that file for in-context reference.
|
|
|
92
96
|
|
|
93
97
|
</task_specification>
|
|
94
98
|
|
|
99
|
+
<evaluation_discipline>
|
|
100
|
+
Before writing `signals.json`, work through each acceptance criterion and each floor dimension
|
|
101
|
+
explicitly. For each, note the concrete observation that supports your PASS or FAIL, and record
|
|
102
|
+
a preliminary verdict per criterion before moving to the next — do not defer all verdicts to the
|
|
103
|
+
end. The final `signals.json` is the only machine-readable output and must come last.
|
|
104
|
+
</evaluation_discipline>
|
|
105
|
+
|
|
95
106
|
<inputs>
|
|
96
107
|
<project_path>{{PROJECT_PATH}}</project_path>
|
|
97
108
|
<verify_script>{{VERIFY_SCRIPT_SECTION}}</verify_script>
|
|
@@ -128,12 +139,6 @@ commands (to execute the verify script, run test files, check git status, inspec
|
|
|
128
139
|
may write is `signals.json` under the harness output directory.
|
|
129
140
|
</capabilities>
|
|
130
141
|
|
|
131
|
-
<reasoning>
|
|
132
|
-
Use a thinking block when weighing multiple criteria or dimensions simultaneously. Skip it for straightforward
|
|
133
|
-
single-criterion checks. Structure your thinking as: (1) list the criteria you will grade, (2) note red flags
|
|
134
|
-
from the task description, (3) plan which shell commands to run first.
|
|
135
|
-
</reasoning>
|
|
136
|
-
|
|
137
142
|
## Review protocol
|
|
138
143
|
|
|
139
144
|
### Phase 0 — Checkpoint write (do this first, before any verification)
|
|
@@ -171,7 +176,7 @@ Write this file, then proceed to Phase 1.
|
|
|
171
176
|
|
|
172
177
|
### Phase 1 — Computational verification
|
|
173
178
|
|
|
174
|
-
|
|
179
|
+
Before running any checks, list the criteria you will grade and any red flags from the task description.
|
|
175
180
|
|
|
176
181
|
Run deterministic checks first — they are authoritative and cheap.
|
|
177
182
|
|
|
@@ -199,6 +204,12 @@ For every criterion in the contract:
|
|
|
199
204
|
|
|
200
205
|
Grade each criterion PASS or FAIL — no middle ground. Any single criterion FAIL forces `status: "failed"`.
|
|
201
206
|
|
|
207
|
+
Record each criterion's verdict STRUCTURALLY in the `evaluation` signal's `criteria` array — one entry
|
|
208
|
+
per criterion with its `id`, a `passed` boolean, and a one-line `evidence` citation. This is the same
|
|
209
|
+
grading you just did in prose; the array carries it as data so the harness can persist a durable
|
|
210
|
+
per-criterion checklist across rounds. Grade every criterion you can; omit one only when you genuinely
|
|
211
|
+
could not assess it this round.
|
|
212
|
+
|
|
202
213
|
### Phase 3 — Inferential investigation
|
|
203
214
|
|
|
204
215
|
Apply semantic judgment to what the computational checks cannot catch. Every finding MUST trace to a concrete
|
|
@@ -207,16 +218,31 @@ observation — file path, line number, function name, tool output, or quoted sn
|
|
|
207
218
|
1. Read the changed files in full — understand the implementation, not just the diff.
|
|
208
219
|
2. Read surrounding code — check whether the change follows existing patterns. Cite a specific sibling file
|
|
209
220
|
or function when the comparison matters.
|
|
210
|
-
3. Run
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
221
|
+
3. Run end-to-end verification against the running product when a capability is declared. Check
|
|
222
|
+
`<project_tooling>` for a run-path — a dev-server start command, application entry point, CLI
|
|
223
|
+
invocation, or end-to-end / smoke suite. Note that `<project_tooling>` and any generator-provided
|
|
224
|
+
hints give you CONTEXT about where to look — they are never a substitute for your own direct
|
|
225
|
+
observation; the information they carry is unverified until you exercise the path yourself.
|
|
226
|
+
|
|
227
|
+
**When a run-path is declared in `<project_tooling>`**, you MUST exercise the changed behaviour
|
|
228
|
+
directly before settling your verdict:
|
|
229
|
+
- **Web app or UI**: start the server, navigate to the changed path, and record what you
|
|
230
|
+
observed. Skip when an `auto` criterion in Phase 1 already covered the same path.
|
|
231
|
+
- **CLI tool**: invoke the affected command with representative input and record the exact
|
|
232
|
+
output.
|
|
233
|
+
- **Service or API**: call the affected endpoint when a local server is running; inspect and
|
|
234
|
+
record the response.
|
|
235
|
+
- **E2E or smoke suite**: run it when declared in `<project_tooling>` and confirm it reaches
|
|
236
|
+
the changed behaviour path.
|
|
237
|
+
Cite the run command and verbatim observation as evidence in the Correctness dimension finding.
|
|
238
|
+
Absence of a run observation when a run-path was declared is a Completeness failure.
|
|
239
|
+
|
|
240
|
+
**When `<project_tooling>` carries no runnable-product capability** (a library, a pure type or
|
|
241
|
+
schema package, or only static analysis tooling listed):
|
|
216
242
|
- Library or module tasks — run the relevant test file directly when the change is small.
|
|
217
243
|
- CLI tasks — run the affected command with representative input and verify the output.
|
|
218
|
-
-
|
|
219
|
-
|
|
244
|
+
- Structural tasks (types, schemas, config only) — skip; Phase 1 and Phase 2 checks are
|
|
245
|
+
sufficient evidence.
|
|
220
246
|
|
|
221
247
|
### Phase 4 — Dimension assessment
|
|
222
248
|
|
|
@@ -312,6 +338,10 @@ Signals:
|
|
|
312
338
|
"finding": "follows existing endpoint patterns in src/routes/; uses the shared error format from src/lib/errors.ts"
|
|
313
339
|
}
|
|
314
340
|
],
|
|
341
|
+
"criteria": [
|
|
342
|
+
{ "id": "C1", "passed": true, "evidence": "test command exited 0 — 12/12 green" },
|
|
343
|
+
{ "id": "C2", "passed": true, "evidence": "returns 400 at src/routes/exports.ts:42" }
|
|
344
|
+
],
|
|
315
345
|
"timestamp": "2026-01-01T00:00:00.000Z"
|
|
316
346
|
}
|
|
317
347
|
]
|
|
@@ -391,6 +421,14 @@ Signals:
|
|
|
391
421
|
"finding": "controller structure follows existing patterns; pagination helper used correctly"
|
|
392
422
|
}
|
|
393
423
|
],
|
|
424
|
+
"criteria": [
|
|
425
|
+
{ "id": "C1", "passed": true, "evidence": "test command exited 0 — 8/8 green" },
|
|
426
|
+
{
|
|
427
|
+
"id": "C2",
|
|
428
|
+
"passed": false,
|
|
429
|
+
"evidence": "src/controllers/users.ts:47 returns 500 on non-numeric page (expected 400)"
|
|
430
|
+
}
|
|
431
|
+
],
|
|
394
432
|
"critique": "[Correctness · C2] (a) correctness, (b) parseInt(page) at src/controllers/users.ts:47 returns NaN for non-numeric input causing 500, (c) validate page before use so invalid input returns 400, (d) src/controllers/users.ts:47. [Safety] (a) safety, (b) WHERE name LIKE '%${query}%' at src/repositories/users.ts:23 interpolates user input into SQL, (c) use a parameterised query, (d) src/repositories/users.ts:23.",
|
|
395
433
|
"timestamp": "2026-01-01T00:00:00.000Z"
|
|
396
434
|
}
|
|
@@ -63,17 +63,43 @@ For the complete history — older than the excerpt above — read `{{PROGRESS_F
|
|
|
63
63
|
|
|
64
64
|
{{GENERATOR_HINTS_SECTION}}
|
|
65
65
|
|
|
66
|
+
<evaluation_discipline>
|
|
67
|
+
Before writing `signals.json`, work through each acceptance criterion and each floor dimension
|
|
68
|
+
explicitly. For each, note the concrete observation that supports your PASS or FAIL, and record
|
|
69
|
+
a preliminary verdict per criterion before moving to the next — do not defer all verdicts to the
|
|
70
|
+
end. The final `signals.json` is the only machine-readable output and must come last.
|
|
71
|
+
</evaluation_discipline>
|
|
72
|
+
|
|
66
73
|
<protocol>
|
|
67
74
|
**Checkpoint write — do this first, before re-grading**
|
|
68
75
|
|
|
69
|
-
If you have not already written a checkpoint `signals.json` for this round, write
|
|
70
|
-
continuing. Use `status: "failed"`, all four floor dimensions present, each set
|
|
71
|
-
`passed: false` with `finding: "assessment in progress"`. Use the path named in the output
|
|
76
|
+
If you have not already written a checkpoint `signals.json` for this round, write an `evaluation`
|
|
77
|
+
signal now before continuing. Use `status: "failed"`, all four floor dimensions present, each set
|
|
78
|
+
to `passed: false` with `finding: "assessment in progress"`. Use the path named in the output
|
|
72
79
|
contract section at the bottom of this prompt. This placeholder is valid against the schema the
|
|
73
80
|
harness validates — it ensures a recoverable file exists on disk if this session exhausts its
|
|
74
81
|
token budget before you reach your final verdict. You will overwrite it after completing all steps
|
|
75
82
|
below.
|
|
76
83
|
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"schemaVersion": 1,
|
|
87
|
+
"signals": [
|
|
88
|
+
{
|
|
89
|
+
"type": "evaluation",
|
|
90
|
+
"status": "failed",
|
|
91
|
+
"dimensions": [
|
|
92
|
+
{ "dimension": "correctness", "passed": false, "finding": "assessment in progress" },
|
|
93
|
+
{ "dimension": "completeness", "passed": false, "finding": "assessment in progress" },
|
|
94
|
+
{ "dimension": "safety", "passed": false, "finding": "assessment in progress" },
|
|
95
|
+
{ "dimension": "consistency", "passed": false, "finding": "assessment in progress" }
|
|
96
|
+
],
|
|
97
|
+
"timestamp": "<ISO-8601 timestamp>"
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
77
103
|
Re-grade this round the same way you graded the first:
|
|
78
104
|
|
|
79
105
|
1. Re-run each `auto` criterion's command directly and record the verbatim output. Do NOT run the
|
|
@@ -83,7 +109,10 @@ Re-grade this round the same way you graded the first:
|
|
|
83
109
|
2. Re-inspect the working tree and the uncommitted diff — this is your primary view of what changed
|
|
84
110
|
this round. The tree is expected to be dirty; a dirty tree is not a Completeness failure.
|
|
85
111
|
3. Re-assess each criterion and each floor dimension against the current evidence. A criterion you
|
|
86
|
-
passed last round can regress; one you failed can now be met — verify, do not assume.
|
|
112
|
+
passed last round can regress; one you failed can now be met — verify, do not assume. Record each
|
|
113
|
+
criterion's fresh verdict STRUCTURALLY in the `evaluation` signal's `criteria` array — one entry
|
|
114
|
+
per criterion with its `id`, a `passed` boolean, and a one-line `evidence` citation — in addition
|
|
115
|
+
to the floor `dimensions`, so the harness keeps a durable per-criterion checklist across rounds.
|
|
87
116
|
4. When `status: "failed"`, write a critique whose every bullet names (a) the dimension, (b) the
|
|
88
117
|
concrete observed behaviour, (c) the desired behaviour, and (d) where in the code or tests to
|
|
89
118
|
look. A bullet missing (d) is itself a Completeness failure on re-evaluation.
|
|
@@ -83,8 +83,8 @@ Focus: clarify WHAT needs to be built. Implementation-agnostic — no repo explo
|
|
|
83
83
|
|
|
84
84
|
### Step 1.0 — Think first
|
|
85
85
|
|
|
86
|
-
Before interviewing:
|
|
87
|
-
|
|
86
|
+
Before interviewing: work through what the idea makes clear vs what it leaves ambiguous. Cover these
|
|
87
|
+
dimensions before formulating questions:
|
|
88
88
|
|
|
89
89
|
- Problem statement and affected users
|
|
90
90
|
- Functional behaviour observable as user-visible outcomes
|
|
@@ -132,9 +132,9 @@ Begin only after Phase 1 approval is confirmed.
|
|
|
132
132
|
|
|
133
133
|
### Step 2.0 — Think first
|
|
134
134
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
Map the approved requirements onto the repositories. Identify task boundaries, dependencies, and
|
|
136
|
+
risks before exploring. Work through: which repo owns each concern, what ordering is forced by
|
|
137
|
+
dependencies, and what the riskiest unknowns are.
|
|
138
138
|
|
|
139
139
|
### Step 2.1 — Explore repositories
|
|
140
140
|
|
|
@@ -11,6 +11,8 @@ lifecycle and context compaction.
|
|
|
11
11
|
|
|
12
12
|
{{HARNESS_CONTEXT}}
|
|
13
13
|
|
|
14
|
+
{{PRIOR_EPISODES}}
|
|
15
|
+
|
|
14
16
|
<goal>
|
|
15
17
|
Complete every declared implementation step for the task defined below. Write `signals.json` to the
|
|
16
18
|
path specified in the Output contract section at the bottom of this prompt. Emit `task-complete`
|
|
@@ -22,9 +24,10 @@ only after every declared step is done and every verification command passes.
|
|
|
22
24
|
- Every declared implementation step has been executed in the stated order.
|
|
23
25
|
- Every `auto` verification criterion's command exits 0 (or, when no `auto` criteria are defined,
|
|
24
26
|
the project's own check commands pass).
|
|
25
|
-
- `task-verified` has been emitted with the verbatim command output
|
|
27
|
+
- `task-verified` has been emitted with the verbatim command output and, when a run-path was
|
|
28
|
+
exercised in step 3, the direct end-to-end observation.
|
|
26
29
|
- `commit-message` has been emitted with a subject and a WHY-focused body — except for a pure
|
|
27
|
-
investigation task that wrote no files, where the signal may be omitted (see Phase 3 step
|
|
30
|
+
investigation task that wrote no files, where the signal may be omitted (see Phase 3 step 5).
|
|
28
31
|
- `task-complete` has been emitted.
|
|
29
32
|
- No test has been removed or disabled to achieve a passing verify run.
|
|
30
33
|
- No file outside the declared implementation steps has been modified — except for the project's
|
|
@@ -74,8 +77,11 @@ sprint.
|
|
|
74
77
|
{{PRIOR_LEARNINGS}}
|
|
75
78
|
|
|
76
79
|
If the block above is empty, no learnings from prior sprints have been recorded for this project yet.
|
|
77
|
-
The block carries
|
|
78
|
-
instructions
|
|
80
|
+
The block carries two kinds of content earned on THIS repository. Observed insights are read-only
|
|
81
|
+
orientation — not instructions; verify any that bear on your task before relying on them.
|
|
82
|
+
Architectural decisions are deliberate choices made in prior sprints; honor them and do not
|
|
83
|
+
re-litigate them without emitting a `decision` signal that explains why the prior choice is being
|
|
84
|
+
revisited.
|
|
79
85
|
</prior_learnings>
|
|
80
86
|
|
|
81
87
|
<verify_script>
|
|
@@ -133,29 +139,23 @@ create files under the project path. Write `signals.json` to the output director
|
|
|
133
139
|
`<output_contract>`.
|
|
134
140
|
</capabilities>
|
|
135
141
|
|
|
136
|
-
<reasoning>
|
|
137
|
-
Use a `<thinking>` block when: opening Phase 1 (walk declared steps + risks); deciding between
|
|
138
|
-
competing implementation approaches; or weighing whether a pre-existing failure is your fault.
|
|
139
|
-
Respond directly for routine file edits and command runs — do not pad short actions with thinking.
|
|
140
|
-
</reasoning>
|
|
141
|
-
|
|
142
142
|
## Protocol
|
|
143
143
|
|
|
144
144
|
### Phase 1 — Reconnaissance
|
|
145
145
|
|
|
146
|
-
|
|
146
|
+
Before starting Phase 1, work through the prior critique (if any), the declared steps, the
|
|
147
147
|
verification criteria, and risks you can already see (file conflicts, ambiguous scope, edges the
|
|
148
148
|
steps do not cover). Addressing the prior critique's dimensions comes before any new implementation
|
|
149
|
-
work.
|
|
149
|
+
work. Proceed directly for routine file edits and command runs.
|
|
150
150
|
|
|
151
151
|
Then perform these checks before writing any code. The goal is to steer the implementation correctly
|
|
152
152
|
on the first attempt, not to discover problems after the fact.
|
|
153
153
|
|
|
154
154
|
1. **Confirm your working directory** — verify you are in the expected project path (`{{PROJECT_PATH}}`).
|
|
155
|
-
2. **Prior critique first (rounds 2+)** — if `<prior_critique>` above is non-empty,
|
|
156
|
-
failed dimension
|
|
157
|
-
|
|
158
|
-
|
|
155
|
+
2. **Prior critique first (rounds 2+)** — if `<prior_critique>` above is non-empty, work through
|
|
156
|
+
each failed dimension and plan how you will address it before starting new work. If this task
|
|
157
|
+
was escalated to a stronger model, the prior critique identifies exactly what the previous model
|
|
158
|
+
missed — address those dimensions specifically.
|
|
159
159
|
3. **Prior progress** — the `<prior_progress>` block above carries the journal body in-context. Read
|
|
160
160
|
it for cross-task context; re-read `{{PROGRESS_FILE}}` directly only when you need the latest
|
|
161
161
|
on-disk state (e.g. another task settled mid-session).
|
|
@@ -210,14 +210,39 @@ In order:
|
|
|
210
210
|
confirm no regressions before signalling completion. When no verify script is configured either,
|
|
211
211
|
run the project's own check commands (as found during Phase 1 reconnaissance) before signalling
|
|
212
212
|
completion.
|
|
213
|
-
3. **
|
|
214
|
-
|
|
215
|
-
|
|
213
|
+
3. **End-to-end exercise — required when a run-path exists.** Before recording verification
|
|
214
|
+
results, check `<project_tooling>` for a way to start or invoke the product: a dev-server
|
|
215
|
+
start command, application entry point, CLI invocation, or end-to-end / smoke suite. Consult
|
|
216
|
+
the project's AI context files (when present) for additional run instructions. When a run-path is
|
|
217
|
+
present, start the product and exercise the changed behaviour AS A USER:
|
|
218
|
+
|
|
219
|
+
- **Web app or UI**: start the dev server, navigate to the changed path, and confirm the
|
|
220
|
+
behaviour from the user's perspective.
|
|
221
|
+
- **CLI tool**: invoke the affected command with representative input and observe the output
|
|
222
|
+
directly.
|
|
223
|
+
- **Service or API**: call the affected endpoint and inspect the response.
|
|
224
|
+
- **E2E or smoke suite**: run it and confirm it reaches and passes the changed behaviour path.
|
|
225
|
+
|
|
226
|
+
Record the invocation command(s) and your direct observation — what you actually saw, not what
|
|
227
|
+
you expected — in the `output` field of your `task-verified` signal alongside the step 2 output.
|
|
228
|
+
|
|
229
|
+
When `<project_tooling>` carries no runnable-product capability — a library, a pure type or
|
|
230
|
+
schema package, or only static analysis tooling listed — skip this step and state the reason in
|
|
231
|
+
one sentence in `task-verified` so the evaluator does not treat the absence as an oversight.
|
|
232
|
+
|
|
233
|
+
If starting the product fails due to an environment failure (missing dependency, port
|
|
234
|
+
unavailable, runtime not found), emit `task-blocked` with the failure details — do not skip
|
|
235
|
+
silently. A deliberate skip (no run-path declared) does not warrant `task-blocked`.
|
|
236
|
+
|
|
237
|
+
4. **Record verification results** — emit `task-verified` with the verbatim commands and their
|
|
238
|
+
combined stdout/stderr output from step 2, plus the end-to-end observation from step 3 when
|
|
239
|
+
it ran, all in the `output` field.
|
|
240
|
+
5. **Propose the commit message** — emit `commit-message` with a real subject and a body explaining
|
|
216
241
|
WHY the change exists, what alternatives you weighed, and any follow-ups a reviewer should know.
|
|
217
242
|
The harness commits after this turn using your wording verbatim. The fallback when you omit the
|
|
218
243
|
signal is just the task name and description paragraph — thin context. Emit it on every task that
|
|
219
244
|
touched any file. Omit only when the task was a pure investigation that wrote nothing.
|
|
220
|
-
|
|
245
|
+
6. **Signal completion** — emit `task-complete` ONLY after all the above steps pass.
|
|
221
246
|
|
|
222
247
|
## Failure modes
|
|
223
248
|
|
|
@@ -42,6 +42,8 @@ context to apply.
|
|
|
42
42
|
For the complete history — older than the excerpt above — read `{{PROGRESS_FILE}}` on disk.
|
|
43
43
|
</prior_progress>
|
|
44
44
|
|
|
45
|
+
{{DECISIONS_GUIDANCE}}
|
|
46
|
+
|
|
45
47
|
<goal>
|
|
46
48
|
Address every dimension the evaluator flagged in `<prior_critique>`, then run each `auto`
|
|
47
49
|
criterion's command once. Do NOT run the verify script — the harness runs it after your turn as
|
|
@@ -51,7 +53,8 @@ script once yourself. Emit `task-verified` with the verbatim command output, pro
|
|
|
51
53
|
dimension is resolved and every criterion command passes. Removing or disabling a test to make
|
|
52
54
|
verify pass counts as task failure — fix the implementation, not the test. When a flagged item is
|
|
53
55
|
genuinely blocked (missing dependency, contradictory input, unresolvable ambiguity), emit
|
|
54
|
-
`task-blocked` with the concrete reason instead of guessing.
|
|
56
|
+
`task-blocked` with the concrete reason instead of guessing. Emit `change`, `learning`, and
|
|
57
|
+
`note` signals as applicable — the harness records them in the sprint journal.
|
|
55
58
|
</goal>
|
|
56
59
|
|
|
57
60
|
{{OUTPUT_CONTRACT_SECTION}}
|
|
@@ -140,7 +140,7 @@ implemented in a single session, and verified end-to-end against its criteria.
|
|
|
140
140
|
|
|
141
141
|
**Do not split when:**
|
|
142
142
|
|
|
143
|
-
- A utility and its first caller would be separated — create-and-use is always one task.
|
|
143
|
+
- A utility and its first caller would be separated — create-and-use is always one task, unless the utility already exists in the codebase or a prior task in this plan produces it.
|
|
144
144
|
- A feature and its tests would be separated.
|
|
145
145
|
- The same pattern applies across N call sites — it is one refactor, not N tasks.
|
|
146
146
|
|
|
@@ -319,15 +319,11 @@ If `<prior_progress>` is empty, no prior progress has been recorded on this spri
|
|
|
319
319
|
|
|
320
320
|
</inputs>
|
|
321
321
|
|
|
322
|
-
<reasoning>
|
|
323
|
-
Use a thinking block before producing any output. Map each ticket onto repositories,
|
|
324
|
-
identify natural task boundaries, and sequence dependencies. Explicit reasoning produces
|
|
325
|
-
sharper plans than jumping straight to JSON. The harness strips thinking blocks before
|
|
326
|
-
persisting.
|
|
327
|
-
</reasoning>
|
|
328
|
-
|
|
329
322
|
## Protocol
|
|
330
323
|
|
|
324
|
+
Before producing any output, map each ticket onto repositories, identify natural task boundaries,
|
|
325
|
+
and sequence dependencies.
|
|
326
|
+
|
|
331
327
|
### Step 1 — Explore the repositories
|
|
332
328
|
|
|
333
329
|
Read the repositories mounted under `<repositories>` to:
|
|
@@ -351,7 +347,7 @@ For each approved ticket, decide:
|
|
|
351
347
|
- Where the natural task boundaries are.
|
|
352
348
|
- Which tasks must complete before others (`blockedBy`).
|
|
353
349
|
|
|
354
|
-
|
|
350
|
+
Draft the plan first, before writing JSON.
|
|
355
351
|
|
|
356
352
|
### Step 3 — Interview the user
|
|
357
353
|
|
|
@@ -33,9 +33,10 @@ warranted. Write all signals to the `signals.json` path described in `<output_co
|
|
|
33
33
|
<target_file_conventions>
|
|
34
34
|
{{TARGET_FILE_CONVENTIONS}}
|
|
35
35
|
</target_file_conventions>
|
|
36
|
-
{{HARNESS_CONTEXT}}
|
|
37
36
|
</inputs>
|
|
38
37
|
|
|
38
|
+
{{HARNESS_CONTEXT}}
|
|
39
|
+
|
|
39
40
|
<constraints>
|
|
40
41
|
|
|
41
42
|
**Read-only scope.** Read configuration and metadata files only — `package.json`, `pyproject.toml`,
|
|
@@ -117,7 +118,7 @@ A short, accurate file beats a long, padded one.
|
|
|
117
118
|
|
|
118
119
|
### Phase 1 — Inspection
|
|
119
120
|
|
|
120
|
-
|
|
121
|
+
Before reading files, outline your plan: list which artefacts from `<detected_artefacts>` you will actually
|
|
121
122
|
read, the project's apparent shape (language, package manager, monorepo vs single repo), and the candidate
|
|
122
123
|
sections you would consider including.
|
|
123
124
|
|
|
@@ -57,9 +57,8 @@ If `<issue_context>` is empty, no upstream issue body was available.
|
|
|
57
57
|
|
|
58
58
|
### Step 1 — Analyse the ticket
|
|
59
59
|
|
|
60
|
-
Before producing any output,
|
|
61
|
-
|
|
62
|
-
before persisting; reasoning here produces sharper requirements than jumping straight to output.
|
|
60
|
+
Before producing any output, work through what is clear, what is ambiguous, and what edge cases the
|
|
61
|
+
ticket omits. Only `signals.json` is read by the harness.
|
|
63
62
|
|
|
64
63
|
Then identify, in order:
|
|
65
64
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ralphctl",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "Agent harness for long-running AI coding tasks — orchestrates Claude Code, GitHub Copilot, and OpenAI Codex across repositories",
|
|
5
5
|
"homepage": "https://github.com/lukas-grigis/ralphctl",
|
|
6
6
|
"type": "module",
|
|
@@ -16,8 +16,12 @@
|
|
|
16
16
|
"keywords": [
|
|
17
17
|
"cli",
|
|
18
18
|
"agent-harness",
|
|
19
|
+
"ralph",
|
|
20
|
+
"ralph-harness",
|
|
21
|
+
"ralph-loop",
|
|
19
22
|
"claude-code",
|
|
20
23
|
"github-copilot",
|
|
24
|
+
"codex",
|
|
21
25
|
"ai-coding",
|
|
22
26
|
"task-orchestration",
|
|
23
27
|
"anthropic",
|
|
@@ -93,7 +97,7 @@
|
|
|
93
97
|
"coverage:unused": "tsx scripts/find-unused.ts",
|
|
94
98
|
"deadcode": "knip",
|
|
95
99
|
"skills:update": "tsx scripts/sync-skills.ts",
|
|
96
|
-
"lint": "eslint .",
|
|
100
|
+
"lint": "eslint . --max-warnings 254",
|
|
97
101
|
"lint:fix": "eslint . --fix",
|
|
98
102
|
"format": "prettier --write .",
|
|
99
103
|
"format:check": "prettier --check ."
|