[PR #6202] [CLOSED] fix(analysis-view): preserve binary layout field diagnostics #7200

Closed
opened 2026-11-01 21:46:06 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6202
Author: @monsterlag
Created: 10/22/2026
Status: ❌ Closed

Base: main ← Head: fix/issue-6003-7415


📝 Commits (1)

  • b4fde13 fix(analysis-view): preserve binary layout field diagnostics

📊 Changes

4 files changed (+159 additions, -8 deletions)

View changed files

📝 src/domain/analysisView/analysisView.test.ts (+36 -0)
📝 src/domain/analysisView/analysisView.ts (+9 -8)
📝 tests/boundary/cli/analysisViewCli.test.ts (+52 -0)
📝 tests/boundary/mcp/analysisViewMcp.test.ts (+62 -0)

📄 Description

Note

AI-generated; human owner review pending. This pull request was written by an AI coding agent and checked by a separate AI review agent, which re-ran the tests described below. It is opened as a draft: its human owner, @monsterlag, reviews the final diff and completes the readiness declarations before marking it ready for review.

Summary

Fixes #6003. Malformed binary-layout parent Evidence now reports the owning schema's field diagnostics instead of one generic source error.

Problem and expected behavior

Digest-valid inspect_binary_layout Evidence with a string artifact.bytes was rejected at ["source"] with invalid_value. The existing analysis-view convention requires ["source","normalized_result","artifact","bytes"] with invalid_type and expected type number.

Change and scope

Project safeParseOwnedBinaryLayout failures through analysisInputErrorFromIssues, retaining the original schema cause and matching input wrapper. Keep the owned-parser cache, successful projections, Evidence authentication, and subject checks unchanged. No related parser or projection refactor is needed: the schema already supplies the correct diagnostics.

Contract and boundary impact

  • Semantic owner and earliest changed stage: binary-layout schema diagnostics at the shared analysis-view parent-validation boundary.
  • Contribution scope fit and linked maintainer decision: routine diagnostic bug fix within existing boundaries; advance scope decision not applicable.
  • CLI and MCP/tool-catalog contract: existing correction-path/reason convention; error code, category, retryability, and recovery stay unchanged. No schema/catalog changes.
  • Provider, bridge, target-format, or platform compatibility: no provider/bridge changes; exercised on Linux x64, Node 24.18.0, npm 11.16.0.
  • Evidence, artifact, provenance, or reconstruction contract: authentication and identities unchanged; malformed layouts remain rejected.
  • Target selection, authority, upstream behavior, and cleanup details: no new target access, execution, mutation, network access, or resources.
  • Generated metadata, package, or installation impact: none.

Expected effects: validate caller-supplied captured Evidence; no additional target interaction. Effect checklist left for the owner.

  • 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: wrong-type versus missing-field diagnostics and retained Zod cause; compiled CLI rejection; inline/retained MCP rejection and a successful corrected request on the same connection. Public errors must not echo the invalid field value.

  • Base reproduction (executed): both new domain cases failed (2 failed, 33 passed); MCP returned the generic source issue. The corrected CLI regression independently failed with that same path/reason mismatch before changing production code.

  • User-visible CLI/MCP output (executed): invalid_request, invalid_input, retryable: false, inspect_input_contract recovery, and:

    {"path":["source","normalized_result","artifact","bytes"],"reason":"invalid_type","expected":"number"}
    

    A separate built CLI invocation returned exit 1 with empty stderr and the same diagnostic.

  • Remaining proof gaps: synthetic, digest-valid Evidence, not a real layout producer. MCP uses the production handler over in-memory transport; this does not establish stdio/client or real-provider behavior.

For evidence-bearing changes (owner declarations left unchecked):

  • 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

Using the pinned toolchain after npm ci:

  • npm run test:local -- src/domain/analysisView/analysisView.test.ts — 35 passed after the fix.
  • npm run test:focused -- tests/boundary/cli/analysisViewCli.test.ts tests/boundary/mcp/analysisViewMcp.test.ts — 45 passed after rebuilding.
  • npm run check:fast — typecheck and lint passed.
  • npm run check — passed typecheck, built lint/module boundaries, formatting, Knip, metadata, and architecture guards; lint reported 0 errors and 2,122 warnings.
  • npm run verify:test-discovery — all 1,957 test files discovered exactly once.
  • git diff --check — passed; pre-commit formatting/lint hooks also passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none; malformed inputs gain existing schema-owned correction detail.
  • Real Hopper/Ghidra, browser, or OS coverage: Linux synthetic Evidence only; no native engine required or run. Full-suite/coverage execution remains with CI.
  • Package or release metadata impact: none; no generated outputs committed.
  • Security, privacy, process, or containment review: uses the existing safe issue projector; tests confirm invalid values are not echoed and authenticated malformed Evidence still fails closed.

Author readiness

Human owner: @monsterlag

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

Keep this PR in draft until the human owner completes these declarations.

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/6202 **Author:** [@monsterlag](https://github.com/monsterlag) **Created:** 10/22/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/issue-6003-7415` --- ### 📝 Commits (1) - [`b4fde13`](https://github.com/morluto/rea/commit/b4fde131c0d8d4acf8c4bce2a4ded9eeef67af29) fix(analysis-view): preserve binary layout field diagnostics ### 📊 Changes **4 files changed** (+159 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/analysisView/analysisView.test.ts` (+36 -0) 📝 `src/domain/analysisView/analysisView.ts` (+9 -8) 📝 `tests/boundary/cli/analysisViewCli.test.ts` (+52 -0) 📝 `tests/boundary/mcp/analysisViewMcp.test.ts` (+62 -0) </details> ### 📄 Description > [!NOTE] > **AI-generated; human owner review pending.** This pull request was written by an AI coding agent and checked by a separate AI review agent, which re-ran the tests described below. It is opened as a draft: its human owner, @monsterlag, reviews the final diff and completes the readiness declarations before marking it ready for review. ## Summary Fixes #6003. Malformed binary-layout parent Evidence now reports the owning schema's field diagnostics instead of one generic source error. ## Problem and expected behavior Digest-valid `inspect_binary_layout` Evidence with a string `artifact.bytes` was rejected at `["source"]` with `invalid_value`. The existing analysis-view convention requires `["source","normalized_result","artifact","bytes"]` with `invalid_type` and expected type `number`. ## Change and scope Project `safeParseOwnedBinaryLayout` failures through `analysisInputErrorFromIssues`, retaining the original schema cause and matching input wrapper. Keep the owned-parser cache, successful projections, Evidence authentication, and subject checks unchanged. No related parser or projection refactor is needed: the schema already supplies the correct diagnostics. ## Contract and boundary impact - Semantic owner and earliest changed stage: binary-layout schema diagnostics at the shared analysis-view parent-validation boundary. - Contribution scope fit and linked maintainer decision: routine diagnostic bug fix within existing boundaries; advance scope decision not applicable. - CLI and MCP/tool-catalog contract: existing correction-path/reason convention; error code, category, retryability, and recovery stay unchanged. No schema/catalog changes. - Provider, bridge, target-format, or platform compatibility: no provider/bridge changes; exercised on Linux x64, Node 24.18.0, npm 11.16.0. - Evidence, artifact, provenance, or reconstruction contract: authentication and identities unchanged; malformed layouts remain rejected. - Target selection, authority, upstream behavior, and cleanup details: no new target access, execution, mutation, network access, or resources. - Generated metadata, package, or installation impact: none. Expected effects: validate caller-supplied captured Evidence; no additional target interaction. Effect checklist left for the owner. - [ ] 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: wrong-type versus missing-field diagnostics and retained Zod cause; compiled CLI rejection; inline/retained MCP rejection and a successful corrected request on the same connection. Public errors must not echo the invalid field value. - Base reproduction (executed): both new domain cases failed (`2 failed, 33 passed`); MCP returned the generic source issue. The corrected CLI regression independently failed with that same path/reason mismatch before changing production code. - User-visible CLI/MCP output (executed): `invalid_request`, `invalid_input`, `retryable: false`, `inspect_input_contract` recovery, and: ```json {"path":["source","normalized_result","artifact","bytes"],"reason":"invalid_type","expected":"number"} ``` A separate built CLI invocation returned exit 1 with empty stderr and the same diagnostic. - Remaining proof gaps: synthetic, digest-valid Evidence, not a real layout producer. MCP uses the production handler over in-memory transport; this does not establish stdio/client or real-provider behavior. For evidence-bearing changes (owner declarations left unchecked): - [ ] 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 Using the pinned toolchain after `npm ci`: - `npm run test:local -- src/domain/analysisView/analysisView.test.ts` — 35 passed after the fix. - `npm run test:focused -- tests/boundary/cli/analysisViewCli.test.ts tests/boundary/mcp/analysisViewMcp.test.ts` — 45 passed after rebuilding. - `npm run check:fast` — typecheck and lint passed. - `npm run check` — passed typecheck, built lint/module boundaries, formatting, Knip, metadata, and architecture guards; lint reported 0 errors and 2,122 warnings. - `npm run verify:test-discovery` — all 1,957 test files discovered exactly once. - `git diff --check` — passed; pre-commit formatting/lint hooks also passed. ## Compatibility, safety, and release - Breaking changes or migration steps: none; malformed inputs gain existing schema-owned correction detail. - Real Hopper/Ghidra, browser, or OS coverage: Linux synthetic Evidence only; no native engine required or run. Full-suite/coverage execution remains with CI. - Package or release metadata impact: none; no generated outputs committed. - Security, privacy, process, or containment review: uses the existing safe issue projector; tests confirm invalid values are not echoed and authenticated malformed Evidence still fails closed. ## Author readiness Human owner: @monsterlag - [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. Keep this PR in draft until the human owner completes these declarations. ## 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-01 21:46: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#7200
No description provided.