ProcessLogger/BIBLE
ProcessLogger — Project Bible
Single source of truth for what ProcessLogger IS, is NOT, and the rules that keep it coherent. README says how to build and run it; this says how to think about it. The finish line lives in
docs/RELEASE.md.
1. The one sentence
Catch whatever stole focus: record every Windows process start and exit, even sub-second ones, and every foreground change, then search it in a viewer.
2. The product promise
- Processes that live a fraction of a second are still recorded (kernel trace).
- Each row says who started it, how heavy it was, and which capture source saw it.
- Focus changes sit next to what was running at that moment.
- Everything stays local in one SQLite file.
3. What it is NOT
- Not a monitoring service: no alerts, no remote viewing, nothing sent anywhere.
- Not cross-platform: Windows only, and the logger runs elevated.
- Not a general log store: its operational log holds lifecycle, warnings and errors; the process record lives in
processlogger.db.
4. Architecture canon
ETW kernel trace ─┐
├─► reconciler ─► ProcessEvents ─┐
WMI start/stop ───┘ (250 ms window) ├─► processlogger.db (SQLite, EF Core) ◄── viewer
memory sampler (50 ms) ─────────────────────────────┤ (WebView2)
SetWinEventHook foreground ─► FocusEvents ─────────┘
4.1 Projects
ProcessLogger.Core— capture sources, reconciler, memory sampler, focus watcher, EF model, query services.ProcessLogger.Cli— elevated generic host running the watchers; applies migrations at start.ProcessLogger.Frontend— WPF + WebView2 viewer (vanilla HTML/CSS/JS inwwwroot).ProcessLogger.Tests— NUnit tests.
4.2 Domain model
ProcessEvent (name, PID, parent, path, command line, opened/closed, duration, memory peaks, source Etw/Wmi/Both), FocusEvent (process, title, focused/lost times).
4.3 Key services
ProcessWatcherService (reconcile and persist), MemorySamplerService, FocusWatcherService, ProcessEventQueryService / FocusEventQueryService (filters, sorts, take).
5. The Laws
Inherits MindAttic.HouseRules.md by reference.
- Two sources report the same process within the reconcile window → one row, source
Both. - Names are stored with
.exe; filters match either spelling. - Capture must never crash on a protected or vanished process.
- Database writes are serialized; no SQLite lock contention.
- Settings live in a per-machine MindAttic Vault app.
6. Verified state
Capture, reconcile, focus log and viewer work; NUnit covers the watcher, query services and MindAttic.Log integration. Deployed to R:\MindAttic\Apps\ProcessLogger (abeaf18). Known: the operational log grows ~1.7 GB a day (PL-T28).
7. Active frontier
docs/RELEASE.md — milestone MS-69 "Lean and on R:".
8. Quality bar
Builds with warnings as errors (Directory.Build.props); capture changes come with a watcher test using the fake capture source.
9. Glossary
- ETW — the NT Kernel Logger process trace (only one session system-wide).
- WMI —
Win32_ProcessStartTrace/StopTrace, the cross-check and fallback. - Reconcile window — how close two sources' reports must be to merge (250 ms).