vitna.ai/docs/routing/config Machine view
Raw .md llms.txt
> Source: https://vitna.ai/docs/routing/config
> Raw Markdown: https://vitna.ai/docs/routing/config.md
> Corpus index: https://vitna.ai/llms.txt

# Emitting a routing config

`aperture:config` renders an organisation's accepted decisions as a signed
environment fragment.

```bash
DATABASE_MIGRATE_URL=... VITNA_SIGNING_KEY=... npm run aperture:config -- --org convexity
npm run aperture:config -- --org convexity --out /etc/convexity/models.env
```

## Flags

| Flag | Meaning |
|---|---|
| `--org <id>` | Whose config to emit. Required unless verifying. |
| `--out <path>` | Write to a file instead of standard output |
| `--verify <path>` | Check a file instead of emitting one. Takes neither of the above. |

## Which sku a decision emits

| Outcome | Emits |
|---|---|
| `switch` | The candidate |
| `stay` | The incumbent |
| `test` | The incumbent |

A test is an instruction to measure, not a change. Emitting its candidate would
move production traffic on the strength of a proposal that said do not.

## The file

One line per delivery target, plus headers: `org`, `canonical`, `generated`,
`entries`, `digest`, `signature`, `public-key`.

Provenance rides on comment lines marked `#:`, naming the workload and the
decision id behind each value. Those lines are part of the canonical body, so
"this value came from decision 13" is a claim the signature covers rather than
a note anyone can retype.

The statement prefix is `vitna-routing-config-v1`, distinct from the
attestation prefix so a routing signature cannot be read as an attestation. The
canonical form is versioned as `config-lines-v1` and is bumped whenever the
bytes that get hashed change.

## It reads no clock

The instant is passed in, exactly as the brief builder takes one. The same
record and the same instant produce the same bytes, which is what makes a diff
meaningful.

## The eight refusals

A workload with no delivery target is skipped silently, because that is the
ordinary case. A workload that names one and cannot be emitted is named, with
the reason:

| Refusal |
|---|
| Names a delivery kind nothing can write |
| Names a key that is not an environment name |
| Claims a key another workload already claims |
| Has no accepted decision |
| Names a decision that is proposed or superseded rather than accepted |
| Has an accepted switch naming no candidate sku |
| Names no incumbent, so the key has no value behind it |
| Is decided on a sku the registry does not hold, or one that [cannot be named in a request](model-ids.md) |

Every one is a refusal rather than a silent omission, because a config missing a
line leaves whatever the consumer already had in place.

## Nothing is applied

The command prints the file and says so. Diff it against what the consumer
holds, then load it there.
Human Machine Shift+M