Feat/ak sync#751
Closed
shehab299 wants to merge 9 commits into
Closed
Conversation
…nflict resolution
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces an stakpak ak sync command to reconcile the local ak knowledge store with the remote Stakpak knowledge store, using per-file SHA-256 content hashes and sizes to plan uploads/downloads and detect conflicts.
Changes:
- Added shared helpers for SHA-256 hex hashing and small human-oriented formatting (size + short hash).
- Extended
stakpak_ak::StorageBackendwithlist_with_meta()and implemented it for local + remote backends. - Added a new CLI
ak sync push|pullworkflow (plan/execute/display) with conflict detection and optional resolution strategies.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| libs/shared/src/lib.rs | Exposes new shared format and hash modules. |
| libs/shared/src/hash.rs | Adds reusable sha256_hex() helper with test vectors. |
| libs/shared/src/format.rs | Adds format_size() and short_hash() helpers for terminal output. |
| libs/api/src/stakpak/knowledge/cache.rs | Switches cache ETag hashing to shared sha256_hex() implementation. |
| libs/ak/src/store.rs | Adds FileMeta + StorageBackend::list_with_meta() for sync reconciliation. |
| libs/ak/src/lib.rs | Re-exports FileMeta for downstream consumers (CLI sync). |
| libs/ak/Cargo.toml | Adds stakpak-shared dependency for shared hashing helper. |
| cli/src/commands/ak/sync/plan.rs | Implements sync planning logic (uploads/downloads/skips/conflicts). |
| cli/src/commands/ak/sync/mod.rs | Adds ak sync clap surface, orchestration, and tests. |
| cli/src/commands/ak/sync/execute.rs | Executes a sync plan with per-file fault tolerance and strategies. |
| cli/src/commands/ak/sync/display.rs | Prints sync plans/reports with size/hash formatting. |
| cli/src/commands/ak/mod.rs | Wires the new ak sync subcommand into the ak command group. |
| Cargo.lock | Records new dependency edges (e.g., stakpak-shared used by stakpak-ak). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.