# Namespace authorization

> Decide if kappa-registry lets someone change a namespace. Only its owner, a key holder or a short chain of trust can write.

Inspired by UOR-Foundation/kappa-registry (https://github.com/UOR-Foundation/kappa-registry). A single-binary content-addressed registry serving OCI, Git, S3, Nix and AT Protocol from one store, with capability-edge authorization and bounded delegation. 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 Namespace authorization 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 | op, store, target, grant, hops |
| 2. 10 rules | the first that applies decides |
| 3. Answer | permit, deny, not-applicable, indeterminate |
| 4. Proved | 4 theorems, 52 tests |

Verified by prismpm verify in the pinned SDK. Fingerprint: d6d139bca1242def3754b3acbecba672edd2c861ff03dad6f433edb411da2e06. Acceptance vectors: 52. Claims: 7.

## The prompt

```json
{
  "schema": "prism/prompt/1",
  "goal": "Decide if kappa-registry lets someone change a namespace. Only its owner, a key holder or a short chain of trust can write.",
  "pattern": "policyDecision",
  "repository": "UOR-Foundation/kappa-registry",
  "app": {
    "name": "namespace-authorization",
    "limits": [
      "It does not resolve namespaces or walk edges; it decides from the authority the walk found.",
      "The redb store and the identity system are outside it."
    ],
    "title": "Namespace authorization",
    "purpose": "Decide, as an XACML policy decision, whether an operation on a namespace is permitted, from the operation class, whether the store answered, what the target namespace is, the authority the asserter holds and the delegation hops it takes.",
    "fields": [
      {
        "name": "op",
        "kind": "choice",
        "values": [
          "exempt",
          "read",
          "write",
          "admin"
        ],
        "means": "the operation class"
      },
      {
        "name": "store",
        "kind": "choice",
        "values": [
          "ok",
          "error"
        ],
        "means": "whether the store answered the delegation walk"
      },
      {
        "name": "target",
        "kind": "choice",
        "values": [
          "existing",
          "unclaimed",
          "absent",
          "reserved",
          "none"
        ],
        "means": "the namespace: claimed, existing with no capability edges, absent, absent and reserved, or none"
      },
      {
        "name": "grant",
        "kind": "choice",
        "values": [
          "none",
          "root",
          "owner",
          "direct",
          "parent",
          "role",
          "delegated"
        ],
        "means": "the first authority the asserter holds, in authorize's order"
      },
      {
        "name": "hops",
        "kind": "number",
        "min": 0,
        "means": "delegation hops walked to a capability holder",
        "max": 10
      }
    ],
    "outcomes": [
      "permit",
      "deny",
      "not-applicable",
      "indeterminate"
    ],
    "meanings": {
      "permit": "Allowed, AllowCreateNew or AllowedViaDelegation",
      "deny": "Forbidden: access denied, or a reserved namespace needs _root authority",
      "not-applicable": "NotFound: a read of a namespace that does not exist",
      "indeterminate": "a store error during the auth check, so no decision is made"
    },
    "rules": [
      {
        "when": [
          {
            "field": "op",
            "op": "is",
            "value": "exempt"
          }
        ],
        "then": "permit",
        "why": "crates/kappa-server/src/auth.rs authorize: an Exempt operation is Allowed before any check"
      },
      {
        "when": [
          {
            "field": "store",
            "op": "is",
            "value": "error"
          }
        ],
        "then": "indeterminate",
        "why": "auth.rs: a store error in the delegation walk is AuthError::Store, not a decision"
      },
      {
        "when": [
          {
            "field": "grant",
            "op": "is",
            "value": "root"
          }
        ],
        "then": "permit",
        "why": "auth.rs step 1: a capability on _root allows any namespace"
      },
      {
        "when": [
          {
            "field": "target",
            "op": "is",
            "value": "none"
          }
        ],
        "then": "permit",
        "why": "auth.rs: ResolvedNamespace::NoNamespace is Allowed"
      },
      {
        "when": [
          {
            "field": "target",
            "op": "is",
            "value": "reserved"
          }
        ],
        "then": "deny",
        "why": "auth.rs: an absent reserved namespace requires _root authority"
      },
      {
        "when": [
          {
            "field": "target",
            "op": "is",
            "value": "absent"
          },
          {
            "field": "op",
            "op": "is",
            "value": "read"
          }
        ],
        "then": "not-applicable",
        "why": "auth.rs: reading an absent namespace is AuthError::NotFound"
      },
      {
        "when": [
          {
            "field": "target",
            "op": "is",
            "value": "absent"
          }
        ],
        "then": "permit",
        "why": "auth.rs: a write to an absent non-reserved namespace is AllowCreateNew, first writer claims"
      },
      {
        "when": [
          {
            "field": "target",
            "op": "is",
            "value": "unclaimed"
          }
        ],
        "then": "permit",
        "why": "auth.rs step 3: a non-reserved namespace with no capability edges is open"
      },
      {
        "when": [
          {
            "field": "grant",
            "op": "is not",
            "value": "none"
          },
          {
            "field": "grant",
            "op": "is not",
            "value": "delegated"
          }
        ],
        "then": "permit",
        "why": "auth.rs steps 2, 4, 5 and 6: owner, direct capability, parent namespace or held role"
      },
      {
        "when": [
          {
            "field": "grant",
            "op": "is",
            "value": "delegated"
          },
          {
            "field": "hops",
            "op": "<=",
            "value": 5
          }
        ],
        "then": "permit",
        "why": "auth.rs check_delegation_inner: a delegation chain counts up to hop 5, AllowedViaDelegation"
      }
    ],
    "otherwise": "deny",
    "otherwiseWhy": "auth.rs: no authority found, Forbidden access denied",
    "properties": [
      {
        "kind": "never",
        "when": [
          {
            "field": "op",
            "op": "is",
            "value": "read"
          },
          {
            "field": "target",
            "op": "is",
            "value": "existing"
          },
          {
            "field": "grant",
            "op": "is",
            "value": "none"
          }
        ],
        "then": "permit",
        "why": "a claimed namespace is never read without authority"
      },
      {
        "kind": "never",
        "when": [
          {
            "field": "target",
            "op": "is",
            "value": "existing"
          },
          {
            "field": "grant",
            "op": "is",
            "value": "delegated"
          },
          {
            "field": "hops",
            "op": ">",
            "value": 5
          },
          {
            "field": "op",
            "op": "is not",
            "value": "exempt"
          }
        ],
        "then": "permit",
        "why": "the delegation walk is bounded at five hops"
      },
      {
        "kind": "never",
        "when": [
          {
            "field": "target",
            "op": "is",
            "value": "reserved"
          },
          {
            "field": "grant",
            "op": "is not",
            "value": "root"
          },
          {
            "field": "op",
            "op": "is not",
            "value": "exempt"
          }
        ],
        "then": "permit",
        "why": "a reserved namespace needs _root authority"
      },
      {
        "kind": "always",
        "when": [
          {
            "field": "store",
            "op": "is",
            "value": "error"
          },
          {
            "field": "op",
            "op": "is not",
            "value": "exempt"
          }
        ],
        "then": "indeterminate",
        "why": "a store error never becomes a permit or a deny"
      }
    ],
    "examples": [
      {
        "request": "read ok existing owner 0",
        "response": "permit"
      },
      {
        "request": "read ok existing none 0",
        "response": "deny"
      },
      {
        "request": "write ok absent none 0",
        "response": "permit"
      },
      {
        "request": "read ok absent none 0",
        "response": "not-applicable"
      },
      {
        "request": "admin ok reserved none 0",
        "response": "deny"
      },
      {
        "request": "write ok existing delegated 5",
        "response": "permit"
      },
      {
        "request": "write ok existing delegated 6",
        "response": "deny"
      },
      {
        "request": "read error existing owner 0",
        "response": "indeterminate"
      },
      {
        "request": "exempt error none none 0",
        "response": "permit"
      }
    ]
  },
  "stakeholders": [
    {
      "name": "Namespace owner",
      "text": "Owns a namespace and needs nothing but an owner, a capability holder or a bounded delegation to write to it.",
      "concerns": [
        "Proved guarantees",
        "Correct answers"
      ]
    },
    {
      "name": "Registry operator",
      "text": "Runs the single-binary server for Docker, Git, S3, Nix and AT Protocol clients and needs reserved namespaces kept for _root.",
      "concerns": [
        "Reserved namespaces protected"
      ]
    }
  ],
  "concerns": [
    {
      "name": "Reserved namespaces protected",
      "text": "The reserved namespaces, such as kappa/protocols, kappa/runtimes and kappa/os, are created only with _root authority.",
      "model": "security"
    }
  ],
  "components": [
    {
      "name": "Protocol clients",
      "text": "docker push, git push, aws s3, nix copy and XRPC clients, each speaking its native protocol to the one server.",
      "kind": "externalSystem"
    },
    {
      "name": "redb store",
      "text": "state.redb: tags, edges, sequences, namespaces and epochs, which the auth checks query.",
      "kind": "database"
    }
  ],
  "threats": [
    {
      "name": "Delegation asserted by a third party",
      "text": "Someone other than the source writes a delegation edge on its behalf to grant themselves access.",
      "stride": "spoofing",
      "asset": "request",
      "likelihood": "medium",
      "impact": "critical",
      "control": {
        "name": "Source must assert",
        "text": "A delegation counts only if its asserter is its source.",
        "evidence": [
          {
            "kind": "review",
            "reference": "crates/kappa-server/src/auth.rs check_delegation_inner"
          },
          {
            "kind": "gate",
            "reference": "crates/kappa-server/tests/integration/delegation.rs"
          }
        ]
      }
    },
    {
      "name": "Unbounded delegation walk",
      "text": "A long or cyclic delegation chain makes authorization walk without end or grants access far down a chain.",
      "stride": "denialOfService",
      "asset": "request",
      "likelihood": "low",
      "impact": "major",
      "control": {
        "name": "Five hops",
        "text": "The walk stops after hop 5, and beyond it nothing is permitted, proved for every request.",
        "evidence": [
          {
            "kind": "proof",
            "reference": "KappaDominanceProofs::inv002Holds"
          }
        ]
      }
    },
    {
      "name": "Fail-open on an edge query error",
      "text": "Step 3's edge query for an unclaimed namespace answers Allowed when the store errors.",
      "stride": "elevationOfPrivilege",
      "asset": "request",
      "likelihood": "low",
      "impact": "major",
      "accepted": "The app models a store error as indeterminate; auth.rs step 3 allows on an edge-query error, a fail-open recorded here for the repository to review."
    }
  ],
  "quality": [
    {
      "characteristic": "Security",
      "subcharacteristic": "Resistance",
      "requirement": "No authority, no write",
      "text": "No read, write or admin of a claimed namespace is permitted without an owner, capability, role or delegation within five hops.",
      "measure": "Unauthorized permits",
      "measureText": "Requests with no grant on a claimed namespace answered permit.",
      "threshold": 0
    }
  ],
  "journeys": [
    {
      "stakeholder": "Namespace owner",
      "steps": [
        "REQ-009",
        "REQ-010",
        "otherwise",
        "INV-001",
        "INV-002"
      ]
    },
    {
      "stakeholder": "Registry operator",
      "steps": [
        "REQ-003",
        "REQ-005",
        "REQ-007",
        "INV-003"
      ]
    }
  ],
  "axioms": {
    "inv003Holds": [
      "Classical.choice",
      "Quot.sound",
      "propext"
    ],
    "inv004Holds": [
      "Classical.choice",
      "Quot.sound",
      "propext"
    ]
  },
  "license": "MIT OR Apache-2.0"
}
```

## Claims

- NA-01: The app never answers permit when op is read and target is existing and grant is none
- NA-02: The app never answers permit when target is existing and grant is delegated and hops is above 5 and op is not exempt
- NA-03: The app never answers permit when target is reserved and grant is not root and op is not exempt
- NA-04: The app always answers indeterminate when store is error and op is not exempt
- NA-05: The architecture description declares every stakeholder, concern, component, edge, viewpoint and view it references
- NA-06: The ISO/IEC 25010 quality model numbers every characteristic, subcharacteristic, requirement and measure, and every parent it names is declared
- NA-07: 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 deny.

|  | rules |
| --- | --- |
| permit | 7 |
| deny | 1 |
| not-applicable | 1 |
| indeterminate | 1 |

## Behavior

A request is op, store, target, grant, hops, separated by spaces. The first rule that matches decides. If none matches, the answer is deny. A request over 136 bytes, or in any other form, is answered invalid.

| Rule | When | Answer | Why |
| --- | --- | --- | --- |
| REQ-001 | op is exempt | permit | crates/kappa-server/src/auth.rs authorize: an Exempt operation is Allowed before any check |
| REQ-002 | store is error | indeterminate | auth.rs: a store error in the delegation walk is AuthError::Store, not a decision |
| REQ-003 | grant is root | permit | auth.rs step 1: a capability on \_root allows any namespace |
| REQ-004 | target is none | permit | auth.rs: ResolvedNamespace::NoNamespace is Allowed |
| REQ-005 | target is reserved | deny | auth.rs: an absent reserved namespace requires \_root authority |
| REQ-006 | target is absent and op is read | not-applicable | auth.rs: reading an absent namespace is AuthError::NotFound |
| REQ-007 | target is absent | permit | auth.rs: a write to an absent non-reserved namespace is AllowCreateNew, first writer claims |
| REQ-008 | target is unclaimed | permit | auth.rs step 3: a non-reserved namespace with no capability edges is open |
| REQ-009 | grant is not none and grant is not delegated | permit | auth.rs steps 2, 4, 5 and 6: owner, direct capability, parent namespace or held role |
| REQ-010 | grant is delegated and hops is at most 5 | permit | auth.rs check\_delegation\_inner: a delegation chain counts up to hop 5, AllowedViaDelegation |
| otherwise | no rule matches | deny | auth.rs: no authority found, Forbidden access denied |

## 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 op is read and target is existing and grant is none. | NamespaceAuthorizationProofs::inv001Holds | a claimed namespace is never read without authority |
| INV-002 | It never answers permit when target is existing and grant is delegated and hops is above 5 and op is not exempt. | NamespaceAuthorizationProofs::inv002Holds | the delegation walk is bounded at five hops |
| INV-003 | It never answers permit when target is reserved and grant is not root and op is not exempt. | NamespaceAuthorizationProofs::inv003Holds | a reserved namespace needs \_root authority |
| INV-004 | It always answers indeterminate when store is error and op is not exempt. | NamespaceAuthorizationProofs::inv004Holds | a store error never becomes a permit or a deny |

## Architecture

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

| Stakeholder | Who they are | Concerns |
| --- | --- | --- |
| Namespace owner | Owns a namespace and needs nothing but an owner, a capability holder or a bounded delegation to write to it. | Proved guarantees, Correct answers |
| Registry operator | Runs the single-binary server for Docker, Git, S3, Nix and AT Protocol clients and needs reserved namespaces kept for \_root. | Reserved namespaces protected |
| 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 deny 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 4 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 |
| Reserved namespaces protected | The reserved namespaces, such as kappa/protocols, kappa/runtimes and kappa/os, are created only with \_root authority. | 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 Namespace authorization guest. |
| GitHub Pages | externalSystem | Serves the page and the holo from the repository Pages workflow. |
| Namespace authorization 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. |
| Namespace authorization 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. |
| Protocol clients | externalSystem | docker push, git push, aws s3, nix copy and XRPC clients, each speaking its native protocol to the one server. |
| redb store | database | state.redb: tags, edges, sequences, namespaces and epochs, which the auth checks query. |
| 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 Namespace authorization request | opmObjectProcess | Namespace owner: Correct answers |
| Components of Namespace authorization | umlComponent | Verifier: Integrity of the published app |
| Answering a Namespace authorization request | umlSequence | Namespace owner: Correct answers |
| States of the Namespace authorization guest | umlStateMachine | Verifier: Refused malformed requests |

## Features and journeys

16 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 op is exempt, the answer is permit. | NamespaceAuthorization::rule1, NamespaceAuthorization::judge | NamespaceAuthorization::application |
| When store is error, the answer is indeterminate. | NamespaceAuthorization::rule2, NamespaceAuthorization::judge | NamespaceAuthorization::application |
| When grant is root, the answer is permit. | NamespaceAuthorization::rule3, NamespaceAuthorization::judge | NamespaceAuthorization::application |
| When target is none, the answer is permit. | NamespaceAuthorization::rule4, NamespaceAuthorization::judge | NamespaceAuthorization::application |
| When target is reserved, the answer is deny. | NamespaceAuthorization::rule5, NamespaceAuthorization::judge | NamespaceAuthorization::application |
| When target is absent and op is read, the answer is not-applicable. | NamespaceAuthorization::rule6, NamespaceAuthorization::judge | NamespaceAuthorization::application |
| When target is absent, the answer is permit. | NamespaceAuthorization::rule7, NamespaceAuthorization::judge | NamespaceAuthorization::application |
| When target is unclaimed, the answer is permit. | NamespaceAuthorization::rule8, NamespaceAuthorization::judge | NamespaceAuthorization::application |
| When grant is not none and grant is not delegated, the answer is permit. | NamespaceAuthorization::rule9, NamespaceAuthorization::judge | NamespaceAuthorization::application |
| When grant is delegated and hops is at most 5, the answer is permit. | NamespaceAuthorization::rule10, NamespaceAuthorization::judge | NamespaceAuthorization::application |
| When no rule matches, the answer is deny. | NamespaceAuthorization::judge | NamespaceAuthorization::application |
| A request that is not op, store, target, grant, hops in order, separated by single spaces, or is over 136 bytes, is answered invalid. | NamespaceAuthorization::dispatch, NamespaceAuthorization::decodeField1 | NamespaceAuthorization::application |
| It never answers permit when op is read and target is existing and grant is none. | NamespaceAuthorization::judge | NamespaceAuthorizationProofs::inv001Holds |
| It never answers permit when target is existing and grant is delegated and hops is above 5 and op is not exempt. | NamespaceAuthorization::judge | NamespaceAuthorizationProofs::inv002Holds |
| It never answers permit when target is reserved and grant is not root and op is not exempt. | NamespaceAuthorization::judge | NamespaceAuthorizationProofs::inv003Holds |
| It always answers indeterminate when store is error and op is not exempt. | NamespaceAuthorization::judge | NamespaceAuthorizationProofs::inv004Holds |

## Journeys

The ordered features each stakeholder takes.

| Stakeholder | Steps |
| --- | --- |
| Namespace owner | REQ-009 → REQ-010 → otherwise → INV-001 → INV-002 |
| Registry operator | REQ-003 → REQ-005 → REQ-007 → INV-003 |
| Verifier | refuse → INV-001 → INV-002 → INV-003 → INV-004 |

## Security and threat model

13 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 NamespaceAuthorizationProofs::inv001Holds |
| Answer that breaks INV-002 | repudiation | Answer | medium likelihood, critical impact | Proof of INV-002: proof NamespaceAuthorizationProofs::inv002Holds |
| Answer that breaks INV-003 | repudiation | Answer | medium likelihood, critical impact | Proof of INV-003: proof NamespaceAuthorizationProofs::inv003Holds |
| Answer that breaks INV-004 | repudiation | Answer | medium likelihood, critical impact | Proof of INV-004: proof NamespaceAuthorizationProofs::inv004Holds |
| Delegation asserted by a third party | spoofing | Request bytes | medium likelihood, critical impact | Source must assert: review crates/kappa-server/src/auth.rs check\_delegation\_inner; gate crates/kappa-server/tests/integration/delegation.rs |
| Fail-open on an edge query error | elevationOfPrivilege | Request bytes | low likelihood, major impact | accepted: The app models a store error as indeterminate; auth.rs step 3 allows on an edge-query error, a fail-open recorded here for the repository to review. |
| 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 |
| 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 |
| Unbounded delegation walk | denialOfService | Request bytes | low likelihood, major impact | Five hops: proof KappaDominanceProofs::inv002Holds |

## 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 property proved: All 4 properties are theorems the Lean kernel checks. | Security: Integrity | Unproved properties | 0 |
| Every request answered: Every request gets an answer: a rule, deny otherwise, or invalid. | Functional suitability: Functional completeness | Unanswered requests | 0 |
| Every vector replays: All 52 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 9 examples of the spec is answered as it states. | Functional suitability: Functional correctness | Example mismatches | 0 |
| No authority, no write: No read, write or admin of a claimed namespace is permitted without an owner, capability, role or delegation within five hops. | Security: Resistance | Unauthorized 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 | NamespaceAuthorization::judge, NamespaceAuthorization::encodeAnswer |
| OpenSpec | Requirements | NamespaceAuthorization::application |
| SPDX MIT OR Apache-2.0 | Licensing | NamespaceAuthorization::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 Namespace authorization request
Viewpoint: Architecture::viewpointNamespaceOwnerCorrectAnswers
Notation: ISO/PAS 19450:2015 OPM, Prism OPL profile

componentBrowser is an object.
componentNamespaceAuthorizationGuest is an object.
componentNamespaceAuthorizationGuest can be stateDeciding or stateIdle.
processDecide is a process.
processEncodeAnswer is a process.
processJudge is a process.
processParseRequest is a process.
componentNamespaceAuthorizationGuest 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 Namespace authorization
component "componentBrowser" as c0
component "componentGitHubPages" as c1
component "componentNamespaceAuthorizationGuest" as c2
component "componentNamespaceAuthorizationPage" as c3
component "componentPrismBuild" as c4
component "componentProtocolClients" as c5
component "componentRedbStore" as c6
component "componentSourceRepository" as c7
c0 --> c2 : edgeBrowserToNamespaceAuthorizationGuest
c1 --> c0 : edgeGitHubPagesToBrowser
c2 --> c0 : edgeNamespaceAuthorizationGuestToBrowser
c2 --> c5 : edgeNamespaceAuthorizationGuestToProtocolClients
c2 --> c6 : edgeNamespaceAuthorizationGuestToRedbStore
c3 --> c1 : edgeNamespaceAuthorizationPageToGitHubPages
c4 --> c2 : edgePrismBuildToNamespaceAuthorizationGuest
c4 --> c3 : edgePrismBuildToNamespaceAuthorizationPage
c5 --> c2 : edgeProtocolClientsToNamespaceAuthorizationGuest
c6 --> c2 : edgeRedbStoreToNamespaceAuthorizationGuest
c7 --> c4 : edgeSourceRepositoryToPrismBuild
@enduml

```

### design/Design.viewUmlRequest.puml

```
@startuml
' UML 2.5.1 sequence diagram
' view: Design::viewUmlRequest
' viewpoint: Architecture::viewpointNamespaceOwnerCorrectAnswers
title Answering a Namespace authorization request
participant "componentBrowser" as p0
participant "componentNamespaceAuthorizationGuest" 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 Namespace authorization 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 --> s3 : processRule1
s4 --> s1 : processRule2
s4 --> s3 : processRule3
s4 --> s3 : processRule4
s4 --> s0 : processRule5
s4 --> s2 : processRule6
s4 --> s3 : processRule7
s4 --> s3 : processRule8
s4 --> s3 : processRule9
s4 --> s3 : processRule10
s4 --> s0 : 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-namespace-authorization.zip has them all.

- app/src/Architecture.lex.tex (399 lines)
- app/src/Compliance.lex.tex (56 lines)
- app/src/Design.lex.tex (654 lines)
- app/src/Features.lex.tex (172 lines)
- app/src/Quality.lex.tex (354 lines)
- app/src/Security.lex.tex (593 lines)
- app/src/NamespaceAuthorization.lex.tex (319 lines)
- app/src/NamespaceAuthorizationProofs.lex.tex (217 lines)
- app/lexlean.toml (43 lines)
- app/prompt.json (472 lines)
- model/ids.toml (65 lines)
- features/suites/namespace\_authorization.feature (44 lines)
- crates/conformance/tests/namespace\_authorization.rs (132 lines)
- site/app.json (114 lines)
- openspec/specs/namespace-authorization/spec.md (247 lines)
