Skip to content

fix(root): confine documented guarantees in require mode - #752

Merged
steipete merged 2 commits into
mainfrom
codex/require-harden-docs-20260927
Sep 28, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/require-harden-docs-20260927

Conversation

@steipete

@steipete steipete commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

The blanket recommendation to use require for hostile concurrent mutation obscured which operations retained pathname mutations. README, security-model, and writing docs now describe the coordinated removal, creation, and overwrite-move paths with an operation/platform matrix and explicit compatibility notes.

The hardened paths apply only to require. Default auto retains its previous best-effort paths and does not confine these operations under hostile concurrency. The docs explain each operation's extra admission/identity cost, fail-closed recursive-removal gaps, ACL-preserving FileHandle handoff, and the limits of directory pinning versus atomic namespace authorization. Finite race campaigns do not establish every possible schedule.

This PR accompanies #744, #751, and #750 and should land with their implementation. Documentation examples, full checks, diff checks, and independent Codex documentation review passed. No CHANGELOG changes are included.

Current-head CI is green: 35 passing checks, seven skips. The coordinated implementations have completed final supported-operation campaigns and A/A-controlled method measurements. Linux proof; macOS/Windows proof.

@clawsweeper

clawsweeper Bot commented Sep 28, 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.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 28, 2026, 10:52 AM ET / 14:52 UTC (Revision 5).

ClawSweeper review

What this changes

Updates the README and Root guides with a required-mode operation matrix, default-mode limitations, and compatibility guidance for filesystem mutations.

Merge readiness

⛔ Blocked before merge - 4 items remain

The three companion implementations are now merged, resolving the prior sequencing blocker. This PR still provides needed guidance, but one statement overstates when required-mode recursive removal fails on unsupported platforms.

Priority: P2
Reviewed head: 25e3533a3b7e0330c27465fa875485609e42e16b

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The linked cross-platform behavior proof is strong, but the public capability wording needs one source-backed correction before merge.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): Linked Linux, macOS, and Windows runs built the combined public package, exercised native Root mutations through public proof jobs and adversarial campaigns, and the PR reports zero outside or denied effects after the fixes. That supports the central hardened-operation guidance now on main, though the recursive-leaf wording remains source-disproved. No stored-data contract changes.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): Linked Linux, macOS, and Windows runs built the combined public package, exercised native Root mutations through public proof jobs and adversarial campaigns, and the PR reports zero outside or denied effects after the fixes. That supports the central hardened-operation guidance now on main, though the recursive-leaf wording remains source-disproved. No stored-data contract changes.
Evidence reviewed 12 items Introduced recursive-removal claim: The new writing guide says required mode rejects recursive removal on Windows and Linux without mount-bounded descent, without limiting that statement to directory trees.
Related overview claim: The README similarly states that required recursive removal needs Linux openat2 or the macOS backend and is unavailable on Windows.
Actual capability gate: The native removal path requires the recursive-directory capability only when the initial target is a directory; a file or symlink proceeds to native leaf removal even with recursive mode selected.
Findings 1 actionable finding [P2] Scope unsupported recursive removal to directory trees
Security Needs attention Overbroad fail-closed deletion claim: The guide says required recursive removal rejects on Windows and Linux without mount-bounded descent, while the native path can still remove a file or symlink supplied with the recursive option.

How this fits together

Root accepts caller-supplied paths and mutation options, then selects native or guarded JavaScript filesystem operations. These guides tell applications which operations can be confined and which errors to expect.

flowchart LR
A[Caller path and mode] --> B[Root mutation]
B --> C{Required native mode?}
C -->|Yes| D[Native operation or error]
C -->|No| E[Guarded JavaScript operation]
D --> F[Filesystem result]
E --> F
F --> G[Documented guarantee]
Loading

Before merge

  • Scope unsupported recursive removal to directory trees (P2) - Required-mode removal checks for the recursive-directory capability only when the target is a directory (src/root-remove-native.ts:79). With { recursive: true }, a file or symlink can still reach native leaf deletion on Windows or Linux without openat2. Qualify this rejection claim, and the matching README and matrix wording, so callers do not assume every recursive request fails closed.
  • Resolve security concern: Overbroad fail-closed deletion claim - The guide says required recursive removal rejects on Windows and Linux without mount-bounded descent, while the native path can still remove a file or symlink supplied with the recursive option.
  • Resolve merge risk (P1) - A caller could read the unconditional unsupported-platform wording as a guarantee that a recursive request cannot delete a file or symlink, although required-mode native leaf removal can do so.
  • Complete next step (P2) - Clarify that unsupported recursive directory traversal rejects on Windows and Linux without openat2, while recursive requests for files or symlinks can still use native leaf removal.

