ruvector/scripts/README.md
rUv de9aa2ea5a feat: Implement GNN forgetting mitigation (#17)
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>
2025-11-26 23:17:07 +00:00

2.4 KiB

RuVector Automation Scripts

This directory contains automation scripts to streamline development, deployment, and prevent common issues.

📜 Available Scripts

🚀 deploy.sh

Comprehensive deployment script for publishing to crates.io and npm.

Handles:

  • Version management and synchronization
  • Pre-deployment checks (tests, linting, formatting)
  • WASM package builds
  • Crate publishing to crates.io
  • NPM package publishing
  • GitHub Actions trigger for cross-platform builds

Usage:

# Full deployment
./scripts/deploy.sh

# Dry run (test without publishing)
./scripts/deploy.sh --dry-run

# See all options
./scripts/deploy.sh --help

See: DEPLOYMENT.md for complete documentation

🧪 test-deploy.sh

Tests the deployment script without publishing.

Usage: ./scripts/test-deploy.sh

🔄 sync-lockfile.sh

Automatically syncs package-lock.json with package.json changes.

Usage: ./scripts/sync-lockfile.sh

🪝 install-hooks.sh

Installs git hooks for automatic lock file management.

Usage: ./scripts/install-hooks.sh

🤖 ci-sync-lockfile.sh

CI/CD script for automatic lock file fixing.

Usage: ./scripts/ci-sync-lockfile.sh

📦 publish-crates.sh

Legacy script for publishing individual crates. Use deploy.sh instead.

🧭 validate-packages.sh

Validates package configurations and dependencies.

🚀 Quick Start

For Development

  1. Install git hooks (recommended):

    ./scripts/install-hooks.sh
    
  2. Test the hook:

    cd npm/packages/ruvector
    npm install chalk
    git add package.json
    git commit -m "test: Add chalk dependency"
    # Hook automatically updates lock file
    

For Deployment

  1. Test deployment script:

    ./scripts/test-deploy.sh
    
  2. Set credentials (required):

    export CRATES_API_KEY="your-crates-io-token"
    export NPM_TOKEN="your-npm-token"
    
  3. Run dry run (recommended first):

    ./scripts/deploy.sh --dry-run
    
  4. Deploy:

    ./scripts/deploy.sh
    

📖 Documentation

🔐 Security

Never commit credentials! Always use environment variables or secure credential storage.

See DEPLOYMENT.md#security-best-practices for details.