# JCS NFC admission

> Give the one refusal code for a broken JSON document, or let it through. Then every tool refuses the same input with the same code.

Inspired by UOR-Foundation/uor-jcs-nfc (https://github.com/UOR-Foundation/uor-jcs-nfc). A JSON digest context: RFC 8785 with integer-only admission, NFC before member sort, collision refusal and a pinned sha256 representation. Pattern: Decision table, OMG DMN 1.5, hit policy FIRST. To write one of your own, follow How to build a decision table app (../../guides/decision-table/index.md). The prompt below is data, quoted from the example.

**Figure: What the JCS NFC admission 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 | bom, utf8, parse, names, surrogate |
| 2. 10 rules | the first that matches wins |
| 3. Answer | addressed, e-bom, e-utf8, e-json, e-num-token, e-num-range, e-constant, e-trailing, e-dup-name, e-surrogate, e-nfc-collision |
| 4. Proved | 4 theorems, 40 tests |

Verified by prismpm verify in the pinned SDK. Fingerprint: e6faeb7b37c054196bcc12f7b2351bbf9e29e8416e4d432b7c65b66c63c67fd2. Acceptance vectors: 40. Claims: 7.

## The prompt

```json
{
  "schema": "prism/prompt/1",
  "pattern": "decisionTable",
  "goal": "Give the one refusal code for a broken JSON document, or let it through. Then every tool refuses the same input with the same code.",
  "repository": "UOR-Foundation/uor-jcs-nfc",
  "license": "Apache-2.0",
  "app": {
    "name": "jcs-nfc-admission",
    "title": "JCS NFC admission",
    "purpose": "Give the UOR-JCS-NFC answer for one document from what admission and canonicalization find in it: the first refusal code by the section 3.9 precedence and the NFC collision check, or addressed when it receives its sha256 digest.",
    "fields": [
      {
        "name": "bom",
        "kind": "choice",
        "values": [
          "absent",
          "present"
        ],
        "means": "whether the bytes start with EF BB BF"
      },
      {
        "name": "utf8",
        "kind": "choice",
        "values": [
          "valid",
          "invalid"
        ],
        "means": "whether the bytes are well-formed UTF-8, raw surrogates included as invalid"
      },
      {
        "name": "parse",
        "kind": "choice",
        "values": [
          "ok",
          "json",
          "number-token",
          "number-range",
          "constant",
          "trailing"
        ],
        "means": "the first parse-time finding in input order, then trailing content after the top-level value"
      },
      {
        "name": "names",
        "kind": "choice",
        "values": [
          "distinct",
          "duplicate",
          "colliding"
        ],
        "means": "member names: distinct, duplicate after escape decoding, or distinct but colliding after NFC"
      },
      {
        "name": "surrogate",
        "kind": "choice",
        "values": [
          "none",
          "lone"
        ],
        "means": "whether an escaped unpaired surrogate is reached"
      }
    ],
    "outcomes": [
      "addressed",
      "e-bom",
      "e-utf8",
      "e-json",
      "e-num-token",
      "e-num-range",
      "e-constant",
      "e-trailing",
      "e-dup-name",
      "e-surrogate",
      "e-nfc-collision"
    ],
    "meanings": {
      "addressed": "admitted, canonicalized and digested as sha256:<hex>",
      "e-bom": "E_BOM, leading byte-order mark",
      "e-utf8": "E_UTF8, not well-formed UTF-8",
      "e-json": "E_JSON, malformed JSON",
      "e-num-token": "E_NUM_TOKEN, number token outside -?(0|[1-9][0-9]*)",
      "e-num-range": "E_NUM_RANGE, integer outside plus or minus 9007199254740991",
      "e-constant": "E_CONSTANT, NaN, Infinity or another non-standard constant",
      "e-trailing": "E_TRAILING, content after the top-level value",
      "e-dup-name": "E_DUP_NAME, duplicate member name",
      "e-surrogate": "E_SURROGATE, escaped lone surrogate",
      "e-nfc-collision": "E_NFC_COLLISION, member names collide after NFC, never merged"
    },
    "rules": [
      {
        "when": [
          {
            "field": "bom",
            "op": "is",
            "value": "present"
          }
        ],
        "then": "e-bom",
        "why": "SPEC.md 3.2 and 3.9: E_BOM is a byte-level check before parsing and comes first"
      },
      {
        "when": [
          {
            "field": "utf8",
            "op": "is",
            "value": "invalid"
          }
        ],
        "then": "e-utf8",
        "why": "SPEC.md 3.1 and 3.9: E_UTF8 follows E_BOM"
      },
      {
        "when": [
          {
            "field": "parse",
            "op": "is",
            "value": "json"
          }
        ],
        "then": "e-json",
        "why": "SPEC.md 3.9: parse-time codes fire in input order"
      },
      {
        "when": [
          {
            "field": "parse",
            "op": "is",
            "value": "number-token"
          }
        ],
        "then": "e-num-token",
        "why": "SPEC.md 3.5: tokens such as 1.0 and 1e0 are refused as text"
      },
      {
        "when": [
          {
            "field": "parse",
            "op": "is",
            "value": "number-range"
          }
        ],
        "then": "e-num-range",
        "why": "SPEC.md 3.5: values outside the safe-integer bound are refused"
      },
      {
        "when": [
          {
            "field": "parse",
            "op": "is",
            "value": "constant"
          }
        ],
        "then": "e-constant",
        "why": "SPEC.md 3.6: NaN and Infinity are refused"
      },
      {
        "when": [
          {
            "field": "parse",
            "op": "is",
            "value": "trailing"
          }
        ],
        "then": "e-trailing",
        "why": "SPEC.md 3.3 and 3.9: the remainder check follows the parse-time codes"
      },
      {
        "when": [
          {
            "field": "names",
            "op": "is",
            "value": "duplicate"
          }
        ],
        "then": "e-dup-name",
        "why": "SPEC.md 3.4 and 3.9: duplicates after escape decoding, a post-parse scan"
      },
      {
        "when": [
          {
            "field": "surrogate",
            "op": "is",
            "value": "lone"
          }
        ],
        "then": "e-surrogate",
        "why": "SPEC.md 3.7 and 3.9: E_SURROGATE follows E_DUP_NAME"
      },
      {
        "when": [
          {
            "field": "names",
            "op": "is",
            "value": "colliding"
          }
        ],
        "then": "e-nfc-collision",
        "why": "SPEC.md 4.1 and 4.3: NFC precedes member sort, and post-normalization collisions are refused in canonicalization, after admission"
      }
    ],
    "otherwise": "addressed",
    "otherwiseWhy": "SPEC.md 5 and uor_jcs_nfc_ref.py address_json: an admitted, canonicalized document is digested",
    "properties": [
      {
        "kind": "always",
        "when": [
          {
            "field": "bom",
            "op": "is",
            "value": "present"
          }
        ],
        "then": "e-bom",
        "why": "one malformed input receives one code, and E_BOM has precedence"
      },
      {
        "kind": "never",
        "when": [
          {
            "field": "names",
            "op": "is",
            "value": "colliding"
          }
        ],
        "then": "addressed",
        "why": "a collision is never resolved by last-write-wins, first-write-wins or merging"
      },
      {
        "kind": "never",
        "when": [
          {
            "field": "parse",
            "op": "is",
            "value": "number-token"
          }
        ],
        "then": "addressed",
        "why": "an integral value such as 1.0 is still refused"
      },
      {
        "kind": "never",
        "when": [
          {
            "field": "surrogate",
            "op": "is",
            "value": "lone"
          }
        ],
        "then": "addressed",
        "why": "a lone escaped surrogate is never digested"
      }
    ],
    "examples": [
      {
        "request": "absent valid ok distinct none",
        "response": "addressed"
      },
      {
        "request": "present invalid json duplicate lone",
        "response": "e-bom"
      },
      {
        "request": "absent invalid ok distinct none",
        "response": "e-utf8"
      },
      {
        "request": "absent valid number-token distinct none",
        "response": "e-num-token"
      },
      {
        "request": "absent valid trailing duplicate none",
        "response": "e-trailing"
      },
      {
        "request": "absent valid ok duplicate lone",
        "response": "e-dup-name"
      },
      {
        "request": "absent valid ok colliding lone",
        "response": "e-surrogate"
      },
      {
        "request": "absent valid ok colliding none",
        "response": "e-nfc-collision"
      }
    ]
  },
  "stakeholders": [
    {
      "name": "Context implementer",
      "text": "Writes an implementation of the digest context and needs the same refusal code as every other implementation for every input.",
      "concerns": [
        "Correct answers",
        "Proved guarantees"
      ]
    },
    {
      "name": "Registry maintainer",
      "text": "Cites the context's final corpus in a registry entry and needs no inadmissible document to receive an address.",
      "concerns": [
        "Proved guarantees",
        "Refused malformed requests"
      ]
    }
  ],
  "components": [
    {
      "name": "Reference implementation",
      "text": "uor_jcs_nfc_ref.py, admit and canonicalize written from SPEC.md.",
      "kind": "cliAdapter"
    },
    {
      "name": "Conformance corpus",
      "text": "conformance/uor-jcs-nfc-vectors-v0.1-rc5.json and its mutation suite run_mutants.py.",
      "kind": "externalSystem"
    }
  ],
  "threats": [
    {
      "name": "Merged colliding names",
      "text": "An implementation merges members whose names collide after NFC, giving two documents one address.",
      "stride": "tampering",
      "asset": "answer",
      "likelihood": "medium",
      "impact": "critical",
      "control": {
        "name": "Collision refusal",
        "text": "Colliding names are refused, never addressed.",
        "evidence": [
          {
            "kind": "proof",
            "reference": "JcsNfcAdmissionProofs::inv002Holds"
          },
          {
            "kind": "gate",
            "reference": "UOR-Foundation/uor-jcs-nfc conformance/run_mutants.py"
          }
        ]
      }
    },
    {
      "name": "Integral float admitted",
      "text": "A type-based guard admits 1.0 or 2^53 as a float with an integral value.",
      "stride": "tampering",
      "asset": "request",
      "likelihood": "medium",
      "impact": "major",
      "control": {
        "name": "Lexical number admission",
        "text": "Number tokens are validated as text.",
        "evidence": [
          {
            "kind": "proof",
            "reference": "JcsNfcAdmissionProofs::inv003Holds"
          },
          {
            "kind": "review",
            "reference": "UOR-Foundation/uor-jcs-nfc SPEC.md 8 mutation probes"
          }
        ]
      }
    },
    {
      "name": "Different Unicode database",
      "text": "NFC under a Unicode version other than 15.0.0 normalizes differently and yields another digest.",
      "stride": "tampering",
      "asset": "source",
      "likelihood": "medium",
      "impact": "major",
      "accepted": "The app takes the collision finding as given; SPEC.md 1.3 pins Unicode 15.0.0, and gen_vectors.py refuses any other runtime."
    }
  ],
  "quality": [
    {
      "characteristic": "Compatibility",
      "subcharacteristic": "Interoperability",
      "requirement": "One code per input",
      "text": "Every malformed combination receives exactly one of the ten refusal codes SPEC.md 3.8 and 4.3 define.",
      "measure": "Refusal codes",
      "measureText": "Distinct refusal codes the app answers.",
      "threshold": 10
    },
    {
      "characteristic": "Security",
      "subcharacteristic": "Integrity",
      "requirement": "No refused document addressed",
      "text": "No document with any refusal finding receives an address.",
      "measure": "Addressed refusals",
      "measureText": "Acceptance vectors with a refusal finding answered addressed.",
      "threshold": 0
    }
  ],
  "journeys": [
    {
      "stakeholder": "Context implementer",
      "steps": [
        "REQ-001",
        "REQ-002",
        "REQ-003",
        "REQ-007",
        "REQ-008",
        "REQ-009",
        "REQ-010",
        "otherwise"
      ]
    },
    {
      "stakeholder": "Registry maintainer",
      "steps": [
        "INV-001",
        "INV-002",
        "INV-003",
        "INV-004",
        "refuse"
      ]
    }
  ],
  "concerns": [],
  "axioms": {}
}
```

## Claims

- JN-01: The app always answers e-bom when bom is present
- JN-02: The app never answers addressed when names is colliding
- JN-03: The app never answers addressed when parse is number-token
- JN-04: The app never answers addressed when surrogate is lone
- JN-05: The architecture description declares every stakeholder, concern, component, edge, viewpoint and view it references
- JN-06: The ISO/IEC 25010 quality model numbers every characteristic, subcharacteristic, requirement and measure, and every parent it names is declared
- JN-07: Every compliance obligation is numbered in order and names its evidence

## Pattern

Decision table: OMG DMN 1.5, hit policy FIRST. The rules are tried in order, and the first one that matches gives the answer. If none matches, the default answer applies. This is a DMN decision table with the FIRST hit policy.

| Pattern | Standard | Answers |
| --- | --- | --- |
| Decision table | OMG DMN 1.5, hit policy FIRST | addressed, e-bom, e-utf8, e-json, e-num-token, e-num-range, e-constant, e-trailing, e-dup-name, e-surrogate, e-nfc-collision |

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

|  | rules |
| --- | --- |
| addressed | 0 |
| e-bom | 1 |
| e-utf8 | 1 |
| e-json | 1 |
| e-num-token | 1 |
| e-num-range | 1 |
| e-constant | 1 |
| e-trailing | 1 |
| e-dup-name | 1 |
| e-surrogate | 1 |
| e-nfc-collision | 1 |

## Behavior

A request is bom, utf8, parse, names, surrogate, separated by spaces. The first rule that matches decides. If none matches, the answer is addressed. A request over 136 bytes, or in any other form, is answered invalid.

| Rule | When | Answer | Why |
| --- | --- | --- | --- |
| REQ-001 | bom is present | e-bom | SPEC.md 3.2 and 3.9: E\_BOM is a byte-level check before parsing and comes first |
| REQ-002 | utf8 is invalid | e-utf8 | SPEC.md 3.1 and 3.9: E\_UTF8 follows E\_BOM |
| REQ-003 | parse is json | e-json | SPEC.md 3.9: parse-time codes fire in input order |
| REQ-004 | parse is number-token | e-num-token | SPEC.md 3.5: tokens such as 1.0 and 1e0 are refused as text |
| REQ-005 | parse is number-range | e-num-range | SPEC.md 3.5: values outside the safe-integer bound are refused |
| REQ-006 | parse is constant | e-constant | SPEC.md 3.6: NaN and Infinity are refused |
| REQ-007 | parse is trailing | e-trailing | SPEC.md 3.3 and 3.9: the remainder check follows the parse-time codes |
| REQ-008 | names is duplicate | e-dup-name | SPEC.md 3.4 and 3.9: duplicates after escape decoding, a post-parse scan |
| REQ-009 | surrogate is lone | e-surrogate | SPEC.md 3.7 and 3.9: E\_SURROGATE follows E\_DUP\_NAME |
| REQ-010 | names is colliding | e-nfc-collision | SPEC.md 4.1 and 4.3: NFC precedes member sort, and post-normalization collisions are refused in canonicalization, after admission |
| otherwise | no rule matches | addressed | SPEC.md 5 and uor\_jcs\_nfc\_ref.py address\_json: an admitted, canonicalized document is digested |

## 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 always answers e-bom when bom is present. | JcsNfcAdmissionProofs::inv001Holds | one malformed input receives one code, and E\_BOM has precedence |
| INV-002 | It never answers addressed when names is colliding. | JcsNfcAdmissionProofs::inv002Holds | a collision is never resolved by last-write-wins, first-write-wins or merging |
| INV-003 | It never answers addressed when parse is number-token. | JcsNfcAdmissionProofs::inv003Holds | an integral value such as 1.0 is still refused |
| INV-004 | It never answers addressed when surrogate is lone. | JcsNfcAdmissionProofs::inv004Holds | a lone escaped surrogate is never digested |

## Architecture

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

| Stakeholder | Who they are | Concerns |
| --- | --- | --- |
| Context implementer | Writes an implementation of the digest context and needs the same refusal code as every other implementation for every input. | Correct answers, Proved guarantees |
| Registry maintainer | Cites the context's final corpus in a registry entry and needs no inadmissible document to receive an address. | Proved guarantees, Refused malformed requests |
| 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 addressed 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 |

## 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 JCS NFC admission guest. |
| Conformance corpus | externalSystem | conformance/uor-jcs-nfc-vectors-v0.1-rc5.json and its mutation suite run\_mutants.py. |
| GitHub Pages | externalSystem | Serves the page and the holo from the repository Pages workflow. |
| JCS NFC admission 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. |
| JCS NFC admission 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. |
| Reference implementation | cliAdapter | uor\_jcs\_nfc\_ref.py, admit and canonicalize written from SPEC.md. |
| 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 JCS NFC admission request | opmObjectProcess | Context implementer: Correct answers |
| Components of JCS NFC admission | umlComponent | Verifier: Integrity of the published app |
| Answering a JCS NFC admission request | umlSequence | Context implementer: Correct answers |
| States of the JCS NFC admission guest | umlStateMachine | Registry maintainer: 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 bom is present, the answer is e-bom. | JcsNfcAdmission::rule1, JcsNfcAdmission::judge | JcsNfcAdmission::application |
| When utf8 is invalid, the answer is e-utf8. | JcsNfcAdmission::rule2, JcsNfcAdmission::judge | JcsNfcAdmission::application |
| When parse is json, the answer is e-json. | JcsNfcAdmission::rule3, JcsNfcAdmission::judge | JcsNfcAdmission::application |
| When parse is number-token, the answer is e-num-token. | JcsNfcAdmission::rule4, JcsNfcAdmission::judge | JcsNfcAdmission::application |
| When parse is number-range, the answer is e-num-range. | JcsNfcAdmission::rule5, JcsNfcAdmission::judge | JcsNfcAdmission::application |
| When parse is constant, the answer is e-constant. | JcsNfcAdmission::rule6, JcsNfcAdmission::judge | JcsNfcAdmission::application |
| When parse is trailing, the answer is e-trailing. | JcsNfcAdmission::rule7, JcsNfcAdmission::judge | JcsNfcAdmission::application |
| When names is duplicate, the answer is e-dup-name. | JcsNfcAdmission::rule8, JcsNfcAdmission::judge | JcsNfcAdmission::application |
| When surrogate is lone, the answer is e-surrogate. | JcsNfcAdmission::rule9, JcsNfcAdmission::judge | JcsNfcAdmission::application |
| When names is colliding, the answer is e-nfc-collision. | JcsNfcAdmission::rule10, JcsNfcAdmission::judge | JcsNfcAdmission::application |
| When no rule matches, the answer is addressed. | JcsNfcAdmission::judge | JcsNfcAdmission::application |
| A request that is not bom, utf8, parse, names, surrogate in order, separated by single spaces, or is over 136 bytes, is answered invalid. | JcsNfcAdmission::dispatch, JcsNfcAdmission::decodeField1 | JcsNfcAdmission::application |
| It always answers e-bom when bom is present. | JcsNfcAdmission::judge | JcsNfcAdmissionProofs::inv001Holds |
| It never answers addressed when names is colliding. | JcsNfcAdmission::judge | JcsNfcAdmissionProofs::inv002Holds |
| It never answers addressed when parse is number-token. | JcsNfcAdmission::judge | JcsNfcAdmissionProofs::inv003Holds |
| It never answers addressed when surrogate is lone. | JcsNfcAdmission::judge | JcsNfcAdmissionProofs::inv004Holds |

## Journeys

The ordered features each stakeholder takes.

| Stakeholder | Steps |
| --- | --- |
| Context implementer | REQ-001 → REQ-002 → REQ-003 → REQ-007 → REQ-008 → REQ-009 → REQ-010 → otherwise |
| Registry maintainer | INV-001 → INV-002 → INV-003 → INV-004 → refuse |
| 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 JcsNfcAdmissionProofs::inv001Holds |
| Answer that breaks INV-002 | repudiation | Answer | medium likelihood, critical impact | Proof of INV-002: proof JcsNfcAdmissionProofs::inv002Holds |
| Answer that breaks INV-003 | repudiation | Answer | medium likelihood, critical impact | Proof of INV-003: proof JcsNfcAdmissionProofs::inv003Holds |
| Answer that breaks INV-004 | repudiation | Answer | medium likelihood, critical impact | Proof of INV-004: proof JcsNfcAdmissionProofs::inv004Holds |
| Different Unicode database | tampering | Model source | medium likelihood, major impact | accepted: The app takes the collision finding as given; SPEC.md 1.3 pins Unicode 15.0.0, and gen\_vectors.py refuses any other runtime. |
| Granted capability | informationDisclosure | Answer | low likelihood, major impact | No capability granted: gate prism-code check refuses an ungranted guest import |
| Integral float admitted | tampering | Request bytes | medium likelihood, major impact | Lexical number admission: proof JcsNfcAdmissionProofs::inv003Holds; review UOR-Foundation/uor-jcs-nfc SPEC.md 8 mutation probes |
| Malformed request | tampering | Request bytes | high likelihood, major impact | Strict decoder: gate malformed-request acceptance vectors, replayed in the compiled guest by prismpm verify |
| Merged colliding names | tampering | Answer | medium likelihood, critical impact | Collision refusal: proof JcsNfcAdmissionProofs::inv002Holds; gate UOR-Foundation/uor-jcs-nfc conformance/run\_mutants.py |
| 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 |

## 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, addressed otherwise, or invalid. | Functional suitability: Functional completeness | Unanswered requests | 0 |
| Every vector replays: All 40 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 |
| No refused document addressed: No document with any refusal finding receives an address. | Security: Integrity | Addressed refusals | 0 |
| One code per input: Every malformed combination receives exactly one of the ten refusal codes SPEC.md 3.8 and 4.3 define. | Compatibility: Interoperability | Refusal codes | 10 |

## 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 |
| OMG DMN 1.5, hit policy FIRST | Decision table | JcsNfcAdmission::judge |
| OpenSpec | Requirements | JcsNfcAdmission::application |
| SPDX Apache-2.0 | Licensing | JcsNfcAdmission::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 JCS NFC admission request
Viewpoint: Architecture::viewpointContextImplementerCorrectAnswers
Notation: ISO/PAS 19450:2015 OPM, Prism OPL profile

componentBrowser is an object.
componentJCSNFCAdmissionGuest is an object.
componentJCSNFCAdmissionGuest can be stateDeciding or stateIdle.
processDecide is a process.
processEncodeAnswer is a process.
processJudge is a process.
processParseRequest is a process.
componentJCSNFCAdmissionGuest 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 JCS NFC admission
component "componentBrowser" as c0
component "componentConformanceCorpus" as c1
component "componentGitHubPages" as c2
component "componentJCSNFCAdmissionGuest" as c3
component "componentJCSNFCAdmissionPage" as c4
component "componentPrismBuild" as c5
component "componentReferenceImplementation" as c6
component "componentSourceRepository" as c7
c0 --> c3 : edgeBrowserToJCSNFCAdmissionGuest
c1 --> c3 : edgeConformanceCorpusToJCSNFCAdmissionGuest
c2 --> c0 : edgeGitHubPagesToBrowser
c3 --> c0 : edgeJCSNFCAdmissionGuestToBrowser
c3 --> c1 : edgeJCSNFCAdmissionGuestToConformanceCorpus
c3 --> c6 : edgeJCSNFCAdmissionGuestToReferenceImplementation
c4 --> c2 : edgeJCSNFCAdmissionPageToGitHubPages
c5 --> c3 : edgePrismBuildToJCSNFCAdmissionGuest
c5 --> c4 : edgePrismBuildToJCSNFCAdmissionPage
c6 --> c3 : edgeReferenceImplementationToJCSNFCAdmissionGuest
c7 --> c5 : edgeSourceRepositoryToPrismBuild
@enduml

```

### design/Design.viewUmlRequest.puml

```
@startuml
' UML 2.5.1 sequence diagram
' view: Design::viewUmlRequest
' viewpoint: Architecture::viewpointContextImplementerCorrectAnswers
title Answering a JCS NFC admission request
participant "componentBrowser" as p0
participant "componentJCSNFCAdmissionGuest" 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::viewpointRegistryMaintainerRefusedMalformedRequests
title States of the JCS NFC admission guest
state "stateAnsweredAddressed" as s0
state "stateAnsweredEBom" as s1
state "stateAnsweredEConstant" as s2
state "stateAnsweredEDupName" as s3
state "stateAnsweredEJson" as s4
state "stateAnsweredENfcCollision" as s5
state "stateAnsweredENumRange" as s6
state "stateAnsweredENumToken" as s7
state "stateAnsweredESurrogate" as s8
state "stateAnsweredETrailing" as s9
state "stateAnsweredEUtf8" as s10
state "stateDeciding" as s11
state "stateIdle" as s12
state "stateRefused" as s13
[*] --> s12
s12 --> s11 : processParseRequest
s12 --> s13 : processParseRequest
s11 --> s1 : processRule1
s11 --> s10 : processRule2
s11 --> s4 : processRule3
s11 --> s7 : processRule4
s11 --> s6 : processRule5
s11 --> s2 : processRule6
s11 --> s9 : processRule7
s11 --> s3 : processRule8
s11 --> s8 : processRule9
s11 --> s5 : processRule10
s11 --> s0 : processOtherwise
s0 --> s12 : processEncodeAnswer
s1 --> s12 : processEncodeAnswer
s10 --> s12 : processEncodeAnswer
s4 --> s12 : processEncodeAnswer
s7 --> s12 : processEncodeAnswer
s6 --> s12 : processEncodeAnswer
s2 --> s12 : processEncodeAnswer
s9 --> s12 : processEncodeAnswer
s3 --> s12 : processEncodeAnswer
s8 --> s12 : processEncodeAnswer
s5 --> s12 : processEncodeAnswer
s13 --> s12 : processEncodeAnswer
@enduml

```

## Prism source

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

- app/src/Architecture.lex.tex (406 lines)
- app/src/Compliance.lex.tex (56 lines)
- app/src/Design.lex.tex (801 lines)
- app/src/Features.lex.tex (172 lines)
- app/src/Quality.lex.tex (382 lines)
- app/src/Security.lex.tex (593 lines)
- app/src/JcsNfcAdmission.lex.tex (324 lines)
- app/src/JcsNfcAdmissionProofs.lex.tex (233 lines)
- app/lexlean.toml (43 lines)
- app/prompt.json (421 lines)
- model/ids.toml (65 lines)
- features/suites/jcs\_nfc\_admission.feature (44 lines)
- crates/conformance/tests/jcs\_nfc\_admission.rs (132 lines)
- site/app.json (121 lines)
- openspec/specs/jcs-nfc-admission/spec.md (248 lines)
