Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
|
Thank you @Adkid-Zephyr for following through on the failed-open recovery issue. Preserving Evidence and Unknown records when provider cleanup fails means an investigation remains exportable and recoverable until the caller explicitly closes it. |
Summary
Preserve the investigation's Evidence and Unknown history when
open_binaryfails to retire the previous provider. Both target switching and same-target restart currently turn a bundle with 4 records/2 revisions into an empty bundle. Fixes #2753.Follow-up to the unresolved P1 finding on #1776; original finding credited there. Implemented and verified with OpenAI Codex assistance.
Problem and expected behavior
A provider cleanup failure is returned correctly, but
BinarySession.#openalso callsclearSessionRecords(). A subsequent export cannot recover the lost investigation. Target opens must preserve records; explicitclose_binaryremains the operation that clears them.Change and scope
Use the existing
clearSnapshot()owner to discard the retired provider's replay cache without clearing the investigation ledger. Keep the pending cleanup owner, unavailable target, retry gate, and explicit-close behavior. Clarify this lifetime in the MCP guide.Contract and boundary impact
BinarySession.#open, after failed retirement.Expected effects exercised by the regression workflow (production adds no new target interaction):
Production adds no target interaction. Tests also write temporary fixtures/exports and launch REA's JavaScript analysis worker; they never execute the analyzed JavaScript or a native target.
Evidence and regression coverage
Two public MCP boundary regressions exercise a target switch and same-target restart through the production provider composition, with controlled provider failure/health.
Exact final tests on main
ab02f3c8d665ead35391c94db74cd0fb0cfed0ed: 2 failed, observing all 4 records and both Unknown revisions disappear. With the fix: 2 passed.Check repeated failed cleanup, exact bundle preservation and file export, successful retry, fresh provider queries instead of stale cache replay, retained JavaScript Evidence views, and explicit close clearing.
User-visible failure remains
cleanup_incomplete;get_evidence_bundleand export retain the original records instead of empty collections.Proof gaps: provider cleanup/health are fixtures. No new real Hopper/Ghidra/IDA failure or native Windows/Linux run; no incidence-rate claim.
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
Pinned Node 24.18.0/npm 11.16.0 on macOS arm64, final head
f603947rebased onto main2995ec6:npm run test:focused -- tests/boundary/mcp/sessionEvidenceRecovery.test.ts tests/boundary/mcp/sessionMcp.test.ts tests/boundary/mcp/retainedApplicationEvidenceMcp.test.ts tests/composition/analysis-sessions/binarySessionCleanupRetry.test.ts tests/composition/analysis-sessions/binarySession.test.ts src/application/binary/BinarySessionLiveness.test.ts tests/boundary/filesystem/directAnalysisSnapshotReplay.test.ts— 76 passed, 7 files.npm run check— passed after shortening the new test helper; the initial run caught its function-length lint error.npm run docs:check— passed, including 2 consistency tests.npm run verify:test-discovery— all 1,055 files discovered once.git diff --check— passed.Full deterministic suite not run locally; remote CI is separate.
verify:packagepassed while scouting the untouched baseline; packaging checks were not rerun for this lifecycle-only diff.Compatibility, safety, and release
Before merge