Skip to content

fix: Git updates fail when artifact storage is symlinked - #185680

Merged
steipete merged 1 commit into
mainfrom
dbasync/artifactsync
Oct 27, 2026
Merged

steipete merged 1 commit into
mainfrom
dbasync/artifactsync

Conversation

@steipete

@steipete steipete commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes openclaw update aborting during database backup capture when a Git installation's .artifacts directory is a symlink, including storage on another volume. The snapshot was already valid, but its final parent-directory sync rejected the lexical symlink and rolled back the update.

Related: #160671 introduced the backup location; #153764 established support for redirected artifact storage.

User Impact

Git updates can capture their recovery databases in supported redirected artifact storage. The installed updater must contain this fix; a newer candidate cannot repair an older updater's capture step.

Why This Change Was Made

Resolve .artifacts once after ensuring it exists, then build the backup path from the physical directory. Directory receipts, identity verification, durability synchronization, maintenance custody, retention and rollback remain unchanged. No fallback, retry, schema change or relaxed filesystem guard is introduced.

The nearby capacity assessment, preflight temporary directory, build cache and per-destination runtime staging paths do not pass .artifacts itself to this final backup-parent sync; no sibling fix is needed. The patch adds one filesystem realpath per native Git capture, with no SQL, worker-request or runtime MAIN changes by source attribution. Production delta: +2/-1 lines; necessary growth is the physical-path resolution.

Evidence

  • Real-backup regression on the original caller: ordinary directory passes; redirected directory fails at the expected not-file parent-sync error (6 passed, 1 failed).
  • Fixed capture/retention suite: 7/7 pass. Both layouts return the physical backup directory; retained SQLite snapshots pass integrity validation and contain the synthetic row. All previous retention cases remain.
  • Existing Git staging regression: 2/2 selected cases pass, including redirected artifact storage.
  • Fresh-process real-owner replay: both layouts pass using isolated synthetic HOME, state, config and cache, real config loading, maintenance custody, snapshot workers and SQLite verification. This uses the focused-owner proof allowance: the original full native update already reproduced this exact callback failure after build and runtime activation. A complete native CLI update was not rerun; build/activation behavior is unchanged.
  • Cross-volume replay also passes with the synthetic install and physical artifact storage on different filesystems: physical path, SQLite integrity and synthetic row verified.
  • Test cost: capture suite 49.87s including cold worker compilation; the two real-capture bodies take 2.574s and 2.433s. Git staging selection 13.43s. These are diagnostic durations, not a performance comparison.
  • Formatting, focused syntax lint and whitespace checks pass. Local type-aware lint stopped before analysis because the declaration-custody guard rejects the mandated external dependency store; CI supplies type-aware/static gates without a bypass.
  • Two isolated Codex reviews completed with no actionable P0–P2 findings. No public SDK or PostgreSQL query/identity change.
  • Knip on current main and the prospective merge has identical findings: 3 production, 3 full-tree, 0 script; no new findings.
  • Exact-head CI passed all static and changed-file test jobs. PostgreSQL shard 2 hit an unrelated host-reply timeout in state-read-admission-publication.postgres.test.ts; the same unchanged case then passed on both current main and this head with its original assertions/deadline (1 selected case each). The single failed-only retry passed on the same head (attempt 2); all required checks, including the aggregate CI gate, are green. No source change or broader rerun was needed.
Open PR overlap check

Shared open-PR index: compared baseline-only and baseline plus this candidate against all 18 overlapping main-target PR heads with git merge-tree. No new conflict paths or regions; pre-existing conflict counts remain:

PR Conflicts before → after
#185398 0 → 0
#185097 1 → 1
#181395 4 → 4
#181393 0 → 0
#178347 0 → 0
#167219 21 → 21
#163964 569 → 569
#162160 567 → 567
#162144 567 → 567
#162132 567 → 567
#162126 567 → 567
#161344 571 → 571
#157542 7 → 7
#152205 598 → 598
#151441 572 → 572
#150246 569 → 569
#149882 89 → 89
#148581 570 → 570

Resolve the physical .artifacts directory before database capture so the existing backup-parent durability sync accepts supported symlink layouts. Preserve backup integrity, custody, retention, and rollback checks. Add paired real-capture coverage and document the installed-updater requirement.

Related: #160671, #153764
@clawsweeper

clawsweeper Bot commented Oct 27, 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T08:27:05.784422Z 416d1b7 PR opened
ℹ️ 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes size: S labels Oct 27, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority 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-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 27, 2026
@clawsweeper

