# Browser Runtime

## Purpose

The browser runtime hosts TinyRustLM as static files and keeps prompts local to the user browser. TinyRustLM.com is the current public app surface, while TinyRustLM.MiRust.com/developer-portal/ is the current developer documentation identity.

## Constraints

The app uses static HTML, custom CSS, handwritten JavaScript, local WASM, and local `.slm` files only. It does not use npm, CDN scripts, frontend frameworks, remote inference APIs, telemetry, analytics, or model downloads from external hosts during inference.

Generated local P2P share kits now include the sender-side peer contact book and peer companion inventory steps. When the user supplies a consenting `KnownPeerBaseUrl`, the downloaded script writes `minimodel.peer_contact_book.v0` with `write-peer-contact-book`, immediately revalidates it with `inspect-peer-contact-book`, then writes `minimodel.peer_companion_inventory.v0` with `write-peer-companion-inventory` and revalidates it with `inspect-peer-companion-inventory`. The book and inventory are metadata only: they bind contact-card SHA-256s, manifest/piece-set evidence, the local receipt ledger, piece-store byte/quota/SHA-256 checks, optional contact cards, and a `ready-after-rust-reverify` serve plan without embedding `.slm` bytes, peer-piece payloads, or catalog availability claims.

TinyRustLM can load that local peer companion inventory in the simple P2P panel or Advanced source details. After browser validation of the metadata-only boundary, safe direct peer URL, state, piece-store, receipt-ledger, contact-card, command, quota, and serve-plan fields, the inventory summary shows the peer URL and peer status route, fills and persists the Known peer URL for later P2P import request/script generation, and still leaves `inspect-peer-companion-inventory` plus Rust reverify as the trust gate before serving or transfer. Mapped public-root browser-smoke `hf-peer-companion-inventory-ui` proves the inventory-derived Known peer URL reaches a proof-ready Hugging Face row's downloaded peer import request and route/gate script.

On TinyRustLM.com, the browser host does not auto-admit selector registries or fetch hosted `/models/` bytes. It loads the app shell and WASM runtime, then waits for the user to import a local `.slm` file from disk. Optional Hugging Face discovery is user-triggered and only helps users find external source/model pages or conversion candidates; importing into the runtime still goes through the local file picker and Rust/WASM `load_model` validation.

The left sidebar now uses a Model Setup flow instead of placeholder product navigation. `Local .slm`, `Hugging Face`, and `P2P import` open the matching source panel; `Advanced tools` opens the real verifier/details rail; documentation icons link to TinyRustLM and MiniModel developer docs. `source-options-ui` clicks those sidebar actions and proves they route to implemented panels without triggering Hugging Face or MiniModel network access before the user explicitly searches or loads metadata.

Local Connect approvals live in Advanced Tools with a simple P2P shortcut. The UI stores a local-only `tinyrustlm.local_connect_approval_policy.v0` policy that defaults to `Ask every time`, supports `Always approve selected` for named app categories or app names, adds a `Trust Browsers + Email` preset for the common browser/email automation case, and exposes a high-risk `Full local-control lab mode` that requires `full_control_non_sensitive_machine_acknowledged=true` before endpoint use. App categories include browsers, email apps, docs/office, files/folders, terminal/scripts, and passwords/payments/settings, each with visible risk warnings. The policy preview can be saved as `tinyrustlm-local-connect-policy.v0.json` so a user-run endpoint can load the exact approval contract without sending it to project servers. The Rust `tinyrustlm-local-connect` gate is the endpoint-side contract: `inspect-approval-policy` validates the JSON policy, rejects unacknowledged full-control policies, `decide-approval` returns an `allow`, `ask`, or `deny` key-value report for a requested category/app after rejecting policy drift, duplicate approvals, unsafe path-like app names, and ask-mode auto approvals, `execute-action <policy.json> <action.json>` dry-runs or starts a typed native-opener action, and `serve-approval-endpoint <policy.json> [port]` runs a user-owned `127.0.0.1` API with `/v0/health`, `/v0/categories`, `/v0/apps`, `/v0/decision`, and `/v0/action`. The `/v0/apps` response is a privacy-preserving list built from approved app names, bounded local app-name discovery, and common app fallbacks with category labels, risk warnings, approval rules, supported typed actions, and dry-run decisions; it can mark known rows as `Found locally`, but it reports names only and sets `inventory_paths_exposed=false` for the response and every row. The browser renders those rows with visible risk warnings plus `Always approve app`, `Always approve category`, and `Block category` controls that update the local policy preview while still requiring the user to save/reload the endpoint policy before enforcement changes; acknowledged full lab mode keeps the rendered inventory visible and recomputes decisions immediately while explicit category blocks stay denied. `/v0/action` requires the loaded policy SHA-256 in both JSON and `x-tinyrustlm-policy-sha256`, accepts only category-matched typed actions (`open-url`, `compose-email`, `open-path`), binds app-level approval to the approved app's category before execution, dry-runs by default, and starts the OS native opener only when the decision is `allow`, `dry_run:false` is explicit, and HTTP carries `x-tinyrustlm-execution-consent: native-opener-v1`. `local-connect-approval-ui` verifies the category list, browser/email preset, approved-app dedupe, full-control acknowledgement and warning, reset path, and no Hugging Face or MiniModel network access; `local-connect-endpoint-ui` verifies the downloaded policy JSON, endpoint app-list rendering with approve/block controls, cross-category app approval rejection in the browser preview, acknowledged full-mode row recomputation, loopback endpoint URL gate, health/category validation, browser dry-run decision, dry-run `open-url` action, unsafe endpoint URL rejection, and no Hugging Face or MiniModel network access against a mock endpoint; `local-connect-rust-endpoint-ui` repeats that browser flow against the actual Rust `serve-approval-endpoint` process.

Local Connect endpoint identity is hash-bound to the exported policy. The browser and Rust gate compute `sha256:<hex>` over the canonical pretty-printed policy JSON plus trailing newline; `inspect-approval-policy` reports `policy.sha256`, and each endpoint route returns `policy_sha256`. The UI refuses health, category, app-list, decision, or action responses whose digest does not match the current browser policy preview.

Local Connect action responses are fingerprinted separately. `/v0/action` returns `action_request_sha256` over the accepted endpoint kind/version, policy digest, category, app, typed action, target kind, target, and dry-run flag; the CLI prints the same value as `action.request_sha256`, and the browser rejects action dry-run responses without a valid request fingerprint.

Endpoint app approvals preserve the row-selected category for an unknown endpoint-listed app in exported `approved_app_bindings`. Known app category drift fails closed before app-level approval, so endpoint inventory cannot rewrite a known browser, email, file, terminal, or secrets app into another approval category.

