Examples: Organization lifecycle
Overview
Example appsDecision tables
Rule 30 cellStrike dieWise deferralCurrent supportHeader workPlant attunementCapability routePublish gateProposal admissionCompression admissionQuorum commitAddress admissionDataflow policyDraft admissionCoded matmul admissionUTQC row honestyCalculator protocolRequantization clampJCS NFC admissionTwo-seed barDocs sync// example · State machines
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. 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.
The data in this figure
| 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 |
- Fingerprint
d1f84f85782bf516d73ea0f6b2303df96d3a92afcd534f64e0632b113eb76190- Acceptance vectors
- 50
- Claims
- 8
Verified by prismpm verify in the pinned SDK when this site was built.
The prompt
This is the whole input. Raw JSON · Open it in the builder · Download the app (.zip)
The prompt 457 lines
{
"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": {}
}What the app claims
Each claim is a row in model/ids.toml, a scenario and a test, and a theorem the Lean kernel checks. The claims are quoted as the model states them.
FO-01The app never answers activated when state is provisional and administrators is below 2FO-02The app never answers activated when state is provisional and coverage is partialFO-03The app never answers retired when scope is other and state is activatedFO-04The app never answers retired when state is suspendedFO-05The app always answers retired when state is retiredFO-06The architecture description declares every stakeholder, concern, component, edge, viewpoint and view it referencesFO-07The ISO/IEC 25010 quality model numbers every characteristic, subcharacteristic, requirement and measure, and every parent it names is declaredFO-08Every 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 |
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.
Behavior 8 rows
| 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.
Properties Lean proves 5 rows
| 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.
Features and journeys 14 rows
| 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.
Security and threat model 14 rows
| 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.
Quality 8 rows
| 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 language packages and Foundation modules every app shares are in the download.
app/src/Architecture.lex.tex 406 lines
\begin{lexlean}{Architecture}
\useglossary{lexlean.std.bool@1.2.0}
\useglossary{lexlean.std.nat@1.2.0}
\useglossary{prism.arch@1.0.0}
\importmodule{Foundation.Arch}
\title{architectural component}
\begin{semanticmodule}
definition{
name: standardIso25010,
parameters: [],
result: Foundation.Arch::StandardReference,
body: (record Foundation.Arch::StandardReference {standardIndex := 0, editionIndex := 0, standardId := "ISO-25010-2023", edition := "2023"})
}
definition{
name: standardIso27005,
parameters: [],
result: Foundation.Arch::StandardReference,
body: (record Foundation.Arch::StandardReference {standardIndex := 1, editionIndex := 0, standardId := "ISO-27005-2022", edition := "2022"})
}
definition{
name: standardIso27034,
parameters: [],
result: Foundation.Arch::StandardReference,
body: (record Foundation.Arch::StandardReference {standardIndex := 2, editionIndex := 0, standardId := "ISO-27034-1-2011", edition := "2011"})
}
definition{
name: standardIso42010,
parameters: [],
result: Foundation.Arch::StandardReference,
body: (record Foundation.Arch::StandardReference {standardIndex := 4, editionIndex := 0, standardId := "ISO-42010-2022", edition := "2022"})
}
definition{
name: stakeholderOrganizationAdministrator,
parameters: [],
result: Foundation.Arch::Stakeholder,
body: (record Foundation.Arch::Stakeholder {index := 0, name := "Organization administrator", text := "Approves suspension, reactivation and retirement and needs no single user or other organization to move the organization alone."})
}
definition{
name: stakeholderOrganizationFounder,
parameters: [],
result: Foundation.Arch::Stakeholder,
body: (record Foundation.Arch::Stakeholder {index := 1, name := "Organization founder", text := "Enrolls, creates an organization with any display name and needs it to activate once a second administrator covers every part."})
}
definition{
name: stakeholderVerifier,
parameters: [],
result: Foundation.Arch::Stakeholder,
body: (record Foundation.Arch::Stakeholder {index := 2, name := "Verifier", text := "Anyone who loads the holo, checks its fingerprint and replays its acceptance vectors before trusting an answer."})
}
definition{
name: concernCorrectAnswers,
parameters: [],
result: Foundation.Arch::Concern,
body: (record Foundation.Arch::Concern {index := 0, name := "Correct answers", text := "Every well-formed request is answered by the first rule that matches it, or provisional when none does, as the spec states."})
}
definition{
name: concernIntegrityOfThePublishedApp,
parameters: [],
result: Foundation.Arch::Concern,
body: (record Foundation.Arch::Concern {index := 1, name := "Integrity of the published app", text := "What a visitor runs is the holo the build verified, with its fingerprint and signed provenance beside it."})
}
definition{
name: concernProvedGuarantees,
parameters: [],
result: Foundation.Arch::Concern,
body: (record Foundation.Arch::Concern {index := 2, name := "Proved guarantees", text := "Each of the 5 properties of the spec holds for every request, proved by the Lean kernel."})
}
definition{
name: concernRefusedMalformedRequests,
parameters: [],
result: Foundation.Arch::Concern,
body: (record Foundation.Arch::Concern {index := 3, name := "Refused malformed requests", text := "A request that is not the 5 fields in order, or is longer than 136 bytes, is answered invalid and never guessed."})
}
definition{
name: componentBrowser,
parameters: [],
result: Foundation.Arch::Component,
body: (record Foundation.Arch::Component {index := 0, kind := (ctor Foundation.Arch::ComponentKind.externalSystem), name := "Browser", text := "The visitor's web browser, which loads the page and runs the Organization lifecycle guest."})
}
definition{
name: componentFoundryAuthorityModel,
parameters: [],
result: Foundation.Arch::Component,
body: (record Foundation.Arch::Component {index := 1, kind := (ctor Foundation.Arch::ComponentKind.externalSystem), name := "Foundry authority model", text := "model/authority.toml, the scoped multi-administrator policy that counts distinct approvers."})
}
definition{
name: componentFoundryPortal,
parameters: [],
result: Foundation.Arch::Component,
body: (record Foundation.Arch::Component {index := 2, kind := (ctor Foundation.Arch::ComponentKind.staticSite), name := "Foundry portal", text := "The browser portal whose Views request lifecycle transitions."})
}
definition{
name: componentGitHubPages,
parameters: [],
result: Foundation.Arch::Component,
body: (record Foundation.Arch::Component {index := 3, kind := (ctor Foundation.Arch::ComponentKind.externalSystem), name := "GitHub Pages", text := "Serves the page and the holo from the repository Pages workflow."})
}
definition{
name: componentOrganizationLifecycleGuest,
parameters: [],
result: Foundation.Arch::Component,
body: (record Foundation.Arch::Component {index := 4, kind := (ctor Foundation.Arch::ComponentKind.service), name := "Organization lifecycle guest", text := "The Core-Wasm guest built from the model: it answers one request of at most 136 bytes with one answer of at most 64."})
}
definition{
name: componentOrganizationLifecyclePage,
parameters: [],
result: Foundation.Arch::Component,
body: (record Foundation.Arch::Component {index := 5, kind := (ctor Foundation.Arch::ComponentKind.staticSite), name := "Organization lifecycle page", text := "The page the template publishes: the holo, its fingerprint, its provenance and its acceptance vectors."})
}
definition{
name: componentPrismBuild,
parameters: [],
result: Foundation.Arch::Component,
body: (record Foundation.Arch::Component {index := 6, kind := (ctor Foundation.Arch::ComponentKind.cliAdapter), name := "Prism build", text := "prismpm verify in the SDK image prismpm.lock pins: it checks every theorem, builds the guest and replays every vector."})
}
definition{
name: componentSourceRepository,
parameters: [],
result: Foundation.Arch::Component,
body: (record Foundation.Arch::Component {index := 7, kind := (ctor Foundation.Arch::ComponentKind.externalSystem), name := "Source repository", text := "The repository that holds the prompt, the model and its gate."})
}
definition{
name: edgeBrowserToOrganizationLifecycleGuest,
parameters: [],
result: Foundation.Arch::Edge,
body: (record Foundation.Arch::Edge {index := 0, fromIndex := 0, toIndex := 4, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)})
}
definition{
name: edgeFoundryAuthorityModelToOrganizationLifecycleGuest,
parameters: [],
result: Foundation.Arch::Edge,
body: (record Foundation.Arch::Edge {index := 1, fromIndex := 1, toIndex := 4, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)})
}
definition{
name: edgeFoundryPortalToOrganizationLifecycleGuest,
parameters: [],
result: Foundation.Arch::Edge,
body: (record Foundation.Arch::Edge {index := 2, fromIndex := 2, toIndex := 4, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)})
}
definition{
name: edgeGitHubPagesToBrowser,
parameters: [],
result: Foundation.Arch::Edge,
body: (record Foundation.Arch::Edge {index := 3, fromIndex := 3, toIndex := 0, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)})
}
definition{
name: edgeOrganizationLifecycleGuestToBrowser,
parameters: [],
result: Foundation.Arch::Edge,
body: (record Foundation.Arch::Edge {index := 4, fromIndex := 4, toIndex := 0, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)})
}
definition{
name: edgeOrganizationLifecycleGuestToFoundryAuthorityModel,
parameters: [],
result: Foundation.Arch::Edge,
body: (record Foundation.Arch::Edge {index := 5, fromIndex := 4, toIndex := 1, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)})
}
definition{
name: edgeOrganizationLifecycleGuestToFoundryPortal,
parameters: [],
result: Foundation.Arch::Edge,
body: (record Foundation.Arch::Edge {index := 6, fromIndex := 4, toIndex := 2, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)})
}
definition{
name: edgeOrganizationLifecyclePageToGitHubPages,
parameters: [],
result: Foundation.Arch::Edge,
body: (record Foundation.Arch::Edge {index := 7, fromIndex := 5, toIndex := 3, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)})
}
definition{
name: edgePrismBuildToOrganizationLifecycleGuest,
parameters: [],
result: Foundation.Arch::Edge,
body: (record Foundation.Arch::Edge {index := 8, fromIndex := 6, toIndex := 4, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)})
}
definition{
name: edgePrismBuildToOrganizationLifecyclePage,
parameters: [],
result: Foundation.Arch::Edge,
body: (record Foundation.Arch::Edge {index := 9, fromIndex := 6, toIndex := 5, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)})
}
definition{
name: edgeSourceRepositoryToPrismBuild,
parameters: [],
result: Foundation.Arch::Edge,
body: (record Foundation.Arch::Edge {index := 10, fromIndex := 7, toIndex := 6, kind := (ctor Foundation.Arch::EdgeKind.dataFlow)})
}
definition{
name: viewpointOrganizationAdministratorProvedGuarantees,
parameters: [],
result: Foundation.Arch::Viewpoint,
body: (record Foundation.Arch::Viewpoint {index := 0, stakeholderIndex := 0, concernIndex := 2, modelKindIndex := 1})
}
definition{
name: viewpointOrganizationAdministratorRefusedMalformedRequests,
parameters: [],
result: Foundation.Arch::Viewpoint,
body: (record Foundation.Arch::Viewpoint {index := 1, stakeholderIndex := 0, concernIndex := 3, modelKindIndex := 2})
}
definition{
name: viewpointOrganizationFounderCorrectAnswers,
parameters: [],
result: Foundation.Arch::Viewpoint,
body: (record Foundation.Arch::Viewpoint {index := 2, stakeholderIndex := 1, concernIndex := 0, modelKindIndex := 1})
}
definition{
name: viewpointOrganizationFounderProvedGuarantees,
parameters: [],
result: Foundation.Arch::Viewpoint,
body: (record Foundation.Arch::Viewpoint {index := 3, stakeholderIndex := 1, concernIndex := 2, modelKindIndex := 1})
}
definition{
name: viewpointVerifierIntegrityOfThePublishedApp,
parameters: [],
result: Foundation.Arch::Viewpoint,
body: (record Foundation.Arch::Viewpoint {index := 4, stakeholderIndex := 2, concernIndex := 1, modelKindIndex := 2})
}
definition{
name: viewpointVerifierProvedGuarantees,
parameters: [],
result: Foundation.Arch::Viewpoint,
body: (record Foundation.Arch::Viewpoint {index := 5, stakeholderIndex := 2, concernIndex := 2, modelKindIndex := 1})
}
definition{
name: viewpointVerifierRefusedMalformedRequests,
parameters: [],
result: Foundation.Arch::Viewpoint,
body: (record Foundation.Arch::Viewpoint {index := 6, stakeholderIndex := 2, concernIndex := 3, modelKindIndex := 2})
}
definition{
name: viewOrganizationAdministratorProvedGuarantees,
parameters: [],
result: Foundation.Arch::View,
body: (record Foundation.Arch::View {index := 0, viewpointIndex := 0, modelKindIndex := 1})
}
definition{
name: viewOrganizationAdministratorRefusedMalformedRequests,
parameters: [],
result: Foundation.Arch::View,
body: (record Foundation.Arch::View {index := 1, viewpointIndex := 1, modelKindIndex := 2})
}
definition{
name: viewOrganizationFounderCorrectAnswers,
parameters: [],
result: Foundation.Arch::View,
body: (record Foundation.Arch::View {index := 2, viewpointIndex := 2, modelKindIndex := 1})
}
definition{
name: viewOrganizationFounderProvedGuarantees,
parameters: [],
result: Foundation.Arch::View,
body: (record Foundation.Arch::View {index := 3, viewpointIndex := 3, modelKindIndex := 1})
}
definition{
name: viewVerifierIntegrityOfThePublishedApp,
parameters: [],
result: Foundation.Arch::View,
body: (record Foundation.Arch::View {index := 4, viewpointIndex := 4, modelKindIndex := 2})
}
definition{
name: viewVerifierProvedGuarantees,
parameters: [],
result: Foundation.Arch::View,
body: (record Foundation.Arch::View {index := 5, viewpointIndex := 5, modelKindIndex := 1})
}
definition{
name: viewVerifierRefusedMalformedRequests,
parameters: [],
result: Foundation.Arch::View,
body: (record Foundation.Arch::View {index := 6, viewpointIndex := 6, modelKindIndex := 2})
}
definition{
name: componentRecords,
parameters: [],
result: (List Foundation.Arch::Component),
body: (cons (componentBrowser) (cons (componentFoundryAuthorityModel) (cons (componentFoundryPortal) (cons (componentGitHubPages) (cons (componentOrganizationLifecycleGuest) (cons (componentOrganizationLifecyclePage) (cons (componentPrismBuild) (cons (componentSourceRepository) (nil Foundation.Arch::Component)))))))))
}
definition{
name: edgeRecords,
parameters: [],
result: (List Foundation.Arch::Edge),
body: (cons (edgeBrowserToOrganizationLifecycleGuest) (cons (edgeFoundryAuthorityModelToOrganizationLifecycleGuest) (cons (edgeFoundryPortalToOrganizationLifecycleGuest) (cons (edgeGitHubPagesToBrowser) (cons (edgeOrganizationLifecycleGuestToBrowser) (cons (edgeOrganizationLifecycleGuestToFoundryAuthorityModel) (cons (edgeOrganizationLifecycleGuestToFoundryPortal) (cons (edgeOrganizationLifecyclePageToGitHubPages) (cons (edgePrismBuildToOrganizationLifecycleGuest) (cons (edgePrismBuildToOrganizationLifecyclePage) (cons (edgeSourceRepositoryToPrismBuild) (nil Foundation.Arch::Edge))))))))))))
}
definition{
name: viewpointRecords,
parameters: [],
result: (List Foundation.Arch::Viewpoint),
body: (cons (viewpointOrganizationAdministratorProvedGuarantees) (cons (viewpointOrganizationAdministratorRefusedMalformedRequests) (cons (viewpointOrganizationFounderCorrectAnswers) (cons (viewpointOrganizationFounderProvedGuarantees) (cons (viewpointVerifierIntegrityOfThePublishedApp) (cons (viewpointVerifierProvedGuarantees) (cons (viewpointVerifierRefusedMalformedRequests) (nil Foundation.Arch::Viewpoint))))))))
}
definition{
name: viewRecords,
parameters: [],
result: (List Foundation.Arch::View),
body: (cons (viewOrganizationAdministratorProvedGuarantees) (cons (viewOrganizationAdministratorRefusedMalformedRequests) (cons (viewOrganizationFounderCorrectAnswers) (cons (viewOrganizationFounderProvedGuarantees) (cons (viewVerifierIntegrityOfThePublishedApp) (cons (viewVerifierProvedGuarantees) (cons (viewVerifierRefusedMalformedRequests) (nil Foundation.Arch::View))))))))
}
definition{
name: edgesKnown,
parameters: [count : Nat, records : (List Foundation.Arch::Edge)],
result: Bool,
body: (match records
| List.nil => true
| List.cons edge rest => (((project edge fromIndex) <? count) && (((project edge toIndex) <? count) && (edgesKnown count rest)))),
recursive_argument: records
}
definition{
name: viewpointsKnown,
parameters: [
stakeholderCount : Nat,
concernCount : Nat,
records : (List Foundation.Arch::Viewpoint)
],
result: Bool,
body: (match records
| List.nil => true
| List.cons viewpoint rest => (((project viewpoint stakeholderIndex) <? stakeholderCount) && (((project viewpoint concernIndex) <? concernCount) && (((project viewpoint modelKindIndex) <? 3) && (viewpointsKnown stakeholderCount concernCount rest))))),
recursive_argument: records
}
definition{
name: viewMatches,
parameters: [view : Foundation.Arch::View, viewpoints : (List Foundation.Arch::Viewpoint)],
result: Bool,
body: (match viewpoints
| List.nil => false
| List.cons viewpoint rest => ((((project viewpoint index) =? (project view viewpointIndex)) && ((project viewpoint modelKindIndex) =? (project view modelKindIndex))) || (viewMatches view rest))),
recursive_argument: viewpoints
}
definition{
name: viewsConform,
parameters: [
viewpoints : (List Foundation.Arch::Viewpoint),
records : (List Foundation.Arch::View)
],
result: Bool,
body: (match records
| List.nil => true
| List.cons view rest => ((viewMatches view viewpoints) && (viewsConform viewpoints rest))),
recursive_argument: records
}
definition{
name: architectureValid,
parameters: [],
result: Bool,
body: ((edgesKnown 8 (edgeRecords)) && ((viewpointsKnown 3 4 (viewpointRecords)) && (viewsConform (viewpointRecords) (viewRecords))))
}
theorem{
name: architectureDescriptionHolds,
parameters: [],
statement: ((architectureValid) = true),
proof: decide{}
}
\end{semanticmodule}
\end{lexlean}
app/src/Compliance.lex.tex 56 lines
\begin{lexlean}{Compliance}
\useglossary{lexlean.std.bool@1.2.0}
\useglossary{lexlean.std.nat@1.2.0}
\useglossary{prism.arch@1.0.0}
\importmodule{Architecture}
\importmodule{Design}
\importmodule{Quality}
\importmodule{Security}
\importmodule{FoundryOrgLifecycle}
\title{standards reference}
\begin{semanticmodule}
structure{
name: Obligation,
type_parameters: [],
parameters: [],
fields: [
{name: index, type: Nat},
{name: standard, type: String},
{name: subject, type: String},
{name: text, type: String},
{name: evidence, type: (List String)}
]
}
definition{
name: obligations,
parameters: [],
result: (List Obligation),
body: (cons (record Obligation {index := 0, standard := "ISO/IEC/IEEE 42010:2022", subject := "Architecture description", text := "Stakeholders, concerns, viewpoints and views are declared and their references resolve.", evidence := (cons "Architecture::architectureDescriptionHolds" (nil String))}) (cons (record Obligation {index := 1, standard := "ISO/PAS 19450:2015 and OMG UML 2.5.1", subject := "Design views", text := "Every design view is checked by the SDK against the system model before it is rendered.", evidence := (cons "Design::viewOpmDecide" (cons "Design::viewUmlComponents" (cons "Design::viewUmlRequest" (cons "Design::viewUmlStates" (cons "Design::viewUmlMachine" (nil String))))))}) (cons (record Obligation {index := 2, standard := "ISO/IEC 25010:2023", subject := "Product quality", text := "Characteristics, subcharacteristics, requirements and measures are numbered and their parents resolve.", evidence := (cons "Quality::qualityModelHolds" (nil String))}) (cons (record Obligation {index := 3, standard := "ISO/IEC 27034-1:2011 and ISO/IEC 27005:2022", subject := "Application security and risk", text := "Every threat has a STRIDE category and a mapped control with evidence, or an accepted risk with its rationale.", evidence := (cons "Security::controlSet" (nil String))}) (cons (record Obligation {index := 4, standard := "OMG UML 2.5.1 behavioral state machine", subject := "State machine", text := "The answer to a state and an event is the next state, one of provisional, activated, suspended, retired; every run starts in provisional. The final state retired is never left.", evidence := (cons "FoundryOrgLifecycle::judge" (cons "FoundryOrgLifecycleProofs::inv005Holds" (nil String)))}) (cons (record Obligation {index := 5, standard := "OpenSpec", subject := "Requirements", text := "Every rule and property of the spec is a requirement with a scenario in openspec/specs.", evidence := (cons "FoundryOrgLifecycle::application" (nil String))}) (cons (record Obligation {index := 6, standard := "SPDX MIT OR Apache-2.0", subject := "Licensing", text := "The application and its model are offered under MIT OR Apache-2.0.", evidence := (cons "FoundryOrgLifecycle::application" (nil String))}) (nil Obligation))))))))
}
definition{
name: obligationsEvidenced,
parameters: [position : Nat, items : (List Obligation)],
result: Bool,
body: (match items
| List.nil => true
| List.cons item rest => (((project item index) =? position) && (match{
branches: [
{body: false, binders: [], constructor: List.nil},
{body: true, binders: [first, others], constructor: List.cons}
],
scrutinee: (project item evidence)
} && (obligationsEvidenced (position + 1) rest)))),
recursive_argument: items
}
theorem{
name: everyObligationEvidenced,
parameters: [],
statement: ((obligationsEvidenced 0 (obligations)) = true),
proof: decide{}
}
\end{semanticmodule}
\end{lexlean}
app/src/Design.lex.tex 731 lines
\begin{lexlean}{Design}
\useglossary{lexlean.std.bool@1.2.0}
\useglossary{lexlean.std.nat@1.2.0}
\useglossary{prism.arch@1.0.0}
\importmodule{Architecture}
\importmodule{Foundation.Arch}
\title{design view}
\begin{semanticmodule}
definition{
name: processSendRequest,
parameters: [],
result: Foundation.Arch::SystemProcess,
body: (record Foundation.Arch::SystemProcess {owner := "Architecture::componentBrowser"})
}
definition{
name: processDecide,
parameters: [],
result: Foundation.Arch::SystemProcess,
body: (record Foundation.Arch::SystemProcess {owner := "Architecture::componentOrganizationLifecycleGuest"})
}
definition{
name: processParseRequest,
parameters: [],
result: Foundation.Arch::SystemProcess,
body: (record Foundation.Arch::SystemProcess {owner := "Architecture::componentOrganizationLifecycleGuest"})
}
definition{
name: processJudge,
parameters: [],
result: Foundation.Arch::SystemProcess,
body: (record Foundation.Arch::SystemProcess {owner := "Architecture::componentOrganizationLifecycleGuest"})
}
definition{
name: processEncodeAnswer,
parameters: [],
result: Foundation.Arch::SystemProcess,
body: (record Foundation.Arch::SystemProcess {owner := "Architecture::componentOrganizationLifecycleGuest"})
}
definition{
name: processBuildAndVerify,
parameters: [],
result: Foundation.Arch::SystemProcess,
body: (record Foundation.Arch::SystemProcess {owner := "Architecture::componentPrismBuild"})
}
definition{
name: processRule1,
parameters: [],
result: Foundation.Arch::SystemProcess,
body: (record Foundation.Arch::SystemProcess {owner := "Architecture::componentOrganizationLifecycleGuest"})
}
definition{
name: processRule2,
parameters: [],
result: Foundation.Arch::SystemProcess,
body: (record Foundation.Arch::SystemProcess {owner := "Architecture::componentOrganizationLifecycleGuest"})
}
definition{
name: processRule3,
parameters: [],
result: Foundation.Arch::SystemProcess,
body: (record Foundation.Arch::SystemProcess {owner := "Architecture::componentOrganizationLifecycleGuest"})
}
definition{
name: processRule4,
parameters: [],
result: Foundation.Arch::SystemProcess,
body: (record Foundation.Arch::SystemProcess {owner := "Architecture::componentOrganizationLifecycleGuest"})
}
definition{
name: processRule5,
parameters: [],
result: Foundation.Arch::SystemProcess,
body: (record Foundation.Arch::SystemProcess {owner := "Architecture::componentOrganizationLifecycleGuest"})
}
definition{
name: processRule6,
parameters: [],
result: Foundation.Arch::SystemProcess,
body: (record Foundation.Arch::SystemProcess {owner := "Architecture::componentOrganizationLifecycleGuest"})
}
definition{
name: processRule7,
parameters: [],
result: Foundation.Arch::SystemProcess,
body: (record Foundation.Arch::SystemProcess {owner := "Architecture::componentOrganizationLifecycleGuest"})
}
definition{
name: processOtherwise,
parameters: [],
result: Foundation.Arch::SystemProcess,
body: (record Foundation.Arch::SystemProcess {owner := "Architecture::componentOrganizationLifecycleGuest"})
}
definition{
name: stateIdle,
parameters: [],
result: Foundation.Arch::SystemState,
body: (record Foundation.Arch::SystemState {owner := "Architecture::componentOrganizationLifecycleGuest"})
}
definition{
name: stateDeciding,
parameters: [],
result: Foundation.Arch::SystemState,
body: (record Foundation.Arch::SystemState {owner := "Architecture::componentOrganizationLifecycleGuest"})
}
definition{
name: stateRefused,
parameters: [],
result: Foundation.Arch::SystemState,
body: (record Foundation.Arch::SystemState {owner := "Architecture::componentOrganizationLifecycleGuest"})
}
definition{
name: stateAnsweredProvisional,
parameters: [],
result: Foundation.Arch::SystemState,
body: (record Foundation.Arch::SystemState {owner := "Architecture::componentOrganizationLifecycleGuest"})
}
definition{
name: stateAnsweredActivated,
parameters: [],
result: Foundation.Arch::SystemState,
body: (record Foundation.Arch::SystemState {owner := "Architecture::componentOrganizationLifecycleGuest"})
}
definition{
name: stateAnsweredSuspended,
parameters: [],
result: Foundation.Arch::SystemState,
body: (record Foundation.Arch::SystemState {owner := "Architecture::componentOrganizationLifecycleGuest"})
}
definition{
name: stateAnsweredRetired,
parameters: [],
result: Foundation.Arch::SystemState,
body: (record Foundation.Arch::SystemState {owner := "Architecture::componentOrganizationLifecycleGuest"})
}
definition{
name: stateMachineProvisional,
parameters: [],
result: Foundation.Arch::SystemState,
body: (record Foundation.Arch::SystemState {owner := "Architecture::componentOrganizationLifecycleGuest"})
}
definition{
name: stateMachineActivated,
parameters: [],
result: Foundation.Arch::SystemState,
body: (record Foundation.Arch::SystemState {owner := "Architecture::componentOrganizationLifecycleGuest"})
}
definition{
name: stateMachineSuspended,
parameters: [],
result: Foundation.Arch::SystemState,
body: (record Foundation.Arch::SystemState {owner := "Architecture::componentOrganizationLifecycleGuest"})
}
definition{
name: stateMachineRetired,
parameters: [],
result: Foundation.Arch::SystemState,
body: (record Foundation.Arch::SystemState {owner := "Architecture::componentOrganizationLifecycleGuest"})
}
definition{
name: viewOpmDecide,
parameters: [],
result: Foundation.Arch::DesignView,
body: (record Foundation.Arch::DesignView {title := "Deciding a Organization lifecycle request", viewpoint := "Architecture::viewpointOrganizationFounderCorrectAnswers", diagram := (ctor Foundation.Arch::DesignDiagram.opmObjectProcess)})
}
definition{
name: viewUmlComponents,
parameters: [],
result: Foundation.Arch::DesignView,
body: (record Foundation.Arch::DesignView {title := "Components of Organization lifecycle", viewpoint := "Architecture::viewpointVerifierIntegrityOfThePublishedApp", diagram := (ctor Foundation.Arch::DesignDiagram.umlComponent)})
}
definition{
name: viewUmlRequest,
parameters: [],
result: Foundation.Arch::DesignView,
body: (record Foundation.Arch::DesignView {title := "Answering a Organization lifecycle request", viewpoint := "Architecture::viewpointOrganizationFounderCorrectAnswers", diagram := (ctor Foundation.Arch::DesignDiagram.umlSequence)})
}
definition{
name: viewUmlStates,
parameters: [],
result: Foundation.Arch::DesignView,
body: (record Foundation.Arch::DesignView {title := "States of the Organization lifecycle guest", viewpoint := "Architecture::viewpointOrganizationAdministratorRefusedMalformedRequests", diagram := (ctor Foundation.Arch::DesignDiagram.umlStateMachine)})
}
definition{
name: viewUmlMachine,
parameters: [],
result: Foundation.Arch::DesignView,
body: (record Foundation.Arch::DesignView {title := "The Organization lifecycle state machine", viewpoint := "Architecture::viewpointOrganizationFounderCorrectAnswers", diagram := (ctor Foundation.Arch::DesignDiagram.umlStateMachine)})
}
definition{
name: opmBrowser,
parameters: [],
result: Foundation.Arch::OpmThing,
body: (record Foundation.Arch::OpmThing {view := "Design::viewOpmDecide", kind := (ctor Foundation.Arch::OpmThingKind.object), subject := "Architecture::componentBrowser"})
}
definition{
name: opmGuest,
parameters: [],
result: Foundation.Arch::OpmThing,
body: (record Foundation.Arch::OpmThing {view := "Design::viewOpmDecide", kind := (ctor Foundation.Arch::OpmThingKind.object), subject := "Architecture::componentOrganizationLifecycleGuest"})
}
definition{
name: opmDecide,
parameters: [],
result: Foundation.Arch::OpmThing,
body: (record Foundation.Arch::OpmThing {view := "Design::viewOpmDecide", kind := (ctor Foundation.Arch::OpmThingKind.process), subject := "Design::processDecide"})
}
definition{
name: opmParseRequest,
parameters: [],
result: Foundation.Arch::OpmThing,
body: (record Foundation.Arch::OpmThing {view := "Design::viewOpmDecide", kind := (ctor Foundation.Arch::OpmThingKind.process), subject := "Design::processParseRequest"})
}
definition{
name: opmJudge,
parameters: [],
result: Foundation.Arch::OpmThing,
body: (record Foundation.Arch::OpmThing {view := "Design::viewOpmDecide", kind := (ctor Foundation.Arch::OpmThingKind.process), subject := "Design::processJudge"})
}
definition{
name: opmEncodeAnswer,
parameters: [],
result: Foundation.Arch::OpmThing,
body: (record Foundation.Arch::OpmThing {view := "Design::viewOpmDecide", kind := (ctor Foundation.Arch::OpmThingKind.process), subject := "Design::processEncodeAnswer"})
}
definition{
name: opmGuestIdle,
parameters: [],
result: Foundation.Arch::OpmState,
body: (record Foundation.Arch::OpmState {view := "Design::viewOpmDecide", thing := "Architecture::componentOrganizationLifecycleGuest", state := "Design::stateIdle"})
}
definition{
name: opmGuestDeciding,
parameters: [],
result: Foundation.Arch::OpmState,
body: (record Foundation.Arch::OpmState {view := "Design::viewOpmDecide", thing := "Architecture::componentOrganizationLifecycleGuest", state := "Design::stateDeciding"})
}
definition{
name: opmGuestAgent,
parameters: [],
result: Foundation.Arch::OpmLink,
body: (record Foundation.Arch::OpmLink {view := "Design::viewOpmDecide", kind := (ctor Foundation.Arch::OpmLinkKind.agent), source := "Architecture::componentOrganizationLifecycleGuest", target := "Design::processDecide"})
}
definition{
name: opmBrowserInstrument,
parameters: [],
result: Foundation.Arch::OpmLink,
body: (record Foundation.Arch::OpmLink {view := "Design::viewOpmDecide", kind := (ctor Foundation.Arch::OpmLinkKind.instrument), source := "Architecture::componentBrowser", target := "Design::processParseRequest"})
}
definition{
name: opmParseInvokesJudge,
parameters: [],
result: Foundation.Arch::OpmLink,
body: (record Foundation.Arch::OpmLink {view := "Design::viewOpmDecide", kind := (ctor Foundation.Arch::OpmLinkKind.invocation), source := "Design::processParseRequest", target := "Design::processJudge"})
}
definition{
name: opmJudgeInvokesEncode,
parameters: [],
result: Foundation.Arch::OpmLink,
body: (record Foundation.Arch::OpmLink {view := "Design::viewOpmDecide", kind := (ctor Foundation.Arch::OpmLinkKind.invocation), source := "Design::processJudge", target := "Design::processEncodeAnswer"})
}
definition{
name: opmEncodeAffectsBrowser,
parameters: [],
result: Foundation.Arch::OpmLink,
body: (record Foundation.Arch::OpmLink {view := "Design::viewOpmDecide", kind := (ctor Foundation.Arch::OpmLinkKind.effect), source := "Architecture::componentBrowser", target := "Design::processEncodeAnswer"})
}
definition{
name: opmZoomParseRequest,
parameters: [],
result: Foundation.Arch::OpmZoom,
body: (record Foundation.Arch::OpmZoom {view := "Design::viewOpmDecide", process := "Design::processDecide", subprocess := "Design::processParseRequest", order := 0})
}
definition{
name: opmZoomJudge,
parameters: [],
result: Foundation.Arch::OpmZoom,
body: (record Foundation.Arch::OpmZoom {view := "Design::viewOpmDecide", process := "Design::processDecide", subprocess := "Design::processJudge", order := 1})
}
definition{
name: opmZoomEncodeAnswer,
parameters: [],
result: Foundation.Arch::OpmZoom,
body: (record Foundation.Arch::OpmZoom {view := "Design::viewOpmDecide", process := "Design::processDecide", subprocess := "Design::processEncodeAnswer", order := 2})
}
definition{
name: umlBrowser,
parameters: [],
result: Foundation.Arch::UmlComponent,
body: (record Foundation.Arch::UmlComponent {view := "Design::viewUmlComponents", component := "Architecture::componentBrowser"})
}
definition{
name: umlFoundryAuthorityModel,
parameters: [],
result: Foundation.Arch::UmlComponent,
body: (record Foundation.Arch::UmlComponent {view := "Design::viewUmlComponents", component := "Architecture::componentFoundryAuthorityModel"})
}
definition{
name: umlFoundryPortal,
parameters: [],
result: Foundation.Arch::UmlComponent,
body: (record Foundation.Arch::UmlComponent {view := "Design::viewUmlComponents", component := "Architecture::componentFoundryPortal"})
}
definition{
name: umlGitHubPages,
parameters: [],
result: Foundation.Arch::UmlComponent,
body: (record Foundation.Arch::UmlComponent {view := "Design::viewUmlComponents", component := "Architecture::componentGitHubPages"})
}
definition{
name: umlOrganizationLifecycleGuest,
parameters: [],
result: Foundation.Arch::UmlComponent,
body: (record Foundation.Arch::UmlComponent {view := "Design::viewUmlComponents", component := "Architecture::componentOrganizationLifecycleGuest"})
}
definition{
name: umlOrganizationLifecyclePage,
parameters: [],
result: Foundation.Arch::UmlComponent,
body: (record Foundation.Arch::UmlComponent {view := "Design::viewUmlComponents", component := "Architecture::componentOrganizationLifecyclePage"})
}
definition{
name: umlPrismBuild,
parameters: [],
result: Foundation.Arch::UmlComponent,
body: (record Foundation.Arch::UmlComponent {view := "Design::viewUmlComponents", component := "Architecture::componentPrismBuild"})
}
definition{
name: umlSourceRepository,
parameters: [],
result: Foundation.Arch::UmlComponent,
body: (record Foundation.Arch::UmlComponent {view := "Design::viewUmlComponents", component := "Architecture::componentSourceRepository"})
}
definition{
name: umlBrowserToOrganizationLifecycleGuest,
parameters: [],
result: Foundation.Arch::UmlConnector,
body: (record Foundation.Arch::UmlConnector {view := "Design::viewUmlComponents", edge := "Architecture::edgeBrowserToOrganizationLifecycleGuest"})
}
definition{
name: umlFoundryAuthorityModelToOrganizationLifecycleGuest,
parameters: [],
result: Foundation.Arch::UmlConnector,
body: (record Foundation.Arch::UmlConnector {view := "Design::viewUmlComponents", edge := "Architecture::edgeFoundryAuthorityModelToOrganizationLifecycleGuest"})
}
definition{
name: umlFoundryPortalToOrganizationLifecycleGuest,
parameters: [],
result: Foundation.Arch::UmlConnector,
body: (record Foundation.Arch::UmlConnector {view := "Design::viewUmlComponents", edge := "Architecture::edgeFoundryPortalToOrganizationLifecycleGuest"})
}
definition{
name: umlGitHubPagesToBrowser,
parameters: [],
result: Foundation.Arch::UmlConnector,
body: (record Foundation.Arch::UmlConnector {view := "Design::viewUmlComponents", edge := "Architecture::edgeGitHubPagesToBrowser"})
}
definition{
name: umlOrganizationLifecycleGuestToBrowser,
parameters: [],
result: Foundation.Arch::UmlConnector,
body: (record Foundation.Arch::UmlConnector {view := "Design::viewUmlComponents", edge := "Architecture::edgeOrganizationLifecycleGuestToBrowser"})
}
definition{
name: umlOrganizationLifecycleGuestToFoundryAuthorityModel,
parameters: [],
result: Foundation.Arch::UmlConnector,
body: (record Foundation.Arch::UmlConnector {view := "Design::viewUmlComponents", edge := "Architecture::edgeOrganizationLifecycleGuestToFoundryAuthorityModel"})
}
definition{
name: umlOrganizationLifecycleGuestToFoundryPortal,
parameters: [],
result: Foundation.Arch::UmlConnector,
body: (record Foundation.Arch::UmlConnector {view := "Design::viewUmlComponents", edge := "Architecture::edgeOrganizationLifecycleGuestToFoundryPortal"})
}
definition{
name: umlOrganizationLifecyclePageToGitHubPages,
parameters: [],
result: Foundation.Arch::UmlConnector,
body: (record Foundation.Arch::UmlConnector {view := "Design::viewUmlComponents", edge := "Architecture::edgeOrganizationLifecyclePageToGitHubPages"})
}
definition{
name: umlPrismBuildToOrganizationLifecycleGuest,
parameters: [],
result: Foundation.Arch::UmlConnector,
body: (record Foundation.Arch::UmlConnector {view := "Design::viewUmlComponents", edge := "Architecture::edgePrismBuildToOrganizationLifecycleGuest"})
}
definition{
name: umlPrismBuildToOrganizationLifecyclePage,
parameters: [],
result: Foundation.Arch::UmlConnector,
body: (record Foundation.Arch::UmlConnector {view := "Design::viewUmlComponents", edge := "Architecture::edgePrismBuildToOrganizationLifecyclePage"})
}
definition{
name: umlSourceRepositoryToPrismBuild,
parameters: [],
result: Foundation.Arch::UmlConnector,
body: (record Foundation.Arch::UmlConnector {view := "Design::viewUmlComponents", edge := "Architecture::edgeSourceRepositoryToPrismBuild"})
}
definition{
name: seqBrowser,
parameters: [],
result: Foundation.Arch::UmlLifeline,
body: (record Foundation.Arch::UmlLifeline {view := "Design::viewUmlRequest", component := "Architecture::componentBrowser", order := 0})
}
definition{
name: seqOrganizationLifecycleGuest,
parameters: [],
result: Foundation.Arch::UmlLifeline,
body: (record Foundation.Arch::UmlLifeline {view := "Design::viewUmlRequest", component := "Architecture::componentOrganizationLifecycleGuest", order := 1})
}
definition{
name: seqRequest,
parameters: [],
result: Foundation.Arch::UmlMessage,
body: (record Foundation.Arch::UmlMessage {view := "Design::viewUmlRequest", kind := (ctor Foundation.Arch::UmlMessageKind.synchronous), order := 0, source := "Architecture::componentBrowser", target := "Architecture::componentOrganizationLifecycleGuest", process := "Design::processDecide"})
}
definition{
name: seqReply,
parameters: [],
result: Foundation.Arch::UmlMessage,
body: (record Foundation.Arch::UmlMessage {view := "Design::viewUmlRequest", kind := (ctor Foundation.Arch::UmlMessageKind.reply), order := 1, source := "Architecture::componentOrganizationLifecycleGuest", target := "Architecture::componentBrowser", process := "Design::processDecide"})
}
definition{
name: stIdle,
parameters: [],
result: Foundation.Arch::UmlState,
body: (record Foundation.Arch::UmlState {view := "Design::viewUmlStates", state := "Design::stateIdle", initial := true})
}
definition{
name: stDeciding,
parameters: [],
result: Foundation.Arch::UmlState,
body: (record Foundation.Arch::UmlState {view := "Design::viewUmlStates", state := "Design::stateDeciding", initial := false})
}
definition{
name: stRefused,
parameters: [],
result: Foundation.Arch::UmlState,
body: (record Foundation.Arch::UmlState {view := "Design::viewUmlStates", state := "Design::stateRefused", initial := false})
}
definition{
name: stAnsweredProvisional,
parameters: [],
result: Foundation.Arch::UmlState,
body: (record Foundation.Arch::UmlState {view := "Design::viewUmlStates", state := "Design::stateAnsweredProvisional", initial := false})
}
definition{
name: stAnsweredActivated,
parameters: [],
result: Foundation.Arch::UmlState,
body: (record Foundation.Arch::UmlState {view := "Design::viewUmlStates", state := "Design::stateAnsweredActivated", initial := false})
}
definition{
name: stAnsweredSuspended,
parameters: [],
result: Foundation.Arch::UmlState,
body: (record Foundation.Arch::UmlState {view := "Design::viewUmlStates", state := "Design::stateAnsweredSuspended", initial := false})
}
definition{
name: stAnsweredRetired,
parameters: [],
result: Foundation.Arch::UmlState,
body: (record Foundation.Arch::UmlState {view := "Design::viewUmlStates", state := "Design::stateAnsweredRetired", initial := false})
}
definition{
name: stMachineProvisional,
parameters: [],
result: Foundation.Arch::UmlState,
body: (record Foundation.Arch::UmlState {view := "Design::viewUmlMachine", state := "Design::stateMachineProvisional", initial := true})
}
definition{
name: stMachineActivated,
parameters: [],
result: Foundation.Arch::UmlState,
body: (record Foundation.Arch::UmlState {view := "Design::viewUmlMachine", state := "Design::stateMachineActivated", initial := false})
}
definition{
name: stMachineSuspended,
parameters: [],
result: Foundation.Arch::UmlState,
body: (record Foundation.Arch::UmlState {view := "Design::viewUmlMachine", state := "Design::stateMachineSuspended", initial := false})
}
definition{
name: stMachineRetired,
parameters: [],
result: Foundation.Arch::UmlState,
body: (record Foundation.Arch::UmlState {view := "Design::viewUmlMachine", state := "Design::stateMachineRetired", initial := false})
}
definition{
name: trAccept,
parameters: [],
result: Foundation.Arch::UmlTransition,
body: (record Foundation.Arch::UmlTransition {view := "Design::viewUmlStates", order := 0, source := "Design::stateIdle", target := "Design::stateDeciding", trigger := "Design::processParseRequest"})
}
definition{
name: trRefuse,
parameters: [],
result: Foundation.Arch::UmlTransition,
body: (record Foundation.Arch::UmlTransition {view := "Design::viewUmlStates", order := 1, source := "Design::stateIdle", target := "Design::stateRefused", trigger := "Design::processParseRequest"})
}
definition{
name: trRule1,
parameters: [],
result: Foundation.Arch::UmlTransition,
body: (record Foundation.Arch::UmlTransition {view := "Design::viewUmlStates", order := 2, source := "Design::stateDeciding", target := "Design::stateAnsweredActivated", trigger := "Design::processRule1"})
}
definition{
name: trRule2,
parameters: [],
result: Foundation.Arch::UmlTransition,
body: (record Foundation.Arch::UmlTransition {view := "Design::viewUmlStates", order := 3, source := "Design::stateDeciding", target := "Design::stateAnsweredSuspended", trigger := "Design::processRule2"})
}
definition{
name: trRule3,
parameters: [],
result: Foundation.Arch::UmlTransition,
body: (record Foundation.Arch::UmlTransition {view := "Design::viewUmlStates", order := 4, source := "Design::stateDeciding", target := "Design::stateAnsweredActivated", trigger := "Design::processRule3"})
}
definition{
name: trRule4,
parameters: [],
result: Foundation.Arch::UmlTransition,
body: (record Foundation.Arch::UmlTransition {view := "Design::viewUmlStates", order := 5, source := "Design::stateDeciding", target := "Design::stateAnsweredRetired", trigger := "Design::processRule4"})
}
definition{
name: trRule5,
parameters: [],
result: Foundation.Arch::UmlTransition,
body: (record Foundation.Arch::UmlTransition {view := "Design::viewUmlStates", order := 6, source := "Design::stateDeciding", target := "Design::stateAnsweredActivated", trigger := "Design::processRule5"})
}
definition{
name: trRule6,
parameters: [],
result: Foundation.Arch::UmlTransition,
body: (record Foundation.Arch::UmlTransition {view := "Design::viewUmlStates", order := 7, source := "Design::stateDeciding", target := "Design::stateAnsweredSuspended", trigger := "Design::processRule6"})
}
definition{
name: trRule7,
parameters: [],
result: Foundation.Arch::UmlTransition,
body: (record Foundation.Arch::UmlTransition {view := "Design::viewUmlStates", order := 8, source := "Design::stateDeciding", target := "Design::stateAnsweredRetired", trigger := "Design::processRule7"})
}
definition{
name: trOtherwise,
parameters: [],
result: Foundation.Arch::UmlTransition,
body: (record Foundation.Arch::UmlTransition {view := "Design::viewUmlStates", order := 9, source := "Design::stateDeciding", target := "Design::stateAnsweredProvisional", trigger := "Design::processOtherwise"})
}
definition{
name: trResetProvisional,
parameters: [],
result: Foundation.Arch::UmlTransition,
body: (record Foundation.Arch::UmlTransition {view := "Design::viewUmlStates", order := 10, source := "Design::stateAnsweredProvisional", target := "Design::stateIdle", trigger := "Design::processEncodeAnswer"})
}
definition{
name: trResetActivated,
parameters: [],
result: Foundation.Arch::UmlTransition,
body: (record Foundation.Arch::UmlTransition {view := "Design::viewUmlStates", order := 11, source := "Design::stateAnsweredActivated", target := "Design::stateIdle", trigger := "Design::processEncodeAnswer"})
}
definition{
name: trResetSuspended,
parameters: [],
result: Foundation.Arch::UmlTransition,
body: (record Foundation.Arch::UmlTransition {view := "Design::viewUmlStates", order := 12, source := "Design::stateAnsweredSuspended", target := "Design::stateIdle", trigger := "Design::processEncodeAnswer"})
}
definition{
name: trResetRetired,
parameters: [],
result: Foundation.Arch::UmlTransition,
body: (record Foundation.Arch::UmlTransition {view := "Design::viewUmlStates", order := 13, source := "Design::stateAnsweredRetired", target := "Design::stateIdle", trigger := "Design::processEncodeAnswer"})
}
definition{
name: trResetRefused,
parameters: [],
result: Foundation.Arch::UmlTransition,
body: (record Foundation.Arch::UmlTransition {view := "Design::viewUmlStates", order := 14, source := "Design::stateRefused", target := "Design::stateIdle", trigger := "Design::processEncodeAnswer"})
}
definition{
name: trMachineProvisionalToProvisionalByOtherwise,
parameters: [],
result: Foundation.Arch::UmlTransition,
body: (record Foundation.Arch::UmlTransition {view := "Design::viewUmlMachine", order := 0, source := "Design::stateMachineProvisional", target := "Design::stateMachineProvisional", trigger := "Design::processOtherwise"})
}
definition{
name: trMachineProvisionalToActivatedByREQ001,
parameters: [],
result: Foundation.Arch::UmlTransition,
body: (record Foundation.Arch::UmlTransition {view := "Design::viewUmlMachine", order := 1, source := "Design::stateMachineProvisional", target := "Design::stateMachineActivated", trigger := "Design::processRule1"})
}
definition{
name: trMachineActivatedToActivatedByREQ005,
parameters: [],
result: Foundation.Arch::UmlTransition,
body: (record Foundation.Arch::UmlTransition {view := "Design::viewUmlMachine", order := 2, source := "Design::stateMachineActivated", target := "Design::stateMachineActivated", trigger := "Design::processRule5"})
}
definition{
name: trMachineActivatedToSuspendedByREQ002,
parameters: [],
result: Foundation.Arch::UmlTransition,
body: (record Foundation.Arch::UmlTransition {view := "Design::viewUmlMachine", order := 3, source := "Design::stateMachineActivated", target := "Design::stateMachineSuspended", trigger := "Design::processRule2"})
}
definition{
name: trMachineActivatedToRetiredByREQ004,
parameters: [],
result: Foundation.Arch::UmlTransition,
body: (record Foundation.Arch::UmlTransition {view := "Design::viewUmlMachine", order := 4, source := "Design::stateMachineActivated", target := "Design::stateMachineRetired", trigger := "Design::processRule4"})
}
definition{
name: trMachineSuspendedToSuspendedByREQ006,
parameters: [],
result: Foundation.Arch::UmlTransition,
body: (record Foundation.Arch::UmlTransition {view := "Design::viewUmlMachine", order := 5, source := "Design::stateMachineSuspended", target := "Design::stateMachineSuspended", trigger := "Design::processRule6"})
}
definition{
name: trMachineSuspendedToActivatedByREQ003,
parameters: [],
result: Foundation.Arch::UmlTransition,
body: (record Foundation.Arch::UmlTransition {view := "Design::viewUmlMachine", order := 6, source := "Design::stateMachineSuspended", target := "Design::stateMachineActivated", trigger := "Design::processRule3"})
}
definition{
name: trMachineRetiredToRetiredByREQ007,
parameters: [],
result: Foundation.Arch::UmlTransition,
body: (record Foundation.Arch::UmlTransition {view := "Design::viewUmlMachine", order := 7, source := "Design::stateMachineRetired", target := "Design::stateMachineRetired", trigger := "Design::processRule7"})
}
\end{semanticmodule}
\end{lexlean}
app/src/Features.lex.tex 165 lines
\begin{lexlean}{Features}
\useglossary{lexlean.std.bool@1.2.0}
\useglossary{lexlean.std.nat@1.2.0}
\useglossary{prism.arch@1.0.0}
\importmodule{FoundryOrgLifecycle}
\importmodule{Architecture}
\importmodule{Foundation.Arch}
\title{feature}
\begin{semanticmodule}
definition{
name: acceptINV001,
parameters: [],
result: String,
body: "FoundryOrgLifecycleProofs::inv001Holds"
}
definition{
name: acceptINV002,
parameters: [],
result: String,
body: "FoundryOrgLifecycleProofs::inv002Holds"
}
definition{
name: acceptINV003,
parameters: [],
result: String,
body: "FoundryOrgLifecycleProofs::inv003Holds"
}
definition{
name: acceptINV004,
parameters: [],
result: String,
body: "FoundryOrgLifecycleProofs::inv004Holds"
}
definition{
name: acceptINV005,
parameters: [],
result: String,
body: "FoundryOrgLifecycleProofs::inv005Holds"
}
definition{
name: featureRule1,
parameters: [],
result: Foundation.Arch::Feature,
body: (record Foundation.Arch::Feature {statement := "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.", calls := (cons "FoundryOrgLifecycle::rule1" (cons "FoundryOrgLifecycle::judge" (nil String))), acceptance := (cons "FoundryOrgLifecycle::application" (nil String))})
}
definition{
name: featureRule2,
parameters: [],
result: Foundation.Arch::Feature,
body: (record Foundation.Arch::Feature {statement := "When state is activated and event is suspend and scope is own and administrators is at least 2, the answer is suspended.", calls := (cons "FoundryOrgLifecycle::rule2" (cons "FoundryOrgLifecycle::judge" (nil String))), acceptance := (cons "FoundryOrgLifecycle::application" (nil String))})
}
definition{
name: featureRule3,
parameters: [],
result: Foundation.Arch::Feature,
body: (record Foundation.Arch::Feature {statement := "When state is suspended and event is reactivate and scope is own and administrators is at least 2, the answer is activated.", calls := (cons "FoundryOrgLifecycle::rule3" (cons "FoundryOrgLifecycle::judge" (nil String))), acceptance := (cons "FoundryOrgLifecycle::application" (nil String))})
}
definition{
name: featureRule4,
parameters: [],
result: Foundation.Arch::Feature,
body: (record Foundation.Arch::Feature {statement := "When state is activated and event is retire and scope is own and administrators is at least 2, the answer is retired.", calls := (cons "FoundryOrgLifecycle::rule4" (cons "FoundryOrgLifecycle::judge" (nil String))), acceptance := (cons "FoundryOrgLifecycle::application" (nil String))})
}
definition{
name: featureRule5,
parameters: [],
result: Foundation.Arch::Feature,
body: (record Foundation.Arch::Feature {statement := "When state is activated, the answer is activated.", calls := (cons "FoundryOrgLifecycle::rule5" (cons "FoundryOrgLifecycle::judge" (nil String))), acceptance := (cons "FoundryOrgLifecycle::application" (nil String))})
}
definition{
name: featureRule6,
parameters: [],
result: Foundation.Arch::Feature,
body: (record Foundation.Arch::Feature {statement := "When state is suspended, the answer is suspended.", calls := (cons "FoundryOrgLifecycle::rule6" (cons "FoundryOrgLifecycle::judge" (nil String))), acceptance := (cons "FoundryOrgLifecycle::application" (nil String))})
}
definition{
name: featureRule7,
parameters: [],
result: Foundation.Arch::Feature,
body: (record Foundation.Arch::Feature {statement := "When state is retired, the answer is retired.", calls := (cons "FoundryOrgLifecycle::rule7" (cons "FoundryOrgLifecycle::judge" (nil String))), acceptance := (cons "FoundryOrgLifecycle::application" (nil String))})
}
definition{
name: featureOtherwise,
parameters: [],
result: Foundation.Arch::Feature,
body: (record Foundation.Arch::Feature {statement := "When no rule matches, the answer is provisional.", calls := (cons "FoundryOrgLifecycle::judge" (nil String)), acceptance := (cons "FoundryOrgLifecycle::application" (nil String))})
}
definition{
name: featureRefuseMalformed,
parameters: [],
result: Foundation.Arch::Feature,
body: (record Foundation.Arch::Feature {statement := "A request that is not state, event, scope, administrators, coverage in order, separated by single spaces, or is over 136 bytes, is answered invalid.", calls := (cons "FoundryOrgLifecycle::dispatch" (cons "FoundryOrgLifecycle::decodeField1" (nil String))), acceptance := (cons "FoundryOrgLifecycle::application" (nil String))})
}
definition{
name: featureINV001,
parameters: [],
result: Foundation.Arch::Feature,
body: (record Foundation.Arch::Feature {statement := "It never answers activated when state is provisional and administrators is below 2.", calls := (cons "FoundryOrgLifecycle::judge" (nil String)), acceptance := (cons "Features::acceptINV001" (nil String))})
}
definition{
name: featureINV002,
parameters: [],
result: Foundation.Arch::Feature,
body: (record Foundation.Arch::Feature {statement := "It never answers activated when state is provisional and coverage is partial.", calls := (cons "FoundryOrgLifecycle::judge" (nil String)), acceptance := (cons "Features::acceptINV002" (nil String))})
}
definition{
name: featureINV003,
parameters: [],
result: Foundation.Arch::Feature,
body: (record Foundation.Arch::Feature {statement := "It never answers retired when scope is other and state is activated.", calls := (cons "FoundryOrgLifecycle::judge" (nil String)), acceptance := (cons "Features::acceptINV003" (nil String))})
}
definition{
name: featureINV004,
parameters: [],
result: Foundation.Arch::Feature,
body: (record Foundation.Arch::Feature {statement := "It never answers retired when state is suspended.", calls := (cons "FoundryOrgLifecycle::judge" (nil String)), acceptance := (cons "Features::acceptINV004" (nil String))})
}
definition{
name: featureINV005,
parameters: [],
result: Foundation.Arch::Feature,
body: (record Foundation.Arch::Feature {statement := "It always answers retired when state is retired.", calls := (cons "FoundryOrgLifecycle::judge" (nil String)), acceptance := (cons "Features::acceptINV005" (nil String))})
}
definition{
name: journeyOrganizationAdministrator,
parameters: [],
result: Foundation.Arch::Journey,
body: (record Foundation.Arch::Journey {actor := "Architecture::stakeholderOrganizationAdministrator", steps := (cons "Features::featureRule2" (cons "Features::featureRule3" (cons "Features::featureRule4" (cons "Features::featureINV003" (cons "Features::featureINV004" (cons "Features::featureRefuseMalformed" (nil String)))))))})
}
definition{
name: journeyOrganizationFounder,
parameters: [],
result: Foundation.Arch::Journey,
body: (record Foundation.Arch::Journey {actor := "Architecture::stakeholderOrganizationFounder", steps := (cons "Features::featureOtherwise" (cons "Features::featureINV001" (cons "Features::featureRule1" (nil String))))})
}
definition{
name: journeyVerifier,
parameters: [],
result: Foundation.Arch::Journey,
body: (record Foundation.Arch::Journey {actor := "Architecture::stakeholderVerifier", steps := (cons "Features::featureRefuseMalformed" (cons "Features::featureINV001" (cons "Features::featureINV002" (cons "Features::featureINV003" (cons "Features::featureINV004" (cons "Features::featureINV005" (nil String)))))))})
}
\end{semanticmodule}
\end{lexlean}
app/src/Quality.lex.tex 375 lines
\begin{lexlean}{Quality}
\useglossary{lexlean.std.bool@1.2.0}
\useglossary{lexlean.std.nat@1.2.0}
\useglossary{prism.arch@1.0.0}
\useglossary{prism.qual@1.0.0}
\importmodule{Foundation.Qual}
\title{quality measure}
\begin{semanticmodule}
structure{
name: Named,
type_parameters: [],
parameters: [],
fields: [{name: index, type: Nat}, {name: name, type: String}, {name: text, type: String}]
}
definition{
name: characteristicFunctionalSuitability,
parameters: [],
result: Foundation.Qual::ProductQualityCharacteristic,
body: (record Foundation.Qual::ProductQualityCharacteristic {index := 0})
}
definition{
name: characteristicPerformanceEfficiency,
parameters: [],
result: Foundation.Qual::ProductQualityCharacteristic,
body: (record Foundation.Qual::ProductQualityCharacteristic {index := 1})
}
definition{
name: characteristicReliability,
parameters: [],
result: Foundation.Qual::ProductQualityCharacteristic,
body: (record Foundation.Qual::ProductQualityCharacteristic {index := 2})
}
definition{
name: characteristicSecurity,
parameters: [],
result: Foundation.Qual::ProductQualityCharacteristic,
body: (record Foundation.Qual::ProductQualityCharacteristic {index := 3})
}
definition{
name: subcharacteristicAuthenticity,
parameters: [],
result: Foundation.Qual::QualitySubcharacteristic,
body: (record Foundation.Qual::QualitySubcharacteristic {index := 0, characteristicIndex := 3})
}
definition{
name: subcharacteristicFaultlessness,
parameters: [],
result: Foundation.Qual::QualitySubcharacteristic,
body: (record Foundation.Qual::QualitySubcharacteristic {index := 1, characteristicIndex := 2})
}
definition{
name: subcharacteristicFunctionalCompleteness,
parameters: [],
result: Foundation.Qual::QualitySubcharacteristic,
body: (record Foundation.Qual::QualitySubcharacteristic {index := 2, characteristicIndex := 0})
}
definition{
name: subcharacteristicFunctionalCorrectness,
parameters: [],
result: Foundation.Qual::QualitySubcharacteristic,
body: (record Foundation.Qual::QualitySubcharacteristic {index := 3, characteristicIndex := 0})
}
definition{
name: subcharacteristicIntegrity,
parameters: [],
result: Foundation.Qual::QualitySubcharacteristic,
body: (record Foundation.Qual::QualitySubcharacteristic {index := 4, characteristicIndex := 3})
}
definition{
name: subcharacteristicResourceUtilization,
parameters: [],
result: Foundation.Qual::QualitySubcharacteristic,
body: (record Foundation.Qual::QualitySubcharacteristic {index := 5, characteristicIndex := 1})
}
definition{
name: subcharacteristicTimeBehaviour,
parameters: [],
result: Foundation.Qual::QualitySubcharacteristic,
body: (record Foundation.Qual::QualitySubcharacteristic {index := 6, characteristicIndex := 1})
}
definition{
name: requirementBoundedAllocation,
parameters: [],
result: Foundation.Qual::QualityRequirement,
body: (record Foundation.Qual::QualityRequirement {index := 0, subcharacteristicIndex := 5})
}
definition{
name: requirementBoundedRequest,
parameters: [],
result: Foundation.Qual::QualityRequirement,
body: (record Foundation.Qual::QualityRequirement {index := 1, subcharacteristicIndex := 6})
}
definition{
name: requirementEveryAllowedTransitionModeled,
parameters: [],
result: Foundation.Qual::QualityRequirement,
body: (record Foundation.Qual::QualityRequirement {index := 2, subcharacteristicIndex := 2})
}
definition{
name: requirementEveryPropertyProved,
parameters: [],
result: Foundation.Qual::QualityRequirement,
body: (record Foundation.Qual::QualityRequirement {index := 3, subcharacteristicIndex := 4})
}
definition{
name: requirementEveryRequestAnswered,
parameters: [],
result: Foundation.Qual::QualityRequirement,
body: (record Foundation.Qual::QualityRequirement {index := 4, subcharacteristicIndex := 2})
}
definition{
name: requirementEveryVectorReplays,
parameters: [],
result: Foundation.Qual::QualityRequirement,
body: (record Foundation.Qual::QualityRequirement {index := 5, subcharacteristicIndex := 1})
}
definition{
name: requirementExamplesAnsweredAsStated,
parameters: [],
result: Foundation.Qual::QualityRequirement,
body: (record Foundation.Qual::QualityRequirement {index := 6, subcharacteristicIndex := 3})
}
definition{
name: requirementTwoDistinctAdministratorsPerTransition,
parameters: [],
result: Foundation.Qual::QualityRequirement,
body: (record Foundation.Qual::QualityRequirement {index := 7, subcharacteristicIndex := 0})
}
definition{
name: measureAdministratorsPerTransition,
parameters: [],
result: Foundation.Qual::QualityMeasure,
body: (record Foundation.Qual::QualityMeasure {index := 0, requirementIndex := 7, threshold := 2})
}
definition{
name: measureExampleMismatches,
parameters: [],
result: Foundation.Qual::QualityMeasure,
body: (record Foundation.Qual::QualityMeasure {index := 1, requirementIndex := 6, threshold := 0})
}
definition{
name: measureFailedVectors,
parameters: [],
result: Foundation.Qual::QualityMeasure,
body: (record Foundation.Qual::QualityMeasure {index := 2, requirementIndex := 5, threshold := 0})
}
definition{
name: measureGuestAllocationBytes,
parameters: [],
result: Foundation.Qual::QualityMeasure,
body: (record Foundation.Qual::QualityMeasure {index := 3, requirementIndex := 0, threshold := 272})
}
definition{
name: measureRequestBytesRead,
parameters: [],
result: Foundation.Qual::QualityMeasure,
body: (record Foundation.Qual::QualityMeasure {index := 4, requirementIndex := 1, threshold := 136})
}
definition{
name: measureUnansweredRequests,
parameters: [],
result: Foundation.Qual::QualityMeasure,
body: (record Foundation.Qual::QualityMeasure {index := 5, requirementIndex := 4, threshold := 0})
}
definition{
name: measureUnmodeledTransitions,
parameters: [],
result: Foundation.Qual::QualityMeasure,
body: (record Foundation.Qual::QualityMeasure {index := 6, requirementIndex := 2, threshold := 0})
}
definition{
name: measureUnprovedProperties,
parameters: [],
result: Foundation.Qual::QualityMeasure,
body: (record Foundation.Qual::QualityMeasure {index := 7, requirementIndex := 3, threshold := 0})
}
definition{
name: characteristicNames,
parameters: [],
result: (List Named),
body: (cons (record Named {index := 0, name := "Functional suitability", text := "Functional suitability, as ISO/IEC 25010:2023 defines it, for Organization lifecycle."}) (cons (record Named {index := 1, name := "Performance efficiency", text := "Performance efficiency, as ISO/IEC 25010:2023 defines it, for Organization lifecycle."}) (cons (record Named {index := 2, name := "Reliability", text := "Reliability, as ISO/IEC 25010:2023 defines it, for Organization lifecycle."}) (cons (record Named {index := 3, name := "Security", text := "Security, as ISO/IEC 25010:2023 defines it, for Organization lifecycle."}) (nil Named)))))
}
definition{
name: subcharacteristicNames,
parameters: [],
result: (List Named),
body: (cons (record Named {index := 0, name := "Authenticity", text := "Security: Authenticity."}) (cons (record Named {index := 1, name := "Faultlessness", text := "Reliability: Faultlessness."}) (cons (record Named {index := 2, name := "Functional completeness", text := "Functional suitability: Functional completeness."}) (cons (record Named {index := 3, name := "Functional correctness", text := "Functional suitability: Functional correctness."}) (cons (record Named {index := 4, name := "Integrity", text := "Security: Integrity."}) (cons (record Named {index := 5, name := "Resource utilization", text := "Performance efficiency: Resource utilization."}) (cons (record Named {index := 6, name := "Time behaviour", text := "Performance efficiency: Time behaviour."}) (nil Named))))))))
}
definition{
name: requirementNames,
parameters: [],
result: (List Named),
body: (cons (record Named {index := 0, name := "Bounded allocation", text := "The guest allocates at most 272 bytes for one request."}) (cons (record Named {index := 1, name := "Bounded request", text := "A request over 136 bytes is refused before any field is read."}) (cons (record Named {index := 2, name := "Every allowed transition modeled", text := "Each of the four allowed_transitions rows is one rule of the machine."}) (cons (record Named {index := 3, name := "Every property proved", text := "All 5 properties are theorems the Lean kernel checks."}) (cons (record Named {index := 4, name := "Every request answered", text := "Every request gets an answer: a rule, provisional otherwise, or invalid."}) (cons (record Named {index := 5, name := "Every vector replays", text := "All 50 acceptance vectors replay in the compiled guest, the shortest 0 bytes long."}) (cons (record Named {index := 6, name := "Examples answered as stated", text := "Every one of the 8 examples of the spec is answered as it states."}) (cons (record Named {index := 7, name := "Two distinct administrators per transition", text := "Every transition out of a state needs at least the minimum_distinct_administrators of model/organization_lifecycle.toml."}) (nil Named)))))))))
}
definition{
name: measureNames,
parameters: [],
result: (List Named),
body: (cons (record Named {index := 0, name := "Administrators per transition", text := "Fewest distinct administrators any allowed transition accepts."}) (cons (record Named {index := 1, name := "Example mismatches", text := "Examples the guest answers otherwise than they state."}) (cons (record Named {index := 2, name := "Failed vectors", text := "Acceptance vectors whose replay differs from the model."}) (cons (record Named {index := 3, name := "Guest allocation bytes", text := "Most bytes the guest allocates for one request."}) (cons (record Named {index := 4, name := "Request bytes read", text := "Longest request the guest decodes, in bytes."}) (cons (record Named {index := 5, name := "Unanswered requests", text := "Acceptance vectors the guest does not answer."}) (cons (record Named {index := 6, name := "Unmodeled transitions", text := "allowed_transitions rows with no rule."}) (cons (record Named {index := 7, name := "Unproved properties", text := "Properties of the spec without a checked theorem."}) (nil Named)))))))))
}
definition{
name: subcharacteristicRecords,
parameters: [],
result: (List Foundation.Qual::QualitySubcharacteristic),
body: (cons (subcharacteristicAuthenticity) (cons (subcharacteristicFaultlessness) (cons (subcharacteristicFunctionalCompleteness) (cons (subcharacteristicFunctionalCorrectness) (cons (subcharacteristicIntegrity) (cons (subcharacteristicResourceUtilization) (cons (subcharacteristicTimeBehaviour) (nil Foundation.Qual::QualitySubcharacteristic))))))))
}
definition{
name: requirementRecords,
parameters: [],
result: (List Foundation.Qual::QualityRequirement),
body: (cons (requirementBoundedAllocation) (cons (requirementBoundedRequest) (cons (requirementEveryAllowedTransitionModeled) (cons (requirementEveryPropertyProved) (cons (requirementEveryRequestAnswered) (cons (requirementEveryVectorReplays) (cons (requirementExamplesAnsweredAsStated) (cons (requirementTwoDistinctAdministratorsPerTransition) (nil Foundation.Qual::QualityRequirement)))))))))
}
definition{
name: measureRecords,
parameters: [],
result: (List Foundation.Qual::QualityMeasure),
body: (cons (measureAdministratorsPerTransition) (cons (measureExampleMismatches) (cons (measureFailedVectors) (cons (measureGuestAllocationBytes) (cons (measureRequestBytesRead) (cons (measureUnansweredRequests) (cons (measureUnmodeledTransitions) (cons (measureUnprovedProperties) (nil Foundation.Qual::QualityMeasure)))))))))
}
definition{
name: namesNumbered,
parameters: [position : Nat, names : (List Named)],
result: Bool,
body: (match names
| List.nil => true
| List.cons item rest => (((project item index) =? position) && (namesNumbered (position + 1) rest))),
recursive_argument: names
}
definition{
name: parentsKnown,
parameters: [count : Nat, records : (List Foundation.Qual::QualitySubcharacteristic)],
result: Bool,
body: (match records
| List.nil => true
| List.cons item rest => (((project item characteristicIndex) <? count) && (parentsKnown count rest))),
recursive_argument: records
}
definition{
name: requirementsKnown,
parameters: [count : Nat, records : (List Foundation.Qual::QualityRequirement)],
result: Bool,
body: (match records
| List.nil => true
| List.cons item rest => (((project item subcharacteristicIndex) <? count) && (requirementsKnown count rest))),
recursive_argument: records
}
definition{
name: measuresKnown,
parameters: [count : Nat, records : (List Foundation.Qual::QualityMeasure)],
result: Bool,
body: (match records
| List.nil => true
| List.cons item rest => (((project item requirementIndex) <? count) && (measuresKnown count rest))),
recursive_argument: records
}
definition{
name: thresholdOf,
parameters: [wanted : Nat, records : (List Foundation.Qual::QualityMeasure)],
result: Nat,
body: (match records
| List.nil => 0
| List.cons head rest => (if ((project head index) =? wanted) then (project head threshold) else (thresholdOf wanted rest))),
recursive_argument: records
}
definition{
name: qualityValid,
parameters: [],
result: Bool,
body: ((namesNumbered 0 (characteristicNames)) && ((namesNumbered 0 (subcharacteristicNames)) && ((namesNumbered 0 (requirementNames)) && ((namesNumbered 0 (measureNames)) && ((parentsKnown 4 (subcharacteristicRecords)) && ((requirementsKnown 7 (requirementRecords)) && (measuresKnown 8 (measureRecords))))))))
}
theorem{
name: qualityModelHolds,
parameters: [],
statement: ((qualityValid) = true),
proof: decide{}
}
theorem{
name: measureAdministratorsPerTransitionThreshold,
parameters: [],
statement: ((thresholdOf 0 (measureRecords)) = 2),
proof: decide{}
}
theorem{
name: measureExampleMismatchesThreshold,
parameters: [],
statement: ((thresholdOf 1 (measureRecords)) = 0),
proof: decide{}
}
theorem{
name: measureFailedVectorsThreshold,
parameters: [],
statement: ((thresholdOf 2 (measureRecords)) = 0),
proof: decide{}
}
theorem{
name: measureGuestAllocationBytesThreshold,
parameters: [],
statement: ((thresholdOf 3 (measureRecords)) = 272),
proof: decide{}
}
theorem{
name: measureRequestBytesReadThreshold,
parameters: [],
statement: ((thresholdOf 4 (measureRecords)) = 136),
proof: decide{}
}
theorem{
name: measureUnansweredRequestsThreshold,
parameters: [],
statement: ((thresholdOf 5 (measureRecords)) = 0),
proof: decide{}
}
theorem{
name: measureUnmodeledTransitionsThreshold,
parameters: [],
statement: ((thresholdOf 6 (measureRecords)) = 0),
proof: decide{}
}
theorem{
name: measureUnprovedPropertiesThreshold,
parameters: [],
statement: ((thresholdOf 7 (measureRecords)) = 0),
proof: decide{}
}
\end{semanticmodule}
\end{lexlean}
app/src/Security.lex.tex 635 lines
\begin{lexlean}{Security}
\useglossary{lexlean.std.bool@1.2.0}
\useglossary{lexlean.std.nat@1.2.0}
\useglossary{prism.arch@1.0.0}
\useglossary{prism.sec@1.0.0}
\importmodule{Foundation.Sec}
\importmodule{Production.ThreatModel}
\importmodule{Architecture}
\title{security threat}
\begin{semanticmodule}
definition{
name: assetAnswer,
parameters: [],
result: Foundation.Sec::Asset,
body: (record Foundation.Sec::Asset {index := 0, componentIndex := 4})
}
definition{
name: assetModelSource,
parameters: [],
result: Foundation.Sec::Asset,
body: (record Foundation.Sec::Asset {index := 1, componentIndex := 7})
}
definition{
name: assetPublishedHolo,
parameters: [],
result: Foundation.Sec::Asset,
body: (record Foundation.Sec::Asset {index := 2, componentIndex := 5})
}
definition{
name: assetRequestBytes,
parameters: [],
result: Foundation.Sec::Asset,
body: (record Foundation.Sec::Asset {index := 3, componentIndex := 4})
}
definition{
name: threatAnswerThatBreaksINV001,
parameters: [],
result: Foundation.Sec::Threat,
body: (record Foundation.Sec::Threat {index := 0})
}
definition{
name: threatAnswerThatBreaksINV002,
parameters: [],
result: Foundation.Sec::Threat,
body: (record Foundation.Sec::Threat {index := 1})
}
definition{
name: threatAnswerThatBreaksINV003,
parameters: [],
result: Foundation.Sec::Threat,
body: (record Foundation.Sec::Threat {index := 2})
}
definition{
name: threatAnswerThatBreaksINV004,
parameters: [],
result: Foundation.Sec::Threat,
body: (record Foundation.Sec::Threat {index := 3})
}
definition{
name: threatAnswerThatBreaksINV005,
parameters: [],
result: Foundation.Sec::Threat,
body: (record Foundation.Sec::Threat {index := 4})
}
definition{
name: threatCrossOrganizationRetirement,
parameters: [],
result: Foundation.Sec::Threat,
body: (record Foundation.Sec::Threat {index := 5})
}
definition{
name: threatDuplicateApprovalsCounted,
parameters: [],
result: Foundation.Sec::Threat,
body: (record Foundation.Sec::Threat {index := 6})
}
definition{
name: threatGrantedCapability,
parameters: [],
result: Foundation.Sec::Threat,
body: (record Foundation.Sec::Threat {index := 7})
}
definition{
name: threatMalformedRequest,
parameters: [],
result: Foundation.Sec::Threat,
body: (record Foundation.Sec::Threat {index := 8})
}
definition{
name: threatOversizedRequest,
parameters: [],
result: Foundation.Sec::Threat,
body: (record Foundation.Sec::Threat {index := 9})
}
definition{
name: threatSingleOwnerActivation,
parameters: [],
result: Foundation.Sec::Threat,
body: (record Foundation.Sec::Threat {index := 10})
}
definition{
name: threatSubstitutedHolo,
parameters: [],
result: Foundation.Sec::Threat,
body: (record Foundation.Sec::Threat {index := 11})
}
definition{
name: threatSubstitutedHost,
parameters: [],
result: Foundation.Sec::Threat,
body: (record Foundation.Sec::Threat {index := 12})
}
definition{
name: threatTamperedModel,
parameters: [],
result: Foundation.Sec::Threat,
body: (record Foundation.Sec::Threat {index := 13})
}
definition{
name: riskAnswerThatBreaksINV001,
parameters: [],
result: Foundation.Sec::Risk,
body: (record Foundation.Sec::Risk {index := 0, assetIndex := 0, threatIndex := 0, likelihood := (ctor Foundation.Sec::Likelihood.medium), impact := (ctor Foundation.Sec::Impact.critical)})
}
definition{
name: riskAnswerThatBreaksINV002,
parameters: [],
result: Foundation.Sec::Risk,
body: (record Foundation.Sec::Risk {index := 1, assetIndex := 0, threatIndex := 1, likelihood := (ctor Foundation.Sec::Likelihood.medium), impact := (ctor Foundation.Sec::Impact.critical)})
}
definition{
name: riskAnswerThatBreaksINV003,
parameters: [],
result: Foundation.Sec::Risk,
body: (record Foundation.Sec::Risk {index := 2, assetIndex := 0, threatIndex := 2, likelihood := (ctor Foundation.Sec::Likelihood.medium), impact := (ctor Foundation.Sec::Impact.critical)})
}
definition{
name: riskAnswerThatBreaksINV004,
parameters: [],
result: Foundation.Sec::Risk,
body: (record Foundation.Sec::Risk {index := 3, assetIndex := 0, threatIndex := 3, likelihood := (ctor Foundation.Sec::Likelihood.medium), impact := (ctor Foundation.Sec::Impact.critical)})
}
definition{
name: riskAnswerThatBreaksINV005,
parameters: [],
result: Foundation.Sec::Risk,
body: (record Foundation.Sec::Risk {index := 4, assetIndex := 0, threatIndex := 4, likelihood := (ctor Foundation.Sec::Likelihood.medium), impact := (ctor Foundation.Sec::Impact.critical)})
}
definition{
name: riskCrossOrganizationRetirement,
parameters: [],
result: Foundation.Sec::Risk,
body: (record Foundation.Sec::Risk {index := 5, assetIndex := 0, threatIndex := 5, likelihood := (ctor Foundation.Sec::Likelihood.medium), impact := (ctor Foundation.Sec::Impact.critical)})
}
definition{
name: riskDuplicateApprovalsCounted,
parameters: [],
result: Foundation.Sec::Risk,
body: (record Foundation.Sec::Risk {index := 6, assetIndex := 3, threatIndex := 6, likelihood := (ctor Foundation.Sec::Likelihood.medium), impact := (ctor Foundation.Sec::Impact.major)})
}
definition{
name: riskGrantedCapability,
parameters: [],
result: Foundation.Sec::Risk,
body: (record Foundation.Sec::Risk {index := 7, assetIndex := 0, threatIndex := 7, likelihood := (ctor Foundation.Sec::Likelihood.low), impact := (ctor Foundation.Sec::Impact.major)})
}
definition{
name: riskMalformedRequest,
parameters: [],
result: Foundation.Sec::Risk,
body: (record Foundation.Sec::Risk {index := 8, assetIndex := 3, threatIndex := 8, likelihood := (ctor Foundation.Sec::Likelihood.high), impact := (ctor Foundation.Sec::Impact.major)})
}
definition{
name: riskOversizedRequest,
parameters: [],
result: Foundation.Sec::Risk,
body: (record Foundation.Sec::Risk {index := 9, assetIndex := 3, threatIndex := 9, likelihood := (ctor Foundation.Sec::Likelihood.medium), impact := (ctor Foundation.Sec::Impact.minor)})
}
definition{
name: riskSingleOwnerActivation,
parameters: [],
result: Foundation.Sec::Risk,
body: (record Foundation.Sec::Risk {index := 10, assetIndex := 0, threatIndex := 10, likelihood := (ctor Foundation.Sec::Likelihood.high), impact := (ctor Foundation.Sec::Impact.major)})
}
definition{
name: riskSubstitutedHolo,
parameters: [],
result: Foundation.Sec::Risk,
body: (record Foundation.Sec::Risk {index := 11, assetIndex := 2, threatIndex := 11, likelihood := (ctor Foundation.Sec::Likelihood.low), impact := (ctor Foundation.Sec::Impact.critical)})
}
definition{
name: riskSubstitutedHost,
parameters: [],
result: Foundation.Sec::Risk,
body: (record Foundation.Sec::Risk {index := 12, assetIndex := 2, threatIndex := 12, likelihood := (ctor Foundation.Sec::Likelihood.low), impact := (ctor Foundation.Sec::Impact.critical)})
}
definition{
name: riskTamperedModel,
parameters: [],
result: Foundation.Sec::Risk,
body: (record Foundation.Sec::Risk {index := 13, assetIndex := 1, threatIndex := 13, likelihood := (ctor Foundation.Sec::Likelihood.low), impact := (ctor Foundation.Sec::Impact.major)})
}
definition{
name: controlBoundedRequest,
parameters: [],
result: Foundation.Sec::ApplicationSecurityControl,
body: (record Foundation.Sec::ApplicationSecurityControl {index := 0, riskIndex := 9})
}
definition{
name: controlDistinctUserQuorum,
parameters: [],
result: Foundation.Sec::ApplicationSecurityControl,
body: (record Foundation.Sec::ApplicationSecurityControl {index := 1, riskIndex := 10})
}
definition{
name: controlFingerprintAndProvenance,
parameters: [],
result: Foundation.Sec::ApplicationSecurityControl,
body: (record Foundation.Sec::ApplicationSecurityControl {index := 2, riskIndex := 11})
}
definition{
name: controlNoCapabilityGranted,
parameters: [],
result: Foundation.Sec::ApplicationSecurityControl,
body: (record Foundation.Sec::ApplicationSecurityControl {index := 3, riskIndex := 7})
}
definition{
name: controlOrganizationIsolation,
parameters: [],
result: Foundation.Sec::ApplicationSecurityControl,
body: (record Foundation.Sec::ApplicationSecurityControl {index := 4, riskIndex := 5})
}
definition{
name: controlProofOfINV001,
parameters: [],
result: Foundation.Sec::ApplicationSecurityControl,
body: (record Foundation.Sec::ApplicationSecurityControl {index := 5, riskIndex := 0})
}
definition{
name: controlProofOfINV002,
parameters: [],
result: Foundation.Sec::ApplicationSecurityControl,
body: (record Foundation.Sec::ApplicationSecurityControl {index := 6, riskIndex := 1})
}
definition{
name: controlProofOfINV003,
parameters: [],
result: Foundation.Sec::ApplicationSecurityControl,
body: (record Foundation.Sec::ApplicationSecurityControl {index := 7, riskIndex := 2})
}
definition{
name: controlProofOfINV004,
parameters: [],
result: Foundation.Sec::ApplicationSecurityControl,
body: (record Foundation.Sec::ApplicationSecurityControl {index := 8, riskIndex := 3})
}
definition{
name: controlProofOfINV005,
parameters: [],
result: Foundation.Sec::ApplicationSecurityControl,
body: (record Foundation.Sec::ApplicationSecurityControl {index := 9, riskIndex := 4})
}
definition{
name: controlRegeneratedFromThePrompt,
parameters: [],
result: Foundation.Sec::ApplicationSecurityControl,
body: (record Foundation.Sec::ApplicationSecurityControl {index := 10, riskIndex := 13})
}
definition{
name: controlStrictDecoder,
parameters: [],
result: Foundation.Sec::ApplicationSecurityControl,
body: (record Foundation.Sec::ApplicationSecurityControl {index := 11, riskIndex := 8})
}
definition{
name: controlSet,
parameters: [],
result: Production.ThreatModel::ControlSet,
body: (record Production.ThreatModel::ControlSet {title := "Organization lifecycle security controls", text := "Organization lifecycle answers one request with one answer in a Core-Wasm guest granted no capability. 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.", version := "0.1.0", lastModified := "2026-11-12T18:44:38Z"})
}
definition{
name: modeledAssetAnswer,
parameters: [],
result: Production.ThreatModel::ModeledAsset,
body: (record Production.ThreatModel::ModeledAsset {asset := "Security::assetAnswer", name := "Answer", text := "The answer the guest returns: one of provisional, activated, suspended, retired, or invalid."})
}
definition{
name: modeledAssetModelSource,
parameters: [],
result: Production.ThreatModel::ModeledAsset,
body: (record Production.ThreatModel::ModeledAsset {asset := "Security::assetModelSource", name := "Model source", text := "The prompt, the spec and the LexLean model in the repository, from which the holo is built."})
}
definition{
name: modeledAssetPublishedHolo,
parameters: [],
result: Production.ThreatModel::ModeledAsset,
body: (record Production.ThreatModel::ModeledAsset {asset := "Security::assetPublishedHolo", name := "Published holo", text := "The holo and page the Pages workflow publishes, with its fingerprint and signed provenance."})
}
definition{
name: modeledAssetRequestBytes,
parameters: [],
result: Production.ThreatModel::ModeledAsset,
body: (record Production.ThreatModel::ModeledAsset {asset := "Security::assetRequestBytes", name := "Request bytes", text := "The bytes a caller sends, at most 136 of them."})
}
definition{
name: modeledThreatAnswerThatBreaksINV001,
parameters: [],
result: Production.ThreatModel::ModeledThreat,
body: (record Production.ThreatModel::ModeledThreat {threat := "Security::threatAnswerThatBreaksINV001", name := "Answer that breaks INV-001", text := "The guest answers activated although state is provisional and administrators is below 2, which matters because a sole founding administrator is a bootstrap condition, not accepted redundancy.", category := (ctor Production.ThreatModel::Stride.repudiation)})
}
definition{
name: modeledThreatAnswerThatBreaksINV002,
parameters: [],
result: Production.ThreatModel::ModeledThreat,
body: (record Production.ThreatModel::ModeledThreat {threat := "Security::threatAnswerThatBreaksINV002", name := "Answer that breaks INV-002", text := "The guest answers activated although state is provisional and coverage is partial, which matters because activation needs complete administrative coverage of the organization's parts.", category := (ctor Production.ThreatModel::Stride.repudiation)})
}
definition{
name: modeledThreatAnswerThatBreaksINV003,
parameters: [],
result: Production.ThreatModel::ModeledThreat,
body: (record Production.ThreatModel::ModeledThreat {threat := "Security::threatAnswerThatBreaksINV003", name := "Answer that breaks INV-003", text := "The guest answers retired although scope is other and state is activated, which matters because creation never gives authority over another organization.", category := (ctor Production.ThreatModel::Stride.repudiation)})
}
definition{
name: modeledThreatAnswerThatBreaksINV004,
parameters: [],
result: Production.ThreatModel::ModeledThreat,
body: (record Production.ThreatModel::ModeledThreat {threat := "Security::threatAnswerThatBreaksINV004", name := "Answer that breaks INV-004", text := "The guest answers retired although state is suspended, which matters because retirement is allowed only from activated.", category := (ctor Production.ThreatModel::Stride.repudiation)})
}
definition{
name: modeledThreatAnswerThatBreaksINV005,
parameters: [],
result: Production.ThreatModel::ModeledThreat,
body: (record Production.ThreatModel::ModeledThreat {threat := "Security::threatAnswerThatBreaksINV005", name := "Answer that breaks INV-005", text := "The guest answers retired not when state is retired, which matters because retired is a final state (UML 2.5.1 FinalState): a run that reaches it stays there.", category := (ctor Production.ThreatModel::Stride.repudiation)})
}
definition{
name: modeledThreatCrossOrganizationRetirement,
parameters: [],
result: Production.ThreatModel::ModeledThreat,
body: (record Production.ThreatModel::ModeledThreat {threat := "Security::threatCrossOrganizationRetirement", name := "Cross-organization retirement", text := "Administrators of another organization, possibly one with an identical display name, retire this one.", category := (ctor Production.ThreatModel::Stride.spoofing)})
}
definition{
name: modeledThreatDuplicateApprovalsCounted,
parameters: [],
result: Production.ThreatModel::ModeledThreat,
body: (record Production.ThreatModel::ModeledThreat {threat := "Security::threatDuplicateApprovalsCounted", name := "Duplicate approvals counted", text := "Aliases or extra keys of one user are counted as several administrators.", category := (ctor Production.ThreatModel::Stride.spoofing)})
}
definition{
name: modeledThreatGrantedCapability,
parameters: [],
result: Production.ThreatModel::ModeledThreat,
body: (record Production.ThreatModel::ModeledThreat {threat := "Security::threatGrantedCapability", name := "Granted capability", text := "The guest reads, stores or sends data beyond the request it answers.", category := (ctor Production.ThreatModel::Stride.informationDisclosure)})
}
definition{
name: modeledThreatMalformedRequest,
parameters: [],
result: Production.ThreatModel::ModeledThreat,
body: (record Production.ThreatModel::ModeledThreat {threat := "Security::threatMalformedRequest", name := "Malformed request", text := "A request with a missing, extra, unknown or badly written field is answered as if it were well formed.", category := (ctor Production.ThreatModel::Stride.tampering)})
}
definition{
name: modeledThreatOversizedRequest,
parameters: [],
result: Production.ThreatModel::ModeledThreat,
body: (record Production.ThreatModel::ModeledThreat {threat := "Security::threatOversizedRequest", name := "Oversized request", text := "A request longer than 136 bytes makes the guest parse or allocate without bound.", category := (ctor Production.ThreatModel::Stride.denialOfService)})
}
definition{
name: modeledThreatSingleOwnerActivation,
parameters: [],
result: Production.ThreatModel::ModeledThreat,
body: (record Production.ThreatModel::ModeledThreat {threat := "Security::threatSingleOwnerActivation", name := "Single-owner activation", text := "The sole founding administrator activates the organization without a second distinct user.", category := (ctor Production.ThreatModel::Stride.elevationOfPrivilege)})
}
definition{
name: modeledThreatSubstitutedHolo,
parameters: [],
result: Production.ThreatModel::ModeledThreat,
body: (record Production.ThreatModel::ModeledThreat {threat := "Security::threatSubstitutedHolo", name := "Substituted holo", text := "A holo other than the one the build verified is served under the app address.", category := (ctor Production.ThreatModel::Stride.spoofing)})
}
definition{
name: modeledThreatSubstitutedHost,
parameters: [],
result: Production.ThreatModel::ModeledThreat,
body: (record Production.ThreatModel::ModeledThreat {threat := "Security::threatSubstitutedHost", name := "Substituted host", text := "Something other than the repository Pages workflow serves pages under its address.", category := (ctor Production.ThreatModel::Stride.spoofing)})
}
definition{
name: modeledThreatTamperedModel,
parameters: [],
result: Production.ThreatModel::ModeledThreat,
body: (record Production.ThreatModel::ModeledThreat {threat := "Security::threatTamperedModel", name := "Tampered model", text := "The model the holo is built from differs from the reviewed prompt and spec.", category := (ctor Production.ThreatModel::Stride.tampering)})
}
definition{
name: modeledControlBoundedRequest,
parameters: [],
result: Production.ThreatModel::ModeledControl,
body: (record Production.ThreatModel::ModeledControl {control := "Security::controlBoundedRequest", name := "Bounded request", text := "dispatch answers invalid for a request over 136 bytes before reading a field, and the guest allocates at most 272.", evidence := (cons (record Production.ThreatModel::Evidence {kind := (ctor Production.ThreatModel::EvidenceKind.gate), reference := "acceptance vectors at the request bound, one byte over it, and at the guest allocation bound, replayed by prismpm verify"}) (nil Production.ThreatModel::Evidence))})
}
definition{
name: modeledControlDistinctUserQuorum,
parameters: [],
result: Production.ThreatModel::ModeledControl,
body: (record Production.ThreatModel::ModeledControl {control := "Security::controlDistinctUserQuorum", name := "Distinct-user quorum", text := "Activation needs two distinct administrators and complete coverage.", evidence := (cons (record Production.ThreatModel::Evidence {kind := (ctor Production.ThreatModel::EvidenceKind.proof), reference := "FoundryOrgLifecycleProofs::inv001Holds"}) (cons (record Production.ThreatModel::Evidence {kind := (ctor Production.ThreatModel::EvidenceKind.proof), reference := "FoundryOrgLifecycleProofs::inv002Holds"}) (cons (record Production.ThreatModel::Evidence {kind := (ctor Production.ThreatModel::EvidenceKind.review), reference := "UOR-Foundation/uor-foundry model/organization_lifecycle.toml"}) (nil Production.ThreatModel::Evidence))))})
}
definition{
name: modeledControlFingerprintAndProvenance,
parameters: [],
result: Production.ThreatModel::ModeledControl,
body: (record Production.ThreatModel::ModeledControl {control := "Security::controlFingerprintAndProvenance", name := "Fingerprint and provenance", text := "The page verifies the holo digests before it runs, and the build signs its provenance as the repository workflow.", evidence := (cons (record Production.ThreatModel::Evidence {kind := (ctor Production.ThreatModel::EvidenceKind.gate), reference := "actions/attest-build-provenance in the pages workflow"}) (cons (record Production.ThreatModel::Evidence {kind := (ctor Production.ThreatModel::EvidenceKind.gate), reference := "prism-code check of the holo identities in the page"}) (nil Production.ThreatModel::Evidence)))})
}
definition{
name: modeledControlNoCapabilityGranted,
parameters: [],
result: Production.ThreatModel::ModeledControl,
body: (record Production.ThreatModel::ModeledControl {control := "Security::controlNoCapabilityGranted", name := "No capability granted", text := "prism.toml grants the holo nothing and the model declares capabilitiesEmpty, so a guest import of any host capability is refused.", evidence := (cons (record Production.ThreatModel::Evidence {kind := (ctor Production.ThreatModel::EvidenceKind.gate), reference := "prism-code check refuses an ungranted guest import"}) (nil Production.ThreatModel::Evidence))})
}
definition{
name: modeledControlOrganizationIsolation,
parameters: [],
result: Production.ThreatModel::ModeledControl,
body: (record Production.ThreatModel::ModeledControl {control := "Security::controlOrganizationIsolation", name := "Organization isolation", text := "Only this organization's administrators move it.", evidence := (cons (record Production.ThreatModel::Evidence {kind := (ctor Production.ThreatModel::EvidenceKind.proof), reference := "FoundryOrgLifecycleProofs::inv003Holds"}) (cons (record Production.ThreatModel::Evidence {kind := (ctor Production.ThreatModel::EvidenceKind.review), reference := "UOR-Foundation/uor-foundry SPEC.md: names confer no privileges"}) (nil Production.ThreatModel::Evidence)))})
}
definition{
name: modeledControlProofOfINV001,
parameters: [],
result: Production.ThreatModel::ModeledControl,
body: (record Production.ThreatModel::ModeledControl {control := "Security::controlProofOfINV001", name := "Proof of INV-001", text := "It never answers activated when state is provisional and administrators is below 2. The Lean kernel proves it for every request.", evidence := (cons (record Production.ThreatModel::Evidence {kind := (ctor Production.ThreatModel::EvidenceKind.proof), reference := "FoundryOrgLifecycleProofs::inv001Holds"}) (nil Production.ThreatModel::Evidence))})
}
definition{
name: modeledControlProofOfINV002,
parameters: [],
result: Production.ThreatModel::ModeledControl,
body: (record Production.ThreatModel::ModeledControl {control := "Security::controlProofOfINV002", name := "Proof of INV-002", text := "It never answers activated when state is provisional and coverage is partial. The Lean kernel proves it for every request.", evidence := (cons (record Production.ThreatModel::Evidence {kind := (ctor Production.ThreatModel::EvidenceKind.proof), reference := "FoundryOrgLifecycleProofs::inv002Holds"}) (nil Production.ThreatModel::Evidence))})
}
definition{
name: modeledControlProofOfINV003,
parameters: [],
result: Production.ThreatModel::ModeledControl,
body: (record Production.ThreatModel::ModeledControl {control := "Security::controlProofOfINV003", name := "Proof of INV-003", text := "It never answers retired when scope is other and state is activated. The Lean kernel proves it for every request.", evidence := (cons (record Production.ThreatModel::Evidence {kind := (ctor Production.ThreatModel::EvidenceKind.proof), reference := "FoundryOrgLifecycleProofs::inv003Holds"}) (nil Production.ThreatModel::Evidence))})
}
definition{
name: modeledControlProofOfINV004,
parameters: [],
result: Production.ThreatModel::ModeledControl,
body: (record Production.ThreatModel::ModeledControl {control := "Security::controlProofOfINV004", name := "Proof of INV-004", text := "It never answers retired when state is suspended. The Lean kernel proves it for every request.", evidence := (cons (record Production.ThreatModel::Evidence {kind := (ctor Production.ThreatModel::EvidenceKind.proof), reference := "FoundryOrgLifecycleProofs::inv004Holds"}) (nil Production.ThreatModel::Evidence))})
}
definition{
name: modeledControlProofOfINV005,
parameters: [],
result: Production.ThreatModel::ModeledControl,
body: (record Production.ThreatModel::ModeledControl {control := "Security::controlProofOfINV005", name := "Proof of INV-005", text := "It always answers retired when state is retired. The Lean kernel proves it for every request.", evidence := (cons (record Production.ThreatModel::Evidence {kind := (ctor Production.ThreatModel::EvidenceKind.proof), reference := "FoundryOrgLifecycleProofs::inv005Holds"}) (nil Production.ThreatModel::Evidence))})
}
definition{
name: modeledControlRegeneratedFromThePrompt,
parameters: [],
result: Production.ThreatModel::ModeledControl,
body: (record Production.ThreatModel::ModeledControl {control := "Security::controlRegeneratedFromThePrompt", name := "Regenerated from the prompt", text := "The model is written from the prompt by the builder, and the build checks every theorem and replays every vector in the pinned SDK.", evidence := (cons (record Production.ThreatModel::Evidence {kind := (ctor Production.ThreatModel::EvidenceKind.gate), reference := "prismpm verify in the SDK image prismpm.lock pins"}) (cons (record Production.ThreatModel::Evidence {kind := (ctor Production.ThreatModel::EvidenceKind.review), reference := "app/prompt.json"}) (nil Production.ThreatModel::Evidence)))})
}
definition{
name: modeledControlStrictDecoder,
parameters: [],
result: Production.ThreatModel::ModeledControl,
body: (record Production.ThreatModel::ModeledControl {control := "Security::controlStrictDecoder", name := "Strict decoder", text := "Every field is decoded exactly: choices from their list, numbers as plain decimal digits within their bounds, single spaces between fields; anything else is invalid.", evidence := (cons (record Production.ThreatModel::Evidence {kind := (ctor Production.ThreatModel::EvidenceKind.gate), reference := "malformed-request acceptance vectors, replayed in the compiled guest by prismpm verify"}) (nil Production.ThreatModel::Evidence))})
}
definition{
name: mappingOversizedRequest,
parameters: [],
result: Production.ThreatModel::ThreatMapping,
body: (record Production.ThreatModel::ThreatMapping {threat := "Security::threatOversizedRequest", controls := (cons "Security::controlBoundedRequest" (nil String))})
}
definition{
name: mappingSingleOwnerActivation,
parameters: [],
result: Production.ThreatModel::ThreatMapping,
body: (record Production.ThreatModel::ThreatMapping {threat := "Security::threatSingleOwnerActivation", controls := (cons "Security::controlDistinctUserQuorum" (nil String))})
}
definition{
name: mappingSubstitutedHolo,
parameters: [],
result: Production.ThreatModel::ThreatMapping,
body: (record Production.ThreatModel::ThreatMapping {threat := "Security::threatSubstitutedHolo", controls := (cons "Security::controlFingerprintAndProvenance" (nil String))})
}
definition{
name: mappingGrantedCapability,
parameters: [],
result: Production.ThreatModel::ThreatMapping,
body: (record Production.ThreatModel::ThreatMapping {threat := "Security::threatGrantedCapability", controls := (cons "Security::controlNoCapabilityGranted" (nil String))})
}
definition{
name: mappingCrossOrganizationRetirement,
parameters: [],
result: Production.ThreatModel::ThreatMapping,
body: (record Production.ThreatModel::ThreatMapping {threat := "Security::threatCrossOrganizationRetirement", controls := (cons "Security::controlOrganizationIsolation" (nil String))})
}
definition{
name: mappingAnswerThatBreaksINV001,
parameters: [],
result: Production.ThreatModel::ThreatMapping,
body: (record Production.ThreatModel::ThreatMapping {threat := "Security::threatAnswerThatBreaksINV001", controls := (cons "Security::controlProofOfINV001" (nil String))})
}
definition{
name: mappingAnswerThatBreaksINV002,
parameters: [],
result: Production.ThreatModel::ThreatMapping,
body: (record Production.ThreatModel::ThreatMapping {threat := "Security::threatAnswerThatBreaksINV002", controls := (cons "Security::controlProofOfINV002" (nil String))})
}
definition{
name: mappingAnswerThatBreaksINV003,
parameters: [],
result: Production.ThreatModel::ThreatMapping,
body: (record Production.ThreatModel::ThreatMapping {threat := "Security::threatAnswerThatBreaksINV003", controls := (cons "Security::controlProofOfINV003" (nil String))})
}
definition{
name: mappingAnswerThatBreaksINV004,
parameters: [],
result: Production.ThreatModel::ThreatMapping,
body: (record Production.ThreatModel::ThreatMapping {threat := "Security::threatAnswerThatBreaksINV004", controls := (cons "Security::controlProofOfINV004" (nil String))})
}
definition{
name: mappingAnswerThatBreaksINV005,
parameters: [],
result: Production.ThreatModel::ThreatMapping,
body: (record Production.ThreatModel::ThreatMapping {threat := "Security::threatAnswerThatBreaksINV005", controls := (cons "Security::controlProofOfINV005" (nil String))})
}
definition{
name: mappingTamperedModel,
parameters: [],
result: Production.ThreatModel::ThreatMapping,
body: (record Production.ThreatModel::ThreatMapping {threat := "Security::threatTamperedModel", controls := (cons "Security::controlRegeneratedFromThePrompt" (nil String))})
}
definition{
name: mappingMalformedRequest,
parameters: [],
result: Production.ThreatModel::ThreatMapping,
body: (record Production.ThreatModel::ThreatMapping {threat := "Security::threatMalformedRequest", controls := (cons "Security::controlStrictDecoder" (nil String))})
}
definition{
name: acceptedDuplicateApprovalsCounted,
parameters: [],
result: Production.ThreatModel::AcceptedRisk,
body: (record Production.ThreatModel::AcceptedRisk {threat := "Security::threatDuplicateApprovalsCounted", rationale := "The app is given the count of distinct users; deduplicating aliases and keys belongs to the authority model that sends it, per SPEC.md."})
}
definition{
name: acceptedSubstitutedHost,
parameters: [],
result: Production.ThreatModel::AcceptedRisk,
body: (record Production.ThreatModel::AcceptedRisk {threat := "Security::threatSubstitutedHost", rationale := "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."})
}
\end{semanticmodule}
\end{lexlean}
app/src/FoundryOrgLifecycle.lex.tex 314 lines
\begin{lexlean}{FoundryOrgLifecycle}
\useglossary{lexlean.std.bool@1.2.0}
\useglossary{lexlean.std.nat@1.2.0}
\useglossary{prism.arch@1.0.0}
\importmodule{Foundation.Bytes}
\importmodule{Foundation.View.Text.V1.Model}
\title{Text application model}
\begin{semanticmodule}
definition{name: stateProvisional, parameters: [], result: Nat, body: 0}
definition{name: stateActivated, parameters: [], result: Nat, body: 1}
definition{name: stateSuspended, parameters: [], result: Nat, body: 2}
definition{name: stateRetired, parameters: [], result: Nat, body: 3}
definition{name: eventActivate, parameters: [], result: Nat, body: 0}
definition{name: eventSuspend, parameters: [], result: Nat, body: 1}
definition{name: eventReactivate, parameters: [], result: Nat, body: 2}
definition{name: eventRetire, parameters: [], result: Nat, body: 3}
definition{name: scopeOwn, parameters: [], result: Nat, body: 0}
definition{name: scopeOther, parameters: [], result: Nat, body: 1}
definition{name: coverageComplete, parameters: [], result: Nat, body: 0}
definition{name: coveragePartial, parameters: [], result: Nat, body: 1}
definition{name: answerProvisional, parameters: [], result: Nat, body: 0}
definition{name: answerActivated, parameters: [], result: Nat, body: 1}
definition{name: answerSuspended, parameters: [], result: Nat, body: 2}
definition{name: answerRetired, parameters: [], result: Nat, body: 3}
structure{
name: Request,
type_parameters: [],
parameters: [],
fields: [
{name: state, type: Nat},
{name: event, type: Nat},
{name: scope, type: Nat},
{name: administrators, type: Nat},
{name: coverage, type: Nat}
]
}
definition{
name: byteAt,
parameters: [s : Bytes, i : Nat],
result: (Option Nat),
body: (match (prim index s i : (Option UInt8))
| Option.none => (ctor Option.none [Nat])
| Option.some b => (ctor Option.some [Nat] (prim to_nat b : Nat))),
axioms: [Quot.sound, propext]
}
definition{
name: digitsValue,
parameters: [s : Bytes, i : Nat, acc : Nat, fuel : Nat],
result: (Option Nat),
body: (match fuel
| Nat.zero => (ctor Option.some [Nat] acc)
| Nat.succ rest => (match (byteAt s i)
| Option.none => (ctor Option.none [Nat])
| Option.some d => (if ((d <? 48) || (57 <? d)) then (ctor Option.none [Nat]) else (digitsValue s (i + 1) ((prim multiply acc 10 : Nat) + (prim subtract d 48 : Nat)) rest)))),
axioms: [Quot.sound, propext],
recursive_argument: fuel
}
definition{
name: parseDigits,
parameters: [s : Bytes],
result: (Option Nat),
body: (if ((Foundation.Bytes::byteLength s) =? 0) then (ctor Option.none [Nat]) else (if (18 <? (Foundation.Bytes::byteLength s)) then (ctor Option.none [Nat]) else (match (byteAt s 0)
| Option.none => (ctor Option.none [Nat])
| Option.some lead => (if ((lead =? 48) && (1 <? (Foundation.Bytes::byteLength s))) then (ctor Option.none [Nat]) else (digitsValue s 0 0 (Foundation.Bytes::byteLength s)))))),
axioms: [Quot.sound, propext]
}
definition{
name: parseNumber,
parameters: [value : Bytes],
result: (Option Nat),
body: (parseDigits value),
axioms: [Quot.sound, propext]
}
definition{
name: parseState,
parameters: [value : Bytes],
result: (Option Nat),
body: (if (prim equal value 0x70726f766973696f6e616c : Bool) then (ctor Option.some [Nat] (stateProvisional)) else (if (prim equal value 0x616374697661746564 : Bool) then (ctor Option.some [Nat] (stateActivated)) else (if (prim equal value 0x73757370656e646564 : Bool) then (ctor Option.some [Nat] (stateSuspended)) else (if (prim equal value 0x72657469726564 : Bool) then (ctor Option.some [Nat] (stateRetired)) else (ctor Option.none [Nat])))))
}
definition{
name: parseEvent,
parameters: [value : Bytes],
result: (Option Nat),
body: (if (prim equal value 0x6163746976617465 : Bool) then (ctor Option.some [Nat] (eventActivate)) else (if (prim equal value 0x73757370656e64 : Bool) then (ctor Option.some [Nat] (eventSuspend)) else (if (prim equal value 0x72656163746976617465 : Bool) then (ctor Option.some [Nat] (eventReactivate)) else (if (prim equal value 0x726574697265 : Bool) then (ctor Option.some [Nat] (eventRetire)) else (ctor Option.none [Nat])))))
}
definition{
name: parseScope,
parameters: [value : Bytes],
result: (Option Nat),
body: (if (prim equal value 0x6f776e : Bool) then (ctor Option.some [Nat] (scopeOwn)) else (if (prim equal value 0x6f74686572 : Bool) then (ctor Option.some [Nat] (scopeOther)) else (ctor Option.none [Nat])))
}
definition{
name: parseAdministrators,
parameters: [value : Bytes],
result: (Option Nat),
body: (match (parseNumber value)
| Option.none => (ctor Option.none [Nat])
| Option.some parsed => (if (64 <? parsed) then (ctor Option.none [Nat]) else (ctor Option.some [Nat] parsed))),
axioms: [Quot.sound, propext]
}
definition{
name: parseCoverage,
parameters: [value : Bytes],
result: (Option Nat),
body: (if (prim equal value 0x636f6d706c657465 : Bool) then (ctor Option.some [Nat] (coverageComplete)) else (if (prim equal value 0x7061727469616c : Bool) then (ctor Option.some [Nat] (coveragePartial)) else (ctor Option.none [Nat])))
}
definition{
name: sliceOf,
parameters: [s : Bytes, start : Nat, count : Nat],
result: Bytes,
body: (match (prim slice s start count : (Option Bytes))
| Option.none => 0x
| Option.some part => part)
}
definition{
name: fieldEnd,
parameters: [s : Bytes, i : Nat, fuel : Nat],
result: Nat,
body: (match fuel
| Nat.zero => i
| Nat.succ rest => (match (byteAt s i)
| Option.none => i
| Option.some d => (if (d =? 32) then i else (fieldEnd s (i + 1) rest)))),
axioms: [Quot.sound, propext],
recursive_argument: fuel
}
definition{
name: decodeField5,
parameters: [s : Bytes, start : Nat, v1 : Nat, v2 : Nat, v3 : Nat, v4 : Nat],
result: (Option Request),
body: (let e : Nat := (fieldEnd s start (Foundation.Bytes::byteLength s)); (match (parseCoverage (sliceOf s start (prim subtract e start : Nat)))
| Option.none => (ctor Option.none [Request])
| Option.some v5 => (if (e =? (Foundation.Bytes::byteLength s)) then (ctor Option.some [Request] (record Request {state := v1, event := v2, scope := v3, administrators := v4, coverage := v5})) else (ctor Option.none [Request])))),
axioms: [Quot.sound, propext]
}
definition{
name: decodeField4,
parameters: [s : Bytes, start : Nat, v1 : Nat, v2 : Nat, v3 : Nat],
result: (Option Request),
body: (let e : Nat := (fieldEnd s start (Foundation.Bytes::byteLength s)); (match (parseAdministrators (sliceOf s start (prim subtract e start : Nat)))
| Option.none => (ctor Option.none [Request])
| Option.some v4 => (if (e <? (Foundation.Bytes::byteLength s)) then (decodeField5 s (e + 1) v1 v2 v3 v4) else (ctor Option.none [Request])))),
axioms: [Quot.sound, propext]
}
definition{
name: decodeField3,
parameters: [s : Bytes, start : Nat, v1 : Nat, v2 : Nat],
result: (Option Request),
body: (let e : Nat := (fieldEnd s start (Foundation.Bytes::byteLength s)); (match (parseScope (sliceOf s start (prim subtract e start : Nat)))
| Option.none => (ctor Option.none [Request])
| Option.some v3 => (if (e <? (Foundation.Bytes::byteLength s)) then (decodeField4 s (e + 1) v1 v2 v3) else (ctor Option.none [Request])))),
axioms: [Quot.sound, propext]
}
definition{
name: decodeField2,
parameters: [s : Bytes, start : Nat, v1 : Nat],
result: (Option Request),
body: (let e : Nat := (fieldEnd s start (Foundation.Bytes::byteLength s)); (match (parseEvent (sliceOf s start (prim subtract e start : Nat)))
| Option.none => (ctor Option.none [Request])
| Option.some v2 => (if (e <? (Foundation.Bytes::byteLength s)) then (decodeField3 s (e + 1) v1 v2) else (ctor Option.none [Request])))),
axioms: [Quot.sound, propext]
}
definition{
name: decodeField1,
parameters: [s : Bytes, start : Nat],
result: (Option Request),
body: (let e : Nat := (fieldEnd s start (Foundation.Bytes::byteLength s)); (match (parseState (sliceOf s start (prim subtract e start : Nat)))
| Option.none => (ctor Option.none [Request])
| Option.some v1 => (if (e <? (Foundation.Bytes::byteLength s)) then (decodeField2 s (e + 1) v1) else (ctor Option.none [Request])))),
axioms: [Quot.sound, propext]
}
definition{
name: rule1,
parameters: [request : Request],
result: Bool,
body: ((((((project request state) =? (stateProvisional)) && ((project request event) =? (eventActivate))) && ((project request scope) =? (scopeOwn))) && (2 <=? (project request administrators))) && ((project request coverage) =? (coverageComplete)))
}
definition{
name: rule2,
parameters: [request : Request],
result: Bool,
body: (((((project request state) =? (stateActivated)) && ((project request event) =? (eventSuspend))) && ((project request scope) =? (scopeOwn))) && (2 <=? (project request administrators)))
}
definition{
name: rule3,
parameters: [request : Request],
result: Bool,
body: (((((project request state) =? (stateSuspended)) && ((project request event) =? (eventReactivate))) && ((project request scope) =? (scopeOwn))) && (2 <=? (project request administrators)))
}
definition{
name: rule4,
parameters: [request : Request],
result: Bool,
body: (((((project request state) =? (stateActivated)) && ((project request event) =? (eventRetire))) && ((project request scope) =? (scopeOwn))) && (2 <=? (project request administrators)))
}
definition{
name: rule5,
parameters: [request : Request],
result: Bool,
body: ((project request state) =? (stateActivated))
}
definition{
name: rule6,
parameters: [request : Request],
result: Bool,
body: ((project request state) =? (stateSuspended))
}
definition{
name: rule7,
parameters: [request : Request],
result: Bool,
body: ((project request state) =? (stateRetired))
}
definition{
name: stepProvisional,
parameters: [request : Request],
result: Nat,
body: (if (rule1 request) then (answerActivated) else (answerProvisional))
}
definition{
name: stepActivated,
parameters: [request : Request],
result: Nat,
body: (if (rule2 request) then (answerSuspended) else (if (rule4 request) then (answerRetired) else (if (rule5 request) then (answerActivated) else (answerProvisional))))
}
definition{
name: stepSuspended,
parameters: [request : Request],
result: Nat,
body: (if (rule3 request) then (answerActivated) else (if (rule6 request) then (answerSuspended) else (answerProvisional)))
}
definition{
name: stepRetired,
parameters: [request : Request],
result: Nat,
body: (if (rule7 request) then (answerRetired) else (answerProvisional))
}
definition{
name: judge,
parameters: [request : Request],
result: Nat,
body: (if ((project request state) =? (stateProvisional)) then (stepProvisional request) else (if ((project request state) =? (stateActivated)) then (stepActivated request) else (if ((project request state) =? (stateSuspended)) then (stepSuspended request) else (if ((project request state) =? (stateRetired)) then (stepRetired request) else (answerProvisional)))))
}
definition{
name: encodeAnswer,
parameters: [code : Nat],
result: Bytes,
body: (if (code =? (answerProvisional)) then 0x70726f766973696f6e616c else (if (code =? (answerActivated)) then 0x616374697661746564 else (if (code =? (answerSuspended)) then 0x73757370656e646564 else (if (code =? (answerRetired)) then 0x72657469726564 else 0x696e76616c6964))))
}
definition{
name: dispatch,
parameters: [value : Bytes],
result: Bytes,
body: (if (136 <? (Foundation.Bytes::byteLength value)) then 0x696e76616c6964 else (match (decodeField1 value 0)
| Option.none => 0x696e76616c6964
| Option.some request => (encodeAnswer (judge request)))),
axioms: [Quot.sound, propext]
}
definition{
name: application,
parameters: [],
result: Foundation.View.Text.V1.Model::TextApplication,
body: (record Foundation.View.Text.V1.Model::TextApplication {profile := "prismpm/text-application/1", name := "Organization lifecycle", cargoName := "prism-foundry-org-lifecycle", cargoVersion := "0.1.0", cargoDescription := "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 cov", cargoRepository := "https://github.com/UOR-Foundation/PrismPM", cargoHomepage := "https://github.com/UOR-Foundation/PrismPM", libraryRoots := (cons "PrismFoundryOrgLifecycle.FoundryOrgLifecycle.dispatch" (nil String)), acceptanceVectors := (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c206163746976617465206f776e203220636f6d706c657465, response := 0x616374697661746564}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c206163746976617465206f776e203120636f6d706c657465, response := 0x70726f766973696f6e616c}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c206163746976617465206f776e2033207061727469616c, response := 0x70726f766973696f6e616c}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x6163746976617465642073757370656e64206f776e203220636f6d706c657465, response := 0x73757370656e646564}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x73757370656e6465642072656163746976617465206f776e203220636f6d706c657465, response := 0x616374697661746564}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x61637469766174656420726574697265206f74686572203520636f6d706c657465, response := 0x616374697661746564}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x61637469766174656420726574697265206f776e203220636f6d706c657465, response := 0x72657469726564}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x726574697265642072656163746976617465206f776e203920636f6d706c657465, response := 0x72657469726564}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c206163746976617465206f776e203020636f6d706c657465, response := 0x70726f766973696f6e616c}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c206163746976617465206f776e2030207061727469616c, response := 0x70726f766973696f6e616c}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c206163746976617465206f776e2032207061727469616c, response := 0x70726f766973696f6e616c}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c206163746976617465206f74686572203020636f6d706c657465, response := 0x70726f766973696f6e616c}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c206163746976617465206f746865722030207061727469616c, response := 0x70726f766973696f6e616c}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c206163746976617465206f74686572203220636f6d706c657465, response := 0x70726f766973696f6e616c}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c206163746976617465206f746865722032207061727469616c, response := 0x70726f766973696f6e616c}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c2073757370656e64206f776e203020636f6d706c657465, response := 0x70726f766973696f6e616c}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c2073757370656e64206f776e2030207061727469616c, response := 0x70726f766973696f6e616c}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c2073757370656e64206f776e203220636f6d706c657465, response := 0x70726f766973696f6e616c}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c2073757370656e64206f776e2032207061727469616c, response := 0x70726f766973696f6e616c}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c2073757370656e64206f74686572203020636f6d706c657465, response := 0x70726f766973696f6e616c}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c2073757370656e64206f746865722030207061727469616c, response := 0x70726f766973696f6e616c}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c2073757370656e64206f74686572203220636f6d706c657465, response := 0x70726f766973696f6e616c}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c2073757370656e64206f746865722032207061727469616c, response := 0x70726f766973696f6e616c}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c2072656163746976617465206f776e203020636f6d706c657465, response := 0x70726f766973696f6e616c}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c2072656163746976617465206f776e2030207061727469616c, response := 0x70726f766973696f6e616c}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c2072656163746976617465206f776e203220636f6d706c657465, response := 0x70726f766973696f6e616c}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c2072656163746976617465206f776e2032207061727469616c, response := 0x70726f766973696f6e616c}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c2072656163746976617465206f74686572203020636f6d706c657465, response := 0x70726f766973696f6e616c}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c2072656163746976617465206f746865722030207061727469616c, response := 0x70726f766973696f6e616c}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c2072656163746976617465206f74686572203220636f6d706c657465, response := 0x70726f766973696f6e616c}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c2072656163746976617465206f746865722032207061727469616c, response := 0x70726f766973696f6e616c}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x, response := 0x696e76616c6964}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0xff, response := 0x696e76616c6964}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c206163746976617465206f776e2030, response := 0x696e76616c6964}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c206163746976617465206f776e203020636f6d706c65746520636f6d706c657465, response := 0x696e76616c6964}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c2020616374697661746520206f776e2020302020636f6d706c657465, response := 0x696e76616c6964}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x756e6b6e6f776e206163746976617465206f776e203020636f6d706c657465, response := 0x696e76616c6964}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c20756e6b6e6f776e206f776e203020636f6d706c657465, response := 0x696e76616c6964}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c20616374697661746520756e6b6e6f776e203020636f6d706c657465, response := 0x696e76616c6964}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c206163746976617465206f776e20303720636f6d706c657465, response := 0x696e76616c6964}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c206163746976617465206f776e202d3120636f6d706c657465, response := 0x696e76616c6964}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c206163746976617465206f776e202b3120636f6d706c657465, response := 0x696e76616c6964}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c206163746976617465206f776e203130303030303030303030303030303030303020636f6d706c657465, response := 0x696e76616c6964}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c206163746976617465206f776e20d9a120636f6d706c657465, response := 0x696e76616c6964}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c206163746976617465206f776e207820636f6d706c657465, response := 0x696e76616c6964}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c206163746976617465206f776e20363520636f6d706c657465, response := 0x696e76616c6964}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x70726f766973696f6e616c206163746976617465206f776e203020756e6b6e6f776e, response := 0x696e76616c6964}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878, response := 0x696e76616c6964}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x7878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878, response := 0x696e76616c6964}) (cons (record Foundation.View.Text.V1.Model::AcceptanceVector {request := 0x7878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878, response := 0x696e76616c6964}) (nil Foundation.View.Text.V1.Model::AcceptanceVector))))))))))))))))))))))))))))))))))))))))))))))))))), entryRoot := "PrismFoundryOrgLifecycle.FoundryOrgLifecycle.dispatch", coreContract := "hologram:guest/core-wasm@1", requestMaximum := (136 : UInt32), responseMaximum := (64 : UInt32), guestAllocationMaximum := (272 : UInt32), capabilitiesEmpty := true, fatArchive := true, primaryLayer := (0 : UInt8), viewLayer := (1 : UInt8), view := (record Foundation.View.Text.V1.Model::TextView {title := "Organization lifecycle", heading := "Organization lifecycle", inputLabel := "Request: state event scope administrators coverage", submitLabel := "Decide", outputLabel := "Answer", inputError := "Invalid request", responseError := "Invalid response"})})
}
\end{semanticmodule}
\end{lexlean}
app/src/FoundryOrgLifecycleProofs.lex.tex 244 lines
\begin{lexlean}{FoundryOrgLifecycleProofs}
\useglossary{lexlean.std.bool@1.2.0}
\useglossary{lexlean.std.nat@1.2.0}
\useglossary{prism.arch@1.0.0}
\importmodule{FoundryOrgLifecycle}
\title{Text application model}
\begin{semanticmodule}
definition{
name: breaksInv001,
parameters: [request : FoundryOrgLifecycle::Request],
result: Bool,
body: (((((((((project request state) <? 4) && ((project request event) <? 4)) && ((project request scope) <? 2)) && ((project request administrators) <=? 64)) && ((project request coverage) <? 2)) && ((project request state) =? (FoundryOrgLifecycle::stateProvisional))) && ((project request administrators) <? 2)) && ((FoundryOrgLifecycle::judge request) =? (FoundryOrgLifecycle::answerActivated)))
}
theorem{
name: inv001Holds,
parameters: [request : FoundryOrgLifecycle::Request],
statement: ((breaksInv001 request) = false),
proof: linear_arithmetic{
definitions: [
FoundryOrgLifecycle::answerActivated,
FoundryOrgLifecycle::answerProvisional,
FoundryOrgLifecycle::answerRetired,
FoundryOrgLifecycle::answerSuspended,
FoundryOrgLifecycle::coverageComplete,
FoundryOrgLifecycle::coveragePartial,
FoundryOrgLifecycle::eventActivate,
FoundryOrgLifecycle::eventReactivate,
FoundryOrgLifecycle::eventRetire,
FoundryOrgLifecycle::eventSuspend,
FoundryOrgLifecycle::judge,
FoundryOrgLifecycle::rule1,
FoundryOrgLifecycle::rule2,
FoundryOrgLifecycle::rule3,
FoundryOrgLifecycle::rule4,
FoundryOrgLifecycle::rule5,
FoundryOrgLifecycle::rule6,
FoundryOrgLifecycle::rule7,
FoundryOrgLifecycle::scopeOther,
FoundryOrgLifecycle::scopeOwn,
FoundryOrgLifecycle::stateActivated,
FoundryOrgLifecycle::stateProvisional,
FoundryOrgLifecycle::stateRetired,
FoundryOrgLifecycle::stateSuspended,
FoundryOrgLifecycle::stepActivated,
FoundryOrgLifecycle::stepProvisional,
FoundryOrgLifecycle::stepRetired,
FoundryOrgLifecycle::stepSuspended,
breaksInv001
]
},
axioms: [Quot.sound, propext]
}
definition{
name: breaksInv002,
parameters: [request : FoundryOrgLifecycle::Request],
result: Bool,
body: (((((((((project request state) <? 4) && ((project request event) <? 4)) && ((project request scope) <? 2)) && ((project request administrators) <=? 64)) && ((project request coverage) <? 2)) && ((project request state) =? (FoundryOrgLifecycle::stateProvisional))) && ((project request coverage) =? (FoundryOrgLifecycle::coveragePartial))) && ((FoundryOrgLifecycle::judge request) =? (FoundryOrgLifecycle::answerActivated)))
}
theorem{
name: inv002Holds,
parameters: [request : FoundryOrgLifecycle::Request],
statement: ((breaksInv002 request) = false),
proof: linear_arithmetic{
definitions: [
FoundryOrgLifecycle::answerActivated,
FoundryOrgLifecycle::answerProvisional,
FoundryOrgLifecycle::answerRetired,
FoundryOrgLifecycle::answerSuspended,
FoundryOrgLifecycle::coverageComplete,
FoundryOrgLifecycle::coveragePartial,
FoundryOrgLifecycle::eventActivate,
FoundryOrgLifecycle::eventReactivate,
FoundryOrgLifecycle::eventRetire,
FoundryOrgLifecycle::eventSuspend,
FoundryOrgLifecycle::judge,
FoundryOrgLifecycle::rule1,
FoundryOrgLifecycle::rule2,
FoundryOrgLifecycle::rule3,
FoundryOrgLifecycle::rule4,
FoundryOrgLifecycle::rule5,
FoundryOrgLifecycle::rule6,
FoundryOrgLifecycle::rule7,
FoundryOrgLifecycle::scopeOther,
FoundryOrgLifecycle::scopeOwn,
FoundryOrgLifecycle::stateActivated,
FoundryOrgLifecycle::stateProvisional,
FoundryOrgLifecycle::stateRetired,
FoundryOrgLifecycle::stateSuspended,
FoundryOrgLifecycle::stepActivated,
FoundryOrgLifecycle::stepProvisional,
FoundryOrgLifecycle::stepRetired,
FoundryOrgLifecycle::stepSuspended,
breaksInv002
]
},
axioms: [Quot.sound, propext]
}
definition{
name: breaksInv003,
parameters: [request : FoundryOrgLifecycle::Request],
result: Bool,
body: (((((((((project request state) <? 4) && ((project request event) <? 4)) && ((project request scope) <? 2)) && ((project request administrators) <=? 64)) && ((project request coverage) <? 2)) && ((project request scope) =? (FoundryOrgLifecycle::scopeOther))) && ((project request state) =? (FoundryOrgLifecycle::stateActivated))) && ((FoundryOrgLifecycle::judge request) =? (FoundryOrgLifecycle::answerRetired)))
}
theorem{
name: inv003Holds,
parameters: [request : FoundryOrgLifecycle::Request],
statement: ((breaksInv003 request) = false),
proof: linear_arithmetic{
definitions: [
FoundryOrgLifecycle::answerActivated,
FoundryOrgLifecycle::answerProvisional,
FoundryOrgLifecycle::answerRetired,
FoundryOrgLifecycle::answerSuspended,
FoundryOrgLifecycle::coverageComplete,
FoundryOrgLifecycle::coveragePartial,
FoundryOrgLifecycle::eventActivate,
FoundryOrgLifecycle::eventReactivate,
FoundryOrgLifecycle::eventRetire,
FoundryOrgLifecycle::eventSuspend,
FoundryOrgLifecycle::judge,
FoundryOrgLifecycle::rule1,
FoundryOrgLifecycle::rule2,
FoundryOrgLifecycle::rule3,
FoundryOrgLifecycle::rule4,
FoundryOrgLifecycle::rule5,
FoundryOrgLifecycle::rule6,
FoundryOrgLifecycle::rule7,
FoundryOrgLifecycle::scopeOther,
FoundryOrgLifecycle::scopeOwn,
FoundryOrgLifecycle::stateActivated,
FoundryOrgLifecycle::stateProvisional,
FoundryOrgLifecycle::stateRetired,
FoundryOrgLifecycle::stateSuspended,
FoundryOrgLifecycle::stepActivated,
FoundryOrgLifecycle::stepProvisional,
FoundryOrgLifecycle::stepRetired,
FoundryOrgLifecycle::stepSuspended,
breaksInv003
]
},
axioms: [Quot.sound, propext]
}
definition{
name: breaksInv004,
parameters: [request : FoundryOrgLifecycle::Request],
result: Bool,
body: ((((((((project request state) <? 4) && ((project request event) <? 4)) && ((project request scope) <? 2)) && ((project request administrators) <=? 64)) && ((project request coverage) <? 2)) && ((project request state) =? (FoundryOrgLifecycle::stateSuspended))) && ((FoundryOrgLifecycle::judge request) =? (FoundryOrgLifecycle::answerRetired)))
}
theorem{
name: inv004Holds,
parameters: [request : FoundryOrgLifecycle::Request],
statement: ((breaksInv004 request) = false),
proof: linear_arithmetic{
definitions: [
FoundryOrgLifecycle::answerActivated,
FoundryOrgLifecycle::answerProvisional,
FoundryOrgLifecycle::answerRetired,
FoundryOrgLifecycle::answerSuspended,
FoundryOrgLifecycle::coverageComplete,
FoundryOrgLifecycle::coveragePartial,
FoundryOrgLifecycle::eventActivate,
FoundryOrgLifecycle::eventReactivate,
FoundryOrgLifecycle::eventRetire,
FoundryOrgLifecycle::eventSuspend,
FoundryOrgLifecycle::judge,
FoundryOrgLifecycle::rule1,
FoundryOrgLifecycle::rule2,
FoundryOrgLifecycle::rule3,
FoundryOrgLifecycle::rule4,
FoundryOrgLifecycle::rule5,
FoundryOrgLifecycle::rule6,
FoundryOrgLifecycle::rule7,
FoundryOrgLifecycle::scopeOther,
FoundryOrgLifecycle::scopeOwn,
FoundryOrgLifecycle::stateActivated,
FoundryOrgLifecycle::stateProvisional,
FoundryOrgLifecycle::stateRetired,
FoundryOrgLifecycle::stateSuspended,
FoundryOrgLifecycle::stepActivated,
FoundryOrgLifecycle::stepProvisional,
FoundryOrgLifecycle::stepRetired,
FoundryOrgLifecycle::stepSuspended,
breaksInv004
]
},
axioms: [Quot.sound, propext]
}
definition{
name: breaksInv005,
parameters: [request : FoundryOrgLifecycle::Request],
result: Bool,
body: ((((((((project request state) <? 4) && ((project request event) <? 4)) && ((project request scope) <? 2)) && ((project request administrators) <=? 64)) && ((project request coverage) <? 2)) && ((project request state) =? (FoundryOrgLifecycle::stateRetired))) && (not ((FoundryOrgLifecycle::judge request) =? (FoundryOrgLifecycle::answerRetired))))
}
theorem{
name: inv005Holds,
parameters: [request : FoundryOrgLifecycle::Request],
statement: ((breaksInv005 request) = false),
proof: linear_arithmetic{
definitions: [
FoundryOrgLifecycle::answerActivated,
FoundryOrgLifecycle::answerProvisional,
FoundryOrgLifecycle::answerRetired,
FoundryOrgLifecycle::answerSuspended,
FoundryOrgLifecycle::coverageComplete,
FoundryOrgLifecycle::coveragePartial,
FoundryOrgLifecycle::eventActivate,
FoundryOrgLifecycle::eventReactivate,
FoundryOrgLifecycle::eventRetire,
FoundryOrgLifecycle::eventSuspend,
FoundryOrgLifecycle::judge,
FoundryOrgLifecycle::rule1,
FoundryOrgLifecycle::rule2,
FoundryOrgLifecycle::rule3,
FoundryOrgLifecycle::rule4,
FoundryOrgLifecycle::rule5,
FoundryOrgLifecycle::rule6,
FoundryOrgLifecycle::rule7,
FoundryOrgLifecycle::scopeOther,
FoundryOrgLifecycle::scopeOwn,
FoundryOrgLifecycle::stateActivated,
FoundryOrgLifecycle::stateProvisional,
FoundryOrgLifecycle::stateRetired,
FoundryOrgLifecycle::stateSuspended,
FoundryOrgLifecycle::stepActivated,
FoundryOrgLifecycle::stepProvisional,
FoundryOrgLifecycle::stepRetired,
FoundryOrgLifecycle::stepSuspended,
breaksInv005
]
},
axioms: [Quot.sound, propext]
}
\end{semanticmodule}
\end{lexlean}
app/lexlean.toml 43 lines
spec = "lexlean/project/1"
name = "prism-foundry-org-lifecycle"
language = "1.2"
module_prefix = "PrismFoundryOrgLifecycle"
source_roots = ["src"]
entrypoints = ["src/Architecture.lex.tex", "src/Compliance.lex.tex", "src/Design.lex.tex", "src/Features.lex.tex", "src/FoundryOrgLifecycle.lex.tex", "src/FoundryOrgLifecycleProofs.lex.tex", "src/Quality.lex.tex", "src/Security.lex.tex"]
build_root = ".lexlean"
lockfile = "lexlean.lock"
lean_workspace = "."
lean_toolchain = "leanprover/lean4:v4.32.1"
[[lexicon_source]]
package = "lexlean.std.nat"
kind = "builtin"
[[lexicon_source]]
package = "prism.arch"
kind = "path"
path = "language/prism.arch"
[[lexicon_source]]
package = "prism.qual"
kind = "path"
path = "language/prism.qual"
[[lexicon_source]]
package = "prism.sec"
kind = "path"
path = "language/prism.sec"
[limits]
max_file_bytes = 4194304
max_total_source_bytes = 67108864
max_primitive_atoms = 2000000
max_token_lattice_edges = 4000000
max_parse_states = 4000000
max_ir_nodes = 2000000
max_scope_depth = 1024
max_import_depth = 128
max_diagnostics = 256
max_child_output_bytes = 16777216
child_timeout_ms = 300000
app/prompt.json 458 lines
{
"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": {}
}
model/ids.toml 71 lines
# model/ids.toml --- the conformance ID register.
#
# Every ID this repository claims, in one place, so that nothing is referenced
# without being defined. `CONFORMANCE.md` is generated from this file. A test
# whose name ends in an ID not listed here fails `check-model`, and an ID listed
# here with no scenario and no test fails it too (CM-02).
#
# `level` is the honesty level (R2):
# some-true a fact reproduced from an authority; not established here
# build constructed here and validated against its oracle
# open measured and reported, never asserted
#
# Every row here has a scenario in `features/suites/` and a test whose name ends
# in the ID, lowercased with underscores (R3, CM-02). There is no "pending"
# state: a capability that is not built does not get a row, and every row in this
# file is built.
#
# The first row is the template's own Prism application in `app/` (TC-01).
# A capability starts with a row here; `just new-capability` writes the row,
# its scenario and its failing test in the order `AGENTS.md` sets out.
spec = "template/1"
[[id]]
id = "FO-01"
level = "build"
suite = "foundry_org_lifecycle"
statement = "The app never answers activated when state is provisional and administrators is below 2"
[[id]]
id = "FO-02"
level = "build"
suite = "foundry_org_lifecycle"
statement = "The app never answers activated when state is provisional and coverage is partial"
[[id]]
id = "FO-03"
level = "build"
suite = "foundry_org_lifecycle"
statement = "The app never answers retired when scope is other and state is activated"
[[id]]
id = "FO-04"
level = "build"
suite = "foundry_org_lifecycle"
statement = "The app never answers retired when state is suspended"
[[id]]
id = "FO-05"
level = "build"
suite = "foundry_org_lifecycle"
statement = "The app always answers retired when state is retired"
[[id]]
id = "FO-06"
level = "build"
suite = "foundry_org_lifecycle"
statement = "The architecture description declares every stakeholder, concern, component, edge, viewpoint and view it references"
[[id]]
id = "FO-07"
level = "build"
suite = "foundry_org_lifecycle"
statement = "The ISO/IEC 25010 quality model numbers every characteristic, subcharacteristic, requirement and measure, and every parent it names is declared"
[[id]]
id = "FO-08"
level = "build"
suite = "foundry_org_lifecycle"
statement = "Every compliance obligation is numbered in order and names its evidence"
features/suites/foundry_org_lifecycle.feature 50 lines
Feature: foundry_org_lifecycle
This repository's Prism application, in app/, generated by prism-code from its
spec: 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.
@FO-01 @build
Scenario: The app never answers activated when state is provisional and administrators is below 2
Given the model in app/src/FoundryOrgLifecycle.lex.tex
When the Lean kernel checks inv001Holds during prismpm verify
Then no request meets breaksInv001
@FO-02 @build
Scenario: The app never answers activated when state is provisional and coverage is partial
Given the model in app/src/FoundryOrgLifecycle.lex.tex
When the Lean kernel checks inv002Holds during prismpm verify
Then no request meets breaksInv002
@FO-03 @build
Scenario: The app never answers retired when scope is other and state is activated
Given the model in app/src/FoundryOrgLifecycle.lex.tex
When the Lean kernel checks inv003Holds during prismpm verify
Then no request meets breaksInv003
@FO-04 @build
Scenario: The app never answers retired when state is suspended
Given the model in app/src/FoundryOrgLifecycle.lex.tex
When the Lean kernel checks inv004Holds during prismpm verify
Then no request meets breaksInv004
@FO-05 @build
Scenario: The app always answers retired when state is retired
Given the model in app/src/FoundryOrgLifecycle.lex.tex
When the Lean kernel checks inv005Holds during prismpm verify
Then no request meets breaksInv005
@FO-06 @build
Scenario: The architecture description declares every stakeholder, concern, component, edge, viewpoint and view it references
Given the model in app/src/Architecture.lex.tex
When the Lean kernel checks architectureDescriptionHolds during prismpm verify
Then the architecture description declares every stakeholder, concern, component, edge, viewpoint and view it references
@FO-07 @build
Scenario: The ISO/IEC 25010 quality model numbers every characteristic, subcharacteristic, requirement and measure, and every parent it names is declared
Given the model in app/src/Quality.lex.tex
When the Lean kernel checks qualityModelHolds during prismpm verify
Then the ISO/IEC 25010 quality model numbers every characteristic, subcharacteristic, requirement and measure, and every parent it names is declared
@FO-08 @build
Scenario: Every compliance obligation is numbered in order and names its evidence
Given the model in app/src/Compliance.lex.tex
When the Lean kernel checks everyObligationEvidenced during prismpm verify
Then every compliance obligation is numbered in order and names its evidence
crates/conformance/tests/foundry_org_lifecycle.rs 142 lines
//! The `foundry_org_lifecycle` suite: one test per scenario in `features/suites/foundry_org_lifecycle.feature`.
//!
//! Written by the Prism-DevRel builder from the app's prompt. The theorems are
//! checked by the Lean kernel when `just vv` runs `prismpm verify` on `app/`.
//! What these tests hold fixed is what each theorem is about, so a weakened
//! statement that still verifies fails the gate.
use std::path::PathBuf;
fn root() -> PathBuf {
PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.ancestors()
.nth(2)
.expect("crates/conformance is two below the root")
.to_path_buf()
}
/// The body of the top-level declaration named `name`, up to its closing brace.
fn declaration<'a>(model: &'a str, name: &str) -> &'a str {
let start = model
.find(&format!("\n name: {name},\n"))
.unwrap_or_else(|| panic!("{name} is not declared"));
let end = model[start..]
.find("\n}\n")
.unwrap_or_else(|| panic!("{name} is not closed"));
&model[start..start + end]
}
fn module(path: &str) -> String {
std::fs::read_to_string(root().join(path)).expect("the module")
}
/// The condition no request may meet, and the theorem that says none does.
fn pinned(breaks: &str, condition: &str, theorem: &str) {
let model = module("app/src/FoundryOrgLifecycleProofs.lex.tex");
let found = declaration(&model, breaks);
assert!(
found.contains(condition),
"the condition of {breaks} changed:\n{found}"
);
let holds = declaration(&model, theorem);
let statement = format!("statement: (({breaks} request) = false),");
assert!(
holds.contains(&statement),
"{theorem} must state that no request meets {breaks}:\n{holds}"
);
}
/// A facet theorem: proved by `decide`, about exactly this predicate.
fn holds(path: &str, theorem: &str, statement: &str) {
let model = module(path);
let found = declaration(&model, theorem);
assert!(
found.contains(&format!("statement: {statement},")),
"{theorem} must state {statement}:\n{found}"
);
assert!(
found.contains("proof: decide{}"),
"{theorem} is proved by decide"
);
}
/// `FO-01`: The app never answers activated when state is provisional and administrators is below 2
#[test]
fn foundry_org_lifecycle_fo_01() {
pinned(
"breaksInv001",
"body: (((((((((project request state) <? 4) && ((project request event) <? 4)) && ((project request scope) <? 2)) && ((project request administrators) <=? 64)) && ((project request coverage) <? 2)) && ((project request state) =? (FoundryOrgLifecycle::stateProvisional))) && ((project request administrators) <? 2)) && ((FoundryOrgLifecycle::judge request) =? (FoundryOrgLifecycle::answerActivated)))",
"inv001Holds",
);
}
/// `FO-02`: The app never answers activated when state is provisional and coverage is partial
#[test]
fn foundry_org_lifecycle_fo_02() {
pinned(
"breaksInv002",
"body: (((((((((project request state) <? 4) && ((project request event) <? 4)) && ((project request scope) <? 2)) && ((project request administrators) <=? 64)) && ((project request coverage) <? 2)) && ((project request state) =? (FoundryOrgLifecycle::stateProvisional))) && ((project request coverage) =? (FoundryOrgLifecycle::coveragePartial))) && ((FoundryOrgLifecycle::judge request) =? (FoundryOrgLifecycle::answerActivated)))",
"inv002Holds",
);
}
/// `FO-03`: The app never answers retired when scope is other and state is activated
#[test]
fn foundry_org_lifecycle_fo_03() {
pinned(
"breaksInv003",
"body: (((((((((project request state) <? 4) && ((project request event) <? 4)) && ((project request scope) <? 2)) && ((project request administrators) <=? 64)) && ((project request coverage) <? 2)) && ((project request scope) =? (FoundryOrgLifecycle::scopeOther))) && ((project request state) =? (FoundryOrgLifecycle::stateActivated))) && ((FoundryOrgLifecycle::judge request) =? (FoundryOrgLifecycle::answerRetired)))",
"inv003Holds",
);
}
/// `FO-04`: The app never answers retired when state is suspended
#[test]
fn foundry_org_lifecycle_fo_04() {
pinned(
"breaksInv004",
"body: ((((((((project request state) <? 4) && ((project request event) <? 4)) && ((project request scope) <? 2)) && ((project request administrators) <=? 64)) && ((project request coverage) <? 2)) && ((project request state) =? (FoundryOrgLifecycle::stateSuspended))) && ((FoundryOrgLifecycle::judge request) =? (FoundryOrgLifecycle::answerRetired)))",
"inv004Holds",
);
}
/// `FO-05`: The app always answers retired when state is retired
#[test]
fn foundry_org_lifecycle_fo_05() {
pinned(
"breaksInv005",
"body: ((((((((project request state) <? 4) && ((project request event) <? 4)) && ((project request scope) <? 2)) && ((project request administrators) <=? 64)) && ((project request coverage) <? 2)) && ((project request state) =? (FoundryOrgLifecycle::stateRetired))) && (not ((FoundryOrgLifecycle::judge request) =? (FoundryOrgLifecycle::answerRetired))))",
"inv005Holds",
);
}
/// `FO-06`: The architecture description declares every stakeholder, concern, component, edge, viewpoint and view it references
#[test]
fn foundry_org_lifecycle_fo_06() {
holds(
"app/src/Architecture.lex.tex",
"architectureDescriptionHolds",
"((architectureValid) = true)",
);
}
/// `FO-07`: The ISO/IEC 25010 quality model numbers every characteristic, subcharacteristic, requirement and measure, and every parent it names is declared
#[test]
fn foundry_org_lifecycle_fo_07() {
holds(
"app/src/Quality.lex.tex",
"qualityModelHolds",
"((qualityValid) = true)",
);
}
/// `FO-08`: Every compliance obligation is numbered in order and names its evidence
#[test]
fn foundry_org_lifecycle_fo_08() {
holds(
"app/src/Compliance.lex.tex",
"everyObligationEvidenced",
"((obligationsEvidenced 0 (obligations)) = true)",
);
}
site/app.json 125 lines
{
"name": "Organization lifecycle",
"shortName": "Organization",
"live": "https://uor-foundation.github.io/uor-foundry/",
"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. Send state, event, scope, administrators or coverage, separated by spaces; it answers provisional, activated, suspended or retired, and invalid request for anything else.",
"inputLabel": "Request: state event scope administrators coverage",
"placeholder": "provisional activate own 2 complete",
"submitLabel": "Decide",
"outputLabel": "Answer",
"answers": {
"positive": [
"provisional"
],
"negative": [
"activated",
"suspended",
"retired"
],
"refusal": "invalid request"
},
"promise": {
"headline": "Says conformant exactly when every policy file matches its lock.",
"detail": "Each of the six universal policy files is compared with the digest the lock records, and any file that drifted is named."
},
"claim": "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.",
"proposition": {
"name": "judge",
"text": "judge request :=\n state is provisional and event is activate and scope is own and administrators is at least 2 and coverage is complete → activated\n state is activated and event is suspend and scope is own and administrators is at least 2 → suspended\n state is suspended and event is reactivate and scope is own and administrators is at least 2 → activated\n state is activated and event is retire and scope is own and administrators is at least 2 → retired\n state is activated → activated\n state is suspended → suspended\n state is retired → retired\n otherwise → provisional",
"plain": "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."
},
"theorems": [
{
"name": "inv001Holds",
"statement": "no request meets breaksInv001: the app never answers activated when state is provisional and administrators is below 2",
"how": "Proved by linear arithmetic, checked by the Lean kernel on the UOR MCP server and again by prismpm verify in CI",
"where": "app/src/FoundryOrgLifecycleProofs.lex.tex"
},
{
"name": "inv002Holds",
"statement": "no request meets breaksInv002: the app never answers activated when state is provisional and coverage is partial",
"how": "Proved by linear arithmetic, checked by the Lean kernel on the UOR MCP server and again by prismpm verify in CI",
"where": "app/src/FoundryOrgLifecycleProofs.lex.tex"
},
{
"name": "inv003Holds",
"statement": "no request meets breaksInv003: the app never answers retired when scope is other and state is activated",
"how": "Proved by linear arithmetic, checked by the Lean kernel on the UOR MCP server and again by prismpm verify in CI",
"where": "app/src/FoundryOrgLifecycleProofs.lex.tex"
},
{
"name": "inv004Holds",
"statement": "no request meets breaksInv004: the app never answers retired when state is suspended",
"how": "Proved by linear arithmetic, checked by the Lean kernel on the UOR MCP server and again by prismpm verify in CI",
"where": "app/src/FoundryOrgLifecycleProofs.lex.tex"
},
{
"name": "inv005Holds",
"statement": "no request meets breaksInv005: the app always answers retired when state is retired",
"how": "Proved by linear arithmetic, checked by the Lean kernel on the UOR MCP server and again by prismpm verify in CI",
"where": "app/src/FoundryOrgLifecycleProofs.lex.tex"
}
],
"pinned": [
{
"name": "foundry_org_lifecycle_fo_01",
"what": "FO-01's condition and the theorem that no request meets it. A string-matching test, not a theorem: a planted defect fails it.",
"where": "crates/conformance/tests/foundry_org_lifecycle.rs"
},
{
"name": "foundry_org_lifecycle_fo_02",
"what": "FO-02's condition and the theorem that no request meets it. A string-matching test, not a theorem: a planted defect fails it.",
"where": "crates/conformance/tests/foundry_org_lifecycle.rs"
},
{
"name": "foundry_org_lifecycle_fo_03",
"what": "FO-03's condition and the theorem that no request meets it. A string-matching test, not a theorem: a planted defect fails it.",
"where": "crates/conformance/tests/foundry_org_lifecycle.rs"
},
{
"name": "foundry_org_lifecycle_fo_04",
"what": "FO-04's condition and the theorem that no request meets it. A string-matching test, not a theorem: a planted defect fails it.",
"where": "crates/conformance/tests/foundry_org_lifecycle.rs"
},
{
"name": "foundry_org_lifecycle_fo_05",
"what": "FO-05's condition and the theorem that no request meets it. A string-matching test, not a theorem: a planted defect fails it.",
"where": "crates/conformance/tests/foundry_org_lifecycle.rs"
}
],
"trusted": [
{
"name": "SDK image",
"value": "the digest prismpm.lock pins; see the bootstrap workflow's log"
},
{
"name": "Lean toolchain",
"value": "leanprover/lean4:v4.32.1"
},
{
"name": "LexLean compiler semantics",
"value": "5262e5b4c8b5668ae7066ad686757a6bb7f80c941d515fb9d586894fbc7de69a"
},
{
"name": "prism-code runtime, vendored",
"value": "0.2.0, see try/vendor/prism-code/VENDOR.md"
},
{
"name": "Your browser",
"value": "runs the WebAssembly guest and this page"
}
],
"attestations": {
"proof": {
"id": "not recorded: the proof ran in the SDK image, not on the UOR MCP server",
"url": "https://github.com/UOR-Foundation/uor-foundry/actions/workflows/bootstrap.yml"
},
"build": {
"id": "printed by prismpm verify in every pages run",
"url": "https://github.com/UOR-Foundation/uor-foundry/actions/workflows/pages.yml"
}
},
"repository": "https://github.com/UOR-Foundation/uor-foundry",
"report": "https://github.com/UOR-Foundation/uor-foundry/blob/main/TEMPLATE-VERIFICATION.md"
}
openspec/specs/foundry-org-lifecycle/spec.md 220 lines
# foundry-org-lifecycle Specification
<!-- Generated by Prism from prism/spec.json. Change the app through your agent with /prism, not by editing this file. -->
## Purpose
Organization lifecycle: 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.
## Requirements
### Requirement: Never activated when state is provisional and administrators is below 2
The app SHALL NOT answer `activated` when state is provisional and administrators is below 2, because a sole founding administrator is a bootstrap condition, not accepted redundancy.
Verified: to be proved by Lean for every request (INV-001, theorem `inv001Holds`).
#### Scenario: INV-001 holds
- **WHEN** the request is `provisional activate own 1 complete` (an acceptance example)
- **THEN** the answer SHALL NOT be `activated`
- **AND** the app answers `provisional`, decided by the fallback
### Requirement: Never activated when state is provisional and coverage is partial
The app SHALL NOT answer `activated` when state is provisional and coverage is partial, because activation needs complete administrative coverage of the organization's parts.
Verified: to be proved by Lean for every request (INV-002, theorem `inv002Holds`).
#### Scenario: INV-002 holds
- **WHEN** the request is `provisional activate own 3 partial` (an acceptance example)
- **THEN** the answer SHALL NOT be `activated`
- **AND** the app answers `provisional`, decided by the fallback
### Requirement: Never retired when scope is other and state is activated
The app SHALL NOT answer `retired` when scope is other and state is activated, because creation never gives authority over another organization.
Verified: to be proved by Lean for every request (INV-003, theorem `inv003Holds`).
#### Scenario: INV-003 holds
- **WHEN** the request is `activated retire other 5 complete` (an acceptance example)
- **THEN** the answer SHALL NOT be `retired`
- **AND** the app answers `activated`, decided by REQ-005
### Requirement: Never retired when state is suspended
The app SHALL NOT answer `retired` when state is suspended, because retirement is allowed only from activated.
Verified: to be proved by Lean for every request (INV-004, theorem `inv004Holds`).
#### Scenario: INV-004 holds
- **WHEN** the request is `suspended reactivate own 2 complete` (an acceptance example)
- **THEN** the answer SHALL NOT be `retired`
- **AND** the app answers `activated`, decided by REQ-003
### Requirement: Always retired when state is retired
The app SHALL answer `retired` when state is retired, because retired is a final state (UML 2.5.1 FinalState): a run that reaches it stays there.
Verified: to be proved by Lean for every request (INV-005, theorem `inv005Holds`).
#### Scenario: INV-005 holds
- **WHEN** the request is `retired reactivate own 9 complete` (an acceptance example)
- **THEN** the answer SHALL be `retired`
- **AND** the app answers `retired`, decided by REQ-007
### Requirement: REQ-001 activated when state is provisional and event is activate and scope is own and administrators is at least 2 and coverage is complete
The app SHALL answer `activated` when state is provisional and event is activate and scope is own and administrators is at least 2 and coverage is complete, because 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.
Verified: tested by the acceptance vectors (`rule1`).
#### Scenario: REQ-001 decides
- **WHEN** the request is `provisional activate own 2 complete` (an acceptance example)
- **THEN** the answer SHALL be `activated`, decided by REQ-001
### Requirement: REQ-002 suspended when state is activated and event is suspend and scope is own and administrators is at least 2
The app SHALL answer `suspended` when state is activated and event is suspend and scope is own and administrators is at least 2 and no earlier rule matches, because model/organization_lifecycle.toml: an activated organization may be suspended by authorized distinct administrators (minimum 2).
Verified: tested by the acceptance vectors (`rule2`).
#### Scenario: REQ-002 decides
- **WHEN** the request is `activated suspend own 2 complete` (an acceptance example)
- **THEN** the answer SHALL be `suspended`, decided by REQ-002
### Requirement: REQ-003 activated when state is suspended and event is reactivate and scope is own and administrators is at least 2
The app SHALL answer `activated` when state is suspended and event is reactivate and scope is own and administrators is at least 2 and no earlier rule matches, because model/organization_lifecycle.toml: a suspended organization may be reactivated (minimum 2 distinct administrators).
Verified: tested by the acceptance vectors (`rule3`).
#### Scenario: REQ-003 decides
- **WHEN** the request is `suspended reactivate own 2 complete` (an acceptance example)
- **THEN** the answer SHALL be `activated`, decided by REQ-003
### Requirement: REQ-004 retired when state is activated and event is retire and scope is own and administrators is at least 2
The app SHALL answer `retired` when state is activated and event is retire and scope is own and administrators is at least 2 and no earlier rule matches, because model/organization_lifecycle.toml: an activated organization may be retired, keeping its audit logs (minimum 2 distinct administrators).
Verified: tested by the acceptance vectors (`rule4`).
#### Scenario: REQ-004 decides
- **WHEN** the request is `activated retire own 2 complete` (an acceptance example)
- **THEN** the answer SHALL be `retired`, decided by REQ-004
### Requirement: REQ-005 activated when state is activated
The app SHALL answer `activated` when state is activated and no earlier rule matches, because model/organization_lifecycle.toml: allowed_transitions lists no other move out of activated.
Verified: tested by the acceptance vectors (`rule5`).
#### Scenario: REQ-005 decides
- **WHEN** the request is `activated retire other 5 complete` (an acceptance example)
- **THEN** the answer SHALL be `activated`, decided by REQ-005
### Requirement: REQ-006 suspended when state is suspended
The app SHALL answer `suspended` when state is suspended and no earlier rule matches, because model/organization_lifecycle.toml: allowed_transitions lists only reactivation out of suspended.
Verified: tested by the acceptance vectors (`rule6`).
#### Scenario: REQ-006 decides
- **WHEN** the request is `suspended activate own 0 complete`
- **THEN** the answer SHALL be `suspended`, decided by REQ-006
### Requirement: REQ-007 retired when state is retired
The app SHALL answer `retired` when state is retired and no earlier rule matches, because model/organization_lifecycle.toml: allowed_transitions lists no move out of retired.
Verified: tested by the acceptance vectors (`rule7`).
#### Scenario: REQ-007 decides
- **WHEN** the request is `retired reactivate own 9 complete` (an acceptance example)
- **THEN** the answer SHALL be `retired`, decided by REQ-007
### Requirement: Otherwise provisional
The app SHALL answer `provisional` when no rule matches, because model/organization_lifecycle.toml: allow_sole_founding_admin_in_provisional; a provisional organization without quorum and coverage stays provisional.
Verified: tested by the acceptance vectors.
#### Scenario: No rule matches
- **WHEN** the request is `provisional activate own 1 complete` (an acceptance example)
- **THEN** the answer SHALL be `provisional`
### Requirement: The first matching rule decides
The app SHALL try REQ-001, REQ-002, REQ-003, REQ-004, REQ-005, REQ-006, REQ-007 in that order, and the first rule that matches SHALL decide.
Verified: tested by the acceptance vectors.
#### Scenario: Two rules match
- **WHEN** the request is `activated suspend own 2 complete` (an acceptance example)
- **THEN** the answer SHALL be `suspended`, decided by REQ-002, the earlier rule
### Requirement: Request and answers
The app SHALL read one request as one line of 5 fields separated by single spaces, in this order, and SHALL answer exactly one of `provisional`, `activated`, `suspended`, `retired`, or `invalid` for anything else.
| Field | Accepts | Means |
| --- | --- | --- |
| `state` | `provisional`, `activated`, `suspended`, `retired` | the organization's lifecycle state now |
| `event` | `activate`, `suspend`, `reactivate`, `retire` | the lifecycle transition requested |
| `scope` | `own`, `other` | whether the approving administrators belong to this organization or another one |
| `administrators` | whole number from 0 up to 64 | distinct users approving; aliases, extra keys and duplicate approvals count once |
| `coverage` | `complete`, `partial` | whether administrators cover every part of the organization |
| Answer | Means |
| --- | --- |
| `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 |
| `invalid` | the request is malformed |
Verified: reading a request is tested, not proved.
#### Scenario: A malformed request is invalid
- **WHEN** the request is not 5 fields in this order
- **THEN** the answer SHALL be `invalid`
## Examples
- `provisional activate own 2 complete` gives `activated`
- `provisional activate own 1 complete` gives `provisional`
- `provisional activate own 3 partial` gives `provisional`
- `activated suspend own 2 complete` gives `suspended`
- `suspended reactivate own 2 complete` gives `activated`
- `activated retire other 5 complete` gives `activated`
- `activated retire own 2 complete` gives `retired`
- `retired reactivate own 9 complete` gives `retired`
## What is proved and what is tested
Lean proves each property marked proved above, for every request that decodes, with no exceptions and no sampling. The proof is about `judge`, the function the WebAssembly guest runs, because both come from the same model.
The parsing of requests is tested, not proved: the acceptance vectors in the app replay through the built guest, including malformed and oversized requests.
Nothing here says the rules are the right rules. That is the part only you can judge.
## Files
- `prism/spec.json` is this spec as data.
- `src/FoundryOrgLifecycle.lex.tex` is the LexLean model generated from it. It is the single source of the app.
Words on this page 6
- record
- One entry in a facet: a component, a threat, a measure or a journey step, with the place in the source it came from.
- Lean kernel
- The small checker at the heart of the Lean prover. It accepts a proof only if every step follows the rules.
- theorem
- A statement about the model that the Lean kernel has checked, so it holds for every input, not only the ones tested.
- SDK
- Software development kit. Here, the PrismPM container image that builds, checks and verifies Prism models.
- stakeholder
- A person or group with an interest in the system, as ISO/IEC/IEEE 42010 defines it.
- state machine
- A model of something that is always in one state and moves between states on events, as in UML 2.5.1.