# Olorin > `olor` records durable execution state for coding agents: work items, task and stage DAGs, claims, attempts, reviews and findings. It validates every transition and reports state as one JSON document on stdout. Version 0.3.0 | storage schema v6 | JSON envelope `schema_version` 1 | Rust 1.100+ | AGPL-3.0-or-later. This file is an index for machine readers: it decides whether Olorin fits the job, and points at the authoritative details. If you are an agent in a tracked repository, the first command is always the read-only `olor status --path .`. ## What Olorin is and is not - **It records facts.** Work items, tasks, stage DAGs with explicit dependency edges, claims with leases and fencing generations, attempts with outcomes, reviews, findings, evidence and external references, all in one local SQLite file. - **It validates transitions.** Every write is checked against entity versions, roles, the graph and the current state in one transaction. A refused transition is an `invalid_transition`/`conflict` error with a `details.reason`; it is never a silent no-op and never leaves a partial write. - **It reports state.** One JSON document per invocation on stdout, plus an exit code carrying the error class. `stderr` is always empty. - **It never runs agents.** No subprocess execution, no model calls. It does not choose the next step, decompose work, schedule, dispatch, retry or orchestrate anything: the caller reads state, picks one allowed transition, and writes it. - **It is not a service.** No server, no daemon, no background process, no network. Two processes sharing one state file are serialized by SQLite transactions. - **It is not access control.** Owner, editor and approver names are responsibilities the caller asserts; there is no authentication, no owner transfer, and being the approver grants no edit right. ## Install and upgrade - [docs/installation.md](docs/installation.md): prerequisites, prebuilt installers, state-database location on Linux/macOS/Windows, the safe upgrade procedure and a troubleshooting table. Read before the first install or when a schema error appears. - Prebuilt binaries are the fast path and need no Rust toolchain: `curl -fsSL https://cadumagalhaes.dev/olorin/install.sh | sh` on Linux/macOS, `irm https://cadumagalhaes.dev/olorin/install.ps1 | iex` in PowerShell on Windows. Each installer fetches the archive for the detected target, verifies it against `SHA256SUMS.txt`, installs into `~/.local/bin` (`--dir` or `OLOR_INSTALL_DIR`) or `%LOCALAPPDATA%\olorin\bin` (`-InstallDir` or `$env:OLOR_INSTALL_DIR` on Windows), and runs `olor migrate`. Pin a release with `--version`/`OLOR_VERSION`; skip the migration with `--no-migrate`/`OLOR_NO_MIGRATE=1` (`-NoMigrate` on Windows). - Published targets: `x86_64-unknown-linux-musl` and `aarch64-unknown-linux-musl` (static), `x86_64-apple-darwin` and `aarch64-apple-darwin`, `x86_64-pc-windows-msvc`, plus `SHA256SUMS.txt`. Archives are `olor--.tar.gz` on Linux/macOS and `.zip` on Windows; download them directly from GitHub Releases when a script is not wanted, then run `olor migrate`. - `git` on `PATH` is required at runtime for every install method; SQLite is vendored through `rusqlite`, so there is no system SQLite dependency. Rust stable 1.100+ (edition 2024) is needed only to build from source. - Building from source: `cargo install --git https://github.com/1cadumagalhaes/olorin.git --locked` installs `olor` without a manual clone (`cargo install --path . --locked` installs from a local checkout), then run `olor migrate`. - After the install script, or after `cargo install` plus `olor migrate`, an existing state file is upgraded to schema v6 in place (`make install` from a checkout runs both steps). On a machine with no database, `olor migrate` exits 0 without creating one. - Reads never migrate. A read against an older file fails with `migration_required` (exit 6); `olor migrate` or any write verb migrates atomically. A file written by a newer schema fails with `schema_too_new` (exit 6). - `make check` runs formatting, clippy with `-D warnings`, the test suite, `make llms-check`, `make install-check`, and `make gate-check`. ## Mental model - **Work item -> Task -> Stage (DAG) -> Attempt.** A work item is an objective over zero or more registered repositories. A task belongs to exactly one work item and owns a graph of stages. One execution of a stage is an attempt. - **Claim with lease and fencing.** `stage claim` takes a stage's exclusive claim with a lease and a `(claim_id, generation)` fence. Renew, release, recover, transfer and submit are fenced by that pair: a superseded generation fails with `claim_fenced` (exit 4). An expired lease is reported `stale` and is never auto-released. - **Submit, then accept or reject.** `stage submit` records the attempt outcome under the fence (`succeeded`, `failed`, `blocked`); blocked submissions require `--blocker-class external` and a distinct `--unblock-action`. A `succeeded` attempt awaits review until the approver runs `stage accept` or `stage reject`. - **Deferral is explicit.** `task defer` / `stage defer` record a reason and a deadline (`--snooze-ms` or `--until`); `stage defer` requires one. `stage claim --resume-deferred` lifts an active *stage* deferral only; an active *task* deferral still refuses the claim with `task_deferred` (exit 5). - **Closure is explicit.** Stages never close a task. `task complete`, `task fail` and `task cancel` are separate owner-only verbs, refused while required stages are outstanding. - **The pre-stop gate is a decision, not a report.** `olor gate --path .` exits **10** while any open stage is `eligible`, `submitted` or `stale`, and exits 0 only when every open stage is `deferred` with a deadline, `externally_blocked` with an unblock action, or already `accepted`. With `--actor`, a live claim held by that actor also refuses, while a peer's is reported and does not. It never writes, never creates state, and answers 0 for an unregistered repository. - **Only eligible stages are claimable.** `task show` and `status` publish `eligible_stage_ids`; anything else is `dependencies_unmet` or already claimed. - [docs/state-machine.md](docs/state-machine.md): derived stage states and their precedence, version boundaries, lease and fencing semantics, roles, and the full `details.reason` table. - [docs/phase-6-contract.md](docs/phase-6-contract.md): additive schema-v6 DDL for wired blocker, evidence-waiver, and artifact metadata tables. Read it before writing a transition you are not sure about. ## Command surface Grouped by family; run `olor --help` for flags, and [docs/cli-examples.md](docs/cli-examples.md) for copy-pasteable workflows. Every write verb requires `--idempotency-key` plus `--actor`, `--session`, and `--harness` (from flags or `OLOR_ACTOR`, `OLOR_SESSION`, `OLOR_HARNESS`; missing or blank values fail with `usage` / exit 2 before opening storage). - **inspect (read-only)**: `olor status`, `olor gate`, `olor repo list`, `olor repo show`, `olor repo inspect`, `olor worktree inspect`, `olor work list`, `olor work show`, `olor task list`, `olor task show`, `olor stage show`, `olor finding list`, `olor finding show`, `olor evidence list`, `olor ref list`. Start here: Git context, registry resolution and storage state. - **author the graph**: `olor repo register`, `olor work create`, `olor task create`, `olor task editors set`, `olor task approver set`, `olor stage add`, `olor stage graph apply`, `olor stage edit`, `olor stage approver set`, `olor stage depends add`, `olor stage depends remove`, `olor stage remove`, `olor stage assign`, `olor stage supersede`, `olor worktree bind`, `olor worktree unbind`. Graph edits advance the task version; definition edits advance the stage version. - **defer**: `olor task defer`, `olor task resume`, `olor stage defer`, `olor stage resume`. - **claim and submit**: `olor stage claim`, `olor stage renew`, `olor stage release`, `olor stage recover`, `olor stage transfer`, `olor stage submit`. - **review**: `olor stage accept`, `olor stage reject`. Approver only, against a `succeeded` attempt awaiting review. - **close**: `olor task complete`, `olor task fail`, `olor task cancel`. Owner only; `fail` and `cancel` require `--reason`. - **findings, evidence and refs**: `olor finding add`, `olor finding update`, `olor evidence add`, `olor ref add`. Never inferred; findings and refs never block, while `stage submit --outcome succeeded` requires evidence on the attempt (or an explicit `--no-evidence --reason` waiver). - **schema**: `olor migrate`. ## Machine contract - One JSON document on stdout per invocation. Success: `{"schema_version":1,"ok":true,"command":"","result":{...}}`. The payload key is **`.result`**, never `.data`. - Failure: `{"schema_version":1,"ok":false,"command":"","error":{"code":...,"message":...,"details":{...},"next_actions":[...]}}`. `next_actions` is a list of `{code,hint}` objects: read it before retrying, and use `details.reason` for the machine-readable cause. - Exit codes: `0` success, `2` usage, `3` not found, `4` conflict or ambiguous, `5` invalid transition, `6` storage, migration, schema or persisted-data failure, `7` not implemented, `8` internal, `10` runnable work remains (`olor gate` only: a decision inside a successful envelope, not an error). Retry `4` only after re-reading state; never retry `claim_fenced` blindly. - Idempotency: retrying the same `--idempotency-key` with the same request replays the stored result byte for byte; different request bytes under the same key is `conflict` (exit 4). - Ids are positional and typed (`work_`, `task_`, `stage_`, `claim_`, `att_`, `find_`, `ev_`, `ref_` prefixes over UUIDv7); everything else is a flag. - [integrations/skills/olorin/references/commands.md](integrations/skills/olorin/references/commands.md): exact flag parity, payload fields and exit codes for all 51 leaf subcommands. - [docs/state-machine.md](docs/state-machine.md): the state machine itself, error codes -> exit codes, and the `details.reason` reference. ## Read scope and pagination - `olor work list`, `olor task list` and `olor finding list` are scoped to the current repository by default, resolved from `--path` (default: the current directory). Choose the scope explicitly with `--repository ` or `--all-repositories`; combining the two is a usage error (exit 2). - Every scoped list returns `scope` (`repository` or `global`) and `repository_id`, so a caller never has to guess what it just read. - Pagination: `--limit` defaults to 50 and must be 1 to 200; `--cursor` is opaque, and for the scoped lists it is bound to the list family and to the resolved scope, so a cursor reused under another scope is a usage error (exit 2). Responses carry `next_cursor` and `has_more`; page until `has_more` is false. - `olor evidence list` takes `--limit`/`--cursor` too, keyed to its `--attempt` or `--finding` target. `olor repo list` and `olor ref list` are not paginated. - Nested lists are bounded and non-paginable: `work list`/`work show` return at most 200 tasks per work item with `tasks_total` and `tasks_has_more`, and `status` returns at most 50 with `active_tasks_total` and `active_tasks_has_more`. Trust the `*_total` fields, not the array length. ## Agent integration kit - [integrations/AGENTS.md](integrations/AGENTS.md): the paste-ready snippet for a repository's always-on agent instructions: orientation, auto-registration, actor and metadata rules, the pre-stop gate (`olor gate`, exit 10) and envelope wire rules. - [integrations/skills/olorin/SKILL.md](integrations/skills/olorin/SKILL.md): role playbooks: coordinator and worker loops, DAG shapes, evidence-backed review, deferral and blocker discipline. - [integrations/skills/olorin/references/commands.md](integrations/skills/olorin/references/commands.md): the per-verb reference the skill points into. - [integrations/README.md](integrations/README.md): how to install the snippet, skill and harness attachments, first run in a repository, and local telemetry inspection. - [integrations/pi/README.md](integrations/pi/README.md): the Pi 1.7 extension that runs `olor gate` on `agent_before_settle`, its two-continuation cap, and its fail-open rules. ## Optional - [README.md](README.md): narrative overview, guarantees of the read paths, and the explicit limitation list. - [docs/spec/olorin.md](docs/spec/olorin.md): the product specification (authoritative). - [docs/architecture.md](docs/architecture.md): architecture decisions and rationale. - [docs/implementation-contract.md](docs/implementation-contract.md), [docs/phase-2-contract.md](docs/phase-2-contract.md), [docs/phase-3-contract.md](docs/phase-3-contract.md), [docs/phase-4-contract.md](docs/phase-4-contract.md): frozen per-phase contracts (schema, types, names, reasons). - [docs/research/reference-review.md](docs/research/reference-review.md), [docs/research/architecture-discussion.md](docs/research/architecture-discussion.md), [docs/research/reference-assessment.md](docs/research/reference-assessment.md): research and prior-art review behind the design. - [.agents/plans/2026-11-23T04-42-00Z-olorin-v0.2-backlog.md](.agents/plans/2026-11-23T04-42-00Z-olorin-v0.2-backlog.md): the v0.2 backlog and plan history. - [LICENSE](LICENSE): GNU Affero General Public License v3.0 or later. `Cargo.toml` keeps `publish = false`; install a prebuilt binary with `curl -fsSL https://cadumagalhaes.dev/olorin/install.sh | sh` (Windows: `irm https://cadumagalhaes.dev/olorin/install.ps1 | iex`), or use `cargo install --git` / build from a checkout. - [CHANGELOG.md](CHANGELOG.md): release history, schema versions and upgrade notes.