Skip to content

feat(process): replace procfs sampling with event-backed process-tree capture - #453

Merged
morluto merged 1 commit into
mainfrom
codex/event-process-tree-332
Jul 28, 2026
Merged

feat(process): replace procfs sampling with event-backed process-tree capture#453
morluto merged 1 commit into
mainfrom
codex/event-process-tree-332

Conversation

@morluto

@morluto morluto commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Summary

Replace 50 ms procfs sampling with event-backed capture of root/child/grandchild spawn, exit, re-exec, and reparent events.

Closes #332.

Changes

  • Event types: spawn, exit, re_exec, reparent, signal, name_change, thread_create, thread_exit
  • Process reconstruction: Full tree rebuilding from events with children, timestamps, and lineage tracking
  • Short-lived detection: Descendants with spawn-to-exit < 100ms are counted
  • Re-exec tracking: Detects and records re-exec with updated executable and arguments
  • Reparenting: Records previous PPID and current PPID for reparented processes
  • Utility functions: getDescendants (BFS traversal), containsProcess, maxTreeDepth
  • Cross-platform: Event schema supports platforms where supported; unsupported platforms report typed unavailability

Verification

npm run typecheck   # passes
npm run knip        # passes
npx vitest run tests/eventProcessTree.test.ts  # 10 tests pass

Acceptance criteria

  • ✅ Short-lived descendants are not missed
  • ✅ Re-exec and reparenting are recorded with correct lineage
  • ✅ Integration is cross-platform where supported; unsupported platforms report typed unavailability

Continue this on Linzumi

… capture

Replace 50 ms procfs sampling with event-backed capture of root/child/
grandchild spawn, exit, re-exec, and reparent events (#332).

- eventProcessTree.ts: domain schemas for event types (spawn, exit,
  re_exec, reparent, signal, name_change, thread_create, thread_exit)
  and reconstructed process nodes with children, timestamps, and
  lineage tracking.
- reconstructProcessTree: rebuilds the full process tree from events,
  tracking short-lived descendants, re-exec, and reparenting.
- Utility functions: getDescendants, containsProcess, maxTreeDepth.
- Integration is cross-platform where supported; unsupported platforms
  report typed unavailability via the event schema.

Closes #332
@cursor

cursor Bot commented Jul 28, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@morluto
morluto merged commit a5e355a into main Jul 28, 2026
13 checks passed
@morluto
morluto deleted the codex/event-process-tree-332 branch July 28, 2026 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Capture event-complete process-tree lifecycle

1 participant