Skip to content

[ADR-010] VCS Git-Native Core and Legacy Removal #320

@ohdearquant

Description

@ohdearquant

Summary

Collapse legacy khive-sync/server branch models into Git-native VCS primitives, remove obsolete merge-engine surfaces, and add the Rust sync library boundary called for by ADR-010 and ADR-020.

Source ADRs

  • F056 ADR-010 (CRIT): Canonical snapshot JSON root contains only entities and edges (from audit-foundation/e5/ADR-010.md)
  • F057 ADR-010 (MAJ): Public RemoteConfig still models a remote khive-sync server for push/pull, and crates/khive-vcs/src/lib.rs:20 exports it. (from audit-foundation/e5/ADR-010.md)
  • F058 ADR-010 (MAJ): VcsError still exposes remote server/auth/push-pull errors (RemoteUnreachable, AuthFailed, NonFastForward, MergeRequired) tied to custom VCS behavior. (from audit-foundation/e5/ADR-010.md)
  • F059 ADR-010 (MIN): Crate docs say the full snapshot/branch/merge pipeline was superseded by ADR-048 (from audit-foundation/e5/ADR-010.md)
  • F102 ADR-020 (MAJ): khive-vcs says the full snapshot/branch/merge pipeline was superseded and retains only foundational primitives (from audit-platform/e4/ADR-020.md)
  • F103 ADR-020 (CRIT): khive-vcs still models immutable KgSnapshot rows stored in kg_snapshot_archives, KgBranch branch pointers, and VcsState.dirty - crates/khive-vcs/src/types.rs:87... (from audit-platform/e4/ADR-020.md)
  • F104 ADR-020 (CRIT): RemoteConfig still points to a remote khive instance / khive-sync server, and VcsError still exposes remote server errors and push/pull-style non-fast-forward flow -... (from audit-platform/e4/ADR-020.md)
  • F105 ADR-020 (MAJ): khive-merge is a custom KG three-way merge engine, and the workspace excludes it as not yet compilable against restructured khive-vcs - crates/Cargo.toml:26. (from audit-platform/e4/ADR-020.md)
  • F106 ADR-020 (MAJ): Only kkernel sync implements a Rust NDJSON-to-SQLite rebuild (from audit-platform/e4/ADR-020.md)

Files affected

  • crates/khive-vcs/src/hash.rs (365 sampled LOC)
  • crates/khive-vcs/src/types.rs (365 sampled LOC)
  • crates/khive-vcs/src/error.rs (93 sampled LOC)
  • crates/khive-vcs/src/lib.rs (20 sampled LOC)
  • crates/khive-merge/src/lib.rs (21 sampled LOC)
  • crates/kkernel/src/sync.rs (386 sampled LOC)
  • crates/khive-vcs/src/sync.rs (new/planned path)
  • crates/khive-merge/src/merge.rs (311 sampled LOC)
  • crates/khive-runtime/src/portability.rs (918 sampled LOC)
  • crates/kkernel/src/main.rs (167 sampled LOC)
  • crates/Cargo.toml (59 sampled LOC)
  • crates/khive-vcs/Cargo.toml (24 sampled LOC)

Acceptance criteria

  • All source findings listed above are addressed exactly once in this cluster.
  • Public types, handlers, schema, and docs touched by the affected files agree on the ADR contract.
  • Regression tests cover happy path and edge cases for the changed public APIs or schema behavior.
  • cargo test -p khive-vcs -p kkernel passes.
  • cargo clippy --workspace -- -D warnings passes.
  • make ci passes.

Dependencies

  • Depends on: #[ADR-003] Runtime Backend and Substrate Coordinator
  • Blocks: #[ADR-023] Dynamic Pack Loading, Template, and Pack Binary Inclusion
  • Blocks: #[ADR-011] Retrieval, Embed, and Lattice Boundary
  • Blocks: #[ADR-034] kkernel Engine and Admin Commands
  • Blocks: #[ADR-035] Import, Export, Remote Resolver, and Sync

LOC estimate

~340 lines added/100 removed; 11 existing affected file(s) sampled at 2729 current LOC via wc -l, plus 1 new/planned path(s).

Risk notes

  • Same-file dependencies must merge first; dependency list includes the exact overlapping paths.
  • 1 affected path(s) are new/planned and were not present in rg --files --hidden; create them in the owning PR rather than in independent parallel work.
  • Contains CRIT findings; do not defer without owner approval.

Auto-generated by ADR alignment triage

Metadata

Metadata

Assignees

No one assigned

    Labels

    adr-alignmentADR v1 series alignment workadvancedAdvanced layer (ADR-031..046)foundationFoundation layer (ADR-001..015)platformPlatform layer (ADR-016..030)

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions