init: vaultmesh mcp server
This commit is contained in:
128
Makefile
Normal file
128
Makefile
Normal file
@@ -0,0 +1,128 @@
|
||||
# VaultMesh Cognitive Integration - Makefile
|
||||
# Claude as the 7th Organ of VaultMesh
|
||||
|
||||
.PHONY: all install dev test lint clean build server help
|
||||
|
||||
# Default target
|
||||
all: install test
|
||||
|
||||
# Install production dependencies
|
||||
install:
|
||||
@echo "🔧 Installing VaultMesh Cognitive..."
|
||||
pip install -e .
|
||||
@echo "✅ Installation complete"
|
||||
|
||||
# Install with development dependencies
|
||||
dev:
|
||||
@echo "🔧 Installing VaultMesh Cognitive (dev mode)..."
|
||||
pip install -e ".[dev]"
|
||||
@echo "✅ Development installation complete"
|
||||
|
||||
# Run governance tests
|
||||
test:
|
||||
@echo "🧪 Running governance tests..."
|
||||
pytest tests/governance/ -v --tb=short
|
||||
@echo "✅ All tests passed"
|
||||
|
||||
# Run constitution hash verification
|
||||
verify-constitution:
|
||||
@echo "📜 Verifying constitution hash..."
|
||||
@python -c "\
|
||||
import blake3; \
|
||||
from pathlib import Path; \
|
||||
content = Path('docs/MCP-CONSTITUTION.md').read_text(); \
|
||||
lines = content.split('\n'); \
|
||||
lock = dict(l.split('=', 1) for l in Path('governance/constitution.lock').read_text().split('\n') if '=' in l and not l.startswith('#')); \
|
||||
hash_lines = int(lock.get('hash_lines', 288)); \
|
||||
computed = f'blake3:{blake3.blake3(chr(10).join(lines[:hash_lines]).encode()).hexdigest()}'; \
|
||||
print(f'Computed: {computed}'); \
|
||||
print(f'Locked: {lock[\"hash\"]}'); \
|
||||
exit(0 if computed == lock['hash'] else 1)"
|
||||
@echo "✅ Constitution verified"
|
||||
|
||||
# Run golden drill
|
||||
drill:
|
||||
@echo "🔥 Running Golden Drill Mini..."
|
||||
pytest tests/governance/test_golden_drill_mini.py -v --timeout=30
|
||||
@echo "✅ Drill complete"
|
||||
|
||||
# Run linter
|
||||
lint:
|
||||
@echo "🔍 Running linter..."
|
||||
ruff check packages/ tests/
|
||||
@echo "✅ Linting passed"
|
||||
|
||||
# Format code
|
||||
format:
|
||||
@echo "✨ Formatting code..."
|
||||
ruff format packages/ tests/
|
||||
@echo "✅ Formatting complete"
|
||||
|
||||
# Start MCP server (stdio mode)
|
||||
server:
|
||||
@echo "🚀 Starting VaultMesh MCP Server..."
|
||||
python -m vaultmesh_mcp.server
|
||||
|
||||
# Test tool standalone
|
||||
tool:
|
||||
@echo "🔧 Running tool: $(TOOL)"
|
||||
python -m vaultmesh_mcp.server $(TOOL) '$(ARGS)'
|
||||
|
||||
# Build package
|
||||
build:
|
||||
@echo "📦 Building package..."
|
||||
pip install build
|
||||
python -m build
|
||||
@echo "✅ Build complete"
|
||||
|
||||
# Clean build artifacts
|
||||
clean:
|
||||
@echo "🧹 Cleaning..."
|
||||
rm -rf dist/ build/ *.egg-info/ .pytest_cache/ .ruff_cache/
|
||||
rm -rf packages/*.egg-info/
|
||||
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
|
||||
@echo "✅ Clean complete"
|
||||
|
||||
# Initialize receipt directories
|
||||
init-receipts:
|
||||
@echo "📁 Initializing receipt directories..."
|
||||
mkdir -p receipts/{cognitive,identity,guardian,mesh,treasury,drills,compliance,offsec,observability,automation,psi}
|
||||
mkdir -p realms/cognitive/memory
|
||||
@echo "✅ Directories created"
|
||||
|
||||
# Show guardian status
|
||||
status:
|
||||
@python -m vaultmesh_mcp.server guardian_status '{}'
|
||||
|
||||
# Show cognitive context
|
||||
context:
|
||||
@python -m vaultmesh_mcp.server cognitive_context '{"include": ["health", "receipts"]}'
|
||||
|
||||
# Help
|
||||
help:
|
||||
@echo "VaultMesh Cognitive Integration"
|
||||
@echo ""
|
||||
@echo "Usage: make <target>"
|
||||
@echo ""
|
||||
@echo "Targets:"
|
||||
@echo " all Install and run tests (default)"
|
||||
@echo " install Install production dependencies"
|
||||
@echo " dev Install with dev dependencies"
|
||||
@echo " test Run governance tests"
|
||||
@echo " verify-constitution Verify constitution hash"
|
||||
@echo " drill Run Golden Drill Mini"
|
||||
@echo " lint Run linter"
|
||||
@echo " format Format code"
|
||||
@echo " server Start MCP server"
|
||||
@echo " tool TOOL=x ARGS=y Test tool standalone"
|
||||
@echo " build Build package"
|
||||
@echo " clean Clean build artifacts"
|
||||
@echo " init-receipts Initialize receipt directories"
|
||||
@echo " status Show guardian status"
|
||||
@echo " context Show cognitive context"
|
||||
@echo " help Show this help"
|
||||
@echo ""
|
||||
@echo "Examples:"
|
||||
@echo " make dev # Install dev dependencies"
|
||||
@echo " make test # Run all tests"
|
||||
@echo " make tool TOOL=guardian_status ARGS={} # Test guardian_status"
|
||||
Reference in New Issue
Block a user