Repository navigation
fix(update): skip unreadable foreign directories during update capture - #194166
roboclaw-bot wants to merge 1 commit into
Conversation
Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: steipete <[email protected]>
|
🦞👀 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: blocked before merge. What this changesThis PR records and skips unreadable foreign filesystem entries during original-state capture and backup creation. Example: UID 501 backs up a workspace containing a root-owned, mode-0700 .fseventsd directory.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness⛔ Blocked before merge - 1 item remains Keep this maintainer-authored draft open: it addresses a source-supported capture failure, and no discrete correctness defect was established. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherUpdate capture and backup owners inventory configuration, databases, and filesystem resources, then publish recovery manifests or verified archives. flowchart TD
A[Update or backup request] --> B[Resource ownership inventory]
B --> C[Filesystem and SQLite discovery]
C --> D[Shared permission policy]
D --> E[Capture or archive writer]
E --> F[Payload and omission manifest]
Technical reviewBest possible solution: Retain the shared omission policy in the existing owners and describe this PR as related to the broader update report rather than closing its unresolved validating-phase failure. Do we have a high-confidence way to reproduce the issue? The reported marker-lstat EACCES maps directly to current-main directory capture and backup privacy probing; no target code was executed during this review. Is this the best way to solve the issue? The shared permission classifier and existing omission fields provide a focused repair without a new configuration surface or competing traversal implementation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e45e99d4d454. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +197, Tests +200, Docs +8, Other +2. Total +407 across 14 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 6, 2026, 9:40 AM ET / 14:40 UTC. |
|
Reporter of #191855 here — this PR targets exactly what our machine hits. Real-world data from the box that produced all three updater failures (macOS 26.3.1 arm64, updater runs as uid 501/20, admin group):\n\n |
NUC reproduction: valid private markers fail only in the confined serviceI can reproduce the update-capture failure described by #191855 on a Linux/systemd NUC running OpenClaw 2026.11.1. Environment
ReproductionThe managed update-capture markers are regular files owned by The same marker files are readable and valid when checked as the When the same stock command is run through the confined systemd unit, it aborts before archive publication: The unit's NAS A previous attended service run completed with ExpectedValid private update-capture markers should be recognized and the update-capture payloads omitted from the ordinary backup. The backup should continue around unreadable foreign directories when the new omission policy applies, while still refusing unreadable owned files and malformed/private markers. Could this PR add a regression case for a valid marker under this confined systemd service context, or clarify which namespace/path-admission condition is expected to make the marker unreadable? |
|
Candidate backup scenario passes on Linux at head With a root-created
Limits:
Evidence packet: https://github.com/blexibot/openclaw-lab-evidence/tree/main/191855 Reproduced by an autonomous lab of AI agents using local models; I reviewed the commands, evidence and conclusions. |
|
macOS follow-up, backup path only, OpenClaw 2026.11.1-based builds (one run per cell): PR base The guest was a fresh macOS 26.6.2 arm64 VM with test user uid 501. I attached a 64 MB APFS image (
On head, the refusal controls still refuse: an owned unreadable dir, an owned unreadable or malformed marker, and a foreign marker that is unreadable to the test user in a searchable root-owned dir. A valid marker in an owned dir still keeps that dir out of the archive. All builds succeed with the volume detached, before and after. Shipped 2026.11.3 refuses the same way as base, as reported on #191855. Limits:
Controls, per build
Evidence packet: https://github.com/blexibot/openclaw-lab-evidence/tree/main/194166-macos Reproduced by an autonomous lab of AI agents using local models; I reviewed the commands, evidence and conclusions. |
What Problem This Solves
Original-state capture and full backups abort when a workspace contains an unreadable foreign entry, such as the root-owned
.fseventsddirectory on a mounted APFS volume. Reported by @BorClaw.Fixes #191855.
User Impact
Capture and backup can finish around unreadable foreign entries, with one warning per omitted path and explicit manifest omissions. Unreadable owned files, explicitly selected resources, canonical databases, and present private-capture markers still refuse. The running updater needs this repair for original-state capture; installing a corrected candidate cannot change the older updater's capture code.
Why This Change Was Made
At base
8dd41fc95291553e5885fec09992bd41c3038004,update-recovery-baseline-capture.ts:312calls the privacy classifier before enumerating a directory.update-capture-paths.ts:18–23probes the marker inside that directory and refuses on EACCES. The original-capture caller catches this as a continuation warning; it is not itself the stopping validation exception.The other walks are agent scratch discovery, backup SQLite inventory, and payload tar traversal. The installed v2026.10.10 updater's broad
backup-sqlite-snapshot.ts:183reaches the same privacy check throughisTraversable; its directory failures also propagate at line 192. Supplemental candidate-state discovery calls that owner during validation, inside the broad package-update catch. This is a source-supported validating-phase failure path, not identification of the report's discarded exception. Main already narrows supplemental discovery to declared plugin resources (4a393be419f3), so an unrelated workspace subtree need not be visited there. Capture and full-backup omission handling were still missing on main. Classification and exception-retention work belongs to #194160.One shared permission/UID policy now serves the walkers. The backup inventory retains skipped paths across discovery and archiving, and checks deferred scratch-scan failures after all explicit includes are known. SQLite readability probes use descriptor-free access checks to preserve existing POSIX database locks. Capture records omissions in its existing
excludedRoots; backup recordsunreadable-foreignentries in its existingskippedmanifest. Mount traversal policy is unchanged.Evidence
captureUpdateRecoveryBaselineandcreateBackupArchivefailed with the reported markerlstatEACCES. The focused reproduction took 44.53 seconds including subprocess fixture preparation.CI=1 node scripts/run-vitest.mjs src/infra/backup-tar-walk.test.ts src/commands/backup-resource-inventory.test.ts src/infra/update-capture-paths.test.ts --maxWorkers=1— 21 passed, 4.78 seconds wall time. Covers permission-denied readdir/open, owned-file refusal, late explicit-resource protection, and privacy/symlink safeguards.target_ref=5438a832520be89cde6799215b99a711fc039950; preflight confirms that checkout SHA and passed. Build and test jobs are running; their results remain pending. CI seconds are pending. The first dispatch was cancelled after preflight rejectedvalidation_tier=mainfor a cross-revision target; the linked replacement uses the supported default inputs.config/tsconfig/oxlint.core.json; formatting,git diff --check, and commit hooks pass. A separate 200-line regression allocation preserves inherited test-line debt and leaves the shared scalar unchanged.8dd41fc95291553e5885fec09992bd41c3038004to local production changes, full affected production modules supplied. Explicit-resource and SQLite-probe findings were resolved; final production review is scoped-clean. Subsequent test fixture type guards and relocation into the existing ownership suite were mechanical.Blockers / Crabbox receipt: provider
blacksmith-testbox, Linux leasetbx_01m6rjrhygjtsk58zyh6kgayr3. The requested main build (pnpm build:ci-artifacts) queued before payload execution; no build or CLI update ran. The lease was stopped, then reconciliation confirmed the exact GitHub run cancelled andcrabbox inspectconfirmedstate=completed,ready=false,hasHost=false. Built-CLI main/branch RED/GREEN with a real root-owned 0700 workspace directory remains unproven. The initial named integration/lint entrypoints unexpectedly prepared broad worker fixtures/declarations; this wrapper expansion was not repeated after recognition. Subsequent checks used the narrow walkers and source-backed touched-file lint. This PR stays draft for the missing CLI proof and remote build/typecheck/capture-suite results.