mirror of
https://github.com/ruvnet/RuVector.git
synced 2026-05-23 04:27:11 +00:00
This commit addresses GitHub issue #17 by implementing comprehensive forgetting mitigation for continual learning in the GNN module. ## New Features ### Optimizer Implementation (training.rs) - Full Adam optimizer with bias-corrected first and second moments - SGD with momentum support - Lazy initialization of state buffers for efficiency ### Replay Buffer (replay.rs) - Experience replay with reservoir sampling for uniform distribution - Distribution shift detection with statistical tracking - Configurable capacity and batch sampling ### Elastic Weight Consolidation (ewc.rs) - Fisher information diagonal computation - Anchor weight consolidation for task boundaries - EWC penalty and gradient computation ### Learning Rate Scheduling (scheduler.rs) - Constant, StepDecay, Exponential schedulers - CosineAnnealing with warm restarts - WarmupLinear for pre-training warmup - ReduceOnPlateau for adaptive learning ## Deployment Infrastructure ### GitHub Actions Release Pipeline (.github/workflows/release.yml) - 8-stage CI/CD pipeline for complete releases - Validates, builds crates, WASM, and native modules - Publishes to crates.io and npmjs.com - Creates GitHub releases with artifacts ### Deployment Script (scripts/deploy.sh) - Comprehensive deployment orchestration - Version synchronization across Cargo.toml and package.json - Dry-run mode for testing - Cross-platform native builds support ## Test Coverage - 177 tests passing in ruvector-gnn - Comprehensive tests for all new modules - Convergence tests for optimizers 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
3.3 KiB
3.3 KiB
Quick Deployment Guide
This is a condensed quick-reference guide. For full documentation, see DEPLOYMENT.md.
Prerequisites Checklist
- Rust toolchain installed (
rustc,cargo) - Node.js v18+ and npm installed
wasm-packinstalledjqinstalled- crates.io API token obtained
- NPM authentication token obtained
5-Minute Setup
# 1. Install missing tools (if needed)
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
sudo apt-get install jq # or: brew install jq
# 2. Set credentials
export CRATES_API_KEY="your-crates-io-token"
export NPM_TOKEN="your-npm-token"
# 3. Test deployment script
./scripts/test-deploy.sh
# 4. Dry run
./scripts/deploy.sh --dry-run
# 5. Deploy!
./scripts/deploy.sh
Common Commands
# Full deployment
./scripts/deploy.sh
# Dry run (no publishing)
./scripts/deploy.sh --dry-run
# Skip tests (faster, but risky)
./scripts/deploy.sh --skip-tests
# Publish only to crates.io
./scripts/deploy.sh --skip-npm
# Publish only to npm
./scripts/deploy.sh --skip-crates
# Set explicit version
./scripts/deploy.sh --version 0.2.0
# Help
./scripts/deploy.sh --help
Quick Troubleshooting
| Problem | Solution |
|---|---|
| Tests failing | cargo test --all --verbose to see details |
| Clippy errors | cargo clippy --all-targets --fix |
| Format issues | cargo fmt --all |
| Missing tools | Check Prerequisites section above |
| WASM build fails | curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh |
| Already published | Bump version in Cargo.toml |
Publishing Workflow
graph TD
A[Start] --> B[Check Prerequisites]
B --> C[Get Workspace Version]
C --> D[Sync All Package Versions]
D --> E{Run Tests?}
E -->|Yes| F[cargo test --all]
E -->|Skip| G
F --> G[Run Clippy]
G --> H[Check Formatting]
H --> I[Build WASM Packages]
I --> J{Publish Crates?}
J -->|Yes| K[Publish to crates.io]
J -->|Skip| L
K --> L{Publish NPM?}
L -->|Yes| M[Build Native Modules]
M --> N[Publish to npm]
L -->|Skip| O
N --> O[Trigger GitHub Actions]
O --> P[Done!]
Environment Variables
# Required for crate publishing
export CRATES_API_KEY="your-token"
# Required for npm publishing
export NPM_TOKEN="your-token"
# Optional for GitHub Actions trigger
export GITHUB_TOKEN="your-token"
Security Warning
NEVER commit these to git:
- API tokens
- NPM tokens
- GitHub tokens
.envfiles with credentials
What Gets Published
crates.io (29 crates)
ruvector-core,ruvector-graph,ruvector-gnnruvector-cluster,ruvector-raft,ruvector-replicationruvector-node,ruvector-wasm, and 21 more...
npm (8 packages)
@ruvector/node@ruvector/wasm@ruvector/gnn@ruvector/gnn-wasm@ruvector/graph-node@ruvector/graph-wasm@ruvector/tiny-dancer@ruvector/tiny-dancer-wasm
Logs
Deployment logs: logs/deployment/deploy-YYYYMMDD-HHMMSS.log
# View latest log
ls -t logs/deployment/*.log | head -1 | xargs cat
# Follow live log
tail -f logs/deployment/deploy-*.log
Getting Help
- Full docs: DEPLOYMENT.md
- Script help:
./scripts/deploy.sh --help - Test script:
./scripts/test-deploy.sh - Issues: https://github.com/ruvnet/ruvector/issues