Commit Graph
1395 Commits
Author SHA1 Message Date
Pavlo Ratushnyi 730d05d4e0 STRA-338 size: engine more helper splits (verify_parts, finish_parts, serve_tuning, direct_parts, mtp prefill) 2026-11-06 14:43:22 +01:00
Pavlo Ratushnyi 5df0c8b7fc STRA-338 size: engine split the new helpers further (decode_parts, serve_parts, open_parts, run_parts, generate_fn, generate_mtp); no dyn added 2026-11-06 14:34:18 +01:00
Pavlo Ratushnyi d259125d88 STRA-338 size: engine original_mtp_prefill/scalar_prefill: shared check_final_sources/shifted_next_ids/finish_draft_kv helpers (fn_lines 140 -> ~30, 110 -> ~35) 2026-11-06 14:16:39 +01:00
Pavlo Ratushnyi 8fde3e93c8 STRA-338 size: engine original_serve_host: run_window helpers (window_ple, run_pool_group, report_window) (fn_lines 109 -> ~55) 2026-11-06 14:14:15 +01:00
Pavlo Ratushnyi 907c177a9f STRA-338 size: engine serve_tuning::apply and CpuExpertPool::run_direct split into named steps (fn_lines 124 -> ~25, 130 -> ~35) 2026-11-06 14:12:31 +01:00
Pavlo Ratushnyi 9d146e9459 STRA-338 size: engine original_serve_verifier: assemble split into assemble_parts (fn_lines 142 -> ~45) 2026-11-06 14:08:52 +01:00
Pavlo Ratushnyi 22951a7459 STRA-338 size: engine backend/generate_mtp: generate_mtp_resume split into begin_decoder/prefill_tiles/verified_window/commit_window (fn_lines 216 -> ~85) 2026-11-06 14:06:33 +01:00
Pavlo Ratushnyi 0d659c7598 STRA-338 size: engine original_spec_controller: verify_commit and finish_round split into verify_parts/finish_parts (fn_lines 253 -> ~75, 167 -> ~30) 2026-11-06 14:04:47 +01:00
Pavlo Ratushnyi 1f9948d70f STRA-338 size: engine backend_original_serve runner: run and generate split into run_parts helpers (fn_lines 344 -> ~85, 164 -> ~85) 2026-11-06 13:52:28 +01:00
Pavlo Ratushnyi cdb02d527f STRA-338 size: engine original_serve_stack: OriginalServeStack::open split into open_parts helpers (fn_lines 385 -> ~120) 2026-11-06 13:47:57 +01:00
Pavlo Ratushnyi 6abab96174 STRA-338 size: engine original_serve_stack: decode_phase split into decode_parts/serve_parts helpers (fn_lines 364 -> ~160) 2026-11-06 13:42:17 +01:00
Pavlo Ratushnyi e4c83e6af8 STRA-338 size: scripts/limits-offenders.py lists the production functions over the limits, longest first 2026-11-06 13:32:03 +01:00
Pavlo Ratushnyi 70a907a58b STRA-338 S12: the seal tooling follows the split symbols table and knows chain_window.ptx is sealed (repin_expect); the fake-seal test now gets past chain_window and mtp_original_full_head_native
The remaining refusal is device_poison (sealed PTX pinned at closed_kernels.rs, plan entry has no repin_expect): plan staleness from main, not from the splits.
2026-11-06 13:26:37 +01:00
Pavlo Ratushnyi e15ca2ae82 Merge remote-tracking branch 'origin/claude/hexagonal-smoke' into claude/hexagonal-integ 2026-11-06 13:19:58 +01:00
Pavlo Ratushnyi ad87e5b57d STRA-338 size: scripts/dev/split_types.py moves the types, consts and statics of oversize files into child modules (12 more files split; width census +750 and test census +10 are the restored compact data tables and the reflow, nothing added); 1793 tests listed before and after 2026-11-06 13:16:11 +01:00
Pavlo Ratushnyi ab4280a3df STRA-338 size: data tables keep their compact form (rustfmt::skip: 1719/2051/1905 -> 933/259/360 lines), kernel_ab example becomes a directory example split into 13 modules (3992 -> 1635 in main.rs) 2026-11-06 13:05:10 +01:00
Pavlo Ratushnyi cdfec56460 STRA-338 size: the engine crates are rustfmt-clean at 120 columns (per-crate rustfmt.toml: max_width 120, Max heuristics); width violations 6869 -> 2862 prod, 1273 -> 717 test; files that grew are re-split. Reasons for the raised census numbers: fn_lines +119 and complexity +14 are functions that cross 30 lines / 10 branches only because rustfmt put their one-line bodies on several lines (nothing was added); test lists identical (1793), 800 tests pass, the same 5 known failures; bring-up print gate lookback 20 -> 30 lines for the same reason 2026-11-06 13:03:51 +01:00
Pavlo Ratushnyi a9d80333b4 STRA-338 size: large inline modules of 15 engine-crate files move to files (extract_modules.py now emits #[path] only for files that are themselves loaded through #[path]); test lists identical (1793). Ratchets raised with reason: path-include +3 cuda-driver, +4 engine, +7 model-format... are the child declarations of files that sit under a #[path]-loaded parent (their children cannot be found otherwise); the follow-up that removes them is turning those parents into directory modules 2026-11-06 12:53:35 +01:00
Pavlo Ratushnyi 7a752b6d92 STRA-338 size: mock_driver, preflight probe, conversation tests, qwen artifact fixtures, obs lib and backend_original_serve split into child modules (94 oversize files left) 2026-11-06 12:44:05 +01:00
Pavlo Ratushnyi adf65a53b9 STRA-338 size: 28 oversize test files of the engine crates split by topic with scripts/dev/split_tests.py (tests keep their names, gain a topic module; 1793 tests listed before and after, same leaf names; baseline tightened: 121 -> 98 oversize files) 2026-11-06 12:41:45 +01:00
Pavlo Ratushnyi b3c78c4d26 Merge commit '412d9a48a' into claude/hexagonal-smoke 2026-11-06 12:27:53 +01:00
Pavlo Ratushnyi 8934a1616a STRA-338 S22: smoke inventory follows the moved tests: helpers split into child modules stay visible, every smoke has a declared group, packages of engine-core, model-format and deploy are named, the table is regenerated
SmokeInventory failed three tests at a4ceeab69 and 8890db316.

test_gates_values_and_classes_on_known_tests (caused by the S12c/S17 splits, seen after S22): the
fixture helper of actual_expert215_native_resident_gu_and_same_source_down_diagnostic moved from
mmq_native_resident_gpu.rs into mmq_native_resident_gpu/digest_fn.rs, and only `read` there opens
files. The scanner looked for file-reading helpers in the test's own file and one call deep, so a
test that reads a private fixture was classified device instead of assets. The rule is now the
module tree (x.rs with x/*.rs, or x/y.rs with x.rs) and the helper search is transitive. The
test expectation is unchanged: the smoke needs LELEKA_REAL_GU_DIR and is an assets test. Checked
against the merge base with main: every name that exists in both has the same class, gates and
needs.

test_every_smoke_lands_in_a_declared_group_and_dependencies_precede (51 smokes, 45 of them
already ungrouped on main): smoke-groups.json declares them. Unlisted cuda-driver smokes go to
transport (src/tests.rs and device_slab/tests.rs, which were lib.rs inline tests before S17,
mapped_file_dma_stress_gpu, native_head), qsa (late selection, mapped journal), mtp (scalar short
path), dispatch (qwen_dispatch/ children after the split) and runtime-moe (expert tier
residency). New groups: prefill-stage (depends on gr, gdn), pcie-copy, serve-probes (depends on
seal-loads) and cpu-probes, kind cpu: benchmarks, scale simulations and timing probes of
native-cpu-expert, engine-core and engine-qwen35-cuda that need no GPU and stay out of the default
device run. LELEKA_PLE_PROBE_ARCHIVE, LELEKA_PLE_PROBE_ROWS and LELEKA_SYNTH_KAR are asset
variables now, so the smokes that read the 55 GB archive are no longer classed as device.
CRATE_PACKAGE names leleka-engine-core, leleka-model-format and leleka-deploy (the plan used the
directory name as package).

test_doc_table_is_current: docs/gpu-bringup.md regenerated with smoke_inventory.py --update-doc
under WSL; the section on group order mentions the new groups and the cpu kind.
2026-11-06 12:27:34 +01:00
Pavlo Ratushnyi 8890db316b STRA-338 S26: docs/architecture/hexagonal.md (layers, ports, how to add an engine family, gates, evidence rules, state after S22); tech-debt.md records S19 to S22 and corrects statements they made stale; AGENTS.md and README.md link the page 2026-11-06 11:57:26 +01:00
Pavlo Ratushnyi b27dbeaf88 STRA-338 S26: scripts and documented commands that ran tests of the moved engine now name leleka-engine-qwen35-cuda (leleka-runtime is a facade with no tests); test binaries are found as leleka_engine_qwen35_cuda-<hash>; smoke inventory groups follow the crate directory 2026-11-06 11:57:14 +01:00
Pavlo Ratushnyi ac50c32f31 STRA-338 S26: CI coverage list names the engine crates (leleka-engine-core, leleka-engine-fake, leleka-engine-qwen35-cuda) and leleka-gateway-domain; scripts/check-ci-coverage.py was red on the S22 tip 2026-11-06 11:43:58 +01:00
Pavlo Ratushnyi 412d9a48af STRA-338: merge the STRA-367 limits gate (claude/hexagonal-integ-lints) into the integration; check-local.sh keeps both the engine-crate package names and the limits steps 2026-11-06 11:39:49 +01:00
Pavlo Ratushnyi a4ceeab69c STRA-338 S22: the Qwen3.5 CUDA engine moves to the adapter crate leleka-engine-qwen35-cuda (L3, edges to cuda-driver, model-format, native-cpu-expert declared); leleka-runtime is a one-line facade over it; scripts, CI and the baseline follow the path. Test fixes found on the way: the digest pin test reads backend/config.rs, the bring-up print gate understands rustfmt-split cfg attributes and the settings snapshot guards 2026-11-06 11:34:15 +01:00
Pavlo Ratushnyi a8f1d11e64 STRA-338 S21: the CI coverage list and the product test step include leleka-gateway-domain 2026-11-06 11:29:46 +01:00
Pavlo Ratushnyi 48b2ce9f4c STRA-367: docs/architecture/limits-gate.md (rules, measures, allowlist, census, decision) and the legacy sites of tech-debt.md linked to allowlist entries 2026-11-06 11:26:53 +01:00
Pavlo Ratushnyi 054b57bec8 STRA-367: opt-in Clippy ratchet for too_many_lines, cognitive_complexity and too_many_arguments; limits gate in check-local --product
scripts/check-clippy-limits.sh (check-local.sh --clippy-limits) counts the three lints per crate
with thresholds 30 / 10 / 5 and fails when a total over all crates rises above
clippy-limits-baseline.json. The root clippy.toml carries only the two thresholds of allow-by-default
lints: too_many_arguments is on by default, and a root threshold of 5 fails the hard Clippy gates of
strata-control and strata-desktop-core. No source enables the lints and no rustfmt.toml is added.
check-local.sh --product runs the limits self-tests and the limits gate next to the architecture gate.
2026-11-06 11:26:53 +01:00
Pavlo Ratushnyi 334af80d3d STRA-367: limits gate for lawbook 301 (function 30 lines, complexity 10, nesting 4, width 120)
New and changed code is checked against the base (merge-base with the integration branch):
every added or touched function and every added or changed line must be within the limits,
unless limits-allowlist.json lists the function with a reason and an owner; an allowlisted
function may only shrink. The legacy that exists today is a per-crate census in
limits-baseline.json whose totals may only fall (same --update-baseline semantics as the
architecture gate). Rust is measured from the rustsplit lexer, the gate's own Python from ast.
56 self-tests, including a temporary git repository.
2026-11-06 11:26:53 +01:00
Pavlo Ratushnyi e049e24fe3 STRA-338 S20: EngineFamily seam in leleka-engine-core, Qwen35Cuda family in leleka-runtime, the scripted engine as leleka-engine-fake; the inference binary and the full-chain test start their engines through spawn::<F>. Ratchets raised by the Box<dyn Backend> signatures of the seam (core +2, fake +1, runtime +1) and 2 test lines: the Backend trait object is the process boundary the gRPC server already held 2026-11-06 11:20:57 +01:00
Pavlo Ratushnyi 58e3d864e1 STRA-338 S19e: admission, the stop set, ServeError<E> and the sequencing of one request (run_request over Lifecycle, generic, no trait object) move to leleka-engine-core::request; the runtime's owners reach it through a thin adapter 2026-11-06 11:12:25 +01:00
Pavlo Ratushnyi 8987e9ab06 STRA-338 S19d: the draft policy and the adaptive window policy move to leleka-engine-core::spec; LELEKA_SPEC_* parsing stays in the runtime (free function), SpecError converts to contract::Error 2026-11-06 11:05:47 +01:00
Pavlo Ratushnyi 93afb07bfb STRA-338 S19c: the conversation policy (cache, manager, snapshot, kv, state, model, binding) moves to leleka-engine-core::conversation; the 17 dyn-trait uses and 3 oversize test files move with it (runtime 68 -> 51, core 0 -> 17: a transfer, not growth); SessionDevice::available_memory becomes required, OriginalDevice reads the governor as before 2026-11-06 11:02:14 +01:00
Pavlo Ratushnyi d717c69777 STRA-338 S19b: the Original prompt plan moves to leleka-engine-core::prompt; the serving-context cell bound is a separate constructor the runtime calls 2026-11-06 10:57:41 +01:00
Pavlo Ratushnyi 38eb771a44 STRA-338 S19a: the cross-session prefix cache and the pure memory admission move to the new leleka-engine-core crate (L2); leleka-runtime re-exports them under the old paths 2026-11-06 10:54:33 +01:00
Pavlo Ratushnyi fc591f4e96 STRA-338: integrate the gateway G track (S21 protocol in gateway-domain, S6 rest, S7 serve phases) into the hexagonal integration 2026-11-06 01:46:01 +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
Pavlo Ratushnyi a0052cda6c STRA-338 S7: serve() is a list of phase functions (state, engine, http children), none over 30 lines
serve() was one function of about 240 lines. It is now the ordered list of start-up phases (load config and history, check
host, embedded engine, provision, bind, state, MCP, CORS warning, codec, vision, prompt switches, runtime worker, worker or
pool, idle unload, serve, stop) and the phases live in serve/state.rs, serve/engine.rs and serve/http.rs. The order of the
side effects is the old order; the state is still handed to the router by value (the engine channel closes when the server
stops); every string literal of the old file (log and error texts) is present unchanged. The 149-column log line is now
wrapped with a string continuation that produces the same text.
2026-11-06 01:12:37 +01:00
Pavlo Ratushnyi 5d2564f4ff STRA-338 S6: control-plane/src/responses.rs children named by responsibility (intake, create, route, history, resources, errors, tool_recovery, reasoning, render)
responses.rs is 97 lines (311 at the start of this step, after the domain move); the mechanical child names impl_* and
*_fn are gone. Function texts are moved without change; the fields and constants that sibling modules read became
pub(super). Public paths (responses::create, create_route, retrieve, delete, input_items, count_input_tokens,
ResponseHistory, HistoryResponseStore, TracedJson, PromptDate, set_prompt_date, set_tool_call_recovery and the domain
types) are unchanged. Functions that still miss the limits are listed in docs/architecture/tech-debt.md.

Linux test ids of strata-control, strata-desktop-core, leleka-gateway-text and leleka-gateway-domain: 0 changed,
0 missing against the tip before S21 wider (2 new: the golden test and its ignored regenerator).
2026-11-06 01:00:39 +01:00
Pavlo Ratushnyi 3aa96fbf0e STRA-338 S21: the pure Responses protocol moves from strata-control to leleka-gateway-domain
CreateRequest, TextOptions, TextFormat, its validation and tool-choice rules, OutputItem, Usage, ResponseTrace with its
event stream, the prompt rendering (render_request_with), the output parsing and reasoning split (parse_output_items_with,
decode_generation_noted), reasoning_effort and the schema checks now live in crates/gateway-domain/src/responses/.
strata-control re-exports the types under responses::* and keeps thin wrappers with the old signatures for the places that
need a process flag, a stage span or a log line. The text of the moved functions is unchanged; the edits are listed in
docs/architecture/tech-debt.md (S21 wider).

Evidence: the golden fixture committed just before this (control-plane/tests/fixtures/golden/responses_pure.json, recorded
from the old code, 96 cases of render, validate, trace and parse) passes on the new code, and the Linux test ids of
strata-control, strata-desktop-core, leleka-gateway-text and leleka-gateway-domain are unchanged (0 changed, 0 missing).

Gate: --update-baseline --allow-increase was used for two entries. process-global:leleka-gateway-domain 0 -> 3 is the
memo of tool_schema_accepted moving with its function (process-global:strata-control fell 14 -> 11, the sum is unchanged).
render.rs is a new moved file of 405 lines (one 385-line legacy function), listed as debt.
2026-11-06 00:50:30 +01:00
Pavlo Ratushnyi 02b5aedc23 STRA-338 S21: golden fixture of the pure Responses protocol (validation, prompt rendering, response trace, tool-call parsing), recorded from the code before it moves 2026-11-06 00:39:42 +01:00
Pavlo Ratushnyi 17296a58fd STRA-338: integrate engine S18 (WeightSource port, one migrated load phase) into the hexagonal integration 2026-11-06 00:30:15 +01:00
Pavlo Ratushnyi 6164880902 STRA-338 S18: numbers of the S18 check in tech-debt.md 2026-11-06 00:29:44 +01:00
Pavlo Ratushnyi e0b4757683 STRA-338 S18: KarInspection and the sealed archive as WeightSource, WeightRange for the KAR stager, S18 notes in tech-debt.md 2026-11-06 00:29:31 +01:00
Pavlo Ratushnyi f8f6d780e2 STRA-338 S18: WeightSource port in leleka-model-format (borrowed regions, identity, digest), file, GGUF shard and resident-tensor adapters, in-memory double; the ranked profile is read through it 2026-11-06 00:15:11 +01:00