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 fix/330-resumable-serve

Rach Pradhan6993775b8011
diff --cc scripts/eval/tier1-manifest.json
index fd818684,a4707d84..428dcc42
--- a/scripts/eval/tier1-manifest.json
+++ b/scripts/eval/tier1-manifest.json
@@@ -10,7 -10,7 +10,7 @@@
"src/main.zig",
"src/repl.zig"
],
- "test_count_baseline": 640,
- "test_count_baseline": 633,
++ "test_count_baseline": 646,
"required_invariants": [
{
"id": "goal-epochs",
diff --cc src/schema.zig
index ac8d69a9,c3deaf2d..c856bfbf
--- a/src/schema.zig
+++ b/src/schema.zig
@@@ -25,31 -26,22 +26,12 @@@ const schema_protocol_json = @import("s
/// Documentation of the `harness serve` HTTP bridge, embedded verbatim in
/// `--schema` output. Same request/event contract as the stdio protocol —
/// one POST = one protocol request, streamed back as NDJSON until that
-/// request's terminal event (turn/error for user turns; the ack for others).
-const schema_serve_json =
- \\{
- \\ "transport": "HTTP/1.1 (graff serve, default 127.0.0.1:8787); auth via Authorization: Bearer <token> when --token/HARNESS_SERVE_TOKEN is set (required on non-loopback binds)",
- \\ "endpoints": [
- \\ {"method": "GET", "path": "/healthz", "description": "liveness + version, no auth"},
- \\ {"method": "GET", "path": "/v1/schema", "description": "this schema document"},
- \\ {"method": "POST", "path": "/v1/sessions", "description": "create a session (a graff --json child); optional JSON body {\"model\",\"subagentProvider\",\"subagentModel\",\"allowCrossProviderSubagents\",\"yolo\",\"system_prompt\",\"append_system_prompt\",\"maxToolCalls\",\"maxModelCalls\",\"dedupeToolCalls\"} overrides serve-level defaults; responds {\"session_id\":\"<16 hex>\"}"},
- \\ {"method": "POST", "path": "/v1/sessions/{id}", "description": "body is ONE stdio-protocol request object (user / set_system_prompt / set_model / compact / set_mode / set_agent / score / answer); non-answer requests stream application/x-ndjson events until the request's terminal event (turn/error, or the request-specific ack); answer requests return JSON ack while the original user stream continues; one non-answer request in flight per session at a time"},
- \\ {"method": "DELETE", "path": "/v1/sessions/{id}", "description": "graceful close: waits for any in-flight request, then EOFs the child's stdin"}
- \\ ]
- \\}
-;
+/// request's terminal event (turn/error for user turns; the ack for others) —
+/// plus the #330 resumability surface (seq, ?from=N, durable session names).
+const schema_serve_json = @import("schema_serve.zig").json;
- /// Launch flags relevant to SDK clients, embedded verbatim in `--schema`
- /// output so generated clients can surface them as first-class options.
- /// Pinned against learning_privacy.default_mode by a test there: the SDKs are
- /// generated from this text, so a stale default here is a promise the binary
- /// does not keep.
- pub const schema_flags_json =
- \\[
- \\ {"flag": "--model", "arg": "name", "description": "start on this model (same fuzzy resolution as /model)"},
- \\ {"flag": "--subagent-model", "arg": "name", "description": "pin direct subagents, workflow workers/retries, and judges to this model on the root provider; GRAFF_SUBAGENT_MODEL is the lower-precedence equivalent"},
- \\ {"flag": "--subagent-provider", "arg": "id", "description": "route pinned workers through this explicit provider; GRAFF_SUBAGENT_PROVIDER is the lower-precedence equivalent"},
- \\ {"flag": "--allow-cross-provider-subagents", "arg": null, "description": "explicitly consent to sending worker prompts, code, and tool results to a provider different from the root"},
- \\ {"flag": "--yolo", "arg": null, "description": "skip all permission prompts for the session"},
- \\ {"flag": "--system-prompt", "arg": "text", "description": "replace the built-in system prompt (cwd project-instructions file is still appended)"},
- \\ {"flag": "--append-system-prompt", "arg": "text", "description": "append extra text to the end of the system prompt"},
- \\ {"flag": "--json", "arg": null, "description": "structured stdio protocol (JSON in, JSONL events out)"},
- \\ {"flag": "--max-tool-calls", "arg": "N", "description": "hard per-turn root tool-call budget; rejected calls emit tool_rejected/tool_result"},
- \\ {"flag": "--max-model-calls", "arg": "N", "description": "opt-in invocation-wide provider-call ceiling shared by root, review, subagents, retries, title, compaction, and judges; default unlimited"},
- \\ {"flag": "--dedupe-tool-calls", "arg": null, "description": "reject duplicate root tool name+normalized-input calls per turn"},
- \\ {"flag": "--no-telemetry", "arg": null, "description": "disable anonymous OTEL usage telemetry for this run"},
- \\ {"flag": "--learning-privacy", "arg": "local|aggregate|templates|examples", "description": "set the prompt-learning egress ceiling; default aggregate (signed prompt-free grades), local sends nothing, and template text still requires exact interactive approval"}
- \\]
- ;
+ /// Launch flags for SDK clients (schema_protocol.zig, alongside the protocol
+ /// doc it is emitted with), re-exported here as the `--schema` field name.
+ pub const schema_flags_json = @import("schema_protocol.zig").flags;
const ToolSpec = struct {
name: []const u8,
desc: []const u8, // no characters needing JSON escapes