[PR #453] [MERGED] feat(process): replace procfs sampling with event-backed process-tree capture #2000

Closed
opened 2026-10-16 21:13:14 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/453
Author: @morluto
Created: 7/28/2026
Status: ✅ Merged
Merged: 7/28/2026
Merged by: @morluto

Base: main ← Head: codex/event-process-tree-332


📝 Commits (1)

  • d5d2e56 feat(process): replace procfs sampling with event-backed process-tree capture

📊 Changes

2 files changed (+658 additions, -0 deletions)

View changed files

➕ src/domain/eventProcessTree.ts (+240 -0)
➕ tests/eventProcessTree.test.ts (+418 -0)

📄 Description

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

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/453 **Author:** [@morluto](https://github.com/morluto) **Created:** 7/28/2026 **Status:** ✅ Merged **Merged:** 7/28/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `codex/event-process-tree-332` --- ### 📝 Commits (1) - [`d5d2e56`](https://github.com/morluto/rea/commit/d5d2e56d0461cb0debba540bc658a9938ac30599) feat(process): replace procfs sampling with event-backed process-tree capture ### 📊 Changes **2 files changed** (+658 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `src/domain/eventProcessTree.ts` (+240 -0) ➕ `tests/eventProcessTree.test.ts` (+418 -0) </details> ### 📄 Description ## 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 ```bash 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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:13:14 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#2000
No description provided.