Blank Hugging Face browse scans a bounded top 500 text-generation model-card page by `Popular` or `New releases` and shows up to the top 100 TinyRustLM-ready candidates it finds (P2P, local `.slm`, `.safetensors`, or reviewable GGUF), and keeps typed search as the broader metadata-search path.

The simple P2P panel can run `Check Peer` against a consenting Known peer URL before a generated import script is downloaded. The browser fetches only `minimodel.peer_status.v0.json`, validates the raw `minimodel.peer_status` envelope, route hints, manifest/artifact/piece SHA-256 evidence, no-embedded-byte/no-project-server flags, and `requires_rust_reverify_before_browser_import=true`, then shows `Live peer status loaded` with `Rust reverify required`. MiniModel local peer serving exposes CORS/PNA headers only on metadata routes such as peer status, peer piece-set, and companion state; chunk files remain non-CORS and still move through the Rust import path.

The simple Hugging Face lane treats rows as model-card metadata until MiniModel metadata names an admitted `.slm`. `Start Conversion` saves a `minimodel.huggingface_conversion_request.v0` JSON file for audit/reuse plus a self-contained local Rust conversion script; the browser reports `Rust conversion script saved` rather than pretending conversion already started. The script embeds that conversion request and writes it beside itself if the JSON file is missing, then requires a user-owned local source file or shard directory and calls one TinyRustLM packer command, `convert-huggingface-request <request.json> <input.safetensors-or-directory> <output-dir> [source-shape] [quantization]`; Rust parses the request, inspects and plans the local `.safetensors` input, verifies the requested source contract when Hugging Face metadata supplied file names, byte counts, and SHA-256 values, converts and validates the `.slm`, validates the sidecar manifest, and writes a `tinyrustlm-conversion.receipt` before any MiniModel sharing step. A source-contract mismatch fails preflight before `.slm` output and records `source_contract_status=fail`; unsafe Hugging Face model ids, unsafe `.safetensors` file names, or unsafe known peer URLs fail before source inspection or output-directory creation; passing runs record expected/verified source file counts, verified SHA-256 count, and expected/actual source bytes in both preflight and receipt evidence. The `huggingface_conversion_cli` Rust integration test now drives the public `tinyrustlm-slm-pack` binary through deterministic single-file and sharded fixture writing, file and shard-directory conversion, output `.slm` validation, source-file-count preflight evidence, receipt evidence, the SHA-256 drift fail-closed path with no `.slm` or receipt output, and unsafe request identifier/known-peer rejection before source reads. The receipt is now a durable bridge from conversion to reuse: it records the MiniModel model id, target `minimodel-peer-share` directory, exact `prepare-peer-share` commands with and without a known peer URL, catalog-entry and peer-piece globs, catalog snapshot and peer-source announcement/feed commands, the local peer-serving command shape, and the rule that only catalog/announcement metadata JSON may be published. When Hugging Face metadata lists safe `.safetensors` siblings, the row and generated handoff name those candidate source files so the user can choose a reviewed local copy; when metadata lists multiple shards, the browser totals their byte counts for large-source warnings and the generated kit records the full file list plus `source_input_mode=safetensors-shard-directory`. The browser still does not download them or request `/resolve/` model-byte routes. The generated script now resolves `TINYRUSTLM_WORKSPACE`, `MINIMODEL_WORKSPACE`, and `TINYRUSTLM_SOURCE_SAFETENSORS` when set, falls back to nearby workspace paths, accepts a reviewed single source file beside the script or under `source/`, and accepts a reviewed shard directory when every listed shard is present under `source/` or `TINYRUSTLM_SOURCE_SAFETENSORS`. After Rust conversion, the script discovers the actual `.slm` and receipt files produced in the output directory; after `minimodel prepare-peer-share`, it discovers the generated manifest, catalog entry, and peer-piece directory instead of guessing filenames. The same script then calls `minimodel write-catalog-snapshot <models.v0.json> <catalog-entry-json>...` so the converted artifact can become loadable metadata later without hosting model bytes, and it writes a local `.minimodel-serve-peer-pieces.ps1` helper that runs `inspect-peer-companion-state` immediately before `serve-peer-companion` when peer-companion state exists and falls back to `serve-peer-pieces` from the user's machine when they explicitly consent to share. MiniModel companion serving now honors path-prefixed peer base URLs such as `http://127.0.0.1:8123/peer-pieces/` by serving the same allow-listed routes under that prefix. If `KnownPeerBaseUrl` is set, the script also writes a peer-source announcement, a `peer-source-announcements.v0.json` feed, a feed-bound `models.with-announcement-feed.v0.json` snapshot, and a `converted-once-p2p-publish.README.txt` that tells converters which metadata files are safe for catalog maintainers and which local byte artifacts must stay off project servers. The app now exposes that reuse path as `Local models.v0.json` / `Load Local Catalog`: a user can load the generated snapshot directly, then Hugging Face search uses those local metadata entries before considering the default MiniModel catalog. MiniModel rows with `peer_hint_status=peer-offer-ready-known-peer-needed` and `peer_import_status=request-script-ready` are shown as proof-ready P2P paths only after the browser sees a complete peer-offer proof envelope: kind, route, proof SHA-256, chunk algorithm, chunk size, chunk count, and Merkle root. `P2P Import` appears immediately only when the MiniModel catalog row also carries validated `peer_source_count` / `peer_sources` metadata for a consenting direct peer; otherwise the row offers `Set Peer URL` and uses the list-level Known peer URL gate first. Both paths reject canonical project/Hugging Face hosts, `www` aliases, subdomains, and trailing DNS-root-dot variants as peer sources before saving a local peer-import request plus Rust verifier script bound to the chosen direct `http://` peer. The generated request pins `metadata_routes` and a `receiver_validation_contract` for peer-status, piece-set preflight, advertised companion-state validation, and receipt inspection; MiniModel inspection reports those route/gate statuses before peer contact. The self-locating script resolves `MINIMODEL_WORKSPACE`, keeps the request JSON, metadata manifest, peer-status check report, preflight report, and verified output directory under `$PSScriptRoot`, can download the small MiniModel manifest metadata from the catalog-provided manifest URL, then calls `minimodel check-peer-status <manifest> <known-peer-base-url> <output-json>` to validate only `minimodel.peer_status.v0.json` metadata before preflight. It then runs `minimodel preflight-peer-import-request` to validate peer-piece and optional companion-state metadata without fetching piece bytes, followed by `minimodel import-peer-request <request-json> <manifest> <output-dir>`, which validates the request against the manifest, validates advertised peer companion state when present, fetches pieces, assembles the `.slm`, verifies the artifact, and writes an import receipt with direct peer transport, peer URL, piece-set SHA-256, companion-state status, chunk/Merkle contract, fetched peer-piece bytes, assembled-from-peer-pieces status, and no-project-server-byte flags. The simple and advanced Hugging Face result rows share action and source-file-note builders, so `P2P Import`, `Set Peer URL`, `Start Conversion`, and safe `.safetensors` hints cannot drift between beginner and developer views. The `hf-search-ui` browser smoke proves the `.safetensors` source-file hint appears in both result surfaces, the generated conversion request/script stay local-only, the conversion script can recreate its own request JSON, writes the peer-serving helper, and uses Rust-produced output discovery rather than hard-coded `.slm` guesses; `hf-local-catalog-ui` proves a loaded local `models.v0.json` makes a matching Hugging Face row show `P2P Import` without fetching the default MiniModel catalog or any Hugging Face `/resolve/` model bytes. TinyRustLM still receives only the final user-selected local `.slm`; broader peer discovery and relay behavior are outside the browser runtime.

