# Shapes, not values

> Ormaos records the type, length and structure of what a program handled, and records values only in a run where you ask for them with --values.

By default Ormaos never records the value of an argument, a result, an environment variable or an exception message. It records its shape: type, length and structure.

```console
$ ormaos tree r1:c130 --depth 1 --limit 4
inside: r1:c1 <module> > r1:c16 main
r1:c130 sync_orders(conn: sqlite3.Connection, orders: list[36 parse.Order]) -> int  job.py:49  …  io 180  logs 6  [swallowed 6x validate.SkuFormatError: r1:e1]  calls below: 66
  r1:c131 check_order(order: parse.Order) -> NoneType  validate.py:47  …  calls below: 3
  r1:c135 apply_order(conn: sqlite3.Connection, order: parse.Order) -> bool  inventory.py:78  …  io 6  calls below: 1
  r1:c137 check_order(order: parse.Order) -> NoneType  validate.py:47  …  calls below: 3
... 63 of the 66 calls directly below r1:c130 are not shown (34 check_order, 29 apply_order; 6 raised): --offset 3
next: ormaos exceptions r1:e1 | ormaos tree r1:c130 --offset 3 | ormaos tree r1:c131 | ormaos tree r1:c16 | ormaos exceptions r1:c130
```

`orders: list[36 parse.Order]` is a list of 36 `parse.Order` objects; `str[3]` is a string of three characters; `dict[2]` a dict of two items; `DataFrame[200x4]` a frame of 200 rows and 4 columns; `Tensor[8x4 float32 cpu]` a tensor.

## What is never recorded by default

Arguments, results, exception messages, the values of environment variables, the values on the command line, SQL parameters and literals, file contents, request headers and bodies, URL query strings, the arguments and the formatted message of a logging record, the cells of a DataFrame, the numbers of an array or a tensor.

Two things come close and are said where they appear: the smallest and the largest number of an array are numbers of your data, and the names of the columns of a DataFrame are recorded as names.

## The command line

The command is recorded by name: the executable, a Python interpreter further along the command, the script path or the module after `-m`, and the names of options. Every other word is a value and is kept as its shape, `<str[N]>`:

```text
$ ormaos run -- python job.py --token abc --mode=fast
$ ormaos show
...
command: python job.py --token <str[3]> --mode=<str[4]>
```

## Names are recorded

File paths, the names of functions, classes and exception types, table names, host names, the names of programs and loggers, the labels of DataFrame columns that are text. A message template is text written in your code, like a SQL statement, and is recorded. A name that your program builds from data (a class made with `type(name, ...)`, a file named after a customer) is recorded as it is.

## Values, only when you ask: `--values`

```bash
ormaos run --values -- python app.py
```

Without this option no value is recorded, and nothing turns it on by itself. With it, this one recording also holds the arguments and results of the calls and the messages of the exceptions:

- when they are `None`, `bool`, `int`, `float`, `str`, or a `list`, `tuple`, `set`, `frozenset` or `dict` of those (two levels, the first 10 items); an object of any other type keeps its shape only, because writing it would run code of your program;
- each cut at 200 characters (`ORMAOS_MAX_VALUE`), with the full length said;
- with what is likely a secret written as `***`: a value whose name says so (`token`, `key`, `password`, `secret`, `auth`, `cookie`, `session`, `credential`), the user and password of a URL, `name=value` pairs with such a name, `Bearer ...`, keys with a known prefix, and long random strings.

The same call, without and with `--values`:

```console
$ ormaos tree r1:c19
inside: r1:c1 <module> > r1:c4 main
r1:c19 summarize(base: str[22], ticket: dict[2]) -> str[55]  app.py:24  …  io 2  [swallowed 1x urllib.error.HTTPError: r1:e1]  calls below: 2
  r1:c20 ask(base: str[22], model: str[7], prompt: str[665]) -> raised  app.py:14  …  io 1
  r1:c25 ask(base: str[22], model: str[7], prompt: str[665]) -> str[55]  app.py:14  …  io 1
next: ormaos exceptions r1:e1 | ormaos tree r1:c4 | ormaos exceptions r1:c19
```

```console
$ ormaos tree r2:c19
inside: r2:c1 <module> > r2:c4 main
r2:c19 summarize(base: str[22]="http://127.0.0.1:…", ...) -> str[55]="The export to CSV leaves out the last day of the month."  app.py:24  …  io 2  [swallowed 1x urllib.error.HTTPError: r2:e1]  calls below: 2
  r2:c20 ask(base: str[22]="http://127.0.0.1:…", model: str[7]="small-1", ...) -> raised  app.py:14  …  io 1
  r2:c25 ask(base: str[22]="http://127.0.0.1:…", model: str[7]="large-1", ...) -> str[55]="The export to CSV leaves out the last day of the month."  app.py:14  …  io 1
next: ormaos exceptions r2:e1 | ormaos tree r2:c4 | ormaos exceptions r2:c19
```

The recording says that it holds values, in the header of every process file, in `ormaos show` and in `not_collected`:

```console
$ ormaos show r2
r2 exit 0 in …: 1 Python process, 70 calls, 3 exceptions (3 swallowed, 0 uncaught)
command: python app.py
code: git commit not read (the working directory is not inside a git repository)
swallowed 3x urllib.error.HTTPError at app.py:28 in summarize, raised at /tmp/ormaos-docs-python/cpython-3.14.4-linux-x86_64-gnu/lib/python3.14/urllib/request.py:611  [r2:e1]
io: 112 events (file 101, http 11)
io: 98x file write summaries.json from app.py:38  [r2:i15]
io: 5x http POST http://127.0.0.1:…/v1/models/small-1/generate -> 200 from app.py:20  [r2:i3]
io: 3x http POST http://127.0.0.1:…/v1/models/small-1/generate -> 503 from app.py:20  [r2:i5]
io: 3x http POST http://127.0.0.1:…/v1/models/large-1/generate -> 200 from app.py:20  [r2:i6]
values: recorded in this recording (cut at 200 characters, likely secrets written as ***): it holds data of the program
not collected: io: sockets, at model_server.py:51 (once): a socket was connected or bound there; sockets are not recorded, only HTTP made through http.client or httpx is
never recorded: values of other types, and what is past the size limit, and 20 more kinds of things (`ormaos show --full` lists them with the reason)
next: ormaos exceptions r2:e1 | ormaos tree r2:c1 | ormaos io r2 | ormaos io r2:i15
```

> **Masking is a best effort.**
> Masking goes by names and forms. A secret with a plain name and a plain form is written; a harmless long identifier can be hidden. Environment values, SQL parameters, file contents, request bodies and the arguments of logging records are not recorded with `--values` either. `ormaos diff` does not compare values.

---

Source: https://docs.ormaos.com/python/concepts/shapes-and-values/ · ormaos 0.0.1 · ormaos-python 968f69776c · ormaos-examples 6e27be5922
