Files
leleka/architecture.json
T
Pavlo Ratushnyi 40896ba217 STRA-338 S24: peel the pure host-side models out of cuda-driver into leleka-cuda-model
New L1 crate crates/cuda-model (leleka-cuda-model, forbid(unsafe_code), depends on leleka-context only) holds:
Error/Result with Display, DenseFormat, RoutedFormat, ProjectionKind (+ layout/alignment/required_modes), ProjectionSpec,
the Bf16/Q5K/Q6K projection shapes, bringup_trace_enabled, and the modules serving_context, host_profile, command_profile,
original_mtp_loader, original_prefill_schedule, qsa_prompt_attention_select, original_expert_slots, native_flash_attn,
s_gemv_legacy, device_arena, mmq_original_prefill_misc (moved with git mv; code unchanged apart from pub visibility and
#[inline] on the tiny cached-switch readers, host_profile::add split into an inlined gate and a cold body).

leleka-cuda-driver re-exports every item at its old path, so no use path in the driver, engine-qwen35-cuda or
native-parity-bench changes. Tests moved with their modules; they read the .cu sources and oracle fixtures of the driver
through driver_source!; the one loader test that needs the driver's session geometry stays in the driver.

Housekeeping: workspace members/default-members, Cargo.lock, architecture.json (L1), hexagonal.md, ci-coverage.json,
check-local.sh, port.yml, linux-tests/run.sh, AGENTS.md. architecture-baseline.json: the source ratchets of the moved code
change crate key (dyn-trait driver 56 to 49 + model 3, env-read 72 to 67 + 5, process-global 110 to 99 + 11), regenerated
with --allow-increase for the new keys only; per-pattern totals do not rise. limits-baseline.json is unchanged: no moved
function is over a limit.
2026-11-07 17:40:24 +01:00

54 lines
3.4 KiB
JSON

{
"_comment": "Policy read by scripts/check-architecture.py (STRA-338 ADR). Layers are ordered low to high; a normal dependency must point to the same or a lower layer. L2 (core) holds the extracted domain crates: leleka-gateway-domain (S21); the engine domain crates follow (S19). Every workspace package appears in exactly one layer.",
"max_lines": 400,
"adapter_layer": "L3",
"pure_layers": ["L0", "L1", "L2"],
"forbidden_in_pure": ["tokio", "axum", "tonic", "tonic-prost", "reqwest", "hyper", "libc", "rustix", "windows-sys", "sysinfo", "wgpu"],
"layers": {
"L0": ["leleka-backend-api", "leleka-worker-protocol"],
"L1": [
"leleka-obs", "leleka-context", "leleka-sampler-ref", "leleka-quant-core", "leleka-serving-policy", "leleka-harmony",
"leleka-tokenizer", "leleka-gguf", "leleka-kar-codec", "leleka-experimental-ref", "leleka-cpu-sys", "leleka-cpu-kernels",
"leleka-shm", "leleka-openvino", "leleka-memory", "leleka-gateway-text", "leleka-cuda-model"
],
"L2": ["leleka-gateway-domain", "leleka-engine-core"],
"L3": [
"leleka-libc-shim", "leleka-model-format", "leleka-cuda-driver", "leleka-native-cpu-expert", "leleka-gptoss", "leleka-igpu",
"leleka-gptoss-igpu", "leleka-gptoss-npu", "leleka-npu-service", "leleka-cpu-worker", "leleka-igpu-worker", "leleka-npu-worker",
"leleka-gpu-npu-worker", "leleka-offline-tools", "leleka-runtime-client",
"leleka-engine-fake",
"leleka-engine-qwen35-cuda"
],
"L4": ["leleka-runtime", "strata-desktop-core", "strata-control", "leleka-deploy", "leleka-native-parity-bench"]
},
"adapter_edges": [
["leleka-cuda-driver", "leleka-libc-shim"],
["leleka-cuda-driver", "leleka-model-format"],
["leleka-model-format", "leleka-libc-shim"],
["leleka-native-cpu-expert", "leleka-libc-shim"],
["leleka-cpu-worker", "leleka-gptoss"],
["leleka-gptoss-igpu", "leleka-gptoss"],
["leleka-gptoss-igpu", "leleka-igpu"],
["leleka-gptoss-npu", "leleka-gptoss"],
["leleka-igpu-worker", "leleka-cpu-worker"],
["leleka-igpu-worker", "leleka-gptoss-igpu"],
["leleka-npu-worker", "leleka-cpu-worker"],
["leleka-npu-worker", "leleka-gptoss-npu"],
["leleka-gpu-npu-worker", "leleka-cpu-worker"],
["leleka-gpu-npu-worker", "leleka-gptoss"],
["leleka-gpu-npu-worker", "leleka-gptoss-igpu"],
["leleka-gpu-npu-worker", "leleka-gptoss-npu"],
["leleka-offline-tools", "leleka-model-format"],
["leleka-engine-qwen35-cuda", "leleka-cuda-driver"],
["leleka-engine-qwen35-cuda", "leleka-model-format"],
["leleka-engine-qwen35-cuda", "leleka-native-cpu-expert"]
],
"source_patterns": [
{"id": "env-read", "regex": "\\benv::var(_os)?\\(", "why": "configuration must be parsed once into a Settings struct (S13), not read all over the code"},
{"id": "instant-now", "regex": "\\bInstant::now\\(\\)", "why": "time must come from an injected Clock in core logic (S14)"},
{"id": "path-include", "regex": "#\\[path\\s*=\\s*\"(?![^\"]*tests\\.rs\")(?![A-Za-z0-9_]+/[A-Za-z0-9_]+\\.rs\")", "why": "a file compiled into two crates must be one crate (S8); a tests.rs or a child module file of the form dir/name.rs is not an include"},
{"id": "process-global", "regex": "\\b(OnceLock|LazyLock|OnceCell)\\b|\\bstatic\\s+mut\\b|Governor::global\\(|serving_cells\\(\\)", "why": "process globals make core logic untestable without a GPU (S14)"},
{"id": "dyn-trait", "regex": "\\bdyn\\s+[A-Z]", "why": "no dynamic dispatch per round or token; dyn is for startup composition only"}
]
}