GGUF Hugging Face rows use the same metadata-only boundary with a separate review-first kit. When metadata lists safe `.gguf` siblings, the browser records `source_format=gguf`, listed file SHA-256/byte evidence, and `source_input_mode=single-gguf-file`, then saves a PowerShell handoff that resolves `TINYRUSTLM_SOURCE_GGUF`, runs `inspect-gguf`, `plan-gguf-source`, and `convert-gguf-trained`, validates the produced `.slm`/manifest, and writes MiniModel share/catalog/peer-source metadata only after Rust accepts the artifact. The README and script state that only F32/F16/BF16/Q2_K/Q3_K/Q4_0/Q4_1/Q4_K/Q5_0/Q5_1/Q5_K/Q6_K/Q8_0/Q8_1/Q8_K GGUF tensor payloads can convert; GGUF conversion still requires supported tensor names/shapes, tokenizer token-count compatibility, and Rust validation before .slm import; `plan-gguf-source` fails closed when `tokenizer.ggml.tokens` contradicts the target vocab, and BPE source shapes import `tokenizer.ggml.tokens`/`tokenizer.ggml.merges` into the raw source manifest when both are declared. `hf-search-ui` asserts the GGUF row across simple/advanced views plus the generated request, script, README, known-peer propagation, and no Hugging Face `/resolve/` model-byte fetch.

The packer also exposes `inspect-gguf <input.gguf> [output.report]` as a standard-model intake gate. It streams GGUF metadata and tensor-directory bytes, validates alignment, supported GGML tensor encodings, byte bounds, and overlap-free tensor spans, and writes checksum-bearing report rows for review. `plan-gguf-source`, `extract-gguf-source`, and `convert-gguf-trained` now provide the local F32/F16/BF16/Q2_K/Q3_K/Q4_0/Q4_1/Q4_K/Q5_0/Q5_1/Q5_K/Q6_K/Q8_0/Q8_1/Q8_K conversion path for TinyRustLM source shapes: F32 payloads copy into raw source, F16/BF16 payloads decode to raw little-endian f32, Q2_K/Q3_K/Q4_0/Q4_1/Q4_K/Q5_0/Q5_1/Q5_K/Q6_K/Q8_0/Q8_1/Q8_K blocks dequantize to raw little-endian f32, the source manifest is validated, and the existing trained-source converter writes the final `.slm`. GGUF conversion still requires supported tensor names/shapes, tokenizer token-count compatibility, and Rust validation before .slm import; `plan-gguf-source` fails closed when `tokenizer.ggml.tokens` contradicts the target vocab, and BPE source shapes import `tokenizer.ggml.tokens`/`tokenizer.ggml.merges` into the raw source manifest when both are declared.

The `gguf_cli` integration target covers that tokenizer boundary through the public binary: BPE token and merge rows are preserved into `source.manifest`, while tokenizer vocab-count drift fails closed in `plan-gguf-source` before conversion.

The `hf-search-ui` browser smoke now captures three Hugging Face conversion-kit branches from one search result set: normal `.safetensors` `Start Conversion` rows must save a single-file request/script/README, large-source `.safetensors` `Review Conversion` rows must save a shard-directory request/script/README with both shard filenames, `source_input_mode=safetensors-shard-directory`, reviewed-directory placement guidance, and PowerShell shard resolution, and GGUF `Review Conversion` rows must save a GGUF request/script/README with `source_format=gguf`, `TINYRUSTLM_SOURCE_GGUF`, F32/F16/BF16/Q2_K/Q3_K/Q4_0/Q4_1/Q4_K/Q5_0/Q5_1/Q5_K/Q6_K/Q8_0/Q8_1/Q8_K guidance, GGUF tensor-routing and tokenizer boundary warnings, SHA-256/byte hints, and no Hugging Face `/resolve/` byte route.

The `hf-conversion-kit-exec` browser smoke now executes all three generated conversion-kit branches. The normal `Start Conversion` script runs against a deterministic single-file fixture; the large-source `.safetensors` `Review Conversion` script runs against a reviewed deterministic shard directory with local hash/byte evidence in the sidecar request, proving Rust conversion, two verified shard files, MiniModel share metadata, local import receipt plus sender-side receipt ledger inspection, feed/catalog/companion-state inspection, contact-card/book handoffs, peer companion inventory inspection, and no project-server model bytes. The GGUF `Review Conversion` script runs against a reviewed deterministic Q3_K GGUF fixture, proving `inspect-gguf`, `plan-gguf-source` with `dequant-q3_k`, `convert-gguf-trained`, `.slm` validation, MiniModel peer-share metadata, local import receipt plus receipt-ledger inspection, peer-source feed/catalog/companion-state inspection, contact-card/book handoffs, peer companion inventory inspection, and no project-server model bytes.

The same smoke now also executes the exact generated `Review Conversion` script against mismatched local shards without reconciling the advertised source contract. Rust fails closed during preflight with `source_contract_status=fail` and `conversion_decision=source-contract-rejected-before-conversion`; the smoke verifies the script exits nonzero and produces no `.slm`, conversion receipt, or MiniModel peer-share output.

Hugging Face conversion evidence is SHA-256-bound across the local handoff. Every Rust preflight now records `request_sha256=sha256:<hex>` for the browser-saved conversion request, successful receipts also record `output_slm_sha256` plus `output_manifest_sha256` beside the legacy hex64 checksum rows, and `inspect-huggingface-conversion-receipt` revalidates the request, preflight, receipt, `.slm`, and manifest before MiniModel sharing. The generated conversion script runs that inspector immediately after Rust conversion and before `prepare-peer-share`.

Generated P2P import scripts now run `minimodel inspect-peer-import-request <request-json> <manifest>` after request/manifest sidecar setup and before `check-peer-status`. This validates request/manifest identity, no-project-server-byte flags, safe output names, and the exact request SHA-256 without contacting the peer; executed P2P import smokes assert that PASS output before peer status, metadata preflight, and import run.

