You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sensor-processes currently fires discrete events for every cargo/rustc/gcc start and exit. In a real build, you get:
cargo started
rustc started (child of cargo)
rustc exited
cargo exited
Four notifications for what's conceptually one event: a build happened. The user (and the agent reading notifications) would rather see:
cargo build completed (pass) or cargo build failed
Why it's not trivial
Build tools spawn nested processes. Distinguishing "the build that just started" from "another cargo process" requires some kind of session tracking. Options:
Root process tracking. Watch for top-level cargo/make/gcc invocations; consider them done when the root PID exits. Needs PID ancestry.
Watch exit codes. Requires process accounting (waitid, wait4) or parsing /proc state.
Marker file polling. Users configure a build-status file path; sensor watches for writes.
Shell integration. Hook into the shell's command execution events.
Option 1 is probably right for the common case — watch root cargo/npm/make processes, consider the lifecycle bounded by their exit. Option 2 layers on top for exit-code awareness (see #7).
Needs an ADR
This isn't just a refactor — it changes the event model for this sensor from "process lifecycle" to "build lifecycle." Design decisions worth an ADR:
Does sensor-processes become sensor-builds, or does it grow a second mode?
What defines a "build" — just the whitelist from existing sensor, or configurable?
How does aggregation interact with the per-sensor engagement state?
Also doesn't batch multiple events from the same build tool. If cargo starts, then rustc starts as a child, then rustc exits, then cargo exits, that's four events. Smoothing build lifecycles into "build started → build finished" aggregate events is a known todo.
And in issue #2 as a remaining item from the ADR-113/114 work.
sensor-processescurrently fires discrete events for every cargo/rustc/gcc start and exit. In a real build, you get:cargo startedrustc started(child of cargo)rustc exitedcargo exitedFour notifications for what's conceptually one event: a build happened. The user (and the agent reading notifications) would rather see:
cargo build completed (pass)orcargo build failedWhy it's not trivial
Build tools spawn nested processes. Distinguishing "the build that just started" from "another cargo process" requires some kind of session tracking. Options:
cargo/make/gccinvocations; consider them done when the root PID exits. Needs PID ancestry.waitid,wait4) or parsing/procstate.Option 1 is probably right for the common case — watch root cargo/npm/make processes, consider the lifecycle bounded by their exit. Option 2 layers on top for exit-code awareness (see #7).
Needs an ADR
This isn't just a refactor — it changes the event model for this sensor from "process lifecycle" to "build lifecycle." Design decisions worth an ADR:
sensor-processesbecomesensor-builds, or does it grow a second mode?Documentation reference
Called out explicitly in
docs/attend-and-monitor/sensors.mdunder "What it doesn't do" for sensor-processes:And in issue #2 as a remaining item from the ADR-113/114 work.
Related