wip: rename strata-next/strata-control/strata-desktop-core (to be squashed in the final rename commit)

This commit is contained in:
Pavlo Ratushnyi
2026-11-14 20:30:41 +01:00
parent a931fa9341
commit 94592f4fa0
348 changed files with 1178 additions and 1122 deletions
+39 -39
View File
@@ -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 }}
+2 -2
View File
@@ -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
Generated
+81 -81
View File
@@ -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"
+1 -1
View File
@@ -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"
+1 -1
View File
@@ -3,7 +3,7 @@
**Статус:** проєктний документ v0.1
**Дата:** 2026-10-02
**Тип:** окремий проєкт і форк Strata
**Робоча назва:** `strata-next`
**Робоча назва:** `leleka-api`
## 1. Мета проєкту
+1 -1
View File
@@ -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`.
+4 -4
View File
@@ -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": []
}
+21 -21
View File
@@ -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<dyn Clock> the composition root hands to AppState"},
{"crate": "strata-control", "file": "src/ports/engine.rs", "ratchet": "dyn-trait", "reason": "port boundary: SharedEngine is the Arc<dyn EngineClient> 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<dyn ResponseStore> 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<dyn ToolHub> the composition root hands to AppState"},
{"crate": "strata-control", "file": "src/ports/vision.rs", "ratchet": "dyn-trait", "reason": "port boundary: SharedVisionEncoder is the Arc<dyn VisionEncoder> 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<dyn TextCodec>, once per request"},
{"crate": "strata-control", "file": "src/responses.rs", "ratchet": "dyn-trait", "reason": "SharedCodec, the alias of Arc<dyn TextCodec> 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<dyn Clock> the composition root hands to AppState"},
{"crate": "leleka-control-plane", "file": "src/ports/engine.rs", "ratchet": "dyn-trait", "reason": "port boundary: SharedEngine is the Arc<dyn EngineClient> the composition root hands to AppState"},
{"crate": "leleka-control-plane", "file": "src/ports/response_store.rs", "ratchet": "dyn-trait", "reason": "port boundary: SharedResponseStore is the Arc<dyn ResponseStore> the composition root hands to AppState"},
{"crate": "leleka-control-plane", "file": "src/ports/tool_hub.rs", "ratchet": "dyn-trait", "reason": "port boundary: SharedToolHub is the Arc<dyn ToolHub> the composition root hands to AppState"},
{"crate": "leleka-control-plane", "file": "src/ports/vision.rs", "ratchet": "dyn-trait", "reason": "port boundary: SharedVisionEncoder is the Arc<dyn VisionEncoder> the composition root hands to AppState"},
{"crate": "leleka-control-plane", "file": "src/app/state.rs", "ratchet": "dyn-trait", "reason": "the tokenizer family (Qwen or gpt-oss) is chosen at start-up and held as Arc<dyn TextCodec>, once per request"},
{"crate": "leleka-control-plane", "file": "src/responses.rs", "ratchet": "dyn-trait", "reason": "SharedCodec, the alias of Arc<dyn TextCodec> that the response stages share"},
{"crate": "leleka-control-plane", "file": "src/model/manifest_fetch.rs", "ratchet": "dyn-trait", "reason": "walks an error's source() chain, whose items are dyn Error"},
{"crate": "leleka-control-plane", "file": "src/wire.rs", "ratchet": "dyn-trait", "reason": "the per-request token-bytes closure of a reasoning plan, built once per request from the tokenizer"},
{"crate": "leleka-engine-host", "file": "src/node.rs", "ratchet": "dyn-trait", "reason": "tonic server-streaming response type: the generated trait wants a boxed stream"},
{"crate": "leleka-engine-host", "file": "src/runtime_rpc.rs", "ratchet": "dyn-trait", "reason": "tonic server-streaming response type: the generated trait wants a boxed stream"},
{"crate": "leleka-backend-api", "file": "src/scripted.rs", "ratchet": "dyn-trait", "reason": "the scripted test engine stores the test's responder closure"},
{"crate": "leleka-gateway-domain", "file": "src/responses/schema.rs", "ratchet": "process-global", "reason": "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"},
@@ -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) {
+3 -3
View File
@@ -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) {
+3 -3
View File
@@ -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
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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
+3 -3
View File
@@ -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]
+1 -1
View File
@@ -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 <max-context>`. 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.
+1 -1
View File
@@ -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<dyn std::error::Error>;
+1 -1
View File
@@ -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<dyn std::error::Error>;
+3 -3
View File
@@ -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,
+6 -6
View File
@@ -34,20 +34,20 @@ fn worker_config(tokenizer: Arc<Tokenizer>) -> BackendWorkerConfig {
fn app_state(
status: &Arc<RwLock<WorkerStatus>>,
requests: mpsc::Sender<strata_control::worker::GenerationCommand>,
control: mpsc::Sender<strata_control::worker::Control>,
requests: mpsc::Sender<leleka_control_plane::worker::GenerationCommand>,
control: mpsc::Sender<leleka_control_plane::worker::Control>,
tokenizer: &Arc<Tokenizer>,
) -> 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<RwLock<WorkerStatus>>) {
type SpawnedWorker = (
watch::Sender<bool>,
mpsc::Sender<strata_control::worker::GenerationCommand>,
mpsc::Sender<strata_control::worker::Control>,
mpsc::Sender<leleka_control_plane::worker::GenerationCommand>,
mpsc::Sender<leleka_control_plane::worker::Control>,
tokio::task::JoinHandle<()>,
);
+2 -2
View File
@@ -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,
+1 -1
View File
@@ -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<dyn std::error::Error>;
+1 -1
View File
@@ -21,7 +21,7 @@ pub(super) async fn lifecycle_status(State(state): State<AppState>) -> Json<serd
WorkerState::Ready | WorkerState::Unconfigured | WorkerState::Unloaded
);
Json(
serde_json::json!({"service":"strata-control", "server_pid":std::process::id(), "model":state.model.name,
serde_json::json!({"service":"leleka-control-plane", "server_pid":std::process::id(), "model":state.model.name,
"draining":lifecycle.draining,
"shutting_down":lifecycle.shutting_down,
"max_in_flight_requests":lifecycle.max_in_flight_requests,
+1 -1
View File
@@ -46,7 +46,7 @@ pub(super) fn status_body(
model: Option<String>,
) -> StatusResponse {
StatusResponse {
service: "strata-control",
service: "leleka-control-plane",
server_pid: std::process::id(),
model,
version: env!("CARGO_PKG_VERSION"),
+1 -1
View File
@@ -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();
+1 -1
View File
@@ -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).
//!
+1 -1
View File
@@ -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,
};
+2 -2
View File
@@ -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?
+1 -1
View File
@@ -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<Result<(), BoxError>>;
+1 -1
View File
@@ -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};
+1 -1
View File
@@ -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};
+1 -1
View File
@@ -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};
+2 -2
View File
@@ -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";
+6 -6
View File
@@ -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<strata_control::native_pack::Options, BoxError> {
let mut pack = strata_control::native_pack::Options::default();
) -> Result<leleka_control_plane::native_pack::Options, BoxError> {
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(())
}
+5 -5
View File
@@ -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!({
+1 -1
View File
@@ -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;
+2 -2
View File
@@ -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};
+13 -13
View File
@@ -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(())
}
+1 -1
View File
@@ -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::<Vec<_>>();
+3 -3
View File
@@ -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 \
+1 -1
View File
@@ -39,7 +39,7 @@ pub struct ShardedIdentity {
pub tensors: Vec<TensorIdentity>,
}
/// `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.
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -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,
+4 -4
View File
@@ -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<FixtureSummary, String> {
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,
);
+2 -2
View File
@@ -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<Report, String>
.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,
@@ -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
+2 -2
View File
@@ -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()
@@ -174,7 +174,7 @@ impl OverlayIdentity<'_> {
) -> Result<kar::Summary, String> {
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),
+1 -1
View File
@@ -68,7 +68,7 @@ fn read_candidates(candidate_path: &Path) -> Result<(Vec<u8>, 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()
{
@@ -21,7 +21,7 @@ pub fn resolve_verified(base_archive: &Path, overlay_archive: &Path) -> Result<R
let replacements = overlay_replacements(&overlay, &overlay_sources)?;
let records = resolve_records(&base_sources, &overlay_sources, &replacements)?;
Ok(Resolution {
schema: "strata-next/verified-kar-overlay-selection-v1",
schema: "leleka-api/verified-kar-overlay-selection-v1",
base_archive_sha256: base.archive_sha256,
overlay_archive_sha256: overlay.overlay_archive_sha256,
replacement_count: replacements.len(),
@@ -56,7 +56,7 @@ fn check_base_directory(
fn policy_differs(base: &BaseProvenance, overlay: &OverlayProvenance) -> 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
+1 -1
View File
@@ -67,7 +67,7 @@ pub(super) fn read_provenance(archive_path: &Path) -> Result<Provenance, String>
}
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)
{
@@ -61,7 +61,7 @@ pub(super) fn sample_records(
) -> Result<Report, String> {
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,
+2 -2
View File
@@ -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(),
+1 -1
View File
@@ -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 {
+1 -1
View File
@@ -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<String> = std::env::args().skip(1).collect();
cli::run(&args).await
}
+1 -1
View File
@@ -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.
+2 -2
View File
@@ -214,7 +214,7 @@ fn conversions_value(shards: &[Shard], records: &[Record], options: &Options) ->
"source_sha256":r.source_sha256})
})
.collect::<Vec<_>>();
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,
@@ -187,7 +187,7 @@ fn write_base_outputs(output: &Path, base: &Path, extra: &[Vec<u8>]) -> 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":[]}),
)
}
@@ -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),
@@ -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(
@@ -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
)
@@ -169,11 +169,11 @@ pub(super) fn apply_stream_policy(
ple_part_elements: Option<u64>,
) {
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);
@@ -113,10 +113,10 @@ fn streamed_tensors(prepared: &[StreamedTensor], levels: u8) -> Vec<kar_writer::
fn stream_builder(levels: u8, ple_part_elements: Option<u64>) -> 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")
}
}
@@ -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}],
@@ -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": [
@@ -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);
}
@@ -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();
+7 -7
View File
@@ -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<strata_control::embedded_engine::EmbeddedEngine>,
Option<leleka_control_plane::embedded_engine::EmbeddedEngine>,
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<Option<strata_control::embedded_engine::EmbeddedEngine>, BoxError> {
) -> Result<Option<leleka_control_plane::embedded_engine::EmbeddedEngine>, 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();
}
+8 -8
View File
@@ -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,
+4 -4
View File
@@ -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<bool>,
) -> 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<strata_control::ports::SharedToolHub>,
hub: Option<leleka_control_plane::ports::SharedToolHub>,
vision: Option<Arc<Vision>>,
tasks: Tasks,
) -> Result<(), BoxError> {
+13 -13
View File
@@ -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<app::AppState, BoxError> {
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);
}
+4 -4
View File
@@ -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)]
@@ -28,7 +28,7 @@ pub(super) fn parse(args: &[String]) -> Result<Options, String> {
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())
+6 -6
View File
@@ -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).
@@ -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());
+1 -1
View File
@@ -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)]
+1 -1
View File
@@ -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\
+1 -1
View File
@@ -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",
}
}
+3 -3
View File
@@ -88,7 +88,7 @@ fn check_probe_identity(
model: &str,
expected_pid: Option<u32>,
) -> 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<u32>) -> 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);
}
+1 -1
View File
@@ -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!(
+2 -2
View File
@@ -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<Value>) -> 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<Value>) -> axum::Router {
/// `/admin/lifecycle` reports `reported_pid`; `/admin/drain` counts its posts and fails.
fn admission_router(reported_pid: u32, observed: Arc<AtomicUsize>) -> 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",
});
@@ -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 {
@@ -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) {
@@ -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<String, Value>, 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()
@@ -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);
@@ -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};
@@ -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,
+1 -1
View File
@@ -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 {
+2 -2
View File
@@ -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()
+1 -1
View File
@@ -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<u8> {
(0..text.len() / 2)
+1 -1
View File
@@ -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",
@@ -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()
+1 -1
View File
@@ -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()
+4 -4
View File
@@ -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<Arc<strata_control::auth::ApiKey>> {
fn api_key_from(setup: &Value, dir: &std::path::Path) -> Option<Arc<leleka_control_plane::auth::ApiKey>> {
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<Arc<strata_contr
use std::os::unix::fs::PermissionsExt;
std::fs::set_permissions(&path, std::fs::Permissions::from_mode(0o600)).unwrap();
}
Arc::new(strata_control::auth::ApiKey::from_file(&path).unwrap())
Arc::new(leleka_control_plane::auth::ApiKey::from_file(&path).unwrap())
})
}
@@ -82,7 +82,7 @@ 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()
},
+1 -1
View File
@@ -11,7 +11,7 @@ use leleka_model_format::kar_kernel_model::{
};
use sha2::{Digest, Sha256};
use std::{fs, path::PathBuf};
use strata_control::{kar, kar_writer};
use leleka_control_plane::{kar, kar_writer};
struct Rng(u64);
impl Rng {
+3 -3
View File
@@ -1,6 +1,6 @@
//! Charter M1 / Gate A: a failing log sink must never cut an SSE stream short of its terminal event.
//!
//! Starts the real `strata-next` binary with a scripted engine, lets its stderr consumer disappear after startup
//! Starts the real `leleka-api` binary with a scripted engine, lets its stderr consumer disappear after startup
//! (journald or the container log driver going away makes every later write fail with EPIPE) and then provokes
//! an engine protocol failure in the middle of a streamed Responses request. The stream must still end with
//! `response.failed`, and the process must keep answering `/health`.
@@ -86,7 +86,7 @@ fn free_port() -> 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:?}"
);
}
+1 -1
View File
@@ -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")
@@ -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,
+1 -1
View File
@@ -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"];
@@ -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,

Some files were not shown because too many files have changed in this diff Show More