Skip to content

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

Python

Merge release v0.0.296 with main

Rach Pradhan7b843cef2f51
diff --cc docs/adr/0103-mcp-apps-are-isolated-result-views.md
index 00000000,bd0c122f..bd0c122f
mode 000000,100644..100644
--- a/docs/adr/0103-mcp-apps-are-isolated-result-views.md
+++ b/docs/adr/0103-mcp-apps-are-isolated-result-views.md
diff --cc docs/adr/README.md
index a60f53fa,01dd2ce9..8e6721b5
--- a/docs/adr/README.md
+++ b/docs/adr/README.md
@@@ -105,7 -105,15 +105,15 @@@ record only when you need the evidence
| [0092](0092-codedb-context-is-local-first.md) | Bare `codedb context` is `--local`; `--hybrid` / `--semantic` are opt-in remote rerank (and still refused under ADR 0084 policy). |
| [0093](0093-project-layout-breadth-and-directory-hints.md) | Project layout favors breadth under its caps; missing directories offer bounded sibling hints without changing confinement or ADR 0090 constraint policy. |
| [0094](0094-subagent-interrupt-is-a-cancel-file.md) | GUI Stop writes `{id}.cancel` in the activity dir; the child finishes failed even if the model returns. Not `session/cancel`. |
-| [0095](0095-mcp-apps-are-isolated-result-views.md) | MCP Apps are private saved result views in isolated GUI/browser sandboxes; app tool calls require a future approval path. |
+| [0095](0095-live-evals-are-gated-prs.md) | Live evals are gated PRs with no SPEC.md; score pass @ n=3 and list$ on passing reps only. |
+ | [0096](0096-desktop-link-destination.md) | Persist the desktop link destination outside origin-scoped storage; validate once and reveal the focused chat's Browser without navigating the app. |
+ | [0097](0097-isolate-probe-clipboards.md) | Offline PTY probes get private clipboard commands per process; direct probe runs retain OS clipboard integration. |
+ | [0098](0098-orphan-listeners-are-not-stop-authority.md) | Legacy listener discovery is read-only; stop authority requires verified ownership, port preflight checks both families, and unknown browser visibility protects listening jobs. |
+ | [0099](0099-gui-saved-sessions-are-snapshots.md) | A saved-session GET is a snapshot with unknown live status; the GUI must not infer the REPL finished. |
+ | [0100](0100-publication-claims-and-verified-completion.md) | Non-draft PRs fail closed on CI/Verification/helper-only claims; artifact presence ACK is not ownership; recipe success is verified task success. |
-
+ | [0101](0101-gui-tests-preserve-desktop-focus.md) | GUI tests stay hidden by default; visible opt-in can overlap other apps, and native foreground checks require separate opt-in. |
+ | [0102](0102-workspace-agents-and-cancel-recovery.md) | Agents uses the workspace area, Tasks visibility is explicit and persisted, and timed-out cancellation retires the worker before session recovery. |
++| [0103](0103-mcp-apps-are-isolated-result-views.md) | MCP Apps are private saved result views in isolated GUI/browser sandboxes; app tool calls require a future approval path. |
## When to write one
diff --cc docs/mcp-apps.md
index 00000000,ec1640ef..7636f46b
mode 000000,100644..100644
--- a/docs/mcp-apps.md
+++ b/docs/mcp-apps.md
@@@ -1,0 -1,35 +1,35 @@@
+ # MCP Apps in Codegraff
+
+ Call a connected MCP tool that declares an MCP Apps UI. In the native GUI, its tool result includes an **Interactive MCP result** view. Close/reopen controls dispose and restore the view. Text and image output stays available in the transcript.
+
+ In the REPL, run **`/mcp apps`** after the tool completes to open its latest saved view in the default browser. The link in the tool result also identifies the standalone HTML file. This works with the existing MCP server configuration and consent process; it does not install or authorize additional servers.
+
+ Views can display results, scroll, resize, and offer source links. Clicking a source exposes an **Open source** link in trusted host chrome for a user click. Image-copy features depend on browser permissions; the isolated view may need the app's copy-link or manual-selection fallback. This version does not run app-initiated tool calls or inject messages into the agent conversation; those requests fail explicitly.
+
+ Snapshots are stored in the user's `.graff/mcp-apps` directory with private file permissions and opaque ids. They include the tool result and its view metadata, remain available across transcript reloads, and can be deleted when no longer needed. The REPL shortcut tracks the latest view in its current session; old snapshots remain openable by their saved links.
+
+ ## Development and regression checks
+
+ Build the engine and run its offline integration fixtures:
+
+ ```sh
+ zig build
+ zig build test --summary all
+ python3 scripts/test-mcp-apps.py
+ ```
+
+ The Python fixtures start local MCP and scripted-model servers. They verify text and base64 resources, saved results, exclusion of private UI metadata from model requests, private snapshot permissions, and invalid-resource fallback. The scripted model uses its established local test port; no provider API is called.
+
+ Run simulated apps in Chrome against the actual native GUI component and API route:
+
+ ```sh
+ cd apps/native
+ bun install
+ bun run test:mcp-apps
+ ```
+
+ The browser tests start an isolated Next development server and clean up only their own snapshots. They exercise handshake/result delivery, close/reopen, source and unsafe links, blocked app tool calls, cross-frame access, CSP network blocking, and standalone REPL snapshots. Store tests cover path traversal, symlinks, and oversized files. The visual fixture route is available only when `GRAFF_VISUAL_TESTS=1`.
+
+ For GUI development, run the native app with the rebuilt engine. Packaged desktop copies embed their own engine and frontend and need a new package before these changes appear there.
+
-See [the architecture decision](adr/0095-mcp-apps-are-isolated-result-views.md) for the isolation and capability boundary.
++See [the architecture decision](adr/0103-mcp-apps-are-isolated-result-views.md) for the isolation and capability boundary.