Alhazen Core

Alhazen Core is the required first-install skill. It starts the TypeDB database and Next.js dashboard via Docker Compose, loads the foundational alhazen_notebook.tql schema, and provides infrastructure health checks.

What It Does

  1. Starts TypeDB 3.8 container (or confirms it’s already running)
  2. Creates the alhazen_notebook database if missing
  3. Loads the core schema (alhazen_notebook.tql) — the foundation all other skills extend
  4. Starts the Next.js dashboard container
  5. Wires skill dashboard components into the running container

When to Use

  • First-time setup (make build calls this automatically)
  • Infrastructure health checks
  • Wiring a new skill’s dashboard into the running container
  • Resetting the database (destructive — back up first!)

Key Commands

# Initialize everything (idempotent)
uv run python alhazen_core.py init

# Load an additional schema file
uv run python alhazen_core.py load-schema skills/tech-recon/schema.tql

# Check infrastructure status
uv run python alhazen_core.py status

# Wire a skill's dashboard components into the container
uv run python alhazen_core.py wire-dashboard --skill tech-recon

# Rebuild the Next.js dashboard inside the container
uv run python alhazen_core.py rebuild-dashboard

# Show which skills have dashboards wired
uv run python alhazen_core.py dashboard-status

# DESTRUCTIVE: Drop and recreate database
uv run python alhazen_core.py reset --yes

Environment Variables

Variable Default Purpose
TYPEDB_HOST localhost TypeDB server host
TYPEDB_PORT 1729 TypeDB server port
TYPEDB_DATABASE alhazen_notebook Database name
TYPEDB_USERNAME admin Auth username
TYPEDB_PASSWORD password Auth password

Docker Services

The docker-compose.alhazen.yml file defines two services:

  • typedb — TypeDB 3.8 with data volume persistence
  • dashboard — Next.js app serving skill dashboards on port 3001

Troubleshooting

  • Port conflict on 1729: Another TypeDB instance is running. Stop it or change TYPEDB_PORT.
  • Schema load fails: Check that the .tql file uses TypeDB 3.x syntax (see Schema Reference).
  • Dashboard shows blank: Run rebuild-dashboard after wiring new skill components.