# Candidate packaging input evidence The input collector is preparation for K15/A12, not license clearance or a replacement packaging owner. `src/launcher/delivery.rs` remains the target/channel/manifest contract. The separate formal release orchestration is described below. No package, release, installation, account, GUI or native-voice acceptance is established by these helpers. The fixed Go oracle remains `d8fbf8598c3effd4e2f837e43ad6f0488c461de3`. ## Assemble four native CI candidates without publishing `scripts/package-rust-candidates.py` accepts the target folders produced by `scripts/rust-candidate-ci.py`: `windows-x64`, `linux-x64`, `macos-intel`, and `macos-apple-silicon`. Download and retain the original CI evidence, then place these four folders immediately under one input directory. Use a canonical path without symlink ancestors. Keep input/output directories separate. ```sh python3 scripts/package-rust-candidates.py --inputs /path/to/native-candidates --output /path/to/new-candidate-package ``` This checks all four receipts' source/version/Cargo-lock/Web/launcher-UI input consistency, both binary hashes, notice hashes, successful input collection, and Windows embedded-runtime evidence. Invalid, incomplete or mixed receipts fail before any output is created. Documents come from the receipt's Git commit. Four ZIPs preserve the existing target suffixes and include both binaries, notices, receipts and an unaccepted-candidate warning. Archive bytes are read back and checked. Output must not already exist. `artifacts.json` has the Binary/ID/goos/goarch fields consumed by the existing `scripts/stage-npm-binaries.mjs`, referencing the same staged binary bytes as the ZIPs. Each candidate binary uses `pathBase: "manifest"` and a relative `binaries//` path, so the complete aggregate bundle can be downloaded or moved and then passed directly to the current stager without reassembly. The stager retains absolute paths and legacy paths relative to the repository root when `pathBase` is omitted; unknown path bases fail preflight. npm staging retains its main-binary-only contract and changes local npm package directories; the assembler does not invoke staging or publishing. Keep local candidate output outside the checkout to avoid untracked artifacts. `SHA256SUMS.txt` covers the four ZIPs. This assembler trusts the downloaded CI receipts; it is not a signature verifier or an independent native-runtime test. The existing `rust-migration.yml` stays `workflow_dispatch` only. Its uncredentialed assembly job waits for all four native jobs, checks out the same source SHA, and merges only the four native artifact names for that source, run and attempt. It uploads a separate candidate bundle, explicitly including its hidden output directory; it does not run a second native build. Rerun all jobs for a new attempt: older native artifacts deliberately cannot complete a partial rerun. Original native evidence remains in the native artifacts. The aggregate workflow still needs a real four-target run for acceptance. Without `--release-tag`, these helpers accept only `0.0.0-rust-candidate+`. The assembler does not build, install, publish, or change the running Hub. The explicit formal mode and its publication boundary are described below. Native runtime, installation, update/rollback and device acceptance remain separate release work. Official Docker images, container builds and automatic updates are not provided. Input-collection success is source evidence, not license clearance or native application/device acceptance. Candidate packaging remains unaccepted preparation. ## Formal Rust release orchestration `.github/workflows/release.yml` replaces the frozen Go release path. A tag push selects a full release. The tag must be canonical `vMAJOR.MINOR.PATCH` with an optional SemVer prerelease suffix; build metadata and numeric leading zeroes are rejected. Before compilation, the workflow checks the tag ref, event SHA, checkout HEAD and tag commit agree, rejects registered investigation instrumentation, requires successful Validate/doxguard/secret-scan runs for that exact source, and rejects missing or empty release notes in the corresponding CHANGELOG section. An already published tag cannot be rebuilt by the full-release path. Pending or not-yet-visible latest CI runs are polled for up to ten minutes inside a fifteen-minute planning job (each request has a sixty-second bound). A completed failed run is rejected immediately; an older green run cannot replace the latest result. Only push runs of this repository on `main`, `develop`, `release/*`, `hotfix/*` or the tag itself count, and a branch push run must be green as well as the tag's own run: pull-request runs, which anyone can open at the tag commit, neither block nor stand in for them. The four native jobs reuse the existing candidate runner and target/toolchain contract with `--release-tag`. Each target compiles its two binaries once. The native runner derives the version, commit and timestamp from the tag commit; the assembler rejects mixed identities. Aggregation requires all four artifact names from the same source, workflow run and attempt. Rerun every native job after a failed attempt: successful jobs from older attempts cannot complete a partial matrix rerun. No npm token, cross-repository PAT or signing permission is supplied to native build or package jobs. Stable releases prepare deb/rpm payloads from the Linux canonical ZIP, build only the package containers, extract them, and compare both binaries, notices and evidence with their canonical inputs. The package job records the payload digests as a job output and hands the payload on without running Syft. A separate `sbom` job installs Syft from its release tarball after checking a pinned SHA-256 and generates a separate SPDX document for each shipped ZIP/deb/rpm. The `assemble` job requires the payload to match the recorded digests, accepts each SPDX document only when its root binds to its payload, and writes the checksum inventory; the signing job checks the payload lines against the same record before signing. A hash-bound distribution root describes the opaque payload even when binary metadata does not reveal dependencies. Syft observations and embedded Cargo build-input SPDX are distinct evidence; neither asserts complete runtime classification or license clearance. Artifact instrumentation checks run before signing or publication. One signing job signs the complete checksums with the existing pinned cosign version and tag-bound GitHub OIDC identity. A separate publisher verifies the signature and every asset before creating the GitHub Release with human release notes. Canonical publication precedes npm and pointer updates. Build receipts retain their unaccepted status: a compiled or packaged input is not by itself publication, installation, native voice, device or update/rollback acceptance. `workflow_dispatch` retains the `tag` and `npm_only` API: `npm_only: true` (the default) selects only npm; `false` selects the full release. The additional `channel` choice defaults to `legacy` and can explicitly select `full`, `npm`, `homebrew` or `winget`. Full dispatch must run **at the requested tag ref**, not an unrelated branch, so the signing identity is the same as a tag push. A channel retry must start at the tag ref too: the scripts of the ref a run starts at receive the publishing token and npm's OIDC identity, so every job checks out the tag commit and the `release` environment accepts only `v*` tags. A retry downloads the published four canonical ZIPs, verifies the tag-bound checksum signature and every archive hash, and never invokes a native build. Current Rust npm staging requires the formal Rust notices/build-input layout; it does not republish old Go releases as Rust packages. npm package metadata, shims, README inputs and the staging scripts all come from the release tag commit, even on a retry; a redistribution script fixed after the tag ships with the next tag. Normal and npm-only publication both use `stage-npm-from-release.mjs`. npm publication uses Trusted Publishing: no npm key is stored, the `npm` job runs in the approved `release` environment with `id-token: write`, and npm provenance is kept. Each package must list this repository's `release.yml` and `release` as its trusted publisher on npmjs.com, allowing staged publishing only. The job runs `npm stage publish`; nothing goes live until the owner approves each staged version on npmjs.com with 2FA, platform packages first and the root last. Homebrew and winget are stable-only optional pointers and receive `PUBLISH_GITHUB_TOKEN` only in their final publication step. A missing optional credential is explicitly reported as skipped and does not undo the canonical release. Prereleases publish ZIPs and npm `next`; deb/rpm and stable pointer updates are explicitly skipped. Offline source/helper tests do not establish that the hosted matrix, signing, package tools, registry, tap, winget PR, or installed binaries have succeeded. Those require their own retained CI/publication/native acceptance evidence. ## Offline collection from an actual successful build Python 3.11 or later is required for the standard-library `tomllib`; candidate CI uses the pinned Python 3.12 toolchain. The synthetic fixtures canonicalize their newly created temporary root before constructing cache/metadata paths, because macOS can supply temporary paths through `/var` -> `/private/var`. This does not relax the collector's no-symlink source/cache checks: aliased source ancestors remain rejected and have a separate negative regression. The integration owner captures one complete build's Cargo JSON stdout, preserves stderr and rendered compiler diagnostics, and checks its exit code independently. The two commands must use the same clean source, lockfile, Cargo home, toolchain, target and feature selection as the resulting binaries: ```sh cargo metadata --locked --manifest-path rust/Cargo.toml --format-version 1 \ --filter-platform "$TARGET" > cargo-metadata.json cargo build --locked --manifest-path rust/Cargo.toml --target "$TARGET" \ --release --bins --message-format=json > cargo-build.jsonl python3 rust/packaging/collect_inputs.py \ --lockfile rust/Cargo.lock --metadata cargo-metadata.json \ --build-messages cargo-build.jsonl --cargo-home "$CARGO_HOME" \ --target "$TARGET" --source-revision "$SOURCE_SHA" --output new-evidence-dir ``` The integration owner, not this tool, obtains authorized dependencies and checks clean source/build identity. Use `--offline` only with complete pinned caches. If `CARGO_HOME` is unset, pass its actual selected absolute location explicitly; there is deliberately no implicit home discovery. Repeat `--cache-dir` for exact `registry/cache/` directories when necessary. The paired extracted sources must remain under `registry/src/` so the archive receipt is tied to the manifests Cargo actually resolved. Do not point this at installed application data. The output directory must not already exist. The collector: - Requires successful `build-finished` and executable compiler-artifact receipts for **both** root binaries; rejects concatenated/failed/incomplete builds. - Selects dependencies from observed compiler-artifact/build-script-executed IDs, cross-checks them with Cargo metadata and `Cargo.lock`, and preserves target kind, crate type, feature and freshness observations. It does not label all lockfile packages as built, all built packages as linked, or host proc-macro/ build-script inputs as target runtime libraries. - Does not invoke Cargo or any package code. It hashes the selected `.crate` archive against the lock checksum, verifies every archived source file against the actual resolved extracted source, then reads the archive's manifest and license/notice/copyright/copying files, including nested native-vendor notices. - Rejects unsafe archive paths, links, duplicate files, mismatched sources and oversized evidence. It never extracts files to disk. Report errors omit local cache/home paths. Input/report hashes bind the metadata, complete build log, lockfile and verified texts. They do not attest to a hostile mutable build host. - Includes explicitly reviewed source-header excerpts from `source-notices.json`. The current SQLite header entry is tied to the full upstream source-file hash, version and line range. A dependency change requires re-review; it cannot silently reuse the old header. Archive-wide native notices are conservative evidence; Cargo features/build output establish which bundled code was used. Outputs: - `BUILD-INPUTS.json`: observations, source and notice hashes, gaps and explicit `release_ready: false`. - `CRATE-NOTICES.txt`: exact UTF-8 texts of verified source notices. A partial bundle is retained when some sources are unavailable and labeled as evidence. - `build-inputs.spdx.json`: generated only when every observed package has verified archive/source bytes, a nonempty license expression and discovered notice text. This SPDX 2.3 document describes **Cargo build inputs**, not a complete shipped distribution. `licenseDeclared` and `licenseConcluded` remain `NOASSERTION`; original Cargo expressions are preserved without silently parsing legacy expressions or making legal conclusions. Review expressions, source-header-only notices and composition before treating it as a distribution SBOM. Exit 0 means source evidence collection completed, not release/license clearance. Exit 1 retains the report but blocks source-evidence readiness. Exit 2 means an invalid build input or output collision; it must not be treated as a successful receipt. A successful binary build is a separate result even when this step fails. Synthetic tests (no Cargo/network/installed state): ```sh PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s rust/packaging -p 'test_*.py' -v ``` ## Source-reviewed gap matrix (2026-10-05) Baseline reviewed: recovered source `7c2d7d320e04cd1d550d937d97515ff692500c6a`. The current lock contains 316 registry packages; its SHA256 is `0466139df475d43177199440af0e9aa2455b26aabe55927cacb2d365f8cd0a12`. These observations are not a final candidate/CI/release receipt. | Boundary | Existing source contract | Verified gap / concrete next gate | |---|---|---| | Targets and roles | `delivery::Target`, `.goreleaser.yaml`: Windows x64, Linux x64, macOS Intel/Apple Silicon; ZIP and Linux deb/rpm contain both binaries | Candidate CI produces separate loose binary outputs. Assemble same-source four-target receipts into the existing delivery owner; perform archive/package content and hash readback before accepting packaged artifacts. | | npm | `package_files(..., Npm)`, `scripts/stage-npm-binaries.mjs`, platform `package.json`: main binary only; existing shim forwards argv/stdio and current exit behavior | Keep main-only payload. Coordinator must fix `scripts/smoke-npm.mjs` testing `includes('win32')` against `windows-x64`, missing-binary acceptance and skip-as-success. Real packed binary/shim tests on each native target remain pending. | | Delivery manifest | Existing schema requires eight binaries, Web and launcher entry assets and four runtime DLL entries, with per-file readback | Nonempty runtime strings and hashes are input identities, not authentication/licensing/ABI proof. Manifest validation is not release readiness and is not yet connected to real assembled channel artifacts. Portable relative paths now reject Windows drives/ADS and normalized aliases on every host. | | Windows resources | `winres/winres.json`, `winres/winres-launcher.json`, Go release hooks create icon/manifest/version resources | Rust `build.rs` embeds Web/UI and test fixture but does not create corresponding product resources. Coordinator must preserve both executables' icon/manifest/version input identity and inspect native PE output. | | Locked Rust dependencies | `Cargo.lock` includes AWS-LC, bundled SQLite, ring, zlib-rs and transitive Rust sources | Prior `inventory/dependencies.json` has 28 direct entries and an older lock hash. Use actual observed build inputs plus verified archives, not that snapshot, to assemble notices/SBOM. Collector now supplies the reusable evidence step. | | Native embedded sources | Verified `aws-lc-sys 0.45.0` archive has a compound license expression, root and AWS-LC licenses plus fiat license; `libsqlite3-sys 0.38.2` contains SQLite 3.53.2 | Do not reduce native obligations to wrapper crate MIT/Apache labels. Collector retains nested native texts and the checksum-pinned SQLite public-domain header. Review actual features/native build output, generated code, toolchain and system libraries separately. | | Notice distribution | ZIP includes root Go `THIRD_PARTY_NOTICES.md` and Web vendor texts; npm platform allowlist includes only main binary; deb/rpm configuration lists binaries | Rust source notice currently describes Go-derived regex only. Candidate CI originally copied that notice and GO-LICENSE only. Add reviewed Rust/license/SBOM materials to each actual candidate channel with explicit coordinated metadata changes; this is a documented addition to notice content, not adding the launcher to npm. | | SBOM, checksum and signing | GoReleaser defines archive SBOMs and cosign checksum signature/certificate | Cargo build-input SPDX is one ingredient; compose frontend, copied Go data, toolchain/system/native payload identities and bind both binary/archive hashes. Check schema and unpacked contents, then separately sign only when authorized. No signature/publication performed. | | Credentials and publishing | Go before-hooks run outside explicit publish credentials | The GoReleaser publish step still builds within the credential-bearing process after `--skip=before`. Do not transplant this as Rust build/publish separation: uncredentialed build/package job must hand immutable hash-verified artifacts to publish-only job, with no dependency or build lifecycle execution there. | An offline lock-wide audit verified all 316 archive checksums and corresponding extracted sources. 308 packages had discoverable license/notice texts; eight had no such files in their packaged sources: `jni 0.22.4`, `jni-macros 0.22.4`, `jni-sys-macros 0.4.1`, `r-efi 5.3.0` / `6.0.0`, `rustls-platform-verifier-android 0.2.0`, and both `winapi-*-pc-windows-gnu 0.4.0` packages. This is **lock-wide source inspection**, not proof these packages build on any of the four supported targets. The collector selects observed IDs to avoid treating unrelated Android/UEFI/GNU rows as compiled MSVC/Linux/macOS inputs. Missing evidence for an observed package stays a failure. The matrix records the 2026-10-05 source review. The formal orchestration above addresses source wiring and immutable handoff; its existence does not establish hosted build, signed distribution, channel publication, installation or native acceptance. Retain those receipts separately rather than treating this historical gap inventory or collector success as release approval.