Four shapes that ended in response.failed (or 502 tool_call_parse_failed) are now calls, each logged on stderr as "tool call accepted beyond the template form (closers supplied: N, arguments repaired: M, ...)": * </function> left out: a </parameter> followed by </tool_call> ends the value and the call, but only when no </parameter> followed by <parameter= or </function> ends the value (upstream d7113273, #4427/#4077). A streamed response delivers such a call when the generation ends, not at its </tool_call>: only the end can tell it from </parameter></tool_call> quoted inside a value. * </tool_call> left out: the call is whole when the next <tool_call><function=NAME> follows its </function>, or when its </function> ends a generation that stopped by itself (finish stop). A generation cut by the token limit never gets this. * A call inside the reasoning (no </think>): a normal stop whose text ends on whole calls of declared tools, the first at the start of a line outside a code fence and inline code, is reasoning (completed) followed by those calls (upstream 805ebe17/d7113273, #804). The calls' markup was already streamed as reasoning deltas; the final reasoning item ends before it. * Damaged array/object arguments of a parameter declared array or object (not a union with string): a trailing or doubled comma, single quotes, Python True/False/None, extra closing brackets, and an array written as a JSON string of itself are read as written (upstream _Lenient, A4). Nothing is invented or dropped; open brackets and bare strings are not repaired here. Undeclared tool names: upstream returns the call as text and counts it. That is NOT adopted. Text without a call ends an agent's turn as if it were the answer, while a failed response is retried by the client (docs/e2e-run.md records a session that survived one such failure), and native_tools_sdet / backend_worker_http pin the refusal. An undeclared tool is still an error; it is never run and never published. API: tool_output::{Options, Notes, Parsed, parse_with, calls_at_end}, Incremental::{with_options, finish_after, notes}; parse_complete and Incremental::new keep their strict default reading. Documented in docs/api-contract.md ("Tool-call parsing") and docs/tool-call-corpus.md. Corpus: 24 of 41 specimens read as upstream expects (13 before this commit). New unit tests cover each shape whole and streamed; strata-control lib 334 passed, native_tools_sdet 14 passed, existing tests unchanged. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Control plane
For small, experimental sharded fixtures, model ensure-sharded-preview MANIFEST --source-dir DIR --output FILE.kar --levels N acquires and verifies the sources, creates a KAR-2 preview, and verifies it again. It reuses an existing archive only when its payload, provenance, source identity, and requested level count verify. model smoke-fixture --output FILE.kar creates a deterministic model-free archive, and model checksum-kar-preview FILE.kar TENSOR LEVEL independently decodes it on CPU for comparison with the CUDA smoke tool. The 64 MiB input limit remains; these commands cannot prepare the target model for serving.
The repository pins Rust 1.99.0 in rust-toolchain.toml. rustup selects it automatically from this checkout. The strata-next executable defaults to serve and also supports doctor, model fetch MANIFEST --output DIR, model verify MANIFEST --output DIR, model inspect FILE.gguf, model index FILE.gguf [--hash], model derive-iq3-identity FILE.gguf, model derive-mixed-identity FILE.gguf, model derive-sharded-identity MANIFEST --source-dir DIR, model prepare-f32-preview FILE.gguf --output FILE.kar --levels N, model prepare-iq3-preview FILE.gguf --output FILE.kar --levels N, model prepare-mixed-preview FILE.gguf --output FILE.kar --levels N, model prepare-sharded-preview MANIFEST --source-dir DIR --output FILE.kar --levels N, model inspect-kar FILE.kar, model verify-kar FILE.kar [--manifest SPEC --source-dir DIR], model verify-iq3-preview FILE.kar --source FILE.gguf, model verify-mixed-preview FILE.kar --source FILE.gguf, model verify-sharded-preview FILE.kar --manifest SPEC --source-dir DIR, model extract-tokenizer FILE.gguf --output DIR, model tokenize TOKENIZER_DIR TEXT [--special], and model detokenize TOKENIZER_DIR IDS. Use model tokenize TOKENIZER_DIR --stdin [--special] for long text or control bytes. The IQ3, mixed, and sharded identity commands hash virtual F32 streams with bounded memory. Preview preparation commands write provenance sidecars, which the corresponding verification commands recompute and check against the archives. No preview archive is approved for serving. model inspect-kar checks bounded KAR-2 metadata, header CRC, directory digest, tensor shapes, and section bounds; model verify-kar also scans payload CRC-32 checksums. With a manifest and source directory it verifies each physical source shard and the archive's concatenated source digest. Neither command decodes KAR weights or measures quality. scripts/check-local.sh runs formatting, Clippy, Rust tests, protocol replay, and the CPU engine tests.
The Rust control plane provides process health, worker readiness, status, and graceful shutdown. It can start a Strata engine worker and records worker readiness only after the engine emits READY <max-context>. An abandoned internal generation sends STOP and drains its terminal response before the next request; shutdown during generation sends STOP before QUIT. With tokenizer assets configured, POST /v1/responses can perform a restricted non-streaming text generation with reasoning.effort: "none". It returns 503 while the worker is unavailable, 501 for unsupported live features or a missing tokenizer, and never fabricates a model response. Worker restart is not yet implemented.
Run locally with cargo run --manifest-path control-plane/Cargo.toml. It binds to 127.0.0.1:8081 by default; set STRATA_BIND to another socket address if needed. Check /health, /ready, and /status.
Set STRATA_CONFIG to a JSON file using config.example.json as a template. The file supports bind and an engine object with executable, args, tokenizer_dir, and startup_timeout_s (1–3600 seconds, default 600). STRATA_BIND, STRATA_ENGINE_EXE, STRATA_ENGINE_ARGS_JSON, STRATA_TOKENIZER_DIR, and STRATA_STARTUP_TIMEOUT_S override their file counterparts. The control plane supplies --serve itself. The tokenizer directory must contain the native assets extracted from the model.
Without an engine configuration, /ready returns HTTP 503 and /status reports unconfigured. A configured worker reports starting, then ready with max_context, or failed if startup, the readiness handshake, or the process fails. /ready returns HTTP 200 only when the worker and native tokenizer are configured and ready for the restricted text preview. During shutdown the worker reports stopping and receives QUIT. Startup has a timeout; the control plane never advertises readiness before the engine handshake.
Run the local contract checks with cargo test --manifest-path control-plane/Cargo.toml --locked. The tests use a small fake engine process and need no GPU or model. The supervisor test sends a token-ID GEN command through the worker pipe, reads T and DONE, and rejects a request that exceeds the ready worker's context. The Responses trace builder checks ordered SSE events, terminal completion, unchanged tool arguments, and JSON Schema output validation. The synthetic replay can be run as JSON or SSE:
cargo run --manifest-path control-plane/Cargo.toml --locked --bin replay-responses -- benchmarks/fixtures/responses/structured-tool.json
cargo run --manifest-path control-plane/Cargo.toml --locked --bin replay-responses -- --sse benchmarks/fixtures/responses/structured-tool.json
See API contract for the supported subset and remaining integration work.