Skip to content

feat(drive): add recursive directory push#927

Merged
steipete merged 2 commits into
openclaw:mainfrom
Avg8888:feat/drive-sync-push
Jul 16, 2026
Merged

feat(drive): add recursive directory push#927
steipete merged 2 commits into
openclaw:mainfrom
Avg8888:feat/drive-sync-push

Conversation

@Avg8888

@Avg8888 Avg8888 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add gog drive sync push <localDirectory> --parent <folderId> for recursive, non-destructive uploads
  • create missing folders and binary files, skip unchanged content, and update changed files by Drive ID
  • retain remote-only items; never delete or mirror
  • preflight the complete local and remote trees before writes, rejecting ambiguous names, wrong item types, native Google files, symlinks, invalid paths, and incomplete search results
  • protect local traversal and upload content against path replacement and concurrent source mutation
  • support My Drive and shared-drive request semantics with deterministic JSON and plain output

Fixes #925.

Maintainer repair

The original proposal and live contract came from @Avg8888. The implementation was rewritten after maintainer review to close fail-closed, filesystem-race, bounded-resource, output-safety, and shared-drive gaps. Contributor co-authorship is preserved in the commit and changelog.

Proof

  • make ci
  • exact-tree AutoReview clean: no accepted or actionable findings, confidence 0.90
  • signed exact-head candidate: live Drive behavior contract passed 10/10 against a disposable hierarchy
  • shared-drive request semantics, exact corpus pagination, and incomplete-search rejection covered by HTTP-level tests; no shared drive was available for live validation

Signed candidate SHA-256: d226a155192d9dd727d453fda94498c52b90b40a6ceecf1f308e3c1df558a944

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. labels Jul 16, 2026
@clawsweeper

clawsweeper Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 16, 2026, 9:47 AM ET / 13:47 UTC.

Summary
Adds a recursive one-way gog drive sync push command with preflight planning, checksum skips, ID-stable updates, tests, and generated documentation.

Reproducibility: not applicable. This PR proposes a new Drive capability rather than fixing a reproducible current-main bug.

Review metrics: 3 noteworthy metrics.

  • Command surface: 1 new mutating subcommand. The PR establishes a permanent Drive reconciliation interface rather than extending an existing flag.
  • Diff size: 11 files, +842/-1. Most changes are concentrated in one implementation file, one test file, and generated or user documentation.
  • Core coverage: 376 implementation lines, 354 test lines. The near one-to-one implementation and test size is useful validation but does not replace live proof.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #925
Summary: This PR is the candidate implementation for the open canonical product-direction issue; the older closed PR overlaps only through its broader sync proposal.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🐚 platinum hermit
Result: blocked until stronger real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Attach redacted terminal output or logs for the claimed live Google Drive scenarios.
  • Remove the CHANGELOG.md edit and retain release context in the PR body or commit message.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: The detailed live-test claims are promising, but the PR lacks inspectable after-fix evidence; attach redacted terminal output or logs showing planning, creation, ID-preserving update, unchanged rerun, and fail-closed conflict behavior, then update the PR body to trigger review or ask a maintainer to comment @clawsweeper re-review.

Risk before merge

  • [P1] Merging before sponsorship would establish a permanent new mutating CLI surface while the canonical issue still records an unresolved product decision.
  • [P1] The PR body summarizes live results but provides no inspectable redacted transcript, logs, screenshot, or linked artifact showing the after-fix behavior.
  • [P1] Shared-drive flags are covered by tests, but the PR explicitly lacks live shared-drive verification.

Maintainer options:

  1. Decide the mitigation before merge
    The desired end state is a sponsored, bounded push-only command with stable JSON/plain output, no remote deletion, preflight conflict checks, inspectable live proof, and release notes curated outside the contributor branch.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] A maintainer must decide whether to sponsor the new command surface, and the contributor must add inspectable live Drive proof before merge.

Maintainer decision needed

  • Question: Should gog permanently add the bounded drive sync push command proposed by this PR?
  • Rationale: The implementation adds a new mutating command surface; VISION.md allows small Drive primitives but requires discussion for new API surfaces, and the canonical issue is explicitly awaiting sponsorship.
  • Likely owner: steipete — The Drive command and release history make this the strongest available product-direction owner.
  • Options:
    • Sponsor bounded push (recommended): Accept the push-only, non-deleting command direction once proof and ordinary review requirements are satisfied.
    • Keep design open: Leave the issue and draft PR open while maintainers refine naming, scope, or whether this belongs in core.
    • Decline core command: Keep directory reconciliation in external scripts or tools and close the core proposal without merging the command.

Security
Cleared: The diff adds Drive API reconciliation code without new dependencies, workflow changes, secret handling, permission broadening, or third-party execution paths.

Review findings

  • [P3] Remove the contributor-owned changelog entry — CHANGELOG.md:5
Review details

Best possible solution:

The desired end state is a sponsored, bounded push-only command with stable JSON/plain output, no remote deletion, preflight conflict checks, inspectable live proof, and release notes curated outside the contributor branch.

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

Not applicable: this PR proposes a new Drive capability rather than fixing a reproducible current-main bug.

Is this the best way to solve the issue?

Unclear: the push-only design is substantially narrower and safer than the prior broad sync PR, but a maintainer must confirm that this permanent command surface is the preferred core solution.

Full review comments:

  • [P3] Remove the contributor-owned changelog entry — CHANGELOG.md:5
    This repository treats CHANGELOG.md as release-owned for normal PRs, so this feature branch should not curate the release entry. Remove this line and retain the user-visible release context in the PR body or commit message.
    Confidence: 0.99

Overall correctness: patch is correct
Overall confidence: 0.78

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 7785477091f9.

Label changes

Label changes:

  • add P3: This is a bounded speculative Drive feature with no current regression or urgent user-facing breakage.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The detailed live-test claims are promising, but the PR lacks inspectable after-fix evidence; attach redacted terminal output or logs showing planning, creation, ID-preserving update, unchanged rerun, and fail-closed conflict behavior, then update the PR body to trigger review or ask a maintainer to comment @clawsweeper re-review.

Label justifications:

  • P3: This is a bounded speculative Drive feature with no current regression or urgent user-facing breakage.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The detailed live-test claims are promising, but the PR lacks inspectable after-fix evidence; attach redacted terminal output or logs showing planning, creation, ID-preserving update, unchanged rerun, and fail-closed conflict behavior, then update the PR body to trigger review or ask a maintainer to comment @clawsweeper re-review.
Evidence reviewed

What I checked:

  • Current main lacks the command: The current DriveCmd exposes upload, changes, and other Drive operations but has no sync command group. (internal/cmd/drive.go:80, 7785477091f9)
  • Proposed implementation: The branch adds the new command group and a dedicated recursive planning and application implementation. (internal/cmd/drive_sync.go:26, e69828a9bf9f)
  • Focused regression coverage: The branch adds tests covering dry-run, nested creation, checksum skips, ID-preserving updates, pagination, conflicts, symlinks, listing counts, and deterministic stress planning. (internal/cmd/drive_sync_test.go:15, e69828a9bf9f)
  • Product-direction context: The linked canonical issue remains open with needs-maintainer-review and needs-product-decision labels, and this draft explicitly requests command-surface sponsorship.
  • Vision guidance: VISION.md welcomes small useful primitives in supported areas but requires discussion for new API surfaces or major command-structure changes and expects live testing. (VISION.md:1, 7785477091f9)
  • Release baseline: Release v0.34.0 does not contain recursive Drive push, so this work is neither implemented on main nor already shipped. (CHANGELOG.md:1, 836378754862)

Likely related people:

  • steipete: Release history carries the Drive command surface, including Drive Changes, and the current command structure follows this ownership trail. (role: Drive command and release owner; confidence: high; commits: 280eea7, 7785477091f9; files: internal/cmd/drive.go, CHANGELOG.md)
  • salmonumbrella: Release history credits this contributor for the existing drive upload --replace primitive that provides the adjacent ID-preserving update behavior. (role: adjacent feature owner; confidence: medium; commits: a92bd63; files: internal/cmd/drive_upload.go)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@steipete
steipete force-pushed the feat/drive-sync-push branch from e69828a to 8aa8cf1 Compare July 16, 2026 19:04
@steipete
steipete marked this pull request as ready for review July 16, 2026 19:04
@steipete
steipete merged commit fa832b3 into openclaw:main Jul 16, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(drive): add one-way recursive directory push

2 participants