Repository navigation
fix(update): identify unsafe recovery objects in failure reports - #164858
Conversation
Replacement for #164395 on a clean branch (its GitHub diff metadata had drifted to 6,788 files after merges from main, so the security review could not evaluate it). Same patch as its head 8cf3087. Closes #164188 Co-authored-by: xydigitLybnnnn <[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: needs maintainer review before merge. Reviewed October 4, 2026, 6:06 AM ET / 10:06 UTC. ClawSweeper reviewWhat this changesThe PR makes package-update failure reports identify rejected recovery objects and their filesystem metadata while omitting installation paths and contents. Merge readiness✅ Ready for maintainer review This PR remains useful: current main and v2026.9.8 still discard recovery-permission metadata. No actionable introduced defect was found, and the maintainer-owned replacement preserves the existing safeguards. Priority: P2 Review scores
Verification
How this fits togetherThe package updater checks recovery files before opening journals or publishing an installation. Rejection diagnostics flow through update failure facts and redaction into operator-visible reports. flowchart TD
A[Package update] --> B[Recovery objects]
B --> C[Identity and permission checks]
C --> D[Accepted recovery operation]
C --> E[Bounded rejection metadata]
E --> F[Failure facts and redaction]
F --> G[Operator failure report]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +26, Tests +93, Docs +7. Total +126 across 8 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep recovery safety checks intact and carry compact object metadata through the existing diagnostic and public-report owners. Do we have a high-confidence way to reproduce the issue? Yes: current main rejects a valid owned file with multiple links or group permission bits using a constant message that omits available metadata. This was source-inspected; no local runtime reproduction was executed. Is this the best way to solve the issue? Yes: enriching the existing guard and preserving its bounded diagnostic through report redaction fixes the proven defect without changing recovery policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 96c7ddc7e798. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
…nclaw#164858) Closes openclaw#164188 Co-authored-by: xydigitLybnnnn <[email protected]>
Closes #164188
Supersedes #164395 (same patch; that branch's GitHub diff metadata drifted after merges from main, so the security review could not run). Original diagnostic contribution by @xydigitLybnnnn, credited as co-author.
What Problem This Solves
Fixes: package updates reject unsafe recovery objects without telling operators which object failed or what metadata was observed.
User Impact
Recovery refusals now retain the object role and basename, octal mode, link count, owner UID, and expected private permissions in update failure facts and public reports. Installation paths and file contents stay out of this diagnostic. Ownership, object-type, permission, and hard-link protections remain unchanged. The diagnostic requires an updated installed updater; a candidate cannot add it to a 2026.9.7 or 2026.9.8 updater already running.
Why This Change Was Made
Both published drivers contain the same retention inventory and recovery guard. Their retention path can hard-link a prior control directory's
operation.sqlite, so a private0600journal becomes multiply linked regardless of umask. Main already excludes recovery controls from runtime retention in #160663. This PR completes the missing diagnostic: the recovery owner supplies the object role, and report redaction preserves the bounded metadata instead of treating the generated basename as a hostname.Directories retain their existing exemption from the file link-count rule. Helper and journal creation already use private modes; the shipped helper's archive mode is not copied to the updater-created helper. The separate publication-identity variant already has an ownership/path diagnostic on main via #164797. The original reports did not preserve enough metadata to establish that every host rejected the same object.
Thanks to @xydigitLybnnnn for the original diagnostic contribution, and to @creanet-64, @jrpasolini, @jb168, and @burchk007-jpg for the reports and filesystem observations.
Evidence
Three real-journal regressions fail before the change and pass afterward: linked journal, group-readable journal, and group-accessible control directory. They verify failure facts and the public report while preserving the rejected evidence.
Changed suites passed three times on Blacksmith Testbox: 25 journal tests and 52 redaction tests each run. Combined wrapper wall times: 37.47 s, 35.17 s, 34.75 s. Journal file wall times: 34.40 s, 32.54 s, 32.13 s, with approximately 19 s of test time; the new three cases together take about 0.13 s. Redaction file wall times: 1.29 s, 0.719 s, 0.738 s.
All 38 directly importing or one-barrel importing files were selected: 680 tests passed in 158.34 s; 13 existing skips cover Linux-root-only launcher and macOS-only ownership cases. Longest executed test: 18.1 s.
Independent Codex P1 autoreview: scoped-clean, no actionable findings.
Published-driver reproduction on Blacksmith Testbox
tbx_01m43396zp91rn1mk6fh2w5rb6(lease workflow): official 2026.9.7 driver → official 2026.9.8 candidate, user-owned npm prefix, native-volume storage,umask 077, pre-existing completed receipt, isolated state and a free loopback port. Both tarballs matched their registry SHA-512 integrity. A read-onlylstatSynctracer recorded the rejected inode. The driver failed atpackage-swapafter required candidate admission/validation succeeded (advisory Doctor lint remained deferred), and verified serving 2026.9.7 healthy afterward.The cell used
scripts/e2e/lib/upgrade-survivor/published-driver.mjswith temporary fixture preparation and observation code. To create a valid prior receipt, it backed up the disposable installedbuild-info.json, ran the published 9.7 updater against the exact 9.7 tarball with restart disabled, and asserted that the original published build identity was restored before starting the managed Gateway and the 9.7 → 9.8 attempt. The receipt-seeding update took 132.606 s; the reproduced update took 67.227 s. These are real installed-update operations, separate from unit-test timings. The published driver's guards and executable payload were not patched. An initial same-version seed correctly returned a no-op and was discarded as fixture-only evidence.The 9.7 and 9.8 tags have identical recovery-guard and retention-inventory blobs, so 9.8 is affected too. Main's retention fix prevents a corrected installed driver from creating this alias; it cannot replace the older driver already executing an update. The recorded production reports cannot retrospectively identify every original host's object. After-fix reporting is proven at the real journal-to-failure-report boundary; this evidence does not claim an after-fix installed-CLI run or native macOS/arm64 execution.
Source delta against the tested main base: production +52/-26, tests +93/-0, docs +7/-0 (8 files). Auto-merge remains off.
node scripts/check-changed.mjs --base bced15851945c3c460b48c03896701f9fa304536passed on Blacksmith Testboxtbx_01m4322j69qnmtgr1rzehpe2zz(lease workflow), including all 27 test typecheck graphs, changed-file lint, dead exports, and import-cycle checks. The combined remote command exited 0 in 28m24.6s; a subsequent runner-portal synchronization warning did not change the command result. This is task-owned Testbox evidence, not a claim that hosted PR CI has finished.The current retention owner also passed three focused runs using a temporary variation of its existing real-filesystem fixture: package at
npm/lib/node_modules/openclaw, sibling activation control directory,openclawpeer dependency discovering the outer module owner, andumask 077. Both cases passed each run: normal retention leavesoperation.sqlitesingle-linked and absent from the projection; an explicit runtime dependency link to that recovery state is refused. Runtime assets remain available. The temporary fixture variation was restored after the proof and is not a product change.The contributor commit
9a5962ee495c7bfd63723b93a3cc17c86110723aremains in the branch ancestry. Its direct guard tests are replaced by the existing POSIX journal suite’s real-object/report cases, addressing the Windows-scoping and public-report findings. No auto-merge or merge is requested.