ralphctl 0.16.0 → 0.17.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.
package/dist/cli.mjs CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  // src/index.ts
4
4
  process.env.NODE_ENV ??= "production";
5
- var { runCli } = await import("./cli-KZ4IYDKB.mjs");
5
+ var { runCli } = await import("./cli-WTLOGLWF.mjs");
6
6
  await runCli(process.argv);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "packageVersion": "0.16.0",
4
- "generatedAt": "2026-07-18T13:59:00.834Z",
3
+ "packageVersion": "0.17.1",
4
+ "generatedAt": "2026-07-28T04:40:58.689Z",
5
5
  "assets": [
6
6
  "agent-definitions/ralphctl-evaluator.md",
7
7
  "agent-definitions/ralphctl-generator.md",
@@ -47,14 +47,14 @@ break the shared lockfile.
47
47
 
48
48
  ## Architecture
49
49
 
50
- - Clean Architecture: `domain → business → integration → application`. No reverse imports.
51
- - No barrel files (`index.ts` re-exports) — every import names its symbol explicitly.
50
+ - <your layering rule> — e.g. which modules may import which, and which direction is forbidden.
51
+ - <your module-boundary rule> — e.g. no barrel re-export files; every import names its symbol explicitly.
52
52
 
53
53
  ## Conventions
54
54
 
55
- - Business operations return a `Result` type — do not throw for domain errors.
56
- - All file writes go through the atomic-write helper in `business/io/`; direct `fs.writeFile`
57
- is banned from business code.
55
+ - <your error-handling convention> — e.g. return a typed result instead of throwing for domain errors.
56
+ - <your I/O convention> — e.g. all writes go through one shared helper; direct filesystem calls
57
+ are banned elsewhere.
58
58
 
59
59
  ## Security
60
60
 
@@ -10,7 +10,7 @@ invocation, not as a tutorial or README.
10
10
  - At most seven H2 sections (`## Build & Run`, `## Testing`, `## Architecture`, …). Fewer is better.
11
11
  - No H4 headings or deeper — three heading levels (`#`, `##`, `###`) is the practical maximum.
12
12
  - Prefer tight bullet lists over prose paragraphs; each bullet should be one verifiable claim.
13
- - Hard line cap: 200 lines. Instruction adherence measurably degrades on longer context files, so
13
+ - Hard line cap: 200 lines. Instruction adherence degrades on longer context files, so
14
14
  brevity is load-bearing.
15
15
 
16
16
  **"Read on demand" pattern** — for sections that an agent rarely needs mid-task, list them under a
@@ -19,8 +19,8 @@ invocation, not as a tutorial or README.
19
19
  ```
20
20
  ## References
21
21
 
22
- - `.claude/docs/ARCHITECTURE.md` — module layout and layering rules
23
- - `.claude/docs/DESIGN-SYSTEM.md` — TUI tokens and component copy rules
22
+ - `docs/architecture.md` — module layout and layering rules
23
+ - `docs/style-guide.md` — UI style guide and component copy rules
24
24
  ```
25
25
 
26
26
  This keeps the primary file short while keeping the information reachable.
@@ -48,12 +48,11 @@ Node.js 20 + TypeScript. Run `<install command>` once, then `<dev command>` to s
48
48
 
49
49
  ## Architecture
50
50
 
51
- - Four-module Clean Architecture: `domain → business → integration → application`.
52
- - No barrel `index.ts` files under `src/` — name every import explicitly.
53
- - Business code must not import I/O-bearing `node:*` modules — pure `node:path` / `node:url` ok.
51
+ - <your layering rule> — e.g. which modules may import which, and which direction is forbidden.
52
+ - <your module-boundary rule> — e.g. no cross-module reach-arounds; go through the declared seam.
54
53
 
55
54
  ## Conventions
56
55
 
57
- - Return `Result<T, DomainError>` from every business operation — do not throw.
58
- - Em-dash (`—`) for explanatory clauses in comments and docs.
56
+ - <your error-handling convention> — e.g. return a typed result instead of throwing.
57
+ - <your formatting or naming convention> — state it as a checkable rule, not general advice.
59
58
  ```
@@ -30,10 +30,9 @@ advice the model already follows by default.
30
30
  ```markdown
31
31
  ## Architecture
32
32
 
33
- - Four-module Clean Architecture: `domain → business → integration → application` — inner layers
34
- must not import outer ones. ESLint enforces this; a lint failure means a layering violation.
35
- - No barrel `index.ts` files — every import names what it pulls in. This keeps dead-code analysis
36
- accurate; barrel files silently re-export unused symbols.
33
+ - <your layering rule> — e.g. inner layers must not import outer ones. State the enforcement
34
+ mechanism (linter, review checklist) so the model knows a violation is checkable.
35
+ - <your module-boundary rule> — e.g. no barrel re-export files; every import names what it pulls in.
37
36
 
38
37
  ## Testing
39
38
 
@@ -42,9 +41,8 @@ advice the model already follows by default.
42
41
 
43
42
  ## Conventions
44
43
 
45
- - Every business operation returns `Result<T, DomainError>` — do not throw. Throws are reserved for
46
- programmer errors (invariant violations inside leaf projections).
47
- - Em-dash (`—`) for explanatory clauses in comments and documentation — not a hyphen.
44
+ - <your error-handling convention> — e.g. return a typed result instead of throwing; reserve throws
45
+ for programmer errors.
48
46
 
49
47
  ## Security
50
48
 
@@ -15,6 +15,7 @@ in the sprint's decisions log.
15
15
  convention). Obvious changes do not need a decision entry.
