# morca API reference

> The `orca` package, from Orca 0.23.0, as published on mojoshelf (commit 32ee1ee691cc), by `mojo doc` from Mojo 1.2.0.

## Modules

- [orca.actions](https://morca.dev/docs/api/actions.md): What `orca ui` does to runs: each action is rows in Postgres that the scheduler, or the run's own process, acts on.
- [orca.admission](https://morca.dev/docs/api/admission.md): Admission by memory pressure, where it shows (#202): each host's newest reading in `orca.pressure`, for Ops › Control, `/api/workers`, `/metrics`, `orca status` and the home and runs pages, and the alert when a hold has nothing of orca's to wait for.
- [orca.alerts](https://morca.dev/docs/api/alerts.md): What the scheduler raises alerts about (`orca.notify`, #184), each decided where the data is and sent through `orca.notify.alert`:
- [orca.api](https://morca.dev/docs/api/api.md): orca's JSON API: what `orca --remote`, `orca worker` and `orca.http_store.HttpStore` talk to. A page's JSON is built from the same read models as its HTML (`orca.views`); these are the writers, and the endpoints that are JSON only.
- [orca.api.actions](https://morca.dev/docs/api/api/actions.md): The actions: each a `POST` of a form (or of JSON, from `orca --remote`) that changes something, through `orca.actions`.
- [orca.api.datasets](https://morca.dev/docs/api/api/datasets.md): Rebuilds and lineage as JSON.
- [orca.api.ops](https://morca.dev/docs/api/api/ops.md): The Ops pages' JSON endpoints: `/api/fleet`, `/api/workers`, `/api/system`, `/api/gantt` and `/api/watchdog` (`/api/pools` is the Pools page's, `orca.ui.pools`). `/api/fleet` and `/api/workers` are what the Fleet and Workers pages were, before Pools replaced them.
- [orca.api.pipelines](https://morca.dev/docs/api/api/pipelines.md): A pipeline as JSON: its registration (`json_pipeline`), a keyed one's counts and Start runs' preview.
- [orca.api.runs](https://morca.dev/docs/api/api/runs.md): Runs as JSON: a run (`json_run`), a list's page with its cursors, a code version, and a run's machines with their metrics.
- [orca.api.worker](https://morca.dev/docs/api/api/worker.md): The worker API: what `orca worker` (`orca.worker`) and the runs it starts (`orca.http_store.HttpStore`) call, each a `POST` of JSON with `Authorization: Bearer <worker token>`. What each call does is `orca.workers`; this is how a request reaches it.
- [orca.auth](https://morca.dev/docs/api/auth.md): Who may act in `orca ui`: users with passwords, their sessions, and a record of what each did.
- [orca.aws](https://morca.dev/docs/api/aws.md): `orca aws`: a project's orca on AWS, with the `aws` and `docker` commands its user already has (`aws login`, or `AWS_PROFILE` for a named profile).
- [orca.aws_assets](https://morca.dev/docs/api/aws_assets.md): The stack template and the project Dockerfile `orca aws` writes out: deploy/aws/orca.yaml and deploy/project.Dockerfile, embedded by scripts/embed-aws.py. Edit those, then run it; `pixi run test-aws-assets` fails while this is out of date.
- [orca.aws_replace](https://morca.dev/docs/api/aws_replace.md): `orca aws replace-control`: a blue/green replacement of the stack's control instance by a new one booted from the current template, with the old one's database (DESIGN.md, "Replacing the control instance").
- [orca.awsec2](https://morca.dev/docs/api/awsec2.md): The few EC2 calls the `ec2` runner makes (`orca.ec2`), over objectstore's SigV4 signing and HTTP.
- [orca.awsjson](https://morca.dev/docs/api/awsjson.md): One signed call to an AWS service's JSON API (Secrets Manager's `GetSecretValue`, SSM's `GetParameter`): SigV4 over objectstore's HTTP, with the credentials of the `AWS_*` environment or else the instance role. A low module: `orca.control` and `orca.machines_ec2` both use it.
- [orca.calendar](https://morca.dev/docs/api/calendar.md): A dated pipeline's partitions on a calendar: what state each day (or, for a monthly pipeline, month) is in, read from the database alone.
- [orca.cgroup](https://morca.dev/docs/api/cgroup.md): Containment (#201): a cgroup v2 memory limit per run, and retrying bigger after an out-of-memory kill.
- [orca.chart](https://morca.dev/docs/api/chart.md): Runs per day, drawn as SVG on the server for the home page: one bar a day, stacked by how the runs ended.
- [orca.civil](https://morca.dev/docs/api/civil.md): Calendar arithmetic: dates to days since 1970-01-01 and back.
- [orca.cli](https://morca.dev/docs/api/cli.md): `orca_main`: the command line every pipeline binary gets.
- [orca.command](https://morca.dev/docs/api/command.md): The `orca` command: the scheduler, the UI and registration, in a binary that links no pipeline. A project builds its own from two lines:
- [orca.config](https://morca.dev/docs/api/config.md): `orca.toml`: one checked-in file for how each of a project's pipelines runs (#145), read by `orca register` and `orca aws register`.
- [orca.config_show](https://morca.dev/docs/api/config_show.md): `orca config show` and `orca config export` (`orca.config`): each pipeline's settings with where each came from, as text, HTML and JSON, and the registered settings written back as an orca.toml.
- [orca.control](https://morca.dev/docs/api/control.md): Placement: where a pipeline's runs run (`orca register --placement`), and the control runner, which runs them on the scheduler's own host.
- [orca.coverage](https://morca.dev/docs/api/coverage.md): A pipeline's coverage: one number for how much of it is done, shown on the home page's table, its page's Progress card and in their JSON.
- [orca.crash](https://morca.dev/docs/api/crash.md): What a crash left in a run's output: the stack dump Mojo's runtime prints on a fatal signal (a segfault, `abort`, a failed bounds check), cut down to a line for the error of the attempt it ended.
- [orca.cron](https://morca.dev/docs/api/cron.md): Cron expressions, and when they next fire in a time zone.
- [orca.ctx](https://morca.dev/docs/api/ctx.md): `Ctx`: what a step gets besides its input.
- [orca.dag](https://morca.dev/docs/api/dag.md): A pipeline's DAG drawn as SVG, on the server.
- [orca.day](https://morca.dev/docs/api/day.md): `Day`: the partition key of a daily pipeline.
- [orca.ec2](https://morca.dev/docs/api/ec2.md): Runs on EC2: a head instance and worker instances per run, started and ended by the scheduler (DESIGN.md, phase 5, PR 5).
- [orca.estimate](https://morca.dev/docs/api/estimate.md): How long runs of a pipeline would take, from how long its recent runs took.
- [orca.expiry](https://morca.dev/docs/api/expiry.md): Snapshot expiry, the scheduler's half: what orca still needs of a dataset's history, and the binary that does the expiring.
- [orca.fill](https://morca.dev/docs/api/fill.md): Fills (#155): a pipeline filling its whole partition range by itself, within limits, set in orca.toml (`orca.config`):
- [orca.fleet](https://morca.dev/docs/api/fleet.md): The fleet: every machine orca is paying for, as Ops' Pools shows the EC2 ones (`/ops/pools?kind=ec2`, `orca.ui.pools`) and `/api/fleet` has them as JSON.
- [orca.follow](https://morca.dev/docs/api/follow.md): How far a dated sensor pipeline is behind the datasets it follows.
- [orca.graph](https://morca.dev/docs/api/graph.md): A directed graph drawn as SVG, on the server: the pipelines and datasets that feed each other, and a snapshot's lineage.
- [orca.hcloud](https://morca.dev/docs/api/hcloud.md): Hetzner Cloud's API, as the pool autoscaler needs it (#267, `orca.pool_scale`): make a server, list a pool's, delete one, and the architecture of a server type.
- [orca.heartbeat](https://morca.dev/docs/api/heartbeat.md): A run's heartbeat, kept fresh from a thread while the run's steps work.
- [orca.highlight](https://morca.dev/docs/api/highlight.md): Mojo source coloured for the UI's code-on-hover (`_PEEK` in `orca.ui.layout`), on the server, with no library: `tokens` splits source into runs of one kind, and `highlight` turns those into HTML lines with a `<span>` per coloured run.
- [orca.hour](https://morca.dev/docs/api/hour.md): `Hour`: the partition key of an hourly pipeline.
- [orca.html](https://morca.dev/docs/api/html.md): Writing HTML: every value escaped, markup only where it's said to be.
- [orca.http_store](https://morca.dev/docs/api/http_store.md): `HttpStore`: a run's state over `orca ui`'s API, for a run on a remote worker (`orca worker`, `orca.worker`), which holds no database credentials.
- [orca.instances](https://morca.dev/docs/api/instances.md): Scheduler instances: two `orca scheduler`s of different images overlapping on one Postgres during a deploy (docs/overlap.md).
- [orca.json](https://morca.dev/docs/api/json.md): The little JSON orca writes: quoted strings.
- [orca.key](https://morca.dev/docs/api/key.md): `Key`: what a partition key is, whatever it counts.
- [orca.keyed](https://morca.dev/docs/api/keyed.md): Keyed partitions: keys that are names, read from a column of a dataset.
- [orca.kube](https://morca.dev/docs/api/kube.md): Runs on Kubernetes: a dista cluster per run, made and removed by the scheduler (K8S.md).
- [orca.lineage](https://morca.dev/docs/api/lineage.md): Lineage: which snapshots a dataset's snapshot was made from, and what was made from it, from the reads and commits every attempt records.
- [orca.live](https://morca.dev/docs/api/live.md): Which runs are live: queued, deferred, or running with their process alive.
- [orca.locate](https://morca.dev/docs/api/locate.md): Where a pipeline's step functions and dista tasks are defined in its source, so `orca ui` can link each one to its line at the commit a run ran.
- [orca.logs](https://morca.dev/docs/api/logs.md): Where attempts' logs, drivers' logs and runs' timelines go.
- [orca.machines](https://morca.dev/docs/api/machines.md): Machines for a worker pool, from whichever provider the pool names (#267): what the autoscaler (`orca.pool_scale`) calls, so it never knows which.
- [orca.machines_ec2](https://morca.dev/docs/api/machines_ec2.md): A worker pool's machines on EC2 (#267): `orca.machines.Provider` for a pool with `provider = "ec2"`.
- [orca.maintain](https://morca.dev/docs/api/maintain.md): Table maintenance for a project's datasets: snapshot expiry.
- [orca.metrics](https://morca.dev/docs/api/metrics.md): A run's machine metrics on its page: the samplers' files (`orca.sample`) read back, their peaks and warnings, and the charts, drawn as SVG on the server like the DAG.
- [orca.migrations](https://morca.dev/docs/api/migrations.md): The schema's migrations (`State.migrate` applies them): each version's statements, which versions raise the floor an older binary needs, and the check that an older binary may run on a newer schema. AGENTS.md says how to keep a migration additive.
- [orca.month](https://morca.dev/docs/api/month.md): `Month`: the partition key of a monthly pipeline.
- [orca.name](https://morca.dev/docs/api/name.md): `Name`: the partition key of a keyed pipeline (`orca.keyed`).
- [orca.notify](https://morca.dev/docs/api/notify.md): Alerts to a person: a push to the owner's phone through ntfy (#184).
- [orca.partitions](https://morca.dev/docs/api/partitions.md): Partition sets: which keys a pipeline is partitioned by, from when.
- [orca.pause](https://morca.dev/docs/api/pause.md): Pausing a pipeline: what `orca pause`, the UI's Pause button and the watchdog (`orca.watchdog`) all do.
- [orca.pipeline](https://morca.dev/docs/api/pipeline.md): Pipelines: a named list of steps, checked and run in order.
- [orca.pool](https://morca.dev/docs/api/pool.md): An EC2 instance's side of the warm pool (`orca.ec2`, `ORCA_EC2_POOL_SECONDS`): the two commands its script runs between runs, through the pipeline's binary, over `ORCA_DATABASE_URL`.
- [orca.pool_boot](https://morca.dev/docs/api/pool_boot.md): How a machine the pool autoscaler made becomes a worker (#267): its startup script, and the UI's answer to its `/api/worker/boot`.
- [orca.pool_config](https://morca.dev/docs/api/pool_config.md): Worker pools orca grows and shrinks itself (#267): a `[pools.<name>]` table in orca.toml, read and checked here, recorded by `orca register` in `orca.pools`, and acted on by the scheduler (`orca.pool_scale`).
- [orca.pool_runs](https://morca.dev/docs/api/pool_runs.md): The scheduler's part in a worker pool (`orca.workers`): due retries and dead runs queued again for a worker, lost workers' runs, orphans of gone instances, and fill runs queued for the pool.
- [orca.pool_scale](https://morca.dev/docs/api/pool_scale.md): The pool autoscaler (#267): machines for the pools orca.toml declares (`orca.pool_config`), made and removed by the leading scheduler every `ORCA_POOL_SCALE_SECONDS` (15).
- [orca.pressure](https://morca.dev/docs/api/pressure.md): Memory pressure (#202): Linux's pressure stall information (PSI) for memory, read each tick, and the admission rule built on it.
- [orca.proc](https://morca.dev/docs/api/proc.md): Starting processes: what the scheduler needs to run pipeline binaries.
- [orca.queueing](https://morca.dev/docs/api/queueing.md): Queueing runs over keys: backfills, the keys a pipeline has done or holds, and what a rerun or an append refuses.
- [orca.recommend](https://morca.dev/docs/api/recommend.md): Requests learned from what a pipeline's runs used (#269): shown on its Resources card and in `orca config show`, and applied where its `cpus` or `memory_gb` is `auto` (`resolve_request`).
- [orca.registered](https://morca.dev/docs/api/registered.md): A registered pipeline as the scheduler reads it (`Registered`, `registered`), and what its runs ask for (`run_request`).
- [orca.registering](https://morca.dev/docs/api/registering.md): `orca register`: recording a pipeline binary and how its runs run (`register_pipeline`).
- [orca.registry](https://morca.dev/docs/api/registry.md): Which architectures a container image has (#267): the pool autoscaler makes a machine only of a type the worker image runs on.
- [orca.remote](https://morca.dev/docs/api/remote.md): The `orca` command against a deployed `orca ui`, over HTTPS, as a user of it: log in once, then act from anywhere the UI can be reached.
- [orca.resources](https://morca.dev/docs/api/resources.md): Resource requests and grants (#171): runs sized to their share of the machine.
- [orca.sample](https://morca.dev/docs/api/sample.md): The sampler: a run's machine metrics, one JSON line every few seconds.
- [orca.schedule](https://morca.dev/docs/api/schedule.md): Schedules: when a pipeline runs by itself, and which partition it fills.
- [orca.scheduler](https://morca.dev/docs/api/scheduler.md): The scheduler: fires schedules, senses datasets, queues backfills and rebuilds, and starts runs.
- [orca.secrets](https://morca.dev/docs/api/secrets.md): Secrets a pipeline's runs get: `orca register --secret NAME=ID`.
- [orca.sensing](https://morca.dev/docs/api/sensing.md): Fires and sensors (`orca.scheduler`): a schedule's fires, and a sensor's snapshots, keyed or by partition.
- [orca.sensors](https://morca.dev/docs/api/sensors.md): Runs started by datasets: sensors, and rebuilds downstream of a dataset.
- [orca.source](https://morca.dev/docs/api/source.md): Where a pipeline binary's code came from: its git repository and commit, given at build time.
- [orca.sqlite_store](https://morca.dev/docs/api/sqlite_store.md): orca's runs in a SQLite file: `SqliteStore`, for single-node orca.
- [orca.starting](https://morca.dev/docs/api/starting.md): Starting runs (`orca.scheduler`): due retries, dead runs and queued ones, within `max_runs`, memory pressure, grants and the vCPU budget; and a control-placed run's process.
- [orca.state](https://morca.dev/docs/api/state.md): orca's state in Postgres: pipelines, runs, steps and attempts.
- [orca.step](https://morca.dev/docs/api/step.md): Steps: the functions a pipeline runs, and the edges between them.
- [orca.store](https://morca.dev/docs/api/store.md): Where the executor records what it does.
- [orca.system](https://morca.dev/docs/api/system.md): The control instance's own health: `/ops/control`, the gauges on `/metrics`, and the warning on the home page.
- [orca.tables](https://morca.dev/docs/api/tables.md): Iceberg tables from steps: pinned reads, and commits a retry recognises.
- [orca.tasks](https://morca.dev/docs/api/tasks.md): The dista tasks a pipeline's steps call, and the runtime a run gets.
- [orca.tick](https://morca.dev/docs/api/tick.md): One pass of the scheduler (`orca tick`; `orca scheduler` makes one a second): what each registered pipeline is due, started.
- [orca.timekeys](https://morca.dev/docs/api/timekeys.md): Time keys by their partitions' kind (`monthly`, `daily`, `hourly`), as text: for code that has a pipeline's kind as a string, not its type.
- [orca.timeline](https://morca.dev/docs/api/timeline.md): A run's Dista timeline and its workers over time, drawn as SVG on the server for the run's page.
- [orca.tokens](https://morca.dev/docs/api/tokens.md): API tokens: what `orca login` gets from `orca ui`, so the `orca` command on another machine can act as a user of it (`orca.remote`).
- [orca.toml](https://morca.dev/docs/api/toml.md): The TOML that `orca.toml` is written in (`orca.config`): a parser and a writer for the subset a configuration file needs.
- [orca.tz](https://morca.dev/docs/api/tz.md): Time zones, from the system's TZif files (RFC 8536).
- [orca.ui](https://morca.dev/docs/api/ui.md): orca's pages: HTML, each page in a module of its own, over the read models of `orca.views`; `orca.web.routes` says which path is which.
- [orca.ui.alerts](https://morca.dev/docs/api/ui/alerts.md): Ops › Alerts (`/ops/alerts`): every alert `orca.notify` sent or is sending, newest first, from `orca.alerts`: when, its kind, its title and message as sent, links to what it is about (the run, the pipelines, the watchdog's rules, a worker, Control), whether ntfy took it, and for those that resolve (a watchdog trip, a stalled fill, the disk, memory pressure, an `orca notify` that was later `--resolved`) whether it is still open.
- [orca.ui.attempt](https://morca.dev/docs/api/ui/attempt.md): `/runs/<id>/attempts/<attempt>`, an attempt's page: its log, with its error, and its facts, which refresh from `/facts` while it runs.
- [orca.ui.code](https://morca.dev/docs/api/ui/code.md): `/code?u=`: a file at a commit on GitHub, its lines coloured as HTML (`orca.highlight`), for the code shown on hover; the UI fetches it, so a browser needn't reach GitHub.
- [orca.ui.contained](https://morca.dev/docs/api/ui/contained.md): Ops > Control's Runs card: each local and control-placed run going on this host, with its cgroup's memory against its limit (`orca.cgroup`), which the scheduler records every 5 seconds, and its grant (`orca.resources`).
- [orca.ui.coverage](https://morca.dev/docs/api/ui/coverage.md): The Coverage card on a dated pipeline's Operate tab: its partitions' states (`orca.calendar`) as plain HTML, read-only.
- [orca.ui.datasets](https://morca.dev/docs/api/ui/datasets.md): `/datasets`, the datasets and the graph of pipelines and datasets; `/datasets/<name>`, a dataset's writers, readers, snapshots and what a rebuild of it runs; `/datasets/<name>/snapshots/<id>`, a snapshot's lineage (`orca.lineage`); `/rebuilds/<id>`, a rebuild's runs by level.
- [orca.ui.home](https://morca.dev/docs/api/ui/home.md): `/`, the home page: the pipelines, with their coverage (`orca.coverage`), schedules, next and last runs, the recent runs, and the Timeline tab (`orca.ui.viz`); `/home/pipelines` is its table of pipelines, as the fragment it refreshes from.
- [orca.ui.layout](https://morca.dev/docs/api/ui/layout.md): Every page's frame (`page_html`): its head, the nav, the slots the server fills in with who's logged in (`orca.web.server`), and the scripts every page has (`_POLL` for live fragments, `_TABS`, `_TIPS`, `_PEEK` for code on hover); and what every page draws with: cards, facts, help, action buttons, and the 404 and 400 pages.
- [orca.ui.login](https://morca.dev/docs/api/ui/login.md): The login page (`/login`, `orca.web.auth`).
- [orca.ui.machines](https://morca.dev/docs/api/ui/machines.md): A run's machines on its page: each instance with its role, its metrics' peaks and warnings (`orca.metrics`), and the steps that ran on it.
- [orca.ui.ops](https://morca.dev/docs/api/ui/ops.md): The Ops pages: Control (`/ops/control`, the machine running the scheduler, the UI and Postgres; `orca.system`), the watchdog (`/watchdog`; `orca.watchdog`) and Prometheus' `/metrics`, with the fragments each refreshes from; Alerts (`/ops/alerts`, where `/ops` goes) is `orca.ui.alerts` and Pools (`/ops/pools`) is `orca.ui.pools`. Fleet and Workers' old paths redirect to Pools (`moved`, `to_pools`).
- [orca.ui.parts](https://morca.dev/docs/api/ui/parts.md): Pieces several pages draw: durations, times and partitions in a table's cells, a runs table with each row's actions, links to code, and a run's grant and usage as facts.
- [orca.ui.pipeline](https://morca.dev/docs/api/ui/pipeline.md): `/pipelines/<name>`, a pipeline's page: Overview (its cards: Progress, Steps, Code, Resources, Configuration), Runs and Operate (Start runs, cancel, pause), each a tab of its own; `/progress`, the Progress card as the fragment it refreshes from; and `/keys/<key>`, one key of a keyed pipeline in every run it was in.
- [orca.ui.pools](https://morca.dev/docs/api/ui/pools.md): Ops' Pools (`/ops/pools`): a row per machine of every pool runs are placed on (`orca.views.pools`), filtered by pool and kind with plain links, refreshed every 10 s from `/ops/pools/live`; a machine's own page (`/ops/pools/<kind>/<id>`); and `/api/pools`. With EC2 in view the page keeps Fleet's summary cards and charts (`orca.fleet`).
- [orca.ui.run](https://morca.dev/docs/api/ui/run.md): `/runs/<id>`, a run's page: its cards (Status, Partitions & trigger, Code, Resources, Settings), its steps as a table, a timeline or a graph, its machines, its snapshots and who acted on it; and its fragments and files: `/live`, `/steps`, `/metrics`, `timeline.json`, `driver.log` and each machine's log.
- [orca.ui.runs](https://morca.dev/docs/api/ui/runs.md): `/runs`, the runs list: newest first, filtered by pipeline, status (any of several, each with its count), trigger, when it was created, a run and its partitions, a page at a time (`orca.views.runs.RunsPage`), and its runs picked to cancel, retry or backfill again in one go (`orca.api.actions.bulk`); `/runs/table` is a list's page as the fragment it refreshes from, for `/runs`, a pipeline's Runs tab and the home page.
- [orca.ui.start](https://morca.dev/docs/api/ui/start.md): Start runs, on a pipeline's Operate tab: the form, its date picker (`orca.ui.coverage`), and the preview of what it would queue (`orca.views.start`), updated as you type.
- [orca.ui.step_cards](https://morca.dev/docs/api/ui/step_cards.md): A card per step, on hover, keyboard focus or a tap, in the UI's steps views: a pipeline's Steps card (Graph and Table) and a run's (Table, Timeline and Graph).
- [orca.ui.style](https://morca.dev/docs/api/ui/style.md): The stylesheet `orca ui` serves at `/static/orca.css`: magmalake.dev's colours and type, light and dark, and system fonts (nothing is fetched).
- [orca.ui.terms](https://morca.dev/docs/api/ui/terms.md): What the UI's words mean, in one place: the help on every table's column headers, and on the values that come from a fixed set (statuses, step kinds, triggers, placements, where a setting came from), so the same word has the same explanation on every page.
- [orca.ui.viz](https://morca.dev/docs/api/ui/viz.md): Two views `orca ui` draws in the browser: a run's Dista timeline, and the pipelines over time on the home page. Both are plain scripts in the page (nothing is fetched from elsewhere) over JSON the UI serves, and both load that JSON only when they're looked at, so the pages stay as fast as they were.
- [orca.upgrade](https://morca.dev/docs/api/upgrade.md): A release's upgrade steps (#323): what has to be done before or after a deploy, which a project's image ships in `upgrade.toml` and the Hetzner deploy shows or runs (`deploy/hetzner/deploy.sh`).
- [orca.usage](https://morca.dev/docs/api/usage.md): What a run's processes use: each attempt's peak memory and CPU.
- [orca.views](https://morca.dev/docs/api/views.md): What the pages and their JSON show, read from the database once into typed rows: the query layer `orca.ui` and `orca.api` share.
- [orca.views.code](https://morca.dev/docs/api/views/code.md): Where a pipeline's code is: each step's line at the commit a run, or the registration, was built from (`CodeLinks`), for the link beside every step a page shows.
- [orca.views.commands](https://morca.dev/docs/api/views/commands.md): The `orca` command lines the pages show beside their buttons, so what the UI does can be done from a shell, quoted for `sh`.
- [orca.views.datasets](https://morca.dev/docs/api/views/datasets.md): Datasets as their pages read them: the steps that write and read one, and what a rebuild of it would queue (`RebuildPreview`).
- [orca.views.pipelines](https://morca.dev/docs/api/views/pipelines.md): Pipelines as the pages and their JSON read them: `PipelineRow` (a registration with its schedule and live runs), its steps (`StepDef`), its next fires, a keyed pipeline's counts (`KeyCounts`), its fill, and the Resources card's summary of what its runs used (`UsageSummary`).
- [orca.views.pools](https://morca.dev/docs/api/views/pools.md): Ops' Pools (`/ops/pools`): every machine runs are placed on, one row each, by the pool a placement names.
- [orca.views.runs](https://morca.dev/docs/api/views/runs.md): Runs as the pages and their JSON read them: `RunRow` with its grant and what it used, its steps (`StepRow`), the tables they read and wrote (`Touch`), its machines (`InstanceRow`) and code (`VersionRow`), a step's attempts (`AttemptRow`), and a runs list's page (`RunsQuery`, `RunsPage`: keyset by run id, so pages stay put as runs arrive).
- [orca.views.start](https://morca.dev/docs/api/views/start.md): What Start runs would queue (`StartPreview`), as a sentence and as the command that queues it, for a pipeline's Operate tab and its JSON.
- [orca.views.steps](https://morca.dev/docs/api/views/steps.md): What the step cards show (`orca.ui.step_cards`): each step's card, with what its attempts in the pipeline's latest runs did, and on a run's page each attempt's.
- [orca.warehouse](https://morca.dev/docs/api/warehouse.md): A dataset's current snapshot, read from its table's metadata file without iceberg, for `<binary> sense`.
- [orca.watchdog](https://morca.dev/docs/api/watchdog.md): The watchdog: pauses pipelines when something leaves a sane range.
- [orca.web](https://morca.dev/docs/api/web.md): orca's web server: one router over the pages (`orca.ui`) and the JSON API (`orca.api`), who each request is from, and the listeners.
- [orca.web.auth](https://morca.dev/docs/api/web/auth.md): Who a request is from, and whether it may act: the session cookie of a browser, the API token of a script (`orca --remote`), and the checks that keep another site's page from posting to the UI. Also the endpoints that log in and out. The users, sessions and audit rows themselves are `orca.auth`; API tokens are `orca.tokens`; a worker's token is checked by `orca.api.worker` instead, and gets nothing here.
- [orca.web.drain](https://morca.dev/docs/api/web/drain.md): Stopping `orca ui` without dropping a request. `docker stop` sends SIGTERM and waits 10 s before it kills; Ctrl-C sends SIGINT. Either one starts a drain:
- [orca.web.page](https://morca.dev/docs/api/web/page.md): What a handler answers, `Page`: its status, its JSON and its HTML, where to send a browser, and `respond`, which sends it: the HTML, or the JSON to a script; a fragment or a file as itself, whatever was asked for.
- [orca.web.router](https://morca.dev/docs/api/web/router.md): The router: a table of routes, each a method, a path pattern, what kind of request it is and the handler that answers it. `orca.web.routes` is the table; `orca.web.server` looks a request up here and wraps the handler in what its kind needs.
- [orca.web.routes](https://morca.dev/docs/api/web/routes.md): Every path `orca ui` answers, and what answers it: the route table `orca.web.server` serves (`orca.web.router` for how a path matches).
- [orca.web.server](https://morca.dev/docs/api/web/server.md): `orca ui`'s server: one handler that looks each request up in the route table (`orca.web.routes`), checks who it's from (`orca.web.auth`) and answers it as its route's kind says.
- [orca.worker](https://morca.dev/docs/api/worker.md): `orca worker`: runs a pool's runs on this machine, talking only to `orca ui`'s API.
- [orca.workers](https://morca.dev/docs/api/workers.md): Remote workers, the server's side: worker tokens, claims, and the store calls a worker's runs make over `orca ui` (`orca.http_store`).

orca: orchestration for Mojo data pipelines.

Declare steps and the pipeline they make, and give the binary orca's
command line:

```mojo
from dista import Seq
from orca import Ctx, Gather, Mapped, Month, Pipeline, Step, orca_main

def size(mut ctx: Ctx, m: Month) raises -> Int:
    return m.month * 100

def total(mut ctx: Ctx, sizes: Seq[Int]) raises -> Int:
    var t = 0
    for i in range(len(sizes)):
        t += sizes[i]
    return t

comptime Size = Step["size", Month, Int, size, Mapped]
comptime Total = Step["total", Seq[Int], Int, total, Gather, after=Size]
comptime Sizes = Pipeline["sizes", Size, Total]

def main() raises:
    orca_main[Sizes]()
```

See DESIGN.md for how it works and where it's going.
