User e56b276033 Milestone 4: Synchronization and Remote Interaction
This milestone implements comprehensive remote synchronization capabilities
and authentication support for Onyx, completing the core workflow features.

## Rebase Engine (internal/git/rebase.go)
- Stacked rebase with sequential commit processing
- Conflict detection and handling
- Integration with rerere for automatic conflict resolution
- Support for rebase continuation and abort operations

## Rerere Integration (internal/git/rerere.go)
- Conflict resolution recording and replay
- Cache location: .onx/rerere_cache
- Automatic application of previous conflict resolutions
- SHA1-based conflict pattern matching with normalization

## Conflict Resolution UI (internal/git/conflicts.go)
- Index-based conflict detection using Git stages (1/2/3)
- Clear conflict presentation with file paths and commit hashes
- User-friendly resolution guidance
- Conflict marker extraction and analysis

## Remote Commands

### onx sync (internal/commands/sync.go)
- Fetch latest changes from remote origin
- Rebase workstream stack onto updated base branch
- Automatic rerere conflict resolution
- Transaction-wrapped with full undo support
- Comprehensive progress reporting and error messages

### onx push (internal/commands/push.go)
- Push all workstream branches to remote
- Support for force push operations
- Per-branch progress reporting
- Clear summary of pushed branches
- Push workstream commits to refs/heads/onyx/workstreams/...

## Authentication (internal/git/auth.go)
- Multi-method authentication with auto-detection
- SSH: ssh-agent and ~/.ssh key file support
- HTTPS: git credential helper and environment variables
- Credential caching for performance
- Graceful fallback when authentication unavailable

## Remote Helpers (internal/git/remote.go)
- Remote validation and configuration
- Support for multiple remotes with origin as default
- URL retrieval and remote existence checking

## Dogfooding
- Updated CLAUDE.md with mandatory Onyx-only development policy
- All future development (human and AI) must use Onyx commands
- Exceptions documented for git usage (remotes, PRs, debugging)

## Status
 All Milestone 4 features implemented and tested
 Successfully used Onyx for its own development
 Authentication working with remote repositories
 Full stacked-diff workflow operational
2025-10-14 22:48:09 -04:00
2025-10-09 19:46:05 -04:00
2025-10-14 22:10:45 -04:00
2025-10-14 22:10:45 -04:00
2025-10-14 22:10:45 -04:00
2025-10-14 22:10:45 -04:00
2025-10-09 19:19:31 -04:00
2025-10-09 18:56:20 -04:00
2025-10-09 18:41:16 -04:00
2025-10-10 19:03:31 -04:00
2025-10-10 19:03:31 -04:00
2025-10-10 19:03:31 -04:00
2025-10-10 19:03:31 -04:00
2025-10-09 18:56:20 -04:00
2025-10-10 19:03:31 -04:00

Onyx

A next-generation version control system designed as a superior user experience layer on top of Git.

Overview

Onyx provides transparent versioning, workstreams for stacked-diff management, and an action log for universal undo functionality. The project is written in Go and uses the go-git library for Git interaction.

Features

  • 100% Git Data Model Compatibility: Uses standard .git directory for shared truth
  • Transparent Versioning: Background daemon creates continuous snapshots
  • Workstreams: Stacked-diff workflow management
  • Action Log: Transactional undo/redo capability
  • Hybrid Storage: .git for Git objects, .onx for Onyx-specific metadata

Quick Start

Prerequisites

  • Go 1.24.2 or later
  • Git 2.30.0 or later

Installation

# Clone the repository
git clone https://git.dws.rip/DWS/onyx.git
cd onyx

# Install dependencies
go mod tidy

# Build the CLI and daemon
make build

# Install to PATH
make install

Usage

# Initialize repository
onx init

# Create workstream
onx new feature-branch

# Save work
onx save -m "Add new feature"

# List workstreams
onx list

# Switch workstreams
onx switch main

# Sync with remote
onx sync

# Push workstream
onx push

# Undo last operation
onx undo

Development

Building

# Build the CLI and daemon
go build -o bin/onx ./cmd/onx
go build -o bin/onxd ./cmd/onxd

# Install to PATH
go install ./cmd/onx
go install ./cmd/onxd

Testing

# Run all tests
go test -v ./...

# Run tests with coverage
go test -cover ./...

# Run specific test package
go test -v ./internal/core

Linting and Code Quality

The project uses several tools to maintain code quality:

# Run linter
golangci-lint run

# Run security scanner
gosec ./...

# Run tests with race detection
go test -race ./...

CI/CD

This project uses Gitea Actions for continuous integration and deployment. The workflow includes:

CI Pipeline

  • Test: Runs unit tests with race detection and coverage reporting
  • Build: Cross-compiles binaries for multiple platforms (Linux, Windows, macOS)
  • Security: Runs security scans using Gosec
  • Lint: Performs comprehensive code linting with golangci-lint
  • Release: Creates releases and uploads artifacts for main branch builds

Supported Platforms

  • Linux (amd64, arm64)
  • Windows (amd64)
  • macOS (amd64, arm64)

Workflow Triggers

  • Push to main or develop branches
  • Pull requests to main branch

Architecture

Project Structure

onyx/
├── cmd/
│   ├── onx/           # CLI entry point
│   └── onxd/          # Daemon entry point
├── internal/
│   ├── core/          # Core abstractions
│   ├── git/           # Git interaction layer
│   ├── models/        # Data models
│   ├── storage/       # .onx directory management
│   ├── commands/      # CLI command implementations
│   ├── daemon/        # Daemon implementation
│   └── utils/         # Utilities
├── pkg/               # Public APIs
├── test/              # Integration tests
└── docs/              # Documentation

Core Components

  • Repository: Central object encapsulating access to both Git repository and Onyx metadata
  • Action Log: Append-only binary log storing state before/after each operation
  • Workstreams: Manages stacked-diff workflows through .onx/workstreams.json
  • Daemon: Background process for continuous snapshot creation

Contributing

  1. Fork the repository
  2. Create a feature branch (onx new feature-name)
  3. Make your changes
  4. Run tests and linting (make test lint)
  5. Commit your changes (onx save -m "Add feature")
  6. Push to your fork (onx push)
  7. Create a pull request

License

[License information to be added]

Acknowledgments

  • go-git - Git implementation in pure Go
  • cobra - CLI framework
  • fsnotify - Filesystem monitoring
Description
No description provided
Readme 227 KiB
Languages
Go 92.5%
Shell 5.5%
Makefile 2%