Commit Graph
43 Commits
Author SHA1 Message Date
Pavlo RatushnyiandClaude Sonnet 5.5 ab54ae208f feat: experimental tool_call_recovery for drifted tool-call forms (default OFF)
Adds Options::recovery to tool_output and an opt-in setting, `tool_call_recovery` (config key) / STRATA_TOOL_CALL_RECOVERY=1
(environment, wins over the file; 0/false turns it off; anything else stops the start). It is off unless set, is read once at
start, logs "tool_call_recovery is ON (experimental)" at start, and logs every call it accepts. It is NOT part of the default
contract and has not passed a quality gate (docs/api-contract.md, "Tool-call recovery (experimental)").

With it on, a call for a DECLARED tool written next to the template form is read as the call (upstream 3fcb2106, #3441):
* <parameter=NAME> where <function=NAME> belongs; <=NAME>, <function:NAME>, <function =NAME> or <NAME> after <tool_call>;
* {"name": ..., "arguments": {...}} inside <tool_call>, also in a Markdown fence, arguments possibly a JSON string;
* a bare <function=NAME> ... </function> at the start of a line outside a code fence and inline code (a stray </tool_call>
  after it is dropped); the Markdown state is tracked over the text that has left the stream buffer, so streamed and whole
  readings agree;
* a second call in the same <tool_call>;
* for array/object arguments, brackets left open at the end and a bare string where an object member belongs (dropped).
An undeclared name stays an error in every form. Streaming: a batch is delivered when its </tool_call> arrives, a bare call when
the text after it shows it is over or at the end.

With the option off the reading is byte for byte the step-3 reading. The corpus test now reads every specimen twice (off and on)
and lists the failures of each; every streamed cut agrees with the whole reading in both. Recovery rate on the 41 Qwen specimens:
off 24/41 (58.5 %), on 30/41 (73.2 %); the 6 specimens that need recovery: off 0/6, on 6/6. That is code reach on upstream's
failure corpus, not a rate for real sessions. strata-control lib 339 passed (new: 3 recovery tests, 1 config test), corpus and the
quoted-value shapes pass with the option on and off.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 03:54:39 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 f528844ff9 fix: read the recoverable tool-call cases instead of failing the response
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>
2026-10-30 03:48:29 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 9b07fdd995 fix: a string argument that quotes a tool call is no longer cut at the quoted text
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>
2026-10-30 03:45:24 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 c5c60ac66a test: port the upstream tool-call corpus and record which specimens the parser reads
Adds the 49 specimens of Strata upstream's serve/test_tool_corpus.py (MIT, provenance and licence in
control-plane/tests/fixtures/tool_corpus/NOTICE.md; reporter handles removed) and the six quoted-call value shapes of
serve/test_quoted_call_values.py as control-plane/tests/tool_corpus.rs. 41 specimens are Qwen-form and run against
tool_output (whole through parse_complete, streamed through Incremental in pieces of 1/3/7 and cut at every character);
the 8 DSML specimens are skipped, there is no DSML parser here.

On main 11 of 41 specimens and 2 of 6 quoted value shapes are read as upstream expects. The rest are listed in
KNOWN_FAILURES / KNOWN_QUOTED_FAILURES (strict both ways: a listed specimen that starts passing fails the test) and in
docs/tool-call-corpus.md. No parser change in this commit.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 03:23:24 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 b3274c1130 Merge claude/port-gpu-bringup (CUDA runtime port, upstream sync) into main
Linux / keyless-cuda-gate (push) Skipped
Rust port / port-typecheck (push) Failing after 8s
Desktop foundation / core (ubuntu-latest) (push) Failing after 11s
Rust port / port-oracles (push) Failing after 11s
Rust port / port-linux-tests (push) Failing after 14s
Rust port / port-fast (push) Failing after 9s
Linux / verify (push) Failing after 17s
Linux / keyless-cuda (push) Skipped
Linux / static-cuda-package (push) Skipped
Linux / hosted-cuda-package (push) Skipped
Linux / linux-static-cli (push) Skipped
Linux / linux-cli-container (push) Skipped
Linux / release-cli (push) Skipped
Brings the Rust/CUDA port of the Strata mode17 serve path together with the
CPU/iGPU/NPU gpt-oss runtime that main gained meanwhile.

