Repository navigation
fix(durability): preserve exact directory pin identities - #483
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 real behavior proof before merge. Reviewed September 18, 2026, 5:22 PM ET / 21:22 UTC (Revision 5). ClawSweeper reviewWhat this changesThe PR preserves exact directory identities across durability checks, publication, staging, and synchronous store writes while retaining mutable numeric metadata for callers. Merge readiness⛔ Blocked before merge - 4 items remain This fix remains necessary: main and v0.15.0 still compare numeric directory identities. No introduced correctness defect was found, but the prior runtime-proof and compatibility-acceptance blockers remain. Priority: P2 Review scores
Verification
How this fits togetherDirectory durability connects filesystem identity checks to directory synchronization after file creation or publication. It accepts paths or previously observed receipts and reports synchronization success only after checking that the pathname still identifies the intended directory. flowchart TD
A[Directory path or receipt] --> B[Validate supplied identity]
B --> C[Retain exact private identity]
C --> D[Check pathname and descriptor]
D -->|Identity matches| E[Synchronize directory]
D -->|Mismatch or unknown| F[Reject operation]
E --> G[Recheck identity]
G --> H[Return outcome or rejection]
Decision needed
Why: The stricter checks restore the safety contract but can stop existing callers; documentation establishes the proposed behavior, not maintainer acceptance of its release impact. Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep exact identity checks fail-closed, preserve original-receipt reuse, and ship the documented bigint migration with explicit compatibility acceptance and observable upgrade evidence. Do we have a high-confidence way to reproduce the issue? Yes, from source: main compares numeric directory identities, allowing rounded-equal inode values and tolerated Windows zero components to conceal replacement. No runtime reproduction was executed in this read-only review. Is this the best way to solve the issue? Yes at the implementation level: reusing strict identity helpers and retaining private exact observations repairs the existing contract without adding a parallel public API; release compatibility still needs explicit acceptance. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 50a23bf99547. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
Directory pins could report
assertCurrent()orsync()success after pathname replacement when distinct inode values rounded to the same JavaScript Number, or Windows returned unknown zero identity components. The retained descriptor still referred to the original directory, so success could misrepresent the directory currently at the pathname.Keep exact bigint identities and immutable path facts as private receipt authority. Public numeric
Statsmetadata comes from the same observation, remains independently mutable, and cannot change retained authority or metadata. New admissions validate supplied path and identity fields; top-level receipt fields are checked before pathname alias handling, preventing raw string-method errors for incomplete inputs. Publication, staging, durable creation, and synchronous store writes preserve exact provenance. Store durability reuses its already-admitted parent observation without rereading or readmitting the pathname.Descriptor/path checks reject known mismatches immediately and allow one retry for unknown Windows components. A preflight mismatch never flushes the descriptor; replacement discovered after a flush still rejects. Public
DirectoryReceipt.identitykeeps its numericStatsshape and methods. Unsafe reconstructed numeric identities fail closed; callers can retain the original library receipt/identity object or use bigintexpectedExistingIdentity. Documentation and Unreleased notes describe this boundary.Validation on final head
4090e17954aae1e6602472f113360467dbd79215, including integration with atomic buffered creation from #486:pnpm check: 13,393 tests passed, 586 skipped; 530 passed test files and 22 skipped. Build, lint, documentation examples, package/API checks, and whitespace checks passed.Additional earlier-candidate evidence includes the 847-scenario method smoke, 210 FAT32 outcomes, and 38 optional-free archive outcomes. These are historical coverage evidence; their package hashes are not claimed to identify this final head. The method smoke is not a performance comparison.