This document describes the comprehensive validation system to prevent registry inconsistencies and ensure the installer works correctly.
We have three levels of validation to catch issues before they reach users:
validate-registry.ts)Validates that all paths in registry.json point to actual files on disk.
Usage:
# Basic validation
bun run scripts/registry/validate-registry.ts
# With verbose output
bun run scripts/registry/validate-registry.ts --verbose
# With fix suggestions
bun run scripts/registry/validate-registry.ts --fix
Checks:
Exit codes:
check-dependencies.ts)Comprehensive check for missing dependencies and profile inconsistencies.
Usage:
# Basic check
bun run scripts/registry/check-dependencies.ts
# With verbose output
bun run scripts/registry/check-dependencies.ts --verbose
Checks:
Critical files that must be in registry:
root-navigation (.opencode/context/navigation.md)context-paths-config (.opencode/context/core/config/paths.json)context-system (.opencode/context/core/context-system.md)Exit codes:
test-installer-files.sh)Simulates the installer by checking if files are accessible from GitHub.
Usage:
# Test with local registry (faster, for development)
./scripts/tests/test-installer-files.sh --local --profile=essential
# Test with remote registry (simulates actual installation)
./scripts/tests/test-installer-files.sh --profile=essential
# Test all components
./scripts/tests/test-installer-files.sh --local --all
# Test specific profile with verbose output
./scripts/tests/test-installer-files.sh --local --profile=developer --verbose
Supported profiles:
essential - Minimal starter kitdeveloper - Complete dev environmentbusiness - Business automationfull - Everything includedadvanced - With System BuilderAdd this to .github/workflows/registry-validation.yml:
name: Registry Validation
on:
push:
paths:
- 'registry.json'
- '.opencode/profiles/**'
- '.opencode/config/**'
- 'scripts/registry/**'
pull_request:
paths:
- 'registry.json'
- '.opencode/profiles/**'
- '.opencode/config/**'
- 'scripts/registry/**'
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Validate registry paths
run: bun run scripts/registry/validate-registry.ts
- name: Check dependencies
run: bun run scripts/registry/check-dependencies.ts
- name: Test installer (Essential profile)
run: |
chmod +x scripts/tests/test-installer-files.sh
./scripts/tests/test-installer-files.sh --local --profile=essential
- name: Test installer (Developer profile)
run: ./scripts/tests/test-installer-files.sh --local --profile=developer
Install the pre-commit hook to catch issues before committing:
# Copy the hook to .git/hooks
cp scripts/hooks/pre-commit .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
# Or use with Husky
npx husky add .husky/pre-commit "bun run scripts/registry/check-dependencies.ts"
Cause: navigation.md at .opencode/context/navigation.md is not in registry.
Solution:
{
"id": "root-navigation",
"name": "Root Navigation",
"type": "context",
"path": ".opencode/context/navigation.md",
"category": "essential"
}
Cause: Profile references a component ID that doesn't exist in registry.
Solution:
adding-skill → adding-skill-basics)bun run scripts/registry/check-dependencies.ts to verifyCause: A component's dependencies array references a non-existent component.
Solution:
.opencode/config/agent-metadata.json for agent dependenciesCause: When a file is split (e.g., design-iteration.md → multiple files), the new files weren't added to registry.
Solution:
ls .opencode/context/core/workflows/design-iteration-*.mdAlways run:
# 1. Validate registry
bun run scripts/registry/validate-registry.ts
# 2. Check dependencies
bun run scripts/registry/check-dependencies.ts
# 3. Test installer
./scripts/tests/test-installer-files.sh --local --profile=essential
Add to registry.json:
Add to profiles:
.opencode/profiles/<name>/profile.jsonAdd dependencies:
dependencies arrayRun validation:
bun run scripts/registry/check-dependencies.ts
Remove from registry.json:
Update dependent components:
grep -r "component:old-id" .opencode/Update profiles:
.opencode/profiles/ and registry.json profiles sectionRun validation:
bun run scripts/registry/check-dependencies.ts
Create new registry entries:
design-iteration-overview, design-iteration-plan-fileRemove old entry:
Update dependencies:
grep -r "context:old-id" .opencode/ registry.jsonUpdate profiles:
Install Bun:
curl -fsSL https://bun.sh/install | bash
Ensure you're running from repo root:
cd /path/to/OpenAgentsControl
bun run scripts/registry/check-dependencies.ts
Make sure all files are committed:
git status
# Commit any uncommitted files before pushing
# Full validation suite
bun run scripts/registry/validate-registry.ts && \
bun run scripts/registry/check-dependencies.ts && \
./scripts/tests/test-installer-files.sh --local --all
# Just check dependencies (fastest)
bun run scripts/registry/check-dependencies.ts
# Test specific profile
./scripts/tests/test-installer-files.sh --local --profile=essential
# Check with verbose output
bun run scripts/registry/check-dependencies.ts --verbose