Skip to content

Auto-detect noisy app directories at first startup #27

@CalebisGross

Description

@CalebisGross

Problem

New users install Mnemonic and immediately get flooded with filesystem events from whatever desktop apps they have running. We ship default exclusions for known noisy paths (Chrome, VS Code, GNOME, etc. — see PR #26), but there are hundreds of apps that write to ~/.config/ and ~/.local/share/ that we can't all anticipate.

A user on KDE with Brave and Obsidian would get noise from paths we never thought to exclude.

Proposal

On first startup (or when a new config.yaml is generated), scan the user's system for known noisy application directories and auto-populate exclusion patterns.

Detection approach

Scan these base directories:

  • ~/.config/ (Linux XDG config)
  • ~/.local/share/ (Linux XDG data)
  • ~/Library/ (macOS — already excluded wholesale, but could be more granular)
  • ~/.cache/ (already excluded, but good to confirm)

For each subdirectory found, check against a known-noisy registry:

var knownNoisyApps = map[string]string{
    "Code":            "VS Code internal state",
    "Code - Insiders": "VS Code Insiders internal state",
    "google-chrome":   "Chrome browser storage",
    "chromium":        "Chromium browser storage",
    "BraveSoftware":   "Brave browser storage",
    "firefox":         "Firefox browser storage",
    "Slack":           "Slack desktop app state",
    "discord":         "Discord desktop app state",
    "spotify":         "Spotify cache/state",
    "obsidian":        "Obsidian vault metadata",
    "Signal":          "Signal messenger state",
    "teams":           "MS Teams state",
    "gnome-shell":     "GNOME shell temp files",
    "plasma":          "KDE Plasma state",
    // ... extensible
}

For unrecognized directories, optionally log them at DEBUG level so the adaptive learning system (#TBD) can observe whether they generate noise.

Where this runs

In cmd/mnemonic/main.go during the serve startup sequence, before the watcher starts. Only runs if a marker file (e.g., ~/.mnemonic/.autodetect-done) doesn't exist yet, so it's a one-time operation.

Output

Detected exclusions are logged at INFO level:

Auto-detected noisy app: ~/.config/Code/ (VS Code internal state) — adding to watcher exclusions
Auto-detected noisy app: ~/.config/google-chrome/ (Chrome browser storage) — adding to watcher exclusions
Auto-detected 2 additional watcher exclusions

Exclusions are applied in-memory for the current session. Optionally written back to config.yaml with a comment so the user can review and adjust.

Doesn't replace defaults

This supplements the static defaults from config.yaml — it catches apps that are installed but not in the default list. The layered approach:

  1. Static defaults (config.yaml) — known noisy paths, always active ✅ (PR Add Linux desktop app exclusions to watcher config #26)
  2. Auto-detect (this issue) — scan for installed noisy apps at first startup
  3. Adaptive learning (separate issue) — runtime feedback from heuristic rejections

Related

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions