Watcher operations
The watcher keeps the index and the ledger current while a repository is in use.
Foreground
./auwai watch --repo /path/to/repo --interval 1
One scan:
./auwai watch --repo /path/to/repo --once
The watcher writes .auwai/watch-state.json.
A change runs the incremental refresh and the ledger sync.
User service
[Unit]
Description=Auwai watcher
[Service]
ExecStart=/path/to/auwai watch --repo /path/to/repo --interval 2
Restart=on-failure
RestartSec=5
[Install]
WantedBy=default.target
Place the unit under ~/.config/systemd/user/, then run:
systemctl --user daemon-reload
systemctl --user enable --now auwai-watch.service
The service survives a shell exit. It does not survive a host reboot unless the user service is enabled.
Schedule
Use a timer for the audit:
./auwai audit --repo /path/to/repo --repair
The watcher is the fast path. The audit is the integrity check.
Limits
Polling is the current backend. A large tree pays a stat walk per interval. A branch switch can change many files at once; use the audit repair path.