UPdate checklist
This commit is contained in:
@ -1,71 +1,58 @@
|
|||||||
# Complete Implementation Plan for Onyx Phase 1
|
## Milestone 3: Workstreams
|
||||||
|
|
||||||
## Milestone 2: Transparent Versioning and onx save ✓ COMPLETED
|
### Workstream Data Model
|
||||||
|
|
||||||
### Filesystem Daemon Implementation
|
28. **Implement workstream storage** (`internal/storage/workstreams.go`)
|
||||||
|
```go
|
||||||
|
type WorkstreamsFile struct {
|
||||||
|
CurrentWorkstream string
|
||||||
|
Workstreams map[string]*Workstream
|
||||||
|
}
|
||||||
|
|
||||||
21. ✓ **Create daemon structure** (`internal/daemon/daemon.go`)
|
func LoadWorkstreams(path string) (*WorkstreamsFile, error)
|
||||||
- Implemented Daemon struct with repo, watcher, ticker, debounce, and shutdown channels
|
func (w *WorkstreamsFile) Save(path string) error
|
||||||
- Added configuration support with Config struct
|
```
|
||||||
- Implemented Start(), Stop(), and IsRunning() methods
|
|
||||||
- Includes main event loop with proper goroutine management
|
|
||||||
|
|
||||||
22. ✓ **Implement filesystem watching** (`internal/daemon/watcher.go`)
|
29. **Create workstream manager** (`internal/core/workstream_manager.go`)
|
||||||
- Initialized fsnotify watcher
|
- `CreateWorkstream(name string, base string) error`
|
||||||
- Added repository root to watch list with recursive directory walking
|
- `GetCurrentWorkstream() (*Workstream, error)`
|
||||||
- Implemented recursive subdirectory watching
|
- `SwitchWorkstream(name string) error`
|
||||||
- Filtered out .git, .onx, and other ignored directories
|
- `ListWorkstreams() ([]*Workstream, error)`
|
||||||
- Implemented debouncing (500ms default, configurable)
|
- `AddCommitToWorkstream(sha, message string) error`
|
||||||
|
|
||||||
23. ✓ **Implement snapshot algorithm** (`internal/daemon/snapshot.go`)
|
### Workstream Commands
|
||||||
- Implemented CreateSnapshot() with full workflow:
|
|
||||||
1. Read current workspace pointer from .onx/workspace
|
|
||||||
2. Create tree from working directory state
|
|
||||||
3. Create ephemeral commit with auto-generated message
|
|
||||||
4. Update refs/onyx/workspaces/current reference
|
|
||||||
5. Update .onx/workspace pointer with latest state
|
|
||||||
- Added workspace state serialization/deserialization
|
|
||||||
|
|
||||||
24. ✓ **Create daemon entry point** (`cmd/onxd/main.go`)
|
30. **Implement onx new** (`internal/commands/new.go`)
|
||||||
- Implemented command-line interface with cobra
|
```go
|
||||||
- Parse command line flags (repo path, interval, debounce)
|
func New(repo *Repository, name string) error {
|
||||||
- Initialize daemon with configuration
|
// 1. Fetch latest from origin/main
|
||||||
- Set up signal handlers (SIGTERM, SIGINT) for graceful shutdown
|
// 2. Create workstream entry
|
||||||
- Run main loop with PID file management
|
// 3. Set as current workstream
|
||||||
|
// 4. Update workspace to base commit
|
||||||
|
// 5. Log to oplog
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
25. ✓ **Implement daemon control** (`internal/commands/daemon.go`)
|
31. **Implement onx list** (`internal/commands/list.go`)
|
||||||
- `onx daemon start` - Start background daemon with process detachment
|
- Read workstreams.json
|
||||||
- `onx daemon stop` - Stop daemon gracefully using SIGTERM
|
- Format output with current indicator (*)
|
||||||
- `onx daemon status` - Check daemon status via PID file
|
- Show commit count per workstream
|
||||||
- PID file management in .onx/daemon.pid
|
- Color code output for better readability
|
||||||
- Process lifecycle management with proper signal handling
|
|
||||||
|
|
||||||
### onx save Command
|
32. **Implement onx switch** (`internal/commands/switch.go`)
|
||||||
|
```go
|
||||||
|
func Switch(repo *Repository, name string) error {
|
||||||
|
// 1. Save current ephemeral state
|
||||||
|
// 2. Load target workstream
|
||||||
|
// 3. Checkout latest commit in workstream
|
||||||
|
// 4. Update current_workstream
|
||||||
|
// 5. Restore workspace state
|
||||||
|
// 6. Log to oplog
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
26. ✓ **Implement save command** (`internal/commands/save.go`)
|
33. **Add workstream validation**
|
||||||
- Implemented Save() with complete workflow:
|
- Validate workstream names (no special chars)
|
||||||
1. Read current ephemeral commit from refs/onyx/workspaces/current
|
- Check for uncommitted changes before switch
|
||||||
2. Create new commit with user-provided message
|
- Prevent duplicate workstream names
|
||||||
3. Determine next branch number based on workstream commit count
|
|
||||||
4. Create branch ref (refs/onyx/workstreams/{name}/commit-{n})
|
|
||||||
5. Update workstreams.json with new commit metadata
|
|
||||||
6. Log to oplog via transaction support
|
|
||||||
- Integrated with existing workstream model
|
|
||||||
- Added transaction support for undo capability
|
|
||||||
|
|
||||||
27. ✓ **Add message validation**
|
|
||||||
- Require non-empty message (enforced by cobra flag)
|
|
||||||
- Validate message length (max 72 chars for title)
|
|
||||||
- Support multi-line messages with -m flag
|
|
||||||
- Proper error messages for validation failures
|
|
||||||
|
|
||||||
### Implementation Summary
|
|
||||||
|
|
||||||
All components of Milestone 2 have been successfully implemented:
|
|
||||||
- **Daemon**: Full filesystem monitoring with fsnotify, debouncing, and automatic snapshots
|
|
||||||
- **Save Command**: Complete integration with workstreams and oplog
|
|
||||||
- **Infrastructure**: PID file management, signal handling, transaction support
|
|
||||||
- **Testing**: All existing tests pass, binaries build successfully
|
|
||||||
|
|
||||||
The implementation provides a solid foundation for transparent versioning in Onyx.
|
|
||||||
|
|
||||||
|
@ -1,61 +1,3 @@
|
|||||||
## Milestone 3: Workstreams
|
|
||||||
|
|
||||||
### Workstream Data Model
|
|
||||||
|
|
||||||
28. **Implement workstream storage** (`internal/storage/workstreams.go`)
|
|
||||||
```go
|
|
||||||
type WorkstreamsFile struct {
|
|
||||||
CurrentWorkstream string
|
|
||||||
Workstreams map[string]*Workstream
|
|
||||||
}
|
|
||||||
|
|
||||||
func LoadWorkstreams(path string) (*WorkstreamsFile, error)
|
|
||||||
func (w *WorkstreamsFile) Save(path string) error
|
|
||||||
```
|
|
||||||
|
|
||||||
29. **Create workstream manager** (`internal/core/workstream_manager.go`)
|
|
||||||
- `CreateWorkstream(name string, base string) error`
|
|
||||||
- `GetCurrentWorkstream() (*Workstream, error)`
|
|
||||||
- `SwitchWorkstream(name string) error`
|
|
||||||
- `ListWorkstreams() ([]*Workstream, error)`
|
|
||||||
- `AddCommitToWorkstream(sha, message string) error`
|
|
||||||
|
|
||||||
### Workstream Commands
|
|
||||||
|
|
||||||
30. **Implement onx new** (`internal/commands/new.go`)
|
|
||||||
```go
|
|
||||||
func New(repo *Repository, name string) error {
|
|
||||||
// 1. Fetch latest from origin/main
|
|
||||||
// 2. Create workstream entry
|
|
||||||
// 3. Set as current workstream
|
|
||||||
// 4. Update workspace to base commit
|
|
||||||
// 5. Log to oplog
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
31. **Implement onx list** (`internal/commands/list.go`)
|
|
||||||
- Read workstreams.json
|
|
||||||
- Format output with current indicator (*)
|
|
||||||
- Show commit count per workstream
|
|
||||||
- Color code output for better readability
|
|
||||||
|
|
||||||
32. **Implement onx switch** (`internal/commands/switch.go`)
|
|
||||||
```go
|
|
||||||
func Switch(repo *Repository, name string) error {
|
|
||||||
// 1. Save current ephemeral state
|
|
||||||
// 2. Load target workstream
|
|
||||||
// 3. Checkout latest commit in workstream
|
|
||||||
// 4. Update current_workstream
|
|
||||||
// 5. Restore workspace state
|
|
||||||
// 6. Log to oplog
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
33. **Add workstream validation**
|
|
||||||
- Validate workstream names (no special chars)
|
|
||||||
- Check for uncommitted changes before switch
|
|
||||||
- Prevent duplicate workstream names
|
|
||||||
|
|
||||||
## Milestone 4: Synchronization and Remote Interaction
|
## Milestone 4: Synchronization and Remote Interaction
|
||||||
|
|
||||||
### Rebase Engine
|
### Rebase Engine
|
||||||
|
Reference in New Issue
Block a user