Skip to content

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

Python

Keep input semantics in the task contract

Rach Pradhan189b40c4c6f0
diff --git a/docs/adr/0185-input-semantics-belong-to-the-task-contract.md b/docs/adr/0185-input-semantics-belong-to-the-task-contract.md
new file mode 100644
index 00000000..d1c38e35
--- /dev/null
+++ b/docs/adr/0185-input-semantics-belong-to-the-task-contract.md
@@ -0,0 +1,30 @@
+# 0185. Input semantics belong to the task contract
+
+Status: accepted 2026-09-23
+
+## Context
+
+Standing work instructions prescribed that whitespace-only input yields no
+records and that an input without records is valid despite a required record
+delimiter. Those rules depend on the format and task. Applying them globally
+can override a contract that requires preserving whitespace or rejecting
+incomplete framing.
+
+## Decision
+
+Keep the general instruction to satisfy every clause of the task's specification,
+rather than treating passing public tests as the entire contract. Remove global
+prescriptions for empty input, whitespace normalization, and record delimiters
+from both full and lean work instructions. Derive those semantics from the
+applicable task contract and format instead.
+
+This supersedes only the empty-input and record-delimiter prompt prescriptions
+in [ADR 0024](0024-three-harness-compare-prompt-subagent-rss.md). Its other decisions
+remain unchanged. Tool guidance and the catalog are unchanged.
+
+## Consequences
+
+Full and lean prompts no longer impose one format's input semantics on unrelated
+tasks. The prompt golden remains aligned with the full prompt. Existing prompt
+composition and golden tests verify the text change; task-level correctness
+requires separate evaluation against the relevant contract.
diff --git a/docs/adr/README.md b/docs/adr/README.md
index 68a01459..04f06766 100644
--- a/docs/adr/README.md
+++ b/docs/adr/README.md
@@ -210,6 +210,7 @@ record only when you need the evidence or the edge cases.
| [0182](0182-acp-connection-usage-is-an-extension.md) | Connection-scoped ACP usage preserves unknown totals through a custom notification; network retries remain activity indicators. |
| [0183](0183-request-policy-owns-ambiguous-retries.md) | Ambiguous HTTP/2 failures return to the request retry policy so attempts and unknown usage remain observable. |
| [0184](0184-directory-scan-budgets-count-examined-entries.md) | Directory scan limits count examined entries before filtering; truncated listings and suggestions remain explicitly partial. |
+| [0185](0185-input-semantics-belong-to-the-task-contract.md) | Empty-input, whitespace, and record-framing semantics come from the task contract, not global work instructions. |
## When to write one
diff --git a/src/prompt_golden.zig b/src/prompt_golden.zig
index 08b06627..ac610229 100644
--- a/src/prompt_golden.zig
+++ b/src/prompt_golden.zig
@@ -156,10 +156,7 @@ pub const full_prompt =
\\When a Project layout segment is present, it is the tree — read the
\\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: yield nothing, do not raise. A required
- \\record delimiter applies to records that exist; a payload with no
- \\records is empty, not malformed.
+ \\every clause — a green public test is not the whole spec.
\\
\\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 908c5672..67832097 100644
--- a/src/prompt_text.zig
+++ b/src/prompt_text.zig
@@ -221,10 +221,7 @@ pub const work_note =
\\When a Project layout segment is present, it is the tree — read the
\\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: yield nothing, do not raise. A required
- \\record delimiter applies to records that exist; a payload with no
- \\records is empty, not malformed.
+ \\every clause — a green public test is not the whole spec.
;
/// Always present: narration is a habit, not a capability. ADR 0061: the
@@ -388,10 +385,7 @@ pub const lean_work_note =
\\parameters. When a change request names a file, read it and edit that path
\\before answering — do not describe a fix you have not applied.
\\When a named SPEC.md is in the task, satisfy every clause
- \\— a green public test is not the whole spec. Empty input 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.
+ \\— a green public test is not the whole spec.
;
pub const lean_closing_note =