Skip to content

fix(desktop)!: preserve failure origins through cleanup - #10109

Merged
morluto merged 5 commits into
mainfrom
codex/audit-desktop-cancellation-origin
Nov 11, 2026
Merged

morluto merged 5 commits into
mainfrom
codex/audit-desktop-cancellation-origin

Conversation

@morluto

@morluto morluto commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Summary

A native staging write failure could be reported as cancellation after successful cleanup. Conversely, a caller’s cancellation reason could be mistaken for an input refusal when the reason itself was an AnalysisError.

Desktop checkpoints and composed readers now emit explicit cancellation facts. The shared failure boundary preserves physical failures and cleanup ownership, adding later cancellation separately. Retained-file reads use their actual operation outcomes; dconf uses its owned command’s cancellation type. The download-install reader and bundle task file reads also preserve typed cancellation and the original physical failure. This follows merged #10108.

Breaking internal migration: custom state readers must emit typed cancellation instead of throwing an arbitrary caller reason. Expected read/format failures remain returned results. Current CLI/MCP schemas and execution authority are preserved. The separate capture classifier is being addressed independently.

Validation

  • Authenticated capture fixtures and real private staging roots reproduce native EACCES, with cancellation only after actual root removal. Physical failure, genuine cancellation, normal reads and opaque non-cancellation error reasons are covered. Original capture bytes and cleanup ownership remain intact.

  • Official focused source gates: 174 unique passing tests across nine suites. These include State/Refusals/retained-content/ZIP/dconf (74), TaskExport (32), BuildSecrets (4), and ApplicationExport (64). The export table distinguishes injected ENOSPC from genuine delegated writer cancellation and verifies rollback.

  • The merge with main 69630c03 preserved all 15 then-tested file hashes. Combined check:fast, full typecheck, formatting and diff checks pass; scoped lint has zero errors and five existing warnings.

  • Follow-up: npm run check:fast passed; five source suites for export, witness, failure projection, and host-file consumers passed (81 passed, 4 platform-dependent skips). Cancellation and late-read-failure regressions failed against the prior PR head and passed after the fix.

ZIP format failures remain recoverable view errors with cooperative checkpoints. A pre-aborted dconf profile-failure test was withdrawn and replaced with separate physical-failure and cancellation-before-acquisition controls; physical dconf failure followed by late cancellation remains unverified.

Only controlled files and inert Node/shell/Python fixture processes ran. No desktop application, GUI, real dconf or target ran. Windows permission behavior remains unverified.

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.

Keep physical failures primary when cancellation arrives during cleanup. Migrate application checkpoints and composed readers to existing typed cancellation owners while retaining exact reasons and cleanup leases.

BREAKING CHANGE: Internal desktop readers must report cancellation with AnalysisCancelledError or ArtifactReaderFailure instead of throwing an arbitrary caller cancellation reason.
…ancellation-origin

# Conflicts:
#	src/application/desktop/DesktopApplicationExport.test.ts
@morluto
morluto marked this pull request as ready for review November 11, 2026 14:24
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 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-11T14:36:31.417344Z 8025949 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 04ef485344

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@morluto
morluto merged commit 5fde394 into main Nov 11, 2026
7 of 9 checks passed
@morluto
morluto deleted the codex/audit-desktop-cancellation-origin branch November 11, 2026 14:37
@morluto morluto added bug Something isn't working area: runtime Process capture and runtime observation labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: runtime Process capture and runtime observation bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant