fix: cancel active export IO and reconcile late completion #1506
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 442 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.365
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1506"
general
weight: 0.35
qwts
Motivation
Closes #1217. Cancelling during an active original read, custody acquisition, transform or destination write previously waited for that operation and could continue the current entry.
Description
Pass the caller signal through the supported export seams and stream pipelines. An owned per-entry scope acknowledges abort promptly, observes late success/failure for disposal, removes provisional output and keeps completed photo entries. A failure which settles first remains a per-file failure.
Separate acknowledgement from retirement: ordinary/protected export queues wait for the actual operation and cleanup before starting another batch. Original references return an idempotent, hash-bound release handle so row deletion cannot lose or double-release custody. Managed decrypt pipelines also close upstream descriptors. Exclusive-create cleanup preserves an EEXIST collision winner. A pre-aborted writer closes its input without opening a destination.
Uninterruptible Sharp stages use its supported 30-second processing timeout and stop before the next stage. That clock excludes libuv queue wait. Provider/kernel work has no universal hard stop deadline; the caller does not wait for it, and no physical-stop claim is made. Missing-key preflight, disclosure authority and backup policy are unchanged.
Documentation
Export cancellation acceptance records result/ownership semantics, processing/work bounds, unavoidable IO and controlled regression evidence. Edited-export acceptance, M07 and the docs index link to it.
Changeset
Acceptance coverage
Controlled tests cancel stalled original/buffer reads, custody acquisition, native transforms and actual OS open/write callbacks. Late success/failure, companion rollback, collision ownership, shared custody, disappearing rows, closed diagnostic sinks, queue/drain ordering and protected streams are covered. Seven regressions fail against baseline, including five blocked operations, collision-winner deletion and an upstream descriptor leak.
Testing
Node 24.18.0. Local gates passed sequentially:
npm run lint, focused follow-up ESLint for the captured-release change,INTEROP_IMAGE_TRAIL_ROOT=/workspace/image-trail npm test(2,809 unit passed, ten skipped; 120 DOM; all four database-page scenarios),DOCS_GOV_TOOLING_ROOT=/workspace/docs-gov npm run docs:gov(129 docs, zero findings),npm run format:check,npm run check:changesets,git diff --check. The final pre-abort follow-up also passed focused ESLint, test compilation and all 48 export tests; its new regression failed before the fix.Hosted complete exact-head CI 46116401078 covers complete tests/coverage, build, Storybook, Windows, zero-retry E2E, docs and security on
c538a2a4207658db15a5b76c7fa81a2f82cadae0. Heavy lanes run only in CI.Manual Testing
Follow the acceptance page with several large/offloaded photos: cancel during a later entry, preserve committed entries, observe cleanup after retirement, then queue another export and close/lock. Controlled automated seams provide deterministic evidence for stalls and late completion.
<!-- agent-bot-write: ghw_f9bc47eed404b9ab session=f601b21bf418 bot=trueline-codex-agent[bot] conversation_id=1217-export-cancellation conversation_id_source=self-reported -->