Skip to content

fix(process): honor disabled PID normalization in samples - #703

Merged
kaoru0822-kitauji merged 1 commit into
morluto:mainfrom
kaoru0822-kitauji:fix/process-pid-normalization
Oct 6, 2026
Merged

kaoru0822-kitauji merged 1 commit into
morluto:mainfrom
kaoru0822-kitauji:fix/process-pid-normalization

Conversation

@kaoru0822-kitauji

Copy link
Copy Markdown
Collaborator

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.

Copy link
Copy Markdown
Collaborator Author

@codex review

@kaoru0822-kitauji
kaoru0822-kitauji merged commit 44b3627 into morluto:main Oct 6, 2026
18 checks passed
darsrc pushed a commit to darsrc/rea that referenced this pull request Oct 10, 2026
…-normalization

fix(process): honor disabled PID normalization in samples
@morluto morluto added bug Something isn't working area: runtime Process capture and runtime observation labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: runtime Process capture and runtime observation bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants