Skip to content

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

Python

Merge remote-tracking branch 'origin/main' into worktree-fix-line-repl-paste-1367

justrache614ab4c1bf6
diff --cc docs/adr/0213-line-repl-paste-is-framed-and-typed.md
index 0699ff00,00000000..64d6ed76
mode 100644,000000..100644
--- a/docs/adr/0213-line-repl-paste-is-framed-and-typed.md
+++ b/docs/adr/0213-line-repl-paste-is-framed-and-typed.md
@@@ -1,17 -1,0 +1,17 @@@
- # 0212. Line-REPL pastes remain framed and typed through active turns
++# 0213. Line-REPL pastes remain framed and typed through active turns
+
+Status: accepted 2026-09-28
+
+## Context
+
+The idle line editor enabled bracketed paste but disabled it on submit. A multiline paste during model or tool work then reached the mid-turn stdin watcher as individual keystrokes: pasted newlines queued separate steering prompts, and an empty pasted line could force an interruption. The watcher and turn-boundary queue drain also shared mutable draft state. A dropped `data:image` URI could instead fall through as prompt text. See [#1367](https://github.com/justrach/codegraff/issues/1367).
+
+## Decision
+
+Keep bracketed-paste mode enabled from the first interactive line edit until terminal release; restore the editor's modified-key mode after each line. The mid-turn scanner tracks paste markers across reads and treats their contents as one draft. Only an Enter *after* the closing marker queues it; a later empty Enter still explicitly forces the queued turn. Serialize scanner input, draft/queue mutation, and turn-boundary reset.
+
+Before expanding an idle paste as text, classify recognized image data URIs. Validate their encoding and image type, bound their size, then stage a native image attachment or reject them locally. Never submit a rejected URI as prompt text. Structured context-overflow errors do not become transient gateway retries merely because their message says to try again.
+
+## Consequences
+
+Terminals supporting bracketed paste preserve multiline steering atomically; terminals without it still cannot distinguish a paste from repeated Enter keystrokes. Every graceful line-REPL exit must disable the terminal mode. Image drops now use bounded decoding memory and fail visibly when unsupported; ordinary text pastes and genuine transient gateway retries keep their existing behavior.
diff --cc docs/adr/README.md
index 743fd029,82dd3796..21ed2649
--- a/docs/adr/README.md
+++ b/docs/adr/README.md
@@@ -237,7 -237,8 +237,9 @@@ record only when you need the evidence
| [0208](0208-hot-context-keyed-updates-keep-the-prefix.md) | A mid-session instruction-file edit or date rollover is appended before the next prompt as a keyed `<context>` message (developer role on Responses, system on Chat Completions, user elsewhere), and the system prompt is left as is. Compaction drops those messages and folds the latest values into the new system prompt. |
| [0209](0209-desktop-app-has-no-computer-use.md) | The desktop app has no computer use: the `computer` tool, endpoint and menu toggle are removed; the native input bridge remains a test-only driver. Supersedes the `computer` half of 0071. |
| [0210](0210-macos-cli-is-signed-in-ci-before-upload.md) | Tag releases sign and notarize the macOS CLI tarballs on a macOS runner before anything is uploaded, gated on all five signing secrets; without them the job no-ops and docs/notarization.md is the fallback. `SHA256SUMS` is computed once from the uploaded bytes. The desktop DMG stays a local `distribute.sh` step. |
- | [0212](0212-line-repl-paste-is-framed-and-typed.md) | Keep line-REPL paste framed through active turns; submit one draft on Enter, and stage or reject bounded image data URIs before text expansion. |
+ | [0211](0211-mcp-servers-by-name-user-level-sync-via-harness.md) | `graff mcp add <name>` resolves from the codegraff.com/mcp.json catalog, then the MCP registry only for a namespace owner matching the name. `--everywhere` writes the user-level file. Harness syncs that file through its registry as non-secret rows. Env values, headers and OAuth tokens stay on each device. Harness drives graff only over ACP (slash command, form elicitation, `_meta["graff/mcp"]` status). Supersedes the vault-item sync in #1371. |
+ | [0212](0212-build-time-is-analysis-bound.md) | A cold build is ~16 s of single-core semantic analysis; codegen and link are nearly free. No redundant files to cut. Keep the default backend: `-fllvm` is 2x slower, `-fincremental`/`--watch` do not help on Zig 0.17-dev, and `-fno-llvm -fno-lld` exhausts memory. Iterate with `-Dtest-filter` (44 s → 13 s). |
++| [0213](0213-line-repl-paste-is-framed-and-typed.md) | Keep line-REPL paste framed through active turns; submit one draft on Enter, and stage or reject bounded image data URIs before text expansion. |
## When to write one