From fe34d883d01194658091b85c5c7892c16c4533ba Mon Sep 17 00:00:00 2001 From: Pavlo Ratushnyi Date: Mon, 2 Nov 2026 20:25:09 +0100 Subject: [PATCH 1/3] release 5090 v0.1, phase A: checklist, notes draft, licence/secrets audit, packager (check/stage-source/build/package/verify), leleka version identity, *.ptx -text Co-Authored-By: Claude Sonnet 5.5 --- .gitattributes | 8 + crates/deploy/build.rs | 67 +++ crates/deploy/src/app.rs | 35 +- docs/release/5090-v0.1-checklist.md | 144 ++++++ docs/release/RELEASE-NOTES-5090-v0.1.md | 136 +++++ .../licence-and-secrets-audit-5090-v0.1.md | 75 +++ docs/release/third-party-crates-5090-v0.1.tsv | 204 ++++++++ scripts/release/package-5090.ps1 | 64 +++ scripts/release/package-5090.sh | 472 ++++++++++++++++++ 9 files changed, 1204 insertions(+), 1 deletion(-) create mode 100644 crates/deploy/build.rs create mode 100644 docs/release/5090-v0.1-checklist.md create mode 100644 docs/release/RELEASE-NOTES-5090-v0.1.md create mode 100644 docs/release/licence-and-secrets-audit-5090-v0.1.md create mode 100644 docs/release/third-party-crates-5090-v0.1.tsv create mode 100644 scripts/release/package-5090.ps1 create mode 100644 scripts/release/package-5090.sh diff --git a/.gitattributes b/.gitattributes index 7df5e12c..4da708ee 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,3 +7,11 @@ scripts/gpu-bringup/**/*.py text=auto eol=lf # Codex lossy-delta study: task files are hashed byte for byte (no EOL conversion); the runner scripts are LF. scripts/e2e/codex/tasks/** -text scripts/e2e/codex/delta/** text eol=lf + +# Release reproducibility (docs/release/5090-v0.1-checklist.md): the sealed PTX files are pinned by SHA-256 in the sources, so the bytes in the +# working tree must be the bytes in the index on every platform. Without this line a Windows checkout with core.autocrlf=true turns 212 of the +# 273 .ptx files into CRLF (the other 61 end in a NUL byte, which git treats as binary) so the embedded PTX is not the sealed one (a CRLF checkout built a binary 9 MB smaller than every earlier one, docs/experiments/baseline-pair-5090.md part d). +*.ptx -text +# The release packager and the files it copies into the tarball are POSIX shell and systemd text: LF everywhere. +scripts/release/** text eol=lf +deploy/rust-runtime/** text eol=lf diff --git a/crates/deploy/build.rs b/crates/deploy/build.rs new file mode 100644 index 00000000..437851ec --- /dev/null +++ b/crates/deploy/build.rs @@ -0,0 +1,67 @@ +//! Build identity for `leleka version` (release checklist docs/release/5090-v0.1-checklist.md, section 3). +//! +//! Embeds the git commit of the tree the binary was built from, whether that tree had uncommitted changes, and the Strata upstream pin +//! recorded in `docs/upstream.md`. The release packager (`scripts/release/package-5090.sh`) exports `LELEKA_GIT_COMMIT` and +//! `LELEKA_GIT_DIRTY` so the values do not depend on `git` being callable from the build script; an ordinary developer build asks git itself +//! and falls back to `unknown` (an exported tree has no `.git`). Nothing here reads the network or changes the generated code of the engine. + +use std::path::{Path, PathBuf}; +use std::process::Command; + +fn git(repo: &Path, args: &[&str]) -> Option { + let output = Command::new("git").args(args).current_dir(repo).output().ok()?; + if !output.status.success() { + return None; + } + Some(String::from_utf8_lossy(&output.stdout).trim().to_owned()) +} + +/// The 40-hex commit on the `Upstream commit SHA` row of the pin table in `docs/upstream.md`. +fn upstream_pin(doc: &Path) -> Option { + let text = std::fs::read_to_string(doc).ok()?; + let line = text.lines().find(|line| line.contains("Upstream commit SHA"))?; + let start = line.find('`')? + 1; + let end = start + line[start..].find('`')?; + let sha = &line[start..end]; + (sha.len() == 40 && sha.bytes().all(|b| b.is_ascii_hexdigit())).then(|| sha.to_ascii_lowercase()) +} + +fn main() { + let manifest = PathBuf::from(std::env::var_os("CARGO_MANIFEST_DIR").expect("cargo sets CARGO_MANIFEST_DIR")); + let repo = manifest.join("..").join(".."); + + println!("cargo:rerun-if-env-changed=LELEKA_GIT_COMMIT"); + println!("cargo:rerun-if-env-changed=LELEKA_GIT_DIRTY"); + let doc = repo.join("docs").join("upstream.md"); + println!("cargo:rerun-if-changed={}", doc.display()); + // A commit moves the reflog of HEAD; a branch switch moves HEAD itself. + for name in ["HEAD", "logs/HEAD"] { + if let Some(path) = git(&repo, &["rev-parse", "--git-path", name]) { + println!("cargo:rerun-if-changed={}", repo.join(path).display()); + } + } + + let commit = std::env::var("LELEKA_GIT_COMMIT") + .ok() + .filter(|value| !value.trim().is_empty()) + .or_else(|| git(&repo, &["rev-parse", "HEAD"])) + .unwrap_or_else(|| "unknown".to_owned()); + let dirty = match std::env::var("LELEKA_GIT_DIRTY").ok().filter(|value| !value.trim().is_empty()) { + Some(value) => match value.trim() { + "0" | "no" | "false" | "clean" => "clean", + _ => "dirty", + }, + None => match git(&repo, &["status", "--porcelain", "--untracked-files=no"]) { + Some(status) if status.is_empty() => "clean", + Some(_) => "dirty", + None => "unknown", + }, + }; + let pin = upstream_pin(&doc).unwrap_or_else(|| "unknown".to_owned()); + + println!("cargo:rustc-env=LELEKA_BUILD_COMMIT={commit}"); + println!("cargo:rustc-env=LELEKA_BUILD_TREE={dirty}"); + println!("cargo:rustc-env=LELEKA_BUILD_STRATA_PIN={pin}"); + println!("cargo:rustc-env=LELEKA_BUILD_TARGET={}", std::env::var("TARGET").unwrap_or_else(|_| "unknown".to_owned())); + println!("cargo:rustc-env=LELEKA_BUILD_PROFILE={}", std::env::var("PROFILE").unwrap_or_else(|_| "unknown".to_owned())); +} diff --git a/crates/deploy/src/app.rs b/crates/deploy/src/app.rs index bf38af1a..33699743 100644 --- a/crates/deploy/src/app.rs +++ b/crates/deploy/src/app.rs @@ -14,6 +14,23 @@ pub fn env_var(name: &str) -> Option { std::env::var(name).ok().filter(|v| !v.is_empty()) } +/// What `leleka version` prints: the first line stays `leleka VERSION` (scripts parse it); the rest is the build identity embedded by +/// `build.rs` (docs/release/5090-v0.1-checklist.md, section 3). +pub fn version_text() -> String { + format!( + "leleka {} +commit {} ({}) +strata pin {} (upstream commit of docs/upstream.md at build time) +built for {}, {} profile", + env!("CARGO_PKG_VERSION"), + env!("LELEKA_BUILD_COMMIT"), + env!("LELEKA_BUILD_TREE"), + env!("LELEKA_BUILD_STRATA_PIN"), + env!("LELEKA_BUILD_TARGET"), + env!("LELEKA_BUILD_PROFILE"), + ) +} + fn is_root() -> bool { #[cfg(target_os = "linux")] { @@ -73,7 +90,7 @@ pub async fn main_native(mut args: Vec) -> i32 { 0 } Command::Version => { - println!("leleka {}", env!("CARGO_PKG_VERSION")); + println!("{}", version_text()); 0 } Command::Profiles(None) => { @@ -909,6 +926,22 @@ pub async fn stop_foreground(paths: &crate::layout::Paths) -> i32 { 1 } +#[cfg(test)] +mod version_tests { + use super::version_text; + + #[test] + fn the_version_names_the_commit_and_the_strata_pin_and_keeps_the_first_line() { + let text = version_text(); + assert_eq!(text.lines().next(), Some(concat!("leleka ", env!("CARGO_PKG_VERSION")))); + let pin = env!("LELEKA_BUILD_STRATA_PIN"); + // docs/upstream.md is in the repository this crate is built from; an exported tree without it reports `unknown`. + assert!(pin == "unknown" || (pin.len() == 40 && pin.bytes().all(|b| b.is_ascii_hexdigit())), "{pin}"); + assert!(text.contains(env!("LELEKA_BUILD_COMMIT")), "{text}"); + assert!(["clean", "dirty", "unknown"].contains(&env!("LELEKA_BUILD_TREE"))); + } +} + #[cfg(test)] mod machine_tests { use super::render_machine; diff --git a/docs/release/5090-v0.1-checklist.md b/docs/release/5090-v0.1-checklist.md new file mode 100644 index 00000000..2b66fac9 --- /dev/null +++ b/docs/release/5090-v0.1-checklist.md @@ -0,0 +1,144 @@ +# Release checklist: Leleka 0.1 for the RTX 5090 serve path (`leleka-5090-v0.1`) + +Branch `claude/release-5090`, cut from main `f9003b7ce` (2026-11-02). **Phase A** (this page, the packager, the notes and the audit) is written without +the two branches that are still open: `claude/window-policy` (adaptive-window default policy, fused-commit default decision, `run-e2e.sh` environment) and +`claude/unattended` (fast holder load, one-command `leleka up`, supervision, systemd unit scripts, soak harness). **Phase B** starts when the orchestrator +reports both merged. Nothing here is pushed, published or tagged; the tag is created locally, at the very end of Phase B, only when every row below is PASS. + +Status words: **PASS** (evidence named), **OPEN** (to do in Phase B or by the named owner), **BLOCKER** (the release cannot be tagged until it is resolved), +**NOT CLAIMED** (deliberately outside the release; the notes say so). `scripts/release/package-5090.sh check` runs the mechanical rows (marked `[script]`). + +## 1. Scope + +| | in this release | out of this release (and what the notes say) | +| --- | --- | --- | +| hardware | RTX 5090 (sm_120, 32 GB), PCIe 5 x16, Ryzen 9 9950X3D class host, >= 100 GiB RAM total and 113 GB available at start (profile floors), local NVMe | RTX 3080 laptop and every other GPU: **experimental, not run for this release** (`docs/laptop-profile.md`); the 3080 profile is embedded in the binary but its PTX companions and any claim are not shipped. A 24 GB card (4090) has no profile | +| software | Linux x86_64, glibc >= 2.39, NVIDIA driver >= 595 (sealed PTX needs ISA 9.2), `libcublas.so.12` (CUDA 12; `leleka up` fetches the pinned 12.9.1.4 redistributable if the host has none). No CUDA toolkit and no Python on the serving host | Windows native, WSL2 as a serving target, container image (**no image was ever built**, `docs/deploy.md` section 10), TLS/remote access (SSH tunnel only) | +| model | Qwen3.8-Flash-Next IQ3_S (2 shards) + KAR level-2 PLE archive (55,295,529,472 B) + MTP pack, digests pinned in the binary (`crates/deploy/src/profile.rs`) | any other model; gpt-oss CPU/iGPU/NPU runtime and the worker pool (same control plane, own docs, not gated here); vision (images are refused); DeepSeek | +| serving shape | one stream at 262,144 tokens (charter 4.1), one generation at a time with a queue of 16, cross-session prefix cache, MTP speculative decode with the adaptive window, Responses / Chat Completions / Messages API, Codex CLI 0.163.0 validated | continuous batching (not a goal), multi-GPU, fleet scheduler (charter M6), sampling-quality claims (all identity, quality and speed evidence is **greedy**; sampled requests are accepted but not gated) | +| lossy modes | **all OFF**: route tail skip (`LELEKA_ROUTE_TAIL_SKIP`, quality gate failed), keyless/value-only KV, KAR expert paths, `tool_call_recovery`, draft vocabularies other than the Original's | nothing lossy is shipped as a default; the profile text keeps "Not a formally quality-gated profile" (section 4, rows Q1-Q9) | +| operations | `leleka up/run/status/verify/reconfigure/down/preflight/profiles/version`; systemd units are shipped as files, **the owner installs them** (no installer in this release touches system settings) | THP, sysctl, readahead, drop_caches, watchdogs: documented as owner actions only | + +## 2. Identity + +| item | value / rule | gate | +| --- | --- | --- | +| release tag | `leleka-5090-v0.1`, annotated, local, on the release commit (the last commit of `claude/release-5090` after the rebase) | OPEN (end of Phase B) | +| version number | `0.1.0` in all 34 workspace crates (`Cargo.toml` of each) and in `Cargo.lock`; the tag major.minor must equal it | PASS `[script]` gate_versions | +| `leleka version` | first line `leleka 0.1.0` (scripts parse it), then `commit <40 hex> (clean\|dirty)`, `strata pin <40 hex>`, `built for , `. New in this branch: `crates/deploy/build.rs` embeds the commit (the packager exports `LELEKA_GIT_COMMIT` / `LELEKA_GIT_DIRTY`; a developer build asks git) and the pin from `docs/upstream.md`; unit test `app::version_tests`. A release binary must say `(clean)` | PASS (unit test, Windows debug build); OPEN: run `bin/leleka version` from the package (Phase B `verify`) | +| MANIFEST / PROVENANCE | `MANIFEST.json` (schema 1, read by `leleka up`: version, commit, `features` = `[]` because this is an sm_120-only build, SHA-256 of the six binaries) and `PROVENANCE.json` (commit, branch, `Cargo.lock` SHA-256, toolchain, Strata upstream URL/commit/subtree tree id) | PASS `[script]` at package time | +| Strata upstream pin | `41cf05a06a25dd29103b7b27a2279a3f60c21876` (engine 0.1.50, app 0.2.5), **not moved**; the packager refuses any other pin (`RELEASE_STRATA_PIN`) | PASS `[script]` gate_pin | +| toolchain | `rust-toolchain.toml` = 1.99.0 (the packager compares `rustc --version`); no `[profile]` tuning: default `release` (no LTO, 16 codegen units, no target-cpu on purpose, `Cargo.toml` comment). `release-lto` is not used | PASS `[script]` gate_toolchain | +| build host | **WSL2 Ubuntu 24.04 on the laptop** (glibc 2.39 is the floor of the binaries), from a worktree checked out with LF endings and a **fresh `CARGO_TARGET_DIR`** inside the worktree (no hard deletes: do not wipe an old target). The 5090 server has **no Rust toolchain** (`decode/dt/BUILD.md`); installing one is a ~1 GB sequential write the owner has not approved, so the release is built in WSL and copied with `scp` like every measured binary | decision recorded; OPEN: owner may prefer a server build | +| PTX line endings | `*.ptx -text` in `.gitattributes` (new). Before this branch a Windows checkout with `core.autocrlf=true` turned 212 of 273 `.ptx` into CRLF (61 end in a NUL byte and were left alone by git's binary heuristic), so a Windows-side build embedded different PTX than the sealed one (the baseline-pair part-d binary came out 9 MB smaller). The packager checks `git ls-files --eol` of every `.ptx` and fails on any `crlf` / `mixed`; `verify` checks the shipped copies for CR bytes | PASS `[script]` gate_ptx (this worktree re-checked out as LF). **Other worktrees on the laptop still hold CRLF `.ptx`** until they re-checkout after the merge | +| reproducible bytes | the archive is deterministic (sorted, fixed owner and mtime = commit time, `xz -T1`); the binaries are deterministic only for the same toolchain **and the same absolute build path** (panic messages embed paths) | OPEN: Phase B builds twice at the same path and records whether the six digests agree; no claim if they do not | +| package contents | six binaries, the 5090 profile, two service templates + `runtime.env.example`, `install.sh`, 141 sealed sm_120 PTX with SHA-256 (the PTX is also embedded in the binaries), curated docs, licence texts, the unattended-operation files **when they exist at package time**, `SHA256SUMS`. Never: model weights, KAR archives, captures, credentials, logs, `*.py`, runtime.env, benchmark data | PASS `[script]` (staging scan and `verify`) | + +## 3. Upstream (Strata) pin: record and what moving it would require + +Pin: `41cf05a0` (`docs/upstream.md`). Upstream has moved on: 0.2.6, 0.2.7, 0.2.7.1 and 0.2.8 (Qwen engine 0.1.50 to 0.1.54) are out +(`docs/upstream-port-plan.md`, "Upstream range review": 585 commits, **"Our pin stays 41cf05a0"**). This release does not move it. The vanilla comparison binary of +every paired series (`baseline-pair-5090.md`) is Strata 0.2.6 / engine 0.1.50, the same code as the pin. + +Moving the pin later is a separate release (`0.2`), and needs, in this order: + +1. a documented tree replacement as in `docs/upstream.md` "How this update was made" (3-way `git merge-tree` against the new base, regenerate `docs/upstream/local-patches-on-.patch`, add a pin-history row, same commit as the pin); +2. a new **Original reference build** and a re-run of the whole `docs/quality-gate.md` method: the current reference is a build of the OLD pin (`d9ab8435` / `5b734e42`, engine 0.1.35) plus local patches, and a build of a newer subtree behaves differently with default flags (upstream flipped defaults; digest 1.3). The tolerances of the gate are tied to that reference's own envelope; +3. a decision per flipped upstream default (`STRATA_DEFAULTS=026` for baselines, `docs/upstream-port-plan.md` row 4.14), and a review of what the port took and what it parked (rows 4-7 of the same document); +4. refreshed vanilla arms for every A/B (`docs/experiments/baseline-pair-5090.md` method), because a 0.2.7+ vanilla is "slightly faster by new defaults (1-3 %)"; +5. editing `RELEASE_STRATA_PIN` in `scripts/release/package-5090.sh`, the version/tag, and this checklist; `leleka version` and `PROVENANCE.json` follow `docs/upstream.md` automatically. + +## 4. Gates + +### 4.1 Protocol and stability (charter gates A and E) + +| id | gate | evidence in the tree | status | +| --- | --- | --- | --- | +| P1 | terminal SSE events, tool-call integrity, cancellation, 429 backpressure, memory flat over 40 requests | `docs/e2e-run.md` section 4: job 942, 459 checks, 9 failed, all 9 model-origin malformed tool calls refused by the server (not published as calls); 98 generations, soak flat (+0 MiB RSS, +0 MiB VRAM). **Code of 2026-10-17**, 11 days and many merges ago | OPEN: Phase B re-runs a short real-Codex session on the release binaries (queue protocol below) | +| P2 | real Codex CLI 0.163.0 sessions complete | jobs 943d / 945d (tic-tac-toe 20 requests, 203 s; CRM 72 requests, 871 s; weighted decode 128.8 / 130.0 tok/s on the 2026-10-17 reference configuration; CRM acceptance **failed** because the model wrote a bug, `docs/e2e-run.md` 7d); the 72-cell Codex lossy-delta matrix on `e1bd61f5` (`docs/experiments/codex-lossy-delta.md`, tasks complete, no engine fault recorded in the merge message) | PASS as history; Phase B repeats a short smoke on the release commit | +| P3 | model-origin tool-call failures | not fixed by design: no constrained decoding, no repair step (`docs/e2e-run.md` section 5); `tool_call_recovery` is OFF (lossy) | NOT CLAIMED (listed in the notes) | +| P4 | long soak with the real workload, disk full, client abort, crash of the worker | charter gate E asks for a long soak. `claude/unattended` brings the soak harness and the supervision work | OPEN: attach the unattended soak result if it is merged with one; otherwise the notes say "no multi-hour soak on the release commit" | +| P5 | sampled (non-greedy) requests | accepted by the API; `docs/original-serve.md` request plumbing; coupled draft sampling only with `STRATA_SPEC_COUPLED` as in the Original. `docs/port-remaining.md` section 3 (written earlier) still says the sampled MTP paths "have not run on a device"; **verify its current truth in Phase B and correct the page** | OPEN; the notes say "all evidence is greedy" | + +### 4.2 Determinism and quality (charter gates B and C), per feature of the shipped profile + +The shipped `rtx5090-32g` profile is **not bit-identical to the Original** and says so ("Not a formally quality-gated profile"). Its status per feature, from +`docs/quality-gate.md` (612-row teacher-forced gate, short prompts, tolerance = the Original's own envelope: d_top1 p99 0.22, max 0.43, flips 2.8 %), +`docs/experiments/2026-10-28-s6-1-lossy-audit.md` (27 profile keys classified; "unknown-until-q_pair" = no q_pair at 256k) and the experiment pages: + +| id | feature (profile key) | class | evidence | status | +| --- | --- | --- | --- | --- | +| Q1 | port vs Original, whole stack | rounding-level difference | quality-gate.md: pooled six port arms d_top1 p99 0.210 (Original 0.197), flips 2.15 % (2.22 %); **one row outside** (prompt 1, `` position 66, d_top1 up to 1.36), localised as a high-gain row, not a fault; retrieval of the needle at 100k and 180k equal to the Original's; stop set fixed | PASS with the stated residual risk | +| Q2 | KAR level-2 PLE (`kar_source`) | small numerical perturbation | quality-gate.md section 6: about 1.6x the Original's other envelope arms (p99 0.34, flips 3.4 %); 6 prompts, no perplexity, no tool-call or long-context test; `docs/model-assets.md` keeps the KAR quality status "pending" | OPEN-accepted: stated in the notes; no formal quality gate exists for KAR | +| Q3 | `LELEKA_CHAIN=all` | rounding-level, not bitwise | chain-kernels.md: at 30-70k 5,993 of 64,355 rows identical, d_top1 p99 0.327 / max 4.31, flips 1.08 % against a rounding-noise control of p99 0.394 / 1.45 %; passes the 1.25x q_tail_gate rule; **no 256k q_pair** (audit F1) | OPEN-accepted: stated in the notes | +| Q4 | `prefix_cache_tail=reply` | rounding-level | prefix-cache.md: d_top1 p99 0.401, flips 1.45 % against the control 0.394 / 1.45 % at about 70k; the same document also calls `reply` EXPERIMENTAL (audit F2: two statements disagree); not run at 256k | OPEN: Phase B reads `docs/prefix-cache.md` and makes the two statements agree; the notes call it "gated at 70k only" | +| Q5 | prefill chunk and prefix block 8192 | rounding-level | one 16,000-token prompt answers differently at 8192 than at 2048/4096/6144 (prefill-throughput.md, "rounding or defect" left open); TTFT sum 55-60 s against 131 s at 2048 on a 256k session | OPEN-accepted: stated in the notes | +| Q6 | expert placement: adaptive tier, per-layer slots, upstream ranked profile, seed OFF, `spec_min_p` 0 / adaptive window | placement and window shape, rounding-level | quality-gate.md sections 3 and 8 (P1-P6, seed PASS, adaptive PASS, 612 rows, short prompts); adaptive-spec.md; no 256k q_pair | OPEN-accepted | +| Q7 | `LELEKA_SM120_ATTN_DAILY_MTP=1` (MTP draft attention) | **bitwise** | draft-round-5090.md section 4: 2057 / 2057 logprob rows and 1036 / 1036 draft-trace lines identical, 0 argmax flips; model-free probe byte-identical; enabled in the profile by `f9003b7ce` | PASS | +| Q8 | `LELEKA_DRAFT_FUSED_COMMIT` | bitwise, neutral | same page: identical, round -0.024 +- 0.046 ms; **off by default**. `claude/window-policy` decides the default | OPEN: follow the window-policy decision; whichever it is, re-run the identity gate of draft-round-5090.md section 4 on the release binaries | +| Q9 | adaptive-window default policy (`claude/window-policy`) | policy | arrives with the merge | OPEN: needs its own paired A/B and quality row; the notes' tok/s change with it | +| Q10 | route tail skip (`LELEKA_ROUTE_TAIL_SKIP`) | **lossy, OFF** | upstream-port-plan.md row 3.1: +15.2 % decode on a replay, but the quality gate **fails on all three limits** (d_top1 p99 1.005 against the control's 0.3995, max 5.81, flips 2.77 % against 1.45 %): "not to be enabled in any profile". Not nameable in `engine_env` by the profile validator unless it starts with an admitted prefix: the packager also refuses the word in the profile and templates | PASS `[script]` gate_profile | +| Q11 | keyless / value-only KV | lossy, not shipped | quality gate failed (`docs/experiments/2026-10-04-keyless-runtime.md`) | PASS (not in the package) | + +### 4.3 Performance evidence (charter gate D): what the notes may say + +Only paired A/B results with a recorded workload enter the notes. All of them are the frozen 245k corpus, 5 turns of 300 output tokens, greedy, RTX 5090, +PCIe share 0.45 (`docs/experiments/baseline-pair-5090.md`, `draft-round-5090.md`). Real Codex sessions (section 4.1) are reported separately, as history. + +| id | claim | evidence | status | +| --- | --- | --- | --- | +| A1 | ours vs vanilla 0.2.6, fresh boot, vanilla in its good THP state (part e) | ours 155.4 tok/s (sd 2.4, n=3); v1 (shipped lossy defaults) 137.0; v2 (lossless-comparable) 144.7 (sd 23.0, one run 171.2). Block-paired ours - v1 +18.4 tok/s (+13.5 %), 3 of 3 blocks; ours - v2 +10.7 (+9.2 %), **2 of 3 blocks** (block 2: v2 171.2 against ours 152.6, ours 10.8 % behind) | PASS as stated; n = 3 blocks, wide interval | +| A2 | ours vs vanilla v2 on a 42 h-old machine (part d) | 155.6 (sd 1.6, n=6) against 132.9 (sd 5.5), ahead in 6 of 6 blocks, but 5 of 6 vanilla runs were in the poor-THP state; pooled vanilla full-coverage n=14: 146.9 (sd 12.5, best runs 160-174) | PASS as stated, with the caveat in the notes | +| A3 | draft-round change (MTP draft attention) | bitwise; whole round -0.366 ms (-2.7 %), 12 of 12 blocks; tok/s +0.5 % +- 0.6 % (not significant: the adaptive window narrows); +3.0 %, 5 of 5 blocks with the window held fixed | PASS as stated; "tok/s depends on the window policy" | +| A4 | window-policy defaults | arrives with `claude/window-policy` | OPEN | +| A5 | cold start | fresh-boot cycle: 23-55 min, dominated by the cold read of the 55 GB KAR file at 8-35 MB/s with buffered reads on this NVMe (`baseline-pair-5090.md` section 9); `claude/unattended` promises a fast holder load | OPEN: Phase B measures one fresh-boot cold start on the release commit and records the result whatever it is | + +### 4.4 Build, package and documents + +| id | gate | status | +| --- | --- | --- | +| B1 | `scripts/release/package-5090.sh check` passes with zero FAIL | OPEN, see section 5 | +| B2 | clean build from a fresh target dir with the three commands of `docs/deploy.md` section 8 minus `--features sm86`, `--locked`; `cargo test -p leleka-deploy` (all, with `--features test-fakes` on Linux) and the other crates' tests on Linux; `cargo clippy -D warnings`, `cargo fmt --check` for the crates this branch touched | OPEN (Phase B). Phase A: `app::version_tests` passes on Windows | +| B3 | `package-5090.sh package`, then `verify` on the produced tarball, on the laptop and on the server | OPEN (Phase B) | +| B4 | `leleka verify` (full hash of the shards and the archive against the pins) and `leleka up --dry-run` on the server with the release binaries | OPEN (Phase B; see the server notes below) | +| B5 | licence and third-party audit, secrets/PII scan: `docs/release/licence-and-secrets-audit-5090-v0.1.md` | PASS for the scan; **BLOCKER** for the missing repository LICENSE | +| B6 | documents consistent: list below | OPEN | + +Document inconsistencies found in Phase A (fix in Phase B, after the merges, because `claude/unattended` and `claude/window-policy` edit the same files): + +| id | where | what | +| --- | --- | --- | +| D1 | `docs/deploy.md` section 4 | says `engine_env` is "restricted to `LELEKA_ORIGINAL_SERVE_*`"; since `5378b226d` the validator also admits `LELEKA_SM120_*` and `LELEKA_CHAIN` (`crates/deploy/src/profile.rs`). `[script]` gate_profile fails on it | +| D2 | `deploy/rust-runtime/profiles/rtx5090-32g.json` `description` | quotes "weighted decode 129-130 tok/s in the reference-equivalent real Codex sessions" (2026-10-17 code) while the same page says "carry no speed claim" in `docs/deploy.md` section 4; the paired 245k series says 155 tok/s on the current code. Reword to a dated statement or drop the number. `[script]` gate_profile fails on it | +| D3 | `docs/deploy.md` | header "Status 2026-10-17, branch claude/deploy"; quickstart names `leleka-VERSION-linux-x86_64.tar.xz` but the package is `leleka-VERSION-COMMIT12-linux-x86_64`; section 10 says the two server jobs 930/931 "had not run" (no `leleka.json` exists anywhere under `/data/leleka-e2e`, so `leleka up` has still never run for real on the 5090 server). `claude/unattended` rewrites parts of this page | +| D4 | `docs/port-remaining.md` section 3 | "nothing above has run on a device yet" (sampled MTP); check against `backend_original_serve.rs` and the e2e `determinism` scenario and update | +| D5 | `docs/prefix-cache.md` | `reply` is both "EXPERIMENTAL, not to be defaulted" and "the 5090 default" (audit F2) | +| D6 | `docs/upstream.md` | still correct (pin 41cf05a0); add a line that the upstream is at 0.2.8 and the pin is held by decision (`docs/upstream-port-plan.md`) | +| D7 | profile vs notes | the profile's `LELEKA_ORIGINAL_SERVE_SEED=off` is documented as "placement class, owner to confirm" in its own description | + +`[script]` gate_docs_cli: **PASS**, all 27 flags and 9 commands that `docs/deploy.md` names exist in `leleka --help` (the text of `crates/deploy/src/cli.rs` `USAGE`); +`exec-inherit` is deliberately absent from `--help` (internal re-entry) and is allow-listed in the script. + +## 5. Open blockers at the end of Phase A + +| id | blocker | owner | +| --- | --- | --- | +| BL1 | **No `LICENSE` file at the repository root.** The workspace `Cargo.toml` declares `license = "Apache-2.0"` (inherited by 31 crates), `quant-core` declares `Apache-2.0 AND MIT`, and **`control-plane` (`strata-control`, the `strata-next` binary) and `desktop-core` (`strata-desktop-core`: `leleka-inference`, `leleka-daemon`, `leleka-cli`, `leleka-seal-exec`) declare no licence at all**, i.e. four of the six shipped binaries. Strata is MIT (`engine/strata/LICENSE`). Choosing the licence and adding its text is the owner's decision; the packager refuses to build without a root `LICENSE` | owner | +| BL2 | `docs/release/RELEASE-NOTES-5090-v0.1.md` contains `TBD` markers on purpose (final numbers of the release commit); the packager refuses while any `TBD`/`TODO` is present | Phase B | +| BL3 | D1-D7 above | Phase B | +| BL4 | window-policy and unattended not merged; the notes' speed statement and the package's unattended files depend on them | orchestrator | +| BL6 | the ranked expert table `data/expert-profile.bin` (sha256 `8f59b4aa...388975baf`, pinned in `crates/deploy/src/plan.rs`) is neither in Git nor fetched by `leleka up`; without it the 5090 profile loses its VRAM expert tier (preflight WARN only). Decide: ship it in the package (`--expert-profile`, digest-checked, 196,632 bytes, MIT upstream data) or document the source. The server copy matches the pin | Phase B | +| BL5 | the server has never run `leleka up` for real: the product's one-command path is verified by unit/e2e tests with a test double and on the 3080 laptop (2026-10-17), not on the 5090 (`docs/deploy.md` section 10). The notes must say so unless `claude/unattended` closes it | Phase B / unattended | + +## 6. Phase B procedure (after the orchestrator reports both branches merged) + +1. In `claude/release-5090`: `git rebase main` (my commits touch `.gitattributes`, `crates/deploy/build.rs`, one hunk of `crates/deploy/src/app.rs`, `scripts/release/`, `docs/release/`). Re-run `package-5090.sh check`; fix D1-D7 in the pages that the merged branches changed; re-check `*.ptx` EOL in every worktree used for builds. +2. Read the merged windows-policy and unattended notes; update sections 4.2 (Q8, Q9) and 4.3 (A4, A5), the notes' numbers and `RELEASE_STRATA_PIN` stays. +3. **Build** in WSL2 Ubuntu from this worktree with a new `CARGO_TARGET_DIR` (e.g. `.git/wt/release-5090/target/rel-1`): `wsl -d Ubuntu -- bash -lc "cd /mnt/c/Users/pavel/work/leleka/.git/wt/release-5090 && scripts/release/package-5090.sh package --out dist/release-5090"`. Then once more with `target/rel-2` at the same path and compare the six digests (reproducibility row of section 2). Run the Linux test suites listed in B2. +4. **Verify** the tarball on the laptop (`package-5090.sh verify`), `scp` it to `rnr5090:/data/leleka-e2e/release-5090/` (one file of roughly 100-150 MB, sequential; no rsync, no tree copies), verify again on the server and unpack there (`tar -xJf` writes about 190 MB). +5. **GPU work goes through the queue**, never directly: one FIFO stub per job in `~/work/gpu-runs/holder2/jobs/` (`exec bash /data/leleka-e2e/release-5090/jobs/.sh`), `PRIORITY` untouched, the heavy part under `mkdir /data/leleka-e2e/gpu.lock` (poll, owner file with `STRA-xxx DEV `, `rmdir` only your own), and one line per event appended to `/data/leleka-e2e/decode/notes.md` (`[UTC] [DEV release-5090] ...`, append only). The holder owns the 55 GB sealed memfd and `MODEL.lock`, so a second `leleka up` with its own memfd does **not** fit in the 121 GB host: use `leleka up --mode none|--foreground --kar-fd $LELEKA_STRA169_KAR_FD --trust-archive` inside a holder job (the design of the unrun jobs 930/931), or ask the orchestrator for a window in which the owner stops the holder. +6. Jobs, in order: (a) `leleka verify` + `leleka up --dry-run` with the release binaries (hash reads are throttled: no bulk reads while another agent's job is running); (b) the short real-Codex smoke (prompt `scripts/e2e/codex/prompt-threejs.txt`, sha256 `f5724841...2a9a8`, `run-e2e.sh` harness, release binaries; protocol rows P1/P2: completion, no `generation failed` that is not a model-format error, memory flat); (c) one fresh-boot cold start timed from boot to `/ready` (the owner-authorised reboot procedure of `baseline-reboot-series.sh` applies; **no system setting is changed**); (d) the paired A/B of the final profile only if window-policy changed the default and has no A/B on the release commit. +7. Fill the `TBD` cells of the notes with the numbers of (b)-(d) and the digests of the package (hardware, software, model digest, config, cache state, token counts, distributions: the charter's list), re-run `package-5090.sh check`, repackage from the final commit, verify again. +8. If every row of sections 2-4 is PASS or an OPEN-accepted row that the notes state: `git tag -a leleka-5090-v0.1 -m "..." ` locally. Do not push. If anything fails: stop and report; no gate is weakened and no row is edited to PASS without its evidence. + +Server notes for the procedure: Ubuntu 26.04.1, kernel 7.0.0-38, RTX 5090 (driver 595.99.02, power limit 600 W), 121 GB RAM, `/data` 458 GB of which 63 GB were free on 2026-11-02; the NVMe is a DRAM-less consumer drive that stalled under sustained **writes** (three hangs 2026-10-28..30): keep writes small and sequential, no swap, no rsync; reads are fine. The safety net (rescue sshd on :2222, hardware watchdog, `kernel.hung_task_panic=1`) was installed by the owner. diff --git a/docs/release/RELEASE-NOTES-5090-v0.1.md b/docs/release/RELEASE-NOTES-5090-v0.1.md new file mode 100644 index 00000000..e00affaf --- /dev/null +++ b/docs/release/RELEASE-NOTES-5090-v0.1.md @@ -0,0 +1,136 @@ +# Leleka 0.1 for the RTX 5090: release notes (DRAFT, Phase A) + +Release `leleka-5090-v0.1`. Draft written on main `f9003b7ce` (2026-11-02). Cells marked `TBD` are filled from the release commit in Phase B; the packager refuses to +package while any `TBD` remains. Nothing here is a claim that was not measured: every number names the page it comes from. + +## 1. What this is + +Leleka is a Rust/CUDA port of the **Original mode17 serve path** of Strata (the C++ engine under `engine/strata/`, pinned at upstream `41cf05a0`, engine 0.1.50) for one +model, **Qwen3.8-Flash-Next IQ3_S** with the KAR level-2 PLE archive and the MTP draft head, on **one RTX 5090 (32 GB)**, serving **one stream at 262,144 tokens of +context** to coding agents (Codex CLI) over the Responses, Chat Completions and Messages APIs. The serving path (engine process, gateway, API, supervisor) is Rust; **no Python +is needed to serve**. `engine/strata` is the reference and is not modified by this release. + +It is a first release: it is fast on the workload it was measured on, it completes real Codex sessions, and its limits are listed in section 6. It is **not** a formally +quality-gated profile (the shipped `rtx5090-32g` profile says so in its own description), and the RTX 3080 laptop is **not part of this release**. + +## 2. Supported hardware and software (exact) + +| | measured and supported | notes | +| --- | --- | --- | +| GPU | RTX 5090, 32,607 MiB, compute capability 12.0 (sm_120), PCIe 5 x16, power limit 600 W | the profile selects on `sm 120..130` and >= 30,000 MiB VRAM; needs 31,299 MiB free at start | +| CPU / RAM | Ryzen 9 9950X3D (16 cores), 121 GB RAM | profile floors: 100 GiB total, 113 GB available at start. While serving, the sealed 52 GB KAR memfd plus the 54-60 GB engine leave 7-13 GB available (`docs/e2e-run.md`) | +| OS | Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic | glibc >= 2.39 is the floor of the binaries (built on Ubuntu 24.04); other distributions are untested | +| driver | NVIDIA 595.99.02 (minimum 595: the sealed PTX needs ISA 9.2) | no CUDA toolkit is needed on the host; `libcuda.so.1` from the driver and `libcublas.so.12` + `libcublasLt.so.12` (CUDA 12) are loaded at run time | +| build | Rust 1.99.0 (`rust-toolchain.toml`), `cargo build --release --locked`, no sm86 feature; PTX sealed with nvcc 13.2.86 and checked in | | +| disk | about 140 GB for the model volume (shards 83.6 GB + archive 55.3 GB) plus logs and state | a fast local NVMe; see the cold-start note in section 6 | +| model | Qwen3.8-Flash-Next IQ3_S shards `4c1eb2ce...f7d2aca3` and `316b46f3...c161e113`, KAR level-2 archive `536d612c...1385afa5` (55,295,529,472 B), MTP pack digest-checked by its binding; the ranked expert table `data/expert-profile.bin` (196,632 B, sha256 `8f59b4aa...388975baf`) is pinned in the deploy crate but is **not in Git and not fetched by `leleka up`** (see section 6) | `leleka verify` re-hashes all of it against the pins | + +**Not supported and not run for this release:** the RTX 3080 laptop and WSL2 serving (experimental, `docs/laptop-profile.md`), native Windows, any other GPU, containers +(no image was ever built), multi-GPU, images in requests (refused), `reasoning_budget_tokens`, `strata_tune` and control vectors (refused, fail closed), TLS (use an SSH tunnel). + +## 3. What is in the package + +`leleka-0.1.0-COMMIT12-5090-linux-x86_64.tar.xz` (+ `.sha256`): six binaries (`leleka`, `strata-next`, `leleka-inference`, `leleka-daemon`, `leleka-cli`, `leleka-seal-exec`), +the `rtx5090-32g` profile, the service templates, `install.sh`, the sealed sm_120 PTX with SHA-256 (also embedded in the binaries), the documents this page cites, the licence texts of +the third-party material, the unattended-operation files when the release was built with them (**the owner installs the service; nothing in this release changes a system +setting on its own accord**), `MANIFEST.json`, `PROVENANCE.json` (git commit, `Cargo.lock` digest, Strata upstream commit and subtree id) and `SHA256SUMS`. It contains no +model weights, no KAR archive, no captures, no credentials, no logs and no Python. `leleka version` prints the version, the commit (`clean`) and the Strata pin. + +Release commit `TBD`, package SHA-256 `TBD`, size `TBD`. Reproducibility of the six binaries at the same build path: `TBD` (the tarball itself is deterministic). + +## 4. Numbers (honest ones) + +All speed numbers are **decode tok/s** on the frozen 245k corpus: 5 turns, 300 output tokens each, greedy, final-turn input about 247k tokens, PCIe share 0.45 (the product default), prefix +cache auto, one request at a time, RTX 5090 + Ryzen 9 9950X3D, driver 595.99, ours built from main `ffd9322c7` (the code of `d29e3dba2`). The comparison arm is **vanilla Strata 0.2.6 / +engine 0.1.50** (`v1` = its shipped defaults, route tail skip ON and prefill CPU share ON, both lossy; `v2` = the same with both OFF, the lossless-comparable arm). Source: +`docs/experiments/baseline-pair-5090.md`. These are single-workload, 5-turn series, **not** agent-task wall times; real Codex sessions are in the last paragraph of this section. + +**The cleanest pairing (part e: one arm per fresh boot, page cache evicted so that vanilla gets its good huge-page state; 3 balanced blocks):** + +| arm | n | tok/s mean (sd) | range | tokens/round | ms/round | +| --- | ---: | ---: | --- | ---: | ---: | +| **ours (shipped defaults)** | 3 | **155.4 (2.4)** | 152.6 .. 157.0 | 2.11 | 13.57 | +| vanilla v1 (shipped lossy defaults) | 3 | 137.0 (5.6) | 130.6 .. 140.6 | 1.95 | 14.30 | +| vanilla v2 (lossless-comparable) | 3 | 144.7 (23.0) | 129.9 .. 171.2 | 1.94 | 13.61 | + +Block-paired: ours - v1 **+18.4 tok/s (+13.5 %)**, ahead in 3 of 3 blocks. Ours - v2 **+10.7 tok/s (+9.2 %)**, ahead in **2 of 3 blocks**: in block 2 vanilla v2 ran 171.2 tok/s and ours 152.6, **ours was 10.8 % behind**. Vanilla has a +fast mode that nothing recorded explains (5 of 34 earlier vanilla runs were above 160 tok/s); ours does not (sd 1.6-2.5 in every series). With n = 3 blocks the intervals are wide. + +On a 42 h-old machine (part d, 6 blocks) ours (155.6, sd 1.6) was ahead of vanilla v2 (132.9, sd 5.5) in 6 of 6 blocks (+17 %), but 5 of the 6 vanilla runs were in a partial huge-page state that +follows an ours run; pooled over all 34 vanilla runs the full-coverage vanilla mean is 146.9 (sd 12.5, best runs 160-174), so against vanilla's good state the lead is about 6 %, and ours is behind +vanilla's best single runs. Read "+9 to +13 % over vanilla in vanilla's good state, with high vanilla variance" and not "+17 %". + +**Draft-round change (`LELEKA_SM120_ATTN_DAILY_MTP=1`, now in the profile; `docs/experiments/draft-round-5090.md`):** bitwise identical (2057 of 2057 logprob rows and 1036 of 1036 draft traces, 0 argmax +flips; a model-free probe is byte-identical). Whole decode round **-0.366 ms (-2.7 %) in 12 of 12 paired blocks**. tok/s: **+0.5 % +- 0.6 %, not significant** with the shipped adaptive window, because the window +narrows when rounds get shorter; **+3.0 % in 5 of 5 blocks with the window held fixed** (not the shipped configuration). So the tok/s effect of this change depends on the window policy. `TBD`: the +adaptive-window default of `claude/window-policy` and its paired A/B on the release commit. + +**Real agent sessions (Codex CLI 0.163.0), reported separately and older:** on the 2026-10-17 code and the reference-equivalent configuration, tic-tac-toe 203 s and CRM 871 s, weighted decode +128.8 and 130.0 tok/s at 37k and 121k tokens of context (`docs/e2e-run.md` 7d); a 256k-class scripted session decoded about 105-109 tok/s at 100-220k tokens with TTFT 27-39 s (`docs/ledger.md`, job 9w2). +These predate most of the speed work and are not comparable with the table above (different workload, different code). Release-commit smoke result: `TBD`. Prefill: about 1.8k tok/s flat from 28k to 250k +tokens on the 2026-10-26 build (`docs/ledger.md`); the cross-session prefix cache re-reads only what changed (23,324 of 23,377 tokens reused on a 24k follow-up turn). + +**Cold start:** the first `/ready` after a boot is dominated by reading the 55 GB KAR archive; on this server buffered reads ran at 8-35 MB/s (a full fresh-boot cycle took 23-55 min, 10-39 min of it the +holder load). Release-commit cold start from boot to `/ready`: `TBD`. + +## 5. Quality: what is gated and what is not + +* **Lossy modes are OFF and are not in the package's profile.** Route tail skip (`LELEKA_ROUTE_TAIL_SKIP`) gave +15.2 % decode on a replay but **failed its quality gate on all three limits** (d_top1 p99 1.005 against the + rounding-noise control's 0.3995, max 5.81, argmax flips 2.77 % against 1.45 %; `docs/upstream-port-plan.md` row 3.1), so it stays an experimental flag that no profile may set. Vanilla ships it ON by default; ours + does not. Keyless/value-only KV failed its gate and is not shipped. `tool_call_recovery` (a regeneration on invalid output) is off. +* **Against the Original (`docs/quality-gate.md`, teacher-forced, 612 rows per arm, RTX 5090):** the port's deviation distribution equals the Original's own self-deviation (pooled d_top1 p99 0.210 against 0.197, argmax + flips 2.15 % against 2.22 %). One row of 612 per arm lies outside the Original's envelope (a `` position, d_top1 up to 1.36); it was localised to a high-gain row and not explained at the logit level. The + needle in a 100k and a 180k prompt is retrieved by both engines, with the same stop behaviour after a fix found by this gate. +* **The shipped profile as a whole is not bit-identical to the Original and has no 256k q_pair.** `LELEKA_CHAIN=all` (30-70k: flips 1.08 % against a rounding-noise control of 1.45 %), request-end prefix + checkpoints (`prefix_cache_tail=reply`, gated at about 70k), prefill chunk 8192 (one 16,000-token prompt answers differently from chunks 2048-6144; rounding or defect left open), the adaptive expert tier and the + window policy are each inside the rounding-noise envelope where they were tested and untested at 256k (`docs/experiments/2026-10-28-s6-1-lossy-audit.md`: 8 of 27 profile keys are "unknown until q_pair"). + The one bitwise item is the draft attention switch above. +* **KAR level-2 PLE** is a small numerical perturbation (about 1.6x the Original's other envelope arms on 6 prompts of at most 128 tokens; no perplexity, tool-call or long-context test): its quality status is + "pending" in `docs/model-assets.md`. +* **All identity, quality and speed evidence is greedy.** Sampled requests are accepted; they are not gated. + +## 6. Known limitations + +* **Tool-call quality is the model's.** A real Codex session saw malformed tool calls produced by the model (the server refuses them and nothing partial is published); there is no constrained decoding and no repair + step. Codex re-sends once or twice, then fails the turn (`docs/e2e-run.md` section 5; 4 of 98 generations in job 942, 1 of 72 in job 945d). +* **One generation at a time.** Requests queue (16 slots, then 429 with `Retry-After`); sessions are switched through the prefix cache, not batched. Cancel during prefill takes up to one prefill chunk (1.6 s measured with a 2048 chunk; the profile now uses 8192, not re-measured). +* **Memory headroom is small.** The profile needs the host to keep about 100+ GiB for the runtime; the `workstation` preset cannot reach its free-memory target in the resident form on a 121 GB host and falls back to the + mapped form, which is slower (`docs/deploy.md` 4b). Nothing else big should run on the server. +* **Cold start and the NVMe.** The server's root drive is a DRAM-less consumer NVMe: sustained **writes** stalled it three times (2026-10-28..30), buffered **reads** of the 55 GB archive run at a fraction of its + capability (the owner can raise the device readahead; this release changes no system setting). Do not copy trees or rsync on it; the safety net (hardware watchdog, rescue sshd) is the owner's. +* **`leleka up` on the 5090 has not been run end to end for real**: the one-command deploy path is covered by unit and end-to-end tests with a test double and by a run on the RTX 3080 laptop (2026-10-17); on the + server every measured run started the processes by hand inside a holder job (`docs/deploy.md` section 10, `docs/e2e-run.md`). `TBD`: what `claude/unattended` and the Phase B jobs closed. +* **The ranked expert table is an asset you must provide.** The profile's VRAM expert tier is sized from `data/expert-profile.bin` (upstream Strata's file, MIT, sha256 `8f59b4aa8873209dff11c11e37bcda9529a1335b724a1afeea37bf6388975baf`). It is not in Git (binary data are kept out by rule) and `leleka up` does not download it: without it `up` warns and the engine runs without the ranked tier, which is slower. The package carries it under `share/leleka/data/` only when it was built with `--expert-profile`: `TBD` (build decision). +* **API limits** (`docs/api-over-rust-engine.md`): images, `reasoning_budget_tokens`, `strata_tune`, `experimental_speed_projection` are refused; `usage.reasoning_tokens` is derived from re-tokenized text; the output cap is + 32,768 tokens; `/unload` is unsupported while the runtime is attached. +* **Not ported on purpose** (`docs/port-remaining.md`): the KAR routed/prefill expert arm of the earlier line (section 5 there), the multi-GPU layer split (section 6), the `/api-monitor` HTML page. +* **Stability evidence is short.** The soak behind the numbers is 40 consecutive requests (flat RSS and VRAM) plus two 15-25 minute Codex sessions on 2026-10-17 code and the 72-cell task matrix. `TBD`: the soak of + the unattended-operation work, if merged. +* **Variance of the comparison is vanilla's.** Do not read "ahead of vanilla" as a guarantee against its fast mode (section 4). + +## 7. Install, upgrade, rollback + +All commands are `leleka` subcommands (`leleka --help`); `docs/deploy.md` is the reference. The owner runs these; the packager and the notes never do. + +**Install** (Linux x86_64, root for the system unit): + +1. `sha256sum -c leleka-0.1.0-COMMIT12-5090-linux-x86_64.tar.xz.sha256`, then `tar -xJf` and `cd` into the directory; `sha256sum -c SHA256SUMS` (also run by `install.sh`); `./bin/leleka version` must show the commit and the Strata pin of the release. +2. `./bin/leleka up --dry-run --assets /data/leleka` prints the preflight, the plan and the exact engine command and changes nothing (any FAIL stops here). +3. `sudo ./install.sh --assets /data/leleka` (idempotent: preflight, fetch and verify, KAR archive, install, start, wait for ready); or `--foreground` in a terminal; or `--mode none` to prepare only. The MTP pack must be in + `ASSETS/data/mtp-rt` or passed with `--mtp-pack`. The first start copies the archive into a sealed memfd (needs the RAM above) and verifies 84 GB of shards and 55 GB of archive (stamps skip this on restarts). +4. `./bin/leleka status`; the API key is in `STATE/api-key` (mode 0600), the API listens on `127.0.0.1:8081`. Use an SSH tunnel for remote clients. If the release ships unattended-operation files + (`share/leleka/unattended/`), their README says what to copy where; installing a unit or changing a sysctl is a deliberate owner action. + +**Upgrade:** `leleka down` (or stop the unit), copy `STATE/{leleka,daemon,strata,profile}.json` somewhere safe, unpack the new release next to the old one, run its `./install.sh` with the same flags (binaries are replaced +by rename, configuration is rewritten only when the content changes, secrets are never rotated, the model volume is untouched), then `leleka version` and `leleka status`. `leleka reconfigure --persist` changes are in +`leleka.json` and survive. 0.1 has no state migration; a later release that needs one must say so. + +**Rollback:** `leleka down`, restore the saved `STATE/*.json`, run the **previous** release's `./install.sh` with the same flags (it copies its own `bin/`), `leleka status`. The model volume and the stamps are shared and +are not changed by an upgrade. The previous release directory is the rollback; keep it until the new one has served a real session. + +## 8. Verification and provenance + +* `scripts/release/package-5090.sh check|build|package|verify` (in the repository): gates, a deterministic archive, a `verify` of the unpacked package (digests, no forbidden content, `leleka version`). +* Licence and third-party audit and the secrets/PII scan: `docs/release/licence-and-secrets-audit-5090-v0.1.md` (a repository `LICENSE` is **missing at the time of this draft**; the release is blocked on it). +* Strata upstream: `https://github.com/Niko1221/Strata.git` at `41cf05a06a25dd29103b7b27a2279a3f60c21876`, kept deliberately although upstream is at 0.2.8; moving it is the next release's work (checklist section 3). +* The checklist with every gate, its evidence and its status: `docs/release/5090-v0.1-checklist.md`. diff --git a/docs/release/licence-and-secrets-audit-5090-v0.1.md b/docs/release/licence-and-secrets-audit-5090-v0.1.md new file mode 100644 index 00000000..8c875476 --- /dev/null +++ b/docs/release/licence-and-secrets-audit-5090-v0.1.md @@ -0,0 +1,75 @@ +# Licence, third-party and secrets/PII audit for `leleka-5090-v0.1` + +Date 2026-11-02, base main `f9003b7ce` (branch `claude/release-5090`). Read-only audit; nothing outside `docs/release/` and the packager was changed by it. No network was used: +`cargo deny` / `cargo about` / `cargo license` are not installed on this machine, so the Rust side was done with `cargo metadata --locked --offline` and the rest by hand. The mechanical +parts are repeated by `scripts/release/package-5090.sh check` (gate_licence, gate_tracked_files, gate_secrets) and by `package` / `verify` on the archive. + +## 1. Result in one table + +| id | finding | severity | +| --- | --- | --- | +| L1 | **No `LICENSE` file at the repository root.** The workspace `Cargo.toml` says `Apache-2.0`; the owner has not recorded the decision anywhere else. The packager fails until a root `LICENSE` exists | **BLOCKER** (owner) | +| L2 | **`control-plane` (`strata-control`, binary `strata-next`) and `desktop-core` (`strata-desktop-core`, binaries `leleka-inference`, `leleka-daemon`, `leleka-cli`, `leleka-seal-exec`) declare no `license`** in their manifests: four of the six shipped binaries. 31 crates inherit `Apache-2.0` from the workspace; `crates/quant-core` declares `Apache-2.0 AND MIT` | fix with L1 (one line each); gate_licence fails on it | +| L3 | The Rust dependency graph shipped in the binaries (201 external crates) is permissive-only: no GPL, AGPL or LGPL-only crate (section 2) | PASS | +| L4 | Attribution: MIT, BSD, ISC and Apache-2.0 crates require their notice to travel with binary copies. The package ships the crate list with SPDX expressions (`share/leleka/licenses/rust-crates.tsv`) but **not the licence text of each crate** | OPEN: needed if the package leaves the owner's own machines; generate with `cargo about` / `cargo-bundle-licenses` on a networked machine in Phase B | +| L5 | `crates/cuda-driver/src/third_party/llamacpp/` (ggml-cuda sources, llama.cpp `3cf03257f`) has an `UPSTREAM-REVISION` file but **no licence file** next to it (the ggml MIT text exists in `control-plane/third_party/ggml/LICENSE` and `engine/strata/third_party/ggml/LICENSE`). Kernels compiled from it are inside the shipped PTX/binaries | add `LICENSE` beside `UPSTREAM-REVISION` (Phase B, two lines in the notes); the package already ships the ggml text | +| L6 | The model (Qwen3.8-Flash-Next-GSQ-RCO IQ3_S GGUF from `huggingface.co/ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF` at revision `ed59f920...`) is **not shipped**, but its licence terms are not recorded anywhere in the tree (`grep -i licen docs/model-assets.md README.md docs/deploy.md` is empty). The KAR archive built from it is a derivative | OPEN (owner): record the model licence and the archive's status in the notes | +| L7 | NVIDIA material: the driver and `libcuda.so.1` come from the host; cuBLAS 12.9.1.4 is **downloaded by `leleka up`** (SHA-256 pinned, NVIDIA's redistribution terms) and is **not bundled** by the packager (`--with-cublas` of the older `scripts/package-release.py` is not used); the sealed PTX is generated by us from our own and ggml-derived sources with nvcc 13.2.86 | PASS (note) | +| S1 | Secrets scan of the tracked tree: no private key, AWS/GitHub/Hugging Face/Slack/Google token or JWT pattern in any tracked text file (the script never prints a match) | PASS | +| S2 | No weights, KAR archives, credentials, logs or capture-type files are tracked; the largest tracked files are PTX (13 MB) and one upstream preview image (9.6 MB) | PASS | +| S3 | Owner-identifying strings in tracked files: server user `para`, `/home/para/...` and `C:\Users\pavel\...` paths, the host name `rnr5090`, the LAN address `192.168.1.196` (scripts only, not shipped), a corporate-style Windows user id in the metadata line of `benchmarks/results/agent-episode-ab-2026-10-15.jsonl`, `https://github.com/paveldhq/strata-next (private)` in `docs/upstream.md` and in the generated unit's `Documentation=` line | info; none is a credential. Strip them before any source publication | +| S4 | History scan for the same key/token patterns over all 6,466 commits (outside `engine/strata`): zero hits (section 4) | PASS | + +## 2. Rust dependencies + +Method: `cargo metadata --locked --offline --format-version 1 --filter-platform x86_64-unknown-linux-gnu`, then the transitive **normal** dependencies of the three crates that build the six binaries +(`leleka-deploy`, `strata-control`, `strata-desktop-core`), default features. The complete table (name, version, SPDX expression, repository) is committed as +`docs/release/third-party-crates-5090-v0.1.tsv` and keyed to `Cargo.lock` SHA-256 (LF-normalised) `10d08d0c03448a8abec0ca3fc49595a0630dfa5bf1dfb2e2337bdbd2bdffd2b6`. If `Cargo.lock` changes, regenerate it. + +| declared licence (SPDX) | crates | +| --- | ---: | +| `MIT OR Apache-2.0` / `Apache-2.0 OR MIT` / `MIT/Apache-2.0` / `Apache-2.0/MIT` | 90 + 14 + 2 + 1 + 1 | +| `MIT` | 45 | +| `Unicode-3.0` (icu_*, data crates) | 18 | +| `Apache-2.0` | 7 (`memo-map`, `unicode-general-category`, `minijinja`, `minijinja-contrib`, `prost`, `prost-derive`, `sync_wrapper`) | +| `Apache-2.0 OR ISC OR MIT` | 3 (`rustls`, `rustls-native-certs`, `hyper-rustls`) | +| `BSD-2-Clause OR Apache-2.0 OR MIT` | 2 (`zerocopy`, `zerocopy-derive`) | +| `ISC` | 2 (`untrusted`, `rustls-webpki`) | +| `Unlicense OR MIT` | 2 (`aho-corasick`, `memchr`) | +| `Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT` | 2 (`rustix`, `linux-raw-sys`) | +| others (one each) | `ring` (`Apache-2.0 AND ISC`), `aws-lc-rs`, `aws-lc-sys` (`ISC AND Apache-2.0 AND MIT AND BSD-3-Clause AND ...`, OpenSSL-lineage code inside), `matchit` (`MIT AND BSD-3-Clause`), `subtle` (`BSD-3-Clause`), `webpki-root-certs` (`CDLA-Permissive-2.0`, certificate data), `borrow-or-share` (`MIT-0`), `ryu` (`Apache-2.0 OR BSL-1.0`), `foldhash`, `tinyvec`, `lru-slab`, `unicode-ident`, `fnv`, `bytecount` | + +Notes. (1) No crate in the shipped set has a missing licence field. (2) The only copyleft word in the whole lock (398 packages, all platforms) is `r-efi` (`MIT OR Apache-2.0 OR LGPL-2.1-or-later`): the +permissive options are available and the crate is UEFI-only, not linked on Linux. (3) The TLS stack (`rustls`, `ring`, `aws-lc-*`) is linked for `strata-next model fetch` (Hugging Face downloads); its notice requirements +are the ones in L4. (4) `engine/strata` is not part of any binary and not in the package; the Rust port shares artifacts and algorithms with it, not its C++ code (`docs/upstream.md`, "Port provenance"). + +## 3. First-party, vendored and upstream material + +| material | where | licence | shipped? | action | +| --- | --- | --- | --- | --- | +| Leleka crates (34 workspace members) | `crates/`, `control-plane/`, `desktop-core/` | `Apache-2.0` declared in the workspace (L1, L2) | binaries + PTX | owner decision L1; add the field to the two manifests | +| Strata (the Original, reference) | `engine/strata/` at upstream `41cf05a0`, `https://github.com/Niko1221/Strata.git` | MIT, (c) 2026 Niko1221 and the Strata contributors (`engine/strata/LICENSE`) | no (reference only); text shipped as `licenses/strata-MIT.txt` because sealed kernels and constants derive from it (file headers: "Copyright (c) 2026 Niko1221 and the Strata contributors") | none | +| ggml / llama.cpp | `engine/strata/third_party/ggml` (revision `3cf03257f`), `control-plane/third_party/ggml`, `crates/cuda-driver/src/third_party/llamacpp`, `crates/native-cpu-expert/LICENSE.ggml`, `crates/quant-core/LICENSE-GGML` | MIT, (c) 2023-2026 The ggml authors | derived kernels and CPU code are inside the binaries; text shipped as `licenses/ggml-MIT.txt` | L5: add the licence file beside `UPSTREAM-REVISION` | +| Project Maya | `engine/strata/third_party/project-maya` | MIT, (c) 2026 Peasant Smith and the Project Maya contributors, with Strata's notice | no (DeepSeek engine, not used by Leleka); texts shipped as a courtesy (`licenses/project-maya-*`) | none | +| colibri | `crates/cpu-sys/NOTICE.colibri` | Apache-2.0, (c) 2026 Vincenzo Fornaro | CPU kernels, inside the binaries; notice shipped as `licenses/colibri-NOTICE.txt` | needs the Apache-2.0 text beside it: covered by L1 | +| Strata tool-call corpus | `control-plane/tests/fixtures/tool_corpus/` (`NOTICE.md`) | MIT (Strata); reporter handles removed | no (test fixture) | none | +| cuBLAS 12.9.1.4 | downloaded by `leleka up` | NVIDIA redistribution terms | no | L7 | +| Model weights | `huggingface.co/ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF@ed59f920...` | not recorded in the tree | no | L6 | + +## 4. Secrets and PII scan + +Command (the same regular expression is `SECRET_RE` in `scripts/release/package-5090.sh`): `git grep -InE -e '' -- . ':!*.lock'` over every tracked file (5,730 files on this +branch, including `engine/strata`), plus the assignment pattern `(api[_-]?key|secret|token|password|passwd|pat)\s*[:=]\s*"<20+ chars>"` outside `engine/strata`. **Zero hits for both.** +File-type scan of the index (`gguf`, `kar`, `kar2`, `safetensors`, `pem`, `key`, `p12`, `pfx`, `jks`, `sqlite`, `db`, `log`, `jsonl`, `pcap`, `npz`, `npy`, `pt`, `pth`, `onnx`, `api-key`, `runtime.env`, `.env`, `id_*`): the only hits are `benchmarks/results/*.jsonl` and +`benchmarks/quality/gpt-oss-20b-teacher-forced/**/*.jsonl` (result tables of the gpt-oss CPU/NPU benchmarks, and llama.cpp reference rows that hold token ids and log-probabilities only, no text of a real session) and one telemetry file under `engine/strata/bench/results/` +(upstream community benchmark). `.gitignore` already drops `*.gguf`, `*.kar*`, `*.bin`, `*.log`, `models/`, `captures/`, `logs/`, `artifacts/`, `dist/`, `.env*`, `*.pem`, `*.key`. The request captures and generated token ids of the Codex runs live in private +server directories (`docs/e2e-run.md`) and are not tracked. The golden fixtures of the control plane were produced with a fake engine and the Python server's HTTP surface; the tool-call corpus has its reporter handles removed (`NOTICE.md`); the Codex task files under `scripts/e2e/codex/tasks/` +are synthetic. + +**PII.** Tracked files mention the server account `para`, home paths (`/home/para/work/leleka/...`), the Windows profile of the laptop, the host name `rnr5090` and the LAN address `192.168.1.196` (in `scripts/ops/*`, `scripts/strata-agent-profile.py`, +`scripts/strata-dual-256-experiment.py`, `scripts/test-ple-config-parity.py`: **none of these scripts is in the package**). The package's documents carry `/home/para` paths in a handful of lines (deploy.md 2, upstream.md 1, e2e-run.md 7, baseline-pair 1, draft-round 1, rust-runtime-run.md 1). One +file, `benchmarks/results/agent-episode-ab-2026-10-15.jsonl`, records a Windows model path under another machine's user profile in its first (meta) line. Commit authorship (`Pavlo Ratushnyi `) is in every commit and is not in the package. No email address of a third party was found outside `engine/strata` +(upstream author/credit lines). + +**History.** `git log --all -E -G'' -- . ':!engine/strata'` over all 6,466 commits (the `sk-` and JWT patterns of the tree scan were left out of the history run +because they are too broad for a diff search): **zero commits matched**. This is a pattern scan, not proof of absence: a secret in an unusual format would not be found. diff --git a/docs/release/third-party-crates-5090-v0.1.tsv b/docs/release/third-party-crates-5090-v0.1.tsv new file mode 100644 index 00000000..021032d8 --- /dev/null +++ b/docs/release/third-party-crates-5090-v0.1.tsv @@ -0,0 +1,204 @@ +# Rust crates linked into the six shipped binaries (normal dependencies of leleka-deploy, strata-control, strata-desktop-core; x86_64-unknown-linux-gnu; default features) +# Cargo.lock sha256 (LF-normalised) 10d08d0c03448a8abec0ca3fc49595a0630dfa5bf1dfb2e2337bdbd2bdffd2b6 ; generated offline with cargo metadata --locked --offline on 2026-11-02, base f9003b7ce +# name version SPDX licence expression (as declared by the crate) repository +ahash 0.8.12 MIT OR Apache-2.0 https://github.com/tkaitchuck/ahash +aho-corasick 1.1.5 Unlicense OR MIT https://github.com/BurntSushi/aho-corasick +allocator-api2 0.2.21 MIT OR Apache-2.0 https://github.com/zakarumych/allocator-api2 +anyhow 1.0.104 MIT OR Apache-2.0 https://github.com/dtolnay/anyhow +async-stream 0.3.6 MIT https://github.com/tokio-rs/async-stream +async-stream-impl 0.3.6 MIT https://github.com/tokio-rs/async-stream +async-trait 0.1.92 MIT OR Apache-2.0 https://github.com/dtolnay/async-trait +atomic-waker 1.1.2 Apache-2.0 OR MIT https://github.com/smol-rs/atomic-waker +aws-lc-rs 1.18.1 ISC AND (Apache-2.0 OR ISC) https://github.com/aws/aws-lc-rs +aws-lc-sys 0.45.0 ISC AND (Apache-2.0 OR ISC) AND Apache-2.0 AND MIT AND BSD-3-Clause AND (Apache-2.0 OR ISC OR MIT) AND (Apache-2.0 OR ISC OR MIT-0) https://github.com/aws/aws-lc-rs +axum 0.8.9 MIT https://github.com/tokio-rs/axum +axum-core 0.5.6 MIT https://github.com/tokio-rs/axum +base64 0.22.1 MIT OR Apache-2.0 https://github.com/marshallpierce/rust-base64 +base64 0.23.1 MIT OR Apache-2.0 https://github.com/marshallpierce/rust-base64 +bit-set 0.8.0 Apache-2.0 OR MIT https://github.com/contain-rs/bit-set +bit-vec 0.8.0 Apache-2.0 OR MIT https://github.com/contain-rs/bit-vec +bitflags 2.13.2 MIT OR Apache-2.0 https://github.com/bitflags/bitflags +block-buffer 0.12.1 MIT OR Apache-2.0 https://github.com/RustCrypto/utils +borrow-or-share 0.2.4 MIT-0 https://github.com/yescallop/borrow-or-share +bytecount 0.6.9 Apache-2.0/MIT https://github.com/llogiq/bytecount +bytes 1.12.1 MIT https://github.com/tokio-rs/bytes +cfg-if 1.0.5 MIT OR Apache-2.0 https://github.com/rust-lang/cfg-if +chacha20 0.10.2 MIT OR Apache-2.0 https://github.com/RustCrypto/stream-ciphers +const-oid 0.10.2 Apache-2.0 OR MIT https://github.com/RustCrypto/formats +cpufeatures 0.3.1 MIT OR Apache-2.0 https://github.com/RustCrypto/utils +crypto-common 0.2.2 MIT OR Apache-2.0 https://github.com/RustCrypto/traits +data-encoding 2.11.1 MIT https://github.com/ia0/data-encoding +digest 0.11.3 MIT OR Apache-2.0 https://github.com/RustCrypto/traits +displaydoc 0.2.7 MIT OR Apache-2.0 https://github.com/yaahc/displaydoc +either 1.18.0 MIT OR Apache-2.0 https://github.com/rayon-rs/either +email_address 0.2.9 MIT https://github.com/johnstonskj/rust-email_address.git +equivalent 1.0.2 Apache-2.0 OR MIT https://github.com/indexmap-rs/equivalent +errno 0.3.14 MIT OR Apache-2.0 https://github.com/lambda-fairy/rust-errno +fancy-regex 0.19.2 MIT https://github.com/fancy-regex/fancy-regex +fluent-uri 0.4.1 MIT https://github.com/yescallop/fluent-uri-rs +fnv 1.0.7 Apache-2.0 / MIT https://github.com/servo/rust-fnv +foldhash 0.2.0 Zlib https://github.com/orlp/foldhash +form_urlencoded 1.2.2 MIT OR Apache-2.0 https://github.com/servo/rust-url +fraction 0.17.0 MIT OR Apache-2.0 https://github.com/dnsl48/fraction.git +futures-channel 0.3.34 MIT OR Apache-2.0 https://github.com/rust-lang/futures-rs +futures-core 0.3.34 MIT OR Apache-2.0 https://github.com/rust-lang/futures-rs +futures-io 0.3.34 MIT OR Apache-2.0 https://github.com/rust-lang/futures-rs +futures-macro 0.3.34 MIT OR Apache-2.0 https://github.com/rust-lang/futures-rs +futures-sink 0.3.34 MIT OR Apache-2.0 https://github.com/rust-lang/futures-rs +futures-task 0.3.34 MIT OR Apache-2.0 https://github.com/rust-lang/futures-rs +futures-util 0.3.34 MIT OR Apache-2.0 https://github.com/rust-lang/futures-rs +getrandom 0.2.17 MIT OR Apache-2.0 https://github.com/rust-random/getrandom +getrandom 0.3.4 MIT OR Apache-2.0 https://github.com/rust-random/getrandom +getrandom 0.4.3 MIT OR Apache-2.0 https://github.com/rust-random/getrandom +h2 0.4.19 MIT https://github.com/hyperium/h2 +hashbrown 0.17.1 MIT OR Apache-2.0 https://github.com/rust-lang/hashbrown +heck 0.5.0 MIT OR Apache-2.0 https://github.com/withoutboats/heck +hex 0.4.3 MIT OR Apache-2.0 https://github.com/KokaKiwi/rust-hex +http 1.5.0 MIT OR Apache-2.0 https://github.com/hyperium/http +http-body 1.1.0 MIT https://github.com/hyperium/http-body +http-body-util 0.1.5 MIT https://github.com/hyperium/http-body +httparse 1.10.1 MIT OR Apache-2.0 https://github.com/seanmonstar/httparse +httpdate 1.0.3 MIT OR Apache-2.0 https://github.com/pyfisch/httpdate +hybrid-array 0.4.15 MIT OR Apache-2.0 https://github.com/RustCrypto/hybrid-array +hyper 1.11.1 MIT https://github.com/hyperium/hyper +hyper-rustls 0.27.10 Apache-2.0 OR ISC OR MIT https://github.com/rustls/hyper-rustls +hyper-timeout 0.5.2 MIT OR Apache-2.0 https://github.com/hjr3/hyper-timeout +hyper-util 0.1.21 MIT https://github.com/hyperium/hyper-util +icu_collections 2.3.0 Unicode-3.0 https://github.com/unicode-org/icu4x +icu_locale_core 2.3.0 Unicode-3.0 https://github.com/unicode-org/icu4x +icu_normalizer 2.3.0 Unicode-3.0 https://github.com/unicode-org/icu4x +icu_normalizer_data 2.3.0 Unicode-3.0 https://github.com/unicode-org/icu4x +icu_properties 2.3.0 Unicode-3.0 https://github.com/unicode-org/icu4x +icu_properties_data 2.3.0 Unicode-3.0 https://github.com/unicode-org/icu4x +icu_provider 2.3.1 Unicode-3.0 https://github.com/unicode-org/icu4x +idna 1.1.0 MIT OR Apache-2.0 https://github.com/servo/rust-url/ +idna_adapter 1.2.2 Apache-2.0 OR MIT https://github.com/hsivonen/idna_adapter +indexmap 2.14.2 Apache-2.0 OR MIT https://github.com/indexmap-rs/indexmap +ipnet 2.12.2 MIT OR Apache-2.0 https://github.com/krisprice/ipnet +itertools 0.14.0 MIT OR Apache-2.0 https://github.com/rust-itertools/itertools +itoa 1.0.18 MIT OR Apache-2.0 https://github.com/dtolnay/itoa +jsonschema 0.58.5 MIT https://github.com/Stranger6667/jsonschema +jsonschema-regex 0.58.5 MIT https://github.com/Stranger6667/jsonschema +jsonschema-value 0.58.5 MIT https://github.com/Stranger6667/jsonschema +libc 0.2.190 MIT OR Apache-2.0 https://github.com/rust-lang/libc +libm 0.2.16 MIT https://github.com/rust-lang/compiler-builtins +linux-raw-sys 0.12.1 Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT https://github.com/sunfishcode/linux-raw-sys +litemap 0.8.3 Unicode-3.0 https://github.com/unicode-org/icu4x +lock_api 0.4.14 MIT OR Apache-2.0 https://github.com/Amanieu/parking_lot +log 0.4.34 MIT OR Apache-2.0 https://github.com/rust-lang/log +lru-slab 0.1.3 MIT OR Apache-2.0 OR Zlib https://github.com/Ralith/lru-slab +matchit 0.8.4 MIT AND BSD-3-Clause https://github.com/ibraheemdev/matchit +memchr 2.8.3 Unlicense OR MIT https://github.com/BurntSushi/memchr +memo-map 0.3.4 Apache-2.0 https://github.com/mitsuhiko/memo-map +micromap 0.3.0 MIT https://github.com/yegor256/micromap +mime 0.3.17 MIT OR Apache-2.0 https://github.com/hyperium/mime +minijinja 2.24.0 Apache-2.0 https://github.com/mitsuhiko/minijinja +minijinja-contrib 2.24.0 Apache-2.0 https://github.com/mitsuhiko/minijinja +mio 1.2.4 MIT https://github.com/tokio-rs/mio +num 0.4.3 MIT OR Apache-2.0 https://github.com/rust-num/num +num-bigint 0.4.8 MIT OR Apache-2.0 https://github.com/rust-num/num-bigint +num-cmp 0.1.0 MIT/Apache-2.0 https://github.com/lifthrasiir/num-cmp +num-complex 0.4.6 MIT OR Apache-2.0 https://github.com/rust-num/num-complex +num-integer 0.1.47 MIT OR Apache-2.0 https://github.com/rust-num/num-integer +num-iter 0.1.46 MIT OR Apache-2.0 https://github.com/rust-num/num-iter +num-rational 0.4.2 MIT OR Apache-2.0 https://github.com/rust-num/num-rational +num-traits 0.2.19 MIT OR Apache-2.0 https://github.com/rust-num/num-traits +once_cell 1.21.4 MIT OR Apache-2.0 https://github.com/matklad/once_cell +openssl-probe 0.2.1 MIT OR Apache-2.0 https://github.com/rustls/openssl-probe +outref 0.5.2 MIT https://github.com/Nugine/outref +parking_lot 0.12.5 MIT OR Apache-2.0 https://github.com/Amanieu/parking_lot +parking_lot_core 0.9.12 MIT OR Apache-2.0 https://github.com/Amanieu/parking_lot +percent-encoding 2.3.2 MIT OR Apache-2.0 https://github.com/servo/rust-url/ +pin-project 1.1.13 Apache-2.0 OR MIT https://github.com/taiki-e/pin-project +pin-project-internal 1.1.13 Apache-2.0 OR MIT https://github.com/taiki-e/pin-project +pin-project-lite 0.2.17 Apache-2.0 OR MIT https://github.com/taiki-e/pin-project-lite +potential_utf 0.1.6 Unicode-3.0 https://github.com/unicode-org/icu4x +proc-macro2 1.0.107 MIT OR Apache-2.0 https://github.com/dtolnay/proc-macro2 +prost 0.14.4 Apache-2.0 https://github.com/tokio-rs/prost +prost-derive 0.14.4 Apache-2.0 https://github.com/tokio-rs/prost +quinn 0.11.12 MIT OR Apache-2.0 https://github.com/quinn-rs/quinn +quinn-proto 0.11.19 MIT OR Apache-2.0 https://github.com/quinn-rs/quinn +quinn-udp 0.5.16 MIT OR Apache-2.0 https://github.com/quinn-rs/quinn +quote 1.0.47 MIT OR Apache-2.0 https://github.com/dtolnay/quote +rand 0.10.3 MIT OR Apache-2.0 https://github.com/rust-random/rand +rand_core 0.10.1 MIT OR Apache-2.0 https://github.com/rust-random/rand_core +rand_pcg 0.10.2 MIT OR Apache-2.0 https://github.com/rust-random/rngs +ref-cast 1.0.27 MIT OR Apache-2.0 https://github.com/dtolnay/ref-cast +ref-cast-impl 1.0.27 MIT OR Apache-2.0 https://github.com/dtolnay/ref-cast +referencing 0.58.5 MIT https://github.com/Stranger6667/jsonschema +regex 1.13.1 MIT OR Apache-2.0 https://github.com/rust-lang/regex +regex-automata 0.4.18 MIT OR Apache-2.0 https://github.com/rust-lang/regex +regex-syntax 0.8.11 MIT OR Apache-2.0 https://github.com/rust-lang/regex +reqwest 0.13.5 MIT OR Apache-2.0 https://github.com/seanmonstar/reqwest +ring 0.17.14 Apache-2.0 AND ISC https://github.com/briansmith/ring +rustc-hash 2.1.3 Apache-2.0 OR MIT https://github.com/rust-lang/rustc-hash +rustix 1.1.5 Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT https://github.com/bytecodealliance/rustix +rustls 0.23.45 Apache-2.0 OR ISC OR MIT https://github.com/rustls/rustls +rustls-native-certs 0.8.4 Apache-2.0 OR ISC OR MIT https://github.com/rustls/rustls-native-certs +rustls-pki-types 1.15.1 MIT OR Apache-2.0 https://github.com/rustls/pki-types +rustls-platform-verifier 0.7.1 MIT OR Apache-2.0 https://github.com/rustls/rustls-platform-verifier +rustls-webpki 0.103.15 ISC https://github.com/rustls/webpki +ryu 1.0.23 Apache-2.0 OR BSL-1.0 https://github.com/dtolnay/ryu +scopeguard 1.2.0 MIT OR Apache-2.0 https://github.com/bluss/scopeguard +serde 1.0.229 MIT OR Apache-2.0 https://github.com/serde-rs/serde +serde_core 1.0.229 MIT OR Apache-2.0 https://github.com/serde-rs/serde +serde_derive 1.0.229 MIT OR Apache-2.0 https://github.com/serde-rs/serde +serde_json 1.0.151 MIT OR Apache-2.0 https://github.com/serde-rs/json +serde_path_to_error 0.1.20 MIT OR Apache-2.0 https://github.com/dtolnay/path-to-error +serde_urlencoded 0.7.1 MIT/Apache-2.0 https://github.com/nox/serde_urlencoded +sha2 0.11.0 MIT OR Apache-2.0 https://github.com/RustCrypto/hashes +signal-hook-registry 1.4.8 MIT OR Apache-2.0 https://github.com/vorner/signal-hook +slab 0.4.12 MIT https://github.com/tokio-rs/slab +smallvec 1.16.2 MIT OR Apache-2.0 https://github.com/servo/rust-smallvec +socket2 0.6.5 MIT OR Apache-2.0 https://github.com/rust-lang/socket2 +stable_deref_trait 1.2.1 MIT OR Apache-2.0 https://github.com/storyyeller/stable_deref_trait +strum 0.28.0 MIT https://github.com/Peternator7/strum +strum_macros 0.28.0 MIT https://github.com/Peternator7/strum +subtle 2.6.1 BSD-3-Clause https://github.com/dalek-cryptography/subtle +syn 3.0.6 MIT OR Apache-2.0 https://github.com/dtolnay/syn +syn 2.0.119 MIT OR Apache-2.0 https://github.com/dtolnay/syn +sync_wrapper 1.0.2 Apache-2.0 https://github.com/Actyx/sync_wrapper +synstructure 0.14.0 MIT https://github.com/mystor/synstructure +sysinfo 0.39.6 MIT https://github.com/GuillaumeGomez/sysinfo +thiserror 2.0.21 MIT OR Apache-2.0 https://github.com/dtolnay/thiserror +thiserror-impl 2.0.21 MIT OR Apache-2.0 https://github.com/dtolnay/thiserror +tinystr 0.8.4 Unicode-3.0 https://github.com/unicode-org/icu4x +tinyvec 1.13.3 Zlib OR Apache-2.0 OR MIT https://github.com/Lokathor/tinyvec +tokio 1.53.2 MIT https://github.com/tokio-rs/tokio +tokio-macros 2.7.2 MIT https://github.com/tokio-rs/tokio +tokio-rustls 0.26.6 MIT OR Apache-2.0 https://github.com/rustls/tokio-rustls +tokio-stream 0.1.19 MIT https://github.com/tokio-rs/tokio +tokio-util 0.7.19 MIT https://github.com/tokio-rs/tokio +tonic 0.14.6 MIT https://github.com/hyperium/tonic +tonic-prost 0.14.6 MIT https://github.com/hyperium/tonic +tower 0.5.3 MIT https://github.com/tower-rs/tower +tower-http 0.6.11 MIT https://github.com/tower-rs/tower-http +tower-layer 0.3.3 MIT https://github.com/tower-rs/tower +tower-service 0.3.3 MIT https://github.com/tower-rs/tower +tracing 0.1.44 MIT https://github.com/tokio-rs/tracing +tracing-attributes 0.1.31 MIT https://github.com/tokio-rs/tracing +tracing-core 0.1.36 MIT https://github.com/tokio-rs/tracing +try-lock 0.2.5 MIT https://github.com/seanmonstar/try-lock +typenum 1.20.1 MIT OR Apache-2.0 https://github.com/paholg/typenum +unicode-general-category 1.1.0 Apache-2.0 https://github.com/yeslogic/unicode-general-category +unicode-ident 1.0.26 (MIT OR Apache-2.0) AND Unicode-3.0 https://github.com/dtolnay/unicode-ident +untrusted 0.9.0 ISC https://github.com/briansmith/untrusted +url 2.5.8 MIT OR Apache-2.0 https://github.com/servo/rust-url +utf8_iter 1.0.4 Apache-2.0 OR MIT https://github.com/hsivonen/utf8_iter +uuid 1.27.0 Apache-2.0 OR MIT https://github.com/uuid-rs/uuid +uuid-simd 0.8.0 MIT https://github.com/Nugine/simd +vsimd 0.8.0 MIT https://github.com/Nugine/simd +want 0.3.1 MIT https://github.com/seanmonstar/want +webpki-root-certs 1.0.9 CDLA-Permissive-2.0 https://github.com/rustls/webpki-roots +writeable 0.6.4 Unicode-3.0 https://github.com/unicode-org/icu4x +yoke 0.8.3 Unicode-3.0 https://github.com/unicode-org/icu4x +yoke-derive 0.8.4 Unicode-3.0 https://github.com/unicode-org/icu4x +zerocopy 0.8.59 BSD-2-Clause OR Apache-2.0 OR MIT https://github.com/google/zerocopy +zerocopy-derive 0.8.59 BSD-2-Clause OR Apache-2.0 OR MIT https://github.com/google/zerocopy +zerofrom 0.1.8 Unicode-3.0 https://github.com/unicode-org/icu4x +zerofrom-derive 0.1.8 Unicode-3.0 https://github.com/unicode-org/icu4x +zeroize 1.9.0 Apache-2.0 OR MIT https://github.com/RustCrypto/utils +zerotrie 0.2.5 Unicode-3.0 https://github.com/unicode-org/icu4x +zerovec 0.11.8 Unicode-3.0 https://github.com/unicode-org/icu4x +zerovec-derive 0.11.6 Unicode-3.0 https://github.com/unicode-org/icu4x +zmij 1.0.23 MIT https://github.com/dtolnay/zmij diff --git a/scripts/release/package-5090.ps1 b/scripts/release/package-5090.ps1 new file mode 100644 index 00000000..c2a6a661 --- /dev/null +++ b/scripts/release/package-5090.ps1 @@ -0,0 +1,64 @@ +# Windows front of scripts/release/package-5090.sh (docs/release/5090-v0.1-checklist.md). ASCII only, PowerShell 5.1 compatible. +# +# .\scripts\release\package-5090.ps1 check gates, run by the shell script inside WSL2 (or Git Bash with -Shell git) +# .\scripts\release\package-5090.ps1 package [-Out DIR] [...] build + package inside WSL2 Ubuntu (the Linux toolchain is the pinned one) +# .\scripts\release\package-5090.ps1 verify TARBALL digest check of a tarball on Windows (Get-FileHash), then the shell `verify` in WSL2 +# .\scripts\release\package-5090.ps1 ptx-eol the Windows-only question: are all .ptx files of THIS checkout LF? (git ls-files --eol) +# +# Extra arguments after the command are passed to the shell script unchanged (--allow-dirty, --bin-dir, --target-dir, ...). +# The packager never installs anything, never deletes anything and writes only under the output directory (default dist/release-5090, git-ignored). +# CARGO_TARGET_DIR stays inside the worktree (AGENTS.md: WSL builds inside the repository folder): the default is /target. +param( + [Parameter(Mandatory = $true, Position = 0)][ValidateSet('check', 'build', 'package', 'verify', 'ptx-eol')][string]$Command, + [Parameter(Position = 1, ValueFromRemainingArguments = $true)][string[]]$Rest, + [string]$Distro = 'Ubuntu', + [ValidateSet('wsl', 'git')][string]$Shell = 'wsl' +) +$ErrorActionPreference = 'Stop' +$repo = (& git rev-parse --show-toplevel).Trim() +if (-not $repo) { throw 'run this inside the git checkout' } +Set-Location $repo + +function ConvertTo-WslPath([string]$windowsPath) { + $full = (Resolve-Path -LiteralPath $windowsPath).Path + $drive = $full.Substring(0, 1).ToLower() + return '/mnt/' + $drive + ($full.Substring(2) -replace '\\', '/') +} + +if ($Command -eq 'ptx-eol') { + $lines = & git ls-files --eol -- '*.ptx' + $bad = @($lines | Where-Object { $_ -match 'i/(crlf|mixed)|w/(crlf|mixed)' }) + $total = @($lines).Count + if ($bad.Count -eq 0) { Write-Host "PASS all $total .ptx files are LF in the index and the working tree"; exit 0 } + Write-Host "FAIL $($bad.Count) of $total .ptx files are CRLF or mixed; re-checkout them after the .gitattributes line '*.ptx -text' is in the index:" + Write-Host " (Git Bash) git ls-files -z -- '*.ptx' | xargs -0 rm -f ; git ls-files -z -- '*.ptx' | xargs -0 git checkout -- (regenerated from the index)" + $bad | Select-Object -First 5 | ForEach-Object { Write-Host " $_" } + exit 1 +} + +if ($Command -eq 'verify' -and $Rest.Count -ge 1) { + $tarball = $Rest[0] + $sidecar = "$tarball.sha256" + if (Test-Path -LiteralPath $sidecar) { + $want = ((Get-Content -LiteralPath $sidecar -TotalCount 1) -split '\s+')[0].ToLower() + $have = (Get-FileHash -Algorithm SHA256 -LiteralPath $tarball).Hash.ToLower() + if ($want -ne $have) { Write-Host "FAIL tarball digest differs from $sidecar"; exit 1 } + Write-Host "PASS tarball digest matches $sidecar" + } else { + Write-Host "note no $sidecar next to the tarball" + } + $Rest[0] = ConvertTo-WslPath $tarball +} + +if ($Shell -eq 'git') { + $bash = 'C:\Program Files\Git\bin\bash.exe' + & $bash -c ("cd '" + ($repo -replace '\\', '/') + "' && sh scripts/release/package-5090.sh $Command " + ($Rest -join ' ')) + exit $LASTEXITCODE +} + +$wslRepo = ConvertTo-WslPath $repo +$shellArgs = ($Rest | ForEach-Object { "'" + ($_ -replace "'", "'\''") + "'" }) -join ' ' +# A login shell so that ~/.cargo/env is read; the target directory defaults to /target (inside the folder). +$inner = ". ~/.cargo/env 2>/dev/null; cd '$wslRepo' && sh scripts/release/package-5090.sh $Command $shellArgs" +& wsl.exe -d $Distro -- bash -lc $inner +exit $LASTEXITCODE diff --git a/scripts/release/package-5090.sh b/scripts/release/package-5090.sh new file mode 100644 index 00000000..d14fe38d --- /dev/null +++ b/scripts/release/package-5090.sh @@ -0,0 +1,472 @@ +#!/bin/sh +# Release packager for the RTX 5090 serve path of Leleka (docs/release/5090-v0.1-checklist.md). +# +# Two kinds of host are involved, because the laptop's WSL2 git cannot open a worktree made by Windows git, while the Linux toolchain that builds +# the binaries lives in WSL2 (the 5090 server has no Rust toolchain; every measured binary so far was built in WSL and copied): +# +# 1. a host with the git checkout ("repo mode": Windows Git Bash, Linux): +# package-5090.sh check every gate of the tree, nothing written +# package-5090.sh stage-source [--out DIR] gates, then `git archive HEAD` (LF bytes, no .git) into DIR/src/release-5090-src-COMMIT12 +# with PROVENANCE.env (commit, branch, epoch, subtree id, gate result) - clean tree only +# 2. any Linux host with the pinned toolchain, run INSIDE the staged tree ("export mode": no git needed): +# package-5090.sh build [--target-dir DIR] the three cargo builds of docs/deploy.md section 8 (sm_120 only, no sm86); the commit and +# the clean/dirty mark come from PROVENANCE.env and are embedded by crates/deploy/build.rs +# package-5090.sh package [--out DIR] [...] git-free gates + build + assemble leleka-VERSION-COMMIT12-5090-linux-x86_64.tar.xz +# package-5090.sh verify TARBALL [--out DIR] unpack beside the tarball, re-check digests, contents, CR bytes and `leleka version` +# +# `package` also works in repo mode on a Linux host whose checkout is LF (a CRLF checkout is refused by gate_lf). +# +# Options: --out DIR output directory (default dist/release-5090; dist/ is git-ignored) +# --target-dir DIR cargo target directory (default: $CARGO_TARGET_DIR or ./target); use a NEW directory per build, never wipe an old one +# --bin-dir DIR package binaries that already exist in DIR (no cargo; their digests go into MANIFEST.json as they are) +# --no-build package from --target-dir/release without building +# --allow-dirty rehearsal in repo mode only: the package is named -dirty and cannot be tagged +# --epoch N SOURCE_DATE_EPOCH of the archive (default: commit time of HEAD) +# --expert-profile F ship the ranked-expert table (data/expert-profile.bin of upstream Strata, 196,632 bytes; not in Git) as +# share/leleka/data/expert-profile.bin after checking its SHA-256 against the pin of the deploy crate +# --unattended P extra file or directory to ship under share/leleka/unattended/ (repeatable; the defaults below are added when they +# exist: the systemd units and scripts of the unattended-operation work, which the OWNER installs) +# +# What it never does: install or enable anything, touch system settings, download anything, delete anything (an existing output directory is an +# error: move it to garbage/ first), or put model weights, captures, credentials or logs into the archive. Production serving needs no Python +# and the archive contains none. +set -eu + +# --- the release identity: change these only with the checklist ------------------------------------------------------------------ +RELEASE_TAG=leleka-5090-v0.1 +RELEASE_STRATA_PIN=41cf05a06a25dd29103b7b27a2279a3f60c21876 # docs/upstream.md; upstream 0.2.8 exists, the pin is NOT moved for this release +BINARIES="leleka strata-next leleka-inference leleka-daemon leleka-cli leleka-seal-exec" +DOCS="docs/deploy.md docs/upstream.md docs/quality-gate.md docs/e2e-run.md docs/ledger.md docs/port-remaining.md docs/prefix-cache.md docs/rust-runtime-run.md docs/experiments/baseline-pair-5090.md docs/experiments/draft-round-5090.md docs/experiments/2026-10-28-s6-1-lossy-audit.md" +UNATTENDED_DEFAULTS="deploy/systemd deploy/unattended scripts/unattended deploy/rust-runtime/leleka.service" +EXPERT_PROFILE_SHA256=8f59b4aa8873209dff11c11e37bcda9529a1335b724a1afeea37bf6388975baf # crates/deploy/src/plan.rs EXPERT_PROFILE_SHA256 +MAX_TRACKED_BYTES=20000000 +SECRET_RE='-----BEGIN [A-Z ]*PRIVATE KEY-----|AKIA[0-9A-Z]{16}|ghp_[A-Za-z0-9]{30,}|github_pat_[A-Za-z0-9_]{30,}|hf_[A-Za-z0-9]{30,}|sk-[A-Za-z0-9]{32,}|xox[abp]-[A-Za-z0-9-]{10,}|AIza[0-9A-Za-z_-]{35}|eyJ[A-Za-z0-9_-]{20,}\.[A-Za-z0-9_-]{20,}\.' +FORBIDDEN_NAME_RE='\.(gguf|kar2?|safetensors|pem|key|p12|pfx|jks|sqlite3?|db|log|jsonl|pcap|npz|npy|pt|pth|onnx)$|(^|/)(api-key|runtime\.env|\.env|id_rsa|id_ed25519|credentials)$' +# --------------------------------------------------------------------------------------------------------------------------------- + +say() { printf '%s\n' "$*"; } +failures=0 +ok() { printf 'PASS %s\n' "$*"; } +bad() { printf 'FAIL %s\n' "$*"; failures=$((failures + 1)); } +note() { printf 'note %s\n' "$*"; } +die() { printf 'package-5090: %s\n' "$*" >&2; exit 2; } +field() { tr -d '\r' | sed -n "s/^$1 *= *\"\\(.*\\)\"/\\1/p" | head -1; } +lf() { tr -d '\r'; } +no_cr() { tr -d '\015' <"$1" | cmp -s - "$1"; } + +command=${1:-} +[ -n "$command" ] || { sed -n '2,32p' "$0" | sed 's/^# \{0,1\}//'; exit 2; } +shift || true + +out=dist/release-5090 +target_dir=${CARGO_TARGET_DIR:-} +bin_dir= +no_build=0 +allow_dirty=0 +epoch= +extra_unattended= +expert_profile= +tarball_arg= +while [ $# -gt 0 ]; do + case "$1" in + --out) out=${2:?}; shift 2 ;; + --target-dir) target_dir=${2:?}; shift 2 ;; + --bin-dir) bin_dir=${2:?}; shift 2 ;; + --no-build) no_build=1; shift ;; + --allow-dirty) allow_dirty=1; shift ;; + --epoch) epoch=${2:?}; shift 2 ;; + --expert-profile) expert_profile=${2:?}; shift 2 ;; + --unattended) extra_unattended="$extra_unattended ${2:?}"; shift 2 ;; + -*) die "unknown option $1" ;; + *) [ -z "$tarball_arg" ] || die "unexpected argument $1"; tarball_arg=$1; shift ;; + esac +done + +for tool in sha256sum tar xz awk sed grep find sort tr cmp; do + command -v "$tool" >/dev/null 2>&1 || die "$tool is required" +done + +# Where are we? The repo root is two levels above this script. +here=$(cd "$(dirname "$0")/../.." && pwd) +cd "$here" +mode= +if command -v git >/dev/null 2>&1 && git rev-parse --git-dir >/dev/null 2>&1; then + top=$(cd "$(git rev-parse --show-toplevel)" && pwd) + if [ "$top" = "$here" ]; then mode=repo; fi +fi +if [ -z "$mode" ]; then + if [ -f PROVENANCE.env ]; then mode=export; else die "neither a git checkout nor a staged tree with PROVENANCE.env here ($here); run 'stage-source' on the git host first"; fi +fi +case "$out" in /*) ;; *) out=$here/$out ;; esac +[ -n "$target_dir" ] || target_dir=$here/target + +# --- facts about the tree: from git in repo mode, from PROVENANCE.env in export mode ---------------------------------------------- +if [ "$mode" = export ]; then + . ./PROVENANCE.env + P_DIRTY=false +else + P_COMMIT=$(git rev-parse HEAD) + P_SHORT=$(git rev-parse --short=12 HEAD) + P_BRANCH=$(git rev-parse --abbrev-ref HEAD) + P_DESCRIBE=$(git describe --always --abbrev=12 2>/dev/null || echo unknown) + P_EPOCH=$(git log -1 --format=%ct HEAD) + P_SUBTREE=$(git rev-parse HEAD:engine/strata) + P_TOUCHING=$(git log --format=%h -- engine/strata | wc -l | tr -d ' ') + P_TREE=$(git rev-parse 'HEAD^{tree}') + if [ -n "$(git status --porcelain --untracked-files=no)" ]; then P_DIRTY=true; else P_DIRTY=false; fi +fi +release_version() { field version /dev/null 2>&1; then + have=$(rustc --version | awk '{print $2}') + if [ "$have" = "$channel" ]; then ok "rustc $have is the pinned toolchain (rust-toolchain.toml)"; else bad "rustc is $have, rust-toolchain.toml pins $channel"; fi + else + note "rustc not found on this host (pinned: $channel); needed for build and package" + fi +} + +gate_pin() { + pin=$(upstream_pin) + if [ "$pin" = "$RELEASE_STRATA_PIN" ]; then ok "Strata pin is $RELEASE_STRATA_PIN (docs/upstream.md)"; else bad "docs/upstream.md pins '${pin:-nothing}', this release is defined for $RELEASE_STRATA_PIN: moving the pin needs the checklist section 3"; fi +} + +gate_ptx() { + total=$(ptx_all_list | wc -l | tr -d ' ') + crs=0 + for f in $(ptx_all_list); do + if ! no_cr "$f"; then crs=$((crs + 1)); if [ "$crs" -le 5 ]; then printf ' CR byte in %s\n' "$f"; fi; fi + done + if [ "$crs" = 0 ]; then ok "none of the $total .ptx files contains a CR byte (byte scan of the files that will be built)"; else bad "$crs of $total .ptx files contain CR bytes: a CRLF checkout builds a different binary (use stage-source / git archive)"; fi + if grep -q '^\*\.ptx -text' .gitattributes; then ok ".gitattributes pins *.ptx to -text (no end-of-line conversion on any platform)"; else bad ".gitattributes lacks '*.ptx -text'"; fi + if [ "$mode" = repo ]; then + bad_eol=$(git ls-files --eol -- '*.ptx' | awk '$1 ~ /crlf|mixed/ || $2 ~ /crlf|mixed/ { n++ } END { print n + 0 }') + if [ "$bad_eol" = 0 ]; then ok "git ls-files --eol: every .ptx is LF (or binary) in the index and in the working tree"; else bad "git ls-files --eol reports $bad_eol .ptx files as CRLF or mixed"; fi + fi + if ptx_all_list | grep -q ' '; then bad "a .ptx path contains a space"; fi + note "sealed PTX: $(ptx_sm120_list | wc -l | tr -d ' ') sm_120 files ship with SHA-256 (share/leleka/ptx/sm_120/SHA256SUMS); the sm_86 companions are not shipped by this package" +} + +gate_lf() { + # Text that is compiled into the binaries or copied into the archive must be LF. Windows checkouts with core.autocrlf=true are CRLF. + crlf=0 + for f in Cargo.toml Cargo.lock rust-toolchain.toml deploy/rust-runtime/install.sh deploy/rust-runtime/profiles/rtx5090-32g.json deploy/rust-runtime/profiles/rtx3080-16g.json deploy/rust-runtime/leleka-daemon.service deploy/rust-runtime/leleka-inference.service deploy/rust-runtime/runtime.env.example crates/deploy/src/cli.rs crates/deploy/src/profile.rs; do + [ -f "$f" ] || continue + if ! no_cr "$f"; then crlf=$((crlf + 1)); printf ' CRLF: %s\n' "$f"; fi + done + if [ "$mode" = repo ]; then + all=$(git ls-files --eol | grep -v 'engine/strata/' | awk '$2 ~ /w\/crlf/' | wc -l | tr -d ' ') + fi + if [ "$crlf" = 0 ]; then + ok "the files copied into the archive or compiled in as text are LF" + elif [ "$command" = check ] || [ "$command" = stage-source ]; then + note "$crlf of those files, and $all tracked files outside engine/strata in all, are CRLF in this working tree (core.autocrlf); build only from the LF export made by stage-source" + else + bad "$crlf files that are copied or compiled in are CRLF" + fi +} + +gate_tracked_files() { + [ "$mode" = repo ] || { note "tracked-file and secret gates ran at staging time (PROVENANCE.env)"; return 0; } + hits=$(git ls-files | grep -E "$FORBIDDEN_NAME_RE" | grep -vE '^(benchmarks/(results|quality)/|engine/strata/bench/results/)' || true) + if [ -z "$hits" ]; then ok "no weights, keys, credentials, logs or capture-type files are tracked (benchmarks/ result tables and upstream bench/results excluded; see the audit)"; else bad "forbidden file types are tracked:"; printf '%s\n' "$hits" | head -20; fi + big=$(git ls-tree -r -l HEAD | awk -v m="$MAX_TRACKED_BYTES" '$4 > m { print $4, $5 }') + if [ -z "$big" ]; then ok "no tracked file is larger than $MAX_TRACKED_BYTES bytes"; else bad "tracked files over $MAX_TRACKED_BYTES bytes:"; printf '%s\n' "$big"; fi +} + +gate_secrets() { + [ "$mode" = repo ] || return 0 + hits=$(git grep -InE -e "$SECRET_RE" -- . ':!*.lock' 2>/dev/null | cut -d: -f1,2 | head -20 || true) + if [ -z "$hits" ]; then ok "no private key, cloud/VCS/HF token or JWT pattern in any tracked text file (matches are never printed)"; else bad "secret-like patterns at (file:line):"; printf '%s\n' "$hits"; fi +} + +gate_licence() { + if [ -f LICENSE ] || [ -f LICENSE.md ] || [ -f LICENSE-APACHE ]; then ok "the repository has a LICENSE file at its root"; else bad "no LICENSE file at the repository root (Cargo.toml declares Apache-2.0; the OWNER must confirm the licence and add the text; see docs/release/licence-and-secrets-audit-5090-v0.1.md)"; fi + unlicensed= + for manifest in crates/*/Cargo.toml control-plane/Cargo.toml desktop-core/Cargo.toml; do + [ -f "$manifest" ] || continue + if ! grep -qE '^license(\.workspace)? *=' "$manifest"; then unlicensed="$unlicensed $(field name <"$manifest")"; fi + done + if [ -z "$unlicensed" ]; then ok "every workspace crate declares a licence"; else bad "workspace crates without a licence field:$unlicensed (these build the shipped binaries strata-next, leleka-inference, leleka-daemon, leleka-cli, leleka-seal-exec)"; fi + for f in engine/strata/LICENSE engine/strata/third_party/ggml/LICENSE engine/strata/third_party/project-maya/LICENSE engine/strata/third_party/project-maya/NOTICE.md control-plane/third_party/ggml/LICENSE crates/native-cpu-expert/LICENSE.ggml crates/native-cpu-expert/LICENSE.strata crates/quant-core/LICENSE-GGML crates/cpu-sys/NOTICE.colibri; do + [ -f "$f" ] || bad "third-party licence text missing: $f" + done +} + +gate_profile() { + p=deploy/rust-runtime/profiles/rtx5090-32g.json + [ -f "$p" ] || { bad "$p is missing"; return 0; } + if grep -qiE 'TAIL_SKIP|LOSSY|APPROX|EXPERIMENTAL_' "$p" deploy/rust-runtime/runtime.env.example deploy/rust-runtime/*.service; then bad "a lossy or experimental switch is named in the profile or the unit templates"; else ok "the 5090 profile and unit templates enable no lossy or experimental switch"; fi + if grep -q 'Not a formally quality-gated profile' "$p"; then ok "profile description keeps the 'Not a formally quality-gated profile' wording (release notes repeat it)"; else bad "profile description lost the quality-gate wording"; fi + budget=$(sed -n 's/.*"gpu_budget_bytes": *\([0-9]*\).*/\1/p' "$p") + fmt=$(printf '%s' "$budget" | sed ':a;s/\([0-9]\)\([0-9]\{3\}\)\($\|,\)/\1,\2\3/;ta') + if lf "$dest/PROVENANCE.env" + crlf_after=$(cd "$dest" && for f in $(ptx_all_list); do no_cr "$f" || echo "$f"; done | wc -l | tr -d ' ') + [ "$crlf_after" = 0 ] || die "the export has $crlf_after .ptx files with CR bytes" + say "staged: $dest (commit $P_COMMIT)" + say "next, in WSL2 Ubuntu (or any Linux host with the pinned toolchain): cd '$dest' && sh scripts/release/package-5090.sh package --out " + [ "$checks" = 0 ] +} + +# --- build ------------------------------------------------------------------------------------------------------------------------- +run_build() { + command -v cargo >/dev/null 2>&1 || die "cargo not found (the 5090 server has none: build in WSL2/Linux, docs/deploy.md section 8)" + LELEKA_GIT_COMMIT=$P_COMMIT; export LELEKA_GIT_COMMIT + if [ "$P_DIRTY" = true ]; then LELEKA_GIT_DIRTY=1; else LELEKA_GIT_DIRTY=0; fi + export LELEKA_GIT_DIRTY + CARGO_TARGET_DIR=$target_dir; export CARGO_TARGET_DIR + say "building commit $LELEKA_GIT_COMMIT (dirty=$LELEKA_GIT_DIRTY) into $CARGO_TARGET_DIR" + # The same three commands as docs/deploy.md section 8 and the measured dt/bin-* binaries, minus --features sm86 (sm_120 only). + cargo build --release --locked -p strata-desktop-core --bin leleka-inference --bin leleka-daemon --bin leleka-cli --bin leleka-seal-exec + cargo build --release --locked -p strata-control --bin strata-next + cargo build --release --locked -p leleka-deploy --bin leleka +} + +# --- package ----------------------------------------------------------------------------------------------------------------------- +json_escape() { printf '%s' "$1" | sed 's/\\/\\\\/g; s/"/\\"/g'; } + +run_package() { + run_check || die "the gates failed; fix them (or rehearse with --allow-dirty in repo mode and read the FAIL lines)" + if [ -z "$bin_dir" ]; then + [ "$no_build" = 1 ] || run_build + bin_dir=$target_dir/release + fi + for b in $BINARIES; do [ -f "$bin_dir/$b" ] || die "$bin_dir/$b is missing"; done + + version=$(release_version) + dirty=false; suffix= + if [ "$P_DIRTY" = true ]; then dirty=true; suffix=-dirty; fi + [ -n "$epoch" ] || epoch=$P_EPOCH + name=leleka-$version-$P_SHORT$suffix-5090-linux-x86_64 + [ ! -e "$out/stage/$name" ] || die "$out/stage/$name exists; move it to garbage/ (and add a line to garbage/LOG.txt) before packaging again" + mkdir -p "$out/stage/$name" + stage=$out/stage/$name + + say "assembling $name (epoch $epoch)" + mkdir -p "$stage/bin" "$stage/share/leleka/profiles" "$stage/share/leleka/templates" "$stage/share/leleka/ptx/sm_120" "$stage/share/leleka/docs" "$stage/share/leleka/licenses" "$stage/share/leleka/unattended" + for b in $BINARIES; do cp "$bin_dir/$b" "$stage/bin/$b"; chmod 0755 "$stage/bin/$b"; done + cp deploy/rust-runtime/profiles/rtx5090-32g.json "$stage/share/leleka/profiles/" + for t in leleka-daemon.service leleka-inference.service runtime.env.example; do cp "deploy/rust-runtime/$t" "$stage/share/leleka/templates/"; done + cp deploy/rust-runtime/install.sh "$stage/install.sh"; chmod 0755 "$stage/install.sh" + for f in $(ptx_sm120_list); do cp "$f" "$stage/share/leleka/ptx/sm_120/$(basename "$f")"; done + ( cd "$stage/share/leleka/ptx/sm_120" && LC_ALL=C ls | grep -v '^SHA256SUMS$' | xargs sha256sum >SHA256SUMS ) + for d in $DOCS docs/release/5090-v0.1-checklist.md docs/release/RELEASE-NOTES-5090-v0.1.md docs/release/licence-and-secrets-audit-5090-v0.1.md; do + [ -f "$d" ] || die "$d is missing" + rel=${d#docs/}; mkdir -p "$stage/share/leleka/docs/$(dirname "$rel")"; cp "$d" "$stage/share/leleka/docs/$rel" + done + if [ -n "$expert_profile" ]; then + [ -f "$expert_profile" ] || die "$expert_profile is not a file" + [ "$(sha256sum "$expert_profile" | awk '{print $1}')" = "$EXPERT_PROFILE_SHA256" ] || die "$expert_profile does not have the pinned SHA-256 $EXPERT_PROFILE_SHA256" + mkdir -p "$stage/share/leleka/data"; cp "$expert_profile" "$stage/share/leleka/data/expert-profile.bin" + else + note "no --expert-profile: the package does not carry data/expert-profile.bin; the 5090 profile runs without the ranked VRAM expert tier (slower) unless the asset volume has it (leleka up warns)" + fi + [ ! -f LICENSE ] || cp LICENSE "$stage/LICENSE" + cp engine/strata/LICENSE "$stage/share/leleka/licenses/strata-MIT.txt" + cp engine/strata/third_party/ggml/LICENSE "$stage/share/leleka/licenses/ggml-MIT.txt" + cp engine/strata/third_party/project-maya/LICENSE "$stage/share/leleka/licenses/project-maya-MIT.txt" + cp engine/strata/third_party/project-maya/NOTICE.md "$stage/share/leleka/licenses/project-maya-NOTICE.md" + cp crates/cpu-sys/NOTICE.colibri "$stage/share/leleka/licenses/colibri-NOTICE.txt" + [ ! -f docs/release/third-party-crates-5090-v0.1.tsv ] || cp docs/release/third-party-crates-5090-v0.1.tsv "$stage/share/leleka/licenses/rust-crates.tsv" + found_unattended= + for p in $UNATTENDED_DEFAULTS $extra_unattended; do + if [ -e "$p" ]; then cp -R "$p" "$stage/share/leleka/unattended/"; found_unattended="$found_unattended $p"; fi + done + if [ -n "$found_unattended" ]; then say "unattended files shipped (the owner installs them; nothing here does):$found_unattended"; else rmdir "$stage/share/leleka/unattended"; note "no unattended-operation files found (claude/unattended not merged yet?): the package carries only the two service templates"; fi + + # Provenance and manifest. + cargo_lock=$(lf /dev/null || echo unknown); cargo_v=$(cargo --version 2>/dev/null || echo unknown) + glibc_v=$(ldd --version 2>/dev/null | head -1 || echo unknown) + { + printf '{\n "schema_version": 1,\n "name": "leleka",\n "release": "%s",\n "version": "%s",\n "git_commit": "%s",\n "dirty": %s,\n "features": [],\n' "$RELEASE_TAG" "$version" "$P_COMMIT" "$dirty" + printf ' "binaries": {\n' + first=1 + for b in $BINARIES; do + [ "$first" = 1 ] || printf ',\n' + first=0 + printf ' "%s": "%s"' "$b" "$(sha256sum "$stage/bin/$b" | awk '{print $1}')" + done + printf '\n },\n' + printf ' "target": "x86_64-unknown-linux-gnu, RTX 5090 (sm_120) serve path; the sm_86 companion PTX and the sm86 feature are NOT in this package",\n' + printf ' "strata_upstream_pin": "%s",\n' "$RELEASE_STRATA_PIN" + printf ' "built_with": {"rustc": "%s", "cargo": "%s", "glibc": "%s"},\n' "$(json_escape "$rustc_v")" "$(json_escape "$cargo_v")" "$(json_escape "$glibc_v")" + printf ' "runtime_requirements": {"os": "linux x86_64, glibc 2.39 or newer", "nvidia_driver_min": 595, "gpu": "RTX 5090 class, sm_120, 32 GB", "ram": "100 GiB total, 113 GB available at start (rtx5090-32g profile)", "cublas": "libcublas.so.12 and libcublasLt.so.12 (CUDA 12; leleka up downloads the pinned 12.9.1.4 redistributable unless the host has them)"},\n' + printf ' "ptx_sm120_files": %s,\n "created_utc": "%s"\n}\n' "$(ptx_sm120_list | wc -l | tr -d ' ')" "$(date -u -d "@$epoch" +%Y-%m-%dT%H:%M:%SZ)" + } >"$stage/MANIFEST.json" + { + printf '{\n "schema_version": 1,\n "release": "%s",\n "git_commit": "%s",\n "git_branch": "%s",\n "git_describe": "%s",\n "git_tree": "%s",\n "dirty": %s,\n' "$RELEASE_TAG" "$P_COMMIT" "$P_BRANCH" "$P_DESCRIBE" "$P_TREE" "$dirty" + printf ' "cargo_lock_sha256": "%s",\n "rust_toolchain": "%s",\n "built_in_mode": "%s",\n' "$cargo_lock" "$(field channel "$stage/PROVENANCE.json" + printf '%s\n' "$RELEASE_TAG" >"$stage/RELEASE" + + # Content scan of what is about to be archived: nothing a release must not carry. + badfiles=$(cd "$stage" && find . -type f | sed 's|^\./||' | grep -E "$FORBIDDEN_NAME_RE|\.py$" | grep -v 'runtime\.env\.example$' || true) + [ -z "$badfiles" ] || { printf '%s\n' "$badfiles"; die "forbidden file types in the staging directory (above)"; } + if grep -rIlE -e "$SECRET_RE" "$stage" >/dev/null 2>&1; then die "a secret-like pattern is in the staging directory"; fi + if find "$stage" -type f -size +200000000c | grep -q .; then die "a file over 200 MB is in the staging directory"; fi + if find "$stage" -name '* *' | grep -q .; then die "a path with a space is in the staging directory"; fi + + # SHA256SUMS over every file, then a deterministic archive (sorted names, fixed owner and mtime, one xz thread). + ( cd "$stage" && find . -type f ! -name SHA256SUMS | sed 's|^\./||' | LC_ALL=C sort | xargs sha256sum >SHA256SUMS ) + find "$stage" -exec touch -h -d "@$epoch" {} + + archive=$out/$name.tar.xz + [ ! -e "$archive" ] || die "$archive exists; move it to garbage/ first" + ( cd "$out/stage" && tar --sort=name --format=gnu --owner=0 --group=0 --numeric-owner --mtime="@$epoch" -cf - "$name" ) | xz -6 -T1 -c >"$archive" + ( cd "$out" && sha256sum "$name.tar.xz" >"$name.tar.xz.sha256" ) + say "package: $archive" + say "sha256: $(awk '{print $1}' "$out/$name.tar.xz.sha256")" + say "bytes: $(wc -c <"$archive" | tr -d ' ') files: $(wc -l <"$stage/SHA256SUMS" | tr -d ' ') (+ SHA256SUMS) dirty=$dirty" + if [ "$dirty" = true ]; then say "NOT TAGGABLE: built from a dirty tree"; fi +} + +# --- verify ------------------------------------------------------------------------------------------------------------------------ +run_verify() { + failures=0 + [ -n "$tarball_arg" ] && [ -f "$tarball_arg" ] || die "usage: package-5090.sh verify TARBALL [--out DIR]" + case "$out" in "$here"/dist/release-5090) out=$(cd "$(dirname "$tarball_arg")" && pwd) ;; esac + base=$(basename "$tarball_arg" .tar.xz) + if [ -f "$tarball_arg.sha256" ]; then + want=$(awk '{print $1}' "$tarball_arg.sha256"); have=$(sha256sum "$tarball_arg" | awk '{print $1}') + if [ "$want" = "$have" ]; then ok "tarball digest matches $(basename "$tarball_arg").sha256"; else bad "tarball digest differs from $(basename "$tarball_arg").sha256"; fi + else + note "no .sha256 file next to the tarball; digest not compared" + fi + dest=$out/verify-$base + [ ! -e "$dest" ] || die "$dest exists; move it to garbage/ first" + mkdir -p "$dest" + tar -xJf "$tarball_arg" -C "$dest" + root=$dest/$base + [ -d "$root" ] || root=$(find "$dest" -mindepth 1 -maxdepth 1 -type d | head -1) + if ( cd "$root" && sha256sum --quiet -c SHA256SUMS ); then ok "SHA256SUMS: every file matches"; else bad "SHA256SUMS: a file does not match"; fi + ( cd "$root" && sed 's/^[0-9a-f]* //' SHA256SUMS | LC_ALL=C sort ) >"$dest/.listed" + ( cd "$root" && find . -type f ! -name SHA256SUMS | sed 's|^\./||' | LC_ALL=C sort ) >"$dest/.found" + extra=$(comm -13 "$dest/.listed" "$dest/.found") + if [ -z "$extra" ]; then ok "no file outside SHA256SUMS"; else bad "files not listed in SHA256SUMS:"; printf '%s\n' "$extra"; fi + badfiles=$(cd "$root" && find . -type f | sed 's|^\./||' | grep -E "$FORBIDDEN_NAME_RE|\.py$" | grep -v 'runtime\.env\.example$' || true) + if [ -z "$badfiles" ]; then ok "no weights, captures, credentials, logs or Python files in the package"; else bad "forbidden content:"; printf '%s\n' "$badfiles"; fi + if grep -rIlE -e "$SECRET_RE" "$root" >/dev/null 2>&1; then bad "a secret-like pattern is in the package"; else ok "no secret-like pattern in the package"; fi + for b in $BINARIES; do + m=$(sed -n "s/.*\"$b\": *\"\\([0-9a-f]*\\)\".*/\\1/p" "$root/MANIFEST.json" | head -1) + h=$(sha256sum "$root/bin/$b" | awk '{print $1}') + if [ -n "$m" ] && [ "$m" = "$h" ]; then ok "MANIFEST.json digest of bin/$b matches the file"; else bad "MANIFEST.json digest of bin/$b does not match the file"; fi + done + for f in "$root"/share/leleka/ptx/sm_120/*.ptx; do + if ! no_cr "$f"; then bad "CR byte in shipped $(basename "$f")"; fi + done + ok "shipped sm_120 PTX files were scanned for CR bytes" + if [ "$(uname -s)/$(uname -m)" = "Linux/x86_64" ] && [ -x "$root/bin/leleka" ]; then + ver=$("$root/bin/leleka" version 2>&1 || true) + printf '%s\n' "$ver" | sed 's/^/ /' + mc=$(sed -n 's/.*"git_commit": *"\([0-9a-f]*\)".*/\1/p' "$root/MANIFEST.json" | head -1) + case "$ver" in *"$mc"*"(clean)"*) ok "leleka version names the commit of MANIFEST.json and says clean" ;; *) bad "leleka version does not name the commit $mc of MANIFEST.json with (clean)" ;; esac + case "$ver" in *"$RELEASE_STRATA_PIN"*) ok "leleka version names the Strata pin $RELEASE_STRATA_PIN" ;; *) bad "leleka version does not name the Strata pin" ;; esac + else + note "not Linux x86_64: leleka version was not executed" + fi + say "unpacked at $root (left in place; move it to garbage/ when done)" + say "== $failures check(s) failed ==" + [ "$failures" = 0 ] +} + +case "$command" in + check) run_check ;; + stage-source) run_stage ;; + build) run_build ;; + package) run_package ;; + verify) run_verify ;; + *) die "unknown command $command (check | stage-source | build | package | verify)" ;; +esac From e52c70ae41c1a57e00d6132c338ea447c46e74be Mon Sep 17 00:00:00 2001 From: Pavlo Ratushnyi Date: Mon, 2 Nov 2026 20:30:53 +0100 Subject: [PATCH 2/3] release 5090: rehearsal mode, staged-tree flow, ps1 wrapper, checklist updates Co-Authored-By: Claude Sonnet 5.5 --- crates/deploy/build.rs | 32 +++++++++++--- docs/release/5090-v0.1-checklist.md | 14 +++--- scripts/release/package-5090.ps1 | 66 ++++++++++++++++++----------- scripts/release/package-5090.sh | 13 +++++- 4 files changed, 86 insertions(+), 39 deletions(-) diff --git a/crates/deploy/build.rs b/crates/deploy/build.rs index 437851ec..8b217bce 100644 --- a/crates/deploy/build.rs +++ b/crates/deploy/build.rs @@ -9,7 +9,11 @@ use std::path::{Path, PathBuf}; use std::process::Command; fn git(repo: &Path, args: &[&str]) -> Option { - let output = Command::new("git").args(args).current_dir(repo).output().ok()?; + let output = Command::new("git") + .args(args) + .current_dir(repo) + .output() + .ok()?; if !output.status.success() { return None; } @@ -19,15 +23,20 @@ fn git(repo: &Path, args: &[&str]) -> Option { /// The 40-hex commit on the `Upstream commit SHA` row of the pin table in `docs/upstream.md`. fn upstream_pin(doc: &Path) -> Option { let text = std::fs::read_to_string(doc).ok()?; - let line = text.lines().find(|line| line.contains("Upstream commit SHA"))?; + let line = text + .lines() + .find(|line| line.contains("Upstream commit SHA"))?; let start = line.find('`')? + 1; let end = start + line[start..].find('`')?; let sha = &line[start..end]; - (sha.len() == 40 && sha.bytes().all(|b| b.is_ascii_hexdigit())).then(|| sha.to_ascii_lowercase()) + (sha.len() == 40 && sha.bytes().all(|b| b.is_ascii_hexdigit())) + .then(|| sha.to_ascii_lowercase()) } fn main() { - let manifest = PathBuf::from(std::env::var_os("CARGO_MANIFEST_DIR").expect("cargo sets CARGO_MANIFEST_DIR")); + let manifest = PathBuf::from( + std::env::var_os("CARGO_MANIFEST_DIR").expect("cargo sets CARGO_MANIFEST_DIR"), + ); let repo = manifest.join("..").join(".."); println!("cargo:rerun-if-env-changed=LELEKA_GIT_COMMIT"); @@ -46,7 +55,10 @@ fn main() { .filter(|value| !value.trim().is_empty()) .or_else(|| git(&repo, &["rev-parse", "HEAD"])) .unwrap_or_else(|| "unknown".to_owned()); - let dirty = match std::env::var("LELEKA_GIT_DIRTY").ok().filter(|value| !value.trim().is_empty()) { + let dirty = match std::env::var("LELEKA_GIT_DIRTY") + .ok() + .filter(|value| !value.trim().is_empty()) + { Some(value) => match value.trim() { "0" | "no" | "false" | "clean" => "clean", _ => "dirty", @@ -62,6 +74,12 @@ fn main() { println!("cargo:rustc-env=LELEKA_BUILD_COMMIT={commit}"); println!("cargo:rustc-env=LELEKA_BUILD_TREE={dirty}"); println!("cargo:rustc-env=LELEKA_BUILD_STRATA_PIN={pin}"); - println!("cargo:rustc-env=LELEKA_BUILD_TARGET={}", std::env::var("TARGET").unwrap_or_else(|_| "unknown".to_owned())); - println!("cargo:rustc-env=LELEKA_BUILD_PROFILE={}", std::env::var("PROFILE").unwrap_or_else(|_| "unknown".to_owned())); + println!( + "cargo:rustc-env=LELEKA_BUILD_TARGET={}", + std::env::var("TARGET").unwrap_or_else(|_| "unknown".to_owned()) + ); + println!( + "cargo:rustc-env=LELEKA_BUILD_PROFILE={}", + std::env::var("PROFILE").unwrap_or_else(|_| "unknown".to_owned()) + ); } diff --git a/docs/release/5090-v0.1-checklist.md b/docs/release/5090-v0.1-checklist.md index 2b66fac9..150e5c75 100644 --- a/docs/release/5090-v0.1-checklist.md +++ b/docs/release/5090-v0.1-checklist.md @@ -29,8 +29,8 @@ Status words: **PASS** (evidence named), **OPEN** (to do in Phase B or by the na | MANIFEST / PROVENANCE | `MANIFEST.json` (schema 1, read by `leleka up`: version, commit, `features` = `[]` because this is an sm_120-only build, SHA-256 of the six binaries) and `PROVENANCE.json` (commit, branch, `Cargo.lock` SHA-256, toolchain, Strata upstream URL/commit/subtree tree id) | PASS `[script]` at package time | | Strata upstream pin | `41cf05a06a25dd29103b7b27a2279a3f60c21876` (engine 0.1.50, app 0.2.5), **not moved**; the packager refuses any other pin (`RELEASE_STRATA_PIN`) | PASS `[script]` gate_pin | | toolchain | `rust-toolchain.toml` = 1.99.0 (the packager compares `rustc --version`); no `[profile]` tuning: default `release` (no LTO, 16 codegen units, no target-cpu on purpose, `Cargo.toml` comment). `release-lto` is not used | PASS `[script]` gate_toolchain | -| build host | **WSL2 Ubuntu 24.04 on the laptop** (glibc 2.39 is the floor of the binaries), from a worktree checked out with LF endings and a **fresh `CARGO_TARGET_DIR`** inside the worktree (no hard deletes: do not wipe an old target). The 5090 server has **no Rust toolchain** (`decode/dt/BUILD.md`); installing one is a ~1 GB sequential write the owner has not approved, so the release is built in WSL and copied with `scp` like every measured binary | decision recorded; OPEN: owner may prefer a server build | -| PTX line endings | `*.ptx -text` in `.gitattributes` (new). Before this branch a Windows checkout with `core.autocrlf=true` turned 212 of 273 `.ptx` into CRLF (61 end in a NUL byte and were left alone by git's binary heuristic), so a Windows-side build embedded different PTX than the sealed one (the baseline-pair part-d binary came out 9 MB smaller). The packager checks `git ls-files --eol` of every `.ptx` and fails on any `crlf` / `mixed`; `verify` checks the shipped copies for CR bytes | PASS `[script]` gate_ptx (this worktree re-checked out as LF). **Other worktrees on the laptop still hold CRLF `.ptx`** until they re-checkout after the merge | +| build host | **WSL2 Ubuntu 24.04 on the laptop** (glibc 2.39 is the floor of the binaries; rustc 1.99.0 is installed there). The 5090 server has **no Rust toolchain** (`decode/dt/BUILD.md`); installing one is a ~1 GB sequential write the owner has not approved, so the release is built in WSL and copied with `scp` like every measured binary. Two facts shaped the packager: WSL2 git cannot open a worktree created by Windows git (its `.git` file names a `C:/` path), and a Windows checkout with `core.autocrlf=true` has 1,549 CRLF text files outside `engine/strata`. So `package-5090.sh stage-source` runs in Git Bash (gates, then `git archive HEAD` = LF bytes without `.git`, plus `PROVENANCE.env`), and `build` / `package` / `verify` run in WSL2 **inside the staged tree** with a **fresh `CARGO_TARGET_DIR`** (no hard deletes: never wipe an old target). `scripts/release/package-5090.ps1` wraps both | decision recorded; OPEN: owner may prefer a server build | +| PTX line endings | `*.ptx -text` in `.gitattributes` (new). Before this branch a Windows checkout with `core.autocrlf=true` turned 212 of 273 `.ptx` into CRLF (61 end in a NUL byte and were left alone by git's binary heuristic), so a Windows-side build embedded different PTX than the sealed one (the baseline-pair part-d binary came out 9 MB smaller). The packager checks `git ls-files --eol` of every `.ptx` and fails on any `crlf` / `mixed`; `verify` checks the shipped copies for CR bytes | PASS `[script]` gate_ptx (byte scan for CR in all 273 files, plus `git ls-files --eol`; this worktree re-created as LF). **Other worktrees on the laptop still hold CRLF `.ptx`** until they re-checkout after the merge (`package-5090.ps1 ptx-eol` tells; fix: remove and `git checkout --` the `.ptx` files, because `git checkout` skips stat-clean files) | | reproducible bytes | the archive is deterministic (sorted, fixed owner and mtime = commit time, `xz -T1`); the binaries are deterministic only for the same toolchain **and the same absolute build path** (panic messages embed paths) | OPEN: Phase B builds twice at the same path and records whether the six digests agree; no claim if they do not | | package contents | six binaries, the 5090 profile, two service templates + `runtime.env.example`, `install.sh`, 141 sealed sm_120 PTX with SHA-256 (the PTX is also embedded in the binaries), curated docs, licence texts, the unattended-operation files **when they exist at package time**, `SHA256SUMS`. Never: model weights, KAR archives, captures, credentials, logs, `*.py`, runtime.env, benchmark data | PASS `[script]` (staging scan and `verify`) | @@ -77,7 +77,7 @@ The shipped `rtx5090-32g` profile is **not bit-identical to the Original** and s | Q7 | `LELEKA_SM120_ATTN_DAILY_MTP=1` (MTP draft attention) | **bitwise** | draft-round-5090.md section 4: 2057 / 2057 logprob rows and 1036 / 1036 draft-trace lines identical, 0 argmax flips; model-free probe byte-identical; enabled in the profile by `f9003b7ce` | PASS | | Q8 | `LELEKA_DRAFT_FUSED_COMMIT` | bitwise, neutral | same page: identical, round -0.024 +- 0.046 ms; **off by default**. `claude/window-policy` decides the default | OPEN: follow the window-policy decision; whichever it is, re-run the identity gate of draft-round-5090.md section 4 on the release binaries | | Q9 | adaptive-window default policy (`claude/window-policy`) | policy | arrives with the merge | OPEN: needs its own paired A/B and quality row; the notes' tok/s change with it | -| Q10 | route tail skip (`LELEKA_ROUTE_TAIL_SKIP`) | **lossy, OFF** | upstream-port-plan.md row 3.1: +15.2 % decode on a replay, but the quality gate **fails on all three limits** (d_top1 p99 1.005 against the control's 0.3995, max 5.81, flips 2.77 % against 1.45 %): "not to be enabled in any profile". Not nameable in `engine_env` by the profile validator unless it starts with an admitted prefix: the packager also refuses the word in the profile and templates | PASS `[script]` gate_profile | +| Q10 | route tail skip (`LELEKA_ROUTE_TAIL_SKIP`) | **lossy, OFF** | upstream-port-plan.md row 3.1: +15.2 % decode on a replay, but the quality gate **fails on all three limits** (d_top1 p99 1.005 against the control's 0.3995, max 5.81, flips 2.77 % against 1.45 %): "not to be enabled in any profile". The profile validator rejects the name (`engine_env` admits only `LELEKA_ORIGINAL_SERVE_*`, `LELEKA_SM120_*` and `LELEKA_CHAIN`), and the packager refuses the word in the profile and in the unit templates; the process environment of a service could still set it; the runtime.env template names no such variable | PASS `[script]` gate_profile | | Q11 | keyless / value-only KV | lossy, not shipped | quality gate failed (`docs/experiments/2026-10-04-keyless-runtime.md`) | PASS (not in the package) | ### 4.3 Performance evidence (charter gate D): what the notes may say @@ -99,7 +99,7 @@ PCIe share 0.45 (`docs/experiments/baseline-pair-5090.md`, `draft-round-5090.md` | --- | --- | --- | | B1 | `scripts/release/package-5090.sh check` passes with zero FAIL | OPEN, see section 5 | | B2 | clean build from a fresh target dir with the three commands of `docs/deploy.md` section 8 minus `--features sm86`, `--locked`; `cargo test -p leleka-deploy` (all, with `--features test-fakes` on Linux) and the other crates' tests on Linux; `cargo clippy -D warnings`, `cargo fmt --check` for the crates this branch touched | OPEN (Phase B). Phase A: `app::version_tests` passes on Windows | -| B3 | `package-5090.sh package`, then `verify` on the produced tarball, on the laptop and on the server | OPEN (Phase B) | +| B3 | `package-5090.sh package`, then `verify` on the produced tarball, on the laptop and on the server. Phase A rehearsal: `stage-source` works (2 min 18 s); the WSL2 `leleka` build, `package --rehearse` and `verify` rehearsal results are in section 7 | OPEN (Phase B) | | B4 | `leleka verify` (full hash of the shards and the archive against the pins) and `leleka up --dry-run` on the server with the release binaries | OPEN (Phase B; see the server notes below) | | B5 | licence and third-party audit, secrets/PII scan: `docs/release/licence-and-secrets-audit-5090-v0.1.md` | PASS for the scan; **BLOCKER** for the missing repository LICENSE | | B6 | documents consistent: list below | OPEN | @@ -134,7 +134,7 @@ Document inconsistencies found in Phase A (fix in Phase B, after the merges, bec 1. In `claude/release-5090`: `git rebase main` (my commits touch `.gitattributes`, `crates/deploy/build.rs`, one hunk of `crates/deploy/src/app.rs`, `scripts/release/`, `docs/release/`). Re-run `package-5090.sh check`; fix D1-D7 in the pages that the merged branches changed; re-check `*.ptx` EOL in every worktree used for builds. 2. Read the merged windows-policy and unattended notes; update sections 4.2 (Q8, Q9) and 4.3 (A4, A5), the notes' numbers and `RELEASE_STRATA_PIN` stays. -3. **Build** in WSL2 Ubuntu from this worktree with a new `CARGO_TARGET_DIR` (e.g. `.git/wt/release-5090/target/rel-1`): `wsl -d Ubuntu -- bash -lc "cd /mnt/c/Users/pavel/work/leleka/.git/wt/release-5090 && scripts/release/package-5090.sh package --out dist/release-5090"`. Then once more with `target/rel-2` at the same path and compare the six digests (reproducibility row of section 2). Run the Linux test suites listed in B2. +3. **Stage and build.** Commit everything first (the export is `HEAD`). `scripts elease\package-5090.ps1 stage-source` (Git Bash; about 2 min, most of it the export of `engine/strata`), then `scripts elease\package-5090.ps1 package --expert-profile ` (WSL2, inside the staged tree, new target directory `target-rel-1` per attempt; offline: set `CARGO_NET_OFFLINE=true` if the registry cache is warm). Build once more with `--target-dir .../target-rel-2` **at the same path** and compare the six binary digests (reproducibility row of section 2). Run the Linux test suites of B2 in the same staged tree (`cargo test --locked -p leleka-deploy --features test-fakes` etc.). 4. **Verify** the tarball on the laptop (`package-5090.sh verify`), `scp` it to `rnr5090:/data/leleka-e2e/release-5090/` (one file of roughly 100-150 MB, sequential; no rsync, no tree copies), verify again on the server and unpack there (`tar -xJf` writes about 190 MB). 5. **GPU work goes through the queue**, never directly: one FIFO stub per job in `~/work/gpu-runs/holder2/jobs/` (`exec bash /data/leleka-e2e/release-5090/jobs/.sh`), `PRIORITY` untouched, the heavy part under `mkdir /data/leleka-e2e/gpu.lock` (poll, owner file with `STRA-xxx DEV `, `rmdir` only your own), and one line per event appended to `/data/leleka-e2e/decode/notes.md` (`[UTC] [DEV release-5090] ...`, append only). The holder owns the 55 GB sealed memfd and `MODEL.lock`, so a second `leleka up` with its own memfd does **not** fit in the 121 GB host: use `leleka up --mode none|--foreground --kar-fd $LELEKA_STRA169_KAR_FD --trust-archive` inside a holder job (the design of the unrun jobs 930/931), or ask the orchestrator for a window in which the owner stops the holder. 6. Jobs, in order: (a) `leleka verify` + `leleka up --dry-run` with the release binaries (hash reads are throttled: no bulk reads while another agent's job is running); (b) the short real-Codex smoke (prompt `scripts/e2e/codex/prompt-threejs.txt`, sha256 `f5724841...2a9a8`, `run-e2e.sh` harness, release binaries; protocol rows P1/P2: completion, no `generation failed` that is not a model-format error, memory flat); (c) one fresh-boot cold start timed from boot to `/ready` (the owner-authorised reboot procedure of `baseline-reboot-series.sh` applies; **no system setting is changed**); (d) the paired A/B of the final profile only if window-policy changed the default and has no A/B on the release commit. @@ -142,3 +142,7 @@ Document inconsistencies found in Phase A (fix in Phase B, after the merges, bec 8. If every row of sections 2-4 is PASS or an OPEN-accepted row that the notes state: `git tag -a leleka-5090-v0.1 -m "..." ` locally. Do not push. If anything fails: stop and report; no gate is weakened and no row is edited to PASS without its evidence. Server notes for the procedure: Ubuntu 26.04.1, kernel 7.0.0-38, RTX 5090 (driver 595.99.02, power limit 600 W), 121 GB RAM, `/data` 458 GB of which 63 GB were free on 2026-11-02; the NVMe is a DRAM-less consumer drive that stalled under sustained **writes** (three hangs 2026-10-28..30): keep writes small and sequential, no swap, no rsync; reads are fine. The safety net (rescue sshd on :2222, hardware watchdog, `kernel.hung_task_panic=1`) was installed by the owner. + +## 7. Phase A rehearsal log (2026-11-02, commit `fe34d883d`, not a release) + +REHEARSAL-RESULT: pending diff --git a/scripts/release/package-5090.ps1 b/scripts/release/package-5090.ps1 index c2a6a661..280ae725 100644 --- a/scripts/release/package-5090.ps1 +++ b/scripts/release/package-5090.ps1 @@ -1,18 +1,23 @@ # Windows front of scripts/release/package-5090.sh (docs/release/5090-v0.1-checklist.md). ASCII only, PowerShell 5.1 compatible. # -# .\scripts\release\package-5090.ps1 check gates, run by the shell script inside WSL2 (or Git Bash with -Shell git) -# .\scripts\release\package-5090.ps1 package [-Out DIR] [...] build + package inside WSL2 Ubuntu (the Linux toolchain is the pinned one) -# .\scripts\release\package-5090.ps1 verify TARBALL digest check of a tarball on Windows (Get-FileHash), then the shell `verify` in WSL2 -# .\scripts\release\package-5090.ps1 ptx-eol the Windows-only question: are all .ptx files of THIS checkout LF? (git ls-files --eol) +# Why two hosts: the pinned Linux toolchain lives in WSL2, but WSL2 git cannot open a worktree made by Windows git (its .git file names a C:/ path), +# and a Windows checkout with core.autocrlf=true is CRLF. So the git work happens in Git Bash and the build happens in WSL2 on an LF export. # -# Extra arguments after the command are passed to the shell script unchanged (--allow-dirty, --bin-dir, --target-dir, ...). -# The packager never installs anything, never deletes anything and writes only under the output directory (default dist/release-5090, git-ignored). -# CARGO_TARGET_DIR stays inside the worktree (AGENTS.md: WSL builds inside the repository folder): the default is /target. +# .\scripts\release\package-5090.ps1 check every gate, in Git Bash (writes nothing) +# .\scripts\release\package-5090.ps1 stage-source gates, then `git archive HEAD` into dist\release-5090\src\release-5090-src-COMMIT12 (clean tree only) +# .\scripts\release\package-5090.ps1 package [-Src DIR] build + package inside WSL2 from the staged tree (default: the newest one) +# .\scripts\release\package-5090.ps1 build [-Src DIR] only the three cargo builds +# .\scripts\release\package-5090.ps1 verify TARBALL digest check with Get-FileHash here, then the shell `verify` in WSL2 +# .\scripts\release\package-5090.ps1 ptx-eol are all .ptx files of THIS checkout LF? (git ls-files --eol) +# +# Anything after the command is passed to the shell script unchanged (--rehearse, --bin-dir, --target-dir, --expert-profile, --out, ...). +# The packager never installs anything, never deletes anything and writes only under its output directory (default dist\release-5090, git-ignored). +# CARGO_TARGET_DIR stays inside the staged tree (AGENTS.md: WSL builds inside the repository folder) unless --target-dir says otherwise. param( - [Parameter(Mandatory = $true, Position = 0)][ValidateSet('check', 'build', 'package', 'verify', 'ptx-eol')][string]$Command, + [Parameter(Mandatory = $true, Position = 0)][ValidateSet('check', 'stage-source', 'build', 'package', 'verify', 'ptx-eol')][string]$Command, [Parameter(Position = 1, ValueFromRemainingArguments = $true)][string[]]$Rest, - [string]$Distro = 'Ubuntu', - [ValidateSet('wsl', 'git')][string]$Shell = 'wsl' + [string]$Src = '', + [string]$Distro = 'Ubuntu' ) $ErrorActionPreference = 'Stop' $repo = (& git rev-parse --show-toplevel).Trim() @@ -25,19 +30,31 @@ function ConvertTo-WslPath([string]$windowsPath) { return '/mnt/' + $drive + ($full.Substring(2) -replace '\\', '/') } +function Quote-Sh([string]$text) { return "'" + ($text -replace "'", "'\''") + "'" } + if ($Command -eq 'ptx-eol') { $lines = & git ls-files --eol -- '*.ptx' $bad = @($lines | Where-Object { $_ -match 'i/(crlf|mixed)|w/(crlf|mixed)' }) $total = @($lines).Count if ($bad.Count -eq 0) { Write-Host "PASS all $total .ptx files are LF in the index and the working tree"; exit 0 } - Write-Host "FAIL $($bad.Count) of $total .ptx files are CRLF or mixed; re-checkout them after the .gitattributes line '*.ptx -text' is in the index:" - Write-Host " (Git Bash) git ls-files -z -- '*.ptx' | xargs -0 rm -f ; git ls-files -z -- '*.ptx' | xargs -0 git checkout -- (regenerated from the index)" + Write-Host "FAIL $($bad.Count) of $total .ptx files are CRLF or mixed; with '*.ptx -text' in the index, re-create them from it:" + Write-Host " (Git Bash) git ls-files -z -- '*.ptx' | xargs -0 rm -f ; git ls-files -z -- '*.ptx' | xargs -0 git checkout --" $bad | Select-Object -First 5 | ForEach-Object { Write-Host " $_" } exit 1 } -if ($Command -eq 'verify' -and $Rest.Count -ge 1) { - $tarball = $Rest[0] +if ($Command -in @('check', 'stage-source')) { + $bash = 'C:\Program Files\Git\bin\bash.exe' + $line = "cd " + (Quote-Sh ($repo -replace '\\', '/')) + " && sh scripts/release/package-5090.sh $Command " + (($Rest | ForEach-Object { Quote-Sh $_ }) -join ' ') + & $bash -c $line + exit $LASTEXITCODE +} + +# build / package / verify: inside WSL2, in the staged (LF, git-free) tree +$passThrough = @($Rest) +if ($Command -eq 'verify') { + if ($passThrough.Count -lt 1) { throw 'usage: package-5090.ps1 verify TARBALL' } + $tarball = $passThrough[0] $sidecar = "$tarball.sha256" if (Test-Path -LiteralPath $sidecar) { $want = ((Get-Content -LiteralPath $sidecar -TotalCount 1) -split '\s+')[0].ToLower() @@ -47,18 +64,17 @@ if ($Command -eq 'verify' -and $Rest.Count -ge 1) { } else { Write-Host "note no $sidecar next to the tarball" } - $Rest[0] = ConvertTo-WslPath $tarball + $passThrough[0] = ConvertTo-WslPath $tarball } - -if ($Shell -eq 'git') { - $bash = 'C:\Program Files\Git\bin\bash.exe' - & $bash -c ("cd '" + ($repo -replace '\\', '/') + "' && sh scripts/release/package-5090.sh $Command " + ($Rest -join ' ')) - exit $LASTEXITCODE +if (-not $Src) { + $newest = Get-ChildItem -LiteralPath (Join-Path $repo 'dist\release-5090\src') -Directory -ErrorAction SilentlyContinue | Sort-Object LastWriteTime -Descending | Select-Object -First 1 + if (-not $newest) { throw 'no staged tree: run stage-source first (or pass -Src DIR)' } + $Src = $newest.FullName } - -$wslRepo = ConvertTo-WslPath $repo -$shellArgs = ($Rest | ForEach-Object { "'" + ($_ -replace "'", "'\''") + "'" }) -join ' ' -# A login shell so that ~/.cargo/env is read; the target directory defaults to /target (inside the folder). -$inner = ". ~/.cargo/env 2>/dev/null; cd '$wslRepo' && sh scripts/release/package-5090.sh $Command $shellArgs" +if (-not (Test-Path -LiteralPath (Join-Path $Src 'PROVENANCE.env'))) { throw "$Src is not a staged tree (no PROVENANCE.env)" } +$wslSrc = ConvertTo-WslPath $Src +$shellArgs = ($passThrough | ForEach-Object { Quote-Sh $_ }) -join ' ' +# A login shell so that ~/.cargo/env is read. +$inner = ". ~/.cargo/env 2>/dev/null; cd " + (Quote-Sh $wslSrc) + " && sh scripts/release/package-5090.sh $Command $shellArgs" & wsl.exe -d $Distro -- bash -lc $inner exit $LASTEXITCODE diff --git a/scripts/release/package-5090.sh b/scripts/release/package-5090.sh index d14fe38d..505ddd23 100644 --- a/scripts/release/package-5090.sh +++ b/scripts/release/package-5090.sh @@ -21,6 +21,8 @@ # --bin-dir DIR package binaries that already exist in DIR (no cargo; their digests go into MANIFEST.json as they are) # --no-build package from --target-dir/release without building # --allow-dirty rehearsal in repo mode only: the package is named -dirty and cannot be tagged +# --rehearse package even though gates FAIL (to test the assembly): the archive is named -rehearsal, MANIFEST.json says +# "rehearsal": true and the tag procedure refuses it. Never a release # --epoch N SOURCE_DATE_EPOCH of the archive (default: commit time of HEAD) # --expert-profile F ship the ranked-expert table (data/expert-profile.bin of upstream Strata, 196,632 bytes; not in Git) as # share/leleka/data/expert-profile.bin after checking its SHA-256 against the pin of the deploy crate @@ -63,6 +65,7 @@ target_dir=${CARGO_TARGET_DIR:-} bin_dir= no_build=0 allow_dirty=0 +rehearse=0 epoch= extra_unattended= expert_profile= @@ -74,6 +77,7 @@ while [ $# -gt 0 ]; do --bin-dir) bin_dir=${2:?}; shift 2 ;; --no-build) no_build=1; shift ;; --allow-dirty) allow_dirty=1; shift ;; + --rehearse) rehearse=1; shift ;; --epoch) epoch=${2:?}; shift 2 ;; --expert-profile) expert_profile=${2:?}; shift 2 ;; --unattended) extra_unattended="$extra_unattended ${2:?}"; shift 2 ;; @@ -318,7 +322,10 @@ run_build() { json_escape() { printf '%s' "$1" | sed 's/\\/\\\\/g; s/"/\\"/g'; } run_package() { - run_check || die "the gates failed; fix them (or rehearse with --allow-dirty in repo mode and read the FAIL lines)" + if ! run_check; then + [ "$rehearse" = 1 ] || die "the gates failed; fix them (--rehearse packages anyway, as a non-release, to test the assembly)" + note "--rehearse: continuing past $failures failed gate(s); this archive is not a release" + fi if [ -z "$bin_dir" ]; then [ "$no_build" = 1 ] || run_build bin_dir=$target_dir/release @@ -328,6 +335,7 @@ run_package() { version=$(release_version) dirty=false; suffix= if [ "$P_DIRTY" = true ]; then dirty=true; suffix=-dirty; fi + if [ "$rehearse" = 1 ]; then suffix=$suffix-rehearsal; fi [ -n "$epoch" ] || epoch=$P_EPOCH name=leleka-$version-$P_SHORT$suffix-5090-linux-x86_64 [ ! -e "$out/stage/$name" ] || die "$out/stage/$name exists; move it to garbage/ (and add a line to garbage/LOG.txt) before packaging again" @@ -371,7 +379,7 @@ run_package() { rustc_v=$(rustc --version 2>/dev/null || echo unknown); cargo_v=$(cargo --version 2>/dev/null || echo unknown) glibc_v=$(ldd --version 2>/dev/null | head -1 || echo unknown) { - printf '{\n "schema_version": 1,\n "name": "leleka",\n "release": "%s",\n "version": "%s",\n "git_commit": "%s",\n "dirty": %s,\n "features": [],\n' "$RELEASE_TAG" "$version" "$P_COMMIT" "$dirty" + printf '{\n "schema_version": 1,\n "name": "leleka",\n "release": "%s",\n "version": "%s",\n "git_commit": "%s",\n "dirty": %s,\n "rehearsal": %s,\n "features": [],\n' "$RELEASE_TAG" "$version" "$P_COMMIT" "$dirty" "$([ "$rehearse" = 1 ] && echo true || echo false)" printf ' "binaries": {\n' first=1 for b in $BINARIES; do @@ -411,6 +419,7 @@ run_package() { say "sha256: $(awk '{print $1}' "$out/$name.tar.xz.sha256")" say "bytes: $(wc -c <"$archive" | tr -d ' ') files: $(wc -l <"$stage/SHA256SUMS" | tr -d ' ') (+ SHA256SUMS) dirty=$dirty" if [ "$dirty" = true ]; then say "NOT TAGGABLE: built from a dirty tree"; fi + if [ "$rehearse" = 1 ]; then say "NOT A RELEASE: --rehearse (gates were not enforced)"; fi } # --- verify ------------------------------------------------------------------------------------------------------------------------ From 87253733293a365ccade63d6c0ba18093327561e Mon Sep 17 00:00:00 2001 From: Pavlo Ratushnyi Date: Mon, 2 Nov 2026 20:39:27 +0100 Subject: [PATCH 3/3] release 5090: record the phase A rehearsal (stage, WSL build, package, verify) Co-Authored-By: Claude Sonnet 5.5 --- docs/release/5090-v0.1-checklist.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/release/5090-v0.1-checklist.md b/docs/release/5090-v0.1-checklist.md index 150e5c75..33a44cee 100644 --- a/docs/release/5090-v0.1-checklist.md +++ b/docs/release/5090-v0.1-checklist.md @@ -145,4 +145,13 @@ Server notes for the procedure: Ubuntu 26.04.1, kernel 7.0.0-38, RTX 5090 (drive ## 7. Phase A rehearsal log (2026-11-02, commit `fe34d883d`, not a release) -REHEARSAL-RESULT: pending +What was run, to prove the mechanics (the output is **not** a release: five gates were failing, so it was built with `--rehearse`, named `-rehearsal`, `MANIFEST.json` says `"rehearsal": true`): + +| step | host | result | +| --- | --- | --- | +| `package-5090.sh check --allow-dirty` | Git Bash | 5 gates fail, all expected and listed in section 5 / D1-D2: no root LICENSE, two crates without a licence field, `docs/deploy.md` engine_env sentence, profile description speed, `TBD` markers in the notes. 25 PASS (versions, pin, 273 PTX without CR, tracked files, secrets, 27 flags and 9 commands vs `leleka --help`, ...). 72 s | +| `stage-source` | Git Bash | `git archive HEAD` into `dist/release-5090/src/release-5090-src-fe34d883d011` with `PROVENANCE.env`, 2 min 18 s | +| `package --rehearse` (three cargo builds, offline, `--locked`) | WSL2 Ubuntu 24.04, rustc 1.99.0, inside the staged tree | all six binaries built (8 min 47 s on a shared CPU), archive 25,021,988 bytes, 175 files, sha256 `c35fa11070d20787cb72b18f41c4f585a0857418603f3850ea695c4d56a82ae3` | +| `verify` | WSL2 | 0 failures: tarball digest, `SHA256SUMS`, no file outside it, no forbidden type or Python, no secret pattern, the six `MANIFEST.json` digests, no CR in shipped PTX, `leleka version` = `leleka 0.1.0`, commit `fe34d883...` `(clean)`, Strata pin `41cf05a0...` | + +Not rehearsed: reproducibility of the binaries (second build at the same path), the Linux test suites, anything on the server (nothing was copied there or run there; the only server contact in Phase A was read-only `ssh` queries).