[PR #4065] [MERGED] fix(process): retain selected freshness requirement in comparison Evidence parameters #6030

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4065
Author: @Swatantra-66
Created: 10/15/2026
Status: ✅ Merged
Merged: 10/16/2026
Merged by: @morluto

Base: main ← Head: fix/process-comparison-freshness-evidence


📝 Commits (1)

  • 7883b40 fix(process): retain selected freshness requirement in comparison Evidence parameters

📊 Changes

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

View changed files

📝 src/server/registerProcessComparisonTool.ts (+3 -0)
📝 tests/boundary/mcp/processComparisonDiagnosticsMcp.test.ts (+40 -3)

📄 Description

Summary

Fixes #4000.

compare_process_captures enforces an explicit max_capture_age_ms requirement but previously omitted it from returned and session-retained comparison Evidence parameters. This caused otherwise identical process comparisons with and without an explicit freshness requirement to derive identical evidence_id hashes, losing the provenance of the freshness check.

This PR projects caller-selected max_capture_age_ms into the recorded Evidence parameters, ensuring that freshness-constrained comparisons derive distinct semantic Evidence identities and preserve their provenance across returned tool results and session storage.

Problem and expected behavior

When compare_process_captures was called with max_capture_age_ms, the freshness constraint was passed to compareProcessCaptures(), but omitted during createEvidence() parameters construction in registerProcessComparisonTool.ts. As a result:

  • Neither the caller nor downstream evidence consumers could audit whether a freshness policy had been applied.
  • Comparing the same captures with vs without max_capture_age_ms produced the same evidence_id, violating semantic uniqueness.

Expected behavior: A caller's explicit max_capture_age_ms selection is preserved in the Evidence parameters, distinguishing its derived evidence_id from an unconstrained comparison and maintaining traceability in session.evidenceById().

Change and scope

  • In src/server/registerProcessComparisonTool.ts, project max_capture_age_ms into createEvidence({ parameters: { ... } }) when defined on the tool input.
  • Added boundary regression coverage in tests/boundary/mcp/processComparisonDiagnosticsMcp.test.ts.

Contract and boundary impact

  • Semantic owner and earliest changed stage: MCP tool registration (compare_process_captures)
  • Contribution scope fit and linked maintainer decision: Ordinary bug fix within existing tool boundaries.
  • CLI and MCP/tool-catalog contract: Adheres to existing processComparisonInputSchema.
  • Provider, bridge, target-format, or platform compatibility: Cross-platform; no provider execution required.
  • Evidence, artifact, provenance, or reconstruction contract: Preserves caller-selected freshness verification parameters in Evidence parameters.
  • Target selection, authority, upstream behavior, and cleanup details: Not applicable.
  • Generated metadata impact: None.

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: tests/boundary/mcp/processComparisonDiagnosticsMcp.test.ts ("retains a selected max_capture_age_ms requirement in comparison Evidence parameters")
  • Base reproduction: The added assertion fails on baseline main with:
    AssertionError: expected { ... } to have property "max_capture_age_ms" with value 9007199254740991
    Received: undefined
    
    Passes cleanly with the fix applied.
  • Remaining proof gaps: None.

For evidence-bearing changes:

  • 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

Executed locally on Windows 11 x64 (Node 24.18.0):

  • npm run test:focused -- tests/boundary/mcp/processComparisonDiagnosticsMcp.test.ts — 16/16 tests passed.
  • npm run check:fast — turbo typecheck & lint passed.
  • npm run docs:check — 6/6 documentation and catalog conformance checks passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: None. Existing unconstrained calls remain identical.
  • Real Hopper/Ghidra, browser, or OS coverage: Cross-platform in-memory MCP transport; no native tools required.
  • Package or release metadata impact: None.
  • Security, privacy, process, or containment review: Fully sandboxed.

Author readiness

Human owner: @Swatantra-66

  • 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

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff 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/4065 **Author:** [@Swatantra-66](https://github.com/Swatantra-66) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/16/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/process-comparison-freshness-evidence` --- ### 📝 Commits (1) - [`7883b40`](https://github.com/morluto/rea/commit/7883b403a5973e2480d1088fd0a364849185dcf9) fix(process): retain selected freshness requirement in comparison Evidence parameters ### 📊 Changes **2 files changed** (+43 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/server/registerProcessComparisonTool.ts` (+3 -0) 📝 `tests/boundary/mcp/processComparisonDiagnosticsMcp.test.ts` (+40 -3) </details> ### 📄 Description ## Summary Fixes #4000. `compare_process_captures` enforces an explicit `max_capture_age_ms` requirement but previously omitted it from returned and session-retained comparison Evidence `parameters`. This caused otherwise identical process comparisons with and without an explicit freshness requirement to derive identical `evidence_id` hashes, losing the provenance of the freshness check. This PR projects caller-selected `max_capture_age_ms` into the recorded Evidence `parameters`, ensuring that freshness-constrained comparisons derive distinct semantic Evidence identities and preserve their provenance across returned tool results and session storage. ## Problem and expected behavior When `compare_process_captures` was called with `max_capture_age_ms`, the freshness constraint was passed to `compareProcessCaptures()`, but omitted during `createEvidence()` parameters construction in `registerProcessComparisonTool.ts`. As a result: - Neither the caller nor downstream evidence consumers could audit whether a freshness policy had been applied. - Comparing the same captures with vs without `max_capture_age_ms` produced the same `evidence_id`, violating semantic uniqueness. Expected behavior: A caller's explicit `max_capture_age_ms` selection is preserved in the Evidence `parameters`, distinguishing its derived `evidence_id` from an unconstrained comparison and maintaining traceability in `session.evidenceById()`. ## Change and scope - In `src/server/registerProcessComparisonTool.ts`, project `max_capture_age_ms` into `createEvidence({ parameters: { ... } })` when defined on the tool input. - Added boundary regression coverage in `tests/boundary/mcp/processComparisonDiagnosticsMcp.test.ts`. ## Contract and boundary impact - Semantic owner and earliest changed stage: MCP tool registration (`compare_process_captures`) - Contribution scope fit and linked maintainer decision: Ordinary bug fix within existing tool boundaries. - CLI and MCP/tool-catalog contract: Adheres to existing `processComparisonInputSchema`. - Provider, bridge, target-format, or platform compatibility: Cross-platform; no provider execution required. - Evidence, artifact, provenance, or reconstruction contract: Preserves caller-selected freshness verification parameters in Evidence `parameters`. - Target selection, authority, upstream behavior, and cleanup details: Not applicable. - Generated metadata impact: None. Expected effects: - [x] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added or updated: `tests/boundary/mcp/processComparisonDiagnosticsMcp.test.ts` (`"retains a selected max_capture_age_ms requirement in comparison Evidence parameters"`) - Base reproduction: The added assertion fails on baseline `main` with: ```text AssertionError: expected { ... } to have property "max_capture_age_ms" with value 9007199254740991 Received: undefined ``` Passes cleanly with the fix applied. - Remaining proof gaps: None. For evidence-bearing changes: - [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 Executed locally on Windows 11 x64 (Node 24.18.0): - `npm run test:focused -- tests/boundary/mcp/processComparisonDiagnosticsMcp.test.ts` — 16/16 tests passed. - `npm run check:fast` — turbo typecheck & lint passed. - `npm run docs:check` — 6/6 documentation and catalog conformance checks passed. ## Compatibility, safety, and release - Breaking changes or migration steps: None. Existing unconstrained calls remain identical. - Real Hopper/Ghidra, browser, or OS coverage: Cross-platform in-memory MCP transport; no native tools required. - Package or release metadata impact: None. - Security, privacy, process, or containment review: Fully sandboxed. ## Author readiness Human owner: @Swatantra-66 - [ ] 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 - [ ] This PR addresses a concrete problem or an agreed enhancement. - [ ] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [ ] The PR has one focused outcome and the title follows `type(scope): outcome`. - [ ] Related issue is linked, or the reason for not linking one is stated above. - [ ] Tests cover changed observable behavior and meaningful failure paths. - [ ] Owning docs, contracts, and generated metadata are updated where needed. - [ ] User-visible CLI/MCP changes include representative output. - [ ] I checked the final diff 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-31 01:11:18 +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#6030
No description provided.