# Dataflow policy

> Decide if a Prism dataflow script is accepted, rejected for breaking a policy, or an error. A script that leaks memory or personal data is never accepted.

Inspired by UOR-Foundation/prism-code (https://github.com/UOR-Foundation/prism-code), live at https://uor-foundation.github.io/prism-code/. Dataflow Policy: checks a Prism dataflow project script against its memory and PII-encryption policies. 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 Dataflow policy 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 | bytes, parse, excess, exposed |
| 2. 5 rules | the first that matches wins |
| 3. Answer | accepted, rejected, error |
| 4. Proved | 4 theorems, 57 tests |

Verified by prismpm verify in the pinned SDK. Fingerprint: 5ae23c17282d5b7ad75bc6ff2dca658adc13cfa26ca358fff47124294b7cfbd9. Acceptance vectors: 57. Claims: 7.

## The prompt

```json
{
  "schema": "prism/prompt/1",
  "pattern": "decisionTable",
  "goal": "Decide if a Prism dataflow script is accepted, rejected for breaking a policy, or an error. A script that leaks memory or personal data is never accepted.",
  "repository": "UOR-Foundation/prism-code",
  "app": {
    "name": "dataflow-policy-check",
    "title": "Dataflow policy",
    "purpose": "Decide the status of a dataflow-policy/1 script from its size in bytes, whether every line parsed, how many nodes exceed the memory policy and how many outputs personal data reaches unencrypted.",
    "limits": [
      "It does not parse the script; the parse field says whether every line was read and applied, and the first failing line's code is the CLI's to print.",
      "It does not decide response too-large, the error a report longer than 16384 bytes is replaced by."
    ],
    "fields": [
      {
        "name": "bytes",
        "kind": "number",
        "min": 0,
        "means": "the length of the request in bytes"
      },
      {
        "name": "parse",
        "kind": "choice",
        "values": [
          "ok",
          "fault"
        ],
        "means": "whether the header and every statement line parsed and applied, or a line failed with its typed code"
      },
      {
        "name": "excess",
        "kind": "number",
        "min": 0,
        "means": "nodes whose memory requirement exceeds the policy memory limit (0 with no memory policy)"
      },
      {
        "name": "exposed",
        "kind": "number",
        "min": 0,
        "means": "output nodes personal data reaches without an encrypt node, under policy encrypt-pii (0 without it)"
      }
    ],
    "outcomes": [
      "accepted",
      "rejected",
      "error"
    ],
    "meanings": {
      "accepted": "status accepted, then the canonical sorted project; exit 0",
      "rejected": "status rejected, then every finding and the canonical project; exit 1",
      "error": "status error with the request code or the first failing line and its code; exit 2"
    },
    "rules": [
      {
        "when": [
          {
            "field": "bytes",
            "op": "=",
            "value": 0
          }
        ],
        "then": "error",
        "why": "src/Specification.lex.tex: an empty request answers status error, request empty"
      },
      {
        "when": [
          {
            "field": "bytes",
            "op": ">",
            "value": 4096
          }
        ],
        "then": "error",
        "why": "src/Specification.lex.tex: a request over 4096 bytes answers request too-large"
      },
      {
        "when": [
          {
            "field": "parse",
            "op": "is",
            "value": "fault"
          }
        ],
        "then": "error",
        "why": "src/Engine.lex.tex runLines: the first line that fails to parse or apply ends the run as Outcome.Failed"
      },
      {
        "when": [
          {
            "field": "excess",
            "op": ">=",
            "value": 1
          }
        ],
        "then": "rejected",
        "why": "src/Compliance.lex.tex memoryFindings: each node above the limit is a MemoryExceeded finding"
      },
      {
        "when": [
          {
            "field": "exposed",
            "op": ">=",
            "value": 1
          }
        ],
        "then": "rejected",
        "why": "src/Compliance.lex.tex piiFindings: each output reached by unencrypted personal data is a PlaintextPii finding"
      }
    ],
    "otherwise": "accepted",
    "otherwiseWhy": "src/Engine.lex.tex certifyWith: a parsed project with no findings is Outcome.Accepted",
    "properties": [
      {
        "kind": "never",
        "when": [
          {
            "field": "parse",
            "op": "is",
            "value": "fault"
          }
        ],
        "then": "accepted",
        "why": "Engine.failedRunNeverAccepted: a failed run is never accepted"
      },
      {
        "kind": "never",
        "when": [
          {
            "field": "excess",
            "op": ">=",
            "value": 1
          }
        ],
        "then": "accepted",
        "why": "Engine.completedRunAcceptedOnlyIfCompliant: a node over its memory limit is not compliant"
      },
      {
        "kind": "never",
        "when": [
          {
            "field": "exposed",
            "op": ">=",
            "value": 1
          }
        ],
        "then": "accepted",
        "why": "Engine.completedRunAcceptedOnlyIfCompliant: plaintext personal data at an output is not compliant"
      },
      {
        "kind": "always",
        "when": [
          {
            "field": "bytes",
            "op": ">",
            "value": 4096
          }
        ],
        "then": "error",
        "why": "the request bound of 4096 bytes is checked before any line is read"
      }
    ],
    "examples": [
      {
        "request": "120 ok 0 0",
        "response": "accepted"
      },
      {
        "request": "200 ok 1 0",
        "response": "rejected"
      },
      {
        "request": "200 ok 0 2",
        "response": "rejected"
      },
      {
        "request": "90 fault 0 0",
        "response": "error"
      },
      {
        "request": "0 ok 0 0",
        "response": "error"
      },
      {
        "request": "4097 ok 0 0",
        "response": "error"
      },
      {
        "request": "4096 ok 0 0",
        "response": "accepted"
      },
      {
        "request": "120 ok",
        "response": "invalid"
      }
    ]
  },
  "stakeholders": [
    {
      "name": "Script author",
      "text": "Writes Prism dataflow project scripts and needs the status line to say whether the project meets its declared policies.",
      "concerns": [
        "Correct answers",
        "Proved guarantees"
      ]
    },
    {
      "name": "Data protection reviewer",
      "text": "Relies on an accepted project never sending personal data to an output in plaintext.",
      "concerns": [
        "Proved guarantees",
        "No plaintext personal data accepted"
      ]
    }
  ],
  "concerns": [
    {
      "name": "No plaintext personal data accepted",
      "text": "Under policy encrypt-pii, a project in which personal data reaches an output without an encrypt node is never accepted.",
      "model": "security"
    }
  ],
  "components": [
    {
      "name": "dataflow-policy CLI",
      "text": "The command line PrismPM generates from the prismpm/text-application/3 record: dataflow-policy check [FILE].",
      "kind": "cliAdapter"
    },
    {
      "name": "Dataflow Policy workbench",
      "text": "The verified browser application on GitHub Pages that checks a script in the page.",
      "kind": "staticSite"
    }
  ],
  "threats": [
    {
      "name": "PII finding suppressed",
      "text": "A project whose personal data reaches an output unencrypted is reported accepted, and the data ships in plaintext.",
      "stride": "informationDisclosure",
      "asset": "answer",
      "likelihood": "medium",
      "impact": "critical",
      "control": {
        "name": "Findings rule out acceptance",
        "text": "Any PlaintextPii finding rules out accepted, proved for every request.",
        "evidence": [
          {
            "kind": "proof",
            "reference": "DataflowPolicyCheckProofs::inv003Holds"
          },
          {
            "kind": "review",
            "reference": "prism-code src/Engine.lex.tex completedRunAcceptedOnlyIfCompliant"
          }
        ]
      }
    },
    {
      "name": "Oversized script exhausts the checker",
      "text": "A very large script makes the checker allocate without bound.",
      "stride": "denialOfService",
      "asset": "request",
      "likelihood": "medium",
      "impact": "major",
      "control": {
        "name": "Request bound",
        "text": "A request over 4096 bytes is answered error before any line is read.",
        "evidence": [
          {
            "kind": "proof",
            "reference": "DataflowPolicyCheckProofs::inv004Holds"
          },
          {
            "kind": "gate",
            "reference": "prism-code crates/conformance/tests/cli CL-03"
          }
        ]
      }
    },
    {
      "name": "PII label omitted",
      "text": "A script author leaves out a pii line, so the policy never sees personal data on that input.",
      "stride": "tampering",
      "asset": "request",
      "likelihood": "medium",
      "impact": "major",
      "accepted": "Labelling personal data is the script author's statement; the checker decides from the script it is given and prints the canonical project for review."
    }
  ],
  "quality": [
    {
      "characteristic": "Security",
      "subcharacteristic": "Integrity",
      "requirement": "No non-compliant project accepted",
      "text": "No request with a memory or PII finding, or a failed line, is accepted.",
      "measure": "Non-compliant acceptances",
      "measureText": "Acceptance vectors answered accepted while excess or exposed is at least 1 or parse is fault.",
      "threshold": 0
    },
    {
      "characteristic": "Functional suitability",
      "subcharacteristic": "Functional correctness",
      "requirement": "Every status matches the model",
      "text": "Each vector answers the status the prism-code model gives.",
      "measure": "Vectors that disagree",
      "measureText": "Acceptance vectors whose replayed status differs from the expected one.",
      "threshold": 0
    }
  ],
  "journeys": [
    {
      "stakeholder": "Script author",
      "steps": [
        "REQ-001",
        "REQ-003",
        "REQ-004",
        "otherwise"
      ]
    },
    {
      "stakeholder": "Data protection reviewer",
      "steps": [
        "REQ-005",
        "INV-003",
        "refuse"
      ]
    }
  ],
  "license": "MIT OR Apache-2.0",
  "axioms": {}
}
```

## Claims

- DP-01: The app never answers accepted when parse is fault
- DP-02: The app never answers accepted when excess is at least 1
- DP-03: The app never answers accepted when exposed is at least 1
- DP-04: The app always answers error when bytes is above 4096
- DP-05: The architecture description declares every stakeholder, concern, component, edge, viewpoint and view it references
- DP-06: The ISO/IEC 25010 quality model numbers every characteristic, subcharacteristic, requirement and measure, and every parent it names is declared
- DP-07: 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 | accepted, rejected, error |

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

|  | rules |
| --- | --- |
| accepted | 0 |
| rejected | 2 |
| error | 3 |

## Behavior

A request is bytes, parse, excess, exposed, separated by spaces. The first rule that matches decides. If none matches, the answer is accepted. A request over 112 bytes, or in any other form, is answered invalid.

| Rule | When | Answer | Why |
| --- | --- | --- | --- |
| REQ-001 | bytes equals 0 | error | src/Specification.lex.tex: an empty request answers status error, request empty |
| REQ-002 | bytes is above 4096 | error | src/Specification.lex.tex: a request over 4096 bytes answers request too-large |
| REQ-003 | parse is fault | error | src/Engine.lex.tex runLines: the first line that fails to parse or apply ends the run as Outcome.Failed |
| REQ-004 | excess is at least 1 | rejected | src/Compliance.lex.tex memoryFindings: each node above the limit is a MemoryExceeded finding |
| REQ-005 | exposed is at least 1 | rejected | src/Compliance.lex.tex piiFindings: each output reached by unencrypted personal data is a PlaintextPii finding |
| otherwise | no rule matches | accepted | src/Engine.lex.tex certifyWith: a parsed project with no findings is Outcome.Accepted |

## 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 accepted when parse is fault. | DataflowPolicyCheckProofs::inv001Holds | Engine.failedRunNeverAccepted: a failed run is never accepted |
| INV-002 | It never answers accepted when excess is at least 1. | DataflowPolicyCheckProofs::inv002Holds | Engine.completedRunAcceptedOnlyIfCompliant: a node over its memory limit is not compliant |
| INV-003 | It never answers accepted when exposed is at least 1. | DataflowPolicyCheckProofs::inv003Holds | Engine.completedRunAcceptedOnlyIfCompliant: plaintext personal data at an output is not compliant |
| INV-004 | It always answers error when bytes is above 4096. | DataflowPolicyCheckProofs::inv004Holds | the request bound of 4096 bytes is checked before any line is read |

## Architecture

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

| Stakeholder | Who they are | Concerns |
| --- | --- | --- |
| Data protection reviewer | Relies on an accepted project never sending personal data to an output in plaintext. | Proved guarantees, No plaintext personal data accepted |
| Script author | Writes Prism dataflow project scripts and needs the status line to say whether the project meets its declared policies. | Correct answers, Proved guarantees |
| 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 accepted 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 |
| No plaintext personal data accepted | Under policy encrypt-pii, a project in which personal data reaches an output without an encrypt node is never accepted. | security |
| Proved guarantees | Each of the 4 properties of the spec holds for every request, proved by the Lean kernel. | quality |
| Refused malformed requests | A request that is not the 4 fields in order, or is longer than 112 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 Dataflow policy guest. |
| dataflow-policy CLI | cliAdapter | The command line PrismPM generates from the prismpm/text-application/3 record: dataflow-policy check \[FILE\]. |
| Dataflow policy guest | service | The Core-Wasm guest built from the model: it answers one request of at most 112 bytes with one answer of at most 64. |
| Dataflow policy page | staticSite | The page the template publishes: the holo, its fingerprint, its provenance and its acceptance vectors. |
| Dataflow Policy workbench | staticSite | The verified browser application on GitHub Pages that checks a script in the page. |
| 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. |
| Source repository | externalSystem | The repository that holds the prompt, the model and its gate. |

## Design views

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

| View | Diagram | Viewpoint |
| --- | --- | --- |
| Deciding a Dataflow policy request | opmObjectProcess | Script author: Correct answers |
| Components of Dataflow policy | umlComponent | Verifier: Integrity of the published app |
| Answering a Dataflow policy request | umlSequence | Script author: Correct answers |
| States of the Dataflow policy guest | umlStateMachine | Verifier: 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 bytes equals 0, the answer is error. | DataflowPolicyCheck::rule1, DataflowPolicyCheck::judge | DataflowPolicyCheck::application |
| When bytes is above 4096, the answer is error. | DataflowPolicyCheck::rule2, DataflowPolicyCheck::judge | DataflowPolicyCheck::application |
| When parse is fault, the answer is error. | DataflowPolicyCheck::rule3, DataflowPolicyCheck::judge | DataflowPolicyCheck::application |
| When excess is at least 1, the answer is rejected. | DataflowPolicyCheck::rule4, DataflowPolicyCheck::judge | DataflowPolicyCheck::application |
| When exposed is at least 1, the answer is rejected. | DataflowPolicyCheck::rule5, DataflowPolicyCheck::judge | DataflowPolicyCheck::application |
| When no rule matches, the answer is accepted. | DataflowPolicyCheck::judge | DataflowPolicyCheck::application |
| A request that is not bytes, parse, excess, exposed in order, separated by single spaces, or is over 112 bytes, is answered invalid. | DataflowPolicyCheck::dispatch, DataflowPolicyCheck::decodeField1 | DataflowPolicyCheck::application |
| It never answers accepted when parse is fault. | DataflowPolicyCheck::judge | DataflowPolicyCheckProofs::inv001Holds |
| It never answers accepted when excess is at least 1. | DataflowPolicyCheck::judge | DataflowPolicyCheckProofs::inv002Holds |
| It never answers accepted when exposed is at least 1. | DataflowPolicyCheck::judge | DataflowPolicyCheckProofs::inv003Holds |
| It always answers error when bytes is above 4096. | DataflowPolicyCheck::judge | DataflowPolicyCheckProofs::inv004Holds |

## Journeys

The ordered features each stakeholder takes.

| Stakeholder | Steps |
| --- | --- |
| Data protection reviewer | REQ-005 → INV-003 → refuse |
| Script author | REQ-001 → REQ-003 → REQ-004 → otherwise |
| Verifier | refuse → INV-001 → INV-002 → INV-003 → INV-004 |

## Security and threat model

13 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 DataflowPolicyCheckProofs::inv001Holds |
| Answer that breaks INV-002 | repudiation | Answer | medium likelihood, critical impact | Proof of INV-002: proof DataflowPolicyCheckProofs::inv002Holds |
| Answer that breaks INV-003 | repudiation | Answer | medium likelihood, critical impact | Proof of INV-003: proof DataflowPolicyCheckProofs::inv003Holds |
| Answer that breaks INV-004 | repudiation | Answer | medium likelihood, critical impact | Proof of INV-004: proof DataflowPolicyCheckProofs::inv004Holds |
| 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 |
| Oversized script exhausts the checker | denialOfService | Request bytes | medium likelihood, major impact | Request bound: proof DataflowPolicyCheckProofs::inv004Holds; gate prism-code crates/conformance/tests/cli CL-03 |
| PII finding suppressed | informationDisclosure | Answer | medium likelihood, critical impact | Findings rule out acceptance: proof DataflowPolicyCheckProofs::inv003Holds; review prism-code src/Engine.lex.tex completedRunAcceptedOnlyIfCompliant |
| PII label omitted | tampering | Request bytes | medium likelihood, major impact | accepted: Labelling personal data is the script author's statement; the checker decides from the script it is given and prints the canonical project for review. |
| 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 |

## Quality

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

| Requirement | Characteristic | Measure | Threshold |
| --- | --- | --- | --- |
| Bounded allocation: The guest allocates at most 224 bytes for one request. | Performance efficiency: Resource utilization | Guest allocation bytes | 224 |
| Bounded request: A request over 112 bytes is refused before any field is read. | Performance efficiency: Time behaviour | Request bytes read | 112 |
| Every property proved: All 4 properties are theorems the Lean kernel checks. | Security: Integrity | Unproved properties | 0 |
| Every request answered: Every request gets an answer: a rule, accepted otherwise, or invalid. | Functional suitability: Functional completeness | Unanswered requests | 0 |
| Every status matches the model: Each vector answers the status the prism-code model gives. | Functional suitability: Functional correctness | Vectors that disagree | 0 |
| Every vector replays: All 57 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 8 examples of the spec is answered as it states. | Functional suitability: Functional correctness | Example mismatches | 0 |
| No non-compliant project accepted: No request with a memory or PII finding, or a failed line, is accepted. | Security: Integrity | Non-compliant acceptances | 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 | DataflowPolicyCheck::judge |
| OpenSpec | Requirements | DataflowPolicyCheck::application |
| SPDX MIT OR Apache-2.0 | Licensing | DataflowPolicyCheck::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 Dataflow policy request
Viewpoint: Architecture::viewpointScriptAuthorCorrectAnswers
Notation: ISO/PAS 19450:2015 OPM, Prism OPL profile

componentBrowser is an object.
componentDataflowPolicyGuest is an object.
componentDataflowPolicyGuest can be stateDeciding or stateIdle.
processDecide is a process.
processEncodeAnswer is a process.
processJudge is a process.
processParseRequest is a process.
componentDataflowPolicyGuest 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 Dataflow policy
component "componentBrowser" as c0
component "componentDataflowPolicyCLI" as c1
component "componentDataflowPolicyGuest" as c2
component "componentDataflowPolicyPage" as c3
component "componentDataflowPolicyWorkbench" as c4
component "componentGitHubPages" as c5
component "componentPrismBuild" as c6
component "componentSourceRepository" as c7
c0 --> c2 : edgeBrowserToDataflowPolicyGuest
c1 --> c2 : edgeDataflowPolicyCLIToDataflowPolicyGuest
c2 --> c0 : edgeDataflowPolicyGuestToBrowser
c2 --> c1 : edgeDataflowPolicyGuestToDataflowPolicyCLI
c2 --> c4 : edgeDataflowPolicyGuestToDataflowPolicyWorkbench
c3 --> c5 : edgeDataflowPolicyPageToGitHubPages
c4 --> c2 : edgeDataflowPolicyWorkbenchToDataflowPolicyGuest
c5 --> c0 : edgeGitHubPagesToBrowser
c6 --> c2 : edgePrismBuildToDataflowPolicyGuest
c6 --> c3 : edgePrismBuildToDataflowPolicyPage
c7 --> c6 : edgeSourceRepositoryToPrismBuild
@enduml

```

### design/Design.viewUmlRequest.puml

```
@startuml
' UML 2.5.1 sequence diagram
' view: Design::viewUmlRequest
' viewpoint: Architecture::viewpointScriptAuthorCorrectAnswers
title Answering a Dataflow policy request
participant "componentBrowser" as p0
participant "componentDataflowPolicyGuest" 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::viewpointVerifierRefusedMalformedRequests
title States of the Dataflow policy guest
state "stateAnsweredAccepted" as s0
state "stateAnsweredError" as s1
state "stateAnsweredRejected" as s2
state "stateDeciding" as s3
state "stateIdle" as s4
state "stateRefused" as s5
[*] --> s4
s4 --> s3 : processParseRequest
s4 --> s5 : processParseRequest
s3 --> s1 : processRule1
s3 --> s1 : processRule2
s3 --> s1 : processRule3
s3 --> s2 : processRule4
s3 --> s2 : processRule5
s3 --> s0 : processOtherwise
s0 --> s4 : processEncodeAnswer
s2 --> s4 : processEncodeAnswer
s1 --> s4 : processEncodeAnswer
s5 --> s4 : processEncodeAnswer
@enduml

```

## Prism source

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

- app/src/Architecture.lex.tex (413 lines)
- app/src/Compliance.lex.tex (56 lines)
- app/src/Design.lex.tex (563 lines)
- app/src/Features.lex.tex (137 lines)
- app/src/Quality.lex.tex (368 lines)
- app/src/Security.lex.tex (593 lines)
- app/src/DataflowPolicyCheck.lex.tex (238 lines)
- app/src/DataflowPolicyCheckProofs.lex.tex (129 lines)
- app/lexlean.toml (43 lines)
- app/prompt.json (331 lines)
- model/ids.toml (65 lines)
- features/suites/dataflow\_policy\_check.feature (44 lines)
- crates/conformance/tests/dataflow\_policy\_check.rs (132 lines)
- site/app.json (113 lines)
- openspec/specs/dataflow-policy-check/spec.md (189 lines)
