[PR #2929] [CLOSED] fix(process): attribute a different trace verdict to its failing dimensions #5496

Closed
opened 2026-10-31 01:07:06 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2929
Author: @kevin9327
Created: 10/13/2026
Status: ❌ Closed

Base: main ← Head: fix/trace-dimension-attribution


📝 Commits (2)

  • 97e293d fix(process): attribute a different trace verdict to its failing dimensions
  • 1284d39 fix(process): retain all ordering failure attribution

📊 Changes

3 files changed (+221 additions, -47 deletions)

View changed files

📝 src/domain/process/processComparison.ts (+34 -2)
📝 src/domain/process/processTraceComparison.test.ts (+134 -0)
📝 src/domain/process/processTraceEvaluation.ts (+53 -45)

📄 Description

Summary

Fixes #2616.

With a trace specification, compareProcessCaptures marked every covered dimension changed whenever the trace verdict was different, even when that dimension's observations were identical. A terminal-only difference also reported process: changed, and a process-only difference also reported terminal: changed.

Problem and expected behavior

Trigger: two captures with the same process sample and journal order whose only difference is the terminal frame text, compared with a terminal+process partial-order specification. The exact comparison reports terminal=changed, process=unchanged. The traced comparison reported terminal=changed, process=changed, because the different branch in applyTraceVerdict returned changed before checking which dimension diverged.

Expected: a different verdict should apply only to the dimensions it implicates. The overall trace verdict stays different.

Change and scope

In applyTraceVerdict, the different branch now:

  • keeps any non-unchanged exact status as changed (same as before);
  • marks an exact-unchanged dimension changed only when the trace diagnostic implicates it, either through the diagnostic's declared event_ids (mapped by event source) or its observation locations (mapped by collection);
  • falls back to the old behavior (all covered dimensions) when the diagnostic names nothing.

Ordering failures (edge diagnostics) name both ordered events, so a pure reordering still marks both dimensions changed. No change to trace evaluation, schemas, CLI/MCP shapes, or the overall status.

Contract and boundary impact

  • Semantic owner and earliest changed stage: src/domain/process/processComparison.ts (applyTraceVerdict).

  • Contribution scope fit and linked maintainer decision: routine fix within existing boundaries; not applicable.

  • CLI and MCP/tool-catalog contract: no shape change. Per-dimension statuses are more accurate for traced comparisons.

  • Provider, bridge, target-format, or platform compatibility: none.

  • Evidence, artifact, provenance, or reconstruction contract: none.

  • Target selection, authority, upstream behavior, and cleanup details: not applicable.

  • Generated metadata, package, or installation impact: none.

  • Read existing files or captured data.

Evidence and regression coverage

  • Tests added: process trace dimension attribution in src/domain/process/processTraceComparison.test.ts, covering a terminal-only predicate failure, a process-only predicate failure, and a reordering control that still marks both dimensions changed.
  • Base reproduction: on the base revision the new predicate-failure test fails (process: changed, expected unchanged). With the fix it passes.
  • Remaining proof gaps: verified with synthetic parsed captures on Linux. I did not record a real terminal capture.

Validation performed

Node.js 24.18.0, Linux x64:

  • npx vitest run src/domain/process — 56/56 passed, including the issue's reproduction test, which was run locally and not committed
  • npx vitest run src/domain/process/processTraceComparison.test.ts with the fix stashed — 1 failed, as expected
  • npx vitest run tests/boundary/mcp/processTraceAdaptersParity.test.ts tests/boundary/filesystem/processCliFileInput.test.ts — 12/12 passed
  • npx vitest run --project domain --project services — 3357 passed. The only 5 failures are the pre-existing reconstructionVerification.functionSources.test.ts failures on current main, which #2853 addresses.
  • npx tsc --noEmit -p tsconfig.json, npx oxfmt --check, npx oxlint src/domain/process/ — clean; oxlint reported only existing warnings in an unrelated file

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none; this is domain comparison logic only.

🔄 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/2929 **Author:** [@kevin9327](https://github.com/kevin9327) **Created:** 10/13/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/trace-dimension-attribution` --- ### 📝 Commits (2) - [`97e293d`](https://github.com/morluto/rea/commit/97e293d7ec532fb8e8725722703ff515194c8d9b) fix(process): attribute a different trace verdict to its failing dimensions - [`1284d39`](https://github.com/morluto/rea/commit/1284d39d0c19f0aac7dd244337d1b829ea710513) fix(process): retain all ordering failure attribution ### 📊 Changes **3 files changed** (+221 additions, -47 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/process/processComparison.ts` (+34 -2) 📝 `src/domain/process/processTraceComparison.test.ts` (+134 -0) 📝 `src/domain/process/processTraceEvaluation.ts` (+53 -45) </details> ### 📄 Description ## Summary Fixes #2616. With a trace specification, `compareProcessCaptures` marked every covered dimension `changed` whenever the trace verdict was `different`, even when that dimension's observations were identical. A terminal-only difference also reported `process: changed`, and a process-only difference also reported `terminal: changed`. ## Problem and expected behavior Trigger: two captures with the same process sample and journal order whose only difference is the terminal frame text, compared with a terminal+process partial-order specification. The exact comparison reports `terminal=changed, process=unchanged`. The traced comparison reported `terminal=changed, process=changed`, because the `different` branch in `applyTraceVerdict` returned `changed` before checking which dimension diverged. Expected: a `different` verdict should apply only to the dimensions it implicates. The overall trace verdict stays `different`. ## Change and scope In `applyTraceVerdict`, the `different` branch now: - keeps any non-`unchanged` exact status as `changed` (same as before); - marks an exact-`unchanged` dimension `changed` only when the trace diagnostic implicates it, either through the diagnostic's declared `event_ids` (mapped by event source) or its observation `locations` (mapped by collection); - falls back to the old behavior (all covered dimensions) when the diagnostic names nothing. Ordering failures (`edge` diagnostics) name both ordered events, so a pure reordering still marks both dimensions `changed`. No change to trace evaluation, schemas, CLI/MCP shapes, or the overall status. ## Contract and boundary impact - Semantic owner and earliest changed stage: `src/domain/process/processComparison.ts` (`applyTraceVerdict`). - Contribution scope fit and linked maintainer decision: routine fix within existing boundaries; not applicable. - CLI and MCP/tool-catalog contract: no shape change. Per-dimension statuses are more accurate for traced comparisons. - Provider, bridge, target-format, or platform compatibility: none. - Evidence, artifact, provenance, or reconstruction contract: none. - Target selection, authority, upstream behavior, and cleanup details: not applicable. - Generated metadata, package, or installation impact: none. - [x] Read existing files or captured data. ## Evidence and regression coverage - Tests added: `process trace dimension attribution` in `src/domain/process/processTraceComparison.test.ts`, covering a terminal-only predicate failure, a process-only predicate failure, and a reordering control that still marks both dimensions changed. - Base reproduction: on the base revision the new predicate-failure test fails (`process: changed`, expected `unchanged`). With the fix it passes. - Remaining proof gaps: verified with synthetic parsed captures on Linux. I did not record a real terminal capture. ## Validation performed Node.js 24.18.0, Linux x64: - `npx vitest run src/domain/process` — 56/56 passed, including the issue's reproduction test, which was run locally and not committed - `npx vitest run src/domain/process/processTraceComparison.test.ts` with the fix stashed — 1 failed, as expected - `npx vitest run tests/boundary/mcp/processTraceAdaptersParity.test.ts tests/boundary/filesystem/processCliFileInput.test.ts` — 12/12 passed - `npx vitest run --project domain --project services` — 3357 passed. The only 5 failures are the pre-existing `reconstructionVerification.functionSources.test.ts` failures on current `main`, which #2853 addresses. - `npx tsc --noEmit -p tsconfig.json`, `npx oxfmt --check`, `npx oxlint src/domain/process/` — clean; oxlint reported only existing warnings in an unrelated file ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: not applicable. - Package or release metadata impact: none. - Security, privacy, process, or containment review: none; this is domain comparison logic only. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:07:06 +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#5496
No description provided.