Commit Graph
144 Commits
Author SHA1 Message Date
Pavlo Ratushnyi b8765786b7 STRA-338 size-fn: fetch_steps within the limits, allowlist 429 -> 133 entries (fixed functions dropped, 18 unfinished desktop-core functions recorded), baselines tightened, size-fn record 2026-11-06 19:16:24 +01:00
Pavlo Ratushnyi ec2dbe54e1 STRA-338 size-fn: rustfmt of the files this batch changed (strata-control, strata-desktop-core, runtime-client, deploy) 2026-11-06 19:11:35 +01:00
Pavlo Ratushnyi 521c3d0d91 STRA-338 size-fn: dyn-trait aliases in desktop-core bins, result_large_err allowed where the error is the HTTP response 2026-11-06 19:11:19 +01:00
Pavlo Ratushnyi 5da74034ef Merge branch 'claude/szfn-cpc' into claude/hexagonal-size-gw 2026-11-06 19:06:55 +01:00
Pavlo Ratushnyi 113231a5df STRA-338 size-fn: strata-control: part_layout and plan_parts within the limits (fn>30 2 -> 0) 2026-11-06 19:03:31 +01:00
Pavlo Ratushnyi 44b428dd9a STRA-338 size-fn: strata-control: stream_parts layout/plan, loopback url, switch begin, run_session split into engine_io (fn>30 8 -> 0) 2026-11-06 19:01:38 +01:00
Pavlo Ratushnyi 00ad202f28 STRA-338 size-fn: strata-control: worker generate and Generation::new within the limits (fn>30 2 -> 0) 2026-11-06 18:53:46 +01:00
Pavlo Ratushnyi 04d945da7a STRA-338 size-fn: strata-control: tensor_export record builder (fn>30 1 -> 0) 2026-11-06 18:53:45 +01:00
Pavlo Ratushnyi f47b501f17 STRA-338 size-fn: strata-control: switch transaction, wait_ready, runtime_config resolve, tokenizer extract within the function limits (fn>30 12 -> 0) 2026-11-06 18:53:09 +01:00
Pavlo Ratushnyi 0c95bca7d1 STRA-338 size-fn: strata-control: stream_parts layout and shard planning split into modules (fn>30 2 -> 0) 2026-11-06 18:52:52 +01:00
Pavlo Ratushnyi a4e6db8a0b STRA-338 size-fn: strata-control: v1_reconfigure, status_value, service_unit render, Vision::spawn split; shared codec/decoder aliases (dyn ratchet), wide lines (fn>30 4 -> 0) 2026-11-06 18:50:13 +01:00
Pavlo Ratushnyi 588221cbd2 STRA-338 size-fn: strata-control: worker generate loop moved into Generation::next_line (fn>30 1 -> 0) 2026-11-06 18:43:36 +01:00
Pavlo Ratushnyi 88da9a6b84 Merge claude/szfn-cpb into claude/hexagonal-size-gw 2026-11-06 18:41:52 +01:00
Pavlo Ratushnyi ac7a1a4817 STRA-338 size-fn: strata-control: create helpers, serve, tensor_export within the function limits (fn>30 7 -> 0) 2026-11-06 18:38:31 +01:00
Pavlo Ratushnyi 85bd2ac8bb STRA-338 size-fn: strata-control: worker generate, wrap-up, run_session within the function limits (fn>30 8 -> 0) 2026-11-06 18:36:15 +01:00
Pavlo Ratushnyi 3e50fd08a1 STRA-338 size-fn: strata-control: kar_writer plan and key_init init within the gate 2026-11-06 18:29:42 +01:00
Pavlo Ratushnyi f72ecd2809 STRA-338 size-fn: strata-control: check_full_stream test helper within 30 lines 2026-11-06 18:28:05 +01:00
Pavlo Ratushnyi ac92cbdb9a STRA-338 size-fn: strata-control: write_archive_inner split into plan, file and publish stages (fn>30 1 -> 0) 2026-11-06 18:20:41 +01:00
Pavlo Ratushnyi b30677001e STRA-338 size-fn: strata-control: kar_* modules within function limits (fn>30 23 -> 0) 2026-11-06 18:19:08 +01:00
Pavlo Ratushnyi a8eae529ae STRA-338 size-fn: strata-control: verify_loaded_unit messages as consts (fn>30 1 -> 0) 2026-11-06 18:15:55 +01:00
Pavlo Ratushnyi 721129621b STRA-338 size-fn: strata-control: kar_writer sections within function limits 2026-11-06 18:14:28 +01:00
Pavlo Ratushnyi 2b47848231 STRA-338 size-fn: strata-control: worker run_session and run_supervised split into session and supervisor stages (fn>30 -2, helpers 5 left) 2026-11-06 18:14:15 +01:00
Pavlo Ratushnyi bda9387b00 STRA-338 size-fn: strata-control: service_switch/service_install (fn>30 11 -> 0) 2026-11-06 18:14:08 +01:00
Pavlo Ratushnyi 9654553e4f STRA-338 size-fn: strata-control: kar_writer tests within function limits (second pass) 2026-11-06 18:13:41 +01:00
Pavlo Ratushnyi 38c7af1b64 STRA-338 size-fn: strata-control: responses create/intake/history (fn>30 6 -> 0) 2026-11-06 18:13:30 +01:00
Pavlo Ratushnyi cbf2cf086b STRA-338 size-fn: strata-control: kar_writer tests within function limits 2026-11-06 18:08:31 +01:00
Pavlo Ratushnyi be9678a31a STRA-338 size-fn: strata-control: responses stream: text, buffered and tool streams as run structs with stage methods (fn>30 4 -> 0) 2026-11-06 18:06:24 +01:00
Pavlo Ratushnyi a18786f38a STRA-338 size-fn: strata-control: worker generate, reload_gate, wait_unloaded within the function limits (fn>30 -3) 2026-11-06 18:05:48 +01:00
Pavlo Ratushnyi 7d1f3d8e74 STRA-338 size-fn: strata-control: mcp within function limits 2026-11-06 18:02:22 +01:00
Pavlo Ratushnyi 50a8fd05ea STRA-338 size-fn: strata-control: messages and key_init within function limits 2026-11-06 18:02:09 +01:00
Pavlo Ratushnyi 785545b9e0 STRA-338 size-fn: strata-control: responses tests: keep allowlisted test fns from growing (fn>30 40 -> 0) 2026-11-06 17:50:52 +01:00
Pavlo Ratushnyi 0b4c3623e7 STRA-338 size-fn: strata-control: cli, config, backend_worker, app, chat, gguf/ggml streams, derived/misc (fn>30 83 -> 23 listed) 2026-11-06 17:49:28 +01:00
Pavlo Ratushnyi 9e007d293f STRA-338 size-fn: strata-control: native_pack conversion methods named convert_* 2026-11-06 17:49:10 +01:00
Pavlo Ratushnyi d425f1b846 STRA-338 size-fn: strata-control: write_sharded_preview within 30 lines 2026-11-06 17:42:18 +01:00
Pavlo Ratushnyi f9f89d8651 STRA-338 size-fn: strata-control: worker, service_install, vision, wait_ready tests and three tests-module fns within the function limits (test fns>30 21 -> 0) 2026-11-06 17:38:16 +01:00
Pavlo Ratushnyi 27912564c0 STRA-338 size-fn: strata-control: responses tests and harmony prompt tests within the function limits (fn>30 40 -> 0) 2026-11-06 17:37:57 +01:00
Pavlo Ratushnyi b9d9b910d2 STRA-338 size-fn: strata-control: metrics test helper takes the history by reference 2026-11-06 17:37:24 +01:00
Pavlo Ratushnyi 8622842edb STRA-338 size-fn: strata-control: native_pack, native_model, mtp_pack, mtp_fetch within function limits (fn>30 35 -> 0) 2026-11-06 17:32:17 +01:00
Pavlo Ratushnyi 49bf8800a7 STRA-338 size-fn: strata-control: prepare_preview and model_pipeline functions within limits (fn>30 22 -> 0) 2026-11-06 17:22:37 +01:00
Pavlo Ratushnyi 024df6564e STRA-338 size-fn: strata-control: model, request log/monitor, prometheus, pool, preflight and test helpers within the function limits 2026-11-06 17:14:22 +01:00
Pavlo Ratushnyi a5078a9c84 STRA-338 size-gw: 6 more production functions within the limits; doc comments and cfg attributes given back to the functions they belong to
settings_from, planner candidate, request_monitor begin and render, PrefixView::prefix_match and settings_post now use
helpers. Earlier helper insertions had taken the doc comment (or, for validate_auto, the #[cfg(unix)]) of the function
below them: restored for tool_markup, decode_tensor_row, read_events, one_layer, model_control_prelude,
check_activation_link, validate_auto and finish; the unix-only helpers carry the same #[cfg(unix)] (checked with a
Windows host `cargo check`, which shows no new warning in the two crates).

