# Axiom policy

> Decide if a declaration uses only the axioms its source allows. Then lexlean verify publishes nothing that rests on more.

Inspired by UOR-Foundation/LexLean (https://github.com/UOR-Foundation/LexLean). The LexLean compiler and verifier, which holds every declaration to its exact kernel-observed axiom set. Pattern: Policy decision, OASIS XACML 3.0 policy decision point. To write one of your own, follow How to build a policy decision app (../../guides/policy-decision/index.md). The prompt below is data, quoted from the example.

**Figure: What the Axiom policy app does.** A request goes in, the rules decide, and the Lean kernel has already proved what the rules promise.

| Step | What happens |
| --- | --- |
| 1. Request | audit, row, policy, outside, unseen |
| 2. 6 rules | the first that applies decides |
| 3. Answer | permit, deny, not-applicable, indeterminate |
| 4. Proved | 6 theorems, 55 tests |

Verified by prismpm verify in the pinned SDK. Fingerprint: b675c1b6267a588e693a3c5506eb3d67875c7b089ae6b7c8708f232be046a0a6. Acceptance vectors: 55. Claims: 9.

## The prompt

```json
{
  "schema": "prism/prompt/1",
  "pattern": "policyDecision",
  "goal": "Decide if a declaration uses only the axioms its source allows. Then lexlean verify publishes nothing that rests on more.",
  "repository": "UOR-Foundation/LexLean",
  "app": {
    "name": "lexlean-axiom-policy",
    "title": "Axiom policy",
    "purpose": "Decide, for one declaration at stage 11 of lexlean verify, whether its axiom audit permits it, denies it with LLV7005, does not apply to it, or cannot be decided, from the audit result, where the declaration lives, its policy kind and how its observed set differs from the declared list.",
    "limits": [
      "It does not run the audit: the observed set is read from the Lean axiom audit members of stage 9 and 10.",
      "It does not judge a model declaration's generated family, whose union LexLean compares with the model's declared set separately."
    ],
    "fields": [
      {
        "name": "audit",
        "kind": "choice",
        "values": [
          "listed",
          "unlisted",
          "failed",
          "unparsed"
        ],
        "means": "the audit of the declaration: listed in the output, absent from it, its member exited nonzero, or its output refused by the parser"
      },
      {
        "name": "row",
        "kind": "choice",
        "values": [
          "source",
          "core"
        ],
        "means": "a source declaration of a document, or a row of the document's core calculus"
      },
      {
        "name": "policy",
        "kind": "choice",
        "values": [
          "none",
          "allow",
          "exact"
        ],
        "means": "the declared AxiomPolicy: noaxioms, allowaxioms or exactaxioms"
      },
      {
        "name": "outside",
        "kind": "number",
        "min": 0,
        "max": 64,
        "means": "observed axioms not in the declared list (for noaxioms, every observed axiom)"
      },
      {
        "name": "unseen",
        "kind": "number",
        "min": 0,
        "max": 64,
        "means": "declared axioms the audit did not observe"
      }
    ],
    "outcomes": [
      "permit",
      "deny",
      "not-applicable",
      "indeterminate"
    ],
    "meanings": {
      "permit": "XACML 3.0 Permit: the observed set satisfies the policy and the declaration row records result ok",
      "deny": "XACML 3.0 Deny: the observed set violates the policy and verify fails with LLV7005",
      "not-applicable": "XACML 3.0 NotApplicable: no observation applies, so the policy is not enforced on this row",
      "indeterminate": "XACML 3.0 Indeterminate: the audit could not be evaluated, so verify fails before any policy is judged"
    },
    "rules": [
      {
        "when": [
          {
            "field": "audit",
            "op": "is",
            "value": "failed"
          }
        ],
        "then": "indeterminate",
        "why": "crates/lexlean/src/verify/mod.rs: an audit member that exits nonzero fails with LLV7004"
      },
      {
        "when": [
          {
            "field": "audit",
            "op": "is",
            "value": "unparsed"
          }
        ],
        "then": "indeterminate",
        "why": "verify/mod.rs: output that axiom::parse_audit_output refuses fails with LLV7004, missing or malformed audit output"
      },
      {
        "when": [
          {
            "field": "audit",
            "op": "is",
            "value": "unlisted"
          },
          {
            "field": "row",
            "op": "is",
            "value": "core"
          }
        ],
        "then": "not-applicable",
        "why": "verify/mod.rs stage 11: a core declaration absent from the observed map is skipped (continue)"
      },
      {
        "when": [
          {
            "field": "audit",
            "op": "is",
            "value": "unlisted"
          }
        ],
        "then": "indeterminate",
        "why": "verify/mod.rs: the audit family must observe every declaration, or verify fails as an internal error"
      },
      {
        "when": [
          {
            "field": "outside",
            "op": ">=",
            "value": 1
          }
        ],
        "then": "deny",
        "why": "ir/declaration.rs AxiomPolicy::permits: none needs an empty set, allow a subset, exact an equal one"
      },
      {
        "when": [
          {
            "field": "policy",
            "op": "is",
            "value": "exact"
          },
          {
            "field": "unseen",
            "op": ">=",
            "value": 1
          }
        ],
        "then": "deny",
        "why": "AxiomPolicy::permits Exact: the sorted, deduplicated observed set must equal the declared list"
      }
    ],
    "otherwise": "permit",
    "otherwiseWhy": "AxiomPolicy::permits: every observed axiom is declared, and an exact policy saw every declared one",
    "properties": [
      {
        "kind": "never",
        "when": [
          {
            "field": "outside",
            "op": ">=",
            "value": 1
          }
        ],
        "then": "permit",
        "why": "an axiom the source did not declare is never published"
      },
      {
        "kind": "never",
        "when": [
          {
            "field": "policy",
            "op": "is",
            "value": "exact"
          },
          {
            "field": "unseen",
            "op": ">=",
            "value": 1
          }
        ],
        "then": "permit",
        "why": "an exact policy is equality, not a subset (SPEC section 15.9)"
      },
      {
        "kind": "never",
        "when": [
          {
            "field": "audit",
            "op": "is",
            "value": "failed"
          }
        ],
        "then": "permit",
        "why": "a failed audit proves nothing about the declaration"
      },
      {
        "kind": "never",
        "when": [
          {
            "field": "audit",
            "op": "is",
            "value": "unparsed"
          }
        ],
        "then": "permit",
        "why": "output the parser refuses proves nothing about the declaration"
      },
      {
        "kind": "never",
        "when": [
          {
            "field": "audit",
            "op": "is",
            "value": "unlisted"
          },
          {
            "field": "row",
            "op": "is",
            "value": "source"
          }
        ],
        "then": "permit",
        "why": "a source declaration the audit missed is never taken as axiom free"
      },
      {
        "kind": "always",
        "when": [
          {
            "field": "audit",
            "op": "is",
            "value": "listed"
          },
          {
            "field": "outside",
            "op": "=",
            "value": 0
          },
          {
            "field": "unseen",
            "op": "=",
            "value": 0
          }
        ],
        "then": "permit",
        "why": "an observed set equal to the declared list satisfies all three policies"
      }
    ],
    "examples": [
      {
        "request": "listed source exact 0 0",
        "response": "permit"
      },
      {
        "request": "listed source exact 0 1",
        "response": "deny"
      },
      {
        "request": "listed source allow 0 2",
        "response": "permit"
      },
      {
        "request": "listed source none 1 0",
        "response": "deny"
      },
      {
        "request": "listed core allow 1 0",
        "response": "deny"
      },
      {
        "request": "unlisted core exact 0 0",
        "response": "not-applicable"
      },
      {
        "request": "unlisted source exact 0 0",
        "response": "indeterminate"
      },
      {
        "request": "failed source none 0 0",
        "response": "indeterminate"
      },
      {
        "request": "unparsed core exact 0 0",
        "response": "indeterminate"
      },
      {
        "request": "listed source exact 65 0",
        "response": "invalid"
      }
    ]
  },
  "stakeholders": [
    {
      "name": "Model author",
      "text": "Pins each declaration's axioms with noaxioms, allowaxioms or exactaxioms and needs verify to hold the kernel to exactly that.",
      "concerns": [
        "Correct answers",
        "Proved guarantees"
      ]
    },
    {
      "name": "Release reviewer",
      "text": "Reads the declaration rows of a verify before a release and needs no row to say ok unless its audit was read and satisfied.",
      "concerns": [
        "No unaudited permit",
        "Integrity of the published app"
      ]
    }
  ],
  "concerns": [
    {
      "name": "No unaudited permit",
      "text": "A declaration whose audit failed, was refused or missed it is never permitted.",
      "model": "security"
    }
  ],
  "components": [
    {
      "name": "Lean axiom audit",
      "text": "The audit modules lexlean verify runs under the pinned Lean, whose output lists the axioms each declaration depends on.",
      "kind": "cliAdapter"
    },
    {
      "name": "lexlean verify",
      "text": "The LexLean verifier whose stage 11 enforces each declaration's policy and writes the declaration rows.",
      "kind": "cliAdapter"
    }
  ],
  "threats": [
    {
      "name": "Classical axiom slipped in",
      "text": "A declaration pinned noaxioms or an exact set starts depending on Classical.choice through a lemma it uses, and is still reported ok.",
      "stride": "elevationOfPrivilege",
      "asset": "source",
      "likelihood": "medium",
      "impact": "critical",
      "control": {
        "name": "Observed set outside the policy is denied",
        "text": "Any observed axiom outside the declared list is a deny, proved for every request.",
        "evidence": [
          {
            "kind": "proof",
            "reference": "LexleanAxiomPolicyProofs::inv001Holds"
          },
          {
            "kind": "review",
            "reference": "LexLean crates/lexlean/src/ir/declaration.rs AxiomPolicy::permits"
          }
        ]
      }
    },
    {
      "name": "Silent audit taken as clean",
      "text": "An audit member crashes or prints nothing for a declaration, and an empty observed set is read as no axioms.",
      "stride": "repudiation",
      "asset": "answer",
      "likelihood": "low",
      "impact": "major",
      "control": {
        "name": "No permit without an audit",
        "text": "A failed, refused or missing audit of a source declaration is indeterminate, never permit.",
        "evidence": [
          {
            "kind": "proof",
            "reference": "LexleanAxiomPolicyProofs::inv003Holds"
          },
          {
            "kind": "proof",
            "reference": "LexleanAxiomPolicyProofs::inv005Holds"
          },
          {
            "kind": "gate",
            "reference": "LexLean crates/conformance/src/cases/verification.rs"
          }
        ]
      }
    },
    {
      "name": "Core row left unenforced",
      "text": "A core-calculus row absent from the audit is skipped, so a policy on it is never enforced.",
      "stride": "tampering",
      "asset": "source",
      "likelihood": "low",
      "impact": "minor",
      "accepted": "verify/mod.rs skips a core row the audit does not name by design: only the declarations the audit family observes carry an observed set, and the not-applicable answer says so."
    }
  ],
  "quality": [
    {
      "characteristic": "Security",
      "subcharacteristic": "Integrity",
      "requirement": "Only satisfied policies are permitted",
      "text": "No request with an undeclared observed axiom, or an exact policy missing one, is permitted.",
      "measure": "Violating permits",
      "measureText": "Acceptance vectors permitted while outside or, under exact, unseen is at least 1.",
      "threshold": 0
    },
    {
      "characteristic": "Functional suitability",
      "subcharacteristic": "Functional correctness",
      "requirement": "Every decision matches verify",
      "text": "Each vector answers the decision stage 11 of lexlean verify reaches.",
      "measure": "Vectors that disagree",
      "measureText": "Acceptance vectors whose replayed answer differs from the expected decision.",
      "threshold": 0
    }
  ],
  "journeys": [
    {
      "stakeholder": "Model author",
      "steps": [
        "otherwise",
        "REQ-005",
        "REQ-006",
        "INV-002"
      ]
    },
    {
      "stakeholder": "Release reviewer",
      "steps": [
        "REQ-001",
        "REQ-004",
        "REQ-003",
        "INV-005",
        "refuse"
      ]
    }
  ],
  "axioms": {
    "inv002Holds": [
      "Classical.choice",
      "Quot.sound",
      "propext"
    ],
    "inv003Holds": [
      "Classical.choice",
      "Quot.sound",
      "propext"
    ],
    "inv004Holds": [
      "Classical.choice",
      "Quot.sound",
      "propext"
    ],
    "inv005Holds": [
      "Classical.choice",
      "Quot.sound",
      "propext"
    ]
  },
  "license": "MIT OR Apache-2.0"
}
```

## Claims

- LA-01: The app never answers permit when outside is at least 1
- LA-02: The app never answers permit when policy is exact and unseen is at least 1
- LA-03: The app never answers permit when audit is failed
- LA-04: The app never answers permit when audit is unparsed
- LA-05: The app never answers permit when audit is unlisted and row is source
- LA-06: The app always answers permit when audit is listed and outside equals 0 and unseen equals 0
- LA-07: The architecture description declares every stakeholder, concern, component, edge, viewpoint and view it references
- LA-08: The ISO/IEC 25010 quality model numbers every characteristic, subcharacteristic, requirement and measure, and every parent it names is declared
- LA-09: Every compliance obligation is numbered in order and names its evidence

## Pattern

Policy decision: OASIS XACML 3.0 policy decision point. The answer is one XACML 3.0 decision: permit, deny, not-applicable, indeterminate. A policy that applies gives permit or deny. If none applies, the answer is not-applicable. If the request cannot be judged, it is indeterminate.

| Pattern | Standard | Answers |
| --- | --- | --- |
| Policy decision | OASIS XACML 3.0 policy decision point | permit, deny, not-applicable, indeterminate |

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

|  | rules |
| --- | --- |
| permit | 0 |
| deny | 2 |
| not-applicable | 1 |
| indeterminate | 3 |

## Behavior

A request is audit, row, policy, outside, unseen, separated by spaces. The first rule that matches decides. If none matches, the answer is permit. A request over 136 bytes, or in any other form, is answered invalid.

| Rule | When | Answer | Why |
| --- | --- | --- | --- |
| REQ-001 | audit is failed | indeterminate | crates/lexlean/src/verify/mod.rs: an audit member that exits nonzero fails with LLV7004 |
| REQ-002 | audit is unparsed | indeterminate | verify/mod.rs: output that axiom::parse\_audit\_output refuses fails with LLV7004, missing or malformed audit output |
| REQ-003 | audit is unlisted and row is core | not-applicable | verify/mod.rs stage 11: a core declaration absent from the observed map is skipped (continue) |
| REQ-004 | audit is unlisted | indeterminate | verify/mod.rs: the audit family must observe every declaration, or verify fails as an internal error |
| REQ-005 | outside is at least 1 | deny | ir/declaration.rs AxiomPolicy::permits: none needs an empty set, allow a subset, exact an equal one |
| REQ-006 | policy is exact and unseen is at least 1 | deny | AxiomPolicy::permits Exact: the sorted, deduplicated observed set must equal the declared list |
| otherwise | no rule matches | permit | AxiomPolicy::permits: every observed axiom is declared, and an exact policy saw every declared one |

## Properties Lean proves

Each property is a theorem about the same definitions the app is built from. It is proved for every request, not only the tested ones.

| Property | Statement | Theorem | Why |
| --- | --- | --- | --- |
| INV-001 | It never answers permit when outside is at least 1. | LexleanAxiomPolicyProofs::inv001Holds | an axiom the source did not declare is never published |
| INV-002 | It never answers permit when policy is exact and unseen is at least 1. | LexleanAxiomPolicyProofs::inv002Holds | an exact policy is equality, not a subset (SPEC section 15.9) |
| INV-003 | It never answers permit when audit is failed. | LexleanAxiomPolicyProofs::inv003Holds | a failed audit proves nothing about the declaration |
| INV-004 | It never answers permit when audit is unparsed. | LexleanAxiomPolicyProofs::inv004Holds | output the parser refuses proves nothing about the declaration |
| INV-005 | It never answers permit when audit is unlisted and row is source. | LexleanAxiomPolicyProofs::inv005Holds | a source declaration the audit missed is never taken as axiom free |
| INV-006 | It always answers permit when audit is listed and outside equals 0 and unseen equals 0. | LexleanAxiomPolicyProofs::inv006Holds | an observed set equal to the declared list satisfies all three policies |

## Architecture

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

| Stakeholder | Who they are | Concerns |
| --- | --- | --- |
| Model author | Pins each declaration's axioms with noaxioms, allowaxioms or exactaxioms and needs verify to hold the kernel to exactly that. | Correct answers, Proved guarantees |
| Release reviewer | Reads the declaration rows of a verify before a release and needs no row to say ok unless its audit was read and satisfied. | No unaudited permit, Integrity of the published app |
| 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 permit when none does, as the spec states. | quality |
| Integrity of the published app | What a visitor runs is the holo the build verified, with its fingerprint and signed provenance beside it. | security |
| No unaudited permit | A declaration whose audit failed, was refused or missed it is never permitted. | security |
| Proved guarantees | Each of the 6 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 |
| --- | --- | --- |
| Axiom policy 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. |
| Axiom policy page | staticSite | The page the template publishes: the holo, its fingerprint, its provenance and its acceptance vectors. |
| Browser | externalSystem | The visitor's web browser, which loads the page and runs the Axiom policy guest. |
| GitHub Pages | externalSystem | Serves the page and the holo from the repository Pages workflow. |
| Lean axiom audit | cliAdapter | The audit modules lexlean verify runs under the pinned Lean, whose output lists the axioms each declaration depends on. |
| lexlean verify | cliAdapter | The LexLean verifier whose stage 11 enforces each declaration's policy and writes the declaration rows. |
| 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 Axiom policy request | opmObjectProcess | Model author: Correct answers |
| Components of Axiom policy | umlComponent | Release reviewer: Integrity of the published app |
| Answering a Axiom policy request | umlSequence | Model author: Correct answers |
| States of the Axiom policy guest | umlStateMachine | Verifier: Refused malformed requests |

## Features and journeys

14 features. Each names the definitions that do the work and the tests that accept it. Each stakeholder has one journey.

| Feature | Calls | Accepted by |
| --- | --- | --- |
| When audit is failed, the answer is indeterminate. | LexleanAxiomPolicy::rule1, LexleanAxiomPolicy::judge | LexleanAxiomPolicy::application |
| When audit is unparsed, the answer is indeterminate. | LexleanAxiomPolicy::rule2, LexleanAxiomPolicy::judge | LexleanAxiomPolicy::application |
| When audit is unlisted and row is core, the answer is not-applicable. | LexleanAxiomPolicy::rule3, LexleanAxiomPolicy::judge | LexleanAxiomPolicy::application |
| When audit is unlisted, the answer is indeterminate. | LexleanAxiomPolicy::rule4, LexleanAxiomPolicy::judge | LexleanAxiomPolicy::application |
| When outside is at least 1, the answer is deny. | LexleanAxiomPolicy::rule5, LexleanAxiomPolicy::judge | LexleanAxiomPolicy::application |
| When policy is exact and unseen is at least 1, the answer is deny. | LexleanAxiomPolicy::rule6, LexleanAxiomPolicy::judge | LexleanAxiomPolicy::application |
| When no rule matches, the answer is permit. | LexleanAxiomPolicy::judge | LexleanAxiomPolicy::application |
| A request that is not audit, row, policy, outside, unseen in order, separated by single spaces, or is over 136 bytes, is answered invalid. | LexleanAxiomPolicy::dispatch, LexleanAxiomPolicy::decodeField1 | LexleanAxiomPolicy::application |
| It never answers permit when outside is at least 1. | LexleanAxiomPolicy::judge | LexleanAxiomPolicyProofs::inv001Holds |
| It never answers permit when policy is exact and unseen is at least 1. | LexleanAxiomPolicy::judge | LexleanAxiomPolicyProofs::inv002Holds |
| It never answers permit when audit is failed. | LexleanAxiomPolicy::judge | LexleanAxiomPolicyProofs::inv003Holds |
| It never answers permit when audit is unparsed. | LexleanAxiomPolicy::judge | LexleanAxiomPolicyProofs::inv004Holds |
| It never answers permit when audit is unlisted and row is source. | LexleanAxiomPolicy::judge | LexleanAxiomPolicyProofs::inv005Holds |
| It always answers permit when audit is listed and outside equals 0 and unseen equals 0. | LexleanAxiomPolicy::judge | LexleanAxiomPolicyProofs::inv006Holds |

## Journeys

The ordered features each stakeholder takes.

| Stakeholder | Steps |
| --- | --- |
| Model author | otherwise → REQ-005 → REQ-006 → INV-002 |
| Release reviewer | REQ-001 → REQ-004 → REQ-003 → INV-005 → refuse |
| Verifier | refuse → INV-001 → INV-002 → INV-003 → INV-004 → INV-005 → INV-006 |

## Security and threat model

15 threats against 4 assets. Each has a STRIDE category, and either a control with evidence or a risk that is accepted on purpose.

| Threat | STRIDE | Asset | Risk | Answered by |
| --- | --- | --- | --- | --- |
| Answer that breaks INV-001 | repudiation | Answer | medium likelihood, critical impact | Proof of INV-001: proof LexleanAxiomPolicyProofs::inv001Holds |
| Answer that breaks INV-002 | repudiation | Answer | medium likelihood, critical impact | Proof of INV-002: proof LexleanAxiomPolicyProofs::inv002Holds |
| Answer that breaks INV-003 | repudiation | Answer | medium likelihood, critical impact | Proof of INV-003: proof LexleanAxiomPolicyProofs::inv003Holds |
| Answer that breaks INV-004 | repudiation | Answer | medium likelihood, critical impact | Proof of INV-004: proof LexleanAxiomPolicyProofs::inv004Holds |
| Answer that breaks INV-005 | repudiation | Answer | medium likelihood, critical impact | Proof of INV-005: proof LexleanAxiomPolicyProofs::inv005Holds |
| Answer that breaks INV-006 | repudiation | Answer | medium likelihood, critical impact | Proof of INV-006: proof LexleanAxiomPolicyProofs::inv006Holds |
| Classical axiom slipped in | elevationOfPrivilege | Model source | medium likelihood, critical impact | Observed set outside the policy is denied: proof LexleanAxiomPolicyProofs::inv001Holds; review LexLean crates/lexlean/src/ir/declaration.rs AxiomPolicy::permits |
| Core row left unenforced | tampering | Model source | low likelihood, minor impact | accepted: verify/mod.rs skips a core row the audit does not name by design: only the declarations the audit family observes carry an observed set, and the not-applicable answer says so. |
| 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 |
| Silent audit taken as clean | repudiation | Answer | low likelihood, major impact | No permit without an audit: proof LexleanAxiomPolicyProofs::inv003Holds; proof LexleanAxiomPolicyProofs::inv005Holds; gate LexLean crates/conformance/src/cases/verification.rs |
| Substituted holo | spoofing | Published holo | low likelihood, critical impact | Fingerprint and provenance: gate actions/attest-build-provenance in the pages workflow; gate prism-code check of the holo identities in the page |
| Substituted host | spoofing | Published holo | low likelihood, critical impact | accepted: A page cannot defend against its own host. The holo carries signed build provenance a visitor can check, and the app can be rebuilt from its prompt. |
| Tampered model | tampering | Model source | low likelihood, major impact | Regenerated from the prompt: gate prismpm verify in the SDK image prismpm.lock pins; review app/prompt.json |

## Quality

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

| Requirement | Characteristic | Measure | Threshold |
| --- | --- | --- | --- |
| Bounded allocation: The guest allocates at most 272 bytes for one request. | Performance efficiency: Resource utilization | Guest allocation bytes | 272 |
| Bounded request: A request over 136 bytes is refused before any field is read. | Performance efficiency: Time behaviour | Request bytes read | 136 |
| Every decision matches verify: Each vector answers the decision stage 11 of lexlean verify reaches. | Functional suitability: Functional correctness | Vectors that disagree | 0 |
| Every property proved: All 6 properties are theorems the Lean kernel checks. | Security: Integrity | Unproved properties | 0 |
| Every request answered: Every request gets an answer: a rule, permit otherwise, or invalid. | Functional suitability: Functional completeness | Unanswered requests | 0 |
| Every vector replays: All 55 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 10 examples of the spec is answered as it states. | Functional suitability: Functional correctness | Example mismatches | 0 |
| Only satisfied policies are permitted: No request with an undeclared observed axiom, or an exact policy missing one, is permitted. | Security: Integrity | Violating permits | 0 |

## Compliance

One obligation per standard, each naming its evidence.

| Standard | Subject | Evidence |
| --- | --- | --- |
| ISO/IEC/IEEE 42010:2022 | Architecture description | Architecture::architectureDescriptionHolds |
| ISO/PAS 19450:2015 and OMG UML 2.5.1 | Design views | Design::viewOpmDecide, Design::viewUmlComponents, Design::viewUmlRequest, Design::viewUmlStates |
| ISO/IEC 25010:2023 | Product quality | Quality::qualityModelHolds |
| ISO/IEC 27034-1:2011 and ISO/IEC 27005:2022 | Application security and risk | Security::controlSet |
| OASIS XACML 3.0 policy decision point | Policy decision | LexleanAxiomPolicy::judge, LexleanAxiomPolicy::encodeAnswer |
| OpenSpec | Requirements | LexleanAxiomPolicy::application |
| SPDX MIT OR Apache-2.0 | Licensing | LexleanAxiomPolicy::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 Axiom policy request
Viewpoint: Architecture::viewpointModelAuthorCorrectAnswers
Notation: ISO/PAS 19450:2015 OPM, Prism OPL profile

componentAxiomPolicyGuest is an object.
componentAxiomPolicyGuest can be stateDeciding or stateIdle.
componentBrowser is an object.
processDecide is a process.
processEncodeAnswer is a process.
processJudge is a process.
processParseRequest is a process.
componentAxiomPolicyGuest 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::viewpointReleaseReviewerIntegrityOfThePublishedApp
title Components of Axiom policy
component "componentAxiomPolicyGuest" as c0
component "componentAxiomPolicyPage" as c1
component "componentBrowser" as c2
component "componentGitHubPages" as c3
component "componentLeanAxiomAudit" as c4
component "componentLexleanVerify" as c5
component "componentPrismBuild" as c6
component "componentSourceRepository" as c7
c0 --> c2 : edgeAxiomPolicyGuestToBrowser
c0 --> c4 : edgeAxiomPolicyGuestToLeanAxiomAudit
c0 --> c5 : edgeAxiomPolicyGuestToLexleanVerify
c1 --> c3 : edgeAxiomPolicyPageToGitHubPages
c2 --> c0 : edgeBrowserToAxiomPolicyGuest
c3 --> c2 : edgeGitHubPagesToBrowser
c4 --> c0 : edgeLeanAxiomAuditToAxiomPolicyGuest
c5 --> c0 : edgeLexleanVerifyToAxiomPolicyGuest
c6 --> c0 : edgePrismBuildToAxiomPolicyGuest
c6 --> c1 : edgePrismBuildToAxiomPolicyPage
c7 --> c6 : edgeSourceRepositoryToPrismBuild
@enduml

```

### design/Design.viewUmlRequest.puml

```
@startuml
' UML 2.5.1 sequence diagram
' view: Design::viewUmlRequest
' viewpoint: Architecture::viewpointModelAuthorCorrectAnswers
title Answering a Axiom policy request
participant "componentBrowser" as p0
participant "componentAxiomPolicyGuest" as p1
p0 -> p1 : processDecide
p1 --> p0 : processDecide
@enduml

```

### design/Design.viewUmlStates.puml

```
@startuml
' UML 2.5.1 state machine diagram
' view: Design::viewUmlStates
' viewpoint: Architecture::viewpointVerifierRefusedMalformedRequests
title States of the Axiom policy guest
state "stateAnsweredDeny" as s0
state "stateAnsweredIndeterminate" as s1
state "stateAnsweredNotApplicable" as s2
state "stateAnsweredPermit" as s3
state "stateDeciding" as s4
state "stateIdle" as s5
state "stateRefused" as s6
[*] --> s5
s5 --> s4 : processParseRequest
s5 --> s6 : processParseRequest
s4 --> s1 : processRule1
s4 --> s1 : processRule2
s4 --> s2 : processRule3
s4 --> s1 : processRule4
s4 --> s0 : processRule5
s4 --> s0 : processRule6
s4 --> s3 : processOtherwise
s3 --> s5 : processEncodeAnswer
s0 --> s5 : processEncodeAnswer
s2 --> s5 : processEncodeAnswer
s1 --> s5 : processEncodeAnswer
s6 --> s5 : processEncodeAnswer
@enduml

```

## Prism source

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

- app/src/Architecture.lex.tex (413 lines)
- app/src/Compliance.lex.tex (56 lines)
- app/src/Design.lex.tex (598 lines)
- app/src/Features.lex.tex (172 lines)
- app/src/Quality.lex.tex (368 lines)
- app/src/Security.lex.tex (677 lines)
- app/src/LexleanAxiomPolicy.lex.tex (276 lines)
- app/src/LexleanAxiomPolicyProofs.lex.tex (243 lines)
- app/lexlean.toml (43 lines)
- app/prompt.json (450 lines)
- model/ids.toml (77 lines)
- features/suites/lexlean\_axiom\_policy.feature (56 lines)
- crates/conformance/tests/lexlean\_axiom\_policy.rs (152 lines)
- site/app.json (136 lines)
- openspec/specs/lexlean-axiom-policy/spec.md (228 lines)
