Skip to main content

Module residual

Module residual 

Source
Expand description

Owned residual path discovery (CLI marker + chromium tmp). Owned residual path discovery for one-shot Chrome (GAP-017 / GAP-020 / RES-01…12).

Never wipes host Chromes (Flatpak/VS Code). Only paths that are:

  • under our marker prefix browser-automation-cli-chrome-*, or
  • Singleton files inside our profile, or
  • /tmp/org.chromium.Chromium.* / /tmp/.org.chromium.Chromium.* that are Singleton-only (or empty), owned by this uid, with no live process holding the path — either from this invocation window or cross-run stale GC.

Host Flatpak tmp noise (.com.google.Chrome.* / com.google.Chrome.*) is never deleted by cross-run GC (product law).

§Workload

I/O-bound temp//proc scan during BORN and FINALIZE. Discovery of temp entries stays sequential (directory iterator).

PAR-89: live-process checks use a single /proc cmdline index (index_proc_cmdlines) then crate::concurrency::map_cpu over candidates (threshold 32). Never rescan /proc inside each parallel task (that would be O(N×P) thrashing under Rayon).

PAR-90: independent wipe of disjoint paths uses map_cpu when large. Subprocess Chrome itself is never unbounded-forked (one launch per one-shot process). The brief std::thread::sleep settle in browser residual path is on the sync FINALIZE path (not a Tokio worker).

Structs§

ResidualDiskReport
Machine-readable residual disk hygiene report (doctor / agents).

Constants§

CHROMIUM_TMP_DOT_PREFIX
Hidden Chromium side-channel prefix under the process temp dir.
CHROMIUM_TMP_PREFIX
Chromium side-channel prefix under the process temp dir.
CLI_CHROME_MARKER_PREFIX
Prefix for CLI-owned temp Chrome user-data-dir profiles.
INVOCATION_SIDE_CHANNEL_WINDOW_SECS
Tight window after launch for unattributed chromium tmp (seconds).
MTIME_SKEW_SECS
Skew allowance when comparing mtime/ctime to not_before (seconds).
SINGLETON_MAX_BYTES
Max file/dir payload size treated as Singleton-only residue (bytes).
SINGLETON_MAX_ENTRIES
Max directory entries allowed when classifying Singleton-only residue.
STALE_MIN_AGE_SECS
Minimum age for cross-run stale Singleton GC (seconds).

Functions§

discover_owned_chromium_tmp_side_channels
Discover Chromium side-channel paths in the process temp dir that belong to this launch (GAP-020).
index_proc_cmdlinesUnix
One-shot index of live process cmdlines under /proc (unix).
list_cli_chrome_marker_dirs
Collect residual marker profile dirs left under temp (should be empty after healthy DIE).
residual_disk_report
Snapshot residual disk hygiene without mutating the filesystem.
scavenge_owned_chromium_tmp_orphans
FINALIZE scavenger (GAP-A002): wipe owned Chromium tmp leftovers that are safe to remove — our uid, chromium/cli marker name, no live process holding the path, and either created after not_before or Singleton-only / empty.
scavenge_stale_singleton_orphans
Cross-run GC of stale Singleton-only Chromium tmp + CLI marker orphans (RES-02).
scavenge_stale_singleton_orphans_with_min_age
Same as scavenge_stale_singleton_orphans with an explicit age floor.