[PR #7039] [MERGED] fix(analysis-view): preserve current observation paths in summaries #7596

Closed
opened 2026-11-03 13:38:59 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/7039
Author: @WenyuChiou
Created: 10/24/2026
Status: ✅ Merged
Merged: 10/24/2026
Merged by: @morluto

Base: main ← Head: fix/retained-summary-current-path-20261024


📝 Commits (2)

  • 10795a4 fix(analysis-view): preserve current observation paths in summaries
  • eee7940 merge: integrate upstream Evidence sealing repair

📊 Changes

3 files changed (+209 additions, -23 deletions)

View changed files

📝 src/application/analysisView/AnalysisViewService.test.ts (+101 -1)
📝 src/application/analysisView/AnalysisViewService.ts (+49 -14)
📝 tests/boundary/mcp/analyzeFunctionDetail.test.ts (+59 -8)

📄 Description

Summary

Preserve the current observation's path when returning a retained summary instead of substituting metadata from an earlier same-ID ledger record.

Complete and summary delivery should describe the same current observation. Explicit later lookup by retained ID should continue to show the historical record.

Problem and expected behavior

A production MCP analyze_function regression returned /selected/native.exe for complete delivery but /old/native.exe for summary delivery. The production EvidenceLedger correctly preserves original metadata when a semantic ID is recorded again; the summary path incorrectly came from that historical lookup.

The previous MCP fixture used an overwrite-map and hid this behavior. The regression now uses the production ledger and real MCP SDK/server/registration/delivery boundaries with a synthetic provider dossier.

Change and scope

  • Keep ledger duplicate-ID policy and historical by-ID lookup unchanged.
  • After recording the current Evidence, retain the existing missing-record and identity validation.
  • Keep the authenticated retained record as payload/sealing owner while using a guarded presentation envelope for the current subject/path.
  • Preserve retained-source admission and the existing inline accounting accumulator; do not re-admit a large retained payload as generic inline data.
  • Test complete/summary path parity and later historical lookup separately.

This is a focused application-layer presentation fix, not a general metadata rewrite. It does not copy caller_input_path into later retained views. It does not edit the domain sealing owner in evidence.ts or duplicate #7036's separate JSON ownership correction.

Contract and boundary impact

  • Semantic owner: retained-summary projection in AnalysisViewService.
  • CLI/MCP and public Evidence schemas: unchanged.
  • Retained payload identity, ledger history and source admission: preserved.
  • Provider, target selection, process/network/mutation authority: unchanged.
  • Dependencies, installation, generated metadata and release behavior: unchanged.
  • Contribution scope: routine correction within existing Evidence delivery; no separate advance capability decision required.

Evidence and regression coverage

Before the fix, the owner regression failed with historical same-ID metadata while its clean-ledger control passed. The actual MCP regression likewise failed current-path parity while its control passed.

Final coverage includes a large 40,000-character-header capture: retained projections remain admitted while the equivalent generic inline envelope is refused. It also covers unchanged retained root/payload ownership, record failure, missing-record and wrong-ID guards, current MCP paths, later historical lookup and existing oversized MCP views.

Independent automated static/log review approved the final three-file patch; the reviewer did not independently execute tests. No human readiness attestation is implied.

Two fixture mistakes were corrected and their failed attempts preserved: missing parsed pagination defaults, and an incorrect expected error tag. Exact assertions and failure reasons remain checked. A separate environment-metadata hypothesis was not established as a defect and is excluded from this patch.

Validation performed

On pinned base 31fc9762a34f30aae1832994bfad6209a023f03e, serial bounded checks:

  • Five focused files — 99 tests passed: AnalysisViewService, analyzeFunctionDetail MCP, EvidenceLedger, analysisViewParent and analysisViewMcp. Actual MCP SDK in-memory transport and production record/projection owners; synthetic provider data.
  • node scripts/run-typescript.mjs --noEmit --checkers 1 --maxMemory 2G — whole-project typecheck passed.
  • Scoped lint, format, module boundaries and git diff --check — passed without warnings.

Local merge-tree against 425776174c1826d09b629cf05d2a5a79eb729239 was clean but not executed. Before publication, main advanced to a834ed1cab5327485fdd8845108b63ffcd8654fe; its changes do not touch these three files. Runtime evidence applies to the pinned-base patch, not an independently tested latest-main integration.

Compatibility and limits

No real Ghidra/native engine, browser, newly compiled CLI, full build/CI/coverage or package qualification was run locally. No performance improvement is claimed. The scope is current summary path presentation, not all historical metadata.

The API-published commit differs in metadata from reviewed local commit a3b14683b88c401133ab8d9ab8f8bdc9b202e5c3; its complete tree is identical: c14767a10eb6a975082d68d137ff7800a1f7c3dc. All three public file blob hashes were verified against the reviewed files.

Author readiness

Human owner: @WenyuChiou

  • 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

  • Required current-head checks and relevant verification are satisfied or their gaps are explicitly resolved by maintainers.
  • The human owner has completed the readiness declarations for this PR.
  • Material scope and authority questions are resolved.

🔄 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/7039 **Author:** [@WenyuChiou](https://github.com/WenyuChiou) **Created:** 10/24/2026 **Status:** ✅ Merged **Merged:** 10/24/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/retained-summary-current-path-20261024` --- ### 📝 Commits (2) - [`10795a4`](https://github.com/morluto/rea/commit/10795a4b37e123e250f67095857494981ffd95c2) fix(analysis-view): preserve current observation paths in summaries - [`eee7940`](https://github.com/morluto/rea/commit/eee794035ea4248e644506f1b10117cb53f45c59) merge: integrate upstream Evidence sealing repair ### 📊 Changes **3 files changed** (+209 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `src/application/analysisView/AnalysisViewService.test.ts` (+101 -1) 📝 `src/application/analysisView/AnalysisViewService.ts` (+49 -14) 📝 `tests/boundary/mcp/analyzeFunctionDetail.test.ts` (+59 -8) </details> ### 📄 Description ## Summary Preserve the current observation's path when returning a retained summary instead of substituting metadata from an earlier same-ID ledger record. Complete and summary delivery should describe the same current observation. Explicit later lookup by retained ID should continue to show the historical record. ## Problem and expected behavior A production MCP `analyze_function` regression returned `/selected/native.exe` for complete delivery but `/old/native.exe` for summary delivery. The production EvidenceLedger correctly preserves original metadata when a semantic ID is recorded again; the summary path incorrectly came from that historical lookup. The previous MCP fixture used an overwrite-map and hid this behavior. The regression now uses the production ledger and real MCP SDK/server/registration/delivery boundaries with a synthetic provider dossier. ## Change and scope - Keep ledger duplicate-ID policy and historical by-ID lookup unchanged. - After recording the current Evidence, retain the existing missing-record and identity validation. - Keep the authenticated retained record as payload/sealing owner while using a guarded presentation envelope for the current subject/path. - Preserve retained-source admission and the existing inline accounting accumulator; do not re-admit a large retained payload as generic inline data. - Test complete/summary path parity and later historical lookup separately. This is a focused application-layer presentation fix, not a general metadata rewrite. It does not copy `caller_input_path` into later retained views. It does not edit the domain sealing owner in `evidence.ts` or duplicate #7036's separate JSON ownership correction. ## Contract and boundary impact - Semantic owner: retained-summary projection in AnalysisViewService. - CLI/MCP and public Evidence schemas: unchanged. - Retained payload identity, ledger history and source admission: preserved. - Provider, target selection, process/network/mutation authority: unchanged. - Dependencies, installation, generated metadata and release behavior: unchanged. - Contribution scope: routine correction within existing Evidence delivery; no separate advance capability decision required. ## Evidence and regression coverage Before the fix, the owner regression failed with historical same-ID metadata while its clean-ledger control passed. The actual MCP regression likewise failed current-path parity while its control passed. Final coverage includes a large 40,000-character-header capture: retained projections remain admitted while the equivalent generic inline envelope is refused. It also covers unchanged retained root/payload ownership, record failure, missing-record and wrong-ID guards, current MCP paths, later historical lookup and existing oversized MCP views. Independent automated static/log review approved the final three-file patch; the reviewer did not independently execute tests. No human readiness attestation is implied. Two fixture mistakes were corrected and their failed attempts preserved: missing parsed pagination defaults, and an incorrect expected error tag. Exact assertions and failure reasons remain checked. A separate environment-metadata hypothesis was not established as a defect and is excluded from this patch. ## Validation performed On pinned base `31fc9762a34f30aae1832994bfad6209a023f03e`, serial bounded checks: - Five focused files — **99 tests passed**: AnalysisViewService, analyzeFunctionDetail MCP, EvidenceLedger, analysisViewParent and analysisViewMcp. Actual MCP SDK in-memory transport and production record/projection owners; synthetic provider data. - `node scripts/run-typescript.mjs --noEmit --checkers 1 --maxMemory 2G` — whole-project typecheck passed. - Scoped lint, format, module boundaries and `git diff --check` — passed without warnings. Local merge-tree against `425776174c1826d09b629cf05d2a5a79eb729239` was clean but not executed. Before publication, main advanced to `a834ed1cab5327485fdd8845108b63ffcd8654fe`; its changes do not touch these three files. Runtime evidence applies to the pinned-base patch, not an independently tested latest-main integration. ## Compatibility and limits No real Ghidra/native engine, browser, newly compiled CLI, full build/CI/coverage or package qualification was run locally. No performance improvement is claimed. The scope is current summary path presentation, not all historical metadata. The API-published commit differs in metadata from reviewed local commit `a3b14683b88c401133ab8d9ab8f8bdc9b202e5c3`; its complete tree is identical: `c14767a10eb6a975082d68d137ff7800a1f7c3dc`. All three public file blob hashes were verified against the reviewed files. ## Author readiness Human owner: @WenyuChiou - [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 - [ ] Required current-head checks and relevant verification are satisfied or their gaps are explicitly resolved by maintainers. - [ ] The human owner has completed the readiness declarations for this PR. - [ ] Material scope and authority questions are resolved. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 13:38:59 +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#7596
No description provided.