[PR #703] [MERGED] fix(process): honor disabled PID normalization in samples #2184

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/703
Author: @kaoru0822-kitauji
Created: 10/6/2026
Status: ✅ Merged
Merged: 10/6/2026
Merged by: @kaoru0822-kitauji

Base: main ← Head: fix/process-pid-normalization


📝 Commits (1)

  • a4e5736 fix(process): honor disabled PID normalization in samples

📊 Changes

4 files changed (+291 additions, -5 deletions)

View changed files

➕ src/application/ProcessNormalization.test.ts (+167 -0)
📝 src/application/ProcessNormalization.ts (+12 -5)
➕ tests/boundary/process/processCaptureNormalization.test.ts (+93 -0)
➕ tests/fixtures/processIdentity.mjs (+19 -0)

📄 Description

Summary

Honor normalization.pids: false for numeric process-sample identities.

No separate issue: this is a reproduced caller-option/output mismatch.

Problem and expected behavior

An owned Linux Node process reports its real PID, parent PID, process group and session. With PID normalization explicitly disabled, capture-process still replaces those sample fields with 1/2/1/1, while the emitted Evidence and manifest commit pids: false.

The command-text path already respects the flag. The numeric sample projection should respect it too, without changing the default normalized behavior.

Change and scope

Condition only the four output identity fields on the PID-normalization setting. False preserves sampled values; true and the omitted/default setting retain the existing mapping.

Keep time bucketing, command normalization and independently selected path/port/pattern processing intact. Preserve null/zero sentinels, fresh output arrays and the explicit six-field output whitelist.

Contract and boundary impact

  • Semantic owner: process sample output normalization.
  • CLI/MCP: numeric sample identities now agree with the selected normalization policy; no schema or tool changes.
  • Provider/platform: shared projection is corrected; real process proof was run on Linux.
  • Evidence/provenance: scenario/comparison commitments and Evidence remain tied to the caller's normalization choice. No additional fields are exposed.
  • Process execution/ownership/cleanup: unchanged. Settlement, PID-reuse/start-time checks, process-group selection and cleanup continue using the original upstream samples; only the fresh output projection changes.
  • Generated metadata/package: unchanged.

Evidence and regression coverage

On unchanged main 217e8cf, six regression cases fail while seven controls pass.

Tests cover false/true/omitted settings, root/child/parent/group/session associations, null/zero values, all PID/path/port toggle combinations, independent time/pattern handling, immutable inputs and exclusion of extra runtime metadata.

An owned Linux fixture reads its identity independently from /proc/self/stat. Public capture and actual compiled CLI runs verify agreement among producer output, samples, Evidence parameters and manifest commitments. Both false and true captures exit successfully, quiesce and verify cleanup.

Validation performed

After fast-forwarding the unchanged reviewed patch to main 7f1fa64:

  • Focused normalization, capture, lifecycle, ownership, CLI and cleanup suites: 77 tests passed across 17 files, including real child/grandchild cleanup.
  • Build and npm run check: passed; all five tasks succeeded (101 warnings, no errors; none reference changed files).
  • npm run jscpd, npm run scan:todos, and git diff --check: passed.
  • Independent review completed before publication with no blocking findings.

Linux x64, Node.js 24.19.0, npm 11.9.0, exact locked dependencies. Hosted CI is tracked separately; no full local suite pass is claimed.

Compatibility, safety, and release

Default PID normalization is unchanged. No ownership, sampling, signaling, cleanup, schema, dependency, packaging or execution-authority changes.

The real process regression is Linux-specific; no real macOS/Windows, package-install, browser or Hopper/Ghidra claim is made.

Prepared with AI assistance.


🔄 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/703 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/6/2026 **Status:** ✅ Merged **Merged:** 10/6/2026 **Merged by:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Base:** `main` ← **Head:** `fix/process-pid-normalization` --- ### 📝 Commits (1) - [`a4e5736`](https://github.com/morluto/rea/commit/a4e57366dd75077bde07f25c7966204cedad929e) fix(process): honor disabled PID normalization in samples ### 📊 Changes **4 files changed** (+291 additions, -5 deletions) <details> <summary>View changed files</summary> ➕ `src/application/ProcessNormalization.test.ts` (+167 -0) 📝 `src/application/ProcessNormalization.ts` (+12 -5) ➕ `tests/boundary/process/processCaptureNormalization.test.ts` (+93 -0) ➕ `tests/fixtures/processIdentity.mjs` (+19 -0) </details> ### 📄 Description ## Summary Honor `normalization.pids: false` for numeric process-sample identities. No separate issue: this is a reproduced caller-option/output mismatch. ## Problem and expected behavior An owned Linux Node process reports its real PID, parent PID, process group and session. With PID normalization explicitly disabled, `capture-process` still replaces those sample fields with `1/2/1/1`, while the emitted Evidence and manifest commit `pids: false`. The command-text path already respects the flag. The numeric sample projection should respect it too, without changing the default normalized behavior. ## Change and scope Condition only the four output identity fields on the PID-normalization setting. False preserves sampled values; true and the omitted/default setting retain the existing mapping. Keep time bucketing, command normalization and independently selected path/port/pattern processing intact. Preserve null/zero sentinels, fresh output arrays and the explicit six-field output whitelist. ## Contract and boundary impact - Semantic owner: process sample output normalization. - CLI/MCP: numeric sample identities now agree with the selected normalization policy; no schema or tool changes. - Provider/platform: shared projection is corrected; real process proof was run on Linux. - Evidence/provenance: scenario/comparison commitments and Evidence remain tied to the caller's normalization choice. No additional fields are exposed. - Process execution/ownership/cleanup: unchanged. Settlement, PID-reuse/start-time checks, process-group selection and cleanup continue using the original upstream samples; only the fresh output projection changes. - Generated metadata/package: unchanged. ## Evidence and regression coverage On unchanged main `217e8cf`, six regression cases fail while seven controls pass. Tests cover false/true/omitted settings, root/child/parent/group/session associations, null/zero values, all PID/path/port toggle combinations, independent time/pattern handling, immutable inputs and exclusion of extra runtime metadata. An owned Linux fixture reads its identity independently from `/proc/self/stat`. Public capture and actual compiled CLI runs verify agreement among producer output, samples, Evidence parameters and manifest commitments. Both false and true captures exit successfully, quiesce and verify cleanup. ## Validation performed After fast-forwarding the unchanged reviewed patch to main `7f1fa64`: - Focused normalization, capture, lifecycle, ownership, CLI and cleanup suites: 77 tests passed across 17 files, including real child/grandchild cleanup. - Build and `npm run check`: passed; all five tasks succeeded (101 warnings, no errors; none reference changed files). - `npm run jscpd`, `npm run scan:todos`, and `git diff --check`: passed. - Independent review completed before publication with no blocking findings. Linux x64, Node.js 24.19.0, npm 11.9.0, exact locked dependencies. Hosted CI is tracked separately; no full local suite pass is claimed. ## Compatibility, safety, and release Default PID normalization is unchanged. No ownership, sampling, signaling, cleanup, schema, dependency, packaging or execution-authority changes. The real process regression is Linux-specific; no real macOS/Windows, package-install, browser or Hopper/Ghidra claim is made. Prepared with AI assistance. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:15:22 +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#2184
No description provided.