# Two-seed bar

> Decide if a two-seed UOR-R4 run beats its baselines, so a result inside the noise is never called a win.

Inspired by UOR-Foundation/uor-r4 (https://github.com/UOR-Foundation/uor-r4), live at https://uor-foundation.github.io/uor-r4/. An open research project testing whether geometry and integer tables can replace a transformer's run-time machinery in a laptop-scale language model. Pattern: Decision table, OMG DMN 1.5, hit policy FIRST. To write one of your own, follow How to build a decision table app (../../guides/decision-table/index.md). The prompt below is data, quoted from the example.

**Figure: What the Two-seed bar app does.** A request goes in, the rules decide, and the Lean kernel has already proved what the rules promise.

| Step | What happens |
| --- | --- |
| 1. Request | seed1, seed2, unigram, t2, target |
| 2. 6 rules | the first that matches wins |
| 3. Answer | pass, trails-unigram, trails-t2, split, inside-band |
| 4. Proved | 3 theorems, 72 tests |

Verified by prismpm verify in the pinned SDK. Fingerprint: 96efafee4f6ed20db5a3881572a19610baf587cc747a9bff02ec5437aa312aac. Acceptance vectors: 72. Claims: 6.

## The prompt

```json
{
  "schema": "prism/prompt/1",
  "pattern": "decisionTable",
  "goal": "Decide if a two-seed UOR-R4 run beats its baselines, so a result inside the noise is never called a win.",
  "repository": "UOR-Foundation/uor-r4",
  "license": "MIT",
  "app": {
    "name": "r4-seed-gate",
    "title": "Two-seed bar",
    "purpose": "Decide whether a saved UOR-R4 model passes the two-seed bar on a test panel, from each seed's top-1 rows right, the unigram baseline and the required target T2 plus max(24, the seeds' spread).",
    "fields": [
      {
        "name": "seed1",
        "kind": "number",
        "min": 0,
        "max": 10000000,
        "means": "rows the seed 1 artifact gets right"
      },
      {
        "name": "seed2",
        "kind": "number",
        "min": 0,
        "max": 10000000,
        "means": "rows the seed 2 artifact gets right"
      },
      {
        "name": "unigram",
        "kind": "number",
        "min": 0,
        "max": 10000000,
        "means": "rows the unigram table gets right"
      },
      {
        "name": "t2",
        "kind": "number",
        "min": 0,
        "max": 10000000,
        "means": "rows the T2 previous-word table gets right"
      },
      {
        "name": "target",
        "kind": "number",
        "min": 0,
        "max": 10000000,
        "means": "the required target: T2 plus max(24, the absolute difference of the two seeds)"
      }
    ],
    "outcomes": [
      "pass",
      "trails-unigram",
      "trails-t2",
      "split",
      "inside-band"
    ],
    "meanings": {
      "pass": "both seeds beat the unigram table and reach the target",
      "trails-unigram": "a seed does not beat the unigram table",
      "trails-t2": "both seeds score below T2",
      "split": "one seed reaches the target and the other does not",
      "inside-band": "both seeds miss the target, at least one at or above T2: inside the noise band, not a win"
    },
    "rules": [
      {
        "when": [
          {
            "field": "seed1",
            "op": "<=",
            "value": {
              "field": "unigram"
            }
          }
        ],
        "then": "trails-unigram",
        "why": "docs/research/notebook/m1-discrete-attention.md G-Fresh-Gate: d11_top1 > unigram for each seed"
      },
      {
        "when": [
          {
            "field": "seed2",
            "op": "<=",
            "value": {
              "field": "unigram"
            }
          }
        ],
        "then": "trails-unigram",
        "why": "docs/research/notebook/m1-discrete-attention.md G-Fresh-Gate: d11_top1 > unigram for each seed"
      },
      {
        "when": [
          {
            "field": "seed1",
            "op": "<",
            "value": {
              "field": "t2"
            }
          },
          {
            "field": "seed2",
            "op": "<",
            "value": {
              "field": "t2"
            }
          }
        ],
        "then": "trails-t2",
        "why": "README.md: the first human-text runs trail the baselines"
      },
      {
        "when": [
          {
            "field": "seed1",
            "op": ">=",
            "value": {
              "field": "target"
            }
          },
          {
            "field": "seed2",
            "op": "<",
            "value": {
              "field": "target"
            }
          }
        ],
        "then": "split",
        "why": "README.md: one seed ahead and one behind is not a win; the bar holds at both seeds"
      },
      {
        "when": [
          {
            "field": "seed2",
            "op": ">=",
            "value": {
              "field": "target"
            }
          },
          {
            "field": "seed1",
            "op": "<",
            "value": {
              "field": "target"
            }
          }
        ],
        "then": "split",
        "why": "README.md: one seed ahead and one behind is not a win; the bar holds at both seeds"
      },
      {
        "when": [
          {
            "field": "seed1",
            "op": "<",
            "value": {
              "field": "target"
            }
          }
        ],
        "then": "inside-band",
        "why": "docs/research/notebook/m1-discrete-attention.md G-Fresh-Gate: >= T2 + max(24, |s1 - s2|); README.md: the 6 Nov best run is inside the noise band, not a win"
      }
    ],
    "otherwise": "pass",
    "otherwiseWhy": "docs/labs/m1-close-saved-model/README.md bar (d): both seeds beat Unigram and reach the T2 target, as 7,002 and 7,001 against 6,324 did",
    "properties": [
      {
        "kind": "never",
        "when": [
          {
            "field": "seed1",
            "op": "<",
            "value": {
              "field": "target"
            }
          }
        ],
        "then": "pass",
        "why": "a seed below the target is not a pass"
      },
      {
        "kind": "never",
        "when": [
          {
            "field": "seed2",
            "op": "<",
            "value": {
              "field": "target"
            }
          }
        ],
        "then": "pass",
        "why": "a seed below the target is not a pass"
      },
      {
        "kind": "never",
        "when": [
          {
            "field": "seed1",
            "op": "<=",
            "value": {
              "field": "unigram"
            }
          }
        ],
        "then": "pass",
        "why": "a model that does not beat word frequency has learned nothing"
      }
    ],
    "examples": [
      {
        "request": "7002 7001 1226 6300 6324",
        "response": "pass"
      },
      {
        "request": "272867 234892 200000 256660 294635",
        "response": "inside-band"
      },
      {
        "request": "455 371 1226 6300 6384",
        "response": "trails-unigram"
      },
      {
        "request": "5009 5000 1226 6300 6324",
        "response": "trails-t2"
      },
      {
        "request": "6400 6330 1226 6300 6370",
        "response": "split"
      }
    ]
  },
  "stakeholders": [
    {
      "name": "Researcher",
      "text": "Runs training experiments and needs each two-seed result classified by the pre-registered bar, negative results included.",
      "concerns": [
        "Correct answers",
        "Proved guarantees"
      ]
    },
    {
      "name": "Reviewer",
      "text": "Reads the research notebook and needs no result inside the noise band or at one seed reported as a win.",
      "concerns": [
        "Proved guarantees",
        "Refused malformed requests"
      ]
    }
  ],
  "components": [
    {
      "name": "d11-scorer",
      "text": "The artifact scorer that counts each seed's top-1 rows on a panel.",
      "kind": "cliAdapter"
    },
    {
      "name": "Research notebook",
      "text": "docs/research/notebook, where every result is one row.",
      "kind": "externalSystem"
    }
  ],
  "threats": [
    {
      "name": "Single-seed win reported",
      "text": "One seed's score above the target is reported as a pass while the other seed misses it.",
      "stride": "repudiation",
      "asset": "answer",
      "likelihood": "high",
      "impact": "major",
      "control": {
        "name": "Both seeds bar",
        "text": "Each seed must reach the target.",
        "evidence": [
          {
            "kind": "proof",
            "reference": "R4SeedGateProofs::inv001Holds"
          },
          {
            "kind": "proof",
            "reference": "R4SeedGateProofs::inv002Holds"
          }
        ]
      }
    },
    {
      "name": "Target below the noise floor",
      "text": "A caller sends a target below T2 plus 24, so a noise-level gain passes.",
      "stride": "tampering",
      "asset": "request",
      "likelihood": "medium",
      "impact": "major",
      "accepted": "The target is computed by the pre-registered gate sheet before scoring; the app compares against the target it is given."
    },
    {
      "name": "Sealed panel scored early",
      "text": "The fresh panel is scored before the DEV decision, so the pass is not a confirmation.",
      "stride": "tampering",
      "asset": "source",
      "likelihood": "low",
      "impact": "major",
      "accepted": "refuse_sealed_fresh_source in the scorer guards the seal; this app only classifies counts."
    }
  ],
  "quality": [
    {
      "characteristic": "Functional suitability",
      "subcharacteristic": "Functional correctness",
      "requirement": "Both seeds required",
      "text": "A pass needs both of the two seeds to reach the target.",
      "measure": "Seeds required",
      "measureText": "Seeds that must reach the target before pass.",
      "threshold": 2
    },
    {
      "characteristic": "Reliability",
      "subcharacteristic": "Faultlessness",
      "requirement": "No noise-band win",
      "text": "No result with a seed below the target is answered pass.",
      "measure": "Noise-band passes",
      "measureText": "Acceptance vectors with a seed below the target answered pass.",
      "threshold": 0
    }
  ],
  "journeys": [
    {
      "stakeholder": "Researcher",
      "steps": [
        "REQ-001",
        "REQ-003",
        "REQ-006",
        "otherwise"
      ]
    },
    {
      "stakeholder": "Reviewer",
      "steps": [
        "REQ-004",
        "REQ-005",
        "INV-001",
        "INV-002",
        "INV-003",
        "refuse"
      ]
    }
  ],
  "axioms": {
    "inv002Holds": [
      "Classical.choice",
      "Quot.sound",
      "propext"
    ]
  },
  "concerns": []
}
```

## Claims

- RS-01: The app never answers pass when seed1 is below target
- RS-02: The app never answers pass when seed2 is below target
- RS-03: The app never answers pass when seed1 is at most unigram
- RS-04: The architecture description declares every stakeholder, concern, component, edge, viewpoint and view it references
- RS-05: The ISO/IEC 25010 quality model numbers every characteristic, subcharacteristic, requirement and measure, and every parent it names is declared
- RS-06: Every compliance obligation is numbered in order and names its evidence

## Pattern

Decision table: OMG DMN 1.5, hit policy FIRST. The rules are tried in order, and the first one that matches gives the answer. If none matches, the default answer applies. This is a DMN decision table with the FIRST hit policy.

| Pattern | Standard | Answers |
| --- | --- | --- |
| Decision table | OMG DMN 1.5, hit policy FIRST | pass, trails-unigram, trails-t2, split, inside-band |

**Figure: Rules for each answer.** Each bar counts the rules that give one answer. When no rule matches, the answer is pass.

|  | rules |
| --- | --- |
| pass | 0 |
| trails-unigram | 2 |
| trails-t2 | 1 |
| split | 2 |
| inside-band | 1 |

## Behavior

A request is seed1, seed2, unigram, t2, target, separated by spaces. The first rule that matches decides. If none matches, the answer is pass. A request over 136 bytes, or in any other form, is answered invalid.

| Rule | When | Answer | Why |
| --- | --- | --- | --- |
| REQ-001 | seed1 is at most unigram | trails-unigram | docs/research/notebook/m1-discrete-attention.md G-Fresh-Gate: d11\_top1 \> unigram for each seed |
| REQ-002 | seed2 is at most unigram | trails-unigram | docs/research/notebook/m1-discrete-attention.md G-Fresh-Gate: d11\_top1 \> unigram for each seed |
| REQ-003 | seed1 is below t2 and seed2 is below t2 | trails-t2 | README.md: the first human-text runs trail the baselines |
| REQ-004 | seed1 is at least target and seed2 is below target | split | README.md: one seed ahead and one behind is not a win; the bar holds at both seeds |
| REQ-005 | seed2 is at least target and seed1 is below target | split | README.md: one seed ahead and one behind is not a win; the bar holds at both seeds |
| REQ-006 | seed1 is below target | inside-band | docs/research/notebook/m1-discrete-attention.md G-Fresh-Gate: \>= T2 + max(24, \|s1 - s2\|); README.md: the 6 Nov best run is inside the noise band, not a win |
| otherwise | no rule matches | pass | docs/labs/m1-close-saved-model/README.md bar (d): both seeds beat Unigram and reach the T2 target, as 7,002 and 7,001 against 6,324 did |

## Properties Lean proves

Each property is a theorem about the same definitions the app is built from. It is proved for every request, not only the tested ones.

| Property | Statement | Theorem | Why |
| --- | --- | --- | --- |
| INV-001 | It never answers pass when seed1 is below target. | R4SeedGateProofs::inv001Holds | a seed below the target is not a pass |
| INV-002 | It never answers pass when seed2 is below target. | R4SeedGateProofs::inv002Holds | a seed below the target is not a pass |
| INV-003 | It never answers pass when seed1 is at most unigram. | R4SeedGateProofs::inv003Holds | a model that does not beat word frequency has learned nothing |

## Architecture

Stakeholders and the concerns each one views the app through (ISO/IEC/IEEE 42010).

| Stakeholder | Who they are | Concerns |
| --- | --- | --- |
| Researcher | Runs training experiments and needs each two-seed result classified by the pre-registered bar, negative results included. | Correct answers, Proved guarantees |
| Reviewer | Reads the research notebook and needs no result inside the noise band or at one seed reported as a win. | Proved guarantees, Refused malformed requests |
| Verifier | Anyone who loads the holo, checks its fingerprint and replays its acceptance vectors before trusting an answer. | Integrity of the published app, Refused malformed requests, Proved guarantees |

## Concerns

What the stakeholders care about, and the model each is viewed in.

| Concern | What it means | Model |
| --- | --- | --- |
| Correct answers | Every well-formed request is answered by the first rule that matches it, or pass when none does, as the spec states. | quality |
| Integrity of the published app | What a visitor runs is the holo the build verified, with its fingerprint and signed provenance beside it. | security |
| Proved guarantees | Each of the 3 properties of the spec holds for every request, proved by the Lean kernel. | quality |
| Refused malformed requests | A request that is not the 5 fields in order, or is longer than 136 bytes, is answered invalid and never guessed. | security |

## Components

8 components and 11 edges between them.

| Component | Kind | What it is |
| --- | --- | --- |
| Browser | externalSystem | The visitor's web browser, which loads the page and runs the Two-seed bar guest. |
| d11-scorer | cliAdapter | The artifact scorer that counts each seed's top-1 rows on a panel. |
| GitHub Pages | externalSystem | Serves the page and the holo from the repository Pages workflow. |
| Prism build | cliAdapter | prismpm verify in the SDK image prismpm.lock pins: it checks every theorem, builds the guest and replays every vector. |
| Research notebook | externalSystem | docs/research/notebook, where every result is one row. |
| Source repository | externalSystem | The repository that holds the prompt, the model and its gate. |
| Two-seed bar guest | service | The Core-Wasm guest built from the model: it answers one request of at most 136 bytes with one answer of at most 64. |
| Two-seed bar page | staticSite | The page the template publishes: the holo, its fingerprint, its provenance and its acceptance vectors. |

## Design views

The SDK checks each view against the system model and draws it as OPL and PlantUML.

| View | Diagram | Viewpoint |
| --- | --- | --- |
| Deciding a Two-seed bar request | opmObjectProcess | Researcher: Correct answers |
| Components of Two-seed bar | umlComponent | Verifier: Integrity of the published app |
| Answering a Two-seed bar request | umlSequence | Researcher: Correct answers |
| States of the Two-seed bar guest | umlStateMachine | Reviewer: Refused malformed requests |

## Features and journeys

11 features. Each names the definitions that do the work and the tests that accept it. Each stakeholder has one journey.

| Feature | Calls | Accepted by |
| --- | --- | --- |
| When seed1 is at most unigram, the answer is trails-unigram. | R4SeedGate::rule1, R4SeedGate::judge | R4SeedGate::application |
| When seed2 is at most unigram, the answer is trails-unigram. | R4SeedGate::rule2, R4SeedGate::judge | R4SeedGate::application |
| When seed1 is below t2 and seed2 is below t2, the answer is trails-t2. | R4SeedGate::rule3, R4SeedGate::judge | R4SeedGate::application |
| When seed1 is at least target and seed2 is below target, the answer is split. | R4SeedGate::rule4, R4SeedGate::judge | R4SeedGate::application |
| When seed2 is at least target and seed1 is below target, the answer is split. | R4SeedGate::rule5, R4SeedGate::judge | R4SeedGate::application |
| When seed1 is below target, the answer is inside-band. | R4SeedGate::rule6, R4SeedGate::judge | R4SeedGate::application |
| When no rule matches, the answer is pass. | R4SeedGate::judge | R4SeedGate::application |
| A request that is not seed1, seed2, unigram, t2, target in order, separated by single spaces, or is over 136 bytes, is answered invalid. | R4SeedGate::dispatch, R4SeedGate::decodeField1 | R4SeedGate::application |
| It never answers pass when seed1 is below target. | R4SeedGate::judge | R4SeedGateProofs::inv001Holds |
| It never answers pass when seed2 is below target. | R4SeedGate::judge | R4SeedGateProofs::inv002Holds |
| It never answers pass when seed1 is at most unigram. | R4SeedGate::judge | R4SeedGateProofs::inv003Holds |

## Journeys

The ordered features each stakeholder takes.

| Stakeholder | Steps |
| --- | --- |
| Researcher | REQ-001 → REQ-003 → REQ-006 → otherwise |
| Reviewer | REQ-004 → REQ-005 → INV-001 → INV-002 → INV-003 → refuse |
| Verifier | refuse → INV-001 → INV-002 → INV-003 |

## Security and threat model

12 threats against 4 assets. Each has a STRIDE category, and either a control with evidence or a risk that is accepted on purpose.

| Threat | STRIDE | Asset | Risk | Answered by |
| --- | --- | --- | --- | --- |
| Answer that breaks INV-001 | repudiation | Answer | medium likelihood, critical impact | Proof of INV-001: proof R4SeedGateProofs::inv001Holds |
| Answer that breaks INV-002 | repudiation | Answer | medium likelihood, critical impact | Proof of INV-002: proof R4SeedGateProofs::inv002Holds |
| Answer that breaks INV-003 | repudiation | Answer | medium likelihood, critical impact | Proof of INV-003: proof R4SeedGateProofs::inv003Holds |
| Granted capability | informationDisclosure | Answer | low likelihood, major impact | No capability granted: gate prism-code check refuses an ungranted guest import |
| Malformed request | tampering | Request bytes | high likelihood, major impact | Strict decoder: gate malformed-request acceptance vectors, replayed in the compiled guest by prismpm verify |
| Oversized request | denialOfService | Request bytes | medium likelihood, minor impact | Bounded request: gate acceptance vectors at the request bound, one byte over it, and at the guest allocation bound, replayed by prismpm verify |
| Sealed panel scored early | tampering | Model source | low likelihood, major impact | accepted: refuse\_sealed\_fresh\_source in the scorer guards the seal; this app only classifies counts. |
| Single-seed win reported | repudiation | Answer | high likelihood, major impact | Both seeds bar: proof R4SeedGateProofs::inv001Holds; proof R4SeedGateProofs::inv002Holds |
| Substituted holo | spoofing | Published holo | low likelihood, critical impact | Fingerprint and provenance: gate actions/attest-build-provenance in the pages workflow; gate prism-code check of the holo identities in the page |
| Substituted host | spoofing | Published holo | low likelihood, critical impact | accepted: A page cannot defend against its own host. The holo carries signed build provenance a visitor can check, and the app can be rebuilt from its prompt. |
| Tampered model | tampering | Model source | low likelihood, major impact | Regenerated from the prompt: gate prismpm verify in the SDK image prismpm.lock pins; review app/prompt.json |
| Target below the noise floor | tampering | Request bytes | medium likelihood, major impact | accepted: The target is computed by the pre-registered gate sheet before scoring; the app compares against the target it is given. |

## Quality

ISO/IEC 25010:2023 requirements. Each has a measure and a threshold that a theorem pins.

| Requirement | Characteristic | Measure | Threshold |
| --- | --- | --- | --- |
| Both seeds required: A pass needs both of the two seeds to reach the target. | Functional suitability: Functional correctness | Seeds required | 2 |
| Bounded allocation: The guest allocates at most 272 bytes for one request. | Performance efficiency: Resource utilization | Guest allocation bytes | 272 |
| Bounded request: A request over 136 bytes is refused before any field is read. | Performance efficiency: Time behaviour | Request bytes read | 136 |
| Every property proved: All 3 properties are theorems the Lean kernel checks. | Security: Integrity | Unproved properties | 0 |
| Every request answered: Every request gets an answer: a rule, pass otherwise, or invalid. | Functional suitability: Functional completeness | Unanswered requests | 0 |
| Every vector replays: All 72 acceptance vectors replay in the compiled guest, the shortest 0 bytes long. | Reliability: Faultlessness | Failed vectors | 0 |
| Examples answered as stated: Every one of the 5 examples of the spec is answered as it states. | Functional suitability: Functional correctness | Example mismatches | 0 |
| No noise-band win: No result with a seed below the target is answered pass. | Reliability: Faultlessness | Noise-band passes | 0 |

## Compliance

One obligation per standard, each naming its evidence.

| Standard | Subject | Evidence |
| --- | --- | --- |
| ISO/IEC/IEEE 42010:2022 | Architecture description | Architecture::architectureDescriptionHolds |
| ISO/PAS 19450:2015 and OMG UML 2.5.1 | Design views | Design::viewOpmDecide, Design::viewUmlComponents, Design::viewUmlRequest, Design::viewUmlStates |
| ISO/IEC 25010:2023 | Product quality | Quality::qualityModelHolds |
| ISO/IEC 27034-1:2011 and ISO/IEC 27005:2022 | Application security and risk | Security::controlSet |
| OMG DMN 1.5, hit policy FIRST | Decision table | R4SeedGate::judge |
| OpenSpec | Requirements | R4SeedGate::application |
| SPDX MIT | Licensing | R4SeedGate::application |

## Rendered design views

Written by the SDK from the design records when it verified the app.

### design/Design.viewOpmDecide.opl

```
View: Design::viewOpmDecide
Title: Deciding a Two-seed bar request
Viewpoint: Architecture::viewpointResearcherCorrectAnswers
Notation: ISO/PAS 19450:2015 OPM, Prism OPL profile

componentBrowser is an object.
componentTwoSeedBarGuest is an object.
componentTwoSeedBarGuest can be stateDeciding or stateIdle.
processDecide is a process.
processEncodeAnswer is a process.
processJudge is a process.
processParseRequest is a process.
componentTwoSeedBarGuest handles processDecide.
processParseRequest requires componentBrowser.
processEncodeAnswer affects componentBrowser.
processJudge invokes processEncodeAnswer.
processParseRequest invokes processJudge.
processDecide zooms into processParseRequest, processJudge, and processEncodeAnswer, in that sequence.

```

### design/Design.viewUmlComponents.puml

```
@startuml
' UML 2.5.1 component diagram
' view: Design::viewUmlComponents
' viewpoint: Architecture::viewpointVerifierIntegrityOfThePublishedApp
title Components of Two-seed bar
component "componentBrowser" as c0
component "componentD11Scorer" as c1
component "componentGitHubPages" as c2
component "componentPrismBuild" as c3
component "componentResearchNotebook" as c4
component "componentSourceRepository" as c5
component "componentTwoSeedBarGuest" as c6
component "componentTwoSeedBarPage" as c7
c0 --> c6 : edgeBrowserToTwoSeedBarGuest
c1 --> c6 : edgeD11ScorerToTwoSeedBarGuest
c2 --> c0 : edgeGitHubPagesToBrowser
c3 --> c6 : edgePrismBuildToTwoSeedBarGuest
c3 --> c7 : edgePrismBuildToTwoSeedBarPage
c4 --> c6 : edgeResearchNotebookToTwoSeedBarGuest
c5 --> c3 : edgeSourceRepositoryToPrismBuild
c6 --> c0 : edgeTwoSeedBarGuestToBrowser
c6 --> c1 : edgeTwoSeedBarGuestToD11Scorer
c6 --> c4 : edgeTwoSeedBarGuestToResearchNotebook
c7 --> c2 : edgeTwoSeedBarPageToGitHubPages
@enduml

```

### design/Design.viewUmlRequest.puml

```
@startuml
' UML 2.5.1 sequence diagram
' view: Design::viewUmlRequest
' viewpoint: Architecture::viewpointResearcherCorrectAnswers
title Answering a Two-seed bar request
participant "componentBrowser" as p0
participant "componentTwoSeedBarGuest" as p1
p0 -> p1 : processDecide
p1 --> p0 : processDecide
@enduml

```

### design/Design.viewUmlStates.puml

```
@startuml
' UML 2.5.1 state machine diagram
' view: Design::viewUmlStates
' viewpoint: Architecture::viewpointReviewerRefusedMalformedRequests
title States of the Two-seed bar guest
state "stateAnsweredInsideBand" as s0
state "stateAnsweredPass" as s1
state "stateAnsweredSplit" as s2
state "stateAnsweredTrailsT2" as s3
state "stateAnsweredTrailsUnigram" as s4
state "stateDeciding" as s5
state "stateIdle" as s6
state "stateRefused" as s7
[*] --> s6
s6 --> s5 : processParseRequest
s6 --> s7 : processParseRequest
s5 --> s4 : processRule1
s5 --> s4 : processRule2
s5 --> s3 : processRule3
s5 --> s2 : processRule4
s5 --> s2 : processRule5
s5 --> s0 : processRule6
s5 --> s1 : processOtherwise
s1 --> s6 : processEncodeAnswer
s4 --> s6 : processEncodeAnswer
s3 --> s6 : processEncodeAnswer
s2 --> s6 : processEncodeAnswer
s0 --> s6 : processEncodeAnswer
s7 --> s6 : processEncodeAnswer
@enduml

```

## Prism source

Every file the builder wrote, laid out as a repository created from UOR-Foundation/template; the download prism-r4-seed-gate.zip has them all.

- app/src/Architecture.lex.tex (406 lines)
- app/src/Compliance.lex.tex (56 lines)
- app/src/Design.lex.tex (619 lines)
- app/src/Features.lex.tex (130 lines)
- app/src/Quality.lex.tex (368 lines)
- app/src/Security.lex.tex (537 lines)
- app/src/R4SeedGate.lex.tex (269 lines)
- app/src/R4SeedGateProofs.lex.tex (102 lines)
- app/lexlean.toml (43 lines)
- app/prompt.json (355 lines)
- model/ids.toml (59 lines)
- features/suites/r4\_seed\_gate.feature (38 lines)
- crates/conformance/tests/r4\_seed\_gate.rs (122 lines)
- site/app.json (104 lines)
- openspec/specs/r4-seed-gate/spec.md (183 lines)
