fix(backup): support managed config and credentials links - #136343
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3b084a844e
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Codex review: blocked before merge. Reviewed September 3, 2026, 12:58 PM ET / 16:58 UTC. ClawSweeper reviewWhat this changesThe PR includes configured config and credentials symlink targets as backup assets, then rewrites eligible absolute links to portable archive-relative links. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 3 items remain Keep open: this PR directly owns the still-open backup bug and no introduced correctness defect was found. Current fetched main and the installed tar source were unavailable in this offline, blobless checkout, so this review does not claim a final merge-ready comparison. Priority: P1 Review scores
Verification
How this fits togetherThe backup CLI plans state, configuration, credentials, and workspace assets before serializing them into a portable archive. Archive verification and restore consume that same manifest, so selection and symlink validation must enforce the same containment boundary. flowchart LR
A[Configured config and credentials] --> B[Backup asset planner]
B --> C[Declared archive assets]
C --> D[Archive writer]
D --> E[Portable relative links]
E --> F[Verification and restore]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +48, Tests +221, Docs 0. Total +269 across 8 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one manifest-owned symlink flow: archive the resolved configured asset and lexical configured link, rewrite only a resolved target inside a declared asset, and verify that same invariant before restore. Do we have a high-confidence way to reproduce the issue? Yes. The linked report provides a concrete v2026.8.2 Linux symlink layout, and the added owner-boundary tests construct direct and chained config/credentials links through create, verify, and restore; this reviewer could not rerun them in the read-only dependency-less checkout. Is this the best way to solve the issue? Yes. The patch keeps the existing fail-closed archive guard and makes the exception at the manifest ownership boundary; broadly accepting absolute links would lose that containment guarantee. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1b6eea93c861. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (8 earlier review cycles)
|
4970988 to
78cba81
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Co-authored-by: NianJiuZst <180004567+NianJiuZst@users.noreply.github.com>
78cba81 to
ea61cb7
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Thanks @vsumner! Proof: Native backup CLI created, verified, and restored managed config and credentials links through the portable archive path.
|
…36343) Closes openclaw#136326 ## What Problem This Solves Native backup creation failed when the active config file or credentials directory was an absolute symbolic link to a Nix-managed path outside the state directory. ## Root Cause Backup planning used lexical state containment for credentials, so it could omit the external canonical asset. Archive creation then passed absolute first-hop link targets to the portable archive guard, which correctly rejected them. ## Fix - Decide config and credentials coverage from their canonical paths while preserving active files inside volatile state roots. - Resolve absolute link chains to their final declared asset before writing a portable relative archive link. - Keep the existing archive guard unchanged for undeclared, dangling, and escaping links. - Document the managed-link archive contract. ## Evidence - Current `main` failed native `backup create --verify --json` for direct and chained managed config links before publishing an archive. - Exact-head tests passed: 108 backup-create tests and 64 backup verify/restore tests, with 1 platform-specific skip. - Exact-head changed checks passed, including formatting, type checks, lint, dependency guards, architecture guards, and dead-export checks. - A fresh secretless Linux container created, verified, and restored direct and chained config and credentials links through the native CLI. - The restored links were relative, resolved inside the restore target, and exposed the original managed content. - Native undeclared, dangling, and escaping link probes still failed before archive publication. ## Collaboration Thanks @vsumner for the original repair and real Nix reproduction. Thanks @NianJiuZst for identifying and validating the chained-link case. Co-authored-by: NianJiuZst <180004567+NianJiuZst@users.noreply.github.com> Co-authored-by: Ayaan Zaidi <hi@obviy.us>
…36343) Closes openclaw#136326 ## What Problem This Solves Native backup creation failed when the active config file or credentials directory was an absolute symbolic link to a Nix-managed path outside the state directory. ## Root Cause Backup planning used lexical state containment for credentials, so it could omit the external canonical asset. Archive creation then passed absolute first-hop link targets to the portable archive guard, which correctly rejected them. ## Fix - Decide config and credentials coverage from their canonical paths while preserving active files inside volatile state roots. - Resolve absolute link chains to their final declared asset before writing a portable relative archive link. - Keep the existing archive guard unchanged for undeclared, dangling, and escaping links. - Document the managed-link archive contract. ## Evidence - Current `main` failed native `backup create --verify --json` for direct and chained managed config links before publishing an archive. - Exact-head tests passed: 108 backup-create tests and 64 backup verify/restore tests, with 1 platform-specific skip. - Exact-head changed checks passed, including formatting, type checks, lint, dependency guards, architecture guards, and dead-export checks. - A fresh secretless Linux container created, verified, and restored direct and chained config and credentials links through the native CLI. - The restored links were relative, resolved inside the restore target, and exposed the original managed content. - Native undeclared, dangling, and escaping link probes still failed before archive publication. ## Collaboration Thanks @vsumner for the original repair and real Nix reproduction. Thanks @NianJiuZst for identifying and validating the chained-link case. Co-authored-by: NianJiuZst <180004567+NianJiuZst@users.noreply.github.com> Co-authored-by: Ayaan Zaidi <hi@obviy.us>
Closes #136326
What Problem This Solves
Native backup creation failed when the active config file or credentials directory was an absolute symbolic link to a Nix-managed path outside the state directory.
Root Cause
Backup planning used lexical state containment for credentials, so it could omit the external canonical asset. Archive creation then passed absolute first-hop link targets to the portable archive guard, which correctly rejected them.
Fix
Evidence
mainfailed nativebackup create --verify --jsonfor direct and chained managed config links before publishing an archive.Collaboration
Thanks @vsumner for the original repair and real Nix reproduction. Thanks @NianJiuZst for identifying and validating the chained-link case.