[Platform] Use graceful, consent-aware restarts and preserve target discovery diagnostics
Draft status: ready to create; not submitted by the audit run.
Priority: P1
Findings: ACT-013, ACT-014, ACT-015
Summary
The Windows target lifecycle force-terminates the matched app process, target discovery errors can be collapsed into an empty list, and macOS persistence path checks can accept app bundles outside standard Applications locations.
中文摘要:Windows 路径默认强制结束目标应用,可能丢失未提交输入;平台发现错误又可能被误报成“未安装”。macOS 的持久化宿主路径也需要收紧。应改成正常关闭优先、强制关闭二次确认、结构化诊断。
Audit evidence
- The Windows path invokes
Stop-Process -Force after matching the selected package/executable.
- Discovery uses
unwrap_or_default() in a path that can turn command, permission, JSON, or parsing errors into “no targets found.”
- macOS persistence validation rejects
/Volumes and checks for .app/Contents/MacOS/, but this can still admit a bundle under /tmp or another non-standard location.
- The README/agent contract correctly says not to close a running ChatGPT/Codex session without asking; the implementation should make the final force action equally explicit.
This issue is related to, but not a duplicate of, #2. #2 focuses on target/version probe diagnostics; this issue covers platform discovery classification and process lifecycle safety.
Proposed direction
- Return a typed discovery result that distinguishes unsupported platform, not installed, command unavailable, permission denied, command failed, parse failed, and unsupported version.
- Request graceful app exit first and wait for a bounded period.
- If the process remains, show a second confirmation that explicitly warns about unsent prompts or unsaved input before force termination.
- Preserve a cancel path that leaves the current app and theme state untouched.
- Restrict persistent macOS host paths to
/Applications or $HOME/Applications; after formal signing, validate Team ID/designated requirement.
Acceptance criteria
Related audit findings
ACT-013, ACT-014, ACT-015.
A PR design reference is available in demo/pr-blueprints/PR-06-platform-restart-diagnostics.md in the audit bundle.
[Platform] Use graceful, consent-aware restarts and preserve target discovery diagnostics
Summary
The Windows target lifecycle force-terminates the matched app process, target discovery errors can be collapsed into an empty list, and macOS persistence path checks can accept app bundles outside standard Applications locations.
中文摘要:Windows 路径默认强制结束目标应用,可能丢失未提交输入;平台发现错误又可能被误报成“未安装”。macOS 的持久化宿主路径也需要收紧。应改成正常关闭优先、强制关闭二次确认、结构化诊断。
Audit evidence
Stop-Process -Forceafter matching the selected package/executable.unwrap_or_default()in a path that can turn command, permission, JSON, or parsing errors into “no targets found.”/Volumesand checks for.app/Contents/MacOS/, but this can still admit a bundle under/tmpor another non-standard location.This issue is related to, but not a duplicate of, #2. #2 focuses on target/version probe diagnostics; this issue covers platform discovery classification and process lifecycle safety.
Proposed direction
/Applicationsor$HOME/Applications; after formal signing, validate Team ID/designated requirement.Acceptance criteria
Related audit findings
ACT-013,ACT-014,ACT-015.A PR design reference is available in
demo/pr-blueprints/PR-06-platform-restart-diagnostics.mdin the audit bundle.