Skip to content

fix!: guide snapshot inputs to the restore workflow - #8867

Merged
morluto merged 1 commit into
mainfrom
codex/snapshot-import-recovery
Nov 4, 2026
Merged

morluto merged 1 commit into
mainfrom
codex/snapshot-import-recovery

Conversation

@morluto

@morluto morluto commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Problem and outcome

Passing an analysis snapshot to import_evidence_bundle or evidence-import currently reports an Evidence integrity mismatch and recommends recreating observations, even when the file is a valid snapshot. Recognize the snapshot-shaped envelope after bundle validation fails and guide callers to the appropriate restore workflow. Related: #8590.

The envelope check does not authenticate a snapshot: the error explicitly says so. Inputs with a top-level bundle records member retain bundle integrity diagnostics. MCP guidance names open_binary and snapshot_path; CLI guidance names --snapshot and states that the CLI loads and updates the selected file. Both require the original target identity and matching provider and analysis profile.

Breaking: snapshot-shaped bundle import failures now return invalid_request rather than evidence_integrity_mismatch. Refresh error handling that matches the old code.

Validation

  • Public MCP snapshot workflow suite: 8 tests passed, including three snapshot history scenarios that first receive the new error and then reopen the same snapshot, plus malformed snapshot-shaped, ambiguous bundle-shaped and malformed bundle controls. The valid-snapshot tests failed against the previous behavior. Snapshot bytes remained unchanged by the rejected import.
  • Real Ghidra 12.1.4/JDK 21 on macOS arm64: created a fresh one-shot snapshot from a disposable saved project containing a synthetic historical report. Both MCP schema profiles received invalid_request, followed the open_binary route and recovered the same historical source Evidence. The snapshot, unexecuted target and selected .gpr descriptor hashes were unchanged during those reads. An older snapshot from another analysis profile was correctly rejected as mismatched.
  • The public evidence-import CLI returned the same guidance. A real Ghidra decompile --snapshot invocation succeeded against a disposable copy, preserving its linked source record; the option can update the copy.
  • check:fast, docs:check and git diff --check passed. Other providers, hosts, and arbitrary malformed snapshot contents were not exhaustively exercised.

Author readiness

Human owner:

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

BREAKING CHANGE: Snapshot-shaped bundle import failures use invalid_request rather than evidence_integrity_mismatch.
@greptile-apps

greptile-apps Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the new guidance does not change which bundles or snapshots are accepted.

Summary

The PR recognizes snapshot-shaped JSON after an Evidence bundle import fails and points callers to the restore workflow.

  • Bundle imports point snapshot files toward the restore workflow.

No actionable code or security issues were found. Checks were source-based; tests were not run during this review. Supersession could not be checked because GitHub access required authentication.

Reviews (1) · Last reviewed commit: "fix!: guide snapshot inputs to the resto..." · Reviewed by Greptile

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 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 ✅ Completed 2026-11-04T16:55:18.616832Z 70c8ad6 Draft marked ready
ℹ️ 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.

@morluto
morluto merged commit 30228c9 into main Nov 4, 2026
50 checks passed
@morluto
morluto deleted the codex/snapshot-import-recovery branch November 4, 2026 17:50
@morluto morluto added area: build Build, CI, packaging, and publishing bug Something isn't working labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build Build, CI, packaging, and publishing bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant