milestone 2 complete
This commit is contained in:
@ -1,67 +1,3 @@
|
||||
## Milestone 2: Transparent Versioning and onx save
|
||||
|
||||
### Filesystem Daemon Implementation
|
||||
|
||||
21. **Create daemon structure** (`internal/daemon/daemon.go`)
|
||||
```go
|
||||
type Daemon struct {
|
||||
repo *Repository
|
||||
watcher *fsnotify.Watcher
|
||||
ticker *time.Ticker
|
||||
debounce time.Duration
|
||||
shutdown chan bool
|
||||
}
|
||||
```
|
||||
|
||||
22. **Implement filesystem watching** (`internal/daemon/watcher.go`)
|
||||
- Initialize fsnotify watcher
|
||||
- Add repository root to watch list
|
||||
- Recursively watch subdirectories
|
||||
- Filter out .git and .onx directories
|
||||
- Implement debouncing (500ms)
|
||||
|
||||
23. **Implement snapshot algorithm** (`internal/daemon/snapshot.go`)
|
||||
```go
|
||||
func (d *Daemon) CreateSnapshot() error {
|
||||
// 1. Read current workspace pointer
|
||||
// 2. Create tree from working directory
|
||||
// 3. Create ephemeral commit
|
||||
// 4. Update refs/onyx/workspaces/current
|
||||
// 5. Update .onx/workspace pointer
|
||||
}
|
||||
```
|
||||
|
||||
24. **Create daemon entry point** (`cmd/onxd/main.go`)
|
||||
- Parse command line flags (repo path, interval)
|
||||
- Initialize daemon
|
||||
- Set up signal handlers (SIGTERM, SIGINT)
|
||||
- Run main loop
|
||||
|
||||
25. **Implement daemon control** (`internal/commands/daemon.go`)
|
||||
- `onx daemon start` - Start background daemon
|
||||
- `onx daemon stop` - Stop daemon gracefully
|
||||
- `onx daemon status` - Check daemon status
|
||||
- Use PID file in .onx/daemon.pid
|
||||
|
||||
### onx save Command
|
||||
|
||||
26. **Implement save command** (`internal/commands/save.go`)
|
||||
```go
|
||||
func Save(repo *Repository, message string) error {
|
||||
// 1. Read current ephemeral commit
|
||||
// 2. Create new commit with user message
|
||||
// 3. Determine next branch number
|
||||
// 4. Create branch ref
|
||||
// 5. Update workstreams.json
|
||||
// 6. Log to oplog
|
||||
}
|
||||
```
|
||||
|
||||
27. **Add message validation**
|
||||
- Require non-empty message
|
||||
- Validate message length (max 72 chars for title)
|
||||
- Support multi-line messages with -m flag
|
||||
|
||||
## Milestone 3: Workstreams
|
||||
|
||||
### Workstream Data Model
|
||||
|
Reference in New Issue
Block a user