tool_output::find_parameter_end ended a value at the first </parameter> followed by <parameter= or </function>, so a write whose content quoted a whole call (a file that documents the format, a heredoc, a test) was published with content cut at the quote and the rest as plain text, whole and streamed, without any error (upstream #4078, fixed there in 77794e34 and b72f56e0). It now follows upstream's quote rule: a close inside a call the value itself quotes (more quoted <function=NAME> openers followed by <parameter= or </function> than </function> closers before it) is part of the value. One forward pass over the value. Incremental also stops re-trying candidate call ends it has already rejected. A call whose value quotes an opener and never closes it is now unterminated (an error) instead of being cut at the first plausible close, so a long write that quotes a call and is itself cut by the token limit is not published truncated. Deliberately not taken from upstream: a value that reopens its own parameter (</parameter><parameter=content> inside content). Upstream reads it as text; here it is byte for byte a parameter written twice, which desktop-core's native_tools_sdet::unknown_incomplete_duplicate_or_late_invalid_call_refuses_entire_output requires to be refused, and merging the two into one argument would hide a malformed call. It stays an error (duplicate tool parameter), listed as known failure. Regression tests: specimens 4078-nested-call and 4078-heredoc and the quoted-value shapes "quoted call", "quoted call at the end" and "heredoc" of the ported corpus failed on the previous commit and pass here (13 of 41 specimens, 5 of 6 shapes), plus a unit test for the cut outer call. The 8 existing tool_output tests and the 14 native_tools_sdet tests pass 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.