Skip to content

fix(process): retain selected freshness requirement in comparison Evidence parameters - #4065

Merged
morluto merged 1 commit into
morluto:mainfrom
Swatantra-66:fix/process-comparison-freshness-evidence
Oct 16, 2026
Merged

morluto merged 1 commit into
morluto:mainfrom
Swatantra-66:fix/process-comparison-freshness-evidence

Conversation

@Swatantra-66

Copy link
Copy Markdown
Contributor

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.

…dence parameters

Preserve caller-selected max_capture_age_ms in compare_process_captures Evidence parameters so returned and session-retained records distinguish freshness-constrained comparisons and derive distinct semantic Evidence identities.

Add boundary MCP regression coverage asserting that max_capture_age_ms is omitted when unconstrained, retained in parameters and session evidence when specified, and differentiates comparison Evidence IDs.

Closes morluto#4000
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-15T09:57:31.018501Z 7883b40 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This PR appears safe to merge.

Summary

Preserves caller-selected max_capture_age_ms in process comparison Evidence.

  • Process comparisons keep the selected capture-age limit in Evidence.

Reviews (1) · Last reviewed commit: "fix(process): retain selected freshness ..." · Reviewed by Greptile

@morluto
morluto merged commit e0e8b30 into morluto:main Oct 16, 2026
62 checks passed
@morluto

morluto commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Thanks for preserving the caller's freshness requirement in comparison Evidence, @Swatantra-66. Including max_capture_age_ms in the parameters keeps a constrained comparison distinguishable from an otherwise identical unconstrained one, which matters when the records are retained. Welcome to REA.

@Swatantra-66

Copy link
Copy Markdown
Contributor Author

Thanks @morluto, and happy to be contributing to REA

@morluto morluto added area: runtime Process capture and runtime observation bug Something isn't working labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: runtime Process capture and runtime observation bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Process comparison Evidence omits the selected freshness requirement

2 participants