[PR #6298] [MERGED] fix(process): propagate comparison contradictions #7265

Closed
opened 2026-11-01 21:46:36 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6298
Author: @gongfpp
Created: 10/22/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @morluto

Base: main ← Head: fix/process-comparison-contradiction-6218


📝 Commits (1)

  • 49a0d66 fix(process): propagate comparison contradictions

📊 Changes

4 files changed (+202 additions, -9 deletions)

View changed files

📝 src/domain/changedBehavior.ts (+0 -9)
📝 src/domain/process/processCapture.comparison.test.ts (+58 -0)
📝 src/domain/process/processComparison.ts (+1 -0)
➕ tests/boundary/mcp/processComparisonVerificationMcp.test.ts (+143 -0)

📄 Description

Summary

Fixes #6218. Reject inconsistent imported process-comparison aggregates at their shared schema boundary instead of allowing a false successful reconstruction check.

Problem and expected behavior

A content-authenticated record could retain a contradictory dimension with an overall unchanged status. The shared aggregate derivation omitted contradiction, so both the schema and overall verification accepted it. Content authentication does not establish semantic consistency.

Change and scope

  • Propagate contradiction in the existing owner: truncated > contradiction > changed/added/removed > unknown > unchanged. Existing truncation and observed-change precedence remain intact.
  • Remove changedBehavior's unreachable duplicate aggregate check after the same owner schema has parsed the result.
  • No importer or verifier-specific repair, new capability, or target authority. Routine existing-workflow fix; advance maintainer scope decision is not applicable. Coordination: https://github.com/morluto/rea/issues/6218#issuecomment-6336807482. The proposed #724 explanations remain separate.

Contract and boundary impact

  • Owner: canonical process-comparison derivation/schema. CLI/MCP properties and enums are unchanged; runtime cross-field validation is tightened.
  • Imported Evidence IDs, source links and original records remain unchanged and retained. No provider/bridge, package, installation or generated-metadata change.
  • Read existing files or captured data.

No target execution, injection, mutation, network acquisition or protection recovery is added.

Evidence and regression coverage

  • On base 933af60eba43c29f1fb1c606fddcd725ae0d9d96, the new regressions failed: 12 failures / 7 passes, including the production-registration MCP scenario returning success for the inconsistent comparison.
  • Domain cases cover each of five contradictory dimensions and seven mixed-status pairs in both orders.
  • The MCP SDK in-memory workflow imports a canonical bundle, rejects both overall and selected claims on the inconsistent record with invalid_request / invalid_value, and retains every original record. A consistent contradiction fails both claims; the public compare_process_captures unchanged control still verifies successfully. The same connection remains usable; no provider launches.

Validation performed

macOS arm64, pinned Node.js 24.18.0 / npm 11.16.0, complete locked dependencies. After incorporating upstream 66aacc6fba7fb498302ca58894f179d77a847444:

  • Focused source/MCP regression selection below: 95 tests passed across 7 files.
  • npm run check — passed (typecheck, lint, format, knip, metadata, module and architecture guards).
  • npm run verify:test-discovery — passed; every test file discovered exactly once.
  • git diff --check — passed.
Focused test command
npm run test:focused -- src/domain/process/processCapture.comparison.test.ts src/domain/changedBehavior.test.ts src/domain/staticRuntimeCorrelation.test.ts src/domain/reconstructionVerification.test.ts tests/boundary/mcp/processComparisonVerificationMcp.test.ts tests/boundary/mcp/processComparisonDiagnosticsMcp.test.ts tests/boundary/mcp/processEvidenceIdentityMcp.test.ts

Compatibility, safety, and release

Previously accepted comparison aggregates that disagree with contradictory dimensions must be recomputed from retained source captures before consumption. Generic import still retains those records; this change does not rewrite or rehash them. Consistent contradiction records remain explicit failures for reconstruction verification.

This does not redefine all downstream contradiction reporting: existing find_changed_behavior aggregation and static/runtime correlation semantics have separate limitations (#6217 concerns the latter). No claim of complete contradiction-consumer correctness is made.

Not run: stdio/installed-client, real process capture/provider, Windows/Linux, or the full CI suite. No performance claim. Upstream CI and maintainer approval are not established by local checks.

Author readiness

Human owner: @gongfpp

AI-assisted contribution; the human owner confirmed completion of the review and readiness declaration and requested initial maintainer review.

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • Human ownership/readiness and required current-head CI checks are complete.
  • Maintainer review confirms the intended mixed-status precedence and contribution scope.

🔄 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/6298 **Author:** [@gongfpp](https://github.com/gongfpp) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/process-comparison-contradiction-6218` --- ### 📝 Commits (1) - [`49a0d66`](https://github.com/morluto/rea/commit/49a0d66f0fd5b69a61089b18594a5ecb3326cbd1) fix(process): propagate comparison contradictions ### 📊 Changes **4 files changed** (+202 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/changedBehavior.ts` (+0 -9) 📝 `src/domain/process/processCapture.comparison.test.ts` (+58 -0) 📝 `src/domain/process/processComparison.ts` (+1 -0) ➕ `tests/boundary/mcp/processComparisonVerificationMcp.test.ts` (+143 -0) </details> ### 📄 Description ## Summary Fixes #6218. Reject inconsistent imported process-comparison aggregates at their shared schema boundary instead of allowing a false successful reconstruction check. ## Problem and expected behavior A content-authenticated record could retain a contradictory dimension with an overall `unchanged` status. The shared aggregate derivation omitted `contradiction`, so both the schema and overall verification accepted it. Content authentication does not establish semantic consistency. ## Change and scope - Propagate `contradiction` in the existing owner: `truncated > contradiction > changed/added/removed > unknown > unchanged`. Existing truncation and observed-change precedence remain intact. - Remove `changedBehavior`'s unreachable duplicate aggregate check after the same owner schema has parsed the result. - No importer or verifier-specific repair, new capability, or target authority. Routine existing-workflow fix; advance maintainer scope decision is not applicable. Coordination: https://github.com/morluto/rea/issues/6218#issuecomment-6336807482. The proposed #724 explanations remain separate. ## Contract and boundary impact - Owner: canonical process-comparison derivation/schema. CLI/MCP properties and enums are unchanged; runtime cross-field validation is tightened. - Imported Evidence IDs, source links and original records remain unchanged and retained. No provider/bridge, package, installation or generated-metadata change. - [x] Read existing files or captured data. No target execution, injection, mutation, network acquisition or protection recovery is added. ## Evidence and regression coverage - On base `933af60eba43c29f1fb1c606fddcd725ae0d9d96`, the new regressions failed: **12 failures / 7 passes**, including the production-registration MCP scenario returning success for the inconsistent comparison. - Domain cases cover each of five contradictory dimensions and seven mixed-status pairs in both orders. - The MCP SDK in-memory workflow imports a canonical bundle, rejects both overall and selected claims on the inconsistent record with `invalid_request` / `invalid_value`, and retains every original record. A consistent contradiction fails both claims; the public `compare_process_captures` unchanged control still verifies successfully. The same connection remains usable; no provider launches. ## Validation performed macOS arm64, pinned Node.js 24.18.0 / npm 11.16.0, complete locked dependencies. After incorporating upstream `66aacc6fba7fb498302ca58894f179d77a847444`: - Focused source/MCP regression selection below: **95 tests passed across 7 files**. - `npm run check` — passed (typecheck, lint, format, knip, metadata, module and architecture guards). - `npm run verify:test-discovery` — passed; every test file discovered exactly once. - `git diff --check` — passed. <details><summary>Focused test command</summary> ```sh npm run test:focused -- src/domain/process/processCapture.comparison.test.ts src/domain/changedBehavior.test.ts src/domain/staticRuntimeCorrelation.test.ts src/domain/reconstructionVerification.test.ts tests/boundary/mcp/processComparisonVerificationMcp.test.ts tests/boundary/mcp/processComparisonDiagnosticsMcp.test.ts tests/boundary/mcp/processEvidenceIdentityMcp.test.ts ``` </details> ## Compatibility, safety, and release Previously accepted comparison aggregates that disagree with contradictory dimensions must be recomputed from retained source captures before consumption. Generic import still retains those records; this change does not rewrite or rehash them. Consistent contradiction records remain explicit failures for reconstruction verification. This does **not** redefine all downstream contradiction reporting: existing `find_changed_behavior` aggregation and static/runtime correlation semantics have separate limitations (#6217 concerns the latter). No claim of complete contradiction-consumer correctness is made. Not run: stdio/installed-client, real process capture/provider, Windows/Linux, or the full CI suite. No performance claim. Upstream CI and maintainer approval are not established by local checks. ## Author readiness Human owner: @gongfpp AI-assisted contribution; the human owner confirmed completion of the review and readiness declaration and requested initial maintainer review. - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [ ] Human ownership/readiness and required current-head CI checks are complete. - [ ] Maintainer review confirms the intended mixed-status precedence and contribution scope. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:46:36 +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#7265
No description provided.