# DesktopBeast™ Target Selection Shell Guard Green

Milestone: DESKTOPBEAST_TARGET_SELECTION_SHELL_GUARD_GREEN

## Observed Regression

The EA Beta interface produced a technically valid PNG and Markdown capture, but the target was the Windows taskbar:

- Source App: `explorer`
- Class Name: `Shell_TrayWnd`
- Window Bounds: `0,1368 2560x72`
- Result: thin taskbar strip with low-value OCR

The bitmap capture service behaved correctly for the rectangle it received. The regression was target selection: the foreground-window path accepted a shell/taskbar window as if it were a normal user target.

## Investigation Result

Current EA Beta hotkey path:

1. `Ctrl + Shift + D` raises `HotkeyService_HotkeyPressed`.
2. `windowInfoService.GetForegroundWindow()` resolves the foreground HWND before capture.
3. The old logic only rejected DesktopBeast™'s own process.
4. Shell/taskbar classes were not filtered.
5. A focused taskbar could therefore become a normal `Success` active-window capture.

Likely cause:

- Maximized/sticky UI did not directly break the image engine.
- Foreground preservation needed shell-aware target normalization.
- Completion UI appears after capture, but the foreground target could already be `Shell_TrayWnd` by the time the hotkey message arrived.

## Changed

- Added `CaptureTargetSelector`.
- Added shell/taskbar guard for:
  - `Shell_TrayWnd`
  - `Shell_SecondaryTrayWnd`
- Added desktop-surface handling for:
  - `WorkerW`
  - `Progman`
- Desktop surface captures now resolve to full virtual desktop capture.
- Taskbar captures now resolve as:
  1. last valid non-shell foreground window, when available
  2. full virtual desktop fallback when no previous non-shell target is available
- Added foreground target tracking on a 250 ms WPF dispatcher timer.
- Kept target resolution before capture and before Completion UI display.
- Added diagnostic notes to fallback targets so Markdown artifacts explain what happened.
- Updated command-line active-window smoke path to use the same target selector.
- Updated package candidate ZIP and checksum.

## Package

- ZIP: `release/DesktopBeast-EA-Beta-Package-Candidate.zip`
- SHA256: `87E01AD993F30B6C5C2F88559E2049334F12BCFB692CE57D452715D5DA63CC65`

## Verified

- Build succeeded with bundled local .NET SDK.
- Publish succeeded.
- Package ZIP regenerated.
- ZIP contents inspected; debug PDB excluded.
- Static verification found shell guard classes and fallback diagnostics in source.
- Package scan found no blocked public-release language.

## Manual Validation Still Needed

These require an interactive Windows desktop session:

- Hotkey capture from Notepad captures Notepad.
- Hotkey capture from File Explorer captures File Explorer, not taskbar.
- Hotkey capture from desktop surface captures full desktop/icons.
- Hotkey capture when taskbar is focused does not create a misleading taskbar-only success capture.
- ArchiveBeast™ opens the resulting captures correctly.

## Scope Confirmation

- DesktopBeast™ PNG + Markdown workflow preserved.
- ArchiveBeast™ adaptive viewer preserved.
- No BrowserBeast™ Freeware PNG capture added.
- No BrowserBeast™ paid/pro work started.
- No PersonaVault work started.
- No Cloudflare DNS touched.
- No live deployment performed.

