# Organization lifecycle

> Move a Foundry organization through its life. Only its own admins can switch it on, pause it or retire it.

Inspired by UOR-Foundation/uor-foundry (https://github.com/UOR-Foundation/uor-foundry). A generic organization-management platform on PrismPM, where organizations are created, activated, suspended and retired through scoped multi-administrator workflows. 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 Organization lifecycle state machine.** Each box is a state and each arrow a step a rule can take. A run starts at provisional and stops at retired. Dashed arrows go back to an earlier state.

| From | Link | To |
| --- | --- | --- |
| provisional | otherwise | provisional |
| provisional | REQ-001 | activated |
| activated | REQ-005 | activated |
| activated | REQ-002 | suspended |
| activated | REQ-004 | retired |
| suspended | REQ-006 | suspended |
| suspended | REQ-003 | activated |
| retired | REQ-007 | retired |

Verified by prismpm verify in the pinned SDK. Fingerprint: d1f84f85782bf516d73ea0f6b2303df96d3a92afcd534f64e0632b113eb76190. Acceptance vectors: 50. Claims: 8.

## The prompt

```json
{
  "schema": "prism/prompt/1",
  "pattern": "stateMachine",
  "machine": {
    "state": "state",
    "initial": "provisional",
    "final": [
      "retired"
    ]
  },
  "goal": "Move a Foundry organization through its life. Only its own admins can switch it on, pause it or retire it.",
  "repository": "UOR-Foundation/uor-foundry",
  "app": {
    "name": "foundry-org-lifecycle",
    "title": "Organization lifecycle",
    "purpose": "Give the next lifecycle state of a Foundry organization from its current state, the requested transition, whose administrators approve it, how many distinct administrators approve and whether they cover every part.",
    "fields": [
      {
        "name": "state",
        "kind": "choice",
        "values": [
          "provisional",
          "activated",
          "suspended",
          "retired"
        ],
        "means": "the organization's lifecycle state now"
      },
      {
        "name": "event",
        "kind": "choice",
        "values": [
          "activate",
          "suspend",
          "reactivate",
          "retire"
        ],
        "means": "the lifecycle transition requested"
      },
      {
        "name": "scope",
        "kind": "choice",
        "values": [
          "own",
          "other"
        ],
        "means": "whether the approving administrators belong to this organization or another one"
      },
      {
        "name": "administrators",
        "kind": "number",
        "min": 0,
        "max": 64,
        "means": "distinct users approving; aliases, extra keys and duplicate approvals count once"
      },
      {
        "name": "coverage",
        "kind": "choice",
        "values": [
          "complete",
          "partial"
        ],
        "means": "whether administrators cover every part of the organization"
      }
    ],
    "outcomes": [
      "provisional",
      "activated",
      "suspended",
      "retired"
    ],
    "meanings": {
      "provisional": "created by any enrolled user, with only the creator's provisional grants",
      "activated": "policy-compliant active operation",
      "suspended": "operation suspended by its administrators",
      "retired": "retired with its audit logs kept, the final state"
    },
    "rules": [
      {
        "when": [
          {
            "field": "state",
            "op": "is",
            "value": "provisional"
          },
          {
            "field": "event",
            "op": "is",
            "value": "activate"
          },
          {
            "field": "scope",
            "op": "is",
            "value": "own"
          },
          {
            "field": "administrators",
            "op": ">=",
            "value": 2
          },
          {
            "field": "coverage",
            "op": "is",
            "value": "complete"
          }
        ],
        "then": "activated",
        "why": "model/organization_lifecycle.toml: provisional to activated only after distinct-user multi-admin quorum coverage (activation_minimum_distinct_administrators = 2); SPEC.md: complete administrative coverage"
      },
      {
        "when": [
          {
            "field": "state",
            "op": "is",
            "value": "activated"
          },
          {
            "field": "event",
            "op": "is",
            "value": "suspend"
          },
          {
            "field": "scope",
            "op": "is",
            "value": "own"
          },
          {
            "field": "administrators",
            "op": ">=",
            "value": 2
          }
        ],
        "then": "suspended",
        "why": "model/organization_lifecycle.toml: an activated organization may be suspended by authorized distinct administrators (minimum 2)"
      },
      {
        "when": [
          {
            "field": "state",
            "op": "is",
            "value": "suspended"
          },
          {
            "field": "event",
            "op": "is",
            "value": "reactivate"
          },
          {
            "field": "scope",
            "op": "is",
            "value": "own"
          },
          {
            "field": "administrators",
            "op": ">=",
            "value": 2
          }
        ],
        "then": "activated",
        "why": "model/organization_lifecycle.toml: a suspended organization may be reactivated (minimum 2 distinct administrators)"
      },
      {
        "when": [
          {
            "field": "state",
            "op": "is",
            "value": "activated"
          },
          {
            "field": "event",
            "op": "is",
            "value": "retire"
          },
          {
            "field": "scope",
            "op": "is",
            "value": "own"
          },
          {
            "field": "administrators",
            "op": ">=",
            "value": 2
          }
        ],
        "then": "retired",
        "why": "model/organization_lifecycle.toml: an activated organization may be retired, keeping its audit logs (minimum 2 distinct administrators)"
      },
      {
        "when": [
          {
            "field": "state",
            "op": "is",
            "value": "activated"
          }
        ],
        "then": "activated",
        "why": "model/organization_lifecycle.toml: allowed_transitions lists no other move out of activated"
      },
      {
        "when": [
          {
            "field": "state",
            "op": "is",
            "value": "suspended"
          }
        ],
        "then": "suspended",
        "why": "model/organization_lifecycle.toml: allowed_transitions lists only reactivation out of suspended"
      },
      {
        "when": [
          {
            "field": "state",
            "op": "is",
            "value": "retired"
          }
        ],
        "then": "retired",
        "why": "model/organization_lifecycle.toml: allowed_transitions lists no move out of retired"
      }
    ],
    "otherwise": "provisional",
    "otherwiseWhy": "model/organization_lifecycle.toml: allow_sole_founding_admin_in_provisional; a provisional organization without quorum and coverage stays provisional",
    "properties": [
      {
        "kind": "never",
        "when": [
          {
            "field": "state",
            "op": "is",
            "value": "provisional"
          },
          {
            "field": "administrators",
            "op": "<",
            "value": 2
          }
        ],
        "then": "activated",
        "why": "a sole founding administrator is a bootstrap condition, not accepted redundancy"
      },
      {
        "kind": "never",
        "when": [
          {
            "field": "state",
            "op": "is",
            "value": "provisional"
          },
          {
            "field": "coverage",
            "op": "is",
            "value": "partial"
          }
        ],
        "then": "activated",
        "why": "activation needs complete administrative coverage of the organization's parts"
      },
      {
        "kind": "never",
        "when": [
          {
            "field": "scope",
            "op": "is",
            "value": "other"
          },
          {
            "field": "state",
            "op": "is",
            "value": "activated"
          }
        ],
        "then": "retired",
        "why": "creation never gives authority over another organization"
      },
      {
        "kind": "never",
        "when": [
          {
            "field": "state",
            "op": "is",
            "value": "suspended"
          }
        ],
        "then": "retired",
        "why": "retirement is allowed only from activated"
      }
    ],
    "examples": [
      {
        "request": "provisional activate own 2 complete",
        "response": "activated"
      },
      {
        "request": "provisional activate own 1 complete",
        "response": "provisional"
      },
      {
        "request": "provisional activate own 3 partial",
        "response": "provisional"
      },
      {
        "request": "activated suspend own 2 complete",
        "response": "suspended"
      },
      {
        "request": "suspended reactivate own 2 complete",
        "response": "activated"
      },
      {
        "request": "activated retire other 5 complete",
        "response": "activated"
      },
      {
        "request": "activated retire own 2 complete",
        "response": "retired"
      },
      {
        "request": "retired reactivate own 9 complete",
        "response": "retired"
      }
    ]
  },
  "stakeholders": [
    {
      "name": "Organization founder",
      "text": "Enrolls, creates an organization with any display name and needs it to activate once a second administrator covers every part.",
      "concerns": [
        "Correct answers",
        "Proved guarantees"
      ]
    },
    {
      "name": "Organization administrator",
      "text": "Approves suspension, reactivation and retirement and needs no single user or other organization to move the organization alone.",
      "concerns": [
        "Proved guarantees",
        "Refused malformed requests"
      ]
    }
  ],
  "components": [
    {
      "name": "Foundry portal",
      "text": "The browser portal whose Views request lifecycle transitions.",
      "kind": "staticSite"
    },
    {
      "name": "Foundry authority model",
      "text": "model/authority.toml, the scoped multi-administrator policy that counts distinct approvers.",
      "kind": "externalSystem"
    }
  ],
  "threats": [
    {
      "name": "Single-owner activation",
      "text": "The sole founding administrator activates the organization without a second distinct user.",
      "stride": "elevationOfPrivilege",
      "asset": "answer",
      "likelihood": "high",
      "impact": "major",
      "control": {
        "name": "Distinct-user quorum",
        "text": "Activation needs two distinct administrators and complete coverage.",
        "evidence": [
          {
            "kind": "proof",
            "reference": "FoundryOrgLifecycleProofs::inv001Holds"
          },
          {
            "kind": "proof",
            "reference": "FoundryOrgLifecycleProofs::inv002Holds"
          },
          {
            "kind": "review",
            "reference": "UOR-Foundation/uor-foundry model/organization_lifecycle.toml"
          }
        ]
      }
    },
    {
      "name": "Cross-organization retirement",
      "text": "Administrators of another organization, possibly one with an identical display name, retire this one.",
      "stride": "spoofing",
      "asset": "answer",
      "likelihood": "medium",
      "impact": "critical",
      "control": {
        "name": "Organization isolation",
        "text": "Only this organization's administrators move it.",
        "evidence": [
          {
            "kind": "proof",
            "reference": "FoundryOrgLifecycleProofs::inv003Holds"
          },
          {
            "kind": "review",
            "reference": "UOR-Foundation/uor-foundry SPEC.md: names confer no privileges"
          }
        ]
      }
    },
    {
      "name": "Duplicate approvals counted",
      "text": "Aliases or extra keys of one user are counted as several administrators.",
      "stride": "spoofing",
      "asset": "request",
      "likelihood": "medium",
      "impact": "major",
      "accepted": "The app is given the count of distinct users; deduplicating aliases and keys belongs to the authority model that sends it, per SPEC.md."
    }
  ],
  "quality": [
    {
      "characteristic": "Security",
      "subcharacteristic": "Authenticity",
      "requirement": "Two distinct administrators per transition",
      "text": "Every transition out of a state needs at least the minimum_distinct_administrators of model/organization_lifecycle.toml.",
      "measure": "Administrators per transition",
      "measureText": "Fewest distinct administrators any allowed transition accepts.",
      "threshold": 2
    },
    {
      "characteristic": "Functional suitability",
      "subcharacteristic": "Functional completeness",
      "requirement": "Every allowed transition modeled",
      "text": "Each of the four allowed_transitions rows is one rule of the machine.",
      "measure": "Unmodeled transitions",
      "measureText": "allowed_transitions rows with no rule.",
      "threshold": 0
    }
  ],
  "journeys": [
    {
      "stakeholder": "Organization founder",
      "steps": [
        "otherwise",
        "INV-001",
        "REQ-001"
      ]
    },
    {
      "stakeholder": "Organization administrator",
      "steps": [
        "REQ-002",
        "REQ-003",
        "REQ-004",
        "INV-003",
        "INV-004",
        "refuse"
      ]
    }
  ],
  "concerns": [],
  "license": "MIT OR Apache-2.0",
  "axioms": {}
}
```

## Claims

- FO-01: The app never answers activated when state is provisional and administrators is below 2
- FO-02: The app never answers activated when state is provisional and coverage is partial
- FO-03: The app never answers retired when scope is other and state is activated
- FO-04: The app never answers retired when state is suspended
- FO-05: The app always answers retired when state is retired
- FO-06: The architecture description declares every stakeholder, concern, component, edge, viewpoint and view it references
- FO-07: The ISO/IEC 25010 quality model numbers every characteristic, subcharacteristic, requirement and measure, and every parent it names is declared
- FO-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 | provisional, activated, suspended, retired |

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

|  | rules |
| --- | --- |
| provisional | 0 |
| activated | 3 |
| suspended | 2 |
| retired | 2 |

## Behavior

A request is state, event, scope, administrators, coverage, separated by spaces. The first rule that matches decides. If none matches, the answer is provisional. A request over 136 bytes, or in any other form, is answered invalid.

| Rule | When | Answer | Why |
| --- | --- | --- | --- |
| REQ-001 | state is provisional and event is activate and scope is own and administrators is at least 2 and coverage is complete | activated | model/organization\_lifecycle.toml: provisional to activated only after distinct-user multi-admin quorum coverage (activation\_minimum\_distinct\_administrators = 2); SPEC.md: complete administrative coverage |
| REQ-002 | state is activated and event is suspend and scope is own and administrators is at least 2 | suspended | model/organization\_lifecycle.toml: an activated organization may be suspended by authorized distinct administrators (minimum 2) |
| REQ-003 | state is suspended and event is reactivate and scope is own and administrators is at least 2 | activated | model/organization\_lifecycle.toml: a suspended organization may be reactivated (minimum 2 distinct administrators) |
| REQ-004 | state is activated and event is retire and scope is own and administrators is at least 2 | retired | model/organization\_lifecycle.toml: an activated organization may be retired, keeping its audit logs (minimum 2 distinct administrators) |
| REQ-005 | state is activated | activated | model/organization\_lifecycle.toml: allowed\_transitions lists no other move out of activated |
| REQ-006 | state is suspended | suspended | model/organization\_lifecycle.toml: allowed\_transitions lists only reactivation out of suspended |
| REQ-007 | state is retired | retired | model/organization\_lifecycle.toml: allowed\_transitions lists no move out of retired |
| otherwise | no rule matches | provisional | model/organization\_lifecycle.toml: allow\_sole\_founding\_admin\_in\_provisional; a provisional organization without quorum and coverage stays provisional |

## 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 provisional (OMG UML 2.5.1, clause 14). All 384 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 |
| --- | --- | --- |
| provisional | initial, reachable | created by any enrolled user, with only the creator's provisional grants |
| activated | reachable | policy-compliant active operation |
| suspended | reachable | operation suspended by its administrators |
| retired | final, reachable | retired with its audit logs kept, the final state |

## Transitions

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

| From | To | By |
| --- | --- | --- |
| provisional | provisional | otherwise |
| provisional | activated | REQ-001 |
| activated | activated | REQ-005 |
| activated | suspended | REQ-002 |
| activated | retired | REQ-004 |
| suspended | suspended | REQ-006 |
| suspended | activated | REQ-003 |
| retired | retired | REQ-007 |

## 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 activated when state is provisional and administrators is below 2. | FoundryOrgLifecycleProofs::inv001Holds | a sole founding administrator is a bootstrap condition, not accepted redundancy |
| INV-002 | It never answers activated when state is provisional and coverage is partial. | FoundryOrgLifecycleProofs::inv002Holds | activation needs complete administrative coverage of the organization's parts |
| INV-003 | It never answers retired when scope is other and state is activated. | FoundryOrgLifecycleProofs::inv003Holds | creation never gives authority over another organization |
| INV-004 | It never answers retired when state is suspended. | FoundryOrgLifecycleProofs::inv004Holds | retirement is allowed only from activated |
| INV-005 | It always answers retired when state is retired. | FoundryOrgLifecycleProofs::inv005Holds | retired 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 |
| --- | --- | --- |
| Organization administrator | Approves suspension, reactivation and retirement and needs no single user or other organization to move the organization alone. | Proved guarantees, Refused malformed requests |
| Organization founder | Enrolls, creates an organization with any display name and needs it to activate once a second administrator covers every part. | 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 provisional 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 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 Organization lifecycle guest. |
| Foundry authority model | externalSystem | model/authority.toml, the scoped multi-administrator policy that counts distinct approvers. |
| Foundry portal | staticSite | The browser portal whose Views request lifecycle transitions. |
| GitHub Pages | externalSystem | Serves the page and the holo from the repository Pages workflow. |
| Organization lifecycle 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. |
| Organization lifecycle page | staticSite | The page the template publishes: the holo, its fingerprint, its provenance and its acceptance vectors. |
| 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 Organization lifecycle request | opmObjectProcess | Organization founder: Correct answers |
| Components of Organization lifecycle | umlComponent | Verifier: Integrity of the published app |
| Answering a Organization lifecycle request | umlSequence | Organization founder: Correct answers |
| States of the Organization lifecycle guest | umlStateMachine | Organization administrator: Refused malformed requests |
| The Organization lifecycle state machine | umlStateMachine | Organization founder: Correct answers |

## Features and journeys

14 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 provisional and event is activate and scope is own and administrators is at least 2 and coverage is complete, the answer is activated. | FoundryOrgLifecycle::rule1, FoundryOrgLifecycle::judge | FoundryOrgLifecycle::application |
| When state is activated and event is suspend and scope is own and administrators is at least 2, the answer is suspended. | FoundryOrgLifecycle::rule2, FoundryOrgLifecycle::judge | FoundryOrgLifecycle::application |
| When state is suspended and event is reactivate and scope is own and administrators is at least 2, the answer is activated. | FoundryOrgLifecycle::rule3, FoundryOrgLifecycle::judge | FoundryOrgLifecycle::application |
| When state is activated and event is retire and scope is own and administrators is at least 2, the answer is retired. | FoundryOrgLifecycle::rule4, FoundryOrgLifecycle::judge | FoundryOrgLifecycle::application |
| When state is activated, the answer is activated. | FoundryOrgLifecycle::rule5, FoundryOrgLifecycle::judge | FoundryOrgLifecycle::application |
| When state is suspended, the answer is suspended. | FoundryOrgLifecycle::rule6, FoundryOrgLifecycle::judge | FoundryOrgLifecycle::application |
| When state is retired, the answer is retired. | FoundryOrgLifecycle::rule7, FoundryOrgLifecycle::judge | FoundryOrgLifecycle::application |
| When no rule matches, the answer is provisional. | FoundryOrgLifecycle::judge | FoundryOrgLifecycle::application |
| A request that is not state, event, scope, administrators, coverage in order, separated by single spaces, or is over 136 bytes, is answered invalid. | FoundryOrgLifecycle::dispatch, FoundryOrgLifecycle::decodeField1 | FoundryOrgLifecycle::application |
| It never answers activated when state is provisional and administrators is below 2. | FoundryOrgLifecycle::judge | FoundryOrgLifecycleProofs::inv001Holds |
| It never answers activated when state is provisional and coverage is partial. | FoundryOrgLifecycle::judge | FoundryOrgLifecycleProofs::inv002Holds |
| It never answers retired when scope is other and state is activated. | FoundryOrgLifecycle::judge | FoundryOrgLifecycleProofs::inv003Holds |
| It never answers retired when state is suspended. | FoundryOrgLifecycle::judge | FoundryOrgLifecycleProofs::inv004Holds |
| It always answers retired when state is retired. | FoundryOrgLifecycle::judge | FoundryOrgLifecycleProofs::inv005Holds |

## Journeys

The ordered features each stakeholder takes.

| Stakeholder | Steps |
| --- | --- |
| Organization administrator | REQ-002 → REQ-003 → REQ-004 → INV-003 → INV-004 → refuse |
| Organization founder | otherwise → INV-001 → REQ-001 |
| 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 |
| --- | --- | --- | --- | --- |
| Answer that breaks INV-001 | repudiation | Answer | medium likelihood, critical impact | Proof of INV-001: proof FoundryOrgLifecycleProofs::inv001Holds |
| Answer that breaks INV-002 | repudiation | Answer | medium likelihood, critical impact | Proof of INV-002: proof FoundryOrgLifecycleProofs::inv002Holds |
| Answer that breaks INV-003 | repudiation | Answer | medium likelihood, critical impact | Proof of INV-003: proof FoundryOrgLifecycleProofs::inv003Holds |
| Answer that breaks INV-004 | repudiation | Answer | medium likelihood, critical impact | Proof of INV-004: proof FoundryOrgLifecycleProofs::inv004Holds |
| Answer that breaks INV-005 | repudiation | Answer | medium likelihood, critical impact | Proof of INV-005: proof FoundryOrgLifecycleProofs::inv005Holds |
| Cross-organization retirement | spoofing | Answer | medium likelihood, critical impact | Organization isolation: proof FoundryOrgLifecycleProofs::inv003Holds; review UOR-Foundation/uor-foundry SPEC.md: names confer no privileges |
| Duplicate approvals counted | spoofing | Request bytes | medium likelihood, major impact | accepted: The app is given the count of distinct users; deduplicating aliases and keys belongs to the authority model that sends it, per SPEC.md. |
| 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 |
| Single-owner activation | elevationOfPrivilege | Answer | high likelihood, major impact | Distinct-user quorum: proof FoundryOrgLifecycleProofs::inv001Holds; proof FoundryOrgLifecycleProofs::inv002Holds; review UOR-Foundation/uor-foundry model/organization\_lifecycle.toml |
| 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 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 allowed transition modeled: Each of the four allowed\_transitions rows is one rule of the machine. | Functional suitability: Functional completeness | Unmodeled transitions | 0 |
| 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, provisional otherwise, or invalid. | Functional suitability: Functional completeness | Unanswered requests | 0 |
| Every vector replays: All 50 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 |
| Two distinct administrators per transition: Every transition out of a state needs at least the minimum\_distinct\_administrators of model/organization\_lifecycle.toml. | Security: Authenticity | Administrators per transition | 2 |

## 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 | FoundryOrgLifecycle::judge, FoundryOrgLifecycleProofs::inv005Holds |
| OpenSpec | Requirements | FoundryOrgLifecycle::application |
| SPDX MIT OR Apache-2.0 | Licensing | FoundryOrgLifecycle::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 Organization lifecycle request
Viewpoint: Architecture::viewpointOrganizationFounderCorrectAnswers
Notation: ISO/PAS 19450:2015 OPM, Prism OPL profile

componentBrowser is an object.
componentOrganizationLifecycleGuest is an object.
componentOrganizationLifecycleGuest can be stateDeciding or stateIdle.
processDecide is a process.
processEncodeAnswer is a process.
processJudge is a process.
processParseRequest is a process.
componentOrganizationLifecycleGuest 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 Organization lifecycle
component "componentBrowser" as c0
component "componentFoundryAuthorityModel" as c1
component "componentFoundryPortal" as c2
component "componentGitHubPages" as c3
component "componentOrganizationLifecycleGuest" as c4
component "componentOrganizationLifecyclePage" as c5
component "componentPrismBuild" as c6
component "componentSourceRepository" as c7
c0 --> c4 : edgeBrowserToOrganizationLifecycleGuest
c1 --> c4 : edgeFoundryAuthorityModelToOrganizationLifecycleGuest
c2 --> c4 : edgeFoundryPortalToOrganizationLifecycleGuest
c3 --> c0 : edgeGitHubPagesToBrowser
c4 --> c0 : edgeOrganizationLifecycleGuestToBrowser
c4 --> c1 : edgeOrganizationLifecycleGuestToFoundryAuthorityModel
c4 --> c2 : edgeOrganizationLifecycleGuestToFoundryPortal
c5 --> c3 : edgeOrganizationLifecyclePageToGitHubPages
c6 --> c4 : edgePrismBuildToOrganizationLifecycleGuest
c6 --> c5 : edgePrismBuildToOrganizationLifecyclePage
c7 --> c6 : edgeSourceRepositoryToPrismBuild
@enduml

```

### design/Design.viewUmlMachine.puml

```
@startuml
' UML 2.5.1 state machine diagram
' view: Design::viewUmlMachine
' viewpoint: Architecture::viewpointOrganizationFounderCorrectAnswers
title The Organization lifecycle state machine
state "stateMachineActivated" as s0
state "stateMachineProvisional" as s1
state "stateMachineRetired" as s2
state "stateMachineSuspended" as s3
[*] --> s1
s1 --> s1 : processOtherwise
s1 --> s0 : processRule1
s0 --> s0 : processRule5
s0 --> s3 : processRule2
s0 --> s2 : processRule4
s3 --> s3 : processRule6
s3 --> s0 : processRule3
s2 --> s2 : processRule7
@enduml

```

### design/Design.viewUmlRequest.puml

```
@startuml
' UML 2.5.1 sequence diagram
' view: Design::viewUmlRequest
' viewpoint: Architecture::viewpointOrganizationFounderCorrectAnswers
title Answering a Organization lifecycle request
participant "componentBrowser" as p0
participant "componentOrganizationLifecycleGuest" 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::viewpointOrganizationAdministratorRefusedMalformedRequests
title States of the Organization lifecycle guest
state "stateAnsweredActivated" as s0
state "stateAnsweredProvisional" as s1
state "stateAnsweredRetired" as s2
state "stateAnsweredSuspended" as s3
state "stateDeciding" as s4
state "stateIdle" as s5
state "stateRefused" as s6
[*] --> s5
s5 --> s4 : processParseRequest
s5 --> s6 : processParseRequest
s4 --> s0 : processRule1
s4 --> s3 : processRule2
s4 --> s0 : processRule3
s4 --> s2 : processRule4
s4 --> s0 : processRule5
s4 --> s3 : processRule6
s4 --> s2 : processRule7
s4 --> s1 : processOtherwise
s1 --> s5 : processEncodeAnswer
s0 --> s5 : processEncodeAnswer
s3 --> s5 : processEncodeAnswer
s2 --> s5 : processEncodeAnswer
s6 --> s5 : processEncodeAnswer
@enduml

```

## Prism source

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

- app/src/Architecture.lex.tex (406 lines)
- app/src/Compliance.lex.tex (56 lines)
- app/src/Design.lex.tex (731 lines)
- app/src/Features.lex.tex (165 lines)
- app/src/Quality.lex.tex (375 lines)
- app/src/Security.lex.tex (635 lines)
- app/src/FoundryOrgLifecycle.lex.tex (314 lines)
- app/src/FoundryOrgLifecycleProofs.lex.tex (244 lines)
- app/lexlean.toml (43 lines)
- app/prompt.json (458 lines)
- model/ids.toml (71 lines)
- features/suites/foundry\_org\_lifecycle.feature (50 lines)
- crates/conformance/tests/foundry\_org\_lifecycle.rs (142 lines)
- site/app.json (125 lines)
- openspec/specs/foundry-org-lifecycle/spec.md (220 lines)
