# Prism source

Every app the builder writes carries these 62 files unchanged beside its own model, each byte for byte a file of UOR-Foundation/template or UOR-Foundation/PrismPM at a pinned commit (builder/assets/provenance.json).

**Figure: What every app carries.** The files the builder copies into every app, by kind. None of them changes from app to app.

|  | files |
| --- | --- |
| LexLean modules | 6 |
| Language packages | 3 |
| Language entries | 52 |
| prism-code modules | 5 |

## LexLean modules

| Module | File | Declares | Imports | From |
| --- | --- | --- | --- | --- |
| Foundation.Arch | app/src/Foundation/Arch.lex.tex | 22 structures, 7 inductives, 2 classes, 2 instances, 10 definitions, 1 theorem | lexlean.std.bool@1.2.0, lexlean.std.nat@1.2.0, prism.arch@1.0.0 | https://github.com/UOR-Foundation/PrismPM/blob/3db7f3e6be768f4e1347e5717e9f805492573d05/tests/negative/threat-model/unmapped-threat/project/src/Foundation/Arch.lex.tex |
| Foundation.Bytes | app/src/Foundation/Bytes.lex.tex | 2 inductives, 1 structure, 5 definitions | lexlean.std.bool@1.2.0, lexlean.std.nat@1.2.0, prism.arch@1.0.0 | https://github.com/UOR-Foundation/template/blob/e79e0dcd7b95189f588c9ef2bebf5606b9ce3eb0/app/src/Foundation/Bytes.lex.tex |
| Foundation.Qual | app/src/Foundation/Qual.lex.tex | 4 structures, 8 definitions | lexlean.std.bool@1.2.0, lexlean.std.nat@1.2.0, prism.qual@1.0.0 | https://github.com/UOR-Foundation/PrismPM/blob/3db7f3e6be768f4e1347e5717e9f805492573d05/tests/negative/threat-model/unmapped-threat/project/src/Foundation/Qual.lex.tex |
| Foundation.Sec | app/src/Foundation/Sec.lex.tex | 2 inductives, 5 structures, 6 definitions | lexlean.std.bool@1.2.0, lexlean.std.nat@1.2.0, prism.sec@1.0.0 | https://github.com/UOR-Foundation/PrismPM/blob/3db7f3e6be768f4e1347e5717e9f805492573d05/tests/negative/threat-model/unmapped-threat/project/src/Foundation/Sec.lex.tex |
| Foundation.View.Text.V1.Model | app/src/Foundation/View/Text/V1/Model.lex.tex | 3 structures, 1 definition | lexlean.std.bool@1.2.0, lexlean.std.nat@1.2.0, prism.arch@1.0.0 | https://github.com/UOR-Foundation/template/blob/e79e0dcd7b95189f588c9ef2bebf5606b9ce3eb0/app/src/Foundation/View/Text/V1/Model.lex.tex |
| Production.ThreatModel | app/src/Production/ThreatModel.lex.tex | 2 inductives, 8 structures, 8 definitions, 5 theorems | Foundation.Sec, lexlean.std.bool@1.2.0, lexlean.std.nat@1.2.0, prism.arch@1.0.0, prism.sec@1.0.0 | https://github.com/UOR-Foundation/PrismPM/blob/3db7f3e6be768f4e1347e5717e9f805492573d05/tests/negative/threat-model/unmapped-threat/project/src/Production/ThreatModel.lex.tex |

### Foundation.Arch

Source: files/app/src/Foundation/Arch.lex.tex, from https://github.com/UOR-Foundation/PrismPM/blob/3db7f3e6be768f4e1347e5717e9f805492573d05/tests/negative/threat-model/unmapped-threat/project/src/Foundation/Arch.lex.tex

