# orca.locate

> A module of Orca's API.

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 locate ./build/taxi --root .     # writes ./build/taxi.source.json

`describe` names each function by its module path, `taxi::trips(...)` or
`lake::steps::parse(...)`; the module is a file, `taxi.mojo` or
`lake/steps.mojo`, under one of the source tree's directories. `locate`
finds the file whose path ends with it and the line of its top-level `def`
(or `fn`), and the line declaring the pipeline itself (`Pipeline[` with its
name first), kept as `"pipeline"`. The map, `{"pipeline":
"examples/taxi/taxi.mojo#L243", "taxi::trips": "examples/taxi/taxi.mojo#L42",
...}`, is written beside the binary, and `orca register` records it with the
pipeline's version. Paths are relative to `--root`, which is the
repository's root for the links to work.

## Functions

### `function_key`

```mojo
def function_key(name: String) -> String
```

`module::fn`, without the arguments describe writes after it.

### `mojo_files`

```mojo
def mojo_files(root: String) -> List[String]
```

The `.mojo` files under `root`, as paths relative to it, skipping hidden directories and `build`.

### `locate`

```mojo
def locate(describe: String, root: String) -> String
```

The map of `describe`'s step functions and tasks to `file#Lline` under `root`, as JSON; a function it can't find is left out.
