Repository navigation
feat(advanced): retain entries for one-way no-replace publication - #776
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 September 30, 2026, 9:36 AM ET / 13:36 UTC (Revision 2). ClawSweeper reviewWhat this changesAdds a native backed advanced API for one-way, no-replace publication of retained directories and regular files, with result receipts, documentation, tests, and benchmarks. Merge readiness✅ Ready for maintainer review Current main and v0.21.3 do not provide this retained directory and file publication lifecycle. The branch remains useful, and this review found no concrete introduced defect or unresolved merge blocker. Priority: P2 Review scores
Verification
How this fits togetherThe advanced filesystem API receives caller-observed entry and parent identities plus a synchronous authority check. It retains descriptors, requests a native no-replace rename, and returns a result that the caller must handle. flowchart LR
A[Caller observations] --> B[Advanced publication API]
B --> C[Identity and authority checks]
C --> D[Native filesystem admission]
D --> E[No-replace rename]
E --> F[Transition result]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Keep the operation scoped to caller-owned staging, with native no-replace publication, explicit indeterminate results, and no implicit cleanup. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR adds a capability rather than reporting broken existing behavior. Its tests identify concrete publication and collision scenarios. Is this the best way to solve the issue? Yes. Reusing retained parent descriptors and the existing native no-replace rename provides the requested one-way lifecycle without adding a pathname fallback. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against fe6e61d2df3e. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Summary
Add
retainEntryForPublicationto@openclaw/fs-safe/advancedfor one-way directory and single-link regular-file export. This supplies the no-replace publication primitive needed by managed clone/update staging without exposing destructive reverse or cleanup operations.committed,not-published, orindeterminatebefore postchecks/close. Preserve primary and close failures; consume descriptors once.dispose()closes only.Verification
RENAME_EXCLexception. Real directory/file regressions failed before repair and passed after native destination admission was added. Corrected full candidate is P0–P2 scoped-clean (static review, not independent runtime acceptance).pnpm checkfound owned documentation omissions (fixed; affected 21 documentation tests now pass) and eight native watch-event failures in unchanged code. The same event-delivery failures reproduced with a same-toolchain native rebuild of pinned main (C1 module registration removed), while published 0.21.3 binary controls passed. This isolates the problem to the local native-build/host lane, not the C1 source delta. No watch assertions, timeouts, retries, or source were changed. The complete requiredpnpm checknow passes in the genuine JS-only CI layout, including package-contract checks. Exact-head CI is required before landing.Benchmark inventory integration
CI exposed the missing export registration. Added actual public-API admission and one-way lifecycle measurements on owned filesystem fixtures, including native-off refusal and close-only preservation. Native admission (2 cases), native lifecycle (6 cases), and the complete CI-style off-mode smoke (995 measured cases) pass. The full new helper and runner were audited, and the final delta received API-direct P0–P2 scoped-clean review with the complete runner/API context supplied. No inventory exemption or fake consumer was added.
Test audit
Audited the full new test file: private real filesystem fixtures; native calls exercised for collision and substitution; failure seams wrap real publication/close; synchronous resource settlement; no sleeps, detached children, or source-text safety tests. No existing test was pruned or weakened. The declaration manifest is generated, not handwritten. Reviewed the full touched navigation helper and the unchanged tests in the native module-registration file; no dead or duplicate code required removal.
This PR does not adopt the API into OpenClaw or claim a published npm version. Package release and caller integration are separate delivery gates. The current contributor cannot create protected release tags; publication will require an authorized release maintainer.