| Declaration | Kind | Word |
| --- | --- | --- |
| Foundation.Arch::StandardReference | structure | standards reference |
| Foundation.Arch::ComponentKind | inductive | architectural component kind |
| Foundation.Arch::EdgeKind | inductive | architectural edge kind |
| Foundation.Arch::ModelKind | inductive | architecture model kind |
| Foundation.Arch::Component | structure | architectural component |
| Foundation.Arch::Edge | structure | architectural edge |
| Foundation.Arch::Stakeholder | structure | stakeholder |
| Foundation.Arch::Concern | structure | architectural concern |
| Foundation.Arch::Viewpoint | structure | architecture viewpoint |
| Foundation.Arch::View | structure | architecture view |
| Foundation.Arch::ViewpointClass | class | architecture viewpoint class |
| Foundation.Arch::ViewClass | class | architecture view class |
| Foundation.Arch::canonicalViewpoint | instance |  |
| Foundation.Arch::canonicalView | instance |  |
| Foundation.Arch::componentGateway | definition |  |
| Foundation.Arch::componentAuth | definition |  |
| Foundation.Arch::edgeIngress | definition |  |
| Foundation.Arch::edgeReturnCycle | definition |  |
| Foundation.Arch::stakeholderOperator | definition |  |
| Foundation.Arch::concernSecurity | definition |  |
| Foundation.Arch::standardArchitectureDescription | definition |  |
| Foundation.Arch::modelKindComponents | definition |  |
| Foundation.Arch::viewpointOperations | definition |  |
| Foundation.Arch::viewPrimary | definition |  |
| Foundation.Arch::DesignDiagram | inductive | design diagram |
| Foundation.Arch::OpmThingKind | inductive | OPM thing kind |
| Foundation.Arch::OpmLinkKind | inductive | OPM link kind |
| Foundation.Arch::UmlMessageKind | inductive | UML message kind |
| Foundation.Arch::SystemProcess | structure | system process |
| Foundation.Arch::SystemState | structure | system state |
| Foundation.Arch::DesignView | structure | design view |
| Foundation.Arch::OpmThing | structure | OPM thing |
| Foundation.Arch::OpmState | structure | OPM state |
| Foundation.Arch::OpmLink | structure | OPM link |
| Foundation.Arch::OpmZoom | structure | OPM zoom |
| Foundation.Arch::UmlComponent | structure | UML component |
| Foundation.Arch::UmlConnector | structure | UML connector |
| Foundation.Arch::UmlLifeline | structure | UML lifeline |
| Foundation.Arch::UmlMessage | structure | UML message |
| Foundation.Arch::UmlState | structure | UML state |
| Foundation.Arch::UmlTransition | structure | UML transition |
| Foundation.Arch::Feature | structure | feature |
| Foundation.Arch::Journey | structure | journey |
| Foundation.Arch::componentIdentityUnique | theorem |  |

### Foundation.Bytes

Source: files/app/src/Foundation/Bytes.lex.tex, from https://github.com/UOR-Foundation/template/blob/e79e0dcd7b95189f588c9ef2bebf5606b9ce3eb0/app/src/Foundation/Bytes.lex.tex

| Declaration | Kind | Word |
| --- | --- | --- |
| Foundation.Bytes::ByteOrder | inductive |  |
| Foundation.Bytes::BufferError | inductive |  |
| Foundation.Bytes::BoundedBuffer | structure | Bounded byte buffer |
| Foundation.Bytes::appendBytes | definition |  |
| Foundation.Bytes::byteLength | definition |  |
| Foundation.Bytes::byteAt | definition |  |
| Foundation.Bytes::sliceBytes | definition |  |
| Foundation.Bytes::compareBytes | definition |  |

### Foundation.Qual

Source: files/app/src/Foundation/Qual.lex.tex, from https://github.com/UOR-Foundation/PrismPM/blob/3db7f3e6be768f4e1347e5717e9f805492573d05/tests/negative/threat-model/unmapped-threat/project/src/Foundation/Qual.lex.tex

| Declaration | Kind | Word |
| --- | --- | --- |
| Foundation.Qual::ProductQualityCharacteristic | structure | quality characteristic |
| Foundation.Qual::QualitySubcharacteristic | structure | quality subcharacteristic |
| Foundation.Qual::QualityRequirement | structure | quality requirement |
| Foundation.Qual::QualityMeasure | structure | quality measure |
| Foundation.Qual::characteristicInteractionCapability | definition |  |
| Foundation.Qual::characteristicMaintainability | definition |  |
| Foundation.Qual::subcharacteristicInclusivity | definition |  |
| Foundation.Qual::subcharacteristicModularity | definition |  |
| Foundation.Qual::requirementModuleBoundaries | definition |  |
| Foundation.Qual::requirementWcag1411ForcedColorsNonTextContrast | definition |  |
| Foundation.Qual::requirementWcag413StatusMessages | definition |  |
| Foundation.Qual::measureDependencyCount | definition |  |

### Foundation.Sec

Source: files/app/src/Foundation/Sec.lex.tex, from https://github.com/UOR-Foundation/PrismPM/blob/3db7f3e6be768f4e1347e5717e9f805492573d05/tests/negative/threat-model/unmapped-threat/project/src/Foundation/Sec.lex.tex

| Declaration | Kind | Word |
| --- | --- | --- |
| Foundation.Sec::Likelihood | inductive | security likelihood |
| Foundation.Sec::Impact | inductive | security impact |
| Foundation.Sec::Asset | structure | security asset |
| Foundation.Sec::Risk | structure | security risk |
| Foundation.Sec::ApplicationSecurityControl | structure | security control |
| Foundation.Sec::SecurityActivity | structure | security activity |
| Foundation.Sec::VerificationMeasurement | structure | security verification measurement |
| Foundation.Sec::assetCredentials | definition |  |
| Foundation.Sec::threatUnauthorizedAccess | definition |  |
| Foundation.Sec::riskUnauthorizedAccess | definition |  |
| Foundation.Sec::controlMutualTls | definition |  |
| Foundation.Sec::activityRotateCredentials | definition |  |
| Foundation.Sec::measurementMutualTls | definition |  |

### Foundation.View.Text.V1.Model

Source: files/app/src/Foundation/View/Text/V1/Model.lex.tex, from https://github.com/UOR-Foundation/template/blob/e79e0dcd7b95189f588c9ef2bebf5606b9ce3eb0/app/src/Foundation/View/Text/V1/Model.lex.tex

| Declaration | Kind | Word |
| --- | --- | --- |
| Foundation.View.Text.V1.Model::TextView | structure |  |
| Foundation.View.Text.V1.Model::AcceptanceVector | structure |  |
| Foundation.View.Text.V1.Model::TextApplication | structure | Text application model |
| Foundation.View.Text.V1.Model::textApplicationProfile | definition |  |

### Production.ThreatModel

Source: files/app/src/Production/ThreatModel.lex.tex, from https://github.com/UOR-Foundation/PrismPM/blob/3db7f3e6be768f4e1347e5717e9f805492573d05/tests/negative/threat-model/unmapped-threat/project/src/Production/ThreatModel.lex.tex

| Declaration | Kind | Word |
| --- | --- | --- |
| Production.ThreatModel::Stride | inductive |  |
| Production.ThreatModel::EvidenceKind | inductive |  |
| Production.ThreatModel::Evidence | structure |  |
| Production.ThreatModel::ControlSet | structure |  |
| Production.ThreatModel::ModeledAsset | structure |  |
| Production.ThreatModel::ModeledThreat | structure |  |
| Production.ThreatModel::ModeledControl | structure |  |
| Production.ThreatModel::ThreatMapping | structure |  |
| Production.ThreatModel::AcceptedRisk | structure |  |
| Production.ThreatModel::NormalizedThreatModel | structure |  |
| Production.ThreatModel::threatListLength | definition |  |
| Production.ThreatModel::threatAllPositive | definition |  |
| Production.ThreatModel::validateThreatsAnswered | definition |  |
| Production.ThreatModel::validateThreatCategories | definition |  |
| Production.ThreatModel::validateControlEvidence | definition |  |
| Production.ThreatModel::validateNormalizedThreatModel | definition |  |
| Production.ThreatModel::normalizedThreatModelValid | definition |  |
| Production.ThreatModel::normalizedThreatModel\_sound\_complete | theorem |  |
| Production.ThreatModel::threatModelVector | definition |  |
| Production.ThreatModel::threatModelVectorAccepted | theorem |  |
| Production.ThreatModel::unmappedThreatRefused | theorem |  |
| Production.ThreatModel::controlWithoutEvidenceRefused | theorem |  |
| Production.ThreatModel::threatWithoutCategoryRefused | theorem |  |

## Language packages

### prism.arch 1.0.0

