The request middleware, the backend worker and the metrics handler now share one RequestMetrics value that Services holds, so the LazyLock registry of request_log.rs and its architecture.json exception are gone. The middleware gets it through Observe, the worker through BackendWorkerConfig, and prometheus::render takes it as an argument; the counters, histograms, labels and log lines are unchanged, and the unit tests now count into a registry of their own instead of one shared by the whole test process.
240 lines
48 KiB
JSON
240 lines
48 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-memory-os", "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", "leleka-engine-host", "leleka-control-plane", "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"],
|
|
["leleka-engine-qwen35-cuda", "leleka-memory-os"]
|
|
],
|
|
"mechanical_names": {
|
|
"why": "a module name must say what it is and what it is for; names left by mechanical splits (impl_*, *_fn, numbered) make the source hard to read",
|
|
"patterns": ["^impl_.*\\.rs$", "_fn\\.rs$", "_[0-9]+(_[0-9]+)*\\.rs$"],
|
|
"allow": ["^(quantize_)?q[0-9]_[0-9k]\\.rs$"]
|
|
},
|
|
"_exceptions": "Sites that must stay, so the ratchet is zero outside this list (STRA-338 stage 10). Each entry: crate, file (relative to the crate directory), ratchet (a source_patterns id), reason. The file's hits of that ratchet are not counted; an entry that excuses nothing is an error.",
|
|
"exceptions": [
|
|
{"crate": "leleka-cuda-model", "file": "src/env_switch.rs", "ratchet": "env-read", "reason": "EnvSwitch is the one reader of the operator environment in this crate: it reads one named variable on the first get() and applies a typed rule"},
|
|
{"crate": "leleka-cuda-model", "file": "src/env_switch.rs", "ratchet": "process-global", "reason": "kept: operator environment switch. The OnceLock is the cell of each `static EnvSwitch` that is declared where the switch is read; the variable cannot change after process start, so the first-read value equals a fresh read, and the crate sits below the engine Settings owner, so a settings value cannot be handed down to it (dependency direction)"},
|
|
{"crate": "leleka-cpu-worker", "file": "src/settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: it returns the operator's switches as typed values"},
|
|
{"crate": "leleka-tokenizer", "file": "src/settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: it returns the operator's switches as typed values"},
|
|
{"crate": "leleka-gptoss-npu", "file": "src/settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: it returns the operator's switches as typed values"},
|
|
{"crate": "leleka-gpu-npu-worker", "file": "src/settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: it returns the operator's switches as typed values"},
|
|
{"crate": "leleka-igpu", "file": "src/settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: it returns the operator's switches as typed values"},
|
|
{"crate": "leleka-memory", "file": "src/settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: it returns the operator's switches as typed values"},
|
|
{"crate": "leleka-gptoss", "file": "src/settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: it returns the operator's switches as typed values"},
|
|
{"crate": "leleka-model-format", "file": "src/settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: it returns the operator's switches as typed values"},
|
|
{"crate": "leleka-obs", "file": "src/level.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: LELEKA_LOG* parsed once into Settings, and the request-log path"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: its catalogue holds the operator settings as named cells (EnvSwitch, EnvSetting, LazySetting from leleka_cuda_model::env_switch, MarkerFiles) read on first use; the option parsers that take several variables (stager, stream-all, chain flags, sm120 switches) call the pass-through var/var_os from their own parse functions"},
|
|
{"crate": "leleka-native-cpu-expert", "file": "src/settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate (CPU expert pool, a hot path): the Setting catalogue parses the A/B switches and the kernel dispatch once; the pool and report readers still call the pass-through var/var_os with their own parsing"},
|
|
{"crate": "leleka-cpu-kernels", "file": "src/dispatch.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: ISA_ENV is parsed by Isa::from_request into the selected instruction set"},
|
|
{"crate": "leleka-libc-shim", "file": "src/cuda_trace/trace_state.rs", "ratchet": "env-read", "reason": "Windows interposer (FFI): the CUDA call tracer reads its own LELEKA_BRINGUP_TRACE switches and must not depend on other crates"},
|
|
{"crate": "leleka-libc-shim", "file": "src/lib.rs", "ratchet": "env-read", "reason": "Windows interposer (FFI): the DLL search directories come from the process environment before any other crate can load"},
|
|
{"crate": "leleka-memory-os", "file": "src/heap.rs", "ratchet": "env-read", "reason": "platform adapter (glibc heap): reads its own LELEKA_MEMORY_NO_TRIM switch once"},
|
|
{"crate": "leleka-native-parity-bench", "file": "src/lib.rs", "ratchet": "env-read", "reason": "benchmark host (L4): reads the operator's STRATA_IQ_MT_MIN override to report which value it measured"},
|
|
{"crate": "leleka-npu-worker", "file": "src/main.rs", "ratchet": "env-read", "reason": "worker binary (composition root): reads LELEKA_OPENVINO_ROOT into its configuration"},
|
|
{"crate": "leleka-memory", "file": "src/settings.rs", "ratchet": "process-global", "reason": "kept: the LELEKA_NO_TRIM_FILE path is ambient process environment, immutable after start (a cached read equals a fresh one); this crate is below the engine Settings owner and MemoryServices carries the governor, not the environment, so no settings value reaches the reader"},
|
|
{"crate": "leleka-memory", "file": "src/governor.rs", "ratchet": "dyn-trait", "reason": "port boundary: the Governor holds its MemoryPressure adapter as Arc<dyn MemoryPressure>, chosen at start-up (hexagonal.md, ports table)"},
|
|
{"crate": "leleka-memory", "file": "src/governor/operations/setup.rs", "ratchet": "dyn-trait", "reason": "port boundary: Governor::new takes the host as Arc<dyn ProcSource + Send + Sync> (the adapter is chosen by the composition root) and source() hands it back"},
|
|
{"crate": "leleka-memory", "file": "src/lock/page_locking.rs", "ratchet": "dyn-trait", "reason": "port boundary: SharedPageLocking = Arc<dyn PageLocking>, the OS adapter of mmap/mlock chosen by the composition root"},
|
|
{"crate": "leleka-memory", "file": "src/telemetry.rs", "ratchet": "dyn-trait", "reason": "port boundary: the GPU probe is a closure chosen at start-up (nvidia-smi or NVML) and owned by the sampler thread"},
|
|
{"crate": "leleka-memory", "file": "src/smi.rs", "ratchet": "dyn-trait", "reason": "port boundary: the nvidia-smi probe closure handed to the telemetry sampler (see telemetry.rs)"},
|
|
{"crate": "leleka-cpu-worker", "file": "src/engine.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: load and prefill wall-time measurement, reported in the worker's timing line"},
|
|
{"crate": "leleka-cpu-worker", "file": "src/serve.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: per-request wall-time measurement (prefill and decode), reported in the worker's timing line"},
|
|
{"crate": "leleka-cpu-worker", "file": "src/serve/decode_loop.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: per-token lap timers of the decode loop; one reading per lap, summed into the timing line"},
|
|
{"crate": "leleka-gptoss", "file": "src/forward_pass.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: per-pass lap timer inside the forward pass; one reading per lap, summed into the timing report"},
|
|
{"crate": "leleka-gptoss", "file": "src/generation.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: generation wall-time measurement for the timing report"},
|
|
{"crate": "leleka-gptoss-igpu", "file": "src/prefill_pass.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: wall-time measurement of one prefill pass, reported with the pass"},
|
|
{"crate": "leleka-gptoss-igpu", "file": "src/prefill_run.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: stage lap timers of the iGPU prefill, reported in the timing line"},
|
|
{"crate": "leleka-gptoss-npu", "file": "src/expert_pass.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: stage lap timers of the NPU expert pass, reported in the timing line"},
|
|
{"crate": "leleka-gptoss-npu", "file": "src/prefill_batch.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: stage lap timers of the NPU prefill batch, reported in the timing line"},
|
|
{"crate": "leleka-gptoss-npu", "file": "src/prefill_part_pass.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: wall-time measurement of one NPU prefill part, reported with the pass"},
|
|
{"crate": "leleka-gptoss-npu", "file": "src/service_transfers.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: transfer wall-time measurement toward the NPU service"},
|
|
{"crate": "leleka-gpu-npu-worker", "file": "src/lib.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: wall-time measurement of the split prefill passes, reported in the timing line"},
|
|
{"crate": "leleka-gpu-npu-worker", "file": "src/split_run.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: lap timers of the GPU and NPU legs of the split prefill"},
|
|
{"crate": "leleka-igpu", "file": "src/matrix_uploads.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: wall-time measurement of the weight upload, reported at load"},
|
|
{"crate": "leleka-npu-service", "file": "src/engine/execution.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: lap timers of one NPU execution, summed into the profile report"},
|
|
{"crate": "leleka-model-format", "file": "src/bulk_read/for_each_chunk.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: wall-time measurement of the bulk read, reported in the load report"},
|
|
{"crate": "leleka-model-format", "file": "src/huge_pages.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: wall-time measurement of the huge-page allocation probe, reported in the load report"},
|
|
{"crate": "leleka-model-format", "file": "src/kar/independent_handles.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: wall-time measurement of opening the independent file handles"},
|
|
{"crate": "leleka-model-format", "file": "src/pinned_arena_plan/expert_parallel_load.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: read and copy lap timers of the expert load, reported in the load report"},
|
|
{"crate": "leleka-model-format", "file": "src/ple_reader/read_queue.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: readings of the per-row read queue's latency window, inside the reader loop"},
|
|
{"crate": "leleka-model-format", "file": "src/ple_reader/row_reading.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: latency measurement of one PLE row read, inside the reader loop"},
|
|
{"crate": "leleka-obs", "file": "src/time/clock.rs", "ratchet": "instant-now", "reason": "the clock adapter itself: SystemClock, AnyClock and ManualClock are the one place that reads the monotonic clock"},
|
|
{"crate": "leleka-memory-os", "file": "src/heap.rs", "ratchet": "process-global", "reason": "kept: platform adapter over the glibc heap, which is itself process-wide; the LELEKA_MEMORY_NO_TRIM switch is ambient immutable environment read once, and the adapter is below the Settings owner"},
|
|
{"crate": "leleka-libc-shim", "file": "src/cuda_trace/trace_state.rs", "ratchet": "process-global", "reason": "kept: FFI interposer boundary. The CUDA call tracer is state behind C-ABI hooks that the dynamic loader calls with no context pointer and no way to carry an argument; the process is the only scope that exists there"},
|
|
{"crate": "leleka-obs", "file": "src/lib.rs", "ratchet": "process-global", "reason": "kept: the logger facade, like the `log` crate, is process-wide by contract: elog! and request logging are called from every crate without a handle; its Settings, rate limiter and request sink are built once from the environment"},
|
|
{"crate": "leleka-obs", "file": "src/write_stderr.rs", "ratchet": "process-global", "reason": "kept: the request-log sink of the process-wide logger facade of lib.rs (same reason: written by every thread, no handle at the call sites)"},
|
|
{"crate": "leleka-tokenizer", "file": "src/lib.rs", "ratchet": "process-global", "reason": "kept: immutable constant tables (the pre-tokenizer regex and the character classes) compiled on first use; a pure function of constants, a memo no caller can observe"},
|
|
{"crate": "leleka-gptoss-npu", "file": "src/half.rs", "ratchet": "process-global", "reason": "kept: immutable constant table (half-to-float conversion), a pure function of constants built once; no caller can observe the memo"},
|
|
{"crate": "leleka-cuda-model", "file": "src/original_prefill_schedule.rs", "ratchet": "dyn-trait", "reason": "parameter struct SourceView borrows three residency queries (resident, pinned, transient) from the caller's tables; a generic parameter per closure would make the type unnameable in the callers' signatures"},
|
|
{"crate": "leleka-experimental-ref", "file": "src/remote_experts.rs", "ratchet": "dyn-trait", "reason": "parameter struct Candidates borrows the primary's residency test from the caller's table; generic parameters would leak into every caller's signature"},
|
|
{"crate": "leleka-cpu-worker", "file": "src/engine.rs", "ratchet": "dyn-trait", "reason": "port boundary: the engine holds the prefill accelerator (iGPU, NPU or split) as Box<dyn PrefillAccelerator + Send>, chosen by the worker binary"},
|
|
{"crate": "leleka-cpu-worker", "file": "src/serve.rs", "ratchet": "dyn-trait", "reason": "dyn-compatible worker trait: the progress callback of a trait method must be a trait object"},
|
|
{"crate": "leleka-gptoss", "file": "src/decode_state.rs", "ratchet": "dyn-trait", "reason": "port boundary: PrefillAccelerator and LayerCache are the accelerator seams, chosen by the worker binary; their methods take the progress callback as a trait object"},
|
|
{"crate": "leleka-gptoss", "file": "src/model.rs", "ratchet": "dyn-trait", "reason": "port boundary: the model's weights read through Arc<dyn ModelBytes> (file, memory map or test bytes), chosen when the model is loaded"},
|
|
{"crate": "leleka-gptoss", "file": "src/tensor_loading.rs", "ratchet": "dyn-trait", "reason": "port boundary: the model's weights read through Arc<dyn ModelBytes> (file, memory map or test bytes), chosen when the model is loaded"},
|
|
{"crate": "leleka-gptoss", "file": "src/weights.rs", "ratchet": "dyn-trait", "reason": "port boundary: the model's weights read through Arc<dyn ModelBytes> (file, memory map or test bytes), chosen when the model is loaded"},
|
|
{"crate": "leleka-gptoss", "file": "src/pool.rs", "ratchet": "dyn-trait", "reason": "the worker pool runs heterogeneous closures: Box<dyn FnOnce + Send> is the type-erased job of its queue"},
|
|
{"crate": "leleka-gptoss-igpu", "file": "src/lib.rs", "ratchet": "dyn-trait", "reason": "port boundary: the memory probe closure and the PrefillAccelerator impl (trait objects by the trait's own signature)"},
|
|
{"crate": "leleka-gptoss-npu", "file": "src/lib.rs", "ratchet": "dyn-trait", "reason": "port boundary: the memory probe closure chosen by the worker binary"},
|
|
{"crate": "leleka-gptoss-npu", "file": "src/accelerator.rs", "ratchet": "dyn-trait", "reason": "PrefillAccelerator impl: the progress callback is a trait object by the trait's own signature"},
|
|
{"crate": "leleka-gpu-npu-worker", "file": "src/lib.rs", "ratchet": "dyn-trait", "reason": "port boundary: the memory probe closure, the LayerCache seam and the PrefillAccelerator impl (trait objects by the traits' own signatures)"},
|
|
{"crate": "leleka-tokenizer", "file": "src/lib.rs", "ratchet": "dyn-trait", "reason": "Result<T, Box<dyn Error>> of the public tokenizer API: the error is the std error object at the library boundary"},
|
|
{"crate": "leleka-model-format", "file": "src/gguf.rs", "ratchet": "dyn-trait", "reason": "Result<T, Box<dyn Error>> of the GGUF reader's public API: the std error object at the library boundary"},
|
|
{"crate": "leleka-model-format", "file": "src/qwen4exp.rs", "ratchet": "dyn-trait", "reason": "the artifact error wraps any std error (Box<dyn Error>) from the byte sources it reads through"},
|
|
{"crate": "leleka-model-format", "file": "src/qwen4exp/binding_topology.rs", "ratchet": "dyn-trait", "reason": "std::error::Error::source() returns &(dyn Error + 'static) by the trait's own signature"},
|
|
{"crate": "leleka-model-format", "file": "src/ple_reader.rs", "ratchet": "dyn-trait", "reason": "port boundary: the PLE reader holds its PageSource (file, direct-IO file or test double) as Arc<dyn PageSource>"},
|
|
{"crate": "leleka-model-format", "file": "src/ple_reader/row_reading.rs", "ratchet": "dyn-trait", "reason": "port boundary: PleReader::open takes the PageSource as Arc<dyn PageSource>"},
|
|
{"crate": "leleka-model-format", "file": "src/huge_pages.rs", "ratchet": "process-global", "reason": "kept: ambient environment. The huge-page mode (LELEKA_HUGEPAGES) is immutable after start so the cache equals a fresh read; model-format is below the engine Settings owner (dependency direction), so no settings value reaches the mapping helpers"},
|
|
{"crate": "leleka-model-format", "file": "src/kar/independent_handles.rs", "ratchet": "process-global", "reason": "kept: ambient environment. The identity-recheck switch is immutable after start so the cache equals a fresh read; model-format is below the engine Settings owner (dependency direction)"},
|
|
{"crate": "leleka-model-format", "file": "src/kar.rs", "ratchet": "process-global", "reason": "not a process global: a per-instance lazily opened set of file handles (a OnceLock field of the archive); the gate pattern matches the type name"},
|
|
{"crate": "leleka-model-format", "file": "src/kar/verified_kar_ple_artifact.rs", "ratchet": "process-global", "reason": "not a process global: constructs the per-instance lazy handle cell of kar.rs; the gate pattern matches the type name"},
|
|
{"crate": "leleka-control-plane", "file": "src/env_settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment of the crate: every variable is parsed here into a typed value (number, path, flag, mode)"},
|
|
{"crate": "leleka-deploy", "file": "src/env_settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment of the crate: every variable is parsed here into a typed value (path, flag, text)"},
|
|
{"crate": "leleka-engine-host", "file": "src/env_settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment of the crate and its binaries: credentials by name, the evaluation switches, the inherited child variables"},
|
|
{"crate": "leleka-gateway-text", "file": "src/prompt/env_settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment of the crate: the two prompt rendering switches"},
|
|
{"crate": "leleka-npu-service", "file": "src/env_settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment of the crate: the profile report switch"},
|
|
{"crate": "leleka-control-plane", "file": "src/adapters/system_clock.rs", "ratchet": "instant-now", "reason": "the production Clock adapter: the one place that reads the runtime clock for the injected Clock port"},
|
|
{"crate": "leleka-control-plane", "file": "src/ports/fakes/clock.rs", "ratchet": "instant-now", "reason": "test fixture: the manual clock needs one base instant to count from and never moves by itself"},
|
|
{"crate": "leleka-engine-host", "file": "src/clock.rs", "ratchet": "instant-now", "reason": "the runtime-clock adapter of the Clock port of the crate"},
|
|
{"crate": "leleka-engine-host", "file": "src/node_connection.rs", "ratchet": "instant-now", "reason": "freshness stamp and retry back-off of the node subscription: the monotonic time of network events, compared with elapsed(); the tests use real short timings"},
|
|
{"crate": "leleka-npu-service", "file": "src/engine/execution.rs", "ratchet": "instant-now", "reason": "profile laps around each product on the NPU execution loop (LELEKA_NPU_PROFILE report); a clock call per lap would be the only change on that path"},
|
|
{"crate": "leleka-backend-api", "file": "src/scripted/play.rs", "ratchet": "instant-now", "reason": "the scripted test engine paces a fake generation in real time; the L0 contract crate has no dependency to take a clock from"},
|
|
{"crate": "leleka-control-plane", "file": "src/ports/clock.rs", "ratchet": "dyn-trait", "reason": "port boundary: SharedClock is the Arc<dyn Clock> the composition root hands to AppState"},
|
|
{"crate": "leleka-control-plane", "file": "src/ports/engine.rs", "ratchet": "dyn-trait", "reason": "port boundary: SharedEngine is the Arc<dyn EngineClient> the composition root hands to AppState"},
|
|
{"crate": "leleka-control-plane", "file": "src/ports/response_store.rs", "ratchet": "dyn-trait", "reason": "port boundary: SharedResponseStore is the Arc<dyn ResponseStore> the composition root hands to AppState"},
|
|
{"crate": "leleka-control-plane", "file": "src/ports/tool_hub.rs", "ratchet": "dyn-trait", "reason": "port boundary: SharedToolHub is the Arc<dyn ToolHub> the composition root hands to AppState"},
|
|
{"crate": "leleka-control-plane", "file": "src/ports/vision.rs", "ratchet": "dyn-trait", "reason": "port boundary: SharedVisionEncoder is the Arc<dyn VisionEncoder> the composition root hands to AppState"},
|
|
{"crate": "leleka-control-plane", "file": "src/app/state.rs", "ratchet": "dyn-trait", "reason": "the tokenizer family (Qwen or gpt-oss) is chosen at start-up and held as Arc<dyn TextCodec>, once per request"},
|
|
{"crate": "leleka-control-plane", "file": "src/responses.rs", "ratchet": "dyn-trait", "reason": "SharedCodec, the alias of Arc<dyn TextCodec> that the response stages share"},
|
|
{"crate": "leleka-control-plane", "file": "src/model/manifest_fetch.rs", "ratchet": "dyn-trait", "reason": "walks an error's source() chain, whose items are dyn Error"},
|
|
{"crate": "leleka-control-plane", "file": "src/wire.rs", "ratchet": "dyn-trait", "reason": "the per-request token-bytes closure of a reasoning plan, built once per request from the tokenizer"},
|
|
{"crate": "leleka-engine-host", "file": "src/node.rs", "ratchet": "dyn-trait", "reason": "tonic server-streaming response type: the generated trait wants a boxed stream"},
|
|
{"crate": "leleka-engine-host", "file": "src/runtime_rpc.rs", "ratchet": "dyn-trait", "reason": "tonic server-streaming response type: the generated trait wants a boxed stream"},
|
|
{"crate": "leleka-backend-api", "file": "src/scripted.rs", "ratchet": "dyn-trait", "reason": "the scripted test engine stores the test's responder closure"},
|
|
{"crate": "leleka-gateway-domain", "file": "src/responses/schema.rs", "ratchet": "process-global", "reason": "kept: pure memo (not state): the validity of a tool schema keyed by its compact text, so the dozen schemas of a coding agent compile once, not three times per request; the result depends on the key alone, so no caller can observe the cache; a per-request owner would defeat it"},
|
|
{"crate": "leleka-gateway-text", "file": "src/prompt/renderer.rs", "ratchet": "process-global", "reason": "kept: the compiled pinned chat template is an immutable constant of the build, compiled on first use and read by every request; a pure memo of a constant"},
|
|
{"crate": "leleka-control-plane", "file": "src/stage_trace.rs", "ratchet": "process-global", "reason": "kept: diagnostic stage table of the replay harness and STRATA_STAGE_TRACE; time() and span() are called from deep helpers (render, tokenize) that carry no state argument, and the output is diagnostic only, never read by serving logic"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/settings/source.rs", "ratchet": "env-read", "reason": "the one reader of the process environment of the engine: ProcessEnv is the adapter of the EnvSource port, and Settings parses every variable into typed fields there (S13)"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/original_serve_engine/round_tally/serve_rounds.rs", "ratchet": "instant-now", "reason": "measurement timer in a hot loop (one reading per traced port call, only when the bring-up trace is on); a Clock parameter would add a generic to every owner on the path, which is the S14 follow-up; the reading is a Duration that only feeds a log line or a counter"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/original_serve_lookahead.rs", "ratchet": "instant-now", "reason": "measurement timer in a hot loop (one reading per routing prediction on the lookahead thread); a Clock parameter would add a generic to every owner on the path, which is the S14 follow-up; the reading is a Duration that only feeds a log line or a counter"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/original_serve_pool/direct_group_steps.rs", "ratchet": "instant-now", "reason": "measurement timer in a hot loop (one reading per CPU expert group of a decode round); a Clock parameter would add a generic to every owner on the path, which is the S14 follow-up; the reading is a Duration that only feeds a log line or a counter"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/original_serve_pool/direct_tier.rs", "ratchet": "instant-now", "reason": "measurement timer in a hot loop (one reading per eager admission, once at start-up); a Clock parameter would add a generic to every owner on the path, which is the S14 follow-up; the reading is a Duration that only feeds a log line or a counter"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/original_serve_pool.rs", "ratchet": "instant-now", "reason": "measurement timer in a hot loop (one reading per pool phase lap of a decode round); a Clock parameter would add a generic to every owner on the path, which is the S14 follow-up; the reading is a Duration that only feeds a log line or a counter"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/original_serve_residency/pcie_share_controllers.rs", "ratchet": "instant-now", "reason": "measurement timer in a hot loop (one reading per PCIe lag probe and adaptation round); a Clock parameter would add a generic to every owner on the path, which is the S14 follow-up; the reading is a Duration that only feeds a log line or a counter"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/prefill_profile.rs", "ratchet": "instant-now", "reason": "measurement timer in a hot loop (one reading per prefill stage span, only when the profile switch is on); a Clock parameter would add a generic to every owner on the path, which is the S14 follow-up; the reading is a Duration that only feeds a log line or a counter"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/prompt_device_rows/prompt_device_read/produce_original_gdn.rs", "ratchet": "instant-now", "reason": "measurement timer in a hot loop (one reading per GDN layer producer lap, only when the command profile is on); a Clock parameter would add a generic to every owner on the path, which is the S14 follow-up; the reading is a Duration that only feeds a log line or a counter"},
|
|
{"crate": "leleka-engine-core", "file": "src/family.rs", "ratchet": "dyn-trait", "reason": "EngineFamily::spawn returns Box<dyn Backend>: the family seam is the process boundary of the engine, called once at start-up"},
|
|
{"crate": "leleka-engine-fake", "file": "src/lib.rs", "ratchet": "dyn-trait", "reason": "Box<dyn Backend> is the process boundary: the factory hands the composed engine to the host, which holds one Backend per process (startup composition only, never per round)"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/backend/family.rs", "ratchet": "dyn-trait", "reason": "Box<dyn Backend> is the process boundary: the factory hands the composed engine to the host, which holds one Backend per process (startup composition only, never per round)"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/backend/spawn.rs", "ratchet": "dyn-trait", "reason": "Box<dyn Backend> is the process boundary: the factory hands the composed engine to the host, which holds one Backend per process (startup composition only, never per round)"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/backend/spawn_optimized.rs", "ratchet": "dyn-trait", "reason": "Box<dyn Backend> is the process boundary: the factory hands the composed engine to the host, which holds one Backend per process (startup composition only, never per round)"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/backend/spawn_original.rs", "ratchet": "dyn-trait", "reason": "Box<dyn Backend> is the process boundary: the factory hands the composed engine to the host, which holds one Backend per process (startup composition only, never per round)"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/backend/spawn_preview.rs", "ratchet": "dyn-trait", "reason": "Box<dyn Backend> is the process boundary: the factory hands the composed engine to the host, which holds one Backend per process (startup composition only, never per round)"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/backend/measurement.rs", "ratchet": "dyn-trait", "reason": "the evaluation measurement sink is a stored callback handed in by the host (observer port, called once per request)"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/backend/original_serve/runner.rs", "ratchet": "dyn-trait", "reason": "the GPU telemetry probe is a stored callback handed in by the host at load (port, sampled by the telemetry tick, not per token)"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/model_binding/weight_binding.rs", "ratchet": "process-global", "reason": "not a process global: `std::cell::OnceCell` is an instance field of the binding (lazy PLE reader); the gate pattern matches the type name"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/model_binding/weight_binding/model_binding.rs", "ratchet": "process-global", "reason": "not a process global: `std::cell::OnceCell::new()` initialises the instance field `ple_reader` of one ModelBinding; the gate pattern matches the type name"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/original_serve_residency/split_group_pcie.rs", "ratchet": "process-global", "reason": "kept for now: the adaptive-tier tuning tuple is derived once from the process settings capture and emits the invalid-LELEKA_ADAPT_DECAY line once; it is read from three files (cross_layer_potential, source_spans, this one), so passing it needs a field on the residency state; not moved in this change (STRA-338 follow-up)"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/original_serve_stack.rs", "ratchet": "process-global", "reason": "kept: DBG_T0, the epoch of the bring-up trace timestamps (dbg_el()); diagnostics only, called from trace macros in many files that hold no common owner, never read by serving logic"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/session.rs", "ratchet": "process-global", "reason": "not a process global: `std::cell::OnceCell` is an instance field of the session; the gate pattern matches the type name"},
|
|
{"crate": "leleka-engine-qwen35-cuda", "file": "src/qwen_forward/session/qwen_session.rs", "ratchet": "process-global", "reason": "not a process global: `std::cell::OnceCell::new()` initialises an instance field of one session; the gate pattern matches the type name"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/compute_drain.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: stall span of one timed drain, reported by the prefill stall trace"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/mmq/resident/original_group/copy_ring/chunk_stream/chunk_issuing.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: span of one chunk issue, summed into the copy-ring profile"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/mmq/resident/original_group/copy_ring/original_mmq_copy_schedule/stream_start.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: start of the copy-ring stream, read once per stream for the profile"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/native_prompt_device/original_prompt_device/run_phases.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: span of one prompt phase, reported by the prefill profile"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_file_expert_source/original_file_expert_source_operations/file_expert_source_prefetch.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: span of one expert-file prefetch, summed into the stager profile"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_file_expert_source/original_file_expert_source_operations/file_expert_source_blobs.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: spans of the expert-file stages, summed into the stager profile"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_gpu_schedule/original_gpu_graph.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: span of one graph launch, reported by the graph profile"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_gpu_schedule/original_gpu_stream.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: span of one stream synchronisation, reported by the stream profile"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/diag.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: wait loop of the live-verifier release diagnostic, bounded by its own timeout"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/schedule/verifier_commit_window_lifecycle.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: span of one commit window, reported by the verifier profile"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/schedule/verifier_logits_diagnostics_close.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: span of one logits readout, reported by the verifier profile"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/schedule/window_phases.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: spans of the window phases, reported by the verifier profile"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/share_window_modules/physical.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: span of the physical bank open, reported by the verifier profile"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/qsa_prompt_index/prompt_device/resident_device/original_qsa_prompt_device.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: timestamp of the last prompt-device use, read by the idle-trim policy of the device"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/qsa_prompt_index/resident_program/qsa_prompt_index_workspace.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: span of one resident index program run, reported by the prefill profile"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/qsa_prompt_kv/mapped_journal/original_qsa_mapped_prefix/qsa_mapped_journal_arena.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: spans of the mapped-journal append and resolve, reported by the prefill profile"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/qwen_dispatch/gdn_native_batch/prompt_device/original_gdn_prompt_device/original_gdn_prompt_device_drain.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: spans of the GDN prompt drain, reported by the prefill profile"},
|
|
{"crate": "leleka-native-cpu-expert", "file": "src/rust_bench_frontend/cpu_blob.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: benchmark harness timers around the blob kernels, printed by the bench"},
|
|
{"crate": "leleka-native-cpu-expert", "file": "src/rust_general_pool/epoch_scheduling.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: per-epoch timers of the CPU expert pool (hot loop), summed into the pool trace; one reading per phase"},
|
|
{"crate": "leleka-native-cpu-expert", "file": "src/rust_general_pool/expert_pool.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: per-call phase timers of the CPU expert pool (hot loop), summed into the pool trace; one reading per phase"},
|
|
{"crate": "leleka-native-cpu-expert", "file": "src/rust_general_pool/expert_pool_split_multi_run.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: per-run phase timers of the split multi-expert run (hot loop), summed into the pool trace"},
|
|
{"crate": "leleka-native-cpu-expert", "file": "src/rust_general_pool/phase_handoff.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: wait and quantize lap timers of the pool (hot loop), summed into the pool trace"},
|
|
{"crate": "leleka-native-cpu-expert", "file": "src/rust_pool/epoch_scheduling.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: the pool's one monotonic reading, wrapped so every epoch timestamp comes from it (hot loop)"},
|
|
{"crate": "leleka-native-cpu-expert", "file": "src/rust_pool/native_pool.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: per-thread start stamps of the native pool for its timing mode (hot loop)"},
|
|
{"crate": "leleka-native-cpu-expert", "file": "src/rust_pool/trace.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: origin of the pool trace timeline, read once when tracing starts"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/mmq/resident/original_group.rs", "ratchet": "dyn-trait", "reason": "the group borrows its arena view (GroupArena) from the caller for one run; a test seam with a mock arena"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/mmq/resident/original_group/copy_ring.rs", "ratchet": "dyn-trait", "reason": "the copy ring borrows its arena view (RingArena) from the caller for one run; a test seam with a mock arena"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/mtp_dense_kv/original_int8/prefill/scalar/full_forward/full_round/put.rs", "ratchet": "dyn-trait", "reason": "the put step takes the copy and the fence of one round as callbacks, so the same code runs over the real streams and a recording test double"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/diag.rs", "ratchet": "dyn-trait", "reason": "the live-verifier release diagnostic writes an optional note to any writer (stderr, a file or a buffer in the tests)"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/gr.rs", "ratchet": "dyn-trait", "reason": "the window planner reads weight addresses through the ArenaMap seam (the device arena in production, an in-memory table in the tests); the planner structs keep it for one window plan, which is built at capture time, not per token"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/moe/plan_expert_groups.rs", "ratchet": "dyn-trait", "reason": "the window planner reads weight addresses through the ArenaMap seam (the device arena in production, an in-memory table in the tests); the planner structs keep it for one window plan, which is built at capture time, not per token"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/moe/plan_f32_to_bf16.rs", "ratchet": "dyn-trait", "reason": "the window planner reads weight addresses through the ArenaMap seam (the device arena in production, an in-memory table in the tests); the planner structs keep it for one window plan, which is built at capture time, not per token"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/planner.rs", "ratchet": "dyn-trait", "reason": "the window planner reads weight addresses through the ArenaMap seam (the device arena in production, an in-memory table in the tests); the planner structs keep it for one window plan, which is built at capture time, not per token"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/qsa.rs", "ratchet": "dyn-trait", "reason": "the window planner reads weight addresses through the ArenaMap seam (the device arena in production, an in-memory table in the tests); the planner structs keep it for one window plan, which is built at capture time, not per token"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/original_verify/qsa/qsa_window/qsa_window_query_key_paths.rs", "ratchet": "dyn-trait", "reason": "the window planner reads weight addresses through the ArenaMap seam (the device arena in production, an in-memory table in the tests); the planner structs keep it for one window plan, which is built at capture time, not per token"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/qwen_dispatch/gdn_native_batch.rs", "ratchet": "dyn-trait", "reason": "the batch owner holds its GEMM provider (cuBLAS-backed in production, a host stand-in in the tests) as a trait object for the life of one batch; it is a port, chosen when the owner is opened"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/qwen_dispatch/gdn_native_batch/context.rs", "ratchet": "dyn-trait", "reason": "the batch owner holds its GEMM provider (cuBLAS-backed in production, a host stand-in in the tests) as a trait object for the life of one batch; it is a port, chosen when the owner is opened"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/qwen_dispatch/moe_prefill_batch.rs", "ratchet": "dyn-trait", "reason": "the batch owner holds its GEMM provider (cuBLAS-backed in production, a host stand-in in the tests) as a trait object for the life of one batch; it is a port, chosen when the owner is opened"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/qwen_dispatch/moe_prefill_batch/moe_prefill_batch_lifecycle.rs", "ratchet": "dyn-trait", "reason": "the batch owner holds its GEMM provider (cuBLAS-backed in production, a host stand-in in the tests) as a trait object for the life of one batch; it is a port, chosen when the owner is opened"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/mmq/asset.rs", "ratchet": "process-global", "reason": "kept: pure memo of the verdict of the immutable embedded MMQ artifact check (a function of the embedded bytes alone), so no caller can observe the cache; a Context-owned copy would re-prove the same bytes per Context"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/prefill_stage.rs", "ratchet": "process-global", "reason": "kept: pure memo of a proof about an embedded sealed image (usability of the kh recurrence), a result per device that no caller can observe as state"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/qsa_index_ffi.rs", "ratchet": "process-global", "reason": "kept: pure memo of the RoPE ABI proof of the embedded index module, a function of the embedded bytes alone"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/qsa_prompt_resolver.rs", "ratchet": "process-global", "reason": "kept: pure memo of the resolver ABI proof of the embedded module, a function of the embedded bytes alone"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/qwen_ffi/asset_admission.rs", "ratchet": "process-global", "reason": "kept: per-operation pure memo of the PTX proof of an embedded sealed image, a function of the embedded bytes alone"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/qwen_ffi/n_types.rs", "ratchet": "process-global", "reason": "kept: the table of the PTX proof memos of asset_admission.rs, one cell per operation; pure functions of embedded bytes"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/vram_ledger.rs", "ratchet": "process-global", "reason": "kept for now (diagnostic, NOT a boundary): the LELEKA_VRAM_LEDGER singleton is fed by every allocation site through free functions; the correct owner is the Context, which every allocation already reaches. Not moved in this change (STRA-338 follow-up)"},
|
|
{"crate": "leleka-cuda-driver", "file": "src/marker_files.rs", "ratchet": "process-global", "reason": "kept: the marker files of the A/B controls are operator-named paths read once with the time of the first look, so a hot path stats the disk at most every 250 ms; one type serves three controls"},
|
|
{"crate": "leleka-native-cpu-expert", "file": "src/rust_bench_frontend.rs", "ratchet": "process-global", "reason": "kept: FFI. `static mut stdout` is libc's C stream, declared in an extern block; it is the C library's own global, not ours"},
|
|
{"crate": "leleka-native-cpu-expert", "file": "src/settings.rs", "ratchet": "process-global", "reason": "kept: the cell of each `static Setting` (operator switches and the CPU probes the kernels dispatch on), computed on first read from the immutable environment and the CPU; the kernels are free functions called from pool worker threads that carry no context to pass a value through, and a hot path pays one atomic load"}
|
|
],
|
|
"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", "ignore_imports": true, "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"},
|
|
{"id": "glob-super-import", "regex": "^use super::\\*;", "why": "a glob import of the parent hides what a module needs; name the items (use super::{A, B}); scripts/dev/explicit_imports.py does it for the files rustsplit leaves"},
|
|
{"id": "allow-unused-imports", "regex": "#\\[allow\\(unused_imports\\)\\]", "why": "a blanket allow hides imports that are really unused; it belongs on re-exports and on names that only some cargo features use"}
|
|
]
|
|
}
|