Expand description
QA runs never touch real user data.
A test run may not start an app on the user’s real data or on a location that can raise a
system dialog (macOS file-access prompts for Documents, Desktop, Downloads, iCloud Drive and
removable or network volumes; the same cloud-sync folders on Windows). Guard is evaluated
by control::launch (and by the engine launch paths) before anything is started, with no
opt-out for apps: a violation is a typed UserDataViolation naming the path and the rule,
and nothing is launched. An engine launch must also name an isolated data directory
(check_engine_launch); the one exception is a probe of the engine’s own refusal, available
on Unix only and only with HOME redirected.
The rule for an app launched with a workspace:
- the workspace home must be a QA root this runner created (it sits directly under a
rightkit-qadirectory inside a system temp root on the internal disk and carries the.rightkit-app.jsonbinding), and must itself break none of the forbidden-location rules; - every directory passed to the app (the launch working directory and each absolute path in the environment) must resolve, symlinks followed, inside that home.
Forbidden anywhere: the user’s Documents, Desktop, Downloads, Pictures, Music and Movies;
iCloud Drive (~/Library/Mobile Documents, ~/Library/CloudStorage), OneDrive, Dropbox and
Google Drive folders; the user’s real application-support / AppData / .config directory for
the app under test; any /Volumes/* volume; any Windows UNC (network) path.
Scenarios that need existing state build it with generated fixtures (the default) or with
seed_from, which refuses to read the real per-user data of the app under test unless the
scenario declares the copy scrubbed and a verification callback returns true before launch.
Structs§
- Engine
Launch - Everything the guard judges about one engine, sidecar or app-engine launch, before the process
starts.
envis the environment the launcher will set on the child (target values, the data directory variable, then the caller’s values, in that order: the last value of a key wins, as withCommand::env). - Guard
- What decides whether a launch may proceed. Build one with
Guard::for_workspace(apps) orGuard::for_temp_roots(engines without a workspace). - Scrub
Declaration - How a seed copy proves it holds no user data.
- User
Data Violation - A launch refused before anything started.
From<UserDataViolation> for Errorkeeps?working in code that returnscrate::Result; match onrulewhere the reason matters.
Enums§
- Dialog
Check - Outcome of a permission-dialog check.
- Rule
- Why a path was refused.
Functions§
- check_
app_ data_ dir - App launches get their data directory from the workspace: the launch environment must carry
RIGHTKIT_QA_DATA_DIR, pointing inside the QA rootguardwas built for. A workspace whose environment lost it is refused rather than launched on the app’s own default folder. - check_
engine_ dirs - Engine launches have no workspace: judge the data directory and the environment values that name data, home, profile or config directories.
- check_
engine_ launch - Judge one engine launch. A launch is refused, before anything starts, when:
- is_
system_ dialog_ owner - True when
nameis a macOS process that owns permission prompts. - live_
permission_ dialog_ check - TODO: observe live TCC prompts.
rightkit_qa_driver::mac::windows(pid)lists windows of one pid only; there is no enumeration of windows by owner name (UserNotificationCenter,CoreServicesUIAgent), so no reliable detector exists in this crate yet. This hook reportsDialogCheck::Unsupportedinstead of guessing. Replace the body once the automation layer can list windows by owner without clicking them. - permission_
dialog_ in - Positive evidence only: the first sampled foreground name that belongs to a system dialog
agent, from
StopReport::frontmost_states. An empty answer proves nothing, because these agents rarely become frontmost. - resolve
- Resolve symlinks in the longest existing prefix and append the rest, so a path that does not exist yet is still judged by where its existing parents really are.
- seed_
from - Seed
<data_dir>/<dest_rel>fromsourcethrough the caller’stransform(source, dest). - seed_
from_ guarded seed_fromwith an explicit guard (tests use a fake user home).