| Entry | Word | Denotes |
| --- | --- | --- |
| arch-component | architectural component | Foundation.Arch::Component |
| arch-component-kind | architectural component kind | Foundation.Arch::ComponentKind |
| arch-concern | architectural concern | Foundation.Arch::Concern |
| arch-design-diagram | design diagram | Foundation.Arch::DesignDiagram |
| arch-design-view | design view | Foundation.Arch::DesignView |
| arch-edge | architectural edge | Foundation.Arch::Edge |
| arch-edge-kind | architectural edge kind | Foundation.Arch::EdgeKind |
| arch-feature | feature | Foundation.Arch::Feature |
| arch-journey | journey | Foundation.Arch::Journey |
| arch-model-kind | architecture model kind | Foundation.Arch::ModelKind |
| arch-opm-link | OPM link | Foundation.Arch::OpmLink |
| arch-opm-link-kind | OPM link kind | Foundation.Arch::OpmLinkKind |
| arch-opm-state | OPM state | Foundation.Arch::OpmState |
| arch-opm-thing | OPM thing | Foundation.Arch::OpmThing |
| arch-opm-thing-kind | OPM thing kind | Foundation.Arch::OpmThingKind |
| arch-opm-zoom | OPM zoom | Foundation.Arch::OpmZoom |
| arch-stakeholder | stakeholder | Foundation.Arch::Stakeholder |
| arch-standard-reference | standards reference | Foundation.Arch::StandardReference |
| arch-system-process | system process | Foundation.Arch::SystemProcess |
| arch-system-state | system state | Foundation.Arch::SystemState |
| arch-text-application-model | Text application model | Foundation.View.Text.V1.Model::TextApplication |
| arch-uml-component | UML component | Foundation.Arch::UmlComponent |
| arch-uml-connector | UML connector | Foundation.Arch::UmlConnector |
| arch-uml-lifeline | UML lifeline | Foundation.Arch::UmlLifeline |
| arch-uml-message | UML message | Foundation.Arch::UmlMessage |
| arch-uml-message-kind | UML message kind | Foundation.Arch::UmlMessageKind |
| arch-uml-state | UML state | Foundation.Arch::UmlState |
| arch-uml-transition | UML transition | Foundation.Arch::UmlTransition |
| arch-view | architecture view | Foundation.Arch::View |
| arch-view-class | architecture view class | Foundation.Arch::ViewClass |
| arch-viewpoint | architecture viewpoint | Foundation.Arch::Viewpoint |
| arch-viewpoint-class | architecture viewpoint class | Foundation.Arch::ViewpointClass |
| holo-flat-validation-input | flat validation input | Foundation.Holo::FlatValidationInput |
| holo-normalized-features | normalized feature model | Foundation.Holo::NormalizedFeatures |
| holo-normalized-model | normalized hologram model | Foundation.Holo::NormalizedHolo |
| holo-standards-profile | fixed standards profile | Foundation.Holo::StandardsProfile |
| prism-bounded-byte-buffer | Bounded byte buffer | Foundation.Bytes::BoundedBuffer |
| prism-browser-system-model | Browser-resident system model | Production.BrowserSystem::SystemModel |
| prism-production-system-model | Production system model | Production.Core::Component |
| prism-unicode-text-codec | Unicode text codec | Foundation.Utf8::encode |

### prism.qual 1.0.0

| Entry | Word | Denotes |
| --- | --- | --- |
| qual-characteristic | quality characteristic | Foundation.Qual::ProductQualityCharacteristic |
| qual-measure | quality measure | Foundation.Qual::QualityMeasure |
| qual-requirement | quality requirement | Foundation.Qual::QualityRequirement |
| qual-subcharacteristic | quality subcharacteristic | Foundation.Qual::QualitySubcharacteristic |

### prism.sec 1.0.0

| Entry | Word | Denotes |
| --- | --- | --- |
| sec-activity | security activity | Foundation.Sec::SecurityActivity |
| sec-asset | security asset | Foundation.Sec::Asset |
| sec-control | security control | Foundation.Sec::ApplicationSecurityControl |
| sec-impact | security impact | Foundation.Sec::Impact |
| sec-likelihood | security likelihood | Foundation.Sec::Likelihood |
| sec-measurement | security verification measurement | Foundation.Sec::VerificationMeasurement |
| sec-risk | security risk | Foundation.Sec::Risk |
| sec-threat | security threat | Foundation.Sec::Threat |

## prism-code journey

| Module | What it does | SHA-256 |
| --- | --- | --- |
| spec.mjs | The Prism spec (\`prism/spec/1\`): what a decision app does, in the words a user gives it. One spec renders to one LexLean model (render.mjs), whose theorems Lean proves and whose acceptance vectors the guest replays. | 80f22a5ddd3f018d3711c067c1a93bd48b9f5627b459dac5710540c83c01104f |
| render.mjs | Render a \`prism/spec/1\` spec into the LexLean model of a text application, its acceptance vectors and SPEC.md. | 55f784df40a34f36992cf397c4ff0ba55a5b89b498eca397cd910238e2def64f |
| session.mjs | The spec session: six questions, asked one at a time, each answer checked as it arrives. The spec is rebuilt from the raw answers every time, so an earlier answer can be revised and everything after it is checked again. | 73b2f266120a52d2951b5973afd664336748bb7c5693748207abcdd6c055a582 |
| template.mjs | The files that make a guided-journey app an instance of UOR-Foundation/template, so it has the template's frame, page, gate and Pages URL. | 97885e092443ae6eb46060c976d9c6ee9ca9e138d8914e4f4ae32c0b9dad6ead |
| mcp.mjs | \`prism-code mcp\`: the Prism MCP server, over stdio, with no dependencies. | 4da58794e4f5c1609ffaf2902419cb05300be39a21f69f05f55a64417c002740 |
