agent-governance/bin/checkpoint
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

85 lines
3.1 KiB
Bash
Executable File

#!/bin/bash
#
# Context Checkpoint Skill for Claude Code
# =========================================
# Preserves session context and orchestrates sub-agent calls.
#
# Skill documentation: /opt/agent-governance/checkpoint/CLAUDE.md
#
# Commands:
# now [--notes "..."] Create checkpoint capturing current state
# load [checkpoint_id] Load latest or specific checkpoint
# diff [--from ID] [--to ID] Compare checkpoints
# list [--limit N] List available checkpoints
# summary --level <level> Context summary (minimal/compact/standard/full)
# report [--phase <phase>] Combined checkpoint + directory status report
# timeline [--limit N] Show checkpoint history with status changes
# auto-orchestrate --model <m> Delegate to OpenRouter models
# queue list|add|clear|pop Manage instruction queue
# prune [--keep N] Remove old checkpoints
#
# Examples:
# checkpoint now --notes "Before deploy"
# checkpoint load --json
# checkpoint summary --level compact
# checkpoint auto-orchestrate --model minimax --instruction "run tests"
#
set -euo pipefail
CHECKPOINT_DIR="/opt/agent-governance/checkpoint"
CHECKPOINT_SCRIPT="${CHECKPOINT_DIR}/checkpoint.py"
# Show help if no args or --help
if [[ $# -eq 0 ]] || [[ "${1:-}" == "--help" ]] || [[ "${1:-}" == "-h" ]]; then
cat << 'EOF'
Context Checkpoint Skill
========================
Commands:
now [--notes "..."] Create checkpoint (includes directory statuses)
load [checkpoint_id] [--json] Load checkpoint
diff [--from ID] [--to ID] Compare checkpoints
list [--limit N] [--json] List checkpoints
summary --level <level> Context summary
report [--phase <phase>] Combined checkpoint + directory status report
timeline [--limit N] Checkpoint history with status changes
auto-orchestrate --model <m> Delegate to AI models
queue list|add|clear|pop Manage instruction queue
prune [--keep N] Remove old checkpoints
Summary Levels:
minimal (~500 tokens) Phase + agent only
compact (~1000 tokens) + tasks + key variables
standard (~2000 tokens) + all tasks + dependencies
full (~4000 tokens) Complete context
Models for auto-orchestrate:
minimax Minimax-01 (default, 100K context)
gemini Gemini 2.0 Flash Thinking (free)
gemini-pro Gemini 2.5 Pro (highest capability)
Examples:
checkpoint now --notes "Phase 5 complete"
checkpoint load --json | jq .phase
checkpoint summary --level compact
checkpoint report # Combined status view
checkpoint report --phase in_progress # Filter by phase
checkpoint timeline --limit 5 # Recent history
checkpoint auto-orchestrate --model minimax -i "check status"
checkpoint queue add --instruction "run tests" --priority 5
Documentation: /opt/agent-governance/checkpoint/CLAUDE.md
EOF
exit 0
fi
# Verify checkpoint script exists
if [[ ! -f "${CHECKPOINT_SCRIPT}" ]]; then
echo "Error: checkpoint.py not found at ${CHECKPOINT_SCRIPT}"
exit 1
fi
# Execute checkpoint command
exec python3 "${CHECKPOINT_SCRIPT}" "$@"