clawsweeper Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Resolve Git artifact storage to its physical directory before capturing update recovery databases.

Example: /srv/openclaw/.artifacts points to /mnt/storage/openclaw-artifacts.

  • Before: Database capture reaches the final parent-directory sync through the symlink and aborts.
  • After: Capture uses /mnt/storage/openclaw-artifacts directly and preserves the existing durability checks.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and source-supported, with useful real-capture regression coverage; direct behavior evidence is limited to the author's replay account.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; its body reports production-owner and cross-volume capture replays, while inspectable changed-path terminal output is absent. The change preserves the serialized backup format and already-canonical returned directory, requiring no stored-data migration.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A Git installation using supported symlinked artifact storage cannot finish its update database capture.
Reason: The maintainer-authored direction restores an existing supported layout with a minimal producer fix.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: current main retains the symlinked-artifact backup failure, and this maintainer-authored patch provides a focused fix with no actionable introduced defects found.

Priority: P2
Reviewed head: 416d1b7dd06b14defff36bf823b80eece2412b79

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The body explicitly states that the complete native CLI update was not rerun, and supplies no latest-stable upgrade replay for this patch.
Agent review details

How this fits together

The installed Git updater captures recovery databases before migration; its backup owner creates verified snapshots and synchronizes their parent directory before returning recovery metadata.

flowchart TD
  A[Git update transaction] --> B[Database capture owner]
  B --> C[Resolve physical artifact directory]
  C --> D[Snapshot workers]
  D --> E[Identity and durability checks]
  E --> F[Recovery metadata]
  F --> G[Rollback or retention]
Loading

Technical review

Best possible solution:

Use the physical artifact directory at the existing capture owner while retaining snapshot integrity, custody, durability and recovery behavior.

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

Current main passes the lexical artifact directory to a final sync whose dependency rejects symlinks; the author reports the matching pre-fix failure, but this read-only review ran no target code.

Is this the best way to solve the issue?

This is the smallest complete repair: canonicalize the supported alias once at its producer without weakening the shared filesystem helper or adding fallback behavior.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Git recovery backup placement keeps the original intent (cd6c9c8: Keep database recovery outside the Git source fence so runtime retirement cannot remove it.)
  • Snapshot retention coverage keeps the original intent (c1579cf: Preserve snapshots requiring manual recovery after successful activation; later coverage also protects late restoration refusal.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit f58d46d adds src/cli/update-cli/update-command-database-backup.ts:113 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f58d46d2a4fe; files: src/cli/update-cli/update-command-database-backup.ts)
  • Donnie Fiander: Raw commit 648fb53 adds src/cli/update-cli/update-command-database-backup.ts:112 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 648fb535d3e1; files: src/cli/update-cli/update-command-database-backup.ts)
  • Dallin Romney: Raw commit 1d59169 adds src/cli/update-cli/update-command-database-retention.test.ts:18 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 1d59169ef8b2; files: src/cli/update-cli/update-command-database-retention.test.ts)

PR surface

Source +1, Tests +60, Docs +5. Total +66 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 2 1 +1
Tests 1 91 31 +60
Docs 1 5 0 +5
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 98 32 +66

Review metrics

Metric Value Why it matters
Production versus test delta Production +2/-1; tests +91/-31 One physical-path resolution fixes the producer; test growth adds real SQLite capture for ordinary and redirected layouts while sharing existing execution setup.

Labels

Label changes:

  • add P2: Git updates fail for a supported redirected-storage layout, with limited scope to this advanced installation workflow.
  • 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: Git updates fail for a supported redirected-storage layout, with limited scope to this advanced installation workflow.
  • 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.

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 October 27, 2026, 4:39 AM ET / 08:39 UTC.

@steipete
steipete merged commit aaa0f43 into main Oct 27, 2026
218 of 222 checks passed
@steipete
steipete deleted the dbasync/artifactsync branch October 27, 2026 09:08
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 28, 2026
)

Resolve the physical .artifacts directory once before native Git database capture. This preserves the existing backup durability, identity, custody and rollback checks while supporting redirected artifact storage.

The paired real-backup regression fails on the original caller and passes with the fix. Fresh-process replay verifies cross-volume storage, the physical returned path, SQLite integrity and the retained synthetic row. Existing redirected Git staging tests pass.

Related: openclaw#160671, openclaw#153764
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S 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