Major WHOOSH system refactoring and feature enhancements

- Migrated from HIVE branding to WHOOSH across all components
- Enhanced backend API with new services: AI models, BZZZ integration, templates, members
- Added comprehensive testing suite with security, performance, and integration tests
- Improved frontend with new components for project setup, AI models, and team management
- Updated MCP server implementation with WHOOSH-specific tools and resources
- Enhanced deployment configurations with production-ready Docker setups
- Added comprehensive documentation and setup guides
- Implemented age encryption service and UCXL integration

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
anthonyrawlins
2025-08-27 08:34:48 +10:00
parent 0e9844ef13
commit 268214d971
399 changed files with 57390 additions and 2045 deletions

View File

@@ -1,5 +1,5 @@
-- Hive Complete Database Schema
-- This file creates the entire Hive database schema from scratch
-- WHOOSH Complete Database Schema
-- This file creates the entire WHOOSH database schema from scratch
-- Includes all unified authentication features and complete platform functionality
-- Version: 2.0 (Unified Auth + Complete Platform)
@@ -107,7 +107,7 @@ CREATE TABLE token_blacklist (
-- AGENT MANAGEMENT
-- =============================================================================
-- AI Agents in the Hive cluster
-- AI Agents in the WHOOSH cluster
CREATE TABLE agents (
id VARCHAR(255) PRIMARY KEY, -- Custom agent IDs (e.g., "walnut-codellama", "oak-gemini")
name VARCHAR(255) NOT NULL,
@@ -203,7 +203,7 @@ CREATE TABLE projects (
id SERIAL PRIMARY KEY,
name VARCHAR(255) UNIQUE NOT NULL,
description TEXT,
status VARCHAR(50) DEFAULT 'active', -- active, completed, archived
status VARCHAR(50) DEFAULT 'active', -- active, completed, arcwhooshd
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
@@ -325,10 +325,10 @@ INSERT INTO users (
is_superuser,
is_verified
) VALUES (
'admin@hive.local',
'admin@whoosh.local',
'admin',
'$2b$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/lewohT6ZErjH.2T.2',
'Hive Administrator',
'WHOOSH Administrator',
'admin',
TRUE,
TRUE,
@@ -346,10 +346,10 @@ INSERT INTO users (
is_active,
is_verified
) VALUES (
'developer@hive.local',
'developer@whoosh.local',
'developer',
'$2b$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/lewohT6ZErjH.2T.2',
'Hive Developer',
'WHOOSH Developer',
'developer',
TRUE,
TRUE

View File

@@ -1,5 +1,5 @@
-- Hive Unified Database Schema
-- WHOOSH Unified Database Schema
-- User Management
CREATE TABLE users (
@@ -158,10 +158,10 @@ CREATE TABLE token_blacklist (
-- Sample data
INSERT INTO users (email, hashed_password, role) VALUES
('admin@hive.local', '$2b$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/lewohT6ZErjH.2T.2', 'admin'),
('developer@hive.local', '$2b$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/lewohT6ZErjH.2T.2', 'developer');
('admin@whoosh.local', '$2b$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/lewohT6ZErjH.2T.2', 'admin'),
('developer@whoosh.local', '$2b$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/lewohT6ZErjH.2T.2', 'developer');
-- Sample project data
INSERT INTO projects (name, description, status, github_repo, git_url, git_owner, git_repository, git_branch, bzzz_enabled, ready_to_claim, private_repo, github_token_required) VALUES
('hive', 'Distributed task coordination system with AI agents', 'active', 'anthonyrawlins/hive', 'https://github.com/anthonyrawlins/hive.git', 'anthonyrawlins', 'hive', 'main', true, true, false, false),
('whoosh', 'Distributed task coordination system with AI agents', 'active', 'anthonyrawlins/whoosh', 'https://github.com/anthonyrawlins/whoosh.git', 'anthonyrawlins', 'whoosh', 'main', true, true, false, false),
('bzzz', 'P2P collaborative development coordination system', 'active', 'anthonyrawlins/bzzz', 'https://github.com/anthonyrawlins/bzzz.git', 'anthonyrawlins', 'bzzz', 'main', true, true, false, false);

View File

@@ -110,8 +110,8 @@ COMMENT ON COLUMN agent_permissions.directory_patterns IS 'Comma-separated list
COMMENT ON COLUMN agent_permissions.context_weight IS 'Weight for context relevance calculation (0.1 to 2.0)';
-- Grant permissions (adjust as needed for your setup)
-- GRANT SELECT, INSERT, UPDATE ON context_feedback TO hive_user;
-- GRANT SELECT, INSERT, UPDATE ON agent_permissions TO hive_user;
-- GRANT SELECT, INSERT ON promotion_rule_history TO hive_user;
-- GRANT SELECT, INSERT, UPDATE ON context_feedback TO whoosh_user;
-- GRANT SELECT, INSERT, UPDATE ON agent_permissions TO whoosh_user;
-- GRANT SELECT, INSERT ON promotion_rule_history TO whoosh_user;
COMMIT;

View File

@@ -34,13 +34,13 @@ INSERT INTO projects (
auto_assignment
) VALUES
(
'hive-gitea',
'whoosh-gitea',
'Distributed task coordination system with AI agents (Gitea)',
'active',
'tony/hive',
'ssh://git@192.168.1.113:2222/tony/hive.git',
'tony/whoosh',
'ssh://git@192.168.1.113:2222/tony/whoosh.git',
'tony',
'hive',
'whoosh',
'master',
true,
true,

View File

@@ -1,5 +1,5 @@
-- Cluster Registration Migration
-- Implements the registration-based cluster architecture for Hive-Bzzz integration
-- Implements the registration-based cluster architecture for WHOOSH-Bzzz integration
-- Version: 1.0
-- Date: 2025-07-31
@@ -196,7 +196,7 @@ $$ LANGUAGE plpgsql;
-- Insert development cluster token
INSERT INTO cluster_tokens (token, description, created_by)
VALUES (
'hive_dev_cluster_token_12345678901234567890123456789012',
'whoosh_dev_cluster_token_12345678901234567890123456789012',
'Development cluster token for testing',
(SELECT id FROM users WHERE username = 'admin' LIMIT 1)
) ON CONFLICT (token) DO NOTHING;
@@ -204,7 +204,7 @@ VALUES (
-- Insert production cluster token (should be changed in production)
INSERT INTO cluster_tokens (token, description, created_by, expires_at)
VALUES (
'hive_prod_cluster_token_98765432109876543210987654321098',
'whoosh_prod_cluster_token_98765432109876543210987654321098',
'Production cluster token - CHANGE THIS IN PRODUCTION',
(SELECT id FROM users WHERE username = 'admin' LIMIT 1),
NOW() + INTERVAL '1 year'
@@ -214,12 +214,12 @@ VALUES (
-- COMMENTS AND DOCUMENTATION
-- =============================================================================
COMMENT ON TABLE cluster_tokens IS 'Registration tokens for cluster nodes to join the Hive cluster';
COMMENT ON TABLE cluster_tokens IS 'Registration tokens for cluster nodes to join the WHOOSH cluster';
COMMENT ON TABLE cluster_nodes IS 'Dynamically registered cluster nodes with hardware and capability information';
COMMENT ON TABLE node_heartbeats IS 'Heartbeat history for performance monitoring and status tracking';
COMMENT ON TABLE node_registration_attempts IS 'Security log of all node registration attempts';
COMMENT ON COLUMN cluster_tokens.token IS 'Unique token for node registration, format: hive_[env]_cluster_token_[random]';
COMMENT ON COLUMN cluster_tokens.token IS 'Unique token for node registration, format: whoosh_[env]_cluster_token_[random]';
COMMENT ON COLUMN cluster_tokens.max_registrations IS 'Maximum number of nodes that can use this token (NULL = unlimited)';
COMMENT ON COLUMN cluster_tokens.allowed_ip_ranges IS 'CIDR ranges that can use this token (NULL = any IP)';
@@ -234,8 +234,8 @@ COMMENT ON COLUMN cluster_nodes.capabilities IS 'Node capabilities: {"models": [
DO $$
BEGIN
RAISE NOTICE 'Cluster registration migration completed successfully!';
RAISE NOTICE 'Development token: hive_dev_cluster_token_12345678901234567890123456789012';
RAISE NOTICE 'Production token: hive_prod_cluster_token_98765432109876543210987654321098';
RAISE NOTICE 'Development token: whoosh_dev_cluster_token_12345678901234567890123456789012';
RAISE NOTICE 'Production token: whoosh_prod_cluster_token_98765432109876543210987654321098';
RAISE NOTICE 'SECURITY WARNING: Change production tokens before deployment!';
END
$$;

View File

@@ -1,6 +1,6 @@
# Hive Database Schema Management
# WHOOSH Database Schema Management
This directory contains database schema files and migration scripts for the Hive platform.
This directory contains database schema files and migration scripts for the WHOOSH platform.
## Files Overview
@@ -50,7 +50,7 @@ The `000_complete_schema.sql` file contains the **complete, unified database sch
```bash
# From the backend directory
cd /path/to/hive/backend
cd /path/to/whoosh/backend
./scripts/rebuild_database.sh
```
@@ -66,9 +66,9 @@ This script:
# Set environment variables if needed
export DB_HOST=localhost
export DB_PORT=5432
export DB_NAME=hive
export DB_NAME=whoosh
export DB_USER=postgres
export DB_PASSWORD=hive123
export DB_PASSWORD=whoosh123
# Run the Python script
python scripts/rebuild_database.py
@@ -78,7 +78,7 @@ python scripts/rebuild_database.py
```bash
# Connect to PostgreSQL and execute directly
psql -h localhost -U postgres -d hive -f migrations/000_complete_schema.sql
psql -h localhost -U postgres -d whoosh -f migrations/000_complete_schema.sql
```
## Default Users
@@ -87,8 +87,8 @@ After rebuild, the database will contain:
| Email | Username | Password | Role | Permissions |
|-------|----------|----------|------|-------------|
| admin@hive.local | admin | admin123 | admin | Superuser, Active, Verified |
| developer@hive.local | developer | dev123 | developer | Active, Verified |
| admin@whoosh.local | admin | admin123 | admin | Superuser, Active, Verified |
| developer@whoosh.local | developer | dev123 | developer | Active, Verified |
**⚠️ SECURITY: Change these default passwords immediately in production!**
@@ -101,7 +101,7 @@ After rebuild, the database will contain:
### Complete Authentication
- Password hashing with bcrypt
- API key generation with prefixes (hive_xxx)
- API key generation with prefixes (whoosh_xxx)
- JWT token management with refresh and blacklisting
- Scoped permissions for fine-grained access control
@@ -157,4 +157,4 @@ After successful database rebuild:
4. **Create initial workflows**
5. **Set up monitoring dashboards**
The unified schema provides a solid foundation for the complete Hive platform with authentication, agent management, and workflow orchestration.
The unified schema provides a solid foundation for the complete WHOOSH platform with authentication, agent management, and workflow orchestration.