diff --git a/CHANGELOG.md b/CHANGELOG.md index 78fb2cfbd..babb3b0e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,100 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] -Fixes from the [2026-11-02 audit](docs/audits/comprehensive-audit-2026-11-02.md) -([remediation plan](docs/plans/audit-remediation-2026-11/plan.md)). - -### Security - -- The desktop keeps every renderer on the bundled app: child windows, - off-app navigation, webviews and browser permissions are denied, links open - in the system browser, and every IPC handler checks its sender. Packaged - builds ignore `--dev`, `--debug` and `PUMAS_RPC_BINARY`, ship no DevTools, - source maps or declarations, and the shipped CSP drops loopback - `connect-src`. -- The desktop launches the backend on port 0 with a fresh launch nonce and - accepts only its own nonce-bound readiness; the backend exits when the - desktop dies (`--exit-on-stdin-eof`). -- Owned runtime children start from an environment allowlist; `LD_PRELOAD`, - `PYTHONPATH`, credentials and the inherited `LD_LIBRARY_PATH` are no longer - passed. -- Legacy runtime stops and running checks act only on processes whose PID - identity record matches the live process; a command-line sweep and bare or - reused PIDs are never signalled. -- Ollama installs only from publisher-SHA-256-verified archives; Torch - installs only from a validated per-install hash lock - (`--require-hashes --no-deps`); dependency installs never use the `python3` - on PATH; version tags that escape their directory are refused. -- Managed Torch sidecars require a per-backend token and confine model loads - to the library's roots. The token is sent only to a sidecar this backend - launched and is currently running; a caller-named Torch `connection_url` or - any other server never receives it. Loopback provider traffic never uses a - proxy and provider clients follow no redirects. -- Credential-less `http://` artifact sources on a network host are fetched - over `https` first and fall back to the plaintext URL, with a logged - warning, only when the HTTPS attempt gets no HTTP response. Loopback - sources are unchanged and credentialed plaintext stays refused. -- Public error redaction handles control characters, labelled values, JSON - pairs and `Basic` credentials. The HF token is written atomically with mode - 0600 and `registry.db` is owner-only on Unix. -- `pumas-rpc` bounds open connections (30 s request head, 256 connections) - and serves with no plugins instead of loading them from a shared temp - directory. -- Release builds scan dependencies (`cargo-deny`, `pnpm audit`, `pip-audit`): - advisory on pull requests, blocking for tags and candidates. - -### Changed - -- Rejections carry reasons: typed RPC refusals name the offending field, - pre-handler HTTP refusals return `{"error":{"code","message"}}`, - `request_limit` refusals name the bound, gateway and IPC capacity refusals - say what failed. -- Additive wire fields: `stop_ollama`/`stop_torch` report `skipped` processes - with reasons; `health_check` echoes `launch_nonce`; Hugging Face search rows - carry `observedAt` and `cached`; ONNX embedding descriptors advertise the - model's `input_tokens` limit and image capabilities their decode bounds; - `preview_torch_runtime` accepts `verified_versions` to install a verified - combination's recorded versions. -- The desktop decodes credential, import, delete, runtime-profile, serving, - HF search and status pull traffic with Rust-exported contracts, restarts a - backend that fails three health checks, and reports update-stream loss. -- The renderer shows load failures, cache age and recovery reasons instead of - silent defaults, and backs off installation polling on transport failures. -- The `hf-client` and `gpu-monitor` features gate behavior; ONNX work runs off - the async executor and derives its token limit from the model config. -- Model index records its schema version and refuses unknown ones; - versions metadata changes under one write lock; review edits whose - `metadata.json` write was interrupted are replayed. -- `OllamaClient::new` and `VersionManager::version_path` return `Result`. -- Updated `tokio` to 1.54.1 (with `mio`, `socket2`, `tokio-macros`), `zstd` - to 0.13.4, `zstd-safe` to 7.4.0 and `ctutils` to 0.4.8, clearing - RUSTSEC-2026-0385, -0386 and -0391 to -0406. - -### Removed - -- `network::DownloadManager` and `DownloadProgress`, `NetworkManager::execute` - and `CacheStrategy`'s `allow_stale_on_offline`/`max_stale_age`. -- `OllamaVersionManager`, `ProcessManagerFactory` and the app-manager - `process` module. -- Dead renderer modules, the superseded 0.7.0 and 0.8.0-rc.1 attribution - sets, and the flake8 configuration. - -### Fixed - -- Orphaned Hugging Face downloads resume under their recorded commit; repo - IDs are validated on every metadata read; a corrupt tree cache is refetched; - unbounded retry settings are refused. -- Model and package-facts removals commit with their update events; search - setup is atomic; corrupt rows and search failures surface as errors. -- The legacy JSON writer syncs its directory and backup. -- The Torch sidecar stays responsive during generation and refuses unsafe work - with reasons; externally referenced models stay loadable by Torch. -- The local HTTP consumer ships the capability-descriptor schema it pins. - -## [0.8.0] - 2026-11-04 +## [0.8.0] - 2026-11-06 See the [release notes](docs/release-notes-0.8.0.md) for upgrade steps, -downloads and known limitations. +downloads and known limitations. This release also includes the fixes from +the 2026-11-02 audit +([remediation plan](docs/plans/audit-remediation-2026-11/plan.md)). ### Added @@ -181,8 +93,45 @@ downloads and known limitations. - Desktop update streams (model library, downloads, runtime profiles, serving status and status telemetry) are validated against the backend's declaration. A rejected desktop payload says which field and rule failed. -- Updated Electron to 43.8.1, Vite to 6.4.5, undici to 6.29.1 and 7.30.1, - `zip` to 2.6.1, `rustls` to 0.23.46 and `rand` to 0.10. +- Updated Electron to 43.8.1, Vite to 8.3.5, `lucide-react` to 1.67, undici + to 6.29.1 and 7.30.1, `rusqlite` to 0.41, `rustls` to 0.23.46, `nix` to + 0.31, `windows-sys` to 0.61, `base64` to 0.23 and `rand` to 0.10. +- Rejections carry reasons: typed RPC refusals name the offending field, + pre-handler HTTP refusals return `{"error":{"code","message"}}`, + `request_limit` refusals name the bound, gateway and IPC capacity refusals + say what failed. +- Additive wire fields: `stop_ollama`/`stop_torch` report `skipped` processes + with reasons; `health_check` echoes `launch_nonce`; Hugging Face search rows + carry `observedAt` and `cached`; ONNX embedding descriptors advertise the + model's `input_tokens` limit and image capabilities their decode bounds; + `preview_torch_runtime` accepts `verified_versions` to install a verified + combination's recorded versions. +- The desktop decodes credential, import, delete, runtime-profile, serving, + HF search and status pull traffic with Rust-exported contracts, restarts a + backend that fails three health checks, and reports update-stream loss. +- The renderer shows load failures, cache age and recovery reasons instead of + silent defaults, and backs off installation polling on transport failures. +- The `hf-client` and `gpu-monitor` features gate behavior; ONNX work runs off + the async executor and derives its token limit from the model config. +- Model index records its schema version and refuses unknown ones; + versions metadata changes under one write lock; review edits whose + `metadata.json` write was interrupted are replayed. +- `OllamaClient::new` and `VersionManager::version_path` return `Result`. +- Updated `tokio` to 1.54.1 (with `mio`, `socket2`, `tokio-macros`), `zstd` + to 0.13.4, `zstd-safe` to 7.4.0 and `ctutils` to 0.4.8, clearing + RUSTSEC-2026-0385, -0386 and -0391 to -0406. +- The generated desktop contract is one shared workspace package + (`packages/desktop-contract`) instead of identical copies in the Electron + and frontend trees; the packaged app still bundles it into the preload. + +### Removed + +- `network::DownloadManager` and `DownloadProgress`, `NetworkManager::execute` + and `CacheStrategy`'s `allow_stale_on_offline`/`max_stale_age`. +- `OllamaVersionManager`, `ProcessManagerFactory` and the app-manager + `process` module. +- Dead renderer modules, the superseded 0.7.0 and 0.8.0-rc.1 attribution + sets, and the flake8 configuration. ### Fixed @@ -226,14 +175,64 @@ downloads and known limitations. cached list at once and refreshes it in the background, instead of waiting for GitHub. The new-version indicator compares the newest stable release, not whichever release GitHub lists first (for llama.cpp, a pre-release build). +- Orphaned Hugging Face downloads resume under their recorded commit; repo + IDs are validated on every metadata read; a corrupt tree cache is refetched; + unbounded retry settings are refused. +- Model and package-facts removals commit with their update events; search + setup is atomic; corrupt rows and search failures surface as errors. +- The legacy JSON writer syncs its directory and backup. +- The Torch sidecar stays responsive during generation and refuses unsafe work + with reasons; externally referenced models stay loadable by Torch. +- The local HTTP consumer ships the capability-descriptor schema it pins. ### Security +- The desktop keeps every renderer on the bundled app: child windows, + off-app navigation, webviews and browser permissions are denied, links open + in the system browser, and every IPC handler checks its sender. Packaged + builds ignore `--dev`, `--debug` and `PUMAS_RPC_BINARY`, ship no DevTools, + source maps or declarations, and the shipped CSP drops loopback + `connect-src`. +- The desktop launches the backend on port 0 with a fresh launch nonce and + accepts only its own nonce-bound readiness; the backend exits when the + desktop dies (`--exit-on-stdin-eof`). +- Owned runtime children start from an environment allowlist; `LD_PRELOAD`, + `PYTHONPATH`, credentials and the inherited `LD_LIBRARY_PATH` are no longer + passed. +- Legacy runtime stops and running checks act only on processes whose PID + identity record matches the live process; a command-line sweep and bare or + reused PIDs are never signalled. +- Ollama installs only from publisher-SHA-256-verified archives; Torch + installs only from a validated per-install hash lock + (`--require-hashes --no-deps`); dependency installs never use the `python3` + on PATH; version tags that escape their directory are refused. +- Managed Torch sidecars require a per-backend token and confine model loads + to the library's roots. The token is sent only to a sidecar this backend + launched and is currently running; a caller-named Torch `connection_url` or + any other server never receives it. Loopback provider traffic never uses a + proxy and provider clients follow no redirects. +- Credential-less `http://` artifact sources on a network host are fetched + over `https` first and fall back to the plaintext URL, with a logged + warning, only when the HTTPS attempt gets no HTTP response. Loopback + sources are unchanged and credentialed plaintext stays refused. +- Public error redaction handles control characters, labelled values, JSON + pairs and `Basic` credentials. The HF token is written atomically with mode + 0600 and `registry.db` is owner-only on Unix. +- `pumas-rpc` bounds open connections (30 s request head, 256 connections) + and serves with no plugins instead of loading them from a shared temp + directory. +- Release builds scan dependencies (`cargo-deny`, `pnpm audit`, `pip-audit`): + advisory on pull requests, blocking for tags and candidates. - Managed runtime ZIP archives are read with `zip` 9.4, which fixes GHSA advisories for symlink-target exhaustion, AES HMAC bypass and dual-header parser differentials. An Ollama ZIP entry whose path would leave the install directory now rejects the archive instead of being written outside it. +- The development `torch-server/requirements.txt` floors for torch, + transformers, fastapi and accelerate are raised past known advisories + (development input only; not shipped). The Pantograph guard interop + harness, whose vendored dependency lock carried zip and PyO3 advisories, + is removed; its Pumas-side checks are covered by core tests. ## [0.7.0] - 2026-09-17 diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 62657c29b..5f465b61b 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -49,7 +49,7 @@ through the same builder/API and restricted local IPC dispatcher. It supports indexed list/get/literal-search observations and same-boot, exact-checkpoint cold reopen using the existing physical lease. It admits no acquisition, child/service launch or external HTTP owner. Full/legacy/unknown histories remain refused; see -the [restricted custody contract](plans/operating-owner-custody-design.md). +the [restricted custody contract](contracts/restricted-owner-custody.md). On Linux/macOS the existing owner also holds the physical launcher directory across independent rendezvous registries and symlink aliases. The lifetime is @@ -58,7 +58,7 @@ blocking effects. After `shutdown_instance`, drop the API and those handles before starting a new owner. This strengthens live exclusion only: unknown or failed registry generations are still refused, and a free lock does not qualify recovery from crashed owners or external runtime children. See the -[discovery plan](plans/local-discovery-bootstrap.md#slice-3-durable-identity-and-qualified-lifetime-custody) +[local discovery contract](contracts/local-discovery-bootstrap.md#slice-3-durable-identity-and-qualified-lifetime-custody) for the remaining physical-identity and child-custody gates. An embedding application or standalone RPC process constructs the owner; in @@ -218,8 +218,8 @@ build. ## Known Boundary Work -The [current standards audit](audits/current-standards-2026-09-03/README.md) -tracks gaps in RPC authentication/decoding, persistence atomicity and migration, +The [current-standards remediation issues](plans/current-standards-remediation-2026-09-03/issues.md) +track gaps in RPC authentication/decoding, persistence atomicity and migration, async shutdown, cached-state provenance, release evidence, accessibility, and binding support. Those findings supersede optimistic claims in removed plans or older documentation. diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index 948c1b3dd..ed3ad988f 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -262,7 +262,8 @@ snapshots and must name their code and standards baselines. ## Retained-download recovery qualification The [contract](contracts/download-location-reconciliation.md) owns local acceptance; -[the runbook](runbooks/download-location-reconciliation.md) describes the user action. +[Opening an older library](library-upgrade.md#recover-a-failed-download-whose-files-moved) +describes the user action. Run `cargo test --locked --manifest-path rust/Cargo.toml -p pumas-library retained_location` with default features and `--no-default-features`. The native CI matrix runs both. `scripts/acceptance/download_location_reconciliation.py RPC --temporary-parent PATH` diff --git a/docs/README.md b/docs/README.md index 2f053796c..0960def85 100644 --- a/docs/README.md +++ b/docs/README.md @@ -25,11 +25,12 @@ Consumer-facing contracts: - [Model operations v1](contracts/model-operations-v1.md) and [model lookup v1](contracts/model-lookup-v1.md) - [Image-to-text](contracts/image-to-text-v0.8.md), [image generation](contracts/image-generation.md) and [generation lifetime](contracts/generation-lifetime.md) -- [Local HTTP consumer](contracts/local-http-consumer.md), [admission fence](contracts/local-http-admission-fence.md), [owner retention](contracts/local-owner-retention.md), [start authority](contracts/local-start-authority.md) and [inference-enabled bootstrap](contracts/inference-enabled-bootstrap.md) +- [Local HTTP consumer](contracts/local-http-consumer.md), [admission fence](contracts/local-http-admission-fence.md), [owner retention](contracts/local-owner-retention.md), [start authority](contracts/local-start-authority.md), [inference-enabled bootstrap](contracts/inference-enabled-bootstrap.md) and [local discovery and bootstrap](contracts/local-discovery-bootstrap.md) Internal boundaries: - [Artifact acquisition](contracts/artifact-acquisition.md), [Hugging Face model-detail cache](contracts/hf-model-detail-cache.md) and [retained download reconciliation](contracts/download-location-reconciliation.md) +- [Restricted catalog/query owner custody](contracts/restricted-owner-custody.md) - [Torch provider protocol](contracts/torch-provider-protocol.md) - Audio: [custody foundation](contracts/audio-custody-foundation.md), [owned transport](contracts/owned-audio-transport.md), [owned lifecycle](contracts/owned-audio-lifecycle.md), [installed constructor](contracts/installed-audio-constructor.md), [installed session](contracts/installed-audio-session.md), [Cohere qualification](contracts/cohere-native-qualification.md) and [Cohere cohort](contracts/cohere-native-cohort.md) - [Image-to-text native qualification](contracts/image-to-text-native-qualification.md) @@ -44,18 +45,12 @@ acquisition plan (`contracts/*.json`). - [ADR 0003: Explicit local acceptance of moved legacy download outputs](adr/0003-download-location-reconciliation.md) - [ADR 0004: A model's category is metadata chosen by use](adr/0004-model-category-as-metadata.md) -## Runbooks +## Past Audits -- [Recover a failed download whose files moved](runbooks/download-location-reconciliation.md) - -## Point-in-Time Audits and Investigations - -- [2026-09-03 current-standards audit](audits/current-standards-2026-09-03/README.md) -- [2026-11-02 comprehensive audit](audits/comprehensive-audit-2026-11-02.md), re-verified against `b091ac45` -- [Download destination and model catalog investigation (2026-10-10)](investigations/download-path-discrepancy-2026-10-10.md) - -Audits and investigations describe the named repository and standards commits. -They are evidence and remediation inputs, not current operating instructions. +Past audits (2026-09-03 current standards, 2026-11-02 comprehensive) and +investigations are dated evidence, not operating instructions; they are kept in +Git history (`git log -- docs/audits docs/investigations`). Open findings live +in the plans below. ## Release Evidence @@ -63,8 +58,6 @@ They are evidence and remediation inputs, not current operating instructions. [S3 profile](release-attribution/0.8.0-s3/README.md): the third-party notices and inventories that packages embed, checked by `scripts/release/check-attribution.cjs` -- [0.7.0 ONNX archive verification](release-evidence/0.7.0/onnx-archive-verification.json): - point-in-time evidence for the 0.7.0 ONNX Runtime archive Vulnerability results are not kept in the tree: each CI run produces the `current-vulnerability-results` artifact (see [Security](SECURITY.md#dependency-scans)). @@ -92,7 +85,6 @@ there. These hold open acceptance gates: - [Torch cross-platform runtime management](plans/torch-cross-platform-runtime-management/plan.md) — packaged and Windows/macOS install gates open; the managed-Python license blocker is open - [2026-09-03 current-standards remediation program](plans/current-standards-remediation-2026-09-03/plan.md) — open issues not yet re-verified against 0.8.0. Its focused plans: [Rust library and RPC](plans/current-standards-remediation-2026-09-03/rust-library-and-rpc/plan.md), [frontend and UI](plans/current-standards-remediation-2026-09-03/frontend-and-ui/plan.md), [desktop, release, bindings and Torch](plans/current-standards-remediation-2026-09-03/desktop-release-bindings-and-torch/plan.md) and [governance and verification](plans/current-standards-remediation-2026-09-03/governance-and-verification/plan.md) (accepted) - [Hugging Face discovery cache readiness](plans/hf-discovery-cache/readiness.md) — deferred checklist for the shared cache -- Design records still linked as current: [operating owner custody](plans/operating-owner-custody-design.md) and [local discovery bootstrap](plans/local-discovery-bootstrap.md) An implementation invocation must name the exact focused `plan.md` and an explicit `start`, `continue`, or `verify` operation. Plans remain temporary diff --git a/docs/SECURITY.md b/docs/SECURITY.md index b0e344fad..f85619189 100644 --- a/docs/SECURITY.md +++ b/docs/SECURITY.md @@ -240,4 +240,4 @@ review: `axum` 0.7, `rusqlite` 0.32, `sysinfo` 0.32, `notify` 7, `governor` 0.7, ## Current Security Work Open security and boundary findings are tracked in the -[current standards audit](audits/current-standards-2026-09-03/README.md). +[current-standards remediation issues](plans/current-standards-remediation-2026-09-03/issues.md). diff --git a/docs/audits/comprehensive-audit-2026-11-02.md b/docs/audits/comprehensive-audit-2026-11-02.md deleted file mode 100644 index 233d81fe7..000000000 --- a/docs/audits/comprehensive-audit-2026-11-02.md +++ /dev/null @@ -1,244 +0,0 @@ -# Comprehensive Audit — 2026-11-02 - -## Baseline and method - -- Branch `feat/v080-consumer-api`. The audit began at `1b1438ec` (manifests `0.8.0-rc.1`). - Three commits landed during the audit: `79fd6c51` (native QA tests), `8d03e4da` - (llama.cpp pooled batch sizing in `runtime_profiles.rs`), `b1196838` (version - set to `0.8.0`, attribution regenerated under `docs/release-attribution/0.8.0`). - Line numbers below refer to the start commit; only `runtime_profiles.rs` and - `acquisition/workspace.rs` moved materially. -- Static review only. Nothing was built, compiled, type-checked, linted, tested - or installed. No source, test, config or lockfile was changed; this file is the - only addition and is untracked. -- Nine parallel area reviews (core persistence; HF acquisition and S3; runtime, - process and IPC; `pumas-rpc`; `pumas-app-manager`; Electron; React frontend; - `torch-server`; CI, release, dependencies, docs and hygiene). Every High - finding was independently re-verified against the source by the coordinating - reviewer. Confidence is marked CONFIRMED (code path traced) or SUSPECTED. -- Not performed: `cargo audit`, `cargo deny`, `pip-audit` (not installed); - an OSV batch query over all three lockfiles (1,285 package-versions) returned - matches but the per-advisory detail fetch was interrupted and the rerun and - `pnpm audit` were cancelled by the owner. This audit therefore carries **no - vulnerability inventory**; see GOV-02. -- Severity follows the repository's own scale (Critical / High / Medium / Low). - -| Area | Approx. lines | Notes | -| --- | --- | --- | -| `pumas-core` | 251K | `hf/download.rs` 23.9K (70% tests), `library.rs` 15.1K | -| `pumas-rpc` | 54K | `contract.rs` 9.1K | -| `pumas-app-manager` | 34K | | -| `pumas-uniffi` + `pumas-rustler` | 2.3K | experimental bindings | -| Electron | 56K | includes 2.2MB generated validators | -| Frontend | 102K | 139 test files, 752 cases | -| `torch-server` | 20K | 354 tests | -| Scripts / CI | 22K + 1,043-line workflow | | - -Static counters: TypeScript has 0 `any`, 0 `eslint-disable`, 0 `ts-ignore`, -0 `console.log`; Rust has 83 `unsafe` expressions in 13 opted-in files (0 found -unsound; 24 undocumented, see RT-05/APM-08), ~2,500 `unwrap` and ~315 `expect` -in non-test paths (none found on raw network or on-disk input; several are -test-injection hooks compiled into production modules); 7 module-level -`#![allow(dead_code)]` all in the audio runtime; no secrets in tracked files. - -## Verdict - -Pumas Library is **strong inside each process and still exposed at four -boundaries**. Since the September standards audit, the team closed launcher-root -durability, the launcher kill chain, the old line-count standards, the credential -logging path in Rust, most async ownership, and the dialog/popover accessibility -primitives. The acquisition pipeline (HF, S3, llama.cpp) is now a model of -verify-before-trust. - -What remains is concentrated: (1) the Electron window-creation boundary is -unguarded while the renderer opens metadata-controlled links in-app; (2) legacy -process control kills by command-line substring and trusts PID files; (3) the -Ollama runtime is downloaded, cached and executed with no integrity check while -the llama.cpp path beside it is exemplary; (4) model deletion and the governance -table rebuild are not atomic in SQLite; (5) the Torch text path blocks the event -loop and the sidecar is launched unauthenticated and unconfined; (6) the release -has no vulnerability or license evidence producer and an inert dependency -override block. None of these is Critical by the repository scale, but ELE-01 -is one user click away from handing a remote page the full privileged API and -should be fixed before 0.8.0 ships. - -Prior findings: 4 closed, 3 largely closed, 7 partial, 1 open (table below). - -## High findings (8) - -| ID | Confidence | Finding | Evidence | -| --- | --- | --- | --- | -| **ELE-01 / FE-01** | CONFIRMED | **No `setWindowOpenHandler`, `will-navigate`, `will-redirect` or permission handler anywhere in Electron**, while the renderer renders `target="_blank"` anchors whose `href` comes from embedded GGUF/HF metadata and user notes, and calls `window.open` in four hooks. A child window inherits the opener's webPreferences including the preload; `api:call` has no sender validation (3 of 20 IPC channels check `senderFrame`). One click on a metadata-supplied link gives a remote page all 183 `window.electronAPI` members (178 RPC methods incl. `set_hf_token`, `delete_model_with_cascade`, `import_model`). | `electron/src/main.ts:276-293,520`; `frontend/src/components/ModelMetadataGrid.tsx:128-131`, `ModelNotesMarkdownPreview.tsx:39-44`, `model-import/ImportMetadataDetailsParts.tsx:118-121`, `ImportLookupCard.tsx:49-50`; `hooks/useInstallDialogLinks.ts:38-64`, `useModelLibraryActions.ts:77`, `HuggingFaceAuthDialog.tsx:210`. Safe path exists: `api.open_url` → `validateExternalUrl` (`ipc-validation.ts:330-342`). | -| **RT-01** | CONFIRMED | **Legacy stop kills unrelated processes by case-insensitive command-line substring** (`"ollama serve"`, `"serve.py"`) via `ps -eo pid=,args=`; every non-owned match gets SIGTERM→SIGKILL. Reachable from RPC `stop_ollama`/`stop_torch` and the desktop. A user's system Ollama, another project's `python serve.py`, or `vim serve.py` dies; a match owned by another user fails the whole stop. | `pumas-core/src/process/manager.rs:245,427,504-514`; `platform/process.rs:476-512`; `pumas-rpc/src/contract.rs:558-560`. | -| **RT-02** | CONFIRMED | **PID-file stops have no identity check**: `ollama.pid`/`torch.pid` persist across reboots; liveness is `kill(pid,0)`; a reused PID that leads a group gets `killpg`. | `process/manager.rs:225-228,408-411`; `process/launcher.rs:398-401`; `platform/process.rs:55-66,427-448`. | -| **PERS-01** | CONFIRMED | **Index `delete` commits the row removal and the durable update-feed event as two autocommits**; `upsert` correctly wraps both in one transaction. A crash in between leaves cursor-following consumers never learning of the removal (the CS-03 "row without event" case). Production path for model deletion. | `pumas-core/src/index/model_index.rs:813-835` vs `:423-435`; `model_library/library.rs:2900-2906`. | -| **PERS-02** | CONFIRMED | **Governance table rebuilds run RENAME→CREATE→INSERT→DROP via `execute_batch` with no BEGIN**. Crash after RENAME: next start creates an empty table, reseeds system rows, and user-authored rules sit orphaned in `*_legacy` with no error. Crash after CREATE: the marker text is present so the rebuild never re-runs. | `index/model_index/governance.rs:245-293,295-340`; `model_index.rs:297`. | -| **APM-01** | CONFIRMED | **Ollama runtime downloaded and extracted with no integrity check**: a cached archive is trusted when only its size matches, `download_archive` never hashes, the client is not `https_only`, and `finalize_ollama_binary` skips `validate_native_output` so `set_permissions(0o755)` can act through an archive-supplied symlink. llama.cpp beside it requires the publisher digest and goes through the verified acquisition workspace. | `pumas-app-manager/src/version_manager/installer.rs:1831-1856,2341-2406,2821-2857,3053-3144,3287-3452` vs `:1939-1954`. | -| **TS-01** | CONFIRMED | **Torch text inference runs synchronously on the asyncio loop**: `async def` handlers call `_generate` → `model.generate` inline, without the device lease. While a generation runs, `/health` (Rust liveness), the owned-generation disconnect poll and all control routes stall; CUDA OOM surfaces as a bare 500 with no reason or `empty_cache`. The image path already does this correctly. | `torch-server/openai_api.py:139-167,194-213`; `model_manager.py:518-528`. | -| **GOV-02** | CONFIRMED | **No vulnerability or license evidence producer exists**: `build.yml` has no audit/deny/pip-audit/SBOM step; `.github/` has no Dependabot config; the only evidence is `docs/release-evidence/0.7.0`; `RELEASING.md:347` points 0.8.0 readers to the 0.7.0 dependency review; `artifact-plan.json:517` requires `current-vulnerability-results` with nothing producing it. Combined with this audit's incomplete scan, 0.8.0 has no dependency-risk statement. | `.github/workflows/build.yml` (grep), `scripts/release/artifact-plan.json:517`, `RELEASING.md:347`. | - -## Medium findings (39) - -### Security boundary and trust - -- **TS-02** CONFIRMED — Torch model-path confinement is dormant: `PUMAS_TORCH_MODEL_ROOTS` is read only by `validation.py:46-47` and set nowhere in Rust/Electron/scripts, so `/api/load` accepts any existing path; `pipeline_path`, `vae_path`, `model_type` are unvalidated `Optional[str]` flowing into `from_pretrained`/`load_file` (`control_api.py:43-45`, `diffusion.py:93-114`, `flux2.py:84-110`). -- **TS-03** CONFIRMED — The sidecar runs unauthenticated: auth middleware installs only if `PUMAS_TORCH_API_TOKEN` is set and the launcher never sets it (`serve.py:66-67`; `pumas-core/src/runtime_profiles/launch_specs.rs:180-185` sets only offline/nousersite vars). Compare is constant-time and the token is never in argv, so a per-launch random token is cheap to add. -- **APM-03** CONFIRMED — RPC `install_version_dependencies` → `DependencyManager` runs PATH `python3 -m venv` before checking for `requirements.txt`, pip without `--require-hashes`/`--isolated`, and `version_path(tag)` is a bare `join`, so a `../x` tag escapes `-versions/` (`pumas-rpc/src/handlers/versions/deps.rs:18-26`; `version_manager/mod.rs:618-621,1550-1566`; `dependencies.rs:217-345`). -- **APM-02** CONFIRMED — Torch direct install records hashes after the fact: `resolve_runtime.py:1320-1343` runs pip with a mixed PyTorch+PyPI index set and no `--require-hashes`/`--no-deps`; staged files are compared by size only (`installer/torch.rs:1741-1797`). The retained-plan path does it right (`:2354-2371`). -- **APM-04** CONFIRMED — Exported but unwired `OllamaVersionManager::extract_zip` is zip-slip vulnerable (`ollama.rs:627-660`, no `enclosed_name()`, no hash). -- **RPC-03** CONFIRMED — Provider-facing reqwest clients honor `HTTP_PROXY`/`ALL_PROXY` (no `.no_proxy()`), so prompts and embeddings destined for 127.0.0.1 providers can route through a user proxy (`handlers/openai_gateway.rs:51-61`, `server.rs:730-742`, `model_operations/decision.rs:42-49`, `vision.rs:52-59`, `handlers/plugins.rs:54-57`). `owner_retention.rs:242` and pumas-core clients already use `.no_proxy()`. -- **RPC-04** SUSPECTED — CS-11 residual: default mode still substitutes `std::env::temp_dir()/pumas-plugins-fallback` when the configured plugin loader fails and loads every `*.json` from that world-writable path (`startup.rs:144-153`; `pumas-core/src/plugins/loader.rs:24-76`). The `unwrap` is gone; bootstrap mode fails closed. -- **ELE-05** CONFIRMED — CS-01 residual in Electron: every sidecar stdout/stderr chunk is persisted at `info` (`python-bridge.ts:550-564`, `main.ts:56`); `--dev/--debug` sets `RUST_LOG=debug`; `Invalid JSON response: ${data}` carries the raw body to the renderer (`python-bridge.ts:1063`). Safety now rests on Rust emitting nothing sensitive. -- **RT-09** SUSPECTED — Local IPC auth rests on registry DB file mode: UUID token in `registry.db` created under default umask, loopback TCP with no peer-credential check (`registry/library_registry.rs:163-171,687,895`; `ipc/server.rs:199,250`). -- **ACQ-01** CONFIRMED — `repo_id` is interpolated unvalidated into authenticated HF API URLs on read paths (`hf/metadata.rs:112-119,256-289`; `hf/bundles.rs:54-64`; `hf/search.rs:309-318`); `validate_hf_repo_id` is applied only on the download path. Same-origin injection only; host is constant. - -### Data integrity and persistence - -- **PERS-03** CONFIRMED — The main index has no explicit schema identity (`CREATE TABLE IF NOT EXISTS` + sqlite_master text sniffing, `governance.rs:191-243`, `fts5.rs:57-82`); unknown or newer schemas are accepted. The intent tables and download store refuse unknown schemas with reasons. -- **PERS-04** CONFIRMED — Package-facts cache mutations and events are separate autocommits (`package_facts_cache.rs:~60-131,~255-285`). -- **PERS-05** CONFIRMED — Corrupt JSON columns decode as empty/Null and present as valid models (`model_index.rs:1046-1055` `unwrap_or_default`), contradicting `list_all`'s stated behavior (`:790-792`); `strict_catalog_snapshot` does it correctly. -- **PERS-06** CONFIRMED — `MetadataManager` read-modify-write outside the lock (`metadata/manager.rs:288-355`). -- **PERS-07** CONFIRMED — Review edits span three independent commits (overlay tx, metadata.json, index row+event) (`library.rs:2358-2366,2407-2417`). -- **PERS-08** CONFIRMED — Legacy `atomic_write_json` lacks parent-directory fsync and plain-copies `.bak`; it writes model `metadata.json`, link registry, mapper, migration checkpoints and launcher metadata (`metadata/atomic.rs:982-1083`). The durable `AtomicJsonTarget` (used for downloads.json) already solves this. - -### Runtime, process and lifecycle - -- **RT-03** CONFIRMED — ONNX load and inference run synchronously inside `async fn` under one std Mutex; callers do not offload (`onnx_runtime/real_backend.rs:90-98,132-148`; `pumas-rpc/src/handlers/openai_gateway_onnx.rs:62-65`). -- **RT-04** CONFIRMED — Flat ONNX limits (`MAX_EMBEDDING_INPUTS=128`, 65,536 chars, 8,192 tokens/dims) never consult `max_position_embeddings`; over-length input fails as opaque "ONNX Runtime inference failed" (`onnx_runtime/mod.rs:37-40,360-399`; `tokenizer.rs:8,55,78-94`; `config.rs:41-55`). Violates "no flat limits / every rejection has a reason". -- **RT-05** CONFIRMED — Windows `ManagedChild` has a module-level `#[allow(unsafe_code)]` with 23 unsafe expressions and zero `SAFETY:` comments (`platform/managed_child.rs:596-598,639-850`). Traced sound. -- **RT-06** SUSPECTED — Linux/macOS owned children survive a parent crash (no PDEATHSIG/pidfd; Windows has a kill-on-close Job) and the leftover PID file then blocks relaunch (`managed_child.rs:165`; `runtime_profiles/process_owner.rs:900-908`). -- **TS-04** CONFIRMED — Image width/height have no upper bound; `MAX_PNG_BYTES` is checked after generation; admission never consults `mem_get_info` (`image_api.py:33,40-41,114`; `diffusion.py:31-44`). -- **TS-05** CONFIRMED — Text limits are flat constants (`INPUT_TEXT_MAX_CHARS=1_000_000`, `OUTPUT_TOKENS_MAX_ITEMS=4_096`) with no truncation against the model's positions (`openai_api.py:19-22,200`). - -### Contracts, decoding and reasons - -- **RPC-01** CONFIRMED — Pre-dispatch rejections return bare status codes with empty bodies: fence 400/503/412 (`discovery.rs:134-147,197`), shutdown 503 (`server.rs:723-725`), owner retention 501/428/400/503/412/429 (`owner_retention.rs:56-79`), transport 500/503 (`http_transport.rs:151-153`). Direct violation of the owner's rule that every rejection carries a reason. -- **RPC-02** CONFIRMED — Typed JSON-RPC admission maps every serde error to the fixed sentence "Request parameters are invalid." (`contract.rs:6977-7017`); S3 admission discards `validate()` detail (`s3_imports.rs:101-356`). Legacy handlers and model operations do name the field. -- **ELE-02** CONFIRMED — Generated response and stream validators are closed (`additionalProperties:false` on every DTO, `pumas-rpc/src/contract/export.rs:1809-1811`), so an additive backend field or enum value breaks the desktop until regeneration. Intentional and documented, but it conflicts with "additive = non-breaking" when `PUMAS_RPC_BINARY` lets a packaged desktop run a different backend (`backend-path.ts:19-22`). Owner decision needed. -- **ELE-03** CONFIRMED — CS-02 residual: of 178 allowlisted methods, 88 have request validation beyond "plain object" (31 Rust-generated, 47 hand-written, 15 empty-record) and 90 accept any object, including `set_hf_token`, `import_batch`, `import_model`, `torch_configure`, `delete_model_with_cascade`; ~88 responses return raw (`rpc-method-registry.ts:10-189,255-456`; `ipc-validation.ts:65-175`). -- **ELE-04** CONFIRMED — Four of five SSE streams report transport loss only to the main log; only serving-status has an error channel (`python-bridge.ts:270-291`; `main.ts:700-783`). -- **FE-02** CONFIRMED — Pull-path responses reach hooks undecoded while the matching push path is decoded: 88 plain `apiCall` vs 68 `validatedApiCall` in preload; `get_status_telemetry_snapshot`, `get_runtime_profiles_snapshot`, `get_serving_status`, `search_hf_models`, `get_network_status`, `get_library_status` are consumed typed (`preload.ts:294-730`; `statusTelemetryStore.ts:151-153`; `useRemoteModelSearch.ts:114`). -- **FE-03** CONFIRMED — Nine silent-default sites: `scanModels`/`searchModelsFTS` catch-and-log, APIError message dropped before "Library unavailable", startup download-list failure indistinguishable from empty, disk space 0% on failure (`useModels.ts:92-116,245-289`; `useModelDownloads.ts:109-111`; `useActiveModelDownload.ts:103-105`; `useDiskSpace.ts:16-33`; two app-panel sections). -- **FE-04** CONFIRMED — CS-05 residue: persisted snapshot has no `writtenAt`/revision, and every debounced refresh re-marks rows `cached` so star/actions flicker off (`modelLibrarySnapshot.ts:3-131`; `useModels.ts:60,262-274`; `LocalModelRowState.ts:168-173`). -- **FE-05** CONFIRMED — Tooltip primitive is hover-only, `role="tooltip"` without `aria-describedby`, no focus trigger; 14 usages (`ui/Tooltip.tsx:26-47`). -- **ACQ-02** CONFIRMED — Search results carry no freshness/provenance field; `CacheStrategy::allow_stale_on_offline` and `NetworkManager::fetch_with_cache` are latent stale-as-fresh paths with no production callers (`model_library/hf_cache.rs:422-506`; `network/manager.rs:380-446`). - -### Governance, release and dependencies - -- **GOV-01** CONFIRMED — Root `package.json:16-21` uses npm-style top-level `overrides`; pnpm reads only `pnpm.overrides`, the lockfile has no `overrides:` section and resolves `minimatch@10.2.6`/`brace-expansion@1.1.21` (not the pinned 10.2.5/1.1.18). The security-floor mechanism is inert; exposure is nil today because natural resolution is newer. (Downgraded from the area reviewer's High.) -- **GOV-03** CONFIRMED — Bindings claims contradict code and CI (CS-07): `docs/native-bindings.md:5-6` says "CI generates archives" but `build.yml` has no bindings job; `support-matrix.json` lists `removed_surfaces` for all seven surfaces yet all remain; `pumas-uniffi/src/lib.rs:4,13` still claims Go; 88 `uniffi` references and `uniffi::setup_scaffolding!()` remain in `pumas-core`; `generate-bindings.sh:66` runs an unpinned `cargo install` with no `set -e`. -- **GOV-04** CONFIRMED — Action pinning is inconsistent: `build.yml` uses mutable tags (`checkout@v6`, `setup-node@v6`, `rust-cache@v2`, `upload-artifact@v7.0.1`); `scorecard.yml` SHA-pins except `codeql-action/upload-sarif@v3`; actionlint and ORT downloads are hash-pinned. -- **GOV-05** CONFIRMED — Frontend library-only build runs only on tags and its `dist/` is immediately overwritten by the default build, with no artifact check (`build.yml:446-452`; CS-08 frontend half still open). -- **GOV-06** CONFIRMED — `DEVELOPMENT.md` verification inventory under-describes CI: `torch-quality` runs ~45 native cargo-test steps on 3 OSes per PR; `review-inference-linux`, `review-audio-dependencies`, S3 and attribution gates are absent from the table. -- **GOV-07** CONFIRMED — Docs index and plan lifecycle drift (CS-14): `docs/README.md` lists 2 of 3 ADRs and 4 of 17+16 plans; six terminal plans remain under `docs/plans/`; `docs/breif/` (misspelled) is unindexed; `docs/contracts/local-http-consumer.md:82` references `contracts/capability-descriptor.schema.json`, which is not tracked anywhere. -- **GOV-08** CONFIRMED — Python pin divergence: `build.yml:507,646` use floating `python-version: '3.14'` while `.python-version` is 3.12.3; `torch-server/requirements.txt` is `>=`-only and still the documented dev install; CI pip installs are unhashed. The shipped `runtime/requirements.lock` (66 packages, 939 hashes) is good; `SECURITY.md:56-57` saying it is "not reproducibly locked" is stale. -- **GOV-09** SUSPECTED — 19.7MB of 53.5MB tracked bytes are `docs/release-attribution`; the 0.7.0 directories (~9MB) have no consumer; four `command-logs.tar.gz`, a force-added `rpc.log` and 300KB+ ledgers sit in `docs/plans`. - -## Low findings (48, condensed) - -- **Electron**: ELE-06 orphan sidecar on hard crash, health failures only warn, no parent watchdog in pumas-rpc; ELE-07 model-download subscription counters not reset on window close (macOS leak); ELE-08 `PUMAS_RPC_BINARY` honored when packaged, port pre-allocated then released before spawn, readiness trusts any `{status:'ok'}`; ELE-09 DevTools reachable via default menu in production, CSP `connect-src http://127.0.0.1:*` broader than needed, dev-server origin bypasses the IPC allowlist in `--dev`; ELE-10 packaging ships `.map`/`.d.ts`, unsigned, no mac hardened runtime; ELE-11 launcher-root reason text dropped before the renderer. -- **Frontend**: FE-06 installation poll loop repeats every 800ms forever on transport failure; FE-07 library-only variant unverified beyond compile; FE-08 seven dead modules (`usePlugins.ts` with a 5s interval, `ResourceMonitor`, `StatusDisplay`, `SpringyToggle`, `GenericAppPanel`, `TorchServerConfigSection`, `config/theme.ts` which docs still cite) and no-op `mergeSnapshot`/`force` plumbing; FE-09 CSP informational. -- **torch-server**: TS-06 text loaders omit `use_safetensors=True` (mitigated by torch 2.9.1 `weights_only` default); TS-07 no parent-liveness watchdog, orphan cleanup is substring match (see RT-01); TS-08 control API echoes `str(error)` with resolved paths; TS-09 two request models lack `extra="forbid"`, `torch.cuda.synchronize` in `finally` masks the adapter error on non-CUDA; TS-10 CI never installs runtime deps or runs `tests_native`, no `pip-audit`; TS-11 `model_index.json` class pairs unvalidated under unvalidated `pipeline_path`. -- **Runtime**: RT-07 owned stops go straight to SIGKILL with no graceful phase (`linux_group.rs:94`); RT-08 IPC capacity rejection is a silent EOF, no idle timeout, 64-connection cap; RT-10 ORT dylib preflighted per load but `ort::init_from` is first-wins (TOCTOU on operator path); RT-11 legacy observer thread loops forever on persistent errors. -- **Persistence**: PERS-09 `search_fts5` masks failures as empty results; PERS-10 FTS setup drop/create/populate are separate autocommits; PERS-11 public legacy registry methods bypass the claim protocol (test-only callers); PERS-12 `ModelIndex::clear()` non-transactional (test-only); PERS-13 core errors embed raw launcher-root paths (redaction is RPC's job, per SECURITY.md). -- **App-manager**: APM-05 legacy process factory drops the `Child` (zombies), trusts PID files nothing writes, SIGKILL after fixed 500ms; APM-06 no cumulative size/entry bounds on extraction, zip preserves setuid bits; APM-07 Torch children inherit the full environment (`LD_PRELOAD`, `LD_LIBRARY_PATH`, `SSL_CERT_FILE`) while `managed_python.rs` already `env_clear`s; APM-08 one `unsafe { zeroed() }` without SAFETY (sound); APM-09 Ollama client embeds unbounded upstream bodies in errors, `expect` in constructor, no loopback check on `base_url`. -- **Acquisition**: ACQ-03 public legacy `network::DownloadManager` bypasses the acquisition contract (no callers); ACQ-04 HF token file written under default umask then chmod'd (non-atomic); ACQ-05 `HF_DOWNLOAD_MAX_RETRIES=0` plus `PUMAS_HF_DOWNLOAD_MAX_RETRY_ELAPSED_SECS=0` yields unbounded retry; ACQ-06 corrupt repo-tree JSON cache blocks downloads instead of refetching; ACQ-07 public `HuggingFaceClient::start_download` uses a Weak revision (cannot resume); ACQ-08 per-chunk double copy plus `spawn_blocking` per 16KiB chunk. -- **RPC**: RPC-05 no header-read/idle deadline (hyper builder has no timer, so the 30s default is silently dropped), unbounded connection JoinSet; RPC-06 non-generation gateway client follows redirects, router client reads unbounded bodies; RPC-07 legacy `/v1` gateway masks distinct failures as "unavailable" including the 32MiB bound; RPC-08 undeclared flat decode bounds (`MAX_TOTAL_IMAGE_BYTES`, `MAX_MESSAGES`, `MAX_PARTS`, decision image count, audio token range) not in the contract or `option_bounds`; RPC-09 `deny_unknown_fields` on 98 typed methods, none on 87 legacy; RPC-10 redaction tokenizes on ASCII space only (`token: X`, `"token":"X"`, tab-separated Bearer escape); RPC-11 External profile endpoints accept any http/https host while docs say LAN providers are unsupported; `RUST_LOG` is ignored and `--debug` enables DEBUG for every crate. -- **Governance / hygiene**: GOV-10 `persist-credentials: false` on 5 of 18 checkouts (token is read-only); GOV-11 dead `.flake8`, `.editorconfig` 88 vs ruff 100, `pre-commit-hooks v4.5.0`; GOV-12 three-line `CODE_OF_CONDUCT.md` with typos and no reporting path, LICENSE year 2025; GOV-13 `Z:\tmp\...\wine-home` hidden only by the `.cache/` ignore, empty `onnx-server/` with stale `__pycache__`, `scripts/README.md` omits `release/`, `tests/`, `consumers/`, `acceptance/`, 2.2MB validators tracked twice byte-identical (regeneration gated); GOV-14 `RELEASING.md:30` names a stale branch, `signtoolOptions.publisherName` dead with `CSC_IDENTITY_AUTO_DISCOVERY=false`. Dependency currency lags on several crates with no stated pin policy: axum 0.7, rusqlite 0.32, sysinfo 0.32, notify 7, uniffi 0.28, rustler 0.34, governor 0.7, zip 2, dirs 5; three `rand` majors and five `windows-sys` versions in the lock. - -## Prior audit (2026-09-03) status - -| ID | Status | Evidence | -| --- | --- | --- | -| CS-01 secrets in logs | Largely closed | Rust: handlers log only method label/outcome class, `AdmittedRpcRequest` has no Debug, `SecretToken` newtype, `public_reason` on every message; acquisition passes the token only as a header, redirects strip it (`reqwest 0.12.28 redirect.rs:239-251`), `https_only`. Open: ELE-05, RPC-10, ACQ-04. | -| CS-02 RPC trust boundary | Partial | LAN refused incl. `localhost` (`server.rs:66-79`); Host/Origin/duplicate/Sec-Fetch-Site admission outermost (`http_admission.rs`). 98 typed / 87 legacy methods in Rust; 88 of 178 validated in Electron. No caller auth, by documented design. ELE-03, RPC-09. | -| CS-03 persistence atomicity | Partial | `upsert`, `replace_model_id_with_expectation`, publication projections, dependency bindings and intent schema install are transactional. Open: PERS-01, 02, 03, 04, 07; remediation plan Milestone 3 still `Planned`. | -| CS-04 async lifecycle | Largely closed | `RuntimeTasks` with abort handles, panic capture, drain and ordered tail; acquisition task custody; Electron RPC ack → grace → SIGTERM → SIGKILL ladder with ~60 tests; frontend installation lifecycle. Open: TS-01, RT-03, ELE-07, FE-06. | -| CS-05 snapshot provenance | Partial | Scope-bound snapshot, per-model `cached` flag, `role="alert"` degraded notice, HF cache requires `observed_at/freshness`. Open: FE-04, FE-02, ACQ-02. | -| CS-06 release evidence | Partial | `artifact-plan.json` + `check-artifacts.mjs` (16 artifacts), SPDX 2.3 + in-toto, checksums; hash-locked Torch recipe. Open: GOV-02, GOV-08, APM-01/02 (no in-repo pins for Ollama or Torch dependency closure). | -| CS-07 bindings claims | Partial | README hedged, matrix declares zero host tuples. Open: GOV-03. | -| CS-08 build configurations | Open | `hf-client`/`gpu-monitor` features gate nothing; `process-manager` only toggles a builder default; `build_info.rs` reports all three (RT). Frontend library-only ungated (GOV-05). Rust dependency-feature graph is guarded by `check-dependency-features.py`. | -| CS-09 accessibility | Largely closed | `ui/ModalDialog.tsx` and `ui/Popover.tsx` own role/aria-modal/focus trap/Escape/restore; all 9 dialogs and 30 files use them; progress has valuenow and live regions. Open: FE-05, two progress rings with no aria. | -| CS-10 old standards | Closed | No max-lines, no README-coverage script, `DEVELOPMENT.md:27-28`. | -| CS-11 plugin fallback | Partial | `unwrap` removed, bootstrap fails closed. Open: RPC-04. | -| CS-12 launcher-root durability | Closed | Tri-state absent/invalid/unavailable; `wx` 0o600 temp + fsync + rename + parent fsync; torn-write tests (`launcher-root.ts:155-174,253-270,356-449,523-556`). | -| CS-13 `check:errors` gate | Closed | Retired with recorded disposition. | -| CS-14 doc authority | Partial | Stale RPC method doc and SYSTEM_ARCHITECTURE removed; all plans have status lines. Open: GOV-07. | -| CS-15 launcher platform/kill | Closed | Exit 5 on unknown platform; SIGTERM grace → SIGKILL → forced-close deadline; bounded `taskkill`. | - -## Owner API rules (stated 2026-11-02) - -| Rule | Result | Evidence | -| --- | --- | --- | -| Every rejection carries a human-readable reason | **Fail** | RPC-01 (14 bare-status sites), RPC-02 (generic "Request parameters are invalid."), RPC-07, RT-04, TS-01/TS-05 (OOM/oversize as bare 500), RT-08 (IPC silent EOF). The typed model-operations lane itself passes. | -| Additive changes never break consumers | Pass in Rust, conflict in desktop | `supported_contract_versions` advertised, response types tolerate unknown fields, `unsupported_contract` with reason. Desktop validators are closed (ELE-02); owner decision needed on open responses vs. backend-hash pinning. | -| No flat model-agnostic limits | Pass with exceptions | llama.cpp `text_bounds` derive from served context, `max_tokens` never capped server-side, llama.cpp batch derived from GGUF/context. Exceptions: RT-04 (ONNX), TS-04/TS-05 (Torch), RPC-08 (undeclared decode bounds). | -| Consumers discover models via Pumas; `/v1/served-models` lists profiles and capabilities without duplicate IDs | Pass | Sort + `dedup_by` on (alias, profile), `profile_required` from alias counts (`model_operations.rs:117-169`); `/v1/models` one ID with `profiles`. | -| Secrets never in logs/errors | Pass in Rust | 0 log sites emit request params; 0 Debug derives on token-holding types. Electron residual ELE-05. | - -## Strengths worth keeping - -- **Acquisition pipeline**: RFC 9110-tight range/conditional handling, identity bound before and after hashing, no overwrite of unverified files, signed-URL identity allowlist, `https_only`, token stripped on cross-host redirect, warm checkpoints bounded, S3 reader with SDK-owned signing and bounded XML/pagination. -- **llama.cpp installer, uv bootstrap and audio cohort**: publisher digest required, verify-before-extract, symlink/special-file rejection, stage → fsync → rename publish with receipts, `env_clear` with transport allowlist, fixed .deb recipe with exact lengths. -- **Linux audio confinement**: Landlock ABI≥6 + seccomp, every unsafe block documented, fail-closed arch gating, opt-in kernel-enforcement test in CI. -- **Non-reaping process custody**: `waitid(WNOWAIT)` pins PID/PGID until `/proc` proves drain; Windows children created suspended and assigned to a kill-on-close Job before their first instruction. -- **Capability-based path authority**: `O_NOFOLLOW|O_DIRECTORY` walks, `RENAME_NOREPLACE`/`RENAME_EXCL`/`ReplaceIfExists` non-replacing renames, identity rechecked around every unlink; no `remove_dir_all` on derived paths. -- **Durable JSON publisher** for downloads.json with explicit `Durable / PublishedDurabilityUnknown / VisibilityUnknown` outcomes and duplicate-key refusal; download-store schema refusal with named backups. -- **RPC transport**: handler tasks outlive lost callers, panics contained per task and reported in the shutdown receipt; generation lifetime implemented exactly; typed SSE decoder with 256KiB/32MiB bounds; provider results re-validated, never forwarded; no client headers reach providers. -- **Electron**: Rust-exported AJV-standalone contract pipeline with CI drift check; launcher-root tri-state recovery with atomic publish; `PythonBridge` shutdown receipts with ~60 lifecycle tests; S3 RPC path with non-pooled agent, 64KiB cap and static error text; sandboxed, context-isolated renderer with `script-src 'self'` enforced by test. -- **Frontend**: shared `ModalDialog`/`Popover` primitives with behavioral tests; sequence/generation guards in every async hook checked; optimistic download commands use transitional states with explicit rollback matrices; 0 `any`, 0 suppressions; conformance suite loads the real built preload against producer fixtures. -- **torch-server**: image generation lifecycle with step-checkpoint cancellation and lease custody; private owned channel with bounded frames and `-I -B -S` bootstrap refusing ambient imports; `trust_remote_code=False` + `local_files_only=True` at all 13 `from_pretrained` sites; hash-pinned uv lock with official wheel URLs. -- **CI**: `check-ci-release-gating.test.mjs` asserts workflow invariants (tag gating, `contents: read`, no publish verbs); ORT provisioning hashes a private snapshot before any member read; `--locked`/`--frozen-lockfile` everywhere; exact toolchain pins; `artifact-plan.json` as single source of truth with filename pinning tests. - -## Recommended order - -1. **ELE-01**: `setWindowOpenHandler` → deny + `shell.openExternal(validateExternalUrl(url))`; `will-navigate`/`will-redirect` deny non-app URLs; `setPermissionRequestHandler` deny; `validateSender` on every `ipcMain` handler; replace the four `target="_blank"` anchors with a shared `ExternalLink` over `api.open_url`; add a test asserting the handlers are installed. Ship before 0.8.0. -2. **RT-01 / RT-02 / TS-07**: delete the substring fallback; stop only children with proven custody; store boot-id + start-time (or canonical `/proc//exe` under the version dir) in PID files and refuse on mismatch; return "skipped: not owned" with a reason. -3. **APM-01**: route Ollama through `resolve_release_asset` + `acquire_http` like llama.cpp; run `validate_native_output`; drop the size-only cache check. Then APM-02 (`--require-hashes --no-deps` two-phase) and APM-03 (reject unsafe tags at the `VersionManager` boundary; gate or remove `DependencyManager`). -4. **PERS-01 / PERS-02 / PERS-04**: wrap delete and package-facts mutation+event in one transaction like `upsert`; `BEGIN IMMEDIATE` around each governance rebuild and refuse startup when a `*_legacy` table exists; then PERS-03 (schema marker row, refuse unknown) and PERS-08 (route legacy writers through `AtomicJsonTarget`). -5. **TS-01 / TS-02 / TS-03**: `asyncio.to_thread` + device lease + `StoppingCriteria` cancellation for text; launcher sets `PUMAS_TORCH_MODEL_ROOTS` and a per-launch `PUMAS_TORCH_API_TOKEN`; validate `pipeline_path`/`vae_path`/`model_type`; map OOM to 507 with reason and `empty_cache`. -6. **GOV-02 / GOV-01 / GOV-04**: add `cargo audit` or `cargo deny`, `pnpm audit`, `pip-audit -r torch-server/runtime/requirements.lock` (advisory on PR, blocking on tag, feeding `current-vulnerability-results`); commit `.github/dependabot.yml` for cargo, npm, pip and github-actions; move overrides to `pnpm.overrides` or delete them; SHA-pin actions. -7. **RPC-01 / RPC-02 / RPC-03**: one helper producing `{"error":{"code","message"}}` for the 14 bare-status sites; route serde messages through `public_reason`; `.no_proxy()` on every provider client. -8. **ELE-02 decision**, then ELE-03 (migrate the 90 shape-only methods to Rust-exported decoders), FE-02 (decode pull paths), FE-03 (surface the nine silent failures), FE-04 (snapshot `writtenAt`). -9. **RT-04 / TS-04 / TS-05 / RPC-08**: derive per-model token and pixel budgets from config/device and advertise them in capabilities; document the remaining decode-safety bounds. -10. **CS-08, GOV-03, GOV-07**: make `hf-client`/`gpu-monitor` gate code or remove the features; execute or retract the bindings removal list and correct `native-bindings.md`; fold terminal plans into ADRs, regenerate the docs index, rename `docs/breif`. - -## Appendix A: CI gate matrix (as read from `build.yml`) - -| Gate | PR | push main | tag / candidate dispatch | -| --- | --- | --- | --- | -| lint-workflows (actionlint, dep-ownership, release-versions, attribution ×2, release node tests, S3 provenance) | Y | Y | Y | -| `scripts/rust/check.sh` | Y | Y | Y | -| headless no-default core/RPC + S3 + audio confinement | Y | Y | Y (+ no-inference release build/smoke) | -| Frontend lint / check:types / test:run | Y | Y | Y | -| Frontend default build | – | – | Y | -| Frontend library-only build | – | – | Y (overwritten, unchecked) | -| Electron lint / validate / test + desktop-contract checks | Y | Y | Y | -| `test:launcher` | Y | Y | Y | -| torch-quality: ruff, unit, ~45 native cargo tests ×3 OS | Y | Y | Y | -| review-inference-linux (full inference candidate + synthetic ONNX) | Y | – | – | -| review-audio-dependencies | Y | – | – | -| torch-native-e2e ×3 OS; headless-rpc ×3; headless-inference ×3; build-rust; windows-release; build-electron ±no-inference; verify-launcher (Xvfb); release-candidate (inventory + SPDX + provenance + checksums) | – | – | Y | -| Vulnerability/license scan; bindings generation/host test; signing | never | never | never | - -Push-to-main runs strictly fewer gates than a PR. - -## Appendix B: runtime supply chain - -| Runtime | Source | Pin | Verified before extract | -| --- | --- | --- | --- | -| llama.cpp | github.com API + asset | GitHub publisher `digest`, required | Yes (`https_only`, acquisition workspace) | -| Ollama (`installer.rs`) | github.com | none | **No** (size only) | -| Ollama (`ollama.rs`, legacy, unwired) | github.com | none | **No**, zip-slip | -| uv bootstrap | releases.astral.sh | sha256 per target in `managed_python.rs` | Yes (40MB cap, re-verified on reuse) | -| CPython (python-build-standalone) | via uv | host/path prefix; hashes delegated to uv | Partial | -| Torch qualified recipe 2.9.1 Linux | download-r2.pytorch.org | `torch.rs` + `runtime/requirements.lock` | Yes (`--require-hashes --no-deps`) | -| Torch direct install (other builds) | pytorch + pythonhosted | torch wheel `#sha256` when found; deps unpinned | Partial (post-hoc report, size-only tree check) | -| Audio native cohort (14 .deb) | deb.debian.org | `recipe.json` size + sha256 | Yes | -| ONNX Runtime | in-process, provisioned by release scripts | `onnx-runtime-pins.json` URL + size + sha256 | Yes | - -## Appendix C: housekeeping observed, not changed - -- The temp volume (`/`) hit 0 bytes free while the reviews started; `/tmp/claude-1000` holds 5.9GB of session data. Nothing was deleted. -- Repository root contains ignored working state: `tmp/` (229 entries), `Z:\tmp\...\wine-home`, `.download-identity-repair.*`, `.download-store-cutover.*`, `.coverage`, `onnx-server/` with only `__pycache__`. -- `docs/breif/future.md` is untracked and unindexed. diff --git a/docs/audits/current-standards-2026-09-03/README.md b/docs/audits/current-standards-2026-09-03/README.md deleted file mode 100644 index 7e8d3bb63..000000000 --- a/docs/audits/current-standards-2026-09-03/README.md +++ /dev/null @@ -1,174 +0,0 @@ -# Current Standards Audit — 2026-09-03 - -## Verdict - -Pumas Library is **partially compliant and needs a staged standards refactor**. -It has a good local engineering baseline—strict TypeScript, broad unit coverage, -cross-platform builds, Rust unsafe defaults, Electron isolation, and shared -launcher checks—but those strengths do not yet establish trustworthy behavior -at several system boundaries. - -The audit found one critical issue: the generic RPC handler can write Hugging -Face credentials to debug logs. The main systemic gaps are incomplete RPC -decoding and authorization, non-atomic persistence/event updates, implicit -migration and async shutdown contracts, stale release/SBOM evidence, and user -interfaces that can present cached or inaccessible state as authoritative. - -This is an analysis artifact, not an implementation plan. No source, test, -configuration, generated artifact, or lockfile was changed by the audit. - -## Audit Baseline - -- Pumas commit: `a33c8c0efa7cd8783c7deeac9e608db205290d43` -- Standards commit: `52b096ded9c53afd439a3cf0efc4cc85252da570` -- Standards source: `/media/jeremy/OrangeCream/Linux Software/repos/owned/developer-tooling/Coding-Standards/` -- Inventory: 892 tracked files from - `scripts/dev/list-audit-files.sh --tracked-only` -- Inventory distribution: 328 Rust, 381 frontend, 21 Electron, 68 docs, 42 - scripts, and 52 other files - -The review routed through `CORE-STANDARDS.md`, `STANDARDS-ROUTER.md`, the -Planning, Documentation, Implementation, Verification, Tooling, Build, and -Release workflows, and the applicable architecture, contracts, accessibility, -security, concurrency, resilience, cross-platform, dependency, licensing, -diagnostics, performance, frontend, library, launcher, Rust, TypeScript, IPC, -persistence, interop, generated-contract, and language-binding owners. - -## Architecture and Code-Quality Assessment - -The intended architecture is sound: Rust owns the model library and durable -state, Electron is a privileged desktop boundary, React renders projections, -and optional inference providers sit behind explicit build/runtime seams. Local -code quality is generally strongest inside each process, where the type system, -focused modules, and unit tests can enforce invariants. - -The architecture becomes shallow at cross-process and release seams. Method -names, payload shapes, error meanings, update events, and binding claims are -partly duplicated across Rust, Electron, TypeScript, documentation, and CI. -Several adapters replace malformed or unavailable outcomes with empty/default -values, so consumers cannot reliably distinguish valid empty state from drift -or failure. Persistence similarly separates authoritative mutations from the -events that publish them. - -The next architectural work should deepen these seams around one authoritative -contract and explicit invalid/degraded outcomes. Large implementation files may -be candidates for later review, but their size is not the compliance problem. - -Severity means: - -- **Critical:** a present security, data-integrity, or release-integrity threat. -- **High:** an enforceable standards failure at an important boundary or an - absent proof that can permit incorrect behavior. -- **Medium:** material drift or weak evidence that should be corrected, but is - not presently shown to corrupt data or expose a critical boundary. -- **Improvement:** useful design work that is not, by itself, a violation. - -## Prioritized Findings - -| ID | Severity | Finding | Principal evidence | -| --- | --- | --- | --- | -| CS-01 | Critical | RPC debug logging records complete request parameters, including `set_hf_token`; Electron development/debug mode forwards backend debug stderr into its persistent info-level log. Public/logged errors can also expose paths and URLs. | `rust/crates/pumas-rpc/src/handlers/mod.rs:408-417,482-488`; `rust/crates/pumas-rpc/src/handlers/models/auth.rs:7-10`; `electron/src/main.ts:21-23,499-503`; `electron/src/python-bridge.ts:383-395,447-452` | -| CS-02 | High | The RPC trust boundary is incomplete: LAN mode has no caller authentication, most methods lack operation-specific schemas, and responses/events are trusted or silently discarded. | `rust/crates/pumas-rpc/src/main.rs:203-214`; `rust/crates/pumas-rpc/src/server.rs:170-214`; `electron/src/rpc-method-registry.ts:1-9`; `electron/src/python-bridge.ts:66-102,746-760`; `frontend/src/api/adapter.ts:87-111` | -| CS-03 | High | Authoritative model mutations and their durable update records are separate commits, while startup migration identity, accepted-artifact integrity, ordering, and interruption behavior are implicit. | `rust/crates/pumas-core/src/index/model_index.rs:271-469,1046-1080`; `rust/crates/pumas-core/src/index/model_index/governance.rs:191-337` | -| CS-04 | High | Async work has incomplete current-invocation, admission, cancellation, and shutdown ownership across Rust tasks, Electron subscriptions, frontend installation polling, and Torch inference. | `rust/crates/pumas-core/src/api/runtime_tasks.rs:22-42`; `rust/crates/pumas-rpc/src/server.rs:83-113`; `electron/src/preload.ts:723-798`; `electron/src/main.ts:208-216`; `frontend/src/hooks/useInstallationProgress.ts:100-152`; `torch-server/openai_api.py:109-156,259-292` | -| CS-05 | High | The fast model snapshot has no timestamp, revision, or provenance, and unavailable refreshes leave cached data looking fresh. | `frontend/src/utils/modelLibrarySnapshot.ts:3-7,121-152`; `frontend/src/hooks/useModels.ts:41-92,285-295` | -| CS-06 | High | Release automation does not implement the documented artifact and SBOM contract; dependency, vulnerability, and license evidence is stale or non-reproducible. | `docs/contracts/release-artifacts.md:27-78`; `.github/workflows/build.yml:65-82,433-526`; `scripts/dev/generate-sbom.sh:12-41`; `torch-server/requirements.txt:1-7` | -| CS-07 | High | Binding support claims exceed real-host evidence, and binding concerns leak into the core crate despite the adapter-local contract. | `README.md:172-177`; `.github/workflows/build.yml:236-325,481-490`; `rust/crates/pumas-core/Cargo.toml:101-122`; `rust/crates/pumas-uniffi/src/bindings.rs:299-305` | -| CS-08 | High | Supported build configurations are not expressed or proven consistently: Rust HF/process/GPU capability markers retain their dependency/API graph, and the frontend library-only variant lacks representative CI and artifact checks. | `rust/crates/pumas-core/Cargo.toml:13-122`; `rust/crates/pumas-core/src/lib.rs:33-100`; `frontend/package.json:8-10`; `frontend/vite.config.ts:24-39`; `.github/workflows/build.yml:156-162` | -| CS-09 | High | Dialog, popup, progress, and dynamic-status accessibility is component-specific and incomplete rather than owned by shared interaction primitives. | `frontend/src/components/ModelImportDialog.tsx:65-85`; `frontend/src/components/HuggingFaceAuthDialog.tsx:113-150`; `frontend/src/components/ProgressDetailsView.tsx:77-120,206-253` | -| CS-10 | High | The repository still teaches and enforces the previous standards model. Fixed line counts and blanket per-directory README requirements are treated as architecture/documentation authority, contrary to the current standards. | `CONTRIBUTING.md:29-40`; `docs/STANDARDS_ADOPTION.md:7-32`; `frontend/eslint.config.js:83-100`; `frontend/scripts/check-file-size.js:3-58`; `scripts/dev/check-readme-coverage.sh:29-77` | -| CS-11 | High | Default plugin-enabled RPC startup replaces a failed configured loader with an empty temporary-directory loader and unwraps the fallback, obscuring degradation or panicking. | `rust/crates/pumas-rpc/Cargo.toml:51-57`; `rust/crates/pumas-rpc/src/main.rs:136-152` | -| CS-12 | High | Corrupt or torn persisted launcher-root configuration is treated as absent, after which startup silently selects another library root; writes are not atomic. | `electron/src/launcher-root.ts:21-89,126-143` | -| CS-13 | Medium | Verification mechanisms do not have one coherent schedule or clear marginal claims: `check:errors` is declared as precommit, is absent from hooks and CI, is currently red, and uses a weak regex oracle. | `frontend/package.json:17-20`; `.pre-commit-config.yaml:6-34`; `.github/workflows/build.yml:147-162`; `frontend/scripts/check-error-handling.js:38-59` | -| CS-14 | Medium | Current documentation authority is unclear: the public `PumasApi` ownership description conflicts with implementation, the RPC method document lists removed methods, and plan status is difficult to determine. | `README.md:51-56`; `docs/architecture/SYSTEM_ARCHITECTURE.md:51-59`; `docs/contracts/desktop-rpc-methods.md:14-28`; `docs/plans/README.md:1-25,46-56` | -| CS-15 | Medium | Launcher behavior maps unknown platforms to Linux, does not enforce a complete terminate/grace/kill deadline, and has wrapper-specific release behavior. | `scripts/launcher/platform-service.mjs:5`; `scripts/launcher/commands.mjs:56-150`; `launcher.sh:12`; `launcher.ps1:3` | - -## What Is Already Strong - -- TypeScript uses strict, type-aware compiler and lint settings, including - unchecked-index and floating-promise protection. -- The frontend has 441 passing Vitest tests across 102 files, plus several good - stale-result and persisted-snapshot decoders. -- Electron enables context isolation, sandboxing, web security, and disables - renderer Node integration. -- Rust denies unsafe code by default and keeps the few platform/FFI relaxations - beside explicit safety arguments. -- SQLite enables foreign keys and WAL and provides a distinct read-only opening - path. -- RPC defaults to loopback and has request-size and concurrency bounds. -- Launcher, Electron, and Torch sidecar checks provide useful local evidence. -- CI builds/tests Rust and runs frontend static checks on Linux, Windows, and - macOS; the frontend production build and tests run on Linux. Node installation - uses the frozen lockfile. - -These strengths should be retained. They do not close the boundary-specific -findings without the scenario evidence named above. - -## Verification Snapshot - -| Check | Audit result | Interpretation | -| --- | --- | --- | -| Frontend ESLint and TypeScript | Pass | Useful static evidence | -| Frontend Vitest | Pass: 102 files, 441 tests | Strong component/unit evidence; not a real Electron/browser workflow | -| Frontend file-size check | Pass | Not valid architectural acceptance under the current standards | -| Frontend `check:errors` | Fail: 31 reports | Gate and oracle both need reauthorization; reports are not automatically 31 code defects | -| Electron validate, lint, tests | Pass: 5 test files | Useful shell/validation evidence | -| Launcher tests | Pass: 25 tests | Useful shared parser/command evidence | -| Torch Ruff and unit tests | Pass: 13 tests | CI installs only development dependencies and the tests can substitute fake runtime modules; this is not real ASGI/Torch evidence | -| Dependency ownership and version alignment | Pass | Useful manifest-governance evidence | -| README coverage script | Fail: 2 directories | The script itself conflicts with the current documentation standard and should not be repaired by adding arbitrary READMEs | -| Full Rust, cross-platform runtime, bindings hosts, release publication | Not executed by this audit | Existing build machinery was inspected; its missing scenario proofs remain findings | - -## Focused Audit Set - -The domain passes supporting this overview are: - -- [Frontend and UI](frontend-and-ui.md) -- [Rust library and RPC](rust-library-and-rpc.md) -- [Desktop, release, bindings, and Torch](desktop-release-bindings-and-torch.md) -- [Standards governance and verification](governance-and-verification.md) - -Recommended remediation-oriented audits, in order: - -1. **RPC threat model and diagnostics:** credential redaction, public error - projection, LAN support decision, authentication, authorization, and hostile - client evidence. -2. **Generated desktop RPC contract:** strict request, response, and event - schemas; extra-field policy; negative producer/consumer tests. -3. **Persistence and recovery:** atomic mutation/event outbox, stable migration - identity/integrity/order, interruption recovery, and replay acceptance. -4. **Release dependency closure:** exact artifact manifest, tag/version equality, - locked dependency inputs, current SBOMs, generated notices, and final-byte - checksum proof. -5. **Async lifecycle:** Rust task supervision, frontend polling/subscription - ownership, Torch admission/worker/cancellation behavior, and shutdown - postconditions. -6. **Supported configuration matrix:** Rust feature/dependency graph, frontend - default/library-only artifacts, and real host-language binding cohorts. -7. **Accessible interaction system:** shared dialog/popup/progress/status - primitives verified in a representative Electron/browser environment. -8. **Standards and documentation authority:** current routing, gate inventory, - plan lifecycle, and public contract reconciliation. -9. **Plugin startup and degradation:** configured-root authority, explicit - disabled/degraded outcomes, and fallible recovery without panic. -10. **Launcher-root durability:** atomic configuration replacement, explicit - corrupt/unreadable outcomes, and proof that startup never silently changes - the authoritative library. - -Each item should become its own bounded audit before an implementation plan is -approved. Composed-design review applies to the eventual RPC, persistence, -release, async, and feature-boundary refactors. This audit does not admit a -specific design for those changes. - -## Interpretation Notes - -- The 13,000-line model-library module and other large files are useful review - locators, not standards violations. Any decomposition must be justified by - ownership, interface depth, change coupling, or testability—not a line count. -- Counts such as “51 of 152 RPC methods have schemas” establish inventory gaps; - they do not decide the design. -- A passing build or startup smoke does not prove a real user workflow, - cross-process contract, migration interruption, or host-language load. -- Historical terminal plans do not need mechanical rewrites solely to add new - template fields. Active or still-authoritative plans do need a clear current - status, acceptance claims, and exactly one next slice. diff --git a/docs/audits/current-standards-2026-09-03/desktop-release-bindings-and-torch.md b/docs/audits/current-standards-2026-09-03/desktop-release-bindings-and-torch.md deleted file mode 100644 index 202ac019d..000000000 --- a/docs/audits/current-standards-2026-09-03/desktop-release-bindings-and-torch.md +++ /dev/null @@ -1,187 +0,0 @@ -# Focused Audit: Desktop, Release, Bindings, and Torch - -## Scope and Result - -This pass reviewed Electron, launchers, build/release automation, Torch sidecar, -bindings, dependency/SBOM/licensing evidence, and cross-platform claims. Result: -**useful isolation and build foundations, but the shipped-contract evidence is -not yet authoritative or reproducible**. - -No package installation, GUI, release build, model inference, cross-platform -runtime, or host binding suite was executed. - -## Findings - -### P-01 — Most desktop RPC methods lack operation-specific validation - -**Severity:** High — enforceable IPC/security violation. - -`electron/src/rpc-method-registry.ts:1-9` defaults request and response schemas -to `deferred`. Only 51 of 152 registered methods have request schemas and 19 are -declared empty. Imports, downloads, token changes, deletion, migration, and -quantization include deferred operations. Without a method schema, -`electron/src/ipc-validation.ts:50` accepts a generic record; its -`unknown-record` type at `:164` checks only object shape. - -Generate closed per-operation decoders and negative producer/consumer tests. -Treat the counts as inventory evidence, not design authority. - -### P-02 — Responses and streamed events are not contract-decoded - -**Severity:** High — enforceable generated-contract and TypeScript-boundary -violation. - -`electron/src/python-bridge.ts:746-760` parses JSON and asserts `RPCResponse` -without validating the envelope, correlation ID, or result. SSE handling at -`:66-102` logs and discards malformed events. `electron/src/preload.ts:132` -accepts arrays and nested payloads without decoding their elements. - -Use the same canonical contract owner for requests, responses, and events, and -surface invalid-contract outcomes instead of dropping them. - -### P-03 — Release automation and the release artifact contract disagree - -**Severity:** High — enforceable release/reproducibility violation. - -`docs/contracts/release-artifacts.md:27-78` requires standalone RPC artifacts, -separate native archives, generated binding packages, three SBOMs, and final -checksums. `.github/workflows/build.yml:65-82` ignores missing required Rust/RPC -outputs, while `:433-526` assembles a different set and generates no SBOMs. It -derives a tag version without comparing it to manifests and marks every `v0.*` -release prerelease. - -Define one exact machine-readable artifact manifest, fail on missing or -unexpected files, verify tag/version equality, generate final-byte SBOMs and -checksums, and make release-channel policy explicit. - -### P-04 — Binding publication claims exceed host evidence - -**Severity:** High — enforceable language-binding/release violation. - -`README.md:172-177` claims Python, C#, Kotlin, Swift, Ruby, and Elixir support. -`.github/workflows/build.yml:272-325,481-490` generates and packages five UniFFI -languages but runs no host runtime suites. `scripts/check-uniffi-csharp-smoke.sh:68-74` -text-checks async signatures, while -`bindings/csharp/Pumas.NativeSmoke/Program.cs:7-40` makes only a synchronous -native version call and constructs generated records. - -Binding generation can also install mutable tools implicitly: -`scripts/generate-bindings.sh:64-72,98-106,130-137,163-170,195-202` installs -generators during generation, including unversioned `uniffi-bindgen-cli`; CI -installs the C# generator from a mutable Git tag -(`.github/workflows/build.yml:266-270`). - -Publish an explicit host/target/tier matrix and test load, call, async, and -error behavior against the exact packaged native cohort. - -### P-05 — SBOM, dependency, security, and license evidence is stale - -**Severity:** High — enforceable dependency/build/security/licensing violation. - -`scripts/dev/generate-sbom.sh:12-41` expects a nonexistent root Python lock, -sources ambient NVM state, and invokes unpinned `npx`. The checked-in Python -SBOM describes an obsolete desktop stack instead of Torch. -`torch-server/requirements.txt:1-7` contains lower bounds without a resolved -lock. `docs/SECURITY.md:14,93-119` describes nonexistent manifests and CI -scanning/pinning practices that are not scheduled. -`docs/THIRD-PARTY-NOTICES.md:5-15,49-51` lists obsolete Python packages and -legacy Linux tools while omitting the current Torch and broader shipped -dependency inventory; `electron/package.json:48-76` does not include a notice -artifact in the packaged application. - -Audit the final shipped dependency closure for all three ecosystems, use locked -inputs and pinned producers, regenerate notices from evidence, and run current -vulnerability/license checks in a named schedule. - -### P-06 — Torch accepts unsupported semantics and blocks async routes - -**Severity:** High — enforceable boundary/concurrency violation. - -`torch-server/openai_api.py:25` leaves roles, prompts, sampling, and token -counts largely unconstrained; `:163-198` drops unknown roles, accepts but ignores -`stop`, and returns zero usage. Async handlers at `:109-156,259-292` execute -synchronous generation on the event loop. - -CI installs only `torch-server/requirements-dev.txt` -(`.github/workflows/build.yml:212-213`). The suite substitutes local FastAPI, -Torch, Uvicorn, and psutil fakes when those packages are absent -(`torch-server/tests/test_validation_and_app.py:15-136`), so its 13 passing -tests do not prove real ASGI routing, middleware, dependency compatibility, or -Torch integration. - -Define the supported OpenAI subset, reject unsupported values explicitly, bound -inputs, report truthful usage, and add worker/queue/cancellation/overload -ownership so generation cannot block health and control traffic. - -### P-07 — Electron subscription failures and close ownership are incomplete - -**Severity:** Medium — enforceable TypeScript async/lifecycle violation. - -`electron/src/preload.ts:723-798` launches several subscribe/unsubscribe -promises without observing failures. Window close resets serving, runtime, and -telemetry subscription owners but omits the model-download subscription -(`electron/src/main.ts:208-216`). Async Electron lifecycle callbacks are backed -only by log-level global rejection handling at `electron/src/main.ts:601-620`. - -Give each stream one main-process owner, observe subscription transitions, and -define idempotent close/unsubscribe outcomes with focused lifecycle tests. - -### P-08 — Corrupt launcher-root state silently changes library authority - -**Severity:** High — enforceable persistence/resilience violation. - -`electron/src/launcher-root.ts:126-143` maps malformed, unreadable, or invalid -persisted configuration to `null`; `:21-64` then silently chooses another root. -The owner is written directly at `:66-89`, so interruption can leave a torn -file. Startup may therefore display or mutate a different library while looking -healthy. - -Write the configuration through atomic replacement, distinguish absent from -invalid/unreadable state, and require an explicit recovery outcome before -changing the authoritative library root. - -### P-09 — Launcher outcomes and deadlines are incomplete - -**Severity:** Medium — enforceable launcher/cross-platform violation. - -`scripts/launcher/platform-service.mjs:5` maps any unknown platform to Linux. -`scripts/launcher/commands.mjs:56-150` sends `SIGTERM` at timeout but has no -second deadline or kill escalation while awaiting `close`. `launcher.sh:12` -contains a release fast path absent from `launcher.ps1:3`. - -Reject unknown platforms, define TERM/grace/KILL outcomes, and add wrapper -equivalence tests for supported launch/release actions. - -### P-10 — Repository standards governance still targets legacy owners - -**Severity:** Medium here; elevated to High systemically in the overview. - -`CONTRIBUTING.md:29-40` and `docs/STANDARDS_ADOPTION.md:7-32` route contributors -to the old monolithic standards and count thresholds. -`scripts/dev/check-readme-coverage.sh:29-77` makes directory presence a blanket -documentation requirement, contrary to the current contract/impact rule. - -Replace these with Core + Router navigation and reauthorize each permanent gate -against a named claim, proof boundary, oracle, and marginal value. - -## Strengths to Preserve - -- Electron enables context isolation, sandboxing, web security, and disables - Node integration (`electron/src/main.ts:152`). -- The RPC allowlist and initial schemas are a useful base for generation. -- Launcher process creation is centralized and generally uses structured, - non-shell spawning. -- Torch has loopback defaults, LAN token gating, constant-time token comparison, - path containment, and model-slot locking. -- CI uses frozen pnpm/Cargo inputs for the parts that have locks and calculates - checksums over emitted release files. - -## Next Focused Audits - -1. Generated desktop RPC contracts and invalid-payload outcomes. -2. Exact release artifact/SBOM/license closure. -3. Host binding support matrix and real-runtime cohorts. -4. Torch API subset, admission, inference workers, and shutdown. -5. Electron stream subscription ownership and failure outcomes. -6. Launcher-root persistence, recovery, and authority. -7. Launcher deadlines, outcomes, and wrapper equivalence. diff --git a/docs/audits/current-standards-2026-09-03/frontend-and-ui.md b/docs/audits/current-standards-2026-09-03/frontend-and-ui.md deleted file mode 100644 index 08cb6081f..000000000 --- a/docs/audits/current-standards-2026-09-03/frontend-and-ui.md +++ /dev/null @@ -1,144 +0,0 @@ -# Focused Audit: Frontend and UI - -## Scope and Result - -This pass reviewed `frontend/**`, its package/configuration, tests, CI surface, -and frontend documentation. Result: **strong static and unit-test foundations, -with high-priority runtime-contract, cached-state, async, and accessibility -gaps**. - -No representative Electron/browser session was used, so visual, focus-order, -and assistive-technology claims remain evidence gaps. - -## Findings - -### F-01 — IPC response values cross the boundary without runtime decoding - -**Severity:** High — enforceable contracts and TypeScript boundary violation. - -`frontend/src/api/adapter.ts:87-111` creates the bridge proxy from a type -assertion and forwards results. Domain wrappers such as -`frontend/src/api/models.ts:31-48` and `frontend/src/api/import.ts:39-74` also -return independently produced values without decoding them from `unknown`. - -Create one canonical operation-schema owner, retain `unknown` until decoding, -and test invalid as well as valid producer/consumer payloads. - -### F-02 — Startup snapshot state has no freshness or degradation contract - -**Severity:** High — enforceable authoritative-projection and degraded-outcome -violation. - -`frontend/src/utils/modelLibrarySnapshot.ts:3-7,121-152` stores only model -groups. `frontend/src/hooks/useModels.ts:41-92,285-295` can initialize from that -snapshot and leave it in place when the backend is absent, returns failure, or -throws. The model-list state itself cannot distinguish fresh backend state from -an old projection. `NetworkStatusBanner` can generically report cached data -(`frontend/src/components/NetworkStatusBanner.tsx:33-51`), but it does not -establish this snapshot's revision or freshness. - -Store revision/timestamp/provenance and expose a typed -`fresh | cached | degraded` outcome with visible recovery behavior. - -### F-03 — Installation polling permits overlapping stale completions - -**Severity:** High — enforceable TypeScript async/current-invocation violation. - -`frontend/src/hooks/useInstallationProgress.ts:100-131` applies every async -completion, while `:134-152` starts the fetch on a one-second interval. Cleanup -stops future ticks but does not cancel or generation-check in-flight requests. - -Serialize the loop or move it to events, give each invocation an identity or -abort signal, and test overlap, dependency changes, completion, and unmount. - -### F-04 — Dialog and popup semantics are inconsistent - -**Severity:** High — enforceable accessibility violation. - -- `frontend/src/components/ModelImportDialog.tsx:65-85` lacks owned dialog - semantics, naming, Escape behavior, focus entry/trap, and restoration. -- `frontend/src/components/HuggingFaceAuthDialog.tsx:113-150` has the same gaps - and an unlabeled icon close control. -- `frontend/src/components/VersionSelectorTrigger.tsx:88-96` and - `VersionSelectorDropdown.tsx:111-149` do not establish a complete popup - role/state/keyboard contract. - -Build a shared dialog primitive and choose one explicit disclosure, popover, or -menu interaction contract for the version selector based on its nested actions. -The primitives should own the applicable semantics, focus, keyboard, and -dismissal behavior. - -### F-05 — Progress and dynamic outcomes are visual-only - -**Severity:** Medium — enforceable accessibility/documentation violation. - -Progress bars and completion/failure messages in -`frontend/src/components/ProgressDetailsView.tsx:77-120,206-253` lack progress, -status, or alert semantics. No global reduced-motion implementation was found, -while `frontend/README.md:282-292` claims reduced-motion support. - -Add reusable progress/status announcement behavior and either implement the -documented reduced-motion policy or correct the claim. - -### F-06 — The error-handling gate is red and has a weak oracle - -**Severity:** Medium — enforceable tooling-governance violation. - -`frontend/package.json:17-20` includes `check:errors` in `precommit`, but the -command reports 31 findings. `.pre-commit-config.yaml:6-34` and -`.github/workflows/build.yml:147-162` do not schedule it. Its regex accepts a -catch based on `instanceof` appearing within ten lines -(`frontend/scripts/check-error-handling.js:38-48`), which does not prove a -correct boundary error contract. - -Audit the 31 locations semantically, replace the regex with type-aware rules or -retire it, and schedule only a gate with a named, independently decidable claim. - -### F-07 — Supported frontend variants lack representative evidence - -**Severity:** Medium — enforceable library-profile and verification gap. - -`frontend/package.json:8-10` advertises a library-only build and -`frontend/vite.config.ts:24-39` changes aliases and entrypoints for it. Vitest -always uses the default/plugin aliases in jsdom -(`frontend/vitest.config.ts:5-13,27-32`), while CI builds only the default -variant (`.github/workflows/build.yml:156-162`). - -Build and smoke both variants in CI, inspect library-only artifacts for absent -plugin code/contracts, and add a small representative Electron/browser suite. - -### F-08 — Fixed line counts are being used as design authority - -**Severity:** Medium — enforceable standards-policy violation, not a finding -that current files are necessarily badly designed. - -`frontend/scripts/check-file-size.js:3-58`, `frontend/eslint.config.js:83-100`, -and `frontend/README.md:331-343` treat 300 lines as a modularity decision. The -current Core and Architecture standards explicitly make counts diagnostic -only. - -Retire the blocking count gate or make it advisory. Review modules based on -ownership, cohesion, interface depth, change locality, and testability. - -## Strengths to Preserve - -- Strict compiler settings, including nullability, unchecked-index, unused, and - implicit-return checks (`frontend/tsconfig.json:38-55`). -- Type-aware strict ESLint and `jsx-a11y` - (`frontend/eslint.config.js:11-26,133-135`). -- Good model-search stale-result and timer cleanup - (`frontend/src/hooks/useModels.ts:163-176,200-283`). -- Runtime decoding for persisted model snapshots - (`frontend/src/utils/modelLibrarySnapshot.ts:46-107`). -- Build-time plugin separation through aliases - (`frontend/vite.config.ts:5-40`). -- Passing frontend evidence: ESLint, TypeScript, the current size checker, and - 441 Vitest tests across 102 files. - -## Next Focused Audits - -1. Renderer/Electron/Rust response and event decoder inventory. -2. Polling, subscription, timer, and stale-completion lifecycle inventory. -3. Keyboard, focus, status announcement, and reduced-motion audit in Electron. -4. Default versus library-only artifact and feature verification. -5. Frontend verification-gate ownership and error-contract cleanup. diff --git a/docs/audits/current-standards-2026-09-03/governance-and-verification.md b/docs/audits/current-standards-2026-09-03/governance-and-verification.md deleted file mode 100644 index c136390e8..000000000 --- a/docs/audits/current-standards-2026-09-03/governance-and-verification.md +++ /dev/null @@ -1,139 +0,0 @@ -# Focused Audit: Standards Governance and Verification - -## Scope and Result - -This pass compared repository guidance, permanent gates, contract docs, plans, -and CI with the current standards engine. Result: **the repository's compliance -machinery is partly enforcing the standards version it was originally built -against, so a green check is not yet equivalent to current compliance**. - -## Findings - -### G-01 — Contributor routing points to legacy standards entrypoints - -**Severity:** High — systemic standards-authority violation. - -`CONTRIBUTING.md:29-40` names legacy files such as `CODING-STANDARDS.md`, -`PLAN-STANDARDS.md`, and `TESTING-STANDARDS.md` as the source of truth. -`docs/STANDARDS_ADOPTION.md:7-24` uses the same superseded ownership map. -The current standards require routing from `CORE-STANDARDS.md` through -`STANDARDS-ROUTER.md`; legacy indexes cannot override canonical owners. - -Replace the local adoption map with the current route and record the standards -commit used for each future audit/refactor. - -### G-02 — Count-based architecture and documentation gates are unauthorized - -**Severity:** High — systemic tooling/architecture/documentation violation. - -`frontend/eslint.config.js:83-100` and -`frontend/scripts/check-file-size.js:3-58` block files based on fixed line and -complexity counts and claim that this enforces modularity. -`scripts/dev/check-readme-coverage.sh:29-77` requires a README in every scanned -directory. The current standards explicitly say counts are diagnostic only and -directory/file counts do not establish a documentation obligation. - -The README gate currently reports two missing directories; adding arbitrary -files would make the repository more compliant with the obsolete gate, not the -current standard. Retire or replace these checks with ownership-, contract-, -change-impact-, and test-seam evidence. - -### G-03 — Error-policy verification has no coherent authority or schedule - -**Severity:** Medium — enforceable tooling/verification violation. - -`frontend/package.json:17-20` declares `check:errors` as part of precommit, but -`.pre-commit-config.yaml:6-34` does not run it and CI omits it -(`.github/workflows/build.yml:147-162`). It currently reports 31 locations. -`frontend/scripts/check-error-handling.js:38-59` uses source regexes whose -`instanceof` proximity and `throw new Error` checks do not prove the desired -typed boundary outcome. - -Define the actual error-contract claims, inspect the 31 sites against those -claims, and keep only mechanisms with an authoritative or independent oracle -and marginal deciding value. - -### G-04 — Human contract docs have drifted from executable behavior - -**Severity:** Medium — enforceable documentation/contracts violation. - -- `docs/contracts/desktop-rpc-methods.md:14-16` says all per-method schemas are - deferred, while the registry now contains some schemas. -- Its method table at `:27-28` lists `preview_model_mapping`, - `sync_with_resolutions`, and shortcut methods absent from the executable - registry. -- `README.md:51-56` says legacy `PumasApi` can attach to an existing owner; - `docs/architecture/SYSTEM_ARCHITECTURE.md:51-59` and implementation say - constructors are owner-only. -- `docs/contracts/release-artifacts.md:27-78` promises release outputs and SBOMs - not produced by `.github/workflows/build.yml:433-526`. - -Select the executable owner for each contract and generate or verify human -projections from it. Do not preserve compatibility claims without a named -consumer and evidence. - -### G-05 — Plan lifecycle authority is hard to determine - -**Severity:** Medium — enforceable planning/documentation violation for active -plans, not a request to rewrite terminal history. - -`docs/plans/README.md:1-25` lists many artifacts without a clear -active/accepted/completed/superseded classification. It also references the -standards from a stale filesystem path (`:51`) and claims there are no ADRs -(`:54-57`), despite `docs/adr/0001-onnx-runtime-provider-model.md`. -`docs/plans/backend-owned-status-resource-telemetry/plan.md:750-1171` contains a -long sequence of planned, completed, failed, and later completed status blocks, -making current authority expensive to recover. - -Classify plan lifecycle in the index. Compact active plans to objective, -acceptance status, current phase, blockers, and exactly one next slice. -Historical terminal plans need no mechanical template rewrite. - -### G-06 — Cross-platform and user-workflow evidence is thinner than support claims - -**Severity:** Medium — enforceable verification-evidence gap. - -CI provides valuable cross-platform builds, but real runtime evidence is -concentrated on a Linux Xvfb startup smoke. It does not exercise a substantive -user workflow, host-language loads, migration interruption, hostile RPC input, -or Windows/macOS runtime behavior. A build on a target and a startup smoke prove -only their named boundaries. - -Create a claim-to-evidence matrix before adding more tests. Highest-value -missing scenarios are secret-free RPC diagnostics, unauthorized LAN calls, -invalid request/response/event contracts, interrupted persistence/migration, -default/library-only artifacts, host binding load/call, and keyboard/focus -workflows in Electron. - -## Permanent Gate Disposition - -| Mechanism | Current disposition | Reason | -| --- | --- | --- | -| TypeScript typecheck | Retain | Strong authoritative language proof | -| Type-aware ESLint | Retain, review local policy | Strong static oracle; some local rules need current ownership | -| Frontend Vitest | Retain | Valuable component/unit evidence | -| Fixed file-size/complexity gates | Retire or advisory | Counts do not decide architecture | -| README coverage gate | Retire | Directory presence does not decide documentation need | -| Regex error checker | Reauthorize or replace | Red, inconsistently scheduled, weak semantic oracle | -| Rust check script | Retain, map claims | Broad useful evidence; document each subcheck's boundary | -| Electron validation/tests | Retain and extend | Good initial allowlist/request evidence | -| Launcher tests | Retain and extend | Good shared behavior evidence; deadlines/wrapper parity missing | -| Release startup smoke | Retain as startup-only | Must not substitute for user workflow or platform-runtime evidence | -| Version/dependency ownership checks | Retain | Useful manifest consistency claims | - -## Recommended Governance Slice - -Before broad code refactoring: - -1. update `CONTRIBUTING.md` and `docs/STANDARDS_ADOPTION.md` to the current - standards router; -2. inventory every permanent gate with its named claim, proof boundary, oracle, - overlap, marginal value, and schedule; -3. retire the fixed count and blanket README gates; -4. classify active versus historical plans; -5. reconcile public contract docs with their executable owners; and -6. convert the top boundary findings into separate implementation-ready plans. - -This slice changes governance and documentation authority. It should not be -combined with the credential, RPC schema, persistence, or release fixes in one -undifferentiated refactor. diff --git a/docs/audits/current-standards-2026-09-03/rust-library-and-rpc.md b/docs/audits/current-standards-2026-09-03/rust-library-and-rpc.md deleted file mode 100644 index 97d000f55..000000000 --- a/docs/audits/current-standards-2026-09-03/rust-library-and-rpc.md +++ /dev/null @@ -1,203 +0,0 @@ -# Focused Audit: Rust Library and RPC - -## Scope and Result - -This pass inspected 242 Rust source files, workspace/crate manifests, tests, -RPC/IPC models, persistence, async ownership, feature gates, and UniFFI/Rustler -adapters. Result: **good local Rust hygiene, with critical diagnostics exposure -and high-priority boundary, persistence, lifecycle, and feature-contract gaps**. - -`cargo metadata` and dependency-tree queries were used. The full Rust suite, -crash injection, hostile RPC clients, and host-language runtimes were not run by -this audit. - -## Findings - -### R-01 — RPC parameters can disclose credentials in logs - -**Severity:** Critical — enforceable Security and Diagnostics violation. - -`rust/crates/pumas-rpc/src/handlers/mod.rs:408-417` debug-logs the complete -method parameter object. `set_hf_token` receives the token in that object at -`rust/crates/pumas-rpc/src/handlers/models/auth.rs:7-10`. The same generic path -logs and returns raw internal errors at -`rust/crates/pumas-rpc/src/handlers/mod.rs:482-488`; error text can contain paths -and URLs (`rust/crates/pumas-core/src/error.rs:41-66,105-106,157-167`). - -This reaches persistent logs in normal development/debug operation: Electron -enables backend debug at `electron/src/main.ts:499-503`, the bridge sets -`RUST_LOG=debug` and forwards tracing stderr as info -(`electron/src/python-bridge.ts:383-395,447-452`), and Electron's file transport -accepts info at `electron/src/main.ts:21-23`. - -Stop logging request values, use a deny-by-default structured field allowlist, -and project typed, stable, redacted public errors. - -### R-02 — LAN RPC has no caller authentication or authorization - -**Severity:** High — enforceable network trust-boundary violation. - -`rust/crates/pumas-rpc/src/main.rs:203-214` permits any non-loopback bind when -`--allow-lan` is present. `rust/crates/pumas-rpc/src/server.rs:170-214` adds -CORS, body-size, and concurrency middleware but no authentication layer. The -dispatcher includes credentials, deletion, migrations, path/URL opening, and -runtime control. - -Either remove LAN mode from the supported contract or define authenticated -capabilities, per-operation authorization, admission/rate policy, and hostile -non-browser client tests. CORS is not authentication. - -### R-03 — Durable mutation and update publication are not atomic - -**Severity:** High — enforceable persistence violation. - -`rust/crates/pumas-core/src/index/model_index.rs:419-469` commits a model upsert -before separately appending and publishing its event. Package-facts cache -updates follow the same pattern in -`rust/crates/pumas-core/src/index/model_index/package_facts_cache.rs:69-123`; -`rust/crates/pumas-core/src/index/model_index.rs:1046-1080` deletes rows before -recording removal events. - -Commit authoritative mutation and durable event in one SQLite transaction, -publish only after commit, and prove injected failure, reopen, and replay. - -### R-04 — Startup migration identity and interruption behavior are implicit - -**Severity:** High — enforceable persistence migration violation. - -Every normal open runs schema mutation -(`rust/crates/pumas-core/src/index/model_index.rs:271-376`). The code infers -whether particular repairs and rebuilds are needed by inspecting schema SQL, -then performs ad hoc table-rebuild sequences -(`rust/crates/pumas-core/src/index/model_index/governance.rs:191-337`). It does -not expose stable migration identity, accepted-artifact integrity, deterministic -ordering, or explicit interruption postconditions. - -Define stable migration identity, integrity and ordering plus a durable record -of applied state appropriate to this store. Define transaction/recovery behavior -for each step and test all supported prior schemas plus interruption; the audit -does not prescribe a particular migration framework or version table. - -### R-05 — Task and server owners discard terminal outcomes - -**Severity:** High — enforceable concurrency and Rust async violation. - -- `rust/crates/pumas-core/src/api/runtime_tasks.rs:22-42` removes finished - handles without awaiting their results and aborts on shutdown without - reporting outcomes. -- `rust/crates/pumas-rpc/src/server.rs:83-113` immediately aborts the server - task. -- `rust/crates/pumas-core/src/ipc/server.rs:44-108` aborts accept/connection - tasks. -- `rust/crates/pumas-core/src/api/builder.rs:72-87` maps a blocking-task join - failure to an empty result. - -Use an explicit supervisor, retain typed terminal results, close admission, -signal cancellation, drain under a bounded policy, and return -complete/incomplete/failed shutdown. - -### R-06 — Core capability markers do not gate their dependency or API surface - -**Severity:** High — enforceable library/dependency configuration violation. - -HF, process, GPU, archive, and ONNX dependencies are unconditional in -`rust/crates/pumas-core/Cargo.toml:13-112`. The `hf-client`, `process-manager`, -and `gpu-monitor` entries at `:117-121` are empty compile-time markers, although -`process-manager` does alter builder runtime behavior. Related modules and -re-exports remain unconditional in `rust/crates/pumas-core/src/lib.rs:33-100`. -A no-default dependency tree still contained `reqwest`, `ort`, `tokenizers`, -`sysinfo`, `ctrlc`, archives, and watchers. The separate `uniffi` feature does -correctly enable its optional dependency. - -Define actual consumer configurations, make optional dependencies real, gate -modules/re-exports consistently, and verify both dependency exclusion and -consumer compilation for each supported set. - -### R-07 — IPC decoding and RPC response wrapping invent valid-looking defaults - -**Severity:** High — enforceable IPC/contracts violation. - -`rust/crates/pumas-core/src/ipc/server.rs:110-120` accepts method plus arbitrary -JSON. HTTP search/release handlers cast negative `i64` inputs to `usize`/`u64` -(`rust/crates/pumas-rpc/src/handlers/models/search.rs:7-13,32-35,73-76`; -`rust/crates/pumas-rpc/src/handlers/versions/release.rs:113-123,146-151`). Request -envelopes do not state an extra-field policy, and the HTTP handler decodes but -does not validate the `jsonrpc` version -(`rust/crates/pumas-core/src/ipc/protocol.rs:16-24`; -`rust/crates/pumas-rpc/src/handlers/mod.rs:85-94,408-490`). -`rust/crates/pumas-rpc/src/wrapper.rs:13-60,146-179` turns null or incorrectly -typed values into successful empty collections, strings, or booleans. - -Decode each method into a strict DTO before dispatch, use checked conversions, -declare extra-field policy, and validate typed outbound outcomes. - -### R-08 — Binding placement and support claims exceed their evidence - -**Severity:** High — enforceable binding-boundary violation. - -Core retains an optional UniFFI dependency/scaffolding and framework derives -(`rust/crates/pumas-core/Cargo.toml:101-122`, -`rust/crates/pumas-core/src/lib.rs:29-31`, -`rust/crates/pumas-core/src/models/model.rs:8-15`) even though the adapter does -define its exposed DTOs locally -(`rust/crates/pumas-uniffi/src/bindings.rs:299-305`). UniFFI documentation claims -Python, C#, Kotlin, Swift, Ruby, and Go support -(`rust/crates/pumas-uniffi/src/lib.rs:1-13`), but CI has neither Go generation -nor real-host runtime proof. A real C# host-smoke mechanism exists at -`scripts/check-uniffi-csharp-smoke.sh:114-168`, but CI does not schedule it. -UniFFI error conversion exposes raw paths and collapses paused into cancelled -(`rust/crates/pumas-uniffi/src/bindings.rs:88-141`). - -The README also describes Rustler as a supported core binding, but -`rust/crates/pumas-rustler/src/lib.rs:268-442` exports local parsers and -constructors without calling `pumas-library`; unknown import stages are -fabricated as `Copying` at `:326-335`. - -Keep framework conversion in the adapter, publish a truthful host/target -support matrix, run real-host cohort tests, and retain typed/redacted errors. - -### R-09 — Default plugin startup silently substitutes an unrelated loader - -**Severity:** High — enforceable resilience and degraded-outcome violation. - -The RPC crate enables `inference-plugins` by default -(`rust/crates/pumas-rpc/Cargo.toml:51-57`). If the configured plugin loader fails, -`rust/crates/pumas-rpc/src/main.rs:136-152` silently substitutes an empty loader -rooted in the system temporary directory and then unwraps the fallback result. -The process can therefore look healthy with no configured plugins, or panic -while attempting a recoverable fallback. - -Return a typed startup/degraded outcome tied to the configured plugin root. -Either fail startup or expose a deliberate plugin-disabled state; do not change -the authority path implicitly, and do not unwrap the recovery attempt. - -## Strengths to Preserve - -- Workspace `unsafe_code = "deny"` and `unsafe_op_in_unsafe_fn = "deny"` - (`rust/Cargo.toml:15-19`). -- Credible adjacent safety reasoning for the few platform/FFI relaxations - (`rust/crates/pumas-core/src/platform/process.rs:17-49`, - `rust/crates/pumas-core/src/metadata/atomic.rs:117-130`). -- Loopback RPC default plus body and concurrency limits. -- Shared typed parameter decoding in several handlers - (`rust/crates/pumas-rpc/src/handlers/shared.rs:12-22`). -- SQLite foreign keys, WAL, and distinct read-only opening - (`rust/crates/pumas-core/src/index/model_index.rs:293-330`). -- A broad Rust verification script (`scripts/rust/check.sh:21-94`). - -## Design Note - -The roughly 13,000-line model-library implementation is a review hotspot, not -an automatic violation. A later deep-module review should use ownership, -contract depth, coupling, and test seams to decide whether and where to change -it. - -## Next Focused Audits - -1. RPC threat model, secret handling, and public error disclosure. -2. SQLite mutation/event atomicity and migration recovery. -3. Async task/shutdown postcondition inventory. -4. Core public API and Cargo feature/dependency matrix. -5. IPC/RPC DTO and outcome projection inventory. -6. UniFFI/Rustler support, adapter, and packaged-host evidence. -7. Plugin-loader startup and degraded-state contract. diff --git a/docs/plans/local-discovery-bootstrap.md b/docs/contracts/local-discovery-bootstrap.md similarity index 98% rename from docs/plans/local-discovery-bootstrap.md rename to docs/contracts/local-discovery-bootstrap.md index fc06f7d92..33fce7a33 100644 --- a/docs/plans/local-discovery-bootstrap.md +++ b/docs/contracts/local-discovery-bootstrap.md @@ -205,7 +205,7 @@ The same-registry support boundary and physical-store/namespace limitations rema ### Request admission follow-up to slice 2 -The additive [HTTP admission fence](../contracts/local-http-admission-fence.md) +The additive [HTTP admission fence](local-http-admission-fence.md) binds opted-in requests to the already authenticated core and HTTP service generations. RPC advertises schema `pumas.http-admission-fence@1` through the existing shared build descriptor. Older peers remain observable, but the typed @@ -234,7 +234,7 @@ checkpoint under the same physical lease and returns another restricted owner. Normal bootstrap never invokes recovery. Ordinary full/legacy/unknown owners remain unqualified. This does not certify model bytes, readiness, inference, downloads or arbitrary external writers. See -[the current custody contract](operating-owner-custody-design.md) for the API, +[the current custody contract](restricted-owner-custody.md) for the API, capabilities, durability bounds, native evidence and remaining full-owner gap. ### First recovery slice: qualified pending reservations (Linux) @@ -285,7 +285,7 @@ No model/runtime download or inference is needed. Hardware power-loss durability and additional operating systems are not qualified by those tests. The distinct future operating-owner contract is described in -[operating-owner-custody-design.md](operating-owner-custody-design.md). Current +[restricted-owner-custody.md](restricted-owner-custody.md). Current operating rows remain unresolved after process loss. Define one on-disk library identity/migration and a physical-store primary lifetime @@ -418,7 +418,7 @@ process-loss recovery remain pending. ### Passive consumer retention follow-up -[`local-owner-retention.md`](../contracts/local-owner-retention.md) defines an +[`local-owner-retention.md`](local-owner-retention.md) defines an opaque generation-bound passive guard using existing external-service tasks and physical lifetime shares. Mandatory-fenced HTTP streaming and a read-only CLI holder make it usable by external consumers. Exact row release waits for guards; @@ -432,10 +432,10 @@ or a release qualification. ## Explicit startup and distribution projection The follow-on explicit selected-root reservation is documented in -[`local-start-authority.md`](../contracts/local-start-authority.md). It transfers +[`local-start-authority.md`](local-start-authority.md). It transfers the existing held native lease and exact pending claim into the current builder, and adds a Linux CLI acknowledgment for owned/borrowed HTTP access. The -[inference-built control-plane bootstrap](../contracts/inference-enabled-bootstrap.md) +[inference-built control-plane bootstrap](inference-enabled-bootstrap.md) uses the same authority and acknowledgment without loading a model or native SDK. This closes a bounded typed start-admission gap; automatic historical bootstrap and full operating dead-owner recovery remain pending. Explicit qualified diff --git a/docs/plans/operating-owner-custody-design.md b/docs/contracts/restricted-owner-custody.md similarity index 100% rename from docs/plans/operating-owner-custody-design.md rename to docs/contracts/restricted-owner-custody.md diff --git a/docs/investigations/download-path-discrepancy-2026-10-10.md b/docs/investigations/download-path-discrepancy-2026-10-10.md deleted file mode 100644 index ebe984355..000000000 --- a/docs/investigations/download-path-discrepancy-2026-10-10.md +++ /dev/null @@ -1,224 +0,0 @@ -# Download destination and model catalog investigation - -Date: 2026-10-10. Scope: the three retained Error downloads implicated in the -installed application's startup failure. Current source reviewed: -`1a78ea8ecbe3ddf589d84db6783577eaf4efb79d`, based on GitHub main -`ad31e391dcd94c204b3fcd748cc98d27b3281e65`. The original checkout's existing -source and documentation changes were preserved. - -## Finding - -The model files exist. Their downloads were interrupted when Pumas moved their -directories during reclassification. The download attempts retained the old -destinations, while the model catalog subsequently described the new paths. -This discrepancy predates the October metadata upgrade. - -Historical logs directly establish the move followed by the next-file failure -for all three models. The precise trigger was not logged, but the historical -watcher/reconciliation flow supplies a matching production path: completion of -a file makes the model scope dirty; reconciliation detects its architecture -and reclassifies the directory while the download is still active. - -The previous explanation that these folders might never have been created was -too definite. They existed and contained downloaded files before Pumas moved -them. These are absent old destinations, not empty models awaiting a first -download. - -## Filesystem and metadata evidence - -Paths below are relative to `shared-resources/models`. Each artifact's basename -stayed the same; only its category/family parent changed. - -| Model | Destination in downloads.json | Actual SQLite catalog parent | Expected files present | Combined file sizes | -| --- | --- | --- | --- | --- | -| Huihui Qwen3.8 27B GGUF | `vlm/huihui-qwen3_8/` | `vlm/qwen35/` | 2 / 2 | 17,482,462,272 bytes | -| DavidAU Qwen3.8 27B Turbo GGUF | `vlm/qwen3_8/` | `vlm/qwen35/` | 3 / 3 | 19,433,235,707 bytes | -| inclusionAI LLaDA Image Turbo FP8 | `diffusion/inclusionai/` | `diffusion/vit/` | 33 / 33 | 27,610,502,872 bytes | - -All 38 expected files are regular files at the catalog destinations. Their -combined sizes match each catalog row's `downloaded_size_bytes`. The catalog -paths and each directory's `metadata.json` agree about model identity and -family. All three old destinations are absent. File existence, type, size, -inode and timestamps were inspected; model payloads were not opened or hashed. -This establishes presence and matching aggregate sizes, not cryptographic -integrity or inference compatibility. - -The read-only query used the actual `shared-resources/models/models.db`. -`library.db` has no tables; `link_registry.db` contains link/settings tables. -All three model rows contain repository, download URL, selected artifact files -and expected files. `intent_declarations` has no rows. `downloads.json` retains -the original requests, execution file lists and queue admissions, with status -`error`. SQLite reports progress `1.0`, no missing expected files and -`download_incomplete: false` at the new destinations. - -The live LLaDA metadata still has `match_source: download_partial`, despite all -33 expected files now being present. The inspected legacy metadata does not -carry modern import publication/completion receipts. It therefore cannot be -treated as proof that the old failed attempts completed under today's custody -contract. - -## Historical sequence - -The following times are UTC, taken directly from the retained desktop log: - -| Model | File completed immediately before move | Reclassification | Next-file failure | -| --- | --- | --- | --- | -| Huihui | 2026-09-06 00:11:36.612588, file 1 / 2 | 00:11:36.728180 | 00:11:37.355366 | -| DavidAU | 2026-09-10 22:37:12.446245, file 2 / 3 | 22:37:12.562144 | 22:37:13.203133 | -| LLaDA | 2026-09-13 00:38:23.778677, file 17 / 33 | 00:38:23.901909 | 00:38:24.529533 | - -Every failure names `open partial download file` and `No such file or directory`. -Each occurs approximately 0.63 seconds after its directory move. The new -classified parents exactly match the present catalog paths. - -Later logs include attempts to continue downloads after the initial failures. -The complete files and their timestamps establish that output exists at the -new paths now. They do not uniquely identify which later retry, recovery or -external action produced every remaining file. No claim is made about that -unlogged part of the history. - -The October startup restored these old Error attempts using their persisted -destinations and encountered the absent directory. The recent startup fix -prevents that secondary failure; it does not reconcile the original attempts -with the moved artifacts. - -## Architecture and flow - -```mermaid -flowchart TD - A[Downloader writes a file at the admitted destination] --> B[File completes and produces a filesystem event] - B --> C[Watcher schedules model reconciliation] - C --> D[Classifier detects architecture from available files] - D --> E[Historical reclassification moves the entire directory] - E --> F[Metadata and SQLite reference the new path] - E --> G[Downloader opens its next file at the old path] - G --> H[Attempt fails and persists Error at the old destination] - F --> I[Catalog later observes all expected files at the new path] -``` - -Three responsibilities must be distinguished: - -- Acquisition/download owns the selected file set, admitted workspace, worker - lifecycle, queue custody and attempt settlement in the versioned JSON store. -- Model publication/classification owns model identity, metadata and authorized - directory relocation. -- Catalog projection owns a searchable view of the current model location and - filesystem availability; it does not settle download attempts. - -The historical defect was competing mutation authority over the same directory. -The downloader's destination lock did not coordinate with reconciliation's -rename. Classification also participates in the physical path and model ID, -so a classification change invalidated the active worker's location. This is -concrete lifecycle/location coupling, rather than complexity inferred from -module sizes. - -Historical source `1f49100437f18034b26a09253bdd57d4c4708679`, a nearby retained -September 5 revision, contains this matching path: - -- `api/reconciliation.rs:1369` indexes a changed directory with metadata and - calls `reclassify_model` without consulting durable download custody. -- `model_library/library.rs:3155` classifies from local files, performs a - no-replace directory rename, writes destination metadata, removes the old - catalog row and indexes the new location. It does not coordinate the active - download destination or update its attempt records. - -That revision is source evidence for the historical mechanism, not a proven -build identifier for every September process. The runtime logs independently -prove the moves and ensuing failures. - -Current source is substantially stronger: - -- `api/builder.rs:631` configures a shared acquisition service and lifecycle-owned - importer before restoring downloads. -- `model_library/hf/download.rs:4844` publishes partial download metadata through - an exact transfer capability. Final import is separately capability/receipt - bound; partial discovery is not completion authority. -- `model_library/library.rs:4611` routes relocation through an owned operation, - holding physical exclusion and obtaining mutation authority before rename. -- `model_library/mutation_authority.rs:470` acquires the root grant and validates - target identities; `:577` rejects active queue admissions, hidden admissions, - nonterminal acquisitions or unresolved quarantines before mutation. -- `api/reconciliation.rs:613` treats a busy root as deferred background work. -- `model_library/library/projection.rs:43` builds catalog availability from the - current directory. `library.rs:7747` checks expected file presence, partial - files and sizes; its progress value is not a download completion receipt. -- `model_library/hf/download.rs:5758` finds tracked attempts by destination - identity. An artifact at a different family path does not automatically - become the same admitted workspace. - -## Coding standards MCP review - -The MCP selected applicable policy from snapshot -`snapshot:v1:32f18bf7-e195-4ca5-b0c2-ed993eb0b18a`. This was an evidence-backed -manual review against its authoritative policy, not an automated certification -of the repository. The findings apply to the traced paths only. - -| Finding | MCP requirement | Assessment | -| --- | --- | --- | -| Active directory moved by a separate owner | `topic.architecture` Data And State Authority; `topic.code-design` Simplicity And Ownership | Confirmed historical violation: download and reconciliation could mutate one directory without a shared lifecycle contract. Current relocation uses shared mutation/custody authority. | -| Download destination and relocated model location diverged | `topic.concurrency` Preserve Related Invariants; `profile.boundary.persistence` Durable Mutation Contract | Confirmed historical violation: directory/index changes did not preserve the active attempt's location invariant. Current code prevents relocation under custody rather than guessing a replacement destination. | -| Retained legacy attempts remain disconnected from moved complete artifacts | `topic.resilience` Replay And Resumption Evidence; `workflow.verification` | Current recovery gap: the crash guard preserves records but does not prove convergence or settlement. A successful startup is not evidence that historical attempts have been reconciled. | -| Similar completion language represents different facts | `topic.code-design` Code And Terminology Discipline; `topic.architecture` Data And State Authority | Architectural risk: catalog file availability and attempt completion must remain distinct in APIs/UI. Both observed values can be true: the old attempt failed, and files now exist at a different location. No SQLite-versus-JSON winner should be invented. | -| Rename, metadata and catalog publication span durable boundaries | `profile.boundary.persistence` Durable Mutation Contract | Failure-path review item, not the demonstrated cause. Current code retains claims on unconfirmed mutation and uses conditional publication for receipt-backed imports. This investigation did not inject every interruption in the legacy relocation branch. | - -The shared mutation authority was introduced in retained history at -`22388e702` on September 14, after these three observed failures. Later work -extended the exact acquisition/import proofs. The historical flaw should not -be presented as an unguarded current-main rename. - -## Verification and limits - -The read-only diagnostic command is: - -```bash -python3 /tmp/pumas-path-investigation-20261010/check-path-discrepancy.py -``` - -It has been run and exits 1 with the exact mismatch: three Error attempts with -absent old destinations and complete catalog records. It also checks all -expected file paths at both locations and confirms downloads.json bytes did -not change during inspection. Full metadata/stat evidence is retained at -`/tmp/pumas-path-investigation-20261010/path-evidence.json`; relevant historical -log excerpts are in `historical-moves.log` in that directory. - -Existing isolated tests were run on the reviewed current source: - -- `canonical_acquisition_custody_blocks_model_mutation_until_withdrawal`: passed. -- `busy_download_root_defers_background_reconciliation_without_failing_shutdown` - and `busy_download_root_remains_a_forced_refresh_error_without_failing_shutdown`: - both passed. -- `restore_missing_destination_retains_download_without_failing_startup`: passed. - -These prove focused current guards and preservation behavior. They do not prove -a full download/watcher/reclassification/restart handoff or safe adoption of -these legacy artifacts. A zero-test exact short-name invocation was discarded -and rerun with the matching filter; only actual executed tests count above. - -No application backend was launched against the real library. SQLite queries -used read-only mode. Only metadata files and filesystem stat were inspected. -No model payload was read, copied, hashed, moved, rewritten or deleted; no live -download/custody record was repaired. The discrepancy remains intentionally -available as diagnosis evidence. - -## Changes justified by this evidence - -1. Preserve the current rule that classification cannot relocate a destination - while any active or retained download custody owns it. Classification may - update observations; movement requires the publication owner's permission. -2. Add a composed regression with multiple files: finish one file, deliver the - real watcher event that changes family, attempt reconciliation, finish the - remaining download and reopen. Verify no premature relocation and consistent - attempt settlement and catalog identity. -3. Design explicit reconciliation for legacy moved outputs. Match exact artifact - selection, original attempt/admission and destination history; establish the - required output proof and let the owning lifecycle settle the old attempt. - Repository name, equal byte totals, a catalog row or an absent old folder - alone must not authorize rewriting custody, declaring completion or - downloading a second copy. -4. Present artifact availability separately from failed historical attempt - status, with a useful diagnostic when they refer to different paths. -5. Before extending relocation behavior, verify interruptions across rename, - metadata, catalog and custody publication through the real adapters. Keep - recovery at one coherent owner instead of adding independent JSON/SQL repairs. - -No production implementation changes are part of this investigation. diff --git a/docs/library-upgrade.md b/docs/library-upgrade.md index c79b92073..e371c6d4c 100644 --- a/docs/library-upgrade.md +++ b/docs/library-upgrade.md @@ -85,6 +85,42 @@ lease are refused without an automatic conversion. The migration and historical-writer obligations are owned by the [artifact acquisition contract](contracts/artifact-acquisition.md#9-persistence-and-consumer-finalization). +## Recover a failed download whose files moved + +Open the library and find **Failed download recovery**. This section uses the +saved download identity, including failures that no longer join a catalog row. +Choose **Inspect existing files** for the failed download. Inspection changes nothing. + +If all selected files are found, review the exact model ID, current directory, +file count and size. If several artifacts match, explicitly select the one you +want. Choose **Keep existing files and resolve failure** to retain those files +and settle the obsolete attempt. The library and download list refresh in the +same window; no restart or offline upgrade is needed for a schema-7 library. + +The first confirmation upgrades the HF partition to format 6. Older applications +opening this library directly will refuse it until their Pumas dependency is +updated. The dialog warns before confirmation. Cancel leaves the format unchanged. +Applications connecting to an upgraded RPC server have a separate wire contract; +see the [retained download reconciliation contract](contracts/download-location-reconciliation.md). + +Local acceptance preserves the original Error and releases its exact persisted +and live download claim. It does not assert historical upstream provenance, +produce a successful HF receipt, or promise that the model can run. It does not +read/hash, copy, move, delete or back up model files. SQLite is a catalog of the +current local artifact and receives no repair transaction from this action. + +Missing files or selected partials stay retained. Busy work must finish before +inspection can proceed; use **Inspect again**. A changed observation requires a +fresh inspection. If confirmation's response is lost or publication is uncertain, +use **Retry confirmation** with the same operation. Do not manually edit the +history or substitute another weight based on its display name or quantization. + +This action covers legacy Error attempts with an absent original destination, +explicit selected-file evidence and no immutable revision. Modern acquisition, +intent/deletion custody and quarantined history retain their existing owners. +The separately supported pre-schema-7 metadata upgrade remains a different flow. +Downgrading a binary does not downgrade the HF partition; use a compatible reader. + ## Startup diagnostic boundary Every fatal RPC startup failure writes one newline-delimited stdout frame diff --git a/docs/native-bindings.md b/docs/native-bindings.md index fb7cac97d..6cd29476a 100644 --- a/docs/native-bindings.md +++ b/docs/native-bindings.md @@ -81,5 +81,5 @@ release evidence that exercises the exact packaged cohort through: - invalid-input and error projection; and - the documented target/runtime versions. -The [current standards audit](audits/current-standards-2026-09-03/README.md) -tracks the remaining binding and packaging gaps. +The [desktop, release, bindings and Torch issues](plans/current-standards-remediation-2026-09-03/desktop-release-bindings-and-torch/issues.md) +track the remaining binding and packaging gaps. diff --git a/docs/plans/audit-remediation-2026-11/plan.md b/docs/plans/audit-remediation-2026-11/plan.md index 53486eb9b..cb6eb2070 100644 --- a/docs/plans/audit-remediation-2026-11/plan.md +++ b/docs/plans/audit-remediation-2026-11/plan.md @@ -2,7 +2,7 @@ **Plan status:** `Active` -**Input:** [comprehensive audit 2026-11-02](../../audits/comprehensive-audit-2026-11-02.md), +**Input:** comprehensive audit 2026-11-02 (`docs/audits/comprehensive-audit-2026-11-02.md`, removed; see Git history at `0a4c0a8e`), written against `b1196838`. Every finding was re-verified against `7b40d50f` (2026-11-05) by reading current source; High findings were spot-checked a second time. The verified tree was then compared with diff --git a/docs/plans/current-standards-remediation-2026-09-03/desktop-release-bindings-and-torch/plan.md b/docs/plans/current-standards-remediation-2026-09-03/desktop-release-bindings-and-torch/plan.md index a4b79a477..8b9feada9 100644 --- a/docs/plans/current-standards-remediation-2026-09-03/desktop-release-bindings-and-torch/plan.md +++ b/docs/plans/current-standards-remediation-2026-09-03/desktop-release-bindings-and-torch/plan.md @@ -29,7 +29,7 @@ does not waive review for that later design. **Reports:** Planned evidence reports are indexed in the [execution ledger](execution-ledger.md#reports). -**Audit source:** [Desktop, release, bindings, and Torch](../../../audits/current-standards-2026-09-03/desktop-release-bindings-and-torch.md) +**Audit source:** Desktop, release, bindings, and Torch (`docs/audits/current-standards-2026-09-03/desktop-release-bindings-and-torch.md`, removed; see Git history at `0a4c0a8e`) ## Objective diff --git a/docs/plans/current-standards-remediation-2026-09-03/frontend-and-ui/plan.md b/docs/plans/current-standards-remediation-2026-09-03/frontend-and-ui/plan.md index ea01b66ca..974c72968 100644 --- a/docs/plans/current-standards-remediation-2026-09-03/frontend-and-ui/plan.md +++ b/docs/plans/current-standards-remediation-2026-09-03/frontend-and-ui/plan.md @@ -2665,7 +2665,7 @@ root serializes generation, Cargo and commits. Full M4/M5 remain unaccepted. **Reports:** Planned report artifacts are indexed in the [execution ledger](execution-ledger.md#reports). -**Audit source:** [Frontend and UI audit](../../../audits/current-standards-2026-09-03/frontend-and-ui.md) +**Audit source:** Frontend and UI audit (`docs/audits/current-standards-2026-09-03/frontend-and-ui.md`, removed; see Git history at `0a4c0a8e`) ## Objective diff --git a/docs/plans/current-standards-remediation-2026-09-03/governance-and-verification/plan.md b/docs/plans/current-standards-remediation-2026-09-03/governance-and-verification/plan.md index 8f7ae3f85..f1efea074 100644 --- a/docs/plans/current-standards-remediation-2026-09-03/governance-and-verification/plan.md +++ b/docs/plans/current-standards-remediation-2026-09-03/governance-and-verification/plan.md @@ -16,7 +16,7 @@ are accepted. **Reports:** [Error-contract gate disposition](reports/error-contract-gate-disposition.md) and [final governance evidence](reports/final-governance-evidence.md). -**Audit source:** [Standards governance and verification](../../../audits/current-standards-2026-09-03/governance-and-verification.md) +**Audit source:** Standards governance and verification (`docs/audits/current-standards-2026-09-03/governance-and-verification.md`, removed; see Git history at `0a4c0a8e`) ## Objective diff --git a/docs/plans/current-standards-remediation-2026-09-03/plan.md b/docs/plans/current-standards-remediation-2026-09-03/plan.md index c25fdde98..f6a927b4b 100644 --- a/docs/plans/current-standards-remediation-2026-09-03/plan.md +++ b/docs/plans/current-standards-remediation-2026-09-03/plan.md @@ -877,7 +877,7 @@ unavailable until required-real target runners execute it. **Reports:** Program evidence is indexed in the [ledger](execution-ledger.md#reports). -**Audit source:** [Current standards audit](../../audits/current-standards-2026-09-03/README.md) +**Audit source:** Current standards audit (`docs/audits/current-standards-2026-09-03/README.md`, removed; see Git history at `0a4c0a8e`) ## Objective diff --git a/docs/plans/current-standards-remediation-2026-09-03/rust-library-and-rpc/plan.md b/docs/plans/current-standards-remediation-2026-09-03/rust-library-and-rpc/plan.md index 2018c9b30..10e15dbaa 100644 --- a/docs/plans/current-standards-remediation-2026-09-03/rust-library-and-rpc/plan.md +++ b/docs/plans/current-standards-remediation-2026-09-03/rust-library-and-rpc/plan.md @@ -485,7 +485,7 @@ checkpoint or imply a failed GitHub Actions result. **Reports:** Pending report slots are listed in the [execution ledger](execution-ledger.md#reports). -**Audit source:** [Rust library and RPC](../../../audits/current-standards-2026-09-03/rust-library-and-rpc.md) +**Audit source:** Rust library and RPC (`docs/audits/current-standards-2026-09-03/rust-library-and-rpc.md`, removed; see Git history at `0a4c0a8e`) ## Active PRG-I19 Slice C Boundary diff --git a/docs/plans/download-location-reconciliation/execution-ledger.md b/docs/plans/download-location-reconciliation/execution-ledger.md index 07dcb6875..e0c638530 100644 --- a/docs/plans/download-location-reconciliation/execution-ledger.md +++ b/docs/plans/download-location-reconciliation/execution-ledger.md @@ -5,7 +5,7 @@ Canonical authority: [plan](plan.md). | Date | Event | Evidence / effect | | --- | --- | --- | | 2026-10-10 | User requested a standards-compliant remediation plan. | Planning only; no new implementation admission or live repair. | -| 2026-10-10 | Prior investigation incorporated. | [Investigation](../../investigations/download-path-discrepancy-2026-10-10.md): three historical relocations, current file stats and existing guard tests. Evidence limits preserved. | +| 2026-10-10 | Prior investigation incorporated. | Investigation (`docs/investigations/download-path-discrepancy-2026-10-10.md`, removed; see Git history at `0a4c0a8e`): three historical relocations, current file stats and existing guard tests. Evidence limits preserved. | | 2026-10-10 | Coding standards MCP routed the proposed scope and acceptance tooling. | [Standards](reports/standards.md): final snapshot, 42 selected policies, no unresolved routing categories. | | 2026-10-10 | Plan, owner design, write sets, acceptance procedures and issue dispositions created. | Lifecycle Planned; C1–C10 pending; exactly one next slice M1. No source edits or tests claimed. | | 2026-10-10 | Planning artifact verification passed. | Links in all eight documents resolve, required C1–C10 inventory/statuses checked; original tracked diff remains byte-identical to the preserved baseline, and the latest-main worktree remains clean. This verifies planning artifacts and preservation, not production behavior. | diff --git a/docs/plans/download-location-reconciliation/plan.md b/docs/plans/download-location-reconciliation/plan.md index cd46e43e4..e97c24e9f 100644 --- a/docs/plans/download-location-reconciliation/plan.md +++ b/docs/plans/download-location-reconciliation/plan.md @@ -32,7 +32,7 @@ owners and boundaries. A passing build alone cannot close this plan. ## Evidence and scope -The [investigation](../../investigations/download-path-discrepancy-2026-10-10.md) +The investigation (`docs/investigations/download-path-discrepancy-2026-10-10.md`, removed; see Git history at `0a4c0a8e`) establishes three historical moves during active downloads, followed by attempts to open the next file at the now-absent destination. All 38 expected files now exist at the three catalog locations. Their aggregate sizes agree with SQLite; diff --git a/docs/plans/download-location-reconciliation/reports/design.md b/docs/plans/download-location-reconciliation/reports/design.md index b92260299..192fb9ede 100644 --- a/docs/plans/download-location-reconciliation/reports/design.md +++ b/docs/plans/download-location-reconciliation/reports/design.md @@ -7,7 +7,7 @@ and `docs/adr/0003-download-location-reconciliation.md`, admitted with M1. ## Evidence, alternatives and selected tradeoff -The [investigation](../../../investigations/download-path-discrepancy-2026-10-10.md) +The investigation (`docs/investigations/download-path-discrepancy-2026-10-10.md`, removed; see Git history at `0a4c0a8e`) records three absent old destinations and three populated new catalog paths. Historical logs show renames between completed files and the next file-open failure. Current code already denies competing workspace mutation under custody. diff --git a/docs/release-evidence/0.7.0/onnx-archive-verification.json b/docs/release-evidence/0.7.0/onnx-archive-verification.json deleted file mode 100644 index 24df0f3a8..000000000 --- a/docs/release-evidence/0.7.0/onnx-archive-verification.json +++ /dev/null @@ -1 +0,0 @@ -[{"attestation":{"bundle":{"mediaType":"application/vnd.dev.sigstore.bundle.v0.3+json","verificationMaterial":{"certificate":{"rawBytes":"MIIG4DCCBmagAwIBAgIUV2tAdvpiTIMyCP1SNmFhq4ZK1jIwCgYIKoZIzj0EAwMwNzEVMBMGA1UEChMMc2lnc3RvcmUuZGV2MR4wHAYDVQQDExVzaWdzdG9yZS1pbnRlcm1lZGlhdGUwHhcNMjYwMjE5MjI1NDExWhcNMjYwMjE5MjMwNDExWjAAMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEvTBXG8aZjY84euYvR/2hIj+yiUalOUZh3wb4TXPZWJUisKVUlu3VlCM8ge4IsgVimTLMwZQ5hrJd+qWincsy2qOCBYUwggWBMA4GA1UdDwEB/wQEAwIHgDATBgNVHSUEDDAKBggrBgEFBQcDAzAdBgNVHQ4EFgQUaQrw8m0WU8uBYYuCUVxM8g7FgQUwHwYDVR0jBBgwFoAU39Ppz1YkEZb5qNjpKFWixi4YZD8waAYDVR0RAQH/BF4wXIZaaHR0cHM6Ly9naXRodWIuY29tL3B5a2Vpby9vcnQtYXJ0aWZhY3RzLy5naXRodWIvd29ya2Zsb3dzL2J1aWxkLXJ1bm5lci55bWxAcmVmcy9oZWFkcy9tYWluMDkGCisGAQQBg78wAQEEK2h0dHBzOi8vdG9rZW4uYWN0aW9ucy5naXRodWJ1c2VyY29udGVudC5jb20wHwYKKwYBBAGDvzABAgQRd29ya2Zsb3dfZGlzcGF0Y2gwNgYKKwYBBAGDvzABAwQoZjI2Nzk0N2JiYTc4MmYzMTViZDY2N2I5YjJhNjA3YWI1MTM2MzQ0NTAfBgorBgEEAYO/MAEEBBFCdWlsZCBBbGwgVGFyZ2V0czAiBgorBgEEAYO/MAEFBBRweWtlaW8vb3J0LWFydGlmYWN0czAdBgorBgEEAYO/MAEGBA9yZWZzL2hlYWRzL21haW4wOwYKKwYBBAGDvzABCAQtDCtodHRwczovL3Rva2VuLmFjdGlvbnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tMGoGCisGAQQBg78wAQkEXAxaaHR0cHM6Ly9naXRodWIuY29tL3B5a2Vpby9vcnQtYXJ0aWZhY3RzLy5naXRodWIvd29ya2Zsb3dzL2J1aWxkLXJ1bm5lci55bWxAcmVmcy9oZWFkcy9tYWluMDgGCisGAQQBg78wAQoEKgwoZjI2Nzk0N2JiYTc4MmYzMTViZDY2N2I5YjJhNjA3YWI1MTM2MzQ0NTAdBgorBgEEAYO/MAELBA8MDWdpdGh1Yi1ob3N0ZWQwNwYKKwYBBAGDvzABDAQpDCdodHRwczovL2dpdGh1Yi5jb20vcHlrZWlvL29ydC1hcnRpZmFjdHMwOAYKKwYBBAGDvzABDQQqDChmMjY3OTQ3YmJhNzgyZjMxNWJkNjY3YjliMmE2MDdhYjUxMzYzNDQ1MB8GCisGAQQBg78wAQ4EEQwPcmVmcy9oZWFkcy9tYWluMBkGCisGAQQBg78wAQ8ECwwJODAzNTc1NjY1MCkGCisGAQQBg78wARAEGwwZaHR0cHM6Ly9naXRodWIuY29tL3B5a2VpbzAYBgorBgEEAYO/MAERBAoMCDYyMjY4NzIwMGMGCisGAQQBg78wARIEVQxTaHR0cHM6Ly9naXRodWIuY29tL3B5a2Vpby9vcnQtYXJ0aWZhY3RzLy5naXRodWIvd29ya2Zsb3dzL2J1aWxkLnltbEByZWZzL2hlYWRzL21haW4wOAYKKwYBBAGDvzABEwQqDChmMjY3OTQ3YmJhNzgyZjMxNWJkNjY3YjliMmE2MDdhYjUxMzYzNDQ1MCEGCisGAQQBg78wARQEEwwRd29ya2Zsb3dfZGlzcGF0Y2gwWwYKKwYBBAGDvzABFQRNDEtodHRwczovL2dpdGh1Yi5jb20vcHlrZWlvL29ydC1hcnRpZmFjdHMvYWN0aW9ucy9ydW5zLzIyMjAyNjc0Njg0L2F0dGVtcHRzLzEwFgYKKwYBBAGDvzABFgQIDAZwdWJsaWMwgYoGCisGAQQB1nkCBAIEfAR6AHgAdgDdPTBqxscRMmMZHhyZZzcCokpeuN48rf+HinKALynujgAAAZx4HGEdAAAEAwBHMEUCIQDaGoFH3XR+EJCAdpPts79RpLyRJGZJ4gM3sIZhk7SHNgIgJWPzIalfgY7+IGiVtkKocCvwnRYf1XOlRY3NxexzSbAwCgYIKoZIzj0EAwMDaAAwZQIxALVh5TBUmFbM0Im1oqlmwqFmqcUsU60gc3WYmI99DuBNt9zYM7zH0SjK7U9xW2s2/QIwB8heQrRe/NnP0TpAlD7mXn+Iqe6dx260VUjAcERji1DWxQI5aoFGDGGDlFbL1HNb"},"tlogEntries":[{"logIndex":"971480319","logId":{"keyId":"wNI9atQGlz+VWfO6LRygH4QUfY/8W4RFwiT5i5WRgB0="},"kindVersion":{"kind":"dsse","version":"0.0.1"},"integratedTime":"1771541651","inclusionPromise":{"signedEntryTimestamp":"MEUCIQC4t9RCeX48vqsxChW9WcPsxDRghJU11Gp+VljrCRlUiAIgK16D4RGTT9NWkJmBUAIYbNijJq++7MpsCnUiYRuwt+o="},"inclusionProof":{"logIndex":"849576057","rootHash":"XkqJu32sgHswvlzxSyAwNJiCPeTtyffMtp2IUV/sQRk=","treeSize":"849576079","hashes":["u2yZzZzR4dMf8jgi8W48Fo9+hiH1NEe0betC2RBKTJA=","tMxdp29imLMw21pTYwKueGh3BHIzfYNkkjUFb9fds6o=","FxRxo0LTlDXZAxcCLgTksMc5zAnZEmuWHAbkpl720ig=","0VhlkXWu3uVwM4Ok74Mnb1Ray6aa6QZI4v5jaLJG4Rw=","2zFyg2OhNCP7TWVPYnuTNz28oghQwcId2l02AmXdwzA=","inICtfWHEOuhuvxIo8G5nwVFoWdIbg/y8XezxCq7hJ4=","yFcYTrGgYVmqDVMu+iYU8guHHwmZUoiX4Da6fDc/1/o=","TqHDw9txN0NkJ8kPHP3NgacSc3juWzug/ENg1D0uzvw=","B6qcBUBdqRk3G0DWNsqTfYAmXoD0XghTtwRWp4TIthk=","lNWUFGrUFMpq/rNIZ+kUtRJlz6nwZvMD2CLxmUkwnAw=","SnokHdHhCVEFpMNkLLK2cO/BWeJcsY5hDmE704h5KoI=","9QDvOU/pRUqL9Eu1VAK09l7hHfSXQELWgM50O4J/JFM=","Zd4TJu0GGIHnTI0NiL5x+mPiTCn4VwshktTGNlBDJXE=","Cf3Qsee7cmtATi56kFqvoGskpRx2bvx5qhyhiqobL0U=","fLAvE46NqCVV86EpB2pKkwJlFjjFk7ntX3lC+PiZuIo=","T4DqWD42hAtN+vX8jKCWqoC4meE4JekI9LxYGCcPy1M="],"checkpoint":{"envelope":"rekor.sigstore.dev - 1193050959916656506\n849576079\nXkqJu32sgHswvlzxSyAwNJiCPeTtyffMtp2IUV/sQRk=\n\n— rekor.sigstore.dev wNI9ajBFAiEA5ep4CIAK+JX0zuF1l+/fr5tfuIcQH3SyaZeBk0ze2w0CICtgOkdQoIYu120lpXuhpuOTHcWLsk9P4ujmv2p9WZjK\n"}},"canonicalizedBody":"eyJhcGlWZXJzaW9uIjoiMC4wLjEiLCJraW5kIjoiZHNzZSIsInNwZWMiOnsiZW52ZWxvcGVIYXNoIjp7ImFsZ29yaXRobSI6InNoYTI1NiIsInZhbHVlIjoiNTUzMTdmMzg3YzE2ZDg2NWI5ZTcxNjdjYTRlODU3OWJhZmFkYzk3YTQzZGE2ZjVjMTkzNzA0NGY2Y2QwNzBjNSJ9LCJwYXlsb2FkSGFzaCI6eyJhbGdvcml0aG0iOiJzaGEyNTYiLCJ2YWx1ZSI6ImI5YmVlNjY3ODQ5M2I3MTk4MTU3MjE5ZjZmMTVmMGYyZTYzMDNmNWRlMTc0NDU1NzQ2OGQ0MmRjN2JiZTg5MTcifSwic2lnbmF0dXJlcyI6W3sic2lnbmF0dXJlIjoiTUVVQ0lRRHF2L3Q1b205YTRuNkNyN0c1SUREK2Q5NERkYUFjYmZVeFo0RDUvdE8xemdJZ2NQWVAvK1VSV09yMmVJL1NnTWJHN2p6NEsvei9TYWJuMmpjV0tIYlhnSXM9IiwidmVyaWZpZXIiOiJMUzB0TFMxQ1JVZEpUaUJEUlZKVVNVWkpRMEZVUlMwdExTMHRDazFKU1VjMFJFTkRRbTFoWjBGM1NVSkJaMGxWVmpKMFFXUjJjR2xVU1UxNVExQXhVMDV0Um1oeE5GcExNV3BKZDBObldVbExiMXBKZW1vd1JVRjNUWGNLVG5wRlZrMUNUVWRCTVZWRlEyaE5UV015Ykc1ak0xSjJZMjFWZFZwSFZqSk5ValIzU0VGWlJGWlJVVVJGZUZaNllWZGtlbVJIT1hsYVV6RndZbTVTYkFwamJURnNXa2RzYUdSSFZYZElhR05PVFdwWmQwMXFSVFZOYWtreFRrUkZlRmRvWTA1TmFsbDNUV3BGTlUxcVRYZE9SRVY0VjJwQlFVMUdhM2RGZDFsSUNrdHZXa2w2YWpCRFFWRlpTVXR2V2tsNmFqQkVRVkZqUkZGblFVVjJWRUpZUnpoaFdtcFpPRFJsZFZsMlVpOHlhRWxxSzNscFZXRnNUMVZhYUROM1lqUUtWRmhRV2xkS1ZXbHpTMVpWYkhVelZteERUVGhuWlRSSmMyZFdhVzFVVEUxM1dsRTFhSEpLWkN0eFYybHVZM041TW5GUFEwSlpWWGRuWjFkQ1RVRTBSd3BCTVZWa1JIZEZRaTkzVVVWQmQwbElaMFJCVkVKblRsWklVMVZGUkVSQlMwSm5aM0pDWjBWR1FsRmpSRUY2UVdSQ1owNVdTRkUwUlVablVWVmhVWEozQ2podE1GZFZPSFZDV1ZsMVExVldlRTA0WnpkR1oxRlZkMGgzV1VSV1VqQnFRa0puZDBadlFWVXpPVkJ3ZWpGWmEwVmFZalZ4VG1wd1MwWlhhWGhwTkZrS1drUTRkMkZCV1VSV1VqQlNRVkZJTDBKR05IZFlTVnBoWVVoU01HTklUVFpNZVRsdVlWaFNiMlJYU1hWWk1qbDBURE5DTldFeVZuQmllVGwyWTI1UmRBcFpXRW93WVZkYWFGa3pVbnBNZVRWdVlWaFNiMlJYU1haa01qbDVZVEphYzJJelpIcE1Na294WVZkNGEweFlTakZpYlRWc1kyazFOV0pYZUVGamJWWnRDbU41T1c5YVYwWnJZM2s1ZEZsWGJIVk5SR3RIUTJselIwRlJVVUpuTnpoM1FWRkZSVXN5YURCa1NFSjZUMms0ZG1SSE9YSmFWelIxV1ZkT01HRlhPWFVLWTNrMWJtRllVbTlrVjBveFl6SldlVmt5T1hWa1IxWjFaRU0xYW1JeU1IZElkMWxMUzNkWlFrSkJSMFIyZWtGQ1FXZFJVbVF5T1hsaE1scHpZak5rWmdwYVIyeDZZMGRHTUZreVozZE9aMWxMUzNkWlFrSkJSMFIyZWtGQ1FYZFJiMXBxU1RKT2Vtc3dUakpLYVZsVVl6Uk5iVmw2VFZSV2FWcEVXVEpPTWtrMUNsbHFTbWhPYWtFeldWZEpNVTFVVFRKTmVsRXdUbFJCWmtKbmIzSkNaMFZGUVZsUEwwMUJSVVZDUWtaRFpGZHNjMXBEUWtKaVIzZG5Wa2RHZVZveVZqQUtZM3BCYVVKbmIzSkNaMFZGUVZsUEwwMUJSVVpDUWxKM1pWZDBiR0ZYT0haaU0wb3dURmRHZVdSSGJHMVpWMDR3WTNwQlpFSm5iM0pDWjBWRlFWbFBMd3BOUVVWSFFrRTVlVnBYV25wTU1taHNXVmRTZWt3eU1XaGhWelIzVDNkWlMwdDNXVUpDUVVkRWRucEJRa05CVVhSRVEzUnZaRWhTZDJONmIzWk1NMUoyQ21FeVZuVk1iVVpxWkVkc2RtSnVUWFZhTW13d1lVaFdhV1JZVG14amJVNTJZbTVTYkdKdVVYVlpNamwwVFVkdlIwTnBjMGRCVVZGQ1p6YzRkMEZSYTBVS1dFRjRZV0ZJVWpCalNFMDJUSGs1Ym1GWVVtOWtWMGwxV1RJNWRFd3pRalZoTWxad1luazVkbU51VVhSWldFb3dZVmRhYUZrelVucE1lVFZ1WVZoU2J3cGtWMGwyWkRJNWVXRXlXbk5pTTJSNlRESktNV0ZYZUd0TVdFb3hZbTAxYkdOcE5UVmlWM2hCWTIxV2JXTjVPVzlhVjBaclkzazVkRmxYYkhWTlJHZEhDa05wYzBkQlVWRkNaemM0ZDBGUmIwVkxaM2R2V21wSk1rNTZhekJPTWtwcFdWUmpORTF0V1hwTlZGWnBXa1JaTWs0eVNUVlpha3BvVG1wQk0xbFhTVEVLVFZSTk1rMTZVVEJPVkVGa1FtZHZja0puUlVWQldVOHZUVUZGVEVKQk9FMUVWMlJ3WkVkb01WbHBNVzlpTTA0d1dsZFJkMDUzV1V0TGQxbENRa0ZIUkFwMmVrRkNSRUZSY0VSRFpHOWtTRkozWTNwdmRrd3laSEJrUjJneFdXazFhbUl5TUhaalNHeHlXbGRzZGt3eU9YbGtRekZvWTI1U2NGcHRSbXBrU0UxM0NrOUJXVXRMZDFsQ1FrRkhSSFo2UVVKRVVWRnhSRU5vYlUxcVdUTlBWRkV6V1cxS2FFNTZaM2xhYWsxNFRsZEthMDVxV1ROWmFteHBUVzFGTWsxRVpHZ0tXV3BWZUUxNldYcE9SRkV4VFVJNFIwTnBjMGRCVVZGQ1p6YzRkMEZSTkVWRlVYZFFZMjFXYldONU9XOWFWMFpyWTNrNWRGbFhiSFZOUW10SFEybHpSd3BCVVZGQ1p6YzRkMEZST0VWRGQzZEtUMFJCZWs1VVl6Rk9hbGt4VFVOclIwTnBjMGRCVVZGQ1p6YzRkMEZTUVVWSGQzZGFZVWhTTUdOSVRUWk1lVGx1Q21GWVVtOWtWMGwxV1RJNWRFd3pRalZoTWxad1lucEJXVUpuYjNKQ1owVkZRVmxQTDAxQlJWSkNRVzlOUTBSWmVVMXFXVFJPZWtsM1RVZE5SME5wYzBjS1FWRlJRbWMzT0hkQlVrbEZWbEY0VkdGSVVqQmpTRTAyVEhrNWJtRllVbTlrVjBsMVdUSTVkRXd6UWpWaE1sWndZbms1ZG1OdVVYUlpXRW93WVZkYWFBcFpNMUo2VEhrMWJtRllVbTlrVjBsMlpESTVlV0V5V25OaU0yUjZUREpLTVdGWGVHdE1ibXgwWWtWQ2VWcFhXbnBNTW1oc1dWZFNla3d5TVdoaFZ6UjNDazlCV1V0TGQxbENRa0ZIUkhaNlFVSkZkMUZ4UkVOb2JVMXFXVE5QVkZFeldXMUthRTU2WjNsYWFrMTRUbGRLYTA1cVdUTlphbXhwVFcxRk1rMUVaR2dLV1dwVmVFMTZXWHBPUkZFeFRVTkZSME5wYzBkQlVWRkNaemM0ZDBGU1VVVkZkM2RTWkRJNWVXRXlXbk5pTTJSbVdrZHNlbU5IUmpCWk1tZDNWM2RaU3dwTGQxbENRa0ZIUkhaNlFVSkdVVkpPUkVWMGIyUklVbmRqZW05MlRESmtjR1JIYURGWmFUVnFZakl3ZG1OSWJISmFWMngyVERJNWVXUkRNV2hqYmxKd0NscHRSbXBrU0UxMldWZE9NR0ZYT1hWamVUbDVaRmMxZWt4NlNYbE5ha0Y1VG1wak1FNXFaekJNTWtZd1pFZFdkR05JVW5wTWVrVjNSbWRaUzB0M1dVSUtRa0ZIUkhaNlFVSkdaMUZKUkVGYWQyUlhTbk5oVjAxM1oxbHZSME5wYzBkQlVWRkNNVzVyUTBKQlNVVm1RVkkyUVVoblFXUm5SR1JRVkVKeGVITmpVZ3BOYlUxYVNHaDVXbHA2WTBOdmEzQmxkVTQwT0hKbUswaHBia3RCVEhsdWRXcG5RVUZCV25nMFNFZEZaRUZCUVVWQmQwSklUVVZWUTBsUlJHRkhiMFpJQ2pOWVVpdEZTa05CWkhCUWRITTNPVkp3VEhsU1NrZGFTalJuVFROelNWcG9hemRUU0U1blNXZEtWMUI2U1dGc1ptZFpOeXRKUjJsV2RHdExiMk5EZG5jS2JsSlpaakZZVDJ4U1dUTk9lR1Y0ZWxOaVFYZERaMWxKUzI5YVNYcHFNRVZCZDAxRVlVRkJkMXBSU1hoQlRGWm9OVlJDVlcxR1lrMHdTVzB4YjNGc2JRcDNjVVp0Y1dOVmMxVTJNR2RqTTFkWmJVazVPVVIxUWs1ME9YcFpUVGQ2U0RCVGFrczNWVGw0VnpKek1pOVJTWGRDT0dobFVYSlNaUzlPYmxBd1ZIQkJDbXhFTjIxWWJpdEpjV1UyWkhneU5qQldWV3BCWTBWU2Fta3hSRmQ0VVVrMVlXOUdSMFJIUjBSc1JtSk1NVWhPWWdvdExTMHRMVVZPUkNCRFJWSlVTVVpKUTBGVVJTMHRMUzB0Q2c9PSJ9XX19"}],"timestampVerificationData":{}},"dsseEnvelope":{"payload":"eyJfdHlwZSI6Imh0dHBzOi8vaW4tdG90by5pby9TdGF0ZW1lbnQvdjEiLCJzdWJqZWN0IjpbeyJuYW1lIjoieDg2XzY0LXVua25vd24tbGludXgtZ251LnRhci5sem1hMiIsImRpZ2VzdCI6eyJzaGEyNTYiOiJhY2MxY2JhNzljMzM3NTk0ZWFkMWQ4OGNhNzI1MTYxNDdhYTYwMDU0Yzg0MjE3YjUzMzk5YTMxY2FhNWJhNjcxIn19XSwicHJlZGljYXRlVHlwZSI6Imh0dHBzOi8vc2xzYS5kZXYvcHJvdmVuYW5jZS92MSIsInByZWRpY2F0ZSI6eyJidWlsZERlZmluaXRpb24iOnsiYnVpbGRUeXBlIjoiaHR0cHM6Ly9hY3Rpb25zLmdpdGh1Yi5pby9idWlsZHR5cGVzL3dvcmtmbG93L3YxIiwiZXh0ZXJuYWxQYXJhbWV0ZXJzIjp7IndvcmtmbG93Ijp7InJlZiI6InJlZnMvaGVhZHMvbWFpbiIsInJlcG9zaXRvcnkiOiJodHRwczovL2dpdGh1Yi5jb20vcHlrZWlvL29ydC1hcnRpZmFjdHMiLCJwYXRoIjoiLmdpdGh1Yi93b3JrZmxvd3MvYnVpbGQueW1sIn19LCJpbnRlcm5hbFBhcmFtZXRlcnMiOnsiZ2l0aHViIjp7ImV2ZW50X25hbWUiOiJ3b3JrZmxvd19kaXNwYXRjaCIsInJlcG9zaXRvcnlfaWQiOiI4MDM1NzU2NjUiLCJyZXBvc2l0b3J5X293bmVyX2lkIjoiNjIyNjg3MjAiLCJydW5uZXJfZW52aXJvbm1lbnQiOiJnaXRodWItaG9zdGVkIn19LCJyZXNvbHZlZERlcGVuZGVuY2llcyI6W3sidXJpIjoiZ2l0K2h0dHBzOi8vZ2l0aHViLmNvbS9weWtlaW8vb3J0LWFydGlmYWN0c0ByZWZzL2hlYWRzL21haW4iLCJkaWdlc3QiOnsiZ2l0Q29tbWl0IjoiZjI2Nzk0N2JiYTc4MmYzMTViZDY2N2I5YjJhNjA3YWI1MTM2MzQ0NSJ9fV19LCJydW5EZXRhaWxzIjp7ImJ1aWxkZXIiOnsiaWQiOiJodHRwczovL2dpdGh1Yi5jb20vcHlrZWlvL29ydC1hcnRpZmFjdHMvLmdpdGh1Yi93b3JrZmxvd3MvYnVpbGQtcnVubmVyLnltbEByZWZzL2hlYWRzL21haW4ifSwibWV0YWRhdGEiOnsiaW52b2NhdGlvbklkIjoiaHR0cHM6Ly9naXRodWIuY29tL3B5a2Vpby9vcnQtYXJ0aWZhY3RzL2FjdGlvbnMvcnVucy8yMjIwMjY3NDY4NC9hdHRlbXB0cy8xIn19fX0=","payloadType":"application/vnd.in-toto+json","signatures":[{"sig":"MEUCIQDqv/t5om9a4n6Cr7G5IDD+d94DdaAcbfUxZ4D5/tO1zgIgcPYP/+URWOr2eI/SgMbG7jz4K/z/Sabn2jcWKHbXgIs="}]}},"bundle_url":"","initiator":""},"verificationResult":{"mediaType":"application/vnd.dev.sigstore.verificationresult+json;version=0.1","signature":{"certificate":{"certificateIssuer":"CN=sigstore-intermediate,O=sigstore.dev","subjectAlternativeName":"https://github.com/pykeio/ort-artifacts/.github/workflows/build-runner.yml@refs/heads/main","issuer":"https://token.actions.githubusercontent.com","githubWorkflowTrigger":"workflow_dispatch","githubWorkflowSHA":"f267947bba782f315bd667b9b2a607ab51363445","githubWorkflowName":"Build All Targets","githubWorkflowRepository":"pykeio/ort-artifacts","githubWorkflowRef":"refs/heads/main","buildSignerURI":"https://github.com/pykeio/ort-artifacts/.github/workflows/build-runner.yml@refs/heads/main","buildSignerDigest":"f267947bba782f315bd667b9b2a607ab51363445","runnerEnvironment":"github-hosted","sourceRepositoryURI":"https://github.com/pykeio/ort-artifacts","sourceRepositoryDigest":"f267947bba782f315bd667b9b2a607ab51363445","sourceRepositoryRef":"refs/heads/main","sourceRepositoryIdentifier":"803575665","sourceRepositoryOwnerURI":"https://github.com/pykeio","sourceRepositoryOwnerIdentifier":"62268720","buildConfigURI":"https://github.com/pykeio/ort-artifacts/.github/workflows/build.yml@refs/heads/main","buildConfigDigest":"f267947bba782f315bd667b9b2a607ab51363445","buildTrigger":"workflow_dispatch","runInvocationURI":"https://github.com/pykeio/ort-artifacts/actions/runs/22202674684/attempts/1","sourceRepositoryVisibilityAtSigning":"public"}},"verifiedTimestamps":[{"type":"Tlog","uri":"https://rekor.sigstore.dev","timestamp":"2026-02-19T14:54:11-08:00"}],"verifiedIdentity":{"subjectAlternativeName":{"subjectAlternativeName":"","regexp":"(?i)^https://github\\.com/pykeio/ort-artifacts/"},"issuer":{"issuer":"","regexp":".*"}},"statement":{"_type":"https://in-toto.io/Statement/v1","subject":[{"name":"x86_64-unknown-linux-gnu.tar.lzma2","digest":{"sha256":"acc1cba79c337594ead1d88ca72516147aa60054c84217b53399a31caa5ba671"}}],"predicateType":"https://slsa.dev/provenance/v1","predicate":{"buildDefinition":{"buildType":"https://actions.github.io/buildtypes/workflow/v1","externalParameters":{"workflow":{"path":".github/workflows/build.yml","ref":"refs/heads/main","repository":"https://github.com/pykeio/ort-artifacts"}},"internalParameters":{"github":{"event_name":"workflow_dispatch","repository_id":"803575665","repository_owner_id":"62268720","runner_environment":"github-hosted"}},"resolvedDependencies":[{"digest":{"gitCommit":"f267947bba782f315bd667b9b2a607ab51363445"},"uri":"git+https://github.com/pykeio/ort-artifacts@refs/heads/main"}]},"runDetails":{"builder":{"id":"https://github.com/pykeio/ort-artifacts/.github/workflows/build-runner.yml@refs/heads/main"},"metadata":{"invocationId":"https://github.com/pykeio/ort-artifacts/actions/runs/22202674684/attempts/1"}}}}}}] diff --git a/docs/release-notes-0.8.0.md b/docs/release-notes-0.8.0.md index 2c3438ddf..d1b6ffdd5 100644 --- a/docs/release-notes-0.8.0.md +++ b/docs/release-notes-0.8.0.md @@ -17,6 +17,7 @@ The largest changes are: - digest-checked local imports and S3 imports - inference-enabled headless builds for Linux, Windows and macOS - an explicit, backed-up upgrade for older libraries +- a locked-down desktop app and hash-checked runtime installs ## For desktop users @@ -65,6 +66,21 @@ old preset keep working. - A failed Torch startup trial says why the managed launch failed. - Desktop views that receive an invalid update report it and reload instead of going stale. +- A failed download whose files an older version moved can be kept without + downloading it again: see + [Recover a failed download whose files moved](library-upgrade.md#recover-a-failed-download-whose-files-moved). + +### Safer desktop and runtimes + +- The desktop app stays on its own bundled pages. Links open in your browser; + other sites, pop-up windows and browser permission requests are refused. + Packaged builds have no DevTools and ignore `--dev`, `--debug` and + `PUMAS_RPC_BINARY`. +- Ollama installs only from archives that match the publisher's SHA-256, and + Torch installs only from a hash-checked lock made for that install. +- Runtimes start with a minimal environment: `LD_PRELOAD`, `PYTHONPATH` and + credentials are not passed to them. Stopping a runtime signals only processes + that Pumas started and recorded. ## For applications that use Pumas @@ -91,6 +107,11 @@ Responses may gain fields, capabilities and enum values within contract version 1. Ignore what you do not use. See the [model operations contract](contracts/model-operations-v1.md). +Refusals that happen before a request reaches its handler return +`{"error":{"code","message"}}`, and `request_limit` refusals name the bound. +`pumas-rpc` limits open connections (256) and the time allowed to send request +headers (30 s). + ### New capabilities - **`decision`**: typed choice, score and yes/no questions answered with @@ -128,6 +149,11 @@ schema versions rather than matching product versions. never starts a download. - Merging libraries refuses copied imports that carry a publication receipt bound to their current library root; leave those in place. +- `OllamaClient::new` and `VersionManager::version_path` return `Result`. +- Removed: `network::DownloadManager` and `DownloadProgress`, + `NetworkManager::execute`, `CacheStrategy`'s `allow_stale_on_offline` and + `max_stale_age`, `OllamaVersionManager`, `ProcessManagerFactory` and the + app-manager `process` module. ### Acquisition @@ -140,6 +166,10 @@ schema versions rather than matching product versions. details resolved after you select a model. - A managed GGUF keeps its selected primary file and projector through library moves, and a directory's primary file is never its projector. +- A credential-less `http://` source on a network host is fetched over HTTPS + first. Pumas falls back to the plaintext URL, with a logged warning, only + when the HTTPS attempt gets no HTTP response. Credentialed plaintext sources + are still refused. ### llama.cpp serving diff --git a/docs/runbooks/download-location-reconciliation.md b/docs/runbooks/download-location-reconciliation.md deleted file mode 100644 index 01d460778..000000000 --- a/docs/runbooks/download-location-reconciliation.md +++ /dev/null @@ -1,35 +0,0 @@ -# Recover a failed download whose files moved - -Open the library and find **Failed download recovery**. This section uses the -saved download identity, including failures that no longer join a catalog row. -Choose **Inspect existing files** for the failed download. Inspection changes nothing. - -If all selected files are found, review the exact model ID, current directory, -file count and size. If several artifacts match, explicitly select the one you -want. Choose **Keep existing files and resolve failure** to retain those files -and settle the obsolete attempt. The library and download list refresh in the -same window; no restart or offline upgrade is needed for a schema-7 library. - -The first confirmation upgrades the HF partition to format 6. Older applications -opening this library directly will refuse it until their Pumas dependency is -updated. The dialog warns before confirmation. Cancel leaves the format unchanged. -Applications connecting to an upgraded RPC server have a separate wire contract; -see the [compatibility evidence](../plans/download-location-reconciliation/reports/m1-evidence.md). - -Local acceptance preserves the original Error and releases its exact persisted -and live download claim. It does not assert historical upstream provenance, -produce a successful HF receipt, or promise that the model can run. It does not -read/hash, copy, move, delete or back up model files. SQLite is a catalog of the -current local artifact and receives no repair transaction from this action. - -Missing files or selected partials stay retained. Busy work must finish before -inspection can proceed; use **Inspect again**. A changed observation requires a -fresh inspection. If confirmation's response is lost or publication is uncertain, -use **Retry confirmation** with the same operation. Do not manually edit the -history or substitute another weight based on its display name or quantization. - -This action covers legacy Error attempts with an absent original destination, -explicit selected-file evidence and no immutable revision. Modern acquisition, -intent/deletion custody and quarantined history retain their existing owners. -The separately supported pre-schema-7 metadata upgrade remains a different flow. -Downgrading a binary does not downgrade the HF partition; use a compatible reader. diff --git a/electron/README.md b/electron/README.md index 3bdad42d6..ca860a1bc 100644 --- a/electron/README.md +++ b/electron/README.md @@ -239,4 +239,4 @@ Packaging requires `frontend/dist` plus a matching `pumas-rpc` staged under `CSC_IDENTITY_AUTO_DISCOVERY=false`, so installers are unsigned and the config declares no signing identity. Do not treat a successful package assembly as proof that the application runs on that platform. See [Releasing](../RELEASING.md) -and the [current standards audit](../docs/audits/current-standards-2026-09-03/README.md). +and the [open desktop, release and Torch issues](../docs/plans/current-standards-remediation-2026-09-03/desktop-release-bindings-and-torch/issues.md). diff --git a/frontend/README.md b/frontend/README.md index 19ed1e963..17ce08ff0 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -99,4 +99,4 @@ does not include them. `test:desktop-contract` crosses the real bundled preload [Development](../docs/DEVELOPMENT.md) describes its prerequisites. For representative desktop behavior, build and run through the root launcher. Open frontend findings are tracked in the -[current standards audit](../docs/audits/current-standards-2026-09-03/README.md). +[frontend and UI issue list](../docs/plans/current-standards-remediation-2026-09-03/frontend-and-ui/issues.md). diff --git a/rust/README.md b/rust/README.md index 696215805..6445e212a 100644 --- a/rust/README.md +++ b/rust/README.md @@ -88,4 +88,4 @@ boundary-specific safety argument. See [Architecture](../docs/ARCHITECTURE.md), [Development](../docs/DEVELOPMENT.md), and the -[current standards audit](../docs/audits/current-standards-2026-09-03/README.md). +[open Rust library and RPC issues](../docs/plans/current-standards-remediation-2026-09-03/rust-library-and-rpc/issues.md). diff --git a/shared-resources/models/diffusion/qwen/qwen-image-2512/metadata.json b/rust/crates/pumas-core/tests/fixtures/metadata/qwen-image-2512.json similarity index 100% rename from shared-resources/models/diffusion/qwen/qwen-image-2512/metadata.json rename to rust/crates/pumas-core/tests/fixtures/metadata/qwen-image-2512.json diff --git a/rust/crates/pumas-core/tests/integration/metadata_artifact_tests.rs b/rust/crates/pumas-core/tests/integration/metadata_artifact_tests.rs index 21f7da49e..f66b6ffb7 100644 --- a/rust/crates/pumas-core/tests/integration/metadata_artifact_tests.rs +++ b/rust/crates/pumas-core/tests/integration/metadata_artifact_tests.rs @@ -3,8 +3,8 @@ use std::path::Path; #[test] fn test_qwen_image_2512_metadata_matches_curated_diffusion_contract() { - let metadata_path = Path::new(env!("CARGO_MANIFEST_DIR")) - .join("../../../shared-resources/models/diffusion/qwen/qwen-image-2512/metadata.json"); + let metadata_path = + Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/fixtures/metadata/qwen-image-2512.json"); let metadata_json = std::fs::read_to_string(&metadata_path).unwrap(); let metadata: ModelMetadata = serde_json::from_str(&metadata_json).unwrap(); diff --git a/torch-server/README.md b/torch-server/README.md index 12b665a57..a6306c5d0 100644 --- a/torch-server/README.md +++ b/torch-server/README.md @@ -221,7 +221,7 @@ diffusion serving plan (`git show 78c52fcf:docs/plans/torch-diffusion-serving/`) The managed runtime lock is the production dependency candidate; the root `requirements.txt` remains a direct-development input. Keep qualification, vulnerability and license evidence attached to the exact managed lock. See [Releasing](../RELEASING.md), [Security](../docs/SECURITY.md), and -the [current standards audit](../docs/audits/current-standards-2026-09-03/README.md). +the [open desktop, release and Torch issues](../docs/plans/current-standards-remediation-2026-09-03/desktop-release-bindings-and-torch/issues.md). Native compatibility checks (using a qualified managed Python environment):