16
16
  - **One sentence per decision** — lead with the choice, then the rationale: "Used X over Y because Z." Use
17
17
  two sentences only when the rationale genuinely cannot be compressed without losing the key tradeoff.
18
+ - Keep `text` under roughly 500 characters.
18
19
  - The harness appends task id automatically — do not include it yourself, but DO include the `timestamp`
19
20
  field (ISO 8601).
20
21
  - Emit one signal per decision rather than packing several choices into one `text` body.
@@ -4,7 +4,7 @@
4
4
 
5
5
  Before writing the JSON output, verify EVERY item:
6
6
 
7
- 1. **Requirements understood** — every approved ticket is reflected in at least one task; nothing in scope is dropped.
7
+ 1. **Requirements understood** — every requirement in scope is reflected in at least one task; nothing in scope is dropped.
8
8
  2. **Exclusive file ownership** — each file is owned by exactly one task. When two tasks must edit the same file,
9
9
  make the relationship explicit via `blockedBy` so they run in sequence, not in parallel.
10
10
  3. **Foundations before dependents** — order tasks so prerequisites come first; `blockedBy` reflects genuine code
@@ -15,11 +15,10 @@ Before writing the JSON output, verify EVERY item:
15
15
  functions; "implement the feature" is not a step.
16
16
  6. **Verification criteria** — each task has 2–4 `verificationCriteria` that are testable and unambiguous.
17
17
  "Tests pass" alone is too vague — name the behaviour or invariant that proves the task is done.
18
- 7. **Repository assignment** — every task's `projectPath` matches one of the absolute paths listed under
19
- "Selected repositories" above.
20
- 8. **Signal output only** — the task array goes into the `tasksJson` field of the `task-plan` signal written
21
- to `signals.json`. Do not emit the JSON array as prose or inside markdown fences — only the signal file
22
- is read by the harness.
18
+ 7. **Repository assignment** — every task's `projectPath` matches one of the repository paths provided above.
19
+ 8. **Signal output only** — the task array goes into the output signal named in your output contract below.
20
+ Do not emit the JSON array as prose or inside markdown fences — only the signal file is read by the
21
+ harness.
23
22
  9. **Unique placeholder ids** — each task's `id` is a unique string within this array (used only for
24
23
  `blockedBy` resolution; the harness assigns persistent ids on save).
25
24
  10. **Deterministic checks preferred** — each task includes at least one `auto` criterion when the
@@ -13,8 +13,7 @@ or a false verify result.
13
13
 
14
14
  <goal>
15
15
  Apply every change requested in `<latest_round>` by writing the affected files. Emit `task-complete` when
16
- done. Emit `task-blocked` if the request is ambiguous in WHAT to change (not WHERE — pick the narrowest
17
- plausible target when the location is unclear).
16
+ done, or `task-blocked` when the request is ambiguous — see Phase 3 below for the WHAT-vs-WHERE distinction.
18
17
  </goal>
19
18
 
20
19
  <success_criteria>
@@ -74,10 +73,6 @@ direction.
74
73
  **Write the files — don't describe the edits.** The harness does not apply changes for you. A written-out
75
74
  description without actual file writes is not feedback applied.
76
75
 
77
- **Do not commit. Do not run verify scripts.** The harness commits your changes with the message
78
- `feedback(round-N): <body-snippet>` and then runs the project's verify script. Emit `task-complete` once
79
- your edits are on disk and let the harness drive the gate.
80
-
81
76
  **Pre-existing uncommitted changes are a protocol violation.** If `git status` shows a dirty tree before you
82
77
  start editing, stop and emit `task-blocked` with reason `dirty-tree`.
83
78
 
@@ -95,8 +90,8 @@ referencing the change), not in a signal.
95
90
 
96
91
  <capabilities>
97
92
  You can read and write files under every repository path listed in `<repositories>`. You can run shell
