mirror of
https://github.com/blackboxprogramming/BlackRoad-Operating-System.git
synced 2026-03-17 04:57:15 -05:00
This commit introduces a comprehensive infrastructure overhaul that transforms
BlackRoad OS into a true distributed operating system with unified kernel,
DNS-aware service discovery, and standardized syscall APIs.
## New Infrastructure Components
### 1. Kernel Module (kernel/typescript/)
- Complete TypeScript kernel implementation for all services
- Service registry with production and dev DNS mappings
- RPC client for inter-service communication
- Event bus, job queue, state management
- Structured logging with log levels
- Full type safety with TypeScript
Modules:
- types.ts: Complete type definitions
- serviceRegistry.ts: DNS-aware service discovery
- identity.ts: Service identity and metadata
- config.ts: Environment-aware configuration
- logger.ts: Structured logging
- rpc.ts: Inter-service RPC client
- events.ts: Event bus (pub/sub)
- jobs.ts: Background job queue
- state.ts: Key-value state management
- index.ts: Main exports
### 2. DNS Infrastructure Documentation (infra/DNS.md)
- Complete Cloudflare DNS mapping
- Railway production and dev endpoints
- Email configuration (MX, SPF, DKIM, DMARC)
- SSL/TLS, security, and monitoring settings
- Service-to-domain mapping
- Health check configuration
Production Services:
- operator.blackroad.systems
- core.blackroad.systems
- api.blackroad.systems
- console.blackroad.systems
- docs.blackroad.systems
- web.blackroad.systems
- os.blackroad.systems
- app.blackroad.systems
### 3. Service Registry & Architecture (INFRASTRUCTURE.md)
- Canonical service registry with all endpoints
- Monorepo-to-satellite deployment model
- Service-as-process architecture
- DNS-as-filesystem model
- Inter-service communication patterns
- Service lifecycle management
- Complete environment variable documentation
### 4. Syscall API Specification (SYSCALL_API.md)
- Standard kernel API for all services
- Required syscalls: health, version, identity, RPC
- Optional syscalls: logging, metrics, events, jobs, state
- Complete API documentation with examples
- Express.js implementation guide
Core Endpoints:
- GET /health
- GET /version
- GET /v1/sys/identity
- GET /v1/sys/health
- POST /v1/sys/rpc
- POST /v1/sys/event
- POST /v1/sys/job
- GET/PUT /v1/sys/state
### 5. Railway Deployment Guide (docs/RAILWAY_DEPLOYMENT.md)
- Step-by-step deployment instructions
- Environment variable configuration
- Monitoring and health checks
- Troubleshooting guide
- Best practices for Railway deployment
### 6. Atlas Kernel Scaffold Prompt (prompts/atlas/ATLAS_KERNEL_SCAFFOLD.md)
- Complete prompt for generating new services
- Auto-generates full kernel implementation
- Includes all DNS and Railway mappings
- Production-ready output with zero TODOs
### 7. GitHub Workflow Templates (templates/github-workflows/)
- deploy.yml: Railway auto-deployment
- test.yml: Test suite with coverage
- validate-kernel.yml: Kernel validation
- README.md: Template documentation
## Updated Files
### CLAUDE.md
- Added "Kernel Architecture & DNS Infrastructure" section
- Updated Table of Contents
- Added service architecture diagram
- Documented all new infrastructure files
- Updated repository structure with new directories
- Added kernel and infrastructure to critical path files
## Architecture Impact
This update establishes BlackRoad OS as a distributed operating system where:
- Each Railway service = OS process
- Each Cloudflare domain = mount point
- All services communicate via syscalls
- Unified kernel ensures interoperability
- DNS-aware service discovery
- Production and development environments
## Service Discovery
Services can now discover and call each other:
```typescript
import { rpc } from './kernel';
const user = await rpc.call('core', 'getUserById', { id: 123 });
```
## DNS Mappings
Production:
- operator.blackroad.systems → blackroad-os-operator-production-3983.up.railway.app
- core.blackroad.systems → 9gw4d0h2.up.railway.app
- api.blackroad.systems → ac7bx15h.up.railway.app
Internal (Railway):
- blackroad-os-operator.railway.internal:8001
- blackroad-os-core.railway.internal:8000
- blackroad-os-api.railway.internal:8000
## Next Steps
1. Sync kernel to satellite repos
2. Implement syscall endpoints in all services
3. Update services to use RPC for inter-service calls
4. Configure Cloudflare health checks
5. Deploy updated services to Railway
---
Files Added:
- INFRASTRUCTURE.md
- SYSCALL_API.md
- infra/DNS.md
- docs/RAILWAY_DEPLOYMENT.md
- kernel/typescript/* (9 modules + README)
- prompts/atlas/ATLAS_KERNEL_SCAFFOLD.md
- templates/github-workflows/* (4 files)
Files Modified:
- CLAUDE.md
Total: 22 new files, 1 updated file
164 lines
4.5 KiB
YAML
164 lines
4.5 KiB
YAML
# BlackRoad OS - Kernel Validation Workflow
|
||
#
|
||
# This workflow validates that the service correctly implements the BlackRoad OS kernel.
|
||
# Copy this file to .github/workflows/validate-kernel.yml in your satellite repo.
|
||
#
|
||
# Usage:
|
||
# 1. Copy to .github/workflows/validate-kernel.yml
|
||
|
||
name: Validate Kernel Implementation
|
||
|
||
on:
|
||
push:
|
||
branches:
|
||
- main
|
||
- develop
|
||
pull_request:
|
||
branches:
|
||
- main
|
||
|
||
jobs:
|
||
validate-kernel:
|
||
name: Validate Kernel
|
||
runs-on: ubuntu-latest
|
||
|
||
steps:
|
||
- name: Checkout code
|
||
uses: actions/checkout@v4
|
||
|
||
- name: Setup Node.js
|
||
uses: actions/setup-node@v4
|
||
with:
|
||
node-version: '20'
|
||
|
||
- name: Check kernel directory exists
|
||
run: |
|
||
if [ ! -d "src/kernel" ]; then
|
||
echo "❌ Kernel directory not found at src/kernel"
|
||
exit 1
|
||
fi
|
||
echo "✅ Kernel directory found"
|
||
|
||
- name: Validate kernel modules
|
||
run: |
|
||
REQUIRED_MODULES=(
|
||
"types.ts"
|
||
"serviceRegistry.ts"
|
||
"identity.ts"
|
||
"config.ts"
|
||
"logger.ts"
|
||
"rpc.ts"
|
||
"events.ts"
|
||
"jobs.ts"
|
||
"state.ts"
|
||
"index.ts"
|
||
)
|
||
|
||
for module in "${REQUIRED_MODULES[@]}"; do
|
||
if [ ! -f "src/kernel/${module}" ]; then
|
||
echo "❌ Required kernel module not found: ${module}"
|
||
exit 1
|
||
fi
|
||
done
|
||
echo "✅ All required kernel modules present"
|
||
|
||
- name: Validate syscall endpoints
|
||
run: |
|
||
REQUIRED_ENDPOINTS=(
|
||
"/health"
|
||
"/version"
|
||
"/v1/sys/identity"
|
||
"/v1/sys/health"
|
||
"/v1/sys/rpc"
|
||
)
|
||
|
||
echo "Checking for syscall endpoint implementations..."
|
||
for endpoint in "${REQUIRED_ENDPOINTS[@]}"; do
|
||
# Check if endpoint is implemented in route files
|
||
if ! grep -r "${endpoint}" src/routes/ >/dev/null 2>&1; then
|
||
echo "⚠️ Warning: Syscall endpoint may not be implemented: ${endpoint}"
|
||
else
|
||
echo "✅ Found implementation for: ${endpoint}"
|
||
fi
|
||
done
|
||
|
||
- name: Check service registry
|
||
run: |
|
||
if ! grep -q "SERVICE_REGISTRY" src/kernel/serviceRegistry.ts; then
|
||
echo "❌ SERVICE_REGISTRY not found in serviceRegistry.ts"
|
||
exit 1
|
||
fi
|
||
echo "✅ SERVICE_REGISTRY found"
|
||
|
||
- name: Validate TypeScript compilation
|
||
run: |
|
||
npm ci
|
||
npm run build
|
||
if [ $? -ne 0 ]; then
|
||
echo "❌ TypeScript compilation failed"
|
||
exit 1
|
||
fi
|
||
echo "✅ TypeScript compilation successful"
|
||
|
||
validate-config:
|
||
name: Validate Configuration
|
||
runs-on: ubuntu-latest
|
||
|
||
steps:
|
||
- name: Checkout code
|
||
uses: actions/checkout@v4
|
||
|
||
- name: Check railway.json
|
||
run: |
|
||
if [ ! -f "railway.json" ]; then
|
||
echo "❌ railway.json not found"
|
||
exit 1
|
||
fi
|
||
echo "✅ railway.json found"
|
||
|
||
- name: Validate railway.json structure
|
||
run: |
|
||
if ! grep -q '"healthcheck"' railway.json; then
|
||
echo "❌ healthcheck not configured in railway.json"
|
||
exit 1
|
||
fi
|
||
echo "✅ railway.json is valid"
|
||
|
||
- name: Check Dockerfile (if present)
|
||
run: |
|
||
if [ -f "Dockerfile" ]; then
|
||
echo "Found Dockerfile, validating..."
|
||
if ! grep -q "EXPOSE" Dockerfile; then
|
||
echo "⚠️ Warning: No EXPOSE directive in Dockerfile"
|
||
fi
|
||
echo "✅ Dockerfile present"
|
||
else
|
||
echo "ℹ️ No Dockerfile (using Nixpacks)"
|
||
fi
|
||
|
||
validate-docs:
|
||
name: Validate Documentation
|
||
runs-on: ubuntu-latest
|
||
|
||
steps:
|
||
- name: Checkout code
|
||
uses: actions/checkout@v4
|
||
|
||
- name: Check README.md
|
||
run: |
|
||
if [ ! -f "README.md" ]; then
|
||
echo "❌ README.md not found"
|
||
exit 1
|
||
fi
|
||
echo "✅ README.md found"
|
||
|
||
- name: Validate README content
|
||
run: |
|
||
REQUIRED_SECTIONS=("Installation" "Usage" "Environment" "API")
|
||
for section in "${REQUIRED_SECTIONS[@]}"; do
|
||
if ! grep -qi "${section}" README.md; then
|
||
echo "⚠️ Warning: README may be missing ${section} section"
|
||
fi
|
||
done
|
||
echo "✅ README validation complete"
|