Test ids: 543 before and after, 0 missing, 0 outcome changes; warnings in the two crates 0 (Linux).
Counts (strata-control / strata-desktop-core), functions over 30 lines / complexity 10 / nesting 4 / wide lines, prod:
151/123/17/185 -> 146/122/17/185 and 63/56/6/52 -> 62/56/6/52.
2026-11-06 15:01:37 +01:00
Pavlo Ratushnyi 83565a456b STRA-338 size-gw: 11 more production functions of control-plane and desktop-core within the limits (helpers extracted, behaviour unchanged)
Vision::encode, StdioTransport::request, handle_cancel, RuntimeServer::{serve,reserve}, finish (legacy done line wrapped
with a string continuation, text unchanged), event_to_proto, ResponseHistory::insert_with_limit, ToolStream::{text,
finish_text} (json! bodies wrapped, key order unchanged), cuda_memory::inventory, HarmonyDecoder::translate and
Server::call.

Test ids: 543 before and after, 0 missing, 0 outcome changes; warnings in the two crates 0.
Counts (strata-control / strata-desktop-core), functions over 30 lines / complexity 10 / nesting 4 / wide lines, prod:
158/127/17/194 -> 151/123/17/185 and 67/58/6/54 -> 63/56/6/52.
2026-11-06 14:30:18 +01:00
Pavlo Ratushnyi ba93550022 STRA-338 size-gw: 22 test functions of control-plane and desktop-core within the limits; the size split recorded in docs/architecture
Helpers extracted from test functions that were moved verbatim by the split (their allowlist entries are gone):
native_pack one_layer, service_install unix tests, request_monitor streams, vision fetch, config control_vector_file,
kar_writer, node_reconnect launch, worker lifecycle, model hub token, kar_codec f16, the backend_worker_http prompt
limits, wire gen lines, lifecycle admission, service_switch journal, node_contract proxy, memory_gate reconfigure,
the ggml Q6/Q2 block builders, gguf_f32_stream IQ3/IQ4 truncation and the control-token rendering test.
docs/architecture/size-split-control-plane-desktop-core.md records where every oversize file went and how test ids moved.

