[PR #4263] [CLOSED] fix(analysis-view): preserve native relationship coverage #6145

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4263
Author: @ogutdgn
Created: 10/15/2026
Status: ❌ Closed

Base: main ← Head: fix/native-view-relationship-coverage


📝 Commits (1)

  • 911ba3d fix(analysis-view): preserve native relationship coverage

📊 Changes

4 files changed (+132 additions, -0 deletions)

View changed files

📝 src/application/analysisView/AnalysisViewService.ts (+4 -0)
📝 tests/boundary/cli/analysisViewCli.test.ts (+36 -0)
📝 tests/boundary/mcp/analysisViewMcp.test.ts (+71 -0)
📝 tests/fixtures/analysisView.ts (+21 -0)

📄 Description

Summary

Preserve the parent function analysis's relationship coverage in native analysis views, including read-limit reasons and diagnostics. An exhausted page no longer silently loses the source's declared incompleteness.

Fixes #3891.

Problem and expected behavior

A parent analyze_function Evidence record can declare partial callee coverage while containing an empty callee array. Previously, inspect_analysis_view returned relationship_coverage: null and an exhausted empty page, dropping the parent's read-limit reason and diagnostic. Finishing the recorded rows must not erase known limits of the original analysis.

Change and scope

Forward existing parent coverage at createAnalysisViewEvidence, the shared CLI/MCP Evidence creation boundary, for native views. Preserve exact coverage states and optional fields; missing coverage stays null. Row paging and ordinary dossier limitations keep their existing meaning. The existing Evidence envelope owns this information, so no duplicate field or provider-specific interpretation is added.

Contract and boundary impact

  • Semantic owner and earliest changed stage: shared application service creating view Evidence from an authenticated parent.
  • Contribution scope fit and linked maintainer decision: routine correction within existing read-only analysis; separate scope decision not applicable.
  • CLI and MCP/tool-catalog contract: existing commands, arguments, and schemas; the existing coverage field now retains its source value.
  • Provider, bridge, target-format, or platform compatibility: no provider or bridge changes; native views receive the correction.
  • Evidence, artifact, provenance, or reconstruction contract: parent linkage, authority, artifact identity, and separate diagnostics are retained. Canonical Evidence identity includes the restored coverage.
  • Target selection, authority, upstream behavior, and cleanup: consumes supplied or retained Evidence; no added target execution, attachment, mutation, networking, or resource acquisition.
  • Generated metadata, package, or installation impact: none; no schema, catalog, dependency, or packaging changes.

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

  • Added public CLI and MCP regressions using synthetic canonical Evidence. Cover caller/callee views, inline/retained input parity, partial/unknown/complete/missing coverage, historical optional-field omission, diagnostics, dossier caveats, output schema validity, source immutability, and session readback.
  • Executed against original base 1b828dbb1: both new regressions failed on missing coverage; 29 existing boundary tests passed. Six CLI controls confirmed five populated coverage values were dropped while the null control stayed null.
  • Source comparison at current base 2202e3f0b found the affected service, native projection, and Evidence implementation unchanged. Current-branch validation below passed.
  • Representative actual CLI output, rerun on the current branch with the original partial-callee request:
{
  "relationship_coverage": {
    "status": "partial",
    "limitations": ["Callees: fixture read stopped before all direct callees were returned"],
    "limited_directions": ["callees"],
    "diagnostics": ["Fixture relationship diagnostic"]
  }
}

The same response still has normalized_result.item: [] and normalized_result.coverage.exhausted: true: paging exhaustion describes the retained array, independently of source coverage. Before the fix, the top-level coverage field was null.

  • Remaining proof gaps: synthetic input verifies consumption and preservation of recorded coverage; it does not establish any native provider's coverage production.

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

On macOS arm64 with Node v24.18.0, based on upstream 2202e3f0b:

  • npm run test:focused -- tests/boundary/cli/analysisViewCli.test.ts tests/boundary/mcp/analysisViewMcp.test.ts src/domain/analysisView/analysisView.test.ts src/application/analysisView/AnalysisViewService.test.ts — 97 tests passed across four files, including compiled CLI and MCP boundaries.
  • npm run check — passed typechecking, formatting, lint, module boundaries, unused-code/metadata checks, and architecture guards; lint reported 0 errors and 1,484 warnings.
  • npm run verify:test-discovery — all 1,368 test files discovered exactly once.
  • node scripts/rea.mjs inspect-analysis-view <partial-callee-request.json> --format json — exit 0; exact parent coverage preserved, with the original empty/exhausted page.
  • git diff --check — passed.
  • npm run check:fast — passed via the pre-push hook; pre-commit formatting/lint hooks passed without changing the tested patch.

Compatibility, safety, and release

  • Breaking changes or migration steps: none; existing schema and paging semantics remain valid.
  • Real Hopper/Ghidra, browser, or OS coverage: no native provider or browser ran. Public CLI/MCP tested on macOS; Linux/Windows not run.
  • Package or release metadata impact: none. Full-suite, documentation-generation, and package lanes were not run; no affected contracts, documentation, or package metadata require changes.
  • Security, privacy, process, or containment review: existing authenticated Evidence is forwarded; no new execution or mutation authority. No performance improvement is claimed or measured.

Author readiness

Human owner: @ogutdgn

  • 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/4263 **Author:** [@ogutdgn](https://github.com/ogutdgn) **Created:** 10/15/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/native-view-relationship-coverage` --- ### 📝 Commits (1) - [`911ba3d`](https://github.com/morluto/rea/commit/911ba3d96c3e533796421ff8048621240ab1cb45) fix(analysis-view): preserve native relationship coverage ### 📊 Changes **4 files changed** (+132 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/application/analysisView/AnalysisViewService.ts` (+4 -0) 📝 `tests/boundary/cli/analysisViewCli.test.ts` (+36 -0) 📝 `tests/boundary/mcp/analysisViewMcp.test.ts` (+71 -0) 📝 `tests/fixtures/analysisView.ts` (+21 -0) </details> ### 📄 Description ## Summary Preserve the parent function analysis's relationship coverage in native analysis views, including read-limit reasons and diagnostics. An exhausted page no longer silently loses the source's declared incompleteness. Fixes #3891. ## Problem and expected behavior A parent `analyze_function` Evidence record can declare partial callee coverage while containing an empty callee array. Previously, `inspect_analysis_view` returned `relationship_coverage: null` and an exhausted empty page, dropping the parent's read-limit reason and diagnostic. Finishing the recorded rows must not erase known limits of the original analysis. ## Change and scope Forward existing parent coverage at `createAnalysisViewEvidence`, the shared CLI/MCP Evidence creation boundary, for native views. Preserve exact coverage states and optional fields; missing coverage stays null. Row paging and ordinary dossier limitations keep their existing meaning. The existing Evidence envelope owns this information, so no duplicate field or provider-specific interpretation is added. ## Contract and boundary impact - Semantic owner and earliest changed stage: shared application service creating view Evidence from an authenticated parent. - Contribution scope fit and linked maintainer decision: routine correction within existing read-only analysis; separate scope decision not applicable. - CLI and MCP/tool-catalog contract: existing commands, arguments, and schemas; the existing coverage field now retains its source value. - Provider, bridge, target-format, or platform compatibility: no provider or bridge changes; native views receive the correction. - Evidence, artifact, provenance, or reconstruction contract: parent linkage, authority, artifact identity, and separate diagnostics are retained. Canonical Evidence identity includes the restored coverage. - Target selection, authority, upstream behavior, and cleanup: consumes supplied or retained Evidence; no added target execution, attachment, mutation, networking, or resource acquisition. - Generated metadata, package, or installation impact: none; no schema, catalog, dependency, or packaging changes. 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 - Added public CLI and MCP regressions using synthetic canonical Evidence. Cover caller/callee views, inline/retained input parity, partial/unknown/complete/missing coverage, historical optional-field omission, diagnostics, dossier caveats, output schema validity, source immutability, and session readback. - Executed against original base `1b828dbb1`: both new regressions failed on missing coverage; 29 existing boundary tests passed. Six CLI controls confirmed five populated coverage values were dropped while the null control stayed null. - Source comparison at current base `2202e3f0b` found the affected service, native projection, and Evidence implementation unchanged. Current-branch validation below passed. - Representative actual CLI output, rerun on the current branch with the original partial-callee request: ```json { "relationship_coverage": { "status": "partial", "limitations": ["Callees: fixture read stopped before all direct callees were returned"], "limited_directions": ["callees"], "diagnostics": ["Fixture relationship diagnostic"] } } ``` The same response still has `normalized_result.item: []` and `normalized_result.coverage.exhausted: true`: paging exhaustion describes the retained array, independently of source coverage. Before the fix, the top-level coverage field was null. - Remaining proof gaps: synthetic input verifies consumption and preservation of recorded coverage; it does not establish any native provider's coverage production. 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 On macOS arm64 with Node v24.18.0, based on upstream `2202e3f0b`: - `npm run test:focused -- tests/boundary/cli/analysisViewCli.test.ts tests/boundary/mcp/analysisViewMcp.test.ts src/domain/analysisView/analysisView.test.ts src/application/analysisView/AnalysisViewService.test.ts` — 97 tests passed across four files, including compiled CLI and MCP boundaries. - `npm run check` — passed typechecking, formatting, lint, module boundaries, unused-code/metadata checks, and architecture guards; lint reported 0 errors and 1,484 warnings. - `npm run verify:test-discovery` — all 1,368 test files discovered exactly once. - `node scripts/rea.mjs inspect-analysis-view <partial-callee-request.json> --format json` — exit 0; exact parent coverage preserved, with the original empty/exhausted page. - `git diff --check` — passed. - `npm run check:fast` — passed via the pre-push hook; pre-commit formatting/lint hooks passed without changing the tested patch. ## Compatibility, safety, and release - Breaking changes or migration steps: none; existing schema and paging semantics remain valid. - Real Hopper/Ghidra, browser, or OS coverage: no native provider or browser ran. Public CLI/MCP tested on macOS; Linux/Windows not run. - Package or release metadata impact: none. Full-suite, documentation-generation, and package lanes were not run; no affected contracts, documentation, or package metadata require changes. - Security, privacy, process, or containment review: existing authenticated Evidence is forwarded; no new execution or mutation authority. No performance improvement is claimed or measured. ## Author readiness Human owner: @ogutdgn - [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-10-31 01:12:12 +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#6145
No description provided.