From 5230228c0947a23aca921deedb8b6ba9d3908b9c Mon Sep 17 00:00:00 2001 From: Cody Date: Mon, 14 Sep 2026 18:42:33 -0700 Subject: [PATCH 1/7] Build AppLens v1 inventory client and prepare release validation Separate and preserve AppLens-Tune; connect the quick inventory, storage table, confirmed Windows removal routes, action history and local report exports. Finish keyboard, text scaling and contrast behavior and preserve installation identity in accessible names. Include the development removal probes and evidence guidance without publishing local artifacts. Prepare COP-241 release validation, bundle .NET for Store builds, and add an MSBuild configuration regression. Keep the remaining clean-PC, platform, screen-reader and certification checks explicit. Validation: x64/ARM64 Release builds; 94 core tests; 58 preserved Tune tests; five snapshot check groups; Store settings checks for both architectures; read-only inventory/report smoke; NuGet vulnerability audit. --- .github/workflows/dotnet.yml | 8 + .gitignore | 18 + AGENTS.md | 71 ++ AppLens.ps1 | 135 +++- README.md | 62 +- docs/AppLens-Client-Verification.md | 62 ++ docs/AppLens-Platform-Scope.md | 19 +- docs/AppLens-Privacy-Draft.md | 34 + docs/AppLens-Product-Vision.md | 177 +++++ docs/AppLens-Release-Validation.md | 79 ++ docs/AppLens-Scanner.md | 19 +- docs/AppLens-Support-Draft.md | 37 + docs/AppLens-Tune-App.md | 20 +- docs/AppLens-Uninstall-Routes.md | 61 ++ docs/AppLens-v1-Handoff.md | 177 +++++ docs/AppLensDesktop-Build.md | 81 +- docs/Store-Listing-Draft.md | 128 ++-- docs/Store-Readiness-Checklist.md | 151 ++-- .../AppLens-Tune/AppLens-Tune.ps1 | 0 .../AppLens-Tune/AppLens-Tune.py | 0 future/AppLens-Tune/README.md | 44 ++ .../AppLens-Tune/Run-AppLens-Tune.bat | 0 .../AppLens-Tune/Run-AppLens-Tune.sh | 0 future/AppLens-Tune/desktop/MainWindow.xaml | 657 ++++++++++++++++ .../AppLens-Tune/desktop/MainWindow.xaml.cs | 419 ++++++++++ .../docs}/AppLens-Tune-LLM-Profile.md | 0 .../docs}/AppLens-Tune-Product-Outline.md | 0 .../AppLens-Tune/docs}/AppLens-Tune-Thesis.md | 0 .../AppLens-Tune/preservation-manifest.json | 122 +++ future/AppLens-Tune/src/AppLens.Tune.csproj | 12 + .../src}/LocalAiProfileBuilder.cs | 0 .../src}/ReadinessSummaryBuilder.cs | 0 .../AppLens-Tune/src}/RulesEngine.cs | 0 .../AppLens-Tune/src}/TuneActionExecutor.cs | 3 +- future/AppLens-Tune/src/TuneAuditService.cs | 102 +++ .../AppLens-Tune/src}/TuneCollector.cs | 45 +- .../AppLens-Tune/src}/TunePlanBuilder.cs | 0 future/AppLens-Tune/src/TuneReportWriter.cs | 320 ++++++++ .../tests/AppLens.Tune.Tests.csproj | 16 + .../tests}/LocalAiProfileBuilderTests.cs | 0 .../tests}/PlatformLoopServiceTests.cs | 0 .../tests}/ReadinessSummaryBuilderTests.cs | 0 .../AppLens-Tune/tests}/ReportWriterTests.cs | 25 +- .../AppLens-Tune/tests}/RulesEngineTests.cs | 0 .../tests}/TuneActionExecutorTests.cs | 0 .../tests}/TunePlanBuilderTests.cs | 0 src/AppLens.Backend/AppLens.Backend.csproj | 2 +- src/AppLens.Backend/AuditService.cs | 134 ++-- src/AppLens.Backend/BlackboardEvent.cs | 2 +- src/AppLens.Backend/ITuneActionExecutor.cs | 7 + src/AppLens.Backend/InventoryCollector.cs | 356 ++++----- src/AppLens.Backend/InventoryData.cs | 94 +++ src/AppLens.Backend/InventorySnapshot.cs | 19 + src/AppLens.Backend/MachineCollector.cs | 87 +++ src/AppLens.Backend/Models.cs | 24 +- src/AppLens.Backend/MsiInstallation.cs | 23 + src/AppLens.Backend/PlatformLoopService.cs | 4 +- src/AppLens.Backend/RedactionService.cs | 16 +- src/AppLens.Backend/RegistrationData.cs | 23 + src/AppLens.Backend/RemovalCommand.cs | 47 ++ src/AppLens.Backend/RemovalService.cs | 128 ++++ src/AppLens.Backend/ReportWriter.cs | 380 +++------ src/AppLens.Backend/WindowsRemovalPlatform.cs | 93 +++ src/AppLens.Desktop/App.xaml | 21 + src/AppLens.Desktop/AppLens.Desktop.csproj | 4 + src/AppLens.Desktop/Assets/AppLens-Artwork.md | 10 + src/AppLens.Desktop/Assets/AppLens.ico | Bin 0 -> 1870 bytes .../Assets/AppLensSplash.scale-200.png | Bin 0 -> 12697 bytes .../Assets/AppLensSquare150.scale-200.png | Bin 0 -> 6064 bytes .../Assets/AppLensSquare44.scale-200.png | Bin 0 -> 1848 bytes src/AppLens.Desktop/Assets/AppLensStore.png | Bin 0 -> 904 bytes .../Assets/AppLensWide.scale-200.png | Bin 0 -> 7177 bytes src/AppLens.Desktop/InventoryPresentation.cs | 58 ++ src/AppLens.Desktop/MainWindow.xaml | 725 ++---------------- src/AppLens.Desktop/MainWindow.xaml.cs | 475 ++++-------- src/AppLens.Desktop/Package.appxmanifest | 18 +- .../BlackboardStoreTests.cs | 37 + .../CoreBoundaryTests.cs | 25 + .../InventoryMetadataTests.cs | 81 ++ .../InventoryScanTests.cs | 83 ++ .../RemovalCommandTests.cs | 45 ++ .../RemovalServiceTests.cs | 117 +++ .../AppLens.Desktop.Tests.csproj | 1 + .../InventoryPresentationTests.cs | 49 ++ tests/Script.Tests/Test-AppLensSnapshot.ps1 | 96 +++ .../Test-DevelopmentClientResources.ps1 | 20 + .../Script.Tests/Test-StoreConfiguration.ps1 | 22 + .../AppLens.RemovalProbe.csproj | 10 + .../Build-DevelopmentProbe.ps1 | 91 +++ .../Install-DevelopmentProbe.ps1 | 27 + tools/AppLens.RemovalProbe/New-FixtureMsi.ps1 | 68 ++ tools/AppLens.RemovalProbe/Program.cs | 105 +++ tools/AppLens.RemovalProbe/README.md | 50 ++ tools/AppLens.Smoke/AppLens.Smoke.csproj | 11 + tools/AppLens.Smoke/Program.cs | 25 + tools/Build-StoreCandidate.ps1 | 11 +- tools/New-AppLensAssets.ps1 | 51 ++ 97 files changed, 5018 insertions(+), 1861 deletions(-) create mode 100644 AGENTS.md create mode 100644 docs/AppLens-Client-Verification.md create mode 100644 docs/AppLens-Privacy-Draft.md create mode 100644 docs/AppLens-Product-Vision.md create mode 100644 docs/AppLens-Release-Validation.md create mode 100644 docs/AppLens-Support-Draft.md create mode 100644 docs/AppLens-Uninstall-Routes.md create mode 100644 docs/AppLens-v1-Handoff.md rename AppLens-Tune.ps1 => future/AppLens-Tune/AppLens-Tune.ps1 (100%) rename AppLens-Tune.py => future/AppLens-Tune/AppLens-Tune.py (100%) create mode 100644 future/AppLens-Tune/README.md rename Run-AppLens-Tune.bat => future/AppLens-Tune/Run-AppLens-Tune.bat (100%) rename Run-AppLens-Tune.sh => future/AppLens-Tune/Run-AppLens-Tune.sh (100%) create mode 100644 future/AppLens-Tune/desktop/MainWindow.xaml create mode 100644 future/AppLens-Tune/desktop/MainWindow.xaml.cs rename {docs => future/AppLens-Tune/docs}/AppLens-Tune-LLM-Profile.md (100%) rename {docs => future/AppLens-Tune/docs}/AppLens-Tune-Product-Outline.md (100%) rename {docs => future/AppLens-Tune/docs}/AppLens-Tune-Thesis.md (100%) create mode 100644 future/AppLens-Tune/preservation-manifest.json create mode 100644 future/AppLens-Tune/src/AppLens.Tune.csproj rename {src/AppLens.Backend => future/AppLens-Tune/src}/LocalAiProfileBuilder.cs (100%) rename {src/AppLens.Backend => future/AppLens-Tune/src}/ReadinessSummaryBuilder.cs (100%) rename {src/AppLens.Backend => future/AppLens-Tune/src}/RulesEngine.cs (100%) rename {src/AppLens.Backend => future/AppLens-Tune/src}/TuneActionExecutor.cs (99%) create mode 100644 future/AppLens-Tune/src/TuneAuditService.cs rename {src/AppLens.Backend => future/AppLens-Tune/src}/TuneCollector.cs (88%) rename {src/AppLens.Backend => future/AppLens-Tune/src}/TunePlanBuilder.cs (100%) create mode 100644 future/AppLens-Tune/src/TuneReportWriter.cs create mode 100644 future/AppLens-Tune/tests/AppLens.Tune.Tests.csproj rename {tests/AppLens.Backend.Tests => future/AppLens-Tune/tests}/LocalAiProfileBuilderTests.cs (100%) rename {tests/AppLens.Backend.Tests => future/AppLens-Tune/tests}/PlatformLoopServiceTests.cs (100%) rename {tests/AppLens.Backend.Tests => future/AppLens-Tune/tests}/ReadinessSummaryBuilderTests.cs (100%) rename {tests/AppLens.Backend.Tests => future/AppLens-Tune/tests}/ReportWriterTests.cs (91%) rename {tests/AppLens.Backend.Tests => future/AppLens-Tune/tests}/RulesEngineTests.cs (100%) rename {tests/AppLens.Backend.Tests => future/AppLens-Tune/tests}/TuneActionExecutorTests.cs (100%) rename {tests/AppLens.Backend.Tests => future/AppLens-Tune/tests}/TunePlanBuilderTests.cs (100%) create mode 100644 src/AppLens.Backend/ITuneActionExecutor.cs create mode 100644 src/AppLens.Backend/InventoryData.cs create mode 100644 src/AppLens.Backend/InventorySnapshot.cs create mode 100644 src/AppLens.Backend/MachineCollector.cs create mode 100644 src/AppLens.Backend/MsiInstallation.cs create mode 100644 src/AppLens.Backend/RegistrationData.cs create mode 100644 src/AppLens.Backend/RemovalCommand.cs create mode 100644 src/AppLens.Backend/RemovalService.cs create mode 100644 src/AppLens.Backend/WindowsRemovalPlatform.cs create mode 100644 src/AppLens.Desktop/Assets/AppLens-Artwork.md create mode 100644 src/AppLens.Desktop/Assets/AppLens.ico create mode 100644 src/AppLens.Desktop/Assets/AppLensSplash.scale-200.png create mode 100644 src/AppLens.Desktop/Assets/AppLensSquare150.scale-200.png create mode 100644 src/AppLens.Desktop/Assets/AppLensSquare44.scale-200.png create mode 100644 src/AppLens.Desktop/Assets/AppLensStore.png create mode 100644 src/AppLens.Desktop/Assets/AppLensWide.scale-200.png create mode 100644 src/AppLens.Desktop/InventoryPresentation.cs create mode 100644 tests/AppLens.Backend.Tests/CoreBoundaryTests.cs create mode 100644 tests/AppLens.Backend.Tests/InventoryMetadataTests.cs create mode 100644 tests/AppLens.Backend.Tests/InventoryScanTests.cs create mode 100644 tests/AppLens.Backend.Tests/RemovalCommandTests.cs create mode 100644 tests/AppLens.Backend.Tests/RemovalServiceTests.cs create mode 100644 tests/AppLens.Desktop.Tests/InventoryPresentationTests.cs create mode 100644 tests/Script.Tests/Test-AppLensSnapshot.ps1 create mode 100644 tests/Script.Tests/Test-DevelopmentClientResources.ps1 create mode 100644 tests/Script.Tests/Test-StoreConfiguration.ps1 create mode 100644 tools/AppLens.RemovalProbe/AppLens.RemovalProbe.csproj create mode 100644 tools/AppLens.RemovalProbe/Build-DevelopmentProbe.ps1 create mode 100644 tools/AppLens.RemovalProbe/Install-DevelopmentProbe.ps1 create mode 100644 tools/AppLens.RemovalProbe/New-FixtureMsi.ps1 create mode 100644 tools/AppLens.RemovalProbe/Program.cs create mode 100644 tools/AppLens.RemovalProbe/README.md create mode 100644 tools/AppLens.Smoke/AppLens.Smoke.csproj create mode 100644 tools/AppLens.Smoke/Program.cs create mode 100644 tools/New-AppLensAssets.ps1 diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 2f78e84..b4eeab7 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -32,3 +32,11 @@ jobs: - name: Test run: dotnet test AppLensDesktop.sln --configuration Release --no-restore + - name: Test Windows initial snapshot + shell: powershell + run: .\tests\Script.Tests\Test-AppLensSnapshot.ps1 + + - name: Check Store configuration without packaging + shell: powershell + run: .\tests\Script.Tests\Test-StoreConfiguration.ps1 + diff --git a/.gitignore b/.gitignore index ce80da0..ab58c1a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,24 @@ artifacts/ src/AppLens.Desktop/BundleArtifacts/ .vs/ TestResults/ +.env +.env.* +!.env.example +!.env.template +.claude/ +.claude/settings.local.json +.vercel/ +.wrangler/ +*.log +*.db +*.db-journal +*.sqlite +*.sqlite3 *.user *.suo desktop.ini + +# Local report exports +/AppLens-*.md +/AppLens-*.json +/AppLens-*.html diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..54f8d94 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,71 @@ +# AppLens Agent Instructions + +Be concise. This file is durable project context, not a task log. + +## Project Context + +AppLens is CSI's local control board for managing workstation apps, agents, evidence, approvals, scans, diagnostics, and local reports. + +First Store release direction: a lightweight, silver/metallic Windows client for +guided screen-share sessions: scan, review/filter an app table, approve supported +uninstalls, and verify results. Follow `docs/AppLens-Product-Vision.md`; distinguish +the user's requirements from proposed implementation choices. Keep existing +platform infrastructure from expanding the first-release interface by default. + +AppLens-Tune means the existing Tune implementation. It is intentionally deferred: +separate Tune-specific code into `future/AppLens-Tune/`, preserve its work and +document how to resume it, and keep infrastructure needed by v1 in the shared +backend. Core v1 must operate without AppLens-Tune, including background probes. +Follow the ordered executable tasks in the product vision document. One agent +owns this work with no subagents. Scan, table, and report changes share one model. + +Canonical local path: `C:\Users\codyl\Desktop\csiOS\Projects\AppLens`. + +GitHub remote: `https://github.com/CSI-Platform/AppLens.git`. + +Current branch at csiOS inventory time: `main`. + +## Product Boundaries + +- AppLens is local-first and operator-controlled. +- Read-only scans are the default. +- System-changing behavior must remain explicit, approval-gated, reversible where practical, and recorded. +- No telemetry, accounts, or cloud upload should be added without explicit product approval. + +## Development + +Primary desktop commands from the README: + +```powershell +dotnet restore AppLensDesktop.sln +dotnet build AppLensDesktop.sln +dotnet test AppLensDesktop.sln +.\tools\Run-AppLensDesktop.ps1 +``` + +Package smoke build: + +```powershell +.\tools\Build-StoreCandidate.ps1 +``` + +## Useful Starting Points + +- `README.md` +- `docs/AppLensDesktop-Build.md` +- `docs/AppLens-Platform-Scope.md` +- `docs/Store-Readiness-Checklist.md` +- `docs/AppLens-Scanner.md` +- `docs/AppLens-Tune-App.md` +- `docs/AppLens-Blackboard.md` + +## No-Touch Boundaries + +- Do not add automatic remediation. +- Do not change privacy/telemetry posture without explicit approval. +- Do not publish or package for distribution without explicit approval. +- Do not overwrite raw evidence, artifacts, or user-generated reports without approval. + +## Project Management + +Current work state belongs in Linear and handoff docs, not in this file. diff --git a/AppLens.ps1 b/AppLens.ps1 index 67c9e7b..88ee4c3 100644 --- a/AppLens.ps1 +++ b/AppLens.ps1 @@ -3,11 +3,14 @@ .SYNOPSIS AppLens — Pre-Audit App Scanner for CSI AI Workflow Audits .DESCRIPTION - Scans installed desktop apps (Win32) and Microsoft Store apps without - requiring admin rights. Outputs a clean, categorized text file suitable - for pasting into an AI prompt alongside a workflow audit transcript. + Captures hardware, RAM usage, local disk utilization, + installed desktop apps (Win32), and Microsoft Store apps without admin rights. + Read-only: writes a new local text report without changing system settings. #> +[CmdletBinding()] +param([string]$OutputPath) + # ── Configuration ────────────────────────────────────────────────────────────── function Get-DesktopFilePath { @@ -28,7 +31,12 @@ function Get-DesktopFilePath { return Join-Path $desktopPath $FileName } -$OutputPath = Get-DesktopFilePath -FileName "AppLens_Results_$env:COMPUTERNAME.txt" +if ([string]::IsNullOrWhiteSpace($OutputPath)) { + $OutputPath = Get-DesktopFilePath -FileName "AppLens_Results_$($env:COMPUTERNAME)_$(Get-Date -Format 'yyyyMMdd-HHmmss-fff').txt" +} +if (Test-Path -LiteralPath $OutputPath) { + throw 'The report path already exists. Choose a new OutputPath to preserve previous evidence.' +} # Patterns for apps that should be filtered into the "Runtimes & Frameworks" section $RuntimePatterns = @( @@ -387,13 +395,116 @@ function Format-AppLine { return $line } +function Get-WorkstationSnapshot { + $snapshot = @{ Issues = @() } + $queries = [ordered]@{ + Win32_ComputerSystem = @('Manufacturer', 'Model') + Win32_OperatingSystem = @('Caption', 'Version', 'BuildNumber', 'OSArchitecture', 'TotalVisibleMemorySize', 'FreePhysicalMemory', 'LastBootUpTime') + Win32_Processor = @('Name', 'NumberOfCores', 'NumberOfLogicalProcessors') + Win32_VideoController = @('Name', 'DriverVersion') + Win32_LogicalDisk = @('DeviceID', 'FileSystem', 'Size', 'FreeSpace') + } + foreach ($className in $queries.Keys) { + $parameters = @{ + ClassName = $className + Property = $queries[$className] + OperationTimeoutSec = 5 + ErrorAction = 'Stop' + } + if ($className -eq 'Win32_LogicalDisk') { $parameters.Filter = 'DriveType = 3' } + try { + $snapshot[$className] = @(Get-CimInstance @parameters) + if ($snapshot[$className].Count -eq 0) { $snapshot.Issues += "${className}: Unavailable (no data returned)." } + } catch { + $snapshot[$className] = @() + $snapshot.Issues += "${className}: Unavailable (query failed or timed out)." + } + } + return $snapshot +} + +function Format-WorkstationSnapshot { + param([Parameter(Mandatory = $true)]$Snapshot) + + $lines = @('', '--- Workstation Summary ---') + $attention = @() + $system = $Snapshot.Win32_ComputerSystem | Select-Object -First 1 + $os = $Snapshot.Win32_OperatingSystem | Select-Object -First 1 + if ($system) { $lines += "Machine: $($system.Manufacturer) $($system.Model)" } + else { $lines += 'Machine: Unavailable' } + if ($os) { + $lines += "OS: $($os.Caption) $($os.OSArchitecture) (version $($os.Version), build $($os.BuildNumber))" + if ($os.LastBootUpTime) { + $uptime = (Get-Date) - $os.LastBootUpTime + $lines += "Uptime: $($uptime.Days)d $($uptime.Hours)h $($uptime.Minutes)m (since last Windows boot)" + } else { $lines += 'Uptime: Unavailable' } + } else { $lines += 'OS: Unavailable'; $lines += 'Uptime: Unavailable' } + $processors = @($Snapshot.Win32_Processor) + if ($processors.Count -gt 0) { + foreach ($cpu in $processors) { + $lines += "CPU: $($cpu.Name) | $($cpu.NumberOfCores) cores / $($cpu.NumberOfLogicalProcessors) logical processors" + } + } else { $lines += 'CPU: Unavailable' } + $gpus = @($Snapshot.Win32_VideoController) + if ($gpus.Count -gt 0) { + foreach ($gpu in $gpus) { $lines += "GPU: $($gpu.Name) | Driver: $($gpu.DriverVersion)" } + } else { $lines += 'GPU: Unavailable' } + + if ($os -and $os.TotalVisibleMemorySize -gt 0 -and $null -ne $os.FreePhysicalMemory -and + $os.FreePhysicalMemory -ge 0 -and $os.FreePhysicalMemory -le $os.TotalVisibleMemorySize) { + $usedMemory = $os.TotalVisibleMemorySize - $os.FreePhysicalMemory + $memoryPercent = 100.0 * $usedMemory / $os.TotalVisibleMemorySize + $lines += 'RAM: {0:N1} / {1:N1} GiB used ({2:N1}%); {3:N1} GiB available to Windows' -f + ($usedMemory / 1MB), ($os.TotalVisibleMemorySize / 1MB), $memoryPercent, ($os.FreePhysicalMemory / 1MB) + if ($memoryPercent -ge 85) { $attention += '- High RAM usage: {0:N1}% used at capture time (threshold: 85%).' -f $memoryPercent } + } else { $lines += 'RAM: Unavailable' } + + $lines += '', '--- Local Disk Utilization ---' + $lines += 'Drive | File system | Total GiB | Used GiB | Free GiB | Used % | Free %' + $disks = @($Snapshot.Win32_LogicalDisk | Sort-Object DeviceID) + if ($disks.Count -eq 0) { $lines += 'Unavailable (no local fixed-disk readings).' } + foreach ($disk in $disks) { + if ($disk.Size -le 0 -or $null -eq $disk.FreeSpace -or $disk.FreeSpace -lt 0 -or $disk.FreeSpace -gt $disk.Size) { + $lines += "$($disk.DeviceID) | Unavailable (capacity or free space not reported)." + continue + } + $used = $disk.Size - $disk.FreeSpace + $freePercent = 100.0 * $disk.FreeSpace / $disk.Size + $lines += '{0} | {1} | {2:N1} | {3:N1} | {4:N1} | {5:N1}% | {6:N1}%' -f + $disk.DeviceID, $disk.FileSystem, ($disk.Size / 1GB), ($used / 1GB), ($disk.FreeSpace / 1GB), (100 - $freePercent), $freePercent + if ($freePercent -lt 10) { + $attention += '- Low disk space on {0} - {1:N1} GiB free ({2:N1}%; threshold: below 10%).' -f + $disk.DeviceID, ($disk.FreeSpace / 1GB), $freePercent + } + } + $lines += 'Scope: mounted local fixed disks with drive letters. GiB = 1,073,741,824 bytes.' + + $lines += '', '--- Attention Items ---' + if ($attention.Count) { $lines += $attention } + else { $lines += 'No low-disk/high-RAM thresholds triggered in the available readings.' } + $lines += '', '--- Snapshot Collection Notes ---' + if ($Snapshot.Issues.Count) { $lines += $Snapshot.Issues } + else { $lines += 'All workstation probes returned data.' } + $lines += 'Point-in-time resource snapshot; no folder-size traversal or Tune runtime probes.' + return $lines +} + +function Save-ScanReport { + param([Parameter(Mandatory = $true)][string]$Path, [Parameter(Mandatory = $true)][string]$Text) + $Text | Out-File -LiteralPath $Path -Encoding UTF8 -NoClobber -ErrorAction Stop +} + # ── Main ─────────────────────────────────────────────────────────────────────── Write-Host "" Write-Host "AppLens - Pre-Audit App Scanner" -ForegroundColor Cyan -Write-Host "Scanning installed applications..." -ForegroundColor Gray +Write-Host "Capturing workstation resources and installed applications..." -ForegroundColor Gray Write-Host "" +$scanStarted = Get-Date +$scanTimer = [Diagnostics.Stopwatch]::StartNew() +$workstation = Get-WorkstationSnapshot + # Collect Win32 apps $win32Apps = Get-Win32Apps @@ -421,14 +532,22 @@ foreach ($app in $win32Apps) { } # Collect Store apps -$storeApps = Get-StoreApps +$storeApps = @(Get-StoreApps) +$scanTimer.Stop() # Build output $output = @() $output += "=== AppLens Scan Results ===" $output += "Computer: $env:COMPUTERNAME" $output += "User: $env:USERNAME" -$output += "Scan Date: $(Get-Date -Format 'yyyy-MM-dd')" +$output += "Scan Date: $($scanStarted.ToString('yyyy-MM-dd HH:mm:ss zzz'))" +$output += 'Mode: Audit (read-only)' +$output += 'Collection duration: {0:N1} seconds' -f $scanTimer.Elapsed.TotalSeconds +$output += Format-WorkstationSnapshot -Snapshot $workstation +$output += '' +$output += '--- App Inventory Summary ---' +$output += "Desktop entries: $($desktopApps.Count + $m365Apps.Count) | Store entries: $($storeApps.Count) | Runtimes/frameworks: $($runtimes.Count)" +$output += 'Scope: registered desktop apps and current-user Store apps after filtering; portable/unregistered apps may be absent.' $output += "" $output += "--- Desktop Applications ---" @@ -473,7 +592,7 @@ if ($runtimes.Count -eq 0) { # Write to file $outputText = $output -join "`r`n" -$outputText | Out-File -FilePath $OutputPath -Encoding UTF8 +Save-ScanReport -Path $OutputPath -Text $outputText # Display results Write-Host $outputText diff --git a/README.md b/README.md index 4abef3a..84c79ac 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@

- AppLens logo + AppLens logo

AppLens

@@ -18,6 +18,13 @@ AppLens is CSI's mobile-OS-inspired local control board. It gives a workstation one place to see apps, agents, evidence, proposed actions, and operator approvals. +The first Store release is now centered on a quick client-session workflow: +install AppLens, scan, review a sortable app table, approve supported uninstalls, +and verify the result. See [Product Vision](docs/AppLens-Product-Vision.md) for the +current product direction and proposed client design. The broader platform below +describes existing infrastructure and future possibilities, not requirements for +the first-release interface. + The platform is organized around apps/modules that publish state into CSI's proprietary blackboard layer: - **Scanner**: local workstation inventory and readiness evidence. @@ -26,7 +33,9 @@ The platform is organized around apps/modules that publish state into CSI's prop - **Planner**: operator planning for multi-step local work. - **Future modules**: Fleet, RAG, MCP, and Gov. -The current desktop app is the platform shell. It already hosts local scans, Tune diagnostics, dashboard read models, module status, exports, and blackboard-backed events. +The active desktop client runs the core inventory scan and report download. +Existing Tune diagnostics and the old window are preserved in +[future/AppLens-Tune](future/AppLens-Tune/README.md), outside the v1 build. ## Safety Model @@ -41,7 +50,11 @@ AppLens is local-first and operator-controlled: ## AppLens-desktop -AppLens-desktop is the WinUI 3 platform shell. It provides the local dashboard, machine summary, Scanner results, Tune diagnostics, module status, blackboard event views, and export options for JSON, Markdown, and local HTML reports. +AppLens is the WinUI 3 inventory client. It provides storage and device readings, +a searchable/sortable app table, confirmed Windows/vendor uninstall routes, +verification, local action history, and full JSON/Markdown/HTML downloads. +See the [uninstall route contract](docs/AppLens-Uninstall-Routes.md) and +[Store readiness](docs/Store-Readiness-Checklist.md) for verification limits. Tune actions are modeled as proposals, approvals, executions, and verification records. System-changing behavior must remain explicit, reversible where practical, and blackboard-recorded. @@ -59,7 +72,7 @@ Run locally: .\tools\Run-AppLensDesktop.ps1 ``` -Package smoke build: +Distribution candidate build (requires explicit authorization): ```powershell .\tools\Build-StoreCandidate.ps1 @@ -83,44 +96,71 @@ Double-click: ```text Run-AppLens.bat -Run-AppLens-Tune.bat +future\AppLens-Tune\Run-AppLens-Tune.bat ``` PowerShell: ```powershell powershell -ExecutionPolicy Bypass -File AppLens.ps1 -powershell -ExecutionPolicy Bypass -File AppLens-Tune.ps1 +powershell -ExecutionPolicy Bypass -File future\AppLens-Tune\AppLens-Tune.ps1 ``` ### macOS and Linux ```sh -chmod +x Run-AppLens.sh Run-AppLens-Tune.sh +chmod +x Run-AppLens.sh future/AppLens-Tune/Run-AppLens-Tune.sh ./Run-AppLens.sh -./Run-AppLens-Tune.sh +./future/AppLens-Tune/Run-AppLens-Tune.sh ``` Or run Python directly: ```sh python3 AppLens.py -python3 AppLens-Tune.py +python3 future/AppLens-Tune/AppLens-Tune.py ``` ## Outputs Script reports are written to the user's Desktop: -- `AppLens_Results_.txt` +- Windows Scanner: `AppLens_Results__.txt` +- macOS/Linux Scanner: `AppLens_Results_.txt` - `AppLens_Tune_Results_.txt` +The Windows initial scan includes machine/OS/CPU/GPU details, uptime, RAM usage, +total/used/free space and utilization for each local fixed disk, +low-disk/high-RAM flags, and the categorized app inventory. +Unavailable workstation readings are labeled explicitly. It uses lightweight +local queries without recursive folder scans or starting the Tune runtime probes. + +Windows scans preserve previous reports. An optional `-OutputPath` selects a new +report path; existing files are rejected. Script text reports contain local +computer/user identifiers; desktop-app export redaction is a separate feature. + +Run the Windows snapshot regression checks: + +```powershell +powershell -NoProfile -ExecutionPolicy Bypass -File tests\Script.Tests\Test-AppLensSnapshot.ps1 +``` + The desktop app exports: - JSON - Markdown - local HTML +After a scan, **Download report** (the download icon beside Scan this PC) saves the +selected Markdown, JSON or HTML report through the Windows picker, starting in +Downloads. Exports contain the full scan even when table filters hide rows. +The person can send that file for review; AppLens does not upload it. Personal +identifiers are redacted by default unless explicitly included. Alt+S starts a +scan and Alt+D downloads. See [client verification](docs/AppLens-Client-Verification.md) +and the [continuation handoff](docs/AppLens-v1-Handoff.md). +The [release validation review](docs/AppLens-Release-Validation.md) separates +completed checks from final installation, platform and Store work. + ## Repository Layout ```text @@ -133,4 +173,4 @@ assets/ Placeholder branding ## Project Status -AppLens is in preview. Scanner and Tune scripts are usable now. AppLens-desktop builds locally, has a package smoke build, and is being reframed as the CSI platform shell. Store submission still needs production branding, Partner Center identity, screenshots, a hosted privacy policy URL, and Windows App Certification Kit validation. +AppLens v1 is a local preview. The core client builds independently of the preserved Tune work. Store release still requires the remaining installed/clean-PC checks, owner-reviewed materials, Partner Center identity, published privacy/support URLs, and certification. Local builds do not establish Store availability. diff --git a/docs/AppLens-Client-Verification.md b/docs/AppLens-Client-Verification.md new file mode 100644 index 0000000..ff04706 --- /dev/null +++ b/docs/AppLens-Client-Verification.md @@ -0,0 +1,62 @@ +# AppLens client verification — COP-239 + +Verified locally on 2026-09-13, Windows 11 Home build 26200, x64. +This closes the client/table scope of COP-239. Final installed release acceptance +remains COP-241; this is not Store certification or a clean-PC result. + +Evidence root (local only, excluded from Git): +`artifacts/cop239-client-26922a8cb41d482db372f2590b9c386e/`. +These local artifacts may contain workstation details; they are not public Store screenshots. + +## Changes and observed results + +| Check | Result and evidence | +| --- | --- | +| Silver client, disk summary, table and secondary panels | Live scan displayed 433 entries, with 158 ordinary apps in the default view. Latest completion was 0.52 s on this developer PC, not a performance guarantee. See `final-client.png` and `zero-visible-before-export.png`. | +| Duplicate names, suites and unknown sizes | Real Copilot entries remained separate by installation/type/scope. Largest-first placed the 2.31 GiB desktop entry ahead of unknown Store sizes; the suite entry remained distinct. See `duplicate-names.png`, `largest-unknown-last.png`. Presentation tests cover stable ordering, both size directions and combined publisher/scope/type/removal filters without mutating inventory. | +| Keyboard navigation | Tab/Shift+Tab reached controls and row actions; sorting/scope selection worked by keyboard. Alt+S scanned; Alt+D opened the picker; Enter opened the owned fixture confirmation; Escape cancelled. Focused off-screen actions scrolled into view. See `keyboard-row-action.png`, `night-sky225-confirmation.png`, `keyboard-cancel-verification.json`. | +| Text scaling and resizing | At 225% text size, opening details originally consumed the table viewport. A bounded virtualized list and scrollable page now keep results and both panels reachable. Wrapped headers use the same column widths as rows. Live retest included 1280×880 and 960×760 windows, expanded details/history, horizontal and vertical scrolling. Before/after evidence: `text225-*.png`. | +| High contrast | Windows Night sky and Desert themes tested at 225%, including selection, focus, scrolling and cancellation. System contrast resources remained readable. See `night-sky225-*.png`, `desert225-selection.png`. | +| Accessible names | Live UI Automation originally exposed the class name for a row. Rows now expose app name, version, publisher, scope, type, size and status; action names also distinguish version/scope/type. A regression failed before the fix. See `final-accessibility-tree.txt` and the 12 passing presentation tests. Audio with an actual screen reader remains a release check. | +| Download and cancellation | Picker opens in the current user's Downloads folder. Escape retained results. Enter saved a new JSON report with zero visible rows; all 433 entries and seven actions remained in the report, matching the ledger, with user/computer identifiers redacted. See `picker-downloads-after-fix.png`, `picker-cancel-results-retained.png`, `report-saved-zero-visible.png`, `final-report-verification.json`. | +| Restoration and cleanup | Original Custom theme restored, high contrast off, text size 100%. The owned registry-only fixture was checked present after cancellation and then removed; it had no payload. No working app was removed during this review. See `display-restored.json`, `ui-fixture-cleanup.json`. | + +The picker uses the installed App SDK 1.8's +[SuggestedFolder](https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.windows.storage.pickers.filesavepicker.suggestedfolder?view=windows-app-sdk-1.8) +with [UserDataPaths.Downloads](https://learn.microsoft.com/en-us/uwp/api/windows.storage.userdatapaths.downloads?view=winrt-26100). +The location suggestion alone retained Windows' previously visited folder during +testing; the explicit known-folder path opened Downloads. No SDK upgrade was needed. + +## Build and report evidence + +- Final x64 and ARM64 desktop builds: zero warnings/errors. ARM64 was compiled, + not run on ARM64 hardware. +- Core tests: 94 passed, comprising 82 backend and 12 presentation tests. + Separate TRX files are in `final-tests/`; earlier red-test evidence remains in `tests/`. +- Saved report: `C:\Users\codyl\Downloads\AppLens-20260913-174908-731.json`. + Evidence copy: `client-export-zero-visible.json`. +- SHA-256: `97D83ADEEC9B505041910DECEFBE10F1C7DA9BA62D609F352948A2164044F4B4`. +- Seven recorded outcomes: four Removed, three Cancelled. The extra cancellation + came from this review's disposable fixture. Earlier records were not rewritten. +- Earlier COP-240 evidence covers real packaged Store/MSI/vendor flows, native + UAC denial/approval, independent absence verification and history reload. + +## Later computer-use checks — COP-241 + +Computer use stopped at the user's request after the checks above. Do not resume +desktop control until the user is ready. Do not repeat completed checks unless a +new package, changed behavior or a failure warrants it. + +1. On the final installed candidate, verify scan → filter → exact-target removal + → refresh → download/read report on a clean standard-user Windows PC, including + offline operation. Recheck Downloads there; the latest picker change was tested + in the unpackaged client, not a newly installed package. +2. Use an actual screen reader to check announcements, row/action names and modal + focus recovery. Recheck text/contrast/layout on the final package as needed. +3. Exercise remaining managed/protected, failed/slow uninstaller and app-closure + cases with disposable fixtures. Native administrator prompts require the user. +4. Run the claimed Windows 10 and ARM64 configurations on appropriate systems, + measure installation/launch/footprint, and perform final certification checks. + +See the [reviewed continuation handoff](AppLens-v1-Handoff.md) for release inputs, +authorization boundaries, commands and the complete next-step order. diff --git a/docs/AppLens-Platform-Scope.md b/docs/AppLens-Platform-Scope.md index cd0d635..8c21775 100644 --- a/docs/AppLens-Platform-Scope.md +++ b/docs/AppLens-Platform-Scope.md @@ -2,6 +2,16 @@ ## Position +The first Store release follows [Product Vision](AppLens-Product-Vision.md): quick +inventory, a sortable app table, explicit supported uninstall actions, and result +verification during a client screen-share session. The platform architecture +below supports that flow; its module catalog is not the first-release UI scope. + +The existing AppLens-Tune is intentionally deferred to `future/AppLens-Tune/`. +Core v1 must build and run independently of it; shared infrastructure needed by +inventory, uninstall, or export remains in the normal backend. The product vision +defines the separation-first delivery sequence and verification requirements. + AppLens is CSI's local control board for workstation apps and agents. It borrows from mobile operating systems: a shell hosts focused apps, each app declares capabilities, and shared services handle state, permissions, evidence, and handoffs. The differentiator is CSI's proprietary blackboard technology. Scanner, Tune, Planner, and future modules do not pass around ad hoc files or hidden state. They publish evidence, status, proposed actions, approvals, and verification records into a local blackboard that can be indexed, audited, redacted, and exported. @@ -10,7 +20,8 @@ The differentiator is CSI's proprietary blackboard technology. Scanner, Tune, Pl - **Platform shell**: WinUI desktop control board for local modules, operator decisions, and exports. - **Scanner**: local evidence collection for installed apps, runtime state, tooling, storage, and readiness. -- **Tune**: diagnostic plan, approval-gated action path, execution records, and verification. +- **AppLens-Tune (deferred)**: preserved deeper diagnostics and optimization work; + not part of the v1 launch, scan, uninstall, or export dependency path. - **Blackboard**: local append-only event layer backed by JSONL and SQLite indexing. - **Planner**: planning surface for multi-step work across local modules. - **Future modules**: Fleet, RAG, MCP, and Gov. @@ -41,4 +52,8 @@ Module detection and module execution are separate states. A module can be confi ## Distribution -Microsoft Store packaging remains a distribution track for the Windows shell. It is not the product strategy. Store readiness should prove that the shell is installable, transparent, local-first, and operator-controlled. +Microsoft Store installation is central to the first-release customer journey. +Store readiness must prove that the client is lightweight, installable, +transparent, local-first, and operator-controlled. Availability in the Store and +capability approval must be verified through Partner Center, not inferred from a +successful local package build. diff --git a/docs/AppLens-Privacy-Draft.md b/docs/AppLens-Privacy-Draft.md new file mode 100644 index 0000000..7a4e1fe --- /dev/null +++ b/docs/AppLens-Privacy-Draft.md @@ -0,0 +1,34 @@ +# AppLens privacy policy — publication draft + +AppLens collects information locally when you start a scan. This includes installed +app names, versions, publishers, installation identities and locations, reported +sizes, removal information, local disk capacity and usage, Windows/device details, +processor and graphics names, memory usage, uptime, computer name and Windows username. + +AppLens v1 does not collect top-process rankings or run the deferred AppLens-Tune +diagnostics. It does not include accounts, telemetry, automatic uploads, cloud +analysis, background monitoring, or automatic report sharing. + +Uninstall actions require your confirmation. Windows or the app vendor may request +additional approval. AppLens records the selected installation, mechanism, +timestamps, outcome, verification and observed disk readings in local action +history under the current user's AppLens application data. Closing AppLens before +completion can leave an unknown outcome; review it in Windows and run a fresh scan. +Uninstalling an app can delete that app's data. AppLens does not provide an undo +facility for third-party uninstalls. + +Reports are saved only when you choose a local destination. They contain the full +captured inventory and recorded actions, including entries hidden by display +filters. Computer/user identifiers and profile paths are redacted by default. +You can explicitly include personal identifiers. Redaction is not a guarantee +that a report contains no sensitive information; review it before sharing. +AppLens does not send the report to a consultant or AI service. Any sharing you +perform afterward is your choice and is subject to the recipient's practices. + +Local history and saved reports remain on your device until removed by you or by +Windows' applicable app-data handling. Exported files are separate from the app. +Windows, Microsoft Store and third-party uninstallers have their own policies. + +Before publication, the owner must add the verified publisher/legal identity, +contact channel, effective date, and any applicable jurisdiction-specific text. +This draft has not been published and is not a substitute for legal review. diff --git a/docs/AppLens-Product-Vision.md b/docs/AppLens-Product-Vision.md new file mode 100644 index 0000000..33207c4 --- /dev/null +++ b/docs/AppLens-Product-Vision.md @@ -0,0 +1,177 @@ +# AppLens v1: executable task list + +Build a lightweight Microsoft Store app for a guided screen-share session: +**scan -> review apps and storage -> approve removals -> download results for AI review.** + +## AppLens v1 implementation boundary + +- Keep C#/.NET and WinUI 3. Reuse the existing scanner, reports, and shared services. +- Use one scan record for the table and exports. Do not parse the PowerShell text + report. Preserve distinct installation identities, including duplicate app names. +- Aim for about one second to first useful results; measure it. Show partial results + and unavailable readings honestly. No fixed delay before enabling actions. +- Use a silver, restrained metallic client with crisp edges, matte-black type, + one main app table, and secondary device details/action history. +- Keep scans read-only and local. No accounts, telemetry, automatic uploads, + automatic remediation, forced deletion, or automatic restarts. +- Preserve existing AppLens-Tune in `future/AppLens-Tune/`; core v1 must have no + runtime or build dependency on it. Keep shared infrastructure in the backend. + Defer startup/service optimization, top-process rankings, deeper diagnostics, + and recursive app-folder sizing. Do not redesign Tune or move the inventory + scripts into a legacy folder. + +### Data and download requirements + +| Area | Required content | +| --- | --- | +| Summary | Disk total/used/free and percentages, app count, capture time, scan coverage | +| App table | Name, publisher/version, reported size, scope, app type, removal status, action | +| App details | Stable identity, size source, relevant install location, restriction evidence, reliable install/servicing date | +| Device details | Windows version, CPU/GPU, RAM capacity/utilization, uptime | +| Action history | Confirmed target, mechanism, timestamps, outcome, verification, observed disk change | + +Missing sizes display as **Unknown**, sort after known sizes, and never imply zero. +Reported size is not guaranteed recoverable space. Scope labels are **This user**, +**All users**, or **Unknown**; scope does not prove who installed an app. +Classify runtimes, updates, drivers, and protected components separately from +ordinary apps. Display groups are not uninstall targets; servicing dates are not +last-used dates. + +Keep a visible download icon labeled **Download report**. Save locally through the +Windows picker: Markdown by default, with existing JSON/HTML options retained. +Export the complete captured inventory despite display filters, including unknown +values and action outcomes. Redact personal identifiers/profile paths by default, +with explicit raw-detail opt-in. Export a consistent snapshot and protect existing +reports from silent overwrite. The person sends the file to the consultant. + +## Uninstall behavior and Microsoft requirements + +Support ordinary MSI, vendor-uninstaller, and eligible Store/MSIX apps, including +admin-required apps. Revalidate the exact local target, confirm the action, use +supported Windows/vendor mechanisms, and preserve UAC and organization controls. +Validate executable paths/arguments; never run commands from imported reports or +interpret arbitrary registry text through a shell. + +Show confirmed or possible administrator requirements, managed/protected status, +and unsupported routes truthfully. Enable a row only after its identity and route +are resolved and implemented. Explain relevant data-loss/restart requirements. +Offer cancellation only when supported; opening Windows Installed Apps is a +handoff, not successful removal. Verify removal and show observed disk change. + +Use these references during task 3 and recheck requirements for the release: +[Store policies](https://learn.microsoft.com/en-us/windows/apps/publish/store-policies), +[package removal](https://learn.microsoft.com/en-us/uwp/api/windows.management.deployment.packagemanager.removepackageasync?view=winrt-26100), +[capabilities](https://learn.microsoft.com/en-us/windows/apps/package-and-deploy/app-capability-declarations), +[packaging/process model](https://learn.microsoft.com/en-us/windows/apps/get-started/intro-pack-dep-proc), +[installer metadata](https://learn.microsoft.com/en-us/windows/win32/msi/uninstall-registry-key), +[Windows Settings](https://learn.microsoft.com/en-us/windows/apps/develop/launch/launch-settings). +Do not assume changing language grants permissions, add restricted capabilities +without establishing a need, or claim Store approval from local tests. + +## Ordered tasks for Linear + +Create **one issue per task below only when the user requests the Linear upload**. +Execute in order, with each issue depending on the previous one. One agent owns +the work; **no subagents**. Shared requirements above apply to every issue. + +### 1. Separate and preserve AppLens-Tune + +- [ ] Map core/shared/Tune dependencies before moving files. +- [ ] Move Tune-specific code, tests, and supporting docs into + `future/AppLens-Tune/`; update references and preserve shared services. +- [ ] Add a README with entry points, dependencies, verified/unfinished state, + reason for deferral, and resumption instructions. + +**Done when:** the core builds, launches, scans, and exports with Tune unavailable; +no background Tune work runs, and all relocated work is accounted for. + +**Start in:** `AuditService.cs`, `TuneCollector.cs`, `Models.cs`, desktop bindings, +reports, and project references. + +### 2. Connect the quick scan to the table and reports + +- [ ] Extend the shared scan record with the data requirements above. +- [ ] Collect app metadata and disk/device readings without deep diagnostics; + keep useful results if an optional reading fails. +- [ ] Bind a basic table and existing report writers to that record; keep the + download control, redaction, and capture state working. + +**Done when:** a native scan produces matching rows and saved reports; distinct +identities and unknown values survive; cancellation/partial results work; actual +first-results and completion timings are recorded. + +**Start in:** `Models.cs`, `InventoryCollector.cs`, `AuditService.cs`, +`ReportWriter.cs`, `RedactionService.cs`, and `MainWindow.xaml.cs`. + +### 3. Verify the Windows uninstall routes + +- [ ] Check the current manifest and Microsoft requirements for MSI, vendor-EXE, + and current-user MSIX removal. +- [ ] Use a small development-package test with disposable apps to establish + supported routes and administrator/UAC behavior before building the full UI. +- [ ] Record the chosen routes, evidence, restrictions, and required capabilities + for task 5. Resolve unsupported requirements before dependent work proceeds. + +**Done when:** task 5 has a concrete mechanism and evidence for each proposed route; +untested cases and any required external approval are explicit. + +**Start in:** `Package.appxmanifest`, `AppLens.Desktop.csproj`, existing action +services, and the Microsoft references above. Use an authorized test environment; +do not remove the user's working apps. + +### 4. Finish the client and results table + +- [ ] Apply the silver/metallic design, compact disk summary, main table, and + secondary device/action panels. +- [ ] Add search by app/publisher, name/size/publisher sorting, scope/type/removal + filters, supporting details, and clear scan/action states. +- [ ] Finish the download interaction and prepare the confirmation/status UI + using task 3 findings; keep unfinished removal actions disabled. + +**Done when:** duplicate names, suites, unknown sizes, and large inventories display +correctly; filtering leaves full exports intact; save/cancel, resizing, keyboard +navigation, text scaling, and high contrast work. + +**Start in:** `MainWindow.xaml`, `MainWindow.xaml.cs`, and presentation tests. + +### 5. Implement removals and update their results + +- [ ] Connect the verified routes to exact-target confirmation, appropriate + Windows approval, and local action recording. +- [ ] Handle denied approval, cancellation, restrictions, missing uninstallers, + failure, and restart-required results without breaking the scan. +- [ ] Verify removal, refresh disk readings, and update the row, action history, + and downloadable report from the same outcome. + +**Done when:** real disposable-app removals are verified; admin cases are exercised; +the UI and report agree on outcomes. Distinguish live tests from simulated cases. + +**Start in:** the shared action services/`BlackboardStore.cs`, desktop handlers, +and `ReportWriter.cs`; keep Tune dependencies excluded. + +### 6. Validate the complete app and prepare the Store release + +- [ ] Run the full relevant tests and the installed flow on a clean standard-user + Windows PC: scan -> filter -> uninstall -> verify -> download/read report. + Include failure states and confirm Tune independence. +- [ ] Measure launch/scan speed, package and installed size, prerequisites, and + supported architectures; fix failures and retest affected behavior. +- [ ] Prepare final identity/assets, screenshots, privacy/support URLs, capability + justification, and certification evidence using the Store readiness checklist. + +**Done when:** the customer flow has recorded evidence and release materials are +ready; unresolved requirements are listed. Distribution packaging, external +publication, and Store submission need their explicit authorization. Local tests +do not establish certification; Store installation is verified after publication. + +**Start in:** solution tests, desktop run/build guidance, and +[Store readiness checklist](Store-Readiness-Checklist.md). + +## Working rules + +- Run focused checks with each change; perform the comprehensive review in task 6. + Do not repeat the full release review after every task. +- When Linear work begins, record progress, decisions, and test evidence there; + keep this document as scope and acceptance criteria, not a duplicate status log. +- Resolve consequential uncertainty before relying on it. Do not expand scope, + silently drop required functionality, or request approval for every routine step. diff --git a/docs/AppLens-Release-Validation.md b/docs/AppLens-Release-Validation.md new file mode 100644 index 0000000..bcdeb47 --- /dev/null +++ b/docs/AppLens-Release-Validation.md @@ -0,0 +1,79 @@ +# AppLens release validation — COP-241 + +Reviewed 2026-09-14. This document separates completed source checks from the +remaining installed-app checks. Computer use remains paused. No new app was +installed, launched or uninstalled during this review; no display setting changed. + +## Completed without desktop control + +| Evidence | Result | +| --- | --- | +| Release builds | x64 and ARM64 compile with zero warnings/errors. Compilation alone does not validate ARM64 hardware. | +| Core tests | 94 pass: 82 backend, 12 presentation. Covers partial/cancelled scans, filters/identity, protected routes, literal uninstaller arguments, approval recording, changed-target rejection, independent removal verification, failure outcomes and history recovery. | +| Preserved Tune | 58 tests pass. All 24 preservation-manifest destinations exist; 18 hashes are unchanged and six have the documented separation adaptations. | +| Windows snapshot | All five script check groups pass, including unknown readings and refusal to overwrite evidence. | +| Dependencies | NuGet reports no known vulnerabilities for the four core solution projects at review time. | +| Read-only backend smoke | 433 entries, 198 reported sizes, one disk, complete coverage; first results 0.523 s and completion 0.524 s on the developer PC. JSON/Markdown/HTML written locally. This is not an offline or clean-PC result and does not reload desktop action history. | +| Package input review | Evaluated desktop content/project references exclude deferred Tune, removal probes and local reports. Only runFullTrust is declared. | +| Runtime configuration regression | Initially failed because the Store settings required a separate .NET installation. Packaged builds now bundle .NET while using Store-managed Windows App SDK framework dependencies. The evaluated x64/ARM64 checks pass; actual installed delivery remains unverified. | +| Git destination | Main product repository `https://github.com/CSI-Platform/AppLens.git`; existing branch `codex/applens-v1-quick-client`. No AppLens-SSH/AppLens-LLM repository is involved. | + +Local evidence is under `artifacts/cop241-source-20260914-1e406cb1/`. +Logs, scan reports, screenshots, runtime payloads and other machine evidence stay +out of Git. See [client verification](AppLens-Client-Verification.md) for the +earlier live UI evidence and the [handoff](AppLens-v1-Handoff.md) for continuation. + +The new `tests/Script.Tests/Test-StoreConfiguration.ps1` evaluates actual MSBuild +properties without building a package. It runs in CI and before the separately +authorized Store-candidate builder. The builder explicitly starts from x64; +the source still lists both architectures until launch scope is decided. + +## Remaining hands-on checks for owner review + +These are recommendations for launch confidence, not claims that Microsoft +mandates this exact internal test list. Do not silently mark a skipped test passed. + +| Check | Recommendation | Smallest useful pass / what can be reduced | +| --- | --- | --- | +| Clean-PC installed customer flow | Keep before launch | One clean standard-user Windows PC or VM: install, launch, scan, filter, remove an owned fixture, verify, save/read a report, close/reopen. Confirm no manual .NET setup. Include AppLens's own Windows uninstall and reinstall behavior. | +| Offline operation and final picker | Combine with the clean-PC pass | Disconnect networking in the test environment after installation; scan/export. Check Downloads and cancel/save in the final package. No separate repeated desktop session needed. | +| Remaining uninstaller edge cases | Keep a focused pass | One slow/failed disposable uninstaller, close/reopen mid-action, and one policy-denied case in an appropriate test environment. Confirm an unknown/pending outcome is never reported as Removed. Simulations already pass; actual vendor/OS behavior is the remaining evidence. | +| Administrator prompts | Reuse completed COP-240 evidence unless package behavior changes | Native UAC denial and approval already passed on the developer PC. A fresh standard-user credential handoff can be folded into the clean-PC test. The user must handle any prompt. | +| Actual screen reader | Keep a short pass | Scan/status announcements, one row and its action, confirmation/cancel and focus recovery. UI Automation names were checked; spoken behavior was not. | +| Full keyboard/text/contrast matrix again | Defer the full repeat | The 100%/225%, Night sky/Desert, resize and keyboard checks passed in COP-239. Recheck only affected behavior or one final-package spot check if unchanged. | +| Windows 10 and ARM64 | Conditional on launch support | Test on those systems if they remain supported at launch. A Windows 11 x64-only launch could defer them, but requires an explicit scope decision and matching package/listing changes. Source currently retains both. | +| Windows App Certification Kit | Keep for final candidate | Although command-line driven, WACK needs an active user session and administrator context and may launch the app. Schedule it with the hands-on work. No final-package WACK result exists yet. | +| Store screenshots | Owner review; combine with final client session | Capture only the needed listing views using non-private data. Existing internal screenshots should not be published automatically. | +| Store download/install | After authorized publication | Confirm the real customer delivery path. This cannot be honestly marked complete before the app is published. | + +The lowest-effort plan is one coordinated final-package session on a clean test +environment, plus any additional architecture the owner elects to support. +Do not change launch support or waive a recorded gap without the owner's decision. + +## Microsoft requirements reviewed + +Official sources checked on 2026-09-14; certification remains Microsoft's decision. + +| Source | AppLens implication | +| --- | --- | +| [Store policies](https://learn.microsoft.com/windows/apps/publish/store-policies), 10.1, 10.2.7–8, 10.4 | Describe capabilities and limitations accurately, use supported mechanisms with consent, remain responsive, and support the advertised devices. AppLens itself must be removable. | +| Same policies, 10.5.1 and 10.6 | A Win32/Desktop Bridge app needs a privacy policy even with local-only processing. Declare capabilities tied to real functionality and preserve Windows permission checks. | +| [Capability declarations](https://learn.microsoft.com/windows/apps/package-and-deploy/app-capability-declarations) | Medium-integrity packaged desktop apps declare runFullTrust. It does not turn the process into an administrator or waive removal restrictions. | +| [Self-contained deployment](https://learn.microsoft.com/windows/apps/package-and-deploy/self-contained-deploy/deploy-self-contained-apps) and [deployment overview](https://learn.microsoft.com/windows/apps/package-and-deploy/deploy-overview) | .NET and Windows App SDK deployment settings are separate. Bundling .NET avoids a manual .NET prerequisite; Store-managed Windows App SDK frameworks remain a dependency whose installation must be tested. Ship .NET servicing fixes through app updates. | +| [Windows App Certification Kit](https://learn.microsoft.com/windows/uwp/debug-test-perf/windows-app-certification-kit) | Command-line execution still needs an active user session and admin context. A development build or local test pass is not certification. | + +## Prepared materials and remaining owner inputs + +Listing, privacy and support drafts already exist. The listing now includes a +reviewer walkthrough and the supported removal mechanisms; the privacy draft +describes local inventory/history, redaction and voluntary sharing. Before release, +the owner must supply/approve: + +- Reserved AppLens name and exact Partner Center package/publisher identity. +- Final launch platforms, pricing/category/markets and questionnaire answers. +- Publisher/contact details and the destination for public privacy/support pages. +- Artwork and screenshots, followed by distribution/submission authorization. + +These are product/account decisions, not additional app feature development. +No hosting changes, distribution package, public report upload, final identity, +certification result or Store publication is implied by the GitHub source push. diff --git a/docs/AppLens-Scanner.md b/docs/AppLens-Scanner.md index 0f93b62..ca9e43d 100644 --- a/docs/AppLens-Scanner.md +++ b/docs/AppLens-Scanner.md @@ -2,7 +2,12 @@ ## Responsibility -Scanner captures workstation evidence for CSI reviews. It answers what is installed, what is running, what starts automatically, what tooling is present, where storage is concentrated, and where local development work lives. +The AppLens v1 scanner captures installed-app inventory, reported sizes, disk +utilization, removal information, and secondary device details for CSI reviews. +Startup, services, performance analysis, local AI/tooling, and repo diagnostics +belong to the existing AppLens-Tune, which is intentionally deferred. The core +scanner must operate independently of that feature; see the +[v1 implementation boundary](AppLens-Product-Vision.md#applens-v1-implementation-boundary). ## Boundary @@ -11,9 +16,19 @@ Scanner is evidence-only. It does not tune the machine, uninstall software, chan ## Current Status - Cross-platform scripts exist for Windows, macOS, and Linux. +- The Windows initial script includes hardware/OS, uptime, RAM utilization, + capacity/used/free space for local fixed disks and app counts. + Attention flags use below 10% disk free and at least 85% RAM used; these are + snapshot thresholds, not a hardware health diagnosis. +- Each Windows script run writes a timestamped report and refuses to overwrite + an existing output path. Failed/empty workstation probes are labeled unavailable. + The initial scan does not recurse through folders or invoke Tune runtime probes. +- The initial Windows script does not enumerate or rank running processes. The + proposed client scan/table contract is in [Product Vision](AppLens-Product-Vision.md). - The desktop shell includes native C# collectors. - Reports export to JSON, Markdown, local HTML, and script text output. -- Default exports redact user, machine, and profile-path details. +- Default desktop-app exports redact user, machine, and profile-path details; + standalone script text reports retain local identifiers. - Scan completion can be represented as blackboard evidence. ## Next Moves diff --git a/docs/AppLens-Support-Draft.md b/docs/AppLens-Support-Draft.md new file mode 100644 index 0000000..d941ac3 --- /dev/null +++ b/docs/AppLens-Support-Draft.md @@ -0,0 +1,37 @@ +# AppLens support — publication draft + +AppLens v1 is a local Windows app for inventory, storage review, supported removal +actions and report download. It is not a background optimizer. + +## Using AppLens +1. Select Scan this PC. +2. Review storage and the app table. Search or filter the rows as needed. +3. Review the exact app and scope before confirming an uninstall. Complete any + Windows or vendor approval dialog. +4. Check action history and refresh results. A Settings handoff or process exit + alone is not proof of removal. +5. Select Download report and choose Markdown, JSON or HTML. The complete capture + is included even when table filters are active. + +Unknown size means the installer did not report a usable value. It does not mean +zero space. Observed disk changes can include other activity. + +If a scan is partial, inspect the coverage details in the client/report and retry. +If Windows denies removal, contact the device's administrator. AppLens does not +override management or protected-component restrictions. Do not manually delete +application directories as a substitute for the supported uninstaller. + +Before sending a report for help, review it for private information. Leave +personal identifiers disabled unless they are specifically needed. + +## Removing AppLens +Close AppLens, open Windows Settings → Apps → Installed apps, find AppLens, and +choose Uninstall. AppLens does not uninstall itself from its running table. +Reports you saved elsewhere are separate files; remove them yourself if no +longer needed. Final-package local-history retention must be confirmed before +publishing detailed retention/removal promises. + +## Publication requirements +The owner must provide and verify a real support contact and hosted URL before +Store submission. Include the app version, Windows version, relevant error and +the steps that led to it; do not send passwords or other secrets. diff --git a/docs/AppLens-Tune-App.md b/docs/AppLens-Tune-App.md index b7872db..c74af47 100644 --- a/docs/AppLens-Tune-App.md +++ b/docs/AppLens-Tune-App.md @@ -1,5 +1,19 @@ # AppLens Tune +## Release Boundary + +AppLens-Tune refers to the existing scripts and native Tune functionality. It is +intentionally deferred until the core AppLens v1 flow is complete. The agreed +implementation plan separates Tune-specific code into `future/AppLens-Tune/`, +preserves relevant tests/docs and resumption instructions, and removes its +dependencies from core launch, scan, uninstall, and export. Shared infrastructure +needed by v1 stays in the normal backend. See +[Product Vision](AppLens-Product-Vision.md#applens-v1-implementation-boundary). + +The implementation has been relocated. See the +[preservation and resumption README](../future/AppLens-Tune/README.md). +Existing behavior below describes that deferred work, not the active v1 client. + ## Responsibility Tune turns workstation evidence into a prioritized plan. It identifies startup load, service noise, storage hotspots, repo placement risk, local AI readiness, and developer tooling issues. @@ -16,7 +30,11 @@ Tune can propose work. Execution must remain approval-gated, recorded, and rever - The action executor remains the low-level runtime. - The platform loop is the intended path for approval-gated execution. -## Next Moves +## When AppLens-Tune Development Resumes + +Resume only after core v1 is complete, using the deferred implementation's README +and verification evidence to establish its actual state. Do not treat these +items as first-release AppLens requirements. - Route desktop Tune execution through the platform loop. - Record every proposed, approved, executed, blocked, failed, or verified action in the blackboard. diff --git a/docs/AppLens-Uninstall-Routes.md b/docs/AppLens-Uninstall-Routes.md new file mode 100644 index 0000000..9efacc1 --- /dev/null +++ b/docs/AppLens-Uninstall-Routes.md @@ -0,0 +1,61 @@ +# AppLens v1 uninstall routes + +The core remains a packaged WinUI 3 desktop application at medium integrity with +`runFullTrust`. It does not elevate itself or add `packageManagement` or +`allowElevation`. A language rewrite would not change Windows permissions. + +## Mechanisms + +| Target | Mechanism | Boundary | +| --- | --- | --- | +| MSI | Windows System32 msiexec.exe /x with a validated product GUID, interactive UI and /norestart | Revalidate registry identity and product registration; preserve Windows approval. Explicit administrator handoff launches Windows Installer, not an elevated AppLens. | +| Vendor app | Registered, validated absolute local EXE path and arguments | No shell interpretation, PATH search, script hosts, arbitrary DLL execution, quiet-string substitution, or inferred switches. Ambiguous/missing paths use Windows Installed Apps. | +| Current-user MSIX | PackageManager.RemovePackageAsync(exact PackageFullName) | Revalidate current-user identity and exclude frameworks/resources/system packages and AppLens itself. No all-user removal. Cannot cancel once started; Windows can close the target app and remove its local data. | +| Unsupported/restricted | Explain the evidence; offer Windows Installed Apps where appropriate | A Settings handoff is not a successful uninstall. Never override NoRemove, management policy, protected components, or UAC. | + +Registry machine scope alone does not establish an administrator requirement. +MSI registrations can appear under HKLM even for a current-user installation. +Use MsiEnumProductsEx with the current-user/machine contexts to resolve MSI scope; +ambiguous or unavailable contexts hand off to Windows. Multiple contexts for one +product GUID are not safe to select through a bare msiexec /x GUID command. +Show “May require administrator approval” unless stronger evidence exists. +NoRemove is installer restriction evidence, not proof of organization management. +MSI exit 1602 and UAC error 1223 are cancellation/denial; 3010 means restart +required, not permission to restart. Verify installation identity after execution; +a process exit alone does not prove removal. Record observed disk change with +capture times; other activity and shared data prevent exact attribution. + +## Development evidence, 2026-09-13 + +Generated, disposable fixtures only. Windows 11 Home build 26200; ordinary +unelevated caller (`Administrator=false`). Both test MSIX packages declared only +runFullTrust and used different publishers. Windows approved installation of the +unsigned development packages; no certificate trust or Developer Mode change. + +Evidence directory: `artifacts/removal-preflight-203d4975e60841d4a10834aeb0e0ee35/`. +The installation plan records package hashes and exact identities. Results are in +`fixtures/results.json`; setup and MSI logs preserve observed outcomes. + +- Current-user different-publisher MSIX: API completed, exact package absent. +- Vendor EXE child: exit 0, disposable registration absent. +- Per-user MSI: installation state 5, removal exit 0, state -1 afterward. +- Explicit runas handoff to Windows Installer: exit 0, MSI state -1 afterward. +- Separate unpackaged fixture validation: install/remove exit 0, marker absent. + +This establishes route feasibility, not arbitrary vendor compatibility, managed +device permission, all-user MSI behavior, denied-UAC behavior, Windows 10 +compatibility, or Store approval. Exercise these cases in task 5/6 and distinguish +live evidence from simulations. The test package is not a distribution artifact. + +## Microsoft references checked + +- [Package removal requirements and current-user behavior](https://learn.microsoft.com/en-us/uwp/api/windows.management.deployment.packagemanager.removepackageasync?view=winrt-26100) +- [Capabilities, including runFullTrust and allowElevation](https://learn.microsoft.com/windows/apps/package-and-deploy/app-capability-declarations) +- [ShellExecute runas and Windows approval](https://learn.microsoft.com/windows/win32/shell/launch) +- [Windows Installer command line](https://learn.microsoft.com/windows/win32/msi/command-line-options) +- [Microsoft Store policies](https://learn.microsoft.com/windows/apps/publish/store-policies) +- [Unsigned Windows 11 development packages](https://learn.microsoft.com/windows/msix/package/unsigned-package) + +Store review must accurately describe removal, data loss, administrator approval, +local reports and their privacy controls, and justify runFullTrust. Local API +success does not grant certification or permission to bypass restrictions. diff --git a/docs/AppLens-v1-Handoff.md b/docs/AppLens-v1-Handoff.md new file mode 100644 index 0000000..edba3dd --- /dev/null +++ b/docs/AppLens-v1-Handoff.md @@ -0,0 +1,177 @@ +# AppLens v1 handoff to COP-241 — updated 2026-09-14 + +## Start here + +Continue in this existing worktree: +`C:\Users\codyl\Desktop\csiOS\Projects\.worktrees\AppLens\codex-applens-v1-quick-client` + +Branch: `codex/applens-v1-quick-client`, based on `33be555`. The user authorized +commit and push on 2026-09-14, specifically to `CSI-Platform/AppLens`. Check the +branch log/upstream for the saved revision and `git status` for any later edits. +No merge, distribution package or Store publication is authorized by that push. +The original AppLens checkout and its 13 pre-existing changed/untracked +files were preserved and carried into this worktree before implementation. +Do not switch to the original checkout or discard its work. Use one agent; +no subagents. Read this worktree's AGENTS.md before continuing. + +[Linear project](https://linear.app/csi-platform/project/applens-platform-final-push-bda8c2d44ddf) +· [Approved six-task plan](https://linear.app/csi-platform/document/applens-v1-approved-six-task-delivery-plan-fafa6b12136a). +COP-236/237/238/239/240 are Done; COP-241 remains In Progress. + +The 2026-09-14 source/release review is complete without desktop control: +[release validation and remaining hands-on decisions](AppLens-Release-Validation.md). +Fresh core/Tune tests, x64/ARM64 builds, dependency and snapshot checks passed. +Store settings now bundle .NET; a regression checks the evaluated release +properties without generating a package. Store reviewer instructions are drafted. +Evidence: `artifacts/cop241-source-20260914-1e406cb1/` (local, not pushed). +The fresh backend smoke had 433 entries and complete coverage at ~0.52 seconds. +It writes a new scan and does not reload desktop action history; retain the +earlier seven-action UI export as that evidence. + +No launch-scope reduction has been approved. Windows 11 x64-only was offered as +an option to defer Windows 10/ARM64 hardware checks; source currently retains both +architectures and its existing minimum OS. Ask/verify the owner's decision before +changing release targets. Do not silently waive any remaining checks. + +**Computer use is paused at the user's request.** Original Custom theme and +100% text size were restored; high contrast is off. No approval prompt is pending. +Do documentation/source work freely within scope, but arrange a suitable time +before resuming AppLens/Windows desktop control. Native UAC must be approved by +the user; their being away is not approval to bypass it. + +## Product and completed implementation + +AppLens v1 is the local C#/.NET 10 WinUI client: fast inventory → disk/app table +→ exact-target approved removal → verification → local report download for AI +review. Silver/metallic visual design, no accounts/telemetry/upload or automatic +remediation. Reported app size is an estimate; disk deltas are observations, +not guaranteed space recovered from an app. + +Tune-specific code/scripts/tests/docs are preserved in `future/AppLens-Tune/` +with a move-time hash manifest and README. Core build/launch/scan/export were +exercised with that directory unavailable. Shared evidence contracts remain in +the backend; core `InventorySnapshot` and reports contain no Tune diagnostics. + +The table preserves installation identities, searches names/publishers, sorts +names/publishers/numeric sizes, and filters scope/type/removal route. Unknown +sizes sort last. Ordinary apps are the default; components remain available. +MSI scope comes from Windows Installer context, not HKLM alone. Details, disk +readings, status, history and JSON/Markdown/HTML reports use the shared scan data. +Filters do not truncate exports; personal identifiers are redacted by default. + +Removal uses conservative vendor-EXE parsing, typed MSI GUID commands with +/norestart, current-user MSIX, revalidation and single-use confirmation tokens, +Windows approval, independent presence checks and persistent action outcomes. +Ambiguous routes open Windows for review; protected components/self-removal are +blocked. Never execute commands imported from a report. + +COP-239's final fixes keep the virtualized list visible when large text and open +panels need page scrolling, align wrapped table headers/rows, expose meaningful +row/action accessibility names, and start the save picker in Downloads using the +current user's known-folder path. No framework/language rewrite or SDK upgrade. + +## Verification to retain + +[Client verification](AppLens-Client-Verification.md) maps each COP-239 requirement +to local evidence and lists the later computer-use checks. + +- Final x64 and ARM64 desktop builds succeeded with zero warnings/errors. + ARM64 cross-compilation is not ARM64 runtime verification. +- Latest core run: **94 passed** (82 backend, 12 presentation). TRXs are under + `artifacts/cop239-client-26922a8cb41d482db372f2590b9c386e/final-tests/`. +- Live Windows 11 x64 client: 433 inventory entries, 158 ordinary apps; latest + complete scan 0.52 s on this developer PC. No clean-PC timing guarantee. +- Keyboard navigation, real duplicate names/suite entries, unknown-size ordering, + 1280×880/960×760 layouts, 100%/225% text, Night sky/Desert high contrast, + UI Automation names, confirmation cancellation and native save/cancel passed. +- Latest zero-visible-row JSON export contains all 433 entries and seven actions + (four Removed, three Cancelled), matching the ledger with identifiers redacted. + See `final-report-verification.json` and `client-export-zero-visible.json` in + that same artifact directory. Original report remains in Downloads as + `AppLens-20260913-174908-731.json`; its hash is recorded in the verification file. +- Original display settings and owned registry-fixture cleanup are documented in + `display-restored.json` and `ui-fixture-cleanup.json`. No working app was removed + in COP-239. The extra fixture cancellation is intentionally kept in the ledger. +- Earlier validation: 58 preserved Tune tests, five Windows snapshot check groups, + no known NuGet vulnerabilities reported, and physical Tune-independence checks. + These are earlier evidence, not fresh release/certification results. + +COP-240 evidence is preserved under +`artifacts/cop240-live-6e40495c2ab845f89db8f4373f6ef81b/`: + +- The initially installed WinUI wrapper failed to launch because its resource + index was absent/wrongly identified. `Build-DevelopmentProbe.ps1` now indexes + compiled XAML for the test package identity. The resource regression failed + against the original payload and passed for corrected packages. +- Corrected packaged client launched unelevated from WindowsApps with only + runFullTrust. Real Store confirmation cancellation/approval and all-user MSI + native UAC denial/approval were independently verified. Denial kept the fixture; + approval removed it and refreshed table/disk/history. MSI/vendor tests also passed. +- Report verification found and fixed history reload choosing an approval from a + newest-first query. RemovalService now prioritizes the recorded completion; + the BlackboardStore regression failed before the fix. That run had 93 tests; + the additional COP-239 accessible-name test brings the current total to 94. +- Final development plan: + `artifacts/removal-preflight-644303be956d47be8208d88d1bdedecb/installation-plan.json`. + The package was installed/tested and then removed. All six owned package + identities and the all-user MSI were verified absent during cleanup. No owned + client process remained. The six-action report in COP-240 is historical; + COP-239's seven-action report is newer. Do not rewrite either or the ledger. +- Use `machine-fixture-plan-verified.json` for the generated MSI hash; its earlier + incomplete record hit a COM file lock. Keep failed/superseded raw artifacts. + +## COP-241: short execution order + +1. Read this handoff, release/client verification and Store checklist; inspect + the branch/status. Reuse completed evidence, and rerun checks only for a changed build, + changed behavior or an unresolved failure. Review final source/package choices. +2. When desktop control is available, validate a final installed candidate on a + clean standard-user PC: offline scan → filter → disposable uninstall → verify + → download/read report. Recheck Downloads in that package: the latest picker + fix was verified in the unpackaged client. Check actual screen-reader audio + and modal focus recovery; cover remaining managed/protected, failed/slow + uninstallers and app closure mid-action with disposable fixtures. +3. Verify claimed Windows 10 and ARM64 runtime configurations on appropriate + systems. Measure launch/first-results/completion, download size, installed + footprint and prerequisites for the actual distribution. Earlier 86.89 MiB + compressed / ~217.49 MiB payload figures describe a development package only. +4. Finish owner inputs: Partner Center name/publisher/identity, artwork and private- + data-free screenshots, contact and real privacy/support URLs. Drafts exist; + `CSI.AppLensDesktop` / `CN=CSI` is still a placeholder. SQLite bundle is 2.1.13 + (observed native SQLite 3.53.3). Recheck current Microsoft policies when preparing + release. Obtain explicit distribution/hosting/submission authorization before + those actions, then run WACK on the final candidate and record its result. + Store download/install is verified only after authorized publication. + +Do not mark COP-241 Done based on local builds. WACK exists on this machine but +has not been run against a final package. No clean-PC, Windows 10 or ARM64 live +result, final prerequisite/footprint measurement or Store certification is claimed. + +## Commands and references + +Run from the worktree above: + +```powershell +dotnet restore AppLensDesktop.sln +dotnet build AppLensDesktop.sln -c Release +dotnet test AppLensDesktop.sln -c Release --no-build +dotnet build src/AppLens.Desktop/AppLens.Desktop.csproj -c Release -p:Platform=ARM64 +powershell -NoProfile -ExecutionPolicy Bypass -File tests/Script.Tests/Test-StoreConfiguration.ps1 +``` + +To review that exact x64 Release build when desktop control resumes: + +```powershell +& .\src\AppLens.Desktop\bin\x64\Release\net10.0-windows10.0.19041.0\win-x64\AppLens.Desktop.exe +``` + +`Run-AppLensDesktop.ps1` launches Debug, which can be stale unless rebuilt. +Use a unique test-results directory/logger filename; do not overwrite earlier TRXs. +Builds do not scan the PC; `tools/AppLens.Smoke` explicitly scans and writes evidence. +Development-package instructions: [RemovalProbe README](../tools/AppLens.RemovalProbe/README.md). +`Build-StoreCandidate.ps1` requires separate distribution authorization. + +[Build and keyboard guidance](AppLensDesktop-Build.md) · +[Uninstall routes](AppLens-Uninstall-Routes.md) · +[Store checklist](Store-Readiness-Checklist.md) · +[Product scope](AppLens-Product-Vision.md). diff --git a/docs/AppLensDesktop-Build.md b/docs/AppLensDesktop-Build.md index ad26458..b3b260f 100644 --- a/docs/AppLensDesktop-Build.md +++ b/docs/AppLensDesktop-Build.md @@ -1,42 +1,65 @@ -# AppLens-desktop Build Notes +# AppLens desktop build -AppLens-desktop is the Windows platform shell for AppLens. It is a packaged WinUI 3 / Windows App SDK desktop app with a native C# backend, local Scanner/Tune collectors, module status, blackboard records, and export surfaces. +The active WinUI 3 client scans installed apps, disks and basic device information, +presents a sortable table, supports confirmed removal routes, and saves reports +locally. It has no build/runtime dependency on future/AppLens-Tune. -## Requirements - -- Windows 10/11 build 19041 or later. -- .NET SDK 10. -- Visual Studio 2022 with Windows App SDK / MSIX packaging tooling for Store packaging workflows. - -The backend and tests can build with the .NET SDK alone. Store packaging may require Visual Studio or Windows SDK tooling on the build machine. - -## Build +## Build and run +Windows build 19041+ and .NET 10 SDK are required for development. WinUI/MSIX +builds also require compatible Windows SDK tooling. The source project declares +x64 and ARM64; validate each runtime on its corresponding hardware before release. ```powershell dotnet restore AppLensDesktop.sln -dotnet build AppLensDesktop.sln -dotnet test AppLensDesktop.sln +dotnet build AppLensDesktop.sln -c Release +dotnet test AppLensDesktop.sln -c Release --no-build +& .\src\AppLens.Desktop\bin\x64\Release\net10.0-windows10.0.19041.0\win-x64\AppLens.Desktop.exe ``` -## Package Smoke Build +Build the solution, or specify -p:Platform=x64 when building the desktop project +directly. The solution's x64 executable is under +src/AppLens.Desktop/bin/x64/Release/net10.0-windows10.0.19041.0/win-x64/. +A direct project build without Platform can use a different output directory. +Run-AppLensDesktop.ps1 starts the Debug build, creating it only if absent; rebuild +Debug explicitly before using that launcher to review source changes. +## Using the client +Alt+S starts a scan; Alt+D opens Download report after completion. Tab/Shift+Tab +move through controls and row actions. Choose Markdown, JSON or HTML before +downloading. The Windows picker starts in Downloads; choose another folder if +needed. Cancelling keeps the results. Exports include the complete scan even when +filters hide rows, and personal identifiers are redacted by default. + +At smaller window sizes or larger Windows text sizes, scroll the table +horizontally and the page vertically to reach all columns and expanded panels. +See [client verification](AppLens-Client-Verification.md) for observed coverage and +the [continuation handoff](AppLens-v1-Handoff.md) for remaining release work. + +## Focused verification ```powershell -dotnet publish src\AppLens.Desktop\AppLens.Desktop.csproj ` - -c Release ` - -p:GenerateAppxPackageOnBuild=true ` - -p:AppxPackageSigningEnabled=false +powershell -NoProfile -ExecutionPolicy Bypass -File tests\Script.Tests\Test-AppLensSnapshot.ps1 +powershell -NoProfile -ExecutionPolicy Bypass -File tests\Script.Tests\Test-StoreConfiguration.ps1 +dotnet test future\AppLens-Tune\tests\AppLens.Tune.Tests.csproj -c Release +dotnet run --project tools\AppLens.Smoke\AppLens.Smoke.csproj -c Release +dotnet list AppLensDesktop.sln package --vulnerable --include-transitive ``` -The project is configured for MSIX tooling, Windows 10/11 19041+, and app version `0.1.0.0`. Store submission should use Partner Center-managed signing for the final package. +The smoke command explicitly runs a read-only scan and writes a new evidence +directory. Normal builds do not scan the workstation. Preserved Tune tests run +separately and are not part of the core solution. + +## Development packages and release +Store build settings bundle the .NET runtime and use Store-managed Windows App +SDK framework dependencies. Development builds have separate settings; neither +their size nor this configuration check proves a clean-PC Store installation. +See [release validation](AppLens-Release-Validation.md) for the configuration +regression and remaining hands-on acceptance checks. -## Packaging Guardrails +[Removal probe instructions](../tools/AppLens.RemovalProbe/README.md) describe +disposable, uniquely identified Windows 11 unsigned test packages. Their install +needs native Windows administrator approval. They neither change certificate +trust nor enable Developer Mode. They are not distribution packages. -- Local-first evidence collection. -- No telemetry or cloud upload by default. -- Exports are user-triggered. -- System-changing Tune actions must be explicit, approved, and blackboard-recorded. -- Admin-required actions must stay visibly separate from standard-user actions. -- The baseline scan should not shell out to PowerShell. -- No telemetry or cloud upload. -- Exports are user-triggered. -- Baseline scan does not shell out to PowerShell. +The existing Build-StoreCandidate script is for an explicitly authorized +distribution preparation run. It is not proof of WACK/Store certification or a +clean-PC install. See [Store readiness](Store-Readiness-Checklist.md). diff --git a/docs/Store-Listing-Draft.md b/docs/Store-Listing-Draft.md index f74bad0..601dd44 100644 --- a/docs/Store-Listing-Draft.md +++ b/docs/Store-Listing-Draft.md @@ -1,56 +1,84 @@ -# Microsoft Store Listing Draft +# Microsoft Store listing draft -## App Name +Publication draft; no Store submission has been made. -AppLens-desktop +## App name +AppLens. Final name reservation and publisher identity must come from Partner Center. -## Short Description - -Local control board for workstation inventory, diagnostics, module status, and operator-controlled actions. +## Short description +Review installed apps and disk usage, approve supported uninstalls, and download a local report. ## Description - -AppLens-desktop is CSI's local control board for understanding and managing a Windows workstation before workflow, automation, or AI-readiness work begins. - -The app scans locally and generates a workstation readiness view covering installed applications, startup entries, top processes, selected services, storage hotspots, developer tooling probes, and repo placement. It also shows module status, Tune diagnostics, and local blackboard records for evidence, proposed actions, approvals, and verification. - -AppLens-desktop does not upload data, create accounts, run background monitoring, or automatically share reports. Any system-changing action must be user-approved and recorded. Reports are exported only when the user chooses to export them. - -## Key Features - -- Local workstation inventory. -- AppLens Tune diagnostics. -- Readiness score and highlights. -- Module status dashboard. -- Local blackboard activity record. -- Operator-controlled Tune action flow. -- JSON, Markdown, and HTML exports. -- Default redaction for user, machine, and profile-path details. -- Optional raw-detail export controlled by the user. - -## Privacy Summary - -All scanning is local. No telemetry, cloud upload, account sign-in, or automatic sharing is included. Exported reports are user-controlled. - -## Screenshot Targets - -- First-run privacy notice. -- Completed dashboard with readiness score. -- Module status dashboard. -- AppLens Tune plan section. -- Blackboard activity section. -- App inventory section. -- Export controls. - -## Category - -Productivity or Utilities & tools. - -## Support URL - -Pending final hosted CSI support page. - -## Privacy Policy URL - -Pending final hosted CSI privacy policy page. +AppLens puts your Windows app inventory and storage usage in one simple table. +Run a local scan, search apps or publishers, and sort by name or reported size. +See installation scope, removal restrictions, disk capacity and free space, plus +secondary Windows, processor, graphics and memory details. + +Uninstall eligible desktop and current-user Store apps after confirming the exact +installation. Windows or the vendor may request administrator approval. AppLens +respects restrictions, checks the result, and records observed storage changes. +App data can be deleted by an uninstall; save your work and review the confirmation. + +Download the full inventory and action history as Markdown, JSON or HTML for +review or sharing. Personal identifiers and profile paths are redacted by +default, with an explicit option to include them. AppLens saves locally; you +choose whether and how to send the report. + +## Features +- Local app inventory and disk total/used/free readings. +- Search and size/name/publisher sorting; scope/type/removal filters. +- Explicit supported uninstall actions, Windows approval, and result verification. +- Local action history and downloadable reports. +- No accounts, telemetry, automatic uploads, or background optimization. + +## Limits to describe accurately +Reported app sizes can be missing or differ from recoverable space. System and +shared components are separated from ordinary apps. Some uninstaller commands +and restricted apps require review in Windows Installed Apps. That handoff is +not a verified removal. Current-user MSIX removal does not remove other users' +registrations. Scan speed varies; do not advertise a universal one-second +completion time. AppLens-Tune is deferred and is not included in this release. + +## Listing fields requiring owner/Store input +- Reserved name, Partner Center identity and publisher display name. +- Category choice: Utilities & tools or Productivity, according to available Store categories. +- Age-rating questionnaire and supported markets. +- Verified, published privacy policy and support URLs. +- Review final screenshots and artwork before submission. + +## Screenshot subjects +The finished app table, largest-first storage review, exact-target confirmation, +and download/history controls. Use reviewed screenshots without personal data; +internal development captures are not automatically Store listing assets. + +## Certification notes +The app runs as an ordinary medium-integrity WinUI desktop process. runFullTrust +supports local registry/WMI inventory and supported Windows/vendor uninstall +mechanisms. No packageManagement or allowElevation capability is requested. +AppLens itself remains unelevated; Windows handles explicit administrator +handoffs. Explain and demonstrate each supported removal route in certification. + +### Reviewer walkthrough (final identity/build to be supplied) +No login, account or server is required. Launch AppLens and select Scan this PC. +Search by app/publisher, choose Largest first, and inspect an app's scope/details. +Unknown sizes mean unavailable metadata, not zero disk usage. + +Use a disposable app in the certification test environment for removal. AppLens +revalidates the selected installation before showing its confirmation. Cancel +leaves it installed. Supported routes are Windows Installer for an exact product +GUID, a validated registered vendor EXE, or current-user package removal through +Windows PackageManager. All-user desktop routes can request a Windows admin +handoff. AppLens stays unelevated and does not bypass denied approval or policy. +Restricted components stay disabled; Windows Settings handoffs are labeled as +handoffs and do not claim removal. No arbitrary commands are read from a report. + +After an approved fixture removal, inspect refreshed inventory and action history, +then download JSON, Markdown or HTML. The report includes the complete capture +even if the table is filtered. Personal identifiers are off by default. Close and +reopen to verify history. Uninstall AppLens itself through Windows Installed Apps. + +Final package identity, supported platforms, delivery size and prerequisite +behavior must be filled from the tested submission candidate. The package is +configured to include .NET and use Store-managed Windows App SDK dependencies; +the clean-PC installation has not yet verified their delivery. diff --git a/docs/Store-Readiness-Checklist.md b/docs/Store-Readiness-Checklist.md index 60b3a99..3d61ea9 100644 --- a/docs/Store-Readiness-Checklist.md +++ b/docs/Store-Readiness-Checklist.md @@ -1,89 +1,62 @@ -# Microsoft Store Readiness Checklist - -Store packaging is a distribution track for the AppLens platform shell. It should validate installability, privacy posture, export control, and user trust. It is not the product scope. - -## App Package - -- App name: `AppLens-desktop` -- Package identity placeholder: `CSI.AppLensDesktop` -- Version: `0.1.0.0` -- Target: Windows Desktop, minimum version `10.0.19041.0` -- Package type: MSIX / packaged WinUI 3 desktop app -- Trust level: medium integrity full-trust desktop app, using `runFullTrust` - -## Implemented In The Current Shell - -- WinUI 3 packaged app scaffold. -- Native C# Scanner and Tune collectors. -- App inventory, diagnostics, readiness score, and tune plan. -- Blackboard event and store primitives. -- Module status and dashboard read models. -- JSON, Markdown, and local HTML exports. -- Default redaction with explicit raw-detail export option. -- Unit tests for backend behavior and dashboard presentation. -- MSIX package smoke build. -- Local run script and Store candidate build script under `tools/`. - -## Code-Ready - -- Local-first scan and Tune workflows are user-triggered. -- Tune actions are explicit, approval-gated, and blackboard-recorded. -- Backend and desktop presentation tests are included in `AppLensDesktop.sln`. -- CI runs solution-level Release tests. -- Local Windows `desktop.ini` files are ignored. -- Export defaults keep raw user, machine, and path details redacted unless the user opts in. - -## Packaging-Ready - -- MSIX project configuration exists for Windows desktop target `10.0.19041.0`. -- `tools\Build-StoreCandidate.ps1` runs restore, Release solution tests, unsigned package generation, artifact listing, and WACK detection. -- Latest local smoke generated `artifacts\install\AppLens.Desktop_0.1.0.0_x64_ARM64.msixbundle`. -- Store listing copy is drafted. -- Privacy and support documents exist in-repo for hosted publication. - -## Submission-Blocked - -- Reserve final app name in Partner Center. -- Replace placeholder CSI logo assets with final owned/licensed assets. -- Replace placeholder publisher identity with Partner Center identity. -- Publish production privacy policy URL. -- Publish support/contact URL. -- Capture Store screenshots from the final UI. -- Complete age rating questionnaire. -- Install missing Windows SDK symbol tooling for symbols package generation if symbols are required. -- Run Windows App Certification Kit on the final package. -- Produce Partner Center-signed upload package. - -## Drafted - -- Store listing draft: [Store-Listing-Draft.md](Store-Listing-Draft.md) -- Tomorrow handoff: [Tomorrow-Handoff.md](Tomorrow-Handoff.md) - -## Privacy Position - -The Store build should remain local-first and operator-controlled. It collects workstation inventory and diagnostics only after the user runs a scan. It does not upload data, create accounts, run background services, or automatically share reports. Reports are exported only when the user chooses export. - -System-changing actions must remain explicit, approval-gated, and blackboard-recorded. If any action path is not ready for Store submission, disable it in the Store build and keep the read-only plan visible. - -Collected data may include: - -- computer name and Windows username -- OS/device summary -- installed applications -- startup entries -- top processes -- selected service states -- storage hotspot paths and sizes -- repo placement paths -- WSL, Docker, and Ollama command summaries - -Default exports redact user, machine, and profile path details. The UI has an explicit raw-detail export option. - -## Certification Notes - -- Keep any Store-submitted action path explicit, approved, and documented. -- Avoid admin prompts. -- Avoid driver/service installation. -- Avoid automatic upload or telemetry. -- Do not claim Microsoft certification or affiliation. -- Note in certification comments that probes are local and user-triggered. +# Microsoft Store readiness + +The active v1 flow is inventory -> storage/app table -> approved removal -> +verification -> local report. AppLens-Tune is preserved outside the core build. +The implementation plan is [Product Vision](AppLens-Product-Vision.md); changing +work status is tracked in Linear, not duplicated here. +For completed source checks and a condensed keep/defer list of hands-on work, +see [release validation](AppLens-Release-Validation.md). + +## Package and runtime +- Native C#/.NET 10, WinUI 3 / Windows App SDK. +- Medium-integrity desktop app; only runFullTrust is declared. +- Source manifest minimum Windows build 19041; x64 and ARM64 project targets. +- Source identity CSI.AppLensDesktop / CN=CSI remains a placeholder until + Partner Center supplies the final identity. +- Store configuration bundles .NET and uses Store-managed Windows App SDK + frameworks; actual clean-PC prerequisite delivery is still unverified. +- Display name AppLens, original silver geometric artwork and local-first copy. +- Developer executable builds and unsigned development test packages are not a + Store installation, distribution approval or certification result. + +## Release acceptance +Local evidence already covers keyboard navigation, row/action accessible names, +100%/225% text, normal and two high-contrast themes, resizing and save/cancel: +[COP-239 client verification](AppLens-Client-Verification.md). COP-240 also covers +packaged Store/MSI/vendor fixtures and native UAC denial/approval. These results +inform the final installed review; they do not check off clean-PC certification. +Actual screen-reader audio and the latest picker change in a newly installed +package remain to be tested. Desktop control is paused at the user's request; +continue those hands-on checks later, as listed in the [handoff](AppLens-v1-Handoff.md). + +- [ ] Complete the installed customer flow on a clean standard-user Windows PC, + including native/package dependencies and offline scan/export. +- [ ] Exercise all-user administrator removal, denied UAC, protected/managed + cases, cancellation, failed/slow uninstallers, and app closure mid-action. + Reuse recorded COP-240 approval/denial successes; focus on remaining gaps. +- [ ] Verify keyboard navigation, screen-reader naming, text scaling and Windows + high contrast, including small screens and large inventories. +- [ ] Verify both claimed architectures on appropriate hardware. A cross-build + does not prove ARM64 runtime behavior. +- [ ] Measure launch, first results and completion, package download, installed + footprint, and first-install prerequisites for the actual distribution. +- [ ] Check current Microsoft Store policies, capabilities and privacy disclosures. +- [ ] Run Windows App Certification Kit against the final package. +- [ ] Verify Store download/install only after authorized publication. + +Use [Uninstall routes](AppLens-Uninstall-Routes.md) for the chosen APIs, evidence +and limitations. Application identifiers, unavailable values, action outcomes and +scope evidence must remain consistent in the table and all report formats. +No automatic restart, forced deletion or bypass of administrator/policy controls. + +## Materials to finalize +- [ ] Reserve the final AppLens name and use Partner Center's package/publisher identity. +- [ ] Owner review of original AppLens artwork and final screenshots without private data. +- [ ] Publish and verify the [privacy draft](AppLens-Privacy-Draft.md) at a real URL. +- [ ] Publish and verify the [support draft](AppLens-Support-Draft.md) with a real contact. +- [ ] Complete category, age-rating, market and certification fields using the + [listing draft](Store-Listing-Draft.md). +- [ ] Produce the final upload package using the authorized signing/submission process. + +Distribution packaging, hosting changes and Store submission require explicit +authorization. No publication or final identity is inferred from this checklist. diff --git a/AppLens-Tune.ps1 b/future/AppLens-Tune/AppLens-Tune.ps1 similarity index 100% rename from AppLens-Tune.ps1 rename to future/AppLens-Tune/AppLens-Tune.ps1 diff --git a/AppLens-Tune.py b/future/AppLens-Tune/AppLens-Tune.py similarity index 100% rename from AppLens-Tune.py rename to future/AppLens-Tune/AppLens-Tune.py diff --git a/future/AppLens-Tune/README.md b/future/AppLens-Tune/README.md new file mode 100644 index 0000000..0eeae08 --- /dev/null +++ b/future/AppLens-Tune/README.md @@ -0,0 +1,44 @@ +# AppLens-Tune — deferred, preserved + +This is the existing AppLens-Tune implementation, set aside while AppLens v1 +delivers fast inventory, storage review, uninstall, and report download. +Do not reconnect these diagnostics to core launch or scan. + +## Contents and entry points + +- `AppLens-Tune.ps1` and `Run-AppLens-Tune.bat`: Windows audit script. +- `AppLens-Tune.py` and `Run-AppLens-Tune.sh`: macOS/Linux audit script. +- `src/AppLens.Tune.csproj`: native diagnostics, rules, readiness, Tune plan, + approval-gated executor, `TuneAuditService`, and `TuneReportWriter`. +- `tests/AppLens.Tune.Tests.csproj`: preserved native tests; run explicitly: + `dotnet test future/AppLens-Tune/tests/AppLens.Tune.Tests.csproj -c Release`. +- `desktop/`: former dashboard window source. It is preserved as reference; + there is no active Tune desktop project. Reintegrating it requires a deliberate + separate desktop project and review after v1, not copying it into the core UI. +- `docs/`: original product/LLM/thesis material. Treat its roadmap as deferred. + +## Shared dependencies + +The native project references the normal core backend; core never references this +project. Machine collection, formatting/redaction, approval-loop interfaces, ledger, +module infrastructure, and existing serialized evidence contracts remain shared. +Historical `AuditSnapshot`/Tune-shaped evidence models stay in the backend for +existing platform/ledger compatibility. V1 uses `InventorySnapshot` and exports no +Tune fields. `ITuneActionExecutor` breaks the old concrete executor dependency. +Service-control implementation and its package dependency are confined here. + +## Preservation and verification + +`preservation-manifest.json` records source/destination paths and SHA-256 before +relocation. Files were hash-checked immediately after moving. Subsequent edits are +limited to renaming the legacy audit/report classes, adapting references/tests, +implementing the shared executor interface, and delegating machine reads to the +shared collector. Diagnostic/optimization logic was not redesigned. + +The separated native project currently passes all 58 preserved tests. This does +not prove every real Tune action or OS probe works. The scripts and old dashboard +have not been live-validated after separation. An earlier Windows script audit +stalled; its cause remains unidentified. Do not run it as a v1 readiness check. + +Resume only after v1: read the preserved docs, run the explicit tests, investigate +the stalled script independently, and establish a dedicated UI entry point. diff --git a/Run-AppLens-Tune.bat b/future/AppLens-Tune/Run-AppLens-Tune.bat similarity index 100% rename from Run-AppLens-Tune.bat rename to future/AppLens-Tune/Run-AppLens-Tune.bat diff --git a/Run-AppLens-Tune.sh b/future/AppLens-Tune/Run-AppLens-Tune.sh similarity index 100% rename from Run-AppLens-Tune.sh rename to future/AppLens-Tune/Run-AppLens-Tune.sh diff --git a/future/AppLens-Tune/desktop/MainWindow.xaml b/future/AppLens-Tune/desktop/MainWindow.xaml new file mode 100644 index 0000000..b406386 --- /dev/null +++ b/future/AppLens-Tune/desktop/MainWindow.xaml @@ -0,0 +1,657 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +