Repository navigation
fix(write): retain disk-full diagnostics through disposal - #833
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 4, 2026, 1:34 PM ET / 17:34 UTC. ClawSweeper reviewWhat this changesPreserve disk-full diagnostics, original causes, and cleanup receipts when guarded writes fail during both publication and disposal. Merge readiness✅ Ready for maintainer review Keep open: the combined disk-full failure remains on current main and in v0.23.0, and this focused repair has no identified correctness defect. The member-authored PR also requires explicit maintainer handling. Priority: P2 Review scores
Verification
How this fits togetherfs-safe provides confined filesystem operations for Node.js applications. Its write-error handler converts failures from staged publication and disposal into diagnostics that callers can inspect without losing publication or cleanup evidence. flowchart TD
A[Root write or copy] --> B[Guarded staged publication]
B --> C[Publication failure]
C --> D[Resource disposal]
D --> E[Combined error graph]
E --> F[Write diagnostic handler]
F --> G[Error with causes and receipts]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Extend the existing diagnostic traversal while preserving error classifications, boundary precedence, and indeterminate-publication receipts. Do we have a high-confidence way to reproduce the issue? Yes, from source: Root.copyIn can combine an ENOSPC publication failure with preserved-stage disposal, while main's diagnostic traversal recognizes only descriptor exhaustion. Execution was not repeated in this read-only review. Is this the best way to solve the issue? Yes. Extending the existing traversal is a narrow repair, and the patch preserves classified errors, descriptor precedence, causes, and cleanup receipts without changing filesystem decisions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 29f13fdeacc0. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
What Problem This Solves
Fixes misleading file-type errors when
Root.copyIn()runs out of disk space during native publication and async disposal preserves an uncertain stage.User Impact
Consumers see
ENOSPCand the retained publication/cleanup receipt. The documentedinvalid-path/policycompatibility classification and already-classified errors remain unchanged. An uncertain rename still cannot authorize removing the stage or retrying the write.Why This Change Was Made
The existing write-resource diagnostic owner traversed suppressed and aggregate failures for descriptor exhaustion but omitted disk exhaustion. Extend that same owner, preserving the original cause graph and
EMFILE/ENFILEprecedence. Native publication, cleanup, identity checks, and retry policy are unchanged.Evidence
Three regression cases failed before the change, including native public
Root.copyIn()failures before and after rename dispatch. The repaired cases pass, retain staged or published bytes, and close descriptors. Fullpnpm checkpassed: 14,828 tests passed and 2,854 platform/optional tests skipped, plus static guards, TypeScript/WASM builds, documentation, and installed-package checks. Independent P0–P2 review is scoped-clean.Production delta: +5 lines by extending the existing owner; tests +60, docs/changelog +7. No new public error codes, configuration, dependencies, or fallback paths.
CHANGELOG.mdupdated when release-relevant