#!/bin/bash # ============================================================================= # SentryAgent.ai — Start V&V Architect (Lead Validator) # ============================================================================= # Launches an independent Claude Code instance as the Lead Validator. # This agent verifies the CTO's work against the PRD/OpenSpec. # # Usage: # ./scripts/start-validator.sh # ============================================================================= set -e PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" VALIDATOR_WORKSPACE="$PROJECT_ROOT/.validator-workspace" VALIDATOR_PROMPT="$PROJECT_ROOT/VALIDATOR.md" echo "==============================================" echo " SentryAgent.ai — Starting V&V Architect Agent" echo "==============================================" echo "" echo " Project: $PROJECT_ROOT" echo " Workspace: $VALIDATOR_WORKSPACE" echo " Role Config: $VALIDATOR_PROMPT" echo "" echo " The V&V Architect will:" echo " 1. Audit Code against OpenSpec PRD" echo " 2. Enforce DRY Principles" echo " 3. Log Issues for CTO Resolution" echo " 4. Maintain Local Fail-Safe Ledger" echo "" echo "==============================================" # Ensure the Validator Workspace and Local Ledger exist mkdir -p "$VALIDATOR_WORKSPACE/.openspec/vv_audit" # Verify the Validator Persona file exists (from Part 1 of instructions) if [ ! -f "$VALIDATOR_PROMPT" ]; then echo "ERROR: VALIDATOR.md not found at $VALIDATOR_PROMPT" echo "Please ensure you have created the System Instruction file." exit 1 fi # Synchronize the latest CLAUDE.md to the validator workspace if needed if [ -f "$PROJECT_ROOT/CLAUDE.md" ]; then cp "$PROJECT_ROOT/CLAUDE.md" "$VALIDATOR_WORKSPACE/CLAUDE.md" fi # Launch Claude Code as an independent Auditor cd "$VALIDATOR_WORKSPACE" exec claude --system-prompt-file "$VALIDATOR_PROMPT"