Repository navigation
fix: use exact publication identities on Windows - #126
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs real behavior proof before merge. Reviewed August 10, 2026, 2:48 AM ET / 06:48 UTC. ClawSweeper reviewWhat this changesThe PR moves exclusive-publication source, target, parent, and cleanup checks to bigint filesystem identities while retaining numeric public result and failure payloads, plus dependency refreshes. Merge readiness⛔ Blocked until real behavior proof is added - 5 items remain Keep open: the PR improves several identity fences, but its optional expected-source identity check still compares unsafe numeric Windows identities and can accept a replaced source. Priority: P1 Review scores
Verification
How this fits togetherExclusive publication pins a source, creates a no-clobber target through hardlink, copy, or rename, then verifies identities and cleans up safely on failure. These checks protect applications handling attacker-controlled filesystem paths. flowchart LR
A[Source pathname] --> B[Pin source file]
B --> C[Exact identity fence]
C --> D[Hardlink copy or rename]
D --> E[Verify target and parent]
E --> F[Publication result]
E --> G[Safe rollback cleanup]
Before merge
Findings
Agent review detailsSecurityNeeds attention: The diff substantially hardens publication checks but leaves one security-sensitive numeric source-identity comparison reachable through the public API. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Make the caller-provided source fence fail closed for unsafe numeric identities, compare only exact bigint identities when available, and preserve the existing numeric result and error-detail contract. Do we have a high-confidence way to reproduce the issue? Yes—source inspection provides a high-confidence reproduction shape: provide numeric expected identity from one Windows file index above the safe-integer limit, replace it with a distinct index that rounds identically, then publish; the branch selects numeric comparison at the caller fence. Is this the best way to solve the issue? No—the bigint conversion is appropriate, but retaining a numeric expected-source comparison leaves the reported ambiguity at the public caller fence; reject ambiguous numeric inputs or require exact bigint identity there. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8a7935972492. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
Acceptance criteria:
What 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
|
The @openclaw/fs-safe 0.5.4 bump in 5295f25 (#121508), carrying exact Windows publication identity checks from a260e42d7782 (openclaw/fs-safe#126), changed this mocked path to fail closed with the shipped publication-source identity message on Windows. Assert the complete platform-specific message without weakening target-cleanup coverage.
Summary
Statsresult and numeric failure-detail shape@types/node, eligible pnpm transitive locks, and compatible Rust manifest and lock entriesWhy
Windows file indexes can exceed JavaScript's safe-integer range. Numeric
inovalues can therefore round two distinct files to the same value, allowing a replaced source pathname to pass the post-hardlink identity fence. The same ambiguity could affect target verification and rollback ownership.The internal publication fences now use bigint stats throughout hardlink, copy, native-parent, rename, and cleanup paths. Public result and error payloads remain compatible.
Validation
pnpm check— 100 test files passed, 1,035 tests passed, 61 skippedpnpm test:security— 70 tests passedcargo test --workspace --locked— 18 tests passedcargo clippy --workspace --locked -- -D warningspnpm audit --audit-level high— no known vulnerabilitiescargo audit --deny warnings— no advisoriespnpm exec vitest run test/publish-file-failure.test.ts— 6 passed, 7 platform skips