Skip to content

Integrate event-backed process-tree capture into Process Capture v4 #333

Open

Description

@morluto

Wire event-complete process-tree lifecycle into the Process Capture v4 contract, CLI/MCP adapters, and comparison outputs.

Acceptance:

  • Captures include event-backed process-tree evidence alongside PTY frames and filesystem effects.
  • Comparison treats sampled and event-backed evidence as distinct dimensions.
  • Tests prove spawn, exit, re-exec, reparent, and descendant cleanup.

Part of #59.

Activity

  1. added
    enhancement
    P0: critical
    on Jul 20, 2026
  2. added
    area: runtime
    on Oct 14, 2026
  3. prasad2512 commented on Nov 26, 2026

    @prasad2512
    Contributor

    I investigated the current main state around #333 (0771d11c7) and wanted to align on scope before starting implementation.

    Current Codebase State

    1. The earlier domain scaffolding from feat(process): replace procfs sampling with event-backed process-tree capture #453 (src/domain/process/eventProcessTree.ts) was removed in c93422a89 as unwired scaffolding, so Process Capture v4 (src/domain/process/processCapture.ts) currently only carries periodic process_samples (src/process/capture/ProcessSampling.ts).
    2. PROCESS_CAPTURE_EVENT_COLLECTIONS includes frames, rendered_frames, interaction_events, lifecycle, process_samples, and filesystem_checkpoints, while processComparison.ts currently evaluates one combined "process" dimension.

    Questions Before Implementing

    Before opening a PR, could maintainers confirm the preferred direction on three design points?

    1. Contract & Comparison Dimension Split: Should event-backed process-tree observations live in a distinct collection (e.g. process_tree_events with spawn / exit / re_exec / reparent + explicit platform unavailability) alongside process_samples, and should processComparison.ts treat sampled (process_samples) vs event-backed (process_tree_events) evidence as separate comparison dimensions (as required by acceptance criterion Release REA as one CLI with MCP mode #2)?
    2. Scoped Rollout by OS: Would an incremental PR sequence work best here — e.g.:
      • PR 1: Contract + processComparison dimension split + ProcessCaptureLifecycle integration + Windows Job Object (JOBOBJECT_ASSOCIATE_COMPLETION_PORT / creation/exit notifications in native/windows/src/process.cc)
      • PR 2 / PR 3: Linux (proc connector / cgroup-v2 / eBPF-free netlink or ptrace/fanotify) & macOS (DarwinHelper / ES or kqueue EVFILT_PROC note-track) implementations + typed unavailability on unsupported hosts.
    3. Existing Ownership Alignment: Should event-backed descendant discovery feed directly into ProcessOwnership (ProcessOwnershipProcessTree.ts) during cleanup so short-lived or setproctitle-mutated descendants are also tracked without relying solely on /proc/<pid>/environ?

    Happy to start with PR 1 once the contract shape and staged approach are aligned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0: criticalarea: runtimeenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions