[PR #4431] [CLOSED] fix(hopper): preserve startup diagnostics with generic context #6236

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4431
Author: @ericbyz
Created: 10/16/2026
Status: ❌ Closed

Base: main ← Head: fix-4375-preserve-hopper-diagnostics


📝 Commits (1)

  • 9464e90 fix(hopper): preserve startup diagnostics

📊 Changes

2 files changed (+53 additions, -1 deletions)

View changed files

📝 src/domain/analysisErrorProjection.test.ts (+44 -0)
📝 src/domain/analysisErrorProjection.ts (+9 -1)

📄 Description

Summary

Fixes #4375. Preserve Hopper startup diagnostics when the same typed error also carries provider-neutral diagnostic context.

Problem and expected behavior

projectAnalysisError first projected HopperProcessError.diagnostic into details.diagnostics, then replaced that object with AnalysisError.diagnostics. A private-display startup diagnostic therefore disappeared when caller or secondary-failure context was also present. Both sets of caller-safe facts should remain available.

Change and scope

At the shared error-projection boundary, merge an object-valued primary diagnostic with generic diagnostics before constructing the final details. Generic keys retain their existing precedence on collisions. Provider-only projections and non-object primary diagnostic behavior stay unchanged.

Follow the contribution scope. This is an ordinary fix within the existing typed error-projection boundary; a separate maintainer scope decision is not applicable.

Contract and boundary impact

  • Semantic owner and earliest changed stage: projectAnalysisError, typed error projection.
  • Contribution scope fit and linked maintainer decision: ordinary bug fix within an existing boundary; not applicable.
  • CLI and MCP/tool-catalog contract: existing projected errors can now retain both startup and generic fields in details.diagnostics; schemas and tool catalogs are unchanged.
  • Provider, bridge, target-format, or platform compatibility: no provider execution changes; the recovered fields originate from Hopper startup failures.
  • Evidence, artifact, provenance, or reconstruction contract: preserves caller-safe diagnostic provenance that was previously dropped.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): cleanup enrichment is preserved without changing ownership or retry behavior.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: none.

Expected effects (check known effects; use documentation-only on its own).

  • 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: added a Hopper startup projection regression covering the provider-only control, constructor-supplied generic context, and retainSecondaryFailure enrichment.
  • Base reproduction or other evidence: on d72d856f58d4747c5eb4307426e80d20934e017c, the new focused test failed because the projection contained only { caller_context: "retained" } and omitted all startup fields.
  • User-visible CLI/MCP output (if applicable): projected details.diagnostics now contains the retained startup facts alongside generic context; no compiled CLI/MCP run was performed.
  • Remaining proof gaps: no real Hopper startup failure was run. The issue's production-parser reproduction and existing boundary coverage establish the diagnostic shape; this change was verified at its domain projection owner.

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

  • Regression test before the fix — failed with expected { caller_context: 'retained' } to deeply equal the combined startup and generic diagnostics.
  • npm run test:focused -- src/domain/analysisErrorProjection.test.ts — 55 tests passed.
  • npm run check:fast — typecheck and lint passed, including module-boundary verification.
  • node scripts/verify/architecture-guards.mjs with Node 24.18.0 — passed across 1,455 source files.
  • oxfmt --check src/domain/analysisErrorProjection.ts src/domain/analysisErrorProjection.test.ts — passed.
  • git diff --check — passed.
  • npm run check with Node 24.18.0 — unavailable because this clone lacks native/windows/build/manifest.json and native/windows/build/rea-windows-x64.node; the command stopped in the native-artifact precheck before repository checks ran.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: no real provider run; Windows domain tests and static checks only.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: merges already validated caller-safe JSON diagnostics; no new data collection, process launch, or authority.

Author readiness

