[PR #3122] [CLOSED] fix(analysis-view): report a malformed parent through the shared view source #5630

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3122
Author: @XiaoBinGan
Created: 10/14/2026
Status: ❌ Closed

Base: main ← Head: fix/analysis-view-parent-parse-owner


📝 Commits (4)

  • 6fc15b7 fix(analysis-view): report a malformed parent through the shared view source
  • 757b93a Merge remote-tracking branch 'origin/main' into fix/analysis-view-parent-parse-owner
  • ab90ba9 Merge remote-tracking branch 'origin/main' into fix/analysis-view-parent-parse-owner
  • 3ca4fce Merge remote-tracking branch 'origin/main' into fix/analysis-view-parent-parse-owner

📊 Changes

3 files changed (+31 additions, -29 deletions)

View changed files

📝 src/domain/analysisView/pcapCaptureView.test.ts (+21 -0)
📝 src/domain/analysisView/pcapCaptureView.ts (+6 -14)
📝 src/domain/analysisView/webNetworkCaptureView.ts (+4 -15)

📄 Description

Summary

inspect_analysis_view reports a parent result that does not satisfy its owning schema through one shared boundary, parseAnalysisViewResult in src/domain/analysisView/analysisViewParent.ts. The packet-capture view kept its own copy of that boundary and passed the parent report itself as the offending input, so its caller-correction paths were rooted at the report instead of the request. The web-network capture view kept a verbatim copy of the shared helper.

Problem and expected behavior

Asked for a packet-capture summary over a parent whose retained result is malformed, the view answered:

issues[].path = ["client", "target", "file_type"]

Every other analysis view answers with the same failure located at the request's own view source:

issues[].path = ["source", "normalized_result", "format"]   (Mach-O)
issues[].path = ["source", "normalized_result", ...]        (android, dart, evm, interface-builder, managed, wasm)

source.normalized_result is the advertised request location: inspectAnalysisViewInputSchema accepts it for an inline source, and analysisInputErrorFromIssues classifies missing_argument versus invalid_value by looking the path up in the value it is given. A caller that follows the reported path therefore has to know which view raised the failure to find the field — the sibling views do not require that.

Expected: the packet-capture view locates a malformed parent at the same request path as every other view.

Change and scope

  • pcapCaptureView.parseParent delegates to parseAnalysisViewResult(captureSchema, parent) — the owner of "parse a parent result, report its issues into the view source" — instead of re-deriving it. This is the only behavioral change.
  • webNetworkCaptureView.parseCaptureParent delegates to the same helper; its inline copy was byte-for-byte identical, so this is behavior-preserving.
  • Regression coverage added for the packet-capture path.

No schema, tool contract, or provider behavior changes. The refusal itself (AnalysisInputError, one issue per Zod failure) is unchanged; only the reported path prefix moves to the request.

Contract and boundary impact

The boundary that decides how a malformed parent is reported now has exactly one implementation, which is what AGENTS.md asks for: consumers use the owner's parsed facts rather than reinterpreting raw source, and the producing representation is fixed before downstream repairs. Six of the eight analysis views were converted to this helper in 55dd21a5; these two were the remainder. The sites still using analysisInputErrorFromIssues directly — two in analysisView.ts itself — keep it deliberately: they build their own view-input errors from the request, and are not parent-result parses.

Evidence and regression coverage

The new test fails on main and passes with this change, at the same fixture:

  • without the change: AssertionError: expected [ 'client' ] to deeply equal [ 'source', 'normalized_result' ]
  • with the change: the packet-capture paths are ["source","normalized_result","client","target","file_type"], ["source","normalized_result","target"], ["source","normalized_result","file_type"], ["source","normalized_result","encapsulation"], …

Verification on f3534749 + this change:

  • npm run test:focused -- src/domain/analysisView/pcapCaptureView.test.ts src/domain/analysisView/webNetworkCaptureView.test.ts src/domain/analysisView/webNetworkApiSurfaceView.test.ts src/domain/analysisView/analysisView.test.ts src/domain/analysisView/machoView.test.ts tests/boundary/pcap/pcapRetainedView.test.ts tests/boundary/captures/captureProvider.test.ts — 136 passed, 1 skipped (7 files)
  • npm run check:fast — 2 successful (typecheck + lint)
  • npm run format:check — clean

Unavailable coverage

No real pcap or web-network producer was executed; the affected path is a parent-result parse failure reached from a synthetic parent, and the capture provider boundary test above ran against its existing fixture. The web-network view's conversion is asserted by its existing 50 tests rather than by a new one, since its behavior is unchanged.

Author readiness

Human owner: @XiaoBinGan

  • 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.
  • 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.
  • 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/3122 **Author:** [@XiaoBinGan](https://github.com/XiaoBinGan) **Created:** 10/14/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/analysis-view-parent-parse-owner` --- ### 📝 Commits (4) - [`6fc15b7`](https://github.com/morluto/rea/commit/6fc15b7a62751567ee56c992b105ef47a9d01cba) fix(analysis-view): report a malformed parent through the shared view source - [`757b93a`](https://github.com/morluto/rea/commit/757b93abc1f384c7706f86d5331290addc9ffd6c) Merge remote-tracking branch 'origin/main' into fix/analysis-view-parent-parse-owner - [`ab90ba9`](https://github.com/morluto/rea/commit/ab90ba98ee4b91470b030559b2c107ac1be74df9) Merge remote-tracking branch 'origin/main' into fix/analysis-view-parent-parse-owner - [`3ca4fce`](https://github.com/morluto/rea/commit/3ca4fce12d0a510bd1b031519446b35c8a00e2c5) Merge remote-tracking branch 'origin/main' into fix/analysis-view-parent-parse-owner ### 📊 Changes **3 files changed** (+31 additions, -29 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/analysisView/pcapCaptureView.test.ts` (+21 -0) 📝 `src/domain/analysisView/pcapCaptureView.ts` (+6 -14) 📝 `src/domain/analysisView/webNetworkCaptureView.ts` (+4 -15) </details> ### 📄 Description ## Summary `inspect_analysis_view` reports a parent result that does not satisfy its owning schema through one shared boundary, `parseAnalysisViewResult` in `src/domain/analysisView/analysisViewParent.ts`. The packet-capture view kept its own copy of that boundary and passed the parent report itself as the offending input, so its caller-correction paths were rooted at the report instead of the request. The web-network capture view kept a verbatim copy of the shared helper. ## Problem and expected behavior Asked for a packet-capture summary over a parent whose retained result is malformed, the view answered: ``` issues[].path = ["client", "target", "file_type"] ``` Every other analysis view answers with the same failure located at the request's own view source: ``` issues[].path = ["source", "normalized_result", "format"] (Mach-O) issues[].path = ["source", "normalized_result", ...] (android, dart, evm, interface-builder, managed, wasm) ``` `source.normalized_result` is the advertised request location: `inspectAnalysisViewInputSchema` accepts it for an inline source, and `analysisInputErrorFromIssues` classifies `missing_argument` versus `invalid_value` by looking the path up in the value it is given. A caller that follows the reported path therefore has to know which view raised the failure to find the field — the sibling views do not require that. Expected: the packet-capture view locates a malformed parent at the same request path as every other view. ## Change and scope - `pcapCaptureView.parseParent` delegates to `parseAnalysisViewResult(captureSchema, parent)` — the owner of "parse a parent result, report its issues into the view source" — instead of re-deriving it. This is the only behavioral change. - `webNetworkCaptureView.parseCaptureParent` delegates to the same helper; its inline copy was byte-for-byte identical, so this is behavior-preserving. - Regression coverage added for the packet-capture path. No schema, tool contract, or provider behavior changes. The refusal itself (`AnalysisInputError`, one issue per Zod failure) is unchanged; only the reported `path` prefix moves to the request. ## Contract and boundary impact The boundary that decides how a malformed parent is reported now has exactly one implementation, which is what `AGENTS.md` asks for: consumers use the owner's parsed facts rather than reinterpreting raw source, and the producing representation is fixed before downstream repairs. Six of the eight analysis views were converted to this helper in `55dd21a5`; these two were the remainder. The sites still using `analysisInputErrorFromIssues` directly — two in `analysisView.ts` itself — keep it deliberately: they build their own view-input errors from the request, and are not parent-result parses. ## Evidence and regression coverage The new test fails on `main` and passes with this change, at the same fixture: - without the change: `AssertionError: expected [ 'client' ] to deeply equal [ 'source', 'normalized_result' ]` - with the change: the packet-capture paths are `["source","normalized_result","client","target","file_type"]`, `["source","normalized_result","target"]`, `["source","normalized_result","file_type"]`, `["source","normalized_result","encapsulation"]`, … Verification on `f3534749` + this change: - `npm run test:focused -- src/domain/analysisView/pcapCaptureView.test.ts src/domain/analysisView/webNetworkCaptureView.test.ts src/domain/analysisView/webNetworkApiSurfaceView.test.ts src/domain/analysisView/analysisView.test.ts src/domain/analysisView/machoView.test.ts tests/boundary/pcap/pcapRetainedView.test.ts tests/boundary/captures/captureProvider.test.ts` — 136 passed, 1 skipped (7 files) - `npm run check:fast` — 2 successful (typecheck + lint) - `npm run format:check` — clean ## Unavailable coverage No real pcap or web-network producer was executed; the affected path is a parent-result parse failure reached from a synthetic parent, and the capture provider boundary test above ran against its existing fixture. The web-network view's conversion is asserted by its existing 50 tests rather than by a new one, since its behavior is unchanged. ## Author readiness Human owner: @XiaoBinGan - [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] 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] 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:08:06 +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#5630
No description provided.