!!id:"https://tson.io/2026/37/m/policy.tn?sha256=f2159051c9b7397203272dd5a92c229c1ca0829546032f323db39f4c3eaddca3" !!meta:"https://tson.io/2026/37/m/meta.tn?sha256=568b589bdb162f5390ca46f6a941339d7b92ecb236bf233f8ed992b359b47a90" !!import:"https://tson.io/2026/37/m/core.tn?sha256=4845f0c17bd0753f70cfe34ed3a537445e6a5b551b3b68541696ffe9e50d5065" @doc:""" TSON processor policy — what a processor admits and spends (2026 Revision 37 draft). A processor's policy is a property of the deployment, never of a schema ([TSON-DATA] §8.2): a schema that declared its own strictness would choose its own check. This document declares the policy's vocabulary, so a processor states the policy it judged under in one shape, and a deployment that writes its policy down writes a data document of type `policy`. Such a document is named at the call site and never resolved by identity, and no document may name, import or otherwise select the policy it is judged under. `identifier_policy` and `token_policy` are §8.2's two policies, and `limits` is §9.1's. A script is named by its Unicode Script property value alias (UAX #24), `Latin`, `Cyrillic`, `Han`. """ { @doc:"UTS #39 §5.2's restriction levels, strictest first." restriction_level => !enum [ ASCII_ONLY SINGLE_SCRIPT HIGHLY_RESTRICTIVE MODERATELY_RESTRICTIVE MINIMALLY_RESTRICTIVE UNRESTRICTED ] @doc:""" [TSON-DATA] §8.2's token policy: the restriction level over each whole token, and any script combinations admitted over the level (UTS #39 §5.2's own device for Latn+Jpan and its siblings), each entry in `permitting` one such combination. """ script_policy => { level: restriction_level permitting: [[text]] } @doc:""" [TSON-DATA] §8.2's identifier policy: the restriction level, whether it applies to each segment of a name rather than to the whole of it, whether no two names in one scope may share a UTS #39 skeleton, and any script combinations admitted over the level, as `script_policy` states them. """ identifier_policy => { level: restriction_level per_segment: boolean skeleton_distinctness: boolean permitting: [[text]] } @doc:""" [TSON-DATA] §9.1's resource limits: what a processor will spend reading one document, as against what it admits as a name. A limit refusal is not a verdict on the document. """ limits => { max_depth: int32 } @doc:""" The policy a processor judges a document under: §8.2's identifier and token policies and §9.1's limits. `unicode_data_version` is the UCD release whose tables the §8.2 rules read, which a report states beside the policy (§8.2) and a deployment's own policy document leaves out, the tables being the processor's rather than the deployment's choice. """ policy => { identifier_policy: identifier_policy token_policy: script_policy unicode_data_version?: text limits: limits } }