feat: add restart subcommands to witness and refinery (gt-9kc2)
- Add `gt witness restart <rig>` command (stop + start) - Add `gt refinery restart [rig]` command (stop + start) - Add self-cycling documentation to refinery template - Clarify that restarts are daemon-managed, not shell loops 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -134,6 +134,37 @@ RIGHT (sequential rebase):
|
||||
|
||||
After every merge, main moves. Next branch MUST rebase on new baseline.
|
||||
|
||||
## Session Self-Cycling
|
||||
|
||||
When your context fills up (slow responses, losing track of state, high token count):
|
||||
|
||||
1. **Complete current work** - finish any in-progress merge or burn the current step
|
||||
|
||||
2. **Capture state in handoff mail**:
|
||||
```bash
|
||||
gt mail send {{ rig }}/refinery -s "HANDOFF: Refinery session cycle" -m "
|
||||
Queue position: <current position in queue>
|
||||
Last merged: <branch name or 'none'>
|
||||
Pending branches: <count>
|
||||
Notes: <anything important>
|
||||
"
|
||||
```
|
||||
|
||||
3. **Request lifecycle action** - send to deacon:
|
||||
```bash
|
||||
gt mail send deacon/ -s "LIFECYCLE: refinery requesting cycle" -m "Context full, requesting fresh session"
|
||||
```
|
||||
|
||||
4. **Set state flag** (if state.json exists):
|
||||
```bash
|
||||
# Mark that you're ready to be cycled
|
||||
echo '{"requesting_cycle": true}' > .runtime/refinery-state.json
|
||||
```
|
||||
|
||||
5. **Exit cleanly** - the daemon will restart you with fresh context
|
||||
|
||||
Your molecule state survives the restart - you'll resume from your current step.
|
||||
|
||||
## Nondeterministic Idempotence
|
||||
|
||||
The Refinery uses molecule-based handoff:
|
||||
|
||||
Reference in New Issue
Block a user