# Release lifecycle

> Move a template release from build to accept, one step at a time. No release is accepted before every step has passed in order.

Inspired by UOR-Foundation/template (https://github.com/UOR-Foundation/template), live at https://uor-foundation.github.io/template/. The UOR Prism template, whose release pipeline builds once, then signs, promotes, deploys, verifies and accepts the same digest behind protected identities. Pattern: State machine, OMG UML 2.5.1 behavioral state machine. To write one of your own, follow How to build a state machine app (../../guides/state-machine/index.md). The prompt below is data, quoted from the example.

**Figure: The Release lifecycle state machine.** Each box is a state and each arrow a step a rule can take. A run starts at built and stops at accepted. Dashed arrows go back to an earlier state.

| From | Link | To |
| --- | --- | --- |
| built | REQ-001 | candidate |
| built | otherwise | built |
| candidate | REQ-006 | candidate |
| candidate | REQ-002 | planned |
| planned | REQ-007 | planned |
| planned | REQ-003 | deployed |
| deployed | REQ-008 | deployed |
| deployed | REQ-004 | verified |
| verified | REQ-009 | verified |
| verified | REQ-005 | accepted |
| accepted | REQ-010 | accepted |

Verified by prismpm verify in the pinned SDK. Fingerprint: 4ceb596200b1dd494d917b1938ade7385575ecb06483c78d48e70bfad1cfe3e4. Acceptance vectors: 41. Claims: 8.

## The prompt

```json
{
  "schema": "prism/prompt/1",
  "pattern": "stateMachine",
  "machine": {
    "state": "state",
    "initial": "built",
    "final": [
      "accepted"
    ]
  },
  "goal": "Move a template release from build to accept, one step at a time. No release is accepted before every step has passed in order.",
  "repository": "UOR-Foundation/template",
  "app": {
    "name": "template-release-lifecycle",
    "title": "Release lifecycle",
    "purpose": "Give the next lifecycle state of a template product release from its current state, the pipeline event, whether the ref is protected and whether the attached evidence is complete.",
    "fields": [
      {
        "name": "state",
        "kind": "choice",
        "values": [
          "built",
          "candidate",
          "planned",
          "deployed",
          "verified",
          "accepted"
        ],
        "means": "the lifecycle state the release is in now"
      },
      {
        "name": "event",
        "kind": "choice",
        "values": [
          "promote",
          "plan",
          "deploy",
          "verify",
          "accept"
        ],
        "means": "the prismpm.yml job that runs next"
      },
      {
        "name": "ref",
        "kind": "choice",
        "values": [
          "protected",
          "unprotected"
        ],
        "means": "whether the triggering branch or tag is protected"
      },
      {
        "name": "evidence",
        "kind": "choice",
        "values": [
          "complete",
          "missing"
        ],
        "means": "whether the deployment state and release evidence the job requires are attached"
      }
    ],
    "outcomes": [
      "built",
      "candidate",
      "planned",
      "deployed",
      "verified",
      "accepted"
    ],
    "meanings": {
      "built": "built once by the build job, without publication credentials",
      "candidate": "signed, promoted to candidate and pushed to the registry",
      "planned": "bound to observed target state by a deployment plan",
      "deployed": "deployed from the exact plan with deployment evidence attached",
      "verified": "post-deployment state and release evidence verified after a clean pull",
      "accepted": "conformance attached and promoted to accepted, the final state"
    },
    "rules": [
      {
        "when": [
          {
            "field": "state",
            "op": "is",
            "value": "built"
          },
          {
            "field": "event",
            "op": "is",
            "value": "promote"
          },
          {
            "field": "ref",
            "op": "is",
            "value": "protected"
          }
        ],
        "then": "candidate",
        "why": "prismpm.yml: authorize-release requires branch or tag protection, then promote keyless-signs the development-to-candidate transition and pushes the candidate graph"
      },
      {
        "when": [
          {
            "field": "state",
            "op": "is",
            "value": "candidate"
          },
          {
            "field": "event",
            "op": "is",
            "value": "plan"
          }
        ],
        "then": "planned",
        "why": "prismpm.yml plan job: binds the immutable candidate release to observed target state without rebuilding"
      },
      {
        "when": [
          {
            "field": "state",
            "op": "is",
            "value": "planned"
          },
          {
            "field": "event",
            "op": "is",
            "value": "deploy"
          }
        ],
        "then": "deployed",
        "why": "prismpm.yml deploy job: deploys the exact release and exact plan, then attaches deployment evidence"
      },
      {
        "when": [
          {
            "field": "state",
            "op": "is",
            "value": "deployed"
          },
          {
            "field": "event",
            "op": "is",
            "value": "verify"
          },
          {
            "field": "evidence",
            "op": "is",
            "value": "complete"
          }
        ],
        "then": "verified",
        "why": "prismpm.yml verify-deployment: require observed deployment state and complete attached release evidence"
      },
      {
        "when": [
          {
            "field": "state",
            "op": "is",
            "value": "verified"
          },
          {
            "field": "event",
            "op": "is",
            "value": "accept"
          },
          {
            "field": "evidence",
            "op": "is",
            "value": "complete"
          }
        ],
        "then": "accepted",
        "why": "prismpm.yml conformance then accept: every public feature case is attached before the candidate-to-accepted transition is signed"
      },
      {
        "when": [
          {
            "field": "state",
            "op": "is",
            "value": "candidate"
          }
        ],
        "then": "candidate",
        "why": "prismpm.yml: a job runs only when the jobs it needs succeeded, so any other event leaves a candidate release where it is"
      },
      {
        "when": [
          {
            "field": "state",
            "op": "is",
            "value": "planned"
          }
        ],
        "then": "planned",
        "why": "prismpm.yml: a job runs only when the jobs it needs succeeded, so any other event leaves a planned release where it is"
      },
      {
        "when": [
          {
            "field": "state",
            "op": "is",
            "value": "deployed"
          }
        ],
        "then": "deployed",
        "why": "prismpm.yml: a job runs only when the jobs it needs succeeded, so any other event leaves a deployed release where it is"
      },
      {
        "when": [
          {
            "field": "state",
            "op": "is",
            "value": "verified"
          }
        ],
        "then": "verified",
        "why": "prismpm.yml: a job runs only when the jobs it needs succeeded, so any other event leaves a verified release where it is"
      },
      {
        "when": [
          {
            "field": "state",
            "op": "is",
            "value": "accepted"
          }
        ],
        "then": "accepted",
        "why": "prismpm.yml: a job runs only when the jobs it needs succeeded, so any other event leaves a accepted release where it is"
      }
    ],
    "otherwise": "built",
    "otherwiseWhy": "prismpm.yml: without a protected ref the promote job never requests credentials, so a built release stays built",
    "properties": [
      {
        "kind": "never",
        "when": [
          {
            "field": "state",
            "op": "is",
            "value": "built"
          },
          {
            "field": "ref",
            "op": "is",
            "value": "unprotected"
          }
        ],
        "then": "candidate",
        "why": "authorize-release rejects publication from an unprotected ref"
      },
      {
        "kind": "never",
        "when": [
          {
            "field": "state",
            "op": "is",
            "value": "deployed"
          },
          {
            "field": "evidence",
            "op": "is",
            "value": "missing"
          }
        ],
        "then": "verified",
        "why": "verify-deployment requires observed state and complete attached evidence"
      },
      {
        "kind": "never",
        "when": [
          {
            "field": "state",
            "op": "is",
            "value": "verified"
          },
          {
            "field": "evidence",
            "op": "is",
            "value": "missing"
          }
        ],
        "then": "accepted",
        "why": "accept needs the conformance-bearing graph"
      },
      {
        "kind": "never",
        "when": [
          {
            "field": "state",
            "op": "is",
            "value": "built"
          }
        ],
        "then": "accepted",
        "why": "accept needs promote, deploy, verify-deployment and conformance first"
      }
    ],
    "examples": [
      {
        "request": "built promote protected complete",
        "response": "candidate"
      },
      {
        "request": "built promote unprotected complete",
        "response": "built"
      },
      {
        "request": "candidate plan protected complete",
        "response": "planned"
      },
      {
        "request": "planned deploy protected complete",
        "response": "deployed"
      },
      {
        "request": "deployed verify protected missing",
        "response": "deployed"
      },
      {
        "request": "verified accept protected complete",
        "response": "accepted"
      },
      {
        "request": "accepted promote unprotected missing",
        "response": "accepted"
      }
    ]
  },
  "stakeholders": [
    {
      "name": "Template adopter",
      "text": "Creates a repository from the template and needs prismpm.yml to take a release from build to accepted with nothing skipped.",
      "concerns": [
        "Correct answers",
        "Proved guarantees"
      ]
    },
    {
      "name": "Release approver",
      "text": "Guards the protected release and deployment environments and needs no unprotected ref or missing evidence to reach accepted.",
      "concerns": [
        "Proved guarantees",
        "Refused malformed requests"
      ]
    }
  ],
  "components": [
    {
      "name": "PrismPM product pipeline",
      "text": "The reusable prismpm.yml workflow whose jobs are the lifecycle events.",
      "kind": "cliAdapter"
    },
    {
      "name": "GHCR",
      "text": "The registry the candidate and accepted graphs are pushed to and pulled from.",
      "kind": "externalSystem"
    },
    {
      "name": "Sigstore",
      "text": "Keyless signing of the development-to-candidate and candidate-to-accepted transitions.",
      "kind": "externalSystem"
    },
    {
      "name": "Deployment target",
      "text": "The modeled target, kubernetes-production by default, whose observed state the plan binds.",
      "kind": "externalSystem"
    }
  ],
  "threats": [
    {
      "name": "Publication from an unprotected ref",
      "text": "A push to an unprotected branch obtains release credentials and promotes a candidate.",
      "stride": "elevationOfPrivilege",
      "asset": "answer",
      "likelihood": "medium",
      "impact": "critical",
      "control": {
        "name": "Protected ref before promotion",
        "text": "Only a protected ref moves a built release to candidate.",
        "evidence": [
          {
            "kind": "proof",
            "reference": "TemplateReleaseLifecycleProofs::inv001Holds"
          },
          {
            "kind": "gate",
            "reference": "authorize-release job in .github/workflows/prismpm.yml"
          }
        ]
      }
    },
    {
      "name": "Acceptance without evidence",
      "text": "A deployed release is marked verified or accepted while its deployment state or conformance evidence is missing.",
      "stride": "repudiation",
      "asset": "answer",
      "likelihood": "medium",
      "impact": "major",
      "control": {
        "name": "Evidence before verification and acceptance",
        "text": "Missing evidence keeps the release where it is.",
        "evidence": [
          {
            "kind": "proof",
            "reference": "TemplateReleaseLifecycleProofs::inv002Holds"
          },
          {
            "kind": "proof",
            "reference": "TemplateReleaseLifecycleProofs::inv003Holds"
          },
          {
            "kind": "gate",
            "reference": "verify-deployment and conformance jobs in .github/workflows/prismpm.yml"
          }
        ]
      }
    },
    {
      "name": "Rebuilt release between steps",
      "text": "A step rebuilds the product so the accepted digest differs from the built one.",
      "stride": "tampering",
      "asset": "source",
      "likelihood": "low",
      "impact": "major",
      "accepted": "The app decides lifecycle states, not digests; prismpm.yml passes one immutable-reference from promote to every later job and never rebuilds."
    }
  ],
  "quality": [
    {
      "characteristic": "Functional suitability",
      "subcharacteristic": "Functional completeness",
      "requirement": "Every pipeline job modeled",
      "text": "Each of the five prismpm.yml jobs after build (promote, plan, deploy, verify-deployment with conformance, accept) is one transition of the machine.",
      "measure": "Steps from built to accepted",
      "measureText": "Transitions on the shortest run from built to accepted.",
      "threshold": 5
    },
    {
      "characteristic": "Security",
      "subcharacteristic": "Accountability",
      "requirement": "No skipped job",
      "text": "No single step takes a release past a job it needs.",
      "measure": "Skipping transitions",
      "measureText": "Transitions that move a release more than one lifecycle state forward.",
      "threshold": 0
    }
  ],
  "journeys": [
    {
      "stakeholder": "Template adopter",
      "steps": [
        "REQ-001",
        "REQ-002",
        "REQ-003",
        "REQ-004",
        "REQ-005",
        "REQ-010"
      ]
    },
    {
      "stakeholder": "Release approver",
      "steps": [
        "INV-001",
        "INV-002",
        "INV-003",
        "INV-004",
        "refuse"
      ]
    }
  ],
  "concerns": [],
  "license": "MIT OR Apache-2.0",
  "axioms": {}
}
```

## Claims

- TR-01: The app never answers candidate when state is built and ref is unprotected
- TR-02: The app never answers verified when state is deployed and evidence is missing
- TR-03: The app never answers accepted when state is verified and evidence is missing
- TR-04: The app never answers accepted when state is built
- TR-05: The app always answers accepted when state is accepted
- TR-06: The architecture description declares every stakeholder, concern, component, edge, viewpoint and view it references
- TR-07: The ISO/IEC 25010 quality model numbers every characteristic, subcharacteristic, requirement and measure, and every parent it names is declared
- TR-08: Every compliance obligation is numbered in order and names its evidence

## Pattern

State machine: OMG UML 2.5.1 behavioral state machine. The answer is the next state, given the current state and an event. This is a UML state machine written as one pure function. The state travels in the request, so the app keeps nothing between requests. The builder proves what holds over every run.

| Pattern | Standard | Answers |
| --- | --- | --- |
| State machine | OMG UML 2.5.1 behavioral state machine | built, candidate, planned, deployed, verified, accepted |

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

|  | rules |
| --- | --- |
| built | 0 |
| candidate | 2 |
| planned | 2 |
| deployed | 2 |
| verified | 2 |
| accepted | 2 |

## Behavior

A request is state, event, ref, evidence, separated by spaces. The first rule that matches decides. If none matches, the answer is built. A request over 112 bytes, or in any other form, is answered invalid.

| Rule | When | Answer | Why |
| --- | --- | --- | --- |
| REQ-001 | state is built and event is promote and ref is protected | candidate | prismpm.yml: authorize-release requires branch or tag protection, then promote keyless-signs the development-to-candidate transition and pushes the candidate graph |
| REQ-002 | state is candidate and event is plan | planned | prismpm.yml plan job: binds the immutable candidate release to observed target state without rebuilding |
| REQ-003 | state is planned and event is deploy | deployed | prismpm.yml deploy job: deploys the exact release and exact plan, then attaches deployment evidence |
| REQ-004 | state is deployed and event is verify and evidence is complete | verified | prismpm.yml verify-deployment: require observed deployment state and complete attached release evidence |
| REQ-005 | state is verified and event is accept and evidence is complete | accepted | prismpm.yml conformance then accept: every public feature case is attached before the candidate-to-accepted transition is signed |
| REQ-006 | state is candidate | candidate | prismpm.yml: a job runs only when the jobs it needs succeeded, so any other event leaves a candidate release where it is |
| REQ-007 | state is planned | planned | prismpm.yml: a job runs only when the jobs it needs succeeded, so any other event leaves a planned release where it is |
| REQ-008 | state is deployed | deployed | prismpm.yml: a job runs only when the jobs it needs succeeded, so any other event leaves a deployed release where it is |
| REQ-009 | state is verified | verified | prismpm.yml: a job runs only when the jobs it needs succeeded, so any other event leaves a verified release where it is |
| REQ-010 | state is accepted | accepted | prismpm.yml: a job runs only when the jobs it needs succeeded, so any other event leaves a accepted release where it is |
| otherwise | no rule matches | built | prismpm.yml: without a protected ref the promote job never requests credentials, so a built release stays built |

## State machine

The state is state, and the answer is the next state. A run feeds each answer back in as the next state, starting from built (OMG UML 2.5.1, clause 14). All 120 requests of the spec's sample were stepped to find the states a run can reach. The invariants are INV-005. Each holds for one step, so by induction it holds over every run.

| State | Kind | Meaning |
| --- | --- | --- |
| built | initial, reachable | built once by the build job, without publication credentials |
| candidate | reachable | signed, promoted to candidate and pushed to the registry |
| planned | reachable | bound to observed target state by a deployment plan |
| deployed | reachable | deployed from the exact plan with deployment evidence attached |
| verified | reachable | post-deployment state and release evidence verified after a clean pull |
| accepted | final, reachable | conformance attached and promoted to accepted, the final state |

## Transitions

Every step a reachable state can take, and the rule that takes it.

| From | To | By |
| --- | --- | --- |
| built | candidate | REQ-001 |
| built | built | otherwise |
| candidate | candidate | REQ-006 |
| candidate | planned | REQ-002 |
| planned | planned | REQ-007 |
| planned | deployed | REQ-003 |
| deployed | deployed | REQ-008 |
| deployed | verified | REQ-004 |
| verified | verified | REQ-009 |
| verified | accepted | REQ-005 |
| accepted | accepted | REQ-010 |

## 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 candidate when state is built and ref is unprotected. | TemplateReleaseLifecycleProofs::inv001Holds | authorize-release rejects publication from an unprotected ref |
| INV-002 | It never answers verified when state is deployed and evidence is missing. | TemplateReleaseLifecycleProofs::inv002Holds | verify-deployment requires observed state and complete attached evidence |
| INV-003 | It never answers accepted when state is verified and evidence is missing. | TemplateReleaseLifecycleProofs::inv003Holds | accept needs the conformance-bearing graph |
| INV-004 | It never answers accepted when state is built. | TemplateReleaseLifecycleProofs::inv004Holds | accept needs promote, deploy, verify-deployment and conformance first |
| INV-005 | It always answers accepted when state is accepted. | TemplateReleaseLifecycleProofs::inv005Holds | accepted is a final state (UML 2.5.1 FinalState): a run that reaches it stays there |

## Architecture

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

| Stakeholder | Who they are | Concerns |
| --- | --- | --- |
| Release approver | Guards the protected release and deployment environments and needs no unprotected ref or missing evidence to reach accepted. | Proved guarantees, Refused malformed requests |
| Template adopter | Creates a repository from the template and needs prismpm.yml to take a release from build to accepted with nothing skipped. | 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 built 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 5 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

10 components and 15 edges between them.

| Component | Kind | What it is |
| --- | --- | --- |
| Browser | externalSystem | The visitor's web browser, which loads the page and runs the Release lifecycle guest. |
| Deployment target | externalSystem | The modeled target, kubernetes-production by default, whose observed state the plan binds. |
| GHCR | externalSystem | The registry the candidate and accepted graphs are pushed to and pulled from. |
| 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. |
| PrismPM product pipeline | cliAdapter | The reusable prismpm.yml workflow whose jobs are the lifecycle events. |
| Release lifecycle 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. |
| Release lifecycle page | staticSite | The page the template publishes: the holo, its fingerprint, its provenance and its acceptance vectors. |
| Sigstore | externalSystem | Keyless signing of the development-to-candidate and candidate-to-accepted transitions. |
| 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 Release lifecycle request | opmObjectProcess | Template adopter: Correct answers |
| Components of Release lifecycle | umlComponent | Verifier: Integrity of the published app |
| Answering a Release lifecycle request | umlSequence | Template adopter: Correct answers |
| States of the Release lifecycle guest | umlStateMachine | Release approver: Refused malformed requests |
| The Release lifecycle state machine | umlStateMachine | Template adopter: Correct answers |

## Features and journeys

17 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 state is built and event is promote and ref is protected, the answer is candidate. | TemplateReleaseLifecycle::rule1, TemplateReleaseLifecycle::judge | TemplateReleaseLifecycle::application |
| When state is candidate and event is plan, the answer is planned. | TemplateReleaseLifecycle::rule2, TemplateReleaseLifecycle::judge | TemplateReleaseLifecycle::application |
| When state is planned and event is deploy, the answer is deployed. | TemplateReleaseLifecycle::rule3, TemplateReleaseLifecycle::judge | TemplateReleaseLifecycle::application |
| When state is deployed and event is verify and evidence is complete, the answer is verified. | TemplateReleaseLifecycle::rule4, TemplateReleaseLifecycle::judge | TemplateReleaseLifecycle::application |
| When state is verified and event is accept and evidence is complete, the answer is accepted. | TemplateReleaseLifecycle::rule5, TemplateReleaseLifecycle::judge | TemplateReleaseLifecycle::application |
| When state is candidate, the answer is candidate. | TemplateReleaseLifecycle::rule6, TemplateReleaseLifecycle::judge | TemplateReleaseLifecycle::application |
| When state is planned, the answer is planned. | TemplateReleaseLifecycle::rule7, TemplateReleaseLifecycle::judge | TemplateReleaseLifecycle::application |
| When state is deployed, the answer is deployed. | TemplateReleaseLifecycle::rule8, TemplateReleaseLifecycle::judge | TemplateReleaseLifecycle::application |
| When state is verified, the answer is verified. | TemplateReleaseLifecycle::rule9, TemplateReleaseLifecycle::judge | TemplateReleaseLifecycle::application |
| When state is accepted, the answer is accepted. | TemplateReleaseLifecycle::rule10, TemplateReleaseLifecycle::judge | TemplateReleaseLifecycle::application |
| When no rule matches, the answer is built. | TemplateReleaseLifecycle::judge | TemplateReleaseLifecycle::application |
| A request that is not state, event, ref, evidence in order, separated by single spaces, or is over 112 bytes, is answered invalid. | TemplateReleaseLifecycle::dispatch, TemplateReleaseLifecycle::decodeField1 | TemplateReleaseLifecycle::application |
| It never answers candidate when state is built and ref is unprotected. | TemplateReleaseLifecycle::judge | TemplateReleaseLifecycleProofs::inv001Holds |
| It never answers verified when state is deployed and evidence is missing. | TemplateReleaseLifecycle::judge | TemplateReleaseLifecycleProofs::inv002Holds |
| It never answers accepted when state is verified and evidence is missing. | TemplateReleaseLifecycle::judge | TemplateReleaseLifecycleProofs::inv003Holds |
| It never answers accepted when state is built. | TemplateReleaseLifecycle::judge | TemplateReleaseLifecycleProofs::inv004Holds |
| It always answers accepted when state is accepted. | TemplateReleaseLifecycle::judge | TemplateReleaseLifecycleProofs::inv005Holds |

## Journeys

The ordered features each stakeholder takes.

| Stakeholder | Steps |
| --- | --- |
| Release approver | INV-001 → INV-002 → INV-003 → INV-004 → refuse |
| Template adopter | REQ-001 → REQ-002 → REQ-003 → REQ-004 → REQ-005 → REQ-010 |
| Verifier | refuse → INV-001 → INV-002 → INV-003 → INV-004 → INV-005 |

## Security and threat model

14 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 |
| --- | --- | --- | --- | --- |
| Acceptance without evidence | repudiation | Answer | medium likelihood, major impact | Evidence before verification and acceptance: proof TemplateReleaseLifecycleProofs::inv002Holds; proof TemplateReleaseLifecycleProofs::inv003Holds; gate verify-deployment and conformance jobs in .github/workflows/prismpm.yml |
| Answer that breaks INV-001 | repudiation | Answer | medium likelihood, critical impact | Proof of INV-001: proof TemplateReleaseLifecycleProofs::inv001Holds |
| Answer that breaks INV-002 | repudiation | Answer | medium likelihood, critical impact | Proof of INV-002: proof TemplateReleaseLifecycleProofs::inv002Holds |
| Answer that breaks INV-003 | repudiation | Answer | medium likelihood, critical impact | Proof of INV-003: proof TemplateReleaseLifecycleProofs::inv003Holds |
| Answer that breaks INV-004 | repudiation | Answer | medium likelihood, critical impact | Proof of INV-004: proof TemplateReleaseLifecycleProofs::inv004Holds |
| Answer that breaks INV-005 | repudiation | Answer | medium likelihood, critical impact | Proof of INV-005: proof TemplateReleaseLifecycleProofs::inv005Holds |
| 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 |
| Publication from an unprotected ref | elevationOfPrivilege | Answer | medium likelihood, critical impact | Protected ref before promotion: proof TemplateReleaseLifecycleProofs::inv001Holds; gate authorize-release job in .github/workflows/prismpm.yml |
| Rebuilt release between steps | tampering | Model source | low likelihood, major impact | accepted: The app decides lifecycle states, not digests; prismpm.yml passes one immutable-reference from promote to every later job and never rebuilds. |
| 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 pipeline job modeled: Each of the five prismpm.yml jobs after build (promote, plan, deploy, verify-deployment with conformance, accept) is one transition of the machine. | Functional suitability: Functional completeness | Steps from built to accepted | 5 |
| Every property proved: All 5 properties are theorems the Lean kernel checks. | Security: Integrity | Unproved properties | 0 |
| Every request answered: Every request gets an answer: a rule, built otherwise, or invalid. | Functional suitability: Functional completeness | Unanswered requests | 0 |
| Every vector replays: All 41 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 7 examples of the spec is answered as it states. | Functional suitability: Functional correctness | Example mismatches | 0 |
| No skipped job: No single step takes a release past a job it needs. | Security: Accountability | Skipping transitions | 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, Design::viewUmlMachine |
| 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 UML 2.5.1 behavioral state machine | State machine | TemplateReleaseLifecycle::judge, TemplateReleaseLifecycleProofs::inv005Holds |
| OpenSpec | Requirements | TemplateReleaseLifecycle::application |
| SPDX MIT OR Apache-2.0 | Licensing | TemplateReleaseLifecycle::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 Release lifecycle request
Viewpoint: Architecture::viewpointTemplateAdopterCorrectAnswers
Notation: ISO/PAS 19450:2015 OPM, Prism OPL profile

componentBrowser is an object.
componentReleaseLifecycleGuest is an object.
componentReleaseLifecycleGuest can be stateDeciding or stateIdle.
processDecide is a process.
processEncodeAnswer is a process.
processJudge is a process.
processParseRequest is a process.
componentReleaseLifecycleGuest 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 Release lifecycle
component "componentBrowser" as c0
component "componentDeploymentTarget" as c1
component "componentGHCR" as c2
component "componentGitHubPages" as c3
component "componentPrismBuild" as c4
component "componentPrismPMProductPipeline" as c5
component "componentReleaseLifecycleGuest" as c6
component "componentReleaseLifecyclePage" as c7
component "componentSigstore" as c8
component "componentSourceRepository" as c9
c0 --> c6 : edgeBrowserToReleaseLifecycleGuest
c1 --> c6 : edgeDeploymentTargetToReleaseLifecycleGuest
c2 --> c6 : edgeGHCRToReleaseLifecycleGuest
c3 --> c0 : edgeGitHubPagesToBrowser
c4 --> c6 : edgePrismBuildToReleaseLifecycleGuest
c4 --> c7 : edgePrismBuildToReleaseLifecyclePage
c5 --> c6 : edgePrismPMProductPipelineToReleaseLifecycleGuest
c6 --> c0 : edgeReleaseLifecycleGuestToBrowser
c6 --> c1 : edgeReleaseLifecycleGuestToDeploymentTarget
c6 --> c2 : edgeReleaseLifecycleGuestToGHCR
c6 --> c5 : edgeReleaseLifecycleGuestToPrismPMProductPipeline
c6 --> c8 : edgeReleaseLifecycleGuestToSigstore
c7 --> c3 : edgeReleaseLifecyclePageToGitHubPages
c8 --> c6 : edgeSigstoreToReleaseLifecycleGuest
c9 --> c4 : edgeSourceRepositoryToPrismBuild
@enduml

```

### design/Design.viewUmlMachine.puml

```
@startuml
' UML 2.5.1 state machine diagram
' view: Design::viewUmlMachine
' viewpoint: Architecture::viewpointTemplateAdopterCorrectAnswers
title The Release lifecycle state machine
state "stateMachineAccepted" as s0
state "stateMachineBuilt" as s1
state "stateMachineCandidate" as s2
state "stateMachineDeployed" as s3
state "stateMachinePlanned" as s4
state "stateMachineVerified" as s5
[*] --> s1
s1 --> s2 : processRule1
s1 --> s1 : processOtherwise
s2 --> s2 : processRule6
s2 --> s4 : processRule2
s4 --> s4 : processRule7
s4 --> s3 : processRule3
s3 --> s3 : processRule8
s3 --> s5 : processRule4
s5 --> s5 : processRule9
s5 --> s0 : processRule5
s0 --> s0 : processRule10
@enduml

```

### design/Design.viewUmlRequest.puml

```
@startuml
' UML 2.5.1 sequence diagram
' view: Design::viewUmlRequest
' viewpoint: Architecture::viewpointTemplateAdopterCorrectAnswers
title Answering a Release lifecycle request
participant "componentBrowser" as p0
participant "componentReleaseLifecycleGuest" 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::viewpointReleaseApproverRefusedMalformedRequests
title States of the Release lifecycle guest
state "stateAnsweredAccepted" as s0
state "stateAnsweredBuilt" as s1
state "stateAnsweredCandidate" as s2
state "stateAnsweredDeployed" as s3
state "stateAnsweredPlanned" as s4
state "stateAnsweredVerified" as s5
state "stateDeciding" as s6
state "stateIdle" as s7
state "stateRefused" as s8
[*] --> s7
s7 --> s6 : processParseRequest
s7 --> s8 : processParseRequest
s6 --> s2 : processRule1
s6 --> s4 : processRule2
s6 --> s3 : processRule3
s6 --> s5 : processRule4
s6 --> s0 : processRule5
s6 --> s2 : processRule6
s6 --> s4 : processRule7
s6 --> s3 : processRule8
s6 --> s5 : processRule9
s6 --> s0 : processRule10
s6 --> s1 : processOtherwise
s1 --> s7 : processEncodeAnswer
s2 --> s7 : processEncodeAnswer
s4 --> s7 : processEncodeAnswer
s3 --> s7 : processEncodeAnswer
s5 --> s7 : processEncodeAnswer
s0 --> s7 : processEncodeAnswer
s8 --> s7 : processEncodeAnswer
@enduml

```

## Prism source

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

- app/src/Architecture.lex.tex (448 lines)
- app/src/Compliance.lex.tex (56 lines)
- app/src/Design.lex.tex (906 lines)
- app/src/Features.lex.tex (186 lines)
- app/src/Quality.lex.tex (375 lines)
- app/src/Security.lex.tex (635 lines)
- app/src/TemplateReleaseLifecycle.lex.tex (338 lines)
- app/src/TemplateReleaseLifecycleProofs.lex.tex (294 lines)
- app/lexlean.toml (43 lines)
- app/prompt.json (474 lines)
- model/ids.toml (71 lines)
- features/suites/template\_release\_lifecycle.feature (50 lines)
- crates/conformance/tests/template\_release\_lifecycle.rs (142 lines)
- site/app.json (127 lines)
- openspec/specs/template-release-lifecycle/spec.md (253 lines)
