Major additions: - marketplace/: Agent template registry with FTS5 search, ratings, versioning - observability/: Prometheus metrics, distributed tracing, structured logging - ledger/migrations/: Database migration scripts for multi-tenant support - tests/governance/: 15 new test files for phases 6-12 (295 total tests) - bin/validate-phases: Full 12-phase validation script New features: - Multi-tenant support with tenant isolation and quota enforcement - Agent marketplace with semantic versioning and search - Observability with metrics, tracing, and log correlation - Tier-1 agent bootstrap scripts Updated components: - ledger/api.py: Extended API for tenants, marketplace, observability - ledger/schema.sql: Added tenant, project, marketplace tables - testing/framework.ts: Enhanced test framework - checkpoint/checkpoint.py: Improved checkpoint management Archived: - External integrations (Slack/GitHub/PagerDuty) moved to .archive/ - Old checkpoint files cleaned up Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
64 lines
1.9 KiB
Bash
Executable File
64 lines
1.9 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Bootstrap script for Tier 1 Agent
|
|
# Sets up workspace, credentials, and validates configuration
|
|
#
|
|
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
AGENT_DIR="${SCRIPT_DIR}"
|
|
|
|
echo "========================================"
|
|
echo "Tier 1 Agent Bootstrap"
|
|
echo "========================================"
|
|
|
|
# Create required directories
|
|
echo "[1/5] Creating directories..."
|
|
mkdir -p "${AGENT_DIR}/workspace"
|
|
mkdir -p "${AGENT_DIR}/plans"
|
|
mkdir -p "${AGENT_DIR}/logs"
|
|
mkdir -p "${AGENT_DIR}/credentials"
|
|
|
|
# Validate config
|
|
echo "[2/5] Validating configuration..."
|
|
if [[ ! -f "${AGENT_DIR}/config/agent.json" ]]; then
|
|
echo "ERROR: agent.json not found"
|
|
exit 1
|
|
fi
|
|
|
|
AGENT_ID=$(python3 -c "import json; print(json.load(open('${AGENT_DIR}/config/agent.json'))['agent_id'])")
|
|
AGENT_TIER=$(python3 -c "import json; print(json.load(open('${AGENT_DIR}/config/agent.json'))['tier'])")
|
|
echo " Agent ID: ${AGENT_ID}"
|
|
echo " Tier: ${AGENT_TIER}"
|
|
|
|
# Check Python dependencies
|
|
echo "[3/5] Checking Python dependencies..."
|
|
python3 -c "import sqlite3; import subprocess; import json; print(' Core modules: OK')"
|
|
python3 -c "import redis; print(' Redis module: OK')" 2>/dev/null || echo " Redis module: NOT INSTALLED (optional)"
|
|
|
|
# Check governance ledger
|
|
echo "[4/5] Checking governance ledger..."
|
|
LEDGER_DB="/opt/agent-governance/ledger/governance.db"
|
|
if [[ -f "${LEDGER_DB}" ]]; then
|
|
echo " Ledger database: OK"
|
|
else
|
|
echo " Ledger database: NOT FOUND"
|
|
fi
|
|
|
|
# Test agent import
|
|
echo "[5/5] Testing agent import..."
|
|
cd "${AGENT_DIR}"
|
|
python3 -c "import agent; print(' Agent module: OK')"
|
|
|
|
echo ""
|
|
echo "========================================"
|
|
echo "Bootstrap Complete"
|
|
echo "========================================"
|
|
echo ""
|
|
echo "Run the agent:"
|
|
echo " ./run-agent.sh status"
|
|
echo " ./run-agent.sh exec 'echo hello'"
|
|
echo " ./run-agent.sh test-forbidden"
|
|
echo ""
|