Control plane: the Qwen tokenizer is the implementation behind the Qwen35
variant of codec::TextCodec (qwen(), encode_prompt() widen the trait; QwenCodec
derefs to the tokenizer), so control-token marks, images, chat template, the
runtime backend and vision keep their behavior, while the gpt-oss/Harmony path
and the worker pool keep main's. Config carries the union of fields; extra_workers
is rejected together with runtime, lazy_load, idle_unload_s and vision; the
gpt-oss family refuses top_k/min_p/penalties (its GEN line has no such keys).
leleka-kar-codec takes f16_bits_to_f32 from leleka-quant-core (identical code).
Workspace members and default-members are the union of both sides.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 08:32:33 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 f7ab3fd59c Control-token text inside messages is ordinary text (plan 0.1; upstream c16f31f8, 98b7ea94, 0d613031)
leleka_tokenizer::LiteralMarks swaps every special literal (GGUF token type 3 and 4) in a client string for a plane-15 private-use mark
before the chat template runs (a forged mark is escaped); Tokenizer::encode_marked parses the template's own literals as special tokens and
encodes each mark's literal as ordinary text. render_request marks instructions, message text, reasoning, call arguments, tool outputs and
tool descriptions/schemas; the gateway's own tool markers stay literal. Generation and /input_tokens share the one encoding; the text
contract carries the marked string and leleka-runtime reads it with encode_marked.

Not covered: strata-desktop-core still renders unmarked text; live Codex session (gate L) not run.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-25 23:31:05 +01:00
Pavlo Ratushnyi e64a3da1b7 Merge branch 'claude/platform' into claude/port-gpu-bringup
# Conflicts:
#	crates/deploy/src/app.rs
#	crates/deploy/src/cli.rs
2026-10-25 14:06:50 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 da6f8f2f48 metrics: empty hardware blocks and a null telemetry member while the engine publishes nothing
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-25 13:05:12 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 1bbb9d1b8e desktop-core and control-plane build and test natively on Windows: api-key init (hard-link publish, user profile ACL), atomic no-replace directory publish via MoveFileExW, tokenizer export without directory fsync, MSVC link stubs for the ggml bridge, Unix-only shell-script tests gated
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-25 12:45:21 +01:00
Pavlo Ratushnyi 75e7e47dcc control-plane: /api/requests monitor, the Python Monitor members of /metrics, Prometheus text exposition
Opt-in api_monitor keeps the last 100 requests of the chat, messages and responses dialects; /metrics gains engine, live, requests, totals, hardware, history; ?format=prometheus (or a scraper Accept) renders the same document as gauges and counters. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-25 12:18:32 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 60b48d8225 runtime reconfiguration: reopen the serve stack with new context/cache/resource settings without reloading the model
serve_tuning (settings document, validation, effective settings), Command::Reconfigure in the Original serve loop with rollback,
Backend::reconfigure, gRPC Runtime.Reconfigure, POST /v1/reconfigure, telemetry.settings; tests for each layer.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-25 03:01:53 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 e820b95556 cp-latency: tokenizer kill switches (LELEKA_TOKENIZER_REFERENCE, LELEKA_TOKENIZER_SEGMENT_CACHE_MIB), prompt-text pass-through test, drop dead tokenizer fields
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 01:49:38 +02:00
Pavlo Ratushnyi 0790ba6ec9 Merge branch 'claude/memory-safety' into claude/port-gpu-bringup 2026-10-18 05:09:13 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 f53d54d122 test(control-plane): http_surface golden ignores the Rust-only status keys prefix_cache and memory; docs results
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 04:04:37 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 e4f4e1e9a9 fix(control-plane): chat completions keeps Retry-After on a memory_pressure 503; gate test covers chat and messages
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 02:35:27 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 713235d8ed feat(memory): residency guard on its own thread, read-only remap of the archive, dead-sampler recovery, cgroup v1, swap A/B tool, lint fixes
- guard_archive maps a private read-only reopen of the descriptor (a write-sealed memfd refuses a shared mapping that could become writable on
  kernels up to 5.15); the residency read runs on its own thread; the sampler survives a panic and a stale level is re-evaluated by the
  requests themselves; cgroup v1 memory controller limits (WSL2 hybrid, old container hosts) are honoured.