After `check-peer-status` writes `minimodel.peer_status_check`, generated import scripts now run `minimodel inspect-peer-status-check <status-check-json> <manifest>` before preflight. This revalidates the saved readiness report, status route, strict UTC timestamp, manifest/artifact/piece hashes, and no-byte-transfer boundary without a second peer fetch; executed P2P import smokes assert that PASS output before piece metadata moves.

The saved P2P import `.preflight` report now also records `metadata_routes` and `receiver_validation_contract` status, including each peer metadata route and receiver gate, while still proving `peer_piece_bytes_fetched=false` and `artifact_bytes_fetched=false` before transfer.

Generated P2P import scripts now also run `minimodel inspect-peer-import-preflight <output.preflight> <request-json> <manifest>` after metadata preflight and before piece import, so route/gate or no-byte-transfer drift in the saved report fails before peer pieces move.

Generated P2P import scripts now run `minimodel inspect-import-receipt <receipt.minimodel-receipt> <manifest> <artifact.slm>` after `import-peer-request`, then run `minimodel inspect-peer-import-receipt <receipt.minimodel-receipt> <request-json> <output.preflight> <manifest> <artifact.slm>`. This reparses the receipt, revalidates the manifest and peer-assembled `.slm`, checks peer-transfer evidence, final receiver-validation contract gates, and no-project-server-byte flags, binds the receipt back to the saved request and preflight report, enforces receiver-validation agreement plus strict UTC receipt/preflight timestamp order, and executed P2P import smokes assert both PASS outputs before TinyRustLM imports the local `.slm`.

Generated P2P import scripts now also write `import-receipts.v0.json` under the peer import output directory with `minimodel write-import-receipt-ledger <output-json> <receipt> <manifest> <artifact.slm>`, then immediately run `minimodel inspect-import-receipt-ledger <ledger-json>`. Executed P2P import smokes assert the ledger writer and inspector PASS output, parse the generated metadata-only ledger, and verify the receipt path, receipt/artifact SHA-256 fields, peer-import counts, and peer-transfer gates before browser import.

The local `.slm` file picker can also receive the matching `.minimodel-receipt` sidecar in the same selection. The browser validates receipt shape, strict UTC timestamp, model id, manifest/artifact SHA-256 values, artifact byte count, SLM shape/quantization/evidence fields, `import.next_gate`, peer path hints, peer base URL, companion-state URL/status, fixed chunk mode, final receiver-validation contract gates, peer-transfer fields, companion metadata flag, and no-project-server-byte flags before showing `MiniModel P2P receipt` status and `minimodel-p2p-import-receipt` provenance for peer-assembled imports. After Rust/WASM accepts the local model, the Provenance panel renders receipt hash/time, sidecar name, evidence status, manifest SHA-256, quantization, receiver-validation status, peer URL, companion route/status, chunk count, artifact SHA-256, and browser-load readiness across the Source Snapshot, Source Review, Review Routes, Review Artifacts, and Source Validation rows. The picker accepts exactly one `.slm` and at most one receipt sidecar; `local-import-ambiguous-selection` proves multiple selected `.slm` files or multiple receipts fail closed before model selection. The `hf-p2p-import-kit-exec` browser smoke asserts those receipt provenance rows on a valid import, while `hf-p2p-import-receipt-reject` mutates the receipt artifact SHA-256, `peer_companion_state_metadata_fetched`, `receiver_validation.import_receipt_required_before_browser_load`, `receiver_validation_contract.status`, and `receipt.created_utc`, proving each receipt drift fails closed before selecting the local model.

The simple P2P panel and Advanced source details can also load a local `minimodel.import_receipt_ledger.v0` JSON ledger as metadata-only receipt inventory. The browser validates the ledger kind/version, strict UTC time, metadata-only/no-byte boundary, entry/model/peer-import counts, per-entry local path hints, receipt/manifest/artifact SHA-256 fields, peer-import gates, direct peer URL shape, duplicate receipt paths, and no-project-server-byte flags, then displays the ledger SHA-256 with `Rust reverify required`; `minimodel inspect-import-receipt-ledger <ledger-json>` remains the local trust gate before any ledger is treated as authoritative.

The same P2P panels can load a local `minimodel.peer_status_check` JSON report produced by `minimodel check-peer-status`. Browser validation checks the check kind/version, strict UTC timestamp, validated status, normalized direct peer base URL, exact status route, model id, peer-status/piece-set/companion routes, manifest/artifact/piece SHA-256 fields, artifact byte count, piece count, and no-peer-piece/no-artifact/no-project-server-byte boundary. Passing reports show the peer URL, piece count, artifact size, companion route, report SHA-256, and `Rust reverify required`; `peer-status-check-ui` covers valid and drifted local reports without Hugging Face or MiniModel network requests. MiniModel `inspect-peer-status-check` is the authoritative saved-report recheck for generated receiver scripts.

The same P2P panels can load a local `minimodel.peer_companion_inventory.v0` JSON file as a future-companion handoff preview. The browser validates kind/version, strict UTC time, safe known-peer URL, share-state fields, piece-store byte/quota/SHA-256 evidence, receipt-ledger metadata, optional peer contact cards, command hints, serve-plan routes/preflight flags, no-model-byte/no-peer-piece-byte flags, and `rust_reverify_required_before_trust=true`, then displays model id, piece count, store/quota bytes, piece-store SHA-256, receipt count, contact-card count, serve-plan status route, and the inventory SHA-256. TinyRustLM still treats the inventory as metadata only; Rust `inspect-peer-companion-inventory <inventory-json>` remains the local trust gate before companion use.

The Hugging Face status line also reports availability buckets after each search: external records, P2P-ready matches, proof-ready matches that need one consenting peer URL, metadata matches that still need a local `.slm`, external `.slm` listings that need local review, and models that need Rust conversion. The simple Hugging Face panel renders the same state as compact availability chips (`P2P Import`, `Set Peer URL`, `Start Conversion`, `Review First`, `Local .slm`, `No Source`, and `P2P Off` when applicable) so the beginner view shows which path is actually available before a user opens any row. Catalog-declared peer-source announcement feeds may be valid but empty; TinyRustLM verifies the feed SHA-256, `minimodel.peer_source_announcement_catalog` envelope, no-project-server flags, duplicate model/peer rules, and peer-offer route/checksum/chunk-count/Merkle match before applying them. MiniModel `inspect-peer-source-announcement-feed <feed-json>` can preflight the same metadata-only feed envelope locally, rejects feed JSON above 4 MiB before parsing, and reports exact feed bytes plus SHA-256 before a maintainer binds it or a receiver applies it. Empty feeds are reported as "availability checked, no peer sources published yet" and do not promote rows to `P2P Import` until a matching announcement names a consenting peer. Oversized catalog-declared feed route bodies are reported as `Peer-source announcement metadata exceeded browser budget`, ignored before JSON parse/checksum/application, and leave proof-ready rows at `Set Peer URL` without saving a peer import kit. The first-run chat transcript is empty until real generation output exists; the composer exposes only implemented controls, and Enter-to-send uses the same submit path as the Send button while Shift+Enter stays a newline.

