[PR #1263] [MERGED] fix(process): preserve numeric output and original PTY evidence #2748

Closed
opened 2026-10-17 21:09:46 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1263
Author: @N0zoM1z0
Created: 10/9/2026
Status: ✅ Merged
Merged: 10/9/2026
Merged by: @N0zoM1z0

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


📝 Commits (1)

  • 00d8e44 fix(process): preserve numeric output and original PTY evidence

📊 Changes

10 files changed (+168 additions, -7 deletions)

View changed files

📝 docs/process-capture.md (+17 -0)
📝 src/domain/process/processCapture.comparison.test.ts (+22 -0)
📝 src/domain/process/processCapture.ts (+3 -0)
📝 src/domain/process/processComparison.ts (+5 -1)
📝 src/domain/process/processObservation.ts (+16 -3)
📝 src/domain/process/processScenario.ts (+3 -0)
📝 src/process/capture/ProcessCaptureLifecycle.ts (+1 -0)
📝 src/process/capture/ProcessNormalization.test.ts (+32 -1)
📝 src/process/capture/ProcessNormalization.ts (+23 -2)
📝 tests/boundary/process/processCaptureNormalization.test.ts (+46 -0)

📄 Description

Default port normalization replaced ordinary compact JSON numbers, counters and file line numbers with <port>, hiding meaningful changes in process comparisons. Recognize explicit port fields and valid URL/IP/localhost endpoints instead, and commit the normalization version to prevent legacy captures from being treated as the same comparison contract.

When normalization changes a PTY chunk, retain its original text in optional frames[].raw_data. Evidence commits both representations; comparisons and trace assertions consume normalized data. Existing result fields and tool inventory remain complete.

Sanitized example: {"score":20,"height":480} remains unchanged; listen:8080 becomes listen:<port> with raw_data: "listen:8080".

Validation:

  • Focused source, actual PTY, Evidence/comparison and MCP boundary suites: 9 files, 54 tests passed.
  • Converted MCP JSON Schema validity suite passed.
  • npm run check and npm run docs:check passed.
  • Real compiled CLI and stdio MCP client: default and disabled normalization, original-text round trip, child cleanup and subsequent ping passed (139 advertised tools).

No Hopper/Ghidra verification was needed or performed for this process-only change. Local checks used two CPUs with bounded Node heap and sampled process-family RSS.

Closes #1241. Related to #1065.


🔄 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/1263 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/9/2026 **Status:** ✅ Merged **Merged:** 10/9/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/process-normalization-fidelity` --- ### 📝 Commits (1) - [`00d8e44`](https://github.com/morluto/rea/commit/00d8e44cbf82caa51709c2e0857fbaa69ea329b7) fix(process): preserve numeric output and original PTY evidence ### 📊 Changes **10 files changed** (+168 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `docs/process-capture.md` (+17 -0) 📝 `src/domain/process/processCapture.comparison.test.ts` (+22 -0) 📝 `src/domain/process/processCapture.ts` (+3 -0) 📝 `src/domain/process/processComparison.ts` (+5 -1) 📝 `src/domain/process/processObservation.ts` (+16 -3) 📝 `src/domain/process/processScenario.ts` (+3 -0) 📝 `src/process/capture/ProcessCaptureLifecycle.ts` (+1 -0) 📝 `src/process/capture/ProcessNormalization.test.ts` (+32 -1) 📝 `src/process/capture/ProcessNormalization.ts` (+23 -2) 📝 `tests/boundary/process/processCaptureNormalization.test.ts` (+46 -0) </details> ### 📄 Description Default port normalization replaced ordinary compact JSON numbers, counters and file line numbers with `<port>`, hiding meaningful changes in process comparisons. Recognize explicit port fields and valid URL/IP/localhost endpoints instead, and commit the normalization version to prevent legacy captures from being treated as the same comparison contract. When normalization changes a PTY chunk, retain its original text in optional `frames[].raw_data`. Evidence commits both representations; comparisons and trace assertions consume normalized `data`. Existing result fields and tool inventory remain complete. Sanitized example: `{"score":20,"height":480}` remains unchanged; `listen:8080` becomes `listen:<port>` with `raw_data: "listen:8080"`. Validation: - Focused source, actual PTY, Evidence/comparison and MCP boundary suites: 9 files, 54 tests passed. - Converted MCP JSON Schema validity suite passed. - `npm run check` and `npm run docs:check` passed. - Real compiled CLI and stdio MCP client: default and disabled normalization, original-text round trip, child cleanup and subsequent ping passed (139 advertised tools). No Hopper/Ghidra verification was needed or performed for this process-only change. Local checks used two CPUs with bounded Node heap and sampled process-family RSS. Closes #1241. Related to #1065. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:09:46 +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#2748
No description provided.