- examples/swap_ab + scripts/memory/swap_ab.sh: A/B (unlocked, heal, mlock) of the memfd under real pressure fenced into one cgroup.
- Miri: procfs/host/plan/pressure/inventory/census/ledger/governor run clean (61 tests).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 01:51:29 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 5ebd939b6f feat(memory): wire the governor into the runtime, the gRPC status and the control plane
- leleka-runtime: memory_governor glue (startup plan with refusal, KAR memfd lock/residency guard, VRAM check, load-ledger stages,
  inventory classes), prefix budget from the governor (auto/explicit clamped), shed directive applied per request and per prefill chunk,
  engine-side admission (503 memory_pressure text), page-cache release of the shards after the resident bank load, cgroup-aware
  available_memory.
- backend-api: Backend::memory_report (default None) and ScriptedEngine support; proto Snapshot.memory_json; desktop-core runtime_rpc and
  runtime-client carry it.
- control-plane: MemoryView, /v1/status `memory`, /metrics `memory`, 503 memory_pressure + Retry-After gate before queueing, engine-side
  refusal text mapped to the same 503; tests incl. a 600-request model-free soak (threads/fds/RSS flat).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 01:33:34 +02:00
Pavlo Ratushnyi 1cd52bc388 Merge branch 'claude/port-gpu-bringup' into claude/e2e 2026-10-18 00:59:49 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 8af18396b8 feat(prefix-cache): pool protocol (summary through runtime gRPC, /v1/status, /v1/prefix_match), --prefix-cache-mib/--prefix-cache-block, laptop profile in the smoke, docs
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 19:47:53 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 af3beab76e fix(api): text-level-only features are 400s, generation failures are logged; e2e: xlong scenario and failure notes
reasoning_budget_tokens, strata_tune, experimental_speed_projection and sampling finer than the
text contract's fixed point were queued and then refused as 502 generation_failed; the HTTP layer
now answers 400 unsupported_request_field / invalid_sampling_precision for a text-level engine.
Every failed generation logs its client-visible message; STRATA_DEBUG_FAILED_OUTPUT=1 also logs
the generated text of a failed tool turn (operator debugging only).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 17:35:29 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 856d538a83 wip: HTTP-layer 400 for context/output-cap errors, fake-engine tooling for the e2e client
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 15:45:13 +02:00
Pavlo Ratushnyi 7b833d552a chore: clippy-clean the new code (unused import, map_or identity, ptr_arg) 2026-10-16 03:16:18 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 edb2d49687 feat(control-plane): accept the harmless Codex hints (service_tier, user, text.verbosity, reasoning.effort minimal, summary none)
text.format becomes optional so a text object may carry only a verbosity. concise/detailed
summaries, max_tool_calls and other include values stay refused. New HTTP tests run a Codex-shaped
two-turn exchange with stateless replay and the tool_choice / parallel_tool_calls enforcement
through the runtime stack.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 03:06:03 +02:00
Pavlo Ratushnyi d358a80cd9 test(control-plane): output cap and sampling fixed point reach the engine 2026-10-16 02:47:08 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 c8601d0b2c feat(control-plane): runtime block selects the runtime backend; strata-next serves in front of leleka-inference
runtime.{address,token_env,tokenizer_dir,model,mode,max_context} are validated at load
(loopback only, credential from the environment and never printed, exclusive with
engine/native_model/mtp_pack/vision/gpu). serve spawns backend_worker over GrpcBackend.
The worker carries the runtime's output-token cap in WorkerStatus; a default budget never
exceeds it, an explicit request above it is refused. Request ids are UUIDs, as the
runtime contract requires.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 02:46:22 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 a4259d8f2b feat(control-plane): worker for a text-level engine behind the existing HTTP API
backend_worker drives any leleka_backend_api::Backend through the GenerationCommand
channel strata-next already uses. It maps the rendered prompt to the engine contract
(verified round trip of the ids), re-tokenizes text deltas with a byte-equality check,
recognises the stop literals, maps finish reasons, cancels on client disconnect,
guarantees a terminal event when the engine dies, and re-attaches by itself. What the
text contract cannot carry is refused. 23 HTTP tests over a scripted engine cover
Responses (JSON/SSE), Chat, tools, text.format, cancellation and engine faults.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 02:33:45 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 e74376430f fix(control-plane): a failing log sink can no longer kill the worker supervisor mid-request
eprintln! panics when stderr is unwritable (consumer gone: EPIPE, disk full:
ENOSPC). worker.rs logged before it marked the worker Failed, so with a dead log
consumer the supervisor task died, readiness stayed true and later requests hit a
dead worker (charter M1 / Gate A). All diagnostics now go through the
non-panicking elog! macro.

tests/log_failure_sse.rs starts the real strata-next binary with a scripted
engine, drops the stderr consumer after startup and provokes a protocol failure
inside a streamed Responses request: the stream must end with response.failed and
readiness must drop (the control case with a live sink passes before and after;
the dead-sink case failed before). A source scan keeps eprintln! out of the crate.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 01:59:26 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 750a8d3003 test(reasoning-budget): replay the Service.run golden through the live worker and the Responses HTTP path
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:50:39 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 81b907030f feat(vision): picture parts in the Chat, Messages and Responses dialects, the strata-vision encoder client and GENI embeddings
The three adapters reduce pictures to a Responses input_image, the prompt renderer writes the template's
picture items and returns their sources in prompt order, and the request path encodes them (in turn with the
engine), expands every image pad to its token count and sends GENI with the combined SVE1 file. The encoder
is configured by a top-level vision section, stops with the engine and starts before it. Goldens recorded from
the Python handlers cover fourteen Chat and Messages requests.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:46:59 +02:00
Pavlo Ratushnyi 2d8d362d6b Merge branch 'claude/port-offline' into claude/port-main
# Conflicts:
#	Cargo.toml
#	control-plane/src/lib.rs
#	crates/context/Cargo.toml
#	crates/context/src/lib.rs
#	crates/model-format/src/qwen4exp_expert_source_bank.rs
2026-10-14 16:09:35 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 2d00e78706 feat(reasoning-budget): port Service.reasoning_budget and the run-loop wrap-up with a Service.run differential
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:07:14 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 250fd3e65d feat(prompt): render the pinned chat template with minijinja instead of a hand-written Qwen format
minijinja =2.24.0 (+ minijinja-contrib pycompat for str methods), configured like serve/frontend.py ChatTemplate:
trim/lstrip blocks, no autoescape, raise_exception, Python tojson (json.dumps ensure_ascii=False) and str.strip trim.
All 10 chat_golden.json cases render byte for byte straight through the template (tool_calls, tool messages, no
generation prompt included). Ordered Json keeps object key order. scripts/offline/diff_chat_template.py: 12000
generated conversations vs jinja2 (identical renders, identical raise_exception messages); committed golden + test.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:53:16 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 76d57a549c feat(control): MCP hub (stdio + Streamable HTTP), config keys and GET /mcp
Port of serve/mcp.py: server config validation, background start, paged
tools/list, <server>__<tool> namespacing, error-as-text results with the
character cap, restart on demand, cancellation, GET /mcp. Tested against the
Original's fake MCP server. The server-side tool loop is intentionally not
ported (documented).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:51:13 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 08dbe0abe0 feat(mtp-fetch): port tools/mtp_fetch.py (inventory/fetch/verify) with a local-mirror differential
Pinned 31-entry SHA-256 table, 206 + exact Content-Range, retry-once on wrong bytes, inventory re-read on a revision
change, verified.json stamps. model::http_client is now shared. Tests port test_mtp_fetch.py onto a real local HTTP
mirror; scripts/offline/diff_mtp_fetch.py runs the unmodified Python against the same mirror (10 scenarios).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:43:43 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 2c7fcf4af1 feat(serving): port control vectors, SVE1 embedding files and M-RoPE positions
leleka-serving-policy gains the Original's host-side vision and steering code: the SVE1
record reader and the (t,h,w) position table (compiled verbatim from generate.cpp for the
golden fixture), image sources, Python-compatible base64, the <|image_pad|> expansion of
Service.prepare, and the control-vector GGUF loader with its add/project tables (bit-exact
against the verbatim load_control_vectors). control-plane accepts engine.control_vector in
its config, preflights the files and passes the engine its arguments.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:43:23 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 392037d83e feat(serving): port the operational HTTP surface of the Python server
control-plane serves /props, /slots, /v1/status, /api/health, /settings, /load, /unload,
/v1/load, /v1/unload, model aliases, CORS with the preflight ahead of authentication and the
own-page guard; replayed scenario by scenario against the real Python handlers. The worker
supervisor gains load/unload, lazy start, idle unload, reload gates (before_load, min free VRAM),
an outside stall watchdog and the reasoning-budget wrap-up (budget tracker golden-tested against
the Python Detokenizer/OutputParser loop). leleka-serving-policy adds CORS, idle, stall watchdog,
logits stride (golden vs the C++ header), request timings and alias rules.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:35:08 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 f2ec56325c test(dequant): bit-exact parity of 23 block types vs pinned gguf-py and iq_fixture
scripts/offline/diff_dequant.py (live, 32 rows x 3 seeds through export-tensor-f32) and a committed golden
with an integration test over the production visitor.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:33:27 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 f3bff3842d feat(gguf): header-reader differential, full metadata dump and Python geometry parity
- model inspect-metadata dumps every key/value (bool arrays typed); metadata_entries in model-format
- block_geometry gains Q8_K, IQ1_S, F64, MXFP4, NVFP4; ggml bridge decodes Q8_K, IQ1_S, MXFP4, NVFP4
- general.alignment must be uint32 (the Python reader accepted any width, the Rust reader ignored the rest)
- scripts/offline/diff_gguf_header.py: random GGUF vs unmodified gguf_reader.py, plus stricter-by-design list
- committed golden + integration test (headers and the geometry table)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:25:20 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 0d073e08aa feat(native-pack): match iq_pack.py conversions, add --compat-bf16/--base/--experts-bin and the exhaustive differential
- ple_conv1d inexact F32->F16 is accepted and recorded exact=false, as the oracle does
- conversions.json now carries method/exact/max_abs_err/source_shards like iq_pack.py
- opt-in --compat-bf16 (dequantize + RNE to BF16/F16/F32), --base (index_from_base, extra.bin),
  --experts-bin (+ experts.bin.src.json); receipts list the optional files present