The local P2P file picker now accepts either a single peer-source announcement or a full `peer-source-announcements.v0.json` feed envelope. Both the simple P2P panel and Advanced source details label this as `Peer-source announcement/feed JSON`, and `hf-peer-announcement-ui` proves a local `minimodel.peer_source_announcement_catalog` feed can be applied to a proof-ready `models.v0.json` snapshot before Hugging Face search promotes the matching row to `P2P Import`. The paired `hf-peer-announcement-reject-ui` smoke proves a duplicate same-model/same-peer feed is rejected, leaves the row at `Set Peer URL`, and saves no peer import kit. The `hf-peer-announcement-budget-ui` smoke proves an oversized local feed is rejected at the browser metadata budget before JSON parse or peer-source application, leaves the row at `Set Peer URL`, and saves no peer import kit. The `hf-catalog-announcement-route-budget-ui` smoke covers the same budget boundary for catalog-declared route responses. The matching Rust CLI preflight is `minimodel inspect-peer-source-announcement-feed <feed-json>` for local operators who want the same envelope, duplicate-row, no-project-server, exact byte count, SHA-256, and 4 MiB pre-parse budget check before loading the file in the browser.

The simple P2P panel and Advanced source details can also load a local `minimodel.peer_contact_card` JSON file or a `minimodel.peer_contact_book.v0` JSON file. The browser validates card kind/version, direct HTTP transport, reviewed consent status, printable peer labels, normalized known-peer URLs, top-level and boundary no-project-server serve/run/proxy flags, book-level no-model-byte/no-peer-piece/no-catalog-claim flags, embedded card SHA-256s, duplicate peer URL rejection, `metadata_only=true`, and `requires_rust_reverify_before_browser_import=true` before using it. A passing card fills the list-level Known peer URL; a passing book renders every reviewed card as a local peer chooser, defaults to the first peer, and lets the user switch to another reviewed peer before the same Known peer URL drives `P2P Import`. Both paths immediately refresh proof-ready rows so they use the same request/script path, while a failing file leaves the URL unchanged. The `hf-peer-contact-card-ui` and `hf-peer-contact-book-ui` browser smokes run against the packaged TinyRustLM.com root, proving the public-root controls, Known peer URL status, book peer selection, and generated P2P import request/script stay aligned outside the source `/app/` route. The `hf-peer-contact-card-reject-ui` and `hf-peer-contact-book-reject-ui` smokes run the same root package with unsafe metadata; the UI reports the unsafe flag, leaves the proof-ready row at `Set Peer URL`, and does not save a peer import request/script. Cards and books never contain `.slm` bytes, peer pieces, catalog `peer_sources`, or announcement claims.

Peer URL, peer contact card/book, and P2P toggle refreshes rerender the accepted Hugging Face result rows without re-normalizing them as raw API payloads, so `.safetensors` source metadata and source-backed `Start Conversion` / `Review Conversion` fallbacks survive after a `P2P Import` handoff or KnownPeerBaseUrl change.

After a local `.slm` is imported and accepted by Rust/WASM, the P2P panel also enables `Save Share Metadata` and `Save P2P Share Kit`. The metadata export writes `minimodel.local_slm_share_metadata.v0` with the catalog-entry candidate, artifact byte count/SHA-256, per-chunk SHA-256 rows, chunk-list SHA-256, Merkle root, optional bound Hugging Face conversion request, `peer_transfer_status=metadata-only`, and no-project-server-byte flags. The share kit writes a second bundle for the same artifact that marks `peer_transfer_implementation=generated-local-minimodel-share-kit-v0`, `offer_status=local-share-kit-ready-known-peer-needed`, `local_share_kit_available=true`, and direct MiniModel peer protocols while still keeping `network_transfer_available=false` until the user runs local scripts and consents to a peer URL. MiniModel `inspect-share-metadata` validates both exported bundle shapes, including project-server-byte flags, chunk-list SHA-256, Merkle root, and the share-kit-ready no-live-transfer boundary. The share kit also writes a local `.minimodel-share-kit.ps1` script that resolves `MINIMODEL_WORKSPACE`, finds the verified artifact from `TINYRUSTLM_LOCAL_SLM`, beside the script, or under `source/`, verifies byte count and SHA-256 with `Get-FileHash`, runs `minimodel prepare-peer-share`, writes and inspects a local `.minimodel-receipt`, writes and inspects metadata-only `import-receipts.v0.json` with `peer_import_count=0` for sender-side companion/audit use, optionally writes `add-peer-source`, `write-peer-source-announcement`, `write-peer-source-announcement-feed`, `write-catalog-snapshot-with-announcement-feed`, `inspect-catalog-snapshot`, `write-peer-companion-state`, `inspect-peer-companion-state`, `write-peer-contact-card`, `write-peer-contact-book`, `inspect-peer-contact-book`, and peer companion inventory output when the user sets a consenting `KnownPeerBaseUrl`, always writes and inspects a metadata-only `models.v0.json` snapshot, and prints the direct `inspect-peer-companion-state` command before `serve-peer-companion`, or `serve-peer-pieces` when no companion state exists. The same action also downloads a `.minimodel-serve-peer-pieces.ps1` helper that resolves the generated manifest and peer-piece directory, defaults to `127.0.0.1:8123`, and runs `inspect-peer-companion-state` immediately before `serve-peer-companion` when generated state exists or `serve-peer-pieces` otherwise only from the user's machine. The scripts tell users to send only metadata JSON to catalog maintainers and not to upload `.slm` files or peer pieces to project servers. `share-metadata-ui` asserts both bundle shapes, runs `minimodel inspect-share-metadata` against the actual metadata-only and share-kit downloads, checks the script commands including feed, catalog, receipt-ledger, and companion-state inspectors, the local hash verification, the final `P2P share kit saved locally` state, and the absence of Hugging Face or MiniModel remote requests during export. `share-metadata-import-ui` loads a local `minimodel.local_slm_share_metadata.v0` bundle back into the P2P panel as checksum-bound metadata for matching a local `.slm`; it validates the browser-side chunk-list SHA-256, Merkle root, artifact SHA/byte count, no-project-server flags, and share-kit-ready boundary, but it does not expose `P2P Import` until the user runs the share kit and loads the generated `models.v0.json`/manifest metadata. The same import smoke is green against the packaged TinyRustLM.com root through mapped `http://tinyrustlm.com:<port>/`, including chunk-list drift rejection, wrong local `.slm` rejection, matching local `.slm` Rust/WASM load and generation, and an app/runtime-only network trace.

