# Build all packages
cargo build --workspace --release
# Run all tests
cargo test --workspace
# Run benchmarks
cargo test --package benchmarks --release
# Run specific example
cargo run --package leanr-rag-gateway --example demo# Run RAG gateway tests
cargo test --package leanr-rag-gateway
# Run with specific policy tests
cargo test --package leanr-rag-gateway policy# Compile finance example
rustc examples/finance/verified_finance_agent.rs --edition 2021
# Run finance tests (when integrated)
cargo test finance# Compile memory copilot
rustc examples/memory-copilot/explainable_memory.rs --edition 2021
# Test recall precision
cargo test memory --test recall_precision# Compile trading example
rustc examples/trading/risk_bounded_trading.rs --edition 2021
# Test risk proofs
cargo test trading --test risk_proofs# Compile grid operator
rustc examples/grid-operator/safety_bounded_grid.rs --edition 2021
# Test safety proofs
cargo test grid --test safety_proofs- Agent spawn: <1ms (P99)
- Message throughput: 100K msg/s
- Coordination overhead: <10ms (P99)
- Incremental compile: <100ms
- Cache hit rate: >80%
- Type checking: <50ms (typical)
- Ledger verification: <10% overhead
- Policy verification: <5% overhead
- Proof verification: Zero GC impact
- Task cost: $0.10-$1.00 per 1K tasks
- Spot savings: 40-70% vs on-demand
- Recovery time: <5min
- Availability: >95%
// Agent coordination
agent_spawn_latency_ms
message_throughput_per_sec
coordination_overhead_ms
// Compilation
compilation_time_ms
cache_hit_rate_percent
typecheck_time_ms
// Verification
ledger_verification_overhead_percent
policy_check_latency_ms
proof_generation_time_ms
// Cost
task_cost_usd
spot_instance_usage_percent
total_compute_cost_usd
// Resilience
recovery_time_seconds
availability_percent
error_rate# System health
cargo check --workspace
# Test health
cargo test --workspace --no-fail-fast
# Benchmark health
cargo test --package benchmarks --releaseSymptom: P99 latency exceeds targets
Diagnosis:
cargo test --package benchmarks coordination::bench_agent_spawn
cargo test --package benchmarks coordination::bench_message_passingSolutions:
- Check for GC pressure
- Verify WASM optimizations enabled
- Review coordination topology
- Check network latency
Symptom: Cache hit rate <80%
Diagnosis:
cargo test --package benchmarks compilation::bench_incremental_compileSolutions:
- Review module dependencies
- Increase cache size
- Check for cache invalidation bugs
- Profile hot paths
Symptom: Verification overhead >10%
Diagnosis:
cargo test --package benchmarks verification::bench_ledger_verification
cargo test --package benchmarks verification::bench_policy_verificationSolutions:
- Optimize proof generation
- Cache verification results
- Batch verification operations
- Review proof complexity
Symptom: Task cost >$1.00 per 1K
Diagnosis:
cargo test --package benchmarks cost::bench_task_cost
cargo test --package benchmarks cost::bench_spot_savingsSolutions:
- Increase spot instance usage
- Optimize resource allocation
- Review task batching
- Check for resource leaks
Symptom: Recovery time >5min
Diagnosis:
cargo test --package benchmarks chaos::bench_recovery_time
cargo test --package benchmarks chaos::bench_network_partitionSolutions:
- Review failover logic
- Check quorum configuration
- Optimize state restoration
- Verify health check intervals
- All tests passing
- Benchmarks meet targets
- Coverage >80%
- No critical security issues
- Documentation updated
- Changelog updated
-
Build Release
cargo build --workspace --release
-
Run Full Test Suite
cargo test --workspace --release -
Run Benchmarks
cargo test --package benchmarks --release -
Verify Targets
# Check all targets pass cargo test --package benchmarks --release -- --nocapture | grep "PASS"
-
Deploy
# Deploy to staging first ./deploy.sh staging # Smoke tests ./smoke-tests.sh staging # Deploy to production ./deploy.sh production
- Monitor key metrics for 15 minutes
- Check error rates
- Verify performance targets
- Review audit logs
- Confirm cost tracking
If issues detected:
-
Immediate Rollback
./rollback.sh production
-
Verify Rollback
./smoke-tests.sh production
-
Investigate
# Review logs tail -f logs/production.log # Check metrics cargo test --package benchmarks --release
-
Fix and Redeploy
- Fix issue
- Run full test suite
- Redeploy following normal procedure
- Monitor error rates
- Check performance metrics
- Review audit logs
- Verify cost tracking
- Run full benchmark suite
- Review test coverage
- Check for dependency updates
- Audit security
- Chaos engineering tests
- Performance regression analysis
- Cost optimization review
- Documentation updates
-
Assess
./health-check.sh
-
Emergency Stop
./emergency-stop.sh
-
Restore
./restore-from-backup.sh <timestamp>
-
Verify
./smoke-tests.sh production
-
Isolate
./isolate-affected-systems.sh
-
Audit
cargo test --package leanr-rag-gateway audit -
Review Logs
./export-audit-logs.sh <start-time> <end-time>
-
Remediate
- Patch vulnerabilities
- Rotate credentials
- Update policies
- Redeploy
-
Stop Writes
./pause-writes.sh
-
Verify Integrity
cargo test --package benchmarks verification::bench_ledger_verification -
Restore
./restore-clean-state.sh <backup-id>
-
Verify
cargo test --workspace
# CPU profiling
cargo flamegraph --test benchmark_suite
# Memory profiling
cargo instruments --template Allocations
# Benchmarking
cargo bench --package benchmarks- Enable LTO in release builds
- Use profile-guided optimization (PGO)
- Optimize hot paths
- Reduce allocations
- Cache expensive operations
- Use SIMD where applicable
- Minimize GC pressure
- Batch operations
- On-Call: See PagerDuty rotation
- Slack: #lean-agentic-alerts
- Email: ops@lean-agentic.dev
- Documentation: /workspaces/lean-agentic/docs/
# Quick health check
cargo check --workspace && cargo test --workspace
# Full benchmark suite
cargo test --package benchmarks --release -- --nocapture
# Specific benchmark category
cargo test --package benchmarks coordination --release
# Coverage report
cargo tarpaulin --workspace --out Html
# Security audit
cargo audit
# Dependency tree
cargo tree
# Clean build
cargo clean && cargo build --workspace --release- Application logs:
/var/log/lean-agentic/app.log - Audit logs:
/var/log/lean-agentic/audit.log - Performance logs:
/var/log/lean-agentic/perf.log - Error logs:
/var/log/lean-agentic/error.log
- Production:
config/production.toml - Staging:
config/staging.toml - Development:
config/development.toml
Last Updated: 2025-10-25 Version: 1.0.0 Status: Production Ready ✅