[PR #732] [MERGED] fix(process): scope comparison unknowns to their evidence #2200

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

📋 Pull Request Information

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

Base: main ← Head: fix/719-retained-process-comparison


📝 Commits (1)

  • 20bcff7 fix(process): scope comparison unknowns to their evidence

📊 Changes

2 files changed (+57 additions, -3 deletions)

View changed files

📝 src/server/registerProcessComparisonTool.ts (+5 -1)
📝 tests/boundary/mcp/serverUnknownsMcp.test.ts (+52 -2)

📄 Description

Summary

Fixes #719. Comparing multiple process capture pairs that disagree in the same dimensions could fail with revision_conflict / already-exists in a retained MCP session. Automatic unknown questions now include the immutable comparison Evidence identity, so independent comparisons coexist and exact repeats remain idempotent.

Problem and expected behavior

The unknown registry keys questions by domain, question text, and subject scope. Process comparisons have no subject and used the same question for different capture pairs; their distinct revision contents then collided. Each automatic comparison question must describe its own exact comparison, including source records and trace policy.

Change and scope

Scope process-comparison unknown questions to their derived Evidence ID. Extend the real SDK boundary regression to compare independent observations with the same disagreement dimensions, retain both unknowns, and repeat a comparison without changing the bundle. Manual unknown identity and revision-conflict rules retain their existing behavior.

Contract and boundary impact

  • Semantic owner and earliest changed stage: MCP process-comparison result registration.
  • CLI and MCP/tool-catalog contract: tool names and input/output schemas are unchanged; automatic MCP unknown question text and resulting unknown IDs include the comparison identity.
  • Provider, bridge, target-format, or platform compatibility: no provider protocol changes.
  • Evidence, artifact, provenance, or reconstruction contract: comparison Evidence and source links are preserved; automatic unknowns are scoped to exact comparisons.
  • Process execution, authorization, cleanup, or containment impact: none.
  • Generated metadata, package, or installation impact: none; generated-document checks passed.

Evidence and regression coverage

  • Tests updated: SDK MCP unknown registration, independent capture pairs, malformed Evidence admission, bundle stability on exact repeat; existing process consumer/provider-identity and manual unknown revision tests.

  • Base reproduction: the new boundary regression failed on the base with the exact revision_conflict / already-exists outcome before the fix.

  • Executed evidence: original evaluation capture records replayed through a real stdio server; real PTY captures A/B/A and two comparisons succeeded on one connection, with four independently scoped unknowns and verified process/temporary-root cleanup.

  • Representative MCP flow: compare_process_captures({left: A.evidence, right: A2.evidence}) succeeds after an earlier A/B comparison; repeating A/A2 returns the same Evidence without additional registry entries.

  • Remaining proof gaps: real Hopper/Ghidra and Windows were not exercised; this change concerns derived process comparison registration.

  • Observed, derived, and inferred claims remain distinguishable.

  • Artifact identity, source provenance, and failed attempts remain preserved.

  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npm run test:focused -- tests/boundary/mcp/serverUnknownsMcp.test.ts tests/boundary/mcp/processEvidenceIdentityMcp.test.ts src/application/EvidenceLedger.residualUnknown.test.ts — 32 tests passed.
  • npm run test:local -- src/application/EvidenceLedger.test.ts — 5 tests passed.
  • npm run check:fast — typecheck and lint passed.
  • npm run docs:check — generated contracts/documents passed.
  • Real stdio SDK original-Evidence replay and actual PTY capture regression — passed; owned groups verified and temporary roots removed.
  • git diff --check — passed.

Compatibility, safety, and release

No public schema or installation changes. Automatic unknown questions have a new identity context; existing imported records remain intact. Source records, comparison provenance, and manual registry conflicts were reviewed. Validation ran with two-CPU affinity and bounded Node heaps; no deep provider was launched. No private host paths or credentials are included.

Review checklist

  • One focused outcome; conventional PR title.
  • Related issue linked.
  • Tests cover observable behavior and meaningful failures.
  • Docs/contracts/generated metadata checked where applicable.
  • Representative MCP behavior included.
  • Final diff checked for secrets, unrelated cleanup, and unsupported claims.

🔄 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/732 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/6/2026 **Status:** ✅ Merged **Merged:** 10/6/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/719-retained-process-comparison` --- ### 📝 Commits (1) - [`20bcff7`](https://github.com/morluto/rea/commit/20bcff76f372485f8228c1b253761372b4ad0f8c) fix(process): scope comparison unknowns to their evidence ### 📊 Changes **2 files changed** (+57 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/server/registerProcessComparisonTool.ts` (+5 -1) 📝 `tests/boundary/mcp/serverUnknownsMcp.test.ts` (+52 -2) </details> ### 📄 Description ## Summary Fixes #719. Comparing multiple process capture pairs that disagree in the same dimensions could fail with `revision_conflict / already-exists` in a retained MCP session. Automatic unknown questions now include the immutable comparison Evidence identity, so independent comparisons coexist and exact repeats remain idempotent. ## Problem and expected behavior The unknown registry keys questions by domain, question text, and subject scope. Process comparisons have no subject and used the same question for different capture pairs; their distinct revision contents then collided. Each automatic comparison question must describe its own exact comparison, including source records and trace policy. ## Change and scope Scope process-comparison unknown questions to their derived Evidence ID. Extend the real SDK boundary regression to compare independent observations with the same disagreement dimensions, retain both unknowns, and repeat a comparison without changing the bundle. Manual unknown identity and revision-conflict rules retain their existing behavior. ## Contract and boundary impact - Semantic owner and earliest changed stage: MCP process-comparison result registration. - CLI and MCP/tool-catalog contract: tool names and input/output schemas are unchanged; automatic MCP unknown question text and resulting unknown IDs include the comparison identity. - Provider, bridge, target-format, or platform compatibility: no provider protocol changes. - Evidence, artifact, provenance, or reconstruction contract: comparison Evidence and source links are preserved; automatic unknowns are scoped to exact comparisons. - Process execution, authorization, cleanup, or containment impact: none. - Generated metadata, package, or installation impact: none; generated-document checks passed. ## Evidence and regression coverage - Tests updated: SDK MCP unknown registration, independent capture pairs, malformed Evidence admission, bundle stability on exact repeat; existing process consumer/provider-identity and manual unknown revision tests. - Base reproduction: the new boundary regression failed on the base with the exact `revision_conflict / already-exists` outcome before the fix. - Executed evidence: original evaluation capture records replayed through a real stdio server; real PTY captures A/B/A and two comparisons succeeded on one connection, with four independently scoped unknowns and verified process/temporary-root cleanup. - Representative MCP flow: `compare_process_captures({left: A.evidence, right: A2.evidence})` succeeds after an earlier A/B comparison; repeating A/A2 returns the same Evidence without additional registry entries. - Remaining proof gaps: real Hopper/Ghidra and Windows were not exercised; this change concerns derived process comparison registration. - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed - `npm run test:focused -- tests/boundary/mcp/serverUnknownsMcp.test.ts tests/boundary/mcp/processEvidenceIdentityMcp.test.ts src/application/EvidenceLedger.residualUnknown.test.ts` — 32 tests passed. - `npm run test:local -- src/application/EvidenceLedger.test.ts` — 5 tests passed. - `npm run check:fast` — typecheck and lint passed. - `npm run docs:check` — generated contracts/documents passed. - Real stdio SDK original-Evidence replay and actual PTY capture regression — passed; owned groups verified and temporary roots removed. - `git diff --check` — passed. ## Compatibility, safety, and release No public schema or installation changes. Automatic unknown questions have a new identity context; existing imported records remain intact. Source records, comparison provenance, and manual registry conflicts were reviewed. Validation ran with two-CPU affinity and bounded Node heaps; no deep provider was launched. No private host paths or credentials are included. ## Review checklist - [x] One focused outcome; conventional PR title. - [x] Related issue linked. - [x] Tests cover observable behavior and meaningful failures. - [x] Docs/contracts/generated metadata checked where applicable. - [x] Representative MCP behavior included. - [x] Final diff checked for secrets, unrelated cleanup, and unsupported claims. --- <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: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#2200
No description provided.