Test ids: 543 before and after, 0 missing, 0 outcome changes; warnings in the two crates 0.
2026-11-06 14:07:28 +01:00
Pavlo Ratushnyi c1aa6d0194 STRA-338 size-gw: 13 more production functions of control-plane and desktop-core within the limits (helpers extracted, behaviour unchanged)
The five operator_*_execution parsers of the inference binary share select_execution_flag; the others are
mtp_pack::check, preflight_space, check_activation_link, service_install show, validate_auto, Ssh Config::arguments,
Manager::with_journal, Terminal::feed, Pool::acquire, Agent::build, enqueue_with, GenerationMetrics::finish and
NativeModel::validate.

Test ids: 543 before and after, 0 missing, 0 outcome changes; warnings in the two crates 0.
Counts (strata-control / strata-desktop-core), functions over 30 lines / complexity 10 / nesting 4 / wide lines, prod:
166/130/17/194 -> 158/127/17/194 and 77/59/6/54 -> 67/58/6/54.
2026-11-06 13:50:36 +01:00
Pavlo Ratushnyi 1f8effb97e STRA-338 size-gw: 25 production functions of control-plane and desktop-core brought within the limits (helpers extracted, behaviour unchanged)
Extracted helpers: ReqCtx::new, Profile::gateway, RuntimeServer::new, props, Generate::line, Http::request,
read_events, parse_macos, parse_nvidia, validate_nested_slices, sample_windows, tool_markup, count_input_tokens,
model_control_prelude, vision fetch, admit, decode_tensor_row, Registry::observe, provenance_value,
decode_source_tensor, service_install parse, provision prepare, provision arguments, write_group, pool relay.

Test ids: 543 before and after, 0 missing, 0 outcome changes; warnings in the two crates 0.
Counts (strata-control / strata-desktop-core), functions over 30 lines / complexity 10 / nesting 4 / wide lines:
prod 187/135/17/196 -> 166/130/17/194 and 81/59/6/54 -> 77/59/6/54; test unchanged (214/17/30/133, 65/3/3/27).
2026-11-06 13:30:31 +01:00
Pavlo Ratushnyi 7610ba3568 STRA-338 size-gw: the 19 oversize files of control-plane and desktop-core split by topic (no file over 400 lines); mechanical child modules renamed
Tests become directory modules named after what they test, with a shared fixtures/harness module:
control-plane/src/{responses,ggml_bridge,gguf_f32_stream,prepare_preview}/tests/, desktop-core/src/runtime_rpc/tests/;
integration targets become tests/<name>/main.rs plus topic modules and a harness (backend_worker_http, vision_http,
memory_gate_http, tool_corpus, mcp_hub, api_over_runtime, runtime_gateway_sdet, native_tools_sdet,
native_tools_retry_sdet, managed_worker, gateway); target names are unchanged. Sources: leleka-inference.rs becomes
src/bin/leleka-inference/ (main.rs plus one module per operator option group), the cp_replay example becomes
examples/cp_replay/, and the tonic service impl of runtime_rpc delegates to session_rpc, model_rpc and generate_rpc
(bodies unchanged). impl_* modules are renamed after what they hold (base_provenance, count_tokens, manifest_fetch,
fetcher, record, capture, in_flight, tool_policy, tool_plan, server). The self-spawning tests that name themselves
(credential_child, the managed worker fixture) use the new module path or stay at the target root.