- scripts/offline/diff_native_pack.py: 2700+ cases against the unmodified tools/iq_pack.py
- unit tests: real golden expert tables, numpy/gguf-py F16/BF16 rounding vectors
- fix three pre-existing clippy lints in leleka-model-format

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:20:15 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 cce433339d feat(serving): forward all Original GEN sampling fields end to end
control-plane wire.rs builds GEN/GENI lines through RequestSampling::gen_keys plus
strata_tune and the per-request cvec switch (golden-tested against the real
StrataEngine.generate); Responses, Chat Completions and Messages accept and validate
top_k, min_p, repetition/frequency/presence penalties, penalty_last_n, seed and the
engine knobs with the Original's defaults and ranges; server-wide defaults (config
sampling block plus POST /settings shared values) merge under the request. The desktop
runtime gRPC contract carries the full sampling set and the gateway no longer refuses
temperature != 0. New crate leleka-serving-policy holds the pure Original policies
(shared settings, reasoning budget tracker, fixed-point sampling conversion) with
fixtures generated by running the Python handlers.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:17:04 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 3006852154 test(control-plane): cross-check KAR kernel model against file-backed oracle
Writes NESTED archives with the production kar_writer, opens them with the
shared inspector and compares kernel-model windows for levels 2..=5 (partial
last groups, odd row lengths, expert rows, dial limits) bit-for-bit with
kar::decode_tensor_range. Also checks the model's f16 widening against
quant-core for all 65536 patterns. CPU only.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 14:42:43 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 7f896a8bb8 import: Original-literal source-port snapshot (frozen 2026-10-12 06:36, uncompiled together, no GPU run)
Snapshot of target/stra169-direct-port-integration/source-port (without target/), now the tracked base for the full Strata Rust port.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 14:38:46 +02:00
Pavlo Ratushnyi 4013e0c9bd Import tracked Strata Next source snapshot
Desktop foundation / core (macos-latest) (push) Canceled after 0s
Desktop foundation / core (windows-latest) (push) Canceled after 0s
Linux / verify (push) Canceled after 0s
Linux / keyless-cuda (push) Canceled after 0s
Desktop foundation / core (ubuntu-latest) (push) Failing after 28s
Linux / static-cuda-package (push) Canceled after 0s
Linux / hosted-cuda-package (push) Canceled after 0s
Linux / linux-static-cli (push) Canceled after 0s
Linux / linux-cli-container (push) Canceled after 0s
Linux / release-cli (push) Canceled after 0s
2026-10-05 18:15:08 +02:00