For reviewed automation, the generated `.minimodel-share-kit.ps1` also accepts `MINIMODEL_KNOWN_PEER_BASE_URL` as the consenting peer URL override, while preserving local artifact hash and byte verification before any metadata is written. The `share-metadata-kit-exec` browser smoke executes the actual browser-downloaded share kit, checks the generated MiniModel manifest, peer offer, catalog snapshot, with-peer catalog entry, local import receipt, sender-side receipt ledger, peer-source announcement/feed, receipt-ledger PASS output, feed-inspector PASS output, catalog-inspector PASS output, companion state, companion-state inspector PASS output, peer contact card, peer contact book, contact-book inspector PASS output, peer companion inventory, inventory inspector PASS output, and serve-helper companion-state inspection, starts `serve-peer-companion` on the local path-prefixed peer URL after validating that the printed serve hint and serve helper both inspect companion state, then runs `check-peer-status` and verifies the status report remains metadata-only with no peer-piece or artifact bytes fetched. The same mode is green against the packaged TinyRustLM.com root through mapped `http://tinyrustlm.com:<port>/`, so public-host share-kit export is covered alongside source `/app/`.

Generated conversion kits and local share kits now run `minimodel inspect-peer-source-announcement-feed` immediately after writing `peer-source-announcements.v0.json`; the feed-bound catalog snapshot is created only after that Rust feed preflight passes. They also run `minimodel inspect-catalog-snapshot` after writing normal and feed-bound `models.v0.json` snapshots, `minimodel inspect-peer-companion-state` after writing companion handoff state, `minimodel inspect-import-receipt-ledger` after writing sender-side `import-receipts.v0.json`, and `minimodel inspect-peer-companion-inventory` after writing companion inventory metadata. Feed/catalog inspectors report exact byte/SHA evidence and reject JSON above 4 MiB before parsing. The executed-kit smokes assert the MiniModel receipt-ledger, feed, catalog, companion-state, and companion-inventory validation PASS output, so this is covered as live script behavior rather than only a documented follow-up command.

A later optional MiniModel Peer Companion may make the advanced peer work easier by managing local peer identity, local piece stores, cache quotas, consent prompts, direct serve/fetch controls, receipts, and TinyRustLM handoff. That companion remains user-run local software and must reuse the Rust verifier/import contracts; it does not make TinyRustLM.com, MiniModel.org, or the browser app host, proxy, run, cache, or serve model bytes.

Local development hosting uses the no-crate Rust server in `tools/local_server/`. It serves only the checked-in static tree over loopback, supports `GET` and `HEAD`, rejects traversal paths, and keeps Visual Studio F5 on the Rust toolchain path. The no-crate Rust mini browser harness in `tools/browser_harness/` audits the static app contract and can probe loopback routes before headless browser automation. The older Node server remains only as a narrow fallback utility. Browser smoke maps `tinyrustlm.com` to loopback for local `http://tinyrustlm.com:PORT/` public-host simulations and marks that mapped HTTP origin secure so browser SHA-256 file checks can run; it does not remap the real live `https://tinyrustlm.com/` target unless explicitly requested. The public local-only smoke must prove the deployed page reaches `wasmState=loaded`, leaves the model boundary at `choose a local .slm file`, and makes no `/models/`, Hugging Face, or MiniModel catalog requests before user action. The public-host `catalog-local-import` smoke imports a real fixture `.slm`, verifies SHA-256/provenance, runs Rust/WASM generation, and still uses local files rather than project-hosted model bytes. The public-host `local-import-ambiguous-selection` smoke proves the root package rejects duplicate `.slm` or duplicate receipt selections without choosing a local model. The public-host `peer-url-unsafe-ui` smoke proves unsafe Known peer URLs, including project/Hugging Face root-dot and subdomain host variants, fail closed before script/request generation while the normal path-prefixed MiniModel loopback URL is accepted. The public-host `share-metadata-kit-exec` smoke imports a verified local `.slm`, saves the P2P share kit from root assets, executes the exact downloaded share/serve scripts including direct serve-hint and serve-helper companion-state inspection, starts local companion serving, and validates `minimodel.peer_status.v0.json` without fetching peer-piece or artifact bytes. The public-host `hf-p2p-import-kit-exec` smoke runs the packaged root through the same converted-once-to-P2P path as the source app: root assets load from `http://tinyrustlm.com:<port>/`, metadata remains catalog/manifest/feed only, model bytes come from the consenting peer at `http://127.0.0.1:8123/peer-pieces/`, Rust verifies the path-prefixed peer status, companion-aware preflight, import receipt, generated receipt ledger, and final `.slm` SHA-256, then the browser imports that peer-assembled `.slm` as the local model and runs generation. The public-host `hf-p2p-import-receipt-reject` smoke uses the same path but tampers the receipt sidecar before browser import and proves receipt drift is rejected without project-hosted model bytes.

## Data Structures

JavaScript tracks the WASM instance, selected local model path, optional selector registry fields, selected local model manifest, selected local adapter sidecar metadata, fetched module-plan receipt fields, fetched adapter-family receipt fields, fetched adapter manifest fields, live module-plan trace checkpoints, local conversation transcript, max-token control, decoding controls, Step Token enablement, host-side benchmark timing, exports, UTF-8 encoder/decoder, DOM nodes, and typed-array views over WASM memory. Rust owns runtime state, including the bounded `last_result` transfer buffer and diagnostics fields for `adapter_apply_count`, `last_adapter_checksum`, and `assembly_state_checksum`. Model load seeds the assembly checksum, each accepted adapter apply folds the adapter package into it, and free or load failure clears the assembly fields. The transcript is browser-local UI state only: generation appends User and TinyRustLM entries with DOM text nodes, Step Token appends one decoded token to the current response and latest TinyRustLM turn, Reset clears runtime context and output without clearing transcript history, and Clear empties the transcript. The Rust mini browser harness tracks required app ids, local file routes, selector-registry markers, manifest fields, loopback HTTP status, and content types as a test-only contract surface.

## Binary Formats

The Rust local server serves `runtime/tinyrustlm.wasm`, `runtime/tinyrustlm.wasm.manifest`, selected local `.slm` files under `models/`, local `.slm.manifest` sidecars, checked tiny f32/q8_0/q4_0 self-`ADP1` sidecars, generated registry-carried `.adp1`, `.asp1`, and `.alr1` sidecars, generated `.adapter-family.receipt` files, generated `.assembly.receipt` files with evidence routes, and an optional `models/selector.registry`.