Test ids: 543 before and after in both crates (strata-control, strata-desktop-core, --all-targets), 0 missing, 0 new,
0 outcome changes; 241 ids differ only in the module path. Warnings in the two crates: 0 before and after.
Counts (strata-control / strata-desktop-core): oversize files 19 -> 0 (13 + 6). Functions over 30 lines, complexity 10,
nesting 4, wide lines, prod: 187/135/17/199 -> 187/135/17/196 and 81/59/6/54 -> 81/59/6/54; test: 214/17/30/133 ->
214/17/30/133 and 65/3/3/30 -> 65/3/3/27. The 211 functions that moved verbatim are in limits-allowlist.json (owner
STRA-338) because the diff gate treats a moved function as added; the entries fall as the functions are shortened.
2026-11-06 13:13:59 +01:00
Pavlo Ratushnyi e765c06ae3 STRA-338 S7: last_activity at the start and end of a request reads the request's clock
run_backend_worker (twice per request) and the stdio worker's run_session (once per request) stamp last_activity with
ObsHandle::now(). The stamps at attach or READY and the per-engine-line stamp keep Instant::now(). The instant-now ratchet
of strata-control falls from 26 to 23. Docs: gateway-ports.md lists what is and is not behind the Clock.
2026-11-06 01:36:49 +01:00
Pavlo Ratushnyi c0f6888310 STRA-338 S21: the pure part of the Anthropic Messages adapter moves to leleka-gateway-domain
messages/request.rs (the Messages request types and Request::into_responses, CountRequest, text and block helpers) and
messages/reply.rs (message, stop reason, tool_use block, usage, the error type table and envelope as functions of the
status number) are in crates/gateway-domain. strata-control keeps the route layers, the SSE adaptation and the HTTP errors;
error_value(StatusCode, ..) is a wrapper over the domain function. The adapter tests stay where they are and pass on the
moved code (same test ids). The long functions are added to docs/architecture/tech-debt.md, the continuation is recorded in
docs/experiments/stra-338-gateway-track.md (90 golden cases; an earlier commit message says 96, which was a miscount).
2026-11-06 01:29:57 +01:00
Pavlo Ratushnyi 4394ac3337 STRA-338 S21: the Harmony prompt of a gpt-oss request moves to leleka-gateway-domain
harmony_conversation (the Responses input as Harmony messages), harmony_render (developer message, tools, rendering through
leleka-harmony, the date given by the caller) and prompt_date (PromptDate, its parser, civil_date) are in
crates/gateway-domain/src/responses/. strata-control keeps the process-wide prompt date, today() and render(request) in
responses/harmony_prompt.rs with the inline tests, so the byte-exact Harmony prompt tests keep their ids and pass on the
moved code. render_at lost its cfg(test) because the tests live in the other crate. Function texts are unchanged; the long
ones are added to docs/architecture/tech-debt.md.
2026-11-06 01:21:16 +01:00
Pavlo Ratushnyi 339a4c82cc STRA-338 S7: the request record and the worker request stamps read the Clock port
ReqCtx (the per-request record behind the structured request line) holds the Clock from Observe and stamps admitted,
engine_start, first_token and the line itself with it; Record::from_state takes the time as an argument. The backend
worker (serve_one start, conclude end) and the stdio worker (combine_done start) read the request's own clock through
ObsHandle::now(), which falls back to the system clock when the request has no record. These are request-level stamps;
the per-event stamps (last_progress, drain and stop deadlines, activity stamps) keep calling Instant::now() and stay on
the instant-now ratchet, which fell from 31 to 26 for strata-control.

New test: the_record_stamps_come_from_the_injected_clock (a ManualClock gives queue_ms 40 and ttft_ms 100).
Docs: gateway-ports.md says which stamps are behind the port, describes the serve() phases, and records the S10 default
(the offline CLI groups stay in strata-control).
2026-11-06 01:13:30 +01:00