---
title: "How UORust was modeled"
url: https://afflom.github.io/prism-devrel/case-studies/uorust/
diataxis: explanation
developer-journey: evaluate
collection: case-studies
collection-group: "UORust"
subject: https://github.com/afflom/uorust
commit: afd5cea950a8987da02bbf0cc7cca420b71c4b53
---

# How UORust was modeled

> Who the UORust model is for and what they care about. Then how those concerns became facets.

**Figure: The records of UORust by facet.** Every record of the UORust model, counted by facet. Each one is taught by at least one page of this case study.

| | Count |
| --- | --- |
| Architecture | 61 |
| Design views | 73 |
| Features and journeys | 15 |
| Security and threat model | 108 |
| Quality | 40 |
| Behavior and proofs | 29 |
| System and release | 2 |
| Extension facets | 2 |
| Application | 1 |

UORust says what it is in its own model:

> Routes each kind of Rust fact UORust reads from a Cargo workspace to the one Prism record kind it emits, or refuses it.

Subject: [UORust](https://github.com/afflom/uorust) at commit [`afd5cea950a8`](https://github.com/afflom/uorust/tree/afd5cea950a8987da02bbf0cc7cca420b71c4b53), 331 facet records, source digest `f3f743b6834adaff`.

This case study reads every facet record of UORust. Each record is taught by at least one page here, and no page teaches a record UORust does not declare.

331 records, 331 covered, 14 pages, 9 facets.

## People, concerns and the application

These are the records of UORust that say who the model is for, what they care about, and what its holo is built from. Each viewpoint of the architecture pairs one stakeholder with one concern.

### `Completeness of the model`

`Architecture::concernCompleteness` · Concern · #14 · [source](https://github.com/afflom/uorust/blob/afd5cea950a8987da02bbf0cc7cca420b71c4b53/app/src/Architecture.lex.tex)

> Every fact uorust reads is routed to exactly one record kind or refused; nothing is dropped silently.

- index: `0`

Taught by: case-study, architecture

### `Deterministic output`

`Architecture::concernDeterminism` · Concern · #15 · [source](https://github.com/afflom/uorust/blob/afd5cea950a8987da02bbf0cc7cca420b71c4b53/app/src/Architecture.lex.tex)

> Running uorust twice on the same workspace writes byte-identical files.

- index: `1`

Taught by: case-study, architecture

### `Discoverability`

`Architecture::concernDiscoverability` · Concern · #16 · [source](https://github.com/afflom/uorust/blob/afd5cea950a8987da02bbf0cc7cca420b71c4b53/app/src/Architecture.lex.tex)

> A newcomer can learn what UORust does from its published page and run its route table in the browser.

- index: `2`

Taught by: case-study, architecture

### `Fidelity to the source`

`Architecture::concernFidelity` · Concern · #17 · [source](https://github.com/afflom/uorust/blob/afd5cea950a8987da02bbf0cc7cca420b71c4b53/app/src/Architecture.lex.tex)

> Every emitted record traces to the Rust item, manifest entry or lock entry it came from.

- index: `3`

Taught by: case-study, architecture

### `No silent defaults`

`Architecture::concernNoDefaults` · Concern · #18 · [source](https://github.com/afflom/uorust/blob/afd5cea950a8987da02bbf0cc7cca420b71c4b53/app/src/Architecture.lex.tex)

> An ambiguous or unknown fact is refused with a typed reason and recorded as an open claim, never resolved by a guess.

- index: `4`

Taught by: case-study, architecture

### `Read-only ingestion`

`Architecture::concernReadOnly` · Concern · #19 · [source](https://github.com/afflom/uorust/blob/afd5cea950a8987da02bbf0cc7cca420b71c4b53/app/src/Architecture.lex.tex)

> uorust reads the subject workspace and never builds it, runs its build scripts or sends its source anywhere.

- index: `5`

Taught by: case-study, architecture

### `Supply-chain integrity`

`Architecture::concernSupplyChain` · Concern · #20 · [source](https://github.com/afflom/uorust/blob/afd5cea950a8987da02bbf0cc7cca420b71c4b53/app/src/Architecture.lex.tex)

> The released binary, its dependencies and the published page are what the locked sources say they are.

- index: `6`

Taught by: case-study, architecture

### `DevRel author`

`Architecture::stakeholderDevRelAuthor` · Stakeholder · #42 · [source](https://github.com/afflom/uorust/blob/afd5cea950a8987da02bbf0cc7cca420b71c4b53/app/src/Architecture.lex.tex)

> Writes the walkthroughs and explorers that teach UORust, and covers every facet record with a resource.

- index: `0`

Taught by: case-study, architecture

### `Maintainer`

`Architecture::stakeholderMaintainer` · Stakeholder · #43 · [source](https://github.com/afflom/uorust/blob/afd5cea950a8987da02bbf0cc7cca420b71c4b53/app/src/Architecture.lex.tex)

> Changes the route table, the engine and this model, and keeps the Rust router, the verified table and the Pages site in step.

- index: `1`

Taught by: case-study, architecture

### `Prism modeler`

`Architecture::stakeholderPrismModeler` · Stakeholder · #44 · [source](https://github.com/afflom/uorust/blob/afd5cea950a8987da02bbf0cc7cca420b71c4b53/app/src/Architecture.lex.tex)

> Reads, checks and extends the Prism project uorust emits, and relies on every record tracing to a source span.

- index: `2`

Taught by: case-study, architecture

### `Rust developer`

`Architecture::stakeholderRustDeveloper` · Stakeholder · #45 · [source](https://github.com/afflom/uorust/blob/afd5cea950a8987da02bbf0cc7cca420b71c4b53/app/src/Architecture.lex.tex)

> Owns a Cargo workspace and runs uorust to get a Prism model of it without writing the model by hand.

- index: `3`

Taught by: case-study, architecture

### `Security reviewer`

`Architecture::stakeholderSecurityReviewer` · Stakeholder · #46 · [source](https://github.com/afflom/uorust/blob/afd5cea950a8987da02bbf0cc7cca420b71c4b53/app/src/Architecture.lex.tex)

> Reviews the threat model uorust derives from unsafe code, effects and the supply chain, and the controls that answer it.

- index: `4`

Taught by: case-study, architecture

### `UORust`

`Routes::application` · TextApplication · #207 · [source](https://github.com/afflom/uorust/blob/afd5cea950a8987da02bbf0cc7cca420b71c4b53/app/src/Routes.lex.tex)

- profile: `prismpm/text-application/3`
- cargoName: `uorust-routes`
- cargoVersion: `0.1.1`
- cargoDescription: `Routes each kind of Rust fact UORust reads from a Cargo workspace to the one Prism record kind it emits, or refuses it.`
- cargoRepository: `https://github.com/afflom/uorust`
- cargoHomepage: `https://afflom.github.io/UORust/`
- libraryRoots:
  - `Uorust.Routes.dispatch`
- acceptanceVectors: `(acceptanceVectors)`
- entryRoot: `Uorust.Routes.dispatch`
- coreContract: `hologram:guest/core-wasm@1`
- requestMaximum: `(318 : UInt32)`
- responseMaximum: `(8192 : UInt32)`
- guestAllocationMaximum: `(319 : UInt32)`
- coreMemoryPages: `(ctor Option.some [UInt32] (32 : UInt32))`
- coreStackBytes: `(ctor Option.some [UInt32] (65536 : UInt32))`
- capabilitiesEmpty: `true`
- fatArchive: `true`
- primaryLayer: `(0 : UInt8)`
- viewLayer: `(1 : UInt8)`
- view: TextView
  - title: `UORust route table`
  - heading: `UORust route table`
  - inputLabel: `Rust fact kinds, one per line`
  - submitLabel: `Route`
  - outputLabel: `Route or refusal`
  - inputError: `Enter UTF-8 text of at most 512 bytes.`
  - responseError: `The answer could not be displayed.`
- cli: TextCli
  - command: `route`
  - description: `UORust reads a Cargo workspace and writes a complete Prism model of it. This page runs UORust's route table, the verified function that decides which Prism record each kind of Rust fact becomes, or refuses the fact. `
  - usageCode: `(64 : UInt8)`
  - ioCode: `(74 : UInt8)`
  - limitCode: `(ctor Option.none [UInt8])`
  - outcomes:
    - TextCliOutcome
      - name: `routed`
      - prefix: `route `
      - exitCode: `(0 : UInt8)`
    - TextCliOutcome
      - name: `refused`
      - prefix: `refused `
      - exitCode: `(1 : UInt8)`
    - TextCliOutcome
      - name: `error`
      - prefix: `error `
      - exitCode: `(2 : UInt8)`
  - sections:
    - TextCliSection
      - title: `REQUEST`
      - body: `One kind of Rust fact per line, such as pub-fn, error-enum or unsafe-block. Every line must name the same route. `
    - TextCliSection
      - title: `ANSWER`
      - body: `    route ID, fact KIND, record PRISM-RECORD, facet FACET         the one route every kind names     refused unknown-fact, fact KIND         no route names the kind     refused ambiguous, fact KIND, fact KIND         two kinds name different routes     error REASON         the request is empty, too large, not UTF-8 or has a blank line `
  - examples:
    - TextCliExample
      - name: `routed`
      - text: `error-enum`
    - TextCliExample
      - name: `ambiguous`
      - text: `error-enum state-enum`
- workbench: `(ctor Option.some [Foundation.View.Text.V3.Model::WorkbenchView] (Guide::view))`

Taught by: getting-started, case-study, slides

## How the facets answer each concern

For each concern, the records of UORust that name it or name a viewpoint that frames it, counted by facet. Each count links to the first such record.

| Concern | Named by |
| --- | --- |
| Completeness of the model | [Architecture: 2](https://afflom.github.io/prism-devrel/case-studies/uorust/architecture/#Architecture-viewpointPipelineCompleteness), [Design views: 1](https://afflom.github.io/prism-devrel/case-studies/uorust/design/#Design-viewOpmPipeline) |
| Deterministic output | [Architecture: 2](https://afflom.github.io/prism-devrel/case-studies/uorust/architecture/#Architecture-viewpointDeterminism) |
| Discoverability | [Architecture: 2](https://afflom.github.io/prism-devrel/case-studies/uorust/architecture/#Architecture-viewpointDiscoverability) |
| Fidelity to the source | [Architecture: 2](https://afflom.github.io/prism-devrel/case-studies/uorust/architecture/#Architecture-viewpointPipelineFidelity), [Design views: 2](https://afflom.github.io/prism-devrel/case-studies/uorust/design/#Design-viewUmlComponents) |
| No silent defaults | [Architecture: 2](https://afflom.github.io/prism-devrel/case-studies/uorust/architecture/#Architecture-viewpointRefusal), [Design views: 1](https://afflom.github.io/prism-devrel/case-studies/uorust/design/#Design-viewUmlFactAdmission) |
| Read-only ingestion | [Architecture: 2](https://afflom.github.io/prism-devrel/case-studies/uorust/architecture/#Architecture-viewpointReadOnly) |
| Supply-chain integrity | [Architecture: 2](https://afflom.github.io/prism-devrel/case-studies/uorust/architecture/#Architecture-viewpointSupplyChain) |

## How far the lift reaches

**Figure: How far UORust lifts itself.** Every function of its product code, by row of its lift register. The rows that are not lifted are the distance still to go.

| | Count |
| --- | --- |
| residue | 443 |
| foreign | 34 |
| effect | 55 |
| lifted | 230 |

UORust lifts its own functions too. It keeps the result in [`frontier.toml`](https://github.com/afflom/uorust/blob/afd5cea950a8987da02bbf0cc7cca420b71c4b53/frontier.toml), the register its gate passes to `--register`. Every function of its product code has one row. The rows not lifted are the distance to the goal that every function lifts. That goal is an open claim, measured at each commit:

| Row | Rows | Meaning |
| --- | --- | --- |
| residue | 443 | A pure function outside the lift so far, with the construct that stopped it. |
| foreign | 34 | Its parameter or result is a type of a dependency with no LexLean model yet. |
| effect | 55 | The I/O shell. It reads files, the environment, a process or the network, and is recorded as a capability in the security facet. |
| lifted | 230 | The function became a LexLean definition the kernel checks. |

Here is the residue by the construct that stopped the lift. It is the work list for the next lifts:

| Reason | Functions |
| --- | --- |
| mir | 348 |
| type | 59 |
| form | 17 |
| collision | 8 |
| call | 7 |
| arithmetic | 3 |
| statements | 1 |

The [tutorial](https://afflom.github.io/prism-devrel/case-studies/uorust/getting-started/#frontier) shows what one lifted row looks like.

## Learning paths

The pages of this case study, by the stage of the developer journey each one serves:

- Discover: [Slides and video script](https://afflom.github.io/prism-devrel/case-studies/uorust/slides/).
- Evaluate: [Security and threat model](https://afflom.github.io/prism-devrel/case-studies/uorust/security/), [Quality model (ISO/IEC 25010)](https://afflom.github.io/prism-devrel/case-studies/uorust/quality/).
- Learn: [Turn a Rust project into a Prism model](https://afflom.github.io/prism-devrel/case-studies/uorust/getting-started/), [Architecture walkthrough](https://afflom.github.io/prism-devrel/case-studies/uorust/architecture/), [Design views in OPM and UML](https://afflom.github.io/prism-devrel/case-studies/uorust/design/), [Features and journeys](https://afflom.github.io/prism-devrel/case-studies/uorust/features/).
- Build: [Behavior and proofs](https://afflom.github.io/prism-devrel/case-studies/uorust/behavior/), [Extension facets](https://afflom.github.io/prism-devrel/case-studies/uorust/extensions/), [Command reference](https://afflom.github.io/prism-devrel/case-studies/uorust/cli/), [Record explorer](https://afflom.github.io/prism-devrel/case-studies/uorust/explorer/), [llms.txt and Markdown twins](https://afflom.github.io/prism-devrel/case-studies/uorust/agents/).
- Scale: [System and release](https://afflom.github.io/prism-devrel/case-studies/uorust/system/).

## Pages of this case study

| Page | Modality | Records | What you get |
| --- | --- | --- | --- |
| [Turn a Rust project into a Prism model](https://afflom.github.io/prism-devrel/case-studies/uorust/getting-started/) | Walkthrough | 6 | Run UORust on a sample workspace and check what it writes. Then read a Rust function beside the LexLean it became. |
| [How UORust was modeled](https://afflom.github.io/prism-devrel/case-studies/uorust/) | Walkthrough | 13 | Who the UORust model is for and what they care about. Then how those concerns became facets. |
| [Architecture walkthrough](https://afflom.github.io/prism-devrel/case-studies/uorust/architecture/) | Walkthrough | 61 | Who UORust is for, what they care about, its parts and how they connect. |
| [Design views in OPM and UML](https://afflom.github.io/prism-devrel/case-studies/uorust/design/) | Diagrams | 73 | Every design view of UORust, drawn. It shows things, steps, parts, messages and states. |
| [Features and journeys](https://afflom.github.io/prism-devrel/case-studies/uorust/features/) | Walkthrough | 15 | What UORust does, the calls that do it, the rows that accept it, and the paths people take. |
| [Security and threat model](https://afflom.github.io/prism-devrel/case-studies/uorust/security/) | Walkthrough | 108 | The assets of UORust, its threats, risks and controls, and the risks it accepts on purpose. |
| [Quality model (ISO/IEC 25010)](https://afflom.github.io/prism-devrel/case-studies/uorust/quality/) | Reference | 40 | What good quality means for UORust, and the numbers that measure it. |
| [Behavior and proofs](https://afflom.github.io/prism-devrel/case-studies/uorust/behavior/) | Reference | 29 | Every theorem of UORust, and how it is proved. The Lean kernel checks each one. |
| [System and release](https://afflom.github.io/prism-devrel/case-studies/uorust/system/) | Walkthrough | 2 | What UORust ships, its release manifest, and how its holo goes live. |
| [Extension facets](https://afflom.github.io/prism-devrel/case-studies/uorust/extensions/) | Reference | 2 | The records UORust adds of its own. They sit beside the standard facets. |
| [Command reference](https://afflom.github.io/prism-devrel/case-studies/uorust/cli/) | Reference | 0 | Every command and option of the UORust tool, read from its source. Also the commands its gate runs. |
| [Slides and video script](https://afflom.github.io/prism-devrel/case-studies/uorust/slides/) | Slides and script | 9 | One slide for each facet of UORust, with a script to read over it. |
| [Record explorer](https://afflom.github.io/prism-devrel/case-studies/uorust/explorer/) | Interactive | 0 | Search every record of UORust by name, facet or text. Each result links to the pages that teach it. |
| [llms.txt and Markdown twins](https://afflom.github.io/prism-devrel/case-studies/uorust/agents/) | Agent twin | 0 | The UORust case study as plain text for agents. It has llms.txt, a twin of each page and a feed. |

## Facets of UORust

Each facet links to the page that explains it for every Prism model, beside the count for this one:

| Facet | Records |
| --- | --- |
| [Architecture](https://afflom.github.io/prism-devrel/facets/architecture/) | 61 |
| [Design views](https://afflom.github.io/prism-devrel/facets/design/) | 73 |
| [Features and journeys](https://afflom.github.io/prism-devrel/facets/features/) | 15 |
| [Security and threat model](https://afflom.github.io/prism-devrel/facets/security/) | 108 |
| [Quality](https://afflom.github.io/prism-devrel/facets/quality/) | 40 |
| [Behavior and proofs](https://afflom.github.io/prism-devrel/facets/behavior/) | 29 |
| [System and release](https://afflom.github.io/prism-devrel/facets/system/) | 2 |
| [Extension facets](https://afflom.github.io/prism-devrel/facets/extension/) | 2 |
| [Application](https://afflom.github.io/prism-devrel/facets/application/) | 1 |

