[PR #7099] [CLOSED] fix(artifacts): attribute non-summary analysis view comparison issues to their input side #7640

Closed
opened 2026-11-03 13:39:18 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/7099
Author: @saiyam-jain-dev
Created: 10/25/2026
Status: ❌ Closed

Base: main ← Head: fix/artifact-comparison-issue-path


📝 Commits (1)

  • 3a54a4d fix(artifacts): attribute non-summary analysis view comparison issues to their input side

📊 Changes

3 files changed (+47 additions, -1 deletions)

View changed files

📝 src/application/artifacts/ArtifactComparisonEvidence.test.ts (+43 -0)
📝 src/application/artifacts/ArtifactComparisonEvidence.ts (+2 -1)
📝 src/server/registerArtifactComparisonTool.ts (+2 -0)

📄 Description

Summary

When resolving inspect_analysis_view records before comparing them with compare_artifacts, resolveArtifactComparisonEvidence reported non-summary view results under a generic hardcoded issue path path: ["evidence"]. This PR allows callers to specify the input field path (defaulting to ["evidence"]), and updates registerArtifactComparisonTool to report issues on ["left"] or ["right"] respectively.

Problem and expected behavior

compare_artifacts accepts left and right inputs. If either input is an Evidence record produced by inspect_analysis_view that is not an artifact inventory summary (e.g. a different analysis view), resolveArtifactComparisonEvidence previously returned:

{
  "path": ["evidence"],
  "reason": "invalid_value",
  "message": "Artifact comparison accepts only an artifact inventory summary from inspect_analysis_view."
}

Consumers received an issue path of ["evidence"] instead of identifying whether left or right was invalid. The expected behavior is that issues pinpoint the exact caller input argument (["left"] or ["right"]).

Change and scope

  • Added an optional path: readonly (string | number)[] = ["evidence"] argument to resolveArtifactComparisonEvidence in src/application/artifacts/ArtifactComparisonEvidence.ts.
  • Updated registerArtifactComparisonTool in src/server/registerArtifactComparisonTool.ts to pass ["left"] and ["right"] when resolving both sides.
  • Added regression unit tests in src/application/artifacts/ArtifactComparisonEvidence.test.ts asserting that an invalid non-summary view returns AnalysisInputError with the appropriate path.

Contribution scope fit: ordinary boundary fix within existing boundaries (not applicable).

Contract and boundary impact

  • Semantic owner and earliest changed stage: src/application/artifacts/ArtifactComparisonEvidence.ts and src/server/registerArtifactComparisonTool.ts.
  • Contribution scope fit and linked maintainer decision: not applicable.
  • CLI and MCP/tool-catalog contract: compare_artifacts input validation errors report ["left"] or ["right"] in issues[].path.
  • Provider, bridge, target-format, or platform compatibility: platform-independent.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): none.
  • Generated metadata (docs/public/product-catalog.json), package, or installation 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: src/application/artifacts/ArtifactComparisonEvidence.test.ts
  • Base reproduction or other evidence: previously always reported ["evidence"].
  • User-visible CLI/MCP output: compare_artifacts validation errors name left or right.
  • 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

  • npx vitest run src/application/artifacts/ArtifactComparisonEvidence.test.ts — passed (8 passed in 43ms)
  • npx vitest run tests/boundary/mcp/artifactMcp.test.ts -t "contradiction" — passed (1 passed in 446ms)
  • npm run check:fast (turbo run typecheck lint) — passed cleanly (2/2 tasks successful in 1m37s)

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none.

Author readiness

Human owner: @saiyam-jain-dev

  • 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/7099 **Author:** [@saiyam-jain-dev](https://github.com/saiyam-jain-dev) **Created:** 10/25/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/artifact-comparison-issue-path` --- ### 📝 Commits (1) - [`3a54a4d`](https://github.com/morluto/rea/commit/3a54a4d54f2441db4c4db43e8145c56498040823) fix(artifacts): attribute non-summary analysis view comparison issues to their input side ### 📊 Changes **3 files changed** (+47 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/application/artifacts/ArtifactComparisonEvidence.test.ts` (+43 -0) 📝 `src/application/artifacts/ArtifactComparisonEvidence.ts` (+2 -1) 📝 `src/server/registerArtifactComparisonTool.ts` (+2 -0) </details> ### 📄 Description ## Summary When resolving `inspect_analysis_view` records before comparing them with `compare_artifacts`, `resolveArtifactComparisonEvidence` reported non-summary view results under a generic hardcoded issue path `path: ["evidence"]`. This PR allows callers to specify the input field path (defaulting to `["evidence"]`), and updates `registerArtifactComparisonTool` to report issues on `["left"]` or `["right"]` respectively. ## Problem and expected behavior `compare_artifacts` accepts `left` and `right` inputs. If either input is an Evidence record produced by `inspect_analysis_view` that is not an artifact inventory summary (e.g. a different analysis view), `resolveArtifactComparisonEvidence` previously returned: ```json { "path": ["evidence"], "reason": "invalid_value", "message": "Artifact comparison accepts only an artifact inventory summary from inspect_analysis_view." } ``` Consumers received an issue path of `["evidence"]` instead of identifying whether `left` or `right` was invalid. The expected behavior is that issues pinpoint the exact caller input argument (`["left"]` or `["right"]`). ## Change and scope - Added an optional `path: readonly (string | number)[] = ["evidence"]` argument to `resolveArtifactComparisonEvidence` in `src/application/artifacts/ArtifactComparisonEvidence.ts`. - Updated `registerArtifactComparisonTool` in `src/server/registerArtifactComparisonTool.ts` to pass `["left"]` and `["right"]` when resolving both sides. - Added regression unit tests in `src/application/artifacts/ArtifactComparisonEvidence.test.ts` asserting that an invalid non-summary view returns `AnalysisInputError` with the appropriate path. Contribution scope fit: ordinary boundary fix within existing boundaries (not applicable). ## Contract and boundary impact - Semantic owner and earliest changed stage: `src/application/artifacts/ArtifactComparisonEvidence.ts` and `src/server/registerArtifactComparisonTool.ts`. - Contribution scope fit and linked maintainer decision: not applicable. - CLI and MCP/tool-catalog contract: `compare_artifacts` input validation errors report `["left"]` or `["right"]` in `issues[].path`. - Provider, bridge, target-format, or platform compatibility: platform-independent. - Evidence, artifact, provenance, or reconstruction contract: none. - Target selection, authority, upstream behavior, and cleanup details (if applicable): none. - Generated metadata (`docs/public/product-catalog.json`), package, or installation 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: `src/application/artifacts/ArtifactComparisonEvidence.test.ts` - Base reproduction or other evidence: previously always reported `["evidence"]`. - User-visible CLI/MCP output: `compare_artifacts` validation errors name `left` or `right`. - 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 - `npx vitest run src/application/artifacts/ArtifactComparisonEvidence.test.ts` — passed (8 passed in 43ms) - `npx vitest run tests/boundary/mcp/artifactMcp.test.ts -t "contradiction"` — passed (1 passed in 446ms) - `npm run check:fast` (`turbo run typecheck lint`) — passed cleanly (2/2 tasks successful in 1m37s) ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: not applicable. - Package or release metadata impact: none. - Security, privacy, process, or containment review: none. ## Author readiness Human owner: @saiyam-jain-dev - [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 - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] 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-11-03 13:39: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#7640
No description provided.