Skip to content

Feat/ak sync#751

Closed
shehab299 wants to merge 9 commits into
mainfrom
feat/ak-sync
Closed

Feat/ak sync#751
shehab299 wants to merge 9 commits into
mainfrom
feat/ak-sync

Conversation

@shehab299

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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::StorageBackend with list_with_meta() and implemented it for local + remote backends.
  • Added a new CLI ak sync push|pull workflow (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.

Comment thread libs/ak/src/store.rs
Comment thread cli/src/commands/ak/sync/mod.rs
Comment thread cli/src/commands/ak/sync/mod.rs
Comment thread cli/src/commands/ak/sync/plan.rs
shehab299 and others added 2 commits June 8, 2026 13:19
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@shehab299 shehab299 closed this Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants