diff --git a/.github/workflows/release-candidate.yml b/.github/workflows/release-candidate.yml index 6dec9010..2fe01b93 100644 --- a/.github/workflows/release-candidate.yml +++ b/.github/workflows/release-candidate.yml @@ -58,24 +58,24 @@ jobs: name: snapmaker-studio-installer path: rc - - name: Download the published v1.1.0 installer, verify its checksum + - name: Download the published v1.5.0 installer, verify its checksum shell: pwsh run: | $ErrorActionPreference = "Stop" if ($env:GITHUB_ACTIONS -ne 'true' -or $env:RUNNER_ENVIRONMENT -ne 'github-hosted' -or [string]::IsNullOrWhiteSpace($env:ImageOS) -or $env:GITHUB_REPOSITORY -ne 'DVOpenLabs/snapmaker-studio' ` -or $env:ACT -or $env:WDAGUtilityAccount) { throw 'Disposable preflight failed.' } - $url = "https://github.com/DVOpenLabs/snapmaker-studio/releases/download/v1.1.0/Snapmaker.Studio_1.1.0_x64-setup.exe" - $dest = "old\Snapmaker.Studio_1.1.0_x64-setup.exe" + $url = "https://github.com/DVOpenLabs/snapmaker-studio/releases/download/v1.5.0/Snapmaker.Studio_1.5.0_x64-setup.exe" + $dest = "old\Snapmaker.Studio_1.5.0_x64-setup.exe" New-Item -ItemType Directory -Force -Path old | Out-Null Invoke-WebRequest -Uri $url -OutFile $dest $hash = (Get-FileHash -Algorithm SHA256 $dest).Hash.ToLower() - $expected = "b41931774eac5586bc31746599d4a637e89eda195c620067dc1c756281b217ee" + $expected = "d443f64f5167239f1422c719882cf245cff5d00d40c55fb67fc5a1e497b84e82" if ($hash -ne $expected) { - throw "Downloaded v1.1.0 installer hash $hash does not match the published $expected" + throw "Downloaded v1.5.0 installer hash $hash does not match the published $expected" } - Write-Host "v1.1.0 installer verified: $hash" + Write-Host "v1.5.0 installer verified: $hash" - - name: Install v1.1.0 (default path), record its registration + - name: Install v1.5.0 (default path), record its registration shell: pwsh run: | $ErrorActionPreference = "Stop" @@ -90,14 +90,14 @@ jobs: if ((Test-Path -LiteralPath $userKey) -or (Test-Path -LiteralPath $machine64Key) -or (Test-Path -LiteralPath $machine32Key) -or (Test-Path -LiteralPath $rememberedKey) -or (Test-Path ` -LiteralPath $manufacturerKey) -or (Test-Path -LiteralPath $defaultExe) -or (Get-Process -Name 'snapmaker-studio-desktop' -ErrorAction SilentlyContinue)) { throw ` 'Initial exact production state is not clean.' } - $old = (Resolve-Path "old\Snapmaker.Studio_1.1.0_x64-setup.exe").Path + $old = (Resolve-Path "old\Snapmaker.Studio_1.5.0_x64-setup.exe").Path $p = Start-Process -FilePath $old -ArgumentList '/S', '/NCRC' -PassThru -Wait - if ($p.ExitCode -ne 0) { throw "v1.1.0 silent install failed, exit $($p.ExitCode)" } + if ($p.ExitCode -ne 0) { throw "v1.5.0 silent install failed, exit $($p.ExitCode)" } Start-Sleep -Seconds 2 $beforePath = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\Snapmaker Studio' - if (-not (Test-Path -LiteralPath $beforePath)) { throw 'Exact v1.1.0 registration is absent' } + if (-not (Test-Path -LiteralPath $beforePath)) { throw 'Exact v1.5.0 registration is absent' } $beforeProps = Get-ItemProperty -LiteralPath $beforePath - if ($beforeProps.DisplayVersion -ne "1.1.0") { throw "v1.1.0 registration says DisplayVersion=$($beforeProps.DisplayVersion), expected 1.1.0" } + if ($beforeProps.DisplayVersion -ne "1.5.0") { throw "v1.5.0 registration says DisplayVersion=$($beforeProps.DisplayVersion), expected 1.5.0" } # NSIS can write InstallLocation wrapped in literal quote # characters (part of the string value itself, not just how it # displays) — trim them unconditionally so every later @@ -112,7 +112,7 @@ jobs: if ($installLocation -ne (Join-Path $env:LOCALAPPDATA 'Snapmaker Studio')) { throw 'First install did not use the exact default path.' } "owned_uninstaller=$ownedUninstaller" >> $env:GITHUB_ENV "owned_uninstaller_sha256=$((Get-FileHash -LiteralPath $ownedUninstaller -Algorithm SHA256).Hash)" >> $env:GITHUB_ENV - Write-Host "v1.1.0 installed at $installLocation, DisplayVersion 1.1.0" + Write-Host "v1.5.0 installed at $installLocation, DisplayVersion 1.5.0" pwsh -NoProfile -File .github/scripts/ci-assert-registry.ps1 -Action Assert -InstallDir $installLocation -OutFile $env:RUNNER_TEMP\rc-before.json if ($LASTEXITCODE -ne 0) { throw 'Registry assertion failed.' } diff --git a/CHANGELOG.md b/CHANGELOG.md index 16acd56d..e3c06642 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,37 @@ All notable changes to this project are documented here. The format is based on ## [Unreleased] +## [1.5.1] - 2026-10-09 + +**Clearer Prepare, easier spool choices, and controls that work from the keyboard and with a screen reader.** + +### Added +- **Choose any spool from your inventory** (Project Materials). Each slot can open the provider's + whole spool list, searchable by vendor, material, colour or id, showing colour, vendor, material, + spool id, weight status and the status of the mapped Orca preset. When a spool is picked with no + Orca preset, the slot and the review say the project's existing filament preset will remain. +- **Forget saved mapping.** A mapping Studio remembered for one spool, or for similar spools, can be + forgotten from the slot. The confirmation says what is forgotten and what is not changed (your + inventory, your Orca presets and the project). +- **Why a setting changed.** The Prepare summary shows a short reason under each setting Studio + changed for the U1 and labels where the statement comes from: "Studio's check" or "Verify in + Snapmaker Orca". Lists Studio had to repair say exactly what was done. +- **User guide links.** Help and Get Started link to the task-first user guide, which shows where + each statement comes from and which Studio version it was checked against. Its screenshots were + captured from v1.5.0 and have not been retaken. + +### Fixed +- **A saved-mappings file Studio could not read is no longer treated as damaged.** If another + program briefly holds the file, Studio waits and retries; if it still cannot read it, it changes + nothing and asks you to try again. +- **Printer-action confirmation is an accessible dialog.** Start, Cancel print and Emergency stop + now open a named, described dialog that starts on Cancel, is dismissed only by Escape or Cancel, + names the printer (and the file for Start), and is withdrawn if the printer changes or can no + longer take the action. +- **Tool tabs work from the keyboard.** The Compatibility / Source Check and Print Quality / First + Layer tab rows respond to the arrow keys, Home and End, show a focus outline and wrap on narrow + windows. Moving along the row does not open or re-run a tool. + ## [1.5.0] - 2026-10-06 **Project Materials: pick the real spool, and the real Snapmaker Orca preset, for each colour (#39).** diff --git a/README.md b/README.md index 9749c374..c5dffb28 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ changed. Snapmaker Orca still does the slicing.** Free, open source, and local. No account, no cloud, nothing uploaded off your local network. Your original file is never modified. -### [▶ Watch it work — 66 seconds](https://github.com/DVOpenLabs/snapmaker-studio/blob/main/docs/media/snapmaker-studio-demo.mp4) · [⬇ Download for Windows or Linux](https://github.com/DVOpenLabs/snapmaker-studio/releases/tag/v1.5.0) · [What it is, in 5 minutes](docs/innovation-fund/JUDGE_OVERVIEW.md) +### [▶ Watch it work — 66 seconds](https://github.com/DVOpenLabs/snapmaker-studio/blob/main/docs/media/snapmaker-studio-demo.mp4) · [⬇ Download for Windows or Linux](https://github.com/DVOpenLabs/snapmaker-studio/releases/tag/v1.5.1) · [What it is, in 5 minutes](docs/innovation-fund/JUDGE_OVERVIEW.md) [![Watch the Snapmaker Studio demo](docs/media/demo-poster.jpg)](https://github.com/DVOpenLabs/snapmaker-studio/blob/main/docs/media/snapmaker-studio-demo.mp4) @@ -71,30 +71,30 @@ recording, so it also shows what Studio says when it cannot reach one: **Windows 10/11 (x64)** ✅ · **Linux x86_64 (.deb)** ✅ · **macOS** not supported. -**[⬇ Download for Windows](https://github.com/DVOpenLabs/snapmaker-studio/releases/tag/v1.5.0)** +**[⬇ Download for Windows](https://github.com/DVOpenLabs/snapmaker-studio/releases/tag/v1.5.1)** — one click, no Python, runs offline. -**[⬇ Download for Linux](https://github.com/DVOpenLabs/snapmaker-studio/releases/tag/v1.5.0)** +**[⬇ Download for Linux](https://github.com/DVOpenLabs/snapmaker-studio/releases/tag/v1.5.1)** — one `.deb`, no Python, no Node, no Rust. Install guide: [docs/linux-install.md](docs/linux-install.md). -**v1.5.0 is the current stable release** — not a prerelease, so this is also what +**v1.5.1 is the current stable release** — not a prerelease, so this is also what GitHub's [latest release](https://github.com/DVOpenLabs/snapmaker-studio/releases/latest) points at. Every build ever published is on the [Releases page](https://github.com/DVOpenLabs/snapmaker-studio/releases). Verify it before you run it: -- Release: [v1.5.0](https://github.com/DVOpenLabs/snapmaker-studio/releases/tag/v1.5.0) -- Windows installer: `Snapmaker.Studio_1.5.0_x64-setup.exe` - — 21,944,474 bytes — SHA256: `d443f64f5167239f1422c719882cf245cff5d00d40c55fb67fc5a1e497b84e82` -- Linux package: `snapmaker-studio_1.5.0_amd64_5245cf9f9664.deb` - — 25,944,098 bytes — SHA256: `7fca28d9d4e2558f8a6bdc765b121e2290c54abd39e2a1b9b2efaeea6d923e5a` +- Release: [v1.5.1](https://github.com/DVOpenLabs/snapmaker-studio/releases/tag/v1.5.1) +- Windows installer: `Snapmaker.Studio_1.5.1_x64-setup.exe` + — 21,962,736 bytes — SHA256: `8955097365b12e9eb1405a098c1f6ab345d56d397681a67f0cb08257d1471be3` +- Linux package: `snapmaker-studio_1.5.1_amd64_abf20bf0f74d.deb` + — 25,954,272 bytes — SHA256: `c5766900437fa9826eefdb970c0ed21894b4f5f4b4795518993677ca6eeed08b` ```powershell -Get-FileHash -Algorithm SHA256 .\Snapmaker.Studio_1.5.0_x64-setup.exe +Get-FileHash -Algorithm SHA256 .\Snapmaker.Studio_1.5.1_x64-setup.exe ``` ```bash -sha256sum snapmaker-studio_1.5.0_amd64_5245cf9f9664.deb +sha256sum snapmaker-studio_1.5.1_amd64_abf20bf0f74d.deb ``` Neither installer is code-signed yet, so Windows SmartScreen will show "Unknown @@ -127,11 +127,11 @@ sliced job back**. | The problem, named exactly | The fix, in a new copy — and where Studio says it can't tell | |---|---| -| ![One object hangs 45 mm past the right edge](docs/screenshots/v1.5.0/problem.png) | ![The prepared copy, with what survived and what changed](docs/screenshots/v1.5.0/prepared.png) | +| ![One object hangs 45 mm past the right edge](docs/screenshots/v1.5.1/problem.png) | ![The prepared copy, with what survived and what changed](docs/screenshots/v1.5.1/prepared.png) | | **Painted colour, read before slicing** | **What to load — and where Studio says it cannot tell** | -| ![Which filaments the painting uses, and what that means for four toolheads](docs/screenshots/v1.5.0/painted.png) | ![Each slot named, with the unknowns marked as unknown](docs/screenshots/v1.5.0/what-to-load.png) | +| ![Which filaments the painting uses, and what that means for four toolheads](docs/screenshots/v1.5.1/painted.png) | ![Each slot named, with the unknowns marked as unknown](docs/screenshots/v1.5.1/what-to-load.png) | -From the v1.5.0 build's own installed-application run: the problem and prepared views on the sample project in [`examples/demo_u1_showcase.3mf`](examples/demo_u1_showcase.3mf); the painted view on the acceptance harness's dedicated multi-colour fixture; the what-to-load view on a sliced-job fixture the harness supplies to exercise that screen. Reproduce them with [docs/innovation-fund/JUDGE_WALKTHROUGH.md](docs/innovation-fund/JUDGE_WALKTHROUGH.md). Submission package: [docs/innovation-fund/FINAL_SUBMISSION.md](docs/innovation-fund/FINAL_SUBMISSION.md). +From the v1.5.1 build's own installed-application run: the problem and prepared views on the sample project in [`examples/demo_u1_showcase.3mf`](examples/demo_u1_showcase.3mf); the painted view on the acceptance harness's dedicated multi-colour fixture; the what-to-load view on a sliced-job fixture the harness supplies to exercise that screen. Reproduce them with [docs/innovation-fund/JUDGE_WALKTHROUGH.md](docs/innovation-fund/JUDGE_WALKTHROUGH.md). Submission package: [docs/innovation-fund/FINAL_SUBMISSION.md](docs/innovation-fund/FINAL_SUBMISSION.md). ## Why this isn't a slicer, a dashboard, or a converter @@ -165,7 +165,7 @@ its licence in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md). ## Evidence -Everything below was run against the v1.5.0 release-candidate build — the +Everything below was run against the v1.5.1 release-candidate build — the same application and Linux package published on the release page, checked by SHA256 — not against a development build. The Windows installed-application run used an acceptance copy of the release-candidate installer (same application @@ -179,24 +179,26 @@ counts come from the source at the release commit, not from the installer. Comma | What | Result | |---|---| -| Installed-application acceptance, driven through the real UI | **45/45** | -| Read-only checks against a real Snapmaker U1, from the Windows-installed app | **58/58** | +| Installed-application acceptance, driven through the real UI | **50/50** | +| Read-only checks against a real Snapmaker U1, from the Windows-installed app, with Spoolman and Bambuddy | **76/76** | | Linux clean-image validation, Ubuntu 22.04 + 24.04 | **49/49** each | | Regression tests against genuine OrcaSlicer / BambuStudio / PrusaSlicer projects | **36 tests** | | End-to-end pipeline self-check (`u1convert selfcheck`) | **27/27** | -| Backend / desktop / TypeScript / Rust | 2804 · 725 · clean · clean | +| Backend / desktop / TypeScript / Rust | 2927 · 852 · clean · clean | -The installed-application acceptance count (45/45) is a different total from -v1.2.0's: this release adds two checks for the SpoolEase provider and -three checks that the test lane itself leaves nothing behind, and drops one -older bookkeeping check — see [docs/TRUST_STATUS.md](docs/TRUST_STATUS.md). +The installed-application acceptance count (50/50) is a different total from +the previous release's: this run is the upgrade variant, started from the previous +release's installer, and adds five checks that the previous version installs, leaves its state +to migrate, and that the upgrade keeps your data and registers the new version — see +[docs/TRUST_STATUS.md](docs/TRUST_STATUS.md). The real-U1 verification for this release ran read-only through the -Windows-installed application itself, 58/58, with no printer-control action -called. The Spoolman/Bambuddy-seeded provider-on-hardware checks were not run -this release, no real SpoolEase device has been tested yet, this printer's four -toolheads all carry the same 0.4 mm nozzle, and the Linux-installed app was not -run against the real printer. Full detail: +Windows-installed application itself, 76/76, with no printer-control action +called. Both Spoolman (0.27.0) and Bambuddy (1.2.5.7) took part, as disposable +local containers seeded with anonymous spools, and the provider-on-hardware checks +for each ran and none were skipped. No real SpoolEase device has been tested yet, +this printer's four toolheads all carry the same 0.4 mm nozzle, and the +Linux-installed app was not run against the real printer. Full detail: [docs/TRUST_STATUS.md](docs/TRUST_STATUS.md). Reproduce any of it yourself: @@ -208,6 +210,25 @@ files produced structurally valid U1 profile copies ([PROOF.md](PROOF.md)); that number measures structure, not print success, and the checks above are the stronger evidence. +## What's new in v1.5.1 + +**Clearer Prepare, easier spool choices, and controls that work from the keyboard and with a screen reader.** + +- **Choose any spool from your inventory.** Each slot can open your provider's whole spool list, + searchable by vendor, material, colour or id. If you pick a spool but no Orca preset, the slot and + the review say the project's existing filament preset will remain. +- **Forget a saved mapping.** A remembered spool-to-preset mapping now has a **Forget saved mapping** + button; the confirmation says what is forgotten and what is not changed. +- **A saved-mappings file that is briefly locked is no longer treated as damaged.** Studio retries, + and if it still cannot read the file it changes nothing and asks you to try again. +- **Prepare says why a setting changed**, and whether the statement is Studio's own check or advice to + verify in Snapmaker Orca. +- **Accessible printer-action confirmation and tool tabs.** The Start, Cancel print and Emergency stop + confirmation is a proper dialog that starts on Cancel; the tool tab rows work with the arrow keys, + Home and End. +- **User guide links** from Help and Get Started. The guide's screenshots were captured from v1.5.0 + and have not been retaken. + ## What's new in v1.5.0 **Project Materials: the real spool and the real Snapmaker Orca preset, for each colour.** @@ -225,13 +246,6 @@ Presets you made yourself can be found and mapped, but are shown as **"Confirmed **"Manual check in Orca required"**: in testing Snapmaker Orca kept the project's own values for such a preset, so Studio does not say Orca will apply them. Check the filament in Orca before slicing. -| Suggested spools, nothing selected | Review before Prepare | Orca's presets and yours, told apart | -|---|---|---| -| ![Project Materials: top spool candidates with reasons, no spool selected](docs/screenshots/v1.5.0/pm-1-recommendations.png) | ![Review: each slot mapped, what changed, what the preset controls](docs/screenshots/v1.5.0/pm-3-fidelity-review.png) | ![A user preset marked Manual check in Orca required, next to a built-in preset](docs/screenshots/v1.5.0/pm-5-system-vs-user.png) | - -From the v1.5.0 release-candidate build's own installed-application run, against anonymised -disposable spools and presets. - ## What's new in v1.4.1 **A readable spool picker.** Settings → Materials provider now has a Studio list in place of the diff --git a/backend/pyproject.toml b/backend/pyproject.toml index 304a6bcc..853f2eed 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "snapmaker-studio" -version = "1.5.0" +version = "1.5.1" description = "Snapmaker Studio engine — a local-first workflow platform for modern 3D printing: understand, validate, and prepare designs print-ready (Bambu/Orca/STL today; Snapmaker U1 as the first printer target)." readme = "README.md" requires-python = ">=3.13" diff --git a/backend/snapstudio_core/convert.py b/backend/snapstudio_core/convert.py index f0545a02..0b40194a 100644 --- a/backend/snapstudio_core/convert.py +++ b/backend/snapstudio_core/convert.py @@ -94,12 +94,12 @@ def _starter_summary(*, geometry_only: bool) -> dict: } -def _action_reasons(report: dict) -> tuple[dict[str, str], set[str], set[str], dict[str, str]]: +def _action_reasons(report: dict) -> tuple[dict[str, dict], set[str], set[str]]: """Consume RepairOutcome detail while the independent diff remains authoritative. - The last item is the plain-language explanation some pipeline steps write next to their reason.""" - reasons: dict[str, str] = {} - explanations: dict[str, str] = {} + Each key has one atomic record. A later record replaces or clears all four + provenance fields together, so an explanation can never retain old source data.""" + records: dict[str, dict] = {} cleared: set[str] = set() mapped: set[str] = set() groups = [report.get("normalizations", []), report.get("profile_changes", []), @@ -119,19 +119,26 @@ def _action_reasons(report: dict) -> tuple[dict[str, str], set[str], set[str], d for item in group: if not isinstance(item, dict) or "key" not in item: continue + key = item["key"] reason = item.get("reason") if isinstance(reason, str) and reason: - reasons[item["key"]] = reason - explanations.pop(item["key"], None) # an explanation belongs to the reason it came with - explanation = item.get("explanation") - if isinstance(explanation, str) and explanation: - explanations[item["key"]] = explanation + # reason always; the other three only when this step supplied them, so a + # later record never inherits an earlier explanation, source or kind. + records[key] = {"reason": reason, **{field: item[field] for field in ("explanation", "source", "kind") + if isinstance(item.get(field), str) and item[field]}} + elif reason == "": + # An explicit empty reason clears the complete atomic record. + records.pop(key, None) + else: + # A later report item without a reason is not a clear marker. + # Preserve the prior complete record. + pass if item.get("category") == "mapped": mapped.add(item["key"]) for item in report.get("foreign_cleared", []): if isinstance(item, dict): cleared.add(item["key"]) - return reasons, cleared, mapped, explanations + return records, cleared, mapped def _strict_value_equal(a, b) -> bool: @@ -174,7 +181,7 @@ def _settings_summary(before: dict, after: dict, raw_config: bytes, outcome, recommended_after: dict | None = None) -> dict: profile = load_profile(profile_name) diffs = config_diff(before, after) # independent source of truth (A13) - reasons, cleared, mapped_keys, explanations = _action_reasons(outcome.report) + records, cleared, mapped_keys = _action_reasons(outcome.report) allowlist = machine_compat_keys(profile) slice_info = { item["key"]: item["reason"] @@ -189,19 +196,16 @@ def _settings_summary(before: dict, after: dict, raw_config: bytes, outcome, if key in cleared: # Values in this category were deliberately discarded. They may # be credentials or arbitrary creator G-code, so never echo them. - could_not_carry.append({"key": key, "reason": reasons[key]}) + could_not_carry.append({"key": key, "reason": records[key]["reason"]}) elif key in mapped_keys and _is_preserved_value_mapping(item["old"], item["new"]): mapped_to_u1.append({ "key": key, "old": display_value(item["old"], key=key), "new": display_value(item["new"], key=key), "reason": "carried over to U1 toolheads (values preserved)", }) - elif key in reasons: + elif key in records: entry = {"key": key, "old": display_value(item["old"], key=key), - "new": display_value(item["new"], key=key), - "reason": reasons[key]} - if key in explanations: - entry["explanation"] = explanations[key] + "new": display_value(item["new"], key=key), **records[key]} compat.append(entry) elif key in allowlist: compat.append({"key": key, "old": display_value(item["old"], key=key), diff --git a/backend/snapstudio_core/orca_import.py b/backend/snapstudio_core/orca_import.py index 95250f80..e7c40bc1 100644 --- a/backend/snapstudio_core/orca_import.py +++ b/backend/snapstudio_core/orca_import.py @@ -69,9 +69,11 @@ def _num(cfg: dict, key: str): return None -def _change(changes: list, key: str, old, new, reason: str, why: str) -> None: +def _change(changes: list, key: str, old, new, reason: str, why: str, + *, kind: str = "engine", source: str = "Studio's import rule for this setting") -> None: changes.append({"key": key, "old": old, "new": new, "reason": reason, - "explanation": why, "category": "orca-compatibility"}) + "explanation": why, "source": source, + "kind": kind, "category": "orca-compatibility"}) # --- individual rules ------------------------------------------------------- @@ -89,9 +91,7 @@ def _enable_exclude_object(cfg: dict, changes: list) -> None: cfg["exclude_object"] = "1" _change(changes, "exclude_object", old, "1", "enabled so the U1 can skip a failed object and probe adaptively", - "With Exclude Object off, the U1 cannot cancel one failed object " - "without losing the whole plate, and adaptive bed mesh has no object " - "outlines to work from.") + "Studio's import rule turns Exclude Object on for every U1 copy; the original had it off.") def _fix_auto_brim(cfg: dict, changes: list) -> None: @@ -107,10 +107,9 @@ def _fix_auto_brim(cfg: dict, changes: list) -> None: if brim == "auto_brim": cfg["brim_type"] = "no_brim" _change(changes, "brim_type", brim, "no_brim", - "the creator left the brim on automatic, and Snapmaker Orca decides " - "differently from the slicer this was made in", - "Automatic means the slicer chooses. Snapmaker Orca's choice can add " - "a brim this project never had. A brim you asked for yourself is kept.") + "Studio replaced an automatic brim choice with no brim for this U1 copy", + "Studio replaced the automatic brim choice with no brim. A brim you chose yourself is kept.", + kind="orca") def _fix_tree_support_with_adaptive_layers(cfg: dict, changes: list) -> None: @@ -128,11 +127,8 @@ def _fix_tree_support_with_adaptive_layers(cfg: dict, changes: list) -> None: if style in ("organic", "tree_slim", "tree_strong"): cfg["support_style"] = "tree_hybrid" _change(changes, "support_style", style, "tree_hybrid", - "tree support with variable layer height needs the hybrid style on the U1", - "This project uses variable layer height with tree supports. The " - "slicer it was made in silently switches that combination to hybrid " - "when it opens the file; Snapmaker Orca does not, so Studio applies " - "the same correction.") + "Studio replaced the tree support style with the hybrid style for this U1 copy", + "Studio replaced the tree support style with the hybrid style for this U1 copy.", kind="orca") def _fix_filament_array_validity(cfg: dict, changes: list, count: int) -> None: @@ -154,14 +150,38 @@ def pad_from_self(key: str, why: str, reason: str) -> None: filled = [v for v in value if str(v).strip() != ""] if not filled: return + # Only entries that survive truncation can have been filled, trimmed or converted; + # dropped entries are reported once, as a resize. + retained = value[:count] + had_empty = any(str(v).strip() == "" for v in retained) + trimmed = any(isinstance(v, str) and v.strip() != v for v in retained) new = [(str(v).strip() or str(filled[-1])) for v in value] if len(new) < count: new = new + [new[-1]] * (count - len(new)) elif len(new) > count: new = new[:count] if new != value: + resized = len(new) != len(value) + converted = any(not isinstance(v, str) for v in retained) + parts = [] + if had_empty: + parts.append("Studio filled an empty entry with the last non-empty value in this list.") + if resized: + parts.append("Studio resized this list to cover every filament slot.") + if trimmed: + parts.append("Studio trimmed whitespace around a string value.") + if converted: + parts.append("Studio wrote each value in this list as text.") + actual_why = " ".join(parts) + actual_reason = "; ".join(filter(None, [ + "filled an empty entry with the last non-empty value" if had_empty else "", + "resized the list" if resized else "", + "trimmed whitespace from a string" if trimmed else "", + "wrote each value in the list as text" if converted else "", + ])) cfg[key] = new - _change(changes, key, value, new, reason, why) + _change(changes, key, value, new, actual_reason, actual_why, + kind="engine", source="Studio's import rule for this setting") pad_from_self( "filament_adaptive_volumetric_speed", @@ -184,18 +204,15 @@ def pad_from_self(key: str, why: str, reason: str) -> None: cfg["filament_self_index"] = expected _change(changes, "filament_self_index", self_index, expected, "renumbered so every filament slot identifies itself correctly", - "Each filament slot has to carry its own position. When the " - "numbering is missing or out of step the slicer reports an " - "invalid project configuration.") + "Studio renumbered each filament slot so the list matches its position.") # The raft expansion has two owners: the U1 clamp table (data/u1_rules.json), which runs in every mode and fixes -1, and # the rule below, which runs in Preserve/U1/Optimize and fixes any negative value. They must agree on the value (the clamp's # "good" is the U1 template default, checked by a test) and say the same thing about why, so the reason shown to the person # does not depend on which of them acted. -RAFT_EXPANSION_REASON = "restored to the U1 default (a negative value is out of range)" -RAFT_EXPANSION_WHY = ("Snapmaker Orca and OrcaSlicer both reject a negative raft expansion " - "and warn when the project is opened.") +RAFT_EXPANSION_REASON = "replaced a negative raft expansion with the U1 base-profile value" +RAFT_EXPANSION_WHY = "A negative raft expansion was replaced with the value from Studio's U1 base profile." def _fix_negative_raft_expansion(cfg: dict, changes: list) -> None: @@ -212,7 +229,8 @@ def _fix_negative_raft_expansion(cfg: dict, changes: list) -> None: old = cfg.get("raft_first_layer_expansion") cfg["raft_first_layer_expansion"] = default _change(changes, "raft_first_layer_expansion", old, default, - RAFT_EXPANSION_REASON, RAFT_EXPANSION_WHY) + RAFT_EXPANSION_REASON, RAFT_EXPANSION_WHY, kind="orca", + source="Studio's import rule for this setting") # --- entry points ----------------------------------------------------------- diff --git a/backend/snapstudio_core/repair.py b/backend/snapstudio_core/repair.py index bd117ce9..978f5c24 100644 --- a/backend/snapstudio_core/repair.py +++ b/backend/snapstudio_core/repair.py @@ -2,7 +2,7 @@ import copy from .container import ThreeMF from .config_io import load_project_settings, dump_project_settings -from .rules import load_rules, apply_clamps, clamp_explanation +from .rules import load_rules, apply_clamps from .profile import load_profile, apply_swap from .filaments import apply_remap, filament_count, conform_filament_arrays from .preserve import machine_compat_keys, prepare_preserved_values @@ -39,7 +39,8 @@ def repair(tm: ThreeMF, mode: str = "u1", remap: dict | None = None, change["reason"] = ( orca_import.RAFT_EXPANSION_REASON if change["key"] == "raft_first_layer_expansion" else f"U1 compatibility clamp: {change['old']} → {change['new']}") - change["explanation"] = clamp_explanation(change) + # Explanation and provenance are one record. apply_clamps creates the + # complete evidence pair before this step adds the action reason. # U1 supports >4 filament colours (verified: real U1 files carry 8 colours # with 4 toolheads). Never auto-cap; preserve all filament arrays in every diff --git a/backend/snapstudio_core/rules.py b/backend/snapstudio_core/rules.py index d367d10a..bb8f3112 100644 --- a/backend/snapstudio_core/rules.py +++ b/backend/snapstudio_core/rules.py @@ -10,7 +10,13 @@ def apply_clamps(cfg: dict, rules: dict) -> list[dict]: for c in rules["clamps"]: k = c["key"] if k in cfg and str(cfg[k]) == c["bad"]: - findings.append({"key": k, "old": cfg[k], "new": c["good"]}) + change = {"key": k, "old": cfg[k], "new": c["good"], + "explanation": clamp_explanation({"key": k, "old": cfg[k], "new": c["good"]}), + "source": ("Studio's import rule for this setting" if k == "raft_first_layer_expansion" + else "the Compatibility check's valid range"), + # the raft explanation ends with advice to check the raft in Snapmaker Orca + "kind": "orca" if k == "raft_first_layer_expansion" else "engine"} + findings.append(change) cfg[k] = c["good"] return findings diff --git a/backend/tests/test_guide_claims.py b/backend/tests/test_guide_claims.py index 8eb04f5b..f0494c0b 100644 --- a/backend/tests/test_guide_claims.py +++ b/backend/tests/test_guide_claims.py @@ -9,14 +9,23 @@ the engine really produces, the original stays byte-identical, and the guide's printer-name explanation matches the confidence the engine actually assigns. What they cannot establish: that the prose around those facts is well explained, -or anything about a physical printer or Snapmaker Orca. +that a source is the right source, honest review dates, paraphrased overclaims, +screen-reader behavior, or anything about a physical printer or Snapmaker Orca. """ import hashlib +import importlib +import importlib.util import json +import os import re import shutil +import subprocess +import sys +import tempfile from pathlib import Path +import pytest + from snapstudio_core import plate_placement as pp from snapstudio_core import post_slice @@ -48,6 +57,57 @@ def _sha(path: Path) -> str: return hashlib.sha256(path.read_bytes()).hexdigest() +ENGINE_FACTS = { + "setting-why": ("engine-reason", "backend:rules.apply_clamps"), + "size-or-placement": ("placement-move", "backend:plate_placement.EDGE_MARGIN_MM"), + "unknown-compatible": ("unknown-gap", "backend:post_slice._machine_match"), + "sliced-for-u1": ("sliced-header", "backend:post_slice._machine_match"), + "original-unchanged": ("copy-only", "test:backend/tests/test_guide_claims.py::test_original_unchanged_answer_uses_real_convert_path"), + "print-success": ("readiness-estimate", "backend:success_predict.predict"), +} + + +def check_answers(manifest, pages, tmp_path): + """Check code-derived tokens and ownership; this cannot judge prose clarity, source fitness, dates, paraphrased overclaims, physical behavior, Orca behavior, or screen readers.""" + from snapstudio_core import success_predict + from snapstudio_core.convert import convert_to_u1 + from snapstudio_core.rules import apply_clamps, load_rules + by_id = {answer["id"]: answer for answer in manifest["answers"]} + table = { + "setting-why": lambda: ("engine-reason", "backend:rules.apply_clamps", {"valid range", "U1 default"}), + "size-or-placement": lambda: ("placement-move", "backend:plate_placement.EDGE_MARGIN_MM", {"one move cannot fix the layout", "multi-plate"}), + "unknown-compatible": lambda: ("unknown-gap", "backend:post_slice._machine_match", {"does not guess", "no printer is connected"}), + "sliced-for-u1": lambda: ("sliced-header", "backend:post_slice._machine_match", {"Studio reads the header", "not simulated"}), + "original-unchanged": lambda: ("copy-only", "test:backend/tests/test_guide_claims.py::test_original_unchanged_answer_uses_real_convert_path", {"SnapmakerU1", "original file is not modified"}), + "print-success": lambda: ("readiness-estimate", "backend:success_predict.predict", {"takes points off for each risk signal", "not a probability of print success", "at least 75"}), + } + assert set(table) == set(ENGINE_FACTS) + assert set(ENGINE_FACTS) | {"kept-orca"} == set(by_id) + asserted = set() + for answer_id, (expected_id, expected_derive, expected_tokens) in ((a, table[a]()) for a in table): + answer = by_id[answer_id] + assert len(answer["requiredFacts"]) == 1 + fact = answer["requiredFacts"][0] + assert (fact["id"], fact["derive"]) == (expected_id, expected_derive) + assert set(fact["tokens"]) == expected_tokens + assert all(token in json.dumps(pages) for token in expected_tokens) + asserted.add(fact["id"]) + # Exercise real behavior for the facts whose tokens summarize it. + clamp = apply_clamps({"prime_tower_brim_width": "-1"}, load_rules()) + assert "valid range" in clamp[0]["explanation"] and "U1 default" in clamp[0]["explanation"] + assert clamp[0]["kind"] == "engine" + assert post_slice._machine_match({"printer_model": "Snapmaker U1"}, {})["confidence"] == post_slice.CONFIRMED + assert post_slice._machine_match({"printer_model": "not a known printer"}, {})["confidence"] == post_slice.LIKELY + assert success_predict.predict(readiness={"ready": True})["likelihood"] == 100 + src = tmp_path / "answer-source.3mf" + shutil.copy(ROOT / "examples" / "demo_offplate_foreign.3mf", src) + before = _sha(src) + out = convert_to_u1(str(src), out_dir=str(tmp_path), dry_run=False) + assert out.output_name.endswith("_SnapmakerU1.3mf") and _sha(src) == before + assert asserted == {fact["id"] for answer in manifest["answers"] for fact in answer["requiredFacts"] if fact["derive"].startswith(("backend:", "test:"))} + return True + + def test_placement_example_matches_the_engine(tmp_path): src = tmp_path / "demo_offplate_foreign.3mf" shutil.copy(ROOT / "examples" / "demo_offplate_foreign.3mf", src) @@ -98,3 +158,210 @@ def test_printer_name_confidence_matches_the_guide(): def test_matching_header_is_confirmed_and_looks_right(): ok = post_slice._machine_match({"printer_model": "Snapmaker U1"}, {}) assert ok["result"] == "ok" and ok["confidence"] == post_slice.CONFIRMED + + +def test_original_unchanged_answer_uses_real_convert_path(tmp_path): + """The conversion path preserves the input; this does not establish prose clarity, source choice, dates, physical behavior, paraphrased overclaims, or screen-reader behavior.""" + from snapstudio_core.convert import convert_to_u1 + src = tmp_path / "source.3mf" + shutil.copy(ROOT / "examples" / "demo_offplate_foreign.3mf", src) + before = _sha(src) + result = convert_to_u1(str(src), out_dir=str(tmp_path), dry_run=False) + assert result.output_name.endswith("_SnapmakerU1.3mf") + assert (tmp_path / result.output_name).exists() + assert _sha(src) == before + + +def _resolve_engine_derive(derive, package="snapstudio_core"): + """Resolve a backend: or test: derive for real. Raises AttributeError or returns None when it does not resolve.""" + if derive.startswith("backend:"): + module_name, symbol = derive[8:].rsplit(".", 1) + return getattr(importlib.import_module(f"{package}.{module_name}"), symbol) + if derive.startswith("test:"): + file_name, test_name = derive[5:].split("::", 1) + path = (ROOT / file_name) if not Path(file_name).is_absolute() else Path(file_name) + if not path.is_file(): + return None + if path.resolve() == Path(__file__).resolve(): + module = sys.modules[__name__] # this module is already loaded; never execute it twice + else: + module_name = "_derive_" + hashlib.sha1(str(path.resolve()).encode()).hexdigest()[:12] + spec = importlib.util.spec_from_file_location(module_name, path) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + member = getattr(module, test_name, None) + return member if callable(member) else None + + +def test_every_manifest_derive_resolves_to_code(): + """Resolution is mechanical; it cannot establish prose clarity, source fitness, honest dates, physical printer or Snapmaker Orca behavior, paraphrased overclaims, or screen-reader behavior. App derives are resolved in guideClaims.test.ts.""" + seen = 0 + for answer in _guide("answers")["answers"]: + for fact in answer["requiredFacts"]: + if fact["derive"].startswith(("backend:", "test:")): + assert _resolve_engine_derive(fact["derive"]) is not None, fact["derive"] + seen += 1 + else: + assert fact["derive"].startswith("app:"), fact["derive"] + assert seen >= 5 + + +def test_engine_derive_resolution_rejects_near_misses(tmp_path, monkeypatch): + """Real getattr resolution: a name that only appears in a comment, a comparison or a docstring is not a symbol.""" + package = tmp_path / "fixturepkg" + package.mkdir() + (package / "__init__.py").write_text("", encoding="utf-8") + (package / "mod.py").write_text( + '"""Module docstring mentions docstring_only."""\n' + "# comment_only is described here\n" + "REAL = 1\n" + "def real_fn():\n" + ' """real_fn mentions inner_docstring."""\n' + " return REAL == 1\n" + "async def real_async():\n" + " return 1\n" + "value = REAL\n" + "check = (missing_eq == 1) if False else None\n", + encoding="utf-8", + ) + monkeypatch.syspath_prepend(str(tmp_path)) + assert _resolve_engine_derive("backend:mod.REAL", package="fixturepkg") == 1 + assert _resolve_engine_derive("backend:mod.real_async", package="fixturepkg") + for name in ["REA", "real_f", "comment_only", "docstring_only", "inner_docstring", "missing_eq", "real_fn_"]: + with pytest.raises(AttributeError): + _resolve_engine_derive(f"backend:mod.{name}", package="fixturepkg") + + +def test_test_derive_resolution_imports_the_real_function(tmp_path): + """A test: derive resolves by importing the file and calling getattr, so text that only looks like a definition fails.""" + ref = "test:backend/tests/test_guide_claims.py::" + assert callable(_resolve_engine_derive(ref + "test_original_unchanged_answer_uses_real_convert_path")) + assert _resolve_engine_derive(ref + "test_original_unchanged_answer_uses_real_convert_pat") is None + assert _resolve_engine_derive("test:backend/tests/no_such_file.py::test_x") is None + fixture = tmp_path / "fixture_tests.py" + fixture.write_text( + '"""def spoofed_in_docstring(): pass"""\n' + "TEXT = \"\"\"\ndef spoofed_test():\n pass\n\"\"\"\n" + "ESCAPED = \"\\\"\\\"\\\" def spoofed_escaped(): pass\"\n" + "# def spoofed_comment(): pass\n" + "NOT_CALLABLE = 5\n" + "def test_real():\n return 1\n", + encoding="utf-8", + ) + ref = f"test:{fixture}::" + assert _resolve_engine_derive(ref + "test_real")() == 1 + for name in ["spoofed_test", "spoofed_in_docstring", "spoofed_escaped", "spoofed_comment", "test_rea", "NOT_CALLABLE", "TEXT"]: + assert _resolve_engine_derive(ref + name) is None, name + + +def test_golden_answer_engine_assertion_table_has_exact_manifest_coverage(tmp_path): + """The table checks code facts only; it cannot establish prose clarity, source fitness, honest dates, physical printer or Snapmaker Orca behavior, paraphrased overclaims, or screen readers.""" + assert check_answers(_guide("answers"), {name: _guide(name) for name in ("path", "tasks", "problems")}, tmp_path) + + +def test_print_readiness_is_a_risk_signal_score_not_a_measured_chance(): + """The formula check cannot establish that the score predicts physical printer behavior, prose clarity, source fitness, honest dates, paraphrased overclaims, or screen-reader behavior.""" + from snapstudio_core import success_predict + baseline = success_predict.predict(readiness={"ready": True}) + one_warning = success_predict.predict(readiness={"ready": False, "warnings": ["one"]}) + two_warnings = success_predict.predict(readiness={"ready": False, "warnings": ["one", "two"]}) + assert baseline["likelihood"] == 100 + assert one_warning["likelihood"] == 100 - (20 + 5 * 1) == 75 + assert two_warnings["likelihood"] == 100 - (20 + 5 * 2) == 70 + assert one_warning["band"] == "likely" and two_warnings["band"] == "uncertain" + assert success_predict.predict(readiness={"ready": False, "warnings": []})["band"] == "likely" + assert success_predict._band(75) == "likely" and success_predict._band(74) == "uncertain" + assert "Likely to print" in success_predict._verdict(80, "likely") + + +def _run_guide_build(content, output): + env = os.environ.copy() + env["SNAPSTUDIO_GUIDE_CONTENT"] = str(content) + env["SNAPSTUDIO_GUIDE_OUTPUT"] = str(output) + return subprocess.run(["node", "tools/build.mjs"], cwd=ROOT / "site" / "guide", env=env, capture_output=True, text=True) + + +def test_build_rejects_invalid_answers_and_source_refs(): + """These negative cases test the validator; they cannot establish prose clarity, source fitness, honest dates, physical behavior, paraphrased overclaims, or screen readers.""" + with tempfile.TemporaryDirectory() as raw: + content = Path(raw) / "content" + shutil.copytree(GUIDE, content) + output = Path(raw) / "index.html" + answers_path = content / "answers.json" + original = json.loads(answers_path.read_text(encoding="utf-8")) + cases = [] + bad = json.loads(json.dumps(original)); bad["answers"][0]["requiredFacts"] = []; cases.append(bad) + bad = json.loads(json.dumps(original)); bad["answers"][0]["unknown"] = True; cases.append(bad) + bad = json.loads(json.dumps(original)); bad["answers"][1]["requiredFacts"][0]["id"] = bad["answers"][0]["requiredFacts"][0]["id"]; cases.append(bad) + for bad in cases: + answers_path.write_text(json.dumps(bad), encoding="utf-8") + assert _run_guide_build(content, output).returncode != 0 + # the build checks shape and file existence only; symbol resolution is tested separately above + for derive in ["bogus:thing", "backend:no_such_module.symbol", "backend:rules.not-an-identifier", "backend:rules", "app:desktop/src/lib/no_such_file.ts#X", "app:desktop/src/lib/fidelity.ts", "app:desktop/src/lib/fidelity.ts#not-an-id", "test:backend/tests/no_such_file.py::test_x", "test:backend/tests/test_guide_claims.py::"]: + bad = json.loads(json.dumps(original)); bad["answers"][0]["requiredFacts"][0]["derive"] = derive + answers_path.write_text(json.dumps(bad), encoding="utf-8") + assert _run_guide_build(content, output).returncode != 0 + path_path = content / "path.json" + path_data = json.loads(path_path.read_text(encoding="utf-8")) + source_page_index = next(i for i, page in enumerate(path_data) if page.get("sources")) + for ref in [ + "https://github.com/DVOpenLabs/snapmaker-studio/blob/v1.5.0/backend/DOES_NOT_EXIST.py", + "https://github.com/DVOpenLabs/snapmaker-studio/blob/v1.5.0/desktop/src/lib/fidelity.ts#DOES_NOT_EXIST", + "https://github.com/DVOpenLabs/snapmaker-studio/blob/main/backend/snapstudio_core/rules.py", + "https://github.com/DVOpenLabs/snapmaker-studio/blob/v1.5.0/../backend/snapstudio_core/rules.py", + "/absolute/backend/snapstudio_core/rules.py", + "@does_not_exist", + ]: + bad_path = json.loads(json.dumps(path_data)); bad_path[source_page_index]["sources"][0]["ref"] = ref + path_path.write_text(json.dumps(bad_path), encoding="utf-8") + assert _run_guide_build(content, output).returncode != 0 + path_path.write_text(json.dumps(path_data), encoding="utf-8") + + +@pytest.mark.parametrize("answer_id,changed", [ + ("size-or-placement", "Studio shrinks the object to fit"), + ("sliced-for-u1", "Studio simulates every command"), + ("original-unchanged", "Studio edits your original in place"), +]) +def test_mutated_manifest_and_page_fails_real_engine_checker(tmp_path, answer_id, changed): + """Mutation checks call check_answers, the real engine-layer checker; they cannot judge general prose clarity or accessibility.""" + manifest = json.loads(json.dumps(_guide("answers"))) + pages = {name: _guide(name) for name in ("path", "tasks", "problems")} + answer = next(a for a in manifest["answers"] if a["id"] == answer_id) + answer["requiredFacts"][0]["tokens"] = [changed] + move = next(t for t in pages["tasks"]["tasks"] if t["id"] == "move-onto-plate") + prepare = next(t for t in pages["tasks"]["tasks"] if t["id"] == "prepare-u1-copy") + if answer_id == "size-or-placement": move["differs"][0]["then"] = changed + elif answer_id == "sliced-for-u1": pages["path"][5]["means"][1]["meaning"] = changed + else: prepare["success"][0] = changed + import pytest + with pytest.raises(AssertionError): + check_answers(manifest, pages, tmp_path) + + +def test_extra_contradictory_fact_fails_real_engine_checker(tmp_path): + """An extra fact must fail the real checker; this cannot judge general prose clarity or accessibility.""" + manifest = json.loads(json.dumps(_guide("answers"))) + pages = {name: _guide(name) for name in ("path", "tasks", "problems")} + manifest["answers"][0]["requiredFacts"].append({"id": "contradiction", "derive": "backend:rules.apply_clamps", "tokens": ["shrinks"]}) + import pytest + with pytest.raises(AssertionError): + check_answers(manifest, pages, tmp_path) + + +def test_renamed_fact_id_fails_real_engine_checker_from_fresh_manifest(tmp_path): + """A fact-id mutation calls the real checker; it cannot establish prose clarity, source fitness, dates, physical behavior, Orca behavior, paraphrased overclaims, or screen readers.""" + manifest = json.loads(json.dumps(_guide("answers"))) + pages = {name: _guide(name) for name in ("path", "tasks", "problems")} + manifest["answers"][0]["requiredFacts"][0]["id"] = "renamed-fact" + with pytest.raises(AssertionError): + check_answers(manifest, pages, tmp_path) + + +def test_dropped_token_fails_real_engine_checker_without_page_mutation(tmp_path): + """A pure token deletion calls the real checker; it cannot establish prose clarity, source fitness, dates, physical behavior, Orca behavior, paraphrased overclaims, or screen readers.""" + manifest = json.loads(json.dumps(_guide("answers"))) + pages = {name: _guide(name) for name in ("path", "tasks", "problems")} + manifest["answers"][5]["requiredFacts"][0]["tokens"] = ["SnapmakerU1"] + with pytest.raises(AssertionError): + check_answers(manifest, pages, tmp_path) diff --git a/backend/tests/test_orca_import.py b/backend/tests/test_orca_import.py index 5af8ce5b..e065626d 100644 --- a/backend/tests/test_orca_import.py +++ b/backend/tests/test_orca_import.py @@ -23,7 +23,9 @@ def test_exclude_object_is_enabled_when_off(): assert cfg["exclude_object"] == "1" change = next(c for c in changes if c["key"] == "exclude_object") assert change["old"] == "0" - assert "adaptive" in change["explanation"].lower() or "cancel" in change["explanation"].lower() + # the explanation describes only Studio's operation, not external slicer behavior + assert change["explanation"] == "Studio's import rule turns Exclude Object on for every U1 copy; the original had it off." + assert change["kind"] == "engine" def test_exclude_object_already_on_is_not_reported_as_a_change(): diff --git a/backend/tests/test_public_claims.py b/backend/tests/test_public_claims.py index b65b802a..34473935 100644 --- a/backend/tests/test_public_claims.py +++ b/backend/tests/test_public_claims.py @@ -10,6 +10,7 @@ for every future release, not just one. """ import os +import json import re import pytest @@ -35,8 +36,7 @@ @pytest.mark.parametrize("rel", _PUBLIC_DOCS) def test_no_print_success_guarantees(rel): path = os.path.join(_ROOT, rel) - if not os.path.exists(path): - pytest.skip(f"{rel} not present") + assert os.path.exists(path), f"required public file is missing: {rel}" text = open(path, encoding="utf-8").read().lower() for phrase in _BANNED: assert phrase not in text, f"banned claim '{phrase}' found in {rel}" @@ -66,8 +66,7 @@ def test_no_print_success_guarantees(rel): ]) def test_public_docs_have_no_tooling_names(rel): path = os.path.join(_ROOT, rel) - if not os.path.exists(path): - pytest.skip(f"{rel} not present") + assert os.path.exists(path), f"required public file is missing: {rel}" text = open(path, encoding="utf-8").read().lower() for label, pattern in _BANNED_TOOLS: assert not re.search(pattern, text), f"tooling term '{label}' found in {rel}" @@ -106,8 +105,7 @@ def test_public_docs_have_no_tooling_names(rel): @pytest.mark.parametrize("rel", _RELEASE_SURFACES) def test_release_notes_have_no_internal_tooling_terms(rel): path = os.path.join(_ROOT, rel) - if not os.path.exists(path): - pytest.skip(f"{rel} not present") + assert os.path.exists(path), f"required public file is missing: {rel}" text = open(path, encoding="utf-8").read().lower() for label, pattern in _BANNED_INTERNAL: assert not re.search(pattern, text), f"internal/tooling term '{label}' found in {rel}" @@ -138,3 +136,25 @@ def test_intelligence_report_copy_is_advisory(): def test_success_predict_verdict_not_overconfident(): v = _sp.predict(readiness={"ready": True, "warnings": []})["verdict"].lower() assert "good to go" not in v + + +def test_readme_and_release_notes_keep_the_golden_answer_for_success_unknown(): + """Public-copy checks cannot detect a paraphrased overclaim or judge prose clarity.""" + for rel in ("README.md", os.path.join("docs", "RELEASE_NOTES.md")): + path = os.path.join(_ROOT, rel) + assert os.path.exists(path), f"required public file is missing: {rel}" + text = open(path, encoding="utf-8").read().lower() + assert "guaranteed print" not in text + assert "100% print success" not in text + + +def test_answers_forbidden_phrases_are_absent_from_all_public_guide_content(): + """Forbidden-phrase coverage cannot judge prose clarity, source fitness, honest dates, physical behavior, paraphrased overclaims, or screen readers.""" + answers = json.load(open(os.path.join(_ROOT, "site", "guide", "content", "answers.json"), encoding="utf-8")) + public = "\n".join( + json.dumps(json.load(open(os.path.join(_ROOT, "site", "guide", "content", name), encoding="utf-8"))) + for name in ("guide.json", "examples.json", "shots.json") + ).lower() + for answer in answers["answers"]: + for phrase in answer["forbidden"]: + assert phrase.lower() not in public, f"forbidden phrase '{phrase}' found in guide content" diff --git a/backend/tests/test_setting_explanations.py b/backend/tests/test_setting_explanations.py index 8ecf5512..19cb8340 100644 --- a/backend/tests/test_setting_explanations.py +++ b/backend/tests/test_setting_explanations.py @@ -22,7 +22,9 @@ def _project(tmp_path, settings: dict): path = tmp_path / "foreign.3mf" - base = {"printer_model": "Bambu Lab X1 Carbon", "filament_colour": ["#FF0000"], "filament_type": ["PLA"]} + array_lengths = [len(value) for value in settings.values() if isinstance(value, list)] + count = max(array_lengths or [1]) + base = {"printer_model": "Bambu Lab X1 Carbon", "filament_colour": ["#FF0000"] * count, "filament_type": ["PLA"] * count} with zipfile.ZipFile(path, "w") as z: z.writestr("3D/3dmodel.model", '') z.writestr("Metadata/project_settings.config", json.dumps({**base, **settings})) @@ -82,6 +84,9 @@ def test_a_negative_raft_expansion_has_one_owner_per_run_and_one_explained_recor assert records[0]["explanation"] == orca_import.RAFT_EXPANSION_WHY # the reason is the engine's own, never empty, and never shown instead of the explanation assert records[0]["reason"] == orca_import.RAFT_EXPANSION_REASON + # whichever step wrote the surviving explanation also wrote its source and kind: never a mixed pair + assert records[0]["source"] == "Studio's import rule for this setting" + assert records[0]["kind"] == "orca" @pytest.mark.parametrize("mode", ["safe", "preserve", "u1", "optimize"]) @@ -109,10 +114,23 @@ def test_each_clamped_setting_reaches_the_summary_with_its_explanation(tmp_path) def test_an_ordinary_orca_import_change_keeps_its_own_explanation(tmp_path): summary, _ = _prepare(tmp_path, {"brim_type": "auto_brim"}) (brim,) = [c for c in summary["compat_changed"] if c["key"] == "brim_type"] - assert "Snapmaker Orca" in brim["explanation"] + assert brim["explanation"] == "Studio replaced the automatic brim choice with no brim. A brim you chose yourself is kept." + assert brim["kind"] == "orca" + assert brim["source"] == "Studio's import rule for this setting" + assert brim["kind"] == "orca" assert brim["reason"] and brim["reason"] != brim["explanation"] +@pytest.mark.parametrize("settings,key,phrase", [ + ({"adaptive_layer_height": "1", "support_type": "tree", "support_style": "organic"}, "support_style", "Studio replaced the tree support style with the hybrid style for this U1 copy."), +]) +def test_orca_verify_advice_names_only_studios_operation(settings, key, phrase, tmp_path): + summary, _ = _prepare(tmp_path, settings) + change = next(c for c in summary["compat_changed"] if c["key"] == key) + assert change["explanation"] == phrase + assert change["kind"] == "orca" + + def test_explanations_are_absent_or_non_empty_and_recommendations_carry_none(tmp_path): summary, _ = _prepare(tmp_path, {"layer_height": "0.16", "printer_settings_id": "Bambu Lab X1 Carbon 0.4 nozzle"}) assert isinstance(summary["kept_count"], int) @@ -121,3 +139,95 @@ def test_explanations_are_absent_or_non_empty_and_recommendations_carry_none(tmp # optional recommendations are a separate list and are not explained here for change in summary["recommended_changes"]: assert "explanation" not in change + + +@pytest.mark.parametrize("key", ["filament_flush_temp", "filament_adaptive_volumetric_speed"]) +@pytest.mark.parametrize("value,count,expected,reason", [ + ([220], 1, "Studio wrote each value in this list as text.", "wrote each value in the list as text"), + ([5, 5, 5, 5], 4, "Studio wrote each value in this list as text.", "wrote each value in the list as text"), + ([0, 0, 0, 0, 0], 5, "Studio wrote each value in this list as text.", "wrote each value in the list as text"), + ([" 5 ", 220, "", "7"], 4, "Studio filled an empty entry with the last non-empty value in this list. Studio trimmed whitespace around a string value. Studio wrote each value in this list as text.", "filled an empty entry with the last non-empty value; trimmed whitespace from a string; wrote each value in the list as text"), + (["", "5"], 2, "Studio filled an empty entry with the last non-empty value in this list.", "filled an empty entry with the last non-empty value"), + (["1", "2", "3", "4", "5", "6"], 4, "Studio resized this list to cover every filament slot.", "resized the list"), + ([" 1 ", "2", "3", "4", "5"], 4, "Studio resized this list to cover every filament slot. Studio trimmed whitespace around a string value.", "resized the list; trimmed whitespace from a string"), +]) +def test_filament_import_explanation_matches_each_operation(key, value, count, expected, reason): + from snapstudio_core.orca_import import _fix_filament_array_validity + changes = [] + cfg = {key: list(value)} + _fix_filament_array_validity(cfg, changes, count) + assert changes[0]["explanation"] == expected + assert changes[0]["kind"] == "engine" + assert cfg[key] != value + assert changes[0]["reason"] == reason + assert all(part in changes[0]["explanation"] for part in expected.split(". ") if part) + + +@pytest.mark.parametrize("mode", ["preserve", "recommended"]) +@pytest.mark.parametrize("key", ["filament_flush_temp", "filament_adaptive_volumetric_speed"]) +@pytest.mark.parametrize("value", [[220], [5, 5, 5, 5], [0, 0, 0, 0, 0], [" 5 ", 220, "", "7"]]) +def test_filament_array_conversion_passes_real_convert_preservation_invariant(tmp_path, mode, key, value): + """The real converter records every normalization; this cannot establish prose clarity, source choice, physical behavior, Orca behavior, dates, paraphrased overclaims, or screen-reader behavior.""" + summary, after = _prepare(tmp_path, {key: value}, mode=mode) + change = next(c for c in summary["compat_changed"] if c["key"] == key) + assert change["reason"] and change["explanation"] + assert all(isinstance(item, str) for item in after[key]) + assert after[key] != value + + +def test_action_reasons_replace_all_four_provenance_fields_as_one_record(): + from snapstudio_core.convert import _action_reasons + records, _, _, = _action_reasons({"normalizations": [ + {"key": "raft", "reason": "first", "explanation": "old", "source": "old source", "kind": "engine"}, + ], "orca_compatibility": [ + {"key": "raft", "reason": "second", "explanation": "new", "source": "new source", "kind": "engine"}, + ]}) + assert records["raft"] == {"reason": "second", "explanation": "new", "source": "new source", "kind": "engine"} + + +def test_action_reasons_clear_a_stale_explanation_only_with_an_explicit_clear(): + from snapstudio_core.convert import _action_reasons + records, _, _, = _action_reasons({"normalizations": [ + {"key": "raft", "reason": "first", "explanation": "old", "source": "old source", "kind": "engine"}, + {"key": "raft", "reason": ""}, + ]}) + assert "raft" not in records + + +def test_action_reasons_keep_prior_record_when_later_item_has_no_reason(): + from snapstudio_core.convert import _action_reasons + records, _, _, = _action_reasons({"normalizations": [ + {"key": "raft", "reason": "first", "explanation": "old", "source": "old source", "kind": "engine"}, + {"key": "raft"}, + ]}) + assert records["raft"] == {"reason": "first", "explanation": "old", "source": "old source", "kind": "engine"} + + +@pytest.mark.parametrize("key", ["filament_flush_temp", "filament_adaptive_volumetric_speed"]) +@pytest.mark.parametrize("value,expected,reason", [ + (["1", "2", "3", "4", " 5 "], "Studio resized this list to cover every filament slot.", "resized the list"), + (["1", "2", "3", "4", ""], "Studio resized this list to cover every filament slot.", "resized the list"), + (["1", "2", "3", "4", 5], "Studio resized this list to cover every filament slot.", "resized the list"), +]) +def test_entries_dropped_by_truncation_are_reported_only_as_a_resize(key, value, expected, reason): + """An entry beyond the slot count is dropped, so no trim, fill or text conversion may be claimed for it.""" + from snapstudio_core.orca_import import _fix_filament_array_validity + changes = [] + cfg = {key: list(value)} + _fix_filament_array_validity(cfg, changes, 4) + assert cfg[key] == ["1", "2", "3", "4"] + assert changes[0]["explanation"] == expected + assert changes[0]["reason"] == reason + + +@pytest.mark.parametrize("mode", ["preserve", "recommended"]) +@pytest.mark.parametrize("key", ["filament_flush_temp", "filament_adaptive_volumetric_speed"]) +@pytest.mark.parametrize("dropped", [" 5 ", "", 5]) +def test_truncation_through_the_real_convert_path_reports_only_a_resize(tmp_path, mode, key, dropped): + """Same rule end to end: the dropped entry never leaks a trim, fill or conversion claim into the summary.""" + four = ["#FF0000"] * 4 + summary, after = _prepare(tmp_path, {key: ["1", "2", "3", "4", dropped], "filament_colour": four, "filament_type": ["PLA"] * 4}, mode=mode) + change = next(c for c in summary["compat_changed"] if c["key"] == key) + assert after[key] == ["1", "2", "3", "4"] + assert change["explanation"] == "Studio resized this list to cover every filament slot." + assert change["reason"] == "resized the list" diff --git a/desktop/package-lock.json b/desktop/package-lock.json index 68c2dcb1..21918cd8 100644 --- a/desktop/package-lock.json +++ b/desktop/package-lock.json @@ -1,12 +1,12 @@ { "name": "snapmaker-studio-desktop", - "version": "1.5.0", + "version": "1.5.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "snapmaker-studio-desktop", - "version": "1.5.0", + "version": "1.5.1", "dependencies": { "@radix-ui/react-slot": "^1", "@tanstack/react-query": "^5", diff --git a/desktop/package.json b/desktop/package.json index c156e6e9..4d1ca855 100644 --- a/desktop/package.json +++ b/desktop/package.json @@ -1,7 +1,7 @@ { "name": "snapmaker-studio-desktop", "private": true, - "version": "1.5.0", + "version": "1.5.1", "description": "Snapmaker Studio — the local-first workflow platform for modern 3D printing. Understand any design, check if it will print, get it ready, and monitor your Snapmaker U1.", "type": "module", "scripts": { diff --git a/desktop/src-tauri/Cargo.lock b/desktop/src-tauri/Cargo.lock index 269709ca..911f1a25 100644 --- a/desktop/src-tauri/Cargo.lock +++ b/desktop/src-tauri/Cargo.lock @@ -2787,7 +2787,7 @@ checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" [[package]] name = "snapmaker-studio-desktop" -version = "1.5.0" +version = "1.5.1" dependencies = [ "libc", "serde", diff --git a/desktop/src-tauri/Cargo.toml b/desktop/src-tauri/Cargo.toml index 007faea8..1ef36180 100644 --- a/desktop/src-tauri/Cargo.toml +++ b/desktop/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snapmaker-studio-desktop" -version = "1.5.0" +version = "1.5.1" description = "Snapmaker Studio desktop shell" edition = "2021" diff --git a/desktop/src-tauri/tauri.conf.json b/desktop/src-tauri/tauri.conf.json index 60a928e6..99b38148 100644 --- a/desktop/src-tauri/tauri.conf.json +++ b/desktop/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "Snapmaker Studio", - "version": "1.5.0", + "version": "1.5.1", "identifier": "com.snapmakerstudio.desktop", "build": { "frontendDist": "../dist", diff --git a/desktop/src/api.ts b/desktop/src/api.ts index 2be05629..27fee06b 100644 --- a/desktop/src/api.ts +++ b/desktop/src/api.ts @@ -127,6 +127,9 @@ export interface SettingsChange { reason?: string; /** Plain-language explanation some steps add next to the reason. */ explanation?: string; + /** Evidence provenance for the explanation, replaced or cleared with it. */ + source?: string; + kind?: "file" | "engine" | "estimate" | "orca"; } export interface SettingsSummary { diff --git a/desktop/src/components/BusinessDoctors.tsx b/desktop/src/components/BusinessDoctors.tsx index 3380402c..a82f1093 100644 --- a/desktop/src/components/BusinessDoctors.tsx +++ b/desktop/src/components/BusinessDoctors.tsx @@ -120,7 +120,7 @@ export function BusinessDoctors({ filePath, host }: { filePath: string; host?: s
+ sub="estimated cost" /> diff --git a/desktop/src/components/PrepareSettingsSummary.test.tsx b/desktop/src/components/PrepareSettingsSummary.test.tsx index d5cd8bc1..491b75d6 100644 --- a/desktop/src/components/PrepareSettingsSummary.test.tsx +++ b/desktop/src/components/PrepareSettingsSummary.test.tsx @@ -112,17 +112,19 @@ describe("PrepareSettingsSummary explanations", () => { kept_count: 12, mapped_to_u1: [{ key: "nozzle_temperature", old: "[200]", new: "[200,200,200,200]", reason: "carried over to U1 toolheads (values preserved)" }], compat_changed: [ - { key: "prime_tower_brim_width", old: "-1", new: "5", reason: "U1 compatibility clamp: -1 → 5", explanation: "-1 is outside the valid range for this setting (0 or more), which the Compatibility check flags as an invalid value. Studio used 5, the U1 default." }, - { key: "brim_type", old: "auto_brim", new: "no_brim", reason: "the creator left the brim on automatic", explanation: "Automatic means the slicer chooses." }, + { key: "prime_tower_brim_width", old: "-1", new: "5", reason: "U1 compatibility clamp: -1 → 5", explanation: "-1 is outside the valid range for this setting (0 or more), which the Compatibility check flags as an invalid value. Studio used 5, the U1 default.", source: "Studio's valid range for this setting", kind: "engine" as const }, + { key: "brim_type", old: "auto_brim", new: "no_brim", reason: "the creator left the brim on automatic", explanation: "Automatic means the slicer chooses.", source: "Studio's rule for how Snapmaker Orca imports this setting", kind: "orca" as const }, { key: "some_setting", old: "1", new: "2", reason: "changed only for U1 compatibility" }, ], recommended_changes: [{ key: "speed", old: 20, new: 40, reason: "available with the recommended U1 profile" }], }; it("shows the engine's explanation under each compatibility change that has one", () => { - const html = renderToStaticMarkup(); + const html = renderToStaticMarkup().replace(/'/g, "'"); expect(html).toContain("which the Compatibility check flags as an invalid value"); expect(html).toContain("Automatic means the slicer chooses."); + expect(html).toContain("Studio's check"); + expect(html).toContain("Studio's rule for how Snapmaker Orca imports this setting"); }); it("does not repeat a reason that only restates the change", () => { diff --git a/desktop/src/components/PrepareSettingsSummary.tsx b/desktop/src/components/PrepareSettingsSummary.tsx index 8dd31bd5..223b5791 100644 --- a/desktop/src/components/PrepareSettingsSummary.tsx +++ b/desktop/src/components/PrepareSettingsSummary.tsx @@ -2,6 +2,7 @@ import type { SettingsChange, SettingsSummary } from "@/api"; import { Button } from "@/components/ui/button"; import { Card, CardContent } from "@/components/ui/card"; import { settingNote } from "@/lib/settingNotes"; +import { evidenceKindLabel } from "@/lib/evidenceKind"; function value(value: unknown) { const text = typeof value === "string" ? value : JSON.stringify(value); @@ -16,7 +17,7 @@ function Changes({ changes, explain = false }: { changes: SettingsChange[]; expl return (
  • {change.key}:{value(change.old)} → {value(change.new)}
    - {note &&

    {note}

    } + {note &&

    {note.kind && {evidenceKindLabel(note.kind)}}{note.kind && note.source ? ` — ${note.source}. ` : note.kind ? ". " : note.source ? `${note.source}. ` : ""}{note.note}

    }
  • ); })} diff --git a/desktop/src/components/prepare-copy-guard.test.ts b/desktop/src/components/prepare-copy-guard.test.ts index 0a494488..b3a6dfe4 100644 --- a/desktop/src/components/prepare-copy-guard.test.ts +++ b/desktop/src/components/prepare-copy-guard.test.ts @@ -6,6 +6,7 @@ const BANNED_PATTERNS = [/\bsafe\b/i, /print-ready/i, /guaranteed/i]; const sources = import.meta.glob([ "./PrepareModeChooser.tsx", "./PrepareSettingsSummary.tsx", + "../lib/evidenceKind.ts", "./FirstPrintCard.tsx", "../routes/Compatibility.tsx", "../routes/DesignInsights.tsx", diff --git a/desktop/src/components/ui/ToolTabs.test.tsx b/desktop/src/components/ui/ToolTabs.test.tsx new file mode 100644 index 00000000..80a1521f --- /dev/null +++ b/desktop/src/components/ui/ToolTabs.test.tsx @@ -0,0 +1,230 @@ +// @vitest-environment jsdom +import { act, cleanup, fireEvent, render, screen } from "@testing-library/react"; +import { useState } from "react"; +import { afterEach, describe, expect, it } from "vitest"; +import { ToolTabs, type ToolTab } from "./ToolTabs"; + +afterEach(cleanup); + +const make = (ids: string[]): ToolTab[] => + ids.map((id) => ({ + id, label: `Tab ${id}`, + el:

    Heading {id}

    , + })); + +const tab = (name: string) => screen.getByRole("tab", { name }); +const press = (el: HTMLElement, key: string) => fireEvent.keyDown(el, { key }); + +describe("ToolTabs", () => { + it("names the tab row and wires tab and panel together with ids", () => { + render(); + expect(screen.getByRole("tablist", { name: "Example tools" })).toBeTruthy(); + const a = tab("Tab a"); + const panel = screen.getByRole("tabpanel"); + expect(a.id).toBeTruthy(); + expect(a.getAttribute("aria-controls")).toBe(panel.id); + expect(panel.getAttribute("aria-labelledby")).toBe(a.id); + expect(screen.getByRole("tabpanel", { name: "Tab a" })).toBe(panel); + }); + + it("only the selected tab has aria-controls, because inactive panels are not in the page", () => { + render(); + expect(tab("Tab a").getAttribute("aria-controls")).toBeTruthy(); + expect(tab("Tab b").hasAttribute("aria-controls")).toBe(false); + }); + + it("ignores navigation keys pressed with Alt, Ctrl or Meta", () => { + render(); + tab("Tab a").focus(); + for (const init of [ + { key: "ArrowLeft", altKey: true }, { key: "Home", ctrlKey: true }, { key: "ArrowRight", metaKey: true }, + { key: "Enter", ctrlKey: true }, + ]) { + const notPrevented = fireEvent.keyDown(tab("Tab a"), { ...init, cancelable: true }); + expect(notPrevented).toBe(true); // dispatchEvent returns false when preventDefault ran + expect(document.activeElement).toBe(tab("Tab a")); + expect(tab("Tab a").getAttribute("aria-selected")).toBe("true"); + } + }); + + it("keeps only the selected panel in the page", () => { + render(); + expect(screen.queryByText("Heading a")).not.toBeNull(); + expect(screen.queryByText("Heading b")).toBeNull(); + expect(screen.getAllByRole("tabpanel")).toHaveLength(1); + }); + + it("puts only the selected tab in the Tab order, and the panel is not a tab stop", () => { + render(); + expect(screen.getAllByRole("tab").map((t) => t.tabIndex)).toEqual([0, -1, -1]); + expect(screen.getByRole("tabpanel").tabIndex).toBe(-1); + }); + + it("moves focus with the arrow keys, wrapping at both ends, without switching the panel", () => { + render(); + tab("Tab a").focus(); + press(tab("Tab a"), "ArrowRight"); + expect(document.activeElement).toBe(tab("Tab b")); + press(tab("Tab b"), "ArrowRight"); + press(tab("Tab c"), "ArrowRight"); + expect(document.activeElement).toBe(tab("Tab a")); + press(tab("Tab a"), "ArrowLeft"); + expect(document.activeElement).toBe(tab("Tab c")); + expect(tab("Tab a").getAttribute("aria-selected")).toBe("true"); + expect(tab("Tab c").getAttribute("aria-selected")).toBe("false"); + expect(screen.queryByText("Heading a")).not.toBeNull(); + expect(screen.queryByText("Heading c")).toBeNull(); + }); + + it("moves the single tab stop with focus, leaving the selected tab as it was", () => { + render(); + tab("Tab a").focus(); + press(tab("Tab a"), "ArrowRight"); + expect(screen.getAllByRole("tab").map((t) => t.tabIndex)).toEqual([-1, 0, -1]); + expect(screen.getAllByRole("tab").map((t) => t.getAttribute("aria-selected"))).toEqual(["true", "false", "false"]); + }); + + it("after arrowing to another tab and leaving the row, focus comes back to the selected tab", () => { + render(); + tab("Tab a").focus(); + press(tab("Tab a"), "ArrowRight"); + expect(screen.getAllByRole("tab").map((t) => t.tabIndex)).toEqual([-1, 0, -1]); + act(() => { screen.getByRole("button", { name: "Action a" }).focus(); }); // focus leaves the row + expect(screen.getAllByRole("tab").map((t) => t.tabIndex)).toEqual([0, -1, -1]); + expect(tab("Tab a").getAttribute("aria-selected")).toBe("true"); + }); + + it("Home and End jump to the first and last tab, and Up and Down do nothing", () => { + render(); + tab("Tab a").focus(); + press(tab("Tab a"), "End"); + expect(document.activeElement).toBe(tab("Tab c")); + press(tab("Tab c"), "Home"); + expect(document.activeElement).toBe(tab("Tab a")); + press(tab("Tab a"), "ArrowDown"); + press(tab("Tab a"), "ArrowUp"); + expect(document.activeElement).toBe(tab("Tab a")); + }); + + it("Enter selects the focused tab and shows its panel", () => { + render(); + tab("Tab a").focus(); + press(tab("Tab a"), "ArrowRight"); + press(tab("Tab b"), "Enter"); + expect(tab("Tab b").getAttribute("aria-selected")).toBe("true"); + expect(screen.queryByText("Heading b")).not.toBeNull(); + expect(screen.queryByText("Heading a")).toBeNull(); + expect(screen.getByRole("tabpanel").getAttribute("aria-labelledby")).toBe(tab("Tab b").id); + }); + + it("Space selects the focused tab", () => { + render(); + tab("Tab b").focus(); + press(tab("Tab b"), " "); + expect(screen.queryByText("Heading b")).not.toBeNull(); + }); + + it("a click selects the tab and makes it the tab stop", () => { + render(); + fireEvent.click(tab("Tab b")); + expect(screen.queryByText("Heading b")).not.toBeNull(); + expect(screen.getAllByRole("tab").map((t) => t.tabIndex)).toEqual([-1, 0]); + }); + + it("honors the initial tab", () => { + render(); + expect(screen.queryByText("Heading b")).not.toBeNull(); + expect(screen.getAllByRole("tab").map((t) => t.tabIndex)).toEqual([-1, 0]); + }); + + it("renders nothing, without throwing, when there are no tabs", () => { + const { container } = render(); + expect(container.innerHTML).toBe(""); + }); + + it("uses the shared focus ring tokens on each tab", () => { + render(); + for (const t of screen.getAllByRole("tab")) { + expect(t.className).toContain("focus-visible:ring-2"); + expect(t.className).toContain("focus-visible:ring-ring"); + expect(t.className).toContain("focus-visible:ring-offset-background"); + expect(t.className).toContain("focus-visible:outline-none"); + } + }); +}); + +function Removable({ ids }: { ids: string[] }) { + return ; +} + +function Dropper() { + const [ids, setIds] = useState(["a", "b"]); + return ( +
    + + +
    + ); +} + +describe("ToolTabs when a tab disappears", () => { + it("selects the first remaining tab when the selected tab is removed", () => { + const { rerender } = render(); + rerender(); + expect(tab("Tab b").getAttribute("aria-selected")).toBe("true"); + expect(screen.queryByText("Heading b")).not.toBeNull(); + expect(screen.getAllByRole("tab").map((t) => t.tabIndex)).toEqual([0, -1]); + }); + + it("moves the tab stop to the selected tab when the focused tab is removed", () => { + const { rerender } = render(); + tab("Tab a").focus(); + press(tab("Tab a"), "End"); + rerender(); + expect(tab("Tab a").getAttribute("aria-selected")).toBe("true"); + expect(screen.getAllByRole("tab").map((t) => t.tabIndex)).toEqual([0, -1]); + expect(document.activeElement).toBe(tab("Tab a")); + }); + + it("moves real focus to the new selected tab when the focused, selected tab is removed", () => { + const { rerender } = render(); + tab("Tab a").focus(); + rerender(); + expect(document.activeElement).toBe(tab("Tab b")); + }); + + it("moves focus to the selected tab when focus was inside a panel that is unmounted", () => { + render(); + const inside = screen.getByRole("button", { name: "Action a" }); + inside.focus(); + expect(document.activeElement).toBe(inside); + act(() => { fireEvent.click(screen.getByRole("button", { name: "drop a" })); }); + expect(document.activeElement).toBe(tab("Tab b")); + }); + + it("does not take focus back after the tabs went empty and came back", () => { + function Toggle({ ids }: { ids: string[] }) { + return ( +
    + + +
    + ); + } + const { rerender } = render(); + screen.getByRole("button", { name: "Action a" }).focus(); + rerender(); + const outside = screen.getByRole("button", { name: "outside" }); + outside.focus(); + rerender(); + expect(document.activeElement).toBe(outside); + }); + + it("does not take focus from elsewhere on the page when a tab is removed", () => { + render(); + const drop = screen.getByRole("button", { name: "drop a" }); + drop.focus(); + fireEvent.click(drop); + expect(document.activeElement).toBe(drop); + }); +}); diff --git a/desktop/src/components/ui/ToolTabs.tsx b/desktop/src/components/ui/ToolTabs.tsx index 0188b95b..05d6c6e6 100644 --- a/desktop/src/components/ui/ToolTabs.tsx +++ b/desktop/src/components/ui/ToolTabs.tsx @@ -1,10 +1,24 @@ -import { useState, type ReactNode } from "react"; +import { useEffect, useId, useRef, useState, type KeyboardEvent, type ReactNode } from "react"; import { type LucideIcon } from "lucide-react"; import { cn } from "@/lib/utils"; -// Lightweight tab switcher used to merge two closely-related tools onto one page -// (one sidebar item, two panels) instead of two duplicate nav entries. Each panel -// is an existing route component rendered as-is. +// Tab switcher used to merge two closely-related tools onto one page (one sidebar +// item, two panels) instead of two duplicate nav entries. Each panel is an existing +// route component rendered as-is. +// +// Keyboard model (WAI-ARIA tabs pattern, manual activation): +// - Only one tab is in the Tab order (roving tabindex): the focused tab while focus is +// in the row, otherwise the selected tab. +// - Arrow Left/Right (with wrap), Home and End move focus only. They never switch the +// panel. Enter, Space or a click selects the focused tab. +// - Manual activation is deliberate. Switching unmounts one route and mounts the +// other, which re-runs that route's engine requests. Moving focus along the tab row +// must not trigger that. The pattern allows manual activation for panels that are +// expensive to show. +// - Focus entering the row always lands on the selected tab: the tab stop resets to it +// when focus leaves the row. +// - The selected tab and the tab that owns the tab stop are tracked separately +// (`active` and `focused`). export interface ToolTab { id: string; label: string; @@ -12,25 +26,113 @@ export interface ToolTab { el: ReactNode; } -export function ToolTabs({ tabs, initial }: { tabs: ToolTab[]; initial?: string }) { +export function ToolTabs({ tabs, initial, label }: { + tabs: ToolTab[]; + initial?: string; + /** Accessible name of the tab row (rendered as aria-label), for example "Print quality tools". */ + label: string; +}) { + const uid = useId(); const [active, setActive] = useState(initial ?? tabs[0]?.id); - const current = tabs.find((t) => t.id === active) ?? tabs[0]; + const [focused, setFocused] = useState(active); + const rootRef = useRef(null); + const tabRefs = useRef(new Map()); + // True while keyboard focus is somewhere inside this component (tab row or panel). + const focusInside = useRef(false); + + // A tab can disappear while selected or focused. Fall back to the first remaining tab. + const activeId = tabs.some((t) => t.id === active) ? active : tabs[0]?.id; + const focusedId = tabs.some((t) => t.id === focused) ? focused : activeId; + const idKey = tabs.map((t) => t.id).join("\u0000"); + + useEffect(() => { + // With no tabs the root is gone and no blur fired; forget any focus that was inside it. + if (!activeId) focusInside.current = false; + // Keep the stored state in step with what is shown, so a removed tab that + // returns later does not silently become selected again. + if (activeId !== active) setActive(activeId); + if (focusedId !== focused) setFocused(focusedId); + // If focus was on the removed tab, or inside the panel that was unmounted, the + // browser has dropped it to the page body. Put it on the selected tab. + const now = document.activeElement; + const lost = !now || now === document.body || !now.isConnected || !rootRef.current?.contains(now); + if (focusInside.current && lost && activeId) tabRefs.current.get(activeId)?.focus(); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [idKey]); + + if (tabs.length === 0 || !activeId) return null; + const current = tabs.find((t) => t.id === activeId) ?? tabs[0]; + const tabDomId = (id: string) => `${uid}-tab-${id}`; + const panelDomId = (id: string) => `${uid}-panel-${id}`; + + const moveFocus = (id: string) => { + setFocused(id); + tabRefs.current.get(id)?.focus(); + }; + const select = (id: string) => { + setFocused(id); + setActive(id); + }; + const onKeyDown = (e: KeyboardEvent, index: number) => { + // Browser and assistive-technology shortcuts (Alt+Left is Back, Ctrl+Home scrolls) are left alone. + if (e.altKey || e.ctrlKey || e.metaKey) return; + const last = tabs.length - 1; + let next: number | null = null; + if (e.key === "ArrowRight") next = index === last ? 0 : index + 1; + else if (e.key === "ArrowLeft") next = index === 0 ? last : index - 1; + else if (e.key === "Home") next = 0; + else if (e.key === "End") next = last; + if (next !== null) { + e.preventDefault(); + moveFocus(tabs[next].id); + } else if (e.key === "Enter" || e.key === " ") { + e.preventDefault(); + select(tabs[index].id); + } + }; + return ( -
    -
    - {tabs.map((t) => ( - ))}
    -
    {current?.el}
    + {/* key: always unmount the previous panel, even when two panels render the same component type. */} +
    + {current.el} +
    ); } diff --git a/desktop/src/lib/evidenceKind.test.ts b/desktop/src/lib/evidenceKind.test.ts new file mode 100644 index 00000000..59b58a33 --- /dev/null +++ b/desktop/src/lib/evidenceKind.test.ts @@ -0,0 +1,10 @@ +import { describe, expect, it } from "vitest"; +import { evidenceKindLabel } from "./evidenceKind"; + +describe("evidence kind labels", () => { + it.each([ + ["file", "Read from your file"], ["engine", "Studio's check"], + ["estimate", "Estimate"], ["orca", "Verify in Snapmaker Orca"], + ])("maps %s", (kind, label) => expect(evidenceKindLabel(kind)).toBe(label)); + it("does not invent a label for unknown evidence", () => expect(evidenceKindLabel("unknown")).toBeNull()); +}); diff --git a/desktop/src/lib/evidenceKind.ts b/desktop/src/lib/evidenceKind.ts new file mode 100644 index 00000000..7087fd88 --- /dev/null +++ b/desktop/src/lib/evidenceKind.ts @@ -0,0 +1,21 @@ +export type EvidenceKind = "file" | "engine" | "estimate" | "orca"; + +// `file` maps to preflight `confirmed` and guide certainty `confirmed`: Studio read +// the value directly from the file. `engine` maps to Studio's own preflight check; +// its guide certainty is `likely` when the check supports a conclusion. `estimate` +// maps to preflight derived output and guide certainty `informational`. `orca` is +// advice to verify in Snapmaker Orca; it makes no claim about Orca's behavior. +// The existing UI phrase "Manual check in Orca required" remains the manual-review +// wording; this label is only the provenance badge for the accompanying explanation. + +const LABELS: Record = { + file: "Read from your file", + engine: "Studio's check", + estimate: "Estimate", + orca: "Verify in Snapmaker Orca", +}; + +export function evidenceKindLabel(kind: EvidenceKind | string | undefined): string | null { + const hasOwn = (Object as unknown as { hasOwn: (value: object, key: PropertyKey) => boolean }).hasOwn; + return typeof kind === "string" && hasOwn(LABELS, kind) ? LABELS[kind as EvidenceKind] : null; +} diff --git a/desktop/src/lib/guideClaims.test.ts b/desktop/src/lib/guideClaims.test.ts index f7b9c892..581e9e2a 100644 --- a/desktop/src/lib/guideClaims.test.ts +++ b/desktop/src/lib/guideClaims.test.ts @@ -1,10 +1,33 @@ import { describe, it, expect } from "vitest"; +// @ts-expect-error The desktop type setup intentionally omits Node declarations; Vitest supplies these APIs. +import { readFileSync, mkdtempSync, writeFileSync, rmSync } from "node:fs"; +// @ts-expect-error The desktop type setup intentionally omits Node declarations; Vitest supplies these APIs. +import { join, dirname } from "node:path"; +// @ts-expect-error The desktop type setup intentionally omits Node declarations; Vitest supplies these APIs. +import { tmpdir } from "node:os"; +// @ts-expect-error The desktop type setup intentionally omits Node declarations; Vitest supplies these APIs. +import { spawnSync } from "node:child_process"; +// @ts-expect-error The desktop type setup intentionally omits Node declarations; Vitest supplies these APIs. +import { fileURLToPath } from "node:url"; +declare const process: any; import { needsConfirm, confirmCopy, type ControlAction } from "./printerControl"; -import { FIDELITY_HEADINGS, fidelityHeadline, statusLabel } from "./fidelity"; +import { FIDELITY_HEADINGS, fidelityHeadline, statusLabel, targetNote } from "./fidelity"; import type { FidelityReport } from "@/api"; // Vite hands the guide's own JSON back as text; the guide sources live outside this app, so no copy is kept here. import tasksRaw from "../../../site/guide/content/tasks.json?raw"; import problemsRaw from "../../../site/guide/content/problems.json?raw"; +import pathRaw from "../../../site/guide/content/path.json?raw"; +import answersRaw from "../../../site/guide/content/answers.json?raw"; +import guideRaw from "../../../site/guide/content/guide.json?raw"; +import designInsightsRaw from "../routes/DesignInsights.tsx?raw"; +import placementCardRaw from "../components/PlacementCard.tsx?raw"; +import orcaHandoffRaw from "../components/OrcaHandoff.tsx?raw"; +import afterSlicingRaw from "../routes/AfterSlicing.tsx?raw"; +import printersRaw from "../routes/Printers.tsx?raw"; +import liveWorkspaceRaw from "../routes/LiveWorkspace.tsx?raw"; +import postSliceRaw from "./postSlice.ts?raw"; +import preflightRaw from "./preflight.ts?raw"; +import fidelityRaw from "./fidelity.ts?raw"; // Guard: statements in the user guide (site/guide) that depend on what this app does are checked // against the app. The expected facts come from the code imported above, not from the guide. @@ -14,7 +37,7 @@ import problemsRaw from "../../../site/guide/content/problems.json?raw"; // What it cannot establish: that the surrounding prose is well explained, or anything about a // physical printer or Snapmaker Orca. -const GUIDE: Record = { tasks: tasksRaw, problems: problemsRaw }; +const GUIDE: Record = { tasks: tasksRaw, problems: problemsRaw, path: pathRaw }; function guide(name: string): any { return JSON.parse(GUIDE[name]); } @@ -24,9 +47,41 @@ function strings(v: unknown): string[] { if (v && typeof v === "object") return Object.values(v).flatMap(strings); return []; } +export function checkNextActionLabels(answers: Array<{ nextAction: { label: string } }>, appSource: string): void { + const labels = new Set(); + for (const match of appSource.matchAll(/"([^"\n]+)"/g)) labels.add(match[1]); + for (const match of appSource.matchAll(/>\s*([^<>{}\n]+?)\s* guide("tasks").tasks.find((t: any) => t.id === id); const problem = (id: string) => guide("problems").find((p: any) => p.id === id); const text = (v: unknown) => strings(v).join(" "); +type GuideFact = { id: string; derive: string; tokens: string[] }; +const APP_FACTS: Record = { + "kept-orca": { id: "kept-reachability", derive: "app:desktop/src/lib/fidelity.ts#FIDELITY_HEADINGS", tokens: ["reached the copy", "read any note on the row"] }, +}; +// Real resolution: load the module under vitest and check it exports the name. Comments, strings and near-miss names do not count. +const appModules = import.meta.glob(["/src/**/*.{ts,tsx}", "!/src/**/*.test.*"]) as Record Promise>>; +export async function appExports(file: string, symbol: string): Promise { + const load = appModules["/" + file.replace(/^desktop\//, "")]; + if (!load) return false; + return Object.prototype.hasOwnProperty.call(await load(), symbol); +} +export async function checkAppAnswerFacts(answers: Array<{ id: string; requiredFacts: GuideFact[] }>, sourceRoot: string, pageText: string): Promise { + const appAnswers = answers.filter((a) => a.requiredFacts.some((f) => f.derive.startsWith("app:"))); + expect(new Set(Object.keys(APP_FACTS))).toEqual(new Set(appAnswers.map((a) => a.id))); + for (const answer of appAnswers) { + expect(answer.requiredFacts).toHaveLength(1); + const fact = answer.requiredFacts[0]; + expect(fact).toEqual(APP_FACTS[answer.id]); + const [, value] = fact.derive.split(":"); + const [file, fragment] = value.split("#"); + expect(readFileSync(join(sourceRoot, file), "utf8").length).toBeGreaterThan(0); + expect(await appExports(file, fragment)).toBe(true); + for (const token of fact.tokens) expect(pageText).toContain(token); + } +} describe("guide: printer controls match the app", () => { it("the grouping the guide relies on is still the app's policy", () => { @@ -93,3 +148,105 @@ describe("guide: fidelity groups match the app", () => { expect(page).not.toMatch(/not an error|nothing is wrong/i); }); }); + +describe("guide: golden answers have app-code assertions", () => { + it("covers the app-derived answers", () => { + /** This proves code-to-manifest coverage only; it cannot establish prose clarity, source fitness, honest dates, physical behavior, paraphrased overclaims, or screen-reader behavior. */ + const answers = JSON.parse(answersRaw).answers as Array<{ id: string; requiredFacts: Array<{ derive: string }> }>; + const expected = new Set(["setting-why", "size-or-placement", "kept-orca", "unknown-compatible", "sliced-for-u1", "original-unchanged", "print-success"]); + expect(new Set(answers.map((a) => a.id))).toEqual(expected); + const facts = new Set(answers.flatMap((a) => a.requiredFacts.map((f) => `${a.id}:${f.derive}`))); + expect(facts.size).toBe(7); + expect(facts.has("kept-orca:app:desktop/src/lib/fidelity.ts#FIDELITY_HEADINGS")).toBe(true); + expect(facts.has("print-success:backend:success_predict.predict")).toBe(true); + const app = [designInsightsRaw, placementCardRaw, orcaHandoffRaw, afterSlicingRaw, printersRaw, liveWorkspaceRaw].join("\n"); + for (const label of ["Print readiness", "Move onto the plate", "Open in Snapmaker Orca", "Check this job", "Printer Hub"]) expect(app).toContain(label); + expect(fidelityRaw).toContain("FIDELITY_HEADINGS"); + expect(postSliceRaw).toContain("export function unknownCount"); + expect(preflightRaw).toContain("resultLabel"); + expect(text(problem("looks-right"))).not.toContain("Print readiness"); + expect(text(guide("path"))).toContain("a signal may still have cost points"); + expect(designInsightsRaw).toMatch(/predict\.band !== "likely"[\s\S]*predict\.factors/); + expect(designInsightsRaw).toContain("Print readiness"); + }); + + it("resolves every app derive and checks the app-owned assertion table", async () => { + /** Resolution and table coverage cannot establish prose clarity, source fitness, honest dates, physical behavior, paraphrased overclaims, or screen-reader behavior. */ + const answers = JSON.parse(answersRaw).answers as Array<{ id: string; requiredFacts: GuideFact[] }>; + const appAnswers = answers.filter((a) => a.requiredFacts.some((f) => f.derive.startsWith("app:"))); + await checkAppAnswerFacts(answers, join(dirname(fileURLToPath(import.meta.url)), "../../.."), text(guide("path"))); + const appFacts = new Set(); + for (const answer of appAnswers) { + const fact = answer.requiredFacts[0]; + const expected = APP_FACTS[answer.id]; + expect({ id: fact.id, derive: fact.derive, tokens: fact.tokens }).toEqual(expected); + const [, value] = fact.derive.split(":"); + const [file, fragment] = value.split("#"); + expect(fragment).toBeTruthy(); + expect(await appExports(file, fragment)).toBe(true); + expect(FIDELITY_HEADINGS.kept).toBe("What stayed the same"); + expect(text(guide("path"))).toEqual(expect.stringContaining(fact.tokens[0])); + expect(text(guide("path"))).toEqual(expect.stringContaining(fact.tokens[1])); + appFacts.add(fact.id); + } + expect(appFacts).toEqual(new Set(Object.values(APP_FACTS).map((f) => f.id))); + expect(new Set(answers.map((a) => a.id))).toEqual(new Set(["setting-why", "size-or-placement", "kept-orca", "unknown-compatible", "sliced-for-u1", "original-unchanged", "print-success"])); + }); + + it("rejects a fresh manifest whose app derive was changed", async () => { + /** This mutation checks binding only; it cannot establish prose clarity, source fitness, dates, physical behavior, paraphrased overclaims, or screen-reader behavior. */ + const answers = JSON.parse(answersRaw).answers as Array<{ id: string; requiredFacts: GuideFact[] }>; + const mutated = JSON.parse(JSON.stringify(answers)) as Array<{ id: string; requiredFacts: GuideFact[] }>; + mutated.find((a) => a.id === "kept-orca")!.requiredFacts[0].derive = "app:desktop/src/lib/fidelity.ts#status"; + await expect(checkAppAnswerFacts(mutated, join(dirname(fileURLToPath(import.meta.url)), "../../.."), text(guide("path")))).rejects.toThrow(); + mutated.find((a) => a.id === "kept-orca")!.requiredFacts[0].derive = "app:desktop/src/lib/fidelity.ts#FIDELITY_HEADING"; + await expect(checkAppAnswerFacts(mutated, join(dirname(fileURLToPath(import.meta.url)), "../../.."), text(guide("path")))).rejects.toThrow(); + }); + + it("resolves app symbols by really importing the module", async () => { + /** Resolution checks that a name is exported; it cannot establish that the export is the right evidence for a guide claim. */ + expect(await appExports("desktop/src/lib/fidelity.ts", "FIDELITY_HEADINGS")).toBe(true); + expect(await appExports("desktop/src/lib/fidelity.ts", "FIDELITY_HEADING")).toBe(false); + expect(await appExports("desktop/src/lib/fidelity.ts", "toString")).toBe(false); + expect(await appExports("desktop/src/lib/no_such_file.ts", "FIDELITY_HEADINGS")).toBe(false); + }); + + it("checks exact next-action labels and built anchors", () => { + /** Literal-label and anchor checks cannot establish prose clarity, source fitness, honest dates, physical behavior, paraphrased overclaims, or screen-reader behavior. */ + const answers = JSON.parse(answersRaw).answers as Array<{ id: string; nextAction: { label: string; ref: string } }>; + const app = [designInsightsRaw, placementCardRaw, orcaHandoffRaw, afterSlicingRaw, printersRaw, liveWorkspaceRaw].join("\n"); + checkNextActionLabels(answers, app); + expect(answers.find((a) => a.id === "print-success")!.nextAction.label).toBe("Print readiness (estimate)"); + const html = readFileSync(join(dirname(fileURLToPath(import.meta.url)), "../../..", "site/guide/public/index.html"), "utf8"); + for (const answer of answers) if (answer.nextAction.ref.startsWith("#")) expect(html).toContain(`id="${answer.nextAction.ref.slice(1)}"`); + }); + + it("rejects a shortened next-action label from a fresh valid manifest", () => { + /** This mutation check cannot establish prose clarity, source fitness, honest dates, physical behavior, paraphrased overclaims, or screen-reader behavior. */ + const answers = JSON.parse(answersRaw).answers as Array<{ nextAction: { label: string } }>; + const mutated = answers.map((answer) => ({ ...answer, nextAction: { ...answer.nextAction } })); + mutated.find((answer) => answer.nextAction.label === "Check this job")!.nextAction.label = "Check"; + expect(() => checkNextActionLabels(mutated, [designInsightsRaw, placementCardRaw, orcaHandoffRaw, afterSlicingRaw, printersRaw, liveWorkspaceRaw].join("\n"))).toThrow(); + }); + + it("checks both guide and desktop version branches without changing the built guide", () => { + const guideRoot = join(dirname(fileURLToPath(import.meta.url)), "../../..", "site/guide"); + const html = readFileSync(join(guideRoot, "public/index.html"), "utf8"); + const guideVersion = JSON.parse(guideRaw).site.version as string; + expect(html).toContain(`v${guideVersion}`); + const temp = mkdtempSync(join(tmpdir(), "guide-version-")); + try { + const config = join(temp, "tauri.conf.json"); + const run = (version: string) => { + writeFileSync(config, JSON.stringify({ version })); + return spawnSync("node", [join(guideRoot, "tools/check.mjs")], { cwd: guideRoot, env: { ...process.env, SNAPSTUDIO_TAURI_CONF: config }, encoding: "utf8" }); + }; + const match = run(guideVersion); + expect(match.status).toBe(0); + expect(match.stdout + match.stderr).not.toContain("WARNING guide and desktop versions differ"); + const mismatch = run("9.9.9"); + expect(mismatch.status).toBe(0); + expect(mismatch.stdout + mismatch.stderr).toContain("WARNING guide and desktop versions differ"); + } finally { rmSync(temp, { recursive: true, force: true }); } + }); +}); diff --git a/desktop/src/lib/settingNotes.test.ts b/desktop/src/lib/settingNotes.test.ts index f87e3b3e..1e28b198 100644 --- a/desktop/src/lib/settingNotes.test.ts +++ b/desktop/src/lib/settingNotes.test.ts @@ -5,11 +5,11 @@ const change = (extra: Record) => ({ key: "k", old: "a", new: " describe("settingNote", () => { it("prefers the engine's explanation", () => { - expect(settingNote(change({ reason: "short", explanation: "Because the importer says so." }))).toBe("Because the importer says so."); + expect(settingNote(change({ reason: "short", explanation: "Because the importer says so." }))).toEqual({ note: "Because the importer says so.", source: null, kind: null }); }); it("falls back to a specific reason", () => { - expect(settingNote(change({ reason: "the creator left the brim on automatic" }))).toBe("the creator left the brim on automatic"); + expect(settingNote(change({ reason: "the creator left the brim on automatic" }))).toEqual({ note: "the creator left the brim on automatic", source: null, kind: null }); }); it("says nothing when the reason only restates that the setting changed", () => { @@ -29,6 +29,12 @@ describe("settingNote", () => { }); it("keeps an honest 'not reported' reason, because that is itself a statement of what Studio does not know", () => { - expect(settingNote(change({ reason: "change was not reported by the repair pipeline" }))).toBe("change was not reported by the repair pipeline"); + expect(settingNote(change({ reason: "change was not reported by the repair pipeline" }))).toEqual({ note: "change was not reported by the repair pipeline", source: null, kind: null }); + }); + + it("returns source and kind with the same note record", () => { + expect(settingNote(change({ explanation: "It was outside the range.", source: "Studio's valid range for this setting", kind: "engine" }))).toEqual({ + note: "It was outside the range.", source: "Studio's valid range for this setting", kind: "engine", + }); }); }); diff --git a/desktop/src/lib/settingNotes.ts b/desktop/src/lib/settingNotes.ts index 6cce9247..107086f5 100644 --- a/desktop/src/lib/settingNotes.ts +++ b/desktop/src/lib/settingNotes.ts @@ -1,4 +1,5 @@ import type { SettingsChange } from "@/api"; +import { evidenceKindLabel, type EvidenceKind } from "./evidenceKind"; // What to tell a person about WHY one setting changed, using only what the engine already said. // @@ -16,12 +17,20 @@ const RESTATES_THE_CHANGE = new Set([ "U1 project identity normalized", ]); -export function settingNote(change: SettingsChange): string | null { +export interface SettingNote { + note: string; + source: string | null; + kind: EvidenceKind | null; +} + +export function settingNote(change: SettingsChange): SettingNote | null { const explanation = change.explanation?.trim(); - if (explanation) return explanation; + const source = change.source?.trim() || null; + const kind = change.kind && evidenceKindLabel(change.kind) ? change.kind : null; + if (explanation) return { note: explanation, source, kind }; const reason = change.reason?.trim(); if (!reason) return null; // "U1 compatibility clamp: -1 → 5" only repeats the old and new values already on the line above it. if (RESTATES_THE_CHANGE.has(reason) || reason.startsWith("U1 compatibility clamp:")) return null; - return reason; + return { note: reason, source, kind }; } diff --git a/desktop/src/routes/CompatibilityHub.tsx b/desktop/src/routes/CompatibilityHub.tsx index e03e6639..1174db5e 100644 --- a/desktop/src/routes/CompatibilityHub.tsx +++ b/desktop/src/routes/CompatibilityHub.tsx @@ -8,7 +8,7 @@ import SourceCompatibility from "@/routes/SourceCompatibility"; // as two tabs. /source still resolves on its own for any deep links. export default function CompatibilityHub() { return ( - }, { id: "source", label: "Source Check", icon: FileSearch, el: }, ]} /> diff --git a/desktop/src/routes/PrintQualityHub.tsx b/desktop/src/routes/PrintQualityHub.tsx index 90ac5958..f0194489 100644 --- a/desktop/src/routes/PrintQualityHub.tsx +++ b/desktop/src/routes/PrintQualityHub.tsx @@ -8,7 +8,7 @@ import FirstLayer from "@/routes/FirstLayer"; // tabs. /first-layer still resolves on its own for any deep links. export default function PrintQualityHub() { return ( - }, { id: "first-layer", label: "First Layer", icon: Layers, el: }, ]} /> diff --git a/desktop/src/routes/ToolTabsHubs.test.tsx b/desktop/src/routes/ToolTabsHubs.test.tsx new file mode 100644 index 00000000..9ec36a8a --- /dev/null +++ b/desktop/src/routes/ToolTabsHubs.test.tsx @@ -0,0 +1,34 @@ +// @vitest-environment jsdom +import { cleanup, fireEvent, render, screen } from "@testing-library/react"; +import { afterEach, describe, expect, it, vi } from "vitest"; + +// The four panels call the engine on mount. Stubs keep this a test of the tab wiring only. +vi.mock("@/routes/Compatibility", () => ({ default: () =>

    Compatibility panel

    })); +vi.mock("@/routes/SourceCompatibility", () => ({ default: () =>

    Source Check panel

    })); +vi.mock("@/routes/PrintQuality", () => ({ default: () =>

    Print Quality panel

    })); +vi.mock("@/routes/FirstLayer", () => ({ default: () =>

    First Layer panel

    })); + +import CompatibilityHub from "./CompatibilityHub"; +import PrintQualityHub from "./PrintQualityHub"; + +afterEach(cleanup); + +describe("tool hubs", () => { + it("Compatibility has an accessible tab row with its two tabs", () => { + render(); + expect(screen.getByRole("tablist", { name: "Compatibility tools" })).toBeTruthy(); + expect(screen.getAllByRole("tab").map((t) => t.textContent)).toEqual(["Compatibility", "Source Check"]); + expect(screen.queryByText("Compatibility panel")).not.toBeNull(); + fireEvent.click(screen.getByRole("tab", { name: "Source Check" })); + expect(screen.queryByText("Source Check panel")).not.toBeNull(); + expect(screen.queryByText("Compatibility panel")).toBeNull(); + }); + + it("Print Quality has an accessible tab row with its two tabs", () => { + render(); + expect(screen.getByRole("tablist", { name: "Print quality tools" })).toBeTruthy(); + expect(screen.getAllByRole("tab").map((t) => t.textContent)).toEqual(["Print Quality", "First Layer"]); + fireEvent.click(screen.getByRole("tab", { name: "First Layer" })); + expect(screen.queryByText("First Layer panel")).not.toBeNull(); + }); +}); diff --git a/docs/INNOVATION_FUND.md b/docs/INNOVATION_FUND.md index 46eefed2..9dd9e840 100644 --- a/docs/INNOVATION_FUND.md +++ b/docs/INNOVATION_FUND.md @@ -170,7 +170,7 @@ guessing in the direction that looks better. to end and prints a 27-check pass/fail table, so the claims can be verified without reading the source. It runs in CI on every pull request. - **An acceptance harness that drives the installed application**, not a dev - server: 45 checks over the real window and the frozen engine, including that the + server: 50 checks over the real window and the frozen engine, including that the input file is byte-identical afterwards and that uninstalling leaves nothing behind. - **Regression tests against genuine slicer output** — real OrcaSlicer, @@ -208,19 +208,19 @@ simply the machine it is verified against. ## Evidence -Everything below was verified against the **v1.5.0 release-candidate build** (the same +Everything below was verified against the **v1.5.1 release-candidate build** (the same application published on the release page; the installed-application run used an acceptance copy of its installer, and the real installer was exercised only on a disposable GitHub-hosted runner), not a development build. The backend and desktop test counts come from the source at the release commit, not from the installer. Commands, counts and full reports: [TRUST_STATUS.md](TRUST_STATUS.md). | What | Result | |---|---| -| Installed-application acceptance, through the real UI | 45/45 | -| Read-only verification against a real Snapmaker U1, from the Windows-installed app | 58/58 | +| Installed-application acceptance, through the real UI | 50/50 | +| Read-only verification against a real Snapmaker U1, from the Windows-installed app, with Spoolman and Bambuddy | 76/76 | | Regression tests against genuine Orca/Bambu/Prusa projects | 36 tests | | End-to-end pipeline self-check | 27/27 | -| Backend tests | 2804 passed, 13 skipped | -| Desktop tests | 725 passed | +| Backend tests | 2927 passed, 49 skipped | +| Desktop tests | 852 passed | | TypeScript, Rust, production build | clean | Demo: [`docs/media/snapmaker-studio-demo.mp4`](media/snapmaker-studio-demo.mp4) — diff --git a/docs/RELEASE_METADATA.md b/docs/RELEASE_METADATA.md index 60ef394f..7f29570b 100644 --- a/docs/RELEASE_METADATA.md +++ b/docs/RELEASE_METADATA.md @@ -17,15 +17,15 @@ Every *other* document must link here rather than restate these values. | Field | Value | |---|---| -| Version | v1.5.0 | -| Installer | `Snapmaker.Studio_1.5.0_x64-setup.exe` | -| Size (bytes) | 21,944,474 | -| SHA256 | `d443f64f5167239f1422c719882cf245cff5d00d40c55fb67fc5a1e497b84e82` | -| Linux installer | `snapmaker-studio_1.5.0_amd64_5245cf9f9664.deb` | -| Linux size (bytes) | 25,944,098 | -| Linux SHA256 | `7fca28d9d4e2558f8a6bdc765b121e2290c54abd39e2a1b9b2efaeea6d923e5a` | -| Build run | https://github.com/DVOpenLabs/snapmaker-studio/actions/runs/37533259845 | -| Release URL | https://github.com/DVOpenLabs/snapmaker-studio/releases/tag/v1.5.0 | +| Version | v1.5.1 | +| Installer | `Snapmaker.Studio_1.5.1_x64-setup.exe` | +| Size (bytes) | 21,962,736 | +| SHA256 | `8955097365b12e9eb1405a098c1f6ab345d56d397681a67f0cb08257d1471be3` | +| Linux installer | `snapmaker-studio_1.5.1_amd64_abf20bf0f74d.deb` | +| Linux size (bytes) | 25,954,272 | +| Linux SHA256 | `c5766900437fa9826eefdb970c0ed21894b4f5f4b4795518993677ca6eeed08b` | +| Build run | https://github.com/DVOpenLabs/snapmaker-studio/actions/runs/37947895421 | +| Release URL | https://github.com/DVOpenLabs/snapmaker-studio/releases/tag/v1.5.1 | | Trust status | ACCEPTED — see [docs/TRUST_STATUS.md](TRUST_STATUS.md) | A stable release, not a prerelease, so GitHub's "latest release" points at it. @@ -36,6 +36,19 @@ Note: verify with `Get-FileHash -Algorithm SHA256 ` (Windows) or ## Previous release +| Field | Value | +|---|---| +| Version | v1.5.0 | +| Installer | `Snapmaker.Studio_1.5.0_x64-setup.exe` | +| Size (bytes) | 21,944,474 | +| SHA256 | `d443f64f5167239f1422c719882cf245cff5d00d40c55fb67fc5a1e497b84e82` | +| Linux installer | `snapmaker-studio_1.5.0_amd64_5245cf9f9664.deb` | +| Linux size (bytes) | 25,944,098 | +| Linux SHA256 | `7fca28d9d4e2558f8a6bdc765b121e2290c54abd39e2a1b9b2efaeea6d923e5a` | +| Release URL | https://github.com/DVOpenLabs/snapmaker-studio/releases/tag/v1.5.0 | + +## Superseded + | Field | Value | |---|---| | Version | v1.4.1 | diff --git a/docs/RELEASE_NOTES.md b/docs/RELEASE_NOTES.md index b03b157b..1327cb37 100644 --- a/docs/RELEASE_NOTES.md +++ b/docs/RELEASE_NOTES.md @@ -1,73 +1,59 @@ -# Snapmaker Studio v1.5.0 — Project Materials +# Snapmaker Studio v1.5.1 — clearer Prepare, easier spool choices, accessible controls > **Independent open-source project — not affiliated with or endorsed by Snapmaker.** > "Snapmaker" is a trademark of its respective owner. -Which real spool is in which colour slot, and which installed Snapmaker Orca preset goes with it, -is now part of preparing a project (#39). Studio shows what the model asks for, suggests spools from -your inventory, and writes your choices into a prepared copy. You pick every one of them. - -**Model → the materials and colours it needs → suggested spools from your inventory → the installed -Orca preset you confirm → review → Prepare.** +A small release on top of v1.5.0. It makes Project Materials easier to use with a real spool inventory, +says why Studio changed a setting, and makes two screens work properly from the keyboard and with a +screen reader. Your original files are still never modified, Studio still does not slice, and it never starts a print without your confirmation. ## Project Materials -- **It appears on Prepare whenever the project has filament slots**, whether or not the - compatibility check found anything. Nothing on the page waits for a check result. -- **Top spool candidates, with the reasons.** For each slot Studio lists the best three spools - from your provider (Spoolman, SpoolEase or Bambuddy) and says why: material match, whether the - subtype could be compared, colour distance, and whether the filament left looks like enough - (always marked as an estimate Studio cannot fully trust). -- **Nothing is chosen for you.** No spool is selected automatically and no preset is confirmed - silently. Studio may suggest a generic preset; it never applies one on its own. -- **You choose the physical spool**, then the installed Orca preset for it. The spool's colour is - carried into the prepared copy. -- **Remember a mapping** for one spool or for similar spools. It is saved only after the prepared - copy was actually written, and it is checked again every time: a preset that was deleted, - renamed, replaced or no longer fits is not applied. -- **Review before Prepare.** A plain-language summary lists, per slot, what was mapped, what - changed, what was kept and what the preset controls. Spool details are labelled as what you - selected, not as read from the file. -- **Same-preset safety.** Snapmaker Orca copies a declared value to every slot that uses the same - preset. Studio removes only its own declarations from such a group, and stops (writing nothing, - and saying why) if the project's own vendor or type declarations would be copied onto a slot they - do not belong to. -- **Recommended mode no longer silently writes the legacy "Snapmaker PLA" preset.** A slot keeps - the project's own filament identity unless you confirmed an installed preset for it. - -## Snapmaker Orca's own presets - -Studio reads the filament presets installed with Snapmaker Orca and can check each one against the -U1 and your nozzle size. A preset Studio verifies that way is shown as **Proven**, and a confirmed -Orca preset is the verified path: Snapmaker Orca applies its temperature, flow and cooling. - -## Presets you made yourself — an important limit - -- Studio can find compatible filament presets you created in Snapmaker Orca, map a spool to one, - and remember that mapping. -- They are shown as **"Confirmed by you"** and **"Manual check in Orca required"**, never as Proven. -- In testing, when Snapmaker Orca opened a project that names a preset someone made, it kept the - project's own values and showed the preset as modified, rather than applying the preset's own - temperature, flow and cooling (in one profile it also showed a "Customized Preset" prompt). -- **Studio therefore does not say Orca will apply those values.** Check the filament in Snapmaker - Orca before slicing. +- **Choose any spool from your inventory.** Each slot can open your provider's whole spool list, searchable + by vendor, material, color or id, showing color, vendor, material, spool id, weight status and the status + of the mapped Orca preset. +- **Studio says when a spool leaves the preset alone.** If you pick a spool but no Orca preset, the slot and + the review now say: "Spool selected, but no Orca preset selected. The project's existing filament preset + will remain." +- **Forget a saved mapping.** A mapping Studio remembered for one spool, or for similar spools, now has a + **Forget saved mapping** button. The confirmation says what is forgotten and what is not changed (your + inventory, your Orca presets and the project). +- **A file Studio could not read is no longer treated as damaged.** If another program briefly holds the + saved-mappings file, Studio now waits and retries, and if it still cannot read the file it changes nothing + and tells you to try again. Before, a brief lock could cause the file to be set aside as damaged. + +## Prepare: why a setting changed + +- The Prepare summary now shows a short reason under each setting Studio changed for the U1, and labels where + the statement comes from: **Studio's check** (Studio did or checked it itself) or **Verify in Snapmaker + Orca** (advice to check it there; it makes no claim about how Snapmaker Orca behaves). +- Lists that Studio had to repair (for example one value per filament) say exactly what was done. + +## Easier to use with a keyboard or screen reader + +- **Printer actions.** The confirmation for Start, Cancel print and Emergency stop is now a proper dialog: + it has a name and description, starts on **Cancel**, and Escape only ever dismisses it. It names the printer + (and the file for Start) and is withdrawn if the printer changes or can no longer take the action. +- **Tool tabs.** The tab rows for Compatibility / Source Check and Print Quality / First Layer now work with + the arrow keys, Home and End, show a clear focus outline, and wrap on narrow windows. Moving along the row + does not open or re-run a tool; Enter, Space or a click does. + +## User guide + +- The in-app Help and Get Started pages link to the new task-first user guide, which now shows where each + statement comes from and which version of Studio it was checked against. +- The guide's screenshots were captured from v1.5.0 and have not been retaken. ## Not in this release -- Creating custom Orca presets. -- Changing or decrementing anything in your spool provider. -- Choosing a spool for you. -- Writing print parameters of its own. -- Keeping a project's arbitrary print parameters underneath a different preset. - -Studio does not slice and does not start prints: Snapmaker Orca slices, and anything sent to your -printer is something you confirm. +- No change to what Studio writes into a prepared copy beyond the explanations above. +- No new printer actions. Studio does not start a print without your confirmation; anything sent to your printer is something you confirm. ## Verify your download -- Windows: `Snapmaker.Studio_1.5.0_x64-setup.exe` — 21,944,474 bytes — SHA256 `d443f64f5167239f1422c719882cf245cff5d00d40c55fb67fc5a1e497b84e82` -- Linux: `snapmaker-studio_1.5.0_amd64_5245cf9f9664.deb` — 25,944,098 bytes — SHA256 `7fca28d9d4e2558f8a6bdc765b121e2290c54abd39e2a1b9b2efaeea6d923e5a` +- Windows: `Snapmaker.Studio_1.5.1_x64-setup.exe` — 21,962,736 bytes — SHA256 `8955097365b12e9eb1405a098c1f6ab345d56d397681a67f0cb08257d1471be3` +- Linux: `snapmaker-studio_1.5.1_amd64_abf20bf0f74d.deb` — 25,954,272 bytes — SHA256 `c5766900437fa9826eefdb970c0ed21894b4f5f4b4795518993677ca6eeed08b` Neither installer is code-signed yet; verify the hash before you run it. Verification for this release is in -[TRUST_STATUS.md](https://github.com/DVOpenLabs/snapmaker-studio/blob/v1.5.0/docs/TRUST_STATUS.md). +[TRUST_STATUS.md](https://github.com/DVOpenLabs/snapmaker-studio/blob/v1.5.1/docs/TRUST_STATUS.md). diff --git a/docs/SUBMISSION_STATUS.md b/docs/SUBMISSION_STATUS.md index 98b2c8b8..8c5126e5 100644 --- a/docs/SUBMISSION_STATUS.md +++ b/docs/SUBMISSION_STATUS.md @@ -13,10 +13,10 @@ page is the status record only. | | | |---|---| -| Version | **v1.5.0** — the current stable release | +| Version | **v1.5.1** — the current stable release | | Installer, size, SHA256 | [RELEASE_METADATA.md](RELEASE_METADATA.md) — canonical | | Verification state | [TRUST_STATUS.md](TRUST_STATUS.md) — **ACCEPTED** | -| Release | | +| Release | | The installer is not code-signed — verify the SHA256 before installing. See [windows-install.md](windows-install.md) and diff --git a/docs/TRUST_STATUS.md b/docs/TRUST_STATUS.md index f0093a46..fe63128c 100644 --- a/docs/TRUST_STATUS.md +++ b/docs/TRUST_STATUS.md @@ -9,6 +9,34 @@ real Snapmaker U1 have all passed and are recorded here. > current form is `-InstallerPath` + `-AttestationPath` or `-RealInstaller` + `-ExpectedSha256` + `-SourceVersion`; > see `docs/internal/HARNESS_ISOLATION.md`. The entries are left as they were. +## v1.5.1 — ACCEPTED + +**Clearer Prepare, easier spool choices, accessible controls.** The Windows installer and Linux `.deb` +named in [RELEASE_METADATA.md](RELEASE_METADATA.md) are the build recorded here, verified by SHA256. Build: +[run 37947895421](https://github.com/DVOpenLabs/snapmaker-studio/actions/runs/37947895421), commit +`abf20bf0f74d44eb66b793c317fd303d518e5828`. This release's immutable snapshot: [internal/evidence/1.5.1.json](internal/evidence/1.5.1.json). + +| Gate | Result | +|---|---| +| Backend / desktop suites | backend **2927 passed / 49 skipped**, desktop **852**, Rust **49** | +| Release-candidate build (Windows installer + Linux `.deb`) | **pass** | +| Windows default-path upgrade smoke (disposable GitHub-hosted runner, upgrading from the published v1.5.0 installer) | **pass** | +| Windows installed-application acceptance (acceptance-identity copy of the installer, clean local account, upgrade variant from the published v1.5.0 installer; production-state tripwire 0 violations, no orphan processes) | **50/50** — [internal/acceptance-1.5.1.json](internal/acceptance-1.5.1.json) | +| Linux clean-environment validation, `ubuntu:22.04` | **49/49** | +| Linux clean-environment validation, `ubuntu:24.04` | **49/49** | +| Real Snapmaker U1, read-only, Windows-installed app, with both providers (Spoolman 0.27.0 and Bambuddy 1.2.5.7 as disposable local containers seeded with anonymous spools; six provider-on-hardware checks each, none skipped) | **76/76** — [internal/hardware-1.5.1.json](internal/hardware-1.5.1.json) | +| Update-check state stays in the lane's own data directory: turning the preference on in the installed release candidate (acceptance-identity copy, not the production identity) wrote `update_check.json` inside the lane's data directory and left the production path absent before and after | **pass** | +| Publish dry run | **pass** | +| `tsc`, `cargo test`, production build, `u1convert selfcheck` (27/27) | clean | + +### What is verified, and what is not + +The acceptance run is the acceptance-identity copy of the release candidate, not the production +installation; the real installer's upgrade was exercised on a disposable GitHub-hosted runner. The user +guide's screenshots were captured from v1.5.0 and were not retaken. The limit on presets a person made in +Snapmaker Orca is unchanged from v1.5.0 (below). No real SpoolEase device was tested, and nothing was +written to a spool provider. + ## v1.5.0 — ACCEPTED **Project Materials (#39).** The Windows installer and Linux `.deb` named in diff --git a/docs/innovation-fund/FINAL_SUBMISSION.md b/docs/innovation-fund/FINAL_SUBMISSION.md index 71329d92..54c7560b 100644 --- a/docs/innovation-fund/FINAL_SUBMISSION.md +++ b/docs/innovation-fund/FINAL_SUBMISSION.md @@ -49,7 +49,7 @@ Long form: [../INNOVATION_FUND.md](../INNOVATION_FUND.md). ## 3. What is being submitted -**Release:** [v1.5.0](https://github.com/DVOpenLabs/snapmaker-studio/releases/tag/v1.5.0) +**Release:** [v1.5.1](https://github.com/DVOpenLabs/snapmaker-studio/releases/tag/v1.5.1) — the current stable build; v0.4.0 was the first verified against a real Snapmaker U1, and every release since has been. Installer name, size and SHA256: [../RELEASE_METADATA.md](../RELEASE_METADATA.md). Verification record: @@ -72,18 +72,18 @@ Practicality & Adaptability. The remaining 20% is a community vote. ## 5. Evidence, in one table -Verified against the v1.3.1 release-candidate build (the same application published on the release page; the installed-application run used an acceptance copy of its installer, and the real installer was exercised only on a disposable GitHub-hosted runner), not a development build. The backend and desktop test counts come from the +Verified against the v1.5.1 release-candidate build (the same application published on the release page; the installed-application run used an acceptance copy of its installer, and the real installer was exercised only on a disposable GitHub-hosted runner), not a development build. The backend and desktop test counts come from the source at the release commit, not from the installer. | What | Result | |---|---| -| Installed-application acceptance, through the real UI | 45/45 | +| Installed-application acceptance, through the real UI | 50/50 | | Linux clean-image validation, Ubuntu 22.04 + 24.04 | 49/49 each | -| Read-only verification against a real Snapmaker U1, from the Windows-installed app | 58/58 | +| Read-only verification against a real Snapmaker U1, from the Windows-installed app, with Spoolman and Bambuddy | 76/76 | | Regression tests against genuine Orca/Bambu/Prusa projects | 36 tests | | End-to-end pipeline self-check | 27/27 | -| Backend tests | 2804 passed, 13 skipped | -| Desktop tests | 725 passed | +| Backend tests | 2927 passed, 49 skipped | +| Desktop tests | 852 passed | | TypeScript · production build · Rust | clean | Reproduce any of it: [JUDGE_WALKTHROUGH.md](JUDGE_WALKTHROUGH.md). diff --git a/docs/innovation-fund/JUDGE_OVERVIEW.md b/docs/innovation-fund/JUDGE_OVERVIEW.md index 348ed01a..7248b5ba 100644 --- a/docs/innovation-fund/JUDGE_OVERVIEW.md +++ b/docs/innovation-fund/JUDGE_OVERVIEW.md @@ -93,7 +93,7 @@ honest fix was to remove it, not to tune a number Studio cannot observe. ## What is verified, and how -Everything below ran against the **v1.5.0 release-candidate build** — an acceptance +Everything below ran against the **v1.5.1 release-candidate build** — an acceptance copy of its installer (same application files, separate install identity) was installed, launched, driven through the real window, then uninstalled; the real installer itself was exercised only on a disposable GitHub-hosted runner. Not a development @@ -102,18 +102,18 @@ source at the release commit, not from the installer. | What | Result | How to reproduce | |---|---|---| -| Installed-application acceptance (v1.3.0 release candidate, acceptance-identity copy of the installer) | **45/45** | Maintainer-run `tools/acceptance/run.ps1` (needs a rewrapped acceptance-identity installer; see [../internal/HARNESS_ISOLATION.md](../internal/HARNESS_ISOLATION.md)) | +| Installed-application acceptance (v1.5.1 release candidate, acceptance-identity copy of the installer, upgrade variant) | **50/50** | Maintainer-run `tools/acceptance/run.ps1` (needs a rewrapped acceptance-identity installer; see [../internal/HARNESS_ISOLATION.md](../internal/HARNESS_ISOLATION.md)) | | Linux clean-image validation, Ubuntu 22.04 + 24.04 | **49/49** each | see [../linux-install.md](../linux-install.md) | -| Read-only verification against a real Snapmaker U1, from the Windows-installed app | **58/58** | see [../internal/hardware-1.5.0.json](../internal/hardware-1.5.0.json) | +| Read-only verification against a real Snapmaker U1, from the Windows-installed app, with Spoolman and Bambuddy | **76/76** | see [../internal/hardware-1.5.1.json](../internal/hardware-1.5.1.json) | | End-to-end pipeline self-check | **27/27** | `u1convert selfcheck` | | Genuine OrcaSlicer / BambuStudio / PrusaSlicer projects | **36 tests** | `pytest tests/test_real_world_3mf.py` | -| Backend | 2804 passed, 13 skipped | `pytest` | -| Desktop | 725 passed | `npm run test` | +| Backend | 2927 passed, 49 skipped | `pytest` | +| Desktop | 852 passed | `npm run test` | | TypeScript · production build · Rust | clean | `tsc --noEmit` · `npm run build` · `cargo check` | The installed-application acceptance count is higher than the previous -release's (41), because this release adds two SpoolEase checks and some -checks on the test lane's own bookkeeping — see +release's (45), because this run is the upgrade variant, started from the +previous release's installer, and adds five upgrade checks — see [../TRUST_STATUS.md](../TRUST_STATUS.md) for exactly which. Full records, including the raw evidence files: [../TRUST_STATUS.md](../TRUST_STATUS.md). Step-by-step: [JUDGE_WALKTHROUGH.md](JUDGE_WALKTHROUGH.md). @@ -214,4 +214,4 @@ SHA256 before running it. Why, and what is being done: | Technical depth | [TECHNICAL_DEPTH.md](TECHNICAL_DEPTH.md) | | Where Studio sits in the field | [COMPETITOR_MATRIX.md](COMPETITOR_MATRIX.md) · [DIFFERENTIATION_STRATEGY.md](DIFFERENTIATION_STRATEGY.md) | | The ecosystem story | [OPEN_ECOSYSTEM.md](OPEN_ECOSYSTEM.md) | -| Download | [Releases](https://github.com/DVOpenLabs/snapmaker-studio/releases/tag/v1.5.0) · hash in [../RELEASE_METADATA.md](../RELEASE_METADATA.md) | +| Download | [Releases](https://github.com/DVOpenLabs/snapmaker-studio/releases/tag/v1.5.1) · hash in [../RELEASE_METADATA.md](../RELEASE_METADATA.md) | diff --git a/docs/innovation-fund/JUDGE_WALKTHROUGH.md b/docs/innovation-fund/JUDGE_WALKTHROUGH.md index aaa4587e..37fe1b01 100644 --- a/docs/innovation-fund/JUDGE_WALKTHROUGH.md +++ b/docs/innovation-fund/JUDGE_WALKTHROUGH.md @@ -141,9 +141,9 @@ builds real decompression bombs and asserts the reader refuses them. ## Run the tests ```bash -cd backend && pytest # 2804 passed, 13 skipped +cd backend && pytest # 2927 passed, 49 skipped cd backend && u1convert selfcheck # 27/27 over production code paths -cd desktop && npm run test # 725 passed +cd desktop && npm run test # 852 passed cd desktop && npm run build # tsc + vite ``` @@ -174,8 +174,8 @@ It installs the rewrapped build into an isolated directory with its own WebView2 profile and engine data directory, drives the real application window over the Chrome DevTools Protocol, and uninstalls. Its checks include that the input file is byte-identical afterwards and that uninstalling leaves nothing behind. It stops -only processes it started. For the v1.3.0 release candidate, this harness scored **45/45** — -[../internal/acceptance-1.3.1.json](../internal/acceptance-1.3.1.json). +only processes it started. For the v1.5.1 release candidate (upgrade variant, started from the previous release's installer), this harness scored **50/50** — +[../internal/acceptance-1.5.1.json](../internal/acceptance-1.5.1.json). **A real printer.** With a Snapmaker U1 on the same network, the maintainer runs `tools/hardware/verify.ps1 -PrinterHost `. Like the acceptance harness, @@ -188,8 +188,8 @@ before the first request, so nothing is started, uploaded or queued and no temperature, motion, homing, pause, resume, cancel, emergency-stop or configuration call is made. The printer's address is replaced with a placeholder before anything reaches the evidence file. This release's real-U1 check ran through the -Windows-installed application itself — last result: **58/58** — -[../internal/hardware-1.3.1.json](../internal/hardware-1.3.1.json). +Windows-installed application itself — last result: **76/76**, with disposable Spoolman and Bambuddy containers seeded with anonymous spools — +[../internal/hardware-1.5.1.json](../internal/hardware-1.5.1.json). That run is worth reading rather than just counting. It proved the four toolheads' fitted nozzles are read live and shown as the printer's own reading, @@ -197,8 +197,7 @@ that an offline-saved conflicting nozzle note is shown as a conflict once the printer answers again with the printer's value used, and that a real "Remove my note" action restores the live row — with zero printer-control routes called throughout, confirmed by the harness's request listener, which -records every call. Not run this release: the Spoolman/Bambuddy-seeded -provider-on-hardware checks; this printer's four toolheads all carry the same +records every call. Not run this release: this printer's four toolheads all carry the same 0.4 mm nozzle, so a genuinely mixed-nozzle setup was exercised only in automated tests; and the Linux-installed app was not run against the real printer. No SpoolEase check was run against hardware either (its real-device diff --git a/docs/internal/HARNESS_ISOLATION.md b/docs/internal/HARNESS_ISOLATION.md index 976bef6d..051eb446 100644 --- a/docs/internal/HARNESS_ISOLATION.md +++ b/docs/internal/HARNESS_ISOLATION.md @@ -237,18 +237,24 @@ Menu and Desktop shortcut) and never the production keys or the shared publisher therefore still refuses to launch unless the production file is absent or `auto_check` is `false`, and the tripwire still detects a change. **These protections stay in place until override support is verified in the acceptance artifact; do not relax them on the strength of the source change alone.** - - *Product side (done in source, unreleased):* a build that includes the override reads and writes + - *Product side (in the v1.5.1 build and later):* a build that includes the override reads and writes `update_check.json` under `SNAPSTUDIO_DATA_DIR` when it is set. An explicit value that is empty, not valid text or not absolute is treated as unusable, never as "unset": the preference reads as off, saving fails, and no automatic check runs, so a bad value cannot select production state. Covered by temp-directory tests in `main.rs`. - *Harness side (already in place):* `Start-HarnessProcess` passes `SNAPSTUDIO_DATA_DIR = \engine-data` to the child only (`HarnessLauncher.psm1`, environment block next to `WEBVIEW2_USER_DATA_FOLDER`), so an override-aware build would write the file inside the lane with no further plumbing. - - *What remains:* (1) ship the override in a build and rewrap it as the acceptance artifact; (2) verify, on that - artifact, that `update_check.json` appears under the lane data dir and the production file is unchanged (extend the - tripwire to assert the lane file, and attest the build contains the override, for example by build identity); - (3) only then let the preflight skip the production check, and only for artifacts proven override-aware, keeping - it for older ones. Full harness integration is **not** claimed yet. + - *Verified on the v1.5.1 release candidate:* the override is in the v1.5.1 build. On the acceptance-identity copy + of that exact release candidate (installer SHA256 `8955097365b12e9eb1405a098c1f6ab345d56d397681a67f0cb08257d1471be3`, + clean local account), turning "Automatically check for updates" on in the installed Help screen wrote + `update_check.json` inside the lane data directory (`auto_check` true, then false when turned off), and the + production paths stayed absent before and after; the lane's production-state tripwire reported 0 violations. The + probe is a one-off script run against that artifact; it is not part of `tools/acceptance/run.ps1`. + - *What remains:* extend the tripwire to assert the lane file and attest that a build contains the override (for + example by build identity), and only then let the preflight skip the production check, and only for artifacts + proven override-aware, keeping it for older ones. The preflight and tripwire protections therefore **stay as they + are**: the upgrade lane first installs an older, non-override build, and full harness integration is **not** + claimed. - **Manual interference.** Launching the production exe by hand after the preflight, or using the auto-check UI during a harness session, is a detection-only case. - **Journal content** is validated on read, not on save, and the TEMP-misconfiguration case widens the override allowlist diff --git a/docs/internal/acceptance-1.5.1.json b/docs/internal/acceptance-1.5.1.json new file mode 100644 index 00000000..590f7cd7 --- /dev/null +++ b/docs/internal/acceptance-1.5.1.json @@ -0,0 +1,265 @@ +{ + "schema_version": "acceptance/3", + "lane": { + "schema": "harness-lane-evidence/3", + "lane": "upgrade between two rewrapped acceptance-identity installers (OLD -> NEW); not a production upgrade", + "laneKind": "acceptance", + "identity": "acceptance", + "status": "pass", + "installerSha256": "fb3d5b77b48a2ec24dc2bd352bc69650a60d1f6c89916860cc5eedd483310e46", + "sourceVersion": "1.5.1", + "templateSha256": "d30f5f9d4bc40902addbc895e4211498612c6f0c567a54738c47fe3403ce1028", + "rewrappedOnDemand": true, + "installDir": "install\\h3ad0b07139b54ea7a9fae0f424148a50", + "installArguments": "/S /NCRC /NS /D=", + "preflight": { + "updateCheck": "absent", + "webView2Runtime": "154.0.4258.62" + }, + "keptInstall": false, + "repair": null, + "journals": [ + { + "runId": "h3ad0b07139b54ea7a9fae0f424148a50", + "installExitCode": 0, + "finalized": true + }, + { + "runId": "h3ad0b07139b54ea7a9fae0f424148a50-u2", + "installExitCode": 0, + "finalized": true + } + ], + "orphanedInstall": null, + "uninstallOutcome": "Success", + "errorCount": 0, + "warningCount": 0, + "reasonCodes": [], + "warningCodes": [], + "tripwire": { + "violations": 0, + "added": 0, + "changed": 0, + "removed": 0, + "leveldbChanged": 0, + "structural": 0, + "completed": true, + "surfaces": { + "uninstallKey": 0, + "rememberedKey": 0, + "manufacturerKey": 0, + "runValue": 0, + "startMenuShortcut": 0, + "desktopShortcut": 0, + "installDir": 0 + } + }, + "shortcutFindings": 0, + "notProven": "Production registration, shortcut creation, default-path install/upgrade/uninstall of the real installer are NOT proven by this lane; they are exercised only on disposable GitHub-hosted CI runners." + }, + "checks": [ + { + "name": "Probe servers this run owns are up", + "ok": true + }, + { + "name": "Previous version installs", + "ok": true + }, + { + "name": "Previous version left state to migrate", + "ok": true + }, + { + "name": "Scripted install completes", + "ok": true + }, + { + "name": "Upgrade keeps the user's data", + "ok": true + }, + { + "name": "Upgrade leaves the acceptance registration in place", + "ok": true + }, + { + "name": "Upgrade registration reports the new version", + "ok": true + }, + { + "name": "Application installed", + "ok": true + }, + { + "name": "Frozen engine sidecar installed", + "ok": true + }, + { + "name": "Uninstaller installed", + "ok": true + }, + { + "name": "Application launches", + "ok": true + }, + { + "name": "Window title", + "ok": true + }, + { + "name": "Sidecar boots from the install directory", + "ok": true + }, + { + "name": "CDP reachable on the installed webview", + "ok": true + }, + { + "name": "Startup checks", + "ok": true + }, + { + "name": "Engine routes answer from the installed sidecar", + "ok": true + }, + { + "name": "Model passed on the command line is open", + "ok": true + }, + { + "name": "Project opens and its findings render", + "ok": true + }, + { + "name": "Prepare, fidelity, ledger and best-tool render", + "ok": true + }, + { + "name": "Colour plan renders on its own page", + "ok": true + }, + { + "name": "Post-Slice Doctor reads a sliced job in the installed app", + "ok": true + }, + { + "name": "One surface shows the whole job", + "ok": true + }, + { + "name": "Studio explains how sure it is about a job", + "ok": true + }, + { + "name": "First-evening mistakes are answered, not ignored", + "ok": true + }, + { + "name": "Spool notes and nozzle empty states render (W1/W6/W9)", + "ok": true + }, + { + "name": "Spool notes are created through the installed UI (W2)", + "ok": true + }, + { + "name": "Editing, clearing and validating a spool note behave as specified (W3/W5/W9)", + "ok": true + }, + { + "name": "Recording filament used shows an estimate, not a measurement (W4)", + "ok": true + }, + { + "name": "Nozzle sizes are confirmed through the installed UI (W6)", + "ok": true + }, + { + "name": "Sliced job is byte-identical afterwards", + "ok": true + }, + { + "name": "Original file is byte-identical afterwards", + "ok": true + }, + { + "name": "Painted colour is shown in the installed build", + "ok": true + }, + { + "name": "Spool notes and nozzle confirmations survive a relaunch (W7)", + "ok": true + }, + { + "name": "Removing nozzles, deleting a note and switching provider kind behave as specified (W8)", + "ok": true + }, + { + "name": "Probe servers survived the app restarts", + "ok": true + }, + { + "name": "Both provider wire shapes work in the installed build", + "ok": true + }, + { + "name": "No provider configured means no provider request", + "ok": true + }, + { + "name": "Provider addresses are validated in the installed build", + "ok": true + }, + { + "name": "A redirect off the local network is refused in the installed build", + "ok": true + }, + { + "name": "Closing the real window exits the app and its sidecar (not just a kill)", + "ok": true + }, + { + "name": "No orphan sidecar after close", + "ok": true + }, + { + "name": "Reopens cleanly", + "ok": true + }, + { + "name": "SpoolEase can be configured and read in the installed build", + "ok": true + }, + { + "name": "SpoolEase settings restore without the session key", + "ok": true + }, + { + "name": "Uninstall completes", + "ok": true + }, + { + "name": "Install directory removed", + "ok": true + }, + { + "name": "No sidecar survives uninstall", + "ok": true + }, + { + "name": "Harness journal finalised (nothing left to recover)", + "ok": true + }, + { + "name": "Production state unchanged (tripwire)", + "ok": true + }, + { + "name": "Harness cleanup reported no errors", + "ok": true + } + ], + "passed": 50, + "total": 50, + "evidence": "\\run\\\\evidence" +} diff --git a/docs/internal/evidence.json b/docs/internal/evidence.json index 833210f1..d7b9c1fc 100644 --- a/docs/internal/evidence.json +++ b/docs/internal/evidence.json @@ -1,30 +1,30 @@ { "acceptance": { - "passed": 45, - "report": "acceptance-1.5.0.json", - "total": 45 + "passed": 50, + "report": "acceptance-1.5.1.json", + "total": 50 }, "backend": { - "passed": 2804, - "skipped": 13 + "passed": 2927, + "skipped": 49 }, "demo": { "file": "docs/media/snapmaker-studio-demo.mp4", "seconds": 66 }, "desktop": { - "passed": 725 + "passed": 852 }, "hardware": { - "passed": 58, - "report": "hardware-1.5.0.json", - "total": 58 + "passed": 76, + "report": "hardware-1.5.1.json", + "total": 76 }, "schema_version": "evidence/1", - "screenshots_dir": "docs/screenshots/v1.5.0", + "screenshots_dir": "docs/screenshots/v1.5.1", "selfcheck": { "passed": 27, "total": 27 }, - "version": "1.5.0" + "version": "1.5.1" } diff --git a/docs/internal/evidence/1.5.1.json b/docs/internal/evidence/1.5.1.json new file mode 100644 index 00000000..7b9ec30b --- /dev/null +++ b/docs/internal/evidence/1.5.1.json @@ -0,0 +1,38 @@ +{ + "acceptance": { + "passed": 50, + "report": "acceptance-1.5.1.json", + "total": 50 + }, + "backend": { + "passed": 2927, + "skipped": 49 + }, + "demo": { + "file": "docs/media/snapmaker-studio-demo.mp4", + "seconds": 66 + }, + "desktop": { + "passed": 852 + }, + "hardware": { + "passed": 76, + "report": "hardware-1.5.1.json", + "total": 76 + }, + "installer": { + "name": "Snapmaker.Studio_1.5.1_x64-setup.exe", + "sha256": "8955097365b12e9eb1405a098c1f6ab345d56d397681a67f0cb08257d1471be3", + "size_bytes": 21962736, + "url": "https://github.com/DVOpenLabs/snapmaker-studio/releases/tag/v1.5.1" + }, + "released": "2026-10-09", + "schema_version": "evidence-snapshot/1", + "screenshots_dir": "docs/screenshots/v1.5.1", + "selfcheck": { + "passed": 27, + "total": 27 + }, + "source": "recorded when this release was published", + "version": "1.5.1" +} diff --git a/docs/internal/hardware-1.5.1.json b/docs/internal/hardware-1.5.1.json new file mode 100644 index 00000000..f411ceed --- /dev/null +++ b/docs/internal/hardware-1.5.1.json @@ -0,0 +1,1745 @@ +{ + "schema_version": "hardware/1", + "printer": "", + "read_only_routes": [ + "/printer/status", + "/printer/capabilities", + "/printer/firmware", + "/preflight", + "/post_slice", + "/send_check", + "/material_plan", + "/nozzles/status", + "/nozzles/confirm" + ], + "checks": [ + { + "name": "Printer discovered and answering", + "ok": true, + "detail": "print state: standby" + }, + { + "name": "Firmware object list enumerated", + "ok": true, + "detail": "205 objects" + }, + { + "name": "Printer reports its own bed size", + "ok": true, + "detail": "271 × 335 × 281 mm" + }, + { + "name": "Printer reports its toolhead count", + "ok": true, + "detail": "4 toolheads" + }, + { + "name": "Preflight ran against the real machine", + "ok": true, + "detail": "" + }, + { + "name": "Loaded filament read from the real firmware", + "ok": true, + "detail": "#F8F81C PLA Matte, #6C5BB1 PLA Matte, #080A0D PLA SnapSpeed, #6F4C2F PLA Matte" + }, + { + "name": "Each loaded slot carries a material and a colour", + "ok": true, + "detail": "" + }, + { + "name": "Fitted nozzle matches the real firmware reading, never called unsupported", + "ok": true, + "detail": "ok: project expects 0.4 mm; the printer reports the same" + }, + { + "name": "A matched nozzle reading is credited to the printer, not asserted with no source", + "ok": true, + "detail": "project expects 0.4 mm; the printer reports the same" + }, + { + "name": "Nothing undetected is called unsupported", + "ok": true, + "detail": "" + }, + { + "name": "The printer's own bed size was used in the bed check", + "ok": true, + "detail": "1 object(s) fall outside this printer's 271.0 × 335.0 × 281.0 mm area" + }, + { + "name": "Project materials compared against the machine's toolheads", + "ok": true, + "detail": "project uses 6 filament slot(s); printer reports 4 toolheads" + }, + { + "name": "Project materials compared against what is actually loaded", + "ok": true, + "detail": "printer reports 4 loaded; project uses 6" + }, + { + "name": "Preflight recorded the printer as found", + "ok": true, + "detail": "" + }, + { + "name": "Sliced job joined to the real printer", + "ok": true, + "detail": "Everything Studio can check about this job against this printer looks right." + }, + { + "name": "The tool the job needs is confirmed to exist", + "ok": true, + "detail": "the job prints from slot 2; this printer reports 4 toolheads" + }, + { + "name": "The slot the job prints from is confirmed loaded", + "ok": true, + "detail": "1 slot(s) in use, all reporting a spool" + }, + { + "name": "Loaded material checked against the job's material", + "ok": true, + "detail": "1 slot(s) compared at material-family level" + }, + { + "name": "The job's bed is compared with the printer's own bed", + "ok": true, + "detail": "sliced for 270.0 × 270.0 mm; this printer reports 271.0 × 335.0 mm" + }, + { + "name": "Fitted nozzle after slicing matches the real firmware reading, never called unsupported", + "ok": true, + "detail": "the job was sliced for 0.4 mm; the printer reports the same" + }, + { + "name": "Nothing undetected is called unsupported after slicing", + "ok": true, + "detail": "" + }, + { + "name": "The send check fingerprints what it looked at", + "ok": true, + "detail": "token 813e891b…" + }, + { + "name": "The fingerprint carries the machine's real loadout", + "ok": true, + "detail": "4 slot(s) with a spool" + }, + { + "name": "Filament sufficiency stays unknown on a stock printer", + "ok": true, + "detail": "slot 2: unknown" + }, + { + "name": "Nothing on a stock printer is called short of filament", + "ok": true, + "detail": "" + }, + { + "name": "Community firmware is not claimed on a stock machine", + "ok": true, + "detail": "119 macros, many=true" + }, + { + "name": "Not finding a firmware marker is never called stock", + "ok": true, + "detail": "no community firmware answered for itself on the paths Studio knows about — which is not the same as this printer running stock firmware" + }, + { + "name": "The real machine is identified as a Snapmaker U1", + "ok": true, + "detail": "snapmaker_u1 (confirmed)" + }, + { + "name": "Identification is drawn from the printer's own vendor object", + "ok": true, + "detail": "the printer exposes the print_task_config object, which mainline Klipper does not have; it reports 4 toolheads, as this profile records" + }, + { + "name": "The U1 profile still reads as hardware verified", + "ok": true, + "detail": "Hardware verified" + }, + { + "name": "The live toolhead count is used, not the profile's", + "ok": true, + "detail": "4 from live" + }, + { + "name": "The live bed is used, not the profile's", + "ok": true, + "detail": "271 × 335 × 281 from live" + }, + { + "name": "Travel beyond the printable plate is not called a conflict", + "ok": true, + "detail": "0 conflict(s)" + }, + { + "name": "Loaded filament is recorded as the printer's own observation", + "ok": true, + "detail": "4 slot(s) from live" + }, + { + "name": "All four toolhead temperature channels still come back", + "ok": true, + "detail": "4 channel(s)" + }, + { + "name": "A U1-targeted job matches this identified U1", + "ok": true, + "detail": "the file says it was sliced for Snapmaker U1" + }, + { + "name": "The firmware summary names this machine, having identified it", + "ok": true, + "detail": "Your Snapmaker U1 reports 4 toolheads, 271.0×335.0×281.0 mm bed; 7 capabilities detected (119 custom macros on it)." + }, + { + "name": "No material provider ran, and none was contacted", + "ok": true, + "detail": "sources=undefined remaining_known=false" + }, + { + "name": "What the plan compares against came from the printer itself", + "ok": true, + "detail": "slot 1:printer, slot 2:printer, slot 3:printer, slot 4:printer" + }, + { + "name": "An address that answers nothing gets a generic hint", + "ok": true, + "detail": "Nothing answered Moonraker at that address. Check the printer is powered on and on this network, and that the address and port are the ones it shows. If it is a Snapmaker U1, its network interface only opens once Advanced Mode is turned on under Settings → Maintenance on the touchscreen." + }, + { + "name": "The machine's own reading survives a provider that agrees (spoolman)", + "ok": true, + "detail": "PLA Matte confirmed_by=printer" + }, + { + "name": "The provider supplies the weight the machine cannot know (spoolman)", + "ok": true, + "detail": "880 g tracked" + }, + { + "name": "Agreement is not reported as a disagreement (spoolman)", + "ok": true, + "detail": "0 conflict(s)" + }, + { + "name": "The printer stays authoritative when a provider disagrees (spoolman)", + "ok": true, + "detail": "PLA Matte, printer_confirmed=true" + }, + { + "name": "The disagreement is said out loud rather than resolved (spoolman)", + "ok": true, + "detail": "the printer reports PLA in this slot and your provider (Spoolman) says PETG — Studio is us" + }, + { + "name": "A disagreement does not throw the weight away (spoolman)", + "ok": true, + "detail": "920 g" + }, + { + "name": "The machine's own reading survives a provider that agrees (bambuddy)", + "ok": true, + "detail": "PLA Matte confirmed_by=printer" + }, + { + "name": "The provider supplies the weight the machine cannot know (bambuddy)", + "ok": true, + "detail": "880 g tracked" + }, + { + "name": "Agreement is not reported as a disagreement (bambuddy)", + "ok": true, + "detail": "0 conflict(s)" + }, + { + "name": "The printer stays authoritative when a provider disagrees (bambuddy)", + "ok": true, + "detail": "PLA Matte, printer_confirmed=true" + }, + { + "name": "The disagreement is said out loud rather than resolved (bambuddy)", + "ok": true, + "detail": "the printer reports PLA in this slot and your provider (Bambuddy) says PETG — Studio is us" + }, + { + "name": "A disagreement does not throw the weight away (bambuddy)", + "ok": true, + "detail": "920 g" + }, + { + "name": "Two providers agreeing with the machine decide the same", + "ok": true, + "detail": "{\"material\":\"PLA Matte\",\"state\":\"ready\",\"confirmed_by\":\"printer\",\"printer_confirmed\":true,\"remaining_g\":880,\"quality\":\"tracked\",\"conflicts\":[],\"verdict\":\"enough" + }, + { + "name": "Two providers disagreeing with the machine decide the same", + "ok": true, + "detail": "{\"material\":\"PLA Matte\",\"state\":\"ready\",\"confirmed_by\":\"printer\",\"printer_confirmed\":true,\"remaining_g\":920,\"quality\":\"tracked\",\"conflicts\":[\"the printer report" + }, + { + "name": "An unreachable provider leaves the machine's own facts intact", + "ok": true, + "detail": "PLA Matte confirmed_by=printer" + }, + { + "name": "An unreachable provider claims no weight rather than none", + "ok": true, + "detail": "remaining=null verdict=unknown" + }, + { + "name": "A real machine and a provider together reach a send decision", + "ok": true, + "detail": "unknown {\"blocker\":0,\"warning\":0,\"unknown\":1}" + }, + { + "name": "Nothing about this run claims the printer weighed anything", + "ok": true, + "detail": "no weighing claimed on the machine's behalf" + }, + { + "name": "The real printer's nozzle sizes are read live (R1)", + "ok": true, + "detail": "4 toolhead(s) reported live" + }, + { + "name": "Toolhead 1's own row: nozzle=live size, Source=Printer, Status=Reported live (R1/H7)", + "ok": true, + "detail": "Toolhead 1 0.4 mm Printer Reported live" + }, + { + "name": "Toolhead 2's own row: nozzle=live size, Source=Printer, Status=Reported live (R1/H7)", + "ok": true, + "detail": "Toolhead 2 0.4 mm Printer Reported live" + }, + { + "name": "Toolhead 3's own row: nozzle=live size, Source=Printer, Status=Reported live (R1/H7)", + "ok": true, + "detail": "Toolhead 3 0.4 mm Printer Reported live" + }, + { + "name": "Toolhead 4's own row: nozzle=live size, Source=Printer, Status=Reported live (R1/H7)", + "ok": true, + "detail": "Toolhead 4 0.4 mm Printer Reported live" + }, + { + "name": "A live-reported toolhead offers no way to type a size — the printer's evidence cannot be overridden (H6)", + "ok": true, + "detail": "0 select(s) found" + }, + { + "name": "Host text redacted before capture: v12-nozzle-live", + "ok": true, + "detail": "host_text_redacted: true" + }, + { + "name": "seed: note saved while offline (a direct, labelled write — not a UI action) is accepted", + "ok": true, + "detail": "HTTP 200" + }, + { + "name": "Toolhead 1's row shows the seeded note after the remount, before asserting the conflict (F1)", + "ok": true, + "detail": "Toolhead 1 — pick — 0.2 mm 0.25 mm 0.3 mm 0.4 mm 0.5 mm 0.6 mm 0.8 mm Not sure Printer You noted 0.6 mm · printer reports 0.4 mm — Studio uses the printer's readingUpdate my note to 0.4Remove my note" + }, + { + "name": "Toolhead 1's own row shows the conflict, naming both the printer's and the noted size (R2/H6)", + "ok": true, + "detail": "Toolhead 1 — pick — 0.2 mm 0.25 mm 0.3 mm 0.4 mm 0.5 mm 0.6 mm 0.8 mm Not sure Printer You noted 0.6 mm · printer reports 0.4 mm — Studio uses the printer's readingUpdate my note to 0.4Remove my note" + }, + { + "name": "A fresh probe:true status confirms the conflict, and that the printer still wins (R2)", + "ok": true, + "detail": "printer=0.4 noted=0.6" + }, + { + "name": "The real 'Remove my note' button is reachable on toolhead 1's conflict row", + "ok": true, + "detail": "" + }, + { + "name": "Removing the note through the real button returns toolhead 1's row to 'Reported live' (R2)", + "ok": true, + "detail": "Toolhead 1 0.4 mm Printer Reported live" + }, + { + "name": "A fresh probe:true status shows no stored note after removal (R2)", + "ok": true, + "detail": "confirmed=null conflict=false source=printer" + }, + { + "name": "A live-reported toolhead still offers no way to type a size, after removing the note (H6)", + "ok": true, + "detail": "0 select(s) found" + }, + { + "name": "The request listener actually observed allow-listed printer traffic (H5)", + "ok": true, + "detail": "4 allow-listed /printer/* POST(s) observed" + }, + { + "name": "No printer CONTROL route was ever called during this run (R2/A7-6)", + "ok": true, + "detail": "[]" + }, + { + "name": "Host text redacted before capture: hardware.png", + "ok": true, + "detail": "host_text_redacted: true" + } + ], + "passed": 76, + "total": 76, + "evidence": { + "status": { + "schema_version": "printer/1", + "host": "", + "port": 7125, + "print_state": "standby", + "filename": null, + "message": null, + "progress": 0, + "print_duration_s": 0, + "total_duration_s": 0, + "filament_used_mm": 0, + "current_layer": null, + "total_layer": null, + "speed_factor": 1, + "extrude_factor": 1, + "bed": { + "temperature": 24, + "target": 0 + }, + "toolheads": [ + { + "index": 0, + "temperature": 27, + "target": 0, + "active": false + }, + { + "index": 1, + "temperature": 27, + "target": 0, + "active": false + }, + { + "index": 2, + "temperature": 27, + "target": 0, + "active": false + }, + { + "index": 3, + "temperature": 27, + "target": 0, + "active": false + } + ] + }, + "capabilities": { + "schema_version": "printer/1", + "host": "", + "port": 7125, + "toolhead_count": 4, + "bed_mm": { + "x": 271, + "y": 335, + "z": 281 + }, + "klipper_objects": [ + "gcode", + "webhooks", + "exception_manager", + "configfile", + "mcu", + "mcu e0", + "mcu e1", + "mcu e2", + "mcu e3", + "gcode_move", + "print_stats", + "gcode_macro _PL_SAVE_VARIABLE", + "virtual_sdcard", + "pause_resume", + "display_status", + "gcode_macro M600", + "gcode_macro T4", + "gcode_macro T5", + "gcode_macro T6", + "gcode_macro T7", + "gcode_macro T8", + "gcode_macro T9", + "gcode_macro T10", + "gcode_macro T11", + "gcode_macro T12", + "gcode_macro T13", + "gcode_macro T14", + "gcode_macro T15", + "gcode_macro T16", + "gcode_macro T17", + "gcode_macro T18", + "gcode_macro T19", + "gcode_macro T20", + "gcode_macro T21", + "gcode_macro T22", + "gcode_macro T23", + "gcode_macro T24", + "gcode_macro T25", + "gcode_macro T26", + "gcode_macro T27", + "gcode_macro T28", + "gcode_macro T29", + "gcode_macro T30", + "gcode_macro T31", + "gcode_macro MOVE_TO_DISCARD_FILAMENT_POSITION", + "gcode_macro SHAPER_CALIBRATE", + "gcode_macro PRINT_START", + "gcode_macro PRINT_PRESTART_CHECK", + "gcode_macro PRINT_END", + "gcode_macro CANCEL_PRINT", + "gcode_macro INNER_PAUSE", + "gcode_macro INNER_RESUME", + "gcode_macro SET_PAUSE_NEXT_LAYER", + "gcode_macro SET_PAUSE_AT_LAYER", + "gcode_macro SET_PRINT_STATS_INFO", + "gcode_macro _CLIENT_EXTRUDE", + "gcode_macro _CLIENT_RETRACT", + "gcode_macro INNER_FILAMENT_UNLOAD", + "gcode_macro AUTO_FEEDING", + "gcode_macro AUTO_FEEDING_PREHEAT", + "gcode_macro MANUAL_FEEDING", + "gcode_macro FEEDING_RUNOUT_EVENT_HANDLE", + "gcode_macro ROUGHLY_CLEAN_NOZZLE", + "gcode_macro ROUGHLY_CLEAN_NOZZLE_WITH_DISCARD", + "gcode_macro FINELY_CLEAN_NOZZLE_STAGE_1", + "gcode_macro FINELY_CLEAN_NOZZLE_STAGE_2", + "gcode_macro SM_PRINT_CHECK_SWITCH_EXTRUDER", + "gcode_macro SM_PRINT_EXTRUDER_PREHEAT", + "gcode_macro SM_PRINT_AUTO_FEED", + "gcode_macro SM_PRINT_END_AUTO_UNLOAD_FILAMENT", + "gcode_macro SM_PRINT_START_LINE", + "gcode_macro SM_PRINT_START_LINE_EXTRUDER_0", + "gcode_macro SM_PRINT_START_LINE_EXTRUDER_1", + "gcode_macro SM_PRINT_START_LINE_EXTRUDER_2", + "gcode_macro SM_PRINT_START_LINE_EXTRUDER_3", + "gcode_macro INNER_ROUGHLY_CLEAN_NOZZLE_BASE_DISCARD", + "gcode_macro INNER_DISCARD_FILAMENT_BASE_DISCARD", + "gcode_macro INNER_CUTOFF_BASE_DISCARD", + "gcode_macro INNER_FLUSH_FILAMENT", + "gcode_macro INNER_MANUAL_FEED_STAGE_PREPARE", + "gcode_macro INNER_MANUAL_FEED_STAGE_EXTRUDE", + "gcode_macro INNER_MANUAL_FEED_STAGE_FLUSH", + "gcode_macro INNER_MANUAL_FEED_STAGE_FINISH", + "gcode_macro INNER_MANUAL_FEED_STAGE_CANCEL", + "gcode_macro INNER_FLOW_MEASURE_END_BASE_DISCARD", + "gcode_macro INNER_FLOW_CALIB_END_BASE_DISCARD", + "gcode_macro INNER_PREEXTRUDE_FILAMENT", + "gcode_macro INNER_DETECT_NOZZLE_STAGE_1", + "gcode_macro INNER_DETECT_NOZZLE_STAGE_2", + "gcode_macro CONTROL_EXTRUDE_ACTION", + "gcode_macro CONTROL_RETRACT_ACTION", + "gcode_macro FEED_HANG_NEUTRAL", + "gcode_macro AUTO_FEEDING_BATCH", + "exclude_object", + "print_task_config", + "mqtt", + "timelapse", + "filament_detect", + "resonance_tester", + "gcode_macro _EXTRUDER_OFFSET_ACTION_PRESTART", + "gcode_macro _EXTRUDER_OFFSET_ACTION_PREHOMING", + "gcode_macro _DETECT_PLATE", + "gcode_macro _EXTRUDER_OFFSET_ACTION_PREHEAT", + "gcode_macro _EXTRUDER_OFFSET_ACTION_HEAT_T0", + "gcode_macro _EXTRUDER_OFFSET_ACTION_HEAT_T1", + "gcode_macro _EXTRUDER_OFFSET_ACTION_HEAT_T2", + "gcode_macro _EXTRUDER_OFFSET_ACTION_HEAT_T3", + "gcode_macro _EXTRUDER_OFFSET_ACTION_AUTO_CLEAN_T0", + "gcode_macro _EXTRUDER_OFFSET_ACTION_AUTO_CLEAN_T1", + "gcode_macro _EXTRUDER_OFFSET_ACTION_AUTO_CLEAN_T2", + "gcode_macro _EXTRUDER_OFFSET_ACTION_AUTO_CLEAN_T3", + "gcode_macro _EXTRUDER_OFFSET_ACTION_MANUAL_CLEAN_T0", + "gcode_macro _EXTRUDER_OFFSET_ACTION_MANUAL_CLEAN_T1", + "gcode_macro _EXTRUDER_OFFSET_ACTION_MANUAL_CLEAN_T2", + "gcode_macro _EXTRUDER_OFFSET_ACTION_MANUAL_CLEAN_T3", + "gcode_macro _EXTRUDER_OFFSET_ACTION_WAIT_COOL_T0", + "gcode_macro _EXTRUDER_OFFSET_ACTION_WAIT_COOL_T1", + "gcode_macro _EXTRUDER_OFFSET_ACTION_WAIT_COOL_T2", + "gcode_macro _EXTRUDER_OFFSET_ACTION_WAIT_COOL_T3", + "gcode_macro EXTRUDER_OFFSET_ACTION_PROBE_CALIBRATE_ALL", + "gcode_macro _EXTRUDER_OFFSET_ACTION_PROBE_CALIBRATE_T0", + "gcode_macro _EXTRUDER_OFFSET_ACTION_PROBE_CALIBRATE_T1", + "gcode_macro _EXTRUDER_OFFSET_ACTION_PROBE_CALIBRATE_T2", + "gcode_macro _EXTRUDER_OFFSET_ACTION_PROBE_CALIBRATE_T3", + "gcode_macro _EXTRUDER_OFFSET_ACTION_EXIT", + "gcode_macro XYZ_OFFSET_CALIBRATE", + "gcode_macro XYZ_OFFSET_CALIBRATE_ALL", + "heaters", + "stepper_enable", + "tmc2240 stepper_x", + "tmc2240 stepper_y", + "tmc2209 stepper_z", + "heater_bed", + "temperature_sensor cavity", + "fan_generic cavity_fan", + "led cavity_led", + "fan_generic exhaust_fan", + "fan_generic circulation_fan", + "purifier", + "bed_mesh", + "homing_precise_corexy", + "heater_fan power_fan", + "adc_current_sensor I_AD", + "power_loss_check", + "auto_screws_tilt_adjust", + "gcode_macro AUTO_BED_MESH_CALIBRATE", + "gcode_macro SHAKE_Z", + "gcode_macro SENSORLESS_HOME_X", + "gcode_macro SENSORLESS_HOME_Y", + "gcode_macro SENSORLESS_HOME_Z", + "gcode_macro _HOMING_PRECISE_COREXY_ADVANCED", + "gcode_macro _CLIENT_VARIABLE", + "tmc2209 extruder", + "fan", + "heater_fan e0_nozzle_fan", + "output_pin e0_heat_sw", + "filament_motion_sensor e0_filament", + "filament_entangle_detect e0_filament", + "extruder_offset_calibration", + "probe", + "sensor_accelerometer_identify e0_accelerometer", + "power_loss_check e0", + "tmc2209 extruder1", + "fan_generic e1_fan", + "heater_fan e1_nozzle_fan", + "output_pin e1_heat_sw", + "filament_motion_sensor e1_filament", + "filament_entangle_detect e1_filament", + "power_loss_check e1", + "tmc2209 extruder2", + "fan_generic e2_fan", + "heater_fan e2_nozzle_fan", + "output_pin e2_heat_sw", + "filament_motion_sensor e2_filament", + "filament_entangle_detect e2_filament", + "power_loss_check e2", + "tmc2209 extruder3", + "fan_generic e3_fan", + "heater_fan e3_nozzle_fan", + "output_pin e3_heat_sw", + "filament_motion_sensor e3_filament", + "filament_entangle_detect e3_filament", + "power_loss_check e3", + "filament_feed left", + "filament_feed right", + "gcode_macro _FILAMENT_FEED_VARIABLE", + "idle_timeout", + "filament_parameters", + "defect_detection", + "gcode_macro PAUSE", + "gcode_macro RESUME", + "panda_breath", + "heater_generic panda_breath", + "gcode_macro M141", + "gcode_macro M191", + "motion_report", + "query_endstops", + "system_stats", + "manual_probe", + "machine_state_manager", + "toolhead", + "extruder", + "extruder1", + "extruder2", + "extruder3" + ] + }, + "preflight": { + "schema_version": "preflight/1", + "checks": [ + { + "id": "bed.fit", + "title": "Objects sit outside this printer's bed", + "result": "attention", + "evidence": "1 object(s) fall outside this printer's 271.0 × 335.0 × 281.0 mm area", + "confidence": "confirmed", + "consequence": "The slicer will refuse to slice, or the print will start off the plate.", + "action": "Use Studio's object-placement fix to move them on — it saves a copy and leaves your original alone.", + "source": "project geometry vs printer bed" + }, + { + "id": "materials.toolheads", + "title": "More materials than toolheads", + "result": "attention", + "evidence": "project uses 6 filament slot(s); printer reports 4 toolheads", + "confidence": "confirmed", + "consequence": "This project asks for 6 materials and your printer can hold 4 at once. Some will need to be combined, dropped, or swapped by hand during the print.", + "action": "Open Colours & Materials to see which colours could be handled as swaps.", + "source": "Klipper extruder objects" + }, + { + "id": "materials.loaded", + "title": "Fewer materials loaded than the project uses", + "result": "attention", + "evidence": "printer reports 4 loaded; project uses 6", + "confidence": "confirmed", + "consequence": "Some of the project's materials have nothing to print with.", + "action": "Load the missing materials before you start.", + "source": "printer filament state" + }, + { + "id": "printer.reachable", + "title": "Printer found", + "result": "ok", + "evidence": " answered on port 7125", + "confidence": "confirmed", + "consequence": "Studio can compare this project against your actual printer.", + "action": null, + "source": "Moonraker /server/info" + }, + { + "id": "nozzle.match", + "title": "Nozzle size", + "result": "ok", + "evidence": "project expects 0.4 mm; the printer reports the same", + "confidence": "confirmed", + "consequence": "The project was made for the nozzle the printer reports.", + "action": null, + "source": "printer firmware" + }, + { + "id": "printer.busy", + "title": "Printer is free", + "result": "ok", + "evidence": "the printer reports it is standby", + "confidence": "confirmed", + "consequence": "Nothing else is using the printer.", + "action": null, + "source": "Klipper print_stats" + }, + { + "id": "project.sliced", + "title": "Already sliced", + "result": "ok", + "evidence": "1 plate g-code part(s)", + "confidence": "confirmed", + "consequence": "This project already contains toolpaths from another machine. Studio removes them when it prepares a U1 copy so Snapmaker Orca slices fresh.", + "action": "Prepare a U1 copy, then slice it in Snapmaker Orca.", + "source": "project archive" + } + ], + "counts": { + "blocked": 0, + "attention": 3, + "unknown": 0, + "ok": 4 + }, + "needs_attention": [ + { + "id": "bed.fit", + "title": "Objects sit outside this printer's bed", + "result": "attention", + "evidence": "1 object(s) fall outside this printer's 271.0 × 335.0 × 281.0 mm area", + "confidence": "confirmed", + "consequence": "The slicer will refuse to slice, or the print will start off the plate.", + "action": "Use Studio's object-placement fix to move them on — it saves a copy and leaves your original alone.", + "source": "project geometry vs printer bed" + }, + { + "id": "materials.toolheads", + "title": "More materials than toolheads", + "result": "attention", + "evidence": "project uses 6 filament slot(s); printer reports 4 toolheads", + "confidence": "confirmed", + "consequence": "This project asks for 6 materials and your printer can hold 4 at once. Some will need to be combined, dropped, or swapped by hand during the print.", + "action": "Open Colours & Materials to see which colours could be handled as swaps.", + "source": "Klipper extruder objects" + }, + { + "id": "materials.loaded", + "title": "Fewer materials loaded than the project uses", + "result": "attention", + "evidence": "printer reports 4 loaded; project uses 6", + "confidence": "confirmed", + "consequence": "Some of the project's materials have nothing to print with.", + "action": "Load the missing materials before you start.", + "source": "printer filament state" + } + ], + "unknowns": [], + "printer_reachable": true, + "summary": "3 things to resolve before you slice.", + "disclaimer": "These are checks against what your printer reports right now. They are advisory — Studio cannot promise a print will succeed.", + "printer": { + "reachable": true, + "host": "", + "port": 7125, + "observed_at": 1791574602.5049605, + "toolhead_count": 4, + "bed_mm": { + "x": 271, + "y": 335, + "z": 281 + }, + "nozzle_diameters": [ + 0.4, + 0.4, + 0.4, + 0.4 + ], + "nozzle_confirmed_by": "printer", + "print_state": "standby", + "loaded_filaments": [ + { + "color": "#F8F81C", + "material": "PLA Matte", + "vendor": "Snapmaker", + "confirmed_by": "printer" + }, + { + "color": "#6C5BB1", + "material": "PLA Matte", + "vendor": "Snapmaker", + "confirmed_by": "printer" + }, + { + "color": "#080A0D", + "material": "PLA SnapSpeed", + "vendor": "Snapmaker", + "confirmed_by": "printer" + }, + { + "color": "#6F4C2F", + "material": "PLA Matte", + "vendor": "Snapmaker", + "confirmed_by": "printer" + } + ], + "nozzle_confirmed_at": null, + "nozzle_revision": 0, + "nozzle_conflicts": [], + "nozzle_storage_error": null, + "identity": { + "matched": true, + "printer_id": "snapmaker_u1", + "confidence": "confirmed", + "evidence": "the printer exposes the print_task_config object, which mainline Klipper does not have; it reports 4 toolheads, as this profile records", + "matched_on": [ + "the printer exposes the print_task_config object, which mainline Klipper does not have", + "it reports 4 toolheads, as this profile records" + ] + }, + "profile": { + "printer_id": "snapmaker_u1", + "display_name": "Snapmaker U1", + "manufacturer": "Snapmaker", + "model": "U1", + "verification_level": "hardware_verified", + "verification_label": "Hardware verified", + "verification_meaning": "A physical machine of this kind answered these questions, read-only, and the answers were recorded.", + "verification_note": "Read read-only from a physical Snapmaker U1 on a LAN during the beta.23 and v0.7.x acceptance work.", + "tool_count": 4, + "build_volume_mm": { + "x": 270, + "y": 270, + "z": 270.05 + }, + "known_unknowns": [ + "free storage on the printer — the firmware reports no sizes", + "how much filament is left on a loaded spool — the printer tracks which spool, not what remains" + ], + "not_verified": [], + "source_refs": [ + { + "kind": "hardware", + "detail": "read-only LAN session against a physical Snapmaker U1 on Moonraker port 7125", + "recorded": "docs/internal/evidence/0.7.2.json (hardware 26/26)" + }, + { + "kind": "repository", + "detail": "backend/snapstudio_core/data/profiles/snapmaker_u1.json — the known-good U1 machine preset extracted from a reference project" + } + ] + }, + "resolved": { + "schema_version": "printerprofile/1", + "printer_reachable": true, + "profile": { + "printer_id": "snapmaker_u1", + "display_name": "Snapmaker U1", + "manufacturer": "Snapmaker", + "model": "U1", + "verification_level": "hardware_verified", + "verification_label": "Hardware verified", + "verification_meaning": "A physical machine of this kind answered these questions, read-only, and the answers were recorded.", + "verification_note": "Read read-only from a physical Snapmaker U1 on a LAN during the beta.23 and v0.7.x acceptance work.", + "tool_count": 4, + "build_volume_mm": { + "x": 270, + "y": 270, + "z": 270.05 + }, + "known_unknowns": [ + "free storage on the printer — the firmware reports no sizes", + "how much filament is left on a loaded spool — the printer tracks which spool, not what remains" + ], + "not_verified": [], + "source_refs": [ + { + "kind": "hardware", + "detail": "read-only LAN session against a physical Snapmaker U1 on Moonraker port 7125", + "recorded": "docs/internal/evidence/0.7.2.json (hardware 26/26)" + }, + { + "kind": "repository", + "detail": "backend/snapstudio_core/data/profiles/snapmaker_u1.json — the known-good U1 machine preset extracted from a reference project" + } + ] + }, + "conflicts": [], + "sources": { + "tool_count": "live", + "build_volume_mm": "live" + }, + "tool_count": 4, + "build_volume_mm": { + "x": 271, + "y": 335, + "z": 281 + }, + "build_volume_note": "measured from the printer's own axis limits, which include travel beyond the printable plate", + "capabilities": { + "bed_mesh": { + "name": "bed_mesh", + "state": "present", + "source": "live", + "evidence": "the printer's firmware lists bed_mesh" + }, + "exclude_object": { + "name": "exclude_object", + "state": "present", + "source": "live", + "evidence": "the printer's firmware lists exclude_object" + }, + "input_shaper": { + "name": "input_shaper", + "state": "absent", + "source": "live", + "evidence": "the printer's firmware does not list input_shaper" + }, + "pause_resume": { + "name": "pause_resume", + "state": "present", + "source": "live", + "evidence": "the printer's firmware lists pause_resume" + }, + "eddy_probe": { + "name": "eddy_probe", + "state": "absent", + "source": "live", + "evidence": "the printer's firmware does not list probe_eddy_current" + }, + "filament_runout": { + "name": "filament_runout", + "state": "present", + "source": "live", + "evidence": "the printer's firmware lists filament_switch_sensor" + }, + "quad_gantry_level": { + "name": "quad_gantry_level", + "state": "absent", + "source": "live", + "evidence": "the printer's firmware does not list quad_gantry_level" + }, + "z_tilt": { + "name": "z_tilt", + "state": "absent", + "source": "live", + "evidence": "the printer's firmware does not list z_tilt" + }, + "virtual_sdcard": { + "name": "virtual_sdcard", + "state": "present", + "source": "live", + "evidence": "the printer's firmware lists virtual_sdcard" + } + }, + "material_state": { + "known": true, + "source": "live", + "slots": 4, + "evidence": "the printer reports which filaments are loaded" + } + } + } + }, + "post_slice": { + "schema_version": "post_slice/1", + "available": true, + "printer_reachable": true, + "job": { + "slicer": "Snapmaker Orca", + "slicer_version": "2.3.4", + "printer_model": "Snapmaker U1", + "layer_count": 12, + "layer_height_mm": 0.2, + "max_z_mm": 2.4, + "estimated_seconds": 250, + "tools_used": [ + 1 + ], + "total_g": 0.36, + "size_bytes": 726, + "purge": { + "separable": false, + "expected": false, + "detail": "single-tool job — no tool-change purge", + "confidence": "confirmed" + } + }, + "checks": [ + { + "id": "gcode.machine", + "title": "Sliced for this machine", + "result": "ok", + "evidence": "the file says it was sliced for Snapmaker U1", + "confidence": "confirmed", + "consequence": "The job's commands were generated for a Snapmaker U1.", + "action": null, + "source": "G-code configuration block" + }, + { + "id": "gcode.tools", + "title": "Every toolhead this job needs exists", + "result": "ok", + "evidence": "the job prints from slot 2; this printer reports 4 toolheads", + "confidence": "confirmed", + "consequence": "The printer can select every tool the job asks for.", + "action": null, + "source": "G-code vs Klipper extruder objects" + }, + { + "id": "gcode.loaded", + "title": "Every slot this job uses is loaded", + "result": "ok", + "evidence": "1 slot(s) in use, all reporting a spool", + "confidence": "confirmed", + "consequence": "Nothing will stop for a missing spool.", + "action": null, + "source": "G-code tool use vs printer filament state" + }, + { + "id": "gcode.material", + "title": "Loaded material matches the job", + "result": "ok", + "evidence": "1 slot(s) compared at material-family level", + "confidence": "likely", + "consequence": "The job's temperatures and speeds suit what is loaded.", + "action": null, + "source": "G-code filament types vs printer filament state — compared by family, so PLA Matte counts as PLA" + }, + { + "id": "gcode.bed", + "title": "Bed size matches", + "result": "ok", + "evidence": "sliced for 270.0 × 270.0 mm; this printer reports 271.0 × 335.0 mm", + "confidence": "confirmed", + "consequence": "The job was sliced for this printer's bed.", + "action": null, + "source": "G-code vs the printer's own reported bed" + }, + { + "id": "gcode.nozzle", + "title": "Nozzle size matches", + "result": "ok", + "evidence": "the job was sliced for 0.4 mm; the printer reports the same", + "confidence": "confirmed", + "consequence": "The job was sliced for the nozzle the printer reports.", + "action": null, + "source": "G-code configuration block; this printer's firmware" + }, + { + "id": "printer.busy", + "title": "Printer is free", + "result": "ok", + "evidence": "the printer reports it is standby", + "confidence": "confirmed", + "consequence": "Nothing else is using the printer.", + "action": null, + "source": "Klipper print_stats" + } + ], + "counts": { + "ok": 7 + }, + "needs_attention": [], + "unknowns": [], + "summary": "Everything Studio can check about this job against this printer looks right.", + "disclaimer": "This reads what the sliced file says it will do. It is not a simulation of the print, and Studio does not slice — Snapmaker Orca does.", + "printer": { + "reachable": true, + "host": "", + "port": 7125, + "observed_at": 1791574603.2581892, + "toolhead_count": 4, + "bed_mm": { + "x": 271, + "y": 335, + "z": 281 + }, + "nozzle_diameters": [ + 0.4, + 0.4, + 0.4, + 0.4 + ], + "nozzle_confirmed_by": "printer", + "print_state": "standby", + "loaded_filaments": [ + { + "color": "#F8F81C", + "material": "PLA Matte", + "vendor": "Snapmaker", + "confirmed_by": "printer" + }, + { + "color": "#6C5BB1", + "material": "PLA Matte", + "vendor": "Snapmaker", + "confirmed_by": "printer" + }, + { + "color": "#080A0D", + "material": "PLA SnapSpeed", + "vendor": "Snapmaker", + "confirmed_by": "printer" + }, + { + "color": "#6F4C2F", + "material": "PLA Matte", + "vendor": "Snapmaker", + "confirmed_by": "printer" + } + ], + "nozzle_confirmed_at": null, + "nozzle_revision": 0, + "nozzle_conflicts": [], + "nozzle_storage_error": null, + "identity": { + "matched": true, + "printer_id": "snapmaker_u1", + "confidence": "confirmed", + "evidence": "the printer exposes the print_task_config object, which mainline Klipper does not have; it reports 4 toolheads, as this profile records", + "matched_on": [ + "the printer exposes the print_task_config object, which mainline Klipper does not have", + "it reports 4 toolheads, as this profile records" + ] + }, + "profile": { + "printer_id": "snapmaker_u1", + "display_name": "Snapmaker U1", + "manufacturer": "Snapmaker", + "model": "U1", + "verification_level": "hardware_verified", + "verification_label": "Hardware verified", + "verification_meaning": "A physical machine of this kind answered these questions, read-only, and the answers were recorded.", + "verification_note": "Read read-only from a physical Snapmaker U1 on a LAN during the beta.23 and v0.7.x acceptance work.", + "tool_count": 4, + "build_volume_mm": { + "x": 270, + "y": 270, + "z": 270.05 + }, + "known_unknowns": [ + "free storage on the printer — the firmware reports no sizes", + "how much filament is left on a loaded spool — the printer tracks which spool, not what remains" + ], + "not_verified": [], + "source_refs": [ + { + "kind": "hardware", + "detail": "read-only LAN session against a physical Snapmaker U1 on Moonraker port 7125", + "recorded": "docs/internal/evidence/0.7.2.json (hardware 26/26)" + }, + { + "kind": "repository", + "detail": "backend/snapstudio_core/data/profiles/snapmaker_u1.json — the known-good U1 machine preset extracted from a reference project" + } + ] + }, + "resolved": { + "schema_version": "printerprofile/1", + "printer_reachable": true, + "profile": { + "printer_id": "snapmaker_u1", + "display_name": "Snapmaker U1", + "manufacturer": "Snapmaker", + "model": "U1", + "verification_level": "hardware_verified", + "verification_label": "Hardware verified", + "verification_meaning": "A physical machine of this kind answered these questions, read-only, and the answers were recorded.", + "verification_note": "Read read-only from a physical Snapmaker U1 on a LAN during the beta.23 and v0.7.x acceptance work.", + "tool_count": 4, + "build_volume_mm": { + "x": 270, + "y": 270, + "z": 270.05 + }, + "known_unknowns": [ + "free storage on the printer — the firmware reports no sizes", + "how much filament is left on a loaded spool — the printer tracks which spool, not what remains" + ], + "not_verified": [], + "source_refs": [ + { + "kind": "hardware", + "detail": "read-only LAN session against a physical Snapmaker U1 on Moonraker port 7125", + "recorded": "docs/internal/evidence/0.7.2.json (hardware 26/26)" + }, + { + "kind": "repository", + "detail": "backend/snapstudio_core/data/profiles/snapmaker_u1.json — the known-good U1 machine preset extracted from a reference project" + } + ] + }, + "conflicts": [], + "sources": { + "tool_count": "live", + "build_volume_mm": "live" + }, + "tool_count": 4, + "build_volume_mm": { + "x": 271, + "y": 335, + "z": 281 + }, + "build_volume_note": "measured from the printer's own axis limits, which include travel beyond the printable plate", + "capabilities": { + "bed_mesh": { + "name": "bed_mesh", + "state": "present", + "source": "live", + "evidence": "the printer's firmware lists bed_mesh" + }, + "exclude_object": { + "name": "exclude_object", + "state": "present", + "source": "live", + "evidence": "the printer's firmware lists exclude_object" + }, + "input_shaper": { + "name": "input_shaper", + "state": "absent", + "source": "live", + "evidence": "the printer's firmware does not list input_shaper" + }, + "pause_resume": { + "name": "pause_resume", + "state": "present", + "source": "live", + "evidence": "the printer's firmware lists pause_resume" + }, + "eddy_probe": { + "name": "eddy_probe", + "state": "absent", + "source": "live", + "evidence": "the printer's firmware does not list probe_eddy_current" + }, + "filament_runout": { + "name": "filament_runout", + "state": "present", + "source": "live", + "evidence": "the printer's firmware lists filament_switch_sensor" + }, + "quad_gantry_level": { + "name": "quad_gantry_level", + "state": "absent", + "source": "live", + "evidence": "the printer's firmware does not list quad_gantry_level" + }, + "z_tilt": { + "name": "z_tilt", + "state": "absent", + "source": "live", + "evidence": "the printer's firmware does not list z_tilt" + }, + "virtual_sdcard": { + "name": "virtual_sdcard", + "state": "present", + "source": "live", + "evidence": "the printer's firmware lists virtual_sdcard" + } + }, + "material_state": { + "known": true, + "source": "live", + "slots": 4, + "evidence": "the printer reports which filaments are loaded" + } + } + } + }, + "firmware": { + "schema_version": "firmwarecaps/1", + "available": true, + "toolhead_count": 4, + "bed_mm": { + "x": 271, + "y": 335, + "z": 281 + }, + "macro_count": 119, + "many_custom_macros": true, + "extended_firmware": false, + "extended_firmware_evidence": "no community firmware answered for itself on the paths Studio knows about — which is not the same as this printer running stock firmware", + "features": [ + { + "name": "Automatic bed mesh levelling", + "detail": "compensates for an uneven bed across the whole plate" + }, + { + "name": "Auto bed probing", + "detail": "automatic Z/level probing" + }, + { + "name": "Object exclusion", + "detail": "cancel one failed object mid-print without losing the rest" + }, + { + "name": "Pause / resume", + "detail": "safely pause and continue a print" + }, + { + "name": "Filament runout detection", + "detail": "stops the print if filament runs out or jams" + }, + { + "name": "Custom macros", + "detail": "119 gcode macros on this printer" + }, + { + "name": "4-toolhead multimaterial", + "detail": "prints up to 4 colours/materials in one job" + } + ], + "summary": "Your Snapmaker U1 reports 4 toolheads, 271.0×335.0×281.0 mm bed; 7 capabilities detected (119 custom macros on it).", + "identity": { + "matched": true, + "printer_id": "snapmaker_u1", + "confidence": "confirmed", + "evidence": "the printer exposes the print_task_config object, which mainline Klipper does not have; it reports 4 toolheads, as this profile records", + "matched_on": [ + "the printer exposes the print_task_config object, which mainline Klipper does not have", + "it reports 4 toolheads, as this profile records" + ] + } + }, + "identity": { + "matched": true, + "printer_id": "snapmaker_u1", + "confidence": "confirmed", + "evidence": "the printer exposes the print_task_config object, which mainline Klipper does not have; it reports 4 toolheads, as this profile records", + "matched_on": [ + "the printer exposes the print_task_config object, which mainline Klipper does not have", + "it reports 4 toolheads, as this profile records" + ] + }, + "resolved": { + "schema_version": "printerprofile/1", + "printer_reachable": true, + "profile": { + "printer_id": "snapmaker_u1", + "display_name": "Snapmaker U1", + "manufacturer": "Snapmaker", + "model": "U1", + "verification_level": "hardware_verified", + "verification_label": "Hardware verified", + "verification_meaning": "A physical machine of this kind answered these questions, read-only, and the answers were recorded.", + "verification_note": "Read read-only from a physical Snapmaker U1 on a LAN during the beta.23 and v0.7.x acceptance work.", + "tool_count": 4, + "build_volume_mm": { + "x": 270, + "y": 270, + "z": 270.05 + }, + "known_unknowns": [ + "free storage on the printer — the firmware reports no sizes", + "how much filament is left on a loaded spool — the printer tracks which spool, not what remains" + ], + "not_verified": [], + "source_refs": [ + { + "kind": "hardware", + "detail": "read-only LAN session against a physical Snapmaker U1 on Moonraker port 7125", + "recorded": "docs/internal/evidence/0.7.2.json (hardware 26/26)" + }, + { + "kind": "repository", + "detail": "backend/snapstudio_core/data/profiles/snapmaker_u1.json — the known-good U1 machine preset extracted from a reference project" + } + ] + }, + "conflicts": [], + "sources": { + "tool_count": "live", + "build_volume_mm": "live" + }, + "tool_count": 4, + "build_volume_mm": { + "x": 271, + "y": 335, + "z": 281 + }, + "build_volume_note": "measured from the printer's own axis limits, which include travel beyond the printable plate", + "capabilities": { + "bed_mesh": { + "name": "bed_mesh", + "state": "present", + "source": "live", + "evidence": "the printer's firmware lists bed_mesh" + }, + "exclude_object": { + "name": "exclude_object", + "state": "present", + "source": "live", + "evidence": "the printer's firmware lists exclude_object" + }, + "input_shaper": { + "name": "input_shaper", + "state": "absent", + "source": "live", + "evidence": "the printer's firmware does not list input_shaper" + }, + "pause_resume": { + "name": "pause_resume", + "state": "present", + "source": "live", + "evidence": "the printer's firmware lists pause_resume" + }, + "eddy_probe": { + "name": "eddy_probe", + "state": "absent", + "source": "live", + "evidence": "the printer's firmware does not list probe_eddy_current" + }, + "filament_runout": { + "name": "filament_runout", + "state": "present", + "source": "live", + "evidence": "the printer's firmware lists filament_switch_sensor" + }, + "quad_gantry_level": { + "name": "quad_gantry_level", + "state": "absent", + "source": "live", + "evidence": "the printer's firmware does not list quad_gantry_level" + }, + "z_tilt": { + "name": "z_tilt", + "state": "absent", + "source": "live", + "evidence": "the printer's firmware does not list z_tilt" + }, + "virtual_sdcard": { + "name": "virtual_sdcard", + "state": "present", + "source": "live", + "evidence": "the printer's firmware lists virtual_sdcard" + } + }, + "material_state": { + "known": true, + "source": "live", + "slots": 4, + "evidence": "the printer reports which filaments are loaded" + } + }, + "profile": { + "printer_id": "snapmaker_u1", + "display_name": "Snapmaker U1", + "manufacturer": "Snapmaker", + "model": "U1", + "verification_level": "hardware_verified", + "verification_label": "Hardware verified", + "verification_meaning": "A physical machine of this kind answered these questions, read-only, and the answers were recorded.", + "verification_note": "Read read-only from a physical Snapmaker U1 on a LAN during the beta.23 and v0.7.x acceptance work.", + "tool_count": 4, + "build_volume_mm": { + "x": 270, + "y": 270, + "z": 270.05 + }, + "known_unknowns": [ + "free storage on the printer — the firmware reports no sizes", + "how much filament is left on a loaded spool — the printer tracks which spool, not what remains" + ], + "not_verified": [], + "source_refs": [ + { + "kind": "hardware", + "detail": "read-only LAN session against a physical Snapmaker U1 on Moonraker port 7125", + "recorded": "docs/internal/evidence/0.7.2.json (hardware 26/26)" + }, + { + "kind": "repository", + "detail": "backend/snapstudio_core/data/profiles/snapmaker_u1.json — the known-good U1 machine preset extracted from a reference project" + } + ] + }, + "provider_on_hardware": { + "agreed": { + "spoolman": { + "tool": 1, + "label": "slot 2", + "needed": true, + "wants_material": "PLA", + "wants_colour": null, + "wants_name": null, + "grams": 0.36, + "has_material": "PLA Matte", + "has_colour": "#6C5BB1", + "action": null, + "state": "ready", + "detail": "PLA Matte is loaded and matches what the job expects. 880 g recorded, 0.36 g needed. Last updated just now.", + "colour_distance": null, + "confirmed_by": "printer", + "printer_confirmed": true, + "needs_grams": 0.36, + "remaining_g": 880, + "remaining_quality": "tracked", + "sufficiency": { + "verdict": "enough", + "detail": "880 g recorded, 0.36 g needed. Last updated just now.", + "source": "tracked spool weight", + "quality": "tracked", + "trusted": true, + "freshness": "fresh", + "age_s": 68 + }, + "conflicts": [], + "notes": [] + }, + "bambuddy": { + "tool": 1, + "label": "slot 2", + "needed": true, + "wants_material": "PLA", + "wants_colour": null, + "wants_name": null, + "grams": 0.36, + "has_material": "PLA Matte", + "has_colour": "#6C5BB1", + "action": null, + "state": "ready", + "detail": "PLA Matte is loaded and matches what the job expects. 880 g recorded, 0.36 g needed. Last updated just now.", + "colour_distance": null, + "confirmed_by": "printer", + "printer_confirmed": true, + "needs_grams": 0.36, + "remaining_g": 880, + "remaining_quality": "tracked", + "sufficiency": { + "verdict": "enough", + "detail": "880 g recorded, 0.36 g needed. Last updated just now.", + "source": "tracked spool weight", + "quality": "tracked", + "trusted": true, + "freshness": "fresh", + "age_s": 70 + }, + "conflicts": [], + "notes": [] + } + }, + "conflicted": { + "spoolman": { + "tool": 1, + "label": "slot 2", + "needed": true, + "wants_material": "PLA", + "wants_colour": null, + "wants_name": null, + "grams": 0.36, + "has_material": "PLA Matte", + "has_colour": "#6C5BB1", + "action": null, + "state": "ready", + "detail": "PLA Matte is loaded and matches what the job expects. 920 g recorded, 0.36 g needed. Last updated just now.", + "colour_distance": null, + "confirmed_by": "printer", + "printer_confirmed": true, + "needs_grams": 0.36, + "remaining_g": 920, + "remaining_quality": "tracked", + "sufficiency": { + "verdict": "enough", + "detail": "920 g recorded, 0.36 g needed. Last updated just now.", + "source": "tracked spool weight", + "quality": "tracked", + "trusted": true, + "freshness": "fresh", + "age_s": 69 + }, + "conflicts": [ + "the printer reports PLA in this slot and your provider (Spoolman) says PETG — Studio is using what the printer can see", + "the printer reports #6C5BB1 in this slot and your provider (Spoolman) says #1AA39B — Studio is using what the printer can see" + ], + "notes": [] + }, + "bambuddy": { + "tool": 1, + "label": "slot 2", + "needed": true, + "wants_material": "PLA", + "wants_colour": null, + "wants_name": null, + "grams": 0.36, + "has_material": "PLA Matte", + "has_colour": "#6C5BB1", + "action": null, + "state": "ready", + "detail": "PLA Matte is loaded and matches what the job expects. 920 g recorded, 0.36 g needed. Last updated just now.", + "colour_distance": null, + "confirmed_by": "printer", + "printer_confirmed": true, + "needs_grams": 0.36, + "remaining_g": 920, + "remaining_quality": "tracked", + "sufficiency": { + "verdict": "enough", + "detail": "920 g recorded, 0.36 g needed. Last updated just now.", + "source": "tracked spool weight", + "quality": "tracked", + "trusted": true, + "freshness": "fresh", + "age_s": 71 + }, + "conflicts": [ + "the printer reports PLA in this slot and your provider (Bambuddy) says PETG — Studio is using what the printer can see", + "the printer reports #6C5BB1 in this slot and your provider (Bambuddy) says #1AA39B — Studio is using what the printer can see" + ], + "notes": [] + } + } + }, + "nozzle_before": { + "host": "", + "port": 7125, + "reachable": true, + "live": [ + 0.4, + 0.4, + 0.4, + 0.4 + ], + "live_error": null, + "toolhead_count": 4, + "toolhead_count_source": "printer", + "revision": 0, + "observed_at": "2026-10-09T19:36:54Z", + "count_mismatch": false, + "storage_error": null, + "toolheads": [ + { + "toolhead": 0, + "diameter": 0.4, + "source": "printer", + "confirmed_at": null, + "confirmed": null, + "conflict": false, + "out_of_range": false + }, + { + "toolhead": 1, + "diameter": 0.4, + "source": "printer", + "confirmed_at": null, + "confirmed": null, + "conflict": false, + "out_of_range": false + }, + { + "toolhead": 2, + "diameter": 0.4, + "source": "printer", + "confirmed_at": null, + "confirmed": null, + "conflict": false, + "out_of_range": false + }, + { + "toolhead": 3, + "diameter": 0.4, + "source": "printer", + "confirmed_at": null, + "confirmed": null, + "conflict": false, + "out_of_range": false + } + ] + }, + "nozzle_conflict": { + "host": "", + "port": 7125, + "reachable": true, + "live": [ + 0.4, + 0.4, + 0.4, + 0.4 + ], + "live_error": null, + "toolhead_count": 4, + "toolhead_count_source": "printer", + "revision": 1, + "observed_at": "2026-10-09T19:36:57Z", + "count_mismatch": false, + "storage_error": null, + "toolheads": [ + { + "toolhead": 0, + "diameter": 0.4, + "source": "printer", + "confirmed_at": "2026-10-09T19:36:55Z", + "confirmed": 0.6, + "conflict": true, + "out_of_range": false + }, + { + "toolhead": 1, + "diameter": 0.4, + "source": "printer", + "confirmed_at": null, + "confirmed": null, + "conflict": false, + "out_of_range": false + }, + { + "toolhead": 2, + "diameter": 0.4, + "source": "printer", + "confirmed_at": null, + "confirmed": null, + "conflict": false, + "out_of_range": false + }, + { + "toolhead": 3, + "diameter": 0.4, + "source": "printer", + "confirmed_at": null, + "confirmed": null, + "conflict": false, + "out_of_range": false + } + ] + } + } +} \ No newline at end of file diff --git a/docs/screenshots/v1.5.1/painted.png b/docs/screenshots/v1.5.1/painted.png new file mode 100644 index 00000000..aa184b8d Binary files /dev/null and b/docs/screenshots/v1.5.1/painted.png differ diff --git a/docs/screenshots/v1.5.1/prepared.png b/docs/screenshots/v1.5.1/prepared.png new file mode 100644 index 00000000..9b37086d Binary files /dev/null and b/docs/screenshots/v1.5.1/prepared.png differ diff --git a/docs/screenshots/v1.5.1/problem.png b/docs/screenshots/v1.5.1/problem.png new file mode 100644 index 00000000..e207ed05 Binary files /dev/null and b/docs/screenshots/v1.5.1/problem.png differ diff --git a/docs/screenshots/v1.5.1/what-to-load.png b/docs/screenshots/v1.5.1/what-to-load.png new file mode 100644 index 00000000..6a5f90d1 Binary files /dev/null and b/docs/screenshots/v1.5.1/what-to-load.png differ diff --git a/docs/testing/source-backed-guidance/README.md b/docs/testing/source-backed-guidance/README.md new file mode 100644 index 00000000..225a0155 --- /dev/null +++ b/docs/testing/source-backed-guidance/README.md @@ -0,0 +1,28 @@ +# Source-backed guidance: screenshots + +These screenshots show the "Adjusted for U1 project compatibility" notes in the Prepare summary after +this change. Each changed setting now carries a short plain-language reason and a label for where the +statement comes from: + +- **Studio's check** - Studio did or checked this itself (for example a value outside its valid range was + replaced with the U1 default). +- **Verify in Snapmaker Orca** - advice to check the setting in Snapmaker Orca. It makes no claim about how + Snapmaker Orca behaves. + +Files: `prepare-notes-top-*`, `prepare-notes-bottom-*` and `prepare-compat-section-full-*`, each in light and +dark themes. The project and settings are a synthetic local fixture; no real printer, address or model name +appears. + +## How they were captured + +Edge via Playwright against the local Vite dev server, with web fonts and off-machine hosts blocked. +The capture script reported no violations and no console errors (React SVG attribute warnings from the +sidebar are unrelated and ignored). + +## Not verified + +- The packaged Tauri window on Windows and Linux WebKitGTK; only Edge was used. +- Screen-reader output. +- Snapmaker Orca behavior. The labels never assert it. +- One older sentence outside this change (`preset_deviation.py`: "declared to Snapmaker Orca, which resets an + undeclared value...") still describes Orca behavior. It is unchanged here and left for a separate review. diff --git a/docs/testing/source-backed-guidance/prepare-compat-section-full-dark.png b/docs/testing/source-backed-guidance/prepare-compat-section-full-dark.png new file mode 100644 index 00000000..3cf629f5 Binary files /dev/null and b/docs/testing/source-backed-guidance/prepare-compat-section-full-dark.png differ diff --git a/docs/testing/source-backed-guidance/prepare-compat-section-full-light.png b/docs/testing/source-backed-guidance/prepare-compat-section-full-light.png new file mode 100644 index 00000000..bbdc9305 Binary files /dev/null and b/docs/testing/source-backed-guidance/prepare-compat-section-full-light.png differ diff --git a/docs/testing/source-backed-guidance/prepare-notes-bottom-dark.png b/docs/testing/source-backed-guidance/prepare-notes-bottom-dark.png new file mode 100644 index 00000000..5bbf613a Binary files /dev/null and b/docs/testing/source-backed-guidance/prepare-notes-bottom-dark.png differ diff --git a/docs/testing/source-backed-guidance/prepare-notes-bottom-light.png b/docs/testing/source-backed-guidance/prepare-notes-bottom-light.png new file mode 100644 index 00000000..1a0e29ea Binary files /dev/null and b/docs/testing/source-backed-guidance/prepare-notes-bottom-light.png differ diff --git a/docs/testing/source-backed-guidance/prepare-notes-top-dark.png b/docs/testing/source-backed-guidance/prepare-notes-top-dark.png new file mode 100644 index 00000000..fd06801f Binary files /dev/null and b/docs/testing/source-backed-guidance/prepare-notes-top-dark.png differ diff --git a/docs/testing/source-backed-guidance/prepare-notes-top-light.png b/docs/testing/source-backed-guidance/prepare-notes-top-light.png new file mode 100644 index 00000000..4656348c Binary files /dev/null and b/docs/testing/source-backed-guidance/prepare-notes-top-light.png differ diff --git a/docs/testing/tool-tabs/01-focus-ring-dark.png b/docs/testing/tool-tabs/01-focus-ring-dark.png new file mode 100644 index 00000000..46cf085b Binary files /dev/null and b/docs/testing/tool-tabs/01-focus-ring-dark.png differ diff --git a/docs/testing/tool-tabs/01-focus-ring-light.png b/docs/testing/tool-tabs/01-focus-ring-light.png new file mode 100644 index 00000000..328b5ed8 Binary files /dev/null and b/docs/testing/tool-tabs/01-focus-ring-light.png differ diff --git a/docs/testing/tool-tabs/02-compatibility-dark.png b/docs/testing/tool-tabs/02-compatibility-dark.png new file mode 100644 index 00000000..2b47418c Binary files /dev/null and b/docs/testing/tool-tabs/02-compatibility-dark.png differ diff --git a/docs/testing/tool-tabs/02-compatibility-light.png b/docs/testing/tool-tabs/02-compatibility-light.png new file mode 100644 index 00000000..a45fb87d Binary files /dev/null and b/docs/testing/tool-tabs/02-compatibility-light.png differ diff --git a/docs/testing/tool-tabs/03-compatibility-600px.png b/docs/testing/tool-tabs/03-compatibility-600px.png new file mode 100644 index 00000000..f384c291 Binary files /dev/null and b/docs/testing/tool-tabs/03-compatibility-600px.png differ diff --git a/docs/testing/tool-tabs/03-print-quality-600px.png b/docs/testing/tool-tabs/03-print-quality-600px.png new file mode 100644 index 00000000..b8b42a21 Binary files /dev/null and b/docs/testing/tool-tabs/03-print-quality-600px.png differ diff --git a/docs/testing/tool-tabs/README.md b/docs/testing/tool-tabs/README.md new file mode 100644 index 00000000..54b8ee3e --- /dev/null +++ b/docs/testing/tool-tabs/README.md @@ -0,0 +1,78 @@ +# Tool tabs: keyboard and focus verification + +Real-browser check of the two tab rows, **Compatibility / Source Check** and **Print Quality / First Layer**, operated +**only from the keyboard**, plus focus-ring, 600 px layout and network-isolation checks. Script: +`tools/acceptance/tool-tabs-keyboard.mjs` (Windows; Edge/Chromium; run with `--out `). + +**46/46 checks passed.** + +The run used the uncommitted change on top of the base commit. `results.json` records `baseCommit`, `worktreeDirty`, and a +`diffHash` (SHA-256 of `git diff HEAD` plus the untracked files, excluding this folder). + +## What is real and what is not + +- **Real:** the Studio engine and the web UI from this branch (served by the Vite dev server, not a production build), + running locally, in Microsoft Edge (Chromium, headless). +- **This is Edge.** It is not the Tauri window, not WebKitGTK (the Linux window), and not a screen reader. Focus order + and ring drawing can differ in those; how a screen reader announces the tab row was not tested. +- **No data:** no project is opened and no printer, provider or spool service is involved. The run uses the pages as + they first appear. +- **Browser network guard:** requests to Google Fonts are aborted and recorded but do not fail the run (see the next + item). Every other browser request or WebSocket to a host other than this machine is aborted and fails the run, as does + any engine request that names a printer or network discovery. Service workers are blocked. WebRTC and browser-internal + traffic cannot be intercepted from the script. +- **Not covered:** the spawned engine process makes its own network calls. This run neither constrains nor observes them, + so it does not show that the engine stays on this machine. +- **One known, blocked request:** the app's stylesheet asks Google Fonts for its Inter typeface (`desktop/src/index.css`, + line 1). That behavior is older than this change. The run blocks it, so the screenshots use the fallback typeface, and + `results.json` lists the hosts in `knownBlockedFontHosts`. It is not fixed here. +- **Ignored console messages:** `Failed to load resource` and `net::ERR` come from the blocked font request. React + `Invalid DOM property` warnings (`stroke-width`, `stroke-linecap`) come from the existing sidebar icons, not from the tab + row. `results.json` lists them in `ignoredConsoleMessages`. +- **Not run:** WebKitGTK (`tools/acceptance/linux`) and the packaged Windows window. + +## How the tabs behave + +- Only one tab is in the Tab order. Focus entering the row always lands on the selected tab: when focus leaves the row, + the tab stop resets to the selected tab, so a tab you only arrowed to is not remembered. +- Left and Right Arrow move focus, wrapping at the ends. Home and End jump to the first and last tab. Up and Down Arrow + are not handled by the tab row (the page scrolls as usual); covered by the unit tests, not by this run. +- Arrow keys, Home and End **only move focus**. Enter, Space or a click selects the focused tab and shows its panel. + Showing a panel reloads that tool, so moving focus along the row deliberately does not switch panels. +- Alt, Ctrl and Meta combinations (for example Alt+Left, Ctrl+Home) are left to the browser. Unit tests cover this. +- The tab row has an accessible name ("Compatibility tools", "Print quality tools"). The panel is labeled by its tab. + +## Per case (both pages unless noted) + +The table groups the 46 checks by behavior; `results.json` lists each one. + +| Result | Case | +|---|---| +| PASS | The tab row has its name | +| PASS | Exactly one tab is in the Tab order, and it is the selected one | +| PASS | Tab, pressed 120 times through the page, lands on the selected tab and never on the other | +| PASS | ArrowRight moves focus to the second tab without switching the panel | +| PASS | The tab stop moves with focus | +| PASS | After arrowing to the other tab and leaving the row, Shift+Tab from the first focusable control in the panel lands on the selected tab | +| PASS | ArrowRight and ArrowLeft wrap; Home and End jump to the ends | +| PASS | Home, End and the arrows never switched the panel | +| PASS | Enter switches the panel and its heading appears; focus stays on the tab | +| PASS | The panel is labeled by the selected tab | +| PASS | Space switches back and the first heading appears | +| PASS | Focus ring visible on the keyboard-focused tab, dark and light (Compatibility page only) | +| PASS | At 600 px wide: no horizontal page scroll, labels not truncated and inside the viewport (both pages) | +| PASS | No request reached another host (the Google Fonts request was blocked, see above), a printer, or discovery | +| PASS | No console errors other than the blocked-request failures (`Failed to load resource`, `net::ERR`) and React `Invalid DOM property` warnings, which the run ignores | + +The first focusable control inside each panel is named in `results.json`: "Open a 3MF project" (Compatibility) and +"Stringing / wisps" (Print Quality). + +Evidence: [results.json](results.json), [focus ring, dark](01-focus-ring-dark.png), +[focus ring, light](01-focus-ring-light.png), [Compatibility, dark](02-compatibility-dark.png), +[Compatibility, light](02-compatibility-light.png), [Compatibility at 600 px](03-compatibility-600px.png), +[Print Quality at 600 px](03-print-quality-600px.png). + +## Unit tests + +`desktop/src/components/ui/ToolTabs.test.tsx` and `desktop/src/routes/ToolTabsHubs.test.tsx` cover the same behavior in +jsdom, plus a tab that disappears while selected or focused, modifier keys, and an empty tab list. diff --git a/docs/testing/tool-tabs/results.json b/docs/testing/tool-tabs/results.json new file mode 100644 index 00000000..33617fc4 --- /dev/null +++ b/docs/testing/tool-tabs/results.json @@ -0,0 +1,250 @@ +{ + "browser": "Microsoft Edge (Chromium), headless", + "uiStartedByThisRun": true, + "uiUrl": "http://localhost:55063", + "baseCommit": "b01f7d049dc04c32df36489cf6ad5bd27d5c6b7e", + "worktreeDirty": true, + "diffHash": "7c46b2f8900f549c76b1b79eb04e2671c85cff9ddb7a94f6c63cff86164ef9ab", + "note": "Run on the uncommitted change on top of baseCommit; diffHash covers git diff HEAD plus untracked files (excluding this folder).", + "backendNetworkNotObserved": true, + "knownBlockedFontHosts": [ + "fonts.googleapis.com" + ], + "ignoredConsoleMessages": [ + "Failed to load resource: net::ERR_FAILED", + "Warning: Invalid DOM property `%s`. Did you mean `%s`?%s stroke-width strokeWidth \n at g\n at svg\n at div\n at div\n at aside\n at Sidebar (http://localhost:55063/src/components/shell/Si", + "Warning: Invalid DOM property `%s`. Did you mean `%s`?%s stroke-linecap strokeLinecap \n at g\n at svg\n at div\n at div\n at aside\n at Sidebar (http://localhost:55063/src/components/shel" + ], + "results": [ + { + "name": "compatibility: the tab row is named \"Compatibility tools\"", + "ok": true, + "detail": "" + }, + { + "name": "compatibility: exactly one tab is in the Tab order and it is the selected one", + "ok": true, + "detail": "[\"Compatibility\"]" + }, + { + "name": "compatibility: Tab, pressed 120 times through the page, lands on the selected tab and never on the other", + "ok": true, + "detail": "tabs reached: Compatibility" + }, + { + "name": "compatibility: ArrowRight moves focus to \"Source Check\"", + "ok": true, + "detail": "Source Check" + }, + { + "name": "compatibility: ArrowRight did not switch the panel", + "ok": true, + "detail": "" + }, + { + "name": "compatibility: the tab stop moved with focus", + "ok": true, + "detail": "[\"Source Check\"]" + }, + { + "name": "compatibility: the panel has a first focusable control", + "ok": true, + "detail": "Open a 3MF project" + }, + { + "name": "compatibility: after arrowing to \"Source Check\" and leaving the row, the tab stop is back on the selected tab \"Compatibility\"", + "ok": true, + "detail": "[\"Compatibility\"]" + }, + { + "name": "compatibility: Shift+Tab from the first focusable control in the panel (\"Open a 3MF project\") lands on the selected tab (\"Compatibility\"), not the one that was arrowed to", + "ok": true, + "detail": "Compatibility" + }, + { + "name": "compatibility: ArrowLeft wraps from the first tab to the last", + "ok": true, + "detail": "Source Check" + }, + { + "name": "compatibility: ArrowRight wraps from the last tab to the first", + "ok": true, + "detail": "Compatibility" + }, + { + "name": "compatibility: Home moves focus to the first tab", + "ok": true, + "detail": "Compatibility" + }, + { + "name": "compatibility: End moves focus to the last tab", + "ok": true, + "detail": "Source Check" + }, + { + "name": "compatibility: Home, End and the arrow keys never switched the panel", + "ok": true, + "detail": "" + }, + { + "name": "compatibility: Enter on \"Source Check\" switches the panel and its heading \"Source Check\" appears", + "ok": true, + "detail": "" + }, + { + "name": "compatibility: focus stays on the tab after Enter", + "ok": true, + "detail": "Source Check" + }, + { + "name": "compatibility: the panel is labeled by the selected tab", + "ok": true, + "detail": "" + }, + { + "name": "compatibility: Space on \"Compatibility\" switches back and its heading \"Compatibility Doctor\" appears", + "ok": true, + "detail": "" + }, + { + "name": "print-quality: the tab row is named \"Print quality tools\"", + "ok": true, + "detail": "" + }, + { + "name": "print-quality: exactly one tab is in the Tab order and it is the selected one", + "ok": true, + "detail": "[\"Print Quality\"]" + }, + { + "name": "print-quality: Tab, pressed 120 times through the page, lands on the selected tab and never on the other", + "ok": true, + "detail": "tabs reached: Print Quality" + }, + { + "name": "print-quality: ArrowRight moves focus to \"First Layer\"", + "ok": true, + "detail": "First Layer" + }, + { + "name": "print-quality: ArrowRight did not switch the panel", + "ok": true, + "detail": "" + }, + { + "name": "print-quality: the tab stop moved with focus", + "ok": true, + "detail": "[\"First Layer\"]" + }, + { + "name": "print-quality: the panel has a first focusable control", + "ok": true, + "detail": "Stringing / wisps" + }, + { + "name": "print-quality: after arrowing to \"First Layer\" and leaving the row, the tab stop is back on the selected tab \"Print Quality\"", + "ok": true, + "detail": "[\"Print Quality\"]" + }, + { + "name": "print-quality: Shift+Tab from the first focusable control in the panel (\"Stringing / wisps\") lands on the selected tab (\"Print Quality\"), not the one that was arrowed to", + "ok": true, + "detail": "Print Quality" + }, + { + "name": "print-quality: ArrowLeft wraps from the first tab to the last", + "ok": true, + "detail": "First Layer" + }, + { + "name": "print-quality: ArrowRight wraps from the last tab to the first", + "ok": true, + "detail": "Print Quality" + }, + { + "name": "print-quality: Home moves focus to the first tab", + "ok": true, + "detail": "Print Quality" + }, + { + "name": "print-quality: End moves focus to the last tab", + "ok": true, + "detail": "First Layer" + }, + { + "name": "print-quality: Home, End and the arrow keys never switched the panel", + "ok": true, + "detail": "" + }, + { + "name": "print-quality: Enter on \"First Layer\" switches the panel and its heading \"First Layer Doctor\" appears", + "ok": true, + "detail": "" + }, + { + "name": "print-quality: focus stays on the tab after Enter", + "ok": true, + "detail": "First Layer" + }, + { + "name": "print-quality: the panel is labeled by the selected tab", + "ok": true, + "detail": "" + }, + { + "name": "print-quality: Space on \"Print Quality\" switches back and its heading \"Print Quality Doctor\" appears", + "ok": true, + "detail": "" + }, + { + "name": "focus ring (dark): the keyboard-focused tab shows a visible ring", + "ok": true, + "detail": "{\"box\":\"rgb(15, 17, 26) 0px 0px 0px 2px, rgb(0, 225, 255) 0px 0px 0px 4px, rgba(0, 0, 0, 0) 0px 0px 0px 0px\",\"outline\":\"solid\",\"focusVisible\":true}" + }, + { + "name": "focus ring (light): the keyboard-focused tab shows a visible ring", + "ok": true, + "detail": "{\"box\":\"rgb(255, 255, 255) 0px 0px 0px 2px, rgb(0, 149, 230) 0px 0px 0px 4px, rgba(0, 0, 0, 0) 0px 0px 0px 0px\",\"outline\":\"solid\",\"focusVisible\":true}" + }, + { + "name": "compatibility at 600 px: no horizontal page scroll", + "ok": true, + "detail": "{\"page\":0,\"body\":0}" + }, + { + "name": "compatibility at 600 px: tab labels are not truncated and sit inside the viewport", + "ok": true, + "detail": "{\"pageOverflow\":0,\"bodyOverflow\":0,\"truncated\":[],\"outside\":[],\"heights\":[38,38],\"barRight\":568,\"width\":600}" + }, + { + "name": "compatibility at 600 px: both labels are present in full", + "ok": true, + "detail": "Compatibility | Source Check" + }, + { + "name": "print-quality at 600 px: no horizontal page scroll", + "ok": true, + "detail": "{\"page\":0,\"body\":0}" + }, + { + "name": "print-quality at 600 px: tab labels are not truncated and sit inside the viewport", + "ok": true, + "detail": "{\"pageOverflow\":0,\"bodyOverflow\":0,\"truncated\":[],\"outside\":[],\"heights\":[38,38],\"barRight\":568,\"width\":600}" + }, + { + "name": "print-quality at 600 px: both labels are present in full", + "ok": true, + "detail": "Print Quality | First Layer" + }, + { + "name": "no request reached another host, a printer, or discovery", + "ok": true, + "detail": "" + }, + { + "name": "no unexpected console errors", + "ok": true, + "detail": "" + } + ] +} \ No newline at end of file diff --git a/site/guide/EVIDENCE.md b/site/guide/EVIDENCE.md index 3b3eddca..77e6995c 100644 --- a/site/guide/EVIDENCE.md +++ b/site/guide/EVIDENCE.md @@ -1,7 +1,9 @@ # Evidence record — what each page rests on -The guide describes **Snapmaker Studio v1.5.0** (tag `v1.5.0`; the interface in `main` at the time of writing is the -same, apart from the Help / Get Started links added with this guide). Every button label in the lessons was read from the +The `orca` evidence kind is advice to verify; it makes no claim about Snapmaker Orca behavior. + +The guide describes **Snapmaker Studio v1.5.1** (tag `v1.5.1`). Its screenshots were captured from the installed v1.5.0 +release and have not been recaptured; the interface changed in v1.5.1 where the release notes say so. Every button label in the lessons was read from the running interface or from the source that renders it. "UI" below means the label or behaviour was observed in the running app during capture (`tools/capture.mjs`, a real Studio engine with disposable data and example files); "Source" means it was read from the named file because it cannot be reached without a printer or the installed shell. @@ -123,7 +125,7 @@ All English text was reviewed in two independent passes, then reread after the c 3. Unresolved plural placeholders: "1 object(s) moved…", "Found 5 invalid-value issue(s) and 2 warning(s).", "1 thing(s) are worth settling…". 4. "Moving the objects as one piece would not bring them all on…" lacks a destination ("onto the plate"). 5. "Upload sliced gcode" should read "G-code" like the rest of the app. -6. Cost Doctor says "true cost to make" for an estimate built on user assumptions. +6. Fixed in the app (`BusinessDoctors.tsx`): Cost Doctor now says "estimated cost". The committed screenshot still shows the old wording until it is recaptured. 7. "Not proven separable — reserve a toolhead each" is jargon for beginners. 8. Capitalization varies for one feature ("This print"/"This Print", "Batch prepare"/"Batch Prepare", "After slicing"/"After Slicing"). 9. The page text for a missing file starts in lowercase and has no final period ("that file does not exist"). @@ -144,3 +146,15 @@ Before publishing the corrected copy, Astra (`gpt-6-astra`) checked the guide's Two further notes from that review were also applied: the watch-folder wording now says it looks only while **After Slicing** or **This print** is open (the poll has no focus or visibility gate, `desktop/src/components/OrcaRoundTrip.tsx`), and the exercise record above now states that the printer name in the header is the confirmed fact while the mismatch finding is *likely*. New regression checks: `backend/tests/test_guide_claims.py` (engine-derived placement and printer-name facts), `desktop/src/lib/guideClaims.test.ts` (printer-action policy, prompt text and fidelity labels from app code), and a wording tripwire in `tools/build.mjs`. They establish that the guide agrees with current engine and app code on those points. They do not establish prose quality, physical printer behavior, Snapmaker Orca behavior, or that a paraphrase of a past overclaim cannot return. They were checked to fail against the earlier wording. + +## Source-backed guidance review (2026-10-08) + +The guidance manifest records seven questions, the code-derived facts behind each answer, and forbidden overclaims. +Page sources are checked offline against repository paths or the guide's allowlisted links. +The build checks only the shape and file existence of each fact's `derive` reference; the real symbol resolution happens in the tests. +The reviewed field is metadata for maintainers; the build and renderer do not treat it as proof of current behavior. +Automated checks cannot judge prose clarity or whether a cited source is the right one. They cannot verify review dates, physical printer behavior, Snapmaker Orca behavior, paraphrased overclaims, or screen-reader experience. + +The **Print readiness (estimate)** percentage is treated as risk-signal output, not a probability of print success. +The percentage's mathematical validity remains unproven and needs a maintainer decision. +The app's verdict line "Likely to print (N%)" (`success_predict.py`) is an open maintainer decision: issue #92. diff --git a/site/guide/README.md b/site/guide/README.md index 78c28100..32e9a0b0 100644 --- a/site/guide/README.md +++ b/site/guide/README.md @@ -1,6 +1,6 @@ # Snapmaker Studio — user guide -A static, task-oriented guide for **Snapmaker Studio v1.5.0**. It is organized around the decisions a person makes before a +A static, task-oriented guide for **Snapmaker Studio v1.5.1**. It is organized around the decisions a person makes before a print, not around the order of the app's menus: 1. **Learn with an example project** — six stages (Open → Check → Prepare → Review → Slice in Orca → Check the sliced job), @@ -42,6 +42,7 @@ site/guide/ examples.json ← the interactive examples and their feedback shots.json ← each screenshot's alt text, caption and control explanations geometry.json ← GENERATED: where each control sits, as percentages of the picture + answers.json ← frozen seven-question manifest for code-backed golden answers tools/ ← build, preview, capture and verification scripts (Node, no runtime dependencies) deploy/ ← sample deployment files (nothing here runs automatically) evidence/redesign/ ← screenshots of the finished redesign (desktop and phone, both themes) @@ -55,6 +56,11 @@ land on the right page). With JavaScript the guide shows one page at a time and Requires Node 18 or newer. No packages are needed to build or preview. +Stages, tasks and warnings may include a checked version and repository-backed sources. The build validates source paths, +link keys and the shape of the seven golden answers; it checks only the shape and file existence of each `derive` +reference, and the real symbol resolution happens in the tests. Each source appears in a collapsed **Where this comes from** block. The offline +check compares the guide version with the desktop configuration and warns on drift without failing. + ```bash cd site/guide node tools/build.mjs # validate content and regenerate public/index.html (fails on any problem) @@ -133,4 +139,7 @@ screenshot they replace any local path with ``. Each run rewrites `conte captured, so hotspots stay aligned. Review new screenshots for private data before committing (this guide's captures use only synthetic example files and made-up spools). +Evidence kinds use `file` for values read from a file, `engine` for a Studio check, `estimate` for a derived estimate, and +`orca` only for advice to verify in Snapmaker Orca. The last kind makes no claim about Orca behavior. + Studio's own window is captured in its dark theme. The guide itself has both themes. Screenshots of the finished guide are in `evidence/redesign/`. diff --git a/site/guide/content/answers.json b/site/guide/content/answers.json new file mode 100644 index 00000000..6e45bd6f --- /dev/null +++ b/site/guide/content/answers.json @@ -0,0 +1,12 @@ +{ + "schema": "answers/1", + "answers": [ + {"id":"setting-why","question":"Why did Studio change this setting?","page":"path-review","requiredFacts":[{"id":"engine-reason","derive":"backend:rules.apply_clamps","tokens":["valid range","U1 default"]}],"forbidden":["improves the print","guarantees compatibility"],"nextAction":{"label":"Open in Snapmaker Orca","ref":"#path-orca"}}, + {"id":"size-or-placement","question":"Too big, or just off the plate?","page":"task-move-onto-plate","requiredFacts":[{"id":"placement-move","derive":"backend:plate_placement.EDGE_MARGIN_MM","tokens":["one move cannot fix the layout","multi-plate"]}],"forbidden":["Studio scales the object","will fit after moving"],"nextAction":{"label":"Move onto the plate (saves a copy)","ref":"#task-move-onto-plate"}}, + {"id":"kept-orca","question":"Does “Kept” mean Snapmaker Orca uses it?","page":"path-review","requiredFacts":[{"id":"kept-reachability","derive":"app:desktop/src/lib/fidelity.ts#FIDELITY_HEADINGS","tokens":["reached the copy","read any note on the row"]}],"forbidden":["Kept means Orca uses it","Kept needs no action"],"nextAction":{"label":"Open in Snapmaker Orca","ref":"#path-orca"}}, + {"id":"unknown-compatible","question":"Is “Studio can’t tell” the same as incompatible?","page":"problem-studio-cant-tell","requiredFacts":[{"id":"unknown-gap","derive":"backend:post_slice._machine_match","tokens":["does not guess","no printer is connected"]}],"forbidden":["Studio can't tell means incompatible","unknown means failed"],"nextAction":{"label":"Printer Hub","ref":"#task-connect-printer"}}, + {"id":"sliced-for-u1","question":"Was this job sliced for my U1?","page":"path-job","requiredFacts":[{"id":"sliced-header","derive":"backend:post_slice._machine_match","tokens":["Studio reads the header","not simulated"]}],"forbidden":["Studio simulated the commands","guaranteed to print"],"nextAction":{"label":"Check this job","ref":"#task-check-sliced-job"}}, + {"id":"original-unchanged","question":"Did Studio change my original?","page":"task-prepare-u1-copy","requiredFacts":[{"id":"copy-only","derive":"test:backend/tests/test_guide_claims.py::test_original_unchanged_answer_uses_real_convert_path","tokens":["SnapmakerU1","original file is not modified"]}],"forbidden":["Studio overwrites the original","original is replaced"],"nextAction":{"label":"Prepare U1 copy","ref":"#task-prepare-u1-copy"}}, + {"id":"print-success","question":"Will this print succeed?","page":"path-check","requiredFacts":[{"id":"readiness-estimate","derive":"backend:success_predict.predict","tokens":["takes points off for each risk signal","not a probability of print success","at least 75"]}],"forbidden":["likelihood of success","will print","guaranteed"],"nextAction":{"label":"Print readiness (estimate)","ref":"#path-check"}} + ] +} diff --git a/site/guide/content/guide.json b/site/guide/content/guide.json index 28b444fd..e8ae8307 100644 --- a/site/guide/content/guide.json +++ b/site/guide/content/guide.json @@ -1,10 +1,11 @@ { "site": { "title": "Snapmaker Studio guide — decide what to do with your project", - "description": "A task-first guide to Snapmaker Studio v1.5.0: follow one example from opening a project to checking a sliced job, find help for what you are doing now, or look up a warning.", - "version": "1.5.0", + "description": "A task-first guide to Snapmaker Studio v1.5.1: follow one example from opening a project to checking a sliced job, find help for what you are doing now, or look up a warning.", + "version": "1.5.1", + "reviewed": "2026-10-08", "disclaimer": "Snapmaker Studio is an **independent open-source project — not affiliated with or endorsed by Snapmaker**. “Snapmaker” is a trademark of its owner.", - "footer": "This guide describes **Snapmaker Studio v1.5.0**, the current stable release. Studio is advisory: it checks and prepares files, Snapmaker Orca slices, and nothing here promises that a print will succeed. Source, release notes and verification: [github.com/DVOpenLabs/snapmaker-studio](@repo)." + "footer": "This guide describes **Snapmaker Studio v1.5.1**, the current stable release. Studio is advisory: it checks and prepares files, Snapmaker Orca slices, and nothing here promises that a print will succeed. Source, release notes and verification: [github.com/DVOpenLabs/snapmaker-studio](@repo)." }, "links": { "repo": "https://github.com/DVOpenLabs/snapmaker-studio", diff --git a/site/guide/content/path.json b/site/guide/content/path.json index c0caaa13..36ae012e 100644 --- a/site/guide/content/path.json +++ b/site/guide/content/path.json @@ -40,7 +40,7 @@ "next": { "page": "path-check", "why": "Next question: what needs attention before I slice?" } }, { - "id": "check", "page": "path-check", "n": 2, "lane": "studio", "label": "Check", + "id": "check", "page": "path-check", "n": 2, "lane": "studio", "label": "Check", "checked": "1.5.1", "sources": [{"label":"Readiness estimate","ref":"https://github.com/DVOpenLabs/snapmaker-studio/blob/v1.5.1/backend/snapstudio_core/success_predict.py","kind":"estimate"},{"label":"Readiness card","ref":"https://github.com/DVOpenLabs/snapmaker-studio/blob/v1.5.1/desktop/src/routes/DesignInsights.tsx","kind":"engine"}], "title": "Read the checks", "question": "What needs attention before slicing?", "lead": "Studio compares the project with the U1 and with Snapmaker Orca's expectations. You do not need to read every line. What matters is telling a confirmed problem from a heads-up, and both from something Studio cannot know.", @@ -54,6 +54,7 @@ "means": [ { "seen": "**1 object is outside the U1's printable area.**", "meaning": "An object hangs off the plate. Studio names the object, the edge and the distance.", "certainty": "confirmed", "action": "Decide whether it is misplaced or too big (next stage)." }, { "seen": "**NEEDS ATTENTION** — “Invalid value for …”", "meaning": "Likely to cause trouble in Orca. For a downloaded 3MF it usually means settings from another printer; the text says the model itself may be fine.", "certainty": "check", "action": "Read the **Do this:** line. Preparing a U1 copy is designed to handle this." }, + { "seen": "**Print readiness (estimate)**", "meaning": "Studio starts at 100 and takes points off for each risk signal it found. The percentage is not a probability of print success. **Few risks** means the score is at least 75, so a signal may still have cost points. The line under it shows the percentage; the bullet list of signals appears only below 75.", "certainty": "info", "action": "Review any listed signals before printing." }, { "seen": "**HEADS UP**", "meaning": "Worth knowing, often something Studio cannot verify, such as spacing between objects.", "certainty": "check", "action": "Check it in Orca (**Arrange**, collision warnings)." }, { "seen": "**STUDIO CAN’T TELL** / **STUDIO CAN’T CHECK THIS**", "meaning": "Studio lacks information it needs for this check. It is not a problem found; it is a gap.", "certainty": "unknown", "action": "Connect the printer, or check it yourself. See the unknown-versus-confirmed example in stage 6." }, { "seen": "**LOOKS RIGHT**", "meaning": "Studio checked and found nothing wrong.", "certainty": "ok", "action": "Read any action listed on the card. It is advice, not a guarantee." } @@ -83,7 +84,7 @@ "next": { "page": "path-prepare", "why": "Next question: what can Studio fix, and how should I prepare my copy?" } }, { - "id": "prepare", "page": "path-prepare", "n": 3, "lane": "studio", "label": "Prepare", + "id": "prepare", "page": "path-prepare", "n": 3, "lane": "studio", "label": "Prepare", "checked": "1.5.1", "title": "Fix and prepare", "question": "What can Studio fix, and how should I prepare my copy?", "lead": "Studio can write a repositioned copy and a U1 copy. It fixes only what one safe action can fix, and it tells you when it will not. Both actions write new files; your original stays as it is.", @@ -128,7 +129,7 @@ "next": { "page": "path-review", "why": "Next question: what changed in the prepared copy?" } }, { - "id": "review", "page": "path-review", "n": 4, "lane": "studio", "label": "Review", + "id": "review", "page": "path-review", "n": 4, "lane": "studio", "label": "Review", "checked": "1.5.1", "sources": [{"label":"Fidelity report","ref":"https://github.com/DVOpenLabs/snapmaker-studio/blob/v1.5.1/desktop/src/lib/fidelity.ts","kind":"engine"}], "title": "Review what changed", "question": "What changed in the prepared copy?", "lead": "Studio does not ask you to trust the copy. It lists what it kept, what it changed, what it could not carry over and what it could not check, and you can always return to your original.", @@ -137,8 +138,8 @@ "note": "These cards appear on the Workspace right after preparing, and on **This print** under **2. Prepared**." }, "means": [ - { "seen": "**What survived preparing this copy** — 14 kept · 2 changed", "meaning": "A comparison of what Studio can identify in both files.", "certainty": "info", "action": "Expand **What Studio changed** and look at each line." }, - { "seen": "**Adjusted for U1 project compatibility**", "meaning": "Settings changed only so the project suits the U1, for example the printer identity.", "certainty": "info", "action": "Skim **Before and after**; flag anything that surprises you." }, + { "seen": "**What survived preparing this copy** — 14 kept · 2 changed", "meaning": "A comparison of what Studio can identify in both files. Kept means the value reached the copy, not that Orca uses it: read any note on the row.", "certainty": "info", "action": "Expand **What Studio changed** and look at each line." }, + { "seen": "**Adjusted for U1 project compatibility**", "meaning": "Settings changed only so the project suits the U1, for example the printer identity. Where a setting was outside its valid range, Studio used the U1 default.", "certainty": "info", "action": "Skim **Before and after**; flag anything that surprises you." }, { "seen": "**Optional recommendations (not applied)**", "meaning": "Suggestions Studio did not apply.", "certainty": "info", "action": "Nothing changes unless you choose **Prepare another copy with recommended settings**." }, { "seen": "**What Studio could not carry over**", "meaning": "Something in the original was left behind, or Studio could not establish what happened to it. Read each row's reason.", "certainty": "check", "action": "Check that setting in Orca." }, { "seen": "**What Studio could not check**", "meaning": "Studio could not verify this item: it may be an unexplained change, or something it could not compare.", "certainty": "unknown", "action": "Compare that setting with your original in Orca before slicing, and report it." } diff --git a/site/guide/content/problems.json b/site/guide/content/problems.json index 3a7cfcdf..314b1c41 100644 --- a/site/guide/content/problems.json +++ b/site/guide/content/problems.json @@ -16,7 +16,7 @@ "shot": "compat-findings", "tasks": ["review-in-orca"], "keywords": ["spacing", "collision", "profile", "not a u1 profile", "warning"] }, { - "id": "studio-cant-tell", "label": "STUDIO CAN’T TELL", "certainty": "unknown", "seen": ["check", "job"], + "id": "studio-cant-tell", "label": "STUDIO CAN’T TELL", "certainty": "unknown", "seen": ["check", "job"], "checked": "1.5.1", "sources": [{"label":"Unknown result","ref":"https://github.com/DVOpenLabs/snapmaker-studio/blob/v1.5.1/backend/snapstudio_core/post_slice.py","kind":"engine"}], "means": "Studio lacks information it needs for this check, often because no printer is connected, so it does not guess.", "why": "Most often no printer is connected. The app's own line says: *“Studio can’t tell” means Studio has no way to read that from your printer — not that your printer can’t do it.* Studio can also say it when the file itself leaves a fact out.", "do": ["Connect your printer in Printer Hub so Studio can compare it with the project.", "Or check the item yourself at the printer; the card says what to check."], @@ -32,7 +32,7 @@ "shot": "after-result", "tasks": ["connect-printer", "confirm-nozzles"], "keywords": ["after slicing", "toolheads", "slots loaded", "bed", "nozzle", "unknown"] }, { - "id": "looks-right", "label": "LOOKS RIGHT", "certainty": "ok", "seen": ["check", "job"], + "id": "looks-right", "label": "LOOKS RIGHT", "certainty": "ok", "seen": ["check", "job"], "checked": "1.5.1", "sources": [{"label":"Check results (sliced job)","ref":"https://github.com/DVOpenLabs/snapmaker-studio/blob/v1.5.1/desktop/src/lib/postSlice.ts","kind":"engine"},{"label":"Check results (before slicing)","ref":"https://github.com/DVOpenLabs/snapmaker-studio/blob/v1.5.1/desktop/src/lib/preflight.ts","kind":"engine"}], "means": "Studio checked this and found nothing wrong.", "why": "For example, when a sliced job names a U1, Studio shows **Sliced for the machine Studio prepares for**.", "do": ["Read any action listed on the card; a result that looks right can still have a next step."], diff --git a/site/guide/content/tasks.json b/site/guide/content/tasks.json index e8379974..6a3b43a6 100644 --- a/site/guide/content/tasks.json +++ b/site/guide/content/tasks.json @@ -20,11 +20,11 @@ "**Windows:** run the installer. It is not code-signed yet, so SmartScreen may say **Unknown publisher**. Once the hash matches, choose **More info → Run anyway**, then start **Snapmaker Studio** from the Start menu. More: [Windows install guide](@windows_install).", "**Linux:** `sudo apt install ./`, then start **Snapmaker Studio** from your application menu or run `snapmaker-studio-desktop`. More: [Linux install guide](@linux_install)." ], - "success": ["Studio opens on **Home**, with the version **v1.5.0** in the status bar and **Local-only · nothing leaves your network** in the footer.", "There is nothing to sign in to."], + "success": ["Studio opens on **Home**, with the version **v1.5.1** in the status bar and **Local-only · nothing leaves your network** in the footer.", "There is nothing to sign in to."], "differs": [ { "if": "Windows says “Windows protected your PC”.", "then": "This is expected for an installer that is not code-signed yet. Continue only if the SHA256 matches and you downloaded the file from Studio's Releases page." }, { "if": "The hash does not match.", "then": "Do not run the installer. Delete it and download it again from Studio's Releases page." }, - { "if": "Studio looks different from this guide.", "then": "This guide describes **v1.5.0**. Check the version at the bottom of the Studio window; the [release notes](@releases) say what changed." } + { "if": "Studio looks different from this guide.", "then": "This guide describes **v1.5.1**. Check the version at the bottom of the Studio window; the [release notes](@releases) say what changed." } ], "notes": [ { "kind": "limit", "text": "Linux support is verified by automated installs on clean Ubuntu 22.04 and 24.04 systems. Other distributions and installs on a physical desktop have not been verified yet; see the [Linux install guide](@linux_install)." }, @@ -100,7 +100,7 @@ "problems": ["studio-cant-tell"], "keywords": ["colours", "colors", "toolheads", "four", "painted", "swap", "multi-colour", "filament", "reserve", "color"] }, { - "id": "move-onto-plate", "page": "task-move-onto-plate", "group": "prepare", "title": "Move an object that hangs off the plate", + "id": "move-onto-plate", "page": "task-move-onto-plate", "group": "prepare", "title": "Move an object that hangs off the plate", "checked": "1.5.1", "sources": [{"label":"Placement check","ref":"https://github.com/DVOpenLabs/snapmaker-studio/blob/v1.5.1/backend/snapstudio_core/plate_placement.py","kind":"engine"}], "when": "**Object placement** says an object is outside the U1's printable area.", "prereq": ["The project open in Studio."], "steps": [ @@ -116,7 +116,7 @@ "problems": ["object-outside-area", "cannot-move-as-one-piece"], "keywords": ["move", "plate", "off the plate", "out of bounds", "placement", "hangs", "bed", "arrange"] }, { - "id": "prepare-u1-copy", "page": "task-prepare-u1-copy", "group": "prepare", "title": "Prepare a U1 copy and choose a mode", + "id": "prepare-u1-copy", "page": "task-prepare-u1-copy", "group": "prepare", "title": "Prepare a U1 copy and choose a mode", "checked": "1.5.1", "sources": [{"label":"Copy writer","ref":"https://github.com/DVOpenLabs/snapmaker-studio/blob/v1.5.1/backend/snapstudio_core/convert.py","kind":"engine"}], "when": "You want a copy Orca can open with U1-compatible settings.", "prereq": ["The project open in Studio."], "steps": [ @@ -360,7 +360,7 @@ "when": "You want to know whether a newer Studio exists.", "prereq": [], "steps": [ - "Your version is at the bottom of the window (**v1.5.0** for this guide).", + "Your version is at the bottom of the window (**v1.5.1** for this guide).", "Open **Help → Check for a newer version** and press **Check GitHub now**. The update check does not download or install anything; it only shows a version number and a link.", "To update, download the new installer from Studio's Releases page, verify its hash, and run it over your install. Your data is kept." ], diff --git a/site/guide/package.json b/site/guide/package.json index a175480d..1dcfac44 100644 --- a/site/guide/package.json +++ b/site/guide/package.json @@ -1,7 +1,7 @@ { "name": "snapmaker-studio-guide", "private": true, - "version": "1.5.0", + "version": "1.5.1", "type": "module", "description": "Interactive user guide for Snapmaker Studio (static site; no runtime dependencies).", "scripts": { diff --git a/site/guide/public/assets/guide.css b/site/guide/public/assets/guide.css index 18493ba5..9a3c1def 100644 --- a/site/guide/public/assets/guide.css +++ b/site/guide/public/assets/guide.css @@ -200,6 +200,11 @@ a.chip:hover, button.chip:hover { border-color: var(--accent); color: var(--text .differs summary { cursor: pointer; padding: 11px 16px; font-weight: 700; } .differs details > div { padding: 0 16px 12px; color: var(--muted); } .differs details > div p { margin: 0; } +.sources { margin-top: 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); } +.sources summary { cursor: pointer; padding: 11px 16px; font-weight: 700; } +.sources > div { padding: 0 16px 12px; color: var(--muted); } +.sources ul { margin: 8px 0 0; padding-left: 22px; } +.sources li { margin: 6px 0; } .stage-nav { display: flex; justify-content: space-between; gap: 12px; margin: 38px 0 0; padding-top: 22px; border-top: 1px solid var(--border); flex-wrap: wrap; } /* interactive examples */ diff --git a/site/guide/public/assets/search.js b/site/guide/public/assets/search.js index 6d2733c3..faeafc8d 100644 --- a/site/guide/public/assets/search.js +++ b/site/guide/public/assets/search.js @@ -94,7 +94,7 @@ export function renderSearch(container, q) { if (!results.length) { const box = el("div", { class: "empty", role: "status" }); box.innerHTML = `

    Nothing matched “${escapeHtml(query)}”

    -

    This guide describes Studio v1.5.0. Try fewer or different words, or browse:

    +

    This guide describes Studio v1.5.1. Try fewer or different words, or browse:

    Something missing from the guide? Tell us on GitHub (opens in a new tab).

    `; container.appendChild(box); diff --git a/site/guide/public/index.html b/site/guide/public/index.html index 6f1fc89d..2f08894b 100644 --- a/site/guide/public/index.html +++ b/site/guide/public/index.html @@ -4,7 +4,7 @@ Snapmaker Studio guide — decide what to do with your project - + @@ -17,7 +17,7 @@ - Snapmaker StudioGuide · v1.5.0 + Snapmaker StudioGuide · v1.5.1
    @@ -1117,22 +1145,23 @@

    Diagnose a print that
    - +

    Steps

    1. Open Print Quality and use its Print Quality or First Layer tab.
    2. Pick the symptom that looks like your print.
    3. Read the likely causes and safe first checks.

    You are done when

    • Advice based on the open model, if there is one. It never changes your settings or G-code.
    - - + + +
    @@ -1145,22 +1174,23 @@

    Find a project you already
    - +

    Steps

    1. Open My designs (Simple) or Projects (Advanced).
    2. Use All, Profile compatible or Needs prep to filter.
    3. Open a design again, or its History.

    You are done when

    • The project opens with its last status.
    - - + + +
    @@ -1173,22 +1203,23 @@

    Browse model sites insi
    - +

    Steps

    1. Open Find Models and pick a site, such as Printables or MakerWorld.
    2. Download with the site's normal download button; Studio adds supported downloads to your Library.
    3. Check it in Ready now.

    You are done when

    • The download is in your Library.
    - +
    Safety

    Sign in on the site itself; Studio never sees your password. Clear site data signs you out of every site.

    +
    @@ -1196,27 +1227,28 @@

    Browse model sites insi

    Guide Tasks Update and report

    Check for a newer version and update

    - +

    Use this when: You want to know whether a newer Studio exists.

    - -

    Steps

    1. Your version is at the bottom of the window (v1.5.0 for this guide).
    2. Open Help → Check for a newer version and press Check GitHub now. The update check does not download or install anything; it only shows a version number and a link.
    3. To update, download the new installer from Studio's Releases page, verify its hash, and run it over your install. Your data is kept.
    + +

    Steps

    1. Your version is at the bottom of the window (v1.5.1 for this guide).
    2. Open Help → Check for a newer version and press Check GitHub now. The update check does not download or install anything; it only shows a version number and a link.
    3. To update, download the new installer from Studio's Releases page, verify its hash, and run it over your install. Your data is kept.

    You are done when

    • You know whether you are current.
    - +
    Safety

    The check makes one request to GitHub asking which release is newest and sends nothing about you or your files. The automatic check is off until you turn it on, and runs at most once a day.

    +
    @@ -1224,27 +1256,28 @@

    Check for a newer ver

    Guide Tasks Update and report

    Send a useful problem report

    - +

    Use this when: Studio got something wrong.

    - +

    Steps

    1. Open Help → Reporting something Studio got wrong, press Show me what it contains and read it.
    2. Press Save it to a file. Your username, home folder, file paths, machine name and printer address are replaced first.
    3. Open a report on the Studio issues page (opens in a new tab), attach the file, and say what you did, saw and expected.

    You are done when

    • A report bundle you reviewed before Studio saved it. Studio never sends it anywhere.

    If something is different

    The result differs from this guide.

    Check the version, which file is open and whether a printer is connected first; many answers change with those.

    - + +
    @@ -1268,10 +1301,11 @@

    NEEDS

    Why you see this

    Studio compares the project's settings with what the U1 and Orca expect. The text on the card says: The model may be fine; the project settings are the problem.

    What to do

    1. Read the card's Do this: line. For a project made for another printer, it usually says to import the model into a clean U1 project or to prepare a U1 copy.
    2. Press Prepare U1 copy (Preserve creator settings is the recommended default) and review the result.

    What not to conclude

    Do not conclude your model is broken: the card says the model may be fine.

    +