Before instantiating the runtime, JavaScript fetches `tinyrustlm.wasm.manifest`, checks the runtime kind, status, path, byte count, checksum, and next gate, then fetches the WASM bytes and recomputes the same local 64-bit checksum used by packer provenance text. `tinyrustlm-slm-pack browser-multi-parent-bundle` writes a fresh manifest beside every generated bundle runtime, and `runtime-wasm-manifest` refreshes the checked runtime manifest after a local rebuild.

When that registry exists and passes the browser's simple route filter, the selector options come from admitted `../models/*.slm` entries; otherwise the checked-in deterministic smoke list remains active. The `multi-parent-registry` browser smoke mode serves a local selector registry entry for `multi-parent-sign-merge-q8`, loads that entry through the browser selector, then proves the model and manifest stay on the local `../models/*.slm` route while Rust still owns `.slm` admission. The `multi-parent-registry-file` mode is file-backed: `tinyrustlm-slm-pack browser-multi-parent-bundle` writes runnable TinyRustLM roots with app shell, WASM runtime, generated f32/q8_0/q4_0 sign-merge model, manifest, selector registry, module-plan receipt with `browser-constrained-v1` profile, `single-threaded-wasm-local-v1` execution profile, `module_plan_fetch_policy=local-no-store-v1`, `module_plan_origin_policy=same-origin-loopback-local-v1`, and `module_plan_runtime_scratch_byte_budget=65536`, assembly receipt, and evidence chain, and the browser loads `multi-parent-sign-merge-f32`, `multi-parent-sign-merge-q8`, or `multi-parent-sign-merge-q4` from those served files. The `combined-selector-assembly` smoke uses one generated `all` root, confirms q4_0 is selected before scripted switching, then walks q4_0, q8_0, and f32 entries while proving each module-plan receipt is requested before that entry's model bytes and each compatible adapter stack is auto-applied before generation.

The generated bundle also writes matching self and family `.adp1` packages, a sparse `.asp1` package, a source-backed low-rank `.alr1` package converted from a reviewed adapter source template, their manifests, a served adapter-family receipt, and selector registry adapter-family fields so `adapter-sidecar-registry-file` can display all four registry-supplied sidecars and auto-apply the receipt-declared compatible stack after loading the generated model. Registry-backed models must also carry `entry.N.eval_case_evidence_checksum`, which the browser renders in Model Provenance and matches against the generated assembly receipt before evidence is accepted. If that assembly digest differs after receipt checksum verification, the browser frees the accepted model, records `assembly evidence rejected`, and does not request evidence or adapter-family routes. The selector entry can also carry `entry.N.module_plan_*` fields pointing at a served `.module-plan.receipt`; JavaScript fetches and checksum-verifies that plan before requesting the generated `.slm`, then matches the plan's `browser-constrained-v1` profile, `single-threaded-wasm-local-v1` execution profile, `local-no-store-v1` fetch policy, `same-origin-loopback-local-v1` origin policy, resource class, admitted model byte budget, adapter-family byte budget, runtime scratch byte budget, model, manifest, assembly receipt, adapter-family receipt, adapter-stack members, ordered module byte counts, ordered module checksums, ordered module assembly slots, ordered module role labels, ordered module phases, and ordered module dependency edges against selector metadata. The Module Plan panel renders the verified receipt status, kind, resource class, execution profile, fetch policy, origin policy, module count, model byte budget, adapter byte budget, runtime scratch byte budget, ordered module byte summary, ordered module checksum summary, ordered module slot summary, ordered module role summary, ordered phase summary, ordered dependency summary, live browser assembly trace, model path, and receipt-declared stack routes; checked fallback models render `none` with unavailable fields. Blend, task-delta, sparse task-delta, raw ADP1 adapter-delta packages, sparse ASP1 adapter-delta packages, low-rank ALR1 adapter-delta packages, and sign-merge evidence files are offline packer artifacts except for explicit checked local sidecars: the tiny fallback routes offer `../models/tiny-test-model-self.adp1`, `../models/tiny-test-model-q8-self.adp1`, and `../models/tiny-test-model-q4-self.adp1`; generated registries can offer compatible local f32/q8_0/q4_0 `ADP1`, `ASP1`, or source-backed `ALR1` routes plus receipt handles; JavaScript checks selected adapter artifact checksums before copying bytes into WASM; and Rust validates each compatible package before mutation.

Each `.slm` candidate still must pass candidate manifest, promotion, runtime-smoke/eval, admission, and selector registry gates before the browser selector can route it. The browser copies model bytes into WASM memory and calls `load_model`. After Rust accepts the model, JavaScript fetches the matching local `.slm.manifest` sidecar and renders source kind, admission status, quality claim, trained-quality claim, checksum, and required next gate. The default fallback model is `models/tinylm16-q8.slm`; TinyLM-16M q4_0, f32, tiny byte-tokenizer fixtures, the tiny BPE fixture, and the tiny tied-output fixture remain selectable for regression checks.

For generated registry adapter families, the browser first verifies the module-plan receipt when one is declared. It then fetches the served `.adapter-family.receipt` and each served `.adp1.manifest`, `.asp1.manifest`, or `.alr1.manifest` after model and manifest load, recomputes text checksums, verifies the receipt kind/status/strategy/count, verifies each adapter manifest's route-derived artifact kind/status/dtype/apply status, and matches each member's route, manifest route, label, apply status, artifact checksum, manifest checksum, manifest byte count, and shared base-quantization adapter identity before the options are enabled. The `.alr1` route accepts both deterministic task-delta and source-backed manifest kind/dtype pairs while Rust remains the package authority. The same receipt declares an ordered auto-apply stack; the browser verifies stack status, strategy, count, indexes, paths, and aggregate manifest-declared artifact bytes, fetches and checksum-checks every stack member, calls Rust `validate_adapter_delta` for every fetched member, and only then transfers the same bytes through `apply_adapter_delta`. After generated stack apply, runtime diagnostics must show the expected stack count and nonzero adapter plus assembly checksums before generation.

## Failure Cases

Fetch failure, missing model files, runtime manifest mismatch, WASM instantiation failure, allocation failure, model rejection, UTF-8 transfer failure, model reload failure, missing manifest sidecars, context overflow, output-buffer overflow, and generation errors render in the UI. Model-specific failures disable Generate and Reset while keeping model selection available for recovery after the WASM runtime is loaded. A manifest-sidecar failure does not replace Rust model admission; it leaves inference available while making provenance unavailable.

## Validation Rules