Findings

  • [P2] Scope unsupported recursive removal to directory trees — docs/writing.md:530-531
  • [medium] Overbroad fail-closed deletion claim — docs/writing.md:530
Agent review details

Security

Needs attention: The diff adds no execution or supply-chain path, but one fail-closed capability statement misdescribes when deletion can occur.

Review metrics

Metric Value Why it matters
Documentation scope 3 files changed; 125 lines added, 8 removed The security contract is repeated across the package overview and two guides, so the capability wording must agree in all three.

Merge-risk options

Maintainer options:

  1. Correct the recursive-removal boundary (recommended)
    Scope unsupported-platform rejection to directory-tree traversal across the README and guides before publishing the fail-closed contract.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
In README.md, docs/security-model.md, and docs/writing.md, clarify that required-mode recursive directory traversal is unsupported on Windows and Linux without openat2, while a recursive request targeting a file or symlink can still use native leaf removal. Preserve the auto-mode and namespace caveats, then run pnpm check and git diff --check.

Technical review

Best possible solution:

Keep the coordinated capability matrix, with unsupported recursive removal scoped precisely to directory-tree traversal and the existing namespace limitations stated plainly.

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

Yes for the documentation mismatch: current source gates unsupported recursive directory traversal on a directory target, while the new prose says recursive removal rejects without that qualification. This read-only review did not execute the operation.

Is this the best way to solve the issue?

Yes overall: documenting the merged native capabilities is the right approach. The unsupported-platform statement needs a narrow correction to match the leaf-removal path.

Full review comments:

  • [P2] Scope unsupported recursive removal to directory trees — docs/writing.md:530-531
    Required-mode removal checks for the recursive-directory capability only when the target is a directory (src/root-remove-native.ts:79). With { recursive: true }, a file or symlink can still reach native leaf deletion on Windows or Linux without openat2. Qualify this rejection claim, and the matching README and matrix wording, so callers do not assume every recursive request fails closed.
    Confidence: 0.96

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 296203353cff.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: A bounded but security-sensitive public contract mismatch remains after the implementation PRs merged.
  • merge-risk: 🚨 security-boundary: The new fail-closed wording overstates when a recursive request is rejected before a filesystem deletion.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (linked_artifact): Linked Linux, macOS, and Windows runs built the combined public package, exercised native Root mutations through public proof jobs and adversarial campaigns, and the PR reports zero outside or denied effects after the fixes. That supports the central hardened-operation guidance now on main, though the recursive-leaf wording remains source-disproved. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. Linked Linux, macOS, and Windows runs built the combined public package, exercised native Root mutations through public proof jobs and adversarial campaigns, and the PR reports zero outside or denied effects after the fixes. That supports the central hardened-operation guidance now on main, though the recursive-leaf wording remains source-disproved. No stored-data contract changes.

Evidence

Security concerns:

  • [medium] Overbroad fail-closed deletion claim — docs/writing.md:530
    The guide says required recursive removal rejects on Windows and Linux without mount-bounded descent, while the native path can still remove a file or symlink supplied with the recursive option.
    Confidence: 0.96

Acceptance criteria:

  • [P1] pnpm check.
  • [P1] git diff --check.

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-09-28T08:02:30.421Z sha e8cf693 :: blocked before merge. :: [P1] Publish require-mode guarantees with their implementations
  • reviewed 2026-09-28T08:29:05.127Z sha 3842b73 :: blocked before merge. :: [P1] Publish require-mode guarantees with their implementations
  • reviewed 2026-09-28T13:15:06.148Z sha 3842b73 :: blocked before merge. :: [P1] Publish require-mode guarantees with their implementations
  • reviewed 2026-09-28T13:21:17.731Z sha 3842b73 :: blocked before merge. :: [P1] Publish require-mode guarantees with their implementations

@steipete
steipete marked this pull request as ready for review September 28, 2026 13:10
@steipete
steipete requested a review from a team as a code owner September 28, 2026 13:10
@clawsweeper clawsweeper Bot added the proof: sufficient Contributor real behavior proof is sufficient. label Sep 28, 2026
@steipete
steipete force-pushed the codex/require-harden-docs-20260927 branch from 3842b73 to 25e3533 Compare September 28, 2026 14:47
@steipete
steipete merged commit 4332074 into main Sep 28, 2026
44 checks passed
@steipete
steipete deleted the codex/require-harden-docs-20260927 branch September 28, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant