Skip to content

graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs

Python

feat(prompt): empty payload is no records, not malformed

Cursor Agent506fe4256abc
diff --git a/docs/adr/0024-three-harness-compare-prompt-subagent-rss.md b/docs/adr/0024-three-harness-compare-prompt-subagent-rss.md
index 14dbfe47..34dcd0e3 100644
--- a/docs/adr/0024-three-harness-compare-prompt-subagent-rss.md
+++ b/docs/adr/0024-three-harness-compare-prompt-subagent-rss.md
@@ -194,6 +194,21 @@ already put on the *full* `subagent` desc, not on lean).
**Still reject:** V8 / grok heap, extra spawn tools, parent-history
fork, share root `prompt_cache_key` with children, IPython.
-Live A/B after this revision: `--suite swe --harness
-graff-dev-old,graff-dev,grok -j 12`. Goal: graff passes `json-stream`
-(5/6) and/or fewer calls/tokens, RSS stays ~9M.
+Live A/B after the lean-desc rewrite (`run-20260825-063211.jsonl`,
+same OAuth / grok-4.6 / `-j 12`):
+
+| harness | pass | wall (sum) | first | RSS | in | out | calls |
+|---|---:|---:|---:|---:|---:|---:|---:|
+| `--old` | 4/6 | 551.8s | 16.2s | 9.5M | 819087 | 40858 | 80 |
+| default rlm | 4/6 | 572.2s | 9.6s | 9.4M | **678343** | 42606 | **67** |
+| grok-build | **5/6** | **376.6s** | **1.8s** | 158.7M | **157065** | 24438 | **31** |
+
+Versus the pre-cut grok-inclusive file (`061731`): default rlm
+**−46% input tokens** (1.26M → 678k) and **−30% calls** (96 → 67),
+RSS still ~9M. `cookie-store` 19→12 calls / 322k→152k;
+`label-sort` 22→11 / 354k→125k. Pass rate stayed 4/6 —
+`json-stream` still raised on whitespace-only json-seq (`" "` has
+no RS; grok skips content before the first RS and yields nothing).
+The follow-up `work_note` sentence is that clause: a required
+delimiter applies to records that exist; a payload with no records
+is empty, not malformed. Do not copy grok's 159M heap.
diff --git a/src/prompt_snapshot_tests.zig b/src/prompt_snapshot_tests.zig
index 0d312692..f0cfce86 100644
--- a/src/prompt_snapshot_tests.zig
+++ b/src/prompt_snapshot_tests.zig
@@ -116,7 +116,9 @@ const golden_full_prompt =
\\files you need straight from it instead of ls/find exploration turns.
\\When a named SPEC.md (or equivalent contract) is in the task, satisfy
\\every clause — a green public test is not the whole spec. Empty input
- \\includes whitespace-only unless the spec says otherwise.
+ \\includes whitespace-only: yield nothing, do not raise. A required
+ \\record delimiter applies to records that exist; a payload with no
+ \\records is empty, not malformed.
\\
\\Before a large chunk of work, give a one- or two-sentence heads-up on what
\\you are about to do; on long tasks, drop a brief note as each phase lands.
diff --git a/src/prompt_text.zig b/src/prompt_text.zig
index b045683c..0bbc063b 100644
--- a/src/prompt_text.zig
+++ b/src/prompt_text.zig
@@ -162,7 +162,9 @@ pub const work_note =
\\files you need straight from it instead of ls/find exploration turns.
\\When a named SPEC.md (or equivalent contract) is in the task, satisfy
\\every clause — a green public test is not the whole spec. Empty input
- \\includes whitespace-only unless the spec says otherwise.
+ \\includes whitespace-only: yield nothing, do not raise. A required
+ \\record delimiter applies to records that exist; a payload with no
+ \\records is empty, not malformed.
;
/// Always present: narration is a habit, not a capability.