Expand description
Phase 1 of #221: the process-observation capability model and the portable process-lifecycle baseline.
This module defines the stable observation types — ObserverConfig,
ObserverCapabilities, ObserverEvent, and the
ObserverSubscriber handle — plus the always-available lifecycle
backend that emits started and
exited events for child processes spawned
by this crate.
§TraceScope dimension (#539)
The capability matrix is negotiated for a TraceScope:
TraceScope::SystemWide— the historical default, names admin-gated system tracers (ETW kernel providers, eBPF, EndpointSecurity). All syscall categories reportUnavailableuntil the Phase 3 backends from #469 land.TraceScope::LaunchedProcessTree— the no-admin tier added by #539. Names per-OS primitives that operate purely on the spawn boundary this crate already owns (Windows Job Object IOCP, Linux subreaper+pidfd, macOS kqueue EVFILT_PROC). Currently every syscall category reportsUnavailable; each #539 slice flips one cell toSupported/Partialwith no shape change.
Lifecycle is Supported in every scope because owning the spawn boundary
is sufficient for started/exited on all three platforms.
ObserverCapabilities::negotiate() preserves the pre-#539 contract and
returns the SystemWide matrix; new callers should use
negotiate_for_scope.
§Off by default
Observation is entirely opt-in. A NativeProcess
emits no events unless an ObserverConfig is attached via
NativeProcess::with_observer (or
the equivalent builder seam). With no observer configured the lifecycle
hooks are inert: no channel, no allocation, no events.
The handle is a plain std::sync::mpsc receiver so the lifecycle
baseline stays free of the daemon runtime (tokio/IPC). Phase 2 layers the
daemon-owned subscriber model on top of these same event types.
Structs§
- Category
Capability - Capability report for one
EventCategory: the negotiated support level, the backend that would serve it, and a human-readable reason. - Dump
Result - Observer
Capabilities - The full capability matrix produced by
ObserverCapabilities::negotiateorObserverCapabilities::negotiate_for_scope. - Observer
Config - Opt-in configuration that turns process observation on for a single
NativeProcess. - Observer
Event - A single observation emitted by the lifecycle baseline.
- Observer
Subscriber - Receiver handle for observation events.
- Process
Event - Process
Identity - Process
Observation - Process
Observation Capabilities - Process
Observation Error - Process
Watch - Process
Watch Configuration Error - Process
Watch Cursor - Process
Watch Gap - Process
Watch Loss - Process
Watch Match - Process
Watch Subscriber - Stack
Dump
Enums§
- Capability
Support - Negotiated support level for a single
EventCategory. - Capture
Source - Event
Category - Category of observable process activity.
- Observation
Grade - Observation
Policy - Observer
Event Kind - What happened to an observed process.
- Process
Event Kind - Process
Watch Read - Stack
Capture - Trace
Scope - Scope at which observation is negotiated.
Functions§
- observe_
launched_ tree - Observe the launched process tree of an already-running process.
- read_
process_ argv - Read a process’s argument vector without flattening argument boundaries.
- read_
process_ cmdline - Read a stable human-readable process command display string.
- read_
process_ file_ handles