Show HN: L0/L1/L2 agents, leases, gates, audits, Git-worktree isolation Singular, a bash and Python orchestration engine, introduces a three-tier scheduling model (L0 origin loop, L1 area planners, L2 worker agents) with durable leases, state packets, gate/audit pipelines, and git-worktree isolation to drive autonomous AI coding agents in parallel against software repositories. The engine, installed once per machine and pinned per consumer repo, runs a reconcile cycle that imports task proposals, recovers stale leases, integrates completed branches, dispatches workers, and snapshots state, with detached dispatch enabled by default to minimize lock hold times. TcGUeulhd4hM0DvB5ytcng-under10.mp4 Autonomous multi-agent orchestration for software repos. One engine, many consumers. singular is a bash + Python orchestration engine that drives autonomous AI coding agents in parallel against a repository. It implements a three-tier scheduling model L0 origin loop → L1 area planners → L2 worker agents with durable leases, state packets, gate/audit pipelines, and git-worktree isolation. The engine is installed once per machine and pinned per consumer repo — improvements propagate by bumping a version pin, not by re-copying scripts. | Tier | Role | |---|---| L0 origin | The single scheduler. Runs the reconcile cycle: import → recover → integrate → dispatch → snapshot. Holds the origin lock only during control work. | L1 area planners | One planner per DAG node area . Reads the node's context, plans a batch of L2 tasks, and stages them as proposals for L0 to import. | L2 workers | Execute a single task in an isolated git worktree on a per-task branch. Produce a state packet owned files, changes, evidence . An auditor reviews the packet; the decider routes the outcome. | Each singular reconcile --actuate runs: Import — pull staged L1 task proposals into the DAG under the origin lock. Recover — reclaim stale leases whose workers have exited or timed out. Integrate — merge completed worker branches into the target branch under the git-op lock. Dispatch — pre-lease frontier tasks and spawn L2 workers. Snapshot — write a human-readable project state snapshot. Every in-flight task holds a lease a JSON file in .singular-state/leases/ that records ownership, retry count, and expiry. When a worker finishes it writes a state packet state-packet.v0.schema.json enumerating owned files, changed files, commands, tests, and evidence. The auditor validates the packet; the reaper attributes outcomes on later cycles. After each L2 worker run the host executes the configured gate command e.g. npm test . A gate result gate-result.v0.schema.json feeds the auditor model, which returns an audit verdict audit-verdict.v0.schema.json . The decider maps the failure-class, retries-left pair to a recovery action — retry, amend-scope, escalate, or park — using a deterministic fast-path table before falling back to a model round-trip. A bare command works: exit 0 passes, non-zero fails. The exit code cannot answer two questions the engine would use if it could, so a gate may optionally write a gate observation gate-observation.v0.schema.json to the path in SINGULAR GATE REPORT FILE : failures .signature — stable per-failure identifiers. Required for singular gate baseline to tell an acknowledged failure from a new one. infrastructureFailure / infrastructureReason — the gate could not run missing dependencies, full disk, unreachable network . The engine reports that as inconclusive-infrastructure instead of spending a task's retry budget asking a model to fix code that was never broken. singular init scaffolds docs/orchestration/gates/gate.sh as a starting point. The sidecar is never required — including on schemaVersion: v2 . Without one the engine falls back to the exit code plus a deliberately narrow set of log signatures engine/infra-patterns.tsv covering only environment failures that application code cannot plausibly produce. Detached dispatch is ON by default. When SINGULAR DETACHED DISPATCH=1 the default , reconcile pre-leases each frontier task and spawns the worker in its own session via dispatch-wrap.sh , then returns within seconds. The origin lock is held only for the cycle's control work. A reaper singular reap dispatches runs at the top of every apply/actuate cycle and attributes completions, failures, and crashes by checking dispatch records + worker exit files pid liveness defeats pid reuse; crash detection drops from the 60-min stale-lease window to ~one cycle . This is what keeps import, integrate, recover, STATUS, and STOP responsive while long workers run in the background. Set SINGULAR DETACHED DISPATCH=0 to restore the legacy synchronous batch path, where reconcile waits for every worker before returning. Prerequisites: - Bash = 4, python3 , and git . - At least one supported runner CLI on PATH claude , codex , or another configured runner . - macOS users may need brew install bash . Set SINGULAR BASH BIN=/opt/homebrew/bin/bash in the shell/service environment to select it without reordering PATH . - When multiple Codex installations exist, set SINGULAR CODEX BIN=/absolute/path/to/codex . Doctor and the runner use that exact executable and do not fall back when it is broken. Clone and install the engine to ~/.singular git clone https://github.com/alex-reysa/singular-lite /path/to/singular-lite cd /path/to/singular-lite bash install.sh - ~/.singular/versions/