Skip to content

fix(analysis-view): preserve native relationship coverage - #4263

Closed
ogutdgn wants to merge 1 commit into
morluto:mainfrom
ogutdgn:fix/native-view-relationship-coverage
Closed

ogutdgn wants to merge 1 commit into
morluto:mainfrom
ogutdgn:fix/native-view-relationship-coverage

Conversation

@ogutdgn

@ogutdgn ogutdgn commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

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.

@ogutdgn
ogutdgn marked this pull request as ready for review October 15, 2026 21:34
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-15T22:53:57.764755Z 911ba3d Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This PR appears safe to merge; no actionable issues were found.

Summary

Native analysis views now preserve the parent's relationship_coverage without changing paging or ordinary limitations.

  • Native analysis views retain relationship coverage from their source.

Reviews (1) · Last reviewed commit: "fix(analysis-view): preserve native rela..." · Reviewed by Greptile

@ogutdgn

ogutdgn commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

An unknown error occurred
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

morluto added a commit that referenced this pull request Oct 15, 2026
Carry the parent native coverage facts through inline and retained views independently of row-page exhaustion. Preserve uncertainty, optional diagnostics and source Evidence.

Refs #3891, #4263

Co-authored-by: ogutdgn <[email protected]>
@kaoru0822-kitauji kaoru0822-kitauji added the ci-fix-wip Claimed by the CI-fix track label Oct 16, 2026
@kaoru0822-kitauji

Copy link
Copy Markdown
Collaborator

Conflict check from the CI & conflict-fix track: main's 89dd71f ("fix(analysis-view): preserve native relationship coverage", Refs #4263) already lands this change. AnalysisViewService carries relationship_coverage from native parents into views, and main's CLI/MCP tests are a superset of this PR's (they also assert the inline parent is not mutated). Merging main conflicts only where both sides add the same code, so I left the branch untouched. A maintainer may want to close this as superseded.

@kaoru0822-kitauji kaoru0822-kitauji removed the ci-fix-wip Claimed by the CI-fix track label Oct 16, 2026
@kaoru0822-kitauji

Copy link
Copy Markdown
Collaborator

Conflict check from the CI/conflict track. I did not push anything.

main already carries this change as 89dd71f0f (fix(analysis-view): preserve native relationship coverage), whose message references this PR and credits its author as co-author. The merge conflicts come from that landed version, so this PR looks superseded. Leaving it for the author or maintainer to close.

@ogutdgn

ogutdgn commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for checking. This fix was incorporated into main in 89dd71f, which references this PR and preserves my contribution credit. Closing as superseded.

@ogutdgn ogutdgn closed this Oct 16, 2026
@morluto morluto added area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Native caller/callee analysis views drop partial relationship coverage and diagnostics

3 participants