Skip to content

feat(evidence): name the side and issue path of comparison source integrity failures - #11049

Merged
morluto merged 2 commits into
mainfrom
feat/process-capture-integrity-side
Nov 15, 2026
Merged

morluto merged 2 commits into
mainfrom
feat/process-capture-integrity-side

Conversation

@morluto

@morluto morluto commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

Refs #10508 (Phase 6.1). When compare_process_captures refuses capture Evidence that fails authentication or whose capture result is malformed, MCP returned evidence_integrity_mismatch with only details.reason; which side failed and where was only in the message. The error now carries details.side and details.issue_path, and the CLI's equivalent input issue carries observed.issue_path.

Problem and expected behavior

  • Agents and tests had to parse "The right Evidence has an invalid process capture result (at truncation_details.…)" to find the side and field.
  • Expected: the side and the first failing location are structured facts, identical between the message and the field.

Change and scope

  • EvidenceIntegrityError: optional side and issuePath; analysisErrorProjection adds them to details when set. Other producers are unchanged.

  • validationFailure.ts: firstValidationIssuePath(cause) returns the location describeValidationFailure names (undefined for a non-schema cause), so field and message cannot disagree.

  • ProcessComparisonService.readProcessComparisonSource: invalid-evidence and invalid-capture set side and the issue path.

  • ProcessCli.invalidCaptureEvidence: the [side] issue sets observed.issue_path.

  • Sibling sweep: compare_functions authenticates sources through readEvidence, which had the same gap. The issue path now comes from that owner (readEvidence/readImmutableEvidence always, root-relative; readEvidencePayload only when the caller states where the payload sits), and parseFunctionEvidence passes its side. Process capture result paths are prefixed with normalized_result on both adapters so every issue_path is relative to the Evidence record.

Not included: artifact comparison and other readEvidencePayload callers (their payload position is not passed yet, so they omit issue_path); the remaining-issue count.

Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.

Contract and boundary impact

  • Semantic owner and earliest changed stage: readEvidence / readEvidencePayload (evidenceValidation.ts, source authentication owner) set the record-relative issue path; readProcessComparisonSource (MCP projection of ProcessCaptureEvidenceFailure) and projectCaptureFileFailure (CLI); firstValidationIssuePath beside describeValidationFailure owns the first-issue selection both the message and the field use; EvidenceIntegrityError carries the facts
  • Contribution scope fit and linked maintainer decision: approved owner change (Phase 6.1, [Design] Assert structured remediation facts instead of guidance prose #10508)
  • CLI and MCP/tool-catalog contract: additive: evidence_integrity_mismatch errors from compare_process_captures and compare_functions gain details.side and details.issue_path (relative to the Evidence record, e.g. ["evidence_id"] or ["normalized_result","manifest","rea_version"]); other readEvidence callers gain details.issue_path; the CLI malformed-capture issue gains observed.issue_path. Codes, categories and messages unchanged
  • Provider, bridge, target-format, or platform compatibility: none
  • Evidence, artifact, provenance, or reconstruction contract: none
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs and skills/; edit authored instructions in .agents/skills/reverse-engineer-anything/ and never commit build outputs): none

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • 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: processComparisonDiagnosticsMcp.test.ts: 7 message assertions become details.side / details.issue_path (MCP) and observed.issue_path (CLI); provider and contract-field issues drop redundant sentences (their path, reason and expected already carry the fact). functionComparisonMcp.test.ts tampered-source case asserts side: "left", issue_path: ["evidence_id"]. sessionMcp.test.ts nesting-depth case asserts side: "left", issue_path: ["parameters"] and keeps the depth limit number
  • Base reproduction or other evidence: mutation (run, reverted): without the issue path on the MCP invalid-capture branch and the CLI issue, 2 of 25 tests fail; with readEvidence ignoring the caller's side, the function case fails
  • User-visible CLI/MCP output (if applicable): MCP compare_process_captures with a tampered right capture → {"code":"evidence_integrity_mismatch","details":{"reason":"right Evidence failed validation","side":"right","issue_path":["evidence_id"]},…}
  • Remaining proof gaps: the count of further issues ("(1 more issues)") is still only in the message; one test keeps that substring. The wrong-workflow issue still states the observed operation only in prose

For boundary fixes, identify the applicable boundary regressions
and lifecycle regressions
covered by the evidence above, and explain relevant gaps.

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

  • npm run test:focused -- tests/boundary/mcp/processComparisonDiagnosticsMcp.test.ts tests/boundary/mcp/processComparisonVerificationMcp.test.ts: 27 passed
  • Same file with the issue path removed at both producers: 2 failed (expected), then restored
  • npm run test:focused -- tests/boundary/mcp/sessionMcp.test.ts: 12 passed (11.1 s wall)
  • After the sibling change: npm run test:focused -- tests/boundary/mcp/processComparisonDiagnosticsMcp.test.ts tests/boundary/mcp/functionComparisonMcp.test.ts tests/boundary/mcp/functionComparisonIntegrityMcp.test.ts tests/boundary/mcp/processEvidenceIdentityMcp.test.ts tests/acceptance/tools/nativeFunctionMatching.test.ts: 90 passed
  • npm run check:fast: passed
  • command — result

Compatibility, safety, and release

  • Breaking changes or migration steps: none (additive fields)
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable; macOS only
  • Package or release metadata impact: none
  • Security, privacy, process, or containment review: none

Author readiness

Human owner:

  • 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.

…ity failures

compare_process_captures reported which side failed validation, and where,
only in the message. EvidenceIntegrityError now carries an optional side
and issue path, projected as details.side and details.issue_path, and the
CLI's malformed-capture issue carries observed.issue_path. The first issue
path comes from the same selection describeValidationFailure names.
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-15T10:55:30.108063Z
We couldn’t complete this review. Comment @codex review to try again.
e615f0e 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@greptile-apps

greptile-apps Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The reviewed changes appear safe to merge.

Summary

Adds structured source locations to Evidence integrity errors across process comparisons and shared Evidence readers.

  • Process comparison errors show the failing side and field in structured details.
  • Function comparison errors can name the side and failing dossier field.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Selected Evidence] --> B[Authenticate record]
  B -->|Record fails| C[Record-relative issue path]
  B -->|Record passes| D[Validate normalized_result]
  D -->|Payload fails| E[Prefix path with normalized_result]
  C --> F[Attach selected side when known]
  E --> F
  F --> G[MCP details or CLI observed fields]
Loading

Reviews (2) · Last reviewed commit: "feat(evidence): report source authentica..." · Reviewed by Greptile

…dence owner

readEvidence and readImmutableEvidence now set the record-relative issue
path on their integrity failure, and readEvidencePayload sets it when the
caller says where the payload sits. compare_functions passes its side, so a
tampered function source reports details.side and details.issue_path like
compare_process_captures. Process capture result issue paths are now
relative to the Evidence record (normalized_result.*) on both adapters.
@morluto morluto changed the title feat(process): name the side and issue path of process-capture integrity failures feat(evidence): name the side and issue path of comparison source integrity failures Nov 15, 2026
@morluto
morluto merged commit 423489a into main Nov 15, 2026
7 of 9 checks passed
@morluto
morluto deleted the feat/process-capture-integrity-side branch November 15, 2026 11:33
@morluto morluto added area: evidence Evidence, artifacts, and reconstruction enhancement New feature or request labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: evidence Evidence, artifacts, and reconstruction enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant