[PR #3076] [CLOSED] fix(native): align retained-view recovery guidance across MCP and docs #5595

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3076
Author: @siegfly
Created: 10/14/2026
Status: ❌ Closed

Base: main ← Head: codex/native-retained-evidence-guide


📝 Commits (10+)

  • b597555 docs(native): explain retained views and decompilation recovery
  • 188c2aa docs(native): qualify recovery and native view paging contracts
  • e546d25 docs(native): preserve unavailable collection status in paging guidance
  • 4b78f42 docs(native): qualify unavailable pseudocode and post-close recovery
  • 43bbc12 fix(native): align MCP recovery advice with retained view shapes
  • b5e4d69 docs(native): keep completion unknown after client timeouts
  • 61eff03 docs(native): preserve unknown Ghidra activity after client timeouts
  • 244fc5e docs(cli): qualify optional provider activity observations
  • 9b794ab fix(native): preserve unavailable API residual guidance
  • ddfcb40 fix(native): align cancellation and snapshot recovery guidance

📊 Changes

13 files changed (+718 additions, -31 deletions)

View changed files

📝 .agents/skills/reverse-engineer-anything/references/native-and-artifacts.md (+77 -1)
📝 docs/cli.md (+19 -2)
📝 docs/mcp-contracts.md (+135 -17)
📝 docs/native-investigation.md (+21 -5)
📝 src/contracts/analysisViewToolContracts.ts (+1 -1)
📝 src/ghidra/GhidraAnalysisProfile.ts (+3 -0)
📝 src/ghidra/GhidraProvider.behavior.test.ts (+3 -0)
📝 src/ghidra/GhidraProviderCapabilities.ts (+2 -2)
📝 src/ghidra/GhidraSnapshotCache.test.ts (+81 -0)
📝 src/server/toolResult.ts (+1 -1)
📝 tests/boundary/mcp/analysisViewMcp.test.ts (+170 -2)
📝 tests/boundary/mcp/ghidraEvidenceMcp.test.ts (+125 -0)
📝 tests/boundary/mcp/sessionEvidenceRecovery.test.ts (+80 -0)

📄 Description

Summary

Native recovery guidance could mistake unavailable/singleton results for pages, lose residual facts, or treat historical dossiers as completion of a timed request. Align MCP metadata/errors, emitted Ghidra limitations and native/CLI recovery guides with existing behavior.

  • Preserve text/row/singleton/status variants, including unrecorded native_api status-only output and recorded residual unknowns. Continuation is normalized_result.coverage.next_offset.
  • A timeout leaves completion unknown. Use a pre-call ID baseline and attributable settled result, or explicit request/result correlation; matching old records do not establish current comments after annotation. Concurrent edits/requests and reused content IDs preserve uncertainty.
  • Snapshot close drains and saves before clearing records. After saved snapshot plus failed cleanup, preserve the file and retry plain close without snapshot_path. Metadata-edited sessions need settled work and final export before plain close.

Production changes are guidance strings plus a Ghidra profile commitment for recovery limitations. Pre-revision snapshots require fresh analysis instead of replaying superseded guidance; historical Evidence is not rewritten. Tool schemas, provider algorithms, authority and cleanup policy are unchanged.

Validation

Current head 8ddafded4 includes main 3ea0d9489 / 6.7.0. Verification uses Node 24.18.0 / npm 11.16.0.

Fresh seven-file selection on this exact head: Windows 88 pass / 26 existing skips; Linux 114 pass / zero skips. It covers native Evidence recovery/views/snapshot replay, compiled CLI output, Java prerequisite checks and JADX startup. All 25 JADX startup cases execute on Linux; they are intentionally unsupported on Windows. The earlier real Windows Ghidra 30-check verification remains attributed to 011a63224, not this new head. No fresh real-engine qualification is claimed.

Synchronization and CI diagnosis

The latest hosted run 39253883164 fails in Linux shard 2: the stdout-startup case times out and teardown retains ownership failures (environment_errno_EACCES / identity revalidation). The relevant JADX fixture/provider/process-ownership files are byte-identical to main 3ea0d9489. A main-source three-file control passes 58 tests with 3 existing skips. A broader main-source nine-file control records 93 pass / 1 fail / 2 skips: a different startup cancellation case also waits past its 30-second deadline. This establishes another startup timeout on main, not reproduction of the exact hosted permission failure or proof of its cause.

Diagnostic-only admission instrumentation in a temporary copy (not this PR) observes an operation settling before the fixture request rather than hiding it behind an unresolved request wait; its two-file and nine-file runs pass 34 and 94 tests (the latter with 2 existing skips). Passing diagnostic runs do not establish a fix. The original red logs are retained; no timeout, retry, permission or ownership check is weakened. A failed-jobs rerun request returned HTTP 403 requiring repository admin rights. Could a maintainer rerun the failed jobs of run 39253883164?

Independent fixes and limitations

Main #5224 and the later native-preparation regression update cover most of the earlier independent fixes. Two Windows test gaps remain outside these PRs: a slash-only expected snapshot path and an MCP test expecting native Windows PTY capture to open a snapshot despite the documented unsupported-capability gate. A separate minimal two-file validation copy passes 15 tests on Windows and 15 on Linux. The published independent branch remains at 5453f3cbb; no independent-fix PR is opened, and none of its commits is merged/cherry-picked into these PRs. Its older full diff must not be replayed over newer upstream assertions, particularly the Darwin/Linux preparation distinction.

Readiness and current-head Codex/Greptile reviews pass. The hosted CI failure remains unresolved; Windows capability/package is skipped on this PR, not passed.

Hopper remains local-only and unpublished.

Completed CI and main controls (2026-10-19)

Hosted CI is complete and red in Linux shard 2. Windows native controls pass; Windows capability/package is skipped by scope, not passed. The current-head Codex review and Greptile have no findings. The latest readiness workflow succeeds.

The exact hosted JADX stdout/cancellation failure has not been reproduced locally. A new controlled boundary diagnostic makes only the fixture-owned Java launcher exit 71: the operation returns capability_unavailable before transport acquisition, while the fixture request remains unadmitted and no workspace is created (1 test passes on Linux). This demonstrates how an unconditional fixture-request wait can hide an earlier prerequisite failure; it does not reproduce EACCES or prove a fix.

Upstream controls now provide runtime evidence: main 3ea0d9489 CI and main 255d906e1 CI also fail both recorded-crash containers with the same historical-PID /proc//stat assertion. Main 255d906e1 Apple E2E also reports cleanup-stage process-identity-unavailable. Main has Linux cleanup failures too; this identifies a shared failure family, not the exact cause of each PR assertion.

A local main-source owned-command diagnostic, with an exact-path read observer and no production edits, records the sentinel stat read from readProcessRelationSnapshot via createOwnedCleanupPlan even for a normal Node command with no crash input. The sentinel stays alive. This supports an oracle attribution problem: the current verifier allows those reads only in the ps executable trace, while native ownership reads now occur in Node. Full local strace/recorded-crash reproduction is unavailable (strace is not installed), and neither the whitelist nor the ownership checks have been weakened.

These main issues remain separate. No independent repair PR is created; the existing independent branch remains at 5453f3cbb and Hopper remains local-only/unpublished. These heads include main 3ea0d9489; main has since advanced to 255d906e1 with base64/byte-pattern fixes, which do not change the inspected process, JADX or trace-verifier files. No new main sync is claimed.

Author readiness

Human owner: @siegfly

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

The human owner completed the initial declarations on 2026-10-16; later pushes preserve that declaration under the contribution policy.


🔄 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/3076 **Author:** [@siegfly](https://github.com/siegfly) **Created:** 10/14/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `codex/native-retained-evidence-guide` --- ### 📝 Commits (10+) - [`b597555`](https://github.com/morluto/rea/commit/b5975558ad814039e4aaf8771eec84a1b9da8d4e) docs(native): explain retained views and decompilation recovery - [`188c2aa`](https://github.com/morluto/rea/commit/188c2aa6b5d3d2b26f4f1593fa8f2e3a57292bfb) docs(native): qualify recovery and native view paging contracts - [`e546d25`](https://github.com/morluto/rea/commit/e546d25b0065aeabe2f655228035c0ccbcd29820) docs(native): preserve unavailable collection status in paging guidance - [`4b78f42`](https://github.com/morluto/rea/commit/4b78f426ad938c6b65fc7f643b3b6d56b6a45740) docs(native): qualify unavailable pseudocode and post-close recovery - [`43bbc12`](https://github.com/morluto/rea/commit/43bbc1276383495bd0a11fe5a523004fe07ef938) fix(native): align MCP recovery advice with retained view shapes - [`b5e4d69`](https://github.com/morluto/rea/commit/b5e4d69b570cec0c4ef4b0adb48a1e426ebcfb3d) docs(native): keep completion unknown after client timeouts - [`61eff03`](https://github.com/morluto/rea/commit/61eff030670210463ae24b8d13e852b04f5542a0) docs(native): preserve unknown Ghidra activity after client timeouts - [`244fc5e`](https://github.com/morluto/rea/commit/244fc5ecfbe15854e8ee76c0087703d51f0dbeb6) docs(cli): qualify optional provider activity observations - [`9b794ab`](https://github.com/morluto/rea/commit/9b794abe4541c04164e3c00710b75ef643e9b120) fix(native): preserve unavailable API residual guidance - [`ddfcb40`](https://github.com/morluto/rea/commit/ddfcb4000fcf618e0fd14963141ff973e9bdc566) fix(native): align cancellation and snapshot recovery guidance ### 📊 Changes **13 files changed** (+718 additions, -31 deletions) <details> <summary>View changed files</summary> 📝 `.agents/skills/reverse-engineer-anything/references/native-and-artifacts.md` (+77 -1) 📝 `docs/cli.md` (+19 -2) 📝 `docs/mcp-contracts.md` (+135 -17) 📝 `docs/native-investigation.md` (+21 -5) 📝 `src/contracts/analysisViewToolContracts.ts` (+1 -1) 📝 `src/ghidra/GhidraAnalysisProfile.ts` (+3 -0) 📝 `src/ghidra/GhidraProvider.behavior.test.ts` (+3 -0) 📝 `src/ghidra/GhidraProviderCapabilities.ts` (+2 -2) 📝 `src/ghidra/GhidraSnapshotCache.test.ts` (+81 -0) 📝 `src/server/toolResult.ts` (+1 -1) 📝 `tests/boundary/mcp/analysisViewMcp.test.ts` (+170 -2) 📝 `tests/boundary/mcp/ghidraEvidenceMcp.test.ts` (+125 -0) 📝 `tests/boundary/mcp/sessionEvidenceRecovery.test.ts` (+80 -0) </details> ### 📄 Description ## Summary Native recovery guidance could mistake unavailable/singleton results for pages, lose residual facts, or treat historical dossiers as completion of a timed request. Align MCP metadata/errors, emitted Ghidra limitations and native/CLI recovery guides with existing behavior. - Preserve text/row/singleton/status variants, including unrecorded native_api status-only output and recorded residual unknowns. Continuation is normalized_result.coverage.next_offset. - A timeout leaves completion unknown. Use a pre-call ID baseline and attributable settled result, or explicit request/result correlation; matching old records do not establish current comments after annotation. Concurrent edits/requests and reused content IDs preserve uncertainty. - Snapshot close drains and saves before clearing records. After saved snapshot plus failed cleanup, preserve the file and retry plain close without snapshot_path. Metadata-edited sessions need settled work and final export before plain close. Production changes are guidance strings plus a Ghidra profile commitment for recovery limitations. Pre-revision snapshots require fresh analysis instead of replaying superseded guidance; historical Evidence is not rewritten. Tool schemas, provider algorithms, authority and cleanup policy are unchanged. ## Validation Current head **8ddafded4** includes main **3ea0d9489 / 6.7.0**. Verification uses Node 24.18.0 / npm 11.16.0. Fresh seven-file selection on this exact head: **Windows 88 pass / 26 existing skips; Linux 114 pass / zero skips**. It covers native Evidence recovery/views/snapshot replay, compiled CLI output, Java prerequisite checks and JADX startup. All 25 JADX startup cases execute on Linux; they are intentionally unsupported on Windows. The earlier real Windows Ghidra 30-check verification remains attributed to 011a63224, not this new head. No fresh real-engine qualification is claimed. ## Synchronization and CI diagnosis The latest hosted run [39253883164](https://github.com/morluto/rea/actions/runs/39253883164) fails in Linux shard 2: the stdout-startup case times out and teardown retains ownership failures (`environment_errno_EACCES` / identity revalidation). The relevant JADX fixture/provider/process-ownership files are byte-identical to main 3ea0d9489. A main-source three-file control passes 58 tests with 3 existing skips. A broader main-source nine-file control records **93 pass / 1 fail / 2 skips**: a different startup cancellation case also waits past its 30-second deadline. This establishes another startup timeout on main, not reproduction of the exact hosted permission failure or proof of its cause. Diagnostic-only admission instrumentation in a temporary copy (not this PR) observes an operation settling before the fixture request rather than hiding it behind an unresolved request wait; its two-file and nine-file runs pass 34 and 94 tests (the latter with 2 existing skips). Passing diagnostic runs do not establish a fix. The original red logs are retained; no timeout, retry, permission or ownership check is weakened. A failed-jobs rerun request returned HTTP 403 requiring repository admin rights. **Could a maintainer rerun the failed jobs of run 39253883164?** ## Independent fixes and limitations Main #5224 and the later native-preparation regression update cover most of the earlier independent fixes. Two Windows test gaps remain outside these PRs: a slash-only expected snapshot path and an MCP test expecting native Windows PTY capture to open a snapshot despite the documented unsupported-capability gate. A separate minimal two-file validation copy passes 15 tests on Windows and 15 on Linux. The published independent branch remains at 5453f3cbb; no independent-fix PR is opened, and none of its commits is merged/cherry-picked into these PRs. Its older full diff must not be replayed over newer upstream assertions, particularly the Darwin/Linux preparation distinction. Readiness and current-head Codex/Greptile reviews pass. The hosted CI failure remains unresolved; Windows capability/package is skipped on this PR, not passed. Hopper remains local-only and unpublished. <!-- ci-diagnosis-20261019:start --> ### Completed CI and main controls (2026-10-19) Hosted CI is complete and red in Linux shard 2. Windows native controls pass; Windows capability/package is skipped by scope, not passed. The current-head Codex review and Greptile have no findings. The latest readiness workflow succeeds. The exact hosted JADX stdout/cancellation failure has not been reproduced locally. A new controlled boundary diagnostic makes only the fixture-owned Java launcher exit 71: the operation returns capability_unavailable before transport acquisition, while the fixture request remains unadmitted and no workspace is created (1 test passes on Linux). This demonstrates how an unconditional fixture-request wait can hide an earlier prerequisite failure; it does not reproduce EACCES or prove a fix. Upstream controls now provide runtime evidence: [main 3ea0d9489 CI](https://github.com/morluto/rea/actions/runs/39261789271) and [main 255d906e1 CI](https://github.com/morluto/rea/actions/runs/39266528335) also fail both recorded-crash containers with the same historical-PID /proc/<pid>/stat assertion. Main 255d906e1 Apple E2E also reports cleanup-stage process-identity-unavailable. Main has Linux cleanup failures too; this identifies a shared failure family, not the exact cause of each PR assertion. A local main-source owned-command diagnostic, with an exact-path read observer and no production edits, records the sentinel stat read from readProcessRelationSnapshot via createOwnedCleanupPlan even for a normal Node command with no crash input. The sentinel stays alive. This supports an oracle attribution problem: the current verifier allows those reads only in the ps executable trace, while native ownership reads now occur in Node. Full local strace/recorded-crash reproduction is unavailable (strace is not installed), and neither the whitelist nor the ownership checks have been weakened. These main issues remain separate. No independent repair PR is created; the existing independent branch remains at 5453f3cbb and Hopper remains local-only/unpublished. These heads include main 3ea0d9489; main has since advanced to 255d906e1 with base64/byte-pattern fixes, which do not change the inspected process, JADX or trace-verifier files. No new main sync is claimed. <!-- ci-diagnosis-20261019:end --> ## Author readiness Human owner: @siegfly - [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. The human owner completed the initial declarations on 2026-10-16; later pushes preserve that declaration under the contribution policy. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:07:50 +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#5595
No description provided.