98
- commands (e.g. `git status`, `git log`) to orient yourself. You cannot commit or push — the harness owns
99
- those steps. You cannot run the verify script — the harness runs it after your signal.
93
+ commands (e.g. `git status`, `git log`) to orient yourself. You cannot commit, push, or run the verify
94
+ script — the harness owns those steps (see the role note above).
100
95
  </capabilities>
101
96
 
102
97
  ## Protocol
@@ -106,8 +101,8 @@ those steps. You cannot run the verify script — the harness runs it after your
106
101
  Before editing, work through what the latest round is asking, which files you expect to touch, and any
107
102
  constraints from the feedback log or progress. Then:
108
103
 
109
- 1. Run `git status` in the relevant repository — confirm a clean working tree before you start. If the tree
110
- is dirty, emit `task-blocked` with reason `dirty-tree` and stop.
104
+ 1. Run `git status` in each repository you will touch — confirm a clean working tree before you start. If
105
+ the tree is dirty, emit `task-blocked` with reason `dirty-tree` and stop.
111
106
  2. Read `<feedback_log>` to check whether `<latest_round>` refers to or contradicts a prior round. Trust the
112
107
  latest round's direction even when it reverses an earlier decision.
113
108
  3. If `<feedback_log>` is empty, this is round 1 — there is no prior context to reconcile; proceed directly
@@ -118,7 +113,6 @@ constraints from the feedback log or progress. Then:
118
113
  1. Apply only what `<latest_round>` asks. No opportunistic refactors, no unsolicited tests.
119
114
  2. Be surgical — small, targeted edits to the files the round names, or the nearest obvious files when the
120
115
  round is symptom-described rather than file-described.
121
- 3. Do not commit. Do not run verify.
122
116
 
123
117
  ### Phase 3 — Signal outcome
124
118
 
@@ -15,10 +15,7 @@ Inspect the commit history and diff of `{{HEAD_BRANCH}}` against `{{BASE_BRANCH}
15
15
 
16
16
  <success_criteria>
17
17
 
18
- - The signal carries a `title` of ≤70 characters, imperative present-tense (e.g. "Add CSV export for transactions").
19
- - The `body` has three sections in order: a 1–3 sentence summary, a `## Changes` bullet list, and a `## Test plan`
20
- markdown checklist.
21
- - The `body` is ≤80 lines — concise summaries are a feature, not a limitation.
18
+ - The `title` and `body` follow the format and length rules in the Constraints section below.
22
19
  - Every claim in `body` is supported by the actual diff or commit messages — nothing is invented.
23
20
  - Issue references, when present, appear verbatim at the end of `body`.
24
21
 
@@ -42,7 +39,8 @@ Inspect the commit history and diff of `{{HEAD_BRANCH}}` against `{{BASE_BRANCH}
42
39
  </inputs>
43
40
 
44
41
  <constraints>
45
- Gather context by running shell commands in the repository before writing anything:
42
+ Gather context by running shell commands in the repository before writing anything. You are already on
43
+ `{{HEAD_BRANCH}}` — the commands below use `HEAD` directly, no checkout needed:
46
44
 
47
45
  - Inspect the commit history: `git log {{BASE_BRANCH}}..HEAD`
48
46
  - Inspect the file-level change summary: `git diff {{BASE_BRANCH}}...HEAD --stat`
@@ -69,7 +67,7 @@ Body rules:
69
67
  - Body length: ≤80 lines. Prefer fewer lines over more — reviewers skim.
70
68
  - Tone: clear technical prose, matching the tone of the project's existing commit messages. Neither terse shorthand nor
71
69
  essay-length explanation — aim for "readable in 60 seconds".
72
- - Use em-dash `—` for explanatory clauses, matching the project's house style.
70
+ - Use em-dash `—` for explanatory clauses.
73
71
 
74
72
  Issue references:
75
73
 
@@ -86,8 +84,8 @@ Hard constraints:
86
84
  - Emit ONLY the `pr-content` signal. Do not emit narrative signals (`note`, `learning`, `decision`, `change`) — they are
87
85
  not consumed by this flow and represent wasted tokens.
88
86
  - If you cannot produce a meaningful title and body (e.g. the repository is inaccessible, the diff is empty, or there is
89
- nothing to summarise), write `signals.json` as an empty array `[]` and stop. Do not invent PR content. The harness
90
- falls back to a template-derived description in that case.
87
+ nothing to summarise), write `signals.json` as `{"schemaVersion": 1, "signals": []}` and stop. Do not invent PR
88
+ content. The harness falls back to a template-derived description in that case.
91
89
 
92
90
  </constraints>
93
91
 
@@ -21,10 +21,8 @@ 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
+ - When the project's documented contract names a run command, a `note` signal describes it — see
25
+ the Protocol's Phase 1 step 5 and Phase 2 below for what counts and what the note must contain.
28
26
 
29
27
  </success_criteria>
30
28
 
@@ -67,8 +65,9 @@ what the project documented. Omit a signal only when the project's own files are
67
65
  class entirely.
68
66
 
69
67
  **Script safety.** Reject pipe-to-shell shapes (`curl … | sh`, `wget -O- … | bash`), `eval`, and
70
- `rm -rf`. One shell line per script — multi-line bodies, sub-shells, and heredocs are out of
71
- contract; the harness collapses whitespace before execution.
68
+ `rm -rf`. One shell line per script — multi-line bodies and heredocs are out of contract, and so
69
+ are sub-shells except the single `(cd <path> && …)` fallback named above; the harness collapses
70
+ whitespace before execution.
72
71
 
73
72
  **Idempotence.** Prefer commands that are safe to re-run (e.g. the plain install invocation for
74
73
  the project's package manager rather than a frozen-lockfile / production-only variant, unless the
@@ -106,6 +105,8 @@ emit gates for it. When gates apply:
106
105
 
107
106
  <output_contract>
108
107
 
108
+ Only `signals.json` is read by the harness; all other session output is forensic and not persisted as data.
109
+
109
110
  {{OUTPUT_CONTRACT_SECTION}}
110
111
 
111
112
  Emit only `setup-script`, `verify-script`, `verify-gates`, and `note` signals — no other signal
@@ -123,6 +124,7 @@ test`" and the manifest declares those scripts:
123
124
 