Human owner: @ericbyz

  • 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/4431 **Author:** [@ericbyz](https://github.com/ericbyz) **Created:** 10/16/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix-4375-preserve-hopper-diagnostics` --- ### 📝 Commits (1) - [`9464e90`](https://github.com/morluto/rea/commit/9464e90550268045b726be70b0e5b9a99948fcf2) fix(hopper): preserve startup diagnostics ### 📊 Changes **2 files changed** (+53 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/analysisErrorProjection.test.ts` (+44 -0) 📝 `src/domain/analysisErrorProjection.ts` (+9 -1) </details> ### 📄 Description ## Summary Fixes #4375. Preserve Hopper startup diagnostics when the same typed error also carries provider-neutral diagnostic context. ## Problem and expected behavior `projectAnalysisError` first projected `HopperProcessError.diagnostic` into `details.diagnostics`, then replaced that object with `AnalysisError.diagnostics`. A private-display startup diagnostic therefore disappeared when caller or secondary-failure context was also present. Both sets of caller-safe facts should remain available. ## Change and scope At the shared error-projection boundary, merge an object-valued primary diagnostic with generic diagnostics before constructing the final details. Generic keys retain their existing precedence on collisions. Provider-only projections and non-object primary diagnostic behavior stay unchanged. Follow the [contribution scope](https://github.com/morluto/rea/blob/main/CONTRIBUTING.md#contribution-scope). This is an ordinary fix within the existing typed error-projection boundary; a separate maintainer scope decision is not applicable. ## Contract and boundary impact - Semantic owner and earliest changed stage: `projectAnalysisError`, typed error projection. - Contribution scope fit and linked maintainer decision: ordinary bug fix within an existing boundary; not applicable. - CLI and MCP/tool-catalog contract: existing projected errors can now retain both startup and generic fields in `details.diagnostics`; schemas and tool catalogs are unchanged. - Provider, bridge, target-format, or platform compatibility: no provider execution changes; the recovered fields originate from Hopper startup failures. - Evidence, artifact, provenance, or reconstruction contract: preserves caller-safe diagnostic provenance that was previously dropped. - Target selection, authority, upstream behavior, and cleanup details (if applicable): cleanup enrichment is preserved without changing ownership or retry behavior. - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact: none. Expected effects (check known effects; use documentation-only on its own). - [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: added a Hopper startup projection regression covering the provider-only control, constructor-supplied generic context, and `retainSecondaryFailure` enrichment. - Base reproduction or other evidence: on `d72d856f58d4747c5eb4307426e80d20934e017c`, the new focused test failed because the projection contained only `{ caller_context: "retained" }` and omitted all startup fields. - User-visible CLI/MCP output (if applicable): projected `details.diagnostics` now contains the retained startup facts alongside generic context; no compiled CLI/MCP run was performed. - Remaining proof gaps: no real Hopper startup failure was run. The issue's production-parser reproduction and existing boundary coverage establish the diagnostic shape; this change was verified at its domain projection owner. 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 - Regression test before the fix — failed with `expected { caller_context: 'retained' } to deeply equal` the combined startup and generic diagnostics. - `npm run test:focused -- src/domain/analysisErrorProjection.test.ts` — 55 tests passed. - `npm run check:fast` — typecheck and lint passed, including module-boundary verification. - `node scripts/verify/architecture-guards.mjs` with Node 24.18.0 — passed across 1,455 source files. - `oxfmt --check src/domain/analysisErrorProjection.ts src/domain/analysisErrorProjection.test.ts` — passed. - `git diff --check` — passed. - `npm run check` with Node 24.18.0 — unavailable because this clone lacks `native/windows/build/manifest.json` and `native/windows/build/rea-windows-x64.node`; the command stopped in the native-artifact precheck before repository checks ran. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: no real provider run; Windows domain tests and static checks only. - Package or release metadata impact: none. - Security, privacy, process, or containment review: merges already validated caller-safe JSON diagnostics; no new data collection, process launch, or authority. ## Author readiness Human owner: @ericbyz - [ ] 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:12:55 +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#6236
No description provided.