profit 77655c298c Initial commit: Agent Governance System Phase 8
Phase 8 Production Hardening with complete governance infrastructure:

- Vault integration with tiered policies (T0-T4)
- DragonflyDB state management
- SQLite audit ledger
- Pipeline DSL and templates
- Promotion/revocation engine
- Checkpoint system for session persistence
- Health manager and circuit breaker for fault tolerance
- GitHub/Slack integrations
- Architectural test pipeline with bug watcher, suggestion engine, council review
- Multi-agent chaos testing framework

Test Results:
- Governance tests: 68/68 passing
- E2E workflow: 16/16 passing
- Phase 2 Vault: 14/14 passing
- Integration tests: 27/27 passing

Coverage: 57.6% average across 12 phases

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 22:07:06 -05:00

101 lines
2.9 KiB
Markdown

# Context Checkpoint Skill
## Overview
The checkpoint skill preserves session context across token resets and orchestrates sub-agent calls with minimal token usage.
## Commands
### Create Checkpoint
```bash
/opt/agent-governance/bin/checkpoint now [--notes "description"]
```
Captures current state: phase, tasks, dependencies, variables, recent outputs.
### Load Checkpoint
```bash
/opt/agent-governance/bin/checkpoint load [checkpoint_id]
```
Loads latest or specific checkpoint. Use `--json` for machine-readable output.
### Compare Checkpoints
```bash
/opt/agent-governance/bin/checkpoint diff [--from ID] [--to ID]
```
Shows changes between checkpoints (phase, tasks, variables, dependencies).
### List Checkpoints
```bash
/opt/agent-governance/bin/checkpoint list [--limit N]
```
Lists available checkpoints with timestamps and token counts.
### Context Summary
```bash
/opt/agent-governance/bin/checkpoint summary --level minimal|compact|standard|full
```
Generates token-aware summaries:
- `minimal` (~500 tokens): Phase + active task + agent
- `compact` (~1000 tokens): + pending tasks + key variables
- `standard` (~2000 tokens): + all tasks + dependencies
- `full` (~4000 tokens): Complete context for complex operations
### Auto-Orchestrate Mode
```bash
/opt/agent-governance/bin/checkpoint auto-orchestrate --model minimax|gemini|gemini-pro \
--instruction "command1" --instruction "command2" [--dry-run] [--confirm]
```
Delegates commands to OpenRouter models with automatic checkpointing.
### Instruction Queue
```bash
/opt/agent-governance/bin/checkpoint queue list|add|clear|pop [--instruction "..."] [--priority N]
```
Manages pending instructions for automated execution.
### Prune Old Checkpoints
```bash
/opt/agent-governance/bin/checkpoint prune [--keep N]
```
Removes old checkpoints, keeping the most recent N (default: 50).
## When to Use
1. **Before complex operations**: Create checkpoint to preserve state
2. **After session reset**: Load checkpoint to restore context
3. **Sub-agent calls**: Use `summary --level compact` to minimize tokens
4. **Debugging**: Use `diff` to see what changed between checkpoints
5. **Automated mode**: Use `auto-orchestrate` for humanless execution
## Examples
```bash
# Save current state before risky operation
checkpoint now --notes "Before database migration"
# Restore after context reset
checkpoint load
# Get minimal context for sub-agent
checkpoint summary --level minimal
# Run automated commands with Minimax
checkpoint auto-orchestrate --model minimax \
--instruction "run tests" \
--instruction "deploy if tests pass"
# Queue instructions for later
checkpoint queue add --instruction "backup database" --priority 10
checkpoint queue list
```
## Integration
Checkpoints are stored in:
- `/opt/agent-governance/checkpoint/storage/` (JSON files)
- DragonflyDB `checkpoint:latest` key (fast access)
Audit logs go to:
- SQLite: `orchestration_log` table
- DragonflyDB: `orchestration:log` list