124
125
  ```json
125
126
  {
127
+ "schemaVersion": 1,
126
128
  "signals": [
127
129
  {
128
130
  "type": "setup-script",
@@ -147,6 +149,7 @@ When only a manifest exists with install + test scripts and no context file:
147
149
 
148
150
  ```json
149
151
  {
152
+ "schemaVersion": 1,
150
153
  "signals": [
151
154
  {
152
155
  "type": "setup-script",
@@ -172,6 +175,7 @@ verify steps:
172
175
 
173
176
  ```json
174
177
  {
178
+ "schemaVersion": 1,
175
179
  "signals": [
176
180
  {
177
181
  "type": "setup-script",
@@ -199,6 +203,7 @@ point:
199
203
 
200
204
  ```json
201
205
  {
206
+ "schemaVersion": 1,
202
207
  "signals": [
203
208
  {
204
209
  "type": "setup-script",
@@ -255,8 +260,6 @@ Before writing any output, cover, in order:
255
260
  the live product so it can be exercised as a real user would. List the command and the file
256
261
  that documents it.
257
262
 
258
- Only `signals.json` is read by the harness; all other session output is forensic and not persisted as data.
259
-
260
263
  Then read only the configuration and metadata files in scope above. Do NOT read source trees,
261
264
  tests, vendored directories, or generated output.
262
265
 
@@ -25,15 +25,16 @@ covers that responsibility for this repo.
25
25
 
26
26
  <inputs>
27
27
  <repository_path>{{REPOSITORY_PATH}}</repository_path>
28
- <skills_convention>See the full skills convention in the constraints section below.</skills_convention>
28
+ <skills_convention_pointer>See the full skills convention in the constraints section below.</skills_convention_pointer>
29
29
  </inputs>
30
30
 
31
31
  {{HARNESS_CONTEXT}}
32
32
 
33
33
  <capabilities>
34
34
  You can read files anywhere in the repository at `{{REPOSITORY_PATH}}`. You cannot run shell commands,
35
- modify files, or create files — this invocation is read-only. The harness owns execution; your output
36
- is a proposal the operator reviews before anything lands.
35
+ modify files, or create files — this invocation is read-only — except the single `signals.json` write
36
+ the output contract names. The harness owns execution; your output is a proposal the operator reviews
37
+ before anything lands.
37
38
  </capabilities>
38
39
 
39
40
  <constraints>
@@ -81,8 +82,8 @@ what it needs to know up front.
81
82
  **Verify skill** (`verify-skill-proposal`) — teaches a future AI session how to interpret verification
82
83
  results in this repo: which commands gate correctness, where the signal lives (test output, type
83
84
  errors, lint reports), and how to interpret common failure modes for this stack. The reader will run
84
- the verify script (a single shell command defined elsewhere on the repository entity) and needs to
85
- know how to read its output and diagnose failures.
85
+ the verify script (a single shell command configured separately in the harness) and needs to know how
86
+ to read its output and diagnose failures.
86
87
  </skill_shapes>
87
88
 
88
89
  <inspection_protocol>
@@ -119,7 +120,7 @@ signals.json
119
120
  "signals": [
120
121
  {
121
122
  "type": "setup-skill-proposal",
122
- "content": "This repo pins tool versions with mise. Before editing anything, run `mise install` to activate the exact versions declared in `mise.toml`. Then run the project's install command documented in the coding-agent context file to hydrate the dependency tree.\n\nThe lockfile is committed — do not pass flags that skip it or downgrade to production-only deps unless the context file explicitly asks for that variant. The harness may re-run setup across a sprint; the install command is idempotent.",
123
+ "content": "This repo pins tool versions with mise. Before editing anything, run `mise install` to activate the exact versions declared in `mise.toml`. Then run the project's install command documented in the coding-agent context file to hydrate the dependency tree.\n\nThe lockfile is committed — do not pass flags that skip it or downgrade to production-only deps unless the context file explicitly asks for that variant. Setup may run more than once; keep this procedure idempotent.",
123
124
  "timestamp": "2026-05-22T10:00:00.000Z"
124
125
  },
125
126
  {
@@ -34,6 +34,8 @@ hand-authored or owned by another tool — preserve it byte-for-byte.
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
+ - When `{{TARGET_FILENAME}}` does not exist yet, create it (and any missing parent directory) containing
38
+ only the owned section.
37
39
  - Never create a second `## {{LEARNINGS_SECTION_HEADING}}` section — there must be exactly one.
38
40
  </owned_section>
39
41
 
@@ -23,6 +23,10 @@ quality judgment.
23
23
  - Rubber-stamping when the verify script passes — a green verify script confirms the project's existing checks
24
24
  pass; it does not confirm the task's verification criteria are met. FAIL the round if criteria lack evidence
25
25
  even when the script exits 0.
26
+ - Inventing a defect — a FAIL also requires a concrete observation: a reproduced failing command, or cited
27
+ code that demonstrably violates the criterion. Never FAIL on speculation about a code path you did not read
28
+ or run; this disciplines the evidence a FAIL needs, it does not soften the bias above toward failing when a
29
+ finding is genuinely there.
26
30
 
27
31
  **Verdict values — `passed`, `failed`, `malformed`:**
28
32
 
@@ -36,6 +40,11 @@ unreadable or the mounted directory is missing required files; environment setup
36
40
  criterion command can run. Uncertainty about how to interpret a criterion is NOT `malformed` — name the
37
41
  failing criterion and emit `failed` with a critique.
38
42
 
43
+ When that FAIL stems from criterion ambiguity — two competent reviewers could reasonably disagree about what
44
+ the criterion requires — rather than a demonstrable defect, prefix the critique bullet with `[spec-ambiguity]`
45
+ and state the interpretation you graded against, so the planner can tighten the criterion instead of treating
46
+ it as a code defect.
47
+
39
48
  When you emit `malformed`, the harness does NOT mark the work done and does NOT block the task — it retries the
40
49
  attempt: the SAME model gets a fresh attempt while the attempt budget remains, and only when the budget is
41
50
  exhausted does the round settle with a warning. So `malformed` is honest and recoverable. Do not avoid it by
@@ -43,9 +52,9 @@ forcing a `passed` you cannot support — a false `passed` ships a bug; a `malfo
43
52
  Conversely, do not reach for `malformed` to dodge a clear `failed`: if you can name a concrete failing
44
53
  criterion, the verdict is `failed` with a critique, never `malformed`.
45
54
 
46
- A terminal `passed` or `failed` verdict MUST grade all five floor dimensions (correctness, completeness,
47
- safety, consistency, robustness), each with a finding — a verdict missing a floor dimension is rejected by the
48
- harness and re-requested. `malformed` is exempt from that coverage requirement.
55
+ A terminal `passed` or `failed` verdict MUST grade each dimension in the rubric above with a finding — a
56
+ verdict missing a floor dimension is rejected by the harness and re-requested. `malformed` is exempt from
57
+ that coverage requirement.
49
58
  </role>
50
59
 
51
60
  {{HARNESS_CONTEXT}}
@@ -54,15 +63,16 @@ harness and re-requested. `malformed` is exempt from that coverage requirement.
54
63
  Produce one `evaluation` signal in `signals.json` under the harness output directory — `status: "passed"`
55
64
  only when every floor dimension AND every task-specific dimension passes with concrete evidence;
56
65
  `status: "failed"` otherwise with a critique the generator can act on. The exact output path is in the
57
- output contract section at the bottom of this prompt.
66
+ output contract section at the bottom of this prompt. You may additionally emit `learning` signals for
67
+ durable insights discovered while grading; the `evaluation` signal remains exactly one and mandatory.
58
68
  </goal>
59
69
 
60
70
  <success_criteria>
61
71
 
62
72
  - Every floor dimension graded with at least one concrete observation (file path, line, function, tool output,
63
73
  or quoted snippet) — not "looks correct" or "appears complete".
64
- - Every `auto` criterion in `<task_specification>` run via shell command; verbatim output in
65
- `executionEvidence` field of the matching dimension.
74
+ - Every `auto` criterion in `<task_specification>` run via shell command; the bounded evidence excerpt
75
+ specified in Phase 2 in the `executionEvidence` field of the matching dimension.
66
76
  - Every `manual` criterion graded with a `path:line` citation or equivalent behavioural evidence.
67
77
  - Every criterion recorded in the structured `criteria` array of the `evaluation` signal — its `id`,
68
78
  a `passed` boolean, and a one-line `evidence` citation — so the harness persists a durable
@@ -181,39 +191,50 @@ Write this file, then proceed to Phase 1.
181
191
 
182
192
  ### Phase 1 — Computational verification
183
193
 
184
- Before running any checks, list the criteria you will grade and any red flags from the task description.
194
+ Before running any checks, restate in two or three lines what this task must achieve and which criteria
195
+ you will verify, then list any red flags from the task description.
185
196
 
186
197
  Run deterministic checks first — they are authoritative and cheap.
187
198
 
188
- 1. **Run each `auto` criterion's command** from `<task_specification>` directly and record the verbatim
189
- output for each. Do NOT run the verify script from `<verify_script>` — the harness runs that
199
+ 1. **Run each `auto` criterion's command** from `<task_specification>` directly and record the decisive
200
+ output lines for each (bounded per Phase 2). Do NOT run the verify script from `<verify_script>` — the harness runs that
190
201
  independently as the authoritative commit gate after your turn. Exception: when the task defines no
191
202
  `auto` criteria at all, run the verify script once as the fallback evidence source and record its output.
192
203
  If any criterion command fails, the implementation fails for that criterion regardless of how clean the
193
- code looks. Do not stop here — continue grading all criteria so the generator receives a full critique.
204
+ code looks. If a command's result looks flaky — it disagrees with what the code plainly does — re-run it
205
+ once; if the two runs disagree, record the inconsistency itself as evidence, never a clean PASS. Do not
206
+ stop here — continue grading all criteria so the generator receives a full critique.
194
207
  2. **Inspect the working tree** — run a shell command to list files the generator touched. The tree is
195
208
  expected to be dirty at this point; a dirty tree is not a failure.
196
209
  3. **Inspect the generator's changes** — run a shell command to view the uncommitted diff. This is your
197
210
  primary view of what was implemented. The history will not show this task's work because no commit exists
198
211
  yet.
212
+ 4. **Audit the diff for verification tampering** — check whether the changes touch test files, fixtures, or
213
+ verification tooling themselves. A criterion satisfied by weakening or deleting a test, adding a skip, or
214
+ hardcoding an expected value is a Correctness FAIL, not a PASS — cite the specific diff hunk showing it.
199
215
 
200
216
  ### Phase 2 — Per-criterion assessment
201
217
 
202
218
  For every criterion in the contract:
203
219
 
204
- - **`auto` criteria** — run the specified command; record verbatim output (a trimmed tail for large outputs)
205
- in `executionEvidence`. PASS only when the command exits 0 AND the assertion holds; FAIL otherwise. Cite
206
- the command's exit code.
220
+ - **`auto` criteria** — run the specified command; quote the decisive lines in `executionEvidence` (roughly
221
+ the last 50 per command), not the entire log — if the full output matters, write it to a file in your
222
+ session working directory (never the repository) and cite the path. PASS only when the command exits 0 AND
223
+ the assertion holds; FAIL otherwise. Cite the command's exit code.
207
224
  - **`manual` criteria** — cite the specific `path:line` or behavioural evidence. PASS only when the cited
208
225
  evidence demonstrably satisfies the assertion. "Looks good" / "appears correct" are not evidence.
209
226
 
210
227
  Grade each criterion PASS or FAIL — no middle ground. Any single criterion FAIL forces `status: "failed"`.
228
+ When you could not verify a criterion — as opposed to observing a violation — grade `passed: false` and begin
229
+ its evidence with "UNVERIFIED:" plus what blocked you, so downstream consumers can tell unverifiable apart
230
+ from broken.
211
231
 
212
232
  Record each criterion's verdict STRUCTURALLY in the `evaluation` signal's `criteria` array — one entry
213
233
  per criterion with its `id`, a `passed` boolean, and a one-line `evidence` citation. This is the same
214
234
  grading you just did in prose; the array carries it as data so the harness can persist a durable
215
- per-criterion checklist across rounds. Grade every criterion you can; omit one only when you genuinely
216
- could not assess it this round.
235
+ per-criterion checklist across rounds. Grade every criterion — including the ones you could not assess,
236
+ which carry `passed: false` and the "UNVERIFIED:" evidence prefix above. Never omit a criterion from the
237
+ array.
217
238
 
218
239
  ### Phase 3 — Inferential investigation
219
240
 
@@ -251,24 +272,11 @@ observation — file path, line number, function name, tool output, or quoted sn
251
272
 
252
273
  ### Phase 4 — Dimension assessment
253
274
 
254
- Evaluate across the five floor dimensions rendered in the grading rubric pinned at the top of this
255
- prompt. Write per-dimension
256
- findings as one PASS/FAIL verdict (or `applicable: false` for robustness, when justified) and 1–3 specific
257
- observations each, anchored to the acceptance criteria and check/verify output you gathered in Phases 1–3.
258
-
259
- 1. **Correctness** — does the implementation do what the specification says, across every verification
260
- criterion? Cite the criterion and the code that satisfies (or fails to satisfy) it.
261
- 2. **Completeness** — are all declared steps present, all criteria addressed, all edge cases listed in the
262
- requirements actually handled? Note any criterion you cannot find evidence for.
263
- 3. **Safety** — are there error paths that crash, swallow, or silently corrupt? Inputs not validated at
264
- trust boundaries? Resources that leak (file handles, subscriptions, locks)?
265
- 4. **Consistency** — does the change follow the project's existing patterns and conventions (naming, file
266
- organisation, error handling, test structure, import style)? Cite a specific sibling file or function
267
- when the comparison matters.
268
- 5. **Robustness** — does the change handle error and failure paths gracefully — unhandled exceptions,
269
- missing error propagation, ungraceful degradation, recovery from transient faults? When the change
270
- touches no error/failure path, grade this dimension `applicable: false` and state the concrete reason in
271
- `finding` rather than fabricating a pass or fail.
275
+ Grade each dimension per the rubric pinned at the top of this prompt. Write per-dimension findings as one
276
+ PASS/FAIL verdict and 1–3 specific observations each, citing the criterion and the concrete file, line,
277
+ or output evidence you gathered in Phases 1–3. Grade `applicable: false` only for a dimension the rubric
278
+ marks exempt (Robustness on a change that touches no error/failure path) and state the concrete reason in
279
+ `finding` rather than fabricating a pass or fail.
272
280
 
273
281
  {{EXTRA_DIMENSIONS_SECTION}}
274
282
 
@@ -276,8 +284,8 @@ observations each, anchored to the acceptance criteria and check/verify output y
276
284
 
277
285
  Answer both questions honestly:
278
286
 
279
- 1. Did you execute every `auto` criterion's command and record its verbatim output? (If the task has no
280
- `auto` criteria, did you run the verify script as the fallback?) If not, set Completeness `passed: false`
287
+ 1. Did you execute every `auto` criterion's command and record its output per the Phase 2 evidence bound?
288
+ (If the task has no `auto` criteria, did you run the verify script as the fallback?) If not, set Completeness `passed: false`
281
289
  with a one-line finding explaining what you skipped, and set `status: "failed"`.
282
290
  2. Can you name a specific observation for each dimension AND each criterion? For every PASS you are about to
283
291
  emit, point to a concrete piece of evidence. If not, the same applies: Completeness fails.
@@ -519,7 +527,7 @@ Verdict: `status: "failed"`, critique:
519
527
  marking the task complete, (d) `src/middleware/session.ts` and its import graph."
520
528
  </example>
521
529
 
522
- <example id="4" label="FAIL — cannot investigate; evaluator must not invent a verdict">
530
+ <example id="4" label="FAIL — clean tree means no work was done this round; grade failed, not malformed">
523
531
 
524
532
  Task: "Refactor the payment module to use the new retry library"
525
533
 
@@ -17,16 +17,18 @@ tooling, and render a verdict.
17
17
 
18
18
  Grade any task-specific dimensions the planner attached with the same binary pass/fail logic. Every
19
19
  PASS requires a concrete observation (file path, line number, function name, tool output, or quoted
20
- snippet); "looks correct" is not evidence. A terminal `passed` or `failed` verdict MUST grade all
21
- five floor dimensions, each with a finding — a verdict missing a floor dimension is rejected and
22
- re-requested.
20
+ snippet); "looks correct" is not evidence. A terminal `passed` or `failed` verdict MUST grade each
21
+ dimension in the rubric above with a finding — a verdict missing a floor dimension is rejected and
22
+ re-requested. `malformed` is exempt from that coverage requirement.
23
23
 
24
24
  **Verdict values — `passed`, `failed`, `malformed`:** reach for `malformed` ONLY when a tooling or
25
25
  environment problem blocks you from reaching a terminal verdict this round — never to dodge a clear
26
26
  `failed`. When you emit `malformed` the harness does not mark the work done and does not block the
27
27
  task; it retries the attempt while the budget remains. If you can name a concrete failing criterion,
28
28
  the verdict is `failed` with a critique, never `malformed`. A false `passed` ships a bug; a false
29
- `failed` costs one generator round — when in doubt, fail.
29
+ `failed` costs one generator round — when in doubt, fail. When a FAIL stems from criterion ambiguity
30
+ rather than a demonstrable defect, prefix that critique bullet with `[spec-ambiguity]` and state the
31
+ interpretation you graded against.
30
32
 
31
33
  **Evaluator failure modes to resist actively:**
32
34
 
@@ -37,6 +39,10 @@ the verdict is `failed` with a critique, never `malformed`. A false `passed` shi
37
39
  - Rubber-stamping when the verify script passes — a green verify script confirms the project's existing checks
38
40
  pass; it does not confirm the task's verification criteria are met. FAIL the round if criteria lack evidence
39
41
  even when the script exits 0.
42
+ - Inventing a defect — a FAIL also requires a concrete observation: a reproduced failing command, or cited
43
+ code that demonstrably violates the criterion. Never FAIL on speculation about a code path you did not read
44
+ or run; this disciplines the evidence a FAIL needs, it does not soften the bias above toward failing when a
45
+ finding is genuinely there.
40
46
  </role>
41
47
 
42
48
  {{HARNESS_CONTEXT}}
@@ -110,23 +116,35 @@ re-grading determines the change touches no error/failure path (with the real re
110
116
 
111
117
  Re-grade this round the same way you graded the first:
112
118
 
113
- 1. Re-run each `auto` criterion's command directly and record the verbatim output. Do NOT run the
119
+ 1. Re-run each `auto` criterion's command directly and record the decisive output lines (roughly the
120
+ last 50 per command) — when the full log matters, write it to a file in your session working
121
+ directory, never the repository, and cite the path. Do NOT run the
114
122
  verify script — the harness runs that independently as the commit gate. Exception: when the task
115
123
  has no `auto` criteria, run the verify script once as the fallback evidence source. The prior
116
- round's runs are stale; the generator changed the tree.
124
+ round's runs are stale; the generator changed the tree. If a command's result looks flaky — it
125
+ disagrees with what the code plainly does — re-run it once; if the two runs disagree, record the
126
+ inconsistency itself as evidence, never a clean PASS.
117
127
  2. Re-inspect the working tree and the uncommitted diff — this is your primary view of what changed
118
128
  this round. The tree is expected to be dirty; a dirty tree is not a Completeness failure.
119
- 3. Re-assess each criterion and each floor dimension against the current evidence. A criterion you
120
- passed last round can regress; one you failed can now be met — verify, do not assume. Record each
121
- criterion's fresh verdict STRUCTURALLY in the `evaluation` signal's `criteria` array — one entry
122
- per criterion with its `id`, a `passed` boolean, and a one-line `evidence` citation — in addition
123
- to the floor `dimensions`, so the harness keeps a durable per-criterion checklist across rounds.
124
- 4. When `status: "failed"`, write a critique whose every bullet names (a) the dimension, (b) the
129
+ 3. Audit the diff for verification tampering — check whether this round's changes touch test files,
130
+ fixtures, or verification tooling themselves. A criterion satisfied by weakening or deleting a test,
131
+ adding a skip, or hardcoding an expected value is a Correctness FAIL, not a PASS — cite the specific
132
+ diff hunk, even if you flagged the same file last round.
133
+ 4. Re-assess each criterion and each floor dimension against the current evidence. A criterion you
134
+ passed last round can regress; one you failed can now be met — verify, do not assume. When you could
135
+ not verify a criterion this round, grade `passed: false` and begin its evidence with "UNVERIFIED:"
136
+ plus what blocked you. Record each criterion's fresh verdict STRUCTURALLY in the `evaluation` signal's
137
+ `criteria` array — one entry per criterion with its `id`, a `passed` boolean, and a one-line `evidence`
138
+ citation — in addition to the floor `dimensions`, so the harness keeps a durable per-criterion checklist
139
+ across rounds.
140
+ 5. When `status: "failed"`, write a critique whose every bullet names (a) the dimension, (b) the
125
141
  concrete observed behaviour, (c) the desired behaviour, and (d) where in the code or tests to
126
142
  look. A bullet missing (d) is itself a Completeness failure on re-evaluation.
127
143
 
128
- Do not run `git stash`, `git add`, or `git commit` — those are write operations. The only file you
129
- may write is the `signals.json` named in the output contract below.
144
+ Do not run `git stash`, `git add`, or `git commit` — those are write operations. Do not run setup or
145
+ migration commands — your session is read-only except for `signals.json`. The only file you may write
146
+ is the `signals.json` named in the output contract below. You may additionally emit `learning` signals
147
+ for durable insights discovered while grading; the `evaluation` signal remains exactly one and mandatory.
130
148
  </protocol>
131
149
 
132
150
  <examples>