diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index bf1ca548..8113053b 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -347,10 +347,10 @@ jobs: run: | scripts/install-pinned-rustup.sh rustup toolchain install 1.99.0 --profile minimal --target x86_64-unknown-linux-musl - name: Build static CLI - run: cargo build --manifest-path control-plane/Cargo.toml --locked --release --target x86_64-unknown-linux-musl --bin strata-next + run: cargo build --manifest-path control-plane/Cargo.toml --locked --release --target x86_64-unknown-linux-musl --bin leleka-api - name: Verify ELF and checksum run: | - binary=control-plane/target/x86_64-unknown-linux-musl/release/strata-next + binary=control-plane/target/x86_64-unknown-linux-musl/release/leleka-api if readelf -l "$binary" | grep -q INTERP; then echo 'ELF has a dynamic interpreter' >&2 exit 1 @@ -361,7 +361,7 @@ jobs: fi "$binary" --version mkdir -p dist - cp "$binary" dist/strata-next-linux-x86_64-musl + cp "$binary" dist/leleka-api-linux-x86_64-musl { echo "Commit: $GITHUB_SHA" echo "Workflow: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" @@ -376,66 +376,66 @@ jobs: readelf -d "$binary" } > dist/ELF-AUDIT.txt cd dist - sha256sum strata-next-linux-x86_64-musl BUILD-PROVENANCE.txt ELF-AUDIT.txt > SHA256SUMS + sha256sum leleka-api-linux-x86_64-musl BUILD-PROVENANCE.txt ELF-AUDIT.txt > SHA256SUMS - name: Static CLI model smoke - run: python3 scripts/smoke-static-cli.py control-plane/target/x86_64-unknown-linux-musl/release/strata-next + run: python3 scripts/smoke-static-cli.py control-plane/target/x86_64-unknown-linux-musl/release/leleka-api - name: Engine loader probe before model acquisition - run: python3 scripts/smoke-engine-probe.py control-plane/target/x86_64-unknown-linux-musl/release/strata-next + run: python3 scripts/smoke-engine-probe.py control-plane/target/x86_64-unknown-linux-musl/release/leleka-api - name: Explicit GPU profile driver policy without GPU - run: python3 scripts/smoke-gpu-requirement.py control-plane/target/x86_64-unknown-linux-musl/release/strata-next + run: python3 scripts/smoke-gpu-requirement.py control-plane/target/x86_64-unknown-linux-musl/release/leleka-api - name: Declared GPU memory admission and child UUID pin without GPU - run: python3 scripts/smoke-cuda-memory.py control-plane/target/x86_64-unknown-linux-musl/release/strata-next + run: python3 scripts/smoke-cuda-memory.py control-plane/target/x86_64-unknown-linux-musl/release/leleka-api - name: Atomic pinned assets before native serving - run: python3 scripts/smoke-asset-bootstrap.py control-plane/target/x86_64-unknown-linux-musl/release/strata-next + run: python3 scripts/smoke-asset-bootstrap.py control-plane/target/x86_64-unknown-linux-musl/release/leleka-api - name: Native GGUF pack preparation against upstream oracle - run: python3 scripts/smoke-native-pack.py control-plane/target/x86_64-unknown-linux-musl/release/strata-next + run: python3 scripts/smoke-native-pack.py control-plane/target/x86_64-unknown-linux-musl/release/leleka-api - name: Native fetch prepare serve and verified offline reuse - run: python3 scripts/smoke-native-bootstrap.py control-plane/target/x86_64-unknown-linux-musl/release/strata-next + run: python3 scripts/smoke-native-bootstrap.py control-plane/target/x86_64-unknown-linux-musl/release/leleka-api - name: Pinned MTP structural preflight and native bootstrap - run: python3 scripts/smoke-mtp-pack.py control-plane/target/x86_64-unknown-linux-musl/release/strata-next + run: python3 scripts/smoke-mtp-pack.py control-plane/target/x86_64-unknown-linux-musl/release/leleka-api - name: Native runtime profile metadata admission - run: python3 scripts/smoke-runtime-profile.py control-plane/target/x86_64-unknown-linux-musl/release/strata-next + run: python3 scripts/smoke-runtime-profile.py control-plane/target/x86_64-unknown-linux-musl/release/leleka-api - name: Native systemd unit syntax and path safety - run: python3 scripts/smoke-service-unit.py control-plane/target/x86_64-unknown-linux-musl/release/strata-next + run: python3 scripts/smoke-service-unit.py control-plane/target/x86_64-unknown-linux-musl/release/leleka-api - name: Native installer with actual isolated systemd user service run: | - python3 scripts/smoke-systemd-manager.py control-plane/target/x86_64-unknown-linux-musl/release/strata-next + python3 scripts/smoke-systemd-manager.py control-plane/target/x86_64-unknown-linux-musl/release/leleka-api - name: Native deployment configuration without worker launch - run: python3 scripts/smoke-config-check.py control-plane/target/x86_64-unknown-linux-musl/release/strata-next + run: python3 scripts/smoke-config-check.py control-plane/target/x86_64-unknown-linux-musl/release/leleka-api - name: Native deployment readiness deadline without GPU - run: python3 scripts/smoke-wait-ready.py control-plane/target/x86_64-unknown-linux-musl/release/strata-next + run: python3 scripts/smoke-wait-ready.py control-plane/target/x86_64-unknown-linux-musl/release/leleka-api - name: Native API authentication without GPU - run: python3 scripts/smoke-native-auth.py control-plane/target/x86_64-unknown-linux-musl/release/strata-next + run: python3 scripts/smoke-native-auth.py control-plane/target/x86_64-unknown-linux-musl/release/leleka-api - name: Native custom text and regex tools without GPU - run: python3 scripts/smoke-custom-tools.py control-plane/target/x86_64-unknown-linux-musl/release/strata-next + run: python3 scripts/smoke-custom-tools.py control-plane/target/x86_64-unknown-linux-musl/release/leleka-api - name: Native auto/none/required/forced tool policy without GPU - run: python3 scripts/smoke-tool-policy.py control-plane/target/x86_64-unknown-linux-musl/release/strata-next + run: python3 scripts/smoke-tool-policy.py control-plane/target/x86_64-unknown-linux-musl/release/leleka-api - name: Live Responses replay and corrupt SSE evidence without GPU - run: PYTHONDONTWRITEBYTECODE=1 python3 scripts/test-live-responses-replay.py control-plane/target/x86_64-unknown-linux-musl/release/strata-next + run: PYTHONDONTWRITEBYTECODE=1 python3 scripts/test-live-responses-replay.py control-plane/target/x86_64-unknown-linux-musl/release/leleka-api - name: Input token count exact GEN wire parity without inference - run: python3 scripts/smoke-input-tokens.py control-plane/target/x86_64-unknown-linux-musl/release/strata-next + run: python3 scripts/smoke-input-tokens.py control-plane/target/x86_64-unknown-linux-musl/release/leleka-api - name: Chat Completions live protocol and wire parity - run: python3 scripts/smoke-chat-completions.py control-plane/target/x86_64-unknown-linux-musl/release/strata-next + run: python3 scripts/smoke-chat-completions.py control-plane/target/x86_64-unknown-linux-musl/release/leleka-api - name: Messages named SSE and tool protocol without GPU - run: python3 scripts/smoke-messages.py control-plane/target/x86_64-unknown-linux-musl/release/strata-next + run: python3 scripts/smoke-messages.py control-plane/target/x86_64-unknown-linux-musl/release/leleka-api - name: SSE idle keep-alive, terminal parity and disconnect without GPU - run: PYTHONDONTWRITEBYTECODE=1 python3 scripts/smoke-sse-keepalive.py control-plane/target/x86_64-unknown-linux-musl/release/strata-next + run: PYTHONDONTWRITEBYTECODE=1 python3 scripts/smoke-sse-keepalive.py control-plane/target/x86_64-unknown-linux-musl/release/leleka-api - name: Stored Responses retrieval and deletion without GPU - run: python3 scripts/smoke-response-history.py control-plane/target/x86_64-unknown-linux-musl/release/strata-next + run: python3 scripts/smoke-response-history.py control-plane/target/x86_64-unknown-linux-musl/release/leleka-api - name: Durable Responses restart and disk failure gate - run: python3 scripts/smoke-response-history.py control-plane/target/x86_64-unknown-linux-musl/release/strata-next --durable + run: python3 scripts/smoke-response-history.py control-plane/target/x86_64-unknown-linux-musl/release/leleka-api --durable - name: Native drain and resume without GPU - run: python3 scripts/smoke-native-drain.py control-plane/target/x86_64-unknown-linux-musl/release/strata-next + run: python3 scripts/smoke-native-drain.py control-plane/target/x86_64-unknown-linux-musl/release/leleka-api - name: Native signal shutdown grace without GPU - run: python3 scripts/smoke-signal-drain.py control-plane/target/x86_64-unknown-linux-musl/release/strata-next + run: python3 scripts/smoke-signal-drain.py control-plane/target/x86_64-unknown-linux-musl/release/leleka-api - name: Native generation deadline and recovery without GPU - run: python3 scripts/smoke-generation-deadline.py control-plane/target/x86_64-unknown-linux-musl/release/strata-next + run: python3 scripts/smoke-generation-deadline.py control-plane/target/x86_64-unknown-linux-musl/release/leleka-api - name: Native queue deadline without expiring active work - run: python3 scripts/smoke-queue-deadline.py control-plane/target/x86_64-unknown-linux-musl/release/strata-next + run: python3 scripts/smoke-queue-deadline.py control-plane/target/x86_64-unknown-linux-musl/release/leleka-api - name: Static CLI HTTP cancellation failure isolation - run: python3 scripts/smoke-worker-cancel.py control-plane/target/x86_64-unknown-linux-musl/release/strata-next + run: python3 scripts/smoke-worker-cancel.py control-plane/target/x86_64-unknown-linux-musl/release/leleka-api - name: Static CLI HTTP crash recovery without request replay - run: python3 scripts/smoke-worker-cancel.py control-plane/target/x86_64-unknown-linux-musl/release/strata-next --restart + run: python3 scripts/smoke-worker-cancel.py control-plane/target/x86_64-unknown-linux-musl/release/leleka-api --restart - name: Embedded CPU worker packaging without GPU run: | musl-gcc -O2 -static scripts/fixtures/embedded-worker.c -o "$RUNNER_TEMP/embedded-worker" @@ -445,8 +445,8 @@ jobs: cd "$RUNNER_TEMP/combined-fixture" sha256sum -c SHA256SUMS cd "$GITHUB_WORKSPACE" - python3 scripts/smoke-embedded-engine.py "$RUNNER_TEMP/combined-fixture/strata-next-linux-x86_64-musl" "$RUNNER_TEMP/embedded-worker" - python3 scripts/smoke-controller-deployment.py "$RUNNER_TEMP/combined-fixture/strata-next-linux-x86_64-musl" + python3 scripts/smoke-embedded-engine.py "$RUNNER_TEMP/combined-fixture/leleka-api-linux-x86_64-musl" "$RUNNER_TEMP/embedded-worker" + python3 scripts/smoke-controller-deployment.py "$RUNNER_TEMP/combined-fixture/leleka-api-linux-x86_64-musl" python3 scripts/build-runtime-image.py --cpu-fixture --package "$RUNNER_TEMP/combined-fixture" \ --receipt-sha256 "$(sha256sum "$RUNNER_TEMP/combined-fixture/SHA256SUMS" | cut -d ' ' -f 1)" \ > "$RUNNER_TEMP/combined-image.json" @@ -537,10 +537,10 @@ jobs: - name: Install pinned Rust and target run: scripts/install-pinned-rustup.sh rustup toolchain install 1.99.0 --profile minimal --target x86_64-unknown-linux-musl - name: Rebuild static CLI at the exact gated tag - run: cargo build --manifest-path control-plane/Cargo.toml --locked --release --target x86_64-unknown-linux-musl --bin strata-next + run: cargo build --manifest-path control-plane/Cargo.toml --locked --release --target x86_64-unknown-linux-musl --bin leleka-api - name: Verify ELF and checksum run: | - binary=control-plane/target/x86_64-unknown-linux-musl/release/strata-next + binary=control-plane/target/x86_64-unknown-linux-musl/release/leleka-api if readelf -l "$binary" | grep -q INTERP; then echo 'ELF has a dynamic interpreter' >&2 exit 1 @@ -551,7 +551,7 @@ jobs: fi "$binary" --version mkdir -p dist - cp "$binary" dist/strata-next-linux-x86_64-musl + cp "$binary" dist/leleka-api-linux-x86_64-musl { echo "Commit: $GITHUB_SHA" echo "Workflow: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" @@ -566,7 +566,7 @@ jobs: readelf -d "$binary" } > dist/ELF-AUDIT.txt cd dist - sha256sum strata-next-linux-x86_64-musl BUILD-PROVENANCE.txt ELF-AUDIT.txt > SHA256SUMS + sha256sum leleka-api-linux-x86_64-musl BUILD-PROVENANCE.txt ELF-AUDIT.txt > SHA256SUMS - name: Publish verified tagged CLI preview through Gitea env: GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} diff --git a/.github/workflows/product.yml b/.github/workflows/product.yml index 28b4b232..ef77cc9f 100644 --- a/.github/workflows/product.yml +++ b/.github/workflows/product.yml @@ -7,7 +7,7 @@ name: Product # - scripts/check-ci-coverage.py: fails when a workspace member (or default-member) has no entry in scripts/ci-coverage.json # - scripts/check-architecture.py: dependency direction between layers, adapter edges, no new .rs over 400 lines, source ratchets # (architecture.json is the policy, architecture-baseline.json the debt that may only fall; self-tests in check_architecture_test.py) -# - cargo build --locked (every default-member) and the release build of leleka, strata-next, leleka-inference, leleka-daemon, +# - cargo build --locked (every default-member) and the release build of leleka, leleka-api, leleka-inference, leleka-daemon, # leleka-cli, leleka-seal-exec (docs/deploy.md section 8) # - cargo check of the CUDA-feature crates (leleka-cuda-driver --features cuda-driver, leleka-runtime) # - cargo test of the product crates; the deploy end-to-end tests run against scripts/ci/nvidia-smi, a hermetic stand-in @@ -44,5 +44,5 @@ jobs: - name: Release binaries (digests; publishing stays with scripts/package-release.py) run: | cd target/release - sha256sum leleka strata-next leleka-inference leleka-daemon leleka-cli leleka-seal-exec + sha256sum leleka leleka-api leleka-inference leleka-daemon leleka-cli leleka-seal-exec ./leleka --help | head -5 diff --git a/Cargo.lock b/Cargo.lock index f9a785eb..d2f005ec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1258,6 +1258,50 @@ dependencies = [ "serde_json", ] +[[package]] +name = "leleka-control-plane" +version = "0.1.0" +dependencies = [ + "axum", + "cc", + "futures-core", + "getrandom 0.3.4", + "hex", + "http-body", + "http-body-util", + "jsonschema", + "leleka-backend-api", + "leleka-gateway-domain", + "leleka-gateway-text", + "leleka-gguf", + "leleka-harmony", + "leleka-kar-codec", + "leleka-memory", + "leleka-model-format", + "leleka-obs", + "leleka-offline-tools", + "leleka-quant-core", + "leleka-runtime-client", + "leleka-sampler-ref", + "leleka-serving-policy", + "leleka-tokenizer", + "leleka-worker-protocol", + "libc", + "minijinja", + "minijinja-contrib", + "regex", + "regex-syntax", + "reqwest", + "serde", + "serde_json", + "sha2", + "subtle", + "tokio", + "uuid", + "webpki-root-certs", + "windows-sys 0.61.2", +] + [[package]] name = "leleka-cpu-kernels" version = "0.1.0" @@ -1341,6 +1385,43 @@ dependencies = [ "leleka-engine-core", ] +[[package]] +name = "leleka-engine-host" +version = "0.1.0" +dependencies = [ + "async-stream", + "axum", + "futures-util", + "hex", + "jsonschema", + "leleka-backend-api", + "leleka-control-plane", + "leleka-engine-core", + "leleka-engine-fake", + "leleka-gateway-text", + "leleka-obs", + "leleka-runtime", + "leleka-runtime-client", + "leleka-sampler-ref", + "leleka-serving-policy", + "prost", + "protoc-bin-vendored", + "reqwest", + "rustix", + "serde", + "serde_json", + "sha2", + "subtle", + "sysinfo", + "tokio", + "tokio-stream", + "tonic", + "tonic-prost", + "tonic-prost-build", + "tower", + "uuid", +] + [[package]] name = "leleka-engine-qwen35-cuda" version = "0.1.0" @@ -2841,87 +2922,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "strata-control" -version = "0.1.0" -dependencies = [ - "axum", - "cc", - "futures-core", - "getrandom 0.3.4", - "hex", - "http-body", - "http-body-util", - "jsonschema", - "leleka-backend-api", - "leleka-gateway-domain", - "leleka-gateway-text", - "leleka-gguf", - "leleka-harmony", - "leleka-kar-codec", - "leleka-memory", - "leleka-model-format", - "leleka-obs", - "leleka-offline-tools", - "leleka-quant-core", - "leleka-runtime-client", - "leleka-sampler-ref", - "leleka-serving-policy", - "leleka-tokenizer", - "leleka-worker-protocol", - "libc", - "minijinja", - "minijinja-contrib", - "regex", - "regex-syntax", - "reqwest", - "serde", - "serde_json", - "sha2", - "subtle", - "tokio", - "uuid", - "webpki-root-certs", - "windows-sys 0.61.2", -] - -[[package]] -name = "strata-desktop-core" -version = "0.1.0" -dependencies = [ - "async-stream", - "axum", - "futures-util", - "hex", - "jsonschema", - "leleka-backend-api", - "leleka-engine-core", - "leleka-engine-fake", - "leleka-gateway-text", - "leleka-obs", - "leleka-runtime", - "leleka-runtime-client", - "leleka-sampler-ref", - "leleka-serving-policy", - "prost", - "protoc-bin-vendored", - "reqwest", - "rustix", - "serde", - "serde_json", - "sha2", - "strata-control", - "subtle", - "sysinfo", - "tokio", - "tokio-stream", - "tonic", - "tonic-prost", - "tonic-prost-build", - "tower", - "uuid", -] - [[package]] name = "strum" version = "0.28.0" diff --git a/Cargo.toml b/Cargo.toml index 2dc44c9d..2bd10733 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ all = "warn" # 16 codegen units, panic=unwind, no RUSTFLAGS and no target-cpu (the last on purpose: the CPU kernels select their GGML # arithmetic branches with cfg!(target_feature), see crates/native-cpu-expert/src/rust_ggml_native.rs, so target-cpu would change bits). # `release-lto` changes inlining and layout only; Rust has no fast-math, so the output is expected to be bit-identical, but that is -# unmeasured. Build: cargo build --profile release-lto --locked -p strata-desktop-core --bin leleka-inference (target/release-lto/). +# unmeasured. Build: cargo build --profile release-lto --locked -p leleka-engine-host --bin leleka-inference (target/release-lto/). # It is NOT the default and must not become one before a paired A/B on the same workload. [profile.release-lto] inherits = "release" diff --git a/PROJECT_CHARTER.md b/PROJECT_CHARTER.md index aa33e656..1a27cabd 100644 --- a/PROJECT_CHARTER.md +++ b/PROJECT_CHARTER.md @@ -3,7 +3,7 @@ **Статус:** проєктний документ v0.1 **Дата:** 2026-10-02 **Тип:** окремий проєкт і форк Strata -**Робоча назва:** `strata-next` +**Робоча назва:** `leleka-api` ## 1. Мета проєкту diff --git a/README.md b/README.md index 735c635f..085bfa5b 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ What the service is doing, and why a request was slow or failed, is in its logs; ## Repository layout - `crates/` — the runtime: `engine-qwen35-cuda` (the engine; `leleka-runtime` is its facade), `engine-core` (pure engine domain), `cuda-driver` (CUDA Driver API, sealed PTX), `leleka-memory` (memory governor), `obs` (logging), `deploy` (the `leleka` binary), model-format, tokenizer, sampler and CPU kernels. -- `control-plane/`, `desktop-core/` — the HTTP/Responses gateway (`strata-next`) and the engine/daemon processes. +- `control-plane/`, `desktop-core/` — the HTTP/Responses gateway (`leleka-api`) and the engine/daemon processes. - `engine/strata/` — the pinned upstream Strata, the reference (unmodified by Leleka). - `deploy/`, `scripts/` — profiles, service templates, release packager (`scripts/release/`), test and measurement tooling (Python is allowed there, never in serving). - `PROJECT_CHARTER.md`, `docs/` — requirements, provenance, decisions, gates and measurements. Architecture: `docs/architecture/hexagonal.md`. diff --git a/architecture-baseline.json b/architecture-baseline.json index 70adb3d2..ff15990f 100644 --- a/architecture-baseline.json +++ b/architecture-baseline.json @@ -45,7 +45,7 @@ "env-read:leleka-npu-worker": 1, "env-read:leleka-obs": 2, "env-read:leleka-tokenizer": 2, - "env-read:strata-control": 3, + "env-read:leleka-control-plane": 3, "glob-super-import:leleka-cuda-driver": 3, "glob-super-import:leleka-engine-qwen35-cuda": 70, "instant-now:leleka-cpu-worker": 9, @@ -60,8 +60,8 @@ "instant-now:leleka-model-format": 10, "instant-now:leleka-native-cpu-expert": 27, "instant-now:leleka-obs": 3, - "instant-now:strata-control": 15, - "instant-now:strata-desktop-core": 4, + "instant-now:leleka-control-plane": 15, + "instant-now:leleka-engine-host": 4, "path-include:leleka-cuda-driver": 118, "path-include:leleka-engine-qwen35-cuda": 1, "path-include:leleka-model-format": 12, @@ -77,7 +77,7 @@ "process-global:leleka-native-cpu-expert": 27, "process-global:leleka-obs": 6, "process-global:leleka-tokenizer": 4, - "process-global:strata-control": 2 + "process-global:leleka-control-plane": 2 }, "mechanical_names": [] } diff --git a/architecture.json b/architecture.json index 3534a4fb..821ff769 100644 --- a/architecture.json +++ b/architecture.json @@ -19,7 +19,7 @@ "leleka-engine-fake", "leleka-engine-qwen35-cuda" ], - "L4": ["leleka-runtime", "strata-desktop-core", "strata-control", "leleka-deploy", "leleka-native-parity-bench"] + "L4": ["leleka-runtime", "leleka-engine-host", "leleka-control-plane", "leleka-deploy", "leleka-native-parity-bench"] }, "adapter_edges": [ ["leleka-cuda-driver", "leleka-libc-shim"], @@ -51,34 +51,34 @@ }, "_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": "strata-control", "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-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": "strata-desktop-core", "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-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/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": "strata-control", "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": "strata-control", "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": "strata-desktop-core", "file": "src/clock.rs", "ratchet": "instant-now", "reason": "the runtime-clock adapter of the Clock port of the crate"}, - {"crate": "strata-desktop-core", "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-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": "strata-control", "file": "src/ports/clock.rs", "ratchet": "dyn-trait", "reason": "port boundary: SharedClock is the Arc the composition root hands to AppState"}, - {"crate": "strata-control", "file": "src/ports/engine.rs", "ratchet": "dyn-trait", "reason": "port boundary: SharedEngine is the Arc the composition root hands to AppState"}, - {"crate": "strata-control", "file": "src/ports/response_store.rs", "ratchet": "dyn-trait", "reason": "port boundary: SharedResponseStore is the Arc the composition root hands to AppState"}, - {"crate": "strata-control", "file": "src/ports/tool_hub.rs", "ratchet": "dyn-trait", "reason": "port boundary: SharedToolHub is the Arc the composition root hands to AppState"}, - {"crate": "strata-control", "file": "src/ports/vision.rs", "ratchet": "dyn-trait", "reason": "port boundary: SharedVisionEncoder is the Arc the composition root hands to AppState"}, - {"crate": "strata-control", "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, once per request"}, - {"crate": "strata-control", "file": "src/responses.rs", "ratchet": "dyn-trait", "reason": "SharedCodec, the alias of Arc that the response stages share"}, - {"crate": "strata-control", "file": "src/model/manifest_fetch.rs", "ratchet": "dyn-trait", "reason": "walks an error's source() chain, whose items are dyn Error"}, - {"crate": "strata-control", "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": "strata-desktop-core", "file": "src/node.rs", "ratchet": "dyn-trait", "reason": "tonic server-streaming response type: the generated trait wants a boxed stream"}, - {"crate": "strata-desktop-core", "file": "src/runtime_rpc.rs", "ratchet": "dyn-trait", "reason": "tonic server-streaming response type: the generated trait wants a boxed stream"}, + {"crate": "leleka-control-plane", "file": "src/ports/clock.rs", "ratchet": "dyn-trait", "reason": "port boundary: SharedClock is the Arc 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 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 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 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 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, once per request"}, + {"crate": "leleka-control-plane", "file": "src/responses.rs", "ratchet": "dyn-trait", "reason": "SharedCodec, the alias of Arc 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": "pure cache: the validity of a tool schema by its compact text, so the dozen schemas of a coding agent are compiled once, not three times per request"}, {"crate": "leleka-gateway-text", "file": "src/prompt/renderer.rs", "ratchet": "process-global", "reason": "the compiled pinned chat template: immutable, built on first use, read by every request"}, - {"crate": "strata-control", "file": "src/request_log.rs", "ratchet": "process-global", "reason": "the process-wide request counters and histograms that /metrics renders; written by every request"}, - {"crate": "strata-control", "file": "src/responses/harmony_prompt.rs", "ratchet": "process-global", "reason": "the gpt-oss prompt date: configuration set once by serve before the first request"}, - {"crate": "strata-control", "file": "src/stage_trace.rs", "ratchet": "process-global", "reason": "diagnostic stage table of the replay harness and STRATA_STAGE_TRACE: one table per process by design"} + {"crate": "leleka-control-plane", "file": "src/request_log.rs", "ratchet": "process-global", "reason": "the process-wide request counters and histograms that /metrics renders; written by every request"}, + {"crate": "leleka-control-plane", "file": "src/responses/harmony_prompt.rs", "ratchet": "process-global", "reason": "the gpt-oss prompt date: configuration set once by serve before the first request"}, + {"crate": "leleka-control-plane", "file": "src/stage_trace.rs", "ratchet": "process-global", "reason": "diagnostic stage table of the replay harness and STRATA_STAGE_TRACE: one table per process by design"} ], "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"}, diff --git a/benchmarks/tools/Compare-ConcurrentEpisodes.ps1 b/benchmarks/tools/Compare-ConcurrentEpisodes.ps1 index 96cbf2ab..7d66ff50 100644 --- a/benchmarks/tools/Compare-ConcurrentEpisodes.ps1 +++ b/benchmarks/tools/Compare-ConcurrentEpisodes.ps1 @@ -4,7 +4,7 @@ sent at the same time, through the control plane's /v1/responses. .DESCRIPTION - Arm 'single' starts strata-next with leleka-igpu-worker alone; arm 'pool' starts it with leleka-igpu-worker and + Arm 'single' starts leleka-api with leleka-igpu-worker alone; arm 'pool' starts it with leleka-igpu-worker and leleka-npu-worker in a pool (engine.extra_workers, control-plane/src/pool.rs). In each arm two episodes run at once (two runspaces): each is the scripted episode of Compare-PrefillWorkers.ps1 (turn k carries k function_call / function_call_output pairs of about -ToolTokens tokens of deterministic pseudo-source), with different outputs and @@ -12,7 +12,7 @@ of its episode. Recorded per turn: wall time and usage; per arm: the time until both episodes are done. One untimed warm-up request per worker after readiness. Arms alternate in order for -Pairs pairs; only processes this script starts are stopped. Results are appended as JSON lines to -Output (outside Git, or sanitize first). - Build first: cargo build --release -p strata-control -p leleka-igpu-worker -p leleka-npu-worker -p leleka-npu-service + Build first: cargo build --release -p leleka-control-plane -p leleka-igpu-worker -p leleka-npu-worker -p leleka-npu-service #> param( [Parameter(Mandatory)] [string] $Model, @@ -80,7 +80,7 @@ function Start-Arm([string]$arm, [int]$pair) { } $config = @{ bind = "127.0.0.1:$Port"; model = 'gpt-oss-20b'; engine = $engine } | ConvertTo-Json -Depth 6 [IO.File]::WriteAllText((Join-Path $work 'config.json'), $config, (New-Object Text.UTF8Encoding($false))) - $server = Start-Process (Join-Path $bin 'strata-next.exe') -ArgumentList @('serve', '--config', (Join-Path $work 'config.json')) ` + $server = Start-Process (Join-Path $bin 'leleka-api.exe') -ArgumentList @('serve', '--config', (Join-Path $work 'config.json')) ` -PassThru -WindowStyle Hidden -RedirectStandardOutput (Join-Path $work 'out.txt') -RedirectStandardError (Join-Path $work 'err.txt') $ready = $false foreach ($i in 1..150) { diff --git a/benchmarks/tools/Compare-PrefillWorkers.ps1 b/benchmarks/tools/Compare-PrefillWorkers.ps1 index 49081b4a..b0535ec7 100644 --- a/benchmarks/tools/Compare-PrefillWorkers.ps1 +++ b/benchmarks/tools/Compare-PrefillWorkers.ps1 @@ -5,7 +5,7 @@ through the control plane's /v1/responses. .DESCRIPTION - Each arm starts strata-next with one worker, waits for readiness, then replays the same scripted episode: + Each arm starts leleka-api with one worker, waits for readiness, then replays the same scripted episode: turn k sends the user task plus k (function_call, function_call_output) pairs whose outputs are large, deterministic pseudo-source listings (-ToolTokens tokens each, roughly), with a small output cap. Earlier turns are an exact prefix of later ones, so after turn 1 each request only has the newest tool output to process @@ -13,7 +13,7 @@ input/cached/output tokens. The model's own answers are discarded (history is replayed, not generated). Arms alternate in order (cpu,gpu,gpu,cpu,...) for -Pairs pairs; only processes this script starts are stopped. Warm model file, cold worker cache per arm (a fresh process), one untimed 1-token request per start. - Build first: cargo build --release -p strata-control -p leleka-cpu-worker -p leleka-igpu-worker + Build first: cargo build --release -p leleka-control-plane -p leleka-cpu-worker -p leleka-igpu-worker It is a measurement of this scripted episode, not of real agent traffic. Record machine state yourself (Capture-MachineState.ps1). Results are appended as JSON lines to -Output (outside Git). #> @@ -73,7 +73,7 @@ function Start-Arm([string]$worker) { engine = @{ executable = (Join-Path $bin "$worker.exe"); args = $workerArgs; gptoss_gguf = $Model startup_timeout_s = 300; generation_timeout_s = 1200 } } | ConvertTo-Json -Depth 5 [IO.File]::WriteAllText((Join-Path $work 'config.json'), $config, (New-Object Text.UTF8Encoding($false))) - $server = Start-Process (Join-Path $bin 'strata-next.exe') -ArgumentList @('serve', '--config', (Join-Path $work 'config.json')) ` + $server = Start-Process (Join-Path $bin 'leleka-api.exe') -ArgumentList @('serve', '--config', (Join-Path $work 'config.json')) ` -PassThru -WindowStyle Hidden -RedirectStandardOutput (Join-Path $work 'out.txt') -RedirectStandardError (Join-Path $work 'err.txt') $ready = $false foreach ($i in 1..100) { diff --git a/benchmarks/tools/Smoke-GptOssStack.ps1 b/benchmarks/tools/Smoke-GptOssStack.ps1 index eed0fea5..23cffe94 100644 --- a/benchmarks/tools/Smoke-GptOssStack.ps1 +++ b/benchmarks/tools/Smoke-GptOssStack.ps1 @@ -3,10 +3,10 @@ End-to-end smoke test of the gpt-oss stack: the control plane serving /v1/responses with the CPU worker. .DESCRIPTION - Starts strata-next with leleka-cpu-worker (or, with -Worker leleka-igpu-worker, the GPU-prefill worker) for the given GGUF, waits for readiness, sends four requests + Starts leleka-api with leleka-cpu-worker (or, with -Worker leleka-igpu-worker, the GPU-prefill worker) for the given GGUF, waits for readiness, sends four requests (a plain question, a function call, a tool-result round trip that must reuse the cached prefix, and a streaming request), checks the answers' shape, and stops everything it started. Build first: - cargo build --release -p strata-control -p leleka-cpu-worker -p leleka-igpu-worker + cargo build --release -p leleka-control-plane -p leleka-cpu-worker -p leleka-igpu-worker It is a functional check, not a benchmark. Run it on an otherwise idle machine. #> param( @@ -35,7 +35,7 @@ $config = @{ [IO.File]::WriteAllText((Join-Path $work 'config.json'), $config, (New-Object Text.UTF8Encoding($false))) function Check($ok, $what) { if (-not $ok) { throw "FAILED: $what" } else { "ok $what" } } -$server = Start-Process (Join-Path $bin 'strata-next.exe') -ArgumentList @('serve', '--config', (Join-Path $work 'config.json')) ` +$server = Start-Process (Join-Path $bin 'leleka-api.exe') -ArgumentList @('serve', '--config', (Join-Path $work 'config.json')) ` -PassThru -WindowStyle Hidden -RedirectStandardOutput (Join-Path $work 'out.txt') -RedirectStandardError (Join-Path $work 'err.txt') try { $ready = $false diff --git a/clippy-limits-baseline.json b/clippy-limits-baseline.json index 4ab3c858..e4d71570 100644 --- a/clippy-limits-baseline.json +++ b/clippy-limits-baseline.json @@ -152,12 +152,12 @@ "clippy::too_many_arguments": 1, "clippy::cognitive_complexity": 1 }, - "strata-control": { + "leleka-control-plane": { "clippy::too_many_arguments": 20, "clippy::too_many_lines": 362, "clippy::cognitive_complexity": 91 }, - "strata-desktop-core": { + "leleka-engine-host": { "clippy::too_many_lines": 137, "clippy::cognitive_complexity": 20, "clippy::too_many_arguments": 2 diff --git a/clippy.toml b/clippy.toml index a97c1bb1..743d38da 100644 --- a/clippy.toml +++ b/clippy.toml @@ -4,7 +4,7 @@ # warnings and ratchets the count per crate. # # too-many-arguments-threshold = 5 is NOT set here: too_many_arguments is on by default, so 5 would fail the hard Clippy -# gates of check-local.sh --product today (strata-control, strata-desktop-core: functions with 6 and 7 arguments). The +# gates of check-local.sh --product today (leleka-control-plane, leleka-engine-host: functions with 6 and 7 arguments). The # opt-in script reads scripts/limits/clippy/clippy.toml (CLIPPY_CONF_DIR), which repeats these two keys and adds that one. too-many-lines-threshold = 30 cognitive-complexity-threshold = 10 \ No newline at end of file diff --git a/control-plane/Cargo.toml b/control-plane/Cargo.toml index 71b9ef3e..3e823fa4 100644 --- a/control-plane/Cargo.toml +++ b/control-plane/Cargo.toml @@ -1,13 +1,13 @@ [package] -name = "strata-control" +name = "leleka-control-plane" version = "0.1.0" edition = "2024" rust-version = "1.99" license = "MIT" -default-run = "strata-next" +default-run = "leleka-api" [[bin]] -name = "strata-next" +name = "leleka-api" path = "src/main.rs" [dependencies] diff --git a/control-plane/README.md b/control-plane/README.md index 9c7a6089..93cfdfa3 100644 --- a/control-plane/README.md +++ b/control-plane/README.md @@ -2,7 +2,7 @@ For small, experimental sharded fixtures, `model ensure-sharded-preview MANIFEST --source-dir DIR --output FILE.kar --levels N` acquires and verifies the sources, creates a KAR-2 preview, and verifies it again. It reuses an existing archive only when its payload, provenance, source identity, and requested level count verify. `model smoke-fixture --output FILE.kar` creates a deterministic model-free archive, and `model checksum-kar-preview FILE.kar TENSOR LEVEL` independently decodes it on CPU for comparison with the CUDA smoke tool. The 64 MiB input limit remains; these commands cannot prepare the target model for serving. -The repository pins Rust 1.99.0 in [`rust-toolchain.toml`](../rust-toolchain.toml). `rustup` selects it automatically from this checkout. The `strata-next` executable defaults to `serve` and also supports `doctor`, `model fetch MANIFEST --output DIR`, `model verify MANIFEST --output DIR`, `model inspect FILE.gguf`, `model index FILE.gguf [--hash]`, `model derive-iq3-identity FILE.gguf`, `model derive-mixed-identity FILE.gguf`, `model derive-sharded-identity MANIFEST --source-dir DIR`, `model prepare-f32-preview FILE.gguf --output FILE.kar --levels N`, `model prepare-iq3-preview FILE.gguf --output FILE.kar --levels N`, `model prepare-mixed-preview FILE.gguf --output FILE.kar --levels N`, `model prepare-sharded-preview MANIFEST --source-dir DIR --output FILE.kar --levels N`, `model inspect-kar FILE.kar`, `model verify-kar FILE.kar [--manifest SPEC --source-dir DIR]`, `model verify-iq3-preview FILE.kar --source FILE.gguf`, `model verify-mixed-preview FILE.kar --source FILE.gguf`, `model verify-sharded-preview FILE.kar --manifest SPEC --source-dir DIR`, `model extract-tokenizer FILE.gguf --output DIR`, `model tokenize TOKENIZER_DIR TEXT [--special]`, and `model detokenize TOKENIZER_DIR IDS`. Use `model tokenize TOKENIZER_DIR --stdin [--special]` for long text or control bytes. The IQ3, mixed, and sharded identity commands hash virtual F32 streams with bounded memory. Preview preparation commands write provenance sidecars, which the corresponding verification commands recompute and check against the archives. No preview archive is approved for serving. `model inspect-kar` checks bounded KAR-2 metadata, header CRC, directory digest, tensor shapes, and section bounds; `model verify-kar` also scans payload CRC-32 checksums. With a manifest and source directory it verifies each physical source shard and the archive's concatenated source digest. Neither command decodes KAR weights or measures quality. `scripts/check-local.sh` runs formatting, Clippy, Rust tests, protocol replay, and the CPU engine tests. +The repository pins Rust 1.99.0 in [`rust-toolchain.toml`](../rust-toolchain.toml). `rustup` selects it automatically from this checkout. The `leleka-api` executable defaults to `serve` and also supports `doctor`, `model fetch MANIFEST --output DIR`, `model verify MANIFEST --output DIR`, `model inspect FILE.gguf`, `model index FILE.gguf [--hash]`, `model derive-iq3-identity FILE.gguf`, `model derive-mixed-identity FILE.gguf`, `model derive-sharded-identity MANIFEST --source-dir DIR`, `model prepare-f32-preview FILE.gguf --output FILE.kar --levels N`, `model prepare-iq3-preview FILE.gguf --output FILE.kar --levels N`, `model prepare-mixed-preview FILE.gguf --output FILE.kar --levels N`, `model prepare-sharded-preview MANIFEST --source-dir DIR --output FILE.kar --levels N`, `model inspect-kar FILE.kar`, `model verify-kar FILE.kar [--manifest SPEC --source-dir DIR]`, `model verify-iq3-preview FILE.kar --source FILE.gguf`, `model verify-mixed-preview FILE.kar --source FILE.gguf`, `model verify-sharded-preview FILE.kar --manifest SPEC --source-dir DIR`, `model extract-tokenizer FILE.gguf --output DIR`, `model tokenize TOKENIZER_DIR TEXT [--special]`, and `model detokenize TOKENIZER_DIR IDS`. Use `model tokenize TOKENIZER_DIR --stdin [--special]` for long text or control bytes. The IQ3, mixed, and sharded identity commands hash virtual F32 streams with bounded memory. Preview preparation commands write provenance sidecars, which the corresponding verification commands recompute and check against the archives. No preview archive is approved for serving. `model inspect-kar` checks bounded KAR-2 metadata, header CRC, directory digest, tensor shapes, and section bounds; `model verify-kar` also scans payload CRC-32 checksums. With a manifest and source directory it verifies each physical source shard and the archive's concatenated source digest. Neither command decodes KAR weights or measures quality. `scripts/check-local.sh` runs formatting, Clippy, Rust tests, protocol replay, and the CPU engine tests. The Rust control plane provides process health, worker readiness, status, and graceful shutdown. It can start a Strata engine worker and records worker readiness only after the engine emits `READY `. An abandoned internal generation sends `STOP` and drains its terminal response before the next request; shutdown during generation sends `STOP` before `QUIT`. With tokenizer assets configured, `POST /v1/responses` can perform a restricted non-streaming text generation with `reasoning.effort: "none"`. It returns 503 while the worker is unavailable, 501 for unsupported live features or a missing tokenizer, and never fabricates a model response. Worker restart is not yet implemented. diff --git a/control-plane/examples/compare-iq3-s.rs b/control-plane/examples/compare-iq3-s.rs index 65075ee5..97830429 100644 --- a/control-plane/examples/compare-iq3-s.rs +++ b/control-plane/examples/compare-iq3-s.rs @@ -8,7 +8,7 @@ use std::{ path::Path, }; -use strata_control::{ggml_bridge, gguf, iq3_s}; +use leleka_control_plane::{ggml_bridge, gguf, iq3_s}; type Failure = Box; diff --git a/control-plane/examples/compare-kar-range.rs b/control-plane/examples/compare-kar-range.rs index 5ded6057..d57ca8b4 100644 --- a/control-plane/examples/compare-kar-range.rs +++ b/control-plane/examples/compare-kar-range.rs @@ -8,7 +8,7 @@ use std::{ path::Path, }; -use strata_control::{ggml_bridge, gguf, kar}; +use leleka_control_plane::{ggml_bridge, gguf, kar}; type Failure = Box; diff --git a/control-plane/examples/cp_replay/main.rs b/control-plane/examples/cp_replay/main.rs index c2822907..a1ea52bd 100644 --- a/control-plane/examples/cp_replay/main.rs +++ b/control-plane/examples/cp_replay/main.rs @@ -3,7 +3,7 @@ //! engine that returns a canned reply the moment it has the prompt. Everything this prints is therefore the cost of the //! control plane outside the engine, per stage; it says nothing about the engine. //! -//! ```text cargo run --release -p strata-control --example cp_replay -- TOKENIZER_DIR SESSION.json \ [--sizes +//! ```text cargo run --release -p leleka-control-plane --example cp_replay -- TOKENIZER_DIR SESSION.json \ [--sizes //! 20000,60000,120000,180000] [--turns 24] [--out results.json] [--json-response] [--verify] //! ``` //! @@ -44,7 +44,7 @@ use std::{ }, time::{Duration, Instant}, }; -use strata_control::app::{EngineLink, ModelView}; +use leleka_control_plane::app::{EngineLink, ModelView}; use leleka_backend_api::{ Backend, BackendCapabilities, BackendError, BackendIdentity, FinishReason, GenerationEvent, @@ -52,7 +52,7 @@ use leleka_backend_api::{ SupportedModelTuple, Usage, }; use serde_json::{Value, json}; -use strata_control::{ +use leleka_control_plane::{ app::{AppState, router}, backend_worker::{BackendWorkerConfig, WorkerInbox, run_backend_worker}, stage_trace, diff --git a/control-plane/examples/cp_replay/stack.rs b/control-plane/examples/cp_replay/stack.rs index 088e272b..d7a9a72e 100644 --- a/control-plane/examples/cp_replay/stack.rs +++ b/control-plane/examples/cp_replay/stack.rs @@ -34,20 +34,20 @@ fn worker_config(tokenizer: Arc) -> BackendWorkerConfig { fn app_state( status: &Arc>, - requests: mpsc::Sender, - control: mpsc::Sender, + requests: mpsc::Sender, + control: mpsc::Sender, tokenizer: &Arc, ) -> AppState { AppState { engine: EngineLink { worker: status.clone(), - client: Some(strata_control::adapters::ChannelEngine::shared(requests)), + client: Some(leleka_control_plane::adapters::ChannelEngine::shared(requests)), control: Some(control), ..Default::default() }, model: ModelView { name: Some("fixture".into()), - tokenizer: Some(Arc::new(strata_control::codec::qwen_codec_shared( + tokenizer: Some(Arc::new(leleka_control_plane::codec::qwen_codec_shared( tokenizer.clone(), ))), ..Default::default() @@ -82,8 +82,8 @@ async fn await_ready(status: &Arc>) { type SpawnedWorker = ( watch::Sender, - mpsc::Sender, - mpsc::Sender, + mpsc::Sender, + mpsc::Sender, tokio::task::JoinHandle<()>, ); diff --git a/control-plane/examples/kar-expert-fixture.rs b/control-plane/examples/kar-expert-fixture.rs index ebf375a5..d6291466 100644 --- a/control-plane/examples/kar-expert-fixture.rs +++ b/control-plane/examples/kar-expert-fixture.rs @@ -1,7 +1,7 @@ //! Model-free routed-expert fixture, using the production KAR writer. use sha2::{Digest, Sha256}; use std::path::Path; -use strata_control::kar_writer::{self, SourceIdentity, Tensor, TensorData}; +use leleka_control_plane::kar_writer::{self, SourceIdentity, Tensor, TensorData}; const H: u64 = 64; const F: u64 = 32; @@ -33,7 +33,7 @@ fn source_identity(raw: &[u8]) -> SourceIdentity<'static> { SourceIdentity { name: "synthetic-routed-experts", architecture: "synthetic", - builder: "strata-next/kar-expert-fixture-v1", + builder: "leleka-api/kar-expert-fixture-v1", digest: Sha256::digest(raw).into(), total_elements: H * F * E * 3, bytes: raw.len() as u64, diff --git a/control-plane/examples/scan-quant-blocks.rs b/control-plane/examples/scan-quant-blocks.rs index c6a0c577..1c498365 100644 --- a/control-plane/examples/scan-quant-blocks.rs +++ b/control-plane/examples/scan-quant-blocks.rs @@ -4,7 +4,7 @@ use std::{collections::BTreeMap, env, fs::File, path::Path}; use sha2::{Digest, Sha256}; -use strata_control::{gguf, gguf_f32_stream}; +use leleka_control_plane::{gguf, gguf_f32_stream}; type Failure = Box; diff --git a/control-plane/src/app/admin_routes.rs b/control-plane/src/app/admin_routes.rs index ee1456c9..6a3bea30 100644 --- a/control-plane/src/app/admin_routes.rs +++ b/control-plane/src/app/admin_routes.rs @@ -21,7 +21,7 @@ pub(super) async fn lifecycle_status(State(state): State) -> Json, ) -> StatusResponse { StatusResponse { - service: "strata-control", + service: "leleka-control-plane", server_pid: std::process::id(), model, version: env!("CARGO_PKG_VERSION"), diff --git a/control-plane/src/app/tests.rs b/control-plane/src/app/tests.rs index 991248d6..fb2062ec 100644 --- a/control-plane/src/app/tests.rs +++ b/control-plane/src/app/tests.rs @@ -62,7 +62,7 @@ async fn conditional_admission_rejects_stale_or_ambiguous_pid_before_mutation() let value: serde_json::Value = serde_json::from_str(&response.text().await.unwrap()).unwrap(); assert_eq!(value["server_pid"], std::process::id()); - assert_eq!(value["service"], "strata-control"); + assert_eq!(value["service"], "leleka-control-plane"); assert_eq!(value["draining"], !initial); } server.abort(); diff --git a/control-plane/src/backend_worker.rs b/control-plane/src/backend_worker.rs index 3423a07d..9ea29055 100644 --- a/control-plane/src/backend_worker.rs +++ b/control-plane/src/backend_worker.rs @@ -1,4 +1,4 @@ -//! The worker for a text-level engine: the whole `strata-next` API in front of anything that +//! The worker for a text-level engine: the whole `leleka-api` API in front of anything that //! implements [`leleka_backend_api::Backend`] (the Rust engine over gRPC, or a scripted engine in //! tests). //! diff --git a/control-plane/src/bin/replay-responses.rs b/control-plane/src/bin/replay-responses.rs index 1e7d209f..48847192 100644 --- a/control-plane/src/bin/replay-responses.rs +++ b/control-plane/src/bin/replay-responses.rs @@ -1,7 +1,7 @@ use std::{env, fs, process::ExitCode}; use serde::Deserialize; -use strata_control::responses::{ +use leleka_control_plane::responses::{ CreateRequest, OutputItem, ResponseIdentity, ResponseTrace, Usage, }; diff --git a/control-plane/src/cli.rs b/control-plane/src/cli.rs index 6cc0184e..872b9f5a 100644 --- a/control-plane/src/cli.rs +++ b/control-plane/src/cli.rs @@ -1,4 +1,4 @@ -//! Command-line dispatch of `strata-next`: each group of commands owns its own match, in this order. +//! Command-line dispatch of `leleka-api`: each group of commands owns its own match, in this order. mod args; mod kar_inspect; @@ -13,7 +13,7 @@ mod operations; mod report; mod usage; -use strata_control::BoxError; +use leleka_control_plane::BoxError; pub async fn run(args: &[String]) -> Result<(), BoxError> { if operations::run(args).await? diff --git a/control-plane/src/cli/args.rs b/control-plane/src/cli/args.rs index 8934d22e..89f671a7 100644 --- a/control-plane/src/cli/args.rs +++ b/control-plane/src/cli/args.rs @@ -1,6 +1,6 @@ //! Argument matching shared by the command groups of the CLI. -use strata_control::{BoxError, model}; +use leleka_control_plane::{BoxError, model}; /// The outcome of one command of a group; `None` when the arguments are not for it. pub(super) type Outcome = Option>; diff --git a/control-plane/src/cli/kar_inspect.rs b/control-plane/src/cli/kar_inspect.rs index a1798bfe..a49eac3a 100644 --- a/control-plane/src/cli/kar_inspect.rs +++ b/control-plane/src/cli/kar_inspect.rs @@ -2,7 +2,7 @@ use std::path::Path; -use strata_control::{BoxError, kar, kar_memory}; +use leleka_control_plane::{BoxError, kar, kar_memory}; use super::args::{Outcome, flags, model_action}; diff --git a/control-plane/src/cli/kar_overlay.rs b/control-plane/src/cli/kar_overlay.rs index 84104136..6f855343 100644 --- a/control-plane/src/cli/kar_overlay.rs +++ b/control-plane/src/cli/kar_overlay.rs @@ -2,7 +2,7 @@ use std::path::Path; -use strata_control::{BoxError, kar_overlay, model}; +use leleka_control_plane::{BoxError, kar_overlay, model}; use super::args::{Outcome, flags, model_action}; diff --git a/control-plane/src/cli/kar_verify.rs b/control-plane/src/cli/kar_verify.rs index 332d87e5..c5a14aca 100644 --- a/control-plane/src/cli/kar_verify.rs +++ b/control-plane/src/cli/kar_verify.rs @@ -2,7 +2,7 @@ use std::path::Path; -use strata_control::{BoxError, kar, kar_quality, model, prepare_preview}; +use leleka_control_plane::{BoxError, kar, kar_quality, model, prepare_preview}; use super::args::{Outcome, flags, model_action}; diff --git a/control-plane/src/cli/model_ensure.rs b/control-plane/src/cli/model_ensure.rs index 24b531df..2103a538 100644 --- a/control-plane/src/cli/model_ensure.rs +++ b/control-plane/src/cli/model_ensure.rs @@ -2,12 +2,12 @@ use std::path::Path; -use strata_control::{BoxError, kar, model, model_pipeline}; +use leleka_control_plane::{BoxError, kar, model, model_pipeline}; use super::args::{Outcome, flags, model_action, sharded_source_bytes}; use super::report::print_top_tensor_distortions; -type Preview = strata_control::prepare_preview::PreviewSummary; +type Preview = leleka_control_plane::prepare_preview::PreviewSummary; const NOT_ELIGIBLE: &str = "not eligible for serving without a full-model quality gate"; diff --git a/control-plane/src/cli/model_fetch.rs b/control-plane/src/cli/model_fetch.rs index 9a3e2032..bd24b44a 100644 --- a/control-plane/src/cli/model_fetch.rs +++ b/control-plane/src/cli/model_fetch.rs @@ -2,7 +2,7 @@ use std::path::Path; -use strata_control::{BoxError, kar_fixture, model}; +use leleka_control_plane::{BoxError, kar_fixture, model}; use super::args::{Outcome, flags, model_action}; @@ -55,8 +55,8 @@ async fn manifest_commands(action: &str, rest: &[String]) -> Outcome { /// The options after `--output` of `prepare-native-pack`. fn native_pack_options( options: &[String], -) -> Result { - let mut pack = strata_control::native_pack::Options::default(); +) -> Result { + let mut pack = leleka_control_plane::native_pack::Options::default(); let mut options = options.iter(); while let Some(flag) = options.next() { match flag.as_str() { @@ -82,11 +82,11 @@ async fn prepare_native_pack( output: &str, options: &[String], ) -> Result<(), BoxError> { - let manifest = strata_control::model::Manifest::from_spec(spec).await?; + let manifest = leleka_control_plane::model::Manifest::from_spec(spec).await?; let pack = native_pack_options(options)?; println!( "{}", - strata_control::native_pack::prepare_with( + leleka_control_plane::native_pack::prepare_with( &manifest, Path::new(source), Path::new(output), @@ -99,7 +99,7 @@ async fn prepare_native_pack( fn export_tensor_f32(source: &str, tensor: &str, output: &str) -> Result<(), BoxError> { let report = - strata_control::tensor_export::export(Path::new(source), tensor, Path::new(output))?; + leleka_control_plane::tensor_export::export(Path::new(source), tensor, Path::new(output))?; println!("{}", serde_json::to_string(&report)?); Ok(()) } diff --git a/control-plane/src/cli/model_inspect.rs b/control-plane/src/cli/model_inspect.rs index 3f1a11ab..566e53e1 100644 --- a/control-plane/src/cli/model_inspect.rs +++ b/control-plane/src/cli/model_inspect.rs @@ -3,7 +3,7 @@ use std::path::Path; use serde_json::{Value, json}; -use strata_control::{BoxError, derived_iq3, derived_mixed, gguf, model}; +use leleka_control_plane::{BoxError, derived_iq3, derived_mixed, gguf, model}; use super::args::{Outcome, flags, model_action}; @@ -49,7 +49,7 @@ async fn identity_commands(action: &str, rest: &[String]) -> Outcome { fn inspect_metadata(path: &str) -> Result<(), BoxError> { // Every key/value as one JSON object; non-finite floats are the strings "nan", "inf", "-inf". let entries = gguf::metadata_entries(Path::new(path))?; - println!("{}", strata_control::gguf_json::metadata_json(entries)); + println!("{}", leleka_control_plane::gguf_json::metadata_json(entries)); Ok(()) } @@ -75,7 +75,7 @@ fn inspect(path: &str) -> Result<(), BoxError> { fn derive_iq3_identity(path: &str) -> Result<(), BoxError> { let identity = derived_iq3::fingerprint(Path::new(path))?; let document = json!({ - "derivation": "strata-next/iq3_s-to-f32-le-v1", + "derivation": "leleka-api/iq3_s-to-f32-le-v1", "gguf_sha256": hex::encode(identity.gguf_sha256), "derived_f32_sha256": hex::encode(identity.derived_sha256), "derived_f32_bytes": identity.derived_bytes, @@ -106,7 +106,7 @@ fn mixed_tensor_json(tensor: &derived_mixed::TensorIdentity) -> Value { fn derive_mixed_identity(path: &str) -> Result<(), BoxError> { let identity = derived_mixed::fingerprint(Path::new(path))?; let document = json!({ - "derivation": "strata-next/gguf-mixed-to-f32-le-v1", + "derivation": "leleka-api/gguf-mixed-to-f32-le-v1", "gguf_sha256": hex::encode(identity.gguf_sha256), "derived_f32_sha256": hex::encode(identity.derived_sha256), "derived_f32_bytes": identity.derived_bytes, @@ -120,7 +120,7 @@ async fn derive_sharded_identity(manifest_spec: &str, source_dir: &str) -> Resul let manifest = model::Manifest::from_spec(manifest_spec).await?; let identity = derived_mixed::fingerprint_shards(&manifest, Path::new(source_dir))?; let document = json!({ - "derivation": "strata-next/gguf-shards-to-f32-le-v1", + "derivation": "leleka-api/gguf-shards-to-f32-le-v1", "derived_f32_sha256": hex::encode(identity.derived_sha256), "derived_f32_bytes": identity.derived_bytes, "shards": identity.shards.iter().map(|shard| json!({ diff --git a/control-plane/src/cli/model_prepare.rs b/control-plane/src/cli/model_prepare.rs index 88a8120a..67780928 100644 --- a/control-plane/src/cli/model_prepare.rs +++ b/control-plane/src/cli/model_prepare.rs @@ -2,7 +2,7 @@ use std::path::Path; -use strata_control::{BoxError, model, prepare_preview}; +use leleka_control_plane::{BoxError, model, prepare_preview}; use super::args::{Outcome, flags, model_action, sharded_source_bytes}; use super::report::print_top_tensor_distortions; diff --git a/control-plane/src/cli/model_text.rs b/control-plane/src/cli/model_text.rs index 5f6186a5..6e130988 100644 --- a/control-plane/src/cli/model_text.rs +++ b/control-plane/src/cli/model_text.rs @@ -2,8 +2,8 @@ use std::{io::Read, path::Path}; -use strata_control::prompt::{ChatInput, Json, pinned}; -use strata_control::{BoxError, tokenizer, tokenizer_assets}; +use leleka_control_plane::prompt::{ChatInput, Json, pinned}; +use leleka_control_plane::{BoxError, tokenizer, tokenizer_assets}; use super::args::{Outcome, flags, model_action}; diff --git a/control-plane/src/cli/operations.rs b/control-plane/src/cli/operations.rs index 7ed751d8..8829829a 100644 --- a/control-plane/src/cli/operations.rs +++ b/control-plane/src/cli/operations.rs @@ -3,12 +3,12 @@ use std::{env, path::Path}; -use strata_control::{BoxError, config::Config, doctor}; +use leleka_control_plane::{BoxError, config::Config, doctor}; use super::args::{Outcome, flags}; const SERVICE_UNIT_USAGE: &str = concat!( - "usage: strata-next service-unit --config ABSOLUTE_FILE --working-dir ABSOLUTE_DIR ", + "usage: leleka-api service-unit --config ABSOLUTE_FILE --working-dir ABSOLUTE_DIR ", "[--env-file ABSOLUTE_FILE]" ); @@ -46,7 +46,7 @@ async fn tools_commands(command: &str, rest: &[String]) -> Outcome { } async fn mtp_fetch(args: &[String]) -> Result<(), BoxError> { - let code = strata_control::mtp_fetch::cli(args).await?; + let code = leleka_control_plane::mtp_fetch::cli(args).await?; if code != 0 { std::process::exit(code); } @@ -59,7 +59,7 @@ fn offline_tools(args: &[String]) -> Result<(), BoxError> { } fn api_key(args: &[String]) -> Result<(), BoxError> { - println!("{}", strata_control::key_init::run(args)?); + println!("{}", leleka_control_plane::key_init::run(args)?); Ok(()) } @@ -111,7 +111,7 @@ async fn provision(path: &str) -> Result<(), BoxError> { } fn check_config(config: Option<&Path>) -> Result<(), BoxError> { - println!("{}", strata_control::preflight::check(config)?); + println!("{}", leleka_control_plane::preflight::check(config)?); Ok(()) } @@ -127,7 +127,7 @@ async fn serve_commands(command: &str, rest: &[String]) -> Outcome { } async fn wait_ready(args: &[String]) -> Result<(), BoxError> { - println!("{}", strata_control::wait_ready::run(args).await?); + println!("{}", leleka_control_plane::wait_ready::run(args).await?); Ok(()) } @@ -142,17 +142,17 @@ async fn service_commands(command: &str, rest: &[String]) -> Outcome { } async fn service_switch(args: &[String]) -> Result<(), BoxError> { - println!("{}", strata_control::service_switch::run(args).await?); + println!("{}", leleka_control_plane::service_switch::run(args).await?); Ok(()) } async fn service_control(args: &[String]) -> Result<(), BoxError> { - println!("{}", strata_control::service_install::control(args).await?); + println!("{}", leleka_control_plane::service_install::control(args).await?); Ok(()) } async fn service_install(args: &[String]) -> Result<(), BoxError> { - println!("{}", strata_control::service_install::run(args).await?); + println!("{}", leleka_control_plane::service_install::run(args).await?); Ok(()) } @@ -187,7 +187,7 @@ fn service_unit(rest: &[String]) -> Result<(), BoxError> { let (config, working_dir, env_file) = service_unit_arguments(rest)?; print!( "{}", - strata_control::service_unit::render( + leleka_control_plane::service_unit::render( &env::current_exe()?, Path::new(config), Path::new(working_dir), @@ -200,7 +200,7 @@ fn service_unit(rest: &[String]) -> Result<(), BoxError> { async fn info_commands(command: &str, rest: &[String]) -> Outcome { match (command, rest) { ("engine-info", []) => Some(engine_info()), - ("engine-help", []) => Some(strata_control::embedded_engine::help()), + ("engine-help", []) => Some(leleka_control_plane::embedded_engine::help()), ("--engine-license", []) => Some(engine_license()), ("doctor", []) => Some(doctor::report().await), ("--version" | "-V", []) => Some(version()), @@ -210,7 +210,7 @@ async fn info_commands(command: &str, rest: &[String]) -> Outcome { } fn engine_info() -> Result<(), BoxError> { - println!("{}", strata_control::embedded_engine::info()); + println!("{}", leleka_control_plane::embedded_engine::info()); Ok(()) } @@ -220,7 +220,7 @@ fn engine_license() -> Result<(), BoxError> { } fn version() -> Result<(), BoxError> { - println!("strata-next {}", env!("CARGO_PKG_VERSION")); + println!("leleka-api {}", env!("CARGO_PKG_VERSION")); Ok(()) } diff --git a/control-plane/src/cli/report.rs b/control-plane/src/cli/report.rs index 80bc3c6a..4117852b 100644 --- a/control-plane/src/cli/report.rs +++ b/control-plane/src/cli/report.rs @@ -1,6 +1,6 @@ //! Output shared by the KAR preparation commands. -use strata_control::prepare_preview; +use leleka_control_plane::prepare_preview; pub(super) fn print_top_tensor_distortions(distortions: &[prepare_preview::TensorDistortion]) { let mut ranked = distortions.iter().collect::>(); diff --git a/control-plane/src/cli/usage.rs b/control-plane/src/cli/usage.rs index bc24ef96..52b3627e 100644 --- a/control-plane/src/cli/usage.rs +++ b/control-plane/src/cli/usage.rs @@ -1,14 +1,14 @@ //! The text printed for an unknown command line. -pub const USAGE: &str = "usage: strata-next [service-switch --catalog FILE [--from ID] --to ID --state-dir \ +pub const USAGE: &str = "usage: leleka-api [service-switch --catalog FILE [--from ID] --to ID --state-dir \ ABSOLUTE_DIR|service-switch reconcile --catalog FILE --state-dir DIR --expected-journal-sha SHA256|api-key init \ --file ABSOLUTE_PATH|serve [--config FILE]|provision --config FILE [--defer-memory-check]|check-config [--config \ FILE]|wait-ready --url LOOPBACK_ORIGIN --model ID [--key-file FILE] [--timeout-s N]|service-control \ status|start|stop|restart|enable|disable|start-ready|restart-ready|drain-stop|resume --config ABSOLUTE_FILE \ - --working-dir ABSOLUTE_DIR [--env-file ABSOLUTE_FILE] [--unit strata-next[-NAME].service] [--ready-url \ + --working-dir ABSOLUTE_DIR [--env-file ABSOLUTE_FILE] [--unit leleka-api[-NAME].service] [--ready-url \ LOOPBACK_ORIGIN --ready-model ID [--ready-key-file FILE] [--ready-timeout-s N]]|service-unit --config \ ABSOLUTE_FILE --working-dir ABSOLUTE_DIR [--env-file ABSOLUTE_FILE]|service-install --config ABSOLUTE_FILE \ - --working-dir ABSOLUTE_DIR [--env-file ABSOLUTE_FILE] [--unit strata-next[-NAME].service] [--enable] \ + --working-dir ABSOLUTE_DIR [--env-file ABSOLUTE_FILE] [--unit leleka-api[-NAME].service] [--enable] \ [--start|--start-ready --ready-url ORIGIN --ready-model ID [--ready-key-file FILE] [--ready-timeout-s \ N]]|doctor|engine-info|engine-help|--ggml-license|model prepare-native-pack MANIFEST --source-dir DIR --output DIR \ [--compat-bf16] [--experts-bin] [--base BASE_PACK_DIR]|model smoke-fixture --output FILE.kar|model fetch MANIFEST \ diff --git a/control-plane/src/derived_mixed.rs b/control-plane/src/derived_mixed.rs index f3f92a93..f89d3db0 100644 --- a/control-plane/src/derived_mixed.rs +++ b/control-plane/src/derived_mixed.rs @@ -39,7 +39,7 @@ pub struct ShardedIdentity { pub tensors: Vec, } -/// `strata-next/gguf-mixed-to-f32-le-v1`: concatenate tensor values in GGUF +/// `leleka-api/gguf-mixed-to-f32-le-v1`: concatenate tensor values in GGUF /// directory order, each converted to little-endian IEEE F32. Preserve F32 /// source bits; expand F16 and BF16 with the Rust conversion below; dequantize /// IQ3_S with the pinned ggml grid. Do not include header or alignment bytes. diff --git a/control-plane/src/env_settings.rs b/control-plane/src/env_settings.rs index 1d5ff133..0a9b51ad 100644 --- a/control-plane/src/env_settings.rs +++ b/control-plane/src/env_settings.rs @@ -1,4 +1,4 @@ -//! The only place `strata-control` reads the process environment, and what each variable is parsed into. +//! The only place `leleka-control-plane` reads the process environment, and what each variable is parsed into. //! //! One reader means the operator's surface is one list and a test can see where the environment enters. The readers //! are live (each call asks the process, nothing is snapshotted at start), which keeps the order of the checks and diff --git a/control-plane/src/kar/tests.rs b/control-plane/src/kar/tests.rs index 6867ab46..4f8ebc2d 100644 --- a/control-plane/src/kar/tests.rs +++ b/control-plane/src/kar/tests.rs @@ -208,7 +208,7 @@ fn range_source() -> kar_writer::SourceIdentity<'static> { kar_writer::SourceIdentity { name: "range-fixture", architecture: "synthetic", - builder: "strata-next/kar-range-test", + builder: "leleka-api/kar-range-test", digest: Sha256::digest(b"source").into(), total_elements: 96, bytes: 384, diff --git a/control-plane/src/kar_codec.rs b/control-plane/src/kar_codec.rs index 8a51e080..bc200b76 100644 --- a/control-plane/src/kar_codec.rs +++ b/control-plane/src/kar_codec.rs @@ -69,7 +69,7 @@ mod tests { let source = kar_writer::SourceIdentity { name: "synthetic", architecture: "qwen35", - builder: "strata-next-experimental", + builder: "leleka-api-experimental", digest: Sha256::digest(b"source").into(), total_elements: 32, bytes: 6, diff --git a/control-plane/src/kar_fixture.rs b/control-plane/src/kar_fixture.rs index 3c31e6ec..58dd606e 100644 --- a/control-plane/src/kar_fixture.rs +++ b/control-plane/src/kar_fixture.rs @@ -101,8 +101,8 @@ fn ple_part<'a>( fn ple_source<'a>(weights: &[f32], raw: &[u8]) -> kar_writer::SourceIdentity<'a> { identity( - "strata-next-ple-smoke-f32", - "strata-next/ple-smoke-topdown-g32-l2-v1", + "leleka-api-ple-smoke-f32", + "leleka-api/ple-smoke-topdown-g32-l2-v1", weights, raw, ) @@ -156,8 +156,8 @@ pub fn write(destination: &Path) -> Result { let planes = plane_slices(&encoded.planes); let raw = raw_bytes(&weights); let source = identity( - "strata-next-smoke-f32", - "strata-next/smoke-topdown-g32-l2-v1", + "leleka-api-smoke-f32", + "leleka-api/smoke-topdown-g32-l2-v1", &weights, &raw, ); diff --git a/control-plane/src/kar_memory.rs b/control-plane/src/kar_memory.rs index 5d2340ce..69572933 100644 --- a/control-plane/src/kar_memory.rs +++ b/control-plane/src/kar_memory.rs @@ -294,7 +294,7 @@ fn selected_report( let selected_bytes = totals.selected_bytes()?; let all_plus_scratch = totals.all_plus_scratch(selected_bytes)?; Ok(SelectedReport { - schema: "strata-next/selected-kar-gpu-memory-plan-v1", + schema: "leleka-api/selected-kar-gpu-memory-plan-v1", base_archive_sha256: selection.base_archive_sha256, overlay_archive_sha256: selection.overlay_archive_sha256, base_level: sources.base_level, overlay_level: sources.overlay_level, budget_bytes, record_count: selection.records.len(), replacement_count: selection.replacement_count, @@ -347,7 +347,7 @@ pub fn plan(path: &Path, level: u8, budget_bytes: u64) -> Result .checked_add(totals.tally.scratch_max) .ok_or("KAR all-resident GPU peak overflow")?; Ok(Report { - schema: "strata-next/kar-gpu-memory-plan-v1", + schema: "leleka-api/kar-gpu-memory-plan-v1", level, budget_bytes, record_count: summary.tensor_count as usize, diff --git a/control-plane/src/kar_overlay/base_provenance.rs b/control-plane/src/kar_overlay/base_provenance.rs index 5c2b1b8b..cb439c50 100644 --- a/control-plane/src/kar_overlay/base_provenance.rs +++ b/control-plane/src/kar_overlay/base_provenance.rs @@ -8,8 +8,8 @@ use super::{ impl BaseProvenance { pub(super) fn supported_partition_policy(&self) -> bool { match (self.schema.as_str(), self.ple_part_elements) { - ("strata-next/sharded-stream-provenance-v4", None) => true, - ("strata-next/sharded-stream-provenance-v5", Some(limit)) => { + ("leleka-api/sharded-stream-provenance-v4", None) => true, + ("leleka-api/sharded-stream-provenance-v5", Some(limit)) => { (32..=crate::kar_shard_plan::MAX_PART_ELEMENTS).contains(&limit) && self .partitioned_tensors diff --git a/control-plane/src/kar_overlay/compare.rs b/control-plane/src/kar_overlay/compare.rs index 9c8df21c..63fb73d3 100644 --- a/control-plane/src/kar_overlay/compare.rs +++ b/control-plane/src/kar_overlay/compare.rs @@ -33,7 +33,7 @@ pub fn compare( }; let records = comparer.compare_all(&overlay_sources)?; Ok(Comparison { - schema: "strata-next/kar-overlay-comparison-v1", + schema: "leleka-api/kar-overlay-comparison-v1", base_archive_sha256: base.archive_sha256.clone(), overlay_archive_sha256: overlay.overlay_archive_sha256.clone(), verification: "prior-full-base-verification-assumed; selected-source-digests-and-overlay-verified-now", @@ -56,7 +56,7 @@ fn check_provenance( overlay_archive: &Path, ) -> Result<(), String> { if !base.supported_partition_policy() - || overlay.schema != "strata-next/kar-overlay-provenance-v1" + || overlay.schema != "leleka-api/kar-overlay-provenance-v1" || overlay.base_archive_sha256 != base.archive_sha256 || overlay.levels < 2 || overlay.records.is_empty() diff --git a/control-plane/src/kar_overlay/encode_overlay.rs b/control-plane/src/kar_overlay/encode_overlay.rs index e6c1e993..9c283696 100644 --- a/control-plane/src/kar_overlay/encode_overlay.rs +++ b/control-plane/src/kar_overlay/encode_overlay.rs @@ -174,7 +174,7 @@ impl OverlayIdentity<'_> { ) -> Result { let tensors = overlay_tensors(prepared, self.levels); let builder = format!( - "strata-next/experimental-kar-overlay-v1:l{}:base{}:policy{}", + "leleka-api/experimental-kar-overlay-v1:l{}:base{}:policy{}", self.levels, &self.base.archive_sha256[..16], &hex::encode(self.candidate_sha256)[..16] @@ -244,7 +244,7 @@ struct OverlayHashes { fn provenance_json(hashes: &OverlayHashes, levels: u8, prepared: &[Prepared]) -> serde_json::Value { serde_json::json!({ - "schema": "strata-next/kar-overlay-provenance-v1", + "schema": "leleka-api/kar-overlay-provenance-v1", "base_archive_sha256": hex::encode(hashes.base), "candidate_policy_sha256": hex::encode(hashes.candidate), "overlay_archive_sha256": hex::encode(hashes.overlay), diff --git a/control-plane/src/kar_overlay/prepare.rs b/control-plane/src/kar_overlay/prepare.rs index d448c510..f53da1d2 100644 --- a/control-plane/src/kar_overlay/prepare.rs +++ b/control-plane/src/kar_overlay/prepare.rs @@ -68,7 +68,7 @@ fn read_candidates(candidate_path: &Path) -> Result<(Vec, Candidates), Strin let bytes = fs::read(candidate_path).map_err(|error| error.to_string())?; let candidates: Candidates = serde_json::from_slice(&bytes).map_err(|error| error.to_string())?; - if candidates.schema != "strata-next/proposed-kar-precision-candidates-v1" + if candidates.schema != "leleka-api/proposed-kar-precision-candidates-v1" || !(1..=8).contains(&candidates.proposed_levels) || candidates.records.is_empty() { diff --git a/control-plane/src/kar_overlay/verified_source_resolution.rs b/control-plane/src/kar_overlay/verified_source_resolution.rs index dd3aaa17..6751b02f 100644 --- a/control-plane/src/kar_overlay/verified_source_resolution.rs +++ b/control-plane/src/kar_overlay/verified_source_resolution.rs @@ -21,7 +21,7 @@ pub fn resolve_verified(base_archive: &Path, overlay_archive: &Path) -> Result bool { !base.supported_partition_policy() - || overlay.schema != "strata-next/kar-overlay-provenance-v1" + || overlay.schema != "leleka-api/kar-overlay-provenance-v1" || overlay.base_archive_sha256 != base.archive_sha256 || overlay.levels < 2 || overlay.levels > 8 diff --git a/control-plane/src/kar_quality/previous.rs b/control-plane/src/kar_quality/previous.rs index e72a5f1c..7b7ab68b 100644 --- a/control-plane/src/kar_quality/previous.rs +++ b/control-plane/src/kar_quality/previous.rs @@ -67,7 +67,7 @@ pub(super) fn read_provenance(archive_path: &Path) -> Result } pub(super) fn check_header(provenance: &Provenance, levels: u8) -> Result<(), String> { - if provenance.schema != "strata-next/sharded-stream-provenance-v4" + if provenance.schema != "leleka-api/sharded-stream-provenance-v4" || provenance.levels != levels || !(1..=8).contains(&levels) { diff --git a/control-plane/src/kar_quality/sample_records.rs b/control-plane/src/kar_quality/sample_records.rs index 028b81e5..40fabe7a 100644 --- a/control-plane/src/kar_quality/sample_records.rs +++ b/control-plane/src/kar_quality/sample_records.rs @@ -61,7 +61,7 @@ pub(super) fn sample_records( ) -> Result { let records = sample_all(source, &mut decoder, levels)?; Ok(Report { - schema: "strata-next/kar-sampled-distortion-v1", + schema: "leleka-api/kar-sampled-distortion-v1", archive_sha256, derived_f32_sha256: hex::encode(source.identity.derived_sha256), levels, diff --git a/control-plane/src/kar_writer/tests.rs b/control-plane/src/kar_writer/tests.rs index 3e435f7d..f85ba915 100644 --- a/control-plane/src/kar_writer/tests.rs +++ b/control-plane/src/kar_writer/tests.rs @@ -171,7 +171,7 @@ fn assert_corruptions_rejected(spool: &Spool<'_>, section: &[u8], digest: [u8; 3 fn nested_source() -> SourceIdentity<'static> { let digest = Sha256::digest(b"source").into(); - identity("nested-fixture", "strata-next-test", digest, 32, 6) + identity("nested-fixture", "leleka-api-test", digest, 32, 6) } #[test] @@ -205,7 +205,7 @@ fn streams_raw_tensor_across_buffer_boundary() { let digest: [u8; 32] = Sha256::digest(&raw).into(); let source = identity( "large-synthetic", - "strata-next-test", + "leleka-api-test", digest, 262_145, raw.len(), diff --git a/control-plane/src/key_init.rs b/control-plane/src/key_init.rs index 0cd45912..c108c7b0 100644 --- a/control-plane/src/key_init.rs +++ b/control-plane/src/key_init.rs @@ -1,7 +1,7 @@ //! Explicit Linux credential provisioning. Never return the secret or rotate a key. use std::path::Path; -const USAGE: &str = "usage: strata-next api-key init --file ABSOLUTE_PATH"; +const USAGE: &str = "usage: leleka-api api-key init --file ABSOLUTE_PATH"; fn parse(args: &[String]) -> Result<&Path, String> { let [action, flag, file] = args else { diff --git a/control-plane/src/main.rs b/control-plane/src/main.rs index 7f50e66e..abc8b2ae 100644 --- a/control-plane/src/main.rs +++ b/control-plane/src/main.rs @@ -2,7 +2,7 @@ mod cli; mod serve; #[tokio::main] -async fn main() -> Result<(), strata_control::BoxError> { +async fn main() -> Result<(), leleka_control_plane::BoxError> { let args: Vec = std::env::args().skip(1).collect(); cli::run(&args).await } diff --git a/control-plane/src/mtp_fetch/command_line.rs b/control-plane/src/mtp_fetch/command_line.rs index 24f7de90..fd022ba6 100644 --- a/control-plane/src/mtp_fetch/command_line.rs +++ b/control-plane/src/mtp_fetch/command_line.rs @@ -19,7 +19,7 @@ pub(super) fn mtime_ns(metadata: &fs::Metadata) -> i128 { .map_or(0, |d| d.as_nanos() as i128) } -/// `strata-next tools mtp-fetch inventory|fetch|verify --out DIR [--only SUBSTR] [--repo URL] [--sha256-file FILE]`. +/// `leleka-api tools mtp-fetch inventory|fetch|verify --out DIR [--only SUBSTR] [--repo URL] [--sha256-file FILE]`. /// `--repo` points both the read and the pinned revision at a local mirror and `--sha256-file` (a JSON object of /// name -> hex) replaces the pinned table; both exist for mirrors and for the differential harness. Returns the /// process exit code. diff --git a/control-plane/src/native_pack/dense_files.rs b/control-plane/src/native_pack/dense_files.rs index e8252e06..b737818b 100644 --- a/control-plane/src/native_pack/dense_files.rs +++ b/control-plane/src/native_pack/dense_files.rs @@ -214,7 +214,7 @@ fn conversions_value(shards: &[Shard], records: &[Record], options: &Options) -> "source_sha256":r.source_sha256}) }) .collect::>(); - json!({"schema":1,"tool":"strata-next","compat_bf16":options.compat_bf16, + json!({"schema":1,"tool":"leleka-api","compat_bf16":options.compat_bf16, "source_shards":sources,"tensors":tensors}) } @@ -227,7 +227,7 @@ pub(super) fn write_index( let source = shards[0].path.file_name().unwrap().to_str().unwrap(); let text = format!( concat!( - "# strata pack index v3 -- generated by strata-next (native experts) from {}\n", + "# strata pack index v3 -- generated by leleka-api (native experts) from {}\n", "# align 64 pool {} tensors {}\n{}" ), source, diff --git a/control-plane/src/native_pack/pack_outputs.rs b/control-plane/src/native_pack/pack_outputs.rs index 66d8818a..ba5c30b0 100644 --- a/control-plane/src/native_pack/pack_outputs.rs +++ b/control-plane/src/native_pack/pack_outputs.rs @@ -187,7 +187,7 @@ fn write_base_outputs(output: &Path, base: &Path, extra: &[Vec]) -> Result<( } write_conversions( output, - &json!({"schema":1,"tool":"strata-next","compat_bf16":false, + &json!({"schema":1,"tool":"leleka-api","compat_bf16":false, "base":base.to_str().unwrap_or_default(),"tensors":[]}), ) } diff --git a/control-plane/src/prepare_preview/derived_verification.rs b/control-plane/src/prepare_preview/derived_verification.rs index 3c4e4eb8..96d162d3 100644 --- a/control-plane/src/prepare_preview/derived_verification.rs +++ b/control-plane/src/prepare_preview/derived_verification.rs @@ -137,8 +137,8 @@ pub(super) fn provenance_value( fn iq3_provenance(identity: &derived_iq3::Identity, archive_digest: [u8; 32]) -> serde_json::Value { serde_json::json!({ - "schema": "strata-next/iq3-preview-provenance-v1", - "derivation": "strata-next/iq3_s-to-f32-le-v1", + "schema": "leleka-api/iq3-preview-provenance-v1", + "derivation": "leleka-api/iq3_s-to-f32-le-v1", "original_gguf_sha256": hex::encode(identity.gguf_sha256), "derived_f32_sha256": hex::encode(identity.derived_sha256), "derived_f32_bytes": identity.derived_bytes, @@ -158,8 +158,8 @@ fn mixed_provenance( archive_digest: [u8; 32], ) -> serde_json::Value { serde_json::json!({ - "schema": "strata-next/mixed-preview-provenance-v1", - "derivation": "strata-next/gguf-mixed-to-f32-le-v1", + "schema": "leleka-api/mixed-preview-provenance-v1", + "derivation": "leleka-api/gguf-mixed-to-f32-le-v1", "original_gguf_sha256": hex::encode(identity.gguf_sha256), "derived_f32_sha256": hex::encode(identity.derived_sha256), "derived_f32_bytes": identity.derived_bytes, @@ -180,8 +180,8 @@ pub(super) fn sharded_provenance_value( archive_digest: [u8; 32], ) -> serde_json::Value { serde_json::json!({ - "schema": "strata-next/sharded-preview-provenance-v1", - "derivation": "strata-next/gguf-shards-to-f32-le-v1", + "schema": "leleka-api/sharded-preview-provenance-v1", + "derivation": "leleka-api/gguf-shards-to-f32-le-v1", "derived_f32_sha256": hex::encode(identity.derived_sha256), "derived_f32_bytes": identity.derived_bytes, "archive_sha256": hex::encode(archive_digest), diff --git a/control-plane/src/prepare_preview/prepare_sharded.rs b/control-plane/src/prepare_preview/prepare_sharded.rs index 527688db..47f52183 100644 --- a/control-plane/src/prepare_preview/prepare_sharded.rs +++ b/control-plane/src/prepare_preview/prepare_sharded.rs @@ -42,7 +42,7 @@ fn require_sharded_tensor_count(identity: &derived_mixed::ShardedIdentity) -> Re } fn sharded_builder(levels: u8) -> String { - format!("strata-next/experimental-sharded-derived-f32-topdown-v1:g32:l{levels}:sample-all") + format!("leleka-api/experimental-sharded-derived-f32-topdown-v1:g32:l{levels}:sample-all") } fn write_sharded_preview( diff --git a/control-plane/src/prepare_preview/prepare_single_file.rs b/control-plane/src/prepare_preview/prepare_single_file.rs index e7cfb41a..963ffdfb 100644 --- a/control-plane/src/prepare_preview/prepare_single_file.rs +++ b/control-plane/src/prepare_preview/prepare_single_file.rs @@ -268,7 +268,7 @@ impl PreviewPlan { fn builder(&self) -> String { format!( - "strata-next/experimental-{}-topdown-v1:g32:l{}:sample-all", + "leleka-api/experimental-{}-topdown-v1:g32:l{}:sample-all", builder_label(self.kind), self.levels ) diff --git a/control-plane/src/prepare_preview/preview_tensor_io.rs b/control-plane/src/prepare_preview/preview_tensor_io.rs index 83a21c0d..8666af85 100644 --- a/control-plane/src/prepare_preview/preview_tensor_io.rs +++ b/control-plane/src/prepare_preview/preview_tensor_io.rs @@ -169,11 +169,11 @@ pub(super) fn apply_stream_policy( ple_part_elements: Option, ) { value["schema"] = serde_json::json!(if ple_part_elements.is_some() { - "strata-next/sharded-stream-provenance-v5" + "leleka-api/sharded-stream-provenance-v5" } else { - "strata-next/sharded-stream-provenance-v4" + "leleka-api/sharded-stream-provenance-v4" }); - value["derivation"] = serde_json::json!("strata-next/gguf-shards-to-f32-le-v4:ggml-3cf03257"); + value["derivation"] = serde_json::json!("leleka-api/gguf-shards-to-f32-le-v4:ggml-3cf03257"); value["levels"] = serde_json::json!(levels); value["sampling"] = serde_json::json!("digest-seeded-65536-normalized-v1"); value["partitioned_tensors"] = partitioned_provenance(parts); diff --git a/control-plane/src/prepare_preview/streamed_sharded_prepare.rs b/control-plane/src/prepare_preview/streamed_sharded_prepare.rs index cf047915..d0cf3f83 100644 --- a/control-plane/src/prepare_preview/streamed_sharded_prepare.rs +++ b/control-plane/src/prepare_preview/streamed_sharded_prepare.rs @@ -113,10 +113,10 @@ fn streamed_tensors(prepared: &[StreamedTensor], levels: u8) -> Vec) -> String { if let Some(limit) = ple_part_elements { format!( - "strata-next/experimental-sharded-stream-v5:g32:l{levels}:sample65536:plepart{limit}" + "leleka-api/experimental-sharded-stream-v5:g32:l{levels}:sample65536:plepart{limit}" ) } else { - format!("strata-next/experimental-sharded-stream-v4:g32:l{levels}:sample65536") + format!("leleka-api/experimental-sharded-stream-v4:g32:l{levels}:sample65536") } } diff --git a/control-plane/src/prepare_preview/tests/overlay.rs b/control-plane/src/prepare_preview/tests/overlay.rs index 3a193472..1c32405e 100644 --- a/control-plane/src/prepare_preview/tests/overlay.rs +++ b/control-plane/src/prepare_preview/tests/overlay.rs @@ -63,7 +63,7 @@ fn write_overlay_policy(directory: &Path, archive_digest: [u8; 32]) -> PathBuf { fs::write( &policy, serde_json::to_vec(&serde_json::json!({ - "schema": "strata-next/proposed-kar-precision-candidates-v1", + "schema": "leleka-api/proposed-kar-precision-candidates-v1", "source_archive_sha256": hex::encode(archive_digest), "proposed_levels": 3, "records": [{"name": "dense", "elements": 256}], diff --git a/control-plane/src/prepare_preview/tests/ple_partition.rs b/control-plane/src/prepare_preview/tests/ple_partition.rs index 494c8f27..6d97b22d 100644 --- a/control-plane/src/prepare_preview/tests/ple_partition.rs +++ b/control-plane/src/prepare_preview/tests/ple_partition.rs @@ -66,7 +66,7 @@ fn assert_ple_record(provenance_path: PathBuf) { serde_json::from_slice(&fs::read(provenance_path).unwrap()).unwrap(); assert_eq!( provenance["schema"], - "strata-next/sharded-stream-provenance-v5" + "leleka-api/sharded-stream-provenance-v5" ); assert_eq!(provenance["ple_part_elements"], 128); assert_eq!( @@ -83,7 +83,7 @@ fn write_ple_policy(directory: &Path, archive_digest: [u8; 32]) -> PathBuf { fs::write( &policy, serde_json::to_vec(&serde_json::json!({ - "schema": "strata-next/proposed-kar-precision-candidates-v1", + "schema": "leleka-api/proposed-kar-precision-candidates-v1", "source_archive_sha256": hex::encode(archive_digest), "proposed_levels": 3, "records": [ diff --git a/control-plane/src/prepare_preview/tests/sharded.rs b/control-plane/src/prepare_preview/tests/sharded.rs index ab7a611f..0c99625e 100644 --- a/control-plane/src/prepare_preview/tests/sharded.rs +++ b/control-plane/src/prepare_preview/tests/sharded.rs @@ -43,7 +43,7 @@ fn assert_sharded_record(provenance_path: PathBuf) { serde_json::from_slice(&fs::read(provenance_path).unwrap()).unwrap(); assert_eq!( record["schema"], - "strata-next/sharded-preview-provenance-v1" + "leleka-api/sharded-preview-provenance-v1" ); assert_eq!(record["shards"][0]["name"], "a-f32.gguf"); assert_eq!(record["tensors"][1]["derived_offset"], 128); @@ -95,7 +95,7 @@ fn assert_quality_samples( fn assert_streamed_record(provenance_path: PathBuf) { let record: serde_json::Value = serde_json::from_slice(&fs::read(provenance_path).unwrap()).unwrap(); - assert_eq!(record["schema"], "strata-next/sharded-stream-provenance-v4"); + assert_eq!(record["schema"], "leleka-api/sharded-stream-provenance-v4"); assert_eq!(record["partitioned_tensors"], serde_json::json!([])); assert_eq!(record["levels"], 2); } diff --git a/control-plane/src/prepare_preview/tests/source_kinds.rs b/control-plane/src/prepare_preview/tests/source_kinds.rs index 04d2c946..12edf794 100644 --- a/control-plane/src/prepare_preview/tests/source_kinds.rs +++ b/control-plane/src/prepare_preview/tests/source_kinds.rs @@ -144,7 +144,7 @@ fn prepares_and_verifies_mixed_preview_with_each_source_kind() { assert!(verify_iq3(&source_path, &output).is_err()); let record: serde_json::Value = serde_json::from_slice(&fs::read(&provenance).unwrap()).unwrap(); - assert_eq!(record["schema"], "strata-next/mixed-preview-provenance-v1"); + assert_eq!(record["schema"], "leleka-api/mixed-preview-provenance-v1"); assert_eq!(record["tensors"][0]["source_kind"], 30); assert!(result.maximum_relative_l2.is_finite()); fs::remove_file(provenance).unwrap(); diff --git a/control-plane/src/serve.rs b/control-plane/src/serve.rs index 86d51146..57a647b6 100644 --- a/control-plane/src/serve.rs +++ b/control-plane/src/serve.rs @@ -1,4 +1,4 @@ -//! `strata-next serve`: the composition root. It reads the config, builds the adapters behind the gateway ports +//! `leleka-api serve`: the composition root. It reads the config, builds the adapters behind the gateway ports //! (response history, MCP hub, vision encoder, engine channel, workers) and runs the HTTP server until shutdown. //! //! `serve` is the list of phases in the order they must run. The phases are functions in the children: @@ -8,7 +8,7 @@ use std::path::Path; use tokio::{sync::watch, task::JoinHandle}; -use strata_control::{BoxError, config::Config, responses::ResponseHistory}; +use leleka_control_plane::{BoxError, config::Config, responses::ResponseHistory}; mod engine; mod http; @@ -20,7 +20,7 @@ use state::{ apply_prompt_settings, attach_codec, build_state, start_mcp, start_vision, warn_open_cors, }; -type Vision = strata_control::vision::Vision; +type Vision = leleka_control_plane::vision::Vision; type GrpcBackend = leleka_runtime_client::backend::GrpcBackend; /// The tasks that must end before the process does. @@ -52,10 +52,10 @@ async fn boot( config_path: Option<&Path>, ) -> Result< ( - Option, + Option, Config, tokio::net::TcpListener, - strata_control::app::AppState, + leleka_control_plane::app::AppState, ), BoxError, > { @@ -84,11 +84,11 @@ async fn load_config(config_path: Option<&Path>) -> Result<(Config, ResponseHist /// An `@embedded` worker executable is unpacked; the returned guard keeps it until `serve` ends. fn resolve_embedded_engine( config: &mut Config, -) -> Result, BoxError> { +) -> Result, BoxError> { let Some(worker) = config.worker.as_mut() else { return Ok(None); }; - let embedded = strata_control::embedded_engine::resolve(&worker.executable)?; + let embedded = leleka_control_plane::embedded_engine::resolve(&worker.executable)?; if let Some(engine) = &embedded { worker.executable = engine.executable.clone().into_os_string(); } diff --git a/control-plane/src/serve/engine.rs b/control-plane/src/serve/engine.rs index 07579de9..622eee93 100644 --- a/control-plane/src/serve/engine.rs +++ b/control-plane/src/serve/engine.rs @@ -7,7 +7,7 @@ use tokio::{ task::JoinHandle, }; -use strata_control::{ +use leleka_control_plane::{ BoxError, app, backend_worker::BackendWorkerConfig, config::Config, runtime_config::RuntimeBackend, tokenizer, worker, }; @@ -90,12 +90,12 @@ pub(super) async fn start_runtime_worker( state.engine.control = Some(control_sender); state.engine.worker.write().await.known_max_context = Some(worker_config.max_context); Ok(Some(tokio::spawn( - strata_control::backend_worker::run_backend_worker( + leleka_control_plane::backend_worker::run_backend_worker( Box::new(backend), worker_config, state.engine.worker.clone(), shutdown.clone(), - strata_control::backend_worker::WorkerInbox { + leleka_control_plane::backend_worker::WorkerInbox { requests: receiver, control: control_receiver, }, @@ -157,10 +157,10 @@ pub(super) fn start_pool( shutdown.clone(), received, ))); - members.push(strata_control::pool::Member { requests, status }); + members.push(leleka_control_plane::pool::Member { requests, status }); } - strata_control::elog!("{} workers in a pool", members.len()); - tasks.dispatcher = Some(tokio::spawn(strata_control::pool::dispatch( + leleka_control_plane::elog!("{} workers in a pool", members.len()); + tasks.dispatcher = Some(tokio::spawn(leleka_control_plane::pool::dispatch( receiver, members, ))); } @@ -169,14 +169,14 @@ pub(super) fn start_idle_unload(state: &app::AppState, config: &Config) { let (Some(idle), true) = (config.idle_unload, state.engine.control.is_some()) else { return; }; - strata_control::elog!( + leleka_control_plane::elog!( "the model unloads after {} s without requests", idle.as_secs_f64() ); let poll = Duration::from_secs_f64(leleka_serving_policy::idle::poll_interval_s( idle.as_secs_f64(), )); - tokio::spawn(strata_control::server_api::idle_unload_loop( + tokio::spawn(leleka_control_plane::server_api::idle_unload_loop( state.clone(), idle, poll, diff --git a/control-plane/src/serve/http.rs b/control-plane/src/serve/http.rs index ef90d845..b72c1d91 100644 --- a/control-plane/src/serve/http.rs +++ b/control-plane/src/serve/http.rs @@ -4,7 +4,7 @@ use std::sync::Arc; use tokio::sync::watch; -use strata_control::{BoxError, app, config::Config}; +use leleka_control_plane::{BoxError, app, config::Config}; use super::{Tasks, Vision}; @@ -15,7 +15,7 @@ pub(super) async fn run_http( listener: tokio::net::TcpListener, shutdown_tx: &watch::Sender, ) -> std::io::Result<()> { - strata_control::elog!("strata-control listening on {}", listener.local_addr()?); + leleka_control_plane::elog!("leleka-control-plane listening on {}", listener.local_addr()?); let server_shutdown = shutdown_tx.clone(); let lifecycle = state.lifecycle.clone(); let shutdown_grace = config.shutdown_grace; @@ -29,7 +29,7 @@ pub(super) async fn run_http( shutdown_signal().await; lifecycle.begin_shutdown(); if !shutdown_grace.is_zero() && !lifecycle.wait_drained(shutdown_grace).await { - strata_control::elog!("Shutdown admission grace expired; stopping worker"); + leleka_control_plane::elog!("Shutdown admission grace expired; stopping worker"); } let _ = server_shutdown.send(true); }) @@ -38,7 +38,7 @@ pub(super) async fn run_http( /// Close the MCP hub and the vision encoder, then wait for the worker, pool and runtime tasks. pub(super) async fn stop_services( - hub: Option, + hub: Option, vision: Option>, tasks: Tasks, ) -> Result<(), BoxError> { diff --git a/control-plane/src/serve/state.rs b/control-plane/src/serve/state.rs index 28d1df7e..3cfddaa1 100644 --- a/control-plane/src/serve/state.rs +++ b/control-plane/src/serve/state.rs @@ -3,7 +3,7 @@ use std::sync::Arc; -use strata_control::{ +use leleka_control_plane::{ BoxError, app, config::Config, responses::{HistoryResponseStore, ResponseHistory}, @@ -36,7 +36,7 @@ pub(super) fn services(config: &Config, history: ResponseHistory) -> app::Servic app::Services { responses: HistoryResponseStore::shared(history), settings: Arc::new(build_settings(config)), - monitor: Arc::new(strata_control::request_monitor::RequestMonitor::new( + monitor: Arc::new(leleka_control_plane::request_monitor::RequestMonitor::new( config.api_monitor, )), ..Default::default() @@ -49,7 +49,7 @@ pub(super) fn build_state( history: ResponseHistory, ) -> Result { Ok(app::AppState { - lifecycle: strata_control::lifecycle::Lifecycle::new(config.max_in_flight_requests)?, + lifecycle: leleka_control_plane::lifecycle::Lifecycle::new(config.max_in_flight_requests)?, engine: app::EngineLink { queue_timeout: config.queue_timeout, ..Default::default() @@ -68,7 +68,7 @@ pub(super) fn start_mcp(state: &mut app::AppState, config: &mut Config) { if config.mcp_servers.is_empty() { return; } - let hub = Arc::new(strata_control::mcp::Hub::new( + let hub = Arc::new(leleka_control_plane::mcp::Hub::new( std::mem::take(&mut config.mcp_servers), config.mcp_settings.clone(), )); @@ -79,7 +79,7 @@ pub(super) fn start_mcp(state: &mut app::AppState, config: &mut Config) { pub(super) fn warn_open_cors(config: &Config) { if config.cors_origins.iter().any(|o| o == "*") && config.api_key.is_none() { - strata_control::elog!( + leleka_control_plane::elog!( "CORS on /v1/*: WARNING: any web page may use the model (no API key)" ); } @@ -88,7 +88,7 @@ pub(super) fn warn_open_cors(config: &Config) { /// The model family: the Qwen tokenizer assets (with the chat template), or the gpt-oss GGUF. pub(super) fn attach_codec(state: &mut app::AppState, config: &Config) -> Result<(), BoxError> { if let Some(path) = config.tokenizer_dir.as_deref() { - state.model.tokenizer = Some(Arc::new(strata_control::codec::qwen_codec( + state.model.tokenizer = Some(Arc::new(leleka_control_plane::codec::qwen_codec( tokenizer::Tokenizer::from_assets(path)?, ))); state.model.chat_template = std::fs::read_to_string(path.join("chat_template.jinja")) @@ -97,7 +97,7 @@ pub(super) fn attach_codec(state: &mut app::AppState, config: &Config) -> Result } if let Some(path) = config.gptoss_gguf.as_deref() { state.model.tokenizer = Some(Arc::new( - strata_control::harmony_family::GptOssCodec::from_gguf(path)?, + leleka_control_plane::harmony_family::GptOssCodec::from_gguf(path)?, )); } Ok(()) @@ -112,25 +112,25 @@ pub(super) async fn start_vision( let Some(vision) = config.vision.take() else { return Ok(None); }; - strata_control::elog!("loading the vision encoder ..."); + leleka_control_plane::elog!("loading the vision encoder ..."); let process = Vision::start(vision).await?; state.model.vision = Some(process.clone()); Ok(Some(process)) } pub(super) fn apply_prompt_settings(config: &Config) { - if config.prompt_date != strata_control::responses::PromptDate::Utc { - strata_control::elog!( + if config.prompt_date != leleka_control_plane::responses::PromptDate::Utc { + leleka_control_plane::elog!( "prompt date {:?} (the system message's Current date line; experimental unless a fixed date)", config.prompt_date ); } - strata_control::responses::set_prompt_date(config.prompt_date.clone()); + leleka_control_plane::responses::set_prompt_date(config.prompt_date.clone()); if config.tool_call_recovery { - strata_control::elog!( + leleka_control_plane::elog!( "tool_call_recovery is ON (experimental): a declared tool's call written in a drifted form is run as \ that call; see docs/api-contract.md" ); } - strata_control::responses::set_tool_call_recovery(config.tool_call_recovery); + leleka_control_plane::responses::set_tool_call_recovery(config.tool_call_recovery); } diff --git a/control-plane/src/service_install.rs b/control-plane/src/service_install.rs index 035b4596..0edfd0ad 100644 --- a/control-plane/src/service_install.rs +++ b/control-plane/src/service_install.rs @@ -1,8 +1,8 @@ //! Explicit per-user systemd installation. Never replaces a different unit. use std::path::{Path, PathBuf}; -const USAGE: &str = "usage: strata-next service-install --config ABSOLUTE_FILE --working-dir ABSOLUTE_DIR [--env-file \ - ABSOLUTE_FILE] [--unit strata-next[-NAME].service] [--enable] [--start]"; +const USAGE: &str = "usage: leleka-api service-install --config ABSOLUTE_FILE --working-dir ABSOLUTE_DIR [--env-file \ + ABSOLUTE_FILE] [--unit leleka-api[-NAME].service] [--enable] [--start]"; const INSTALL_READY_USAGE: &str = "service-install --start-ready requires --ready-url LOOPBACK_ORIGIN --ready-model ID \ [--ready-key-file FILE] [--ready-timeout-s N]; do not combine with --start"; @@ -16,9 +16,9 @@ struct Options { enable: bool, } -const CONTROL_USAGE: &str = "usage: strata-next service-control \ +const CONTROL_USAGE: &str = "usage: leleka-api service-control \ status|start|stop|restart|enable|disable|start-ready|restart-ready|drain-stop|resume --config ABSOLUTE_FILE \ - --working-dir ABSOLUTE_DIR [--env-file ABSOLUTE_FILE] [--unit strata-next[-NAME].service] [--ready-url \ + --working-dir ABSOLUTE_DIR [--env-file ABSOLUTE_FILE] [--unit leleka-api[-NAME].service] [--ready-url \ LOOPBACK_ORIGIN --ready-model ID [--ready-key-file FILE] [--ready-timeout-s N]]"; #[cfg(unix)] diff --git a/control-plane/src/service_install/command_line.rs b/control-plane/src/service_install/command_line.rs index c6efbf03..03006c0d 100644 --- a/control-plane/src/service_install/command_line.rs +++ b/control-plane/src/service_install/command_line.rs @@ -28,7 +28,7 @@ pub(super) fn parse(args: &[String]) -> Result { let unit = values .get("--unit") .map(|s| s.as_str()) - .unwrap_or("strata-next.service"); + .unwrap_or("leleka-api.service"); validate_name(unit)?; options_from(&values, unit, start, enable) } @@ -52,7 +52,7 @@ fn options_from( pub(super) fn validate_name(name: &str) -> Result<(), String> { let suffix = name - .strip_prefix("strata-next") + .strip_prefix("leleka-api") .and_then(|s| s.strip_suffix(".service")); if name.len() <= 120 && suffix.is_some_and(|s| { @@ -67,7 +67,7 @@ pub(super) fn validate_name(name: &str) -> Result<(), String> { Ok(()) } else { Err(concat!( - "unit must be strata-next.service or strata-next-NAME.service ", + "unit must be leleka-api.service or leleka-api-NAME.service ", "(ASCII letters, digits, dash, underscore)" ) .into()) diff --git a/control-plane/src/service_install/tests.rs b/control-plane/src/service_install/tests.rs index a27e67e8..76acab2c 100644 --- a/control-plane/src/service_install/tests.rs +++ b/control-plane/src/service_install/tests.rs @@ -77,15 +77,15 @@ fn control_only_explicit_scoped_actions() { } fn assert_names_are_scoped() { - for name in ["strata-next.service", "strata-next-prod_2.service"] { + for name in ["leleka-api.service", "leleka-api-prod_2.service"] { assert!(validate_name(name).is_ok()); } for name in [ "other.service", - "strata-next-.service", - "strata-next@a.service", - "strata-next-../a.service", - "strata-next-a + "leleka-api-.service", + "leleka-api@a.service", + "leleka-api-../a.service", + "leleka-api-a .service", ] { assert!(validate_name(name).is_err()); @@ -118,7 +118,7 @@ fn arguments_and_scoped_names() { let invalid_control = ["start", "--config", "/a", "--working-dir", "/b", "--enable"].map(str::to_owned); assert!(control_options(&invalid_control).is_err()); - assert_eq!(options.unit, "strata-next.service"); + assert_eq!(options.unit, "leleka-api.service"); } /// `start-ready` arguments with a complete readiness block (and the bare form refused first). diff --git a/control-plane/src/service_install/unix/tests.rs b/control-plane/src/service_install/unix/tests.rs index f95f01be..4fc44dc0 100644 --- a/control-plane/src/service_install/unix/tests.rs +++ b/control-plane/src/service_install/unix/tests.rs @@ -20,7 +20,7 @@ fn unique_test_root(prefix: &str) -> PathBuf { #[test] fn atomic_reuse_and_conflicts_preserve_bytes() { let root = unique_test_root("strata-unit-test"); - let name = "strata-next-test.service"; + let name = "leleka-api-test.service"; assert!(publish(&root, name, b"one").unwrap()); let path = root.join(name); let inode = fs::metadata(&path).unwrap().ino(); @@ -73,7 +73,7 @@ fn manager_status_is_limited_and_strict() { #[test] fn activation_link_conflicts_are_preserved() { let root = unique_test_root("strata-activation"); - let name = "strata-next-activation.service"; + let name = "leleka-api-activation.service"; publish(&root, name, b"owned unit").unwrap(); let path = root.join(name); assert!(check_activation_link(&path).is_ok()); diff --git a/control-plane/src/service_switch.rs b/control-plane/src/service_switch.rs index 62f3a932..3684dfed 100644 --- a/control-plane/src/service_switch.rs +++ b/control-plane/src/service_switch.rs @@ -10,7 +10,7 @@ use std::{ }; const USAGE: &str = - "usage: strata-next service-switch --catalog FILE [--from ID] --to ID --state-dir ABSOLUTE_DIR"; + "usage: leleka-api service-switch --catalog FILE [--from ID] --to ID --state-dir ABSOLUTE_DIR"; #[derive(Deserialize)] #[serde(deny_unknown_fields)] diff --git a/control-plane/src/service_unit.rs b/control-plane/src/service_unit.rs index 2557a3c6..ba5ffe0f 100644 --- a/control-plane/src/service_unit.rs +++ b/control-plane/src/service_unit.rs @@ -59,7 +59,7 @@ fn unit_text(working_dir: &str, environment: &str, executable: &str, config: &st // ':' disables ExecStart environment-variable substitution; %% escapes // specifiers. Do not wrap this in a shell or reset the worker restart budget. format!( - "# Generated by strata-next service-unit; install as a user unit.\n\ + "# Generated by leleka-api service-unit; install as a user unit.\n\ [Unit]\n\ Description=Strata Next native Responses runtime\n\ \n\ diff --git a/control-plane/src/tensor_export.rs b/control-plane/src/tensor_export.rs index 1f691459..134714fe 100644 --- a/control-plane/src/tensor_export.rs +++ b/control-plane/src/tensor_export.rs @@ -115,7 +115,7 @@ fn export_record( source_fnv1a64: format!("{source_fnv:016x}"), f32_bytes, f32_sha256: hex::encode(decoded_hash.finalize()), - decoder: "strata-next/gguf-f32-stream:ggml-3cf03257", + decoder: "leleka-api/gguf-f32-stream:ggml-3cf03257", } } diff --git a/control-plane/src/wait_ready.rs b/control-plane/src/wait_ready.rs index 97ae1dea..c6e83cb4 100644 --- a/control-plane/src/wait_ready.rs +++ b/control-plane/src/wait_ready.rs @@ -88,7 +88,7 @@ fn check_probe_identity( model: &str, expected_pid: Option, ) -> Result<(), String> { - if value.get("service").and_then(Value::as_str) != Some("strata-control") + if value.get("service").and_then(Value::as_str) != Some("leleka-control-plane") || value.get("model").and_then(Value::as_str) != Some(model) { return Err("readiness service or model does not match the requested deployment".into()); @@ -194,7 +194,7 @@ impl Waiter { } fn lifecycle_identity(&self, value: &Value, pid: u32) -> Result<(), String> { - if value["service"] != "strata-control" + if value["service"] != "leleka-control-plane" || value["model"] != self.options.model || value["server_pid"].as_u64() != Some(u64::from(pid)) { @@ -268,7 +268,7 @@ impl Waiter { fn ready_result(model: &str, attempts: u64, expected_pid: Option) -> Value { let mut result = - json!({"ready":true, "service":"strata-control", "model":model, "attempts":attempts}); + json!({"ready":true, "service":"leleka-control-plane", "model":model, "attempts":attempts}); if let Some(pid) = expected_pid { result["server_pid"] = json!(pid); } diff --git a/control-plane/src/wait_ready/options.rs b/control-plane/src/wait_ready/options.rs index bf77b79b..a6486293 100644 --- a/control-plane/src/wait_ready/options.rs +++ b/control-plane/src/wait_ready/options.rs @@ -4,7 +4,7 @@ use std::{collections::BTreeMap, net::IpAddr, time::Duration}; use reqwest::Url; const USAGE: &str = concat!( - "usage: strata-next wait-ready --url LOOPBACK_ORIGIN --model ID ", + "usage: leleka-api wait-ready --url LOOPBACK_ORIGIN --model ID ", "[--key-file FILE] [--timeout-s N]" ); const NOT_LOOPBACK: &str = concat!( diff --git a/control-plane/src/wait_ready/tests.rs b/control-plane/src/wait_ready/tests.rs index dee416b7..349ae990 100644 --- a/control-plane/src/wait_ready/tests.rs +++ b/control-plane/src/wait_ready/tests.rs @@ -32,7 +32,7 @@ async fn stop(server: tokio::task::JoinHandle<()>) { /// `/status` of a ready server that reports `reported` as its pid (or none). fn status_router(reported: Option) -> axum::Router { let mut body = - json!({"service":"strata-control", "model":"fixture", "ready":true, "worker":"ready"}); + json!({"service":"leleka-control-plane", "model":"fixture", "ready":true, "worker":"ready"}); if let Some(value) = reported { body["server_pid"] = value; } @@ -45,7 +45,7 @@ fn status_router(reported: Option) -> axum::Router { /// `/admin/lifecycle` reports `reported_pid`; `/admin/drain` counts its posts and fails. fn admission_router(reported_pid: u32, observed: Arc) -> axum::Router { let value = json!({ - "service": "strata-control", "model": "fixture", "server_pid": reported_pid, + "service": "leleka-control-plane", "model": "fixture", "server_pid": reported_pid, "shutting_down": false, "draining": false, "drained": false, "requests_in_flight": 0, "generation_jobs": 0, "worker": "ready", }); diff --git a/control-plane/tests/backend_worker_http/codex.rs b/control-plane/tests/backend_worker_http/codex.rs index 593405f1..e69b7109 100644 --- a/control-plane/tests/backend_worker_http/codex.rs +++ b/control-plane/tests/backend_worker_http/codex.rs @@ -8,7 +8,7 @@ use leleka_backend_api::Usage; use leleka_backend_api::scripted::Script; use serde_json::{Value, json}; use std::sync::Arc; -use strata_control::wire::Generate; +use leleka_control_plane::wire::Generate; #[rustfmt::skip] fn shell_tool() -> Value { diff --git a/control-plane/tests/backend_worker_http/engine_failures.rs b/control-plane/tests/backend_worker_http/engine_failures.rs index 4af99869..5ef19d02 100644 --- a/control-plane/tests/backend_worker_http/engine_failures.rs +++ b/control-plane/tests/backend_worker_http/engine_failures.rs @@ -5,7 +5,7 @@ use leleka_backend_api::ErrorCode; use leleka_backend_api::scripted::{Script, Step}; use serde_json::{Value, json}; use std::time::Duration; -use strata_control::worker::WorkerState; +use leleka_control_plane::worker::WorkerState; /// A failure after one piece ends the stream with `response.failed` carrying the engine's message. async fn assert_streamed_failure_ends_with_response_failed(stack: &Stack) { diff --git a/control-plane/tests/backend_worker_http/harness.rs b/control-plane/tests/backend_worker_http/harness.rs index 77eded73..47347b8e 100644 --- a/control-plane/tests/backend_worker_http/harness.rs +++ b/control-plane/tests/backend_worker_http/harness.rs @@ -6,16 +6,16 @@ use leleka_backend_api::{InferenceMode, RuntimeConfig, Usage}; use serde_json::{Value, json}; use std::sync::Arc; use std::time::Duration; -use strata_control::app::{AppState, EngineLink, ModelView, Services, router}; -use strata_control::backend_worker::{BackendWorkerConfig, WorkerInbox, run_backend_worker}; -use strata_control::tokenizer::Tokenizer; -use strata_control::worker::{Control, GenerationCommand, WorkerState, WorkerStatus}; +use leleka_control_plane::app::{AppState, EngineLink, ModelView, Services, router}; +use leleka_control_plane::backend_worker::{BackendWorkerConfig, WorkerInbox, run_backend_worker}; +use leleka_control_plane::tokenizer::Tokenizer; +use leleka_control_plane::worker::{Control, GenerationCommand, WorkerState, WorkerStatus}; use tokio::sync::{RwLock, mpsc, watch}; /// The byte alphabet, the specials and the merged tokens, with the vocabulary size. fn merging_vocabulary() -> (serde_json::Map, usize) { let mut vocabulary = serde_json::Map::new(); - for (id, ch) in strata_control::tokenizer::byte_alphabet() + for (id, ch) in leleka_control_plane::tokenizer::byte_alphabet() .0 .iter() .enumerate() @@ -158,19 +158,19 @@ fn app_state( AppState { engine: EngineLink { worker: status, - client: Some(strata_control::adapters::ChannelEngine::shared(requests)), + client: Some(leleka_control_plane::adapters::ChannelEngine::shared(requests)), control: Some(control), ..Default::default() }, model: ModelView { name: Some("fixture".into()), - tokenizer: Some(Arc::new(strata_control::codec::qwen_codec_shared( + tokenizer: Some(Arc::new(leleka_control_plane::codec::qwen_codec_shared( tokenizer, ))), ..Default::default() }, services: Services { - monitor: Arc::new(strata_control::request_monitor::RequestMonitor::new( + monitor: Arc::new(leleka_control_plane::request_monitor::RequestMonitor::new( monitor, )), ..Default::default() diff --git a/control-plane/tests/backend_worker_http/runtime_status.rs b/control-plane/tests/backend_worker_http/runtime_status.rs index 1a247020..c35317ed 100644 --- a/control-plane/tests/backend_worker_http/runtime_status.rs +++ b/control-plane/tests/backend_worker_http/runtime_status.rs @@ -4,7 +4,7 @@ use crate::harness::{Stack, body, scripted_text, sse_events, tool_markup, usage} use leleka_backend_api::FinishReason; use leleka_backend_api::scripted::Script; use serde_json::{Value, json}; -use strata_control::worker::WorkerState; +use leleka_control_plane::worker::WorkerState; fn chat_request(stream: bool) -> Value { json!({"model": "fixture", "stream": stream, "messages": [{"role": "user", "content": "hi"}]}) @@ -110,7 +110,7 @@ async fn status_metrics_and_unload_reflect_the_attached_runtime() { assert_eq!(generation["last_done"]["finish"], "stop"); // The runtime's lifecycle belongs to its operator: HTTP cannot unload it. assert_eq!( - strata_control::server_api::unload(&stack.state, None).await, + leleka_control_plane::server_api::unload(&stack.state, None).await, leleka_serving_policy::idle::Outcome::Unsupported ); assert_eq!(stack.status.read().await.state, WorkerState::Ready); diff --git a/control-plane/tests/backend_worker_http/second_worker.rs b/control-plane/tests/backend_worker_http/second_worker.rs index 1da3031a..dd968e47 100644 --- a/control-plane/tests/backend_worker_http/second_worker.rs +++ b/control-plane/tests/backend_worker_http/second_worker.rs @@ -5,9 +5,9 @@ use crate::harness::{Stack, runtime_config}; use leleka_backend_api::scripted::{ScriptedEngine, ScriptedHandle}; use std::sync::Arc; use std::time::Duration; -use strata_control::backend_worker::{BackendWorkerConfig, WorkerInbox, run_backend_worker}; -use strata_control::wire::{Event, Generate}; -use strata_control::worker::{ +use leleka_control_plane::backend_worker::{BackendWorkerConfig, WorkerInbox, run_backend_worker}; +use leleka_control_plane::wire::{Event, Generate}; +use leleka_control_plane::worker::{ Control, GenerationCommand, GenerationResult, WorkerState, WorkerStatus, }; use tokio::sync::{RwLock, mpsc, oneshot, watch}; diff --git a/control-plane/tests/backend_worker_http/text_formats.rs b/control-plane/tests/backend_worker_http/text_formats.rs index 901a0b0c..2065f7d9 100644 --- a/control-plane/tests/backend_worker_http/text_formats.rs +++ b/control-plane/tests/backend_worker_http/text_formats.rs @@ -6,7 +6,7 @@ use crate::harness::{ use crate::second_worker; use leleka_backend_api::scripted::Script; use serde_json::{Value, json}; -use strata_control::wire::Generate; +use leleka_control_plane::wire::Generate; fn result_schema_format() -> Value { json!({"type": "json_schema", "name": "result", "strict": true, diff --git a/control-plane/tests/chat_template_oracle.rs b/control-plane/tests/chat_template_oracle.rs index 91221a52..2e357eab 100644 --- a/control-plane/tests/chat_template_oracle.rs +++ b/control-plane/tests/chat_template_oracle.rs @@ -6,7 +6,7 @@ //! prompt) and 25 conversations the template refuses, with the exact `raise_exception` message. //! `scripts/offline/diff_chat_template.py` runs the same generator live over thousands of cases. use serde::Deserialize; -use strata_control::prompt::{ChatInput, Json, pinned}; +use leleka_control_plane::prompt::{ChatInput, Json, pinned}; #[derive(Deserialize)] struct Case { diff --git a/control-plane/tests/common/mod.rs b/control-plane/tests/common/mod.rs index 7eba84a8..49a97862 100644 --- a/control-plane/tests/common/mod.rs +++ b/control-plane/tests/common/mod.rs @@ -8,7 +8,7 @@ use std::{ }; use serde_json::{Map, json}; -use strata_control::tokenizer::Tokenizer; +use leleka_control_plane::tokenizer::Tokenizer; pub const SPECIALS: [&str; 7] = [ "<|im_start|>", @@ -33,7 +33,7 @@ pub fn scratch(name: &str) -> PathBuf { fn write_vocabulary(root: &Path) { let mut vocabulary = Map::new(); - for (id, ch) in strata_control::tokenizer::byte_alphabet() + for (id, ch) in leleka_control_plane::tokenizer::byte_alphabet() .0 .iter() .enumerate() diff --git a/control-plane/tests/dequant_oracle.rs b/control-plane/tests/dequant_oracle.rs index 6af009f6..f458b28d 100644 --- a/control-plane/tests/dequant_oracle.rs +++ b/control-plane/tests/dequant_oracle.rs @@ -7,7 +7,7 @@ //! dequantizer; its reference is `d * qs`. use serde_json::Value; use std::io::Cursor; -use strata_control::{gguf, gguf_f32_stream}; +use leleka_control_plane::{gguf, gguf_f32_stream}; fn unhex(text: &str) -> Vec { (0..text.len() / 2) diff --git a/control-plane/tests/fixtures/golden/responses_pure.json b/control-plane/tests/fixtures/golden/responses_pure.json index 3a680317..db67065d 100644 --- a/control-plane/tests/fixtures/golden/responses_pure.json +++ b/control-plane/tests/fixtures/golden/responses_pure.json @@ -1,5 +1,5 @@ { - "_comment": "Golden inputs and outputs of the pure Responses protocol (request validation, prompt rendering, response trace, tool-call text parsing). Generated from the code as it was in strata-control before it moved to leleka-gateway-domain (STRA-338 S21); outputs must stay byte-identical. Regenerate only on purpose: cargo test -p strata-control golden::regenerate -- --ignored", + "_comment": "Golden inputs and outputs of the pure Responses protocol (request validation, prompt rendering, response trace, tool-call text parsing). Generated from the code as it was in leleka-control-plane before it moved to leleka-gateway-domain (STRA-338 S21); outputs must stay byte-identical. Regenerate only on purpose: cargo test -p leleka-control-plane golden::regenerate -- --ignored", "render": [ { "name": "plain string", diff --git a/control-plane/tests/gguf_header_differential.rs b/control-plane/tests/gguf_header_differential.rs index f0c82413..2c796996 100644 --- a/control-plane/tests/gguf_header_differential.rs +++ b/control-plane/tests/gguf_header_differential.rs @@ -7,7 +7,7 @@ //! `scripts/offline/diff_gguf_header.py`. use serde_json::Value; use std::{fs, path::PathBuf}; -use strata_control::{gguf, gguf_json}; +use leleka_control_plane::{gguf, gguf_json}; fn golden() -> Value { serde_json::from_str(include_str!("fixtures/offline/gguf_headers.json")).unwrap() diff --git a/control-plane/tests/http_surface.rs b/control-plane/tests/http_surface.rs index 9cc9bf9a..e0340ea0 100644 --- a/control-plane/tests/http_surface.rs +++ b/control-plane/tests/http_surface.rs @@ -14,7 +14,7 @@ mod harness; use harness::Harness; use serde_json::{Value, json}; -use strata_control::worker::WorkerState; +use leleka_control_plane::worker::WorkerState; fn fixture() -> Value { serde_json::from_str(include_str!("fixtures/golden/http_surface.json")).unwrap() diff --git a/control-plane/tests/http_surface/harness.rs b/control-plane/tests/http_surface/harness.rs index 62ac63b1..73ed7584 100644 --- a/control-plane/tests/http_surface/harness.rs +++ b/control-plane/tests/http_surface/harness.rs @@ -4,7 +4,7 @@ use std::{path::PathBuf, sync::Arc, time::Duration}; use leleka_serving_policy::{cors::Cors, shared::sampling_defaults_from_config}; use serde_json::Value; -use strata_control::{ +use leleka_control_plane::{ app::{AppState, EngineLink, HttpPolicy, ModelView, Services, router}, lifecycle::Guard, settings::Settings, @@ -57,7 +57,7 @@ fn build_settings(setup: &Value) -> Settings { settings } -fn api_key_from(setup: &Value, dir: &std::path::Path) -> Option> { +fn api_key_from(setup: &Value, dir: &std::path::Path) -> Option> { setup["api_key"] .as_str() .filter(|k| !k.is_empty()) @@ -69,7 +69,7 @@ fn api_key_from(setup: &Value, dir: &std::path::Path) -> Option u16 { } fn spawn_server(dir: &std::path::Path, engine: &std::path::Path, port: u16) -> Child { - Command::new(env!("CARGO_BIN_EXE_strata-next")) + Command::new(env!("CARGO_BIN_EXE_leleka-api")) .arg("serve") .env_clear() .env("STRATA_BIND", format!("127.0.0.1:{port}")) @@ -190,6 +190,6 @@ fn no_panicking_log_macros_in_the_serving_crate() { } assert!( offenders.is_empty(), - "use strata_control::elog!: {offenders:?}" + "use leleka_control_plane::elog!: {offenders:?}" ); } diff --git a/control-plane/tests/mcp_hub/harness.rs b/control-plane/tests/mcp_hub/harness.rs index a0844b7d..cd5ca470 100644 --- a/control-plane/tests/mcp_hub/harness.rs +++ b/control-plane/tests/mcp_hub/harness.rs @@ -4,7 +4,7 @@ use serde_json::{Map, Value, json}; use std::collections::BTreeMap; use std::path::PathBuf; use std::process::{Command, Stdio}; -use strata_control::mcp::{Hub, Settings}; +use leleka_control_plane::mcp::{Hub, Settings}; pub(super) fn fake_path() -> PathBuf { PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../engine/strata/serve/mcp_fake_server.py") diff --git a/control-plane/tests/mcp_hub/http_and_config.rs b/control-plane/tests/mcp_hub/http_and_config.rs index 300d1875..f196a116 100644 --- a/control-plane/tests/mcp_hub/http_and_config.rs +++ b/control-plane/tests/mcp_hub/http_and_config.rs @@ -4,7 +4,7 @@ use crate::harness::{fake_path, hub, names, python, stdio}; use serde_json::{Value, json}; use std::io::{BufRead, BufReader}; use std::process::{Child, Command, Stdio}; -use strata_control::mcp::{Hub, Settings, servers_from, settings_from}; +use leleka_control_plane::mcp::{Hub, Settings, servers_from, settings_from}; struct HttpFake(Child); @@ -145,10 +145,10 @@ fn config_accepts_both_spellings_and_checks_every_entry() { ); } -async fn get_mcp(state: strata_control::app::AppState) -> Value { +async fn get_mcp(state: leleka_control_plane::app::AppState) -> Value { let listener = tokio::net::TcpListener::bind("127.0.0.1:0").await.unwrap(); let url = format!("http://{}/mcp", listener.local_addr().unwrap()); - let app = strata_control::app::router(state); + let app = leleka_control_plane::app::router(state); let server = tokio::spawn(async move { let _ = axum::serve(listener, app).await; }); @@ -161,7 +161,7 @@ async fn get_mcp(state: strata_control::app::AppState) -> Value { #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn get_mcp_reports_the_hub_or_an_empty_list() { use std::sync::Arc; - use strata_control::app::{AppState, Services}; + use leleka_control_plane::app::{AppState, Services}; assert_eq!( get_mcp(AppState::default()).await, diff --git a/control-plane/tests/mcp_hub/stdio_servers.rs b/control-plane/tests/mcp_hub/stdio_servers.rs index 7a4d87dd..33c64e7e 100644 --- a/control-plane/tests/mcp_hub/stdio_servers.rs +++ b/control-plane/tests/mcp_hub/stdio_servers.rs @@ -2,7 +2,7 @@ use crate::harness::{hub, names, python, stdio}; use serde_json::{Value, json}; -use strata_control::mcp::{Hub, McpError, Settings}; +use leleka_control_plane::mcp::{Hub, McpError, Settings}; use tokio::sync::watch; const TOOLS: [&str; 6] = ["echo", "fail", "sleep", "big", "die", "add"]; diff --git a/control-plane/tests/memory_gate_http/harness.rs b/control-plane/tests/memory_gate_http/harness.rs index 99936b28..1fb0c950 100644 --- a/control-plane/tests/memory_gate_http/harness.rs +++ b/control-plane/tests/memory_gate_http/harness.rs @@ -6,11 +6,11 @@ use leleka_backend_api::{InferenceMode, RuntimeConfig, Usage}; use serde_json::{Value, json}; use std::sync::Arc; use std::time::Duration; -use strata_control::app::{AppState, EngineLink, ModelView, router}; -use strata_control::backend_worker::{BackendWorkerConfig, WorkerInbox, run_backend_worker}; -use strata_control::memory_view::MemoryView; -use strata_control::tokenizer::Tokenizer; -use strata_control::worker::{Control, GenerationCommand, WorkerState, WorkerStatus}; +use leleka_control_plane::app::{AppState, EngineLink, ModelView, router}; +use leleka_control_plane::backend_worker::{BackendWorkerConfig, WorkerInbox, run_backend_worker}; +use leleka_control_plane::memory_view::MemoryView; +use leleka_control_plane::tokenizer::Tokenizer; +use leleka_control_plane::worker::{Control, GenerationCommand, WorkerState, WorkerStatus}; use tokio::sync::{RwLock, mpsc, watch}; pub(super) struct Stack { @@ -65,13 +65,13 @@ fn app_state( AppState { engine: EngineLink { worker: status, - client: Some(strata_control::adapters::ChannelEngine::shared(requests)), + client: Some(leleka_control_plane::adapters::ChannelEngine::shared(requests)), control: Some(control), ..Default::default() }, model: ModelView { name: Some("fixture".into()), - tokenizer: Some(Arc::new(strata_control::codec::qwen_codec_shared( + tokenizer: Some(Arc::new(leleka_control_plane::codec::qwen_codec_shared( tokenizer, ))), memory, diff --git a/control-plane/tests/mtp_fetch.rs b/control-plane/tests/mtp_fetch.rs index ef20b782..96de40af 100644 --- a/control-plane/tests/mtp_fetch.rs +++ b/control-plane/tests/mtp_fetch.rs @@ -8,7 +8,7 @@ use std::{ use serde_json::{Value, json}; use sha2::{Digest, Sha256}; -use strata_control::mtp_fetch::{Fetcher, check_range}; +use leleka_control_plane::mtp_fetch::{Fetcher, check_range}; #[path = "mtp_fetch/mirror.rs"] mod mirror; @@ -263,8 +263,8 @@ async fn verify_keeps_its_verdict_and_skips_other_revisions() { #[test] fn the_pinned_table_has_31_sha256_hashes_for_the_pinned_revision() { - assert_eq!(strata_control::mtp_fetch::SHA256.len(), 31); - for (name, hash) in strata_control::mtp_fetch::SHA256 { + assert_eq!(leleka_control_plane::mtp_fetch::SHA256.len(), 31); + for (name, hash) in leleka_control_plane::mtp_fetch::SHA256 { assert!(name.starts_with("mtp.")); assert!( hash.len() == 64 @@ -273,5 +273,5 @@ fn the_pinned_table_has_31_sha256_hashes_for_the_pinned_revision() { .all(|b| b.is_ascii_hexdigit() && !b.is_ascii_uppercase()) ); } - assert_eq!(strata_control::mtp_fetch::PINNED_REVISION.len(), 40); + assert_eq!(leleka_control_plane::mtp_fetch::PINNED_REVISION.len(), 40); } diff --git a/control-plane/tests/output_golden/capture.rs b/control-plane/tests/output_golden/capture.rs index 2f63450d..fed43341 100644 --- a/control-plane/tests/output_golden/capture.rs +++ b/control-plane/tests/output_golden/capture.rs @@ -6,7 +6,7 @@ use axum::{Json, extract::State, response::Response}; use http_body_util::BodyExt; use leleka_sampler_ref::RequestSampling; use serde_json::{Value, json}; -use strata_control::{ +use leleka_control_plane::{ adapters::ChannelEngine, app::AppState, codec::TextCodec, diff --git a/control-plane/tests/output_golden/live.rs b/control-plane/tests/output_golden/live.rs index 1c99856d..1b315a46 100644 --- a/control-plane/tests/output_golden/live.rs +++ b/control-plane/tests/output_golden/live.rs @@ -5,7 +5,7 @@ use std::time::Duration; use axum::{Json, body::Body, extract::State}; use http_body_util::BodyExt; use serde_json::{Value, json}; -use strata_control::{ +use leleka_control_plane::{ responses::create, wire::{Event, Finish}, worker::{GenerationCommand, GenerationResult}, diff --git a/control-plane/tests/output_golden/sampling.rs b/control-plane/tests/output_golden/sampling.rs index 5449cd28..3be1ea46 100644 --- a/control-plane/tests/output_golden/sampling.rs +++ b/control-plane/tests/output_golden/sampling.rs @@ -6,7 +6,7 @@ use axum::{Json, extract::State}; use leleka_sampler_ref::RequestSampling; use leleka_serving_policy::shared::ConfigSampling; use serde_json::{Value, json}; -use strata_control::{responses::create, settings::Settings}; +use leleka_control_plane::{responses::create, settings::Settings}; use crate::{ ONE_AT_A_TIME, diff --git a/control-plane/tests/output_golden/script.rs b/control-plane/tests/output_golden/script.rs index dce352be..5448507a 100644 --- a/control-plane/tests/output_golden/script.rs +++ b/control-plane/tests/output_golden/script.rs @@ -4,7 +4,7 @@ //! token of the vocabulary (see `vocab::EXTRA`), anything else is text as byte-level tokens. use serde_json::Value; -use strata_control::wire::{Done, Event, Finish}; +use leleka_control_plane::wire::{Done, Event, Finish}; use crate::vocab::Codecs; diff --git a/control-plane/tests/output_golden/vocab.rs b/control-plane/tests/output_golden/vocab.rs index 9dfa646a..e9a65ab4 100644 --- a/control-plane/tests/output_golden/vocab.rs +++ b/control-plane/tests/output_golden/vocab.rs @@ -7,7 +7,7 @@ use std::{fs, path::PathBuf, sync::Arc}; use leleka_tokenizer::gguf_bpe::SpecialIds; use serde_json::{Map, json}; -use strata_control::{ +use leleka_control_plane::{ codec::{QwenCodec, qwen_codec}, harmony_family::GptOssCodec, tokenizer::{Tokenizer, byte_alphabet}, diff --git a/control-plane/tests/ports_fakes.rs b/control-plane/tests/ports_fakes.rs index 8ed42135..4f49875a 100644 --- a/control-plane/tests/ports_fakes.rs +++ b/control-plane/tests/ports_fakes.rs @@ -2,7 +2,7 @@ //! real clock and no MCP server. Each test names the port it covers. use std::{collections::BTreeMap, sync::Arc, time::Duration}; -use strata_control::app::Services; +use leleka_control_plane::app::Services; use axum::{ Json, @@ -12,7 +12,7 @@ use axum::{ response::Response, }; use serde_json::{Value, json}; -use strata_control::{ +use leleka_control_plane::{ app::{AppState, metrics_document}, mcp::{Hub, Settings}, ports::{ @@ -36,7 +36,7 @@ async fn state_with_tokenizer(name: &str) -> AppState { let tokenizer = common::tokenizer(&dir); let mut state = AppState::default(); state.engine.worker.write().await.state = WorkerState::Ready; - state.model.tokenizer = Some(Arc::new(strata_control::codec::qwen_codec_shared( + state.model.tokenizer = Some(Arc::new(leleka_control_plane::codec::qwen_codec_shared( tokenizer, ))); state diff --git a/control-plane/tests/prefix_match_http.rs b/control-plane/tests/prefix_match_http.rs index e1b713b9..12f963e2 100644 --- a/control-plane/tests/prefix_match_http.rs +++ b/control-plane/tests/prefix_match_http.rs @@ -2,10 +2,10 @@ //! `POST /v1/prefix_match` answers from it (`docs/prefix-cache.md`, "Pool protocol"). use std::sync::Arc; -use strata_control::app::ModelView; +use leleka_control_plane::app::ModelView; use serde_json::{Value, json}; -use strata_control::{ +use leleka_control_plane::{ app::{AppState, router}, prefix_view::PrefixView, }; diff --git a/control-plane/tests/reasoning_budget_live.rs b/control-plane/tests/reasoning_budget_live.rs index a6f50c9f..fb87e8cb 100644 --- a/control-plane/tests/reasoning_budget_live.rs +++ b/control-plane/tests/reasoning_budget_live.rs @@ -23,7 +23,7 @@ mod common; use serde::Deserialize; use serde_json::Value; -use strata_control::{ +use leleka_control_plane::{ reasoning_budget::{Utf8Stream, reasoning_budget}, wire::{Event, Finish, Generate, ReasoningPlan}, worker::{ diff --git a/control-plane/tests/reasoning_budget_live/mod_common.rs b/control-plane/tests/reasoning_budget_live/mod_common.rs index dd58813e..c2e6f6a1 100644 --- a/control-plane/tests/reasoning_budget_live/mod_common.rs +++ b/control-plane/tests/reasoning_budget_live/mod_common.rs @@ -3,8 +3,8 @@ use super::*; use crate::common::{scratch, tokenizer}; use serde_json::json; -use strata_control::app::{AppState, EngineLink, ModelView, router}; -use strata_control::tokenizer::Tokenizer; +use leleka_control_plane::app::{AppState, EngineLink, ModelView, router}; +use leleka_control_plane::tokenizer::Tokenizer; fn ids(text: &str) -> String { text.bytes() @@ -21,12 +21,12 @@ fn app_state( AppState { engine: EngineLink { worker: status, - client: Some(strata_control::adapters::ChannelEngine::shared(requests)), + client: Some(leleka_control_plane::adapters::ChannelEngine::shared(requests)), ..Default::default() }, model: ModelView { name: Some("strata-test".into()), - tokenizer: Some(Arc::new(strata_control::codec::qwen_codec_shared( + tokenizer: Some(Arc::new(leleka_control_plane::codec::qwen_codec_shared( tokenizer, ))), ..Default::default() diff --git a/control-plane/tests/reasoning_budget_oracle.rs b/control-plane/tests/reasoning_budget_oracle.rs index c837daf3..6e49bfb5 100644 --- a/control-plane/tests/reasoning_budget_oracle.rs +++ b/control-plane/tests/reasoning_budget_oracle.rs @@ -9,7 +9,7 @@ use std::collections::HashSet; use serde::Deserialize; use serde_json::Value; -use strata_control::reasoning_budget::{ +use leleka_control_plane::reasoning_budget::{ Finish, REASONING_WRAP_UP, RunRequest, TokenCodec, TokenEngine, reasoning_budget, run, }; diff --git a/control-plane/tests/tool_corpus/corpus.rs b/control-plane/tests/tool_corpus/corpus.rs index 08c90fdf..ad765231 100644 --- a/control-plane/tests/tool_corpus/corpus.rs +++ b/control-plane/tests/tool_corpus/corpus.rs @@ -1,7 +1,7 @@ //! Every ported Qwen specimen is read as listed, whole and streamed. use serde_json::Value; -use strata_control::{ +use leleka_control_plane::{ tool_output::{Incremental, Options, Segment, parse_with}, wire::Finish, }; diff --git a/control-plane/tests/tool_corpus/quoted_values.rs b/control-plane/tests/tool_corpus/quoted_values.rs index cf785445..80474452 100644 --- a/control-plane/tests/tool_corpus/quoted_values.rs +++ b/control-plane/tests/tool_corpus/quoted_values.rs @@ -1,7 +1,7 @@ //! Quoted call values stay exact; prose between calls ends the first. use serde_json::{Value, json}; -use strata_control::tool_output::{Incremental, Options, Segment, parse_complete, parse_with}; +use leleka_control_plane::tool_output::{Incremental, Options, Segment, parse_complete, parse_with}; // ---- serve/test_quoted_call_values.py ----------------------------------------------------------------------------- diff --git a/control-plane/tests/vision_http/harness.rs b/control-plane/tests/vision_http/harness.rs index 0a2ad166..08518e9f 100644 --- a/control-plane/tests/vision_http/harness.rs +++ b/control-plane/tests/vision_http/harness.rs @@ -7,10 +7,10 @@ use std::os::unix::fs::PermissionsExt; use std::path::{Path, PathBuf}; use std::sync::Arc; use std::time::Duration; -use strata_control::app::{AppState, EngineLink, ModelView, router}; -use strata_control::tokenizer::Tokenizer; -use strata_control::vision::{Vision, VisionConfig}; -use strata_control::worker::{ +use leleka_control_plane::app::{AppState, EngineLink, ModelView, router}; +use leleka_control_plane::tokenizer::Tokenizer; +use leleka_control_plane::vision::{Vision, VisionConfig}; +use leleka_control_plane::worker::{ Control, GenerationCommand, WorkerConfig, WorkerState, WorkerStatus, run_supervised, }; use tokio::sync::{RwLock, mpsc, watch}; @@ -119,13 +119,13 @@ fn app_state( AppState { engine: EngineLink { worker: status, - client: Some(strata_control::adapters::ChannelEngine::shared(requests)), + client: Some(leleka_control_plane::adapters::ChannelEngine::shared(requests)), control: Some(control), ..Default::default() }, model: ModelView { name: Some("strata-test".into()), - tokenizer: Some(Arc::new(strata_control::codec::qwen_codec_shared( + tokenizer: Some(Arc::new(leleka_control_plane::codec::qwen_codec_shared( tokenizer, ))), vision: vision.map(|v| v as _), diff --git a/crates/deploy/src/bin/fake_runtime/gateway_double.rs b/crates/deploy/src/bin/fake_runtime/gateway_double.rs index aa434bda..f9008071 100644 --- a/crates/deploy/src/bin/fake_runtime/gateway_double.rs +++ b/crates/deploy/src/bin/fake_runtime/gateway_double.rs @@ -23,7 +23,7 @@ pub(super) fn strata(fake: &Path, args: &[String]) { ["model", "extract-tokenizer", _, "--output", dir] => extract_tokenizer(dir), ["serve", "--config", config] => api(fake, config), other => { - eprintln!("fake strata-next: unsupported {other:?}"); + eprintln!("fake leleka-api: unsupported {other:?}"); std::process::exit(2); } } @@ -171,12 +171,12 @@ fn ready_answer(ready: bool) -> (&'static str, String) { if ready { ( "200 OK", - "{\"service\":\"strata-control\",\"ready\":true}".to_owned(), + "{\"service\":\"leleka-control-plane\",\"ready\":true}".to_owned(), ) } else { ( "503 Service Unavailable", - "{\"service\":\"strata-control\",\"ready\":false}".to_owned(), + "{\"service\":\"leleka-control-plane\",\"ready\":false}".to_owned(), ) } } diff --git a/crates/deploy/src/bin/fake_runtime/main.rs b/crates/deploy/src/bin/fake_runtime/main.rs index 3620fa6c..9606617b 100644 --- a/crates/deploy/src/bin/fake_runtime/main.rs +++ b/crates/deploy/src/bin/fake_runtime/main.rs @@ -1,5 +1,5 @@ //! Test double for the six runtime programs, selected by the name it is invoked as (symlinks named -//! `leleka-inference`, `leleka-daemon`, `leleka-cli`, `strata-next`). Used only by the integration tests of +//! `leleka-inference`, `leleka-daemon`, `leleka-cli`, `leleka-api`). Used only by the integration tests of //! `leleka-deploy` (`--features test-fakes`); it speaks just enough of each program's command line and of the //! HTTP readiness contract to exercise the supervisor and the `up` flow without a GPU or a model. //! @@ -30,7 +30,7 @@ fn main() { "leleka-inference" => engine(&fake, &args), "leleka-daemon" => daemon(&args), "leleka-cli" => cli(&fake, &args), - "strata-next" => strata(&fake, &args), + "leleka-api" => strata(&fake, &args), other => { eprintln!("fake runtime invoked as {other:?}"); std::process::exit(64); diff --git a/crates/deploy/src/config/tests.rs b/crates/deploy/src/config/tests.rs index 4c0a707b..2eb308e9 100644 --- a/crates/deploy/src/config/tests.rs +++ b/crates/deploy/src/config/tests.rs @@ -190,7 +190,7 @@ fn generated_configs_are_consistent() { } fn check_output_ceiling_below_a_small_context() { - // A context of 8K needs a ceiling below it, or `strata-next check-config` refuses the file (the laptop profile used + // A context of 8K needs a ceiling below it, or `leleka-api check-config` refuses the file (the laptop profile used // to have one). let mut small = config_of("rtx3080-16g"); small.profile.context_tokens = 8192; diff --git a/crates/deploy/src/doctor.rs b/crates/deploy/src/doctor.rs index 5149c9c9..531f3148 100644 --- a/crates/deploy/src/doctor.rs +++ b/crates/deploy/src/doctor.rs @@ -190,10 +190,11 @@ fn wsl_finding(inputs: &Inputs) -> Finding { fix: match (inputs.wsl_found, inputs.linux_leleka_found) { (false, _) => Some("wsl --install -d Ubuntu".into()), (true, Some(false)) => Some( - "wsl -d Ubuntu -- bash -lc \"cd ~/leleka-src && cargo build --release --locked -p strata-desktop-core \ + "wsl -d Ubuntu -- bash -lc \"cd ~/leleka-src && cargo build --release --locked -p leleka-engine-host \ --features sm86 --bin leleka-inference --bin leleka-daemon --bin leleka-cli --bin leleka-seal-exec && \ - cargo build --release --locked -p strata-control --bin strata-next && cargo build --release --locked \ - -p leleka-deploy --bin leleka\" (docs\\windows.md, \"Linux binaries for route A\")".into(), + cargo build --release --locked -p leleka-control-plane --bin leleka-api && \ + cargo build --release --locked -p leleka-deploy --bin leleka\" \ + (docs\\windows.md, \"Linux binaries for route A\")".into(), ), _ => None, }, diff --git a/crates/deploy/src/layout.rs b/crates/deploy/src/layout.rs index 79422ec6..dfc7794e 100644 --- a/crates/deploy/src/layout.rs +++ b/crates/deploy/src/layout.rs @@ -1,7 +1,7 @@ //! Where everything lives: install prefix, private state, model volume. //! //! ```text -//! PREFIX/bin/{leleka,strata-next,leleka-inference,leleka-daemon,leleka-cli,leleka-seal-exec} +//! PREFIX/bin/{leleka,leleka-api,leleka-inference,leleka-daemon,leleka-cli,leleka-seal-exec} //! PREFIX/lib/cublas/ CUDA 12 cuBLAS (only when the host has none) //! STATE/leleka.json run configuration (no secrets) 0600 //! STATE/runtime.env tokens + LD_LIBRARY_PATH 0600 @@ -16,7 +16,7 @@ use std::path::{Path, PathBuf}; #[cfg(not(windows))] pub const BINARIES: [&str; 6] = [ "leleka", - "strata-next", + "leleka-api", "leleka-inference", "leleka-daemon", "leleka-cli", @@ -26,7 +26,7 @@ pub const BINARIES: [&str; 6] = [ #[cfg(windows)] pub const BINARIES: [&str; 5] = [ "leleka.exe", - "strata-next.exe", + "leleka-api.exe", "leleka-inference.exe", "leleka-daemon.exe", "leleka-cli.exe", diff --git a/crates/deploy/src/plan/host_steps.rs b/crates/deploy/src/plan/host_steps.rs index 16a7320a..1bd98206 100644 --- a/crates/deploy/src/plan/host_steps.rs +++ b/crates/deploy/src/plan/host_steps.rs @@ -129,7 +129,7 @@ pub(super) fn secrets_step(ctx: &Context, fs: &FsState) -> Step { let state = if fs.secrets_present { StepState::Done("runtime.env and api-key exist (never rotated)".into()) } else { - StepState::Todo("generate two tokens (0600) and run `strata-next api-key init`".into()) + StepState::Todo("generate two tokens (0600) and run `leleka-api api-key init`".into()) }; step( "secrets", @@ -143,7 +143,7 @@ pub(super) fn secrets_step(ctx: &Context, fs: &FsState) -> Step { ) } -/// The path of the `strata-next` binary as the plan prints it in commands. +/// The path of the `leleka-api` binary as the plan prints it in commands. pub(super) fn strata_next(ctx: &Context) -> String { - ctx.paths.bin("strata-next").display().to_string() + ctx.paths.bin("leleka-api").display().to_string() } diff --git a/crates/deploy/src/steps/downloads.rs b/crates/deploy/src/steps/downloads.rs index dee50857..2fb150d7 100644 --- a/crates/deploy/src/steps/downloads.rs +++ b/crates/deploy/src/steps/downloads.rs @@ -284,7 +284,7 @@ pub async fn init_api_key(ctx: &Context) -> Result<(), String> { ]; run_tool( "api-key init", - &ctx.paths.bin("strata-next"), + &ctx.paths.bin("leleka-api"), &args, &ctx.paths.logs().join("install.log"), ) diff --git a/crates/deploy/src/steps/model_assets.rs b/crates/deploy/src/steps/model_assets.rs index 752fc5f8..74732d01 100644 --- a/crates/deploy/src/steps/model_assets.rs +++ b/crates/deploy/src/steps/model_assets.rs @@ -6,7 +6,7 @@ use super::{ }; pub async fn fetch_and_verify_model(ctx: &Context) -> Result<(), String> { - let strata = ctx.paths.bin("strata-next"); + let strata = ctx.paths.bin("leleka-api"); let log = ctx.paths.logs().join("install.log"); let model_dir = ctx.paths.model_dir().display().to_string(); if ctx.opts.fetch { @@ -32,7 +32,7 @@ pub async fn fetch_and_verify_model(ctx: &Context) -> Result<(), String> { ) } -/// `strata-next model VERB MANIFEST --output DIR`. +/// `leleka-api model VERB MANIFEST --output DIR`. fn model_args(verb: &str, model_dir: &str) -> Vec { vec![ "model".into(), @@ -62,7 +62,7 @@ pub async fn ensure_kar(ctx: &Context) -> Result<(), String> { /// Build the level-2 archive from the shards with the strict re-derivation. async fn derive_archive(ctx: &Context) -> Result<(), String> { - let strata = ctx.paths.bin("strata-next"); + let strata = ctx.paths.bin("leleka-api"); let log = ctx.paths.logs().join("install.log"); let args: Vec = [ "model", @@ -234,7 +234,7 @@ pub async fn extract_tokenizer(ctx: &Context) -> Result<(), String> { .collect(); run_tool( "tokenizer extraction", - &ctx.paths.bin("strata-next"), + &ctx.paths.bin("leleka-api"), &args, &ctx.paths.logs().join("install.log"), ) diff --git a/crates/deploy/src/supervisor/api.rs b/crates/deploy/src/supervisor/api.rs index 819c80c6..33b342a0 100644 --- a/crates/deploy/src/supervisor/api.rs +++ b/crates/deploy/src/supervisor/api.rs @@ -86,7 +86,7 @@ impl ServiceSupervisor { "--config".to_owned(), self.paths.strata_config().display().to_string(), ]; - let program = self.paths.bin("strata-next"); + let program = self.paths.bin("leleka-api"); *api = self.spawn("api", ChildSpec::plain(&program, &args))?; self.pids[2] = api.id(); self.wait_api_ready(api).await diff --git a/crates/deploy/src/supervisor/startup.rs b/crates/deploy/src/supervisor/startup.rs index 2f7ca74e..f6f13ca7 100644 --- a/crates/deploy/src/supervisor/startup.rs +++ b/crates/deploy/src/supervisor/startup.rs @@ -113,7 +113,7 @@ fn read_api_key(paths: &Paths) -> Result { fn check_binaries(paths: &Paths) -> Result<(), Failure> { for name in [ "leleka", - "strata-next", + "leleka-api", "leleka-inference", "leleka-daemon", "leleka-cli", diff --git a/crates/deploy/src/supervisor/supervise.rs b/crates/deploy/src/supervisor/supervise.rs index d73bfad5..282e5e3a 100644 --- a/crates/deploy/src/supervisor/supervise.rs +++ b/crates/deploy/src/supervisor/supervise.rs @@ -132,7 +132,7 @@ impl ServiceSupervisor { } fn spawn_api(&self) -> Result { - let program = self.paths.bin("strata-next"); + let program = self.paths.bin("leleka-api"); self.spawn("api", ChildSpec::plain(&program, &self.api_args())) } diff --git a/crates/deploy/src/units.rs b/crates/deploy/src/units.rs index 16b7aaba..6d2f7f02 100644 --- a/crates/deploy/src/units.rs +++ b/crates/deploy/src/units.rs @@ -58,7 +58,7 @@ fn unit_section(state_q: &str, prefix_q: &str, lab_q: &str) -> String { unit.push_str("# Generated by `leleka up`; edit the run configuration, not this file.\n"); unit.push_str("[Unit]\n"); unit.push_str("Description=Leleka runtime (engine, gateway and API on loopback)\n"); - unit.push_str("Documentation=https://github.com/paveldhq/strata-next\n"); + unit.push_str("Documentation=https://github.com/paveldhq/leleka-api\n"); unit.push_str("After=network.target\n"); // The model volume and the state must be mounted first; `lab-mode` in the state directory keeps the service from // starting while the GPU belongs to the lab queue (`docs/unattended.md`). diff --git a/crates/engine-qwen35-cuda/src/model_binding/kar_expert_source.rs b/crates/engine-qwen35-cuda/src/model_binding/kar_expert_source.rs index e8da885d..576f424c 100644 --- a/crates/engine-qwen35-cuda/src/model_binding/kar_expert_source.rs +++ b/crates/engine-qwen35-cuda/src/model_binding/kar_expert_source.rs @@ -47,7 +47,7 @@ pub struct KarExpertLevels { pub overlay: u8, } /// Operator-owned immutable inputs. The overlay is the already -/// provenance-verified output of `strata-next model resolve-kar-overlay`. +/// provenance-verified output of `leleka-api model resolve-kar-overlay`. pub struct KarExpertSourceConfig { pub base: KarArchiveRef, pub overlay: Option, diff --git a/crates/gateway-domain/Cargo.toml b/crates/gateway-domain/Cargo.toml index 119a35d1..ce50f280 100644 --- a/crates/gateway-domain/Cargo.toml +++ b/crates/gateway-domain/Cargo.toml @@ -15,7 +15,7 @@ leleka-serving-policy = { path = "../serving-policy" } leleka-tokenizer = { path = "../tokenizer" } leleka-worker-protocol = { path = "../worker-protocol" } serde = { version = "1", features = ["derive"] } -# `preserve_order` and `float_roundtrip` as in leleka-gateway-text and strata-control: tool-call arguments and schemas keep +# `preserve_order` and `float_roundtrip` as in leleka-gateway-text and leleka-control-plane: tool-call arguments and schemas keep # the order the client wrote them (json_order.rs builds the sorted forms explicitly). serde_json = { version = "1", features = ["float_roundtrip", "preserve_order"] } diff --git a/crates/gateway-domain/src/chat_completions.rs b/crates/gateway-domain/src/chat_completions.rs index 23930423..d96aca44 100644 --- a/crates/gateway-domain/src/chat_completions.rs +++ b/crates/gateway-domain/src/chat_completions.rs @@ -1,6 +1,6 @@ //! Chat Completions requests as Responses requests (STRA-338 S21): the wire types, the translation, and the response //! fields a chat reply takes from the native Responses object. Pure JSON in, JSON out; the HTTP adapter is -//! `strata-control`'s `chat`. +//! `leleka-control-plane`'s `chat`. use serde::Deserialize; use serde_json::{Value, json}; diff --git a/crates/gateway-domain/src/json_order.rs b/crates/gateway-domain/src/json_order.rs index c0ac6f8a..923c209f 100644 --- a/crates/gateway-domain/src/json_order.rs +++ b/crates/gateway-domain/src/json_order.rs @@ -4,7 +4,7 @@ //! without it every object is a `BTreeMap` (keys sorted), with it an `IndexMap` (keys in the order they were parsed or //! inserted). Cargo unifies features across the dependency graph, so a crate that merely depends on `serde_json` cannot //! tell which one it gets: `leleka-harmony` enabled `preserve_order` on 2026-10-14 (its Harmony renderer prints tool -//! schemas in the order the client wrote them), and from then on every `Value` in `strata-next` kept insertion order +//! schemas in the order the client wrote them), and from then on every `Value` in `leleka-api` kept insertion order //! while the same code in a build without that crate sorted. The error `tool_result` wrapper in `messages.rs` changed //! its bytes that way without a line of it changing. //! @@ -13,8 +13,8 @@ //! * **Client or model order** (the Original is Python: `json.loads` keeps the order, `tojson` is `sort_keys=False`, //! and so are `json.dumps(schema)` for `text.format` and `json.dumps(block)` for an MCP result): tool-call argument //! objects re-rendered as `` blocks, tool schemas in the prompt, `text.format` schemas, MCP result -//! blocks, the arguments string handed back to a client. This needs `preserve_order`, so `strata-control` and -//! `strata-desktop-core` declare it themselves in their `Cargo.toml` and the tests below fail if it is ever off. +//! blocks, the arguments string handed back to a client. This needs `preserve_order`, so `leleka-control-plane` and +//! `leleka-engine-host` declare it themselves in their `Cargo.toml` and the tests below fail if it is ever off. //! * **Sorted** (the text is a Leleka format that the Python oracle `scripts/smoke-messages.py` writes with //! `sort_keys=True`): the Messages error `tool_result` wrapper. Built by [`to_string_sorted`], which does not depend //! on the feature. diff --git a/crates/gateway-domain/src/lib.rs b/crates/gateway-domain/src/lib.rs index 2f3b3bbe..039377cd 100644 --- a/crates/gateway-domain/src/lib.rs +++ b/crates/gateway-domain/src/lib.rs @@ -1,4 +1,4 @@ -//! Pure domain of the HTTP/Responses gateway (`strata-control`), layer L2 of `architecture.json`. +//! Pure domain of the HTTP/Responses gateway (`leleka-control-plane`), layer L2 of `architecture.json`. //! //! * `sampling`: the sampling extensions a client may send and their validation, `EngineTune`. //! * `reasoning_budget`: the thinking budget driver (generic over the engine and the tokenizer). @@ -10,7 +10,7 @@ //! * `json_order`: tool results and schemas in the order the client wrote them, or sorted where wanted. //! //! Nothing here starts a thread, opens a socket or reads the environment, so the gateway rules can be tested without -//! tokio, axum or an engine. The HTTP layer, the ports and their adapters stay in `strata-control`. +//! tokio, axum or an engine. The HTTP layer, the ports and their adapters stay in `leleka-control-plane`. pub mod chat_completions; pub mod codec; diff --git a/crates/gateway-domain/src/messages.rs b/crates/gateway-domain/src/messages.rs index 7491d69e..bbdfb8a9 100644 --- a/crates/gateway-domain/src/messages.rs +++ b/crates/gateway-domain/src/messages.rs @@ -1,5 +1,5 @@ //! The pure part of the Anthropic Messages adapter: the request as a Responses request, and the reply fields. -//! The route layers, the SSE adaptation and the HTTP errors stay in `strata-control`. +//! The route layers, the SSE adaptation and the HTTP errors stay in `leleka-control-plane`. pub mod reply; pub mod request; diff --git a/crates/gateway-domain/src/responses.rs b/crates/gateway-domain/src/responses.rs index 7f7be5a5..b5117b7b 100644 --- a/crates/gateway-domain/src/responses.rs +++ b/crates/gateway-domain/src/responses.rs @@ -1,6 +1,6 @@ //! The Responses protocol without its transport: the request type and its validation, the prompt a request renders //! to, the output items read back from the model's text, and the response object with its event stream. -//! Moved from `strata-control` (STRA-338 S21); the HTTP handlers, the history and the streaming loops stay there. +//! Moved from `leleka-control-plane` (STRA-338 S21); the HTTP handlers, the history and the streaming loops stay there. pub mod effort; pub mod harmony_conversation; diff --git a/crates/gateway-text/Cargo.toml b/crates/gateway-text/Cargo.toml index d74f445f..23434a3b 100644 --- a/crates/gateway-text/Cargo.toml +++ b/crates/gateway-text/Cargo.toml @@ -14,7 +14,7 @@ minijinja = { version = "=2.24.0", default-features = false, features = ["builti minijinja-contrib = { version = "=2.24.0", default-features = false, features = ["pycompat"] } serde = { version = "1", features = ["derive"] } # `preserve_order`: tool-call arguments and schemas reach the model in the order the client wrote them (see prompt.rs). -# `float_roundtrip` is what both consumers already get through leleka-runtime / strata-control. +# `float_roundtrip` is what both consumers already get through leleka-runtime / leleka-control-plane. serde_json = { version = "1", features = ["float_roundtrip", "preserve_order"] } sha2 = "0.11" diff --git a/crates/gateway-text/src/lib.rs b/crates/gateway-text/src/lib.rs index 0ff1ec92..05406b52 100644 --- a/crates/gateway-text/src/lib.rs +++ b/crates/gateway-text/src/lib.rs @@ -1,4 +1,4 @@ -//! Pure text logic shared by the gateway (`strata-control`) and the desktop daemon (`strata-desktop-core`). +//! Pure text logic shared by the gateway (`leleka-control-plane`) and the desktop daemon (`leleka-engine-host`). //! //! These three modules used to live in `control-plane/src` and were compiled a second time into `desktop-core` //! through `#[path]`. They need only `minijinja`, `serde`, `serde_json`, `sha2`, `regex` and `hex`, so they are a leaf diff --git a/crates/harmony/Cargo.toml b/crates/harmony/Cargo.toml index 79b66f81..3a501906 100644 --- a/crates/harmony/Cargo.toml +++ b/crates/harmony/Cargo.toml @@ -9,7 +9,7 @@ rust-version.workspace = true [dependencies] # `preserve_order` is part of this crate's contract: the renderer prints tool schemas and call arguments in the order the client # wrote them (as llama.cpp's minja does), and `tests/render_oracle.rs` fails without it. Cargo unifies features, so it also -# reaches every crate built next to this one; those that rely on it (strata-control, strata-desktop-core) declare it themselves. +# reaches every crate built next to this one; those that rely on it (leleka-control-plane, leleka-engine-host) declare it themselves. serde_json = { version = "1", features = ["preserve_order"] } [lints] diff --git a/crates/model-format/README.md b/crates/model-format/README.md index 8dc5e721..a6f4469b 100644 --- a/crates/model-format/README.md +++ b/crates/model-format/README.md @@ -53,7 +53,7 @@ an I/O failure cannot be retracted. The existing path APIs and tensor geometry remain unchanged. Descriptor, tensor and tokenizer semantics, memory admission, GPU allocation, readiness and real-model parity remain separate work. -The current `strata-control` still has its legacy GGML/build dependencies; +The current `leleka-control-plane` still has its legacy GGML/build dependencies; extracting this crate does not remove them from that package or its runtime. ## Standalone checks diff --git a/crates/model-format/src/kar_levels.rs b/crates/model-format/src/kar_levels.rs index fc5b33ac..dc0c3058 100644 --- a/crates/model-format/src/kar_levels.rs +++ b/crates/model-format/src/kar_levels.rs @@ -9,7 +9,7 @@ //! //! It performs no I/O, owns no CUDA state and verifies nothing about archive //! contents: archive identity, payload CRCs and overlay provenance (see -//! `strata-next model resolve-kar-overlay`) are the loader's responsibility +//! `leleka-api model resolve-kar-overlay`) are the loader's responsibility //! and must have succeeded before records are handed in. An overlay replaces a //! base record by name; it is never an additive residual. //! diff --git a/crates/offline-tools/src/cli.rs b/crates/offline-tools/src/cli.rs index cfdccf6a..dd137129 100644 --- a/crates/offline-tools/src/cli.rs +++ b/crates/offline-tools/src/cli.rs @@ -1,4 +1,4 @@ -//! `strata-next tools ...`: the argument parsing for the ports in this crate. Each subcommand mirrors its +//! `leleka-api tools ...`: the argument parsing for the ports in this crate. Each subcommand mirrors its //! Python tool's flags. use std::path::{Path, PathBuf}; @@ -109,7 +109,7 @@ fn run_mtp_rt(flags: &Flags) -> Result { pub fn run(args: &[String]) -> Result { let [command, rest @ ..] = args else { - return Err(format!("usage: strata-next {USAGE}").into()); + return Err(format!("usage: leleka-api {USAGE}").into()); }; let flags = Flags { args: rest }; match command.as_str() { @@ -125,7 +125,7 @@ pub fn run(args: &[String]) -> Result { "make-profile" => run_make_profile(&flags, rest), "mtp-rt" => run_mtp_rt(&flags), other => { - Err(format!("unknown tools subcommand {other}; usage: strata-next {USAGE}").into()) + Err(format!("unknown tools subcommand {other}; usage: leleka-api {USAGE}").into()) } } } diff --git a/crates/offline-tools/src/lib.rs b/crates/offline-tools/src/lib.rs index 429cafd9..8b919b43 100644 --- a/crates/offline-tools/src/lib.rs +++ b/crates/offline-tools/src/lib.rs @@ -8,7 +8,7 @@ //! | `make_profile` | `tools/make_profile.py` | `STRP` v1 expert-cache profile | //! | `mtp_rt` | `tools/mtp_rt.py` | MTP `experts.bin`, `dense.bin`, `dense.txt` | //! -//! Differential harness: `scripts/offline/diff_tools.py` runs each oracle and the matching `strata-next tools` +//! Differential harness: `scripts/offline/diff_tools.py` runs each oracle and the matching `leleka-api tools` //! subcommand on synthetic inputs and compares every output byte. Offline conversion only; production serving //! never links this crate's CLI paths into a request path. diff --git a/crates/runtime-client/src/convert.rs b/crates/runtime-client/src/convert.rs index 4088e482..052fe97c 100644 --- a/crates/runtime-client/src/convert.rs +++ b/crates/runtime-client/src/convert.rs @@ -1,5 +1,5 @@ //! Conversions between the backend contract and the `leleka.runtime.v1` wire messages, shared by -//! the server (`strata-desktop-core`) and the clients (the daemon gateway and `strata-next`). +//! the server (`leleka-engine-host`) and the clients (the daemon gateway and `leleka-api`). use leleka_backend_api as api; use std::net::SocketAddr; use tonic::Status; diff --git a/crates/runtime-client/src/lib.rs b/crates/runtime-client/src/lib.rs index 6e6d5b53..a53707ad 100644 --- a/crates/runtime-client/src/lib.rs +++ b/crates/runtime-client/src/lib.rs @@ -1,7 +1,7 @@ //! The client side of the `leleka.runtime.v1` gRPC contract between a gateway and `leleka-inference`. //! //! * [`proto`]: the generated wire messages and both service stubs (the server implementation lives in -//! `strata-desktop-core`); +//! `leleka-engine-host`); //! * [`convert`]: backend-contract <-> wire conversions and the credential / loopback rules; //! * [`client`]: [`client::RuntimeClient`], one authenticated channel whose every answer is validated //! (epochs, sequence numbers, a terminal frame before end of stream); diff --git a/crates/runtime-client/tests/grpc_backend.rs b/crates/runtime-client/tests/grpc_backend.rs index 1f7960b5..8e542749 100644 --- a/crates/runtime-client/tests/grpc_backend.rs +++ b/crates/runtime-client/tests/grpc_backend.rs @@ -2,7 +2,7 @@ //! //! The server here is a stand-in: it answers snapshots, replays the frames a test gives it and counts //! cancels. The full chain with the real `RuntimeServer` and a scripted engine behind it is exercised -//! in `strata-desktop-core` (`tests/api_over_runtime.rs`). Nothing here loads a model. +//! in `leleka-engine-host` (`tests/api_over_runtime.rs`). Nothing here loads a model. use std::{ net::SocketAddr, diff --git a/crates/worker-protocol/src/lib.rs b/crates/worker-protocol/src/lib.rs index d9d70e31..6cae1289 100644 --- a/crates/worker-protocol/src/lib.rs +++ b/crates/worker-protocol/src/lib.rs @@ -6,8 +6,8 @@ //! //! Both ends live here so they cannot drift: [`lines`] writes what a worker prints, [`events`] reads it as the gateway //! does, and [`command`] reads what the gateway sends a CPU worker. The gateway's richer `GEN` writer (every sampling -//! key of the Original, golden tested against the Python server) stays in `strata-control`'s `wire.rs`; this crate -//! holds the parts both sides share. +//! key of the Original, golden tested against the Python server) stays in `leleka-control-plane`'s `wire.rs`; this +//! crate holds the parts both sides share. pub mod command; pub mod events; diff --git a/deploy/Dockerfile.linux-check b/deploy/Dockerfile.linux-check index f7e76cf7..3e082c0e 100644 --- a/deploy/Dockerfile.linux-check +++ b/deploy/Dockerfile.linux-check @@ -10,4 +10,4 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry --mount=type=cache,targe cargo test --release -p leleka-cpu-sys -p leleka-cpu-kernels -p leleka-gptoss -p leleka-cpu-worker -p leleka-gguf \ -p leleka-tokenizer -p leleka-shm -p leleka-npu-service -p leleka-gptoss-npu -p leleka-npu-worker \ -p leleka-igpu -p leleka-gptoss-igpu -p leleka-igpu-worker \ - && cargo build --release -p strata-control -p leleka-cpu-worker -p leleka-igpu-worker -p leleka-npu-worker -p leleka-npu-service + && cargo build --release -p leleka-control-plane -p leleka-cpu-worker -p leleka-igpu-worker -p leleka-npu-worker -p leleka-npu-service diff --git a/deploy/Dockerfile.runtime b/deploy/Dockerfile.runtime index ff6af8b1..6d854fc0 100644 --- a/deploy/Dockerfile.runtime +++ b/deploy/Dockerfile.runtime @@ -4,12 +4,12 @@ FROM ${BASE} ARG BUILD_ID ARG PACKAGE_KIND LABEL io.strata.build-id=${BUILD_ID} io.strata.package-kind=${PACKAGE_KIND} -COPY --chmod=0555 strata-next-linux-x86_64-musl /usr/local/bin/strata-next +COPY --chmod=0555 leleka-api-linux-x86_64-musl /usr/local/bin/leleka-api COPY --chmod=0444 PROVENANCE.json SHA256SUMS /usr/share/strata/ ENV NVIDIA_VISIBLE_DEVICES=void NVIDIA_DRIVER_CAPABILITIES=compute,utility STRATA_BIND=0.0.0.0:8081 USER 65532:65532 WORKDIR /tmp EXPOSE 8081 STOPSIGNAL SIGTERM -ENTRYPOINT ["/usr/local/bin/strata-next"] +ENTRYPOINT ["/usr/local/bin/leleka-api"] CMD ["serve"] diff --git a/deploy/Dockerfile.static-cli b/deploy/Dockerfile.static-cli index 191c3716..9a4fdad0 100644 --- a/deploy/Dockerfile.static-cli +++ b/deploy/Dockerfile.static-cli @@ -17,9 +17,9 @@ COPY control-plane/ ./control-plane/ COPY engine/strata/LICENSE ./engine/strata/LICENSE COPY engine/strata/serve/chat_template.jinja ./engine/strata/serve/chat_template.jinja RUN cargo build --manifest-path control-plane/Cargo.toml --locked --release \ - --target "${RUST_TARGET}" --bin strata-next + --target "${RUST_TARGET}" --bin leleka-api FROM scratch ARG RUST_TARGET=x86_64-unknown-linux-musl -COPY --from=build /src/control-plane/target/${RUST_TARGET}/release/strata-next /strata-next -ENTRYPOINT ["/strata-next"] +COPY --from=build /src/control-plane/target/${RUST_TARGET}/release/leleka-api /leleka-api +ENTRYPOINT ["/leleka-api"] diff --git a/deploy/Dockerfile.windows-build b/deploy/Dockerfile.windows-build index e5a69269..92435a4a 100644 --- a/deploy/Dockerfile.windows-build +++ b/deploy/Dockerfile.windows-build @@ -20,10 +20,10 @@ ENV CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER=x86_64-w64-mingw32-gcc \ RUN --mount=type=cache,target=/usr/local/cargo/registry \ --mount=type=cache,target=/src/target \ cargo build --release --target x86_64-pc-windows-gnu \ - -p strata-control -p leleka-cpu-worker -p leleka-igpu-worker -p leleka-npu-worker \ + -p leleka-control-plane -p leleka-cpu-worker -p leleka-igpu-worker -p leleka-npu-worker \ -p leleka-npu-service -p leleka-gpu-npu-worker \ && mkdir /out \ - && for b in strata-next leleka-cpu-worker leleka-igpu-worker leleka-npu-worker leleka-npu-service leleka-gpu-npu-worker; do \ + && for b in leleka-api leleka-cpu-worker leleka-igpu-worker leleka-npu-worker leleka-npu-service leleka-gpu-npu-worker; do \ cp target/x86_64-pc-windows-gnu/release/$b.exe /out/; done FROM scratch AS export diff --git a/deploy/README.md b/deploy/README.md index ec0cced4..d92803cd 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -1,10 +1,10 @@ # Deployment -Linux CI builds a statically linked musl CLI/control-plane preview and publishes it as a prerelease artifact on version tags. This is not yet a complete GPU runtime: the C++/CUDA engine is not linked into that executable. The host must have a compatible NVIDIA driver already installed (CUDA 13.0 GA baseline: 580.65.06 or newer). The `strata-next doctor` command checks the installed version. Model weights belong on an external volume. A complete GPU deployment image has not been built yet. +Linux CI builds a statically linked musl CLI/control-plane preview and publishes it as a prerelease artifact on version tags. This is not yet a complete GPU runtime: the C++/CUDA engine is not linked into that executable. The host must have a compatible NVIDIA driver already installed (CUDA 13.0 GA baseline: 580.65.06 or newer). The `leleka-api doctor` command checks the installed version. Model weights belong on an external volume. A complete GPU deployment image has not been built yet. For a local static CLI image smoke test, build `deploy/Dockerfile.static-cli` with a Linux/musl target. The final image is `scratch` plus the CLI binary. It is a packaging test, not the deployment image for inference. -The Rust engine pair (`leleka-inference` behind `leleka-daemon`) is a separate runtime from `strata-next` plus the C++ engine described below: its run recipe, example configuration and systemd templates are in [`docs/rust-runtime-run.md`](../docs/rust-runtime-run.md) and [`deploy/rust-runtime/`](rust-runtime/), and the open delivery items are in [`docs/delivery-gap-audit.md`](../docs/delivery-gap-audit.md). It needs CUDA 12 `libcublas.so.12` (not the `.so.13` named below) and a driver of 595 or newer. +The Rust engine pair (`leleka-inference` behind `leleka-daemon`) is a separate runtime from `leleka-api` plus the C++ engine described below: its run recipe, example configuration and systemd templates are in [`docs/rust-runtime-run.md`](../docs/rust-runtime-run.md) and [`deploy/rust-runtime/`](rust-runtime/), and the open delivery items are in [`docs/delivery-gap-audit.md`](../docs/delivery-gap-audit.md). It needs CUDA 12 `libcublas.so.12` (not the `.so.13` named below) and a driver of 595 or newer. ## Worker recovery @@ -64,7 +64,7 @@ For an authenticated deployment, initialize its credential using the executable: ```sh mkdir -m 700 /absolute/private/config -/absolute/path/strata-next api-key init --file /absolute/private/config/api.key +/absolute/path/leleka-api api-key init --file /absolute/private/config/api.key ``` Set `api_key_file` in the serving config (or `STRATA_API_KEY_FILE`) to this path; @@ -79,12 +79,12 @@ service; retain the key outside Git and container images. The native executable can install and operate its per-user service directly: ```sh -/absolute/path/strata-next service-install \ +/absolute/path/leleka-api service-install \ --config /absolute/path/config.json --working-dir /absolute/path/workdir \ - --unit strata-next-prod.service --start -/absolute/path/strata-next service-control status \ + --unit leleka-api-prod.service --start +/absolute/path/leleka-api service-control status \ --config /absolute/path/config.json --working-dir /absolute/path/workdir \ - --unit strata-next-prod.service + --unit leleka-api-prod.service ``` `service-control` accepts `status`, `start`, `stop`, `restart`, `enable`, `disable`, @@ -104,9 +104,9 @@ for actual model readiness. No journal or environment contents are returned. For a managed start that also verifies model readiness, use: ```sh -/absolute/path/strata-next service-control start-ready \ +/absolute/path/leleka-api service-control start-ready \ --config /absolute/path/config.json --working-dir /absolute/path/workdir \ - --unit strata-next-prod.service \ + --unit leleka-api-prod.service \ --ready-url http://127.0.0.1:18082 --ready-model MODEL_ID \ --ready-key-file /absolute/path/api.key --ready-timeout-s 120 ``` @@ -171,7 +171,7 @@ Save a private (mode 600), owned catalog, for example: "provision_timeout_s": 3600, "profiles": { "alpha": { - "unit": "strata-next-alpha.service", + "unit": "leleka-api-alpha.service", "config": "/home/operator/strata/alpha/config.json", "working_dir": "/home/operator/strata/alpha", "url": "http://127.0.0.1:18082", @@ -180,7 +180,7 @@ Save a private (mode 600), owned catalog, for example: "timeout_s": 300 }, "beta": { - "unit": "strata-next-beta.service", + "unit": "leleka-api-beta.service", "config": "/home/operator/strata/beta/config.json", "working_dir": "/home/operator/strata/beta", "url": "http://127.0.0.1:18082", @@ -193,7 +193,7 @@ Save a private (mode 600), owned catalog, for example: ``` ```sh -strata-next service-switch --catalog /home/operator/strata/catalog.json \ +leleka-api service-switch --catalog /home/operator/strata/catalog.json \ --from alpha --to beta --state-dir /home/operator/strata/switch-state ``` @@ -253,7 +253,7 @@ out, its process is killed/reaped; the manager job may still be pending. Inspect status before retrying. A moved executable or changed unit/config identity requires explicit reconciliation; control does not guess which service to use. -For manual installation or unit inspection, `strata-next service-unit` renders a **systemd user unit** to stdout. It does +For manual installation or unit inspection, `leleka-api service-unit` renders a **systemd user unit** to stdout. It does not install, start, enable or replace a service. Provision the native executable, engine, tokenizer and private JSON configuration first; all supplied paths must be absolute and exist. Systemd disallows quotes and backslashes in the executable @@ -263,16 +263,16 @@ on the Linux host: ```sh umask 077 mkdir -p "$HOME/.config/systemd/user" -/absolute/path/strata-next service-unit \ +/absolute/path/leleka-api service-unit \ --config /absolute/path/config.json \ --working-dir /absolute/path/engine-workdir \ - --env-file /absolute/path/runtime.env > "$HOME/strata-next.service" -systemd-analyze --user verify "$HOME/strata-next.service" + --env-file /absolute/path/runtime.env > "$HOME/leleka-api.service" +systemd-analyze --user verify "$HOME/leleka-api.service" # Review the generated unit before installing. Do not overwrite a live unit. -systemctl --user link "$HOME/strata-next.service" -systemctl --user start strata-next.service -systemctl --user status strata-next.service -journalctl --user -u strata-next.service -n 100 +systemctl --user link "$HOME/leleka-api.service" +systemctl --user start leleka-api.service +systemctl --user status leleka-api.service +journalctl --user -u leleka-api.service -n 100 ``` Omit `--env-file` if unnecessary. The file uses systemd EnvironmentFile syntax, @@ -295,8 +295,8 @@ retention is managed by the host; model and capture paths should remain private. To stop and remove an explicitly installed service: ```sh -systemctl --user stop strata-next.service -systemctl --user disable strata-next.service +systemctl --user stop leleka-api.service +systemctl --user disable leleka-api.service systemctl --user daemon-reload ``` @@ -314,16 +314,16 @@ launcher integration (the installer preserves the selected connection): ```sh python3 scripts/install-qwen-native.py python3 scripts/install-qwen-native-service.py -qwen-codex-ctl native-service status --host rnr5090 --unit strata-next.service -qwen-codex-ctl native-service start --host rnr5090 --unit strata-next.service -qwen-codex-ctl native-service logs --host rnr5090 --unit strata-next.service -qwen-codex-ctl native-service stop --host rnr5090 --unit strata-next.service +qwen-codex-ctl native-service status --host rnr5090 --unit leleka-api.service +qwen-codex-ctl native-service start --host rnr5090 --unit leleka-api.service +qwen-codex-ctl native-service logs --host rnr5090 --unit leleka-api.service +qwen-codex-ctl native-service stop --host rnr5090 --unit leleka-api.service ``` These operate on an **already provisioned** systemd user unit through SSH; they never install, enable, migrate or switch a model. The host defaults to the -launcher's configured SSH alias, and the unit to `strata-next.service`. Optional -unit names must follow `strata-next-NAME.service`. Start/stop are idempotent; +launcher's configured SSH alias, and the unit to `leleka-api.service`. Optional +unit names must follow `leleka-api-NAME.service`. Start/stop are idempotent; SSH calls time out after 90 seconds. Logs show the selected unit's last 100 entries. No service credentials are copied or stored by this helper. @@ -424,7 +424,7 @@ part of the existing laptop harness; native production serving remains Rust. Verification without GPU inference: ```sh -python3 scripts/smoke-service-unit.py /absolute/path/strata-next --lifecycle +python3 scripts/smoke-service-unit.py /absolute/path/leleka-api --lifecycle ``` This creates and removes an isolated CPU-only service on an unused loopback @@ -473,7 +473,7 @@ explicitly choose to stop, accepting interruption, using the service manager. Optional signal grace: set top-level `shutdown_grace_s` in the native JSON config or `STRATA_SHUTDOWN_GRACE_S` in its environment (integer 0–20 seconds, default 0). -`strata-next check-config` reports the effective setting. A positive value lets +`leleka-api check-config` reports the effective setting. A positive value lets admitted requests finish after SIGTERM/SIGINT, until the grace expires. During that interval lifecycle reports `shutting_down: true`, readiness is false, new inference is rejected, and resume cannot reopen admission. Worker shutdown @@ -492,7 +492,7 @@ long-running user workloads require separate qualification. ## Optional embedded engine preview -A private build can carry a pinned Linux engine executable inside `strata-next`: +A private build can carry a pinned Linux engine executable inside `leleka-api`: ```sh export STRATA_EMBED_ENGINE_PATH=/absolute/path/to/verified/strata @@ -511,10 +511,10 @@ Normal builds without these variables remain control-plane-only builds. The copy/hash stage uses a fixed buffer; Rust compilation/linking still process the full payload and require memory and disk space proportional to its size. -`strata-next engine-info` reports payload identity without executing it. -`strata-next engine-help` materializes the embedded worker and runs its `--help` +`leleka-api engine-info` reports payload identity without executing it. +`leleka-api engine-help` materializes the embedded worker and runs its `--help` with no GPU visible; this checks loading and help output, not model readiness. -`strata-next --engine-license` prints the imported Strata MIT license. The +`leleka-api --engine-license` prints the imported Strata MIT license. The upstream record in `docs/upstream.md` remains authoritative and unchanged. Select the embedded worker explicitly in the usual configuration: @@ -555,7 +555,7 @@ clean-node, real-model and license/distribution gates. ## Validate configuration before switching a service ```sh -strata-next check-config --config /absolute/path/to/native.json +leleka-api check-config --config /absolute/path/to/native.json ``` This native command reads the same configuration, environment overrides, key file @@ -571,7 +571,7 @@ updated helper: ```sh python3 scripts/install-qwen-native-service.py qwen-codex-ctl native-service check-config --host rnr5090 \ - --binary /absolute/path/to/candidate/strata-next \ + --binary /absolute/path/to/candidate/leleka-api \ --config /absolute/path/to/native.json \ --working-dir /absolute/path/to/engine-workdir ``` @@ -681,7 +681,7 @@ The example requires a Linux executable built with an embedded engine. To acquire/verify the assets separately without starting the service: ```sh -strata-next provision --config /absolute/runtime.json +leleka-api provision --config /absolute/runtime.json ``` Paths must be absolute, without `..`; bundle destinations cannot overlap. @@ -719,7 +719,7 @@ The native CLI can now build a Qwen `qwen4exp` serving pack from locally present manifest-pinned GGUF shards: ```sh -strata-next model prepare-native-pack /absolute/shards.json \ +leleka-api model prepare-native-pack /absolute/shards.json \ --source-dir /absolute/models --output /absolute/packs/model-v1 ``` @@ -895,7 +895,7 @@ readiness**. It neither converts a raw MTP GGUF nor quantizes new weights. The existing offline `mtp_rt.py` conversion remains separate; its dense Q8 conversion must not be described as lossless. MTP activation stays explicit and real-model qualification is still required. CPU verification: -`python3 scripts/smoke-mtp-pack.py /path/to/strata-next` (synthetic sparse layout). +`python3 scripts/smoke-mtp-pack.py /path/to/leleka-api` (synthetic sparse layout). `scripts/smoke-native-bootstrap.py` verifies real HTTP acquisition, exact pack @@ -980,7 +980,7 @@ CUDA initialization. This is not a sandbox for arbitrary executables. `engine_probe_checked: false`. A successful help exit checks only that loader path, not lazy-loaded libraries, CUDA kernels, VRAM, MTP or real-model quality. A loader failure reports the stage and exit status without echoing child output; -use the engine's explicit `--help` (`strata-next engine-help` for embedded payloads) +use the engine's explicit `--help` (`leleka-api engine-help` for embedded payloads) for detailed local loader diagnostics. Full clean-node inference remains a separate qualification step. @@ -1092,7 +1092,7 @@ the switch rollback procedure. Omit `--from` to select the target from the same installed native catalog: ```sh -strata-next service-switch --catalog /home/operator/strata/catalog.json \ +leleka-api service-switch --catalog /home/operator/strata/catalog.json \ --to next --state-dir /home/operator/strata/switch-state ``` @@ -1112,8 +1112,8 @@ import other inference backends. ### Install and wait for model readiness in one command ```sh -strata-next service-install --config /home/operator/strata/runtime.json \ - --working-dir /home/operator/strata --unit strata-next-main.service \ +leleka-api service-install --config /home/operator/strata/runtime.json \ + --working-dir /home/operator/strata --unit leleka-api-main.service \ --start-ready --ready-url http://127.0.0.1:8080 --ready-model MODEL_ID \ --ready-key-file /home/operator/strata/api.key --ready-timeout-s 600 ``` @@ -1138,7 +1138,7 @@ any lifecycle command: ```sh sha256sum /home/operator/strata/switch-state/transaction.json -strata-next service-switch reconcile --catalog /home/operator/strata/catalog.json \ +leleka-api service-switch reconcile --catalog /home/operator/strata/catalog.json \ --state-dir /home/operator/strata/switch-state --expected-journal-sha SHA256_FROM_ABOVE ``` diff --git a/desktop-core/Cargo.toml b/desktop-core/Cargo.toml index 4deeb06e..7f63fbd2 100644 --- a/desktop-core/Cargo.toml +++ b/desktop-core/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "strata-desktop-core" +name = "leleka-engine-host" version = "0.1.0" edition = "2024" rust-version = "1.99" @@ -20,7 +20,7 @@ leleka-serving-policy = { path = "../crates/serving-policy" } leleka-gateway-text = { path = "../crates/gateway-text" } serde = { version = "1", features = ["derive"] } # `preserve_order`: the native adapter re-renders tool-call arguments in the order the client wrote them (as the Python Original -# and strata-control do). Without it a build of this crate alone sorted the keys while a build next to strata-control did not. +# and leleka-control-plane do). Without it a build of this crate alone sorted the keys while a build next to leleka-control-plane did not. serde_json = { version = "1", features = ["preserve_order"] } sysinfo = { version = "0.39.6", default-features = false, features = ["system"] } tokio = { version = "1", features = ["rt", "macros", "process", "io-util", "time", "sync", "net", "signal", "fs"] } @@ -47,7 +47,7 @@ rustix = { version = "=1.1.5", features = ["fs"] } leleka-engine-fake = { path = "../crates/engine-fake" } # The full chain test: the real API router in front of the real RuntimeServer and a scripted engine. leleka-backend-api = { path = "../crates/backend-api", features = ["scripted"] } -strata-control = { path = "../control-plane" } +leleka-control-plane = { path = "../control-plane" } tokio = { version = "1", features = ["rt-multi-thread"] } [features] diff --git a/desktop-core/INSTALL.md b/desktop-core/INSTALL.md index ed3b8645..6495b9d5 100644 --- a/desktop-core/INSTALL.md +++ b/desktop-core/INSTALL.md @@ -1,7 +1,7 @@ # Private SSH installation (STRA-52) `remote-install CONFIG.json` transfers a trusted operator-pinned local Rust helper -and a worker profile into `$HOME/.strata-next/installations/SLOT` over authenticated +and a worker profile into `$HOME/.leleka-api/installations/SLOT` over authenticated OpenSSH. The profile names a backend already installed on the target. No backend, model, driver or service is implicitly downloaded or started. @@ -53,7 +53,7 @@ For activation, retain only `schema_version`, `target`, `runtime_sha256`, and `profile_sha256` (the latter two from the install receipt). Activation can select any previously installed matching bundle, including the previous version. The selected helper/profile live under -`$HOME/.strata-next/installations/SLOT/releases/RELEASE/`. `current` contains +`$HOME/.leleka-api/installations/SLOT/releases/RELEASE/`. `current` contains RELEASE. Installation receipts must be retained outside Git. The real SSH integration uses private fixture keys and a random test slot, tests diff --git a/desktop-core/examples/cp_replay_grpc.rs b/desktop-core/examples/cp_replay_grpc.rs index 13bc4be0..5ec0eba9 100644 --- a/desktop-core/examples/cp_replay_grpc.rs +++ b/desktop-core/examples/cp_replay_grpc.rs @@ -4,7 +4,7 @@ //! server-side handling, not the engine. //! //! ```text -//! cargo run --release -p strata-desktop-core --example cp_replay_grpc -- TOKENIZER_DIR SESSION.json [same options] +//! cargo run --release -p leleka-engine-host --example cp_replay_grpc -- TOKENIZER_DIR SESSION.json [same options] //! ``` #[path = "../../control-plane/examples/cp_replay/main.rs"] #[allow(dead_code)] @@ -20,7 +20,7 @@ use leleka_runtime_client::{ proto, }; use replay::{EngineMarks, InstantBackend}; -use strata_desktop_core::runtime_rpc::RuntimeServer; +use leleka_engine_host::runtime_rpc::RuntimeServer; /// What `leleka-cli load` does: one Load RPC for the current epoch, then wait for readiness. async fn load_the_model(address: std::net::SocketAddr, token: String) { diff --git a/desktop-core/examples/fake_runtime.rs b/desktop-core/examples/fake_runtime.rs index 944171d1..1ffe0130 100644 --- a/desktop-core/examples/fake_runtime.rs +++ b/desktop-core/examples/fake_runtime.rs @@ -27,8 +27,8 @@ use leleka_runtime_client::{ convert::{config_to_proto, descriptor_to_proto}, proto, }; -use strata_control::{reasoning_budget::Utf8Stream, tokenizer::Tokenizer, wire::Generate}; -use strata_desktop_core::runtime_rpc::RuntimeServer; +use leleka_control_plane::{reasoning_budget::Utf8Stream, tokenizer::Tokenizer, wire::Generate}; +use leleka_engine_host::runtime_rpc::RuntimeServer; #[path = "fake_runtime/pump.rs"] mod pump; diff --git a/desktop-core/examples/fake_runtime/pump.rs b/desktop-core/examples/fake_runtime/pump.rs index 3b70fbde..f7cf7e9e 100644 --- a/desktop-core/examples/fake_runtime/pump.rs +++ b/desktop-core/examples/fake_runtime/pump.rs @@ -8,7 +8,7 @@ use std::{ }; use leleka_backend_api as api; -use strata_control::{ +use leleka_control_plane::{ reasoning_budget::Utf8Stream, tokenizer::Tokenizer, wire::{self, Event, Finish}, diff --git a/desktop-core/src/bin/leleka-cli.rs b/desktop-core/src/bin/leleka-cli.rs index f894ba6e..640ad228 100644 --- a/desktop-core/src/bin/leleka-cli.rs +++ b/desktop-core/src/bin/leleka-cli.rs @@ -1,7 +1,7 @@ //! Configuration and typed lifecycle control through the local daemon. use serde_json::{Value, json}; use std::{path::Path, time::Duration}; -use strata_desktop_core::runtime_gateway::Config; +use leleka_engine_host::runtime_gateway::Config; type Failure = Box; /// The daemon route of a command and the JSON body it posts (none: a GET). diff --git a/desktop-core/src/bin/leleka-daemon.rs b/desktop-core/src/bin/leleka-daemon.rs index ab0ad1a1..eb1d7009 100644 --- a/desktop-core/src/bin/leleka-daemon.rs +++ b/desktop-core/src/bin/leleka-daemon.rs @@ -1,6 +1,6 @@ //! Local OpenAI gateway for an explicit set of authenticated gRPC runtimes. use std::path::Path; -use strata_desktop_core::runtime_gateway::{Config, Registry}; +use leleka_engine_host::runtime_gateway::{Config, Registry}; #[tokio::main(flavor = "current_thread")] async fn main() -> Result<(), Box> { diff --git a/desktop-core/src/bin/leleka-inference-evaluation.rs b/desktop-core/src/bin/leleka-inference-evaluation.rs index 33f313c6..3c6729fe 100644 --- a/desktop-core/src/bin/leleka-inference-evaluation.rs +++ b/desktop-core/src/bin/leleka-inference-evaluation.rs @@ -5,8 +5,8 @@ use leleka_runtime::backend::{ spawn_backend_observed_resident_mmq, spawn_backend_observed_windowed256_retained_gr, }; use std::{net::SocketAddr, path::PathBuf}; -use strata_desktop_core::runtime_rpc::RuntimeServer; -use strata_desktop_core::evaluation_measurement; +use leleka_engine_host::runtime_rpc::RuntimeServer; +use leleka_engine_host::evaluation_measurement; const HELP: &str = concat!( "leleka-inference --listen IP:PORT --token-env NAME --shard0 PATH --shard1 PATH --gpu ", @@ -93,7 +93,7 @@ fn runtime_credential(name: &str) -> Result { if name.is_empty() || !name.bytes().all(|b| b.is_ascii_alphanumeric() || b == b'_') { return Err("invalid_token_environment_name".into()); } - let token = strata_desktop_core::env_settings::credential(name).ok_or("missing_runtime_credential")?; + let token = leleka_engine_host::env_settings::credential(name).ok_or("missing_runtime_credential")?; if !(32..=4096).contains(&token.len()) || !token.bytes().all(|b| (0x21..=0x7e).contains(&b)) { return Err("invalid_runtime_credential".into()); } diff --git a/desktop-core/src/bin/leleka-inference/main.rs b/desktop-core/src/bin/leleka-inference/main.rs index f3998831..733c55d0 100644 --- a/desktop-core/src/bin/leleka-inference/main.rs +++ b/desktop-core/src/bin/leleka-inference/main.rs @@ -43,8 +43,8 @@ use leleka_runtime::backend::{ spawn_backend_observed_experimental_optimized_windowed256_adaptive_slots, verify_sources_only, }; use std::{net::SocketAddr, path::PathBuf}; -use strata_desktop_core::runtime_rpc::RuntimeServer; -use strata_desktop_core::evaluation_measurement; +use leleka_engine_host::runtime_rpc::RuntimeServer; +use leleka_engine_host::evaluation_measurement; const PUBLIC_EVALUATION_OUTPUT_FLAG: &str = "--public-evaluation-output"; const INTEGER_WINDOWED_FLAG: &str = "--experimental-native-integer-iq3-windowed256-retained-gr"; diff --git a/desktop-core/src/bin/leleka-inference/startup.rs b/desktop-core/src/bin/leleka-inference/startup.rs index 2bd1309f..c3d2ec27 100644 --- a/desktop-core/src/bin/leleka-inference/startup.rs +++ b/desktop-core/src/bin/leleka-inference/startup.rs @@ -150,7 +150,7 @@ fn runtime_credential(name: &str) -> Result { if name.is_empty() || !name.bytes().all(|b| b.is_ascii_alphanumeric() || b == b'_') { return Err("invalid_token_environment_name".into()); } - let token = strata_desktop_core::env_settings::credential(name).ok_or("missing_runtime_credential")?; + let token = leleka_engine_host::env_settings::credential(name).ok_or("missing_runtime_credential")?; if !(32..=4096).contains(&token.len()) || !token.bytes().all(|b| (0x21..=0x7e).contains(&b)) { return Err("invalid_runtime_credential".into()); } diff --git a/desktop-core/src/bin/leleka-seal-exec.rs b/desktop-core/src/bin/leleka-seal-exec.rs index 1bab9223..90756337 100644 --- a/desktop-core/src/bin/leleka-seal-exec.rs +++ b/desktop-core/src/bin/leleka-seal-exec.rs @@ -319,7 +319,7 @@ mod linux { #[test] #[ignore] fn launch_child() { - let Some((path, script)) = strata_desktop_core::env_settings::seal_exec_test_hook() else { + let Some((path, script)) = leleka_engine_host::env_settings::seal_exec_test_hook() else { return; }; let args = strings(&["--file", &path, "--", "sh", "-c", &script]); diff --git a/desktop-core/src/cli.rs b/desktop-core/src/cli.rs index a9edaf73..664057ab 100644 --- a/desktop-core/src/cli.rs +++ b/desktop-core/src/cli.rs @@ -26,7 +26,7 @@ pub(crate) const HELP: &str = concat!( /// The node credential held in the environment variable `name`; the node, its proxy and its worker client all take /// it this way, so this is the one place the command line reads it. pub(crate) fn node_credential(name: &str) -> Result> { - Ok(strata_desktop_core::env_settings::credential(name).ok_or("missing node credential")?) + Ok(leleka_engine_host::env_settings::credential(name).ok_or("missing node credential")?) } pub(crate) fn read_json( diff --git a/desktop-core/src/cli/node.rs b/desktop-core/src/cli/node.rs index 034cad2c..c80bc6f8 100644 --- a/desktop-core/src/cli/node.rs +++ b/desktop-core/src/cli/node.rs @@ -1,6 +1,6 @@ //! `node`: serves a node agent on a loopback address. use std::io::Write; -use strata_desktop_core::{gateway, managed_worker::Profile, node}; +use leleka_engine_host::{gateway, managed_worker::Profile, node}; type Failure = Box; diff --git a/desktop-core/src/cli/proxy.rs b/desktop-core/src/cli/proxy.rs index 37d5ad65..a60a92c8 100644 --- a/desktop-core/src/cli/proxy.rs +++ b/desktop-core/src/cli/proxy.rs @@ -9,7 +9,7 @@ pub(crate) async fn run( return Err("proxy must bind loopback".into()); } let token = super::node_credential(token_env)?; - let proxy = strata_desktop_core::node_proxy::Proxy::connect(address.parse()?, token).await?; + let proxy = leleka_engine_host::node_proxy::Proxy::connect(address.parse()?, token).await?; let listener = tokio::net::TcpListener::bind(listen).await?; axum::serve(listener, proxy.router()) .with_graceful_shutdown(async { diff --git a/desktop-core/src/cli/tunnel.rs b/desktop-core/src/cli/tunnel.rs index ab69ad3d..ee380643 100644 --- a/desktop-core/src/cli/tunnel.rs +++ b/desktop-core/src/cli/tunnel.rs @@ -10,7 +10,7 @@ pub(crate) async fn run(file: &str) -> Result<(), Failure> { } else { super::read_json(file)? }; - let tunnel = strata_desktop_core::ssh_tunnel::Tunnel::bind(&config).await?; + let tunnel = leleka_engine_host::ssh_tunnel::Tunnel::bind(&config).await?; let closed = stdio_lifetime.then(super::stdin_closed); let endpoint = format!("http://{}", tunnel.address()); println!( diff --git a/desktop-core/src/cli/worker.rs b/desktop-core/src/cli/worker.rs index 95e65470..c32b94ff 100644 --- a/desktop-core/src/cli/worker.rs +++ b/desktop-core/src/cli/worker.rs @@ -1,5 +1,5 @@ //! `worker`: one status, start, stop or operation query against a node. -use strata_desktop_core::node::{self, proto::*}; +use leleka_engine_host::node::{self, proto::*}; type Failure = Box; type Client = node_client::NodeClient; diff --git a/desktop-core/src/clock.rs b/desktop-core/src/clock.rs index abc306aa..8ea1e7f3 100644 --- a/desktop-core/src/clock.rs +++ b/desktop-core/src/clock.rs @@ -1,4 +1,4 @@ -//! The clock of the asynchronous code of `strata-desktop-core`: the tokio runtime's own, so a test that pauses tokio +//! The clock of the asynchronous code of `leleka-engine-host`: the tokio runtime's own, so a test that pauses tokio //! time (`tokio::time::pause`) moves every deadline and wait here at once. //! //! A deadline is read as `RuntimeClock.now() + timeout` and handed to `timeout_at` or compared in a poll loop. Code diff --git a/desktop-core/src/env_settings.rs b/desktop-core/src/env_settings.rs index 3bdd079b..969d3c33 100644 --- a/desktop-core/src/env_settings.rs +++ b/desktop-core/src/env_settings.rs @@ -1,4 +1,4 @@ -//! The only place `strata-desktop-core` and its binaries read the process environment. +//! The only place `leleka-engine-host` and its binaries read the process environment. //! //! The readers are live (each call asks the process) and return a parsed value instead of a raw string where the //! variable has a meaning of its own; a credential is read by the name the command line or the configuration gives, diff --git a/desktop-core/src/main.rs b/desktop-core/src/main.rs index 691d1f9e..dac4813d 100644 --- a/desktop-core/src/main.rs +++ b/desktop-core/src/main.rs @@ -2,7 +2,7 @@ mod cli; use cli::read_json; use std::env; -use strata_desktop_core::{gateway, hardware, planner, remote}; +use leleka_engine_host::{gateway, hardware, planner, remote}; type Failure = Box; @@ -82,17 +82,17 @@ async fn file_command(cmd: &str, file: &str) -> Output { } async fn remote_install_command(file: &str) -> Output { - let report = strata_desktop_core::remote_install::install(read_json(file)?).await?; + let report = leleka_engine_host::remote_install::install(read_json(file)?).await?; Ok(Some(serde_json::to_value(report)?)) } async fn remote_activate_command(file: &str) -> Output { - let report = strata_desktop_core::remote_install::activate(read_json(file)?).await?; + let report = leleka_engine_host::remote_install::activate(read_json(file)?).await?; Ok(Some(serde_json::to_value(report)?)) } fn validate_worker_command(file: &str) -> Output { - let profile: strata_desktop_core::managed_worker::Profile = read_json(file)?; + let profile: leleka_engine_host::managed_worker::Profile = read_json(file)?; profile.validate()?; Ok(None) } diff --git a/desktop-core/src/remote_install.sh b/desktop-core/src/remote_install.sh index 1599f8ec..edb593ba 100644 --- a/desktop-core/src/remote_install.sh +++ b/desktop-core/src/remote_install.sh @@ -37,9 +37,9 @@ verify() { [ "$(digest "$1/worker.json")" = "$strata_profile_hash" ] || fail profile_digest "$1/strata-desktop" validate-worker "$1/worker.json" /dev/null 2>&1 || fail profile_validation } -private_dir "$HOME/.strata-next" -private_dir "$HOME/.strata-next/installations" -strata_root="$HOME/.strata-next/installations/$strata_slot" +private_dir "$HOME/.leleka-api" +private_dir "$HOME/.leleka-api/installations" +strata_root="$HOME/.leleka-api/installations/$strata_slot" private_dir "$strata_root" private_dir "$strata_root/releases" mkdir "$strata_root/.lock" 2>/dev/null || fail slot_locked diff --git a/desktop-core/src/runtime_client.rs b/desktop-core/src/runtime_client.rs index faa051a4..6fe66314 100644 --- a/desktop-core/src/runtime_client.rs +++ b/desktop-core/src/runtime_client.rs @@ -1,2 +1,2 @@ -//! The runtime client moved to `leleka-runtime-client` so that `strata-next` can use it too. +//! The runtime client moved to `leleka-runtime-client` so that `leleka-api` can use it too. pub use leleka_runtime_client::client::{RuntimeClient, RuntimeGeneration, validate_snapshot}; diff --git a/desktop-core/tests/api_over_runtime/engine_loss.rs b/desktop-core/tests/api_over_runtime/engine_loss.rs index 746b6d8f..0db3fcee 100644 --- a/desktop-core/tests/api_over_runtime/engine_loss.rs +++ b/desktop-core/tests/api_over_runtime/engine_loss.rs @@ -4,7 +4,7 @@ use crate::harness::{Runtime, Stack, assert_one_terminal, body, sse_events, text use leleka_backend_api::scripted::Script; use serde_json::json; use std::time::Duration; -use strata_control::worker::WorkerState; +use leleka_control_plane::worker::WorkerState; /// Opens a streaming response and reads until the first text delta arrived. async fn stream_until_first_delta(stack: &Stack) -> reqwest::Response { diff --git a/desktop-core/tests/api_over_runtime/harness.rs b/desktop-core/tests/api_over_runtime/harness.rs index 854051a5..58bfecc9 100644 --- a/desktop-core/tests/api_over_runtime/harness.rs +++ b/desktop-core/tests/api_over_runtime/harness.rs @@ -9,11 +9,11 @@ use serde_json::{Value, json}; use std::net::SocketAddr; use std::sync::Arc; use std::time::{Duration, Instant}; -use strata_control::app::{AppState, EngineLink, ModelView, router}; -use strata_control::backend_worker::{BackendWorkerConfig, WorkerInbox, run_backend_worker}; -use strata_control::tokenizer::Tokenizer; -use strata_control::worker::{WorkerState, WorkerStatus}; -use strata_desktop_core::runtime_rpc::RuntimeServer; +use leleka_control_plane::app::{AppState, EngineLink, ModelView, router}; +use leleka_control_plane::backend_worker::{BackendWorkerConfig, WorkerInbox, run_backend_worker}; +use leleka_control_plane::tokenizer::Tokenizer; +use leleka_control_plane::worker::{WorkerState, WorkerStatus}; +use leleka_engine_host::runtime_rpc::RuntimeServer; use tokio::sync::{RwLock, mpsc, watch}; pub(super) const TOKEN: &str = "synthetic-api-over-runtime-token-0000"; @@ -57,7 +57,7 @@ pub(super) fn tokenizer(name: &str) -> Arc { fn write_byte_vocabulary(root: &std::path::Path) { let mut vocabulary = serde_json::Map::new(); - for (id, ch) in strata_control::tokenizer::byte_alphabet() + for (id, ch) in leleka_control_plane::tokenizer::byte_alphabet() .0 .iter() .enumerate() @@ -75,7 +75,7 @@ fn write_byte_vocabulary(root: &std::path::Path) { } pub(super) fn leleka_tokenizer_pattern() -> &'static str { - strata_control::tokenizer::QWEN35_PATTERN + leleka_control_plane::tokenizer::QWEN35_PATTERN } pub(super) fn runtime_config() -> RuntimeConfig { @@ -164,7 +164,7 @@ pub(super) struct Stack { impl Stack { pub(super) async fn start(name: &str, address: SocketAddr) -> Self { let tokenizer = tokenizer(name); - let prefix_view = Arc::new(strata_control::prefix_view::PrefixView::default()); + let prefix_view = Arc::new(leleka_control_plane::prefix_view::PrefixView::default()); let config = worker_config(tokenizer.clone(), prefix_view.clone()); let status = Arc::new(RwLock::new(WorkerStatus::default())); let (stop, stop_rx) = watch::channel(false); @@ -223,7 +223,7 @@ impl Stack { fn worker_config( tokenizer: Arc, - prefix_view: Arc, + prefix_view: Arc, ) -> BackendWorkerConfig { BackendWorkerConfig { tokenizer, @@ -243,21 +243,21 @@ fn worker_config( fn app_state( status: &Arc>, - requests: mpsc::Sender, - control: mpsc::Sender, + requests: mpsc::Sender, + control: mpsc::Sender, tokenizer: Arc, - prefix_view: Arc, + prefix_view: Arc, ) -> AppState { AppState { engine: EngineLink { worker: status.clone(), - client: Some(strata_control::adapters::ChannelEngine::shared(requests)), + client: Some(leleka_control_plane::adapters::ChannelEngine::shared(requests)), control: Some(control), ..Default::default() }, model: ModelView { name: Some("fixture".into()), - tokenizer: Some(Arc::new(strata_control::codec::qwen_codec_shared( + tokenizer: Some(Arc::new(leleka_control_plane::codec::qwen_codec_shared( tokenizer, ))), prefix_cache: prefix_view, diff --git a/desktop-core/tests/api_over_runtime/main.rs b/desktop-core/tests/api_over_runtime/main.rs index 075b16f9..d9881159 100644 --- a/desktop-core/tests/api_over_runtime/main.rs +++ b/desktop-core/tests/api_over_runtime/main.rs @@ -1,4 +1,4 @@ -//! The complete chain without a GPU: HTTP client -> `strata-next` router -> `backend_worker` -> +//! The complete chain without a GPU: HTTP client -> `leleka-api` router -> `backend_worker` -> //! `GrpcBackend` -> real HTTP/2 gRPC -> the real `RuntimeServer` -> a scripted engine behind the //! `Backend` contract. Everything but the engine is the production code path of the Rust runtime //! stack, so this is the closest thing to `leleka-inference` that runs in `cargo test`. diff --git a/desktop-core/tests/api_over_runtime/scale_and_prefix.rs b/desktop-core/tests/api_over_runtime/scale_and_prefix.rs index c8b434bf..ec1b00ca 100644 --- a/desktop-core/tests/api_over_runtime/scale_and_prefix.rs +++ b/desktop-core/tests/api_over_runtime/scale_and_prefix.rs @@ -4,7 +4,7 @@ use crate::harness::{Runtime, Stack, body, ready, usage}; use leleka_backend_api::scripted::Script; use serde_json::{Value, json}; use std::time::{Duration, Instant}; -use strata_control::worker::WorkerState; +use leleka_control_plane::worker::WorkerState; /// The runtime used to remember every accepted request identity for the life of an epoch and refuse new work /// after 256, so a long agent session ended with `generation_capacity` (found by the e2e run on the 5090 design diff --git a/desktop-core/tests/gateway/failures.rs b/desktop-core/tests/gateway/failures.rs index befa3dc6..208542ec 100644 --- a/desktop-core/tests/gateway/failures.rs +++ b/desktop-core/tests/gateway/failures.rs @@ -10,7 +10,7 @@ use axum::{Json, Router}; use futures_util::StreamExt; use serde_json::json; use std::time::Duration; -use strata_desktop_core::gateway::Gateway; +use leleka_engine_host::gateway::Gateway; async fn refuses_missing_token_and_unsupported_input(client: &reqwest::Client, g: &Server) { assert_eq!( diff --git a/desktop-core/tests/gateway/harness.rs b/desktop-core/tests/gateway/harness.rs index a934c035..9428ceee 100644 --- a/desktop-core/tests/gateway/harness.rs +++ b/desktop-core/tests/gateway/harness.rs @@ -8,7 +8,7 @@ use std::collections::BTreeMap; use std::sync::Arc; use std::sync::atomic::{AtomicUsize, Ordering}; use std::time::Duration; -use strata_desktop_core::gateway::{Config, Deployment, Gateway, Group}; +use leleka_engine_host::gateway::{Config, Deployment, Gateway, Group}; use tokio::sync::{Notify, Semaphore}; use tokio::task::JoinHandle; diff --git a/desktop-core/tests/gateway/routing.rs b/desktop-core/tests/gateway/routing.rs index 38cbacfb..f24af3f6 100644 --- a/desktop-core/tests/gateway/routing.rs +++ b/desktop-core/tests/gateway/routing.rs @@ -9,7 +9,7 @@ use axum::routing::post; use axum::{Json, Router}; use serde_json::{Value, json}; use std::sync::atomic::Ordering; -use strata_desktop_core::gateway::Gateway; +use leleka_engine_host::gateway::Gateway; fn spawn_text(r: reqwest::RequestBuilder) -> tokio::task::JoinHandle { tokio::spawn(async move { r.send().await.unwrap().text().await.unwrap() }) diff --git a/desktop-core/tests/json_order_sdet.rs b/desktop-core/tests/json_order_sdet.rs index cf4c74df..687691f7 100644 --- a/desktop-core/tests/json_order_sdet.rs +++ b/desktop-core/tests/json_order_sdet.rs @@ -3,10 +3,10 @@ //! The Python Original keeps the order objects were written in (`json.loads`, `tojson` with `sort_keys=False`), so a //! replayed tool call lists its `` blocks in the client's order and a call the model wrote comes back //! with its arguments in the model's order. That needs serde_json's `preserve_order`, which this crate declares itself: -//! a build of this crate alone (`cargo build -p strata-desktop-core`) used to sort the keys, while a build next to -//! `strata-control` (which pulled the feature in through `leleka-harmony`) did not. +//! a build of this crate alone (`cargo build -p leleka-engine-host`) used to sort the keys, while a build next to +//! `leleka-control-plane` (which pulled the feature in through `leleka-harmony`) did not. use serde_json::{Value, json}; -use strata_desktop_core::runtime_tools::{ValidatedSegment, prepare}; +use leleka_engine_host::runtime_tools::{ValidatedSegment, prepare}; fn function() -> Value { json!({"type":"function","name":"read","parameters":{ diff --git a/desktop-core/tests/managed_worker/harness.rs b/desktop-core/tests/managed_worker/harness.rs index 248b39cc..9efd6aa7 100644 --- a/desktop-core/tests/managed_worker/harness.rs +++ b/desktop-core/tests/managed_worker/harness.rs @@ -2,9 +2,9 @@ use std::net::SocketAddr; use std::time::Duration; -use strata_desktop_core::managed_worker::Profile; -use strata_desktop_core::node::proto::*; -use strata_desktop_core::node::{self}; +use leleka_engine_host::managed_worker::Profile; +use leleka_engine_host::node::proto::*; +use leleka_engine_host::node::{self}; use tokio::net::TcpListener; pub(super) const TOKEN: &str = "synthetic-lifecycle-test-token-32bytes"; diff --git a/desktop-core/tests/managed_worker/lifecycle.rs b/desktop-core/tests/managed_worker/lifecycle.rs index 33a71282..22fe13aa 100644 --- a/desktop-core/tests/managed_worker/lifecycle.rs +++ b/desktop-core/tests/managed_worker/lifecycle.rs @@ -2,9 +2,9 @@ use crate::harness::{OUTPUT, TOKEN, command, profile, remote_finish, req, serve}; use std::time::Duration; -use strata_desktop_core::managed_worker::Manager; -use strata_desktop_core::node::proto::*; -use strata_desktop_core::node::{self}; +use leleka_engine_host::managed_worker::Manager; +use leleka_engine_host::node::proto::*; +use leleka_engine_host::node::{self}; use tokio::net::TcpListener; async fn finish(m: &Manager, c: WorkerCommand) -> WorkerOperation { diff --git a/desktop-core/tests/managed_worker/stop_and_cli.rs b/desktop-core/tests/managed_worker/stop_and_cli.rs index a0c66269..6c63aa27 100644 --- a/desktop-core/tests/managed_worker/stop_and_cli.rs +++ b/desktop-core/tests/managed_worker/stop_and_cli.rs @@ -2,11 +2,11 @@ use crate::harness::{OUTPUT, TOKEN, command, profile, remote_finish, req, serve}; use std::time::Duration; -use strata_desktop_core::node::proto::*; -use strata_desktop_core::node::{self}; +use leleka_engine_host::node::proto::*; +use leleka_engine_host::node::{self}; use tokio::net::TcpListener; -type Client = strata_desktop_core::node::proto::node_client::NodeClient; +type Client = leleka_engine_host::node::proto::node_client::NodeClient; fn spawn_slow_request(mut response_client: Client) -> tokio::task::JoinHandle> { tokio::spawn(async move { @@ -88,7 +88,7 @@ impl Drop for FileGuard { } fn write_profile_file( - p: &strata_desktop_core::managed_worker::Profile, + p: &leleka_engine_host::managed_worker::Profile, ) -> (std::path::PathBuf, FileGuard) { let path = std::env::temp_dir().join(format!("strata-profile-{}.json", uuid::Uuid::new_v4())); let guard = FileGuard(path.clone()); diff --git a/desktop-core/tests/mtp_mode_sdet.rs b/desktop-core/tests/mtp_mode_sdet.rs index 554db26a..4a5fcf55 100644 --- a/desktop-core/tests/mtp_mode_sdet.rs +++ b/desktop-core/tests/mtp_mode_sdet.rs @@ -4,7 +4,7 @@ use leleka_backend_api::{ ContractError, InferenceMode, LoadedModel, ModelDescriptor, RuntimeConfig, }; use prost::Message; -use strata_desktop_core::runtime_rpc::{ +use leleka_engine_host::runtime_rpc::{ config_from_proto, config_to_proto, descriptor_to_proto, loaded_to_proto, mode_to_proto, proto, }; diff --git a/desktop-core/tests/native_tools_retry_sdet/harness.rs b/desktop-core/tests/native_tools_retry_sdet/harness.rs index 264035ea..b491a990 100644 --- a/desktop-core/tests/native_tools_retry_sdet/harness.rs +++ b/desktop-core/tests/native_tools_retry_sdet/harness.rs @@ -5,8 +5,8 @@ use serde_json::{Value, json}; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{Arc, Mutex}; use std::time::Duration; -use strata_desktop_core::runtime_gateway::{Config, Member, Registry}; -use strata_desktop_core::runtime_rpc::RuntimeServer; +use leleka_engine_host::runtime_gateway::{Config, Member, Registry}; +use leleka_engine_host::runtime_rpc::RuntimeServer; use tokio::task::JoinHandle; pub(super) const TOKEN: &str = "synthetic-tools-retry170-token-000000000000"; diff --git a/desktop-core/tests/native_tools_sdet/calls_and_history.rs b/desktop-core/tests/native_tools_sdet/calls_and_history.rs index e4c394ce..0acb6893 100644 --- a/desktop-core/tests/native_tools_sdet/calls_and_history.rs +++ b/desktop-core/tests/native_tools_sdet/calls_and_history.rs @@ -2,9 +2,9 @@ use crate::harness::{call, function, request}; use serde_json::{Value, json}; -use strata_desktop_core::runtime_tools::{ValidatedSegment, prepare}; +use leleka_engine_host::runtime_tools::{ValidatedSegment, prepare}; -fn assert_regex_input_is_gated(plan: &strata_desktop_core::runtime_tools::ToolPlan, alias: &str) { +fn assert_regex_input_is_gated(plan: &leleka_engine_host::runtime_tools::ToolPlan, alias: &str) { for raw in ["move 12", "MOVE 12 trailing", "", "MOVE\n12"] { assert!( plan.policy diff --git a/desktop-core/tests/native_tools_sdet/declarations.rs b/desktop-core/tests/native_tools_sdet/declarations.rs index 08b4cf11..2d0be46b 100644 --- a/desktop-core/tests/native_tools_sdet/declarations.rs +++ b/desktop-core/tests/native_tools_sdet/declarations.rs @@ -2,7 +2,7 @@ use crate::harness::{call, function, request}; use serde_json::{Value, json}; -use strata_desktop_core::runtime_tools::{ValidatedSegment, prepare}; +use leleka_engine_host::runtime_tools::{ValidatedSegment, prepare}; #[test] fn no_tool_prompt_retains_literal_template_bytes() { @@ -116,7 +116,7 @@ fn allowed_subset_and_parallel_false_are_enforced_after_whole_parse() { assert!(plan.policy.parse_output(&format!("{one}\n{one}")).is_err()); } -fn assert_nullable_path_values(plan: &strata_desktop_core::runtime_tools::ToolPlan) { +fn assert_nullable_path_values(plan: &leleka_engine_host::runtime_tools::ToolPlan) { for (raw, expected) in [("null", Value::Null), ("123", json!("123"))] { let parsed = plan .policy diff --git a/desktop-core/tests/native_tools_sdet/publisher.rs b/desktop-core/tests/native_tools_sdet/publisher.rs index 6dcb0f83..bf9276a6 100644 --- a/desktop-core/tests/native_tools_sdet/publisher.rs +++ b/desktop-core/tests/native_tools_sdet/publisher.rs @@ -2,9 +2,9 @@ use crate::harness::{function, request}; use serde_json::{Value, json}; -use strata_desktop_core::runtime_rpc::proto::Usage; -use strata_desktop_core::runtime_tool_response::ToolResponse; -use strata_desktop_core::runtime_tools::{ValidatedSegment, prepare}; +use leleka_engine_host::runtime_rpc::proto::Usage; +use leleka_engine_host::runtime_tool_response::ToolResponse; +use leleka_engine_host::runtime_tools::{ValidatedSegment, prepare}; fn usage() -> Usage { Usage { diff --git a/desktop-core/tests/node_contract.rs b/desktop-core/tests/node_contract.rs index 67c2f69e..ec2e75d6 100644 --- a/desktop-core/tests/node_contract.rs +++ b/desktop-core/tests/node_contract.rs @@ -2,7 +2,7 @@ mod support; use std::time::Duration; -use strata_desktop_core::node::{self, proto::*}; +use leleka_engine_host::node::{self, proto::*}; use support::{TOKEN, fake, hello, req, serve_proxy, server, wait_until_no_active_response}; use tokio::net::TcpListener; use tonic::Code; diff --git a/desktop-core/tests/node_contract/support.rs b/desktop-core/tests/node_contract/support.rs index c93ab502..44890c95 100644 --- a/desktop-core/tests/node_contract/support.rs +++ b/desktop-core/tests/node_contract/support.rs @@ -2,7 +2,7 @@ use axum::{Router, body::Body, routing::post}; use std::{collections::BTreeMap, time::Duration}; -use strata_desktop_core::{ +use leleka_engine_host::{ gateway, node::{self, proto::*}, }; @@ -98,7 +98,7 @@ pub async fn fake(body: &'static str, delay: bool) -> (Server, gateway::Gateway) /// An HTTP proxy in front of `node`, speaking gRPC to it with the test credential. pub async fn serve_proxy(node: &Server) -> Server { - let proxy = strata_desktop_core::node_proxy::Proxy::connect(node.address, TOKEN.into()) + let proxy = leleka_engine_host::node_proxy::Proxy::connect(node.address, TOKEN.into()) .await .unwrap(); let listener = TcpListener::bind("127.0.0.1:0").await.unwrap(); diff --git a/desktop-core/tests/node_reconnect.rs b/desktop-core/tests/node_reconnect.rs index bc1b09d1..3275ff66 100644 --- a/desktop-core/tests/node_reconnect.rs +++ b/desktop-core/tests/node_reconnect.rs @@ -1,5 +1,5 @@ use std::{net::SocketAddr, process::Stdio, time::Duration}; -use strata_desktop_core::node_connection::{Connection, Phase, Timing}; +use leleka_engine_host::node_connection::{Connection, Phase, Timing}; use tokio::{ io::{AsyncBufReadExt, BufReader}, process::{Child, Command}, diff --git a/desktop-core/tests/planning.rs b/desktop-core/tests/planning.rs index 9ac5d89b..0bffc597 100644 --- a/desktop-core/tests/planning.rs +++ b/desktop-core/tests/planning.rs @@ -1,4 +1,4 @@ -use strata_desktop_core::{ +use leleka_engine_host::{ hardware::{Accelerator, Hardware, Memory, MemoryKind}, planner::{Requirements, plan}, }; diff --git a/desktop-core/tests/pool.rs b/desktop-core/tests/pool.rs index c9552c5d..c7474ac7 100644 --- a/desktop-core/tests/pool.rs +++ b/desktop-core/tests/pool.rs @@ -1,5 +1,5 @@ use std::time::Duration; -use strata_desktop_core::pool::*; +use leleka_engine_host::pool::*; const WAIT: Duration = Duration::from_secs(3); fn pool(shared: bool, limit: usize) -> Pool { Pool::new( diff --git a/desktop-core/tests/runtime_gateway_sdet/harness.rs b/desktop-core/tests/runtime_gateway_sdet/harness.rs index 3f5ff7b9..82709c03 100644 --- a/desktop-core/tests/runtime_gateway_sdet/harness.rs +++ b/desktop-core/tests/runtime_gateway_sdet/harness.rs @@ -5,8 +5,8 @@ use serde_json::{Value, json}; use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; use std::sync::{Arc, Mutex}; use std::time::Duration; -use strata_desktop_core::runtime_gateway::{Config, Member, Registry}; -use strata_desktop_core::runtime_rpc::RuntimeServer; +use leleka_engine_host::runtime_gateway::{Config, Member, Registry}; +use leleka_engine_host::runtime_rpc::RuntimeServer; use tokio::task::JoinHandle; pub(super) const TOKEN: &str = "synthetic-sdet170-token-0000000000000000"; diff --git a/desktop/tests/remote_install.py b/desktop/tests/remote_install.py index 47e3486f..30a8448c 100644 --- a/desktop/tests/remote_install.py +++ b/desktop/tests/remote_install.py @@ -22,7 +22,7 @@ async def main(): sshd = shutil.which("sshd") or "/usr/sbin/sshd" assert os.name != "nt" and ssh and Path(sshd).is_file() slot = "install-test-" + secrets.token_hex(12) - installed = Path.home() / ".strata-next/installations" / slot + installed = Path.home() / ".leleka-api/installations" / slot assert not installed.exists() processes = [] with tempfile.TemporaryDirectory(prefix="strata-install-test-") as folder: diff --git a/docs/api-contract.md b/docs/api-contract.md index 31ad02d4..96e7098a 100644 --- a/docs/api-contract.md +++ b/docs/api-contract.md @@ -439,7 +439,7 @@ references; the implementation supports the bounded history subset described her obtained the transcript before deletion, and does not cancel generation. These routes require the newer preview; the preserved user trial is unchanged. -CPU verification: `python3 scripts/smoke-response-history.py /path/to/strata-next`; +CPU verification: `python3 scripts/smoke-response-history.py /path/to/leleka-api`; add `--durable` for actual process restart, corruption and disk-failure coverage. ### Input item listing diff --git a/docs/api-over-rust-engine.md b/docs/api-over-rust-engine.md index 4a93c645..dffb4d93 100644 --- a/docs/api-over-rust-engine.md +++ b/docs/api-over-rust-engine.md @@ -6,16 +6,16 @@ anything written here; nothing is a performance or quality claim. ## The two stacks today -| | `strata-next` (`control-plane/`) | `leleka-daemon` (`desktop-core/src/runtime_gateway.rs`) | +| | `leleka-api` (`control-plane/`) | `leleka-daemon` (`desktop-core/src/runtime_gateway.rs`) | | --- | --- | --- | | API surface | Responses (JSON+SSE, stored, `previous_response_id`, `input_tokens`), Chat Completions, Messages, tools (function, custom, regex), `text.format`, reasoning, MCP hub, drain, history, metrics | Responses text subset; Codex-shaped bodies get 400; `max_output_tokens` <= 4096; tools off by default | | Engine link | child process, stdio lines `GEN ` / `T ` / `DONE` (`wire.rs`, `worker.rs`) | gRPC `leleka.runtime.v1` (`runtime.proto`) to `leleka-inference` | | Unit of exchange with the engine | **token ids** in, **token ids** out | **text** prompt in (`GenerateRequest.prompt`), **text** deltas out (`TextDelta`) | -| Where the chat template is rendered | `strata-next` (minijinja, `prompt.rs`) | the daemon (a path-included copy of `prompt.rs`) | -| Where text is tokenized | `strata-next` (`leleka-tokenizer`, `encode(prompt, parse_special=true)`) | the engine (`backend.rs` `prepare_prompt`: `encode(prompt, true)`, same crate) | -| Where output is detokenized | `strata-next` (`decode_bytes` per token, incremental UTF-8) | the engine (`TextDelta`, UTF-8 safe) | -| Stop handling | engine emits the stop token; `strata-next` treats `<|im_end|>`/`<|endoftext|>` ids as the end | engine stops at its single `eos` id and never emits it; no other stop handling | -| Tool-call parsing | `strata-next` from decoded text (`tool_output.rs`, incremental) | the daemon adapter, from text (`runtime_tools.rs`); `ToolCallDelta` is unused by the engine (`supports_tool_call_streaming` false) | +| Where the chat template is rendered | `leleka-api` (minijinja, `prompt.rs`) | the daemon (a path-included copy of `prompt.rs`) | +| Where text is tokenized | `leleka-api` (`leleka-tokenizer`, `encode(prompt, parse_special=true)`) | the engine (`backend.rs` `prepare_prompt`: `encode(prompt, true)`, same crate) | +| Where output is detokenized | `leleka-api` (`decode_bytes` per token, incremental UTF-8) | the engine (`TextDelta`, UTF-8 safe) | +| Stop handling | engine emits the stop token; `leleka-api` treats `<|im_end|>`/`<|endoftext|>` ids as the end | engine stops at its single `eos` id and never emits it; no other stop handling | +| Tool-call parsing | `leleka-api` from decoded text (`tool_output.rs`, incremental) | the daemon adapter, from text (`runtime_tools.rs`); `ToolCallDelta` is unused by the engine (`supports_tool_call_streaming` false) | | Reasoning budget, images | token-level wrap-up (`worker.rs`), `GENI` embeddings | absent | The engine contract (`crates/backend-api`, version 2) is therefore **text-level**: one prompt string, `TextDelta` strings, @@ -23,9 +23,9 @@ a terminal with usage and a finish reason (`Stop`/`Length`/`ToolCalls`), `cancel ## Options -### A. A runtime backend for `strata-next` (the whole existing API in front of the Rust engine) +### A. A runtime backend for `leleka-api` (the whole existing API in front of the Rust engine) -Add a second implementation of the worker seam of `strata-next` (the `GenerationCommand` channel plus `WorkerStatus`/`Control`, +Add a second implementation of the worker seam of `leleka-api` (the `GenerationCommand` channel plus `WorkerStatus`/`Control`, today fed only by the stdio supervisor `worker::run_supervised`). It drives any `leleka_backend_api::Backend`; the production `Backend` is a gRPC client of `leleka-inference` (`leleka-runtime-client`, extracted from `desktop-core` so both binaries share one proto and one frame validator), and tests drive an in-process scripted engine implementing the same trait. @@ -51,7 +51,7 @@ Grow `runtime_gateway.rs` until it accepts Codex bodies, stores responses, serve ### C. A shared API crate used by both binaries -Extract the Responses/Chat/Messages implementation into a library with an `Engine` trait, link it into `strata-next` and +Extract the Responses/Chat/Messages implementation into a library with an `Engine` trait, link it into `leleka-api` and `leleka-daemon`. * Cleanest end state; also the largest blast radius: `responses.rs` is 5.7k lines wired into axum state, `WorkerStatus`, @@ -65,7 +65,7 @@ Reasons: 1. It is the only option that gives Codex the complete, already-tested native API on top of the Rust engine without rewriting it and without a compatibility bridge or Python. -2. All existing `strata-next` tests stay valid by construction: the stdio worker is untouched, and the new worker is selected by +2. All existing `leleka-api` tests stay valid by construction: the stdio worker is untouched, and the new worker is selected by an explicit configuration block (`runtime`), mutually exclusive with `engine.executable`. 3. The engine contract stays the engine's: `crates/backend-api` and `leleka-runtime/src/backend*.rs` are not modified. The things the contract cannot express are refused or documented, not papered over (below). @@ -74,11 +74,11 @@ Reasons: runtime across engine restarts (new epoch, model not ready) and reports `not ready` meanwhile. `leleka-daemon` remains the lifecycle gateway (`/runtime/load|unload|operation`, nodes, tunnels) until its remaining roles -move into `strata-next`; it is not extended with API surface. +move into `leleka-api`; it is not extended with API surface. ## Token-level edge (the part that needs care) -Prompt direction. `strata-next` renders the chat template and encodes the whole prompt with `parse_special=true`; the engine +Prompt direction. `leleka-api` renders the chat template and encodes the whole prompt with `parse_special=true`; the engine encodes the `prompt` string again with `parse_special=true` using the same `leleka-tokenizer` crate. The worker therefore decodes the ids back to text and **verifies** `encode(decode(ids), true) == ids` before sending. A prompt that does not survive the round trip (for example ids that are not the canonical encoding of any text, or an image-expanded prompt) fails the request @@ -92,12 +92,12 @@ engine's terminal usage (`output_tokens`), not from the re-encoding; `reasoning_ the same reason. Passing the engine's ids in `TextDelta` (additive field) is the contract change that removes this approximation; it is listed as a follow-up, not done here. -Stop handling. The engine stops at its `eos` id. `strata-next` additionally ends the text at `<|im_end|>` or `<|endoftext|>`. +Stop handling. The engine stops at its `eos` id. `leleka-api` additionally ends the text at `<|im_end|>` or `<|endoftext|>`. The worker scans the delta stream for those two literals (holding back a possible partial prefix across deltas), truncates the text, cancels the engine generation and reports `stop`. Consequence: a model that spells one of those literals with ordinary byte tokens is cut as well (the engine contract gives no way to tell the special token from its spelling). -Finish reasons. `Stop` -> `stop`, `Length` -> `length`, `ToolCalls` -> `stop` (tool calls are parsed by `strata-next` from the +Finish reasons. `Stop` -> `stop`, `Length` -> `length`, `ToolCalls` -> `stop` (tool calls are parsed by `leleka-api` from the text; an engine `ToolCallDelta` while `supports_tool_call_streaming` is false is a protocol violation and fails the request), `Cancelled` after a client disconnect -> cancel, `Failed` -> error, a stream that ends without a terminal event -> failure and the worker leaves `ready` until the runtime is attached again. SSE termination is guaranteed by the HTTP layer, which already @@ -124,19 +124,19 @@ Not expressible over the text contract, refused (fail closed, with an explicit m | layer | command | what it covers | | --- | --- | --- | -| API + worker over the scripted engine, real HTTP/SSE | `cargo test -p strata-control --test backend_worker_http` (27) | Responses JSON/SSE, Chat, tools (function and custom), `text.format` valid/invalid, finish reasons, stop literals, client disconnect, generation deadline, wedged engine, dying engine, native tool-call delta, refused features, output cap, sampling fixed point, token counting, Codex-shaped two-turn exchange with stateless replay, `tool_choice` / `parallel_tool_calls` | +| API + worker over the scripted engine, real HTTP/SSE | `cargo test -p leleka-control-plane --test backend_worker_http` (27) | Responses JSON/SSE, Chat, tools (function and custom), `text.format` valid/invalid, finish reasons, stop literals, client disconnect, generation deadline, wedged engine, dying engine, native tool-call delta, refused features, output cap, sampling fixed point, token counting, Codex-shaped two-turn exchange with stateless replay, `tool_choice` / `parallel_tool_calls` | | `GrpcBackend` over loopback HTTP/2 | `cargo test -p leleka-runtime-client` (11) | attach checks, no Load RPC, frame mapping, missing terminal, drop/cancel, stale epoch, unreachable runtime | -| whole chain: router -> worker -> `GrpcBackend` -> gRPC -> real `RuntimeServer` -> scripted engine | `cargo test -p strata-desktop-core --test api_over_runtime` (6) | streaming, finish reasons, tool call, stop marker, disconnect through gRPC, failure and engine death, runtime restart and re-attach, the 256-generation limit | -| existing HTTP smokes, unchanged assertions, engine moved behind the runtime | `python3 scripts/test-api-over-runtime.py target/debug/strata-next target/debug/examples/fake_runtime` (10 scripts) | replay driver and corrupted-stream rejection, custom tools, Chat, Messages, 216 tool-policy cases, input tokens, stored responses across a restart, keep-alive, drain, queue deadline | +| whole chain: router -> worker -> `GrpcBackend` -> gRPC -> real `RuntimeServer` -> scripted engine | `cargo test -p leleka-engine-host --test api_over_runtime` (6) | streaming, finish reasons, tool call, stop marker, disconnect through gRPC, failure and engine death, runtime restart and re-attach, the 256-generation limit | +| existing HTTP smokes, unchanged assertions, engine moved behind the runtime | `python3 scripts/test-api-over-runtime.py target/debug/leleka-api target/debug/examples/fake_runtime` (10 scripts) | replay driver and corrupted-stream rejection, custom tools, Chat, Messages, 216 tool-policy cases, input tokens, stored responses across a restart, keep-alive, drain, queue deadline | -The ten scripts are the ones whose assertions do not depend on `strata-next` owning the engine process. Not moved: +The ten scripts are the ones whose assertions do not depend on `leleka-api` owning the engine process. Not moved: `smoke-worker-cancel.py` (a wedged engine ends the stdio supervisor; the runtime backend re-attaches instead), `smoke-signal-drain.py` (expects `QUIT` on the engine's stdin) and `smoke-generation-deadline.py` (the deadline is a `runtime.generation_timeout_s` here, covered by `backend_worker_http`). ### Not covered / known gaps -* **No real engine ran.** Nothing here loads a model or touches CUDA. Tokenizer agreement between `strata-next`'s assets and the +* **No real engine ran.** Nothing here loads a model or touches CUDA. Tokenizer agreement between `leleka-api`'s assets and the engine's GGUF tokenizer is checked per request (prompt round trip) and by the input-token counter comparison (`the engine counted N input tokens, the control plane M` on stderr), but never against the real vocabulary. * **Output budget.** `RuntimeServer::generate` refuses `max_output_tokens > 4096`; the worker carries that cap diff --git a/docs/architecture/gateway-ports.md b/docs/architecture/gateway-ports.md index b7fd797f..5dc54ef2 100644 --- a/docs/architecture/gateway-ports.md +++ b/docs/architecture/gateway-ports.md @@ -2,7 +2,7 @@ The layers, the engine-side ports and the architecture gates are on `hexagonal.md`; this page is the gateway half. -The HTTP/Responses gateway (`strata-control`, binary `strata-next`) talks to everything outside the request through five +The HTTP/Responses gateway (`leleka-control-plane`, binary `leleka-api`) talks to everything outside the request through five small traits in `control-plane/src/ports/`. `AppState` holds `Arc` (type aliases `SharedClock`, `SharedEngine`, `SharedResponseStore`, `SharedToolHub`, `SharedVisionEncoder`), never a concrete adapter. The real adapters are chosen in one place, `serve()` in `control-plane/src/serve.rs` (the composition root, called from `main.rs`). @@ -18,7 +18,7 @@ adapters are chosen in one place, `serve()` in `control-plane/src/serve.rs` (the | `services: Services` | `settings`, `monitor`, `started_at` | `ResponseStore`, `ToolHub`, `Clock` | The pure part of the gateway (request sampling, the reasoning budget, the model-family codec, JSON ordering, the Chat -Completions translation) is the crate `leleka-gateway-domain` (layer L2); `strata-control` re-exports it under the old paths. +Completions translation) is the crate `leleka-gateway-domain` (layer L2); `leleka-control-plane` re-exports it under the old paths. | Port | Trait file | What the gateway asks | Real adapter | |---|---|---|---| @@ -81,12 +81,12 @@ switches, runtime worker, worker or pool, idle unload, serve, stop). Each phase encoder starts before the engine (a GPU encoder takes its VRAM first), and the state is handed to the router by value so that the engine channel closes when the server stops. -## The offline commands stay in `strata-control` (S10, STRA-352) +## The offline commands stay in `leleka-control-plane` (S10, STRA-352) The offline KAR/GGUF commands (the `model_*` and `kar_*` groups under `control-plane/src/cli/`, with the code they call: the ggml bridge, `kar*`, `native_pack`, `derived_*`, `mtp_*`, `tensor_export`, `gguf_*`) are not moved out of -`strata-control`. This is the owner default the integration session gave for S10: one crate and one binary, -`strata-next`, with the offline groups beside the service group (`operations`). The seam for a later move is the dispatch +`leleka-control-plane`. This is the owner default the integration session gave for S10: one crate and one binary, +`leleka-api`, with the offline groups beside the service group (`operations`). The seam for a later move is the dispatch in `cli.rs`: each group owns its own `run`, so a second binary or a feature split can take the offline groups without touching the gateway. Nothing in the gateway track depends on that move, and it needs a release decision (a second binary to package), so it stays open. @@ -96,11 +96,11 @@ binary to package), so it stays open. `leleka-gateway-domain` (layer L2) holds the pure protocol: sampling, the reasoning budget, the model-family codec, JSON ordering, the Chat Completions translation and, since S21 wider, `responses/` (the `CreateRequest` type and its validation, the prompt rendering, the reading of tool calls and reasoning out of the model text, the response object with -its event stream). `strata-control` keeps `responses::*` as re-exports and wrappers: the HTTP handlers, the history, the +its event stream). `leleka-control-plane` keeps `responses::*` as re-exports and wrappers: the HTTP handlers, the history, the streaming loops, the process switches (tool-call recovery, prompt date) and the log lines stay there. The Harmony prompt of a gpt-oss request (`harmony_conversation`, `harmony_render`, `PromptDate`, `civil_date`) is in the domain too; only the process-wide prompt date, `today()` and `render(request)` (which reads them) stay in `responses/harmony_prompt.rs`, next to the byte-exact prompt tests. The pure part of the Anthropic Messages adapter (`messages/`: the request as a Responses request, and the reply fields, stop reason, usage and error envelope) is in the domain as well; the route layers, the SSE adaptation and the HTTP error -responses stay in `strata-control`. What is not moved: `ReasoningStream` and the SSE loops of `responses/stream/`, the +responses stay in `leleka-control-plane`. What is not moved: `ReasoningStream` and the SSE loops of `responses/stream/`, the Chat Completions handler around the domain translation, and `harmony_family::GptOssCodec` (it reads a GGUF from disk). diff --git a/docs/architecture/hexagonal.md b/docs/architecture/hexagonal.md index 40787ddd..688f0b77 100644 --- a/docs/architecture/hexagonal.md +++ b/docs/architecture/hexagonal.md @@ -17,10 +17,10 @@ Inside L3 a crate may use another L3 crate only through an edge listed in `adapt | L1 leaf libraries | pure or std-only libraries | `leleka-obs` (`Clock`), `leleka-memory` (`MemoryPressure`), `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-gateway-text`, `leleka-cuda-model` (the pure host-side models peeled out of `leleka-cuda-driver`: `Error`, projection formats and geometries, serving context, schedules and kernel specifications) | | L2 domain | pure domain of one side | `leleka-engine-core` (prefix cache, conversation policy, prompt plan, speculative-decoding policies, request lifecycle, `EngineFamily`), `leleka-gateway-domain` (sampling, reasoning budget, codec, `OutputEvent` and the output decoders, Responses and Messages protocol) | | L3 adapters | OS, device, process and file access | engine: `leleka-engine-qwen35-cuda`, `leleka-engine-fake`, `leleka-cuda-driver`, `leleka-model-format` (`WeightSource`), `leleka-native-cpu-expert`, `leleka-libc-shim`, `leleka-memory-os` (page locking, glibc heap and Win32 host facts for the memory governor); gpt-oss workers: `leleka-gptoss`, `leleka-gptoss-igpu`, `leleka-gptoss-npu`, `leleka-cpu-worker`, `leleka-igpu-worker`, `leleka-npu-worker`, `leleka-gpu-npu-worker`, `leleka-npu-service`, `leleka-igpu`; also `leleka-offline-tools`, `leleka-runtime-client` (gRPC client) | -| L4 hosts | composition roots and facades | `leleka-runtime` (facade), `strata-desktop-core` (the `leleka-inference` binary), `strata-control` (gateway, binary `strata-next`), `leleka-deploy` (the `leleka` binary), `leleka-native-parity-bench` | +| L4 hosts | composition roots and facades | `leleka-runtime` (facade), `leleka-engine-host` (the `leleka-inference` binary), `leleka-control-plane` (gateway, binary `leleka-api`), `leleka-deploy` (the `leleka` binary), `leleka-native-parity-bench` | `leleka-runtime` is one line, `pub use leleka_engine_qwen35_cuda::*;` (S22), so the binaries keep importing `leleka_runtime::...`. -`leleka-engine-fake` is a dev-dependency of `strata-desktop-core` only; no production crate depends on it. +`leleka-engine-fake` is a dev-dependency of `leleka-engine-host` only; no production crate depends on it. `leleka-engine-qwen35-cuda` has a default-on cargo feature `preview-path` (S25) for the legacy Rust-native "preview" decoder chain (`docs/original-serve.md`): its spawn tier, `Qwen35CudaStart::Native` and the native serve loop. Off, the crate serves the Original path only @@ -33,8 +33,8 @@ Selected edges of `python scripts/check-architecture.py --report`; every arrow p ```mermaid flowchart TB subgraph L4[L4 hosts] - ctl[strata-control
gateway root] - dcore[strata-desktop-core
engine process root] + ctl[leleka-control-plane
gateway root] + dcore[leleka-engine-host
engine process root] rt[leleka-runtime
facade] end subgraph L3[L3 adapters] @@ -80,7 +80,7 @@ flowchart TB ``` `engine-qwen35-cuda` reaches `cuda-driver`, `model-format` and `native-cpu-expert` through three declared adapter edges. `engine-core` -depends on `leleka-backend-api` and `serde` only. `strata-desktop-core` is the composition root of the engine process; `strata-control` +depends on `leleka-backend-api` and `serde` only. `leleka-engine-host` is the composition root of the engine process; `leleka-control-plane` is the composition root of the gateway process (`serve()` in `control-plane/src/serve.rs`). ## Ports and seams @@ -217,7 +217,7 @@ Where the runtime went (oversize files and their lines, from the two baselines, | `leleka-engine-fake` | 0 / 0 | 0 | 0 | 0 | 1 | 0 | | `leleka-gateway-domain` | 1 / 405 | 0 | 0 | 3 | 5 | 0 | | `leleka-cuda-driver`, S1 to now | 97 / 91,850 to 30 / 19,617 | 126 to 76 | 44 to 31 | 108 to 110 | 51 to 48 | 102 to 115 | -| `strata-control`, S1 to now | 40 / 42,971 to 10 / 10,764 | 21 to 19 | 37 to 23 | 16 to 11 | 29 to 16 | 0 | +| `leleka-control-plane`, S1 to now | 40 / 42,971 to 10 / 10,764 | 21 to 19 | 37 to 23 | 16 to 11 | 29 to 16 | 0 | Size of the new crates (all `.rs` under `src/`, tests included): `engine-core` 11,245 lines, `engine-qwen35-cuda` 113,374, `engine-fake` 92. `engine-core` has no environment, clock or global in its code, which the zero counts reflect. The largest oversize file of the workspace is diff --git a/docs/architecture/independent-nvidia-engine.md b/docs/architecture/independent-nvidia-engine.md index b700e509..766bb151 100644 --- a/docs/architecture/independent-nvidia-engine.md +++ b/docs/architecture/independent-nvidia-engine.md @@ -8,7 +8,7 @@ an upstream source for selected behavior and algorithms, not a build, runtime, or deployment dependency. The new implementation repository is the private Gitea repository `git@vezha.io:para/leleka.git`; its remote is reachable and was empty when checked on 2026-10-05. Keep this architecture record and the existing -Strata provenance in `strata-next`; implement the replacement in Leleka. +Strata provenance in `leleka-api`; implement the replacement in Leleka. ## 1. Options and recommendation @@ -188,7 +188,7 @@ selection and evaluation-data availability remain explicit gates. separate port/service with artifact rollback; keep the last accepted runtime selectable until the new build passes gates. Only after acceptance remove Strata from the Leleka production/release path; retain historical - source provenance in `strata-next`. + source provenance in `leleka-api`. No stage claims performance from compilation, synthetic kernels, mock-backend tests, source inspection, or model loading alone. Required project profiles diff --git a/docs/architecture/limits-gate.md b/docs/architecture/limits-gate.md index 3ef3ea4c..a10b57d6 100644 --- a/docs/architecture/limits-gate.md +++ b/docs/architecture/limits-gate.md @@ -156,8 +156,8 @@ Census at the commit that introduced the gate (production / test; functions are | `leleka-tokenizer` | 13 / 10 | 7 / 1 | 0 / 0 | 21 / 10 | | `leleka-worker-protocol` | 3 / 1 | 3 / 0 | 0 / 0 | 0 / 0 | | `python` | 0 / 0 | 1 / 0 | 0 / 0 | 2 / 1 | -| `strata-control` | 187 / 214 | 135 / 17 | 17 / 30 | 199 / 133 | -| `strata-desktop-core` | 81 / 65 | 59 / 3 | 6 / 3 | 54 / 30 | +| `leleka-control-plane` | 187 / 214 | 135 / 17 | 17 / 30 | 199 / 133 | +| `leleka-engine-host` | 81 / 65 | 59 / 3 | 6 / 3 | 54 / 30 | | **total** | **1980 / 930** | **1818 / 132** | **139 / 70** | **6869 / 1273** | The numbers come from `scripts/check-limits.py --report` and are the content of `limits-baseline.json`. The Clippy side, measured on Linux with the opt-in script, is in `clippy-limits-baseline.json` (3675 warnings in 36 crates: `too_many_lines` 2441, `cognitive_complexity` 730, `too_many_arguments` 504); Clippy skips blank and comment lines and counts arguments, so its numbers differ from the table. @@ -181,8 +181,8 @@ Ubuntu, Clippy 0.1.99); a Windows run differs by the `cfg(windows)` code. Clippy 0.1.99 keys: `too-many-lines-threshold`, `cognitive-complexity-threshold`, `too-many-arguments-threshold`. The root `clippy.toml` sets the first two to 30 and 10; they belong to allow-by-default lints, so they change nothing for the existing `-D warnings` gates. The third (5) lives in `scripts/limits/clippy/clippy.toml`, which the script passes as -`CLIPPY_CONF_DIR`: `too_many_arguments` is **on by default**, and a root threshold of 5 makes `strata-control` and -`strata-desktop-core` (functions with 6 and 7 arguments) fail the hard Clippy gates of `check-local.sh --product`. +`CLIPPY_CONF_DIR`: `too_many_arguments` is **on by default**, and a root threshold of 5 makes `leleka-control-plane` and +`leleka-engine-host` (functions with 6 and 7 arguments) fail the hard Clippy gates of `check-local.sh --product`. A self-test keeps the two files in step. Crates that carry `#![allow(clippy::too_many_arguments)]` are not counted. `rustfmt.toml` with `max_width = 120` is deliberately absent: it would reformat the workspace and conflict with every diff --git a/docs/architecture/output-event.md b/docs/architecture/output-event.md index e1cf6b99..781c5fe1 100644 --- a/docs/architecture/output-event.md +++ b/docs/architecture/output-event.md @@ -88,7 +88,7 @@ reasoning budget. Adding a family touches, for the output side: a `TokenBytes` arm and the constructors `LiveDecoder::` and `AtEndDecoder::`, all inside `gateway-domain` (the enum is private to it, so those constructors are the only way in); a -`TextCodec` implementation in the crate that holds the family's tokenizer (`harmony_family.rs` in `strata-control` for gpt-oss) with +`TextCodec` implementation in the crate that holds the family's tokenizer (`harmony_family.rs` in `leleka-control-plane` for gpt-oss) with `at_end_decoder`, `live_decoder` only if the family can be read live, `always_reasons`, `sampling_limit`, `terminal_ids`, `encode` and `family()` (a `Family` variant); and the choice of the codec in `serve/state.rs`. The stream loops and the answer builder do not change. The input side (`render_prompt`, pictures, the reasoning budget) still has its own `Family` and `qwen()` branches. @@ -142,14 +142,14 @@ not); a gpt-oss request that sets a sampler the worker lacks gets a 400 that nam samplers do not reach the gpt-oss worker (top_k 20 and penalty_last_n 64 among them), neutral values are accepted, and Qwen keeps all five samplers. All fifteen tests of the binary pass on `08afbf216` and on the new code. -Results on the tip: `cargo test --no-fail-fast --all-targets` for `strata-control`, `leleka-gateway-domain`, `leleka-gateway-text`, +Results on the tip: `cargo test --no-fail-fast --all-targets` for `leleka-control-plane`, `leleka-gateway-domain`, `leleka-gateway-text`, `leleka-harmony`, `leleka-tokenizer` and `leleka-runtime-client` on Linux (WSL), before (`cbc1a9587`) and after, compared with `scripts/dev/test-outcomes.py compare`: 0 missing, 0 outcome changes, 38 new ids; 515 ok / 1 ignored before, 552 ok / 2 ignored after. The ids of the first golden harness moved to the new binary; the tests that read the replaced code (`reasoning_marker_and_unicode_split_at_every_byte`, the unclosed-reasoning test, the utf8 test, the Harmony decoder tests) keep their ids and now read through the new decoders. -`cargo check --all-targets` and `cargo clippy --no-deps --all-targets -- -D warnings` for `strata-control` and `leleka-gateway-domain`: +`cargo check --all-targets` and `cargo clippy --no-deps --all-targets -- -D warnings` for `leleka-control-plane` and `leleka-gateway-domain`: 0 warnings. `check-limits.py --base origin/claude/hexagonal-integ`, `check-architecture.py` and `check-ci-coverage.py`: green; -`architecture-baseline.json` tightened (`dyn-trait` gateway-domain 5 to 2, strata-control 14 to 11). +`architecture-baseline.json` tightened (`dyn-trait` gateway-domain 5 to 2, leleka-control-plane 14 to 11). Not covered end to end: `STRATA_DEBUG_FAILED_OUTPUT` (read once per process through a `OnceLock`, so a test binary cannot switch it beside other tests); the `keep_raw`, `raw_text()` and `split_text()` paths have unit tests in `leleka-gateway-domain`. @@ -204,4 +204,4 @@ Behaviours kept on purpose (they are in the golden): * **Prompt rendering is still chosen by `Family`** (`intake/intake_stages.rs`), and the picture expansion, the reasoning budget and the runtime backend still ask for the Qwen tokenizer (`qwen()`). They are the input side of the codec; they need a prompt-rendering port, not an output one. -* **`GptOssCodec` lives in `strata-control`** because it loads the BPE from a GGUF file; the decoder it hands out is in the domain. +* **`GptOssCodec` lives in `leleka-control-plane`** because it loads the BPE from a GGUF file; the decoder it hands out is in the domain. diff --git a/docs/architecture/size-fn.md b/docs/architecture/size-fn.md index b381de95..3d9438c0 100644 --- a/docs/architecture/size-fn.md +++ b/docs/architecture/size-fn.md @@ -6,7 +6,7 @@ the behaviour unchanged: one helper per rule, stage or item kind, a small contex threads through, builder and assert helpers for tests, big literals as constants. Entries of `limits-allowlist.json` of the fixed functions are gone. -Crates: `strata-control`, `strata-desktop-core`, `leleka-deploy`, `leleka-gateway-text`, `leleka-gateway-domain`, +Crates: `leleka-control-plane`, `leleka-engine-host`, `leleka-deploy`, `leleka-gateway-text`, `leleka-gateway-domain`, `leleka-worker-protocol`, `leleka-runtime-client`, `leleka-offline-tools`, `leleka-gptoss`, `leleka-cpu-sys`, `leleka-cpu-kernels`, `leleka-cpu-worker`, `leleka-igpu*`, `leleka-gptoss-igpu`, `leleka-gptoss-npu`, `leleka-npu-*`, `leleka-gpu-npu-worker`, `leleka-gguf`, `leleka-kar-codec`, `leleka-harmony`, `leleka-tokenizer`, `leleka-shm`, @@ -54,8 +54,8 @@ Per crate (before -> after; production columns, then test columns; "wide" counts | `leleka-shm` | 1 -> 0 | 0 -> 0 | 0 -> 0 | 0 -> 0 | 0 -> 0 | 0 -> 0 | 0 -> 0 | 0 -> 0 | | `leleka-tokenizer` | 13 -> 0 | 7 -> 0 | 0 -> 0 | 21 -> 14 | 10 -> 0 | 1 -> 0 | 0 -> 0 | 10 -> 2 | | `leleka-worker-protocol` | 3 -> 0 | 3 -> 0 | 0 -> 0 | 0 -> 0 | 1 -> 0 | 0 -> 0 | 0 -> 0 | 0 -> 0 | -| `strata-control` | 146 -> 0 | 122 -> 0 | 17 -> 0 | 185 -> 50 | 194 -> 0 | 17 -> 0 | 30 -> 0 | 131 -> 17 | -| `strata-desktop-core` | 62 -> 15 | 56 -> 11 | 6 -> 0 | 52 -> 13 | 63 -> 6 | 3 -> 0 | 3 -> 0 | 27 -> 0 | +| `leleka-control-plane` | 146 -> 0 | 122 -> 0 | 17 -> 0 | 185 -> 50 | 194 -> 0 | 17 -> 0 | 30 -> 0 | 131 -> 17 | +| `leleka-engine-host` | 62 -> 15 | 56 -> 11 | 6 -> 0 | 52 -> 13 | 63 -> 6 | 3 -> 0 | 3 -> 0 | 27 -> 0 | | **total** | 486 -> 17 | 340 -> 11 | 46 -> 0 | 756 -> 449 | 507 -> 122 | 35 -> 3 | 47 -> 4 | 332 -> 150 | @@ -65,7 +65,7 @@ Same method, then the owner's single-responsibility rule: one function does one that needs "and" or "then" is split again, the decision (which branch) is separate from the execution (how), a `check_*` is a predicate and does not mutate or compute, a test is setup, action and assertion as named steps. -* `strata-desktop-core`: the 15 production functions and the 6 test functions left by pass 1 (`ToolResponse::complete` and +* `leleka-engine-host`: the 15 production functions and the 6 test functions left by pass 1 (`ToolResponse::complete` and `preflight` with the new module `runtime_tool_response/preflight.rs`, `hardware::inventory`, node `respond` with the new module `node/respond.rs`, `node_connection::session`, `node_proxy::respond`, `planner::plan`, `Pool::new`, `cli::node`, `main`, `managed_worker` start/run, ...). @@ -122,8 +122,8 @@ Per crate (pass 1 end -> pass 2; production fn>30, cx>10, wide, then test fn>30, | `leleka-runtime-client` | 0 -> 0 | 0 -> 0 | 3 -> 0 | 0 -> 0 | 0 -> 0 | 0 -> 0 | 0 -> 0 | | `leleka-serving-policy` | 0 -> 0 | 0 -> 0 | 5 -> 0 | 0 -> 0 | 0 -> 0 | 0 -> 0 | 1 -> 0 | | `leleka-tokenizer` | 0 -> 0 | 0 -> 0 | 14 -> 0 | 0 -> 0 | 0 -> 0 | 0 -> 0 | 2 -> 0 | -| `strata-control` | 0 -> 0 | 0 -> 0 | 50 -> 0 | 0 -> 0 | 0 -> 0 | 0 -> 0 | 17 -> 0 | -| `strata-desktop-core` | 15 -> 0 | 11 -> 0 | 13 -> 0 | 6 -> 0 | 0 -> 0 | 0 -> 0 | 0 -> 0 | +| `leleka-control-plane` | 0 -> 0 | 0 -> 0 | 50 -> 0 | 0 -> 0 | 0 -> 0 | 0 -> 0 | 17 -> 0 | +| `leleka-engine-host` | 15 -> 0 | 11 -> 0 | 13 -> 0 | 6 -> 0 | 0 -> 0 | 0 -> 0 | 0 -> 0 | | **total** | 17 -> 2 | 11 -> 0 | 449 -> 38 | 122 -> 0 | 3 -> 0 | 4 -> 0 | 150 -> 0 | Allowlist entries: 133 -> 1 (`OpenVino::load`); the entries of functions that only had wide lines went when the lines were @@ -167,18 +167,18 @@ a paired A/B (same workload, quality result) before anything is said about speed * Test ids and outcomes: `cargo test --no-fail-fast --all-targets` on Linux (WSL) for the 28 crates and for `leleka-deploy --features test-fakes`, before (`0c594d351`) and after, compared with `scripts/dev/test-outcomes.py compare` - : 0 missing, 0 new, 0 outcome changes (`strata-control` and the 27 other crates: 1067 ok before, 1078 ok after, the 11 differences + : 0 missing, 0 new, 0 outcome changes (`leleka-control-plane` and the 27 other crates: 1067 ok before, 1078 ok after, the 11 differences are tests that the base log could not resolve or that failed once on the base; `leleka-deploy`: 213 ok / 5 failed / 2 ignored before and after). The five `leleka-deploy` e2e failures (`dry_run_prints_the_plan_and_changes_nothing` and four in `reconfigure_flow`) fail on the base too: they report the free - VRAM of the host GPU. The `strata-control` lib suite had one flaky failure on the base run + VRAM of the host GPU. The `leleka-control-plane` lib suite had one flaky failure on the base run (`responses::tests::history::durable_history_roundtrip_delete_eviction_and_faults`). * `cargo clippy --no-deps --all-targets -- -D warnings` clean for the crates above; `result_large_err` is allowed in the - modules of the `/v1/responses` handler and the gateway relay of `strata-desktop-core` because the error value is the finished - HTTP response. `cargo fmt --check` for `strata-control`, `strata-desktop-core`, `leleka-runtime-client` and `leleka-deploy` + modules of the `/v1/responses` handler and the gateway relay of `leleka-engine-host` because the error value is the finished + HTTP response. `cargo fmt --check` for `leleka-control-plane`, `leleka-engine-host`, `leleka-runtime-client` and `leleka-deploy` differs only in files this batch did not change. * Gates: `scripts/check-limits.py --base origin/claude/hexagonal-integ` 0 errors, 0 stale; `scripts/check-architecture.py` - 0 errors (the `dyn-trait` ratchet of `strata-desktop-core` is held by spelling `dyn leleka_backend_api::Backend` in the + 0 errors (the `dyn-trait` ratchet of `leleka-engine-host` is held by spelling `dyn leleka_backend_api::Backend` in the binaries); `scripts/check-ci-coverage.py` green. ## Method note diff --git a/docs/architecture/size-split-control-plane-desktop-core.md b/docs/architecture/size-split-control-plane-desktop-core.md index 9484e0a4..6acdecc7 100644 --- a/docs/architecture/size-split-control-plane-desktop-core.md +++ b/docs/architecture/size-split-control-plane-desktop-core.md @@ -1,14 +1,14 @@ # Size split of control-plane and desktop-core (STRA-338, batch GW-1) The owner order: no `.rs` file over 400 lines, no function over the limits of `docs/architecture/limits-gate.md`. This -page records how the 19 oversize files of `strata-control` (`control-plane/`) and `strata-desktop-core` +page records how the 19 oversize files of `leleka-control-plane` (`control-plane/`) and `leleka-engine-host` (`desktop-core/`) were split, and how the test ids moved. Every module is named after what it holds, never `_2`/`_3`. ## Test ids A test id is `::`. A split changes the module path and nothing else: -* 543 tests before and after in the two crates (`cargo test -p strata-control -p strata-desktop-core --all-targets`, +* 543 tests before and after in the two crates (`cargo test -p leleka-control-plane -p leleka-engine-host --all-targets`, Linux): 0 missing, 0 new, 0 outcome changes; 241 ids differ only in the module path (the topic module is inserted). * Cargo test targets keep their names: `tests/.rs` became `tests//main.rs`, which Cargo discovers under the same target name. diff --git a/docs/architecture/size-split-rest.md b/docs/architecture/size-split-rest.md index 9c9e0b8f..bcc7197f 100644 --- a/docs/architecture/size-split-rest.md +++ b/docs/architecture/size-split-rest.md @@ -59,7 +59,7 @@ function of 40 lines that calls `instructions::push_system_messages` and `replay value whose methods handle one item kind each (`reasoning_item`, `message_item`, `call_item`, `output_item`) and whose helpers parse one part (`message_content`, `call_identity`, `call_arguments`, `call_markup`, `output_text`, `flush_exchange`). The order of the checks, the error texts and the rendered text are unchanged. Evidence: the -`leleka-gateway-domain` tests (17) and the `strata-control` `responses` unit tests (72, which render through this function) +`leleka-gateway-domain` tests (17) and the `leleka-control-plane` `responses` unit tests (72, which render through this function) pass before and after; no function in the new files is over 30 lines, complexity 10 or nesting 4. ## Why the limits allowlist grew diff --git a/docs/architecture/tech-debt.md b/docs/architecture/tech-debt.md index fc8aad06..1fb4c48b 100644 --- a/docs/architecture/tech-debt.md +++ b/docs/architecture/tech-debt.md @@ -56,10 +56,10 @@ What the pass did, by `scripts/dev/explicit_imports.py` (with `scripts/dev/rust_ |---|---|---|---| | `cuda-driver` | 471 -> 0 | 564 -> 564 | all: the compile-and-prune loop reached a state it could not close (glob sources the tool cannot trace, `macro_rules!` and item-defining macro calls, 172 files under cfg-gated names, 17 under platform cfg); two attempts with the failing top-level modules excluded were interrupted by the laptop GPU stretch, so the crate got the doc headers only; second pass: 571 -> 3 production globs, see below | | `engine-qwen35-cuda` | 343 -> 0 | 407 -> 236 | 127 platform cfg, 105 under cfg-gated names; `open_phase_steps.rs` (was `open_parts.rs`) stays a glob on purpose (it is at the 400-line limit and the explicit list would put it over) | -| `strata-control` | 66 -> 0 | 113 -> 22 | 5 platform cfg, 17 under cfg-gated names (the `responses` and `messages` trees) | +| `leleka-control-plane` | 66 -> 0 | 113 -> 22 | 5 platform cfg, 17 under cfg-gated names (the `responses` and `messages` trees) | | `leleka-model-format` | 54 -> 0 | 77 -> 10 | platform cfg (`bulk_read`, `gguf_resident`, `kar`) | | `leleka-native-cpu-expert` | 58 -> 0 | 62 -> 34 | 10 behind an `extern "C"` glob chain, the rest macro-defined names | -| `leleka-engine-core`, `strata-desktop-core`, `leleka-gateway-text`, `leleka-memory`, `leleka-cuda-model`, `leleka-tokenizer`, `leleka-backend-api`, `leleka-context`, `leleka-serving-policy`, `leleka-obs`, `leleka-runtime-client`, `leleka-harmony`, `leleka-gateway-domain`, `leleka-npu-service`, `leleka-experimental-ref`, `leleka-deploy`, `leleka-libc-shim` | 114 -> 0 | 158 -> 14 | `leleka-context` 1, `leleka-experimental-ref` 5, `leleka-runtime-client` 8 | +| `leleka-engine-core`, `leleka-engine-host`, `leleka-gateway-text`, `leleka-memory`, `leleka-cuda-model`, `leleka-tokenizer`, `leleka-backend-api`, `leleka-context`, `leleka-serving-policy`, `leleka-obs`, `leleka-runtime-client`, `leleka-harmony`, `leleka-gateway-domain`, `leleka-npu-service`, `leleka-experimental-ref`, `leleka-deploy`, `leleka-libc-shim` | 114 -> 0 | 158 -> 14 | `leleka-context` 1, `leleka-experimental-ref` 5, `leleka-runtime-client` 8 | | `leleka-cpu-sys` | 4 -> 0 | 16 -> 13 | opaque glob chain, cfg-gated names | | `gptoss`, `igpu`, `gguf`, `gptoss-npu`, `openvino`, `cpu-worker`, `cpu-kernels`, `gpu-npu-worker`, `gptoss-igpu` | none | 74 -> 74 | not touched: the CPU/iGPU/NPU runtime is another stream's code and has no "Moved out" header; the tool works on them unchanged | @@ -67,7 +67,7 @@ Left as a glob, and why (counts above): a module under a `cfg(windows)`, `cfg(ta Linux only, so it cannot prove the explicit list there: 5 to 20 files a crate); a module whose parent chain declares names under a `cfg` attribute (an explicit import would need the same `cfg`); a glob that comes from a crate outside the module tree (`use libc::*` style, `opaque`). Next step for each: one author-side pass per crate, adding the cfg on the import or a platform-aware compile (a Windows `cargo check` for the crates that build there: -`leleka-deploy`, `strata-control`, `leleka-model-format`); estimate one to two days for `cuda-driver` (group by top-level module, bisect the failing group), an hour for each other crate. +`leleka-deploy`, `leleka-control-plane`, `leleka-model-format`); estimate one to two days for `cuda-driver` (group by top-level module, bisect the failing group), an hour for each other crate. #### Second pass: the low-level crates (owner order 2026-11-14, branch `claude/arch-names-low`) @@ -155,10 +155,10 @@ of the `heap` module, counted there now). What the census shows (production code | Pattern (total) | What it is made of | Next step | Estimate | |---|---|---|---| | `process-global` 265 | about 42 are the switch idiom `static ON: OnceLock` read from one environment variable (`cuda-driver` 25, `native-cpu-expert`, `libc-shim`, `cuda-model`, `model-format`), the rest are lazily built tables and caches (`OnceLock>`, regex, parse tables), the settings capture (`settings::process()`), and a few real singletons (`Governor::global()`, `Inventory`, the serve loop `INSTANCE`/`RECONFIGURING`, the load-time lap printer) | one `EnvSwitch` type (name, rule `fn(Option<&OsStr>) -> bool`, `OnceLock` inside, `get()`) in `leleka-cuda-model` for the switches; keep the tables (they are pure caches); the singletons need the injection of S13/S14 (a settings handle and a clock through the engine stack) | EnvSwitch: one day for about 25 sites plus an identity run, because several (`up8`, `fused_commit`, `commit_sync_forced`, `daily_mtp`) sit on the decode path that this pass must not touch; singletons: the S13/S14 follow-up, several days | -| `env-read` 200 | `cuda-driver` 67 (25 switch idiom, the rest option parsers such as `OriginalStagerOptions`), `deploy` 41 (CLI and child environment on purpose), `native-cpu-expert` 19, `strata-control` 19, `strata-desktop-core` 15 | per crate a `settings` module that is the only reader (the engine has one: `EnvSource`, `ProcessEnv`, `MapEnv`); `deploy` sets the child's environment, which stays | one day per crate; `cuda-driver` waits for the `EnvSwitch` type and for a settings crate below the driver (S13 follow-up) | -| `instant-now` 188 | `deploy` 28, `native-cpu-expert` 27 (per-window and per-miss timers of the CPU expert pool), `cuda-driver` 25 (stall and profile spans), `strata-control` 22, `engine-qwen35-cuda` 16, `gptoss-npu` 12 | `leleka_obs::time::Clock` (generic, `SystemClock` by default) for the coarse points (deploy, control, desktop-core: one reading per request or probe); the timers inside the decode loop and the pool stay on `Instant` until a clock parameter is designed, because each is one reading per kernel or miss | half a day for `deploy` + `strata-*`; the pool and driver timers are a design decision | +| `env-read` 200 | `cuda-driver` 67 (25 switch idiom, the rest option parsers such as `OriginalStagerOptions`), `deploy` 41 (CLI and child environment on purpose), `native-cpu-expert` 19, `leleka-control-plane` 19, `leleka-engine-host` 15 | per crate a `settings` module that is the only reader (the engine has one: `EnvSource`, `ProcessEnv`, `MapEnv`); `deploy` sets the child's environment, which stays | one day per crate; `cuda-driver` waits for the `EnvSwitch` type and for a settings crate below the driver (S13 follow-up) | +| `instant-now` 188 | `deploy` 28, `native-cpu-expert` 27 (per-window and per-miss timers of the CPU expert pool), `cuda-driver` 25 (stall and profile spans), `leleka-control-plane` 22, `engine-qwen35-cuda` 16, `gptoss-npu` 12 | `leleka_obs::time::Clock` (generic, `SystemClock` by default) for the coarse points (deploy, control, desktop-core: one reading per request or probe); the timers inside the decode loop and the pool stay on `Instant` until a clock parameter is designed, because each is one reading per kernel or miss | half a day for `deploy` + `strata-*`; the pool and driver timers are a design decision | | `path-include` 234 | `cuda-driver` 118 and `engine-qwen35-cuda` 100 are `#[path = "dir/file.rs"] mod x;` declarations of the files the splits made, `model-format` 12 | declare the children through the directory layout (`mod x;` with the file at `parent/x.rs`) and drop the attribute; `git mv` per module; mechanical but it renames paths that the ledger and the identity scripts quote | one day with `rustsplit`'s layout rule; no behaviour change | -| `dyn-trait` 207 | `engine-qwen35-cuda` 53, `cuda-driver` 45, `engine-core` 18, `deploy` 17, `leleka-memory` 17 (the `&dyn ProcSource` of the host reads, the `SharedPageLocking`), `strata-control` 11 | request-level and start-up composition only (the policy); the `&dyn ProcSource` parameters of `leleka-memory` can become generics (two were changed in this pass: `HostFacts::probe`, `Census::take`, `HostSample::take`) | half a day for `leleka-memory`; the rest are the carve-outs listed in `hexagonal.md` | +| `dyn-trait` 207 | `engine-qwen35-cuda` 53, `cuda-driver` 45, `engine-core` 18, `deploy` 17, `leleka-memory` 17 (the `&dyn ProcSource` of the host reads, the `SharedPageLocking`), `leleka-control-plane` 11 | request-level and start-up composition only (the policy); the `&dyn ProcSource` parameters of `leleka-memory` can become generics (two were changed in this pass: `HostFacts::probe`, `Census::take`, `HostSample::take`) | half a day for `leleka-memory`; the rest are the carve-outs listed in `hexagonal.md` | No source ratchet was raised. `leleka-memory`: `dyn-trait` 17 -> 12 (`HostFacts::probe` and its cgroup helpers, `Census::take` and `HostSample::take` are generic over `ProcSource` now), `env-read` 3 -> 2 and `process-global` 10 -> 8 (the trim switch and its cache moved to `leleka-memory-os`, which counts `env-read` 1 and `process-global` 2). @@ -174,11 +174,11 @@ that needs a feature-gated name no longer stays a glob. `rename_module.py` renam the generated doc block by the real sentence. `wsl-cargo.sh` limits `CARGO_BUILD_JOBS` (default 4). **Numbers** (`architecture-baseline.json`, before -> after this pass): `glob-super-import` engine 328 -> 70, `leleka-deploy` 79 -> 15, -`strata-control` 37 -> 9, `strata-desktop-core` 16 -> 0 (its `leleka-inference` binary has its own crate root: `ROOT_FILE=src/bin/leleka-inference/main.rs`), -`leleka-gateway-domain` 2 -> 0; `allow-unused-imports` engine 396 -> 224, `strata-control` 63 -> 48; `env-read` `strata-control` 19 -> 14 (the run -configuration reads `STRATA_*` only in `config/process_env.rs`), `strata-desktop-core` 15 -> 13 (one `node_credential`). The two engine files that sit at the +`leleka-control-plane` 37 -> 9, `leleka-engine-host` 16 -> 0 (its `leleka-inference` binary has its own crate root: `ROOT_FILE=src/bin/leleka-inference/main.rs`), +`leleka-gateway-domain` 2 -> 0; `allow-unused-imports` engine 396 -> 224, `leleka-control-plane` 63 -> 48; `env-read` `leleka-control-plane` 19 -> 14 (the run +configuration reads `STRATA_*` only in `config/process_env.rs`), `leleka-engine-host` 15 -> 13 (one `node_credential`). The two engine files that sit at the 400-line limit (`cache_profile_fill/profile_build.rs`, `original_serve_stack_methods/open_phase_steps.rs`) stay globs on purpose. Checks: `cargo check ---workspace --all-targets` clean, tests of `leleka-deploy`, `strata-control`, `strata-desktop-core`, `leleka-gateway-domain`, `leleka-engine-core`, +--workspace --all-targets` clean, tests of `leleka-deploy`, `leleka-control-plane`, `leleka-engine-host`, `leleka-gateway-domain`, `leleka-engine-core`, `leleka-context`, `leleka-experimental-ref`, `leleka-engine-qwen35-cuda`: 1759 passed, 2 failed (the two known `mtp::backing` NTFS tests, red on base too). The tool also had two defects that this pass fixed and that explain why the first pass stopped at 236 files: a file given back its glob was not rewritten (the explicit list stayed on disk and kept failing), and a test-only import was never pruned. @@ -198,16 +198,16 @@ their doc comment now says by which phase), `ConversationManager` (a domain type | What | Why it stays | Next step | |---|---|---| | globs in the engine that the compile-guided loop gave back (about 100 files: GPU-proof and `cfg(test)` names such as `BindingIdentity::test_identity`, `super::session` of the proof modules) and 9 behind mixed cfg | the tool imports a name once; a name that exists only under an inner cfg of the file needs the cfg on that name | read the compiler's "consider importing" help instead of the module tree for these files, or move the proofs to their own `tests/` crate | -| globs in files under a platform cfg (engine 12, `deploy` 12, `strata-control` 6) | the tool compiles on Linux only | a Windows `cargo check` pass for `leleka-deploy` and `strata-control`; for the engine files (`mtp::backing`, `kar_ple`) edit by hand with the cfg on the import | +| globs in files under a platform cfg (engine 12, `deploy` 12, `leleka-control-plane` 6) | the tool compiles on Linux only | a Windows `cargo check` pass for `leleka-deploy` and `leleka-control-plane`; for the engine files (`mtp::backing`, `kar_ple`) edit by hand with the cfg on the import | | `Governor::global()` and `serving_cells()` (engine `process-global` 59) | the S13/S14 injection: a governor handle and the context bound through the engine stack | the S13/S14 step in (d); not a cheap change | -| `Instant::now()` in `strata-control` (22), `desktop-core` (14), `deploy` (28) | the gateway `Clock` port is tokio's `Instant`, the views and the engine use `std::time::Instant`; most sites are deadlines of `tokio::time` | one `Clock` per crate with the instant type of its runtime; half a day per crate with the time-paused tests | -| env reads of `deploy` (41), `desktop-core` (evaluation and seal-exec hooks), the one-line reads of `strata-control` | the CLI and the child environment are the product; the others are test hooks | per-crate `settings` module that is the only reader | +| `Instant::now()` in `leleka-control-plane` (22), `desktop-core` (14), `deploy` (28) | the gateway `Clock` port is tokio's `Instant`, the views and the engine use `std::time::Instant`; most sites are deadlines of `tokio::time` | one `Clock` per crate with the instant type of its runtime; half a day per crate with the time-paused tests | +| env reads of `deploy` (41), `desktop-core` (evaluation and seal-exec hooks), the one-line reads of `leleka-control-plane` | the CLI and the child environment are the product; the others are test hooks | per-crate `settings` module that is the only reader | | `path-include` (engine 100, `desktop-core` 2) | not in the owner's list for this pass | `mod x;` through the directory layout with `git mv`, one directory at a time | | generated doc headers (`Methods of ...`, `Functions: ...`) in about 430 files of these crates | the sentence on why the file is separate needs the author's knowledge | by directory, together with the next feature that touches it | ### (e) Stage 10 pass: control-plane, desktop-core, deploy and the small crates (owner order 2026-11-14, branch `claude/debt-control`) -Crates: `strata-control`, `strata-desktop-core`, `leleka-deploy`, `leleka-gateway-domain`, `leleka-gateway-text`, `leleka-backend-api`, `leleka-runtime-client`, `leleka-npu-service`. Numbers are from `scripts/check-architecture.py`; a site that must stay is a named entry of `exceptions` in `architecture.json` (crate, file, ratchet, reason), not a baseline number. +Crates: `leleka-control-plane`, `leleka-engine-host`, `leleka-deploy`, `leleka-gateway-domain`, `leleka-gateway-text`, `leleka-backend-api`, `leleka-runtime-client`, `leleka-npu-service`. Numbers are from `scripts/check-architecture.py`; a site that must stay is a named entry of `exceptions` in `architecture.json` (crate, file, ratchet, reason), not a baseline number. | Ratchet | before | after (outside the exceptions) | |---|---|---| @@ -219,11 +219,11 @@ Crates: `strata-control`, `strata-desktop-core`, `leleka-deploy`, `leleka-gatewa | `instant-now` | `deploy` 28, `control` 22, `desktop-core` 14, `npu-service` 5, `backend-api` 2 | `control` 15 and `desktop-core` 4 in hot files, see below; the rest 0 | | `process-global` | `control` 8, `gateway-text` 4, `gateway-domain` 2 | 2 (`control`, hot files) | -**One reader per crate.** `env_settings.rs` in `strata-control`, `strata-desktop-core`, `leleka-deploy`, `leleka-gateway-text` and `leleka-npu-service` is the only file that calls `std::env::var`; the other modules ask for a typed value (`env_settings::number::("STRATA_QUEUE_TIMEOUT_S")`, `supervisor_status_file()`, `hub_token()`, `stage_trace()`, `home_dir()`, `hf_token_set()`). The reads stay live, so the order of the checks and the messages of the run configuration are as before. `leleka-deploy` passes its `LELEKA_*` lookup around as `EnvLookup = fn(&str) -> Option` (a function pointer, no `dyn`), the tests pass `env_settings::nothing` or a non-capturing closure. +**One reader per crate.** `env_settings.rs` in `leleka-control-plane`, `leleka-engine-host`, `leleka-deploy`, `leleka-gateway-text` and `leleka-npu-service` is the only file that calls `std::env::var`; the other modules ask for a typed value (`env_settings::number::("STRATA_QUEUE_TIMEOUT_S")`, `supervisor_status_file()`, `hub_token()`, `stage_trace()`, `home_dir()`, `hf_token_set()`). The reads stay live, so the order of the checks and the messages of the run configuration are as before. `leleka-deploy` passes its `LELEKA_*` lookup around as `EnvLookup = fn(&str) -> Option` (a function pointer, no `dyn`), the tests pass `env_settings::nothing` or a non-capturing closure. -**Clock.** `leleka-deploy`: the supervisor owns an `AnyClock` (a manual one in tests) and the command flows read `SystemClock` of `leleka-obs`. `strata-control`: the MCP hub and servers and the hardware series hold an `AnyClock`; `model/file_download.rs` uses the gateway `SystemClock`. `strata-desktop-core`: the node's inventory cache holds an `AnyClock`, the asynchronous deadlines read `clock::RuntimeClock` (tokio's clock, which `tokio::time::pause` controls). Exceptions: the two adapters and the manual clock fixture, the node subscription's freshness stamps, the NPU profile laps and the scripted engine's pacing. +**Clock.** `leleka-deploy`: the supervisor owns an `AnyClock` (a manual one in tests) and the command flows read `SystemClock` of `leleka-obs`. `leleka-control-plane`: the MCP hub and servers and the hardware series hold an `AnyClock`; `model/file_download.rs` uses the gateway `SystemClock`. `leleka-engine-host`: the node's inventory cache holds an `AnyClock`, the asynchronous deadlines read `clock::RuntimeClock` (tokio's clock, which `tokio::time::pause` controls). Exceptions: the two adapters and the manual clock fixture, the node subscription's freshness stamps, the NPU profile laps and the scripted engine's pacing. -**Exceptions (reasons in `architecture.json`).** `dyn-trait`: the five `Shared*` ports of `strata-control` and `AppState`'s codec (composition), `SharedCodec`, the error source chain, the per-request token-bytes closure, the two tonic streaming types of `desktop-core`, the scripted engine's responder. `process-global`: the compiled pinned chat template, the schema validity cache, the request metrics registry, the gpt-oss prompt date set at start-up, the stage-trace table. +**Exceptions (reasons in `architecture.json`).** `dyn-trait`: the five `Shared*` ports of `leleka-control-plane` and `AppState`'s codec (composition), `SharedCodec`, the error source chain, the per-request token-bytes closure, the two tonic streaming types of `desktop-core`, the scripted engine's responder. `process-global`: the compiled pinned chat template, the schema validity cache, the request metrics registry, the gpt-oss prompt date set at start-up, the stage-trace table. **Names and docs.** About 150 generated doc headers (`Methods of ...`, `Functions: ...`, `Unit tests of this module (split out ...)`) are real sentences that say what the file holds and why it is separate. 60 modules were renamed by what they hold with `scripts/dev/rename_module.py` (`worker/generation_result.rs` -> `worker_entry.rs`, `model/fetch_one.rs` -> `file_download.rs`, `mtp_fetch/mtime_ns.rs` -> `command_line.rs`, `server_api/slots.rs` -> `status_routes.rs`, `desktop-core` `gateway/secret.rs` -> `pool_gateway.rs`, ...). `*_methods` group modules and `ConversationManager` are in `engine-core`/the engine, not in these crates. @@ -232,7 +232,7 @@ Crates: `strata-control`, `strata-desktop-core`, `leleka-deploy`, `leleka-gatewa | What | Why | Next step | |---|---|---| | hot-path sites (`env-read` 3, `instant-now` 15 + 4, `process-global` 2 in `control`/`desktop-core`) | admission, streaming and the gRPC client are held back until the two-binary identity run | branch `claude/debt-hot-control` | -| Windows-only files (`key_init/windows.rs`, `facts/windows.rs`, `winfront/*`, `winservice/*`) | edited by hand (names read from the code); no Windows `cargo check` could run because `leleka-memory` and `leleka-model-format` do not compile for Windows at this commit (`governor/operations.rs`, `qwen4exp_*`: unresolved imports under `cfg(windows)`) | a Windows `cargo check -p leleka-deploy -p strata-control` once those two crates compile there | +| Windows-only files (`key_init/windows.rs`, `facts/windows.rs`, `winfront/*`, `winservice/*`) | edited by hand (names read from the code); no Windows `cargo check` could run because `leleka-memory` and `leleka-model-format` do not compile for Windows at this commit (`governor/operations.rs`, `qwen4exp_*`: unresolved imports under `cfg(windows)`) | a Windows `cargo check -p leleka-deploy -p leleka-control-plane` once those two crates compile there | | deploy end-to-end tests `dry_run_*` and `reconfigure_flow::*` | need free VRAM and a quiet GPU (host checks read `nvidia-smi`); they fail on the busy laptop with "GPU memory: ... free but the engine needs ..." | run on the 5090 | ### (d) Other open items of this file (unchanged by the pass; the owner's order for them) @@ -289,7 +289,7 @@ What is still outside the port, and why: | --- | --- | --- | | `settings::process()` | one `OnceLock`: leaf code (the nine `driver_error` functions, the GDN/prefill switches, the serve loop traces) cannot take a parameter without threading it through hundreds of `map_err(driver_error)` calls; `LoadEnv::settings` carries it on the load path, the rest asks `process()` | injecting the settings (and the clock, S14) into the executors and the stack. S19 extracted the pure policy only and `engine-core` takes no `Settings`, so this is still open | | `leleka-cuda-driver` (76 reads, 96 keys) | the driver parses its own options (`OriginalStagerOptions`, `OriginalResidentOptions`, the draft vocabulary, `logpos_topk_from_environment` and others); runtime never calls them, the driver does | a settings crate below the driver (L1) that both crates use, then the same capture-and-topic move | -| `leleka-native-cpu-expert` (19), `leleka-gptoss` (6), `leleka-model-format` (5), `leleka-libc-shim` (4), `leleka-memory` (3), `leleka-deploy` (41), `strata-control` (19), `strata-desktop-core` (15) and the other CPU/iGPU/NPU crates | same pattern in their own crates; deploy sets the child's environment on purpose | follow-up steps per crate, after the settings crate exists | +| `leleka-native-cpu-expert` (19), `leleka-gptoss` (6), `leleka-model-format` (5), `leleka-libc-shim` (4), `leleka-memory` (3), `leleka-deploy` (41), `leleka-control-plane` (19), `leleka-engine-host` (15) and the other CPU/iGPU/NPU crates | same pattern in their own crates; deploy sets the child's environment on purpose | follow-up steps per crate, after the settings crate exists | | `memory_governor`, `ResidentPolicy::from_environment` | public or crate-wide entry points keep their signature and read `settings::process().env()` | callers pass the capture once the load path owns a `Settings` reference everywhere | | replay and GPU proof modules (`backend_original_serve_replay.rs`, `gpu_proofs/`) | read their operator inputs from `std::env` | test-only, not counted | @@ -621,7 +621,7 @@ and the doc comments in `crates/` (`crates/engine-core/src/family.rs` names `lel ## leleka-gateway-domain `responses/` (STRA-338 S21, wider scope) -The pure Responses protocol moved from `strata-control` to `crates/gateway-domain/src/responses/` with the code text +The pure Responses protocol moved from `leleka-control-plane` to `crates/gateway-domain/src/responses/` with the code text unchanged; only what the compiler or the gate forced was edited. The functions below keep the shape they had and miss the limits (function 30 lines, complexity 10, nesting 4, 120 columns). A line count is the function as measured by `scripts/dev` style counting (signature to closing brace). @@ -645,11 +645,11 @@ and in the doc comment of `tool_schema_accepted`; they are moved text. What changed in the move, apart from `pub(super)` becoming `pub`: * `render_request` -> `render_request_with(request, marks, template_span)`: the `render_template` stage span is created - by the closure the caller passes (`strata-control` keeps `render_request` with the old signature and passes + by the closure the caller passes (`leleka-control-plane` keeps `render_request` with the old signature and passes `stage_trace::span`), so the domain does not read the stage trace global. * `parse_output_items_after` -> `parse_output_items_with(.., options) -> (items, notes)` and `decode_generation_with` -> `decode_generation_noted(.., natural_options, on_call_in_reasoning)`: the recovery flag is the caller's - (`TOOL_CALL_RECOVERY` stays in `strata-control`) and so are the log lines (`elog!`). `strata-control` keeps both old + (`TOOL_CALL_RECOVERY` stays in `leleka-control-plane`) and so are the log lines (`elog!`). `leleka-control-plane` keeps both old names as wrappers. The log line for a call written inside the reasoning is now emitted by a closure at the same point. * `CreateRequest::apply_defaults(&Settings)` -> `apply_defaults(&MergedDefaults, &SharedDefaults)`; the one caller passes `settings.merged()` and `settings.shared()` in that order, as the method did. @@ -657,7 +657,7 @@ What changed in the move, apart from `pub(super)` becoming `pub`: domain crate did not rise. * `tool_schema_accepted` keeps its process-wide memo (a coding agent sends the same tool schemas on every request and the schema is validated three times per request). It moved with the function, so `process-global:leleka-gateway-domain` is - 3 and `process-global:strata-control` fell from 14 to 11 (`--allow-increase` was used for the new key only; the sum is + 3 and `process-global:leleka-control-plane` fell from 14 to 11 (`--allow-increase` was used for the new key only; the sum is unchanged). Removing it needs the memo owned by the gateway state and passed to `validate`, which changes every caller. ## OutputEvent and the output decoders (STRA-338 S23) @@ -665,7 +665,7 @@ What changed in the move, apart from `pub(super)` becoming `pub`: `crates/gateway-domain/src/output/` is new (pure, L2): `event.rs` (`OutputEvent`, `OutputError`), `token_bytes.rs` (the family's bytes), `live.rs` (`LiveDecoder`) and `at_end.rs` (`AtEndDecoder`) with `cut.rs` (the cut of a finished generation), `harmony.rs` (the gpt-oss decoder, moved from `control-plane/src/harmony_family.rs`), `reasoning_preview.rs`, `utf8.rs`, `fold.rs` (`output_items`); the -`` marker is `think_marker.rs`; the sampler limit of a worker is `sampler_limit.rs`. The four consumers in `strata-control` read events; `docs/architecture/output-event.md` has +`` marker is `think_marker.rs`; the sampler limit of a worker is `sampler_limit.rs`. The four consumers in `leleka-control-plane` read events; `docs/architecture/output-event.md` has the flow analysis, the table of the sites that asked for the family, the identity proof, the behaviour changes and the list of what was kept on purpose. What it did not do: @@ -673,9 +673,9 @@ was kept on purpose. What it did not do: |---|---|---| | `HarmonyDecoder` writes Qwen-style markup that the shared cut and parse read | reading the channels directly changes a `` inside the analysis text and the calls-without-tools quirk; both are pinned by the golden | an owner decision, then one `Bytes` arm that emits events | | `intake/intake_stages.rs` `render_prompt` still matches `Family`; `qwen()` for pictures, the reasoning budget and the runtime backend | input side of the codec | a prompt-rendering port | -| `GptOssCodec` lives in `strata-control` | it holds the BPE loaded from a GGUF file (`std::fs`), which the pure domain may not read | none needed; the decoder it hands out is in the domain | +| `GptOssCodec` lives in `leleka-control-plane` | it holds the BPE loaded from a GGUF file (`std::fs`), which the pure domain may not read | none needed; the decoder it hands out is in the domain | -## strata-control `responses/` (STRA-338 S6, rest) +## leleka-control-plane `responses/` (STRA-338 S6, rest) `responses.rs` is 97 lines (module list and re-exports); its children are named for what they do: `route`, `create`, `intake`, `render`, `reasoning`, `tool_recovery`, `stream/`, `history`, `history_adapter`, `resources`, `errors`, diff --git a/docs/build-validation.md b/docs/build-validation.md index ede15341..70037d39 100644 --- a/docs/build-validation.md +++ b/docs/build-validation.md @@ -119,7 +119,7 @@ The test toolchain was installed into ignored `artifacts/tool-venv/` for this ru - Ported the koference KAR-2 container writer for already encoded RAW/NESTED tensor slices to Rust. A native two-tensor archive has the same SHA-256, `013d3daa3f8ee70feb7045eee29390cb51e16d2a8558444cc8d6cbb91918f4f2`, as the independently generated reference archive at koference commit `806d2398ae1daaceb2917242911e5680cbfb3608`. The writer's temporary output passes native payload verification before publication. This fixture is synthetic and does not establish model quality or a bounded-memory full-model conversion. - Rust 1.99 formatting, Clippy with warnings denied, and all 32 Rust tests pass with the native writer. - Added a GGUF tensor index that checks exact source block lengths and can hash one tensor with a fixed 1 MiB buffer. A synthetic mixed F32/IQ3_S fixture verifies offsets, lengths, and rejection of overlapping sections, a misaligned quantized row, and an unsupported type. All 33 Rust tests and Clippy with warnings denied pass; this is a source-layout check, not a KAR encoder or model conversion. -- The `model index /tmp/strata-next-index-smoke.gguf --hash` CLI emitted the expected two JSON records: F32 at absolute offset 128 with 16 bytes, and IQ3_S at 160 with 110 bytes; both SHA-256 values matched the synthetic zero payloads. `cargo check --locked --target aarch64-unknown-linux-musl` passed with this source. +- The `model index /tmp/leleka-api-index-smoke.gguf --hash` CLI emitted the expected two JSON records: F32 at absolute offset 128 with 16 bytes, and IQ3_S at 160 with 110 bytes; both SHA-256 values matched the synthetic zero payloads. `cargo check --locked --target aarch64-unknown-linux-musl` passed with this source. - The KAR writer's file-backed RAW path generated the same complete archive bytes as its in-memory path, rejected a changed source digest without publishing a destination, and passed a separate 1,048,580-byte input crossing the 1 MiB copy boundary. Rust 1.99 formatting, Clippy with warnings denied, all 34 tests, and Linux/arm64 musl cross-check pass. NESTED encoded data is still in-memory, so full-model conversion is not bounded yet. - Added a file-backed NESTED path for already coded KAR sections. A synthetic file-backed section produces the same complete archive bytes as the in-memory writer; corrupted scale, nonzero padding, and wrong section digest each fail before publication. The path streams through 1 MiB and retains no full encoded tensor in RAM. All 35 Rust tests, Clippy with warnings denied, and Linux/arm64 musl cross-check pass. The source-to-NESTED encoder is still missing, so this does not complete model conversion. - Added an experimental native f32-to-KAR bit-plane encoder with supplied thresholds. A synthetic four-cell pattern produced the koference word layout (`0xcccccccc`, `0xaaaaaaaa`), then passed through the KAR writer and verifier. IEEE f16 scale conversion tests include the smallest subnormal and ties-to-even. All 37 Rust tests, Clippy with warnings denied, and Linux/arm64 musl cross-check pass. Calibration fitting, IQ3_S decoding, bounded source conversion, and full-model quality remain open. @@ -146,7 +146,7 @@ The test toolchain was installed into ignored `artifacts/tool-venv/` for this ru - On a **provisional real-data sample** from the partially downloaded first Qwen shard, a 28,835,840-byte leading slice of `blk.17.ffn_gate_exps.weight` (IQ3_S, starting at absolute GGUF offset 19,192,385,920) and the 921,600-byte `blk.0.ffn_down_shexp.weight` (IQ4_NL, offset 1,385,570,304) were wrapped as two minimal GGUF shards outside Git. Their GGUF bytes total 29,757,760 and their level-2 KAR-2 archive is 21,485,056 bytes (72.1998% of this sample, 2.500179 accounted bits per weight), SHA-256 `ebacd3cd488274a21bc94630c841d157b5633ce62721bb991c39b78dad8cef23`. The dedicated verifier matched manifest source hashes, derived-F32 identity, provenance, KAR source records, and payload CRCs. The maximum tensor relative L2 error was **0.40491666**, so this level is not approved for serving. The full source shard hash has not yet been checked; this sample is not representative of whole-model size or quality. `scripts/measure-real-sample.py` reproduces this measurement into an output directory outside Git; pass `--index-gguf` only while the source is a partial download, and `--source-sha256` after its full hash is known. The chosen source GGUF offsets are absolute as printed by `model index`; no data-start offset is added. - Repeated the same sample through `scripts/measure-real-sample.py`: level 2 reproduced the same 21,485,056-byte archive and SHA-256. Level 3 gave a 30,078,464-byte archive (101.0777% of sampled GGUF input), SHA-256 `3e6bc55254ba30bea5ed4f40c970ac9290ad4b1fd160e5c92e71caaaff0328e2`, and maximum tensor relative L2 error **0.18060363**. Both archives passed the dedicated manifest/provenance/payload verifier. These measurements show a sample rate/error tradeoff, not a whole-model compression or agent-quality result; neither rate is enabled for serving. - `cargo run --locked --release --example compare-iq3-s -- 262144` compared every block in the sampled real IQ3_S slice: **262,144 blocks / 67,108,864 F32 values were bit-identical** between the independent Rust decoder and the pinned ggml C decoder. This is a non-lossy decoder parity check on source bytes from the incomplete first shard; the complete shard still needs manifest SHA-256 verification. -- Built the committed static-CLI Dockerfile on an arm64 Linux container with `RUST_TARGET=aarch64-unknown-linux-musl`. The resulting single `strata-next` ELF is 14 MiB (`file` reports `statically linked`), SHA-256 `3faa76d410f08134cb39bc77009674ffba8e9a3190bfa7af0099028ed5282285`. The `scratch` image ran `--version` successfully and independently verified the real-slice level-2 KAR archive through a read-only bind mount, including manifest source hashes, provenance, source records, and payload CRCs. This validates the Linux/arm64 static control-plane/CLI artifact, not the x86_64 release path or a CUDA-enabled inference runtime. Hosted GitHub Actions still has not run because this checkout has no GitHub repository or remote. +- Built the committed static-CLI Dockerfile on an arm64 Linux container with `RUST_TARGET=aarch64-unknown-linux-musl`. The resulting single `leleka-api` ELF is 14 MiB (`file` reports `statically linked`), SHA-256 `3faa76d410f08134cb39bc77009674ffba8e9a3190bfa7af0099028ed5282285`. The `scratch` image ran `--version` successfully and independently verified the real-slice level-2 KAR archive through a read-only bind mount, including manifest source hashes, provenance, source records, and payload CRCs. This validates the Linux/arm64 static control-plane/CLI artifact, not the x86_64 release path or a CUDA-enabled inference runtime. Hosted GitHub Actions still has not run because this checkout has no GitHub repository or remote. - The same reproducible sampler has an `--profile expert` option using the same 28,835,840-byte IQ3_S slice plus a 28,800,000-byte leading slice of the much larger `blk.0.ffn_down_exps.weight` IQ4_NL tensor (absolute GGUF offset 913,711,104). The two minimal GGUF inputs total 57,636,160 bytes. Level 2 produced a verified 36,973,056-byte KAR-2 archive (64.1491% of sampled input), SHA-256 `03a971fc1ff0a50c34a24fb5a29df76116f16fe9dec98ed61c3429a8f322af48`, with maximum tensor relative L2 **0.33925502**. Level 3 produced a verified 51,761,664-byte archive (89.8076%), SHA-256 `1f94757878575541d3a1568e7ba8d9e680ba6afed2c1199ae63d4c342a6203f8`, with maximum tensor relative L2 **0.16425464**. These are rates for selected slices from an incomplete shard, not an estimate with validated uncertainty for the full model, and neither rate is approved for serving. - The first complete Qwen shard was fetched and matched its manifest SHA-256 `4c1eb2ceb4915e1192f4f386021897bde56a97f40a0bb78bb86465e0f7d2aca3`. Repeating `scripts/measure-real-sample.py --profile expert --levels 2 --source-sha256 ` on this verified file reproduced the same two slice digests, 36,973,056-byte archive, archive SHA-256 `03a971fc1ff0a50c34a24fb5a29df76116f16fe9dec98ed61c3429a8f322af48`, and maximum relative L2 0.33925502. The second source shard is still downloading. - Added bounded CPU decode of an arbitrary nested KAR tensor range, reading only the relevant scales and bit-plane words after archive verification. A 96-element synthetic archive test covers ranges crossing group boundaries. On the verified-source level-2 expert sample, `compare-kar-range` independently decoded three one-million-value archive ranges and compared them with pinned ggml source decoding: IQ3_S at starts 0 and 33,000,013 had relative L2 0.32941509 and 0.32867352; IQ4_NL at start 25,000,017 had 0.34136948. The same IQ4_NL range from the level-3 archive had 0.16519821. This checks stored archive reconstruction on selected ranges, not GPU execution or model-level quality. @@ -163,10 +163,10 @@ The test toolchain was installed into ignored `artifacts/tool-venv/` for this ru ## 2026-10-03 — complete two-shard KAR-2 size - Host: macOS arm64; release CLI at commit `edf0617`; KAR-2 experimental streamed policy v4, group 32, level 2. Both source GGUF shards matched the embedded manifest SHA-256 before conversion and were rehashed by the preparation command. -- Command: `strata-next model prepare-sharded-streamed qwen-iq3-s --source-dir /Users/para/.local/share/strata-next/qwen-iq3-s --output /Users/para/.local/share/strata-next/qwen-iq3-s-l2-v4.kar --levels 2`. +- Command: `leleka-api model prepare-sharded-streamed qwen-iq3-s --source-dir /Users/para/.local/share/leleka-api/qwen-iq3-s --output /Users/para/.local/share/leleka-api/qwen-iq3-s-l2-v4.kar --levels 2`. - The complete archive has **55,295,529,472 bytes** (51.49797487 GiB) across 1,225 KAR records; the two GGUF shards have 83,617,662,656 bytes. Archive/source ratio is 0.66129006, saving 28,322,133,184 bytes (33.87099%). Accounted rate is 2.500025 bits per derived F32 weight. Archive SHA-256 is `536d612ca60eab460cb978f51748fc6fa4e9d611d4601e777884e8b51385afa5`; derived F32 SHA-256 is `c89bfcea7b1c979ad2e9e64c59fcc3c03fc414b345c5f47f027ce0ba99015479`. - The writer's full payload CRC verification passed before atomic publication, and a versioned provenance sidecar was written. The maximum tensor relative L2 error measured during encoding was 0.68008092. This is **not** a model-level quality result or permission to serve with KAR-2. No Linux GPU inference, GPU decode, or paired end-to-end throughput result exists yet. -- A separate `model verify-sharded-streamed /Users/para/.local/share/strata-next/qwen-iq3-s-l2-v4.kar --manifest qwen-iq3-s --source-dir /Users/para/.local/share/strata-next/qwen-iq3-s --levels 2` run exited successfully. It recomputed the derived F32 source identity, checked both manifest shards, all 1,225 KAR source records and payload CRCs, the archive SHA-256, and the v4 provenance policy. The provenance sidecar SHA-256 is `3edceb512c386ea4552a3e5d3d49fbd841f7bd1b314aeba8b2a87ac811a8a6b5`. Temporary section files, old real-data slices, local header fixtures, and superseded local Docker images were removed; both verified GGUF shards, the final KAR, and its provenance remain outside Git. +- A separate `model verify-sharded-streamed /Users/para/.local/share/leleka-api/qwen-iq3-s-l2-v4.kar --manifest qwen-iq3-s --source-dir /Users/para/.local/share/leleka-api/qwen-iq3-s --levels 2` run exited successfully. It recomputed the derived F32 source identity, checked both manifest shards, all 1,225 KAR source records and payload CRCs, the archive SHA-256, and the v4 provenance policy. The provenance sidecar SHA-256 is `3edceb512c386ea4552a3e5d3d49fbd841f7bd1b314aeba8b2a87ac811a8a6b5`. Temporary section files, old real-data slices, local header fixtures, and superseded local Docker images were removed; both verified GGUF shards, the final KAR, and its provenance remain outside Git. ## 2026-10-03 — outer block codec and selective precision probes @@ -177,14 +177,14 @@ The test toolchain was installed into ignored `artifacts/tool-venv/` for this ru ## 2026-10-03 — sampled distortion of the existing complete archive - Added `model analyze-sharded-kar` and a reusable verified CPU range decoder. The strict mode checks complete source derivation, archive payloads, and provenance. Its first full-model run was stopped after about 13 minutes because repeated derivation of the 707,775,598,080-byte virtual F32 stream made it unnecessarily expensive; it had produced no report or intermediate model files. A separate `--assume-verified` mode uses the earlier independent full verification of the immutable archive and source shards, checks current metadata and provenance mapping, and reads only sample windows. Synthetic compressed and RAW archives gave identical sampled relative L2 in strict and fast modes. The fast mode does **not** rehash source or archive payloads and says so in its output. -- The fast real-model run produced `/Users/para/.local/share/strata-next/qwen-iq3-s-l2-v4.sampled-distortion.json` outside Git: 1,225 records, 12,276,608 sampled values, 546,787 JSON bytes, report SHA-256 `1452b55705b9f723747df7dba47fd0484ae8b4140b0022cacceefb16970b5bbf`, bound to the previously verified archive SHA-256 `536d612ca60eab460cb978f51748fc6fa4e9d611d4601e777884e8b51385afa5`. Each record uses up to three nonoverlapping GGUF-block-aligned windows of at most 4,096 values (beginning, middle, end). The median sampled relative L2 is 0.363209; 22 records are at least 0.5 and 207 at least 0.4. The largest sampled value is 0.77458222 in `blk.0.ffn_gate_inp.weight`; 0.74248190 and 0.73494266 occur in the same tensor family at blocks 30 and 14. A window's relative L2 can exceed the earlier full-record maximum of 0.68008092 because it measures a different subset, and it is not a full-record bound or model-quality result. -- The 22 records at or above 0.5 contain 43,008,000 values. Adding one KAR bit plane only to these records would nominally add 5.13 MiB of plane bits before alignment and metadata; a serving loader and GPU path still need to apply this mixed-rate overlay. An external proposal list, `/Users/para/.local/share/strata-next/qwen-iq3-s-l3-candidates.json`, has SHA-256 `6c82c80c8edfb7a8b0e83c8ebd690339843b83a9dce0020967e7146cbcb41120`. It is a diagnostic proposal, not an approved precision policy or proof of improved model quality. The split `per_layer_token_embd.weight` sampled at 0.33714705 and 0.33125633; `token_embd.weight` at 0.33737772 and `output.weight` at 0.37104131. +- The fast real-model run produced `/Users/para/.local/share/leleka-api/qwen-iq3-s-l2-v4.sampled-distortion.json` outside Git: 1,225 records, 12,276,608 sampled values, 546,787 JSON bytes, report SHA-256 `1452b55705b9f723747df7dba47fd0484ae8b4140b0022cacceefb16970b5bbf`, bound to the previously verified archive SHA-256 `536d612ca60eab460cb978f51748fc6fa4e9d611d4601e777884e8b51385afa5`. Each record uses up to three nonoverlapping GGUF-block-aligned windows of at most 4,096 values (beginning, middle, end). The median sampled relative L2 is 0.363209; 22 records are at least 0.5 and 207 at least 0.4. The largest sampled value is 0.77458222 in `blk.0.ffn_gate_inp.weight`; 0.74248190 and 0.73494266 occur in the same tensor family at blocks 30 and 14. A window's relative L2 can exceed the earlier full-record maximum of 0.68008092 because it measures a different subset, and it is not a full-record bound or model-quality result. +- The 22 records at or above 0.5 contain 43,008,000 values. Adding one KAR bit plane only to these records would nominally add 5.13 MiB of plane bits before alignment and metadata; a serving loader and GPU path still need to apply this mixed-rate overlay. An external proposal list, `/Users/para/.local/share/leleka-api/qwen-iq3-s-l3-candidates.json`, has SHA-256 `6c82c80c8edfb7a8b0e83c8ebd690339843b83a9dce0020967e7146cbcb41120`. It is a diagnostic proposal, not an approved precision policy or proof of improved model quality. The split `per_layer_token_embd.weight` sampled at 0.33714705 and 0.33125633; `token_embd.weight` at 0.33737772 and `output.weight` at 0.37104131. ## 2026-10-03 — selected L3 overlay and paired tensor comparison -- `model prepare-kar-overlay` encoded the 22 proposed unsplit records from the original GGUF shards at KAR level 3. Each selected physical GGUF and virtual F32 digest matched the full base provenance during encoding; the KAR writer and an independent pass verified the overlay records and payloads. The overlay is `/Users/para/.local/share/strata-next/qwen-iq3-s-l3-overlay.kar`, **18,827,008 bytes** (17.955 MiB), SHA-256 `4f308e611e189b0fe8dde75287e55c65c4800bf7da8e6a5c2acef96d70c67471`, with 22 records. The corresponding base archive sections occupy 13,445,632 bytes, so the standalone overlay file exceeds those sections by 5,381,376 bytes, including its own header/directory/alignment. The overlay provenance is 6,039 bytes, SHA-256 `403eeca17d09bd51b3c5f6bae2587c62c483707e346577ab3df6feed2a2a7958`. Private staging sections were removed. -- `model compare-kar-overlay` decoded every value of the same 22 tensors from the base L2 and overlay L3 archives, compared both to pinned GGUF dequantization, and recomputed each selected source tensor's physical and F32 SHA-256. Its external report `/Users/para/.local/share/strata-next/qwen-iq3-s-l2-vs-l3-overlay.json` is 4,226 bytes, SHA-256 `6413b353381749c5d0cc0eb91ed5bf93e6b8a9c36fd7f6db9942fd20a7478e97`. All 22 full-record relative L2 errors decreased. The median across selected records was 0.50734744 at L2 and 0.22607999 at L3; the largest selected-record error decreased from 0.62459845 to 0.28435756. For `blk.0.ffn_gate_inp.weight`, the paired full-record values were 0.62459845 and 0.28435756. This is a numerical weight reconstruction result, **not** a model-quality result or a GPU/PCIe performance result. The large base archive's earlier full verification is assumed by this comparison, while the selected source tensors and small overlay were freshly checked. -- All 67 Rust tests, Clippy with warnings denied, and `git diff --check` passed after the overlay work. A current macOS arm64 release CLI was saved outside Git at `/Users/para/.local/share/strata-next/bin/strata-next-overlay-probe` (13,691,888 bytes, SHA-256 `df2ce4c26dbf000f5935fe79a31a8ef73aea64ee5e48a1f5a5888d3751c94817`). `cargo clean --profile dev` and `cargo clean --profile release` removed their build outputs; the private overlay section staging directory is gone. Verified GGUF shards, the full base KAR, overlay, and reports remain for reproduction. +- `model prepare-kar-overlay` encoded the 22 proposed unsplit records from the original GGUF shards at KAR level 3. Each selected physical GGUF and virtual F32 digest matched the full base provenance during encoding; the KAR writer and an independent pass verified the overlay records and payloads. The overlay is `/Users/para/.local/share/leleka-api/qwen-iq3-s-l3-overlay.kar`, **18,827,008 bytes** (17.955 MiB), SHA-256 `4f308e611e189b0fe8dde75287e55c65c4800bf7da8e6a5c2acef96d70c67471`, with 22 records. The corresponding base archive sections occupy 13,445,632 bytes, so the standalone overlay file exceeds those sections by 5,381,376 bytes, including its own header/directory/alignment. The overlay provenance is 6,039 bytes, SHA-256 `403eeca17d09bd51b3c5f6bae2587c62c483707e346577ab3df6feed2a2a7958`. Private staging sections were removed. +- `model compare-kar-overlay` decoded every value of the same 22 tensors from the base L2 and overlay L3 archives, compared both to pinned GGUF dequantization, and recomputed each selected source tensor's physical and F32 SHA-256. Its external report `/Users/para/.local/share/leleka-api/qwen-iq3-s-l2-vs-l3-overlay.json` is 4,226 bytes, SHA-256 `6413b353381749c5d0cc0eb91ed5bf93e6b8a9c36fd7f6db9942fd20a7478e97`. All 22 full-record relative L2 errors decreased. The median across selected records was 0.50734744 at L2 and 0.22607999 at L3; the largest selected-record error decreased from 0.62459845 to 0.28435756. For `blk.0.ffn_gate_inp.weight`, the paired full-record values were 0.62459845 and 0.28435756. This is a numerical weight reconstruction result, **not** a model-quality result or a GPU/PCIe performance result. The large base archive's earlier full verification is assumed by this comparison, while the selected source tensors and small overlay were freshly checked. +- All 67 Rust tests, Clippy with warnings denied, and `git diff --check` passed after the overlay work. A current macOS arm64 release CLI was saved outside Git at `/Users/para/.local/share/leleka-api/bin/leleka-api-overlay-probe` (13,691,888 bytes, SHA-256 `df2ce4c26dbf000f5935fe79a31a8ef73aea64ee5e48a1f5a5888d3751c94817`). `cargo clean --profile dev` and `cargo clean --profile release` removed their build outputs; the private overlay section staging directory is gone. Verified GGUF shards, the full base KAR, overlay, and reports remain for reproduction. ## 2026-10-03 — live text SSE preview @@ -206,7 +206,7 @@ The test toolchain was installed into ignored `artifacts/tool-venv/` for this ru - The new `model resolve-kar-overlay` command recomputes full SHA-256 and payload CRCs for the base and overlay archives, validates their shared virtual-F32 source, and maps every tensor name to a base or replacement record. A synthetic fixture rejected a modified overlay provenance digest. The real release-build run on macOS arm64 completed in 407.7 seconds without staging a model copy: base SHA-256 `536d612ca60eab460cb978f51748fc6fa4e9d611d4601e777884e8b51385afa5`, overlay SHA-256 `4f308e611e189b0fe8dde75287e55c65c4800bf7da8e6a5c2acef96d70c67471`, 1,225 base records, and 22 selected replacements. The large `per_layer_token_embd.weight` parent correctly resolves through two adjacent KAR records. This validates archive identity and selection only; it does not test GPU residency, CUDA decode, model quality, or inference speed. - The CLI from commit `d62c6ce` cross-built for `aarch64-unknown-linux-musl` and ran `--version` in an arm64 `scratch` container. Its ELF has no interpreter or dynamic program header; SHA-256 is `ae22b63d19c11e1de3c5d5279edbdef8042acee89a3fc1192baab25fa41efa7a`. The superseded local static CLI copy was removed. This binary still excludes the CUDA inference engine. -- `cargo check --locked --target aarch64-unknown-linux-musl` passed for the current Rust code. A first release link on macOS chose the host `cc` and failed on ELF flags; setting `CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-musl-gcc` made `cargo build --locked --release --target aarch64-unknown-linux-musl --bin strata-next` pass. The 15,141,536-byte Linux/arm64 ELF is statically linked, has no `INTERP` program header or dynamic section, and returned `strata-next 0.1.0` inside the existing Linux/arm64 `scratch` container. External copy: `/Users/para/.local/share/strata-next/bin/strata-next-linux-arm64-musl-8704ef3`, SHA-256 `78723399f292816e5f894ebf64b11ecf369eb68cef6478e363d71539d2b787ac`. This is a control-plane/CLI artifact, not a CUDA inference runtime or x86_64 release validation. +- `cargo check --locked --target aarch64-unknown-linux-musl` passed for the current Rust code. A first release link on macOS chose the host `cc` and failed on ELF flags; setting `CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-musl-gcc` made `cargo build --locked --release --target aarch64-unknown-linux-musl --bin leleka-api` pass. The 15,141,536-byte Linux/arm64 ELF is statically linked, has no `INTERP` program header or dynamic section, and returned `leleka-api 0.1.0` inside the existing Linux/arm64 `scratch` container. External copy: `/Users/para/.local/share/leleka-api/bin/leleka-api-linux-arm64-musl-8704ef3`, SHA-256 `78723399f292816e5f894ebf64b11ecf369eb68cef6478e363d71539d2b787ac`. This is a control-plane/CLI artifact, not a CUDA inference runtime or x86_64 release validation. ## 2026-10-03 — precision overlay for one partitioned PLE record @@ -223,7 +223,7 @@ The test toolchain was installed into ignored `artifacts/tool-venv/` for this ru - `model plan-kar-overlay-memory` verifies complete base and overlay archive SHA-256 values, payload CRCs, provenance, and 22 replacement mappings before calculating selected compressed residency. A synthetic v5 fixture selected six records with two overlay replacements and counted each exactly once. All 90 Rust tests and Clippy with warnings denied passed locally. - The release CLI ran against the preserved real v4 base and level-3 overlay in 421.0 seconds. Verified archive SHA-256 values were `536d612ca60eab460cb978f51748fc6fa4e9d611d4601e777884e8b51385afa5` and `4f308e611e189b0fe8dde75287e55c65c4800bf7da8e6a5c2acef96d70c67471`. At base level 2, overlay level 3, and a hypothetical 24,576 MiB GPU budget, 1,225 selected records (22 replacements) require **55,300,367,408 bytes** of compressed residency: 55,281,550,704 from selected base records and 18,816,704 from overlay records. That is 5,376,352 bytes more than the earlier base-only compressed plan. The largest full F32 scratch is 128,000,000,000 bytes, and two PLE records exceed the per-record full-decode budget while their one-row output bounds fit. All-selected residency plus one largest scratch is 183,300,367,408 bytes, so a 32 GB card cannot keep all selected records resident. This is verified archive metadata arithmetic, **not** measured GPU allocation, model quality, or inference throughput. -- The external report is `/Users/para/.local/share/strata-next/qwen-iq3-s-selected-overlay-memory.json`, 3,586 bytes, SHA-256 `488a79973f90937429af1483bafe648441cd6e76ceb3a9f9edf9c16c7fcf376c`. The verified source shards, base archive, overlay, and this report remain outside Git. The local release build output was removed after the run. +- The external report is `/Users/para/.local/share/leleka-api/qwen-iq3-s-selected-overlay-memory.json`, 3,586 bytes, SHA-256 `488a79973f90937429af1483bafe648441cd6e76ceb3a9f9edf9c16c7fcf376c`. The verified source shards, base archive, overlay, and this report remain outside Git. The local release build output was removed after the run. ## 2026-10-03 — KAR preparation space guard @@ -253,12 +253,12 @@ The test toolchain was installed into ignored `artifacts/tool-venv/` for this ru ## 2026-10-03 — private Linux x86_64 preparation host -- Cross-built the Rust control-plane/CLI at commit `3a96103` for `x86_64-unknown-linux-musl` on macOS arm64 using the pinned Rust 1.99 toolchain and musl cross compiler. The 16 MiB ELF reports static PIE, has no ELF interpreter or `DT_NEEDED` library, and has SHA-256 `d49e02212537b0290717dd7c0818c8ce1b4569712cba4c1bf5acd394285007de`. A private copy at `/home/para/.local/bin/strata-next-x86_64-musl-3a96103` on the Linux RTX 5090 host matched that digest, returned `strata-next 0.1.0`, and passed `doctor` under driver 595.91.07. This validates the CLI and driver check, not GPU inference or a single-file CUDA engine. +- Cross-built the Rust control-plane/CLI at commit `3a96103` for `x86_64-unknown-linux-musl` on macOS arm64 using the pinned Rust 1.99 toolchain and musl cross compiler. The 16 MiB ELF reports static PIE, has no ELF interpreter or `DT_NEEDED` library, and has SHA-256 `d49e02212537b0290717dd7c0818c8ce1b4569712cba4c1bf5acd394285007de`. A private copy at `/home/para/.local/bin/leleka-api-x86_64-musl-3a96103` on the Linux RTX 5090 host matched that digest, returned `leleka-api 0.1.0`, and passed `doctor` under driver 595.91.07. This validates the CLI and driver check, not GPU inference or a single-file CUDA engine. - The host's NTFS model volume had both expected-size IQ3_S source shards. An old incomplete Q5_K_XL download and nine unneeded experiment-copy directories containing only Q4_K_XL GGUF duplicates were removed after checking current process use, reclaiming 634,919,717,485 bytes in total. Available space rose from about 91 GiB to 683 GiB. The current Strata process's IQ3_S shards, pack, and MTP files were left intact. Low-priority SHA-256 verification of the remote IQ3_S shards matched the manifest values `4c1eb2ceb4915e1192f4f386021897bde56a97f40a0bb78bb86465e0f7d2aca3` and `316b46f3a2dbd68c900f43136ab9449f9dcc3725dfd8c794847c204bc161e113`. Only after this check, their 83,617,662,656-byte duplicate copies were removed from the Mac; the v4 KAR archive and overlay remain. The Mac's ten authorized Time Machine local snapshots were then removed, raising reported free space from 17 GiB to 138 GiB. The local cross-build directory was removed after the private Linux copy passed its checks. ## 2026-10-03 — RTX 5090 KAR CUDA smoke -- On Linux x86_64, driver 595.91.07 and CUDA toolkit/runtime 13.2, compiled the pinned `libkar.cu` plus the local smoke target for `sm_120`. The current Strata server was idle; one synthetic non-streaming Chat Completions request completed with `finish_reason=stop` and 39 prompt / 4 completion tokens. Its raw response and timings are stored privately at `/mnt/microcrm-flash-preflight/microcrm-flash-next-experiment/strata-next/baseline-smoke-iq3-s.json`. The server used engine commit `30ec18ec7094550fcc594fd948220d511d80464e` with six dirty paths, engine binary SHA-256 `f631b32495440f1dde716734559e757b76f5436c34ca49164cb97bd80b4b18e7`, and config SHA-256 `ac4eebc189350a6392078f168c71cabb45042221e0f7321006922002c1b2a3e0`. This four-token request is a readiness smoke, not a throughput baseline. +- On Linux x86_64, driver 595.91.07 and CUDA toolkit/runtime 13.2, compiled the pinned `libkar.cu` plus the local smoke target for `sm_120`. The current Strata server was idle; one synthetic non-streaming Chat Completions request completed with `finish_reason=stop` and 39 prompt / 4 completion tokens. Its raw response and timings are stored privately at `/mnt/microcrm-flash-preflight/microcrm-flash-next-experiment/leleka-api/baseline-smoke-iq3-s.json`. The server used engine commit `30ec18ec7094550fcc594fd948220d511d80464e` with six dirty paths, engine binary SHA-256 `f631b32495440f1dde716734559e757b76f5436c34ca49164cb97bd80b4b18e7`, and config SHA-256 `ac4eebc189350a6392078f168c71cabb45042221e0f7321006922002c1b2a3e0`. This four-token request is a readiness smoke, not a throughput baseline. - The server's authorized `/unload` returned `unloaded`; GPU memory use fell from 31,867 to 34 MiB while its HTTP process stayed ready for `/load`. On a 32-element KAR fixture, both full and one-row GPU decoding matched the CPU FNV-1a `ff9fd7a827b333a5`. Thirty warm GPU iterations gave medians 0.002816 ms full and 0.003136 ms row, with compressed residency 64 bytes. These are tiny-kernel timings, not a model speed claim. - The verified 18,827,008-byte real level-3 overlay was copied privately to the NTFS volume and matched its known SHA-256 `4f308e611e189b0fe8dde75287e55c65c4800bf7da8e6a5c2acef96d70c67471`. Full GPU decoding of `blk.34.ssm_beta.weight` at level 3 matched the independent CPU byte checksum `7a8bd0b57620bfea` across 122,880 F32 values; one-row GPU decoding of `blk.0.ffn_gate_inp.weight` matched CPU byte checksum `1a84ea920505914` across 2,560 F32 values. Each used 30 warm iterations; GPU medians were about 0.003168 ms on these small outputs. This checks CPU/CUDA reconstruction for two real records, not an end-to-end model-quality or throughput result. - A private v5 PLE-partitioned level-2 conversion is running on the verified remote GGUF shards with low CPU/I/O priority. The v4 base archive is being copied privately for the larger PLE row and overlay-selection smoke checks. No v5 size, model quality gate, or compressed-model inference result is claimed before those jobs finish and independent verification passes. @@ -386,7 +386,7 @@ The test toolchain was installed into ignored `artifacts/tool-venv/` for this ru - Static musl CLI: **17,046,600 bytes**, SHA-256 `b1276083b9a71ea74a0cdefd66f968d064a6dc430a177dc2cd9509a25294b6dc`. Private raw evidence and offline driver: - `/home/para/.cache/strata-next/native-structured-20261004`. + `/home/para/.cache/leleka-api/native-structured-20261004`. Initial test setup pointed to the extraction parent rather than its tokenizer child; correcting that private configuration allowed startup. No serving code workaround or Python serving component was added. @@ -433,7 +433,7 @@ The test toolchain was installed into ignored `artifacts/tool-venv/` for this ru These are single sequential functional checks with mixed prefix reuse, not a paired throughput result or full model-quality evaluation. Private evidence: -`/home/para/.cache/strata-next/native-reasoning-20261004` (includes the driver, +`/home/para/.cache/leleka-api/native-reasoning-20261004` (includes the driver, raw responses/events, token usage and logs). Model files were not rehashed. Static CLI: **17,083,088 bytes**, SHA-256 `949696b3e915cc662f6622cb284eab46fd8d372bc82233276a0d04a1bb82eb3b`. @@ -553,18 +553,18 @@ soak still remain; hosted Actions has not run. backup/idempotence/profile preservation and refusal to overwrite an unrelated helper. The test is included in `scripts/check-local.sh` for future Linux CI. - The installed real controller completed status/start/start/status/logs/stop/ - stop/status against `strata-next-controller-smoke-20261004.service` on + stop/status against `leleka-api-controller-smoke-20261004.service` on rnr5090. This isolated CPU-only native service reported the expected model identity via HTTP and correctly remained unready without an engine. The second start and second stop reported `changed: false`. The normal default - `strata-next.service` was absent and was not created by a status call. + `leleka-api.service` was absent and was not created by a status call. - The laptop integration is installed with a private backup; the normal connection remains unchanged. This is client-side Python only; inference still runs directly through Rust and the existing engine. - Real GPU service migration, managed GPU stop during active generation and login/boot persistence remain unqualified. The external trial endpoint is preserved; these commands do not adopt it. Raw smoke results are private in - `~/.cache/strata-next/native-console-20261004/controller-service-quality.json`. + `~/.cache/leleka-api/native-console-20261004/controller-service-quality.json`. ## Optional native API auth — 2026-10-04 @@ -749,7 +749,7 @@ soak still remain; hosted Actions has not run. rebuild was performed in this step. Its byte identity is verified directly. Combined executable: 63,007,200 bytes, SHA-256 `ec21fb36fc0ed665fab063877a575b8376d7e8fd9aacbd43889851ac46fd3f5d`, - retained privately as `strata-next-linux-x86_64-musl-embedded-preview`. + retained privately as `leleka-api-linux-x86_64-musl-embedded-preview`. `engine-info` and license output ran on Linux without loading the GPU engine. Outer ELF has no INTERP/NEEDED entries. The embedded ELF still requires libcudart.so.13, libcublas.so.13, libstdc++, libgcc, libc and libm; its existing @@ -852,7 +852,7 @@ equality remain mandatory checks for this build-path change. Existing static-engine, combined-package and OCI builders supply the actual compile/link, dependency/ABI, embedded identity and GPU-hidden help gates. -The private `strata-next-hosted-cuda-preview` artifact retains package checksums, +The private `leleka-api-hosted-cuda-preview` artifact retains package checksums, source provenance, image archive/receipt, exact toolkit manifest/toolchain data and component license archive. Retention is seven days. Successful upload is required; an ephemeral hosted runner is not durable fallback storage if upload @@ -891,9 +891,9 @@ tea api --repo para/leleka --login git.vezha.io --method POST \ On Linux with a running systemd user manager: ```sh -/opt/strata-next service-install --config /srv/strata/config.json \ +/opt/leleka-api service-install --config /srv/strata/config.json \ --working-dir /srv/strata --env-file /srv/strata/runtime.env \ - --unit strata-next-preview.service --start + --unit leleka-api-preview.service --start ``` `--env-file` and `--start` are optional. The command reuses `service-unit`'s @@ -927,12 +927,12 @@ boot persistence, runtime upgrades or automatic rollback of a live GPU service. After activation, or through an existing SSH loopback tunnel: ```sh -/opt/strata-next wait-ready --url http://127.0.0.1:18082 \ +/opt/leleka-api wait-ready --url http://127.0.0.1:18082 \ --model strata-native-iq3-s --key-file /srv/strata/api.key --timeout-s 300 ``` Only `GET /status` is sent. Success emits JSON with `ready`, `service`, `model` -and `attempts`; it requires the exact model ID, `service: strata-control`, +and `attempts`; it requires the exact model ID, `service: leleka-control-plane`, `worker: ready` and `ready: true`. This is a readiness snapshot, not an inference or quality probe, and availability may change immediately afterward. diff --git a/docs/ci-audit.md b/docs/ci-audit.md index 07dc0127..bf0ef39b 100644 --- a/docs/ci-audit.md +++ b/docs/ci-audit.md @@ -43,8 +43,8 @@ import), and the **static musl CLI did not compile** (`MADV_COLLAPSE`). Both are | Shipped artifact (docs/deploy.md section 8) | Built by CI before | Tested by CI before | Now | | --- | --- | --- | --- | | `leleka` (leleka-deploy: 126 unit, 18 end-to-end, 6 recipe tests) | no | no | release build and tests in `check-local.sh --product` / `product.yml` | -| `strata-next` (strata-control) | musl release build (`linux-static-cli`, `release-cli`), debug in `verify` | `cargo test` via `--manifest-path control-plane` (416 tests) and 29 smoke scripts | unchanged, plus release glibc build and `-p strata-control` tests in the product job | -| `leleka-inference`, `leleka-daemon`, `leleka-cli`, `leleka-seal-exec` (strata-desktop-core, `--features sm86`) | debug build inside `desktop.yml` only (not `sm86`, not release) | desktop-core tests (161) | release build with `--features sm86` of exactly those four binaries | +| `leleka-api` (leleka-control-plane) | musl release build (`linux-static-cli`, `release-cli`), debug in `verify` | `cargo test` via `--manifest-path control-plane` (416 tests) and 29 smoke scripts | unchanged, plus release glibc build and `-p leleka-control-plane` tests in the product job | +| `leleka-inference`, `leleka-daemon`, `leleka-cli`, `leleka-seal-exec` (leleka-engine-host, `--features sm86`) | debug build inside `desktop.yml` only (not `sm86`, not release) | desktop-core tests (161) | release build with `--features sm86` of exactly those four binaries | | leleka-runtime (the engine) | `cargo check` only | no (631 tests, 60 ignored) | `cargo check --all-targets` and `cargo test` | | leleka-cuda-driver | `cargo check --features cuda-driver`; **`cargo test` without the feature, which does not compile** | no | tests with `--features cuda-driver` | | leleka-memory, leleka-runtime-client | built as dependencies only | no | tests, Clippy and (runtime-client) rustfmt as hard gates | @@ -71,14 +71,14 @@ two builds sharing the CPU. | `cargo build --locked` (all 30 default-members) | Win | PASS 198 s | | | `cargo build --locked` | WSL | PASS 835 s (crate download + `/mnt/c`) | | | `cargo build --locked --release -p leleka-deploy` (`leleka`) | Win / WSL | PASS 39 s / 45 s | `target/release/leleka(.exe)` produced | -| release set of `docs/deploy.md` §8 (`strata-next` + 4 desktop-core binaries, `--features sm86`) | Win / WSL | PASS 287 s / 330 s | all six binaries present | +| release set of `docs/deploy.md` §8 (`leleka-api` + 4 desktop-core binaries, `--features sm86`) | Win / WSL | PASS 287 s / 330 s | all six binaries present | | `check-local.sh --fast` | Win / WSL | **FAIL** 1 s / 3 s | rustfmt diff in "strict" crates `leleka-backend-api` (3 hunks) and `leleka-context` (5); behind it, Clippy `type_complexity` in `leleka-tokenizer`, and `literal_port` in `leleka-experimental-ref` | | `check-local.sh --port`, `--full` (also with `STRICT_DEBT=1`) | WSL | **FAIL** 2 to 3 s | stop at the same fast-path failure (`set -e`) | | `cargo test -p leleka-cuda-driver` (the `--full` line) | Win / WSL | **FAIL** 8 s / 17 s | 32 compile errors: modules such as `original_expert_stager` and `native_head` exist only with feature `cuda-driver`; `leleka-runtime` always enables it, so nothing noticed | | `cargo test -p leleka-cuda-driver --features cuda-driver` | Win / WSL | PASS 71 s / 86 s | | | `cargo test -p leleka-memory` / `-p leleka-runtime-client` | Win, WSL | PASS | 80 / 84 and 12 tests | -| `cargo test -p strata-control` | Win / WSL | PASS 189 s / 475 s | 359 / 416 tests | -| `cargo test -p strata-desktop-core` | Win / WSL | PASS 148 s / 341 s | 152 / 161 tests | +| `cargo test -p leleka-control-plane` | Win / WSL | PASS 189 s / 475 s | 359 / 416 tests | +| `cargo test -p leleka-engine-host` | Win / WSL | PASS 148 s / 341 s | 152 / 161 tests | | `cargo test -p leleka-runtime` | Win | PASS 113 s | 592 tests | | `cargo test -p leleka-runtime` | WSL | FAIL-ENV 143 s | 2 tests (`failed_cleanup_or_replaced_inode_never_deletes_unowned_file`, `frozen_same_fd_hash_owner_and_source_independence`): fixtures under `../../target/` on 9p. PASS in WSL-ns, 631 tests | | `cargo test -p leleka-native-cpu-expert` | WSL | PASS 122 s | | @@ -91,7 +91,7 @@ two builds sharing the CPU. | `control-plane` Clippy (`--full`, no `--no-deps`) | WSL | FAIL | it lints path dependency `leleka-model-format` (known debt) | | `desktop.yml`: Format / Lints / Hardware smoke | Win, WSL | FAIL / FAIL / FAIL | 22 hunks; same path-dependency Clippy failure; `cargo run` "could not determine which binary" (six binaries, no `default-run`) | | `desktop.yml`: Tests | WSL | PASS | 161 tests | -| `smoke-*.py` of `linux-static-cli` against the glibc `strata-next` | WSL | mostly FAIL-ENV | 9p lacks `chmod` (key-file mode checks), numpy missing, one script hangs without a timeout (`smoke-wait-ready`, killed after 21 min) | +| `smoke-*.py` of `linux-static-cli` against the glibc `leleka-api` | WSL | mostly FAIL-ENV | 9p lacks `chmod` (key-file mode checks), numpy missing, one script hangs without a timeout (`smoke-wait-ready`, killed after 21 min) | | python `test-*.py` of `--full` | WSL | 8 FAIL-ENV, 1 numpy | `chmod`, FIFO, symlink on 9p; `numpy` missing for `test-keyless-routing`; all PASS in WSL-ns except numpy | ### 3.2 After this branch, on the `f9003b7ce` base @@ -112,7 +112,7 @@ two builds sharing the CPU. | `desktop.yml`: Format / Tests / Lints (`--no-deps`) / Hardware smoke (`--bin strata-desktop`) | WSL-ns | PASS / PASS (161) / PASS / PASS | | | `desktop.yml`: `dotnet restore/build`, `--self-check`, `reconnect.py`, `lifecycle.py` | | SKIPPED | .NET SDK 9.0.320 only; the project targets `net10.0` and the tests drive the dotnet app | | `linux-static-cli`: musl build | WSL | SKIPPED | `aws-lc-sys` needs a musl C compiler (`x86_64-linux-musl-gcc`, package `musl-tools`); the musl target itself was added in a worktree-local copy of the toolchain and works. Everything else in the job was run against the glibc build, next row | -| `linux-static-cli`: 29 `smoke-*.py` against the glibc `strata-next` | WSL-ns | 23 PASS, 5 FAIL-ENV, **1 FAIL** | FAIL-ENV: `smoke-native-pack`, `smoke-native-bootstrap`, `smoke-mtp-pack`, `smoke-runtime-profile` (numpy), `smoke-systemd-manager` (builds a Docker image). FAIL: `smoke-messages.py` (finding 3) | +| `linux-static-cli`: 29 `smoke-*.py` against the glibc `leleka-api` | WSL-ns | 23 PASS, 5 FAIL-ENV, **1 FAIL** | FAIL-ENV: `smoke-native-pack`, `smoke-native-bootstrap`, `smoke-mtp-pack`, `smoke-runtime-profile` (numpy), `smoke-systemd-manager` (builds a Docker image). FAIL: `smoke-messages.py` (finding 3) | | `linux-static-cli`: combined-package fixture, runtime image, `linux-cli-container` | | SKIPPED | need `musl-gcc` and Docker | | `keyless-cuda`, `static-cuda-package`, `hosted-cuda-package` (manual dispatch) | | SKIPPED | self-hosted GPU runner / CUDA toolkit download / Docker | | `port.yml`: port-fast, port-typecheck, port-oracles (shim), port-linux-tests | | PASS / PASS / PASS (live differentials SKIPPED) / absent script, stays green | | @@ -152,7 +152,7 @@ Nothing was installed on Windows or in the Ubuntu WSL distro. Logs: `artifacts/c | `scripts/test-cuda-driver-bootstrap.sh` | **FAIL** (stale), now debt in `--full` | builds a synthetic workspace of `crates/cuda-driver` alone; the crate gained path dependencies (`leleka-context`, `-model-format`, `-experimental-ref`) so `cargo metadata` fails, and the script also runs `cargo fmt --check` and Clippy `-D warnings` on the crate (finding 9). The same mock-ELF gates run on the real tree in the next row | | `scripts/linux-tests/run.sh` (the `port-linux-tests` job) | **PASS** 441 s | `leleka-cuda-driver` 437 passed / 104 ignored, `leleka-runtime` 631 / 60, `leleka-native-cpu-expert` 30 / 4; 0 failed | | `scripts/linux-tests/run.sh --mocks` (fake `libcuda.so.1` protocol gates) | **FAIL, fixed, PASS** | the fake lacked `cuStreamSynchronize`, which `Driver::load` now resolves eagerly (load-only stub added to `mock_cuda.c`); `port.yml` now runs the gates | -| musl static CLI build (`control-plane`, `--release --target x86_64-unknown-linux-musl`) | **FAIL, fixed, PASS** 353 s | `leleka-model-format` used `libc::MADV_COLLAPSE`, which libc 0.2.190 does not define for musl; spelled out locally (25, glibc's value). ELF: no `INTERP`, no `NEEDED`; `strata-next 0.1.0`, sha256 `f6d6cb85ad1a26d8cec804e3dd8eb1ad0b20f8c4b1d422bc366b7583c838d875` | +| musl static CLI build (`control-plane`, `--release --target x86_64-unknown-linux-musl`) | **FAIL, fixed, PASS** 353 s | `leleka-model-format` used `libc::MADV_COLLAPSE`, which libc 0.2.190 does not define for musl; spelled out locally (25, glibc's value). ELF: no `INTERP`, no `NEEDED`; `leleka-api 0.1.0`, sha256 `f6d6cb85ad1a26d8cec804e3dd8eb1ad0b20f8c4b1d422bc366b7583c838d875` | | `linux-static-cli`: 29 `smoke-*.py` against that binary | 26 PASS, **3 FAIL** | `smoke-messages` (finding 3, now confirmed on a clean filesystem); `smoke-mtp-pack` (finding 14); `smoke-systemd-manager` (finding 15). `smoke-service-unit` needs `systemd-analyze`, added to that job's apt list | | `linux-static-cli`: embedded CPU worker packaging, controller deployment, runtime image build and probe | **PASS** | `build-linux-package.py --cpu-fixture`, `smoke-embedded-engine`, `smoke-controller-deployment`, `build-runtime-image.py --cpu-fixture`, `smoke-runtime-image`; the owned fixture image is removed. Needs BuildKit: Ubuntu's `docker.io` has no `buildx`, and `COPY --chmod` fails on the legacy builder, so `docker-buildx` is added to that job's apt list | | `linux-cli-container` (`deploy/Dockerfile.static-cli` build, `smoke-cli-container.py`) | **FAIL, fixed, PASS** 118 s | the Dockerfile added the musl target before copying `rust-toolchain.toml`; the floating `rust:1.99` tag is 1.99.1 and the pin is 1.99.0, so the target went to the wrong toolchain ("can't find crate for `core`"). Now after the COPY. "CLI OCI passed: actual image, exact upstream license, no embedded engine/model, non-root read-only health200/ready503, graceful stop" | @@ -173,10 +173,10 @@ Nothing was installed on Windows or in the Ubuntu WSL distro. Logs: `artifacts/c 2. **`main` was red in the gates that exist**: rustfmt in two "strict" crates, a Clippy lint in `leleka-tokenizer`, the `cargo test -p leleka-cuda-driver` line that cannot compile, control-plane and desktop-core format, the Clippy lines that lint dependencies' debt, the desktop hardware smoke, a stale `8192` assertion. Fixed (section 5), except the debt below. -3. **`smoke-messages.py` fails against the current `strata-next`, and the cause may be a prompt change.** For a Messages +3. **`smoke-messages.py` fails against the current `leleka-api`, and the cause may be a prompt change.** For a Messages `tool_result` with `is_error: true`, the control plane builds `json!({"is_error":true,"content":text})` (`control-plane/src/messages.rs:268`). Since 2026-10-27 `leleka-harmony` enables `serde_json/preserve_order` (commit `3bedec610`), which feature unification applies to the - `strata-next` build, so the object is now serialized `is_error` first; before, `serde_json` sorted the keys (`content` first). The + `leleka-api` build, so the object is now serialized `is_error` first; before, `serde_json` sorted the keys (`content` first). The Rust unit test (`messages.rs:643`) expects the new order, the Python smoke expects the old one and also expects the Messages path to match the Responses path byte for byte. Either the smoke is stale or the prompt text of error results changed for Claude Code clients. This is an owner decision (tool-call integrity, AGENTS.md priority 2); I did not change it. @@ -201,7 +201,7 @@ Nothing was installed on Windows or in the Ubuntu WSL distro. Logs: `artifacts/c 9. **Format and Clippy debt, by crate** (reported by `debt`; `STRICT_DEBT=1` makes it fatal). rustfmt hunks before this branch: `leleka-runtime` 2833, `leleka-cuda-driver` 1970, `leleka-native-cpu-expert` 396, `leleka-deploy` 281, `leleka-experimental-ref` 226, `leleka-memory` 224, `leleka-model-format` 143, `leleka-libc-shim` 34; now clean: - `strata-control` (290), `strata-desktop-core` (22), `leleka-runtime-client` (8), `leleka-backend-api`, `leleka-context`. + `leleka-control-plane` (290), `leleka-engine-host` (22), `leleka-runtime-client` (8), `leleka-backend-api`, `leleka-context`. Clippy errors on Linux (`-D warnings`, lib target): `leleka-cuda-driver` 372, `leleka-runtime` 196, `leleka-model-format` 4. `leleka-memory` also has 3 Windows-only Clippy errors (unused imports, dead code) and `leleka-deploy` 2 (`layout.rs`, `winsys.rs`); the Linux gate does not see them. Other agents own those sources, so they were not mass-reformatted. @@ -220,7 +220,7 @@ Nothing was installed on Windows or in the Ubuntu WSL distro. Logs: `artifacts/c `engine/strata/src/core/mtp.cpp`; in engine 0.1.50 that file lists them in a `required[]` array and reads them through `wq(...)`, so `self_attn.q_proj.weight` is not generated and `assert bad_index != good_index` fails. **Fixed on `claude/offline-diff`**: the nine Q8_0 names are now read from `required[]` and `wq("...")` (all 26 names resolve in the pinned manifest; an assertion fails if the count changes). - Not run end to end there (the smoke needs a Linux `strata-next`, a POSIX shell worker and Python 3.11). + Not run end to end there (the smoke needs a Linux `leleka-api`, a POSIX shell worker and Python 3.11). 15. **`deploy/Dockerfile.systemd-smoke` pins apt package versions that no longer exist** (`systemd=255.4-1ubuntu8.17`, `ca-certificates=20260601~24.04.1`; apt answers "Version ... was not found"), so `smoke-systemd-manager.py` cannot build its image. Version pins rot against a rolling archive. **Fixed on `claude/offline-diff`**: the version pins are gone, the base-image digest stays. The image build was @@ -272,7 +272,7 @@ Nothing was installed on Windows or in the Ubuntu WSL distro. Logs: `artifacts/c Commit "ci: build and test what ships ..." (CI and repairs): * `.github/workflows/product.yml` (new, Gitea conventions of `linux.yml`): runs `scripts/check-local.sh --product` on `ubuntu-latest`. -* `scripts/check-local.sh --product`: coverage gate; PTX LF check; `cargo build --locked`; release build of `leleka`, `strata-next` +* `scripts/check-local.sh --product`: coverage gate; PTX LF check; `cargo build --locked`; release build of `leleka`, `leleka-api` and the four desktop-core binaries with `--features sm86`, and a check that all six exist; `cargo check --all-targets` of `leleka-cuda-driver --features cuda-driver` and `leleka-runtime`; tests of all the crates that ship (and of the 17 CPU/iGPU/NPU default-members); rustfmt and Clippy as hard gates where clean, `debt` where not. A failing step is recorded and the rest still @@ -289,11 +289,11 @@ Commit "ci: build and test what ships ..." (CI and repairs): Commit "ci: cover leleka-obs": `leleka-obs` added to `scripts/ci-coverage.json` and the product test list. -Commit "style: cargo fmt on strata-control ..." (separable): `cargo fmt` on `strata-control`, `strata-desktop-core`, `leleka-runtime-client` (37 files), the +Commit "style: cargo fmt on leleka-control-plane ..." (separable): `cargo fmt` on `leleka-control-plane`, `leleka-engine-host`, `leleka-runtime-client` (37 files), the four Clippy lints in them (`tool_output.rs`, a test `mut`, a collapsible `if` in `leleka-inference.rs`, `allow(dead_code)` on `observer_adaptive_slots`), the `log_failure_sse` fix and the `facts.rs` reorder of section 3.3. An earlier version of this commit conflicted with the observability merge, which is why it was redone on top of it; if more branches land in these crates first, drop it -and re-run `cargo fmt -p strata-control -p strata-desktop-core -p leleka-runtime-client`. +and re-run `cargo fmt -p leleka-control-plane -p leleka-engine-host -p leleka-runtime-client`. Nothing in this branch touches a kernel, `.cu`/`.ptx`, an engine numeric path, or runtime behaviour. The edits to compiled code are formatting, a type alias, a function moved above a test module, a test-only `eprintln!` replaced by `write_fmt`, `then` to `then_some` of a struct holding borrows, `% 2 == 0` to `is_multiple_of(2)`, a removed diff --git a/docs/compressed-runtime.md b/docs/compressed-runtime.md index a6bd9d57..8a2680a0 100644 --- a/docs/compressed-runtime.md +++ b/docs/compressed-runtime.md @@ -13,7 +13,7 @@ SHA-256 and sidecar for a validated run. A supervised smoke run may skip the separate full-file SHA pass while recording that it was skipped; the engine still checks payload CRCs. The feature is off in ordinary builds. `strata_next_kar_ple_probe ARCHIVE 2 ROW...` prints FNV-1a checksums for -comparison with `strata-next model checksum-kar-row` on the matching part. +comparison with `leleka-api model checksum-kar-row` on the matching part. ### Static CUDA PLE package profile @@ -94,7 +94,7 @@ GPU memory pressure, and paired agent throughput pass their gates. ## Artifact pipeline -`strata-next model fetch` downloads the pinned source shards to an external volume. `model verify` checks their size and SHA-256 before any conversion. The current experimental `model prepare-sharded-streamed` builds a KAR-2 archive and a provenance sidecar with source and archive digests, codec policy, and tensor mapping; it writes to a staging path and publishes the finished archive without replacing an existing file. A production `model prepare --format kar2` still needs a per-class rate policy, tokenizer identity, and full-model quality approval. The final one-command `serve` flow should run missing fetch/verify/prepare stages automatically, reuse a verified prepared archive on subsequent starts, and never treat an incomplete stage as usable. Neither source shards nor the archive belong in Git or CI artifacts. +`leleka-api model fetch` downloads the pinned source shards to an external volume. `model verify` checks their size and SHA-256 before any conversion. The current experimental `model prepare-sharded-streamed` builds a KAR-2 archive and a provenance sidecar with source and archive digests, codec policy, and tensor mapping; it writes to a staging path and publishes the finished archive without replacing an existing file. A production `model prepare --format kar2` still needs a per-class rate policy, tokenizer identity, and full-model quality approval. The final one-command `serve` flow should run missing fetch/verify/prepare stages automatically, reuse a verified prepared archive on subsequent starts, and never treat an incomplete stage as usable. Neither source shards nor the archive belong in Git or CI artifacts. The first source profile is Qwen3.8-Flash-Next IQ3_S, which is already quantized. KAR transcoding of it is a **lossy experiment** until full-model quality is measured. A higher-fidelity source may be needed if the IQ3_S → KAR path exceeds the error budget. Keep the verified native IQ3_S pack as the control arm and recovery path; never infer model quality from archive size or isolated tensor error alone. @@ -106,11 +106,11 @@ The current `model inspect-kar` command performs bounded structural checks, head The Rust `kar_writer` module emits a KAR-2 container from already coded RAW/NESTED tensor slices. A synthetic two-tensor output matches the pinned koference reference writer byte for byte, including header, directory, aligned payload, CRCs, and digest. The writer verifies its temporary file before atomic no-replace publication and rejects non-finite f16 scales/books. It does not choose a compression rate or approve a serving configuration. -`strata-next model index FILE.gguf [--hash]` prints one JSON record per tensor with checked absolute offset, exact source byte count, type, and dimensions. `--hash` adds a SHA-256 computed with a fixed 1 MiB buffer. The index uses Strata's pinned GGUF block geometry, including IQ3_S, and rejects unknown types, overlapping spans, truncated payloads, and rows that do not align to quantization blocks. The KAR writer can stream both RAW tensor bytes and pre-encoded NESTED sections from files through a 1 MiB buffer. It checks the RAW source digest or NESTED section digest; the latter also checks finite f16 scales/books and zero alignment padding. The experimental native encoder supplies these sections for all GGUF types found in the target model. +`leleka-api model index FILE.gguf [--hash]` prints one JSON record per tensor with checked absolute offset, exact source byte count, type, and dimensions. `--hash` adds a SHA-256 computed with a fixed 1 MiB buffer. The index uses Strata's pinned GGUF block geometry, including IQ3_S, and rejects unknown types, overlapping spans, truncated payloads, and rows that do not align to quantization blocks. The KAR writer can stream both RAW tensor bytes and pre-encoded NESTED sections from files through a 1 MiB buffer. It checks the RAW source digest or NESTED section digest; the latter also checks finite f16 scales/books and zero alignment padding. The experimental native encoder supplies these sections for all GGUF types found in the target model. An experimental native `kar_codec::encode_with_boundaries` converts one in-memory f32 tensor to group scales and MSB-first bit planes using nested boundaries. `kar_codec::fit_topdown` fits those boundaries and f16 books to an already selected normalized sample; pinned synthetic fixtures match koference's Python reference. It rounds scales to IEEE f16 before assigning cells and uses the same bit-within-u32 order as koference's CUDA decoder. `kar_codec::decode_range` reconstructs a selected prefix into a caller-sized CPU buffer, giving a small numerical oracle for later CUDA checks. The streamed pipeline separately handles source decoding, bounded calibration and encoding, while model rate selection and lossy serving approval remain open. -`strata-next model prepare-f32-preview FILE.gguf --output FILE.kar --levels N` connects the GGUF index, native calibration, encoder, CPU reconstruction check, and verified KAR writer. It accepts only a single F32 GGUF no larger than 64 MiB, at most 1000 tensors, with at most 1 million elements per tensor. Each encoded tensor is written to a private staging section and released from memory before the next tensor; the archive writer reads those sections with a 1 MiB buffer. Staging is cleaned after success or failure. It fits each tensor from all normalized values, records the rate in the KAR builder identity, and prints source/archive SHA-256 plus the maximum tensor relative L2. This command is an explicitly lossy integration preview. IQ3_S input is rejected, and no output from this command is eligible for serving until the full-model quality gate passes. +`leleka-api model prepare-f32-preview FILE.gguf --output FILE.kar --levels N` connects the GGUF index, native calibration, encoder, CPU reconstruction check, and verified KAR writer. It accepts only a single F32 GGUF no larger than 64 MiB, at most 1000 tensors, with at most 1 million elements per tensor. Each encoded tensor is written to a private staging section and released from memory before the next tensor; the archive writer reads those sections with a 1 MiB buffer. Staging is cleaned after success or failure. It fits each tensor from all normalized values, records the rate in the KAR builder identity, and prints source/archive SHA-256 plus the maximum tensor relative L2. This command is an explicitly lossy integration preview. IQ3_S input is rejected, and no output from this command is eligible for serving until the full-model quality gate passes. The Rust `iq3_s` module now decodes one GGUF IQ3_S block (110 bytes, 256 F32 outputs) or a caller-sized sequence of complete blocks. Its 512-entry grid is copied from the pinned Strata/ggml tree, checked by SHA-256, and carries the ggml MIT notice in the binary through `--ggml-license`. Synthetic block output matches an independent Python calculation. A real-data slice of 262,144 IQ3_S blocks also produced 67,108,864 bit-identical F32 values against the pinned ggml CPU decoder. Both complete source shards have since passed their manifest SHA-256 checks. @@ -164,9 +164,9 @@ The streamed assembly now consumes private staged sections as it copies them int ## GPU path -`strata-next model plan-kar-memory FILE.kar --level 2 --budget-mib 24576` reads validated KAR metadata and reports compressed-prefix residency, full F32 decode scratch, the largest single-record peak, and records whose full decode exceeds the supplied VRAM slice. The budget must be the memory left after the engine, KV cache, and other allocations; it is not the card's advertised capacity. `one_row_peak_bytes` is only a geometric lower bound for records that `kar_decode_rows()` can address. It does not mean the model can compute from one row of an arbitrary expert or projection. This command does not scan payload CRCs or approve the archive for serving. +`leleka-api model plan-kar-memory FILE.kar --level 2 --budget-mib 24576` reads validated KAR metadata and reports compressed-prefix residency, full F32 decode scratch, the largest single-record peak, and records whose full decode exceeds the supplied VRAM slice. The budget must be the memory left after the engine, KV cache, and other allocations; it is not the card's advertised capacity. `one_row_peak_bytes` is only a geometric lower bound for records that `kar_decode_rows()` can address. It does not mean the model can compute from one row of an arbitrary expert or projection. This command does not scan payload CRCs or approve the archive for serving. -`strata-next model plan-kar-overlay-memory --base BASE.kar --overlay OVERLAY.kar --base-level 2 --overlay-level 3 --budget-mib 24576` first verifies both complete archive hashes, payload CRCs, provenance, and every replacement mapping. It then counts exactly one selected record per tensor at its chosen precision level, separating base and overlay compressed residency and reporting the largest F32 scratch and one-row lower bound. Keep both archives immutable after this check. This is still a memory calculation, not GPU admission or permission to serve a lossy model. +`leleka-api model plan-kar-overlay-memory --base BASE.kar --overlay OVERLAY.kar --base-level 2 --overlay-level 3 --budget-mib 24576` first verifies both complete archive hashes, payload CRCs, provenance, and every replacement mapping. It then counts exactly one selected record per tensor at its chosen precision level, separating base and overlay compressed residency and reporting the largest F32 scratch and one-row lower bound. Keep both archives immutable after this check. This is still a memory calculation, not GPU admission or permission to serve a lossy model. On the verified Qwen3.8-Flash-Next IQ3_S level-2 archive, the metadata plan at a hypothetical 24,576 MiB slice reports 55,294,991,056 bytes if all compressed records were resident, so residency must be selective. Two split `per_layer_token_embd.weight` records exceed that slice for full F32 decode: their compressed-prefix-plus-output peaks are 138,000,000,016 and 82,801,059,856 bytes. Their one-row lower bounds are 10,000,000,656 and 6,000,077,456 bytes. `kar_decode_rows()` avoids the huge F32 output but `kar_reserve()` still stages the complete 10.0 GB or 6.0 GB compressed record. Efficient cold row lookup therefore needs smaller addressable PLE parts or a sparse staging kernel. The engine must not allocate the full decoded table on the target card. These are metadata arithmetic, not GPU measurements or quality results. diff --git a/docs/cp-latency.md b/docs/cp-latency.md index 69d43389..4bb66ee3 100644 --- a/docs/cp-latency.md +++ b/docs/cp-latency.md @@ -148,9 +148,9 @@ cold first request (ms, min over repeats): * `prompt::native_render_equals_the_template`: 4,000 random conversations (whitespace of every kind at the edges, empty contents, template-looking and special-token text, with and without system messages and tools, every effort) render to the same bytes (or the same error) both ways; the ten golden chat cases pass. -* `strata-control`: all 282 unit tests and every integration test, including the golden HTTP surface and the full-chain +* `leleka-control-plane`: all 282 unit tests and every integration test, including the golden HTTP surface and the full-chain `backend_worker_http` suite (a new test covers the prompt-text pass-through: the text is sent only if the ids decode to it, else - the old check runs); `strata-desktop-core` (the full chain with the real `RuntimeServer`), `leleka-runtime-client`, + the old check runs); `leleka-engine-host` (the full chain with the real `RuntimeServer`), `leleka-runtime-client`, `leleka-backend-api`, `leleka-serving-policy`, and `leleka-runtime --lib` (510) pass. * Kill switches: `LELEKA_TOKENIZER_REFERENCE=1` (original tokenizer only), `LELEKA_TOKENIZER_SEGMENT_CACHE_MIB=n` (0 = no cache; default 64, both engine and control plane), `STRATA_REFERENCE_RENDER=1`. @@ -159,8 +159,8 @@ cold first request (ms, min over repeats): ```text python3 scripts/cp/synth_session.py TOKENIZER_DIR CAPTURE_DIR LAST_REQ OUT.json [--extend CAPTURE2 LAST2] -cargo run --release -p strata-control --example cp_replay -- TOKENIZER_DIR OUT.json [--sizes 20000,60000] [--turns 16] [--out r.json] -cargo run --release -p strata-desktop-core --example cp_replay_grpc -- TOKENIZER_DIR OUT.json # real gRPC hop +cargo run --release -p leleka-control-plane --example cp_replay -- TOKENIZER_DIR OUT.json [--sizes 20000,60000] [--turns 16] [--out r.json] +cargo run --release -p leleka-engine-host --example cp_replay_grpc -- TOKENIZER_DIR OUT.json # real gRPC hop cp_replay TOKENIZER_DIR OUT.json --verify [--verify-step 1] # equivalence scripts/cp/run-ab.sh BASE_TREE NEW_TREE TOKENIZER_DIR OUT.json OUT_DIR 5 --turns 16; python3 scripts/cp/summarize.py OUT_DIR LELEKA_TOKENIZER_DIR=... LELEKA_TOKENIZER_TEXTS=... cargo test --release -p leleka-tokenizer @@ -168,8 +168,8 @@ LELEKA_TOKENIZER_DIR=... LELEKA_TOKENIZER_TEXTS=... cargo test --release -p lele ## 6. Real engine -Job `scripts/e2e/codex/jobs/9f1-cp-live-ab.sh` (queue name `9f1-cp-live-ab`): one model load, the current `strata-next` on :8081 and the -baseline `strata-next` on :8082 in front of the same engine (the new `leleka-inference`), one synthesized Codex session of about +Job `scripts/e2e/codex/jobs/9f1-cp-live-ab.sh` (queue name `9f1-cp-live-ab`): one model load, the current `leleka-api` on :8081 and the +baseline `leleka-api` on :8082 in front of the same engine (the new `leleka-inference`), one synthesized Codex session of about 100k tokens, 20 consecutive requests (`max_output_tokens` 64) sent alternately through the two so the engine sees the same prompt sequence either way. `scripts/cp/live_report.py` joins the client's timings with both servers' stage logs and the engine's `generation done` lines: client time to first token = pre-engine host time + engine time + post time. Queued behind the other jobs of `holder2/jobs` (23 pending when submitted); the result is appended here when it ran. diff --git a/docs/cpu-runtime.md b/docs/cpu-runtime.md index a5bb6ba0..3551dfe4 100644 --- a/docs/cpu-runtime.md +++ b/docs/cpu-runtime.md @@ -42,7 +42,7 @@ every number; see the work results on STRA-214 and STRA-217 for the paired runs) ## Serving through the control plane -The control plane (`strata-next serve`) serves `/v1/responses` for gpt-oss with this worker. Configuration +The control plane (`leleka-api serve`) serves `/v1/responses` for gpt-oss with this worker. Configuration (JSON file, or `STRATA_GPTOSS_GGUF`): ```json diff --git a/docs/delivery-gap-audit.md b/docs/delivery-gap-audit.md index 3bd68994..9cd2cccc 100644 --- a/docs/delivery-gap-audit.md +++ b/docs/delivery-gap-audit.md @@ -7,17 +7,17 @@ to this branch. The run recipe is [`rust-runtime-run.md`](rust-runtime-run.md). ## 0. Findings that decide the next work > Update 2026-10-16, branch `claude/api-over-rust-engine`: finding 1 and section 7 task 1 are addressed in software by -> [`api-over-rust-engine.md`](api-over-rust-engine.md) (the full `strata-next` API in front of the runtime, tested with a scripted +> [`api-over-rust-engine.md`](api-over-rust-engine.md) (the full `leleka-api` API in front of the runtime, tested with a scripted > engine; no real engine run). Findings 2-5 and the delivery tasks are unchanged. The lock flakes of section 1 are most likely a test > artefact (a `flock` kept alive past `drop` by a child another test forked meanwhile); the reopen in those tests now waits, and 12 of 12 -> parallel runs of the `strata-desktop-core` lib suite passed afterwards (the mechanism itself was not isolated). +> parallel runs of the `leleka-engine-host` lib suite passed afterwards (the mechanism itself was not isolated). > Update 2026-10-17, branch `claude/deploy`: the packaging half of finding 4 and tasks 3-4 of section 7 are addressed in software by > [`deploy.md`](deploy.md) (`leleka up`: preflight incl. driver/cuBLAS/`/proc`/RAM/disk, asset fetch+verify+archive with stamps, native sealed-memfd supervisor, > auto-load and readiness, systemd unit, OCI recipe, release tarball with provenance). Still open there: the MTP pack has no automated producer, no clean-VM run on > Ubuntu 24.04/26.04, the image was not built here (see `deploy.md` section 10), and SIGTERM handling of the daemon/engine is worked around by the supervisor (it sends SIGINT). -1. **Two serving stacks exist and the full API is wired to the wrong one.** `strata-next` (`control-plane/`) has the Responses / +1. **Two serving stacks exist and the full API is wired to the wrong one.** `leleka-api` (`control-plane/`) has the Responses / Chat / Messages surface, text.format, custom tools, reasoning, drain, history, MCP hub, but it drives an *engine process over the Original stdio wire protocol* (`READY`/`GEN `/`T `/`DONE`, `control-plane/src/wire.rs`). The Rust engine (`leleka-inference`) speaks gRPC with a **text prompt in, text deltas out** (`crates/backend-api/src/lib.rs:130-211`) and is @@ -29,7 +29,7 @@ to this branch. The run recipe is [`rust-runtime-run.md`](rust-runtime-run.md). 3. **Every Original-path request starts from an empty context** (no conversation or prefix reuse is bound, `docs/original-serve.md:97-104`); the backend serves one generation at a time (`backend.rs:759`). 4. **Delivery of the Rust pair is absent**: no image, no installer, no health/ready endpoint on the daemon, no SIGTERM - handling, no readiness after restart without a manual `load-mtp`. Existing packaging (`deploy/`) ships `strata-next` plus the + handling, no readiness after restart without a manual `load-mtp`. Existing packaging (`deploy/`) ships `leleka-api` plus the C++ engine only. 5. **Gate A evidence is synthetic.** Every committed Responses fixture is marked `synthetic` (`benchmarks/fixtures/responses/*.json`); no recorded Codex session or comparison against the Python server exists @@ -52,16 +52,16 @@ Failures of run 1: | test | cause | status | | --- | --- | --- | | `desktop-core/tests/native_tools_sdet.rs` `declarations_are_bounded_unique_and_closed_before_render` | stale: asserted temperature 0.4 is refused, valid since `cce4333` | fixed `203b88f` | -| `strata-desktop-core --lib` `operation_journal::tests::{append_failure_preserves_existing_evidence, terminal_history_survives_and_incomplete_is_not_replayed}` (and `recovered_uncertainty...` in reruns) | `journal already owned or locking unavailable` under the parallel lib run; pass alone and with `--test-threads=1`; 4 of 5 parallel reruns failed once, run 2 passed. Root cause not isolated (suspected: the `flock` of one test inherited by a concurrent child process until `exec`) | **open, flaky** | -| `strata-control --lib` `responses::tests::durable_history_roundtrip_delete_eviction_and_faults` | same message from `history.lock`; 3 of 3 reruns passed | **open, flaky** | +| `leleka-engine-host --lib` `operation_journal::tests::{append_failure_preserves_existing_evidence, terminal_history_survives_and_incomplete_is_not_replayed}` (and `recovered_uncertainty...` in reruns) | `journal already owned or locking unavailable` under the parallel lib run; pass alone and with `--test-threads=1`; 4 of 5 parallel reruns failed once, run 2 passed. Root cause not isolated (suspected: the `flock` of one test inherited by a concurrent child process until `exec`) | **open, flaky** | +| `leleka-control-plane --lib` `responses::tests::durable_history_roundtrip_delete_eviction_and_faults` | same message from `history.lock`; 3 of 3 reruns passed | **open, flaky** | | `runtime_gateway_sdet` `daemon_http_disconnect_cancels_one_runtime_generation` | timed out (13 s) in the loaded run; 3 of 3 isolated runs passed | load-sensitive | -Other checks on Linux: `cargo clippy -p strata-control --all-targets --no-deps -- -D warnings` clean; with dependencies it stops +Other checks on Linux: `cargo clippy -p leleka-control-plane --all-targets --no-deps -- -D warnings` clean; with dependencies it stops at known debt in `leleka-model-format` (`pinned_arena_plan.rs:325` `type_complexity`), so `scripts/check-local.sh` full mode fails -at the control-plane Clippy step. `cargo fmt -p strata-desktop-core --check` also reports existing drift (`leleka-inference.rs`, +at the control-plane Clippy step. `cargo fmt -p leleka-engine-host --check` also reports existing drift (`leleka-inference.rs`, untouched here). -HTTP/SSE smokes against `strata-next` with scripted engines (Python 3.14 as test driver only), debug binary: pass +HTTP/SSE smokes against `leleka-api` with scripted engines (Python 3.14 as test driver only), debug binary: pass `test-live-responses-replay` (21 corrupt streams rejected, JSON+SSE tool continuation), `smoke-tool-policy` (216 cases), `smoke-custom-tools`, `smoke-sse-keepalive`, `smoke-input-tokens`, `smoke-response-history` (+`--durable`), `smoke-native-drain`, `smoke-signal-drain`, `smoke-generation-deadline`, `smoke-worker-cancel`, `smoke-native-auth`, `smoke-queue-deadline`, @@ -71,7 +71,7 @@ Not run: `smoke-static-cli`, `smoke-embedded-engine`, packaging and container sm Windows 11 (Rust 1.99.0): the 8 portable crates (`leleka-backend-api`, `-tokenizer`, `-quant-core`, `-context`, `-sampler-ref`, `-experimental-ref`, `-serving-policy`, `-offline-tools`): **341 passed, 0 failed**. The default workspace does not build -here: `desktop-core` pulls `leleka-runtime` -> `leleka-cuda-driver` (Linux-only items, 29 compile errors), `strata-control` lib tests use +here: `desktop-core` pulls `leleka-runtime` -> `leleka-cuda-driver` (Linux-only items, 29 compile errors), `leleka-control-plane` lib tests use `std::os::unix` (`vision.rs:499,513`), `leleka-model-format` lib tests need the unix-only `RangeSource for KarInspection` (`kar_levels.rs:582`, used at `tests/kar_ple/mod.rs:693`). Windows is not a delivery target; use Linux. @@ -81,16 +81,16 @@ here: `desktop-core` pulls `leleka-runtime` -> `leleka-cuda-driver` (Linux-only | --- | --- | --- | | daemon gateway, mock backend, real HTTP/2 + gRPC | `runtime_gateway_sdet` (8 tests): ordered SSE with one terminal, finish reason `stop` -> `completed`, `length` -> `incomplete`, missing terminal / tool reason / accepted fault -> `response.failed` without retry, disconnect cancels one generation | pass | | daemon process + `leleka-inference` process (real binaries, **no Load**) | `/runtime/status` connected, `model_ready: false`; `/v1/responses` valid body -> 503 `model_not_ready`; unsupported field -> 400; no token -> 401 | as expected; recipe in `rust-runtime-run.md` | -| `strata-next` over a scripted engine | live SSE: `created, in_progress, output_item.added, content_part.added, output_text.delta*, done events, output_item.done, function_call_arguments.delta*/done, ... completed`; token budget -> `response.incomplete` (`max_output_tokens`); worker error -> `response.failed` (unit tests `responses.rs:5428,5490`) | pass | +| `leleka-api` over a scripted engine | live SSE: `created, in_progress, output_item.added, content_part.added, output_text.delta*, done events, output_item.done, function_call_arguments.delta*/done, ... completed`; token budget -> `response.incomplete` (`max_output_tokens`); worker error -> `response.failed` (unit tests `responses.rs:5428,5490`) | pass | | log failure | real binary, stderr consumer gone, protocol failure mid-stream | stream ends `response.failed`; readiness drops (after `e743764`) | ## 3. Python audit -Production serving path (what `strata-next serve`, `leleka-daemon`, `leleka-inference` start at run time): **no Python**. +Production serving path (what `leleka-api serve`, `leleka-daemon`, `leleka-inference` start at run time): **no Python**. | item | where | class | | --- | --- | --- | -| external processes spawned by `strata-next` | `nvidia-smi` (`doctor.rs:50`, `cuda_memory.rs:134`), `systemctl` (`service_install.rs:543,627`), operator `engine.executable` / `@embedded` memfd (`worker.rs:441`, `embedded_engine.rs`), operator `strata-vision` (`vision.rs:222`), operator `before_load` argv or `sh` (`worker.rs:235-244`), operator MCP server commands (`mcp.rs:135`), `kill` (`mcp.rs:346,355`) | no Python hard-coded; an MCP server or `before_load` the operator configures may be anything | +| external processes spawned by `leleka-api` | `nvidia-smi` (`doctor.rs:50`, `cuda_memory.rs:134`), `systemctl` (`service_install.rs:543,627`), operator `engine.executable` / `@embedded` memfd (`worker.rs:441`, `embedded_engine.rs`), operator `strata-vision` (`vision.rs:222`), operator `before_load` argv or `sh` (`worker.rs:235-244`), operator MCP server commands (`mcp.rs:135`), `kill` (`mcp.rs:346,355`) | no Python hard-coded; an MCP server or `before_load` the operator configures may be anything | | chat template | `include_str!(engine/strata/serve/chat_template.jinja)` rendered by minijinja (`prompt.rs:32`) | data file, not Python | | `leleka-inference` / `leleka-daemon` / `leleka-cli` / `leleka-seal-exec` | `ldd`: libc, libm, libgcc_s; dlopen `libcuda.so.1`, `libcublas.so.12` | none | | error text only | `original_mtp_rt.rs:71` says "run tools/mtp_rt.py" (offline conversion; ported to `crates/offline-tools`) | message | @@ -105,14 +105,14 @@ Residual risk: CI itself (`linux.yml`, `desktop.yml`, `port.yml`) needs Python; ## 4. Codex-direct audit -"strata-next" = `control-plane/`; "daemon" = `desktop-core/src/runtime_gateway.rs`. Wire contract: `docs/api-contract.md`. +"leleka-api" = `control-plane/`; "daemon" = `desktop-core/src/runtime_gateway.rs`. Wire contract: `docs/api-contract.md`. -| requirement | strata-next | daemon (Rust engine) | gap / location | +| requirement | leleka-api | daemon (Rust engine) | gap / location | | --- | --- | --- | --- | | `POST /v1/responses`, bearer auth, SSE | yes (`responses.rs:1078`, streams `:1951,2122,2423`) | yes | none | | Codex-shaped body (`include`, `reasoning`, `store:false`, `parallel_tool_calls`, `tool_choice:auto`, `prompt_cache_key`, `client_metadata`) | accepted (`responses.rs:487-521`, `:709-722`) | **400** `unsupported_request_field` (`runtime_gateway.rs:422-431`; tool path `runtime_tools.rs:393-418`) | daemon | | unknown top-level or `text` fields | **rejected** by `deny_unknown_fields` (`responses.rs:486,524`): `service_tier`, `text.verbosity`, `max_tool_calls`, `user` would 400 | rejected | decide accept-and-ignore for harmless fields | -| `reasoning.effort` / `summary` | effort none..xhigh; summary only `auto`/null (`:1361-1388`); `minimal` and `concise`/`detailed` -> 400 | thinking never enabled (`Effort::None`) | strata-next: map `minimal`; daemon: absent | +| `reasoning.effort` / `summary` | effort none..xhigh; summary only `auto`/null (`:1361-1388`); `minimal` and `concise`/`detailed` -> 400 | thinking never enabled (`Effort::None`) | leleka-api: map `minimal`; daemon: absent | | `text.format` text / json_object / json_schema | prompt guidance + validation of the finished text; buffered until DONE; invalid -> `response.failed` (`:684-707`, render `:1625-1640`, `api-contract.md` "Live structured text") | only `{"format":{"type":"text"}}` (`runtime_tools.rs:432-437`) | **no constrained decoding anywhere**; daemon: absent | | function tools | yes, schema-validated before publication (`:765-791`); names `[A-Za-z0-9_-]` up to 64 bytes | behind `experimental_native_tools` (default off, `:642`), buffered, one regeneration on invalid output, at most 128 tools (`runtime_tools.rs:14`) | daemon: default-off, no streaming of arguments | | custom tools (text) and regex format | yes, validation-only (`response_tools.rs:62-101`) | tool adapter covers namespaced custom regex (test `native_tools_sdet`) | no grammar-constrained sampling | @@ -141,16 +141,16 @@ Residual risk: CI itself (`linux.yml`, `desktop.yml`, `port.yml`) needs Python; | --- | --- | --- | --- | | driver floor | `doctor` / `gpu_requirement` know only `cuda-13.0-linux` = 580.65.06 | `doctor.rs:27,44` | the sealed PTX contains ISA 9.2 (36 `.ptx` files, nvcc 13.2) and the target floor is 595: a `cuda-13.2-linux` profile; no check for `libcublas.so.12` | | cuBLAS | the Rust engine dlopens CUDA **12** `libcublas.so.12` by name | `ple_batch_ffi.rs:147` | not packaged, not preflighted; `deploy/README.md` still says `libcublas.so.13` for the C++ engine; version pin undecided (bring-up 12.9.1.4, Ubuntu 26.04 `libcublas12` 12.4.5.8) | -| binaries | `cargo build --release -p strata-desktop-core --bin leleka-inference ...` needs only Rust + a C compiler | `ldd` of the debug build | no release job, no checksum/provenance for the Rust pair; `linux.yml` builds only `strata-next` + C++ engine; `port.yml` only type-checks | -| one-command install | `strata-next service-install` (user unit, `--start-ready`) exists for `strata-next` | `deploy/README.md:77-130` | nothing for `leleka-inference` + `leleka-daemon`; no asset fetch/verify chain for the KAR archive, MTP pack and shards of the Rust path | +| binaries | `cargo build --release -p leleka-engine-host --bin leleka-inference ...` needs only Rust + a C compiler | `ldd` of the debug build | no release job, no checksum/provenance for the Rust pair; `linux.yml` builds only `leleka-api` + C++ engine; `port.yml` only type-checks | +| one-command install | `leleka-api service-install` (user unit, `--start-ready`) exists for `leleka-api` | `deploy/README.md:77-130` | nothing for `leleka-inference` + `leleka-daemon`; no asset fetch/verify chain for the KAR archive, MTP pack and shards of the Rust path | | sealed KAR | `leleka-seal-exec` (`414169b`) | tests | 55 GB RAM per engine start; no preflight of free RAM/`/proc`/memfd | -| systemd | templates `deploy/rust-runtime/*.service` pass `systemd-analyze --user verify`; `strata-next` has a user unit (`service_unit.rs:44-63`, `Restart=no`) | | never run with the real model; no system-wide unit; lingering is never configured (`deploy/README.md:240-246`), so a user unit does not start at boot without admin action | -| signals | `strata-next` has shutdown grace; the Rust pair handles SIGINT only | `leleka-daemon.rs:38`, `leleka-inference.rs:211` | observed on the daemon: SIGTERM ends the process with status 143, SIGINT exits 0; templates set `KillSignal=SIGINT` as a workaround | -| readiness / health | `strata-next`: `/health`, `/ready`, `/status`, `wait-ready`; daemon: authenticated `/runtime/status` only | `runtime_gateway.rs:220` | no unauthenticated probe, no `wait-ready` equivalent, no auto-load: after any engine restart the model is not loaded until `leleka-cli load-mtp` | -| OCI image | `Dockerfile.runtime` = `strata-next` + embedded C++ engine on an Ubuntu 26.04 digest, non-root, `NVIDIA_VISIBLE_DEVICES=void` default | `deploy/Dockerfile.runtime`, `build-runtime-image.py` | no image for the Rust pair; `Dockerfile.static-cli` context was broken (fixed `e5c7c32`) | -| model volume / no re-download | asset manifests with SHA-256, resumable fetch, atomic publish for `strata-next` | `deploy/README.md:646-770` | not wired to the Rust path's inputs (shards + KAR + provenance + MTP pack) | -| observability | JSON `/metrics` on `strata-next` (not Prometheus) | `api-contract.md:265` | none on the daemon/engine; `DBG arena` `eprintln!` lines remain on the engine load path (`cache_original_prompt.rs:31-62`) | -| security | loopback only, bearer tokens from env, 0700/0600 checks in `strata-next`; tokens for the Rust pair read from env | `leleka-inference.rs:112` | systemd `EnvironmentFile` mode not enforced by tooling | +| systemd | templates `deploy/rust-runtime/*.service` pass `systemd-analyze --user verify`; `leleka-api` has a user unit (`service_unit.rs:44-63`, `Restart=no`) | | never run with the real model; no system-wide unit; lingering is never configured (`deploy/README.md:240-246`), so a user unit does not start at boot without admin action | +| signals | `leleka-api` has shutdown grace; the Rust pair handles SIGINT only | `leleka-daemon.rs:38`, `leleka-inference.rs:211` | observed on the daemon: SIGTERM ends the process with status 143, SIGINT exits 0; templates set `KillSignal=SIGINT` as a workaround | +| readiness / health | `leleka-api`: `/health`, `/ready`, `/status`, `wait-ready`; daemon: authenticated `/runtime/status` only | `runtime_gateway.rs:220` | no unauthenticated probe, no `wait-ready` equivalent, no auto-load: after any engine restart the model is not loaded until `leleka-cli load-mtp` | +| OCI image | `Dockerfile.runtime` = `leleka-api` + embedded C++ engine on an Ubuntu 26.04 digest, non-root, `NVIDIA_VISIBLE_DEVICES=void` default | `deploy/Dockerfile.runtime`, `build-runtime-image.py` | no image for the Rust pair; `Dockerfile.static-cli` context was broken (fixed `e5c7c32`) | +| model volume / no re-download | asset manifests with SHA-256, resumable fetch, atomic publish for `leleka-api` | `deploy/README.md:646-770` | not wired to the Rust path's inputs (shards + KAR + provenance + MTP pack) | +| observability | JSON `/metrics` on `leleka-api` (not Prometheus) | `api-contract.md:265` | none on the daemon/engine; `DBG arena` `eprintln!` lines remain on the engine load path (`cache_original_prompt.rs:31-62`) | +| security | loopback only, bearer tokens from env, 0700/0600 checks in `leleka-api`; tokens for the Rust pair read from env | `leleka-inference.rs:112` | systemd `EnvironmentFile` mode not enforced by tooling | | clean-host test | none for either stack (`docs/roadmap.md` P4 acceptance open) | | | ## 6. Changes made on this branch @@ -170,8 +170,8 @@ Not changed: `engine/strata/`, `crates/cuda-driver`, `crates/leleka-runtime`, th | # | task | acceptance | | --- | --- | --- | -| 1 | **One API in front of the Rust engine.** Add token-level generation to `backend-api` (prompt token ids in, `TokenDelta` out, versioned) and a worker trait in `control-plane` with the stdio and the gRPC/in-process implementations; or move the daemon onto the control-plane router | the `control-plane` HTTP fixtures (tools, custom/regex, text.format, reasoning, cancel, drain, history, Chat, Messages) pass unchanged against a fake `Backend`; a Codex-shaped body returns 200 with the section-4 event order; `leleka-daemon` route set equals `strata-next`'s | -| 2 | **Record and sanitize real Codex sessions** (plain turns, MCP tool turns with LeaseVibe, approval/review, long context) and replay them through `strata-next` and the Python server, then the Rust path | N sessions, zero protocol errors, zero streams without a terminal event, unchanged tool arguments, a written diff against the Python server; fixtures free of credentials and prompts that are not public | +| 1 | **One API in front of the Rust engine.** Add token-level generation to `backend-api` (prompt token ids in, `TokenDelta` out, versioned) and a worker trait in `control-plane` with the stdio and the gRPC/in-process implementations; or move the daemon onto the control-plane router | the `control-plane` HTTP fixtures (tools, custom/regex, text.format, reasoning, cancel, drain, history, Chat, Messages) pass unchanged against a fake `Backend`; a Codex-shaped body returns 200 with the section-4 event order; `leleka-daemon` route set equals `leleka-api`'s | +| 2 | **Record and sanitize real Codex sessions** (plain turns, MCP tool turns with LeaseVibe, approval/review, long context) and replay them through `leleka-api` and the Python server, then the Rust path | N sessions, zero protocol errors, zero streams without a terminal event, unchanged tool arguments, a written diff against the Python server; fixtures free of credentials and prompts that are not public | | 3 | **Rust-pair delivery**: one command that preflights (driver >= 595, `libcublas.so.12`, `/proc`, free RAM >= 56 GB, disk), verifies assets by SHA-256, seals, starts engine and gateway, loads, waits for readiness | on a clean Ubuntu 24.04 and 26.04 VM with a GPU: one command -> authenticated `/ready` true -> one `/v1/responses` completes; a restart reaches ready again without re-download | | 4 | **OCI image for the Rust pair** (pinned base digest, pinned CUDA 12 cuBLAS with SHA-256, four binaries, non-root) and a CI job building it | loader test without GPU passes (`ldd`, `--help`, dlopen failure messages); `docker run --gpus all` smoke on the GPU runner; provenance file lists binary digests | | 5 | **Lifecycle of the daemon/engine**: SIGTERM drain with terminal SSE events, unauthenticated `/health` + `/ready`, `--autoload`/`wait-ready`, readiness false after engine restart | kill -TERM during a stream ends it with `response.failed`/`completed`; a killed engine flips `/ready` and returns to ready by itself | diff --git a/docs/deploy.md b/docs/deploy.md index 01991032..44d30f6d 100644 --- a/docs/deploy.md +++ b/docs/deploy.md @@ -45,9 +45,9 @@ Container: [section 7](#7-container-image). Build your own release: [section 8]( | 3 | binaries | copy `bin/*` to `PREFIX/bin`, SHA-256 checked against `MANIFEST.json` | skipped when identical; replaced by rename (safe for a running binary) | | 3b | expert profile | the ranked VRAM expert tier's table `ASSETS/data/expert-profile.bin` (192 KiB, upstream Strata at the pinned commit): the upstream bytes are embedded in the `leleka` binary (`crates/deploy/data/expert-profile.bin`, MIT notice beside it) and written there on first start, so no network is needed; `--expert-profile-file PATH` installs your copy instead, and an https download from the pinned commit is only the fallback; SHA-256 `8f59b4aa...388975baf` is checked, the file is installed by rename, any other digest fails closed (a wrong file already there is moved aside, never deleted); `--no-expert-tier` is the explicit opt-out. Planned before the large downloads. `status`, `verify`, the ready summary and the supervisor log say `expert tier ON (sha256 ...)` or `WARNING expert tier OFF: reason` | skipped when the file has the pinned digest | | 4 | cuBLAS 12 | uses what the host has; otherwise downloads the pinned NVIDIA 12.9.1.4 redistributable (SHA-256 pinned, resumable) into `PREFIX/lib/cublas` | skipped when `libcublas.so.12` and `libcublasLt.so.12` are found | -| 5 | secrets | two service tokens into `STATE/runtime.env` (0600), API key through `strata-next api-key init` | never rotated; only missing/invalid ones are created | -| 6 | model | `strata-next model fetch qwen-iq3-s` then `model verify` (resumable `.part` files, SHA-256) | stamped with size+mtime: skipped on re-runs unless `--reverify` | -| 7 | KAR archive | `strata-next model ensure-sharded-streamed qwen-iq3-s --levels 2` (level 2, the pinned 55,295,529,472-byte archive + provenance) | stamped; also checks the length the engine admits | +| 5 | secrets | two service tokens into `STATE/runtime.env` (0600), API key through `leleka-api api-key init` | never rotated; only missing/invalid ones are created | +| 6 | model | `leleka-api model fetch qwen-iq3-s` then `model verify` (resumable `.part` files, SHA-256) | stamped with size+mtime: skipped on re-runs unless `--reverify` | +| 7 | KAR archive | `leleka-api model ensure-sharded-streamed qwen-iq3-s --levels 2` (level 2, the pinned 55,295,529,472-byte archive + provenance) | stamped; also checks the length the engine admits | | 8 | MTP pack | `ASSETS/data/mtp-rt` must exist; `--mtp-pack` imports it from a directory or tarball | skipped when present | | 9 | tokenizer | `model extract-tokenizer` from shard 1 | skipped when present | | 10 | config | `leleka.json`, `daemon.json`, `strata.json`, `profile.json`, `runtime.env` | rewritten only when the content changes | @@ -69,11 +69,11 @@ leleka run (supervisor, the systemd ExecStart or your terminal) |- leleka-daemon gateway for the typed lifecycle, 127.0.0.1:18080 |- leleka-inference engine, gRPC 127.0.0.1:18766 (started through `leleka exec-inherit`, which passes the sealed fd) |- leleka-cli load-mtp qwen-iq3 qwen4exp-kar-ple-mtp-v1 -> wait for model_ready (the engine verifies shards + archive here) - `- strata-next serve public API (Responses, Chat, Messages, tools, ...), 127.0.0.1:8081, bearer key + `- leleka-api serve public API (Responses, Chat, Messages, tools, ...), 127.0.0.1:8081, bearer key ``` ```text -PREFIX/bin/{leleka,strata-next,leleka-inference,leleka-daemon,leleka-cli,leleka-seal-exec} PREFIX/lib/cublas/ +PREFIX/bin/{leleka,leleka-api,leleka-inference,leleka-daemon,leleka-cli,leleka-seal-exec} PREFIX/lib/cublas/ STATE/{leleka.json,daemon.json,strata.json,profile.json,runtime.env,api-key} STATE/{logs,run/status.json,stamps,mtp-staging} ASSETS/model/*.gguf ASSETS/qwen-iq3-s-l2-v4.kar(.provenance.json) ASSETS/data/mtp-rt/ ASSETS/tokenizer-assets/ ``` @@ -324,9 +324,9 @@ profile allows `memfd_create`. Build is not run in CI; see section 10 for what w On Linux/WSL, from a tree with the toolchain pinned by `rust-toolchain.toml` (no CUDA toolkit is needed; the PTX is checked in): ```sh -cargo build --release --locked -p strata-desktop-core --features sm86 \ +cargo build --release --locked -p leleka-engine-host --features sm86 \ --bin leleka-inference --bin leleka-daemon --bin leleka-cli --bin leleka-seal-exec -cargo build --release --locked -p strata-control --bin strata-next +cargo build --release --locked -p leleka-control-plane --bin leleka-api cargo build --release --locked -p leleka-deploy --bin leleka # provenance is made where git exists (an exported tree has no .git); the tree must be clean or --allow-dirty marks it @@ -396,7 +396,7 @@ All of this is bring-up evidence, not a performance or quality result: no paired an engine that cannot start; a refused load fails fast; weak tokens are exit code 2; `up` is idempotent, resumable after a deleted archive, never rotates secrets, `--trust-archive`, wrong-size archive refused; `--dry-run` creates nothing; a failing preflight changes nothing), `tests/recipe.rs` (the Containerfile is non-root, has a health check, copies no model or secret; the cuBLAS pin agrees in three places; `install.sh` verifies before it runs). `cargo clippy --all-targets -- -D warnings` and `cargo fmt --check` are clean. -* `cargo test -p strata-desktop-core --bin leleka-inference` (14 argument-parsing tests, including `--kar-archive-file` and `--expert-source`). +* `cargo test -p leleka-engine-host --bin leleka-inference` (14 argument-parsing tests, including `--kar-archive-file` and `--expert-source`). * Linux only for the process tests; the portable parts also run on Windows (`cargo test -p leleka-deploy`), where the POSIX-path tests are not meaningful. ### Not done / open diff --git a/docs/e2e-run.md b/docs/e2e-run.md index 639c0c77..b0b54896 100644 --- a/docs/e2e-run.md +++ b/docs/e2e-run.md @@ -8,15 +8,15 @@ A/B, no quality gate). Stack under test, all four processes started inside a holder job (sealed KAR memfd inherited, `MODEL.lock` held by the holder): ```text -python3 e2e_client.py (Codex-shaped Responses requests) -- HTTP, Bearer test key --> strata-next serve (runtime block) 127.0.0.1:8081 -strata-next -- gRPC, runtime token ----> leleka-inference --backend-mode original 127.0.0.1:18766 -leleka-cli load-mtp (through leleka-daemon 127.0.0.1:18080) loads the model; strata-next only attaches. +python3 e2e_client.py (Codex-shaped Responses requests) -- HTTP, Bearer test key --> leleka-api serve (runtime block) 127.0.0.1:8081 +leleka-api -- gRPC, runtime token ----> leleka-inference --backend-mode original 127.0.0.1:18766 +leleka-cli load-mtp (through leleka-daemon 127.0.0.1:18080) loads the model; leleka-api only attaches. ``` ## 1. Binaries (built in WSL, never on the server) -`cargo build --release --locked -p strata-desktop-core --bin leleka-inference --bin leleka-daemon --bin leleka-cli -p strata-control --bin strata-next -p leleka-deploy --bin leleka` -(rustc 1.99.0, WSL2 Ubuntu 24.04, `CARGO_TARGET_DIR` outside the tree), sm_120 default and `--features strata-desktop-core/sm86`. Only the first four were copied to +`cargo build --release --locked -p leleka-engine-host --bin leleka-inference --bin leleka-daemon --bin leleka-cli -p leleka-control-plane --bin leleka-api -p leleka-deploy --bin leleka` +(rustc 1.99.0, WSL2 Ubuntu 24.04, `CARGO_TARGET_DIR` outside the tree), sm_120 default and `--features leleka-engine-host/sm86`. Only the first four were copied to `rnr5090:~/work/leleka-e2e/bin-sm120/` (`scp`, mode 0755). The sm86 binaries were built and started with `--help` in WSL (RTX 3080 Laptop, cc 8.6, `ldd`: libc, libm, libgcc_s), not run against a model here. Final build, tree `73e77f8` (= `claude/port-gpu-bringup` head `4f7c461`-era merge + this branch; the Codex jobs 943b / 945 ran the earlier build listed second): @@ -26,14 +26,14 @@ Final build, tree `73e77f8` (= `claude/port-gpu-bringup` head `4f7c461`-era merg | leleka-inference | 69,249,120 | `0eb83374e9782ded5c2d8d62d2552b4efd8c37142ea62d3d2309f9fcfe40eb26` | 120,106,704 | `30e08783873e7dc952020a8f93cf9232ef7ccb4c7f07ed5a18fbb8b81e6f0a2d` | | leleka-daemon | 23,340,736 | `f7908fc6f4d5924bb9b3ebbd1ef7e7158fcc8bdde72d5efe515a896973b17cbb` | 23,340,024 | `a73a1c0e8ecc7241436a81c2da85fa9b8ce6369712a7fbc1ad87a75e2ed1a63d` | | leleka-cli | 10,462,568 | `19bf908a56e900677b46488a11c1860cc7e524a1d9615b72a1effa712b5f2d3b` | 10,462,472 | `8c44891388e859e8c1525bfa0fc8b8df10e3d24b73950470b0620f3bdb7b7f2c` | -| strata-next | 28,834,064 | `ce98d23fd4e9efcbd3c46ca322641c1cbec8b3af142762866467143b3533b9b7` | 28,834,048 | `2fa5573f1c2062e50e6e9e8c6e0a4af704906222ba3ef6f92efacc6f9721d0f2` | +| leleka-api | 28,834,064 | `ce98d23fd4e9efcbd3c46ca322641c1cbec8b3af142762866467143b3533b9b7` | 28,834,048 | `2fa5573f1c2062e50e6e9e8c6e0a4af704906222ba3ef6f92efacc6f9721d0f2` | | leleka (deploy supervisor, not copied) | 2,938,592 | `b2be6e21e19975387141f314ecc92c681bb8a91e48338b102ca432d96a87d053` | 2,938,592 | same | | leleka-runtime-tests (replay smoke, server: `leleka-runtime-tests-73e77f8`) | 79,533,344 | `4d0b400d951f0f485a5b31c66c8952669b11a64323dc46896b937b4a1a49a321` | | | Binaries of the Codex jobs 943b / 945 and the replay job 947 (the server copies in `bin-sm120/`): `leleka-inference` `484b7622274ec80cab5357dd304de41c5a311163161a5daf7e4771fe8f1c4eae`, `leleka-daemon` `8d681a3a3a88d5b354481766998fc5a72780e8d0e942c57e3280baaecdd8d0bd`, `leleka-cli` `8615325793196b3740a584916e70b09bedaa5c16a3e1d03ba955cae5749bbd0c`, -`strata-next` `ac0bfa40215844148785680697c693c01616c7ec0bcb34f65e3623af849c0768`, `leleka-runtime-tests` `a4dfb8530b76a19e7114c64ee0ebf1062d9a52d533cb46310fd31a4d73bbfc2e`. -Cargo unifies features per build, so byte identity of `strata-next` / `leleka-daemon` between the sm_120 and sm86 builds is not expected. The `leleka` supervisor (native sealed memfd) is not used by these +`leleka-api` `ac0bfa40215844148785680697c693c01616c7ec0bcb34f65e3623af849c0768`, `leleka-runtime-tests` `a4dfb8530b76a19e7114c64ee0ebf1062d9a52d533cb46310fd31a4d73bbfc2e`. +Cargo unifies features per build, so byte identity of `leleka-api` / `leleka-daemon` between the sm_120 and sm86 builds is not expected. The `leleka` supervisor (native sealed memfd) is not used by these jobs: inside a holder job a second 55 GB memfd would not fit, so `scripts/e2e/run-e2e.sh` starts the same processes with the holder's descriptor (`--kar-archive-fd $LELEKA_STRA169_KAR_FD`), the flags of `deploy/rust-runtime/profiles/rtx5090-32g.json` (`--gpu-budget 25769803776`, `--context-tokens 262144`, resident expert source) and the bring-up expert-tier environment of the 98x jobs. @@ -48,10 +48,10 @@ E2E_CLIENT_ARGS="--soak-n 40 --burst 20 --xlong-tokens 24000" bash ~/work/leleka `run-e2e.sh` refuses to start unless it inherited a sealed memfd and `MODEL.lock` exists, nothing else holds the GPU and no stack process is running; it generates the two service tokens and the API key into mode-0600 files (never printed), extracts the tokenizer assets, starts -`leleka-inference`, `leleka-daemon`, runs `leleka-cli load-mtp` and **fails fast** on a `leleka-load phase=` line, starts `strata-next`, waits +`leleka-inference`, `leleka-daemon`, runs `leleka-cli load-mtp` and **fails fast** on a `leleka-load phase=` line, starts `leleka-api`, waits for `/ready`, runs `scripts/e2e/e2e_client.py` (or `E2E_RUN_CMD`, used by the Codex jobs), samples RSS/VRAM every 30 s (`env.tsv`), then stops with SIGINT and reports left-over processes and GPU applications. Logs and `results.json` are written under `E2E_OUT` -(`inference.log`, `strata-next.log`, `daemon.log`, `client.log`, `results.json`, `env.tsv`); they stay out of Git. +(`inference.log`, `leleka-api.log`, `daemon.log`, `client.log`, `results.json`, `env.tsv`); they stay out of Git. `scripts/e2e/run-fake.sh` + `fake_llm_engine.py` run the identical client against a scripted engine without GPU (465 checks pass); that is how the client's own checks were debugged. @@ -83,15 +83,15 @@ Model load through `leleka-cli load-mtp`: 371 s (942), 390 s (941). After load: | compat (Chat Completions, Messages, tool call over Chat) | 3/3 | | | determinism | 2/2 | greedy x3 identical; the seeded sampled pair matched in 942 and differed in 941 (`C++` vs `C`): documented envelope of the adaptive expert tier (`original-serve.md`), recorded as a note, not a failure | | reasoning (Codex default `effort: medium`, `summary: auto`) | 26/26 | reasoning item + message, `reasoning_tokens` 14 of 19, replay of the reasoning item accepted (981 of 1027 reused) | -| soak (40 consecutive requests, alternate stream/JSON, every 4th a tool call) | 7/7 | all 40 ok (10 tool calls schema-valid), latency 1.69 / 1.87 / 2.09 s (min/p50/max), decode 60.7 tok/s mean; `leleka-inference` RSS +0 MiB, `strata-next` +0, daemon +0, **VRAM +0 MiB** after warm-up; `/metrics` delta started 40 = completed 40 | +| soak (40 consecutive requests, alternate stream/JSON, every 4th a tool call) | 7/7 | all 40 ok (10 tool calls schema-valid), latency 1.69 / 1.87 / 2.09 s (min/p50/max), decode 60.7 tok/s mean; `leleka-inference` RSS +0 MiB, `leleka-api` +0, daemon +0, **VRAM +0 MiB** after warm-up; `/metrics` delta started 40 = completed 40 | -Whole job 942: 98 generations seen by `strata-next` (log line `generation done:`), 145,787 prompt tokens of which 30,878 reused (21 %; the +Whole job 942: 98 generations seen by `leleka-api` (log line `generation done:`), 145,787 prompt tokens of which 30,878 reused (21 %; the low share comes from the soak and invalid-input requests, whose ~980-token system prefix is below the cache's `--prompt-cache-root 2048` threshold and therefore never reused across unrelated prompts), TTFT median 1.63 s (p90 1.68 s, max 18.0 s), decode median 68.4 tok/s per request (10th-90th percentile 48.9-89.0), sum-weighted 68.5 tok/s over 1,791 tokens. Memory over the job (7 samples): inference VmRSS 53,611 -> 54,347 MiB (+0.7 GB while the 24k prompt was served, flat in the soak), VRAM 13,192 -> 13,424 MiB, MemAvailable 14.3 -> 13.5 GB, no growth trend. -Teardown (every job): `SIGINT` to strata-next, daemon, engine: all exited, `pgrep` empty, no GPU compute applications, `free -m` back to +Teardown (every job): `SIGINT` to leleka-api, daemon, engine: all exited, `pgrep` empty, no GPU compute applications, `free -m` back to avail 68.8 GB; the one forced abort (job 940) also left nothing behind. ## 5. Findings @@ -105,9 +105,9 @@ avail 68.8 GB; the one forced abort (job 940) also left nothing behind. | 3 | client errors surfaced as server errors: a context overflow or `max_output_tokens` above the runtime cap was queued and refused by the worker as **502 `generation_failed`** (SSE: `response.failed` after a 200) | `invalid[...]` rows of job 941 | `f5925f3`: 400 `context_length_exceeded` / `invalid_output_limit` before queueing; tests `a_prompt_that_cannot_fit_the_context_is_a_400...`, `the_runtimes_output_cap_...` | | 4 | the default output budget (`context - prompt`) ignored the engine's 8-token margin, so a prompt close to the context failed at the worker | same | `f5925f3` (default leaves the margin) | | 5 | `reasoning_budget_tokens`, `strata_tune`, `experimental_speed_projection` and sampling finer than the fixed point were 502 after queueing | `invalid[reasoning_budget_tokens]` = 502 in job 941 | `af3beab`: 400 `unsupported_request_field` / `invalid_sampling_precision` for a text-level engine; test `text_the_contract_cannot_carry_is_refused_not_dropped` | -| 6 | no operator-visible trace of why a generation failed or how a request went | `strata-next.log` had one line | `af3beab`, `da187a9`: `generation failed: ` and one `generation done: finish= prompt_tokens= reused= generated= prompt_ms= decode_ms=` line per request; `STRATA_DEBUG_FAILED_OUTPUT=1` additionally logs the generated text of a failed tool turn (operator debugging only) | +| 6 | no operator-visible trace of why a generation failed or how a request went | `leleka-api.log` had one line | `af3beab`, `da187a9`: `generation failed: ` and one `generation done: finish= prompt_tokens= reused= generated= prompt_ms= decode_ms=` line per request; `STRATA_DEBUG_FAILED_OUTPUT=1` additionally logs the generated text of a failed tool turn (operator debugging only) | -All of `cargo test -p strata-control` (274 lib + integration, 28 in `backend_worker_http`), `-p strata-desktop-core`, `-p leleka-runtime-client`, +All of `cargo test -p leleka-control-plane` (274 lib + integration, 28 in `backend_worker_http`), `-p leleka-engine-host`, `-p leleka-runtime-client`, `-p leleka-backend-api` and the 10 runtime-stack HTTP smokes (`scripts/test-api-over-runtime.py`) pass on Linux after these changes. ### Model-origin tool-call failures (not fixed, repro below) @@ -200,7 +200,7 @@ The memory-safety agent was given these numbers. **Defect 7 (fixed: output cap 4096 -> 32768).** Job 943: at 14.3k context the model wrote the whole `index.html` in one tool call; the runtime facade cut every generation at 4,096 tokens (the Original server has no such cap: `max_tokens` 0 = the rest of the context). Codex saw `response.failed` ("tool parameter is incomplete"), reconnected twice with the identical request (greedy, same cut) and then `turn.failed` ("incomplete: max_output_tokens"), exit 1. The decoded captured tokens show a coherent design monologue followed by an unfinished HTML file, not a -repetition loop. `leleka_backend_api::MAX_OUTPUT_TOKENS = 32768` is now the single cap of `RuntimeServer`, the engine request check, `strata-next`'s runtime default and the `leleka-deploy` +repetition loop. `leleka_backend_api::MAX_OUTPUT_TOKENS = 32768` is now the single cap of `RuntimeServer`, the engine request check, `leleka-api`'s runtime default and the `leleka-deploy` generated config. Also fixed on the way: `/v1/status` always carried `prefix_cache: null`, which broke the `http_surface` golden after the prefix-cache merge. **Does Codex recover by itself?** Tool-level errors: yes (a rejected `apply_patch` came back as a tool result and the model corrected it; failed commands were retried or worked around). A @@ -286,7 +286,7 @@ turn (a 2048-token grid step plus the reply), six times the ideal suffix. **Why the sessions stopped, and what is left.** Neither run died of an engine error any more (the scalar draft-KV fix works: both resumed past the fallback that killed 943c / 945c). The harness's `client rc=9` of 943d is the runner's own code for "no node/Playwright on the server, browser checks not run" (the Codex exit was 0; the six checks were run on the laptop: 6/6); `run-codex.sh` no longer turns that into a failure. One generation failed in 945d (request 5): the model emitted a native-style call to a function named `apply_patch`, which is not a declared tool (Codex 0.163 exposes `apply_patch` as a shell command); -`strata-next` refused it (`undeclared function in tool call: apply_patch`), Codex reconnected, and the retried request produced a valid call, so the session carried on (1 of 72 generations; a model-format error, the +`leleka-api` refused it (`undeclared function in tool call: apply_patch`), Codex reconnected, and the retried request produced a valid call, so the session carried on (1 of 72 generations; a model-format error, the same class as section 5). The 945d CRM does not pass acceptance for a bug **the model wrote**: `handlers.py` defines `CRMHandler.handle(self, method)`, which overrides `socketserver.BaseRequestHandler.handle`, so every real HTTP request raises `TypeError: handle() missing 1 required positional argument: 'method'` and the connection is dropped; the agent's 125 unit tests call the handlers in-process, never start a server, and passed, and its final message said both phases were green. This is a task-quality result of one greedy trajectory (the shipped-options run of the same prompt produced a working app); a different engine diff --git a/docs/gpu-bringup.md b/docs/gpu-bringup.md index 0ab56130..ead83d92 100644 --- a/docs/gpu-bringup.md +++ b/docs/gpu-bringup.md @@ -75,8 +75,8 @@ a C/C++ compiler, 6 GiB RAM). `[WARN]` lines need a human look: * no `cargo`: `scripts/install-pinned-rustup.sh` (pins rustup 1.29.0, checksummed); `rust-toolchain.toml` then fetches 1.99.0. **What not to touch** (known from the repo's own reports; `host_sanity.sh` prints what is actually there): the systemd -user unit `strata-next.service` and its loopback port 18082 plus any SSH tunnel to it; `~/.cache/strata-next/**` -(evidence of earlier A/B runs); `~/.strata-next/`; `~/.local/bin/strata-next-*`; the model shards and KAR/MTP packs +user unit `leleka-api.service` and its loopback port 18082 plus any SSH tunnel to it; `~/.cache/leleka-api/**` +(evidence of earlier A/B runs); `~/.leleka-api/`; `~/.local/bin/leleka-api-*`; the model shards and KAR/MTP packs (open them read-only, never move, rewrite or re-hash them in place); any system CUDA under `/usr/local/cuda*`. Everything this runbook creates lives under `$R`, `$TK` and `/tmp`. @@ -243,11 +243,11 @@ scripts/gpu-bringup/remote_sync.sh build --host $HOST --remote-dir '~/work/lelek ``` Runs on the host with a log in `$G/logs/`: `cargo fetch --locked` (fails fast if offline), then -`cargo build --release --locked -p strata-desktop-core --bin leleka-cli --bin leleka-daemon --bin leleka-inference` +`cargo build --release --locked -p leleka-engine-host --bin leleka-cli --bin leleka-daemon --bin leleka-inference` (the three binaries the earlier Linux build produced), then `cargo test --no-run --locked` for `leleka-cuda-driver --features cuda-driver`, `leleka-engine-qwen35-cuda`, and `leleka-native-cpu-expert`, and prints `sha256sum` of the binaries into `$G/binaries.sha256`. `native-cpu-expert/build.rs` has no C++ step (the `.cpp` files in that crate are not built); the crate -needs only `cc` as linker. `strata-control` (the `cc`-compiled GGML bridge) is not in this set. Do not run `sync` between c +needs only `cc` as linker. `leleka-control-plane` (the `cc`-compiled GGML bridge) is not in this set. Do not run `sync` between c and d. First release build is slow; use `--jobs` to leave CPU to a live service. Then the non-GPU unit tests, to see that sealing is consistent (ignored tests are not run, so the GPU is not touched): diff --git a/docs/iq2-s-iq3-xxs-reference-parity.md b/docs/iq2-s-iq3-xxs-reference-parity.md index 48cbd7ca..88e4cb3a 100644 --- a/docs/iq2-s-iq3-xxs-reference-parity.md +++ b/docs/iq2-s-iq3-xxs-reference-parity.md @@ -83,8 +83,8 @@ signed-zero and zero-field fixtures preserve the pinned C value policy. ```sh cargo test --locked -p leleka-quant-core cargo clippy --locked -p leleka-quant-core --all-targets -- -D warnings -cargo test --locked -p strata-control --lib ggml_bridge::tests -- --test-threads=2 -cargo test --locked -p strata-control --lib gguf_f32_stream::tests +cargo test --locked -p leleka-control-plane --lib ggml_bridge::tests -- --test-threads=2 +cargo test --locked -p leleka-control-plane --lib gguf_f32_stream::tests ``` ## Actual results diff --git a/docs/iq3-reference-parity.md b/docs/iq3-reference-parity.md index d65204ef..2f7d20dd 100644 --- a/docs/iq3-reference-parity.md +++ b/docs/iq3-reference-parity.md @@ -40,7 +40,7 @@ semantics independently. ## Targeted gate ```sh -cargo test --locked -p strata-control --lib ggml_bridge::tests +cargo test --locked -p leleka-control-plane --lib ggml_bridge::tests ``` ## Actual local CPU result, 2026-10-07 diff --git a/docs/iq4-reference-parity.md b/docs/iq4-reference-parity.md index db694f9e..daca8b7d 100644 --- a/docs/iq4-reference-parity.md +++ b/docs/iq4-reference-parity.md @@ -62,8 +62,8 @@ separate task. ```sh cargo test --locked -p leleka-quant-core cargo clippy --locked -p leleka-quant-core --all-targets -- -D warnings -cargo test --locked -p strata-control --lib ggml_bridge::tests -cargo test --locked -p strata-control --lib gguf_f32_stream::tests +cargo test --locked -p leleka-control-plane --lib ggml_bridge::tests +cargo test --locked -p leleka-control-plane --lib gguf_f32_stream::tests ``` ## Actual local CPU result, 2026-10-07 diff --git a/docs/kar-file-source.md b/docs/kar-file-source.md index 2c810e25..c6fb3ad3 100644 --- a/docs/kar-file-source.md +++ b/docs/kar-file-source.md @@ -138,10 +138,10 @@ Install and run (the holder must be stopped; this is not a holder job): ```sh # laptop, WSL, in the worktree: the four binaries (about 1-4 min incremental) -wsl -d Ubuntu -- bash -lc ". ~/.cargo/env; cd /mnt/c/Users/pavel/work/leleka/.git/wt/kar-file-source && export CARGO_TARGET_DIR=\$PWD/target && cargo build --release --locked -j 10 -p strata-desktop-core --bin leleka-inference --bin leleka-daemon --bin leleka-cli -p strata-control --bin strata-next" +wsl -d Ubuntu -- bash -lc ". ~/.cargo/env; cd /mnt/c/Users/pavel/work/leleka/.git/wt/kar-file-source && export CARGO_TARGET_DIR=\$PWD/target && cargo build --release --locked -j 10 -p leleka-engine-host --bin leleka-inference --bin leleka-daemon --bin leleka-cli -p leleka-control-plane --bin leleka-api" # server (orchestrator): copy binaries + scripts; ~100 MB total, light I/O ssh rnr5090 'mkdir -p /data/leleka-e2e/decode/dt/bin-karfile /data/leleka-e2e/decode/dt/jobs-manual' -scp target/release/{leleka-inference,leleka-daemon,leleka-cli,strata-next} rnr5090:/data/leleka-e2e/decode/dt/bin-karfile/ +scp target/release/{leleka-inference,leleka-daemon,leleka-cli,leleka-api} rnr5090:/data/leleka-e2e/decode/dt/bin-karfile/ scp scripts/e2e/run-e2e.sh rnr5090:/data/leleka-e2e/decode/dt/scripts/e2e/run-e2e-karfile.sh scp scripts/e2e/decode/kar-file-ab.sh rnr5090:/data/leleka-e2e/decode/dt/jobs-manual/ # server, once: file mode (voids the old stamps), stop the holder (frees 51.5 GiB and MODEL.lock), then run diff --git a/docs/memory-safety-unsafe.md b/docs/memory-safety-unsafe.md index 2d06cd8e..45061362 100644 --- a/docs/memory-safety-unsafe.md +++ b/docs/memory-safety-unsafe.md @@ -242,7 +242,7 @@ Commands (WSL, toolchain 1.99.0, `--all-targets`): `cargo clippy` (workspace def | `leleka-runtime` | 166 | 166 | | `leleka-native-cpu-expert` | 158 | 153 | | `leleka-model-format` | 4 | 4 | -| `strata-desktop-core` | 2 | 2 | +| `leleka-engine-host` | 2 | 2 | Diagnostics in test targets introduced by this branch (3: `chunks_exact_mut` in a `host_stage` test, a no-effect mask in a `physical_layout` test, `chunks_exact` in `pool_lifecycle.rs`) were fixed. The 5 fewer warnings in `native-cpu-expert` are diff --git a/docs/memory-safety.md b/docs/memory-safety.md index 98006014..2e0f221d 100644 --- a/docs/memory-safety.md +++ b/docs/memory-safety.md @@ -200,7 +200,7 @@ The experimental `memfd_extents: ple_only` (a sealed memfd that holds only the ~ | --- | --- | | `leleka-memory` unit tests (67) | parsers reject malformed/duplicated numbers; cgroup v2 tightest-ancestor headroom and the v1 controller; planner: the 5090 gets an auto cache from what is left, a host that cannot hold the footprint is refused with numbers and advice (also "a second model process beside the holder"), the memfd still to be created counts, explicit caches are clamped and the clamp reported, the laptop profile fits, WSL advice, missing telemetry is blind not zero; monitor: immediate escalation, hysteresis and three calm samples to step down, unknown holds shed, PSI only below the guard, cgroup oom/high deltas, swap-out storm; governor: admission (400 context, 503 pressure, transient), shed order and recovery, env overrides validated, sampler thread starts/publishes/stops, a dead sampler cannot leave `reject` stuck; mapping/`mlock`/`mincore`/`madvise` over a real descriptor, bounds refused before any syscall; flatness checker catches 1 thread / 1 fd / 4 KiB-per-10-requests leaks | | Miri (`cargo +nightly miri test -p leleka-memory --lib`) | 61 tests, no UB, no leaks (syscall and wall-clock tests skipped) | -| `strata-control --test memory_gate_http` (4) | `reject` report -> 503 `memory_pressure` + `Retry-After` on `/v1/responses`, `/v1/chat/completions` (JSON and stream), `/v1/messages` and streaming, nothing reaches the engine; `shed` still serves; stale/garbage report never blocks; engine-side refusal text -> same 503; **600-request soak** (served, streamed, abandoned mid-stream, engine failures, pressure flips every 12 requests): 289 served, 120 refused, 96 abandoned, 95 failed; threads 4 -> 4, descriptors 14 -> 14, RSS +0.27 MB (tolerance 96 MiB) | +| `leleka-control-plane --test memory_gate_http` (4) | `reject` report -> 503 `memory_pressure` + `Retry-After` on `/v1/responses`, `/v1/chat/completions` (JSON and stream), `/v1/messages` and streaming, nothing reaches the engine; `shed` still serves; stale/garbage report never blocks; engine-side refusal text -> same 503; **600-request soak** (served, streamed, abandoned mid-stream, engine failures, pressure flips every 12 requests): 289 served, 120 refused, 96 abandoned, 95 failed; threads 4 -> 4, descriptors 14 -> 14, RSS +0.27 MB (tolerance 96 MiB) | | `leleka-runtime` `original_serve_stack::prefix` (13) | shed evicts to the target and restores the configured budget; 300 random requests under random shed directives: every resume is exact (digest equals a full read), the store never exceeds its budget, invariants hold | | `leleka-deploy` (77) | profiles carry the memory section into engine arguments and environment; invalid sections refused | | `cuda-driver`, `native-cpu-expert`, `model-format` suites | from the unsafe review (371 / all / 129 pass) | @@ -287,7 +287,7 @@ Everything is built in WSL (tar/rsync of the tracked files, never on the server) # model-free, anywhere cargo test -p leleka-memory # parsers, planner, state machine, governor, mapping/mlock, flatness (67 tests) cargo +nightly miri test -p leleka-memory --lib # the same pure modules under Miri -cargo test -p strata-control --test memory_gate_http # gate 503 + Retry-After, engine-side refusal, 600-request soak (threads/fds/RSS flat) +cargo test -p leleka-control-plane --test memory_gate_http # gate 503 + Retry-After, engine-side refusal, 600-request soak (threads/fds/RSS flat) cargo test -p leleka-engine-qwen35-cuda --lib original_serve_stack::prefix # shed/restore and the churn test under random shed directives cargo test -p leleka-deploy # profiles carry the memory section diff --git a/docs/model-assets.md b/docs/model-assets.md index 26502519..65d6d06a 100644 --- a/docs/model-assets.md +++ b/docs/model-assets.md @@ -1,16 +1,16 @@ # Model acquisition -The `strata-next` CLI can fetch and verify model files described by a versioned manifest. Each file has a pinned HTTPS URL, byte length, and SHA-256. It writes to `NAME.part`, resumes with HTTP Range when supported, verifies the complete digest, and renames the file only after successful verification. A server that ignores Range causes a full restart of that file. Existing completed files are hashed before reuse. A failed hash is never accepted as a completed model. +The `leleka-api` CLI can fetch and verify model files described by a versioned manifest. Each file has a pinned HTTPS URL, byte length, and SHA-256. It writes to `NAME.part`, resumes with HTTP Range when supported, verifies the complete digest, and renames the file only after successful verification. A server that ignores Range causes a full restart of that file. Existing completed files are hashed before reuse. A failed hash is never accepted as a completed model. Each shard gets at most four transfer attempts with 1, 2, and 4 second waits between retries. Retries cover connection and body failures, timeouts, short responses, and HTTP 408/429/5xx. Every attempt rechecks the partial file before resuming; malformed ranges, local filesystem errors, and SHA-256 failures stop the fetch. Authenticated Hub access remains to be implemented. For the initial Qwen3.8-Flash-Next IQ3_S profile: ```sh -strata-next model fetch qwen-iq3-s --output /models/qwen-iq3-s -strata-next model verify qwen-iq3-s --output /models/qwen-iq3-s -strata-next model inspect /models/qwen-iq3-s/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf -strata-next model extract-tokenizer /models/qwen-iq3-s/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf --output /models/qwen-iq3-s/pack +leleka-api model fetch qwen-iq3-s --output /models/qwen-iq3-s +leleka-api model verify qwen-iq3-s --output /models/qwen-iq3-s +leleka-api model inspect /models/qwen-iq3-s/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf +leleka-api model extract-tokenizer /models/qwen-iq3-s/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf --output /models/qwen-iq3-s/pack ``` The profile manifest is embedded in the executable; a custom manifest path can be used in place of `qwen-iq3-s`. The two shard URLs are pinned to Hugging Face repository commit `ed59f92082b1e93c0e96d60a8b11aab089b52f09`, matching the imported Strata setup source. Both shards were downloaded outside Git and matched their manifest SHA-256 values locally: shard 1 `54,817,524,224` bytes / `4c1eb2ceb4915e1192f4f386021897bde56a97f40a0bb78bb86465e0f7d2aca3`; shard 2 `28,800,138,432` bytes / `316b46f3a2dbd68c900f43136ab9449f9dcc3725dfd8c794847c204bc161e113`. diff --git a/docs/offline-port.md b/docs/offline-port.md index a43c0175..8981485f 100644 --- a/docs/offline-port.md +++ b/docs/offline-port.md @@ -11,7 +11,7 @@ when `OFFLINE_ORACLE_PYTHON` and `STRATA_GGUF_PY` are set. Two kinds of check exist for each package: -- `scripts/offline/diff_*.py ` runs the Python oracle **live** over thousands of generated cases; +- `scripts/offline/diff_*.py ` runs the Python oracle **live** over thousands of generated cases; - `scripts/offline/gen_goldens.py` writes the small committed goldens (`control-plane/tests/fixtures/offline/`, `crates/*/tests/fixtures/`) that plain `cargo test` replays without Python. Re-run it after changing a generator, review the diff, commit. @@ -60,5 +60,5 @@ scope. They remain Python-only until the Q2_0/AVX-512 path is brought into scope - The reasoning budget is wired into the live worker (`worker.rs` `generate`, `BudgetTracker`); see `docs/port-remaining.md` item 2 for the live-path differential. - The reference-parity checks use synthetic fixtures. No real IQ3_S shard, tokenizer or chat transcript was run here (no model downloads). -- Thirteen worker tests in `strata-control` and four in `leleka-model-format` fail on macOS on the base branch too +- Thirteen worker tests in `leleka-control-plane` and four in `leleka-model-format` fail on macOS on the base branch too (process and path assumptions); they are unrelated to these changes. diff --git a/docs/original-serve.md b/docs/original-serve.md index ee468ae0..5e33efff 100644 --- a/docs/original-serve.md +++ b/docs/original-serve.md @@ -48,7 +48,7 @@ code it always was. Gated by it: the spawn tier (`backend/spawn_preview.rs`, `sp `generate`, `generate_mtp`, `session`, `load_weights`, `load_moe*`) and the tests and GPU proofs that need them. With the feature off the crate keeps the Original serve path only: `original_serve_choice` refuses `preview` and the fallback of `auto` with an error that names the feature and the reason that led to the preview path (it never starts a different engine), and a Load without Original options is refused at the owner. -Checked only on the engine crate (`cargo check -p leleka-engine-qwen35-cuda --no-default-features`); `strata-desktop-core` still names the +Checked only on the engine crate (`cargo check -p leleka-engine-qwen35-cuda --no-default-features`); `leleka-engine-host` still names the preview factories, so the `leleka-inference` binary builds with the feature on only. The experimental KV and control-vector modes (`experimental.rs`) are not behind it: `NativeBackendConfig` carries them and the default tests use them. diff --git a/docs/prefix-cache.md b/docs/prefix-cache.md index 4e0340b4..65fb4053 100644 --- a/docs/prefix-cache.md +++ b/docs/prefix-cache.md @@ -358,7 +358,7 @@ tokens average do not fit in 13 GB: the cache keeps the sessions it can and reje * GPU, model-free (`cargo test -p leleka-cuda-driver --features cuda-driver --lib -- --ignored parked_tests`, RTX 3080 Laptop sm86 build, 2026-10-17): parked K/V pages and index rows written back come out byte for byte, in pieces and as sub-ranges, the tail round-trips through the image, malformed spans are refused. -* HTTP/gRPC (`cargo test -p strata-desktop-core --test api_over_runtime`, `-p strata-control --test prefix_match_http`): the summary +* HTTP/gRPC (`cargo test -p leleka-engine-host --test api_over_runtime`, `-p leleka-control-plane --test prefix_match_http`): the summary travels engine -> runtime gRPC snapshot -> worker -> `/v1/status` and answers `/v1/prefix_match`. * Real model: `backend::original_serve_prefix_smoke::original_serve_prefix_cache_smoke` (jobs 921-92x). diff --git a/docs/q4-q5-k-reference-parity.md b/docs/q4-q5-k-reference-parity.md index bfd695af..447d6a40 100644 --- a/docs/q4-q5-k-reference-parity.md +++ b/docs/q4-q5-k-reference-parity.md @@ -85,8 +85,8 @@ classification and all non-NaN output bits. Previous nine visitor tests remain. ```sh cargo test --locked -p leleka-quant-core cargo clippy --locked -p leleka-quant-core --all-targets -- -D warnings -cargo test --locked -p strata-control --lib ggml_bridge::tests -- --test-threads=2 -cargo test --locked -p strata-control --lib gguf_f32_stream::tests +cargo test --locked -p leleka-control-plane --lib ggml_bridge::tests -- --test-threads=2 +cargo test --locked -p leleka-control-plane --lib gguf_f32_stream::tests ``` ## Actual local CPU result, 2026-10-07 diff --git a/docs/q6-k-q2-0-reference-parity.md b/docs/q6-k-q2-0-reference-parity.md index 39948f2a..1bc51a4f 100644 --- a/docs/q6-k-q2-0-reference-parity.md +++ b/docs/q6-k-q2-0-reference-parity.md @@ -71,8 +71,8 @@ headers with explicit zero factors retain C output semantics. ```sh cargo test --locked -p leleka-quant-core cargo clippy --locked -p leleka-quant-core --all-targets -- -D warnings -cargo test --locked -p strata-control --lib ggml_bridge::tests -- --test-threads=2 -cargo test --locked -p strata-control --lib gguf_f32_stream::tests +cargo test --locked -p leleka-control-plane --lib ggml_bridge::tests -- --test-threads=2 +cargo test --locked -p leleka-control-plane --lib gguf_f32_stream::tests ``` ## Actual results diff --git a/docs/q8-iq4xs-reference-parity.md b/docs/q8-iq4xs-reference-parity.md index 41d0d5c2..ee19bed0 100644 --- a/docs/q8-iq4xs-reference-parity.md +++ b/docs/q8-iq4xs-reference-parity.md @@ -72,8 +72,8 @@ prove Linux/GCC parity, measure performance or exercise a GPU. ```sh cargo test --locked -p leleka-quant-core cargo clippy --locked -p leleka-quant-core --all-targets -- -D warnings -cargo test --locked -p strata-control --lib ggml_bridge::tests -- --test-threads=2 -cargo test --locked -p strata-control --lib gguf_f32_stream::tests +cargo test --locked -p leleka-control-plane --lib ggml_bridge::tests -- --test-threads=2 +cargo test --locked -p leleka-control-plane --lib gguf_f32_stream::tests ``` ## Actual local CPU result, 2026-10-07 diff --git a/docs/release/5090-v0.1-checklist.md b/docs/release/5090-v0.1-checklist.md index be9eac5c..6f27245c 100644 --- a/docs/release/5090-v0.1-checklist.md +++ b/docs/release/5090-v0.1-checklist.md @@ -170,7 +170,7 @@ The candidate was built from commit `98f725f9c5e2` (docs-only difference from th | `package` (three cargo builds, `--locked`, new target dir) | WSL2 Ubuntu 24.04, rustc 1.99.0, inside the staged tree | all six binaries; archive 25,358,156 bytes, 185 files, sha256 `74e0d55fe61d4eb07467280aeb5c16d667e8090853ab4d2772523beced8b9805`; about 4 min | | `verify` | WSL2 | 0 failures: tarball digest, `SHA256SUMS`, no file outside it, no weights / credentials / Python, the six `MANIFEST.json` digests, no CR in shipped PTX, `leleka version`: `0.1.0`, commit `98f725f9...` `(clean)`, Strata pin `41cf05a0...` | | tests | WSL2 | `cargo test -p leleka-deploy --features test-fakes`: 180 unit tests, 26 end-to-end tests pass with `scripts/ci/nvidia-smi` first on `PATH` (as `scripts/check-local.sh --product`; the two host-class tests `dry_run_*` and `a_failing_preflight_*` are skipped there too, the dry run itself ran on the server below). Without the stand-in, on the laptop (RTX 3080 busy with the owner's own service, 39 GB RAM) seven end-to-end tests fail because they read the real GPU. Two of them (`a_sparse_memfd_profile_*`) were stale on main (they expected the word EXPERIMENTAL and an unpinned extents digest) and are fixed in this branch. `clippy -D warnings` on `leleka-deploy`: clean. `cargo fmt --check` on `leleka-deploy`: 450 hunks, known debt (not a gate) | -| second package at the same source path, **new** target dir | WSL2 | `leleka` and `leleka-seal-exec` are byte-identical to the first build; `strata-next`, `leleka-inference`, `leleka-daemon`, `leleka-cli` differ (the target directory path is embedded), so the tarball is not bit-reproducible across target dirs (second tarball sha256 `48791ac0...`). A rebuild in the same target dir was not done (no hard delete). Not a gate | +| second package at the same source path, **new** target dir | WSL2 | `leleka` and `leleka-seal-exec` are byte-identical to the first build; `leleka-api`, `leleka-inference`, `leleka-daemon`, `leleka-cli` differ (the target directory path is embedded), so the tarball is not bit-reproducible across target dirs (second tarball sha256 `48791ac0...`). A rebuild in the same target dir was not done (no hard delete). Not a gate | Server (`rnr5090`, Ubuntu 26.04.1, driver 595.99.02, RTX 5090): the tarball was copied with one `scp` (25 MB) to `/data/leleka-e2e/release-5090/` and run as a **holder job** of the GPU queue (`rel5090-accept4`; FIFO stub in `~/work/gpu-runs/holder2/jobs/`, `PRIORITY` untouched, `mkdir gpu.lock`, events appended to `decode/notes.md`), script `scripts/release/accept-5090-job.sh`; the run directory is `/data/leleka-e2e/release-5090/runs/accept-20261103T221030Z/` (`SUMMARY.txt`, `job.log`, `state/logs/`). The job inherits the lab holder's sealed archive descriptor, starts from an assets overlay with **no** `data/expert-profile.bin`, and evicts model files per file with `posix_fadvise(DONTNEED)` (never `drop_caches`). diff --git a/docs/release/licence-and-secrets-audit-5090-v0.1.md b/docs/release/licence-and-secrets-audit-5090-v0.1.md index a3abe56d..fc80aac3 100644 --- a/docs/release/licence-and-secrets-audit-5090-v0.1.md +++ b/docs/release/licence-and-secrets-audit-5090-v0.1.md @@ -17,13 +17,13 @@ parts are repeated by `scripts/release/package-5090.sh check` (gate_licence, gat | L7 | NVIDIA material: the driver and `libcuda.so.1` come from the host; cuBLAS 12.9.1.4 is **downloaded by `leleka up`** (SHA-256 pinned, NVIDIA's redistribution terms) and is **not bundled** by the packager (`--with-cublas` of the older `scripts/package-release.py` is not used); the sealed PTX is generated by us from our own and ggml-derived sources with nvcc 13.2.86 | PASS (note) | | S1 | Secrets scan of the tracked tree: no private key, AWS/GitHub/Hugging Face/Slack/Google token or JWT pattern in any tracked text file (the script never prints a match) | PASS | | S2 | No weights, KAR archives, credentials, logs or capture-type files are tracked; the largest tracked files are PTX (13 MB) and one upstream preview image (9.6 MB) | PASS | -| S3 | Owner-identifying strings in tracked files: server user `para`, `/home/para/...` and `C:\Users\pavel\...` paths, the host name `rnr5090`, the LAN address `192.168.1.196` (scripts only, not shipped), a corporate-style Windows user id in the metadata line of `benchmarks/results/agent-episode-ab-2026-10-15.jsonl`, `https://github.com/paveldhq/strata-next (private)` in `docs/upstream.md` and in the generated unit's `Documentation=` line | info; none is a credential. Strip them before any source publication | +| S3 | Owner-identifying strings in tracked files: server user `para`, `/home/para/...` and `C:\Users\pavel\...` paths, the host name `rnr5090`, the LAN address `192.168.1.196` (scripts only, not shipped), a corporate-style Windows user id in the metadata line of `benchmarks/results/agent-episode-ab-2026-10-15.jsonl`, `https://github.com/paveldhq/leleka-api (private)` in `docs/upstream.md` and in the generated unit's `Documentation=` line | info; none is a credential. Strip them before any source publication | | S4 | History scan for the same key/token patterns over all 6,466 commits (outside `engine/strata`): zero hits (section 4) | PASS | ## 2. Rust dependencies Method: `cargo metadata --locked --offline --format-version 1 --filter-platform x86_64-unknown-linux-gnu`, then the transitive **normal** dependencies of the three crates that build the six binaries -(`leleka-deploy`, `strata-control`, `strata-desktop-core`), default features. The complete table (name, version, SPDX expression, repository) is committed as +(`leleka-deploy`, `leleka-control-plane`, `leleka-engine-host`), default features. The complete table (name, version, SPDX expression, repository) is committed as `docs/release/third-party-crates-5090-v0.1.tsv` and keyed to `Cargo.lock` SHA-256 (LF-normalised) `10d08d0c03448a8abec0ca3fc49595a0630dfa5bf1dfb2e2337bdbd2bdffd2b6`. If `Cargo.lock` changes, regenerate it. | declared licence (SPDX) | crates | @@ -40,7 +40,7 @@ Method: `cargo metadata --locked --offline --format-version 1 --filter-platform | others (one each) | `ring` (`Apache-2.0 AND ISC`), `aws-lc-rs`, `aws-lc-sys` (`ISC AND Apache-2.0 AND MIT AND BSD-3-Clause AND ...`, OpenSSL-lineage code inside), `matchit` (`MIT AND BSD-3-Clause`), `subtle` (`BSD-3-Clause`), `webpki-root-certs` (`CDLA-Permissive-2.0`, certificate data), `borrow-or-share` (`MIT-0`), `ryu` (`Apache-2.0 OR BSL-1.0`), `foldhash`, `tinyvec`, `lru-slab`, `unicode-ident`, `fnv`, `bytecount` | Notes. (1) No crate in the shipped set has a missing licence field. (2) The only copyleft word in the whole lock (398 packages, all platforms) is `r-efi` (`MIT OR Apache-2.0 OR LGPL-2.1-or-later`): the -permissive options are available and the crate is UEFI-only, not linked on Linux. (3) The TLS stack (`rustls`, `ring`, `aws-lc-*`) is linked for `strata-next model fetch` (Hugging Face downloads); its notice requirements +permissive options are available and the crate is UEFI-only, not linked on Linux. (3) The TLS stack (`rustls`, `ring`, `aws-lc-*`) is linked for `leleka-api model fetch` (Hugging Face downloads); its notice requirements are the ones in L4. (4) `engine/strata` is not part of any binary and not in the package; the Rust port shares artifacts and algorithms with it, not its C++ code (`docs/upstream.md`, "Port provenance"). ## 3. First-party, vendored and upstream material diff --git a/docs/release/third-party-crates-5090-v0.1.tsv b/docs/release/third-party-crates-5090-v0.1.tsv index 8ee73930..fd25a99f 100644 --- a/docs/release/third-party-crates-5090-v0.1.tsv +++ b/docs/release/third-party-crates-5090-v0.1.tsv @@ -1,4 +1,4 @@ -# Rust crates linked into the six shipped binaries (normal dependencies of leleka-deploy, strata-control, strata-desktop-core; x86_64-unknown-linux-gnu; default features) +# Rust crates linked into the six shipped binaries (normal dependencies of leleka-deploy, leleka-control-plane, leleka-engine-host; x86_64-unknown-linux-gnu; default features) # Cargo.lock sha256 (LF-normalised) 84b74b1d6a56c3245104dbb8f3bd78671991a55e4aed4cceae1bbfcc03218ade ; generated offline with cargo metadata --locked --offline on 2026-11-03, base 4cbbd2729 # name version SPDX licence expression (as declared by the crate) repository ahash 0.8.12 MIT OR Apache-2.0 https://github.com/tkaitchuck/ahash diff --git a/docs/roadmap.md b/docs/roadmap.md index 09c67f4a..33414f15 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -2,7 +2,7 @@ ## Product shape -The target interface is one Linux command, `strata-next`, with `serve`, `model fetch`, `model verify`, `model prepare`, `doctor`, and `benchmark` operations. A model remains on an external volume. The command must keep production serving independent of Python. The user-facing executable may eventually contain a statically linked Strata engine, but CUDA still needs the installed NVIDIA driver and its `libcuda.so`. The CLI checks the existing driver; it does not install or bundle one. For the current CUDA 13.0 GA baseline, the minimum Linux driver is 580.65.06 per NVIDIA's release notes. Until engine integration is proven, the Rust executable and C++ engine remain separate build artifacts and the CLI reports that limitation clearly. +The target interface is one Linux command, `leleka-api`, with `serve`, `model fetch`, `model verify`, `model prepare`, `doctor`, and `benchmark` operations. A model remains on an external volume. The command must keep production serving independent of Python. The user-facing executable may eventually contain a statically linked Strata engine, but CUDA still needs the installed NVIDIA driver and its `libcuda.so`. The CLI checks the existing driver; it does not install or bundle one. For the current CUDA 13.0 GA baseline, the minimum Linux driver is 580.65.06 per NVIDIA's release notes. Until engine integration is proven, the Rust executable and C++ engine remain separate build artifacts and the CLI reports that limitation clearly. `LAYERED_EXTENDED` is retained as an exact user-provided term; no runtime semantics have been assigned to it yet. @@ -157,7 +157,7 @@ Last reviewed 2026-10-14 against branch `claude/port-main`. No performance or mo - Source-complete and type-checked only: the CUDA driver wrappers, the native head, MTP drafter and loader, verifier window recorder, prefill scheduling, expert cache and stager, QSA/GDN/GR/PLE/MoE/MMQ owners, and the KAR routed-expert source. `cargo check --target x86_64-unknown-linux-gnu --all-targets -p leleka-cuda-driver --features cuda-driver -p leleka-runtime` passes; the tests of these two crates compile but were not run on Linux by this effort. - The PTX of the new or changed kernels was compiled with nvcc 13.2.86 and sealed on 2026-10-15 (30 assets; six placeholders remain), but the engine is not linked. Unsealed assets fail closed (zero pins, refusing constructors). - Not run on a GPU: everything above. The only GPU evidence is the earlier preview-generation run (identical greedy ids for one 202-token prompt; it was far slower than the Original and scaled variants exhausted VRAM), which predates the Original-literal code and does not qualify it. -- Known test debt on the macOS development host: thirteen worker tests in `strata-control` and four in `leleka-model-format` fail on macOS because of process and path assumptions (also on the base branch); `leleka-cuda-driver`, `leleka-runtime` and `leleka-native-cpu-expert` do not build natively on macOS; `cargo fmt --check` is not clean for `leleka-model-format`, `leleka-experimental-ref`, `leleka-cuda-driver`, `leleka-runtime` and `leleka-native-cpu-expert`. +- Known test debt on the macOS development host: thirteen worker tests in `leleka-control-plane` and four in `leleka-model-format` fail on macOS because of process and path assumptions (also on the base branch); `leleka-cuda-driver`, `leleka-runtime` and `leleka-native-cpu-expert` do not build natively on macOS; `cargo fmt --check` is not clean for `leleka-model-format`, `leleka-experimental-ref`, `leleka-cuda-driver`, `leleka-runtime` and `leleka-native-cpu-expert`. **What remains.** Build and seal the PTX, link the engine, run the GPU smokes, establish Original17 parity, execute the Linux-gated tests, then the charter's controlled baseline, paired A/B and quality gates. Until the performance ledger has entries, nothing here is a performance claim. diff --git a/docs/rust-runtime-run.md b/docs/rust-runtime-run.md index fa51a87e..2565e8e4 100644 --- a/docs/rust-runtime-run.md +++ b/docs/rust-runtime-run.md @@ -19,7 +19,7 @@ leleka-cli --HTTP /runtime/{status,load,unload,operation}-------> l ``` `leleka-seal-exec` is a launcher, not a daemon: it copies the KAR archive into a sealed memfd and `exec`s `leleka-inference` -with the descriptor number substituted for `{FD}`. All four binaries live in `desktop-core/` (package `strata-desktop-core`). +with the descriptor number substituted for `{FD}`. All four binaries live in `desktop-core/` (package `leleka-engine-host`). `leleka-inference` starts with model admission closed; its CUDA owner thread waits for an explicit `Load` and creates no CUDA context before it. @@ -42,7 +42,7 @@ numerical reproducibility is not decided anywhere in the repository. ```sh cd # branch claude/m2-control-plane -cargo build --release --locked -p strata-desktop-core \ +cargo build --release --locked -p leleka-engine-host \ --bin leleka-inference --bin leleka-daemon --bin leleka-cli --bin leleka-seal-exec # binaries: target/release/{leleka-inference,leleka-daemon,leleka-cli,leleka-seal-exec} ``` @@ -119,31 +119,31 @@ Notes taken from the code: * After an engine restart the model is **not** loaded again automatically; issue `load-mtp` again (new epoch). * `leleka-inference` and `leleka-daemon` shut down gracefully on SIGINT only (observed: the daemon exits 0 on SIGINT and with status 143 on SIGTERM); under systemd use `KillSignal=SIGINT`, as the templates do. -## The full API in front of the runtime: `strata-next` with a `runtime` block +## The full API in front of the runtime: `leleka-api` with a `runtime` block `leleka-daemon` serves only a narrow text subset of `/v1/responses`. For Codex and the rest of the native API (Responses with -stored responses, tools, `text.format`, reasoning; Chat Completions; Messages; `input_tokens`; drain; metrics) run `strata-next` +stored responses, tools, `text.format`, reasoning; Chat Completions; Messages; `input_tokens`; drain; metrics) run `leleka-api` with a `runtime` block instead of an `engine` child. Design and limits: [`api-over-rust-engine.md`](api-over-rust-engine.md). ```text -client / Codex --HTTP, Bearer STRATA api key--> strata-next 127.0.0.1:8081 -strata-next --gRPC, Bearer LELEKA_RUNTIME_TOKEN--> leleka-inference 127.0.0.1:18766 (the same process the daemon talks to) +client / Codex --HTTP, Bearer STRATA api key--> leleka-api 127.0.0.1:8081 +leleka-api --gRPC, Bearer LELEKA_RUNTIME_TOKEN--> leleka-inference 127.0.0.1:18766 (the same process the daemon talks to) ``` Order (steps 1 and 3 of the commands above are unchanged; the daemon is optional and only needed for `leleka-cli`): ```sh # 1. engine, as above 2. (optional) leleka-daemon 3. explicit load: leleka-cli ... load-mtp qwen-iq3 qwen4exp-kar-ple-mtp-v1 -# 4. the tokenizer assets strata-next counts tokens with (same GGUF the engine loads; written once, offline): -strata-next model extract-tokenizer $A/model/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf --output $S/tokenizer-assets +# 4. the tokenizer assets leleka-api counts tokens with (same GGUF the engine loads; written once, offline): +leleka-api model extract-tokenizer $A/model/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf --output $S/tokenizer-assets # 5. the API export LELEKA_RUNTIME_TOKEN=... # same value the engine was started with; 32..4096 printable ASCII bytes -strata-next serve --config control-plane/config.runtime.example.json # edit tokenizer_dir (= $S/tokenizer-assets/tokenizer) and api_key_file -strata-next wait-ready --url http://127.0.0.1:8081 --model qwen-iq3 --key-file /etc/leleka/api-key +leleka-api serve --config control-plane/config.runtime.example.json # edit tokenizer_dir (= $S/tokenizer-assets/tokenizer) and api_key_file +leleka-api wait-ready --url http://127.0.0.1:8081 --model qwen-iq3 --key-file /etc/leleka/api-key ``` `runtime.model` and `runtime.mode` name what the engine must have loaded (here the pinned IQ3_S artifact and the experimental -`qwen4exp-kar-ple-mtp-v1` mode). `strata-next` **only attaches**: it never sends Load or Unload, so an HTTP request cannot start a +`qwen4exp-kar-ple-mtp-v1` mode). `leleka-api` **only attaches**: it never sends Load or Unload, so an HTTP request cannot start a 55 GB load. If the runtime has nothing loaded, another artifact, or another mode, `/ready` stays 503 (worker `starting` or `restarting`) and the reason is logged (`waiting for the engine: ...`); when the runtime restarts, readiness drops within `runtime.health_interval_s` and returns by itself once the operator has loaded the model again. `/unload` answers `unsupported`. @@ -178,7 +178,7 @@ used) and the real `*.provenance.json`, and stopped before any `Load`. Request validation, SSE ordering and finish reasons through the real HTTP/2 gateway are covered by the project's own synthetic backend (`desktop-core/tests/runtime_gateway_sdet.rs`: `actual_http2_text_maps_single_ordered_sse_terminal`, `accepted_faults_missing_terminal_and_tool_reason_fail_without_retry`, `daemon_http_disconnect_cancels_one_runtime_generation`) -and, for the full Responses surface, through `strata-next` against scripted engines (`control-plane` tests, +and, for the full Responses surface, through `leleka-api` against scripted engines (`control-plane` tests, `scripts/test-live-responses-replay.py`, `scripts/smoke-*.py`; results in `delivery-gap-audit.md`, section 1). The synthetic fixtures are not recorded Codex traffic. diff --git a/docs/sm86-assets.md b/docs/sm86-assets.md index b4deacf0..051418c2 100644 --- a/docs/sm86-assets.md +++ b/docs/sm86-assets.md @@ -14,7 +14,7 @@ match). **No numerical, quality or performance claim is made anywhere here.** `MANIFEST.json` (method, rules applied, sm_120 and sm_86 digests, ptxas verdict, what is not built). * `crates/cuda-driver/src/sm86_table.rs` is generated: companions sorted by the SHA-256 of the **sealed sm_120 body**, each with its own `(length incl. NUL, sha256)` pin. -* Cargo feature `sm86` (`leleka-cuda-driver`, forwarded by `leleka-runtime` and `strata-desktop-core`), off by +* Cargo feature `sm86` (`leleka-cuda-driver`, forwarded by `leleka-runtime` and `leleka-engine-host`), off by default. With it, the 27 `cuModuleLoadData` sites call `arch_ptx::image(sealed_image)`: on a device with 8.6 <= cc < 12.0 the companion is looked up by digest and admitted only through `sealed_ptx::pinned`; otherwise (cc 12.x, no companion, pin failure, any query error) the sealed image is passed through unchanged. One binary therefore serves both @@ -138,7 +138,7 @@ placeholders; `device_poison` is already sealed). Not done here. What it needs, from the repo's own documents: -* Build: `cargo build --release --locked -p strata-desktop-core --features sm86 --bin leleka-inference --bin leleka-daemon` +* Build: `cargo build --release --locked -p leleka-engine-host --features sm86 --bin leleka-inference --bin leleka-daemon` (same for `leleka-cli`), run with `LD_LIBRARY_PATH` containing the libcublas 12 directory. `LELEKA_SM86_TRACE=1` shows the swapped modules. * Inputs (`docs/original-serve.md`): the two pinned IQ3_S shards, the compressed KAR archive (the 51.5 GiB level-2 archive is mentioned in `docs/model-assets.md`) plus its provenance, the MTP pack and staging dir. Copy them to the WSL ext4 disk first; `/mnt/c` is a 9p mount diff --git a/docs/tool-call-corpus.md b/docs/tool-call-corpus.md index 299fe937..c8722462 100644 --- a/docs/tool-call-corpus.md +++ b/docs/tool-call-corpus.md @@ -22,7 +22,7 @@ Origin of the question: upstream issue #4078 (a string argument that quotes a to * Not compared: upstream's counters (`unread`, `notes`) and the ids of calls. Text is compared after trimming. * A specimen marked `length` ended at the token limit; the test treats it like the others (our code parses the answer whatever the finish reason). * The test is strict both ways: a specimen that fails and is not listed in `KNOWN_FAILURES` fails the test, and so does a listed one that - passes. Run `TOOL_CORPUS_TABLE=1 cargo test --release -p strata-control --test tool_corpus -- --nocapture` to print the table. + passes. Run `TOOL_CORPUS_TABLE=1 cargo test --release -p leleka-control-plane --test tool_corpus -- --nocapture` to print the table. * From step 4 on every specimen is read twice, with the default options and with the experimental `tool_call_recovery` on (`Options::recovery`); the test lists the failures of each reading separately (`KNOWN_FAILURES`, `KNOWN_FAILURES_WITH_RECOVERY`). diff --git a/docs/unattended.md b/docs/unattended.md index 6a61c7ff..f0e52fff 100644 --- a/docs/unattended.md +++ b/docs/unattended.md @@ -18,7 +18,7 @@ systemd: leleka.service (User=para, Restart=on-failure, starts at boot) |- seals the 55 GB KAR archive into a memfd ONCE (O_DIRECT, 32 x 8 MiB blocks; 2.5 min cold) |- leleka-daemon gateway, 127.0.0.1:18080 |- leleka-inference engine, gRPC 127.0.0.1:18766 (gets a duplicate of the memfd) - `- strata-next serve the API Codex talks to, 127.0.0.1:8081, bearer key in STATE/api-key + `- leleka-api serve the API Codex talks to, 127.0.0.1:8081, bearer key in STATE/api-key ``` The service replaces the lab infrastructure for daily use: the Python KAR holder (`run_holder2.sh`), `gpu.lock` and the job stubs in @@ -29,7 +29,7 @@ Layout on `rnr5090` (all inside the work folder, which is a symlink to `/data/le | path | content | | --- | --- | -| `/data/leleka-e2e/service/prefix/bin/` | `leleka`, `leleka-inference`, `leleka-daemon`, `leleka-cli`, `leleka-seal-exec`, `strata-next` | +| `/data/leleka-e2e/service/prefix/bin/` | `leleka`, `leleka-inference`, `leleka-daemon`, `leleka-cli`, `leleka-seal-exec`, `leleka-api` | | `/data/leleka-e2e/service/state/` | `leleka.json` (run configuration), `runtime.env` + `api-key` (mode 0600), `run/status.json`, `logs/`, `stamps/` | | `/home/para/work/leleka/models/leleka-gates/assets/` | shards, archive, MTP pack, tokenizer (read only; unchanged) | | `/data/leleka-e2e/service/ops/` | `install-leleka-service.sh`, `leleka.service` (copies of `scripts/ops/`) | @@ -177,7 +177,7 @@ host already has `server-hang-autoreboot.sh`); GPU or driver faults that corrupt * The API binds `127.0.0.1:8081` (`--api-bind` only for containers); engine and gateway are loopback-only and refuse anything else in `leleka.json` validation. Remote access: SSH tunnel. No TLS inside the machine. -* Every route except `/health` needs `Authorization: Bearer `; the key is generated by `strata-next api-key init` (random, file 0600, +* Every route except `/health` needs `Authorization: Bearer `; the key is generated by `leleka-api api-key init` (random, file 0600, never rotated by `up`); the two internal tokens live in `runtime.env` (0600) and reach children through their environment, never argv. `HF_TOKEN` is removed from every child. The unit runs with `UMask=0077` and `NoNewPrivileges=yes` as the unprivileged user `para`. * No secret in a log: the supervisor never logs a command line with a token; the soak harness scans every log for the key and the tokens diff --git a/docs/upstream-port-plan.md b/docs/upstream-port-plan.md index 638c3418..82969d3b 100644 --- a/docs/upstream-port-plan.md +++ b/docs/upstream-port-plan.md @@ -17,7 +17,7 @@ the run-to-run control); **L** live Codex session. | # | Item (upstream SHAs) | Action | Gate | Status | |---|---|---|---|---| -| 0.1 | Control-token text in messages becomes real special tokens (`c16f31f8`, `98b7ea94`, `0d613031`) | swap ``, `` and the other control literals in message text (user, tool, system, assistant history, tool-call arguments, tool descriptions) for private-use marks before the template renders; after it encode those spans as plain text (`Tokenizer::encode` plain spans); the template's own markers stay special; same path for token counting | U (injection fixtures), L | **U done** (2026-10-25, native Windows `cargo test`: leleka-tokenizer lib 11 + marked 7 + fast_path 7 + oracle 3, strata-control 259 lib + 33 backend_worker_http, leleka-runtime lib 504, all green; the injection fixtures are in `crates/tokenizer/tests/marked.rs`, `responses.rs` tests and `backend_worker_http.rs`). `leleka_tokenizer::LiteralMarks` maps every type 3/4 literal to a plane-15 private-use mark (a forged mark is escaped); `render_request` marks instructions, message text, reasoning, call arguments, tool outputs, tool descriptions/schemas; the gateway's own ``/`` markers stay literal; `Tokenizer::encode_marked` is the one path for generation and `/input_tokens`; the text contract carries the marked string and `leleka-runtime` `prepare_prompt` reads it with `encode_marked`. Not done: `strata-desktop-core` (`runtime_gateway`, `runtime_tools`) still renders unmarked text; replayed assistant text keeps its marks too (a model-written `` in history is replayed as text); an engine older than this change reads the marks as private-use characters. **L todo** (live Codex session) | +| 0.1 | Control-token text in messages becomes real special tokens (`c16f31f8`, `98b7ea94`, `0d613031`) | swap ``, `` and the other control literals in message text (user, tool, system, assistant history, tool-call arguments, tool descriptions) for private-use marks before the template renders; after it encode those spans as plain text (`Tokenizer::encode` plain spans); the template's own markers stay special; same path for token counting | U (injection fixtures), L | **U done** (2026-10-25, native Windows `cargo test`: leleka-tokenizer lib 11 + marked 7 + fast_path 7 + oracle 3, leleka-control-plane 259 lib + 33 backend_worker_http, leleka-runtime lib 504, all green; the injection fixtures are in `crates/tokenizer/tests/marked.rs`, `responses.rs` tests and `backend_worker_http.rs`). `leleka_tokenizer::LiteralMarks` maps every type 3/4 literal to a plane-15 private-use mark (a forged mark is escaped); `render_request` marks instructions, message text, reasoning, call arguments, tool outputs, tool descriptions/schemas; the gateway's own ``/`` markers stay literal; `Tokenizer::encode_marked` is the one path for generation and `/input_tokens`; the text contract carries the marked string and `leleka-runtime` `prepare_prompt` reads it with `encode_marked`. Not done: `leleka-engine-host` (`runtime_gateway`, `runtime_tools`) still renders unmarked text; replayed assistant text keeps its marks too (a model-written `` in history is replayed as text); an engine older than this change reads the marks as private-use characters. **L todo** (live Codex session) | | 0.2 | `--dump-logits` header lies on native packs (`504579da`) | check every parity harness that compared against it | U | **checked, not affected; guard added** (2026-10-26). Searched the whole tree (scripts, tools, benchmarks, docs, crates, desktop, control-plane; `engine/strata` excluded) for `dump-logits`, `dump_logits`, `logits_identical`, logits-dump readers and fixtures: the only reference is the manual debugging recipe in `docs/gpu-bringup.md` step f.5 ("re-run the first differing case with the CLI `--dump-logits`"), never executed by a harness. Every parity and quality harness of ours reads other channels: the serve-mode `STRATA_LOGPOS` top-k rows (`scripts/quality/q_lib.py`, `q-common.sh`, jobs 991-9973, `scripts/numerics/num_lp*.py`), the `DBG residual window` lines (`num_cmp_resid.py`, `num_lad_tools.py`) and text/token outputs (`compare-chat-reports.py`, the replay and smoke harnesses). The upstream defect is real for the pinned reference build `stra169-ladder` (older than `504579da`: header written at open, n_prompt + max_new rows promised, a native pack never reaches the dump site), so the recipe in `gpu-bringup.md` now says to check the dump first, and `scripts/quality/logits_dump_check.py` (offline, no model; `--selftest` passes: honest file, header lying with no rows, count one too high, short body, truncated row, wrong vocabulary) trusts the file size instead of the header and refuses an empty dump. No code of ours changed. Not verified: the recipe itself was not re-run on the server (no GPU job) | | 0.3 | Spec window / MTP drafts near the context end run past `max_cells` (`e85567b6`) | test the controller at `max_context - k` | U | **U done** (2026-10-26, server `rnr5090`, `cargo test --release`: `leleka-runtime` lib `original_spec_controller` + `original_serve_engine` 60 passed, `leleka-cuda-driver --features cuda-driver` lib 382 passed). Ours was not the upstream crash (the serve loop ended as length instead of "ran out of context") but had the same hole in two places: (a) `verify_commit` ended the request when `p + t > max_context` instead of taking the rows that fit (upstream generate.cpp `room`), losing up to 7 tokens at the end of a context, and the MTP chain drafted `mtp_t - 1` cells whatever the context had left (upstream `mtp.cpp`: `max_steps = min(.., max_cells - (p + a))`); (b) the driver refused a draft launch when `first + a + max_t - 1 > 262144` (`mtp_original_full_drafter.rs`, `mtp_original_full_round.rs`) although only draft 0 was needed: a request admitted at the edge (`n + max_new + 8 = 262144`, a window of up to 8 rows plus accept 7) died with `InvalidQwenShape`. Now: the window shrinks to `max_context - p` (no room = finished as context; a shrunk window is not observed by the adaptive policy), the chain is clamped to `max_context - (p + a)` through `set_draft_plan` and restored on the next round, `chain_end_within_cells` bounds the driver's chain loop, the staging checks bound what is staged (`first + max(rows, a + 1)`). Tests: `spec_windows_and_drafts_never_pass_max_context_at_any_distance_from_the_end` (max_t 2/4/6/8, k = 1..max_t+3 from the end, fixed / suffix / min_p / adaptive: no row or draft cell >= max_context, text = greedy of every row that fits), `a_window_near_the_context_end_takes_only_the_rows_that_fit`, `the_chain_is_shortened_near_the_end_and_restored_after_it`, `a_chain_clamped_by_one_request_is_restored_for_the_next`, `serve_request_to_the_context_end_stays_inside_the_cells_and_ends_as_context` (real engine over the fake port), `the_chain_stops_at_the_last_cell_that_exists` (driver). Mutation check: with the window shrink and the chain clamp removed, 5 of these fail. Not verified on a model (no GPU run: the driver check relaxation is exercised only by the pure helper test). Open: the MTP ring is fixed at `MTP_ORIGINAL_MAX_CELLS` = 262144 cells while `leleka_context::geometry::MAX_CELLS` is 524288: a 512K context cannot draft past cell 262143 (not changed here) | | 0.4 | PLE `gather_batch` matches prefetched rows by position (`36381540`) | test reordered and duplicated keys on our async PLE reader | U | **U done, ours is not affected** (2026-10-26, server, `cargo test --release`: `leleka-model-format` lib `ple_reader` 27 passed, `leleka-runtime` lib `kar_ple_cache` 5 passed, 2 ignored need the real archive). Upstream's bug is in its `PleTable::gather_batch` fast path, which compared the prefetch slot list with the requested token list position by position and re-read the rows of a reordered or duplicated batch (a second ticket; the bytes were right, the read was wasted). Ours has no such matching: `PleReader::issue` returns a `Ticket` that owns its output buffer (slot `i` = request row `i`; `plan_reads` records one `Use` per request slot, duplicates included) and the row cache is keyed by row id; the per-token path (`ple_issue`/`ple_collect`, `original_window_ple`) pairs a token with its own ticket, and the KAR PLE GPU cache (`kar_ple_cache.rs`, `lookup_rows`) is a `RowMap` keyed by row id. Pinned by `ple_reader::tests::prefetched_keys_are_matched_by_row_never_by_position` (the upstream cases: ordered, permutation, subset, duplicates, duplicate prefetch, missing key, extra prefetch, none, over the window, window overflow, plus out-of-range rows; cache 0 / 8192 rows, inline / threaded; every slot equals the byte oracle, tickets collected out of order, a row already fetched is not read again, a batch never reads more than its distinct rows) and `kar_ple_cache::slot_tests::rows_are_matched_by_row_id_never_by_position_in_the_chunk` (swapped, reversed, shifted, repeated, subset and mixed known/new chunks keep each row in its slot). No code change | @@ -402,7 +402,7 @@ Row numbers 4.x to 7.x are new. "Branch" means a local branch not merged into `m |---|---|---|---|---| | 4.1 | Quoted tool call inside a string argument cut the argument silently (`77794e34`, `b72f56e0`, upstream #4078; cpu review A1, a confirmed defect of ours) | follow upstream's quote rule in `control-plane/src/tool_output.rs`; port upstream's corpus first | U (+ L) | **done on `main`** (`c5c60ac6` corpus: 49 specimens, 41 Qwen-form, 8 DSML skipped; `9b07fdd9` fix). Before the fix 11 of 41 specimens and 2 of 6 quoted-value shapes were read as upstream expects, after it 13 of 41 and 5 of 6 (M, code reach on upstream's corpus, not a session rate). Deliberately not taken: a value that reopens its own parameter stays an error (duplicate parameter), pinned by `native_tools_sdet`. L todo: count the shape in real failed-output captures (`STRATA_DEBUG_FAILED_OUTPUT`) | | 4.2 | Recoverable shapes that ended in a failed response: `` left out, `` left out, a call inside the reasoning, damaged array / object arguments (`d7113273`, `805ebe17`, upstream #4427, #4077; cpu review A2, A3, A4) | read them as calls, log every acceptance; an undeclared tool name stays an error | U (+ L) | **done on `main`** (`f528844f`, default behaviour, each acceptance logged on stderr). Undeclared names are NOT returned as text as upstream does (a text answer ends an agent's turn, a failed response is retried by the client; pinned by `native_tools_sdet`, `backend_worker_http`). Open brackets and bare strings in arguments are not repaired by default. Repairs interpret what the model wrote: the owner has not recorded an explicit decision in the repo (U). L todo | -| 4.3 | `tool_call_recovery`: calls drifted by a token (`` opener, `<=NAME>`, bare ``, JSON inside ``, a second call in one wrapper) (`3fcb2106`, `5bc479d9`; cpu review A5) | opt-in setting `tool_call_recovery` / `STRATA_TOOL_CALL_RECOVERY=1`, declared tools only | U, L, then Q-equivalent: completion of real agent tasks | **implemented, experimental, default OFF** (`ab54ae20`; strata-control lib 339 passed, M). Recovery on upstream's 41 Qwen specimens: off 24 of 41, on 30 of 41, the 6 that need it 0 of 6 against 6 of 6 (M, code reach, not a rate for real sessions). Upstream's 98.3 % against 92.9 % (C) is a reporter's corpus under Claude Code. Not enabled in any profile until measured on our own failed-output captures and a Codex session | +| 4.3 | `tool_call_recovery`: calls drifted by a token (`` opener, `<=NAME>`, bare ``, JSON inside ``, a second call in one wrapper) (`3fcb2106`, `5bc479d9`; cpu review A5) | opt-in setting `tool_call_recovery` / `STRATA_TOOL_CALL_RECOVERY=1`, declared tools only | U, L, then Q-equivalent: completion of real agent tasks | **implemented, experimental, default OFF** (`ab54ae20`; leleka-control-plane lib 339 passed, M). Recovery on upstream's 41 Qwen specimens: off 24 of 41, on 30 of 41, the 6 that need it 0 of 6 against 6 of 6 (M, code reach, not a rate for real sessions). Upstream's 98.3 % against 92.9 % (C) is a reporter's corpus under Claude Code. Not enabled in any profile until measured on our own failed-output captures and a Codex session | | 4.4 | Aliases of a declared tool name: `namespace__member`, `namespace=member`, bare member, `mcp_a_b` (`805ebe17`, `fd8d37e9`; cpu review A6) | test whether the model mistypes our 24-hex namespace alias (`ns_`, `response_tools.rs`) on a Codex MCP namespace before adding aliases; owner policy on fail-closed against text | L (needs the model) | **todo**, hypothesis only (U): the risk that the 24-hex alias is mistyped is not measured. Undeclared name = error stays | | 4.5 | Window-graph `cuGraphInstantiate` out of memory ended the engine (`a8c1d4b7`, `2a9a67c1`, upstream #3702; decode B1, kernels C5 / H3) | drop the widest window graphs that do not fit and carry on; an upload failure is a warm-up skip | U, then a GPU run with the failure injected (`LELEKA_TEST_WINDOW_INSTANTIATE_OOM_AT=N`) | **branch `claude/upstream-fixes`, `b5d5b24f`; CPU tests only, never run on a GPU (U), not merged.** Matters at the edge: free VRAM at decode is 316-563 MiB on the 5090 (M, `vram-footprint-5090.md`), and vanilla ends with about 459 MiB free on the laptop (M, `laptop-vs-vanilla.md`; ours not re-checked) | | 4.6 | PLE reader hang after a failed read (`ebe3383a`) | tests with several tickets in flight; a panicking source is a failed read | U | **branch `claude/upstream-fixes`, `03e891cd`, not merged.** The failed-read path already released tickets (so the upstream bug did not apply); the panic case was the open hole. Pin: row 0.4 for the other PLE bug | @@ -414,7 +414,7 @@ Row numbers 4.x to 7.x are new. "Branch" means a local branch not merged into `m | 4.12 | Per-thread copy streams and events leak VRAM over many cold prompts (`3478382e`, `f62589fd`, upstream #3470) | free VRAM must stay flat over N long cold prompts (`LELEKA_VRAM_LEDGER=1`) | R-style leak run | **todo**, needs a GPU run (U: no leak known in our driver wrappers, not audited) | | 4.13 | Window-invariant CPU rows as a **test mode** (`499e9635`, `447460e8`, upstream #3416; cpu review D1) | each token's CPU expert rows take the bits of the one-token call whatever the window width; use only to tighten the run-to-run band of gate Q | Q tooling | **todo**, no speed claim. Motivation: the port is not bit-deterministic between processes (13.5 % of rows identical across two runs, M, header of this document) and fixed windows with one CPU worker are bit-identical (M, job `up3h-det`); that window-width dependent CPU rounding is a main part of the band is an inference (U) | | 4.14 | Vanilla baseline hygiene (`a3ab37fc`, `STRATA_DEFAULTS=026`) | every A/B arm built from upstream 0.2.7 or later sets `STRATA_DEFAULTS=026` or each switch explicitly, and records it in the run metadata; the pin and the reference build do not move | process | **rule only**, no code. Reason: a 0.2.8 binary silently carries `GR_UP_WIDE`, `GR_V3`, `PROMPT_ATTN_IMMA`, `PLE_AUTO_RAM` and a 256 MiB smaller cache (1-3 % in total, C), the size of our run-to-run spread | -| 4.15 | Control-token text in messages (old row 0.1; `c16f31f8`, `98b7ea94`, `0d613031`) | finish `strata-desktop-core` (`runtime_gateway`, `runtime_tools` still render unmarked text) | U, L | unchanged from row 0.1: U done, desktop-core not done, L todo | +| 4.15 | Control-token text in messages (old row 0.1; `c16f31f8`, `98b7ea94`, `0d613031`) | finish `leleka-engine-host` (`runtime_gateway`, `runtime_tools` still render unmarked text) | U, L | unchanged from row 0.1: U done, desktop-core not done, L todo | Merge note for `claude/upstream-fixes`: `git diff --stat main...claude/upstream-fixes` reads 13,685 insertions and 13,039 deletions over 13 files, but with `--ignore-space-at-eol` only 661 insertions and 15 deletions (M, just measured): four of the six commits (11 of the 13 files) rewrote whole files' line endings (the same issue `47707480` fixed on `main` for other branches). Re-normalize to the repository's line endings before merging so that the review and blame show the real change. diff --git a/docs/upstream-review/cpu-and-platform.md b/docs/upstream-review/cpu-and-platform.md index bd67be5a..e6c5153e 100644 --- a/docs/upstream-review/cpu-and-platform.md +++ b/docs/upstream-review/cpu-and-platform.md @@ -161,7 +161,7 @@ All values are the state of `870aedd9`. "Switch" is the off switch. `STRATA_DEFA | 1 | Quoted tool call inside a string argument truncates the argument | `77794e34`, `b72f56e0` | **Present in our parser, silently** (section 8) | A1 + fixtures | P0 | | 2 | Call without ``; call inside reasoning; stray ``; damaged JSON array | `d7113273` | Present: `Err` or string argument | A2, A3 (A4 by owner decision) | P0/P1 | | 3 | Mangled or namespaced tool names fail the turn | `805ebe17`, `fd8d37e9` | Present as `Err("undeclared function")`; hex-alias scheme for namespaces | A6, owner policy | P1 | -| 4 | Control-token text in messages becomes real special tokens | `c16f31f8`, `98b7ea94`, `0d613031` (before the pin) | Done (port plan 0.1; `strata-desktop-core` still renders unmarked text, per that row) | finish `desktop-core` | tracked | +| 4 | Control-token text in messages becomes real special tokens | `c16f31f8`, `98b7ea94`, `0d613031` (before the pin) | Done (port plan 0.1; `leleka-engine-host` still renders unmarked text, per that row) | finish `desktop-core` | tracked | | 5 | Checkpoint copy out of memory ends the engine | `f62589fd` | Not traced | B3 | P3 | | 6 | PLE reader hangs after a failed read | `ebe3383a` | Not affected (port plan 0.4) | none | - | | 7 | Windows direct PLE read -> all-logits NaN (#3602), unexplained upstream | `ebe3383a`, `8dd297d0` | We use the same idea (unbuffered, own handles) on Windows; verify mode exists, no production guard | C5 | P3 | diff --git a/docs/upstream.md b/docs/upstream.md index 48452237..e27a68f8 100644 --- a/docs/upstream.md +++ b/docs/upstream.md @@ -17,7 +17,7 @@ OLD pin plus the old local patches; the new subtree is not that reference (see " | Local repository path | `engine/strata/` | | Update date | 2026-10-25 | | Update method | documented tree replacement: 3-way `git merge-tree` of the old subtree against the new upstream, base = the old pin (see "How this update was made") | -| Hosted project repository URL | https://github.com/paveldhq/strata-next (private) | +| Hosted project repository URL | https://github.com/paveldhq/leleka-api (private) | | Engine build instructions | `scripts/build-cpu.sh` for source checks (needs network once: it fetches llama.cpp `3cf03257f` through CMake FetchContent); CUDA builds: see `deploy/README.md` and `docs/build-validation.md`. Upstream's `packaging/build_cuda_linux.sh` and `packaging/build_dsv41_cuda.sh` are the reference recipes and have not been run here | ## Pin history diff --git a/docs/windows-runtime.md b/docs/windows-runtime.md index 7ea14df0..673c5ab2 100644 --- a/docs/windows-runtime.md +++ b/docs/windows-runtime.md @@ -6,7 +6,7 @@ serving needs no Python and no CUDA. Linux x64 builds and passes its unit tests ## What it is -`strata-next serve` (control plane) exposes `POST /v1/responses` (and `/health`, `/ready`) and supervises one worker +`leleka-api serve` (control plane) exposes `POST /v1/responses` (and `/health`, `/ready`) and supervises one worker process that decodes gpt-oss-20b-MXFP4 on the CPU (AVX-VNNI / AVX2 / portable kernels, chosen at run time). | worker | long prompts (prefill) | decode | notes | @@ -32,7 +32,7 @@ Runs `deploy/Dockerfile.windows-build`: a Linux container cross-compiles the six `dist\leleka-windows-x64.zip` (about 23 MB: `bin\*.exe`, `Start-Leleka.ps1`, `README.txt`, `SHA256SUMS.txt`). The first build downloads the Rust and mingw packages (a few minutes). Docker Desktop's VM takes several GB of RAM while it runs: stop it (`docker desktop stop`) before measuring anything. A native build with the MSVC toolchain -(`cargo build --release -p strata-control -p leleka-cpu-worker ...`) also works where Visual Studio Build Tools exist. +(`cargo build --release -p leleka-control-plane -p leleka-cpu-worker ...`) also works where Visual Studio Build Tools exist. ## Run diff --git a/docs/windows.md b/docs/windows.md index 12432f96..fcbdb92c 100644 --- a/docs/windows.md +++ b/docs/windows.md @@ -6,7 +6,7 @@ Branch `claude/windows`. Two routes, both started by the same `leleka.exe`: `leleka.exe` is the Windows front end: it starts the Linux `leleka` through `wsl.exe`, translates paths, checks `%UserProfile%\.wslconfig`, and reads status / sends `reconfigure` / stops the service from Windows over the loopback HTTP that WSL2 forwards. -* **Route B, the native engine.** No WSL: `leleka-inference.exe` (engine), `leleka-daemon.exe` (gateway) and `strata-next.exe` +* **Route B, the native engine.** No WSL: `leleka-inference.exe` (engine), `leleka-daemon.exe` (gateway) and `leleka-api.exe` (API) run as Windows processes under `leleka.exe run`. The Windows primitives replace the Linux ones: `nvcuda.dll` for `libcuda.so.1`, read-only file mappings for `mmap`, `VirtualLock` for `mlock`, `GlobalMemoryStatusEx` / `GetProcessMemoryInfo` for `/proc`, Ctrl-C and a stop file for signals. @@ -19,7 +19,7 @@ No performance claim is made anywhere in this document; nothing here has a quali | --- | --- | --- | | A. WSL2 bridge, real | **Works with the model** (2026-10-25): `up` to ready, one request, `status`, `reconfigure --prefix-cache-tail prompt`, a second request, `down` | section "Measured on this laptop" | | B. native engine, real | **Works with the model** (2026-10-25): staged volume, pins verified, `up --native --foreground` to ready (engine load 80-128 s), requests answered, `status`, `reconfigure`, `down`. Needed two fixes (MTP ranged reads, child shutdown), both committed | section "Measured on this laptop" | -| Whole tree builds and tests natively | `leleka-deploy` 116 unit + 2 Windows end-to-end + 5 recipe tests, control-plane, `leleka-runtime`, `strata-desktop-core`, `leleka-memory`, `leleka-model-format` and the rest of the workspace pass. Failures, also on Linux: `arch_ptx` (`chain_window.ptx` has no sm_86 record). `experimental-ref` `literal_port` (4 tests, kernel sources moved with the upstream sync) passes again since the 2026-11-03 re-sync | `cargo test --workspace` on Windows; Linux `cargo check --release --workspace --tests` and `cargo test -p leleka-deploy --features test-fakes` in WSL | +| Whole tree builds and tests natively | `leleka-deploy` 116 unit + 2 Windows end-to-end + 5 recipe tests, control-plane, `leleka-runtime`, `leleka-engine-host`, `leleka-memory`, `leleka-model-format` and the rest of the workspace pass. Failures, also on Linux: `arch_ptx` (`chain_window.ptx` has no sm_86 record). `experimental-ref` `literal_port` (4 tests, kernel sources moved with the upstream sync) passes again since the 2026-11-03 re-sync | `cargo test --workspace` on Windows; Linux `cargo check --release --workspace --tests` and `cargo test -p leleka-deploy --features test-fakes` in WSL | | native supervisor, test doubles | start, readiness, `status`, `reconfigure` (HTTP and engine restart), Ctrl-Break drain, stop-file shutdown | `crates/deploy/tests/e2e_windows.rs` | | `leleka service` (Task Scheduler / user unit) | Task XML generated, unit-tested and **reviewed from `service install --dry-run`** on this machine; **never registered** (not authorized) | `service.rs` tests | | `stage-model.ps1`, `fetch-cublas.ps1` | **Both run for real**: the cuBLAS download (524 MiB, 18 s) matched the SHA-256 pin; the staging copied 138 GB in 614 s; the refusal path of `fetch-cublas.ps1` was also verified with wrong archives | measured section | @@ -27,7 +27,7 @@ No performance claim is made anywhere in this document; nothing here has a quali Known limits (all of them apply to route B unless stated): -* **Model volume is not built or downloaded on Windows.** `strata-next model fetch` / archive preparation / `service-install` are +* **Model volume is not built or downloaded on Windows.** `leleka-api model fetch` / archive preparation / `service-install` are Unix-only. Prepare the shards, the KAR archive, the MTP pack and the expert profile on the WSL disk (or copy a finished volume), then copy them to a Windows disk (section "Model files"). * **Only the file-backed form**: the profile must be `rtx3080-16g` (`kar_source=file`, `expert_source=mapped`). The sealed-memfd form @@ -53,7 +53,7 @@ Known limits (all of them apply to route B unless stated): * Windows 11, NVIDIA driver >= 595 (this laptop: 617.42). Nothing else from NVIDIA is needed for route A; no CUDA toolkit and no `nvcc` for either route (every PTX image is sealed in the repository). * Rust 1.99 for `x86_64-pc-windows-msvc` (the repository pins it in `rust-toolchain.toml`) and the Visual Studio Build Tools - (MSVC linker and `cl.exe`; `strata-next` compiles a small C bridge). + (MSVC linker and `cl.exe`; `leleka-api` compiles a small C bridge). * Route A: WSL2 with an Ubuntu distribution that has Rust 1.99 and a C toolchain (`gcc`), the NVIDIA Windows driver (WSL2 gets the GPU from it), `%UserProfile%\.wslconfig` with `memory=40GB` and `swap=8GB` (what this laptop has; `leleka doctor` judges it). * Route B: the two CUDA 12 cuBLAS DLLs (below). @@ -69,7 +69,7 @@ powershell -ExecutionPolicy Bypass -File scripts\windows\build-release.ps1 cargo build --release --locked -p leleka-deploy --bin leleka # -> target\release\leleka.exe ``` -`dist\bin` gets `leleka.exe`, `strata-next.exe`, `leleka-inference.exe`, `leleka-daemon.exe`, `leleka-cli.exe` and a stub +`dist\bin` gets `leleka.exe`, `leleka-api.exe`, `leleka-inference.exe`, `leleka-daemon.exe`, `leleka-cli.exe` and a stub `leleka-seal-exec.exe` (prints "requires Linux"; nothing runs it). The first full release build takes a while (`leleka-inference.exe` is ~140 MB). ### Linux binaries for route A (inside WSL) @@ -79,7 +79,7 @@ The Linux `leleka` needs its five sibling programs next to it; build them in WSL ```powershell wsl -d Ubuntu -- bash -lc "mkdir -p ~/leleka-src && cd /mnt/c/Users/pavel/work/leleka-windows && git ls-files -co --exclude-standard -z | tar --null -T - -cf - | tar -xf - -C ~/leleka-src" -wsl -d Ubuntu -- bash -lc "cd ~/leleka-src && source ~/.cargo/env && cargo build --release --locked -p strata-desktop-core --features sm86 --bin leleka-inference --bin leleka-daemon --bin leleka-cli --bin leleka-seal-exec && cargo build --release --locked -p strata-control --bin strata-next && cargo build --release --locked -p leleka-deploy --bin leleka" +wsl -d Ubuntu -- bash -lc "cd ~/leleka-src && source ~/.cargo/env && cargo build --release --locked -p leleka-engine-host --features sm86 --bin leleka-inference --bin leleka-daemon --bin leleka-cli --bin leleka-seal-exec && cargo build --release --locked -p leleka-control-plane --bin leleka-api && cargo build --release --locked -p leleka-deploy --bin leleka" ``` The result is `~/leleka-src/target/release/` (six programs). `leleka.exe` finds `leleka` there (it also looks in @@ -103,7 +103,7 @@ ASSETS\tokenizer-assets\ (made by **Route A: the volume must be on the WSL ext4 disk** (not `/mnt/c`: 9p is far too slow for mapped reads; `leleka.exe` refuses `--assets` under `/mnt//`). This laptop's existing `~/laptop` volume has the archive inside `model/`, and the tools want real regular files -at the leleka layout: `strata-next model fetch` refuses symlinks ("refusing symlink") and the engine admits only a regular, single-link archive, +at the leleka layout: `leleka-api model fetch` refuses symlinks ("refusing symlink") and the engine admits only a regular, single-link archive, so neither a symlink nor a hard link is a substitute. What was done (nothing in `~/laptop` was touched; needs 140 GB free on the WSL disk, 578 GB were): ```powershell @@ -198,7 +198,7 @@ It needs steps 1 and 2 first. It was run for real (138 GB, 614 s, layout checks What `up --native` does: preflight with Windows facts (`nvidia-smi.exe`, `GlobalMemoryStatusEx`, `GetDiskFreeSpaceEx`, DLL search for `nvcuda.dll` / `cublas64_12.dll`), checks that the two shards and the archive are on the volume with their pinned sizes (it never downloads or -builds), installs the five `.exe` files into `%LOCALAPPDATA%\leleka\bin`, generates the tokens and the API key (`strata-next api-key init`), +builds), installs the five `.exe` files into `%LOCALAPPDATA%\leleka\bin`, generates the tokens and the API key (`leleka-api api-key init`), extracts the tokenizer from shard 1, writes `leleka.json` / `daemon.json` / `strata.json` / `runtime.env` in `%LOCALAPPDATA%\leleka\state`, and runs the supervisor (`leleka.exe run`): gateway, engine, typed `load-mtp`, API, `/ready`. Logs are in `...\state\logs\{leleka,engine,gateway,api}.log`. The cuBLAS directory reaches the engine through `LELEKA_DLL_DIRS` (the loader flags used by the engine do not search `PATH`). @@ -231,8 +231,8 @@ on the supervisor). Highest GPU temperature seen: 57 C; no throttling, no P5 und | | Route A (WSL2 bridge, Linux engine) | Route B (native Windows engine) | | --- | --- | --- | -| volume | `~/leleka-assets` on ext4: shards and archive **copied** (`cp`, 83 GB + 55 GB; symlinks are refused by `strata-next model fetch`: "refusing symlink"), MTP pack copied, expert profile copied. `~/laptop` untouched | `C:\leleka\assets`, 138 GB copied by `stage-model.ps1` in **614 s** (about 0.22 GB/s over the 9p share), layout checks passed | -| pinned digests | `leleka up --mode none --trust-archive` (installs, verifies both shards with `strata-next model verify`): **600 s** cold | `leleka.exe verify --native`: both shards and the archive hashed in parallel in **46 s** (the files had just been written, so partly cached) | +| volume | `~/leleka-assets` on ext4: shards and archive **copied** (`cp`, 83 GB + 55 GB; symlinks are refused by `leleka-api model fetch`: "refusing symlink"), MTP pack copied, expert profile copied. `~/laptop` untouched | `C:\leleka\assets`, 138 GB copied by `stage-model.ps1` in **614 s** (about 0.22 GB/s over the 9p share), layout checks passed | +| pinned digests | `leleka up --mode none --trust-archive` (installs, verifies both shards with `leleka-api model verify`): **600 s** cold | `leleka.exe verify --native`: both shards and the archive hashed in parallel in **46 s** (the files had just been written, so partly cached) | | start to ready | `leleka.exe up` (user unit, stamps current): **266 s** wall (engine load not printed separately) | `leleka.exe up --native --foreground`: engine load **127.7 s** (first start), **79.9 s** (second start, warm file cache); `model loaded` in 82 s | | request 1 | 59 in / 31 out (22 reasoning): **47.8 s** (first request after start) | 59 in / 48 out (all reasoning, hit the cap): **18.4 s**; run 3: **17.1 s** | | `reconfigure --prefix-cache-tail prompt` | worked; settings echo shows `tail prompt` | worked, **17.1 s** to reopen the serve stack | @@ -247,7 +247,7 @@ What broke on the way and what was done (each is a commit on `claude/windows` wi `qwen4exp_mtp.rs`) had only a Unix `read_exact_at`; the Windows arm returned `UnsupportedKind`. Fixed with `seek_read` (`53a7666`). Everything after it loaded: the mapped 83 GB shards (file mappings), the 55 GB archive read through `seek_read`, `nvcuda.dll`, the sm_86 PTX companions, the expert tier (13,162 VRAM slots + profile fill), the MTP draft, the serve stack. 2. **`leleka down --native` took 94 s**: the supervisor stopped its children with SIGINT, which does not exist on Windows (`interrupt()` was a no-op), so each of the API, the gateway and the - engine was killed after its 30 s grace. Now the children run in their own process groups and are stopped in order with Ctrl-Break; `leleka-inference`, `leleka-daemon` and `strata-next` + engine was killed after its 30 s grace. Now the children run in their own process groups and are stopped in order with Ctrl-Break; `leleka-inference`, `leleka-daemon` and `leleka-api` handle Ctrl-Break like Ctrl-C (`tokio::signal::windows::ctrl_break`). `down` takes 6 s with the real engine; the Windows end-to-end test now asserts it finishes in under 25 s. 3. `leleka up --mode none` printed the "reachable from Windows" summary although nothing was started: fixed. 4. `stage-model.ps1`: with the output redirected, robocopy wrote a line per percent point (thousands of lines): it adds `/NP` then. @@ -347,8 +347,8 @@ All flags: `--context-tokens 1..262144`, `--prefill-capacity 256..8192`, `--kv-r | `step kar is blocked ... must already be on the model volume` (native) | `scripts\windows\stage-model.ps1 -Dest ...` (puts the archive and its `.provenance.json` at the root of the volume); `leleka doctor --assets DIR` names each missing file | | `status` says `ready: false` and the distribution is stopped | start the service again with `leleka up`; keep a `wsl` window open | | native `up` fails the preflight with `memory: 0.0 GiB available` / below 10 GiB | WSL2 still holds the RAM (`vmmemWSL`): `wsl --shutdown`, or wait a few seconds after a big copy, then rerun | -| `strata-next model fetch`: `refusing symlink` (WSL volume) | the shards must be real files in `model/`; copy them (`cp`), do not link them | -| `strata-next doctor` fails on Windows ("requires Linux") | expected: that check is Linux-only | +| `leleka-api model fetch`: `refusing symlink` (WSL volume) | the shards must be real files in `model/`; copy them (`cp`), do not link them | +| `leleka-api doctor` fails on Windows ("requires Linux") | expected: that check is Linux-only | | the API refuses with `max_output_tokens` | fixed on this branch: `strata.json` now uses `min(32768, context-1)` (8191 on the laptop); rerun `up` to rewrite the config | ## Where the code is diff --git a/gpu/kar/README.md b/gpu/kar/README.md index 651ba9c3..6f4b352e 100644 --- a/gpu/kar/README.md +++ b/gpu/kar/README.md @@ -87,7 +87,7 @@ the median over the requested repeats. The first native gather may incur storage page faults, while KAR opening already scanned the archive; compare the warm medians and report first-run times separately. -For a model-free reader check, run `strata-next model ple-smoke-fixture --output +For a model-free reader check, run `leleka-api model ple-smoke-fixture --output /tmp/ple-smoke.kar`, then `strata_next_kar_ple_probe /tmp/ple-smoke.kar 2 --expected-rows 4 0 1 2 3`. The four checksums must match those printed by the Rust fixture command. Remove the temporary archive afterward. @@ -97,13 +97,13 @@ the Rust fixture command. Remove the temporary archive afterward. On Linux with CUDA 13 and a supported NVIDIA GPU, create a model-free fixture and compare its CPU and GPU decode checksums: ```sh -strata-next model smoke-fixture --output /tmp/strata-smoke.kar +leleka-api model smoke-fixture --output /tmp/strata-smoke.kar cmake -S gpu/kar -B artifacts/kar-gpu-build -G Ninja -DCMAKE_CUDA_ARCHITECTURES=120 cmake --build artifacts/kar-gpu-build --target strata-kar-gpu-smoke artifacts/kar-gpu-build/strata-kar-gpu-smoke /tmp/strata-smoke.kar smoke.expert 2 30 -strata-next model checksum-kar-preview /tmp/strata-smoke.kar smoke.expert 2 +leleka-api model checksum-kar-preview /tmp/strata-smoke.kar smoke.expert 2 artifacts/kar-gpu-build/strata-kar-gpu-smoke /tmp/strata-smoke.kar smoke.expert 2 30 --row 0 -strata-next model checksum-kar-row /tmp/strata-smoke.kar smoke.expert 2 --row 0 +leleka-api model checksum-kar-row /tmp/strata-smoke.kar smoke.expert 2 --row 0 ``` An optional fifth argument is an overlay archive. The smoke target opens both @@ -112,7 +112,7 @@ and every replacement's name, shape, source dtype, source digest, and source offset, then reserves and decodes the requested tensor from the overlay when it is present there. It prints `source=base` or `source=overlay`. For a real overlay, first run -`strata-next model resolve-kar-overlay --base BASE.kar --overlay OVERLAY.kar`: +`leleka-api model resolve-kar-overlay --base BASE.kar --overlay OVERLAY.kar`: that Rust verifier additionally checks complete archive SHA-256 values and provenance. Keep both files unchanged between resolution and this smoke run. The smoke target alone does not authenticate the archive files against diff --git a/integrations/codex-qwen/README.md b/integrations/codex-qwen/README.md index 14916fa8..a7eb654d 100644 --- a/integrations/codex-qwen/README.md +++ b/integrations/codex-qwen/README.md @@ -16,10 +16,10 @@ On this development laptop both aliases have been installed and share the same configuration and Responses adapter. ```sh -qwen-codex-ctl start strata-next-v-only --kv-mode without-key --layout 1x256 --kv-cache q8_0 +qwen-codex-ctl start leleka-api-v-only --kv-mode without-key --layout 1x256 --kv-cache q8_0 qwen-codex qwen-codex-ctl stop -qwen-codex-ctl start strata-next-baseline --kv-mode with-key --layout 1x256 --kv-cache q8_0 +qwen-codex-ctl start leleka-api-baseline --kv-mode with-key --layout 1x256 --kv-cache q8_0 ``` This is an experiment entry point. A profile being loadable does not mean its diff --git a/scripts/bench-chat-sequential-server.py b/scripts/bench-chat-sequential-server.py index 437eb79c..5b3bba54 100644 --- a/scripts/bench-chat-sequential-server.py +++ b/scripts/bench-chat-sequential-server.py @@ -72,7 +72,7 @@ def arm(name, exe, config, args): if name == "candidate": cfg["args"] += ["--ple-kar", str(args.kar), "--ple-kar-level", "2"] cfg["log"] = str(args.output_dir / f"{name}-engine.log") - fd, config_name = tempfile.mkstemp(prefix="strata-next-ab-", suffix=".json", dir=args.tmpfs) + fd, config_name = tempfile.mkstemp(prefix="leleka-api-ab-", suffix=".json", dir=args.tmpfs) temp_config = Path(config_name) process = None model_loaded = False diff --git a/scripts/build-linux-package.py b/scripts/build-linux-package.py index b706c4e3..e2cb7a65 100644 --- a/scripts/build-linux-package.py +++ b/scripts/build-linux-package.py @@ -20,7 +20,7 @@ import uuid REPO = Path(__file__).resolve().parents[1] TARGET = 'x86_64-unknown-linux-musl' -NAME = 'strata-next-linux-x86_64-musl' +NAME = 'leleka-api-linux-x86_64-musl' LIMIT = 1024 ** 3 @@ -233,12 +233,12 @@ def assemble(args): CARGO_TARGET_DIR=str(target_dir), CUDA_VISIBLE_DEVICES='') env.pop('LD_LIBRARY_PATH', None) subprocess.run(['cargo', 'build', '--manifest-path', str(REPO / 'control-plane/Cargo.toml'), - '--locked', '--release', '--target', TARGET, '--bin', 'strata-next'], + '--locked', '--release', '--target', TARGET, '--bin', 'leleka-api'], env=env, check=True) published = stage / 'package' published.mkdir(mode=0o700) binary = published / NAME - shutil.copyfile(target_dir / TARGET / 'release/strata-next', binary) + shutil.copyfile(target_dir / TARGET / 'release/leleka-api', binary) binary.chmod(0o700) outer = static_outer(binary) probe_env = {'PATH': os.defpath, 'CUDA_VISIBLE_DEVICES': ''} diff --git a/scripts/build-runtime-image.py b/scripts/build-runtime-image.py index a67b400c..286a40e3 100644 --- a/scripts/build-runtime-image.py +++ b/scripts/build-runtime-image.py @@ -14,7 +14,7 @@ import tempfile import uuid REPO = Path(__file__).resolve().parents[1] -NAME = 'strata-next-linux-x86_64-musl' +NAME = 'leleka-api-linux-x86_64-musl' FILES = {NAME, 'PROVENANCE.json', 'SHA256SUMS'} # Official Ubuntu 26.04 linux/amd64 manifest, observed 2026-10-04; glibc is probed. BASE = 'ubuntu@sha256:88a381d5b5eeb2b35d3ad70925a362c37ce569daf43ede89ff818ec20e4d3794' @@ -52,7 +52,7 @@ def freeze(package, stage, receipt_sha, cpu_fixture): raise ValueError('pinned receipt SHA256 mismatch') hashes = {} for line in (stage / 'SHA256SUMS').read_text().splitlines(): - match = re.fullmatch(r'([0-9a-f]{64}) (strata-next-linux-x86_64-musl|PROVENANCE.json)', line) + match = re.fullmatch(r'([0-9a-f]{64}) (leleka-api-linux-x86_64-musl|PROVENANCE.json)', line) if not match or match[2] in hashes: raise ValueError('invalid or duplicate receipt entry') hashes[match[2]] = match[1] diff --git a/scripts/check-kar-cuda-records.py b/scripts/check-kar-cuda-records.py index a2e6d2b6..df100688 100755 --- a/scripts/check-kar-cuda-records.py +++ b/scripts/check-kar-cuda-records.py @@ -44,7 +44,7 @@ def main(): parser.add_argument("--records-json", type=pathlib.Path, required=True, help="JSON with records containing name and elements") parser.add_argument("--cpu", type=pathlib.Path, required=True, - help="strata-next CLI executable") + help="leleka-api CLI executable") parser.add_argument("--gpu", type=pathlib.Path, required=True, help="strata-kar-gpu-smoke executable") parser.add_argument("--level", type=int, required=True) diff --git a/scripts/check-local.sh b/scripts/check-local.sh index 39a78a8f..ecb8eadf 100755 --- a/scripts/check-local.sh +++ b/scripts/check-local.sh @@ -5,7 +5,7 @@ # scripts/check-local.sh --fast only the fast path (seconds to a few minutes, works on macOS) # scripts/check-local.sh --port fast path, Linux type-check and the CPU oracle differentials of the Rust port # scripts/check-local.sh --product what ships (docs/ci-audit.md): the CI coverage gate, a build of every default-member, -# the release build of the six product binaries (leleka, strata-next, leleka-inference, +# the release build of the six product binaries (leleka, leleka-api, leleka-inference, # leleka-daemon, leleka-cli, leleka-seal-exec), the tests of the product crates, the # type-check of the CUDA-feature crates, Clippy and rustfmt (known debt is reported) # scripts/check-local.sh --clippy-limits opt-in, slow: ratchet of the Clippy length/complexity/argument lints (STRA-367, @@ -99,8 +99,8 @@ port_oracles() { # OFFLINE_ORACLE_PYTHON=/venv/bin/python STRATA_GGUF_PY=/llama.cpp/gguf-py scripts/check-local.sh offline_oracles() { if [[ -n "${OFFLINE_ORACLE_PYTHON:-}" && -n "${STRATA_GGUF_PY:-}" ]]; then - cargo build --manifest-path "${repo_root}/Cargo.toml" --locked -p strata-control --bin strata-next - local strata_next="${CARGO_TARGET_DIR:-${repo_root}/target}/debug/strata-next" + cargo build --manifest-path "${repo_root}/Cargo.toml" --locked -p leleka-control-plane --bin leleka-api + local strata_next="${CARGO_TARGET_DIR:-${repo_root}/target}/debug/leleka-api" local oracle for oracle in native_pack gguf_header tokenizer dequant tools mtp_fetch chat_template; do "${OFFLINE_ORACLE_PYTHON}" "${repo_root}/scripts/offline/diff_${oracle}.py" "${strata_next}" @@ -146,12 +146,12 @@ product_path() { gate cargo build "${manifest[@]}" echo "== product: release build of the six shipped binaries (docs/deploy.md section 8)" gate cargo build "${manifest[@]}" --release -p leleka-deploy --bin leleka - gate cargo build "${manifest[@]}" --release -p strata-control --bin strata-next - gate cargo build "${manifest[@]}" --release -p strata-desktop-core --features sm86 \ + gate cargo build "${manifest[@]}" --release -p leleka-control-plane --bin leleka-api + gate cargo build "${manifest[@]}" --release -p leleka-engine-host --features sm86 \ --bin leleka-inference --bin leleka-daemon --bin leleka-cli --bin leleka-seal-exec local out="${CARGO_TARGET_DIR:-${repo_root}/target}/release" exe="" bin [[ "${host_os}" == Linux ]] || exe=".exe" - for bin in leleka strata-next leleka-inference leleka-daemon leleka-cli leleka-seal-exec; do + for bin in leleka leleka-api leleka-inference leleka-daemon leleka-cli leleka-seal-exec; do [[ -x "${out}/${bin}${exe}" ]] || { echo "missing release binary: ${out}/${bin}${exe}" >&2; failed+=("missing release binary ${bin}"); } done echo "== product: type-check the CUDA-feature crates (nothing is executed on a GPU)" @@ -167,7 +167,7 @@ product_path() { local host_tests=(dry_run_prints_the_plan_and_changes_nothing a_failing_preflight_stops_before_any_change_and_says_how_to_fix_it) PATH="${smi_path}" gate cargo test "${manifest[@]}" --no-fail-fast -p leleka-deploy --features test-fakes -- --skip "${host_tests[0]}" --skip "${host_tests[1]}" PATH="${smi_path}" gate debt cargo test "${manifest[@]}" -p leleka-deploy --features test-fakes --test e2e -- "${host_tests[@]}" - gate cargo test "${manifest[@]}" --no-fail-fast -p leleka-memory -p leleka-memory-os -p leleka-runtime-client -p leleka-gateway-text -p leleka-gateway-domain -p leleka-worker-protocol -p leleka-engine-core -p leleka-engine-fake -p strata-control -p strata-desktop-core + gate cargo test "${manifest[@]}" --no-fail-fast -p leleka-memory -p leleka-memory-os -p leleka-runtime-client -p leleka-gateway-text -p leleka-gateway-domain -p leleka-worker-protocol -p leleka-engine-core -p leleka-engine-fake -p leleka-control-plane -p leleka-engine-host gate cargo test "${manifest[@]}" --no-fail-fast -p leleka-cuda-model gate cargo test "${manifest[@]}" --no-fail-fast -p leleka-cuda-driver --features cuda-driver gate cargo test "${manifest[@]}" --no-fail-fast -p leleka-engine-qwen35-cuda -p leleka-native-cpu-expert @@ -179,9 +179,9 @@ product_path() { echo "== product: rustfmt and Clippy on the shipped crates" # Clean today, so they are hard gates: the control plane, the desktop-core binaries and the runtime client for rustfmt; these plus the # memory governor and the deploy tool for Clippy (-D warnings). - gate cargo fmt -p strata-control -p strata-desktop-core -p leleka-runtime-client --check + gate cargo fmt -p leleka-control-plane -p leleka-engine-host -p leleka-runtime-client --check local crate - for crate in leleka-memory leleka-memory-os leleka-runtime-client strata-control strata-desktop-core leleka-deploy; do + for crate in leleka-memory leleka-memory-os leleka-runtime-client leleka-control-plane leleka-engine-host leleka-deploy; do gate cargo clippy "${manifest[@]}" -p "${crate}" --all-targets --no-deps -- -D warnings done # Known debt (docs/ci-audit.md lists the counts); STRICT_DEBT=1 makes it fatal. Other agents own these sources. diff --git a/scripts/ci-coverage.json b/scripts/ci-coverage.json index d2bc77a6..3412bb09 100644 --- a/scripts/ci-coverage.json +++ b/scripts/ci-coverage.json @@ -17,8 +17,8 @@ "leleka-gateway-text", "leleka-gateway-domain", "leleka-worker-protocol", - "strata-control", - "strata-desktop-core", + "leleka-control-plane", + "leleka-engine-host", "leleka-cuda-driver", "leleka-cuda-model", "leleka-engine-core", diff --git a/scripts/cp/live-ab.sh b/scripts/cp/live-ab.sh index 3803cdf5..83341fcd 100644 --- a/scripts/cp/live-ab.sh +++ b/scripts/cp/live-ab.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Runs inside run-e2e.sh (as E2E_RUN_CMD, so inside a holder job, with the engine loaded and the current strata-next on :8081): -# starts the BASELINE strata-next (commit dbf487b logic) on :8082 against the same engine and replays one synthesized Codex session +# Runs inside run-e2e.sh (as E2E_RUN_CMD, so inside a holder job, with the engine loaded and the current leleka-api on :8081): +# starts the BASELINE leleka-api (commit dbf487b logic) on :8082 against the same engine and replays one synthesized Codex session # (scripts/cp/synth_session.py) alternately through the two, then joins the client's timings with the servers' stage logs. # Test tooling only; no credential is printed (keys are read from files). set -uo pipefail @@ -15,13 +15,13 @@ TURNS=${CP_TURNS:-20} MAXOUT=${CP_MAX_OUT:-64} sed 's/127.0.0.1:8081/127.0.0.1:8082/' "$STATE/strata.json" >"$STATE/strata-base.json" [ "$(grep -c 8082 "$STATE/strata-base.json")" = 1 ] || { echo "could not derive the baseline config"; exit 3; } -STRATA_STAGE_TRACE=log "$BINS/strata-next-base" serve --config "$STATE/strata-base.json" >"$OUT/strata-base.log" 2>&1 & +STRATA_STAGE_TRACE=log "$BINS/leleka-api-base" serve --config "$STATE/strata-base.json" >"$OUT/strata-base.log" 2>&1 & PID_BASE=$! -if ! "$BINS/strata-next-base" wait-ready --url http://127.0.0.1:8082 --model qwen-iq3 --key-file "$STATE/api-key" --timeout-s 180 >"$OUT/wait-ready-base.log" 2>&1; then - echo "baseline strata-next never became ready"; tail -20 "$OUT/wait-ready-base.log" "$OUT/strata-base.log"; kill -INT $PID_BASE 2>/dev/null; exit 6 +if ! "$BINS/leleka-api-base" wait-ready --url http://127.0.0.1:8082 --model qwen-iq3 --key-file "$STATE/api-key" --timeout-s 180 >"$OUT/wait-ready-base.log" 2>&1; then + echo "baseline leleka-api never became ready"; tail -20 "$OUT/wait-ready-base.log" "$OUT/strata-base.log"; kill -INT $PID_BASE 2>/dev/null; exit 6 fi echo "both servers ready: $(date -u +%T)" -sha256sum "$BINS"/strata-next-base "$BINS"/strata-next-new "$BINS"/leleka-inference "$BINS"/cp_replay | cut -c1-16,65- +sha256sum "$BINS"/leleka-api-base "$BINS"/leleka-api-new "$BINS"/leleka-inference "$BINS"/cp_replay | cut -c1-16,65- "$BINS/cp_replay" "$TOK" "$SESSION" --live http://127.0.0.1:8081,http://127.0.0.1:8082 --names new,base --key-file "$STATE/api-key" \ --size "$SIZE" --turns "$TURNS" --max-output-tokens "$MAXOUT" >"$OUT/live.txt" 2>"$OUT/live.err" RC=$? @@ -29,6 +29,6 @@ cat "$OUT/live.err" | tail -5 kill -INT $PID_BASE 2>/dev/null for _ in $(seq 1 20); do kill -0 $PID_BASE 2>/dev/null || break; sleep 1; done kill -KILL $PID_BASE 2>/dev/null -python3 -I "$HERE/live_report.py" "$OUT/live.txt" new="$OUT/strata-next.log" base="$OUT/strata-base.log" | tee "$OUT/live-report.txt" +python3 -I "$HERE/live_report.py" "$OUT/live.txt" new="$OUT/leleka-api.log" base="$OUT/strata-base.log" | tee "$OUT/live-report.txt" echo "cp_replay exit status $RC" exit $RC diff --git a/scripts/cp/live_report.py b/scripts/cp/live_report.py index 8467383f..465108d4 100644 --- a/scripts/cp/live_report.py +++ b/scripts/cp/live_report.py @@ -4,7 +4,7 @@ live_report.py LIVE.txt ARM=SERVER_LOG [ARM=SERVER_LOG ...] LIVE.txt holds `LIVE {json}` lines (one per request, with the client's unix-ms send/done times). Each SERVER_LOG is the stderr of a -`strata-next serve` run with STRATA_STAGE_TRACE=log: `stage NAME MS t_unix_ms=END`, `generation start: t_unix_ms=T ...` and +`leleka-api serve` run with STRATA_STAGE_TRACE=log: `stage NAME MS t_unix_ms=END`, `generation start: t_unix_ms=T ...` and `generation done: ... prompt_ms=P ...` lines. A turn is joined with the lines of its arm's log that fall inside [send, done]. Per turn the client's time to the first token splits into diff --git a/scripts/cp/run-ab.sh b/scripts/cp/run-ab.sh index dad31bc5..f926d7d3 100644 --- a/scripts/cp/run-ab.sh +++ b/scripts/cp/run-ab.sh @@ -12,8 +12,8 @@ set -euo pipefail BASE=$1 NEW=$2 TOK=$3 SESSION=$4 OUT=$5; REPS=${6:-3}; shift 6 2>/dev/null || shift $# mkdir -p "$OUT" build() { # tree target - ( cd "$1" && CARGO_TARGET_DIR="$2" cargo build --locked --release -p strata-control --example cp_replay \ - && CARGO_TARGET_DIR="$2" cargo build --locked --release -p strata-desktop-core --example cp_replay_grpc ) >&2 + ( cd "$1" && CARGO_TARGET_DIR="$2" cargo build --locked --release -p leleka-control-plane --example cp_replay \ + && CARGO_TARGET_DIR="$2" cargo build --locked --release -p leleka-engine-host --example cp_replay_grpc ) >&2 } TB=${CARGO_TARGET_DIR_BASE:-$BASE/target-ab} TN=${CARGO_TARGET_DIR_NEW:-$NEW/target-ab} diff --git a/scripts/decode-sm120/build_stack.sh b/scripts/decode-sm120/build_stack.sh index 75fe2ab5..613487ab 100644 --- a/scripts/decode-sm120/build_stack.sh +++ b/scripts/decode-sm120/build_stack.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Build the four stack binaries of THIS worktree in WSL (never on the server) and print their sha256. # scripts/decode-sm120/build_stack.sh TAG run from Git Bash in the worktree; needs WSL distro "Ubuntu" -# Result: WSL ~/sm120-stack/TAG/{leleka-inference,leleka-daemon,leleka-cli,strata-next}; copy to rnr5090:/data/leleka-e2e/sm120/stack-TAG/. +# Result: WSL ~/sm120-stack/TAG/{leleka-inference,leleka-daemon,leleka-cli,leleka-api}; copy to rnr5090:/data/leleka-e2e/sm120/stack-TAG/. set -euo pipefail tag=${1:?tag} root=$(git rev-parse --show-toplevel) @@ -15,8 +15,8 @@ export PATH=\$HOME/cuda-toolkits/13.2.2/bin:\$HOME/.cargo/bin:/usr/local/bin:/us rm -rf ~/sm120-src && mkdir -p ~/sm120-src ~/sm120-stack/$tag && tar -xf '$tar_wsl' -C ~/sm120-src cd ~/sm120-src export CARGO_TARGET_DIR=\$HOME/sm120-target-rel -nice -n 10 cargo build --release --locked -p strata-desktop-core --bin leleka-inference --bin leleka-daemon --bin leleka-cli -p strata-control --bin strata-next > ~/sm120-stack/build-$tag.log 2>&1 -for b in leleka-inference leleka-daemon leleka-cli strata-next; do cp \$CARGO_TARGET_DIR/release/\$b ~/sm120-stack/$tag/\$b; done +nice -n 10 cargo build --release --locked -p leleka-engine-host --bin leleka-inference --bin leleka-daemon --bin leleka-cli -p leleka-control-plane --bin leleka-api > ~/sm120-stack/build-$tag.log 2>&1 +for b in leleka-inference leleka-daemon leleka-cli leleka-api; do cp \$CARGO_TARGET_DIR/release/\$b ~/sm120-stack/$tag/\$b; done sha256sum ~/sm120-stack/$tag/* | tee ~/sm120-stack/$tag/SHA256SUMS git -C ~/sm120-src log -1 --format=%H 2>/dev/null || true " diff --git a/scripts/dev/rename_strata_names.py b/scripts/dev/rename_strata_names.py new file mode 100644 index 00000000..8214b053 --- /dev/null +++ b/scripts/dev/rename_strata_names.py @@ -0,0 +1,55 @@ +"""Stage 9 of docs/experiments/plan-faster-than-strata.md: the historical Strata names in our own code become ours. + + strata-next -> leleka-api (the gateway binary of control-plane/) + strata-control -> leleka-control-plane (the crate of control-plane/) + strata-desktop-core -> leleka-engine-host (the crate of desktop-core/: it hosts the engine process leleka-inference + and the node, pool and gateway services around it) + +The `STRATA_*` environment variables stay (the language shared with the Original). Not touched: `engine/strata` (the +Original, including its Python package `strata_control`), the experiment records and measured data, `*.patch` files and +`docs/upstream/` (diffs against the Original), `Cargo.lock` (regenerate it with `cargo metadata --offline`). +The underscore forms (`strata_control`, `strata_desktop_core`) are the crate identifiers and change in `.rs` and `.toml` +files only. Usage: python scripts/dev/rename_strata_names.py [--dry-run] +""" +import pathlib +import subprocess +import sys + +SKIP_PREFIXES = ( + "engine/strata/", "experiments/", "artifacts/", "docs/experiments/", "docs/e2e-data/", "docs/upstream/", + "docs/ledger", "Cargo.lock", "scripts/dev/rename_strata_names.py", +) +HYPHEN = (("strata-next", "leleka-api"), ("strata-control", "leleka-control-plane"), + ("strata-desktop-core", "leleka-engine-host")) +UNDERSCORE = (("strata_control", "leleka_control_plane"), ("strata_desktop_core", "leleka_engine_host")) + + +def main(): + dry = "--dry-run" in sys.argv + root = pathlib.Path(__file__).resolve().parents[2] + files = subprocess.run(["git", "ls-files"], cwd=root, capture_output=True, text=True, check=True).stdout.splitlines() + changed = 0 + for name in files: + if name.startswith(SKIP_PREFIXES) or name.endswith(".patch"): + continue + path = root / name + try: + raw = path.read_bytes() + text = raw.decode("utf-8") + except (UnicodeDecodeError, OSError): + continue + new = text + for old, to in HYPHEN: + new = new.replace(old, to) + if name.endswith((".rs", ".toml")): + for old, to in UNDERSCORE: + new = new.replace(old, to) + if new != text: + changed += 1 + if not dry: + path.write_bytes(new.encode("utf-8")) + print(f"{changed} files {'would change' if dry else 'changed'}") + + +if __name__ == "__main__": + main() diff --git a/scripts/e2e/analyze_session.py b/scripts/e2e/analyze_session.py index 8751c983..cf237863 100644 --- a/scripts/e2e/analyze_session.py +++ b/scripts/e2e/analyze_session.py @@ -4,7 +4,7 @@ analyze_session.py RUN_DIR [--csv trace.csv] [--top 10] Reads from RUN_DIR (written by run-e2e.sh / run-codex.sh): - strata-next.log `generation start:` / `generation done:` lines (t_unix_ms, prompt/reused/generated tokens, prompt_ms = time to first text, decode_ms) + leleka-api.log `generation start:` / `generation done:` lines (t_unix_ms, prompt/reused/generated tokens, prompt_ms = time to first text, decode_ms) inference.log engine stderr with LELEKA_SERVE_PROFILE=1 and LELEKA_BRINGUP_TRACE=1: `prefill_phase start n= resume=`, PREFILL-PROFILE, `DBG window`, `leleka-serve request outcome=`, expert-tier counters, `prefix request:` lines codex-events.jsonl Codex `--json` events stamped with t_unix_ms by ts_lines.py (optional) @@ -12,7 +12,7 @@ Reads from RUN_DIR (written by run-e2e.sh / run-codex.sh): and writes one CSV row per generation plus a text report: time shares (prefill / decode / idle waiting for the agent and its tools), context growth, prefill cost against context, reuse effectiveness, decode speed against context, the slowest requests with causes, and what the prefill would have cost had every turn re-read only its new suffix (the ideal of a perfect prefix cache). -Requests of strata-next and prefill phases of the engine are joined by order; the prompt token counts are compared as a check. +Requests of leleka-api and prefill phases of the engine are joined by order; the prompt token counts are compared as a check. """ import argparse import csv @@ -48,11 +48,11 @@ def pct(xs, p): return round(xs[min(len(xs) - 1, int(p * len(xs)))], 2) if xs else None -# ---- strata-next ---------------------------------------------------------------------------------------------------------- +# ---- leleka-api ---------------------------------------------------------------------------------------------------------- start_re = re.compile(r"generation start: t_unix_ms=(\d+) prompt_tokens=(\d+) max_new=(\d+)") done_re = re.compile(r"generation done: (?:t_unix_ms=(\d+) )?finish=(\w+) prompt_tokens=(\d+) reused=(\d+) generated=(\d+) prompt_ms=([\d.]+) decode_ms=([\d.]+) disconnected=(\w+)") starts, reqs, failures = [], [], [] -for l in lines("strata-next.log"): +for l in lines("leleka-api.log"): m = start_re.search(l) if m: starts.append(int(m[1])) @@ -198,7 +198,7 @@ if args.csv: w.writerows(rows) # ---- report --------------------------------------------------------------------------------------------------------------------------- -print(f"== Session {os.path.basename(os.path.abspath(RUN))}: {n} generations in strata-next.log, {len(blocks)} prefill phases in inference.log, {sum(1 for r in reqs if not r['join_ok'])} join mismatches") +print(f"== Session {os.path.basename(os.path.abspath(RUN))}: {n} generations in leleka-api.log, {len(blocks)} prefill phases in inference.log, {sum(1 for r in reqs if not r['join_ok'])} join mismatches") if failures: print(f" {len(failures)} failed generations:") for at, m in failures[:8]: @@ -216,7 +216,7 @@ print("\n== Time shares (first request start to last request end" + (f" = {wall: den = wall or (ttft_s + dec_s + idle_s) for name, v in (("time to first text (prefill + first token)", ttft_s), ("decode after the first token", dec_s), ("between requests (agent + tools)", idle_s), (" of which command execution seen in Codex events", tool_s)): print(f" {name:52s} {v:9.1f} s {100 * v / den:5.1f} %") -print(" queue wait: 0 by construction (one client, one generation at a time; strata-next /metrics queue_used was 0)") +print(" queue wait: 0 by construction (one client, one generation at a time; leleka-api /metrics queue_used was 0)") gen_tot = sum(max(r["gen"] - 1, 0) for r in reqs if r["decode_ms"] > 0) dec_tot = sum(r["decode_ms"] for r in reqs if r["decode_ms"] > 0) / 1000 diff --git a/scripts/e2e/codex/codex_report.py b/scripts/e2e/codex/codex_report.py index 18a6f244..523ba06b 100644 --- a/scripts/e2e/codex/codex_report.py +++ b/scripts/e2e/codex/codex_report.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 """Summarize a Codex agent run against the stack (offline helper, not shipped). - codex_report.py RUN_DIR reads codex-events.jsonl, strata-next.log (one `generation done:` line per request), + codex_report.py RUN_DIR reads codex-events.jsonl, leleka-api.log (one `generation done:` line per request), inference.log and env.tsv written by run-e2e.sh / run-codex.sh. """ import json @@ -63,15 +63,15 @@ print(" error events:", len(errors)) for e in errors[:5]: print(" ", e) -# ---- per-request records from strata-next --------------------------------------------------------------------------------- +# ---- per-request records from leleka-api --------------------------------------------------------------------------------- pat = re.compile(r"generation done: finish=(\w+) prompt_tokens=(\d+) reused=(\d+) generated=(\d+) prompt_ms=([\d.]+) decode_ms=([\d.]+) disconnected=(\w+)") reqs = [] -for line in lines("strata-next.log"): +for line in lines("leleka-api.log"): m = pat.search(line) if m: reqs.append({"finish": m[1], "prompt": int(m[2]), "reused": int(m[3]), "gen": int(m[4]), "ttft_s": float(m[5]) / 1000, "decode_s": float(m[6]) / 1000, "disc": m[7] == "true"}) -failed = [l for l in lines("strata-next.log") if "generation failed:" in l] -print("== Requests seen by strata-next:", len(reqs), " failures logged:", len(failed)) +failed = [l for l in lines("leleka-api.log") if "generation failed:" in l] +print("== Requests seen by leleka-api:", len(reqs), " failures logged:", len(failed)) causes = {} for l in failed: k = l.split("generation failed:", 1)[1].strip()[:90] @@ -83,7 +83,7 @@ if reqs: rates = [(r["gen"] - 1) / r["decode_s"] for r in reqs if r["gen"] > 8 and r["decode_s"] > 0.05] pre = [r["prompt"] - r["reused"] for r in reqs] total_p, total_r = sum(r["prompt"] for r in reqs), sum(r["reused"] for r in reqs) - print(f" TTFT s (engine first text, as seen by strata-next): median {med(ttfts)} p90 {pct(ttfts, .9)} max {max(ttfts):.2f}") + print(f" TTFT s (engine first text, as seen by leleka-api): median {med(ttfts)} p90 {pct(ttfts, .9)} max {max(ttfts):.2f}") print(f" decode tok/s per request (>8 tokens): median {med(rates)} p10 {pct(rates, .1)} p90 {pct(rates, .9)}") gen = sum(r["gen"] for r in reqs) dec = sum(r["decode_s"] for r in reqs) diff --git a/scripts/e2e/codex/compare/cmp_codex_job.sh b/scripts/e2e/codex/compare/cmp_codex_job.sh index 163b097a..7e901bd2 100644 --- a/scripts/e2e/codex/compare/cmp_codex_job.sh +++ b/scripts/e2e/codex/compare/cmp_codex_job.sh @@ -81,7 +81,7 @@ cleanup() { trap cleanup EXIT note "codex-compare block $VAR started: $RUN tasks=[$TASKS] reps=[$REPS] wall=$WALL cap=$ROUNDS; holds gpu.lock" if [ -n "$(nvidia-smi --query-compute-apps=pid --format=csv,noheader 2>/dev/null)" ]; then echo "something uses the GPU"; exit 3; fi -if pgrep -u "$USER" -x 'leleka-inference|strata-next|leleka-daemon' >/dev/null; then echo "a stack process exists"; exit 3; fi +if pgrep -u "$USER" -x 'leleka-inference|leleka-api|leleka-daemon' >/dev/null; then echo "a stack process exists"; exit 3; fi for p in 18766 18080 8081 8090; do ss -ltn "sport = :$p" 2>/dev/null | grep -q LISTEN && { echo "port $p in use"; exit 3; }; done export LD_LIBRARY_PATH=$CUBLAS:$HOME/cuda-toolkits/13.2.2/lib64:${LD_LIBRARY_PATH:-} # what the agent's shell sees, identical for both arms: Node on PATH, no analytics, caches in /tmp (the sandbox writes the workspace and /tmp only) diff --git a/scripts/e2e/codex/config.toml.tmpl b/scripts/e2e/codex/config.toml.tmpl index f08af913..3bcb5543 100644 --- a/scripts/e2e/codex/config.toml.tmpl +++ b/scripts/e2e/codex/config.toml.tmpl @@ -7,14 +7,14 @@ sandbox_mode = "workspace-write" model_reasoning_effort = "@EFFORT@" model_context_window = 262144 model_reasoning_summary = "auto" -# Codex sends the hosted web_search tool by default; strata-next refuses hosted tools (400), as the existing launcher scripts/install-qwen-native.py also configures +# Codex sends the hosted web_search tool by default; leleka-api refuses hosted tools (400), as the existing launcher scripts/install-qwen-native.py also configures web_search = "disabled" [sandbox_workspace_write] network_access = false [model_providers.strata] -name = "strata-next over leleka-inference" +name = "leleka-api over leleka-inference" base_url = "@BASE_URL@/v1" env_key = "E2E_API_KEY" wire_api = "responses" diff --git a/scripts/e2e/codex/delta/block.sh b/scripts/e2e/codex/delta/block.sh index 8e678362..bd0957a3 100644 --- a/scripts/e2e/codex/delta/block.sh +++ b/scripts/e2e/codex/delta/block.sh @@ -75,7 +75,7 @@ if [ "$KIND" = ours ]; then if [ "$V" = V3 ]; then export LELEKA_ROUTE_TAIL_SKIP=7; EXPECT=on; else EXPECT=off; fi write_stack_json { echo "variant=$V tag=$TAG"; date -u +%FT%TZ; free -g | sed -n 2p; uptime - sha256sum "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/strata-next "$A/data/expert-profile.bin" + sha256sum "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/leleka-api "$A/data/expert-profile.bin" cat "$ROOT/bin-main/COMMIT.txt" 2>/dev/null env | grep -E '^(LELEKA_|STRATA_|E2E_)' | grep -v -E 'TOKEN|KEY' | sort; } >"$STACK/env-arm.txt" export CLD_CODEX=$CODEX diff --git a/scripts/e2e/codex/jobs/943-e2e-codex-ttt.sh b/scripts/e2e/codex/jobs/943-e2e-codex-ttt.sh index 05527567..2359b5d3 100644 --- a/scripts/e2e/codex/jobs/943-e2e-codex-ttt.sh +++ b/scripts/e2e/codex/jobs/943-e2e-codex-ttt.sh @@ -1,6 +1,6 @@ set -uo pipefail # claude/e2e: the real Codex CLI (0.163.0) writes a Three.js tic-tac-toe game against the production stack -# (leleka-inference Original serve, default conversation cache, behind strata-next). Profiling on, engine log kept. +# (leleka-inference Original serve, default conversation cache, behind leleka-api). Profiling on, engine log kept. export E2E_BIN=$HOME/work/leleka-e2e/bin-sm120 export E2E_OUT=$HOME/work/leleka-e2e/runs/943-codex-ttt export CODEX_TIMEOUT_S=5400 diff --git a/scripts/e2e/codex/jobs/943b-e2e-codex-ttt.sh b/scripts/e2e/codex/jobs/943b-e2e-codex-ttt.sh index 5a5945b7..9c760274 100644 --- a/scripts/e2e/codex/jobs/943b-e2e-codex-ttt.sh +++ b/scripts/e2e/codex/jobs/943b-e2e-codex-ttt.sh @@ -1,6 +1,6 @@ set -uo pipefail # claude/e2e: the real Codex CLI (0.163.0) writes a Three.js tic-tac-toe game (rerun after the 32768 output cap) against the production stack -# (leleka-inference Original serve, default conversation cache, behind strata-next). Profiling on, engine log kept. +# (leleka-inference Original serve, default conversation cache, behind leleka-api). Profiling on, engine log kept. export E2E_BIN=$HOME/work/leleka-e2e/bin-sm120 export E2E_OUT=$HOME/work/leleka-e2e/runs/943b-codex-ttt export CODEX_TIMEOUT_S=5400 diff --git a/scripts/e2e/codex/jobs/943c-e2e-codex-ttt.sh b/scripts/e2e/codex/jobs/943c-e2e-codex-ttt.sh index cf302eb6..1eb96fab 100644 --- a/scripts/e2e/codex/jobs/943c-e2e-codex-ttt.sh +++ b/scripts/e2e/codex/jobs/943c-e2e-codex-ttt.sh @@ -1,6 +1,6 @@ set -uo pipefail # claude/e2e (rerun with the reference-equivalent config, auto expert cache + spec-min-p 0.5): the real Codex CLI (0.163.0) writes a Three.js tic-tac-toe game (rerun after the 32768 output cap) against the production stack -# (leleka-inference Original serve, default conversation cache, behind strata-next). Profiling on, engine log kept. +# (leleka-inference Original serve, default conversation cache, behind leleka-api). Profiling on, engine log kept. export E2E_BIN=$HOME/work/leleka-e2e/bin-sm120 export E2E_OUT=$HOME/work/leleka-e2e/runs/943c-codex-ttt export CODEX_TIMEOUT_S=5400 diff --git a/scripts/e2e/codex/jobs/943d-e2e-codex-ttt.sh b/scripts/e2e/codex/jobs/943d-e2e-codex-ttt.sh index eea77230..7cbf02dd 100644 --- a/scripts/e2e/codex/jobs/943d-e2e-codex-ttt.sh +++ b/scripts/e2e/codex/jobs/943d-e2e-codex-ttt.sh @@ -1,6 +1,6 @@ set -uo pipefail # claude/e2e (second rerun, scalar draft-KV identity fix with --mtp-rt-dir, auto expert cache + spec-min-p 0.5): the real Codex CLI (0.163.0) writes a Three.js tic-tac-toe game (rerun after the 32768 output cap) against the production stack -# (leleka-inference Original serve, default conversation cache, behind strata-next). Profiling on, engine log kept. +# (leleka-inference Original serve, default conversation cache, behind leleka-api). Profiling on, engine log kept. export E2E_BIN=$HOME/work/leleka-e2e/bin-sm120 export E2E_OUT=$HOME/work/leleka-e2e/runs/943d-codex-ttt export CODEX_TIMEOUT_S=5400 diff --git a/scripts/e2e/codex/jobs/9f1-cp-live-ab.sh b/scripts/e2e/codex/jobs/9f1-cp-live-ab.sh index 73566526..8d753704 100644 --- a/scripts/e2e/codex/jobs/9f1-cp-live-ab.sh +++ b/scripts/e2e/codex/jobs/9f1-cp-live-ab.sh @@ -1,15 +1,15 @@ set -uo pipefail # claude/cp-latency: the host side of one Codex session on the real engine. One model load; two API servers in front of the same engine -# (the current strata-next on :8081 and the baseline dbf487b logic on :8082); one synthesized Codex session (capture 945, history ~100k tokens, +# (the current leleka-api on :8081 and the baseline dbf487b logic on :8082); one synthesized Codex session (capture 945, history ~100k tokens, # 20 consecutive requests, max_output_tokens 64) sent alternately through the two, so the engine sees the same prompt sequence either way. # Prints the per-request table and per-arm medians of: client TTFT, pre-engine time (send -> generation start), engine time, post time. -# Needs (outside Git, copied by the operator): $CP/bin/{leleka-inference,strata-next-new,strata-next-base,cp_replay}, $CP/data/s945.json, +# Needs (outside Git, copied by the operator): $CP/bin/{leleka-inference,leleka-api-new,leleka-api-base,cp_replay}, $CP/data/s945.json, # the e2e bins for leleka-daemon / leleka-cli, and the scripts of this branch under $CP/scripts/cp. CP=$HOME/work/leleka-cp E2E=$HOME/work/leleka-e2e/bin-sm120 mkdir -p $CP/bin-e2e $CP/runs ln -sf $CP/bin/leleka-inference $CP/bin-e2e/leleka-inference -ln -sf $CP/bin/strata-next-new $CP/bin-e2e/strata-next +ln -sf $CP/bin/leleka-api-new $CP/bin-e2e/leleka-api ln -sf $E2E/leleka-daemon $CP/bin-e2e/leleka-daemon ln -sf $E2E/leleka-cli $CP/bin-e2e/leleka-cli export E2E_BIN=$CP/bin-e2e diff --git a/scripts/e2e/codex/orchestrator/orchestrator_smoke_job.sh b/scripts/e2e/codex/orchestrator/orchestrator_smoke_job.sh index fd612a75..c130d226 100644 --- a/scripts/e2e/codex/orchestrator/orchestrator_smoke_job.sh +++ b/scripts/e2e/codex/orchestrator/orchestrator_smoke_job.sh @@ -60,7 +60,7 @@ cleanup() { trap cleanup EXIT note "orchestrator smoke started: $RUN release=$TAG wall_orch=$WALL_ORCH control=${CMP_CONTROL:-1}; holds gpu.lock" if [ -n "$(nvidia-smi --query-compute-apps=pid --format=csv,noheader 2>/dev/null)" ]; then die "something uses the GPU"; fi -if pgrep -u "$USER" -x 'leleka-inference|strata-next|leleka-daemon' >/dev/null; then die "a stack process exists"; fi +if pgrep -u "$USER" -x 'leleka-inference|leleka-api|leleka-daemon' >/dev/null; then die "a stack process exists"; fi for p in 18766 18080 8081 8090; do ss -ltn "sport = :$p" 2>/dev/null | grep -q LISTEN && die "port $p in use"; done export LD_LIBRARY_PATH=$CUBLAS:$HOME/cuda-toolkits/13.2.2/lib64:${LD_LIBRARY_PATH:-} export PATH=$NODE_BIN:$PATH NG_CLI_ANALYTICS=false npm_config_cache=/tmp/cmp-npm-cache npm_config_update_notifier=false npm_config_fund=false npm_config_audit=false CI=1 diff --git a/scripts/e2e/codex/prefill/e2e-release/cmp_codex_job_gguf.sh b/scripts/e2e/codex/prefill/e2e-release/cmp_codex_job_gguf.sh index 86e1b3b4..1c188356 100644 --- a/scripts/e2e/codex/prefill/e2e-release/cmp_codex_job_gguf.sh +++ b/scripts/e2e/codex/prefill/e2e-release/cmp_codex_job_gguf.sh @@ -82,7 +82,7 @@ cleanup() { trap cleanup EXIT note "codex-compare block $VAR started: $RUN tasks=[$TASKS] reps=[$REPS] wall=$WALL cap=$ROUNDS; holds gpu.lock" if [ -n "$(nvidia-smi --query-compute-apps=pid --format=csv,noheader 2>/dev/null)" ]; then echo "something uses the GPU"; exit 3; fi -if pgrep -u "$USER" -x 'leleka-inference|strata-next|leleka-daemon' >/dev/null; then echo "a stack process exists"; exit 3; fi +if pgrep -u "$USER" -x 'leleka-inference|leleka-api|leleka-daemon' >/dev/null; then echo "a stack process exists"; exit 3; fi for p in 18766 18080 8081 8090; do ss -ltn "sport = :$p" 2>/dev/null | grep -q LISTEN && { echo "port $p in use"; exit 3; }; done export LD_LIBRARY_PATH=$CUBLAS:$HOME/cuda-toolkits/13.2.2/lib64:${LD_LIBRARY_PATH:-} # what the agent's shell sees, identical for both arms: Node on PATH, no analytics, caches in /tmp (the sandbox writes the workspace and /tmp only) diff --git a/scripts/e2e/codex/prefill/e2e-release/cmp_codex_job_profile.sh b/scripts/e2e/codex/prefill/e2e-release/cmp_codex_job_profile.sh index b74df27f..1b5d3e22 100644 --- a/scripts/e2e/codex/prefill/e2e-release/cmp_codex_job_profile.sh +++ b/scripts/e2e/codex/prefill/e2e-release/cmp_codex_job_profile.sh @@ -81,7 +81,7 @@ cleanup() { trap cleanup EXIT note "codex-compare block $VAR started: $RUN tasks=[$TASKS] reps=[$REPS] wall=$WALL cap=$ROUNDS; holds gpu.lock" if [ -n "$(nvidia-smi --query-compute-apps=pid --format=csv,noheader 2>/dev/null)" ]; then echo "something uses the GPU"; exit 3; fi -if pgrep -u "$USER" -x 'leleka-inference|strata-next|leleka-daemon' >/dev/null; then echo "a stack process exists"; exit 3; fi +if pgrep -u "$USER" -x 'leleka-inference|leleka-api|leleka-daemon' >/dev/null; then echo "a stack process exists"; exit 3; fi for p in 18766 18080 8081 8090; do ss -ltn "sport = :$p" 2>/dev/null | grep -q LISTEN && { echo "port $p in use"; exit 3; }; done export LD_LIBRARY_PATH=$CUBLAS:$HOME/cuda-toolkits/13.2.2/lib64:${LD_LIBRARY_PATH:-} # what the agent's shell sees, identical for both arms: Node on PATH, no analytics, caches in /tmp (the sandbox writes the workspace and /tmp only) diff --git a/scripts/e2e/codex/prefill/pf_codex_job.sh b/scripts/e2e/codex/prefill/pf_codex_job.sh index ecbf14cf..deb3d925 100644 --- a/scripts/e2e/codex/prefill/pf_codex_job.sh +++ b/scripts/e2e/codex/prefill/pf_codex_job.sh @@ -46,7 +46,7 @@ cleanup() { stop_stack; [ -n "$MON_PID" ] && kill "$MON_PID" 2>/dev/null; [ -n " trap cleanup EXIT note "prefill codex block $VAR started: $RUN tasks=[$TASKS] reps=[$REPS] env=[${PF_ENV:-}]" [ -z "$(nvidia-smi --query-compute-apps=pid --format=csv,noheader 2>/dev/null)" ] || { echo "something uses the GPU"; exit 3; } -if pgrep -u "$USER" -x 'leleka-inference|strata-next|leleka-daemon' >/dev/null; then echo "a stack process exists"; exit 3; fi +if pgrep -u "$USER" -x 'leleka-inference|leleka-api|leleka-daemon' >/dev/null; then echo "a stack process exists"; exit 3; fi for p in 18766 18080 8081 8090; do ss -ltn "sport = :$p" 2>/dev/null | grep -q LISTEN && { echo "port $p in use"; exit 3; }; done export LD_LIBRARY_PATH=$CUBLAS:$HOME/cuda-toolkits/13.2.2/lib64:${LD_LIBRARY_PATH:-} export PATH=$NODE_BIN:$PATH NG_CLI_ANALYTICS=false npm_config_cache=/tmp/cmp-npm-cache npm_config_update_notifier=false npm_config_fund=false npm_config_audit=false CI=1 diff --git a/scripts/e2e/codex/speed/q245_codex_job_armprofile.sh b/scripts/e2e/codex/speed/q245_codex_job_armprofile.sh index 9f70f33e..d7f48a35 100644 --- a/scripts/e2e/codex/speed/q245_codex_job_armprofile.sh +++ b/scripts/e2e/codex/speed/q245_codex_job_armprofile.sh @@ -67,7 +67,7 @@ cleanup() { trap cleanup EXIT note "codex job $MODE started: $RUN tasks=[$TASKS] reps=[$REPS] pad=$(wc -c <"$PAD") bytes; holds gpu.lock" if [ -n "$(nvidia-smi --query-compute-apps=pid --format=csv,noheader 2>/dev/null)" ]; then echo "something uses the GPU"; exit 3; fi -if pgrep -u "$USER" -x 'leleka-inference|strata-next|leleka-daemon' >/dev/null; then echo "a stack process exists"; exit 3; fi +if pgrep -u "$USER" -x 'leleka-inference|leleka-api|leleka-daemon' >/dev/null; then echo "a stack process exists"; exit 3; fi for p in 18766 18080 8081 8090; do ss -ltn "sport = :$p" 2>/dev/null | grep -q LISTEN && { echo "port $p in use"; exit 3; }; done export LD_LIBRARY_PATH=$CUBLAS:$HOME/cuda-toolkits/13.2.2/lib64:${LD_LIBRARY_PATH:-} { date -u +%FT%TZ; uname -r; nvidia-smi --query-gpu=name,driver_version,power.limit --format=csv,noheader; free -g | sed -n 2p; uptime; $CODEX --version; sha256sum "$CODEX" "$PAD"; } | tee "$RUN/host.txt" diff --git a/scripts/e2e/cupti_trigger.sh b/scripts/e2e/cupti_trigger.sh index 8180a157..0c1e15d2 100644 --- a/scripts/e2e/cupti_trigger.sh +++ b/scripts/e2e/cupti_trigger.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # cupti_trigger.sh SECONDS LABEL [TRIGGER_FILE] : ask the injected CUPTI tracer (tools/cupti-trace, claude/ledger) of the running # leleka-inference to record SECONDS (max 120) of kernels/copies/syncs. Atomic write; logs the unix ms of the request to -# $(dirname TRIGGER)/windows.log so the window can be joined with strata-next.log. The tracer writes .lct/ and .done. +# $(dirname TRIGGER)/windows.log so the window can be joined with leleka-api.log. The tracer writes .lct/ and .done. sec=${1:?seconds}; label=${2:?label} trigger=${3:-$HOME/work/codex-e2e/cupti/cupti.trigger} dir=$(dirname "$trigger"); mkdir -p "$dir" diff --git a/scripts/e2e/decode/baseline-install.sh b/scripts/e2e/decode/baseline-install.sh index 9c57223b..db43f4d3 100644 --- a/scripts/e2e/decode/baseline-install.sh +++ b/scripts/e2e/decode/baseline-install.sh @@ -15,9 +15,9 @@ chmod a-w "$BP/tools" ENG=$(ls -d /home/para/.local/share/strata/components/engine/*/strata | head -1) { sha256sum "$BP"/tools/* \ - "$D/bin-footprint3b/leleka-inference" "$D/bin-footprint3b/leleka-daemon" "$D/bin-footprint3b/leleka-cli" "$D/bin-footprint3b/strata-next" \ - "$D/bin-cpuservice/leleka-inference" "$D/bin-cpuservice/leleka-daemon" "$D/bin-cpuservice/leleka-cli" "$D/bin-cpuservice/strata-next" \ - $(ls "$D"/bin-main-*/leleka-inference "$D"/bin-main-*/leleka-daemon "$D"/bin-main-*/leleka-cli "$D"/bin-main-*/strata-next 2>/dev/null) \ + "$D/bin-footprint3b/leleka-inference" "$D/bin-footprint3b/leleka-daemon" "$D/bin-footprint3b/leleka-cli" "$D/bin-footprint3b/leleka-api" \ + "$D/bin-cpuservice/leleka-inference" "$D/bin-cpuservice/leleka-daemon" "$D/bin-cpuservice/leleka-cli" "$D/bin-cpuservice/leleka-api" \ + $(ls "$D"/bin-main-*/leleka-inference "$D"/bin-main-*/leleka-daemon "$D"/bin-main-*/leleka-cli "$D"/bin-main-*/leleka-api 2>/dev/null) \ "$D/tools/long-session.py" "$D/scripts/e2e/run-e2e.sh" "$D/scripts/e2e/sample_env.sh" \ /data/leleka-e2e/decode/assets/expert-profile-upstream.bin /data/leleka-e2e/decode/corpus/MANIFEST.txt \ "$HOME/work/vanilla-strata/control/bin/strata" "$ENG" "$HOME/.config/strata/settings.json" diff --git a/scripts/e2e/decode/baseline-pair-ab.sh b/scripts/e2e/decode/baseline-pair-ab.sh index 95c0ddeb..c9c7d3be 100644 --- a/scripts/e2e/decode/baseline-pair-ab.sh +++ b/scripts/e2e/decode/baseline-pair-ab.sh @@ -83,7 +83,7 @@ ours() { # $1 tag, $2 run dir, $3 arm (ours | ours45) # ours45 = the product default PCIe share 0.45; ours = whatever run-e2e.sh exports (its own default 0.55, the value every earlier harness A/B used) if [ "$oarm" = ours45 ]; then export LELEKA_ORIGINAL_SERVE_PCIE_FRAC=0.45; fi echo "pcie_frac_requested=${LELEKA_ORIGINAL_SERVE_PCIE_FRAC:-0.55 (run-e2e.sh default)}" >"$R/pcie-frac.txt" - { echo "arm=$oarm tag=$tag"; date -u +%FT%TZ; free -g | sed -n 2p; uptime; sha256sum "$UP" "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/strata-next + { echo "arm=$oarm tag=$tag"; date -u +%FT%TZ; free -g | sed -n 2p; uptime; sha256sum "$UP" "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/leleka-api cat "$E2E_BIN/COMMIT.txt" 2>/dev/null; head -1 /data/leleka-e2e/decode/corpus/MANIFEST.txt env | grep -E '^(LELEKA_|STRATA_|E2E_)' | sort; } >"$R/env-arm.txt" export E2E_RUN_CMD="bash $BP/tools/ts-wrap.sh $R/client.ts.log python3 -I $D/tools/long-session.py --src $CORPUS $SESSION_ARGS" diff --git a/scripts/e2e/decode/cpu-service-ab.sh b/scripts/e2e/decode/cpu-service-ab.sh index 54d0a91c..74724878 100644 --- a/scripts/e2e/decode/cpu-service-ab.sh +++ b/scripts/e2e/decode/cpu-service-ab.sh @@ -43,7 +43,7 @@ ours() { # $1 tag, $2 arm cs-p35) export LELEKA_ORIGINAL_SERVE_PCIE_FRAC=0.35 ;; *) echo "unknown ours arm $arm" >&2; exit 2 ;; esac - { echo "arm=$arm tag=$tag"; date -u +%FT%TZ; free -g | sed -n 2p; uptime; sha256sum "$UP" "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/strata-next + { echo "arm=$arm tag=$tag"; date -u +%FT%TZ; free -g | sed -n 2p; uptime; sha256sum "$UP" "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/leleka-api cat "$E2E_BIN/COMMIT.txt" 2>/dev/null; head -1 /data/leleka-e2e/decode/corpus/MANIFEST.txt env | grep -E '^(LELEKA_|STRATA_|E2E_)' | sort; } >"$E2E_OUT/env-arm.txt" export E2E_RUN_CMD="python3 -I $D/tools/long-session.py --src $CORPUS $SESSION_ARGS" diff --git a/scripts/e2e/decode/cpu-service2-eager-ab.sh b/scripts/e2e/decode/cpu-service2-eager-ab.sh index 9c6d8c15..7494243f 100644 --- a/scripts/e2e/decode/cpu-service2-eager-ab.sh +++ b/scripts/e2e/decode/cpu-service2-eager-ab.sh @@ -37,7 +37,7 @@ ours() { # $1 tag, $2 arm ea-off) export LELEKA_ORIGINAL_SERVE_PCIE_FRAC=0.55 LELEKA_CPU_ADMIT_EAGER=off LELEKA_Q8K=legacy ;; *) echo "unknown ours arm $arm" >&2; exit 2 ;; esac - { echo "arm=$arm tag=$tag"; date -u +%FT%TZ; free -g | sed -n 2p; uptime; sha256sum "$UP" "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/strata-next + { echo "arm=$arm tag=$tag"; date -u +%FT%TZ; free -g | sed -n 2p; uptime; sha256sum "$UP" "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/leleka-api cat "$E2E_BIN/COMMIT.txt" 2>/dev/null; head -1 /data/leleka-e2e/decode/corpus/MANIFEST.txt env | grep -E '^(LELEKA_|STRATA_|E2E_)' | sort; } >"$E2E_OUT/env-arm.txt" export E2E_RUN_CMD="python3 -I $D/tools/long-session.py --src $CORPUS $SESSION_ARGS" diff --git a/scripts/e2e/decode/cpu-service2-pcie-ab.sh b/scripts/e2e/decode/cpu-service2-pcie-ab.sh index 6f4a0379..3e5b96e9 100644 --- a/scripts/e2e/decode/cpu-service2-pcie-ab.sh +++ b/scripts/e2e/decode/cpu-service2-pcie-ab.sh @@ -40,7 +40,7 @@ ours() { # $1 tag, $2 arm pc55L) export LELEKA_ORIGINAL_SERVE_PCIE_FRAC=0.55 LELEKA_Q8K=legacy ;; *) echo "unknown ours arm $arm" >&2; exit 2 ;; esac - { echo "arm=$arm tag=$tag"; date -u +%FT%TZ; free -g | sed -n 2p; uptime; sha256sum "$UP" "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/strata-next + { echo "arm=$arm tag=$tag"; date -u +%FT%TZ; free -g | sed -n 2p; uptime; sha256sum "$UP" "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/leleka-api cat "$E2E_BIN/COMMIT.txt" 2>/dev/null; head -1 /data/leleka-e2e/decode/corpus/MANIFEST.txt env | grep -E '^(LELEKA_|STRATA_|E2E_)' | sort; } >"$E2E_OUT/env-arm.txt" export E2E_RUN_CMD="python3 -I $D/tools/long-session.py --src $CORPUS $SESSION_ARGS" diff --git a/scripts/e2e/decode/draftround-ab.sh b/scripts/e2e/decode/draftround-ab.sh index 3eecd724..353fb787 100644 --- a/scripts/e2e/decode/draftround-ab.sh +++ b/scripts/e2e/decode/draftround-ab.sh @@ -70,7 +70,7 @@ ours() { # $1 tag, $2 run dir, $3 bin dir, $4 extra env words unset LELEKA_HUGEPAGES LELEKA_BANK_THP LELEKA_DRAFT_FUSED_COMMIT LELEKA_DRAFT_ROUND LELEKA_SM120_ATTN_DAILY_MTP export LELEKA_ORIGINAL_SERVE_SEED=off LELEKA_ORIGINAL_SERVE_PCIE_FRAC=$PCIE_FRAC for kv in $xenv; do export "$kv"; done - { echo "tag=$tag bin=$bin extra=[$xenv]"; date -u +%FT%TZ; free -g | sed -n 2p; uptime; sha256sum "$UP" "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/strata-next + { echo "tag=$tag bin=$bin extra=[$xenv]"; date -u +%FT%TZ; free -g | sed -n 2p; uptime; sha256sum "$UP" "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/leleka-api cat "$E2E_BIN/COMMIT.txt" 2>/dev/null; head -1 /data/leleka-e2e/decode/corpus/MANIFEST.txt env | grep -E '^(LELEKA_|STRATA_|E2E_)' | sort; } >"$R/env-arm.txt" export E2E_RUN_CMD="bash $DR/tools/ts-wrap.sh $R/client.ts.log python3 -I $D/tools/long-session.py --src $CORPUS $SESSION_ARGS" diff --git a/scripts/e2e/decode/draftround-install.sh b/scripts/e2e/decode/draftround-install.sh index 3de7dce1..3cf4f6f7 100644 --- a/scripts/e2e/decode/draftround-install.sh +++ b/scripts/e2e/decode/draftround-install.sh @@ -15,7 +15,7 @@ chmod a-w "$DR/tools" BINS="bin-main-ffd9322 $*" { sha256sum "$DR"/tools/* "$DR"/cupti/lib/libcupti.so.2026.1.2 - for b in $BINS; do for x in leleka-inference leleka-daemon leleka-cli strata-next; do echo "$(sha256sum "$D/$b/$x" | cut -d' ' -f1) $D/$b/$x"; done; done + for b in $BINS; do for x in leleka-inference leleka-daemon leleka-cli leleka-api; do echo "$(sha256sum "$D/$b/$x" | cut -d' ' -f1) $D/$b/$x"; done; done sha256sum "$D/tools/long-session.py" "$D/scripts/e2e/run-e2e.sh" "$D/scripts/e2e/sample_env.sh" \ /data/leleka-e2e/decode/assets/expert-profile-upstream.bin /data/leleka-e2e/decode/corpus/MANIFEST.txt } >"$DR/MANIFEST.sha256.new" diff --git a/scripts/e2e/decode/drafttail-ab.sh b/scripts/e2e/decode/drafttail-ab.sh index 004a889d..05225c40 100644 --- a/scripts/e2e/decode/drafttail-ab.sh +++ b/scripts/e2e/decode/drafttail-ab.sh @@ -51,7 +51,7 @@ ours() { # $1 tag, $2 arm drafttail-ac-noseed) export LELEKA_SERVE_DRAFT_AFTER_COMMIT=on ;; *) echo "unknown ours arm $arm" >&2; exit 2 ;; esac - { echo "arm=$arm tag=$tag"; date -u +%FT%TZ; free -g | sed -n 2p; sha256sum "$UP" "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/strata-next + { echo "arm=$arm tag=$tag"; date -u +%FT%TZ; free -g | sed -n 2p; sha256sum "$UP" "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/leleka-api cat "$E2E_BIN/COMMIT.txt" 2>/dev/null; head -1 /data/leleka-e2e/decode/corpus/MANIFEST.txt env | grep -E '^(LELEKA_|STRATA_|E2E_)' | sort; } >"$E2E_OUT/env-arm.txt" export E2E_RUN_CMD="python3 -I $D/tools/long-session.py --src $CORPUS $SESSION_ARGS" diff --git a/scripts/e2e/decode/draftvocab-ab.sh b/scripts/e2e/decode/draftvocab-ab.sh index 24448c27..c07dfd69 100644 --- a/scripts/e2e/decode/draftvocab-ab.sh +++ b/scripts/e2e/decode/draftvocab-ab.sh @@ -4,7 +4,7 @@ # HOLDER JOB (run on rnr5090 under the holder). Install: # cp scripts/e2e/decode/draftvocab-ab.sh /data/leleka-e2e/decode/dt/jobs/draftvocab-ab.sh # queue stub (~/work/gpu-runs/holder2/jobs/draftvocab-ab.sh): #!/usr/bin/env bash / exec bash /data/leleka-e2e/decode/dt/jobs/draftvocab-ab.sh (+ one line in jobs/PRIORITY) -# Needs dt/bin-draftvocab (claude/draft-vocab release build: leleka-inference leleka-daemon leleka-cli strata-next, see dt/BUILD.md) and the frozen asset +# Needs dt/bin-draftvocab (claude/draft-vocab release build: leleka-inference leleka-daemon leleka-cli leleka-api, see dt/BUILD.md) and the frozen asset # /data/leleka-e2e/decode/assets/draft_vocab_en.bin (this script creates it from the read-only vanilla install copy when missing and REFUSES any file whose sha256 differs). # It takes /data/leleka-e2e/gpu.lock per arm (one arm at a time) and skips an arm when something else uses the GPU. ~13 min an arm, 6 arms by default (~80 min). # @@ -75,7 +75,7 @@ ours() { # $1 tag, $2 arm export LELEKA_ORIGINAL_SERVE_EXPERT_SLOTS=$N ;; *) echo "unknown ours arm $arm" >&2; exit 2 ;; esac - { echo "arm=$arm tag=$tag"; date -u +%FT%TZ; free -g | sed -n 2p; sha256sum "$UP" "$VOCAB_EN" "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/strata-next + { echo "arm=$arm tag=$tag"; date -u +%FT%TZ; free -g | sed -n 2p; sha256sum "$UP" "$VOCAB_EN" "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/leleka-api cat "$E2E_BIN/COMMIT.txt" 2>/dev/null; head -1 /data/leleka-e2e/decode/corpus/MANIFEST.txt env | grep -E '^(LELEKA_|STRATA_|E2E_)' | sort; } >"$E2E_OUT/env-arm.txt" export E2E_RUN_CMD="python3 -I $D/tools/long-session.py --src $CORPUS $SESSION_ARGS" diff --git a/scripts/e2e/decode/footprint2-ab.sh b/scripts/e2e/decode/footprint2-ab.sh index bf5a239e..a4ef31c7 100644 --- a/scripts/e2e/decode/footprint2-ab.sh +++ b/scripts/e2e/decode/footprint2-ab.sh @@ -43,7 +43,7 @@ ours() { # $1 tag, $2 arm fp2-alias-noseed) export LELEKA_PROMPT_EMBED_ALIAS=1 ;; *) echo "unknown ours arm $arm" >&2; exit 2 ;; esac - { echo "arm=$arm tag=$tag"; date -u +%FT%TZ; free -g | sed -n 2p; uptime; sha256sum "$UP" "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/strata-next + { echo "arm=$arm tag=$tag"; date -u +%FT%TZ; free -g | sed -n 2p; uptime; sha256sum "$UP" "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/leleka-api cat "$E2E_BIN/COMMIT.txt" 2>/dev/null; head -1 /data/leleka-e2e/decode/corpus/MANIFEST.txt env | grep -E '^(LELEKA_|STRATA_|E2E_)' | sort; } >"$E2E_OUT/env-arm.txt" export E2E_RUN_CMD="python3 -I $D/tools/long-session.py --src $CORPUS $SESSION_ARGS" diff --git a/scripts/e2e/decode/footprint3-ab.sh b/scripts/e2e/decode/footprint3-ab.sh index 0151404a..fd57a9ed 100644 --- a/scripts/e2e/decode/footprint3-ab.sh +++ b/scripts/e2e/decode/footprint3-ab.sh @@ -44,7 +44,7 @@ ours() { # $1 tag, $2 arm fp3-both-noseed) export LELEKA_PROMPT_EMBED_ALIAS=1 LELEKA_ORIGINAL_SERVE_DECODE_RESERVE_MIB=130 ;; *) echo "unknown ours arm $arm" >&2; exit 2 ;; esac - { echo "arm=$arm tag=$tag"; date -u +%FT%TZ; free -g | sed -n 2p; uptime; sha256sum "$UP" "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/strata-next + { echo "arm=$arm tag=$tag"; date -u +%FT%TZ; free -g | sed -n 2p; uptime; sha256sum "$UP" "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/leleka-api cat "$E2E_BIN/COMMIT.txt" 2>/dev/null; head -1 /data/leleka-e2e/decode/corpus/MANIFEST.txt env | grep -E '^(LELEKA_|STRATA_|E2E_)' | sort; } >"$E2E_OUT/env-arm.txt" export E2E_RUN_CMD="python3 -I $D/tools/long-session.py --src $CORPUS $SESSION_ARGS" diff --git a/scripts/e2e/decode/hugepages-ab.sh b/scripts/e2e/decode/hugepages-ab.sh index 5bc268c0..b54300be 100644 --- a/scripts/e2e/decode/hugepages-ab.sh +++ b/scripts/e2e/decode/hugepages-ab.sh @@ -63,7 +63,7 @@ ours() { # $1 tag, $2 run dir, $3 arm hpon) export LELEKA_HUGEPAGES=on ;; *) echo "unknown arm $arm" >&2; exit 2 ;; esac - { echo "arm=$arm tag=$tag"; date -u +%FT%TZ; free -g | sed -n 2p; uptime; sha256sum "$UP" "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/strata-next + { echo "arm=$arm tag=$tag"; date -u +%FT%TZ; free -g | sed -n 2p; uptime; sha256sum "$UP" "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/leleka-api cat "$E2E_BIN/COMMIT.txt" 2>/dev/null; head -1 /data/leleka-e2e/decode/corpus/MANIFEST.txt env | grep -E '^(LELEKA_|STRATA_|E2E_)' | sort; } >"$R/env-arm.txt" export E2E_RUN_CMD="bash $HP/tools/ts-wrap.sh $R/client.ts.log python3 -I $D/tools/long-session.py --src $CORPUS $SESSION_ARGS" diff --git a/scripts/e2e/decode/hugepages-install.sh b/scripts/e2e/decode/hugepages-install.sh index f127a876..da6c29f6 100644 --- a/scripts/e2e/decode/hugepages-install.sh +++ b/scripts/e2e/decode/hugepages-install.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Install the claude/hugepages measurement inputs on rnr5090 (run on the server from the directory that holds the scripts and the uploaded binaries): -# bash hugepages-install.sh +# bash hugepages-install.sh # Freezes (read-only) /data/leleka-e2e/hugepages/{tools,bin-hugepages,rt-hugepages} and writes MANIFEST.sha256 over every input a run depends on (tools, binaries, the shared # harness run-e2e.sh / long-session.py, the upstream profile, the corpus manifest, the identity capture tools). The jobs refuse to start on a missing or changed input. set -euo pipefail @@ -13,7 +13,7 @@ chmod -R u+w "$HP/tools" "$HP/bin-hugepages" 2>/dev/null || true chmod u+w "$HP/rt-hugepages" 2>/dev/null || true for f in hugepages-ab.sh hugepages-id.sh hugepages-analyze.py baseline-sampler.py ts-wrap.sh; do install -m 0444 "$SRC/$f" "$HP/tools/$f"; done if [ "$BIN" != --tools-only ]; then # --tools-only: refresh the tools and the manifest, keep the installed binaries - for b in leleka-inference leleka-daemon leleka-cli strata-next; do install -m 0555 "$BIN/$b" "$HP/bin-hugepages/$b"; done + for b in leleka-inference leleka-daemon leleka-cli leleka-api; do install -m 0555 "$BIN/$b" "$HP/bin-hugepages/$b"; done install -m 0444 "$BIN/COMMIT.txt" "$HP/bin-hugepages/COMMIT.txt" install -m 0555 "$BIN/rt-hugepages" "$HP/rt-hugepages" fi diff --git a/scripts/e2e/decode/kar-file-ab.sh b/scripts/e2e/decode/kar-file-ab.sh index 5970c93e..de25d60c 100644 --- a/scripts/e2e/decode/kar-file-ab.sh +++ b/scripts/e2e/decode/kar-file-ab.sh @@ -13,7 +13,7 @@ # cd ~/work/gpu-runs/holder2 && rm jobs/STOP && nohup bash run_holder2.sh > holder2.out 2>&1 & # install: cp scripts/e2e/decode/kar-file-ab.sh /data/leleka-e2e/decode/dt/jobs-manual/kar-file-ab.sh (any directory that is not the holder queue) # cp scripts/e2e/run-e2e.sh /data/leleka-e2e/decode/dt/scripts/e2e/run-e2e-karfile.sh (a NEW name: the frozen run-e2e.sh stays untouched) -# mkdir -p /data/leleka-e2e/decode/dt/bin-karfile && cp /{leleka-inference,leleka-daemon,leleka-cli,strata-next} there, plus COMMIT.txt +# mkdir -p /data/leleka-e2e/decode/dt/bin-karfile && cp /{leleka-inference,leleka-daemon,leleka-cli,leleka-api} there, plus COMMIT.txt # run: bash /data/leleka-e2e/decode/dt/jobs-manual/kar-file-ab.sh 2>&1 | tee -a /data/leleka-e2e/runs/kar-file-ab.job.log # # Arms (the order in ARMS is the run order; default two blocks of base, new-cold, new-warm; ARMS="base-memfd new-file-cold base-memfd new-file-cold" is the 4-arm minimum): @@ -59,7 +59,7 @@ ARMS=${ARMS:-"base-memfd new-file-cold new-file-warm base-memfd new-file-cold ne SESSION_ARGS="--turns 5 --target-tokens 245000 --max-output 300 --min-final-tokens 200000" export LD_LIBRARY_PATH=$HOME/cuda-toolkits/cublas-12.9.1.4/lib:$HOME/cuda-toolkits/13.2.2/lib64:${LD_LIBRARY_PATH:-} -for f in "$UP" "$D/tools/long-session.py" "$RUNNER" "$BINDIR/leleka-inference" "$BINDIR/leleka-daemon" "$BINDIR/leleka-cli" "$BINDIR/strata-next" "$CORPUS/backend-api/src/lib.rs" \ +for f in "$UP" "$D/tools/long-session.py" "$RUNNER" "$BINDIR/leleka-inference" "$BINDIR/leleka-daemon" "$BINDIR/leleka-cli" "$BINDIR/leleka-api" "$CORPUS/backend-api/src/lib.rs" \ "$ARCHIVE" "$ASSETS/qwen-iq3-s-l2-v4.kar.provenance.json" "$SHARD0" "$SHARD1"; do [ -r "$f" ] || { echo "missing $f" >&2; exit 3; } done @@ -160,7 +160,7 @@ ours() { # $1 tag, $2 arm echo "resident before start: archive=$(resident "$ARCHIVE") shard0=$(resident "$SHARD0") shard1=$(resident "$SHARD1")" stat -c "%n mode=%a ino=%i size=%s mtime=%y ctime=%z" "$ARCHIVE" "$SHARD0" "$SHARD1" echo "read_ahead_kb=$(cat /sys/block/nvme0n1/queue/read_ahead_kb) scheduler=$(cat /sys/block/nvme0n1/queue/scheduler) swappiness=$(cat /proc/sys/vm/swappiness)" - sha256sum "$UP" "$BINDIR"/leleka-inference "$BINDIR"/leleka-daemon "$BINDIR"/leleka-cli "$BINDIR"/strata-next "$RUNNER" + sha256sum "$UP" "$BINDIR"/leleka-inference "$BINDIR"/leleka-daemon "$BINDIR"/leleka-cli "$BINDIR"/leleka-api "$RUNNER" cat "$BINDIR/COMMIT.txt" 2>/dev/null; head -1 /data/leleka-e2e/decode/corpus/MANIFEST.txt echo "engine args: $engine_args" env | grep -E '^(LELEKA_|STRATA_|E2E_)' | sort; } >"$E2E_OUT/env-arm.txt" diff --git a/scripts/e2e/decode/parity-audit-ab.sh b/scripts/e2e/decode/parity-audit-ab.sh index ac438307..9b9a61e6 100755 --- a/scripts/e2e/decode/parity-audit-ab.sh +++ b/scripts/e2e/decode/parity-audit-ab.sh @@ -61,7 +61,7 @@ for arm in $ARMS; do pa-notrace) unset LELEKA_BRINGUP_TRACE LELEKA_PREFIX_TRACE ;; pa-dres100) export LELEKA_ORIGINAL_SERVE_DECODE_RESERVE_MIB=100 ;; pa-gather) export STRATA_IQ_GATHER=1 ;; - pa-lto) : "${LTO_BIN:?pa-lto needs LTO_BIN=}"; export E2E_BIN=$LTO_BIN ;; + pa-lto) : "${LTO_BIN:?pa-lto needs LTO_BIN=}"; export E2E_BIN=$LTO_BIN ;; *) echo "unknown arm $arm" >&2; exit 2 ;; esac { echo "arm=$arm tag=$tag"; date -u +%FT%TZ; free -g | sed -n 2p; sha256sum "$UP" "$E2E_BIN/leleka-inference"; head -1 /data/leleka-e2e/decode/corpus/MANIFEST.txt diff --git a/scripts/e2e/decode/ram-inventory.sh b/scripts/e2e/decode/ram-inventory.sh index cd297cd6..e2b4138a 100644 --- a/scripts/e2e/decode/ram-inventory.sh +++ b/scripts/e2e/decode/ram-inventory.sh @@ -6,7 +6,7 @@ # # Blocks: # meminfo MemTotal MemFree MemAvailable Cached Shmem AnonPages Mlocked Unevictable AnonHugePages Buffers (GiB) -# process the engine (leleka-inference), the supervisor (leleka), the gateway/daemon (leleka-daemon, strata-next, leleka-cli), the lab holder (python kar_holder*), and the +# process the engine (leleka-inference), the supervisor (leleka), the gateway/daemon (leleka-daemon, leleka-api, leleka-cli), the lab holder (python kar_holder*), and the # caller of this script (the shell that holds a `leleka seal-exec` memfd): Rss, Pss, anon/file/shmem Pss, Locked (smaps_rollup), VmLck. Shared pages (a memfd the # supervisor and the engine both map) are split by Pss, so the sum over processes does not double count them. # memfd every memfd descriptor of those processes: apparent size and ALLOCATED bytes (st_blocks), so a sparse memfd shows its holes (allocated << apparent) @@ -38,7 +38,7 @@ report_pid() { # pid name cmd done } seen=" " -for name in leleka-inferenc leleka leleka-daemon strata-next leleka-cli python3; do # comm is truncated to 15 chars: pgrep -x leleka-inference never matches +for name in leleka-inferenc leleka leleka-daemon leleka-api leleka-cli python3; do # comm is truncated to 15 chars: pgrep -x leleka-inference never matches for pid in $(pgrep -u "$USER" -x "$name" 2>/dev/null); do cmd=$(cmdline "$pid") if [ "$name" = python3 ]; then case "$cmd" in *kar_holder*|*single-copy-holder*) ;; *) continue ;; esac; fi diff --git a/scripts/e2e/decode/single-copy-ab.sh b/scripts/e2e/decode/single-copy-ab.sh index 6455c953..646df3bf 100644 --- a/scripts/e2e/decode/single-copy-ab.sh +++ b/scripts/e2e/decode/single-copy-ab.sh @@ -46,8 +46,8 @@ mkdir -p "$OUTR" "$STAMPS"; chmod 700 "$STAMPS" export LD_LIBRARY_PATH=$HOME/cuda-toolkits/cublas-12.9.1.4/lib:$HOME/cuda-toolkits/13.2.2/lib64:${LD_LIBRARY_PATH:-} # ---- guards ------------------------------------------------------------------------------------------------------------------- -for f in "$UP" "$D/tools/long-session.py" "$SC/tools/run-e2e.sh" "$BIN_NEW/leleka" "$BIN_NEW/leleka-inference" "$BIN_NEW/leleka-daemon" "$BIN_NEW/leleka-cli" "$BIN_NEW/strata-next" \ - "$BIN_BASE/leleka-inference" "$BIN_BASE/leleka-daemon" "$BIN_BASE/leleka-cli" "$BIN_BASE/strata-next" "$KAR" "$SHARD0" "$SHARD1" "$CORPUS/backend-api/src/lib.rs" "$INV"; do +for f in "$UP" "$D/tools/long-session.py" "$SC/tools/run-e2e.sh" "$BIN_NEW/leleka" "$BIN_NEW/leleka-inference" "$BIN_NEW/leleka-daemon" "$BIN_NEW/leleka-cli" "$BIN_NEW/leleka-api" \ + "$BIN_BASE/leleka-inference" "$BIN_BASE/leleka-daemon" "$BIN_BASE/leleka-cli" "$BIN_BASE/leleka-api" "$KAR" "$SHARD0" "$SHARD1" "$CORPUS/backend-api/src/lib.rs" "$INV"; do [ -r "$f" ] || { echo "missing $f" >&2; exit 3; } done case " $PHASES " in *" id "*) for f in "$RT_BASE" "$RT_NEW" "$D/tools/q_pair.py" "$D/tools/q_lib.py" "$CAP"; do [ -e "$f" ] || { echo "missing $f (id phase)" >&2; exit 3; }; done ;; esac diff --git a/scripts/e2e/decode/slots-footprint-ab.sh b/scripts/e2e/decode/slots-footprint-ab.sh index af68893f..d9a9088c 100644 --- a/scripts/e2e/decode/slots-footprint-ab.sh +++ b/scripts/e2e/decode/slots-footprint-ab.sh @@ -59,7 +59,7 @@ ours() { # $1 tag, $2 arm slots-ledger) export LELEKA_VRAM_LEDGER=1; session="--turns 2 --target-tokens 60000 --max-output 100 --min-final-tokens 40000" ;; *) echo "unknown ours arm $arm" >&2; exit 2 ;; esac - { echo "arm=$arm tag=$tag"; date -u +%FT%TZ; free -g | sed -n 2p; sha256sum "$UP" "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/strata-next + { echo "arm=$arm tag=$tag"; date -u +%FT%TZ; free -g | sed -n 2p; sha256sum "$UP" "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/leleka-api cat "$E2E_BIN/COMMIT.txt" 2>/dev/null; head -1 /data/leleka-e2e/decode/corpus/MANIFEST.txt env | grep -E '^(LELEKA_|STRATA_|E2E_)' | sort; } >"$E2E_OUT/env-arm.txt" export E2E_RUN_CMD="python3 -I $D/tools/long-session.py --src $CORPUS $session" diff --git a/scripts/e2e/decode/sparse-memfd-ab.sh b/scripts/e2e/decode/sparse-memfd-ab.sh index d1767889..2ea38869 100644 --- a/scripts/e2e/decode/sparse-memfd-ab.sh +++ b/scripts/e2e/decode/sparse-memfd-ab.sh @@ -9,7 +9,7 @@ # Install (laptop -> server, small files only): # cp scripts/e2e/decode/sparse-memfd-ab.sh /data/leleka-e2e/decode/dt/jobs/sparse-memfd-ab.sh # binaries, built once from claude/sparse-memfd in release mode and frozen read-only (record their sha256 in dt/BUILD.md): -# dt/bin-sparsememfd/{leleka,leleka-inference,leleka-daemon,leleka-cli,strata-next} the same five for both arms +# dt/bin-sparsememfd/{leleka,leleka-inference,leleka-daemon,leleka-cli,leleka-api} the same five for both arms # dt/rt-sparsememfd the leleka-runtime lib test binary (replay smoke) of the same commit # EXTENTS_SHA256=<64 hex> the pinned digest of the archive's extents, from `kar_census ARCHIVE --hash-extents` on the archive that matched its full SHA-256 (docs/kar-sparse-memfd.md) # @@ -60,7 +60,7 @@ CAP_MIB=6144 mkdir -p "$OUTR" # ---- guards -------------------------------------------------------------------------------------------------------------------- -for f in "$UP" "$D/tools/long-session.py" "$D/scripts/e2e/run-e2e.sh" "$BIN/leleka" "$BIN/leleka-inference" "$BIN/leleka-daemon" "$BIN/leleka-cli" "$BIN/strata-next" "$KAR" "$CORPUS/backend-api/src/lib.rs"; do +for f in "$UP" "$D/tools/long-session.py" "$D/scripts/e2e/run-e2e.sh" "$BIN/leleka" "$BIN/leleka-inference" "$BIN/leleka-daemon" "$BIN/leleka-cli" "$BIN/leleka-api" "$KAR" "$CORPUS/backend-api/src/lib.rs"; do [ -r "$f" ] || { echo "missing $f" >&2; exit 3; } done case " $PHASES " in *" id "*) for f in "$RT" "$D/tools/q_pair.py" "$D/tools/q_lib.py" "$CAP"; do [ -e "$f" ] || { echo "missing $f (identity phase)" >&2; exit 3; }; done ;; esac @@ -106,7 +106,7 @@ sampler() { # $1 output file; runs until killed record() { # $1 file, $2 arm, $3 tag { echo "arm=$2 tag=$3"; date -u +%FT%TZ; uname -r; nvidia-smi --query-gpu=driver_version --format=csv,noheader echo "page cache NOT dropped (no write access to /proc/sys/vm); meminfo at start:"; grep -E "MemTotal|MemAvailable|^Cached|^Shmem:|SwapFree" /proc/meminfo; free -g | sed -n 2p - echo "extents_sha256=${EXTENTS_SHA256:-none} (arm sparse only)"; sha256sum "$UP" "$BIN"/leleka "$BIN"/leleka-inference "$BIN"/leleka-daemon "$BIN"/leleka-cli "$BIN"/strata-next ${RT:+"$RT"} 2>/dev/null + echo "extents_sha256=${EXTENTS_SHA256:-none} (arm sparse only)"; sha256sum "$UP" "$BIN"/leleka "$BIN"/leleka-inference "$BIN"/leleka-daemon "$BIN"/leleka-cli "$BIN"/leleka-api ${RT:+"$RT"} 2>/dev/null cat "$BIN/COMMIT.txt" 2>/dev/null; head -1 /data/leleka-e2e/decode/corpus/MANIFEST.txt env | grep -E '^(LELEKA_|STRATA_|E2E_)' | sort; } > "$1" } diff --git a/scripts/e2e/decode/speedtrain-ab.sh b/scripts/e2e/decode/speedtrain-ab.sh index ec949a44..dcd07673 100644 --- a/scripts/e2e/decode/speedtrain-ab.sh +++ b/scripts/e2e/decode/speedtrain-ab.sh @@ -45,7 +45,7 @@ ours() { # $1 tag, $2 arm speedtrain-noseed) export LELEKA_ORIGINAL_SERVE_SEED=off ;; *) echo "unknown ours arm $arm" >&2; exit 2 ;; esac - { echo "arm=$arm tag=$tag"; date -u +%FT%TZ; free -g | sed -n 2p; sha256sum "$UP" "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/strata-next + { echo "arm=$arm tag=$tag"; date -u +%FT%TZ; free -g | sed -n 2p; sha256sum "$UP" "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/leleka-api cat "$E2E_BIN/COMMIT.txt" 2>/dev/null; head -1 /data/leleka-e2e/decode/corpus/MANIFEST.txt env | grep -E '^(LELEKA_|STRATA_|E2E_)' | sort; } >"$E2E_OUT/env-arm.txt" export E2E_RUN_CMD="python3 -I $D/tools/long-session.py --src $CORPUS $SESSION_ARGS" diff --git a/scripts/e2e/decode/speedtrain2-ab.sh b/scripts/e2e/decode/speedtrain2-ab.sh index 1021aee5..400359da 100644 --- a/scripts/e2e/decode/speedtrain2-ab.sh +++ b/scripts/e2e/decode/speedtrain2-ab.sh @@ -51,7 +51,7 @@ ours() { # $1 tag, $2 arm speedtrain-noseed | speedtrain2-noseed) ;; *) echo "unknown ours arm $arm" >&2; exit 2 ;; esac - { echo "arm=$arm tag=$tag"; date -u +%FT%TZ; free -g | sed -n 2p; sha256sum "$UP" "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/strata-next + { echo "arm=$arm tag=$tag"; date -u +%FT%TZ; free -g | sed -n 2p; sha256sum "$UP" "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/leleka-api cat "$E2E_BIN/COMMIT.txt" 2>/dev/null; head -1 /data/leleka-e2e/decode/corpus/MANIFEST.txt env | grep -E '^(LELEKA_|STRATA_|E2E_)' | sort; } >"$E2E_OUT/env-arm.txt" export E2E_RUN_CMD="python3 -I $D/tools/long-session.py --src $CORPUS $SESSION_ARGS" diff --git a/scripts/e2e/decode/speedtrain3-ab.sh b/scripts/e2e/decode/speedtrain3-ab.sh index 3f5e5850..dc8f5b9c 100644 --- a/scripts/e2e/decode/speedtrain3-ab.sh +++ b/scripts/e2e/decode/speedtrain3-ab.sh @@ -55,7 +55,7 @@ ours() { # $1 tag, $2 arm speedtrain3-res130-noseed) export LELEKA_ORIGINAL_SERVE_DECODE_RESERVE_MIB=130 ;; *) echo "unknown ours arm $arm" >&2; exit 2 ;; esac - { echo "arm=$arm tag=$tag"; date -u +%FT%TZ; free -g | sed -n 2p; sha256sum "$UP" "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/strata-next + { echo "arm=$arm tag=$tag"; date -u +%FT%TZ; free -g | sed -n 2p; sha256sum "$UP" "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/leleka-api cat "$E2E_BIN/COMMIT.txt" 2>/dev/null; head -1 /data/leleka-e2e/decode/corpus/MANIFEST.txt env | grep -E '^(LELEKA_|STRATA_|E2E_)' | sort; } >"$E2E_OUT/env-arm.txt" export E2E_RUN_CMD="python3 -I $D/tools/long-session.py --src $CORPUS $SESSION_ARGS" diff --git a/scripts/e2e/decode/windowpolicy-ab.sh b/scripts/e2e/decode/windowpolicy-ab.sh index 98c64223..a7ddd524 100644 --- a/scripts/e2e/decode/windowpolicy-ab.sh +++ b/scripts/e2e/decode/windowpolicy-ab.sh @@ -73,7 +73,7 @@ ours() { # $1 tag, $2 run dir, $3 bin dir, $4 extra env words unset LELEKA_HUGEPAGES LELEKA_BANK_THP LELEKA_DRAFT_FUSED_COMMIT LELEKA_DRAFT_ROUND LELEKA_SM120_ATTN_DAILY_MTP LELEKA_SPEC LELEKA_SPEC_ADAPTIVE LELEKA_SPEC_POLICY LELEKA_SPEC_EXPLORE LELEKA_SPEC_DRAFT_STEP_MS LELEKA_SPEC_MARGIN LELEKA_SPEC_MIN_P_LO LELEKA_SPEC_COST_ALPHA LELEKA_SPEC_DECAY LELEKA_SPEC_BIAS_RATE export LELEKA_ORIGINAL_SERVE_SEED=off LELEKA_ORIGINAL_SERVE_PCIE_FRAC=$PCIE_FRAC for kv in $xenv; do export "$kv"; done - { echo "tag=$tag bin=$bin extra=[$xenv]"; date -u +%FT%TZ; free -g | sed -n 2p; uptime; sha256sum "$UP" "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/strata-next + { echo "tag=$tag bin=$bin extra=[$xenv]"; date -u +%FT%TZ; free -g | sed -n 2p; uptime; sha256sum "$UP" "$E2E_BIN"/leleka-inference "$E2E_BIN"/leleka-daemon "$E2E_BIN"/leleka-cli "$E2E_BIN"/leleka-api cat "$E2E_BIN/COMMIT.txt" 2>/dev/null; head -1 /data/leleka-e2e/decode/corpus/MANIFEST.txt env | grep -E '^(LELEKA_|STRATA_|E2E_)' | sort; } >"$R/env-arm.txt" export E2E_RUN_CMD="bash $DRT/tools/ts-wrap.sh $R/client.ts.log python3 -I $D/tools/long-session.py --src $CORPUS $SESSION_ARGS" diff --git a/scripts/e2e/decode/windowpolicy-install.sh b/scripts/e2e/decode/windowpolicy-install.sh index 3717ffc7..e0eee934 100644 --- a/scripts/e2e/decode/windowpolicy-install.sh +++ b/scripts/e2e/decode/windowpolicy-install.sh @@ -25,7 +25,7 @@ chmod a-w "$WP/tools" "$WP/scripts/e2e" "$WP/scripts" { sha256sum "$WP"/tools/* "$WP"/scripts/e2e/* "$DRT"/ts-wrap.sh for b in "$@"; do - for x in leleka-inference leleka-daemon leleka-cli strata-next; do + for x in leleka-inference leleka-daemon leleka-cli leleka-api; do sha256sum "$D/$b/$x" done done diff --git a/scripts/e2e/e2e_client.py b/scripts/e2e/e2e_client.py index f7998889..c3766d97 100644 --- a/scripts/e2e/e2e_client.py +++ b/scripts/e2e/e2e_client.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -"""End-to-end client for `strata-next` in front of `leleka-inference` (offline TEST DRIVER, not shipped). +"""End-to-end client for `leleka-api` in front of `leleka-inference` (offline TEST DRIVER, not shipped). Sends Codex-shaped Responses requests and checks the wire behaviour. Standard library only. The API key is read from --key-file and is never printed or written to the results. diff --git a/scripts/e2e/evidence/capture.py b/scripts/e2e/evidence/capture.py index 4ccfc2f8..84e778af 100644 --- a/scripts/e2e/evidence/capture.py +++ b/scripts/e2e/evidence/capture.py @@ -6,7 +6,7 @@ never in Git. CLI v1 (fixed by the leaf): - capture.py --arm ours --meta META.json --replay-output REPLAY.json --engine-log strata-next.log --inference-log inference.log + capture.py --arm ours --meta META.json --replay-output REPLAY.json --engine-log leleka-api.log --inference-log inference.log --power-series POWER.csv --out REC.json [--analyze-session PATH] Exit codes @@ -20,14 +20,14 @@ Exit codes How the pieces are obtained analyze_session.py is a flat script (argparse and the whole report at module level, no main guard), so it is NEVER imported: it is wrapped by SUBPROCESS and its `--csv` output is parsed (STRA-251 round-5 re-cut). The two logs are staged under their fixed names - (strata-next.log, inference.log) in a private temporary directory, with CRLF folded to LF (raw bytes are never stored; comparisons are on + (leleka-api.log, inference.log) in a private temporary directory, with CRLF folded to LF (raw bytes are never stored; comparisons are on the normalised text), because the script reads a RUN directory. --meta (written by the runner, STRA-257): arm, series_id, block, pair_id, position, predecessor, schedule_hash, h0_id, machine (a real series writes laptop|server: validity.py requires hardware.machine_role == the declared machine, STRA-326) and ours_build_id (an object commit / target_triple / cargo_features / profile_value_sha256 = the FROZEN build id, STRA-304/322). Optional: owner_attestation {present, identifier, time_utc}, foreign_load {samples}, synthetic, long_session_argv, source_snapshot_sha256. --replay-output: the run JSON of replay_session.py (STRA-308); status must be "ok". - Engine logs (inference.log first, then strata-next.log; CRLF tolerated, a trailing CR is stripped): + Engine logs (inference.log first, then leleka-api.log; CRLF tolerated, a trailing CR is stripped): `leleka-serve cpu: ...` and `leleka-serve gpu: ...` lines are copied VERBATIM, with the prefix, into kernel_lines (cpu lines required). `leleka-serve gpu N: , cc ...` gives gpu_name, `leleka-serve cpu: logical ...: ; ...` gives cpu_model, `leleka-serve gpu: CUDA driver X.Y ...` gives cuda_version. @@ -226,7 +226,7 @@ def run_analyze(analyze_path, strata_lines, inference_lines): with tempfile.TemporaryDirectory(prefix="leleka-capture-") as tmp: run_dir = os.path.join(tmp, "run") os.mkdir(run_dir) - for name, lines in (("strata-next.log", strata_lines), ("inference.log", inference_lines)): + for name, lines in (("leleka-api.log", strata_lines), ("inference.log", inference_lines)): with open(os.path.join(run_dir, name), "w", encoding="utf-8", newline="\n") as f: f.write("\n".join(lines)) csv_path = os.path.join(tmp, "trace.csv") @@ -247,7 +247,7 @@ def run_analyze(analyze_path, strata_lines, inference_lines): rows = list(reader) columns = reader.fieldnames or [] if not rows: - raise fail_input("engine logs: no `generation done:` lines for analyze_session.py (is --engine-log strata-next.log?)") + raise fail_input("engine logs: no `generation done:` lines for analyze_session.py (is --engine-log leleka-api.log?)") missing = [c for c in CSV_COLUMNS if c not in columns] if missing: raise Fail(EXIT_ANALYZE, "analyze_session.py --csv columns drifted, missing: %s" % ", ".join(missing)) @@ -650,7 +650,7 @@ def main(argv=None): ap.add_argument("--arm", required=True) ap.add_argument("--meta", required=True) ap.add_argument("--replay-output", required=True) - ap.add_argument("--engine-log", required=True, help="strata-next.log") + ap.add_argument("--engine-log", required=True, help="leleka-api.log") ap.add_argument("--inference-log", required=True, help="inference.log") ap.add_argument("--power-series", required=True) ap.add_argument("--out", required=True) diff --git a/scripts/e2e/evidence/test_capture.py b/scripts/e2e/evidence/test_capture.py index 1f76a622..38b51839 100644 --- a/scripts/e2e/evidence/test_capture.py +++ b/scripts/e2e/evidence/test_capture.py @@ -113,7 +113,7 @@ class Run: if engine_edit: strata, inf = engine_edit(strata, inf) self.paths = {} - for name, body in (("strata-next.log", "\n".join(strata) + "\n"), ("inference.log", "\n".join(inf) + "\n")): + for name, body in (("leleka-api.log", "\n".join(strata) + "\n"), ("inference.log", "\n".join(inf) + "\n")): self._write(name, body.replace("\n", nl)) self._write("meta.json", json.dumps(self.meta)) self._write("replay.json", json.dumps(self.replay)) @@ -132,7 +132,7 @@ class Run: def argv(self, arm="ours", extra=()): return [sys.executable, CAPTURE, "--arm", arm, "--meta", self.paths["meta.json"], "--replay-output", self.paths["replay.json"], - "--engine-log", self.paths["strata-next.log"], "--inference-log", self.paths["inference.log"], "--power-series", self.paths["power.csv"], + "--engine-log", self.paths["leleka-api.log"], "--inference-log", self.paths["inference.log"], "--power-series", self.paths["power.csv"], "--out", self.out] + list(extra) def run(self, path_dir=None, extra=(), arm="ours", env_extra=None): diff --git a/scripts/e2e/fake_llm_engine.py b/scripts/e2e/fake_llm_engine.py index 3a3efe18..bb3fba72 100644 --- a/scripts/e2e/fake_llm_engine.py +++ b/scripts/e2e/fake_llm_engine.py @@ -4,7 +4,7 @@ fake_runtime ... --engine fake_llm_engine.py --engine-arg TOKENIZER_DIR --engine-arg STRATA_NEXT_BINARY It speaks the stdio wire protocol (`READY`, `GEN [k=v...] ids`, `T `, `DONE ...`, `STOP`, `QUIT`), decodes the prompt with -`strata-next model detokenize`, picks a canned reply from the last user turn and streams it token by token. It exists so the e2e +`leleka-api model detokenize`, picks a canned reply from the last user turn and streams it token by token. It exists so the e2e client and the API stack can be exercised without a GPU and so the client's own checks can be tested; it says nothing about the real model. Prefix reuse is emulated as the common prefix with the previous prompt. """ @@ -75,7 +75,7 @@ def reply(prompt, max_new): if "programming languages, comma" in u: return pre + "Rust, C, Python, Go, Zig" if "Summarize" in u or "Question:" in u: - return pre + "The worker lives in control-plane/src/backend_worker.rs in the strata-control crate." + return pre + "The worker lives in control-plane/src/backend_worker.rs in the leleka-control-plane crate." return pre + "OK" diff --git a/scripts/e2e/hexagonal/arch-install.sh b/scripts/e2e/hexagonal/arch-install.sh index cbc2c6cd..b8bee352 100644 --- a/scripts/e2e/hexagonal/arch-install.sh +++ b/scripts/e2e/hexagonal/arch-install.sh @@ -2,7 +2,7 @@ # Install the measurement tree of the hexagonal-architecture task (STRA-338) on rnr5090 and freeze it. # # bash arch-install.sh BASE_DIR CAND_DIR BASE_RT CAND_RT -# BASE_DIR / CAND_DIR directories that hold leleka-inference leleka-daemon leleka-cli strata-next (main and the branch) +# BASE_DIR / CAND_DIR directories that hold leleka-inference leleka-daemon leleka-cli leleka-api (main and the branch) # BASE_RT / CAND_RT the release test binaries of leleka-runtime (cargo test --no-run --release --lib, with -p leleka-runtime on a tree before STRA-338 S22 and -p leleka-engine-qwen35-cuda after it) # # Result under /data/leleka-e2e/hexagonal (the task's own directory; nothing outside it is written): @@ -36,7 +36,7 @@ install_tools() { # the shared helpers and scripts, installed once install_binaries() { # $1 = main or cand local kind=$1 dir rt x dir=$([ "$kind" = main ] && echo "$BASE" || echo "$CAND"); rt=$([ "$kind" = main ] && echo "$BASE_RT" || echo "$CAND_RT") - for x in leleka-inference leleka-daemon leleka-cli strata-next; do place "$dir/$x" "$HX/dt/bin-$kind/$x" 0555; done + for x in leleka-inference leleka-daemon leleka-cli leleka-api; do place "$dir/$x" "$HX/dt/bin-$kind/$x" 0555; done place "$rt" "$HX/dt/rt-$kind" 0555 } diff --git a/scripts/e2e/kar-off/kar_off_common.sh b/scripts/e2e/kar-off/kar_off_common.sh index 9b5de1eb..60fec14a 100644 --- a/scripts/e2e/kar-off/kar_off_common.sh +++ b/scripts/e2e/kar-off/kar_off_common.sh @@ -32,7 +32,7 @@ ko_guard() { local shmem; shmem=$(awk '/^Shmem:/{print int($2/1048576)}' /proc/meminfo) [ "$shmem" -lt 8 ] || { echo "Shmem is $shmem GiB: a sealed memfd is still resident"; return 3; } if [ -n "$(nvidia-smi --query-compute-apps=pid --format=csv,noheader 2>/dev/null)" ]; then echo "something uses the GPU"; return 3; fi - if pgrep -u "$USER" -x 'leleka-inference|strata-next|leleka-daemon' >/dev/null; then echo "a stack process exists"; return 3; fi + if pgrep -u "$USER" -x 'leleka-inference|leleka-api|leleka-daemon' >/dev/null; then echo "a stack process exists"; return 3; fi for p in 18766 18080 8081 8090; do ss -ltn "sport = :$p" 2>/dev/null | grep -q LISTEN && { echo "port $p in use"; return 3; }; done export LD_LIBRARY_PATH=$CUBLAS:$HOME/cuda-toolkits/13.2.2/lib64:${LD_LIBRARY_PATH:-} } diff --git a/scripts/e2e/kar-off/kar_off_install.sh b/scripts/e2e/kar-off/kar_off_install.sh index 86f660e3..3d4692d5 100644 --- a/scripts/e2e/kar-off/kar_off_install.sh +++ b/scripts/e2e/kar-off/kar_off_install.sh @@ -12,7 +12,7 @@ chmod u+w "$K"/tools/* "$K"/pkg/bin/leleka "$K"/*.sha256 2>/dev/null || true for f in "$SRC"/*.sh "$SRC"/*.py; do [ -f "$f" ] && install -m 0555 "$f" "$K/tools/$(basename "$f")"; done install -m 0555 /data/leleka-e2e/spd-gap/tools/replay_fwd.py "$K/tools/replay_fwd.py" OURS=$CMP/ours-pkg -for b in leleka-cli leleka-daemon leleka-inference leleka-seal-exec strata-next; do [ "$b" = leleka-inference ] && [ -z "$ENG" ] && [ -e "$K/pkg/bin/$b" ] && continue; ln -f "$OURS/bin/$b" "$K/pkg/bin/$b" 2>/dev/null || cp -p "$OURS/bin/$b" "$K/pkg/bin/$b"; done +for b in leleka-cli leleka-daemon leleka-inference leleka-seal-exec leleka-api; do [ "$b" = leleka-inference ] && [ -z "$ENG" ] && [ -e "$K/pkg/bin/$b" ] && continue; ln -f "$OURS/bin/$b" "$K/pkg/bin/$b" 2>/dev/null || cp -p "$OURS/bin/$b" "$K/pkg/bin/$b"; done install -m 0555 "$BIN" "$K/pkg/bin/leleka" [ -n "$ENG" ] && install -m 0555 "$ENG" "$K/pkg/bin/leleka-inference" python3 -I - "$OURS/MANIFEST.json" "$K/pkg/MANIFEST.json" "$K/pkg/bin" <<'PY' diff --git a/scripts/e2e/laptop/laptop-pair.ps1 b/scripts/e2e/laptop/laptop-pair.ps1 index e8a09053..3b4eb872 100644 --- a/scripts/e2e/laptop/laptop-pair.ps1 +++ b/scripts/e2e/laptop/laptop-pair.ps1 @@ -154,7 +154,7 @@ function Invoke-Install { $commit = (& git -C $src rev-parse HEAD).Trim() $corpusCommit = (& git -C $src rev-parse $CorpusCommit).Trim() if (-not $OursBinSrc) { $OursBinSrc = Join-Path $src 'dist\bin' } - foreach ($n in 'leleka.exe', 'strata-next.exe', 'leleka-inference.exe', 'leleka-daemon.exe', 'leleka-cli.exe') { + foreach ($n in 'leleka.exe', 'leleka-api.exe', 'leleka-inference.exe', 'leleka-daemon.exe', 'leleka-cli.exe') { if (-not (Test-Path -LiteralPath (Join-Path $OursBinSrc $n))) { Say ('REFUSED: ' + $n + ' missing in ' + $OursBinSrc + ' (scripts\windows\build-release.ps1)'); return 3 } } if (-not $Python) { Say 'REFUSED: no python on PATH (Python 3.9 stdlib is enough); pass -Python'; return 3 } @@ -164,9 +164,9 @@ function Invoke-Install { @{ From = 'scripts\laptop\win\guard.ps1' }, @{ From = 'scripts\laptop\win\watchdog.ps1' }, @{ From = 'scripts\laptop\win\state.ps1' }, @{ From = 'docs\experiments\laptop-pair-3080.thresholds.json' }) foreach ($t in $toolFiles) { Copy-Item -LiteralPath (Join-Path $src $t.From) -Destination $Tools } - foreach ($n in 'leleka.exe', 'strata-next.exe', 'leleka-inference.exe', 'leleka-daemon.exe', 'leleka-cli.exe') { Copy-Item -LiteralPath (Join-Path $OursBinSrc $n) -Destination $OursBin } + foreach ($n in 'leleka.exe', 'leleka-api.exe', 'leleka-inference.exe', 'leleka-daemon.exe', 'leleka-cli.exe') { Copy-Item -LiteralPath (Join-Path $OursBinSrc $n) -Destination $OursBin } $rustc = (& rustc --version) -join ' ' - Write-Text (Join-Path $OursBin 'BUILD.txt') ("tree_commit=" + $commit + "`nsource=" + $OursBinSrc + "`nbuild=scripts\windows\build-release.ps1 (cargo build --release --locked, strata-desktop-core --features sm86)`nrustc=" + $rustc + "`n") + Write-Text (Join-Path $OursBin 'BUILD.txt') ("tree_commit=" + $commit + "`nsource=" + $OursBinSrc + "`nbuild=scripts\windows\build-release.ps1 (cargo build --release --locked, leleka-engine-host --features sm86)`nrustc=" + $rustc + "`n") # corpus: git archive of crates/ at the corpus commit (LF, deterministic), piped into the Windows tar (no intermediate file) $corpus = Join-Path $Inputs 'corpus' [void](New-Item -ItemType Directory -Force -Path $corpus) @@ -391,8 +391,8 @@ function Invoke-SelfTest { function Stop-Tree([int]$ProcId) { if ($ProcId -gt 0) { & taskkill.exe /PID $ProcId /T /F 2>&1 | Out-Null } } function Get-EngineProcs([string]$Kind) { - if ($Kind -eq 'ours') { return @(Get-Process -ErrorAction SilentlyContinue | Where-Object { $_.ProcessName -like 'leleka*' -or $_.ProcessName -eq 'strata-next' }) } - return @(Get-Process -ErrorAction SilentlyContinue | Where-Object { $_.ProcessName -like 'strata*' -and $_.ProcessName -ne 'strata-next' }) + if ($Kind -eq 'ours') { return @(Get-Process -ErrorAction SilentlyContinue | Where-Object { $_.ProcessName -like 'leleka*' -or $_.ProcessName -eq 'leleka-api' }) } + return @(Get-Process -ErrorAction SilentlyContinue | Where-Object { $_.ProcessName -like 'strata*' -and $_.ProcessName -ne 'leleka-api' }) } function Invoke-Arm { diff --git a/scripts/e2e/run-e2e.sh b/scripts/e2e/run-e2e.sh index d6fb3370..31975197 100644 --- a/scripts/e2e/run-e2e.sh +++ b/scripts/e2e/run-e2e.sh @@ -2,14 +2,14 @@ # Start the whole production stack on the GPU server and run the e2e client against it, then stop it and check for leaks. # # leleka-inference (Original serve backend, sealed KAR memfd inherited from the holder) -# leleka-daemon + leleka-cli load-mtp (explicit load; strata-next only attaches) -# strata-next serve (runtime block) <- scripts/e2e/e2e_client.py +# leleka-daemon + leleka-cli load-mtp (explicit load; leleka-api only attaches) +# leleka-api serve (runtime block) <- scripts/e2e/e2e_client.py # # MUST run inside a holder job (it needs LELEKA_STRA169_KAR_FD, a sealed memfd). It refuses to start otherwise: the model process # is never started outside the holder (MODEL.lock rules). Never builds anything. # # Environment (all optional except where noted): -# E2E_BIN directory with leleka-inference leleka-daemon leleka-cli strata-next (default ~/work/leleka-e2e/bin-sm120) +# E2E_BIN directory with leleka-inference leleka-daemon leleka-cli leleka-api (default ~/work/leleka-e2e/bin-sm120) # E2E_OUT output directory for logs and results.json (default ~/work/leleka-e2e/runs/) # E2E_CLIENT scripts/e2e/e2e_client.py (default next to this script) # E2E_CONTEXT directory whose .rs/.md files make the long prompt (default ~/work/leleka-e2e/context) @@ -52,9 +52,9 @@ CLOSE_FD=; [ -n "$FD" ] && CLOSE_FD="$FD>&-" KAR_ARG="--kar-archive-fd $FD"; [ -n "$KARFILE" ] && KAR_ARG="--kar-archive-file \"$KARFILE\"" [ -d "$G/MODEL.lock" ] || { echo "refusing to start: $G/MODEL.lock is not held" >&2; exit 3; } -for b in leleka-inference leleka-daemon leleka-cli strata-next; do [ -x "$BIN/$b" ] || { echo "missing $BIN/$b" >&2; exit 3; }; done -if pgrep -u "$USER" -x 'leleka-inference|strata-next|leleka-daemon' >/dev/null; then - echo "refusing to start: a stack process of this user is already running" >&2; pgrep -a -u "$USER" -x 'leleka-inference|strata-next|leleka-daemon' >&2; exit 3 +for b in leleka-inference leleka-daemon leleka-cli leleka-api; do [ -x "$BIN/$b" ] || { echo "missing $BIN/$b" >&2; exit 3; }; done +if pgrep -u "$USER" -x 'leleka-inference|leleka-api|leleka-daemon' >/dev/null; then + echo "refusing to start: a stack process of this user is already running" >&2; pgrep -a -u "$USER" -x 'leleka-inference|leleka-api|leleka-daemon' >&2; exit 3 fi if [ -n "$(nvidia-smi --query-compute-apps=pid --format=csv,noheader 2>/dev/null)" ]; then echo "refusing to start: something else already uses the GPU" >&2; nvidia-smi --query-compute-apps=pid,used_memory --format=csv,noheader >&2; exit 3 @@ -73,7 +73,7 @@ mkrand() { head -c 36 /dev/urandom | base64 | tr -d '\n'; } export LELEKA_RUNTIME_TOKEN=$(mkrand) LELEKA_GATEWAY_TOKEN=$(mkrand) KEYFILE=$STATE/api-key rm -f "$KEYFILE" -"$BIN/strata-next" api-key init --file "$KEYFILE" >/dev/null 2>"$OUT/api-key-init.err" || { log "api-key init failed"; cat "$OUT/api-key-init.err"; exit 4; } +"$BIN/leleka-api" api-key init --file "$KEYFILE" >/dev/null 2>"$OUT/api-key-init.err" || { log "api-key init failed"; cat "$OUT/api-key-init.err"; exit 4; } chmod 600 "$KEYFILE" # engine tuning exactly as the 98x bring-up jobs (VRAM expert tier, placeholder profile); serve profile prints one line per request @@ -133,12 +133,12 @@ stop_one() { # name pid grace } cleanup() { log "shutting down" - stop_one strata-next "$PID_STR" 30 + stop_one leleka-api "$PID_STR" 30 stop_one leleka-daemon "$PID_DAE" 30 stop_one leleka-inference "$PID_INF" 120 sleep 2 log "left over processes of this stack (expect none):" - pgrep -a -u "$USER" -x 'leleka-inference|strata-next|leleka-daemon' || echo " none" + pgrep -a -u "$USER" -x 'leleka-inference|leleka-api|leleka-daemon' || echo " none" log "GPU compute apps (expect none):" nvidia-smi --query-compute-apps=pid,used_memory --format=csv,noheader || true nvidia-smi --query-gpu=memory.used --format=csv,noheader || true @@ -149,7 +149,7 @@ trap cleanup EXIT # ---- tokenizer assets (offline, CPU) ------------------------------------------------------------------------------ if [ ! -d "$TOK/tokenizer" ]; then log "extracting tokenizer assets" - "$BIN/strata-next" model extract-tokenizer "$A/model/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf" --output "$TOK" >"$OUT/extract-tokenizer.log" 2>&1 || { log "extract-tokenizer failed"; tail -5 "$OUT/extract-tokenizer.log"; exit 4; } + "$BIN/leleka-api" model extract-tokenizer "$A/model/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf" --output "$TOK" >"$OUT/extract-tokenizer.log" 2>&1 || { log "extract-tokenizer failed"; tail -5 "$OUT/extract-tokenizer.log"; exit 4; } fi ls "$TOK" "$TOK/tokenizer" 2>&1 | head -5 @@ -196,15 +196,15 @@ log "model ready after ${LOAD_S}s" echo "load_seconds=$LOAD_S" >"$OUT/load.txt" # ---- API --------------------------------------------------------------------------------------------------------- -eval "\"$BIN/strata-next\" serve --config \"$STATE/strata.json\" $CLOSE_FD >\"$OUT/strata-next.log\" 2>&1 &" +eval "\"$BIN/leleka-api\" serve --config \"$STATE/strata.json\" $CLOSE_FD >\"$OUT/leleka-api.log\" 2>&1 &" PID_STR=$! -if ! "$BIN/strata-next" wait-ready --url http://127.0.0.1:8081 --model qwen-iq3 --key-file "$KEYFILE" --timeout-s 180 >"$OUT/wait-ready.log" 2>&1; then - log "strata-next never became ready"; tail -20 "$OUT/wait-ready.log"; tail -30 "$OUT/strata-next.log"; exit 6 +if ! "$BIN/leleka-api" wait-ready --url http://127.0.0.1:8081 --model qwen-iq3 --key-file "$KEYFILE" --timeout-s 180 >"$OUT/wait-ready.log" 2>&1; then + log "leleka-api never became ready"; tail -20 "$OUT/wait-ready.log"; tail -30 "$OUT/leleka-api.log"; exit 6 fi -log "strata-next ready" +log "leleka-api ready" echo "pids inference=$PID_INF daemon=$PID_DAE strata=$PID_STR" rss() { awk '/VmRSS/{print int($2/1024)" MiB"}' /proc/$1/status; } -log "rss after load: inference $(rss "$PID_INF"), strata-next $(rss "$PID_STR"), gpu $(nvidia-smi --query-gpu=memory.used --format=csv,noheader)" +log "rss after load: inference $(rss "$PID_INF"), leleka-api $(rss "$PID_STR"), gpu $(nvidia-smi --query-gpu=memory.used --format=csv,noheader)" # ---- client ------------------------------------------------------------------------------------------------------ if [ -n "${E2E_STATUS_FILE:-}" ]; then bash "$HERE/status_writer.sh" "$OUT" "$E2E_STATUS_FILE" "${E2E_STATUS_S:-60}" >/dev/null 2>&1 & PID_STATUS=$!; fi @@ -224,7 +224,7 @@ kill "$PID_SAMPLER" ${PID_STATUS:-} 2>/dev/null log "client exit status $RC" log "engine stderr tail (request outcome lines):" grep -E 'leleka-serve request|panicked|ERROR|error' "$OUT/inference.log" | tail -n 15 | cut -c1-300 -log "strata-next stderr (non-empty lines, head):" -grep -v '^$' "$OUT/strata-next.log" | head -n 15 | cut -c1-300 +log "leleka-api stderr (non-empty lines, head):" +grep -v '^$' "$OUT/leleka-api.log" | head -n 15 | cut -c1-300 echo "$RC" >"$OUT/client.rc" exit "$RC" diff --git a/scripts/e2e/run-fake.sh b/scripts/e2e/run-fake.sh index 6c7929f8..53355aa9 100644 --- a/scripts/e2e/run-fake.sh +++ b/scripts/e2e/run-fake.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash -# Run e2e_client.py against strata-next in front of a scripted fake engine (no GPU, no model): TEST TOOLING for the client itself. +# Run e2e_client.py against leleka-api in front of a scripted fake engine (no GPU, no model): TEST TOOLING for the client itself. # run-fake.sh STRATA_NEXT FAKE_RUNTIME TOKENIZER_DIR OUT_DIR [client args...] -# fake_runtime = `cargo build --release -p strata-desktop-core --example fake_runtime`; its engine is fake_llm_engine.py. +# fake_runtime = `cargo build --release -p leleka-engine-host --example fake_runtime`; its engine is fake_llm_engine.py. set -uo pipefail HERE=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) SN=$1 FAKE=$2 TOK=$3 OUT=$4; shift 4 @@ -20,10 +20,10 @@ cat >"$OUT/strata.json" <"$OUT/strata-next.log" 2>&1 & +"$SN" serve --config "$OUT/strata.json" >"$OUT/leleka-api.log" 2>&1 & SPID=$! trap 'kill -INT $SPID 2>/dev/null; pkill -P $$ 2>/dev/null; sleep 1; pkill -f fake_runtime 2>/dev/null; true' EXIT -"$SN" wait-ready --url http://127.0.0.1:18081 --model qwen-iq3 --key-file "$KEY" --timeout-s 60 >"$OUT/wait-ready.log" 2>&1 || { echo "not ready"; cat "$OUT/wait-ready.log"; tail "$OUT/strata-next.log"; exit 6; } +"$SN" wait-ready --url http://127.0.0.1:18081 --model qwen-iq3 --key-file "$KEY" --timeout-s 60 >"$OUT/wait-ready.log" 2>&1 || { echo "not ready"; cat "$OUT/wait-ready.log"; tail "$OUT/leleka-api.log"; exit 6; } [ -n "${E2E_FAKE_HOLD:-}" ] && { echo "holding the stack for $E2E_FAKE_HOLD s (manual debugging)"; sleep "$E2E_FAKE_HOLD"; exit 0; } python3 -I "$HERE/e2e_client.py" --base http://127.0.0.1:18081 --key-file "$KEY" --model qwen-iq3 --out "$OUT/results.json" \ --context-dir "${E2E_CONTEXT:-$HERE/../../control-plane/src}" --pids "strata=$SPID" "$@" diff --git a/scripts/e2e/status_writer.sh b/scripts/e2e/status_writer.sh index e37a51c2..21c2ba36 100644 --- a/scripts/e2e/status_writer.sh +++ b/scripts/e2e/status_writer.sh @@ -5,7 +5,7 @@ t0=$(date +%s) echo "# $(date -u +%FT%TZ) session $(basename "$out") started" >>"$status" while :; do sleep "$every" - log="$out/strata-next.log" + log="$out/leleka-api.log" n=$(grep -c 'generation done:' "$log" 2>/dev/null) last=$(grep 'generation done:' "$log" 2>/dev/null | tail -1) ctx=$(echo "$last" | sed -n 's/.*prompt_tokens=\([0-9]*\).*/\1/p') diff --git a/scripts/gpu-bringup/host_sanity.sh b/scripts/gpu-bringup/host_sanity.sh index 035049a8..7fd64e2f 100755 --- a/scripts/gpu-bringup/host_sanity.sh +++ b/scripts/gpu-bringup/host_sanity.sh @@ -53,7 +53,7 @@ if have ss; then ports="$(ss -ltnH 2>/dev/null | awk '{print $4}' | grep -E ':(180[0-9][0-9]|8080|11434)$' || true)" [ -n "$ports" ] && info "listening on: $(echo "$ports" | tr '\n' ' ')(tunnels/services live here)" || pass "no strata-range listeners" fi -for d in "$HOME/.cache/strata-next" "$HOME/.strata-next" "$HOME/.local/bin"; do [ -e "$d" ] && info "existing, DO NOT TOUCH: $d"; done +for d in "$HOME/.cache/leleka-api" "$HOME/.leleka-api" "$HOME/.local/bin"; do [ -e "$d" ] && info "existing, DO NOT TOUCH: $d"; done echo "== disk and memory" free_gib="$(df -Pk "$HOME" | awk 'NR==2 {printf "%d", $4/1048576}')" diff --git a/scripts/gpu-bringup/regress_3080.sh b/scripts/gpu-bringup/regress_3080.sh index 9d0662e5..67d61e81 100755 --- a/scripts/gpu-bringup/regress_3080.sh +++ b/scripts/gpu-bringup/regress_3080.sh @@ -135,7 +135,7 @@ nvidia-smi --query-gpu=name,compute_cap,memory.total,memory.used --format=csv,no item companions python3 -B scripts/gpu-bringup/sm86_assets.py check item unit-driver cargo test --locked --release -p leleka-cuda-driver --features cuda-driver,sm86 --lib item unit-runtime cargo test --locked --release -p leleka-engine-qwen35-cuda --features sm86 --lib -item build-binaries cargo build --locked --release -p strata-desktop-core --features sm86 --bins +item build-binaries cargo build --locked --release -p leleka-engine-host --features sm86 --bins # smoke groups: one run of the repo's runner (it orders groups by dependency), reported per group run_smokes=1 diff --git a/scripts/gpu-bringup/remote_sync.sh b/scripts/gpu-bringup/remote_sync.sh index e10eef42..831a463f 100755 --- a/scripts/gpu-bringup/remote_sync.sh +++ b/scripts/gpu-bringup/remote_sync.sh @@ -126,7 +126,7 @@ rustc --version; cargo --version; cc --version | head -1 echo "== cargo fetch (needs crates.io; fails fast if the host is offline)" cargo fetch --locked echo "== release build: leleka-cli leleka-daemon leleka-inference" -${nice}cargo build --release --locked $jf -p strata-desktop-core --bin leleka-cli --bin leleka-daemon --bin leleka-inference +${nice}cargo build --release --locked $jf -p leleka-engine-host --bin leleka-cli --bin leleka-daemon --bin leleka-inference echo "== test binaries (not run): cuda-driver with --features cuda-driver" ${nice}cargo test --no-run --locked $jf $test_profile -p leleka-cuda-driver --features cuda-driver echo "== test binaries (not run): leleka-engine-qwen35-cuda" diff --git a/scripts/gpu-bringup/tests/test_gpu_bringup.py b/scripts/gpu-bringup/tests/test_gpu_bringup.py index d2101830..52735fa6 100644 --- a/scripts/gpu-bringup/tests/test_gpu_bringup.py +++ b/scripts/gpu-bringup/tests/test_gpu_bringup.py @@ -934,7 +934,7 @@ class RemoteSyncScript(unittest.TestCase): p = self.run_sync("build", "--jobs", "4") self.assertEqual(p.returncode, 0, p.stderr) script = Path(str(self.log) + ".script").read_text() - self.assertIn("cargo build --release --locked -j 4 -p strata-desktop-core --bin leleka-cli --bin leleka-daemon --bin leleka-inference", script) + self.assertIn("cargo build --release --locked -j 4 -p leleka-engine-host --bin leleka-cli --bin leleka-daemon --bin leleka-inference", script) self.assertIn("cargo test --no-run --locked -j 4 -p leleka-cuda-driver --features cuda-driver", script) self.assertIn("-p leleka-engine-qwen35-cuda", script) self.assertIn("nice -n 10", script) diff --git a/scripts/install-pinned-rustup.sh b/scripts/install-pinned-rustup.sh index 484997e6..eaa1010b 100755 --- a/scripts/install-pinned-rustup.sh +++ b/scripts/install-pinned-rustup.sh @@ -28,7 +28,7 @@ import sys import urllib.request request = urllib.request.Request( - sys.argv[1], headers={"User-Agent": "strata-next-pinned-rustup-bootstrap/1"} + sys.argv[1], headers={"User-Agent": "leleka-api-pinned-rustup-bootstrap/1"} ) with urllib.request.urlopen(request, timeout=120) as response: with open(sys.argv[2], "wb") as output: diff --git a/scripts/install-qwen-native-menu.py b/scripts/install-qwen-native-menu.py index e7b55758..2c806690 100644 --- a/scripts/install-qwen-native-menu.py +++ b/scripts/install-qwen-native-menu.py @@ -10,7 +10,7 @@ import tempfile MARKER = '# Strata Next native picker integration v1' PROFILE_MARKER = '# Strata Next native picker profile integration v1' HELPER_MARKER = '# Strata Next native picker profile v1' -NATIVE = '''STRATA_SWITCH_HELPER = '/home/para/.cache/strata-next/model-switch.py' +NATIVE = '''STRATA_SWITCH_HELPER = '/home/para/.cache/leleka-api/model-switch.py' STRATA_NATIVE_MODEL = dict(id='strata-native', label='Flash-Next IQ3_S · Native Responses · автоматичне перемикання', backend='strata-native', maxContext=262144, bytes=84525205664) diff --git a/scripts/install-qwen-native.py b/scripts/install-qwen-native.py index c20636c7..93c3cec5 100644 --- a/scripts/install-qwen-native.py +++ b/scripts/install-qwen-native.py @@ -49,7 +49,7 @@ replace(" models = read('/v1/models')['data']", ''' if selected['backend'] if parsed.hostname not in {'127.0.0.1', 'localhost', '::1'}: raise RuntimeError('Native preview requires a loopback URL; use an SSH tunnel for the GPU server') observed = read('/status') - if observed.get('service') != 'strata-control' or not observed.get('ready'): + if observed.get('service') != 'leleka-control-plane' or not observed.get('ready'): raise RuntimeError('Native Strata runtime is not ready') model = observed.get('model', '') if not isinstance(model, str) or not re.fullmatch(r'[A-Za-z0-9_.-]{1,180}', model): diff --git a/scripts/laptop/build-route-a.sh b/scripts/laptop/build-route-a.sh index c4632476..0225cbf9 100644 --- a/scripts/laptop/build-route-a.sh +++ b/scripts/laptop/build-route-a.sh @@ -4,7 +4,7 @@ # wsl -d Ubuntu -- bash /mnt/c/Users/pavel/work/leleka/.git/wt//scripts/laptop/build-route-a.sh # # The target directory is inside the worktree (AGENTS.md: keep WSL builds in the work folder); the result is -# /target/release/{leleka,leleka-inference,leleka-daemon,leleka-cli,leleka-seal-exec,strata-next}. +# /target/release/{leleka,leleka-inference,leleka-daemon,leleka-cli,leleka-seal-exec,leleka-api}. # Check first that no other build runs (`pgrep -a cargo`) and never start it during a GPU run. set -euo pipefail # shellcheck disable=SC1090 @@ -13,8 +13,8 @@ worktree=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd) cd "$worktree" export CARGO_TARGET_DIR="$worktree/target" export CARGO_BUILD_JOBS="${CARGO_BUILD_JOBS:-10}" -cargo build --release --locked -p strata-desktop-core --features sm86 \ +cargo build --release --locked -p leleka-engine-host --features sm86 \ --bin leleka-inference --bin leleka-daemon --bin leleka-cli --bin leleka-seal-exec -cargo build --release --locked -p strata-control --bin strata-next +cargo build --release --locked -p leleka-control-plane --bin leleka-api cargo build --release --locked -p leleka-deploy --bin leleka echo BUILD-DONE diff --git a/scripts/offline/diff_chat_template.py b/scripts/offline/diff_chat_template.py index 298ed98b..9b23c5f8 100644 --- a/scripts/offline/diff_chat_template.py +++ b/scripts/offline/diff_chat_template.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -"""Chat-template differential: strata-next's native Jinja renderer (`model render-chat`) vs the Python server's +"""Chat-template differential: leleka-api's native Jinja renderer (`model render-chat`) vs the Python server's `ChatTemplate` (serve/frontend.py, jinja2 ImmutableSandboxedEnvironment) on the same template, over generated conversations: every role incl. developer and tool, string / list / null content with image and video parts, reasoning content, assistant tool_calls (mapping / string / malformed arguments), tools with nested schemas and non-ASCII text, @@ -7,7 +7,7 @@ and the template kwargs (enable_thinking, reasoning_effort incl. bad values, pre Both must either render the same bytes or both refuse; template-raised messages (raise_exception) must match exactly. - pip install jinja2; python scripts/offline/diff_chat_template.py [--cases N] [--seed S] + pip install jinja2; python scripts/offline/diff_chat_template.py [--cases N] [--seed S] """ import json import random diff --git a/scripts/offline/diff_dequant.py b/scripts/offline/diff_dequant.py index 0c005974..e34c43ac 100644 --- a/scripts/offline/diff_dequant.py +++ b/scripts/offline/diff_dequant.py @@ -1,12 +1,12 @@ #!/usr/bin/env python3 -"""Dequantization parity: `strata-next model export-tensor-f32` (the production visitor: independent Rust decoders +"""Dequantization parity: `leleka-api model export-tensor-f32` (the production visitor: independent Rust decoders for IQ2_S/IQ3_S/IQ3_XXS/IQ4_NL/IQ4_XS/Q2_0/Q4_K/Q5_K/Q6_K/Q8_0, the pinned ggml C bridge for the rest) against the gguf-py dequantizer of the pinned llama.cpp commit, bit for bit. Fixtures are tools/iq_fixture.py's (10 types, seeded) plus the other block types gguf-py can dequantize (Q4_0, Q4_1, Q5_0, Q5_1, Q8_0, Q2_K, Q4_K, Q5_K, Q6_K, IQ1_S, MXFP4, NVFP4) and Q8_K (gguf-py has none: d * qs). - STRATA_GGUF_PY=/gguf-py python scripts/offline/diff_dequant.py [--seeds 3] + STRATA_GGUF_PY=/gguf-py python scripts/offline/diff_dequant.py [--seeds 3] """ import json import struct diff --git a/scripts/offline/diff_gguf_header.py b/scripts/offline/diff_gguf_header.py index c7e71602..d59e59fe 100644 --- a/scripts/offline/diff_gguf_header.py +++ b/scripts/offline/diff_gguf_header.py @@ -1,9 +1,9 @@ #!/usr/bin/env python3 -"""GGUF header differential: strata-next (`model inspect`, `model inspect-metadata`, `model index`) vs the +"""GGUF header differential: leleka-api (`model inspect`, `model inspect-metadata`, `model index`) vs the unmodified tools/gguf_reader.py on randomized synthetic GGUF v3 files, plus geometry-table parity and the "Rust is stricter by design" rejection list. - python scripts/offline/diff_gguf_header.py [--cases N] [--seed S] + python scripts/offline/diff_gguf_header.py [--cases N] [--seed S] Random files cover all 13 metadata value types, arrays of every element type, unicode strings, `general.alignment`, split keys and 1-4 dimensional tensors of every block geometry both sides know. Pure stdlib + the oracle. diff --git a/scripts/offline/diff_mtp_fetch.py b/scripts/offline/diff_mtp_fetch.py index 8fec0549..cccaaeca 100644 --- a/scripts/offline/diff_mtp_fetch.py +++ b/scripts/offline/diff_mtp_fetch.py @@ -1,12 +1,12 @@ #!/usr/bin/env python3 -"""mtp_fetch differential: `strata-next tools mtp-fetch` vs the unmodified tools/mtp_fetch.py, both against the same +"""mtp_fetch differential: `leleka-api tools mtp-fetch` vs the unmodified tools/mtp_fetch.py, both against the same local HTTP mirror of a fake checkpoint (the fixture pattern of tools/test_mtp_fetch.py, here a real socket). Scenarios: honest fetch + verify; a corrupted install re-fetched; a resumed half tensor; `--only`; a mirror that ignores Range (both must refuse and leave no tensor); inventory-only. After each, the output directories must match file for file (inventory json/md, manifest, every tensor, verified.json modulo mtime). - python scripts/offline/diff_mtp_fetch.py + python scripts/offline/diff_mtp_fetch.py """ import hashlib import http.server diff --git a/scripts/offline/diff_native_pack.py b/scripts/offline/diff_native_pack.py index 6f500288..7450af90 100644 --- a/scripts/offline/diff_native_pack.py +++ b/scripts/offline/diff_native_pack.py @@ -1,12 +1,12 @@ #!/usr/bin/env python3 -"""Exhaustive native-pack differential: `strata-next model prepare-native-pack` vs the UNMODIFIED tools/iq_pack.py. +"""Exhaustive native-pack differential: `leleka-api model prepare-native-pack` vs the UNMODIFIED tools/iq_pack.py. Every FORM tensor name (bare and under `blk.N.`) x every source type/value class x {default, --compat-bf16}, plus shard topologies (1/2/4 shards, layers and roles split anywhere, multi-layer) and malformed inputs. For each case both sides must make the same accept/reject decision and, when they accept, write byte-identical dense.bin, equal index.txt rows, an equal native_experts.txt, equal conversions.json fields and an equal compat-bf16.json. - STRATA_GGUF_PY=/gguf-py python scripts/offline/diff_native_pack.py [--quick] + STRATA_GGUF_PY=/gguf-py python scripts/offline/diff_native_pack.py [--quick] Needs numpy and the pinned gguf-py (quantized sources). Offline, CPU only, synthetic data. """ @@ -386,7 +386,7 @@ def topology_cases(h, rng): def full_pack_cases(h, rng): - """Whole-CLI comparison: tools/iq_pack.py as a subprocess (tokenizer, experts.bin, --base) vs strata-next.""" + """Whole-CLI comparison: tools/iq_pack.py as a subprocess (tokenizer, experts.bin, --base) vs leleka-api.""" py = sys.executable tool = str(REPO / 'engine/strata/tools/iq_pack.py') diff --git a/scripts/offline/diff_tokenizer.py b/scripts/offline/diff_tokenizer.py index 37bad9d8..73c85946 100644 --- a/scripts/offline/diff_tokenizer.py +++ b/scripts/offline/diff_tokenizer.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -"""Tokenizer differential: strata-next (crates/tokenizer, extract-tokenizer) vs the unmodified tools/strata_tokenizer.py. +"""Tokenizer differential: leleka-api (crates/tokenizer, extract-tokenizer) vs the unmodified tools/strata_tokenizer.py. 1. pre-tokenizer: for EVERY Unicode scalar value, the qwen35 split of 13 one-character contexts (alone, next to a letter / space / digit / punctuation / newline, doubled) in Rust's `fancy_regex` vs Python's `regex`. @@ -8,7 +8,7 @@ five files, then ids from `tokenize-batch` (with and without special parsing) and text from `detokenize-batch` over a boundary corpus plus fuzzed Unicode. - python scripts/offline/diff_tokenizer.py [--stride N] [--fuzz N] [--seed S] + python scripts/offline/diff_tokenizer.py [--stride N] [--fuzz N] [--seed S] Needs `regex` (pip install regex). --stride N checks every Nth scalar value (default 1 = all 1,112,064). """ diff --git a/scripts/offline/diff_tools.py b/scripts/offline/diff_tools.py index 35649b63..cd31e70f 100644 --- a/scripts/offline/diff_tools.py +++ b/scripts/offline/diff_tools.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -"""Differential for the small offline tools: strata-next `tools ...` vs the unmodified Python originals. +"""Differential for the small offline tools: leleka-api `tools ...` vs the unmodified Python originals. embd_bf16_pack.py -> tools embd-bf16-pack (synthetic safetensors checkpoint, BF16 table) ple_fp8_pack.py -> tools ple-fp8-pack (3 shards of F8_E4M3 + BF16 scale) @@ -8,7 +8,7 @@ mtp_rt.py -> tools mtp-rt (Q2_0 experts at the real H/FF geometry, 2 experts) Every output file must be byte-identical. Needs numpy, regex (draft_vocab imports the tokenizer) and the pinned -gguf-py (mtp_rt imports it): STRATA_GGUF_PY=/gguf-py python scripts/offline/diff_tools.py +gguf-py (mtp_rt imports it): STRATA_GGUF_PY=/gguf-py python scripts/offline/diff_tools.py """ import contextlib import io diff --git a/scripts/ops/install-leleka-service.sh b/scripts/ops/install-leleka-service.sh index 4ee3c99e..b9dc7588 100755 --- a/scripts/ops/install-leleka-service.sh +++ b/scripts/ops/install-leleka-service.sh @@ -33,7 +33,7 @@ checks() { [ -f "$SRC" ] || die "missing $SRC" [ -f "$STATE/leleka.json" ] && [ -f "$STATE/runtime.env" ] || die "the service state is not prepared ($STATE/leleka.json, runtime.env): run the prepare step of docs/unattended.md first" [ -x "$PREFIX/bin/leleka" ] || die "missing $PREFIX/bin/leleka" - for b in leleka-inference leleka-daemon leleka-cli strata-next; do + for b in leleka-inference leleka-daemon leleka-cli leleka-api; do [ -x "$PREFIX/bin/$b" ] || die "missing $PREFIX/bin/$b" done id para >/dev/null 2>&1 || die "the unit runs as user para, which does not exist" diff --git a/scripts/ops/leleka.service b/scripts/ops/leleka.service index 25261ac9..7e273b8f 100644 --- a/scripts/ops/leleka.service +++ b/scripts/ops/leleka.service @@ -1,7 +1,7 @@ # Generated by `leleka up`; edit the run configuration, not this file. [Unit] Description=Leleka runtime (engine, gateway and API on loopback) -Documentation=https://github.com/paveldhq/strata-next +Documentation=https://github.com/paveldhq/leleka-api After=network.target RequiresMountsFor=/data/leleka-e2e/service/state /data/leleka-e2e/service/prefix ConditionPathExists=!/data/leleka-e2e/service/state/lab-mode diff --git a/scripts/package-release.py b/scripts/package-release.py index 88fc0ab7..fa52f540 100755 --- a/scripts/package-release.py +++ b/scripts/package-release.py @@ -30,7 +30,7 @@ import subprocess import sys import tarfile -RUNTIME_BINARIES = ['leleka', 'strata-next', 'leleka-inference', 'leleka-daemon', 'leleka-cli', 'leleka-seal-exec'] +RUNTIME_BINARIES = ['leleka', 'leleka-api', 'leleka-inference', 'leleka-daemon', 'leleka-cli', 'leleka-seal-exec'] TEMPLATES = [ 'deploy/rust-runtime/leleka-daemon.service', 'deploy/rust-runtime/leleka-inference.service', diff --git a/scripts/publish-gitea-release.py b/scripts/publish-gitea-release.py index fb1abf19..a55fa3a4 100644 --- a/scripts/publish-gitea-release.py +++ b/scripts/publish-gitea-release.py @@ -13,7 +13,7 @@ import stat import sys from urllib.parse import urlencode, urljoin, urlsplit -PACKAGE_BINARY = 'strata-next-linux-x86_64-musl' +PACKAGE_BINARY = 'leleka-api-linux-x86_64-musl' PACKAGE_ASSETS = {PACKAGE_BINARY, 'PROVENANCE.json'} IMAGE_ASSETS = {'runtime-image.tar', 'IMAGE-PROVENANCE.json', 'CUDA-TOOLCHAIN.json', 'CUDA-LICENSES.tar'} ASSETS = PACKAGE_ASSETS | IMAGE_ASSETS | {'SHA256SUMS', 'IMAGE-SHA256SUMS'} diff --git a/scripts/quality/q245_codex_job.sh b/scripts/quality/q245_codex_job.sh index 221cec6a..f5267c20 100644 --- a/scripts/quality/q245_codex_job.sh +++ b/scripts/quality/q245_codex_job.sh @@ -67,7 +67,7 @@ cleanup() { trap cleanup EXIT note "codex job $MODE started: $RUN tasks=[$TASKS] reps=[$REPS] pad=$(wc -c <"$PAD") bytes; holds gpu.lock" if [ -n "$(nvidia-smi --query-compute-apps=pid --format=csv,noheader 2>/dev/null)" ]; then echo "something uses the GPU"; exit 3; fi -if pgrep -u "$USER" -x 'leleka-inference|strata-next|leleka-daemon' >/dev/null; then echo "a stack process exists"; exit 3; fi +if pgrep -u "$USER" -x 'leleka-inference|leleka-api|leleka-daemon' >/dev/null; then echo "a stack process exists"; exit 3; fi for p in 18766 18080 8081 8090; do ss -ltn "sport = :$p" 2>/dev/null | grep -q LISTEN && { echo "port $p in use"; exit 3; }; done export LD_LIBRARY_PATH=$CUBLAS:$HOME/cuda-toolkits/13.2.2/lib64:${LD_LIBRARY_PATH:-} { date -u +%FT%TZ; uname -r; nvidia-smi --query-gpu=name,driver_version,power.limit --format=csv,noheader; free -g | sed -n 2p; uptime; $CODEX --version; sha256sum "$CODEX" "$PAD"; } | tee "$RUN/host.txt" diff --git a/scripts/qwen_native_api.py b/scripts/qwen_native_api.py index bcca2bff..6ab3deac 100644 --- a/scripts/qwen_native_api.py +++ b/scripts/qwen_native_api.py @@ -90,7 +90,7 @@ def wait_ready(url, token, wait, transport, clock, sleep): except NativeConnectionError: result = None if result is not None: - if (not isinstance(result, dict) or result.get('service') != 'strata-control' + if (not isinstance(result, dict) or result.get('service') != 'leleka-control-plane' or type(result.get('ready')) is not bool): raise RuntimeError('Endpoint is not a native Strata control plane') worker = result.get('worker') @@ -123,7 +123,7 @@ def control(action, target, read_key, *, wait=0, transport=request, clock=time.m result = wait_ready(url, token, wait, transport, clock, sleep) return {'action': action, 'url': url, 'connection_changed': False, 'runtime': result} observed = transport(url, 'GET', '/status', token) - if observed.get('service') != 'strata-control' or type(observed.get('ready')) is not bool: + if observed.get('service') != 'leleka-control-plane' or type(observed.get('ready')) is not bool: raise RuntimeError('Endpoint is not a native Strata control plane') if action == 'status': result = observed diff --git a/scripts/qwen_native_service.py b/scripts/qwen_native_service.py index 48db8177..97c3df06 100644 --- a/scripts/qwen_native_service.py +++ b/scripts/qwen_native_service.py @@ -49,7 +49,7 @@ def ssh_check(host, arguments): def check_config(host, binary, config, working_dir, *, runner=ssh_check): - validate(host, 'strata-next.service') + validate(host, 'leleka-api.service') for path in (binary, config, working_dir): if not isinstance(path, str) or not path.startswith('/') or any(ord(c) < 32 or ord(c) == 127 for c in path): raise ValueError('preflight paths must be absolute and contain no control characters') @@ -91,8 +91,8 @@ def validate(host, unit): # SSH aliases/DNS names only. Refuse options, user overrides and shell text. if not re.fullmatch(r'[A-Za-z0-9][A-Za-z0-9_.-]{0,252}', host): raise ValueError('host must be an SSH alias or DNS name without options or a username') - if not re.fullmatch(r'strata-next(?:-[a-z0-9][a-z0-9-]{0,79})?\.service', unit): - raise ValueError('unit must be strata-next.service or strata-next-NAME.service') + if not re.fullmatch(r'leleka-api(?:-[a-z0-9][a-z0-9-]{0,79})?\.service', unit): + raise ValueError('unit must be leleka-api.service or leleka-api-NAME.service') def ssh(host, arguments): @@ -159,7 +159,7 @@ def main(argv=None, *, default_host='rnr5090'): else: if any((args.binary, args.config, args.working_dir)): parser.error('--binary, --config and --working-dir are only for check-config') - result = control(args.action, args.host, args.unit or 'strata-next.service') + result = control(args.action, args.host, args.unit or 'leleka-api.service') print(result if isinstance(result, str) else json.dumps(result, ensure_ascii=False), end='\n') diff --git a/scripts/release/accept-5090-job.sh b/scripts/release/accept-5090-job.sh index 7902cf4c..34a70cce 100644 --- a/scripts/release/accept-5090-job.sh +++ b/scripts/release/accept-5090-job.sh @@ -67,7 +67,7 @@ cleanup() { } trap cleanup EXIT if [ -n "$(nvidia-smi --query-compute-apps=pid --format=csv,noheader 2>/dev/null)" ]; then echo "refusing: something uses the GPU"; exit 3; fi -if pgrep -u "$USER" -x 'leleka-inference|strata-next|leleka-daemon' >/dev/null; then echo "refusing: a stack process exists"; exit 3; fi +if pgrep -u "$USER" -x 'leleka-inference|leleka-api|leleka-daemon' >/dev/null; then echo "refusing: a stack process exists"; exit 3; fi for p in 18766 18080 8081; do ss -ltn "sport = :$p" 2>/dev/null | grep -q LISTEN && { echo "port $p in use"; exit 3; }; done for _ in $(seq 1 90); do avail=$(awk '/MemAvailable/{print int($2/1048576)}' /proc/meminfo); [ "$avail" -ge 60 ] && break; sleep 10; done [ "$avail" -ge 60 ] || { echo "refusing: MemAvailable $avail GiB < 60"; exit 4; } @@ -87,7 +87,7 @@ P=$RUN/pkg; BIN=$P/bin ( cd "$P" && sha256sum --quiet -c SHA256SUMS && echo "SHA256SUMS ok" ) | tee -a "$SUMMARY" "$BIN/leleka" version | tee -a "$SUMMARY" sum "tarball sha256 $(sha256sum "$TARBALL" | cut -c1-64)" -for b in leleka strata-next leleka-inference leleka-daemon leleka-cli leleka-seal-exec; do +for b in leleka leleka-api leleka-inference leleka-daemon leleka-cli leleka-seal-exec; do m=$(sed -n "s/.*\"$b\": *\"\\([0-9a-f]*\\)\".*/\\1/p" "$P/MANIFEST.json" | head -1); h=$(sha256sum "$BIN/$b" | cut -c1-64) [ "$m" = "$h" ] && echo "digest ok $b" || { sum "DIGEST MISMATCH $b"; exit 5; } done diff --git a/scripts/release/package-5090.sh b/scripts/release/package-5090.sh index 0d66ad7d..7f4da9cb 100644 --- a/scripts/release/package-5090.sh +++ b/scripts/release/package-5090.sh @@ -37,7 +37,7 @@ set -eu # --- the release identity: change these only with the checklist ------------------------------------------------------------------ RELEASE_TAG=leleka-5090-v0.1 RELEASE_STRATA_PIN=41cf05a06a25dd29103b7b27a2279a3f60c21876 # docs/upstream.md; upstream 0.2.8 exists, the pin is NOT moved for this release -BINARIES="leleka strata-next leleka-inference leleka-daemon leleka-cli leleka-seal-exec" +BINARIES="leleka leleka-api leleka-inference leleka-daemon leleka-cli leleka-seal-exec" DOCS="docs/deploy.md docs/upstream.md docs/quality-gate.md docs/e2e-run.md docs/ledger.md docs/port-remaining.md docs/prefix-cache.md docs/rust-runtime-run.md docs/experiments/baseline-pair-5090.md docs/experiments/draft-round-5090.md docs/experiments/2026-10-28-s6-1-lossy-audit.md docs/experiments/window-policy-5090.md docs/unattended.md docs/kar-sparse-memfd.md" UNATTENDED_DEFAULTS="scripts/ops/README.md scripts/ops/install-leleka-service.sh scripts/ops/leleka.service scripts/ops/owner-wifi-stability.sh" MAX_TRACKED_BYTES=20000000 @@ -223,7 +223,7 @@ gate_licence() { [ -f "$manifest" ] || continue if ! grep -qE '^license(\.workspace)? *=' "$manifest"; then unlicensed="$unlicensed $(field name <"$manifest")"; fi done - if [ -z "$unlicensed" ]; then ok "every workspace crate declares a licence"; else bad "workspace crates without a licence field:$unlicensed (these build the shipped binaries strata-next, leleka-inference, leleka-daemon, leleka-cli, leleka-seal-exec)"; fi + if [ -z "$unlicensed" ]; then ok "every workspace crate declares a licence"; else bad "workspace crates without a licence field:$unlicensed (these build the shipped binaries leleka-api, leleka-inference, leleka-daemon, leleka-cli, leleka-seal-exec)"; fi for f in engine/strata/LICENSE engine/strata/third_party/ggml/LICENSE engine/strata/third_party/project-maya/LICENSE engine/strata/third_party/project-maya/NOTICE.md control-plane/third_party/ggml/LICENSE crates/native-cpu-expert/LICENSE.ggml crates/native-cpu-expert/LICENSE.strata crates/quant-core/LICENSE-GGML crates/cpu-sys/NOTICE.colibri; do [ -f "$f" ] || bad "third-party licence text missing: $f" done @@ -310,8 +310,8 @@ run_build() { CARGO_TARGET_DIR=$target_dir; export CARGO_TARGET_DIR say "building commit $LELEKA_GIT_COMMIT (dirty=$LELEKA_GIT_DIRTY) into $CARGO_TARGET_DIR" # The same three commands as docs/deploy.md section 8 and the measured dt/bin-* binaries, minus --features sm86 (sm_120 only). - cargo build --release --locked -p strata-desktop-core --bin leleka-inference --bin leleka-daemon --bin leleka-cli --bin leleka-seal-exec - cargo build --release --locked -p strata-control --bin strata-next + cargo build --release --locked -p leleka-engine-host --bin leleka-inference --bin leleka-daemon --bin leleka-cli --bin leleka-seal-exec + cargo build --release --locked -p leleka-control-plane --bin leleka-api cargo build --release --locked -p leleka-deploy --bin leleka } diff --git a/scripts/smoke-cli-container.py b/scripts/smoke-cli-container.py index 99ba96b0..3ee51d42 100644 --- a/scripts/smoke-cli-container.py +++ b/scripts/smoke-cli-container.py @@ -48,7 +48,7 @@ def main(image): primary_error = None try: version = docker('run', '--rm', *common, '--network', 'none', image, '--version').stdout - assert version.startswith('strata-next '), version + assert version.startswith('leleka-api '), version license_text = docker('run', '--rm', *common, '--network', 'none', image, '--engine-license').stdout assert license_text == (root / 'engine/strata/LICENSE').read_text() diff --git a/scripts/smoke-controller-deployment.py b/scripts/smoke-controller-deployment.py index d4815bdf..3d3f9f72 100644 --- a/scripts/smoke-controller-deployment.py +++ b/scripts/smoke-controller-deployment.py @@ -36,7 +36,7 @@ BAD = {'backend':'agent','profile':'failed-cpu-fixture'} def main(): binary = str(Path(sys.argv[1]).resolve()) os.umask(0o077) - with tempfile.TemporaryDirectory(prefix='strata-controller-smoke-') as tmp: + with tempfile.TemporaryDirectory(prefix='leleka-control-planeler-smoke-') as tmp: root = Path(tmp).resolve() with socket.socket() as probe: probe.bind(('127.0.0.1',0)); port=probe.getsockname()[1] diff --git a/scripts/smoke-native-switch.py b/scripts/smoke-native-switch.py index 7ab91030..0c964b28 100644 --- a/scripts/smoke-native-switch.py +++ b/scripts/smoke-native-switch.py @@ -56,7 +56,7 @@ def main(): return run(str(binary),'service-switch','--catalog',str(catalog),'--to',target,'--state-dir',str(state),check=check) try: for name in ['old','next','bad','preflight']: - unit=f'strata-next-switch-{root.name}-{name}.service' + unit=f'leleka-api-switch-{root.name}-{name}.service' unit_path=unit_dir/unit assert not unit_path.exists() and not unit_path.is_symlink() config=root/f'{name}.json' diff --git a/scripts/smoke-service-unit.py b/scripts/smoke-service-unit.py index 1aca2c76..664b475f 100644 --- a/scripts/smoke-service-unit.py +++ b/scripts/smoke-service-unit.py @@ -30,12 +30,12 @@ def main(): parser.add_argument('binary', type=Path) parser.add_argument('--lifecycle', action='store_true') args = parser.parse_args() - with tempfile.TemporaryDirectory(prefix='strata-next-install-') as directory: + with tempfile.TemporaryDirectory(prefix='leleka-api-install-') as directory: root = Path(directory) # Exercise literal $, systemd % specifiers, quoting and C escaping. odd = root / 'space %n ${HOME} "quote" back\\slash' odd.mkdir() - binary = root / 'strata-next %n ${HOME}' + binary = root / 'leleka-api %n ${HOME}' shutil.copy2(args.binary.resolve(), binary) config = odd / 'config.json' env_file = root / 'runtime %n ${HOME} "quote".env' @@ -158,7 +158,7 @@ exit {42 if fail_action else 0} manager(status='ActiveState=active\nSubState=running\nMainPID=124\nUnitFileState=disabled\n') elif changed == 'fragment': manager(fragment='/changed.service') else: fault_unit.write_text('changed during wait') - data = json.dumps({'service':'strata-control', 'model':'fixture', 'server_pid':123, + data = json.dumps({'service':'leleka-control-plane', 'model':'fixture', 'server_pid':123, 'ready':True, 'worker':'ready'}).encode() self.send_response(200); self.send_header('Content-Length', str(len(data))) self.end_headers(); self.wfile.write(data) @@ -357,7 +357,7 @@ exit {42 if fail_action else 0} ready_args[:4] + ['--ready-key-file', str(root/'missing-key')]]: assert ready_control('restart-ready', bad_options, check=False).returncode != 0 assert native_ctl('status')['manager']['main_pid'] == pid - response_body = {'service':'strata-control', 'model':'service-smoke-env', + response_body = {'service':'leleka-control-plane', 'model':'service-smoke-env', 'ready':True, 'worker':'ready', 'server_pid':1} class OtherEndpoint(http.server.BaseHTTPRequestHandler): def do_GET(self): diff --git a/scripts/smoke-static-cli.py b/scripts/smoke-static-cli.py index a1406eb2..28e5d610 100644 --- a/scripts/smoke-static-cli.py +++ b/scripts/smoke-static-cli.py @@ -161,8 +161,8 @@ def main() -> None: streamed_provenance = json.loads( (root / "streamed.kar.provenance.json").read_text() ) - assert streamed_provenance["schema"] == "strata-next/sharded-stream-provenance-v4" - assert streamed_provenance["derivation"] == "strata-next/gguf-shards-to-f32-le-v4:ggml-3cf03257" + assert streamed_provenance["schema"] == "leleka-api/sharded-stream-provenance-v4" + assert streamed_provenance["derivation"] == "leleka-api/gguf-shards-to-f32-le-v4:ggml-3cf03257" assert streamed_provenance["partitioned_tensors"] == [] assert streamed_provenance["levels"] == 2 assert streamed_provenance["derived_f32_sha256"] == expected_source diff --git a/scripts/smoke-systemd-manager.py b/scripts/smoke-systemd-manager.py index addb9ca2..516d5a7d 100644 --- a/scripts/smoke-systemd-manager.py +++ b/scripts/smoke-systemd-manager.py @@ -74,11 +74,11 @@ def root_setup(): for path in (target, target/'cgroup.procs', target/'cgroup.subtree_control'): os.chown(path, UID, UID) # Only known staged regular files are normalized. The CLI remains root-owned. - for name in (*FILES, 'smoke-systemd-manager.py', 'strata-next'): + for name in (*FILES, 'smoke-systemd-manager.py', 'leleka-api'): path = Path('/work') / name assert path.is_file() and not path.is_symlink() os.chown(path, 0, 0) - path.chmod(0o755 if name == 'strata-next' else 0o644) + path.chmod(0o755 if name == 'leleka-api' else 0o644) for path in (Path('/run/systemd/journal'), Path('/run/log/journal')): path.mkdir(parents=True, exist_ok=True) os.chown(path, UID, UID) @@ -156,8 +156,8 @@ def user_tests(): assert str(manager.pid) in Path('/sys/fs/cgroup/init.scope/cgroup.procs').read_text().split() print(result.stdout.strip(), flush=True) print('Private real manager, bus, journal and cgroup ready; all capabilities zero', flush=True) - run('python3', '/work/smoke-service-unit.py', '/work/strata-next', '--lifecycle', timeout=600) - run('python3', '/work/smoke-native-switch.py', '/work/strata-next', timeout=300) + run('python3', '/work/smoke-service-unit.py', '/work/leleka-api', '--lifecycle', timeout=600) + run('python3', '/work/smoke-native-switch.py', '/work/leleka-api', timeout=300) except BaseException: failed = True raise @@ -193,7 +193,7 @@ def host(binary): shutil.copy2(dockerfile, context/'Dockerfile') for filename in (*FILES, 'smoke-systemd-manager.py'): shutil.copy2(root/'scripts'/filename, stage/filename) - shutil.copy2(binary, stage/'strata-next') + shutil.copy2(binary, stage/'leleka-api') def digest(path): checksum = hashlib.sha256() with path.open('rb') as source: @@ -227,7 +227,7 @@ def host(binary): 'setup_capabilities': config['CapAdd'], 'user_capabilities': 'zero', 'seccomp': 'Docker default'}), flush=True) # docker cp works with a remote daemon; runner paths are not bind-mounted. - for filename in (*FILES, 'smoke-systemd-manager.py', 'strata-next'): + for filename in (*FILES, 'smoke-systemd-manager.py', 'leleka-api'): run('docker', 'cp', str(stage/filename), name + ':/work/' + filename, timeout=60) run('docker', 'start', '--attach', name, timeout=1000) state = json.loads(subprocess.check_output(['docker', 'inspect', name], text=True))[0]['State'] diff --git a/scripts/smoke-wait-ready.py b/scripts/smoke-wait-ready.py index 12a27264..7ed061b1 100644 --- a/scripts/smoke-wait-ready.py +++ b/scripts/smoke-wait-ready.py @@ -18,7 +18,7 @@ import time def main(): binary = Path(sys.argv[1]).resolve() key = 'fixture-only-wait-ready-key-00001' - ready = {'service': 'strata-control', 'model': 'fixture', 'worker': 'ready', 'ready': True} + ready = {'service': 'leleka-control-plane', 'model': 'fixture', 'worker': 'ready', 'ready': True} state = {'mode': 'ready', 'calls': 0, 'paths': [], 'auth': []} stopped = threading.Event() @@ -117,7 +117,7 @@ def main(): result, _ = run() assert result.returncode == 0, result.stderr data = json.loads(result.stdout) - assert data == {**{'service': 'strata-control', 'model': 'fixture', 'ready': True}, 'attempts': state['calls']} + assert data == {**{'service': 'leleka-control-plane', 'model': 'fixture', 'ready': True}, 'attempts': state['calls']} assert state['calls'] == (1 if mode == 'ready' else 3) assert all(state['auth']) and set(state['paths']) == {'/status'} for mode, message in [('wrong_model', 'does not match'), ('wrong_service', 'does not match'), diff --git a/scripts/smoke-worker-cancel.py b/scripts/smoke-worker-cancel.py index 4f263c5e..fd891776 100644 --- a/scripts/smoke-worker-cancel.py +++ b/scripts/smoke-worker-cancel.py @@ -38,12 +38,12 @@ def tokenizer(root): def runtime_stack(env, root): """Test-only. With STRATA_TEST_FAKE_RUNTIME= in the environment, run - this script's scripted stdio engine behind the Rust runtime stack instead of as strata-next's own - child: strata-next (runtime backend) -> gRPC -> fake_runtime -> the same engine.sh. The fake runtime + this script's scripted stdio engine behind the Rust runtime stack instead of as leleka-api's own + child: leleka-api (runtime backend) -> gRPC -> fake_runtime -> the same engine.sh. The fake runtime ends when this process does (it exits when its stdin closes). Without the variable `env` is returned unchanged, so every script that calls this keeps its original meaning. - Used by the smokes whose assertions do not depend on strata-next owning the engine process: + Used by the smokes whose assertions do not depend on leleka-api owning the engine process: test-live-responses-replay, smoke-{custom-tools,chat-completions,messages,tool-policy,input-tokens, response-history,sse-keepalive,native-drain,queue-deadline}. Not by smoke-worker-cancel (a wedged engine ends the stdio supervisor; the runtime backend re-attaches instead), smoke-signal-drain (expects QUIT diff --git a/scripts/soak/soak-job.sh b/scripts/soak/soak-job.sh index d9face80..c98e276e 100755 --- a/scripts/soak/soak-job.sh +++ b/scripts/soak/soak-job.sh @@ -15,7 +15,7 @@ # 5 wrap-up leleka status / verify --quick, clean SIGTERM, no leftover process, VRAM back, lock released # # Environment (all optional but SOAK_BIN): -# SOAK_BIN directory with leleka leleka-inference leleka-daemon leleka-cli leleka-seal-exec strata-next (required) +# SOAK_BIN directory with leleka leleka-inference leleka-daemon leleka-cli leleka-seal-exec leleka-api (required) # SOAK_DURATION_S soak length (default 5400) # SOAK_FAULTS --faults of soak.py (default: engine, hang, api, gateway, abort, logs, burst, supervisor) # SOAK_STALL_S API stall timeout of this run (default 300; the product default is 600: compressed so that a hang costs minutes) @@ -41,7 +41,7 @@ log() { echo "[soak-job $(date -u +%T)] $*"; } # ---- 0. guards ------------------------------------------------------------------------------------------------------------ if [ -z "$FD" ] || ! readlink "/proc/self/fd/$FD" 2>/dev/null | grep -q '^/memfd:'; then echo "refusing: no sealed memfd inherited (run as a holder job)"; exit 3; fi [ -d "$G/MODEL.lock" ] || { echo "refusing: MODEL.lock is not held"; exit 3; } -for b in leleka leleka-inference leleka-daemon leleka-cli leleka-seal-exec strata-next; do [ -x "$BIN/$b" ] || { echo "missing $BIN/$b"; exit 3; }; done +for b in leleka leleka-inference leleka-daemon leleka-cli leleka-seal-exec leleka-api; do [ -x "$BIN/$b" ] || { echo "missing $BIN/$b"; exit 3; }; done [ -f "$SOAK_PY" ] || { echo "missing $SOAK_PY"; exit 3; } got=0 for i in $(seq 1 1080); do @@ -66,7 +66,7 @@ cleanup() { } trap cleanup EXIT if [ -n "$(nvidia-smi --query-compute-apps=pid --format=csv,noheader 2>/dev/null)" ]; then echo "refusing: something uses the GPU"; nvidia-smi --query-compute-apps=pid,name,used_memory --format=csv,noheader; exit 3; fi -if pgrep -u "$USER" -x 'leleka-inference|strata-next|leleka-daemon' >/dev/null; then echo "refusing: a stack process exists"; exit 3; fi +if pgrep -u "$USER" -x 'leleka-inference|leleka-api|leleka-daemon' >/dev/null; then echo "refusing: a stack process exists"; exit 3; fi for p in 18766 18080 8081; do ss -ltn "sport = :$p" 2>/dev/null | grep -q LISTEN && { echo "port $p in use"; exit 3; }; done # The pinned (production) form needs 105.5 GiB + 4 GiB free with the archive counted: with the holder's memfd already resident that is # MemAvailable >= 58 GiB. The previous job's page cache is reclaimable and counts as available; give the kernel a moment. @@ -77,7 +77,7 @@ for _ in $(seq 1 90); do done [ "$avail" -ge 60 ] || { echo "refusing: MemAvailable $avail GiB < 60 after 15 min"; exit 4; } export LD_LIBRARY_PATH=$CUBLAS:$HOME/cuda-toolkits/13.2.2/lib64:${LD_LIBRARY_PATH:-} -log "run dir $RUN; binaries $BIN"; sha256sum "$BIN"/leleka "$BIN"/leleka-inference "$BIN"/strata-next | cut -c1-80 +log "run dir $RUN; binaries $BIN"; sha256sum "$BIN"/leleka "$BIN"/leleka-inference "$BIN"/leleka-api | cut -c1-80 date -u +%FT%TZ; uname -r; nvidia-smi --query-gpu=name,driver_version,memory.used --format=csv,noheader; free -g | head -2 evict() { python3 -c 'import os,sys for p in sys.argv[1:]: @@ -161,7 +161,7 @@ evict "$A/model/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf" "$A/model/ echo "$(date -u +%FT%TZ) supervisor exited rc=$rc" >>"$RUN/supervisor-exits.log" [ -e "$RUN/STOP-SUP" ] && break # systemd's KillMode: whatever the dead supervisor left behind goes with it - pkill -KILL -f "$RUN/prefix/bin/leleka-(inference|daemon)" 2>/dev/null; pkill -KILL -f "$RUN/prefix/bin/strata-next" 2>/dev/null + pkill -KILL -f "$RUN/prefix/bin/leleka-(inference|daemon)" 2>/dev/null; pkill -KILL -f "$RUN/prefix/bin/leleka-api" 2>/dev/null for _ in $(seq 1 60); do pgrep -f "$RUN/prefix/bin/leleka-inference" >/dev/null || break; sleep 1; done sleep 30 # RestartSec=30 done diff --git a/scripts/strata-agent-profile.py b/scripts/strata-agent-profile.py index 4115fd98..5bc88c83 100644 --- a/scripts/strata-agent-profile.py +++ b/scripts/strata-agent-profile.py @@ -15,19 +15,19 @@ import time import urllib.request -ROOT = Path('/home/para/.cache/strata-next/agent-profiles') +ROOT = Path('/home/para/.cache/leleka-api/agent-profiles') STATE = ROOT / 'state.json' -CONFIG = Path('/dev/shm/strata-next-agent-profile.json') +CONFIG = Path('/dev/shm/leleka-api-agent-profile.json') SOURCE = Path('/home/para/inference/strata/strata-iq3_s.json') SERVER = Path('/home/para/inference/strata/serve/server.py') PYTHON = Path('/home/para/inference/strata/.venv/bin/python') -ARCHIVE = Path('/mnt/microcrm-flash-preflight/microcrm-flash-next-experiment/strata-next/qwen-iq3-s-l2-v4.kar') -KEYLESS_ROUTING = Path('/home/para/.cache/strata-next/keyless-feasibility/query-routing-distilled-wide.bin') +ARCHIVE = Path('/mnt/microcrm-flash-preflight/microcrm-flash-next-experiment/leleka-api/qwen-iq3-s-l2-v4.kar') +KEYLESS_ROUTING = Path('/home/para/.cache/leleka-api/keyless-feasibility/query-routing-distilled-wide.bin') EXES = { - 'strata-next-v-only': Path('/home/para/.cache/strata-next/keyless-runtime-20261003/build/strata'), - 'strata-next-baseline': Path('/home/para/.cache/strata-next/engine-fork-f80a3e0/build/strata'), - 'strata-next-kar-ple': Path('/home/para/.cache/strata-next/engine-kar-ple-build/strata'), - 'strata-next-kar-ple-gpu': Path('/home/para/.cache/strata-next/engine-ple-gpu-36e512a/build/strata'), + 'leleka-api-v-only': Path('/home/para/.cache/leleka-api/keyless-runtime-20261003/build/strata'), + 'leleka-api-baseline': Path('/home/para/.cache/leleka-api/engine-fork-f80a3e0/build/strata'), + 'leleka-api-kar-ple': Path('/home/para/.cache/leleka-api/engine-kar-ple-build/strata'), + 'leleka-api-kar-ple-gpu': Path('/home/para/.cache/leleka-api/engine-ple-gpu-36e512a/build/strata'), } HOST = '192.168.1.196' PORT = 18081 @@ -66,9 +66,9 @@ def status(): observed = health() if current else {'ready': False} return {'profile': current['profile'] if current else None, 'pid': current['pid'] if current else None, - 'kv_mode': 'without-key' if current and current['profile'] == 'strata-next-v-only' else 'with-key', + 'kv_mode': 'without-key' if current and current['profile'] == 'leleka-api-v-only' else 'with-key', 'quality_gate': (json.loads(Path(str(KEYLESS_ROUTING) + '.json').read_text()).get('quality_gate', 'not_run') - if current and current['profile'] == 'strata-next-v-only' else None), **observed} + if current and current['profile'] == 'leleka-api-v-only' else None), **observed} def unload(current): @@ -115,7 +115,7 @@ def prepare(profile): if profile not in EXES: raise ValueError('unknown experiment profile') routing_identity = None - if profile == 'strata-next-v-only': + if profile == 'leleka-api-v-only': routing_report = Path(str(KEYLESS_ROUTING) + '.json') if not KEYLESS_ROUTING.is_file() or not routing_report.is_file(): raise FileNotFoundError(KEYLESS_ROUTING) @@ -123,12 +123,12 @@ def prepare(profile): for path in (SOURCE, SERVER, PYTHON, EXES[profile]): if not path.is_file(): raise FileNotFoundError(path) - if profile in {'strata-next-kar-ple', 'strata-next-kar-ple-gpu'} and not ARCHIVE.is_file(): + if profile in {'leleka-api-kar-ple', 'leleka-api-kar-ple-gpu'} and not ARCHIVE.is_file(): raise FileNotFoundError(ARCHIVE) environment = dict(os.environ) environment.pop('STRATA_KEYLESS_ROUTING', None) environment.pop('STRATA_KEYLESS_TRACE', None) - if profile == 'strata-next-v-only': + if profile == 'leleka-api-v-only': if not KEYLESS_ROUTING.is_file(): raise FileNotFoundError(KEYLESS_ROUTING) environment['STRATA_KEYLESS_ROUTING'] = str(KEYLESS_ROUTING) @@ -144,9 +144,9 @@ def prepare(profile): cfg = dict(raw) cfg['exe'] = str(EXES[profile]) cfg['args'] = list(args) - if profile in {'strata-next-kar-ple', 'strata-next-kar-ple-gpu'}: + if profile in {'leleka-api-kar-ple', 'leleka-api-kar-ple-gpu'}: cfg['args'] += ['--ple-kar', str(ARCHIVE), '--ple-kar-level', '2'] - if profile == 'strata-next-kar-ple-gpu': + if profile == 'leleka-api-kar-ple-gpu': cfg['args'] += ['--ple-kar-gpu-cache-mib', '64'] return cfg, environment, routing_identity diff --git a/scripts/strata-dual-256-experiment.py b/scripts/strata-dual-256-experiment.py index ae99b222..7448a0c4 100644 --- a/scripts/strata-dual-256-experiment.py +++ b/scripts/strata-dual-256-experiment.py @@ -17,10 +17,10 @@ import urllib.request SOURCE = Path('/home/para/inference/strata/strata-iq3_s.json') -ENGINE = Path('/home/para/.cache/strata-next/engine-fork-f80a3e0/build/strata') +ENGINE = Path('/home/para/.cache/leleka-api/engine-fork-f80a3e0/build/strata') PYTHON = Path('/home/para/inference/strata/.venv/bin/python') SERVER = Path('/home/para/inference/strata/serve/server.py') -ROOT = Path('/home/para/.cache/strata-next/dual-256') +ROOT = Path('/home/para/.cache/leleka-api/dual-256') STATE = ROOT / 'state.json' HOST = '192.168.1.196' PORTS = (18081, 18082) @@ -28,7 +28,7 @@ EXPERT_SLOTS = 2000 def config_path(port): - return Path(f'/dev/shm/strata-next-dual-{port}.json') + return Path(f'/dev/shm/leleka-api-dual-{port}.json') def process_is_ours(pid, port): diff --git a/scripts/strata-model-switch.py b/scripts/strata-model-switch.py index df95ace3..d5a45b60 100644 --- a/scripts/strata-model-switch.py +++ b/scripts/strata-model-switch.py @@ -20,8 +20,8 @@ import time import urllib.request from urllib.parse import urlsplit -ROOT = Path('/home/para/.cache/strata-next/model-switch') -NATIVE = Path('/home/para/.cache/strata-next/native-console-20261004') +ROOT = Path('/home/para/.cache/leleka-api/model-switch') +NATIVE = Path('/home/para/.cache/leleka-api/native-console-20261004') CONTROL = Path('/home/para/inference/codex-qwen') @@ -180,13 +180,13 @@ class Host: self.root = Path(deployment['root']) if deployment else ROOT self.native = Path(deployment['native']) if deployment else NATIVE self.control = Path(deployment['control']) if deployment else CONTROL - self.binary = Path(deployment['binary']) if deployment else self.native/'strata-next' + self.binary = Path(deployment['binary']) if deployment else self.native/'leleka-api' self.config = Path(deployment['config']) if deployment else self.native/'config.json' sys.path.insert(0, str(self.control)) import qwen_remote import strata_remote self.q, self.s = qwen_remote, strata_remote - spec = importlib.util.spec_from_file_location('agent_profile', deployment['agent_helper'] if deployment else '/home/para/.cache/strata-next/agent-profile.py') + spec = importlib.util.spec_from_file_location('agent_profile', deployment['agent_helper'] if deployment else '/home/para/.cache/leleka-api/agent-profile.py') self.a = importlib.util.module_from_spec(spec) spec.loader.exec_module(self.a) @@ -401,7 +401,7 @@ class Host: if len(data) > 65536: return False value = json.loads(data) - return (isinstance(value, dict) and value.get('service') == 'strata-control' and + return (isinstance(value, dict) and value.get('service') == 'leleka-control-plane' and value.get('model') == self.deployment['model'] and value.get('ready') is True) finally: conn.close() @@ -417,7 +417,7 @@ class Host: if backend == 'native': with urllib.request.urlopen('http://127.0.0.1:18082/status', timeout=3) as response: value = json.load(response) - return value.get('service') == 'strata-control' and value.get('model') == 'strata-native-iq3-s' and value.get('ready') is True + return value.get('service') == 'leleka-control-plane' and value.get('model') == 'strata-native-iq3-s' and value.get('ready') is True models = (self.q if backend == 'llama' else self.s).api('/v1/models')['data'] return len(models) == 1 and (backend != 'llama' or models[0]['id'] == target['id'] + '--' + target['layout'] + 'k') except (OSError, ValueError, KeyError, RuntimeError, http.client.HTTPException): diff --git a/scripts/test-api-over-runtime.py b/scripts/test-api-over-runtime.py index 58a1c091..bbbeaa42 100644 --- a/scripts/test-api-over-runtime.py +++ b/scripts/test-api-over-runtime.py @@ -1,14 +1,14 @@ #!/usr/bin/env python3 """Run the repository's scripted-engine HTTP smokes through the Rust runtime stack. - cargo build -p strata-control --bin strata-next - cargo build -p strata-desktop-core --example fake_runtime - python3 scripts/test-api-over-runtime.py target/debug/strata-next target/debug/examples/fake_runtime + cargo build -p leleka-control-plane --bin leleka-api + cargo build -p leleka-engine-host --example fake_runtime + python3 scripts/test-api-over-runtime.py target/debug/leleka-api target/debug/examples/fake_runtime Each smoke keeps its own assertions; only the engine moves. Normally the smoke's scripted `engine.sh` is -strata-next's child process speaking token ids on stdio. With STRATA_TEST_FAKE_RUNTIME set (done here) the +leleka-api's child process speaking token ids on stdio. With STRATA_TEST_FAKE_RUNTIME set (done here) the smoke starts `fake_runtime` instead: a real `leleka.runtime.v1` gRPC server (`RuntimeServer`) whose engine -is the same `engine.sh`, and runs `strata-next` with a `runtime` block, so the HTTP API is exercised in +is the same `engine.sh`, and runs `leleka-api` with a `runtime` block, so the HTTP API is exercised in front of text-in/text-out gRPC. Test tooling only; nothing here is part of serving. Not a GPU or model result. """ import os @@ -24,7 +24,7 @@ SMOKES = [ 'smoke-messages', 'smoke-tool-policy', # 216 tool_choice / parallel_tool_calls / allowed_tools cases 'smoke-input-tokens', - 'smoke-response-history', # stored responses, previous_response_id, restart of strata-next + 'smoke-response-history', # stored responses, previous_response_id, restart of leleka-api 'smoke-sse-keepalive', 'smoke-native-drain', 'smoke-queue-deadline', diff --git a/scripts/test-linux-package.py b/scripts/test-linux-package.py index 45a97596..b6aa42c2 100644 --- a/scripts/test-linux-package.py +++ b/scripts/test-linux-package.py @@ -146,7 +146,7 @@ class PackageTests(unittest.TestCase): workspace_lock = self.root / 'Cargo.lock' workspace_lock.write_text('version = 4\n') target = self.root / 'target' - binary = target / pkg.TARGET / 'release/strata-next' + binary = target / pkg.TARGET / 'release/leleka-api' binary.parent.mkdir(parents=True) binary.write_bytes(b'outer executable fixture') args = SimpleNamespace(engine=engine, sha256=pkg.sha256(engine), revision='a' * 40, diff --git a/scripts/test-model-switch.py b/scripts/test-model-switch.py index 787cea1a..913ec450 100644 --- a/scripts/test-model-switch.py +++ b/scripts/test-model-switch.py @@ -93,7 +93,7 @@ class PreparationTests(unittest.TestCase): spec=importlib.util.spec_from_file_location('agent',Path(__file__).with_name('strata-agent-profile.py')) agent=importlib.util.module_from_spec(spec);spec.loader.exec_module(agent) with patch.object(agent,'prepare',side_effect=FileNotFoundError('missing')), patch.object(agent,'state') as state, patch.object(agent,'unload') as unload: - with self.assertRaises(FileNotFoundError):agent.start('strata-next-kar-ple-gpu') + with self.assertRaises(FileNotFoundError):agent.start('leleka-api-kar-ple-gpu') state.assert_not_called();unload.assert_not_called() def test_gpu_release_waits_without_killing(self): @@ -104,7 +104,7 @@ class PreparationTests(unittest.TestCase): class DeploymentTests(unittest.TestCase): def setUp(self): - self.tmp = tempfile.TemporaryDirectory(prefix='strata-controller-') + self.tmp = tempfile.TemporaryDirectory(prefix='leleka-control-planeler-') self.addCleanup(self.tmp.cleanup) self.root = Path(self.tmp.name).resolve() self.value = dict(schema_version=1, **{key: str(self.root/key) for key in @@ -195,7 +195,7 @@ class DeploymentTests(unittest.TestCase): host=self.host(); key=self.root/'key';key.write_text('fixture-token');key.chmod(0o600) self.value['key_file']=str(key) response=Mock(status=200) - response.read.return_value=json.dumps(dict(service='strata-control',model='fixture',ready=True)).encode() + response.read.return_value=json.dumps(dict(service='leleka-control-plane',model='fixture',ready=True)).encode() conn=Mock();conn.getresponse.return_value=response with patch.object(m.http.client,'HTTPConnection',return_value=conn): self.assertTrue(host.ready(OLD)) diff --git a/scripts/test-native-api.py b/scripts/test-native-api.py index a9fb7910..ce4ede17 100644 --- a/scripts/test-native-api.py +++ b/scripts/test-native-api.py @@ -42,7 +42,7 @@ class ControlTests(unittest.TestCase): worker = replies.pop(0) if worker is None: raise client.NativeConnectionError('offline') - return {'service': 'strata-control', 'ready': worker == 'ready', 'worker': worker} + return {'service': 'leleka-control-plane', 'ready': worker == 'ready', 'worker': worker} result = client.control('wait-ready', dict(TARGET, key_file='private'), lambda _: token, wait=1, transport=transport, clock=lambda: now[0], sleep=lambda seconds: now.__setitem__(0, now[0] + seconds)) @@ -51,7 +51,7 @@ class ControlTests(unittest.TestCase): self.assertEqual(calls, [('GET', '/status', token, n) for n in [1, .75, .5, .25]]) def test_wait_ready_single_check_and_deadline_includes_initial_request(self): - ready = {'service': 'strata-control', 'ready': True, 'worker': 'ready'} + ready = {'service': 'leleka-control-plane', 'ready': True, 'worker': 'ready'} self.assertEqual(client.control('wait-ready', TARGET, None, transport=lambda *a, **k: ready)['runtime'], ready) for response in [dict(ready, ready=False), None]: @@ -81,11 +81,11 @@ class ControlTests(unittest.TestCase): calls = [] def transport(*args, **kwargs): calls.append(args) - return {'service': 'strata-control', 'ready': ready, 'worker': worker} + return {'service': 'leleka-control-plane', 'ready': ready, 'worker': worker} with self.assertRaises(RuntimeError): client.control('wait-ready', TARGET, None, wait=5, transport=transport) self.assertEqual(len(calls), 1) - for bad in [{'service': 'other', 'ready': True}, {'service': 'strata-control', 'ready': 1}]: + for bad in [{'service': 'other', 'ready': True}, {'service': 'leleka-control-plane', 'ready': 1}]: with self.assertRaisesRegex(RuntimeError, 'not a native'): client.control('wait-ready', TARGET, None, wait=1, transport=lambda *a, **k: bad) calls = [] @@ -100,7 +100,7 @@ class ControlTests(unittest.TestCase): calls = [] def transport(url, method, path, token): calls.append((method, path)) - return {'service': 'strata-control', 'ready': False} if path == '/status' else state() + return {'service': 'leleka-control-plane', 'ready': False} if path == '/status' else state() result = client.control('resume', TARGET, None, transport=transport) self.assertFalse(result['connection_changed']) self.assertEqual(calls, [('GET', '/status'), ('POST', '/admin/resume')]) @@ -141,7 +141,7 @@ class ControlTests(unittest.TestCase): def transport(url, method, path, token, **kwargs): calls.append((method, path)) if path == '/status': - return {'service': 'strata-control', 'ready': True} + return {'service': 'leleka-control-plane', 'ready': True} if path == '/admin/drain' or ending == 'timeout': return state(True, 1) return state(ending == 'complete') @@ -162,7 +162,7 @@ class ControlTests(unittest.TestCase): client.lifecycle(invalid) with self.assertRaisesRegex(RuntimeError, 'metrics'): client.control('metrics', TARGET, None, transport=lambda u, m, p, t: - {'service': 'strata-control', 'ready': True} if p == '/status' else {'schema_version': 2}) + {'service': 'leleka-control-plane', 'ready': True} if p == '/status' else {'schema_version': 2}) def test_cli_auth_is_not_inherited_for_url_overrides(self): def unexpected(*args): @@ -189,7 +189,7 @@ class HttpTests(unittest.TestCase): def do_GET(self): seen.append((self.path, self.headers.get('Authorization'))) ready = len(seen) > 1 - body = json.dumps({'service': 'strata-control', 'ready': ready, + body = json.dumps({'service': 'leleka-control-plane', 'ready': ready, 'worker': 'ready' if ready else 'starting'}).encode() self.send_response(200) self.send_header('Content-Type', 'application/json') diff --git a/scripts/test-native-service.py b/scripts/test-native-service.py index 00c70981..5a7e3b62 100644 --- a/scripts/test-native-service.py +++ b/scripts/test-native-service.py @@ -47,7 +47,7 @@ class ControlTests(unittest.TestCase): def test_idempotent_start_stop_and_readiness_is_not_inferred(self): host = FakeHost() def call(action): - return client.control(action, 'rnr5090', 'strata-next-test.service', runner=host) + return client.control(action, 'rnr5090', 'leleka-api-test.service', runner=host) self.assertFalse(call('status')['changed']) self.assertTrue(call('start')['changed']) again = call('start') @@ -59,14 +59,14 @@ class ControlTests(unittest.TestCase): self.assertFalse(call('stop')['changed']) mutations = [args for _, args in host.calls if args[2] in {'start', 'stop'}] self.assertEqual([args[2] for args in mutations], ['start', 'stop']) - self.assertTrue(all(args[-2:] == ['--', 'strata-next-test.service'] for args in mutations)) + self.assertTrue(all(args[-2:] == ['--', 'leleka-api-test.service'] for args in mutations)) def test_rejected_selectors_never_reach_ssh(self): host = FakeHost() for bad in ['-oProxyCommand=x', 'host;id', 'host\nother', 'user@host', 'host name']: with self.assertRaises(ValueError): - client.control('start', bad, 'strata-next.service', runner=host) - for bad in ['sshd.service', 'strata-next.service;id', '../strata-next.service', 'strata-next@a.service']: + client.control('start', bad, 'leleka-api.service', runner=host) + for bad in ['sshd.service', 'leleka-api.service;id', '../leleka-api.service', 'leleka-api@a.service']: with self.assertRaises(ValueError): client.control('stop', 'rnr5090', bad, runner=host) self.assertEqual(host.calls, []) @@ -75,19 +75,19 @@ class ControlTests(unittest.TestCase): host = FakeHost() host.loaded = False with self.assertRaisesRegex(RuntimeError, 'provision'): - client.control('start', 'rnr5090', 'strata-next.service', runner=host) + client.control('start', 'rnr5090', 'leleka-api.service', runner=host) self.assertEqual(len(host.calls), 1) self.assertEqual(host.calls[0][1][2], 'show') def test_invalid_status_fails_closed(self): with self.assertRaisesRegex(RuntimeError, 'invalid'): - client.control('start', 'rnr5090', 'strata-next.service', + client.control('start', 'rnr5090', 'leleka-api.service', runner=lambda *_: 'LoadState=loaded\nActiveState=active\nMainPID=oops') def test_logs_are_scoped_and_bounded(self): host = FakeHost() - self.assertEqual(client.control('logs', 'rnr5090', 'strata-next-test.service', runner=host), 'fixture log\n') - self.assertEqual(host.calls[-1][1], ['journalctl', '--user', '--unit=strata-next-test.service', + self.assertEqual(client.control('logs', 'rnr5090', 'leleka-api-test.service', runner=host), 'fixture log\n') + self.assertEqual(host.calls[-1][1], ['journalctl', '--user', '--unit=leleka-api-test.service', '--lines=100', '--no-pager', '--output=short-iso']) @@ -146,7 +146,7 @@ class PreflightTests(unittest.TestCase): self.assertEqual(json.loads(output.getvalue()), {'fixture': True}) check.assert_called_once_with('rnr5090', '/b', '/c', '/d') for args in [['check-config'], ['status', '--binary', '/b'], - ['check-config', '--binary', '/b', '--config', '/c', '--working-dir', '/d', '--unit', 'strata-next.service']]: + ['check-config', '--binary', '/b', '--config', '/c', '--working-dir', '/d', '--unit', 'leleka-api.service']]: with contextlib.redirect_stderr(io.StringIO()), self.assertRaises(SystemExit): client.main(args) diff --git a/scripts/test-ple-config-parity.py b/scripts/test-ple-config-parity.py index 512e6a3b..b0f1137d 100644 --- a/scripts/test-ple-config-parity.py +++ b/scripts/test-ple-config-parity.py @@ -33,7 +33,7 @@ class ParityTests(unittest.TestCase): '--spec', '4', '--spec-min-p', '0.5', '--expert-cache', 'auto', '--prefill', 'auto', '--vram-reserve-mib', '700', '--mtp', '/models/mtp-v1', ] - self.candidate_executable = '/runtime/strata-next' + self.candidate_executable = '/runtime/leleka-api' self.ple = ['--ple-kar', str(self.archive), '--ple-kar-level', '2', '--ple-kar-gpu-cache-mib', '64'] self.legacy = {'exe': '/legacy/strata', 'args': list(self.legacy_args), diff --git a/scripts/test-runtime-image.py b/scripts/test-runtime-image.py index 6a251163..b70bdd2f 100644 --- a/scripts/test-runtime-image.py +++ b/scripts/test-runtime-image.py @@ -206,7 +206,7 @@ class IsolatedProbeTests(unittest.TestCase): def test_probe_uses_long_infrastructure_deadline_and_original_cli_deadline(self): calls = [] with patch.object(b, 'docker', side_effect=self.fake_docker(calls)): - output = b.isolated_run('sha256:' + 'a' * 64, ['engine-info'], entrypoint='strata-next') + output = b.isolated_run('sha256:' + 'a' * 64, ['engine-info'], entrypoint='leleka-api') self.assertEqual(output, 'probe output\n') operations = [call[0][0] for call in calls] self.assertEqual(operations, ['create', 'start', 'wait', 'logs', 'rm']) @@ -221,7 +221,7 @@ class IsolatedProbeTests(unittest.TestCase): self.assertIn('--read-only', create[0]) self.assertIn('--cap-drop', create[0]) self.assertIn('65532:65532', create[0]) - self.assertIn('strata-next', create[0]) + self.assertIn('leleka-api', create[0]) self.assertEqual(start[0][1], create[0][create[0].index('--name') + 1]) self.assertEqual(wait[0][1], start[0][1]) self.assertEqual(logs[0][-1], start[0][1]) diff --git a/scripts/windows/Start-Leleka.ps1 b/scripts/windows/Start-Leleka.ps1 index 06ac9bf4..ba156a56 100644 --- a/scripts/windows/Start-Leleka.ps1 +++ b/scripts/windows/Start-Leleka.ps1 @@ -3,7 +3,7 @@ Starts the Leleka gpt-oss runtime on Windows: the control plane (/v1/responses) with a CPU, iGPU or NPU worker. .DESCRIPTION - Writes a configuration for strata-next, starts it, waits until it is ready and keeps it running in the + Writes a configuration for leleka-api, starts it, waits until it is ready and keeps it running in the foreground (Ctrl+C stops the control plane and its workers). Nothing is installed or downloaded. Modes (-Mode): @@ -22,7 +22,7 @@ .PARAMETER Model Path of gpt-oss-20b-MXFP4.gguf (SHA-256 65d06d31...cde53ab is the file this runtime was measured with). .PARAMETER BinDir - Folder with strata-next.exe and the workers. Default: bin next to this script, else target\release of the repository. + Folder with leleka-api.exe and the workers. Default: bin next to this script, else target\release of the repository. #> [CmdletBinding()] param( @@ -43,9 +43,9 @@ $ErrorActionPreference = 'Stop' if (-not (Test-Path -LiteralPath $Model -PathType Leaf)) { throw "model file not found: $Model" } if (-not $BinDir) { $candidates = @((Join-Path $PSScriptRoot 'bin'), (Join-Path $PSScriptRoot '..\..\target\release'), (Join-Path $PSScriptRoot '..\..\dist\windows')) - $BinDir = $candidates | Where-Object { Test-Path (Join-Path $_ 'strata-next.exe') } | Select-Object -First 1 + $BinDir = $candidates | Where-Object { Test-Path (Join-Path $_ 'leleka-api.exe') } | Select-Object -First 1 } -if (-not $BinDir -or -not (Test-Path (Join-Path $BinDir 'strata-next.exe'))) { throw 'strata-next.exe not found; pass -BinDir' } +if (-not $BinDir -or -not (Test-Path (Join-Path $BinDir 'leleka-api.exe'))) { throw 'leleka-api.exe not found; pass -BinDir' } $BinDir = (Resolve-Path $BinDir).Path $worker = @{ igpu = 'leleka-igpu-worker'; cpu = 'leleka-cpu-worker'; npu = 'leleka-npu-worker' }[$Mode] @@ -80,7 +80,7 @@ $configPath = Join-Path $work 'config.json' } | ConvertTo-Json -Depth 5 | ForEach-Object { [IO.File]::WriteAllText($configPath, $_, (New-Object Text.UTF8Encoding($false))) } Write-Host "Leleka: $Mode worker, $Threads threads, context $Context, $CacheSlots cache slots, speculation $(if ($NoSpeculate) {'off'} else {'on'})" -$server = Start-Process (Join-Path $BinDir 'strata-next.exe') -ArgumentList @('serve', '--config', $configPath) -PassThru -NoNewWindow +$server = Start-Process (Join-Path $BinDir 'leleka-api.exe') -ArgumentList @('serve', '--config', $configPath) -PassThru -NoNewWindow try { $deadline = (Get-Date).AddSeconds($StartupTimeoutSeconds + 30) $ready = $false diff --git a/scripts/windows/build-release.ps1 b/scripts/windows/build-release.ps1 index a70215eb..3aecb1b9 100644 --- a/scripts/windows/build-release.ps1 +++ b/scripts/windows/build-release.ps1 @@ -3,11 +3,11 @@ # powershell -ExecutionPolicy Bypass -File scripts\windows\build-release.ps1 [-OutDir dist] [-NoSm86] # # Needs: Rust 1.99 (rust-toolchain.toml pins it), Visual Studio Build Tools (MSVC linker and cl.exe for the ggml C -# bridge of strata-next). No CUDA toolkit: every PTX image is sealed in the repository and nvcuda.dll comes with the +# bridge of leleka-api). No CUDA toolkit: every PTX image is sealed in the repository and nvcuda.dll comes with the # NVIDIA driver. The default build carries the sm86 companions (RTX 30-series, e.g. the 3080 laptop); -NoSm86 builds # the sm_120-only variant. # -# Produces dist\bin\{leleka,strata-next,leleka-inference,leleka-daemon,leleka-cli,leleka-seal-exec}.exe. +# Produces dist\bin\{leleka,leleka-api,leleka-inference,leleka-daemon,leleka-cli,leleka-seal-exec}.exe. # leleka-seal-exec.exe is the stub that prints "sealed memfd archives require Linux": the Windows engine opens the KAR # archive as a read-only file (kar_source=file), so nothing runs it; it is copied only because `leleka` lists six binaries. param( @@ -26,14 +26,14 @@ function Invoke-Cargo { $features = @() if (-not $NoSm86) { $features = @("--features", "sm86") } -Invoke-Cargo build --release --locked -p strata-desktop-core @features --bin leleka-inference --bin leleka-daemon --bin leleka-cli --bin leleka-seal-exec -Invoke-Cargo build --release --locked -p strata-control --bin strata-next +Invoke-Cargo build --release --locked -p leleka-engine-host @features --bin leleka-inference --bin leleka-daemon --bin leleka-cli --bin leleka-seal-exec +Invoke-Cargo build --release --locked -p leleka-control-plane --bin leleka-api Invoke-Cargo build --release --locked -p leleka-deploy --bin leleka $target = if ($env:CARGO_TARGET_DIR) { $env:CARGO_TARGET_DIR } else { Join-Path $root "target" } $bin = Join-Path $OutDir "bin" New-Item -ItemType Directory -Force -Path $bin | Out-Null -foreach ($name in "leleka", "strata-next", "leleka-inference", "leleka-daemon", "leleka-cli", "leleka-seal-exec") { +foreach ($name in "leleka", "leleka-api", "leleka-inference", "leleka-daemon", "leleka-cli", "leleka-seal-exec") { $source = Join-Path $target "release\$name.exe" if (-not (Test-Path $source)) { throw "missing build output: $source" } Copy-Item -Force $source (Join-Path $bin "$name.exe")