milestone 2 complete
Some checks failed
CI / Test (pull_request) Failing after 6s
CI / Build (pull_request) Failing after 7s
CI / Lint (pull_request) Failing after 13s

This commit is contained in:
2025-10-10 19:03:31 -04:00
parent 4a517d104a
commit a0f80c5c7d
19 changed files with 2225 additions and 145 deletions

View File

@ -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