JavaScript does not parse model or adapter bytes in the UI path. It only transfers them. JavaScript parses the line-based runtime WASM manifest before instantiation, selector registry metadata before loading a model, optional generated module-plan receipts before fetching generated model bytes, the local `.slm.manifest` sidecar after Rust accepts the model, and generated adapter-family receipts plus adapter manifests before enabling family choices. Registry entries must be `admitted-records-only`, must have admitted entry status, and must route to `../models/*.slm` without traversal or remote markers.

Optional registry adapter fields must route to `../models/*.adp1`, `../models/*.asp1`, or `../models/*.alr1`, carry sidecar manifest paths, and use the apply status that matches the route format and entry quantization: ADP1/ASP1 f32 entries use `runtime-f32-compatible-or-fuse-to-slm`, ADP1/ASP1 q8_0 and q4_0 entries use `runtime-q8-q4-compatible-or-fuse-to-slm`, ALR1 f32 entries use `runtime-f32-compatible-low-rank`, and ALR1 q8_0/q4_0 entries use `runtime-q8-q4-compatible-low-rank`. Single-adapter registries use the legacy `entry.N.adapter_path` fields; adapter-family registries add `entry.N.adapter_count`, indexed `entry.N.adapter.K.*` fields, optional `entry.N.adapter_family_*` receipt metadata, explicit `entry.N.adapter_auto_apply_stack_*` fields, optional `entry.N.module_plan_*` fields, `entry.N.eval_case_evidence_checksum`, and served `.module-plan.receipt` files for generated self-assembly. Adapter sidecar routes must stay under `../models/*.adp1`, `../models/*.asp1`, or `../models/*.alr1` without traversal or remote markers; adapter-family receipt routes must stay under `../models/*.adapter-family.receipt`, module-plan routes must stay under `../models/*.module-plan.receipt`, each receipt route must carry a hex checksum and expected status/kind/strategy/profile/execution-profile fields, and generated module plans must match profile, execution profile, resource class, model byte budget, adapter byte budget, runtime scratch byte budget, model, manifest, assembly receipt, adapter-family receipt, module byte counts, module checksums, module roles, module assembly slots, module phases, module dependency edges, and every declared stack member. The fetched receipt checksum, fetched model byte count, fetched manifest text byte count, fetched receipt text byte counts, fetched adapter-manifest checksums, manifest-declared adapter artifact byte counts, eval-case checksum, each module checksum, each receipt member, each receipt role, each receipt assembly slot, each receipt phase, each dependency edge, and each stack member must match the selector metadata before the browser exposes or auto-applies those options. On apply, the fetched local ADP1/ASP1/ALR1 bytes must match the selected route's artifact checksum before WASM transfer.

Temperature, top-k, top-p, and seed controls are clamped in JavaScript, then passed through `set_sampling_config`; Rust validates and owns sampling with a fixed 1024-candidate cap. Rust returns explicit error codes and readable result text for the UI. Generated output decoded into `last_result` is capped at 64 KiB; byte and BPE tokenizer decode paths return `OutputBufferExceeded` before replacing the old result, and full `generate` failures clear token/cache diagnostics. `generate_next_token` follows that same ABI rule: it returns an `ErrorCode`, writes decoded token text into `last_result`, and exposes the selected token id in diagnostics. `validate_adapter_delta` accepts bytes copied into WASM memory, runs the same compatible raw `ADP1`, sparse `ASP1`, or low-rank `ALR1` model-aware checks as apply, writes `adapter validated` to `last_result`, and preserves generation/KV diagnostics. `apply_adapter_delta` accepts bytes copied into WASM memory, validates compatible packages against the loaded f32, q8_0, or q4_0 model, applies them in place, re-quantizes compact q8_0/q4_0 tensors when needed, writes `adapter applied` to `last_result`, and clears generation/KV diagnostics on success. The browser Step Token control is disabled until generation context exists, then stays available across transcript Clear and disables after runtime Reset, failed generation, or successful adapter apply.

The Rust mini browser harness validates the checked-in app tree for required UI ids, selector registry fetch markers, model route declarations including the tied-output fixture, adapter route declarations, runtime manifest fields, adapter stack and module-plan strategy/profile/execution-profile markers, local-only markers, Rust WASM export definitions, and optional loopback HTTP content types. The Rust local server is smoke-tested with direct HTTP probes for `/app/`, `/runtime/tinyrustlm.wasm`, `/runtime/tinyrustlm.wasm.manifest`, `.slm`, and `.slm.manifest` routes. `tools/browser-smoke.js` verifies the UI by loading the app in headless Chrome or Edge, clicking Generate, clicking Step Token, reading rendered output and diagnostics, asserting transcript entries, Clear-click behavior, Step Token enablement, and Clear-button state, auditing desktop/mobile product-shell structure, checking default greedy sampling controls, checking the provenance panel, checking the Module Plan panel's fallback and generated-receipt fields including visible execution profile, model, adapter, and runtime scratch budgets, byte summaries, checksum summaries, slot summaries, role summaries, phase summaries, dependency summaries, and the live trace from plan verification through stack apply, applying the checked f32/q8_0/q4_0 adapter sidecars, applying an intercepted registry-supplied q8_0 adapter sidecar, fetching generated module-plan receipts before generated model bytes, checking module-plan profile, execution profile, resource, runtime scratch, graph, stack, role, slot, phase, byte-count, checksum, and dependency drift before generated model or adapter-stack routes, checking assembly eval-case drift before evidence or adapter-family routes, validating and auto-applying the generated registry-supplied family ADP1 plus sparse ASP1 plus source-backed low-rank ALR1 adapter stack after the receipt and adapter manifest requests, asserting the Rust diagnostics assembly count and checksums for generated stacks plus checked manual sidecars, walking one combined generated selector root through q4_0, q8_0, and f32 verified self-assembly, checking runtime manifest drift handling, checking repeated q8/q4 generation with reset, intercepting malformed local model bytes, intercepting missing local model files, serving a multi-parent selector registry fixture, loading a generated served multi-parent bundle, submitting an over-context prompt, running endurance loops, and asserting local-only network requests.

## Future Expansion Path

Later UI work can add richer benchmark charts and a reviewed trained-model selector once real trained weights and assistant-quality evidence exist. The first selector registry path is intentionally small: it supplies admitted local routes but does not replace Rust `.slm` validation or provenance sidecars. Missing-file UI coverage, context overflow rendering, malformed model rejection, repeated q8/q4 loops, transcript rendering, desktop/mobile shell audit, provenance-panel audit, endurance loops, sampling ABI validation, invalid UTF-8 WASM ABI checks, single-token stepping, and model-free behavior are covered by smoke tools. Tokenizer detail, logits summary, top-k candidates, KV cache length, quant mode, active sampling config, host-side benchmark timing, transcript history, and model quality boundary are already exposed in the UI.
