Skip to content

fix: skip DrvFS preparation on non-9p filesystems - #1080

Merged
steipete merged 2 commits into
mainfrom
fix/drvfs-negative-probe
Nov 8, 2026
Merged

steipete merged 2 commits into
mainfrom
fix/drvfs-negative-probe

Conversation

@steipete

@steipete steipete commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Enabling allowDrvfsRenameRecovery in 0.28.0 prepared retained parents and recovery snapshots before every Linux rename, even on filesystems that cannot be DrvFS. Skip that work using the existing exact device identity or one native fstatfs on an already-open parent, and cache only negative device observations. Atomic writes reuse their directory-mode descriptor; writers without one reuse their existing cold recovery-parent acquisition. A stale negative entry can only retain strict behavior. Full recovery-time mount, parent, identity, ownership, mode and content checks remain unchanged.

The change adds no caller option or package export. Native probe absence/failure retains the previous preparation path on anonymous-device filesystems; Linux block-device filesystems are excluded without I/O. Cold-negative cleanup relinquishes parent ownership before closing, preventing a retry from closing a reused descriptor after a close error.

Validation includes failing-first async/sync regressions, callback/JSON writers, positive and unavailable observations, parent-close ownership, and existing recovery adversaries. Linux Node and the pinned OpenClaw Bun pass 41 focused tests. On ext4 and tmpfs, warmed async/sync success, EACCES and EIO paths add zero filesystem calls in two repetitions; native auto and forced-off modes match after warming the negative cache. The initial anonymous-filesystem observation adds one fstatfs for atomic writes. Independent Codex review is clean at P0–P2.

The full local suite passed: 843 test files, 18,822 tests (42 files and 863 tests skipped). pnpm pack:check passed after hydrating the unchanged Windows helper from the published 0.28.0 package and verifying its SHA-256; git diff --check passed. The full pnpm check reached that same package gate after its successful test suite; the missing build prerequisite was resolved separately without repeating the suite.

@clawsweeper

clawsweeper Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review November 8, 2026 01:06
@steipete
steipete requested a review from a team as a code owner November 8, 2026 01:06
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-08T01:52:19.267211Z 556b061 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal priority bug or improvement with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 8, 2026
@clawsweeper

clawsweeper Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR skips DrvFS recovery preparation on known non-9p filesystems using existing device identities and a negative-only native filesystem probe.

Example: Repeatedly write config.json on Linux tmpfs with allowDrvfsRenameRecovery: true.

  • Before: Each write retains an additional recovery parent and captures recovery metadata and content.
  • After: The first negative filesystem observation lets subsequent writes skip that preparation while preserving ordinary publication verification.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and source review found no defect; confidence in runtime measurements rests on reported harness results rather than an inspectable execution artifact.
Proof confidence 🦐 gold shrimp (3/6) The host identifies a maintainer-authored PR, outside the ordinary contributor proof gate; the body reports Node/Bun runs and ext4/tmpfs measurements through the checked-in public-API counting fixture, while this review inspected source without executing it.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Applications enabling DrvFS compatibility pay recovery-preparation costs on ordinary Linux filesystems where that recovery cannot apply.
Reason: The host identifies this as maintainer-authored, establishing direction, and the change removes recurring work without adding a public option or weakening recovery verification.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR removes unnecessary opt-in write overhead still present on main, with no actionable correctness or security defects found.

Priority: P2
Reviewed head: 8859885d2a129b857e86912f41a4eae45859c24d

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The body reports failing-first and filesystem-call measurements, but supplies no inspectable execution trace of this optimization; the ordinary contributor proof gate is waived for the host-identified maintainer author.
Agent review details

How this fits together

Atomic, callback, and Root writers stage caller content, publish it by rename, and verify filesystem identity before reporting success; this change filters preparation for the optional DrvFS recovery path.

flowchart TD
 A[Public write API] --> B[Existing parent identity]
 B --> C[Negative filesystem filter]
 C --> D[Ordinary staged publication]
 C --> E[Prepare possible DrvFS recovery]
 E --> D
 D --> F[Verify publication]
 F --> G[Full DrvFS checks after ENOENT]
Loading

Technical review

Best possible solution:

Keep the shared negative-only filter in the existing publication owners while preserving full recovery admission and strict fallback when observations are unavailable.

Do we have a high-confidence way to reproduce the issue?

Current-main source unconditionally prepares recovery for enabled Linux writes, including non-DrvFS filesystems; the added tests and counting fixture target that overhead, but this review executed no target code.

Is this the best way to solve the issue?

The optimization uses existing admitted descriptors and exact device identities, shares one filter across writers, and leaves unknown observations on the previous preparation path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 27c02f710f66.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned introduced change: The introduced diff adds a shared negative-only filter and integrates it into existing publication owners; current main still prepares recovery for every enabled Linux write. (src/publication-recovery.ts:14, 8859885d2a12)
  • Recovery remains independently gated: A positive or unavailable preparation probe grants no recovery authority: the unchanged recovery owner still requires exact descriptor-bound DrvFS mount evidence and verifies file identity, permissions, ownership, and available content. (src/publication-recovery.ts:39, 8859885d2a12)
  • Descriptor settlement: The cold-negative path clears its parent ownership before closing, preventing the catch path from retrying a close against a potentially reused descriptor. (src/drvfs-parent.ts:24, 8859885d2a12)
  • Existing compatibility decision: The discussion at feat(atomic): opt in to verified DrvFS rename recovery #1074 (comment) establishes explicit opt-in and descriptor-bound mount verification; lswang9 supplied real-mount results at feat(atomic): opt in to verified DrvFS rename recovery #1074 (comment). Those results concern the earlier recovery implementation, not this optimization. (docs/atomic.md:103, ce716562b932)
  • Focused validation coverage: Added coverage exercises async/sync preparation budgets, positive and unavailable observations, JSON/callback callers, actual native filesystem classification, and descriptor reuse after a throwing close; the body reports focused and full-suite success. (test/drvfs-preparation.test.ts:19, 8859885d2a12)
  • Review policy and clean checkout: Read the complete root AGENTS.md; no nested policy, maintainer notes, or pr-simplify skill was present. Applied the filesystem-boundary and public-contract rules; the requested read-only review superseded running autoreview or artifact-producing checks. Diff whitespace checks passed and the checkout remained clean. (AGENTS.md:21, 8859885d2a12)

Likely related people:

  • Peter Steinberger: Raw commit 8dbb453 adds src/native-staged-file.ts:92 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 8dbb4533cf75; files: src/native-staged-file.ts)
  • lswang9: Raw commit ce71656 adds src/publication-recovery.ts:1 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ce716562b932; files: src/publication-recovery.ts)
  • Jason (Json): Raw commit fc7bd11 adds native/src/entry_publication.rs:15 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: fc7bd11f449b; files: native/src/entry_publication.rs)

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: The change reduces repeated filesystem work and content copying for explicitly enabled writes without an established availability or data-integrity emergency.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: The change reduces repeated filesystem work and content copying for explicitly enabled writes without an established availability or data-integrity emergency.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Attach the counting fixture's terminal output for cold and warmed writes on ext4 and tmpfs.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 7, 2026, 8:19 PM ET / November 8, 2026, 01:19 UTC.

@steipete
steipete merged commit 7a107e1 into main Nov 8, 2026
59 checks passed
@steipete
steipete deleted the fix/drvfs-negative-probe branch November 8, 2026 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant