Phase 0 is the foundation of the entire Harness AI roadmap. It installs no AI capabilities, no agents, and no external integrations — its sole purpose is to prove that the monorepo, infrastructure services, execution pipeline, and audit trail work end-to-end on a single Docker Compose stack and can be reproduced identically in a Dokploy production deployment. Without Phase 0 there is no Harness Core, no audit trail, and no execution surface for any subsequent phase to build upon.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/joseluis-dev/harness-ai/llms.txt
Use this file to discover all available pages before exploring further.
Objective
Establish the monorepo, the support services (PostgreSQL, Redis), and the minimum audit and execution schema so the system starts locally with Docker Compose and is deployable to Dokploy. Every subsequent phase depends on the tables, queues, and health checks created here.Dependencies
This is the initial phase of the 0–13 roadmap. It has no upstream dependencies.What to Implement
Monorepo structure
Single repository with clearly separated apps (
harness-core, runtime-python) and an infra/ directory for Docker Compose files, migrations, and Dokploy notes.Astro SSR
harness-core Astro application with server-side rendering enabled, capable of handling API routes and serving the executions UI.PostgreSQL
Relational store for executions, audit events, and all future phase tables. Exposed only on
private-harness-net; never published to host except via Astro.Redis
Job queue backing store for RQ. Used by runtime Python to consume execution jobs. Internal to
private-harness-net.Runtime Python
Single container running both
uvicorn (internal API on port 8000) and rq worker via entrypoint.sh. No separate worker sidecar exists in the Compose definition.Docker Compose + migrations
docker-compose.local.yml and docker-compose.prod.yml with the same 4-service topology. Alembic (or equivalent) migrations run on startup; schema is reproducible from zero.Health checks
All 4 services report healthy status (
Up (healthy)) before Astro accepts traffic. Compose depends_on: condition: service_healthy enforces ordering.executions table
Tracks every harness execution:
id (UUID), status (queued → running → completed/failed), source_type, intent, risk_level, timestamps.audit_events table
Append-only event log. Written exclusively by
runtime/audit/event_builder.py. Records execution_id, event_type, from_status, to_status, and timestamp for every state transition.RQ job queue
Astro enqueues a job after creating an execution row; the RQ worker in
runtime-python picks it up, transitions the execution, and writes audit events.Executions page
The first UI artifact — a server-rendered Astro page that lists executions and their current status. Serves as the end-to-end smoke-test surface.
Acceptance Criteria
All criteria are LIVE verified (2026-07-05). Each check below maps to a specific command and expected response.[LIVE 2026-07-05] System starts with Docker Compose — 4 services healthy
Run the local stack and confirm all four services reach the Expected output — all four services Only
healthy state:Up (healthy):harness-core publishes a host port. runtime-python exposes 8000/tcp internally only.[LIVE 2026-07-05] Runtime Python consumes the job
Verify that Expected output includes both process names:
runtime-python hosts both processes under its entrypoint.sh supervisor:ps is not available in python:3.12-slim; inspect /proc directly. There is no separate worker service in the Compose definition — both uvicorn (port 8000) and rq worker executions run inside the same container via bash /app/infra/docker/entrypoint.runtime-python.sh.[LIVE 2026-07-05] Execution reaches 'completed' state
Poll the execution until it transitions to Expected response — status has advanced:The transition typically completes within ~1.5 s (controlled by
completed:EXECUTION_WORKER_FAKE_WORK_SECONDS).[LIVE 2026-07-05] Audit events registered — 2 events in order
runtime/audit/event_builder.py — the sole writer of the audit_events table. The execution.running event captures the queued → running transition; execution.completed captures running → completed.[LIVE 2026-07-05] Deployable to Dokploy — config validates cleanly
ports: on all services except harness-core:4321. See infra/dokploy/deployment-notes.md for the Dokploy deployment procedure.Operational Notes
- The
executionsandaudit_eventstables created here are the canonical schema for all future phases. No phase may bypass them. - The executions page is the first UI artifact and acts as the primary smoke-test surface throughout the roadmap.
- The
audit_eventstable is append-only: no phase may update or delete rows. New events are always inserted; never mutated. - All state transitions in
executionsgo through the runtime Python worker; Astro only reads and enqueues — it never writes execution status directly. EXECUTION_WORKER_FAKE_WORK_SECONDSis the environment variable that controls the simulated delay in the worker. Its default value produces the ~1.5 s latency observed in the Phase 0 smoke test.