Skip to content

fix(target): preserve physical admission failures through cancellation - #12339

Merged
morluto merged 2 commits into
mainfrom
audit/target-admission-read-lifecycle
Nov 19, 2026
Merged

morluto merged 2 commits into
mainfrom
audit/target-admission-read-lifecycle

Conversation

@morluto

@morluto morluto commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

Preserve the physical failure when a selected binary target's descriptor read or hash fails and the caller cancels before cleanup finishes. Retain the caller's cancellation and any descriptor lease that still needs retry.

Root cause

The target resolver inferred cancellation from the ambient signal and from equality with its reason, even when the stable file owner had recorded a distinct physical outcome. It now uses the owner's typed cancellation, retains a later interruption as a secondary failure, and uses the same descriptor cleanup owner.

Validation

Four regression variants failed on the base. Two further cases reproduced loss of typed cancellation after a successful close retry. The final patch passed 131 focused tests, with one Windows-only fixture skipped on macOS, including real file handles with injected physical errors, cleanup retry, and MCP connection reuse. npm run check:fast, formatting, and diff checks passed.

Author readiness

Human owner: @morluto

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T13:03:13.189297Z 21d8503 New commits
ℹ️ 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 Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge; no blocking issues remain.

Summary

Preserves file-read failures when a caller cancels during target selection, while keeping cancellation details and ownership of handles that still need closing.

  • Binary target admission keeps file failures primary when cancellation arrives during cleanup.

Reviews (2) · Last reviewed commit: "fix(target): preserve cancellation facts..." · Reviewed by Greptile

Comment thread src/application/BinaryTargetResolver.ts Resolved
@morluto
morluto enabled auto-merge (squash) November 19, 2026 13:03
@morluto
morluto merged commit 29b2f96 into main Nov 19, 2026
42 checks passed
@morluto
morluto deleted the audit/target-admission-read-lifecycle branch November 19, 2026 13:10
jimpablo added a commit to jimpablo/rea that referenced this pull request Nov 21, 2026
…-admission

Resolve conflicts with upstream/main (8fefe18):
- Remove docs/specs/README.md and docs/specs/native/macho-dsym-companion/* per morluto#12856
- Combine caller_input_path and debug_companion in liveBinaryTargetSummary.ts
- Combine ComLoader import and debug_companion in GhidraAnalysisProfile.ts
- Combine detectDatabaseEngine, boolean hasTrailingZipArchive, and retainTargetCancellation (morluto#12339) with dsym_path admission and cleanup in BinaryTargetResolver.ts
- Update advertised schema summary for open_binary.json
- Migrate new tests in ghidraCheckpointLifecycle.test.ts and GhidraProvider.behavior.test.ts to createTestTempDirectory (morluto#12722)
jimpablo added a commit to jimpablo/rea that referenced this pull request Nov 21, 2026
…rship

- Report Mach-O LC_UUID and FAT format failures with ParseFailureError (kind, format, offset, field) in machoDebugCompanion and preserve them through DebugCompanionAdmission.
- Preserve established member refusals in readMemberWithBorrowedResources without running cancellation-sensitive post-read stability validation on rejected outcomes, and preserve physical EIO failures when the caller aborts with the same error object (morluto#12339).
- Preserve cancellation arriving during outer target handle close after an inner companion handle close failure.
- Defer partial staged-bundle removal in stageGhidraDebugCompanion to the private runtime owner so open destination descriptors are never unlinked before release (matching GhidraTargetSnapshot).
- Remove explicit 10s test timeout in sessionMcp.test.ts, use exactOptional() on liveBinaryTargetSummary debug_companion, and align explicit format-selection rejection/docs with TargetFormatHint.
@morluto morluto added bug Something isn't working area: providers Provider and capability discovery, including provider proposal triage labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: providers Provider and capability discovery, including provider proposal triage bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant