Repository navigation
feat(consent): Name the process Windows Privacy will list - #536
Conversation
Implements Windows-specific process detection for Settings Privacy pane (#238): - Detects packaged vs cargo run via target/debug or target/release paths - Walks parent process chain to find launching IDE/terminal for dev builds - Adds Windows-specific hint copy without macOS/TCC vocabulary - Fixes form.rs to route Windows to Windows intro, not Linux intro - Updates tests to distinguish Windows and Linux prose separately Co-authored-by: Oded Messer <odedmesser@gmail.com>
Fixes type error comparing HANDLE to integer. Use INVALID_HANDLE_VALUE constant instead of raw 0 or -1 cast. Co-authored-by: Oded Messer <odedmesser@gmail.com>
- Remove unused HANDLE import from Windows module - Use next_back() instead of last() for DoubleEndedIterator per clippy Co-authored-by: Oded Messer <odedmesser@gmail.com>
Architect review — request changes @
|
Must-fix from Architect review: parent_chain_name was returning the first named parent (cargo for cargo run), not the IDE/terminal Privacy will list. Now mirrors macOS bundled_ancestor_name logic: - Walk parents, skip toolchain (cargo, rustc, rustup, rust-analyzer, rls) - Return first IDE/terminal (Cursor, Code, WindowsTerminal, powershell, etc.) - Document packaged() path heuristic (target/debug|release vs installed) - Soften Settings wording (Null probe: no grants claimed yet) - Add unit test for toolchain classification (pure string, no live Privacy) Co-authored-by: Oded Messer <odedmesser@gmail.com>
|
Architect must-fix addressed @ 9787e9c: Must-fix: Skip toolchain in Windows parent walk✅
Soft improvements (same pass)✅ Packaged detection — added comment documenting the heuristic: NSIS installs live in Program Files/AppData (no ✅ Settings wording — softened
✅ Unit test — added CI statusAll checks green:
Ready for re-review. Windows desktop e2e/smoke on DESKTOP-UQIE144 remains the next human gate (not run). — Cursor agent, on @omesser's behalf. |
Architect re-gate — approve @
|
Windows settings_window.rs now renders section.heading and section.comment for each FormSection, matching X11 behavior. Before this fix, only rows were drawn — heading and comment were ignored. - Add STATIC label for section heading (LABEL_HEIGHT + HINT_GAP spacing) - Add STATIC label for section comment when present (LABEL_HEIGHT * 2 height to accommodate wrapping) - Maintain existing SECTION_GAP above each section - Use unique control IDs (section_heading_<tab>_<section> and section_comment_<tab>_<section>) to avoid collisions After #536, Privacy pane's process-name hint from consent::pane_intro lives in FormSection.comment, so this fix makes it visible on Windows. Fixes #552 Co-authored-by: Oded Messer <odedmesser@gmail.com>
…efresh After rebase on main (which includes #536), Windows Privacy pane now has the correct pane_intro. The remaining issue is that section heading and comment STATIC controls were blanked on every refresh. Root cause: should_update_label_text() returned true for section_heading_* and section_comment_* IDs. When draw() called set_window_text() on these labels, it had no match case for them and fell through to String::new(), blanking the text set at build_ui time. Fix: Add exclusion patterns for section_heading_* and section_comment_* in should_update_label_text(), treating them like help hints and field labels (static text that should never be overwritten from view data). Test: Added regression test cases to should_update_label_text_preserves_help_hints verifying both patterns return false. After this fix: - Section headings stay populated after refresh - Section comments (including Privacy pane's process-name hint) stay visible - Windows Privacy comment shows Windows-specific hint from #536 (no macOS/TCC copy) Co-authored-by: Oded Messer <odedmesser@gmail.com>
Why
Windows Privacy UI (screen capture, UI Automation) lists the process requesting permission, but the Settings window showed Linux prose and
process_listed_as()hardcoded"ai-buddy"on Windows. Acargo runfrom Cursor/Terminal shows the IDE or shell, not the app name, so the hint has to name what Privacy will actually list.Issue #238 requests Windows-specific process naming and hint copy to match the macOS approach (sibling of #148 / PR #229). #197 shipped the native Settings window; this is copy only.
What changed
consent::windows::process_list_name()detects packaged builds (not undertarget\debugortarget\release) vs dev builds, walks the parent process chain viaCreateToolhelp32Snapshot/Process32FirstW/Process32NextWto find the launching IDE/terminal forcargo run.listed_under_hint(name)andpane_intro(listed_as)for Windows that do not mention macOS, Privacy & Security, TCC, Accessibility, or Screen Recording.form::privacy_sections()now routes Windows toconsent::pane_intro(&process_listed_as())instead oflinux_pane_intro(). Linux still getslinux_pane_intro().form.rs. Added Windows-specific tests inconsent.rsfor hint copy (no macOS vocabulary) and confirmedprocess_listed_as()is non-empty.live()stays Null on Windows. No real grant probe or prompt APIs.Did not implement:
How to verify
Tests (on this Linux cloud agent):
cargo test -p ai-buddy-core --libpasses (454 tests).#[cfg(target_os = "windows")]will be tested by Windows CI.listed_under_hintandpane_introavoid macOS vocabulary.CI:
cargo test+cargo clippy) will compile and test the Windows code path. Thewindowslabel ensures CI runs Windows tests despite path filter.Manual (next gate):
cargo runfrom Cursor/Terminal/PowerShell: Settings → Privacy should print the IDE/shell name, not "ai-buddy".Closes #238
— Cursor agent (Coder), on @omesser's behalf.