packages feed

okf-core 0.5.0.0 → 0.8.0.0

raw patch · 60 files changed

Files

CHANGELOG.md view
@@ -7,6 +7,108 @@  ## [Unreleased] +## [0.8.0.0] - 2026-08-19++### Added++- `HandleReferenceRule` can prohibit local handles with `allowLocal` and narrow+  external references with an optional whole-value POSIX ERE. The compiled+  matcher is reused during validation, while URI syntax and scheme checks still+  run first and no external target is resolved.+- `NestedFieldRule.reference` applies the same compiled reference semantics to+  members of record lists and object-valued fields.+- `FieldRule.uniqueBy` enforces list-local uniqueness for one unconditionally+  required scalar member. `fieldRuleUniqueBy` exposes the effective merged key+  without exposing `EffectiveFieldRule` constructors.++### Changed++- **Breaking:** the raw profile schema and JSON representation add+  `allowLocal`, `externalUriPattern`, nested `reference`, and `uniqueBy`.+  Compatibility decoding supplies `True`, `Nothing`, `Nothing`, and `Nothing`+  respectively for descriptors written against 0.7.0.0 and earlier.+- **Breaking:** `ProfileDefinitionError` and `ProfileViolation` add structured+  cases for invalid/conflicting patterns, invalid uniqueness declarations,+  local-handle prohibition, pattern mismatch, and duplicate nested values.+- Generated profile documentation prints effective local/external reference+  constraints at both rule depths and a fixed `Unique by` bullet.++## [0.7.0.0] - 2026-08-18++### Added++- `RegistryLoadError`, `ProfileSourceLoadError`, `loadRegistryDetailed`,+  `loadProfileSourceDetailed`, and `loadProfileSourcesDetailed` add stable typed+  failure categories while the existing text-returning APIs preserve their+  signatures. `looksLikeRegistryPath` lets callers distinguish actionable+  filesystem intent from remote URLs and raw Dhall expressions.+- `Okf.Profile.Discovery` finds `.dhall` files that decode as profiles using a+  bounded, failure-tolerant walk and a loader that rejects fresh remote+  imports. `ProfileSource` now includes one-file `DescriptorSource` values so+  local descriptors participate in provenance-aware enumeration.+- `ProfileSource`, `SourcedProfile`, and `SourceFailure` add provenance-aware,+  ordered multi-source registry enumeration without changing `RegistryEntry` or+  the existing single-registry functions. Partial failures are returned beside+  successful profiles, collisions remain visible, and exact duplicate sources+  are normalized in first-occurrence order.+- An offline snapshot of the built-in profile catalogue and a registry+  conformance test prove that every pinned export decodes under the current+  `ProfileSpec` compatibility chain. The exact ten export paths are asserted so+  a partial or unintended catalogue refresh fails loudly.++### Changed++- `defaultRegistryReference` now pins `mori://shinzui/okf-profiles` v0.10.0 and+  its normalized sha256 hash, replacing v0.4.2. The public registry API is+  unchanged.++## [0.6.0.1] - 2026-08-16++No library changes. Released to keep the version in step with `okf-cli`+`0.6.0.1`, which fixes how profile diagnostics render non-ASCII values.++## [0.6.0.0] - 2026-08-11++### Added++- `Okf.Query`: selecting concepts out of a walked bundle by what their+  frontmatter says. `parseFieldEquals` reads a `KEY=VALUE` filter and+  `parseFieldSelector` a `KEY` or `PARENT.MEMBER` path; `conceptFieldValues`+  pulls the values a filter is about out of one concept, `matchesFilter` answers+  one question, and `filterConcepts` answers a list of them, reading repeated+  keys as any-of and different keys as all-of while preserving `walkBundle`+  order.++  A filter is **existential** over a list: `tags=cli` selects a concept tagged+  `[profiles, cli]`, because a person asking for `cli` wants the concepts that+  mention it. A profile's closed-vocabulary check stays universal for the same+  key, because there the question is whether the key may *ever* hold that value.+  A nested selector reads through both shapes a profile can describe, an+  object-valued key and a list of records, since OKF v0.2 permits `verified` as+  either spelling.++  Matching lives here rather than in the CLI so a consumer gets it without+  spawning a subprocess.+- `Okf.Query.checkFiltersAgainstProfile` checks filters against a+  `CompiledProfile` and returns `FilterProfileError` values naming a key no+  relevant type declares, or a value outside a closed vocabulary. It is offline+  and pure: it receives a compiled profile and decides.++  A profile-declared rule is consulted **before** the core OKF key list, never+  after — `status` sits in both, and the other order would exempt exactly the key+  a house profile is most likely to close. A `type` filter is additionally+  checked against the profile's declared type names when+  `allowUnknownTypes = False`, since that is how a profile spells its+  concept-type vocabulary.++### Changed++- **Nothing breaks in this release.** `okf-core` 0.6.0.0 is additive — one new+  module, no changed type and no removed export — and the major bump only+  reflects the shared version it carries with `okf-cli`, which does break. Prior+  major bumps here each carried a real break, so this one is worth naming: a+  consumer upgrading from 0.5.0.0 has nothing to change.+ ## [0.5.0.0] - 2026-08-01  ### Added
dhall/FieldRule.dhall view
@@ -23,6 +23,10 @@ -- mapping. Declaring it alongside `cardinality = Cardinality.Scalar` or -- `Cardinality.List` is a profile definition error, because a mapping is -- neither.+--+-- `uniqueBy = Some key` applies only to `elementFields`: the named nested key+-- must be unconditionally required and scalar, and its present values must be+-- unique within each one parent list. `None` performs no comparison. let Cardinality = ./Cardinality.dhall  let FieldFormat = ./FieldFormat.dhall@@ -45,4 +49,5 @@     , reference : Optional HandleReferenceRule     , path : Optional PathReferenceRule     , when : Optional FieldCondition+    , uniqueBy : Optional Text     }
dhall/HandleReferenceRule.dhall view
@@ -1,7 +1,12 @@---| Policy for a top-level field containing local document handles or explicit--- external URI alternatives. okf resolves only the local handle and never--- performs network or registry lookups for an external URI.+--| Policy for a top-level or nested field containing local document handles or+-- explicit external URI alternatives. `allowLocal` can prohibit the local+-- spelling; `externalUriPattern`, when present, is a whole-value POSIX extended+-- regular expression applied after URI syntax and scheme checks. okf resolves+-- only an allowed local handle and never performs network or registry lookups+-- for an external URI. { localPrefix : Text , externalUriSchemes : List Text , allowSelf : Bool+, allowLocal : Bool+, externalUriPattern : Optional Text }
dhall/NestedFieldRule.dhall view
@@ -5,13 +5,11 @@ -- are bounded to one level of flat records rather than recursively nested -- objects. ----- It does carry `path`, because `sources[].resource` — the motivating--- path-valued field of OKF v0.2 specification §6.2 — lives inside a list element--- record and is unreachable from a top-level rule. It deliberately does not--- carry `reference`: no v0.2 field names a `PREFIX-N` document handle inside a--- nested record, and adding an unused member to a published record is a--- compatibility event bought for nothing. It is a cheap additive change for--- whoever has a motivating case.+-- It carries `path`, because `sources[].resource` — the motivating path-valued+-- field of OKF v0.2 specification §6.2 — lives inside a list element record and+-- is unreachable from a top-level rule. It also carries `reference`, so a+-- member such as `dependencies[].ref` can prohibit local handles and constrain+-- which external artifact URI family its text names. let Cardinality = ./Cardinality.dhall  let FieldFormat = ./FieldFormat.dhall@@ -20,6 +18,8 @@  let PathReferenceRule = ./PathReferenceRule.dhall +let HandleReferenceRule = ./HandleReferenceRule.dhall+ in  { field : Text     , description : Optional Text     , allowedValues : List Text@@ -27,4 +27,5 @@     , format : Optional FieldFormat     , path : Optional PathReferenceRule     , when : Optional FieldCondition+    , reference : Optional HandleReferenceRule     }
dhall/defaults/FieldRule.dhall view
@@ -24,5 +24,6 @@       , reference = None HandleReferenceRule       , path = None PathReferenceRule       , when = None FieldCondition+      , uniqueBy = None Text       }     }
dhall/defaults/HandleReferenceRule.dhall view
@@ -5,5 +5,7 @@     , default =       { externalUriSchemes = [] : List Text       , allowSelf = False+      , allowLocal = True+      , externalUriPattern = None Text       }     }
dhall/defaults/NestedFieldRule.dhall view
@@ -9,6 +9,8 @@  let PathReferenceRule = ../PathReferenceRule.dhall +let HandleReferenceRule = ../HandleReferenceRule.dhall+ in  { Type = NestedFieldRuleType     , default =       { description = None Text@@ -17,5 +19,6 @@       , format = None FieldFormat       , path = None PathReferenceRule       , when = None FieldCondition+      , reference = None HandleReferenceRule       }     }
okf-core.cabal view
@@ -1,6 +1,6 @@ cabal-version:      3.4 name:               okf-core-version:            0.5.0.0+version:            0.8.0.0 synopsis:   Read, validate, index, and traverse Open Knowledge Format bundles @@ -31,6 +31,7 @@   test/fixtures/**/*.md   test/fixtures/**/*.py   test/fixtures/**/*.sql+  test/fixtures/**/*.txt  common common-options   ghc-options:@@ -62,8 +63,10 @@     Okf.Path     Okf.Prelude     Okf.Profile+    Okf.Profile.Discovery     Okf.Profile.Documentation     Okf.Profile.Registry+    Okf.Query     Okf.Trust     Okf.Validation @@ -81,6 +84,7 @@     , generic-lens  >=2.2   && <2.4     , lens          ^>=5.3     , network-uri   >=2.6.4 && <2.7+    , regex-tdfa    >=1.3.2 && <1.4     , text          ^>=2.1     , time          >=1.12  && <1.15     , vector        >=0.13  && <0.14
src/Okf/Discovery.hs view
@@ -15,6 +15,8 @@     defaultDiscoveryOptions,     discoverBundleRoots,     directoryQualifiesAsBundleRoot,+    isSearchableDirectory,+    listDirectorySafe,   ) where 
src/Okf/Profile.hs view
@@ -56,6 +56,7 @@     fieldRuleCardinality,     fieldRuleFormat,     fieldRuleReference,+    fieldRuleUniqueBy,     fieldRulePath,     fieldRuleElementFields,     fieldRuleObjectFields,@@ -92,7 +93,6 @@ import Data.Map.Strict (Map) import Data.Map.Strict qualified as Map import Data.Maybe (catMaybes, mapMaybe)-import Data.Set (Set) import Data.Set qualified as Set import Data.Text qualified as Text import Data.Text.Read qualified as Text.Read@@ -144,6 +144,8 @@ import Okf.Prelude hiding (List, Object, (.=)) import Okf.Validation (ValidationProfile (..)) import System.FilePath qualified as FilePath+import Text.Regex.TDFA (Regex, defaultCompOpt, defaultExecOpt)+import Text.Regex.TDFA.Text qualified as Regex.Text import "generic-lens" Data.Generics.Labels ()  -- | A complete house profile. @description@ is prose documenting the profile as@@ -197,7 +199,9 @@ data HandleReferenceRule = HandleReferenceRule   { localPrefix :: !Text,     externalUriSchemes :: ![Text],-    allowSelf :: !Bool+    allowSelf :: !Bool,+    allowLocal :: !Bool,+    externalUriPattern :: !(Maybe Text)   }   deriving stock (Generic, Eq, Ord, Show)   deriving anyclass (FromDhall)@@ -243,7 +247,8 @@     objectFields :: !(Maybe NestedRules),     reference :: !(Maybe HandleReferenceRule),     path :: !(Maybe PathReferenceRule),-    when :: !(Maybe FieldCondition)+    when :: !(Maybe FieldCondition),+    uniqueBy :: !(Maybe Text)   }   deriving stock (Generic, Eq, Show)   deriving anyclass (FromDhall)@@ -271,7 +276,8 @@     cardinality :: !Cardinality,     format :: !(Maybe FieldFormat),     path :: !(Maybe PathReferenceRule),-    when :: !(Maybe FieldCondition)+    when :: !(Maybe FieldCondition),+    reference :: !(Maybe HandleReferenceRule)   }   deriving stock (Generic, Eq, Show)   deriving anyclass (FromDhall)@@ -385,11 +391,13 @@       ]  instance ToJSON HandleReferenceRule where-  toJSON HandleReferenceRule {localPrefix, externalUriSchemes, allowSelf} =+  toJSON HandleReferenceRule {localPrefix, externalUriSchemes, allowSelf, allowLocal, externalUriPattern} =     object       [ "localPrefix" .= localPrefix,         "externalUriSchemes" .= externalUriSchemes,-        "allowSelf" .= allowSelf+        "allowSelf" .= allowSelf,+        "allowLocal" .= allowLocal,+        "externalUriPattern" .= externalUriPattern       ]  instance ToJSON PathReferenceRule where@@ -400,7 +408,7 @@       ]  instance ToJSON FieldRule where-  toJSON FieldRule {field = fieldName, description, allowedValues, cardinality, format, elementFields, objectFields, reference, path = pathRule, when = condition} =+  toJSON FieldRule {field = fieldName, description, allowedValues, cardinality, format, elementFields, objectFields, reference, path = pathRule, when = condition, uniqueBy} =     object       [ "field" .= fieldName,         "description" .= description,@@ -414,7 +422,8 @@         -- reads as "the keys this instance has always emitted, then the ones         -- added since". A consumer keys on names, not position.         "objectFields" .= objectFields,-        "path" .= pathRule+        "path" .= pathRule,+        "uniqueBy" .= uniqueBy       ]  instance ToJSON NestedRules where@@ -426,7 +435,7 @@       ]  instance ToJSON NestedFieldRule where-  toJSON NestedFieldRule {field = fieldName, description, allowedValues, cardinality, format, path = pathRule, when = condition} =+  toJSON NestedFieldRule {field = fieldName, description, allowedValues, cardinality, format, path = pathRule, when = condition, reference} =     object       [ "field" .= fieldName,         "description" .= description,@@ -435,7 +444,8 @@         "format" .= format,         "when" .= condition,         -- Appended for the same reason 'FieldRule' appends @objectFields@.-        "path" .= pathRule+        "path" .= pathRule,+        "reference" .= reference       ]  instance ToJSON Cardinality where@@ -569,6 +579,96 @@   LegacyUriWithScheme scheme -> UriWithScheme scheme   LegacyDocumentHandle prefix -> DocumentHandle prefix +-- | The complete 0.7.0.0 descriptor generation, frozen before nested+-- document-reference policies and record-list uniqueness were added. Every+-- record that directly or transitively contains one of the grown records is+-- copied so a descriptor pinned to 0.7.0.0 remains decodable as one closed+-- Dhall type.+data PreNestedReferenceHandleReferenceRule = PreNestedReferenceHandleReferenceRule+  { localPrefix :: !Text,+    externalUriSchemes :: ![Text],+    allowSelf :: !Bool+  }+  deriving stock (Generic, Eq, Ord, Show)+  deriving anyclass (FromDhall)++data PreNestedReferenceFieldRule = PreNestedReferenceFieldRule+  { field :: !Text,+    description :: !(Maybe Text),+    allowedValues :: ![Text],+    cardinality :: !Cardinality,+    format :: !(Maybe FieldFormat),+    elementFields :: !(Maybe PreNestedReferenceNestedRules),+    objectFields :: !(Maybe PreNestedReferenceNestedRules),+    reference :: !(Maybe PreNestedReferenceHandleReferenceRule),+    path :: !(Maybe PathReferenceRule),+    when :: !(Maybe FieldCondition)+  }+  deriving stock (Generic, Eq, Show)+  deriving anyclass (FromDhall)++data PreNestedReferenceNestedRules = PreNestedReferenceNestedRules+  { required :: ![PreNestedReferenceNestedFieldRule],+    recommended :: ![PreNestedReferenceNestedFieldRule],+    optional :: ![PreNestedReferenceNestedFieldRule]+  }+  deriving stock (Generic, Eq, Show)+  deriving anyclass (FromDhall)++data PreNestedReferenceNestedFieldRule = PreNestedReferenceNestedFieldRule+  { field :: !Text,+    description :: !(Maybe Text),+    allowedValues :: ![Text],+    cardinality :: !Cardinality,+    format :: !(Maybe FieldFormat),+    path :: !(Maybe PathReferenceRule),+    when :: !(Maybe FieldCondition)+  }+  deriving stock (Generic, Eq, Show)+  deriving anyclass (FromDhall)++data PreNestedReferenceFrontmatterRules = PreNestedReferenceFrontmatterRules+  { required :: ![PreNestedReferenceFieldRule],+    recommended :: ![PreNestedReferenceFieldRule],+    optional :: ![PreNestedReferenceFieldRule]+  }+  deriving stock (Generic, Eq, Show)+  deriving anyclass (FromDhall)++data PreNestedReferenceProfileSpec = PreNestedReferenceProfileSpec+  { name :: !Text,+    description :: !(Maybe Text),+    okfVersion :: !Text,+    frontmatter :: !PreNestedReferenceFrontmatterRules,+    allowUnknownTypes :: !Bool,+    allowUnknownFields :: !Bool,+    idField :: !(Maybe Text),+    requireBundleVersion :: !(Maybe Text),+    types :: ![PreNestedReferenceTypeRule]+  }+  deriving stock (Generic, Eq, Show)+  deriving anyclass (FromDhall)++data PreNestedReferenceTypeRule = PreNestedReferenceTypeRule+  { type_ :: !Text,+    description :: !(Maybe Text),+    frontmatter :: !PreNestedReferenceFrontmatterRules,+    pathPattern :: !(Maybe Text),+    resourceScheme :: !(Maybe Text),+    requireSchemaSection :: !Bool,+    schemaColumns :: ![Text],+    idPrefix :: !(Maybe Text)+  }+  deriving stock (Generic, Eq, Show)++instance FromDhall PreNestedReferenceTypeRule where+  autoWith _normalizer =+    genericAutoWith+      (Dhall.defaultInterpretOptions {Dhall.fieldModifier = stripTrailingUnderscore})+    where+      stripTrailingUnderscore fieldName =+        fromMaybe fieldName (Text.stripSuffix "_" fieldName)+ -- | The complete descriptor generation frozen before a profile could require its -- bundle to declare an OKF version. This is the immediately preceding public -- descriptor generation: it is today's shape minus the @requireBundleVersion@@@ -583,11 +683,11 @@   { name :: !Text,     description :: !(Maybe Text),     okfVersion :: !Text,-    frontmatter :: !FrontmatterRules,+    frontmatter :: !PreNestedReferenceFrontmatterRules,     allowUnknownTypes :: !Bool,     allowUnknownFields :: !Bool,     idField :: !(Maybe Text),-    types :: ![TypeRule]+    types :: ![PreNestedReferenceTypeRule]   }   deriving stock (Generic, Eq, Show)   deriving anyclass (FromDhall)@@ -607,7 +707,7 @@     format :: !(Maybe FieldFormat),     elementFields :: !(Maybe PrePathProfileNestedRules),     objectFields :: !(Maybe PrePathProfileNestedRules),-    reference :: !(Maybe HandleReferenceRule),+    reference :: !(Maybe PreNestedReferenceHandleReferenceRule),     when :: !(Maybe FieldCondition)   }   deriving stock (Generic, Eq, Show)@@ -687,7 +787,7 @@     format :: !(Maybe PreV02FieldFormat),     elementFields :: !(Maybe PreActorProfileNestedRules),     objectFields :: !(Maybe PreActorProfileNestedRules),-    reference :: !(Maybe HandleReferenceRule),+    reference :: !(Maybe PreNestedReferenceHandleReferenceRule),     when :: !(Maybe FieldCondition)   }   deriving stock (Generic, Eq, Show)@@ -767,7 +867,7 @@     cardinality :: !Cardinality,     format :: !(Maybe PreV02FieldFormat),     elementFields :: !(Maybe PreObjectProfileNestedRules),-    reference :: !(Maybe HandleReferenceRule),+    reference :: !(Maybe PreNestedReferenceHandleReferenceRule),     when :: !(Maybe FieldCondition)   }   deriving stock (Generic, Eq, Show)@@ -846,7 +946,7 @@     cardinality :: !Cardinality,     format :: !(Maybe PreV02FieldFormat),     elementFields :: !(Maybe ReferenceProfileNestedRules),-    reference :: !(Maybe HandleReferenceRule),+    reference :: !(Maybe PreNestedReferenceHandleReferenceRule),     when :: !(Maybe FieldCondition)   }   deriving stock (Generic, Eq, Show)@@ -1293,6 +1393,83 @@ emptyFrontmatterRules :: FrontmatterRules emptyFrontmatterRules = FrontmatterRules {required = [], recommended = [], optional = []} +upgradePreNestedReferenceHandleRule :: PreNestedReferenceHandleReferenceRule -> HandleReferenceRule+upgradePreNestedReferenceHandleRule previous =+  HandleReferenceRule+    { localPrefix = previous ^. #localPrefix,+      externalUriSchemes = previous ^. #externalUriSchemes,+      allowSelf = previous ^. #allowSelf,+      allowLocal = True,+      externalUriPattern = Nothing+    }++upgradePreNestedReferenceFrontmatter :: PreNestedReferenceFrontmatterRules -> FrontmatterRules+upgradePreNestedReferenceFrontmatter previous =+  FrontmatterRules+    { required = map upgradeField (previous ^. #required),+      recommended = map upgradeField (previous ^. #recommended),+      optional = map upgradeField (previous ^. #optional)+    }+  where+    upgradeField rule =+      FieldRule+        { field = rule ^. #field,+          description = rule ^. #description,+          allowedValues = rule ^. #allowedValues,+          cardinality = rule ^. #cardinality,+          format = rule ^. #format,+          elementFields = upgradeNestedRules <$> rule ^. #elementFields,+          objectFields = upgradeNestedRules <$> rule ^. #objectFields,+          reference = upgradePreNestedReferenceHandleRule <$> rule ^. #reference,+          path = rule ^. #path,+          when = rule ^. #when,+          uniqueBy = Nothing+        }+    upgradeNestedRules rules =+      NestedRules+        { required = map upgradeNestedField (rules ^. #required),+          recommended = map upgradeNestedField (rules ^. #recommended),+          optional = map upgradeNestedField (rules ^. #optional)+        }+    upgradeNestedField rule =+      NestedFieldRule+        { field = rule ^. #field,+          description = rule ^. #description,+          allowedValues = rule ^. #allowedValues,+          cardinality = rule ^. #cardinality,+          format = rule ^. #format,+          path = rule ^. #path,+          when = rule ^. #when,+          reference = Nothing+        }++upgradePreNestedReferenceTypeRule :: PreNestedReferenceTypeRule -> TypeRule+upgradePreNestedReferenceTypeRule rule =+  TypeRule+    { type_ = rule ^. #type_,+      description = rule ^. #description,+      frontmatter = upgradePreNestedReferenceFrontmatter (rule ^. #frontmatter),+      pathPattern = rule ^. #pathPattern,+      resourceScheme = rule ^. #resourceScheme,+      requireSchemaSection = rule ^. #requireSchemaSection,+      schemaColumns = rule ^. #schemaColumns,+      idPrefix = rule ^. #idPrefix+    }++upgradePreNestedReferenceProfile :: PreNestedReferenceProfileSpec -> ProfileSpec+upgradePreNestedReferenceProfile previous =+  ProfileSpec+    { name = previous ^. #name,+      description = previous ^. #description,+      okfVersion = previous ^. #okfVersion,+      frontmatter = upgradePreNestedReferenceFrontmatter (previous ^. #frontmatter),+      allowUnknownTypes = previous ^. #allowUnknownTypes,+      allowUnknownFields = previous ^. #allowUnknownFields,+      idField = previous ^. #idField,+      requireBundleVersion = previous ^. #requireBundleVersion,+      types = map upgradePreNestedReferenceTypeRule (previous ^. #types)+    }+ upgradePrePathProfileFrontmatter :: PrePathProfileFrontmatterRules -> FrontmatterRules upgradePrePathProfileFrontmatter previous =   FrontmatterRules@@ -1310,9 +1487,10 @@           format = rule ^. #format,           elementFields = upgradeNestedRules <$> rule ^. #elementFields,           objectFields = upgradeNestedRules <$> rule ^. #objectFields,-          reference = rule ^. #reference,+          reference = upgradePreNestedReferenceHandleRule <$> rule ^. #reference,           path = Nothing,-          when = rule ^. #when+          when = rule ^. #when,+          uniqueBy = Nothing         }     upgradeNestedRules rules =       NestedRules@@ -1328,7 +1506,8 @@           cardinality = rule ^. #cardinality,           format = rule ^. #format,           path = Nothing,-          when = rule ^. #when+          when = rule ^. #when,+          reference = Nothing         }  upgradePreActorProfileFrontmatter :: PreActorProfileFrontmatterRules -> FrontmatterRules@@ -1348,9 +1527,10 @@           format = upgradePreV02FieldFormat <$> rule ^. #format,           elementFields = upgradeNestedRules <$> rule ^. #elementFields,           objectFields = upgradeNestedRules <$> rule ^. #objectFields,-          reference = rule ^. #reference,+          reference = upgradePreNestedReferenceHandleRule <$> rule ^. #reference,           path = Nothing,-          when = rule ^. #when+          when = rule ^. #when,+          uniqueBy = Nothing         }     upgradeNestedRules rules =       NestedRules@@ -1366,7 +1546,8 @@           cardinality = rule ^. #cardinality,           format = upgradePreV02FieldFormat <$> rule ^. #format,           path = Nothing,-          when = rule ^. #when+          when = rule ^. #when,+          reference = Nothing         }  upgradePreObjectProfileFrontmatter :: PreObjectProfileFrontmatterRules -> FrontmatterRules@@ -1386,9 +1567,10 @@           format = upgradePreV02FieldFormat <$> rule ^. #format,           elementFields = upgradeNestedRules <$> rule ^. #elementFields,           objectFields = Nothing,-          reference = rule ^. #reference,+          reference = upgradePreNestedReferenceHandleRule <$> rule ^. #reference,           path = Nothing,-          when = rule ^. #when+          when = rule ^. #when,+          uniqueBy = Nothing         }     upgradeNestedRules rules =       NestedRules@@ -1404,7 +1586,8 @@           cardinality = rule ^. #cardinality,           format = upgradePreV02FieldFormat <$> rule ^. #format,           path = Nothing,-          when = rule ^. #when+          when = rule ^. #when,+          reference = Nothing         }  upgradeReferenceProfileFrontmatter :: ReferenceProfileFrontmatterRules -> FrontmatterRules@@ -1424,9 +1607,10 @@           format = upgradePreV02FieldFormat <$> rule ^. #format,           elementFields = upgradeNestedRules <$> rule ^. #elementFields,           objectFields = Nothing,-          reference = rule ^. #reference,+          reference = upgradePreNestedReferenceHandleRule <$> rule ^. #reference,           path = Nothing,-          when = rule ^. #when+          when = rule ^. #when,+          uniqueBy = Nothing         }     upgradeNestedRules rules =       NestedRules@@ -1442,7 +1626,8 @@           cardinality = rule ^. #cardinality,           format = upgradePreV02FieldFormat <$> rule ^. #format,           path = Nothing,-          when = rule ^. #when+          when = rule ^. #when,+          reference = Nothing         }  upgradePreviousFrontmatter :: PreviousFrontmatterRules -> FrontmatterRules@@ -1464,7 +1649,8 @@           objectFields = Nothing,           reference = Nothing,           path = Nothing,-          when = Nothing+          when = Nothing,+          uniqueBy = Nothing         }  upgradeConditionalProfileFrontmatter :: ConditionalProfileFrontmatterRules -> FrontmatterRules@@ -1486,7 +1672,8 @@           objectFields = Nothing,           reference = Nothing,           path = Nothing,-          when = rule ^. #when+          when = rule ^. #when,+          uniqueBy = Nothing         }     upgradeNestedRules rules =       NestedRules@@ -1502,7 +1689,8 @@           cardinality = rule ^. #cardinality,           format = upgradePreV02FieldFormat <$> rule ^. #format,           path = Nothing,-          when = rule ^. #when+          when = rule ^. #when,+          reference = Nothing         }  upgradeNestedProfileFrontmatter :: NestedProfileFrontmatterRules -> FrontmatterRules@@ -1524,7 +1712,8 @@           objectFields = Nothing,           reference = Nothing,           path = Nothing,-          when = Nothing+          when = Nothing,+          uniqueBy = Nothing         }     upgradeNestedProfileRules rules =       NestedRules@@ -1540,7 +1729,8 @@           cardinality = rule ^. #cardinality,           format = upgradePreV02FieldFormat <$> rule ^. #format,           path = Nothing,-          when = Nothing+          when = Nothing,+          reference = Nothing         }  upgradeFormatFrontmatter :: FormatFrontmatterRules -> FrontmatterRules@@ -1562,7 +1752,8 @@           objectFields = Nothing,           reference = Nothing,           path = Nothing,-          when = Nothing+          when = Nothing,+          uniqueBy = Nothing         }  upgradeCardinalityFrontmatter :: CardinalityFrontmatterRules -> FrontmatterRules@@ -1584,7 +1775,8 @@           objectFields = Nothing,           reference = Nothing,           path = Nothing,-          when = Nothing+          when = Nothing,+          uniqueBy = Nothing         }  upgradeVocabularyFrontmatter :: VocabularyFrontmatterRules -> FrontmatterRules@@ -1606,26 +1798,25 @@           objectFields = Nothing,           reference = Nothing,           path = Nothing,-          when = Nothing+          when = Nothing,+          uniqueBy = Nothing         } --- | Lift the generation frozen before @requireBundleVersion@ forward. Every rule--- record is shared with today's schema, so this copies members across and--- supplies the one no-op default: a descriptor that predates the member demands--- nothing of its bundle's version declaration, which is what it meant when it--- was written.+-- | Lift the generation frozen before @requireBundleVersion@ forward. Its+-- contained rule records use the shared 0.7.0.0 frozen types because those+-- records later grew too. upgradePreBundleVersionProfile :: PreBundleVersionProfileSpec -> ProfileSpec upgradePreBundleVersionProfile previous =   ProfileSpec     { name = previous ^. #name,       description = previous ^. #description,       okfVersion = previous ^. #okfVersion,-      frontmatter = previous ^. #frontmatter,+      frontmatter = upgradePreNestedReferenceFrontmatter (previous ^. #frontmatter),       allowUnknownTypes = previous ^. #allowUnknownTypes,       allowUnknownFields = previous ^. #allowUnknownFields,       idField = previous ^. #idField,       requireBundleVersion = Nothing,-      types = previous ^. #types+      types = map upgradePreNestedReferenceTypeRule (previous ^. #types)     }  upgradePrePathProfile :: PrePathProfileSpec -> ProfileSpec@@ -1935,7 +2126,7 @@       types = map upgradeRule (legacy ^. #types)     }   where-    undocumented key = FieldRule {field = key, description = Nothing, allowedValues = [], cardinality = Any, format = Nothing, elementFields = Nothing, objectFields = Nothing, reference = Nothing, path = Nothing, when = Nothing}+    undocumented key = FieldRule {field = key, description = Nothing, allowedValues = [], cardinality = Any, format = Nothing, elementFields = Nothing, objectFields = Nothing, reference = Nothing, path = Nothing, when = Nothing, uniqueBy = Nothing}     upgradeRule rule =       TypeRule         { type_ = rule ^. #type_,@@ -1951,7 +2142,7 @@ -- | Load and decode a Dhall profile descriptor from a file path. Any evaluation -- or decoding failure is captured as a human-readable 'Left'. ----- The pre-bundle-version shape, pre-path shape, pre-actor shape, pre-object+-- The pre-nested-reference shape, pre-bundle-version shape, pre-path shape, pre-actor shape, pre-object -- shape, reference-aware shape, -- condition-aware shape, bounded-nested shape, EP-4 -- format shape, EP-3 cardinality shape, EP-2 vocabulary shape, type-aware EP-1@@ -1973,7 +2164,8 @@     -- picks that generation's decoder. Adding a generation is one line here.     frozenDecoders :: [IO (Maybe ProfileSpec)]     frozenDecoders =-      [ attempt upgradePreBundleVersionProfile,+      [ attempt upgradePreNestedReferenceProfile,+        attempt upgradePreBundleVersionProfile,         attempt upgradePrePathProfile,         attempt upgradePreActorProfile,         attempt upgradePreObjectProfile,@@ -2006,7 +2198,7 @@         `catch` \(exception :: SomeException) -> pure (Left (Text.pack (show exception)))  -- | Does an already-evaluated Dhall expression decode as a profile? Tries the--- current schema, then the pre-bundle-version, pre-path, pre-actor, pre-object,+-- current schema, then the pre-nested-reference, pre-bundle-version, pre-path, pre-actor, pre-object, -- reference-aware, -- condition-aware, bounded-nested, EP-4, EP-3, EP-2, EP-1, self-documenting, and -- okf 0.2.x schemas, so the published @okf-profiles@ package still enumerates.@@ -2015,6 +2207,7 @@ decodeProfileExpr :: Expr Src Void -> Maybe ProfileSpec decodeProfileExpr expression =   Dhall.rawInput Dhall.auto expression+    <|> fmap upgradePreNestedReferenceProfile (Dhall.rawInput Dhall.auto expression)     <|> fmap upgradePreBundleVersionProfile (Dhall.rawInput Dhall.auto expression)     <|> fmap upgradePrePathProfile (Dhall.rawInput Dhall.auto expression)     <|> fmap upgradePreActorProfile (Dhall.rawInput Dhall.auto expression)@@ -2076,6 +2269,13 @@   | -- | one rule declares both a document-handle policy and a path policy;     -- a value cannot be resolved as both a handle and a path     PathReferenceWithHandleReference (Maybe Text) FieldPath+  | InvalidExternalUriPattern (Maybe Text) FieldPath Text Text+  | ConflictingExternalUriPatterns Text FieldPath Text Text+  | UniqueByRequiresElementFields (Maybe Text) FieldPath Text+  | UniqueByFieldNotDeclared (Maybe Text) FieldPath+  | UniqueByFieldNotUnconditionallyRequired (Maybe Text) FieldPath+  | UniqueByFieldNotScalar (Maybe Text) FieldPath Cardinality+  | ConflictingUniqueBy Text FieldPath Text Text   | -- | @okfVersion@ is not @\<major\>.\<minor\>@     InvalidProfileOkfVersion Text   | -- | @okfVersion@ names a major version okf does not implement, so okf cannot@@ -2121,10 +2321,41 @@     elementFields :: !(Maybe (Map Text EffectiveFieldRule)),     objectFields :: !(Maybe (Map Text EffectiveFieldRule)),     reference :: !(Maybe HandleReferenceRule),-    path :: !(Maybe PathReferenceRule)+    path :: !(Maybe PathReferenceRule),+    uniqueBy :: !(Maybe Text),+    compiledExternalUriPattern :: !(Maybe Regex)   }-  deriving stock (Generic, Eq, Show)+  deriving stock (Generic) +instance Eq EffectiveFieldRule where+  left == right =+    left ^. #presenceClauses == right ^. #presenceClauses+      && left ^. #description == right ^. #description+      && left ^. #allowedValues == right ^. #allowedValues+      && left ^. #cardinality == right ^. #cardinality+      && left ^. #format == right ^. #format+      && left ^. #elementFields == right ^. #elementFields+      && left ^. #objectFields == right ^. #objectFields+      && left ^. #reference == right ^. #reference+      && left ^. #path == right ^. #path+      && left ^. #uniqueBy == right ^. #uniqueBy++instance Show EffectiveFieldRule where+  show rule =+    "EffectiveFieldRule "+      <> show+        ( rule ^. #presenceClauses,+          rule ^. #description,+          rule ^. #allowedValues,+          rule ^. #cardinality,+          rule ^. #format,+          rule ^. #elementFields,+          rule ^. #objectFields,+          rule ^. #reference,+          rule ^. #path,+          rule ^. #uniqueBy+        )+ -- | The stable lowercase display name for a cardinality: @any@, @scalar@, -- @list@, or @object@. These are the names the CLI prints and the names -- generated profile documentation uses, so a reader who has seen one recognizes@@ -2188,6 +2419,11 @@ fieldRuleReference :: EffectiveFieldRule -> Maybe HandleReferenceRule fieldRuleReference rule = rule ^. #reference +-- | The required scalar member whose values must be unique within this one+-- list of records, or 'Nothing' when no list-local key is declared.+fieldRuleUniqueBy :: EffectiveFieldRule -> Maybe Text+fieldRuleUniqueBy rule = rule ^. #uniqueBy+ -- | The path-valued policy for this key, if any. Distinct from -- 'fieldRuleReference': a handle resolves against the bundle's document-ID -- index, a path against its concept tree. A rule never carries both — compiling@@ -2306,6 +2542,7 @@           <> conflictingFormatErrors           <> conditionDefinitionErrors           <> referenceDefinitionErrors+          <> uniquenessDefinitionErrors           <> versionErrors           <> requiredBundleVersionErrors @@ -2354,6 +2591,16 @@         let (scopeRank, typeName) = scopeKey scope          in (scopeRank, typeName, 20, renderFieldPathKey fieldPath, fromEnum (cardinality == Scalar))       PathReferenceWithHandleReference scope target -> referenceErrorKey scope target 21 ""+      InvalidExternalUriPattern scope target patternText detail ->+        referenceErrorKey scope target 22 (patternText <> ":" <> detail)+      ConflictingExternalUriPatterns ctype target profilePattern typePattern ->+        (1, ctype, 23, renderFieldPathKey target <> ":" <> profilePattern, Text.length typePattern)+      UniqueByRequiresElementFields scope target key -> uniqueErrorKey scope target 24 key+      UniqueByFieldNotDeclared scope target -> uniqueErrorKey scope target 25 ""+      UniqueByFieldNotUnconditionallyRequired scope target -> uniqueErrorKey scope target 26 ""+      UniqueByFieldNotScalar scope target cardinality -> uniqueErrorKey scope target 27 (Text.pack (show cardinality))+      ConflictingUniqueBy ctype target profileKey typeKey ->+        (1, ctype, 28, renderFieldPathKey target <> ":" <> profileKey, Text.length typeKey)       -- The two version-parse errors are profile-wide rather than scoped, and       -- rank below every scope rank: if the declared version is unreadable, every       -- version-derived error below is downstream noise and the reader should see@@ -2364,10 +2611,10 @@       InvalidRequiredBundleVersion rawVersion -> (-1, rawVersion, 2, "", 0)       FieldSupersededInOkfVersion scope path _declared supersededIn ->         let (scopeRank, typeName) = scopeKey scope-         in (scopeRank, typeName, 23, renderFieldPathKey path <> ":" <> supersededIn, 0)+         in (scopeRank, typeName, 30, renderFieldPathKey path <> ":" <> supersededIn, 0)       FormatRequiresOkfVersion scope path fieldFormat _declared introducedIn ->         let (scopeRank, typeName) = scopeKey scope-         in (scopeRank, typeName, 24, renderFieldPathKey path <> ":" <> introducedIn, Text.length (Text.pack (show fieldFormat)))+         in (scopeRank, typeName, 31, renderFieldPathKey path <> ":" <> introducedIn, Text.length (Text.pack (show fieldFormat)))      scopeKey Nothing = (0, "")     scopeKey (Just ctype) = (1, ctype)@@ -2379,6 +2626,7 @@     referenceErrorKey scope target rank detail =       let (scopeRank, typeName) = scopeKey scope        in (scopeRank, typeName, rank, renderFieldPathKey target <> ":" <> detail, 0)+    uniqueErrorKey = referenceErrorKey      scopeErrors scope FrontmatterRules {required, recommended, optional} =       [DuplicateFieldRule scope "required" key | key <- duplicates (map (^. #field) required)]@@ -2618,49 +2866,36 @@             : [(Just (rule ^. #type_), rule ^. #frontmatter) | rule <- rawSpec ^. #types]          rawReferenceErrors (scope, rules) =-          concatMap (fieldReferenceErrors scope) topLevelRules-            <> concatMap (fieldPathErrors scope) topLevelRules-            -- Path rules are declarable at nested and object scope too, which-            -- is where @sources[].resource@ lives, so the walk descends. It-            -- hangs on 'declaredNestedRuleSets' rather than iterating-            -- @elementFields@ and @objectFields@ separately, because-            -- @mk.recordOrList@ declares one rule set under both names and a-            -- @FieldPath@ such as @sources.resource@ cannot tell them apart.+          concatMap topLevelPolicyErrors topLevelRules             <> [ nestedError                | rule <- topLevelRules,                  nestedRules <- declaredNestedRuleSets rule,                  nestedRule <- nestedRules ^. #required <> nestedRules ^. #recommended <> nestedRules ^. #optional,-                 nestedError <--                   pathPolicyErrors-                     scope-                     (nestedDefinitionPath (rule ^. #field) (nestedRule ^. #field))-                     (nestedRule ^. #format)-                     Nothing-                     (nestedRule ^. #path)+                 nestedError <- policyErrors scope (nestedDefinitionPath (rule ^. #field) (nestedRule ^. #field)) (nestedRule ^. #format) (nestedRule ^. #reference) (nestedRule ^. #path)                ]           where             topLevelRules = rules ^. #required <> rules ^. #recommended <> rules ^. #optional+            topLevelPolicyErrors rule =+              policyErrors scope (topLevelFieldPath (rule ^. #field)) (rule ^. #format) (rule ^. #reference) (rule ^. #path) -        fieldReferenceErrors scope rule =-          case rule ^. #reference of-            Nothing -> []-            Just policy ->-              let path = topLevelFieldPath (rule ^. #field)-                  prefix = policy ^. #localPrefix-                  schemes = deduplicateSchemes (policy ^. #externalUriSchemes)-               in [InvalidReferencePrefix scope path prefix | not (validDocumentHandlePrefix prefix)]-                    <> [ReferencePrefixNotDeclared scope path prefix | prefix `notElem` declaredPrefixes]-                    <> [ReferenceRequiresIdField scope path | isNothing (rawSpec ^. #idField)]-                    <> [InvalidExternalReferenceScheme scope path scheme | scheme <- schemes, not (validUriScheme scheme)]-                    <> [ReferenceWithFormat scope path fieldFormat | Just fieldFormat <- [rule ^. #format]]+        policyErrors scope path declaredFormat handlePolicy pathPolicy =+          referencePolicyErrors scope path declaredFormat handlePolicy+            <> pathPolicyErrors scope path declaredFormat handlePolicy pathPolicy -        fieldPathErrors scope rule =-          pathPolicyErrors-            scope-            (topLevelFieldPath (rule ^. #field))-            (rule ^. #format)-            (rule ^. #reference)-            (rule ^. #path)+        referencePolicyErrors scope path declaredFormat = \case+          Nothing -> []+          Just policy ->+            let prefix = policy ^. #localPrefix+                schemes = deduplicateSchemes (policy ^. #externalUriSchemes)+             in [InvalidReferencePrefix scope path prefix | not (validDocumentHandlePrefix prefix)]+                  <> [ReferencePrefixNotDeclared scope path prefix | prefix `notElem` declaredPrefixes]+                  <> [ReferenceRequiresIdField scope path | isNothing (rawSpec ^. #idField)]+                  <> [InvalidExternalReferenceScheme scope path scheme | scheme <- schemes, not (validUriScheme scheme)]+                  <> [ReferenceWithFormat scope path fieldFormat | Just fieldFormat <- [declaredFormat]]+                  <> [ InvalidExternalUriPattern scope path patternText detail+                     | Just patternText <- [policy ^. #externalUriPattern],+                       Left detail <- [compileExternalUriPattern patternText]+                     ]          -- The three ways a path policy can be incoherent on its own. Two reuse         -- the handle-reference constructors because the claim is identical: a@@ -2680,21 +2915,84 @@               <> [PathReferenceWithHandleReference scope path | isJust handlePolicy]          mergedReferenceErrors typeRule =-          [ ConflictingReferencePrefix (typeRule ^. #type_) (topLevelFieldPath key) (profilePolicy ^. #localPrefix) (typePolicy ^. #localPrefix)-          | let typeFields = compileRules (typeRule ^. #frontmatter),-            (key, (profileRule, typeFieldRule)) <- Map.toAscList (Map.intersectionWith (,) baseRules typeFields),+          [ ConflictingReferencePrefix (typeRule ^. #type_) path (profilePolicy ^. #localPrefix) (typePolicy ^. #localPrefix)+          | (path, profileRule, typeFieldRule) <- pairedRules typeRule,             Just profilePolicy <- [profileRule ^. #reference],             Just typePolicy <- [typeFieldRule ^. #reference],             profilePolicy ^. #localPrefix /= typePolicy ^. #localPrefix           ]-            <> [ ReferenceWithFormat (Just (typeRule ^. #type_)) (topLevelFieldPath key) fieldFormat-               | let typeFields = compileRules (typeRule ^. #frontmatter),-                 (key, (profileRule, typeFieldRule)) <- Map.toAscList (Map.intersectionWith (,) baseRules typeFields),+            <> [ ConflictingExternalUriPatterns (typeRule ^. #type_) path profilePattern typePattern+               | (path, profileRule, typeFieldRule) <- pairedRules typeRule,+                 Just profilePattern <- [profileRule ^. #reference >>= (^. #externalUriPattern)],+                 Just typePattern <- [typeFieldRule ^. #reference >>= (^. #externalUriPattern)],+                 profilePattern /= typePattern+               ]+            <> [ ReferenceWithFormat (Just (typeRule ^. #type_)) path fieldFormat+               | (path, profileRule, typeFieldRule) <- pairedRules typeRule,                  (referenceRule, formatRule) <- [(profileRule, typeFieldRule), (typeFieldRule, profileRule)],                  isJust (referenceRule ^. #reference),                  Just fieldFormat <- [formatRule ^. #format]                ]+            <> [ PathReferenceWithHandleReference (Just (typeRule ^. #type_)) path+               | (path, profileRule, typeFieldRule) <- pairedRules typeRule,+                 (referenceRule, pathRule) <- [(profileRule, typeFieldRule), (typeFieldRule, profileRule)],+                 isJust (referenceRule ^. #reference),+                 isJust (pathRule ^. #path)+               ] +        pairedRules typeRule =+          [ (topLevelFieldPath key, profileRule, typeFieldRule)+          | let typeFields = compileRules (typeRule ^. #frontmatter),+            (key, (profileRule, typeFieldRule)) <- Map.toAscList (Map.intersectionWith (,) baseRules typeFields)+          ]+            <> [ (nestedDefinitionPath parentKey nestedKey, profileNestedRule, typeNestedRule)+               | let typeFields = compileRules (typeRule ^. #frontmatter),+                 (parentKey, (profileRule, typeFieldRule)) <- Map.toAscList (Map.intersectionWith (,) baseRules typeFields),+                 (profileNested, typeNested) <- pairedNestedRuleMaps profileRule typeFieldRule,+                 (nestedKey, (profileNestedRule, typeNestedRule)) <- Map.toAscList (Map.intersectionWith (,) profileNested typeNested)+               ]++    uniquenessDefinitionErrors =+      concatMap (validateDeclarations Nothing baseRules) [rawSpec ^. #frontmatter]+        <> concat+          [ let typeRules = compileRules (typeRule ^. #frontmatter)+             in validateDeclarations (Just (typeRule ^. #type_)) (mergeRules baseRules typeRules) (typeRule ^. #frontmatter)+          | typeRule <- rawSpec ^. #types+          ]+        <> [ ConflictingUniqueBy (typeRule ^. #type_) (topLevelFieldPath key) profileKey typeKey+           | typeRule <- rawSpec ^. #types,+             let typeRules = compileRules (typeRule ^. #frontmatter),+             (key, (profileRule, typeFieldRule)) <- Map.toAscList (Map.intersectionWith (,) baseRules typeRules),+             Just profileKey <- [profileRule ^. #uniqueBy],+             Just typeKey <- [typeFieldRule ^. #uniqueBy],+             profileKey /= typeKey+           ]+      where+        validateDeclarations scope effectiveRules rules =+          concatMap (validateDeclaration scope effectiveRules) (rules ^. #required <> rules ^. #recommended <> rules ^. #optional)++        validateDeclaration scope effectiveRules rawRule =+          case rawRule ^. #uniqueBy of+            Nothing -> []+            Just requestedKey ->+              let parentPath = topLevelFieldPath (rawRule ^. #field)+                  memberPath = nestedDefinitionPath (rawRule ^. #field) requestedKey+               in case Map.lookup (rawRule ^. #field) effectiveRules >>= (^. #elementFields) of+                    Nothing -> [UniqueByRequiresElementFields scope parentPath requestedKey]+                    Just memberRules ->+                      case Map.lookup requestedKey memberRules of+                        Nothing -> [UniqueByFieldNotDeclared scope memberPath]+                        Just memberRule ->+                          [ UniqueByFieldNotUnconditionallyRequired scope memberPath+                          | not (any unconditionalRequired (memberRule ^. #presenceClauses))+                          ]+                            <> [ UniqueByFieldNotScalar scope memberPath (memberRule ^. #cardinality)+                               | memberRule ^. #cardinality /= Scalar+                               ]++        unconditionalRequired clause =+          clause ^. #requirement == RequiredField && isNothing (clause ^. #condition)+     -- Only a value okf cannot parse is rejected. An unknown /major/ is     -- deliberately accepted, unlike in @okfVersion@: there the profile is asking     -- okf to interpret rules it may not understand, while here it is stating a@@ -2843,9 +3141,13 @@       format = rule ^. #format,       elementFields = compileNestedRules <$> rule ^. #elementFields,       objectFields = compileNestedRules <$> rule ^. #objectFields,-      reference = compileReferenceRule <$> rule ^. #reference,-      path = compilePathRule <$> rule ^. #path+      reference = compiledReference,+      path = compilePathRule <$> rule ^. #path,+      uniqueBy = rule ^. #uniqueBy,+      compiledExternalUriPattern = compileReferenceMatcher compiledReference     }+  where+    compiledReference = compileReferenceRule <$> rule ^. #reference  -- | The cardinality a rule with no declared one takes from its format. --@@ -2903,12 +3205,15 @@       -- Nested rules stay depth-bounded: 'NestedFieldRule' has no object member,       -- so a profile cannot constrain @sources[0].usage_window.from@.       objectFields = Nothing,-      -- Still 'Nothing': 'NestedFieldRule' carries no document-handle policy.-      reference = Nothing,+      reference = compiledReference,       -- But it does carry a path policy, which is the point of the member —       -- @sources[].resource@ is only reachable here.-      path = compilePathRule <$> rule ^. #path+      path = compilePathRule <$> rule ^. #path,+      uniqueBy = Nothing,+      compiledExternalUriPattern = compileReferenceMatcher compiledReference     }+  where+    compiledReference = compileReferenceRule <$> rule ^. #reference  compileNestedFieldRule :: FieldRequirement -> NestedFieldRule -> EffectiveFieldRule compileNestedFieldRule requirement rule =@@ -2929,9 +3234,13 @@       format = fromMaybe (profileRule ^. #format) (mergeFieldFormat (profileRule ^. #format) (typeRule ^. #format)),       elementFields = mergeNestedRuleMaps (profileRule ^. #elementFields) (typeRule ^. #elementFields),       objectFields = mergeNestedRuleMaps (profileRule ^. #objectFields) (typeRule ^. #objectFields),-      reference = fromMaybe (profileRule ^. #reference) (mergeReferenceRule (profileRule ^. #reference) (typeRule ^. #reference)),-      path = mergePathRule (profileRule ^. #path) (typeRule ^. #path)+      reference = mergedReference,+      path = mergePathRule (profileRule ^. #path) (typeRule ^. #path),+      uniqueBy = fromMaybe (profileRule ^. #uniqueBy) (mergeUniqueBy (profileRule ^. #uniqueBy) (typeRule ^. #uniqueBy)),+      compiledExternalUriPattern = compileReferenceMatcher mergedReference     }+  where+    mergedReference = fromMaybe (profileRule ^. #reference) (mergeReferenceRule (profileRule ^. #reference) (typeRule ^. #reference))  -- | Normalize a declared condition for storage in a 'PresenceClause': the shape -- is unchanged, but the accepted-value list is deduplicated so that a clause@@ -2949,9 +3258,26 @@   HandleReferenceRule     { localPrefix = policy ^. #localPrefix,       externalUriSchemes = map Text.toCaseFold (deduplicateSchemes (policy ^. #externalUriSchemes)),-      allowSelf = policy ^. #allowSelf+      allowSelf = policy ^. #allowSelf,+      allowLocal = policy ^. #allowLocal,+      externalUriPattern = policy ^. #externalUriPattern     } +compileExternalUriPattern :: Text -> Either Text Regex+compileExternalUriPattern patternText =+  first Text.pack (Regex.Text.compile defaultCompOpt defaultExecOpt patternText)++compileReferenceMatcher :: Maybe HandleReferenceRule -> Maybe Regex+compileReferenceMatcher policy = do+  patternText <- policy >>= (^. #externalUriPattern)+  either (const Nothing) Just (compileExternalUriPattern patternText)++matchesWholeExternalUriPattern :: Regex -> Text -> Bool+matchesWholeExternalUriPattern regex value =+  case Regex.Text.regexec regex value of+    Right (Just (before, _matched, after, _groups)) -> Text.null before && Text.null after+    _ -> False+ compilePathRule :: PathReferenceRule -> PathReferenceRule compilePathRule policy =   PathReferenceRule@@ -2992,7 +3318,8 @@ mergeReferenceRule Nothing typePolicy = Just typePolicy mergeReferenceRule profilePolicy Nothing = Just profilePolicy mergeReferenceRule (Just profilePolicy) (Just typePolicy)-  | profilePolicy ^. #localPrefix == typePolicy ^. #localPrefix =+  | profilePolicy ^. #localPrefix == typePolicy ^. #localPrefix,+    Just mergedPattern <- mergeOptionalText (profilePolicy ^. #externalUriPattern) (typePolicy ^. #externalUriPattern) =       Just . Just $         HandleReferenceRule           { localPrefix = profilePolicy ^. #localPrefix,@@ -3000,10 +3327,22 @@               filter                 (`Set.member` Set.fromList (typePolicy ^. #externalUriSchemes))                 (profilePolicy ^. #externalUriSchemes),-            allowSelf = profilePolicy ^. #allowSelf && typePolicy ^. #allowSelf+            allowSelf = profilePolicy ^. #allowSelf && typePolicy ^. #allowSelf,+            allowLocal = profilePolicy ^. #allowLocal && typePolicy ^. #allowLocal,+            externalUriPattern = mergedPattern           }   | otherwise = Nothing +mergeUniqueBy :: Maybe Text -> Maybe Text -> Maybe (Maybe Text)+mergeUniqueBy = mergeOptionalText++mergeOptionalText :: Maybe Text -> Maybe Text -> Maybe (Maybe Text)+mergeOptionalText Nothing typeValue = Just typeValue+mergeOptionalText profileValue Nothing = Just profileValue+mergeOptionalText profileValue typeValue+  | profileValue == typeValue = Just profileValue+  | otherwise = Nothing+ mergeFieldFormat :: Maybe FieldFormat -> Maybe FieldFormat -> Maybe (Maybe FieldFormat) mergeFieldFormat Nothing typeFormat = Just typeFormat mergeFieldFormat profileFormat Nothing = Just profileFormat@@ -3223,6 +3562,10 @@     MalformedDocumentReference ConceptId FieldPath Value   | -- | an absolute external URI uses a scheme the profile did not permit     ExternalReferenceSchemeNotAllowed ConceptId FieldPath Text [Text]+  | -- | a syntactically valid local handle is prohibited at this field+    LocalDocumentReferenceNotAllowed ConceptId FieldPath Text+  | -- | an allowed external URI does not match the declared whole-value pattern+    ExternalReferencePatternMismatch ConceptId FieldPath Text Text   | -- | a local handle, or a bundle path, resolves to the concept carrying it     SelfDocumentReference ConceptId FieldPath Text   | -- | a path-valued field's value is not one of the three shapes of §6.2@@ -3235,6 +3578,8 @@     FieldNotInProfile ConceptId Text   | -- | a declared list element is not an object record     NestedElementNotRecord ConceptId FieldPath Value+  | -- | one valid scalar member value occurs in more than one list element+    DuplicateNestedFieldValue ConceptId FieldPath Value (NonEmpty Int)   | -- | concept's file path does not match the type rule's pattern (concept, type, pattern)     PathPatternMismatch ConceptId Text Text   | -- | type rule requires a resource scheme but resource is absent (concept, type, scheme)@@ -3386,12 +3731,12 @@               presenceViolations key rule                 <> maybe [] (vocabularyViolations key rule) actual                 <> maybe [] (formatViolations key rule) actual-                <> maybe [] (referenceViolations key rule) actual+                <> maybe [] (referenceViolations (topLevelFieldPath key) rule) actual                 <> maybe [] (pathViolations (topLevelFieldPath key) rule) actual             FieldPresent actual ->               vocabularyViolations key rule actual                 <> formatViolations key rule actual-                <> referenceViolations key rule actual+                <> referenceViolations (topLevelFieldPath key) rule actual                 <> pathViolations (topLevelFieldPath key) rule actual                 <> nestedViolations key rule actual                 <> objectViolations key rule actual@@ -3415,10 +3760,10 @@           | Just fieldFormat <- [rule ^. #format],             not (valueMatchesFormat fieldFormat actual)           ]-        referenceViolations key rule actual =+        referenceViolations fieldPath rule actual =           case rule ^. #reference of             Nothing -> []-            Just policy -> validateReferenceValue validDocumentIdIndex cid (topLevelFieldPath key) policy actual+            Just policy -> validateReferenceValue validDocumentIdIndex cid fieldPath policy (rule ^. #compiledExternalUriPattern) actual          -- Takes a 'FieldPath' rather than a key because it is shared by all         -- three scopes: a top-level key, a member of a list element, and a@@ -3431,15 +3776,17 @@         nestedViolations parentKey parentRule = \case           Array elementValues             | Just nestedRules <- parentRule ^. #elementFields ->-                concat-                  [ case elementValue of-                      Aeson.Object members ->-                        concatMap-                          (checkRecordMember (nestedValuePath parentKey elementIndex) members)-                          (Map.toAscList nestedRules)-                      _ -> [NestedElementNotRecord cid (nestedElementPath parentKey elementIndex) elementValue]-                  | (elementIndex, elementValue) <- zip [0 ..] (Vector.toList elementValues)-                  ]+                let indexedElements = zip [0 ..] (Vector.toList elementValues)+                 in concat+                      [ case elementValue of+                          Aeson.Object members ->+                            concatMap+                              (checkRecordMember (nestedValuePath parentKey elementIndex) members)+                              (Map.toAscList nestedRules)+                          _ -> [NestedElementNotRecord cid (nestedElementPath parentKey elementIndex) elementValue]+                      | (elementIndex, elementValue) <- indexedElements+                      ]+                      <> uniquenessViolations parentKey parentRule nestedRules indexedElements           _ -> []          -- The mapping spelling of the same idea. The value /is/ the record, so@@ -3465,10 +3812,12 @@                   nestedPresenceViolations members path rule                     <> maybe [] (nestedVocabularyViolations path rule) actual                     <> maybe [] (nestedFormatViolations path rule) actual+                    <> maybe [] (referenceViolations path rule) actual                     <> maybe [] (pathViolations path rule) actual                 FieldPresent actual ->                   nestedVocabularyViolations path rule actual                     <> nestedFormatViolations path rule actual+                    <> referenceViolations path rule actual                     <> pathViolations path rule actual                 FieldWrongShape actual -> [CardinalityMismatch cid path (rule ^. #cardinality) actual] @@ -3493,6 +3842,32 @@             not (valueMatchesFormat fieldFormat actual)           ] +        uniquenessViolations parentKey parentRule nestedRules indexedElements =+          case parentRule ^. #uniqueBy of+            Nothing -> []+            Just key ->+              case Map.lookup key nestedRules of+                Nothing -> []+                Just keyRule ->+                  [ DuplicateNestedFieldValue cid (nestedDefinitionPath parentKey key) duplicateValue (firstIndex :| remainingIndices)+                  | (duplicateValue, firstIndex : remainingIndices) <- groupedValues key keyRule indexedElements,+                    not (null remainingIndices)+                  ]++        groupedValues key keyRule =+          List.foldl' insertValue [] . mapMaybe participant+          where+            participant (elementIndex, Aeson.Object members) =+              case evaluateFieldValue keyRule (Aeson.KeyMap.lookup (Aeson.Key.fromText key) members) of+                FieldPresent scalarValue -> Just (scalarValue, elementIndex)+                _ -> Nothing+            participant _ = Nothing++            insertValue [] (value, elementIndex) = [(value, [elementIndex])]+            insertValue ((groupValue, elementIndices) : remaining) (value, elementIndex)+              | groupValue == value = (groupValue, elementIndices <> [elementIndex]) : remaining+              | otherwise = (groupValue, elementIndices) : insertValue remaining (value, elementIndex)+     checkUnknownFields cid ctype concept       | spec ^. #allowUnknownFields = []       | otherwise =@@ -3527,22 +3902,24 @@           documentId ^. #prefix == expectedPrefix         ] -validateReferenceValue :: Map DocumentId [ConceptId] -> ConceptId -> FieldPath -> HandleReferenceRule -> Value -> [ProfileViolation]-validateReferenceValue validOwners sourceConcept path policy = \case-  String rawReference -> validateReferenceText validOwners sourceConcept path policy rawReference+validateReferenceValue :: Map DocumentId [ConceptId] -> ConceptId -> FieldPath -> HandleReferenceRule -> Maybe Regex -> Value -> [ProfileViolation]+validateReferenceValue validOwners sourceConcept path policy matcher = \case+  String rawReference -> validateReferenceText validOwners sourceConcept path policy matcher rawReference   Array values ->     concat       [ case value of-          String rawReference -> validateReferenceText validOwners sourceConcept (appendArrayIndex path elementIndex) policy rawReference+          String rawReference -> validateReferenceText validOwners sourceConcept (appendArrayIndex path elementIndex) policy matcher rawReference           _ -> [MalformedDocumentReference sourceConcept (appendArrayIndex path elementIndex) value]       | (elementIndex, value) <- zip [0 ..] (Vector.toList values)       ]   actual -> [MalformedDocumentReference sourceConcept path actual] -validateReferenceText :: Map DocumentId [ConceptId] -> ConceptId -> FieldPath -> HandleReferenceRule -> Text -> [ProfileViolation]-validateReferenceText validOwners sourceConcept path policy rawReference =+validateReferenceText :: Map DocumentId [ConceptId] -> ConceptId -> FieldPath -> HandleReferenceRule -> Maybe Regex -> Text -> [ProfileViolation]+validateReferenceText validOwners sourceConcept path policy matcher rawReference =   case parseDocumentId rawReference of     Just documentId+      | not (policy ^. #allowLocal) ->+          [LocalDocumentReferenceNotAllowed sourceConcept path rawReference]       | documentId ^. #prefix /= policy ^. #localPrefix ->           [ReferenceHandlePrefixMismatch sourceConcept path rawReference (policy ^. #localPrefix)]       | otherwise ->@@ -3556,7 +3933,14 @@     Nothing ->       case parseURI (Text.unpack rawReference) of         Just parsed-          | not (Text.null normalizedScheme), normalizedScheme `elem` policy ^. #externalUriSchemes -> []+          | not (Text.null normalizedScheme),+            normalizedScheme `elem` policy ^. #externalUriSchemes ->+              case (policy ^. #externalUriPattern, matcher) of+                (Nothing, _) -> []+                (Just patternText, Just compiledPattern)+                  | matchesWholeExternalUriPattern compiledPattern rawReference -> []+                  | otherwise -> [ExternalReferencePatternMismatch sourceConcept path rawReference patternText]+                (Just patternText, Nothing) -> [ExternalReferencePatternMismatch sourceConcept path rawReference patternText]           | not (Text.null normalizedScheme) ->               [ ExternalReferenceSchemeNotAllowed                   sourceConcept
+ src/Okf/Profile/Discovery.hs view
@@ -0,0 +1,139 @@+-- | Network-silent discovery of local Dhall profile descriptors.+--+-- A descriptor qualifies by behavior: it is a non-symlink @.dhall@ file that+-- evaluates and decodes as a 'ProfileSpec'. Discovery is a convenience rather+-- than validation, so unreadable, malformed, and non-profile files are skipped.+-- Remote import callbacks always reject before doing I/O; explicit profile and+-- registry loading retains its ordinary Dhall behavior elsewhere.+module Okf.Profile.Discovery+  ( ProfileDiscoveryOptions (..),+    defaultProfileDiscoveryOptions,+    discoverProfileDescriptors,+    fileQualifiesAsProfileDescriptor,+    loadProfileDescriptorWithoutNetwork,+  )+where++import Control.Exception (Exception, SomeException, catch, throw)+import Control.Monad (filterM)+import Data.List qualified as List+import Data.Text qualified as Text+import Data.Text.IO qualified as Text.IO+import Dhall.Core qualified+import Dhall.Import qualified+import Dhall.Parser qualified+import Dhall.TypeCheck qualified+import Okf.Discovery (isSearchableDirectory, listDirectorySafe)+import Okf.Prelude+import Okf.Profile (ProfileSpec, decodeProfileExpr)+import System.Directory (doesFileExist, pathIsSymbolicLink)+import System.FilePath ((</>))+import System.FilePath qualified as FilePath++-- | How far and where 'discoverProfileDescriptors' may look.+data ProfileDiscoveryOptions = ProfileDiscoveryOptions+  { -- | How many directory levels below the search root to inspect. The search+    -- root itself is depth 0, so @maxDepth = 4@ inspects four levels beneath it.+    maxDepth :: !Int,+    -- | Directory names never entered, regardless of depth. Directories whose+    -- name begins with @.@ are always skipped and need no entry here.+    skipDirectories :: ![FilePath]+  }+  deriving stock (Generic, Eq, Show)++-- | The same depth and build-output exclusions as bundle discovery. Keeping+-- both discovery mechanisms aligned makes their filesystem reach predictable.+defaultProfileDiscoveryOptions :: ProfileDiscoveryOptions+defaultProfileDiscoveryOptions =+  ProfileDiscoveryOptions+    { maxDepth = 4,+      skipDirectories =+        [ "dist-newstyle",+          "dist",+          "node_modules",+          "target",+          "vendor",+          "_build"+        ]+    }++-- | Discover every qualifying descriptor below a search root. Unlike bundle+-- discovery, finding one file does not prune the subtree: sibling and nested+-- descriptors are independent sources. Results are sorted and normalized.+discoverProfileDescriptors :: ProfileDiscoveryOptions -> FilePath -> IO [FilePath]+discoverProfileDescriptors ProfileDiscoveryOptions {maxDepth, skipDirectories} searchRoot =+  List.sort <$> walk 0 searchRoot+  where+    walk depth directory = do+      entries <- listDirectorySafe directory+      let visible = [entry | entry <- List.sort entries, not (isHidden entry)]+      descriptors <-+        filterM+          fileQualifiesAsProfileDescriptor+          [directory </> entry | entry <- visible, FilePath.takeExtension entry == ".dhall"]+      nested <-+        if depth >= maxDepth+          then pure []+          else do+            subdirectories <-+              filterM+                (isSearchableDirectory skipDirectories)+                [directory </> entry | entry <- visible]+            concat <$> traverse (walk (depth + 1)) subdirectories+      pure (map FilePath.normalise descriptors <> nested)++    isHidden entry = case entry of+      ('.' : _) -> True+      _ -> False++-- | Whether one filesystem path is a discoverable descriptor. Symlinks are+-- excluded because following them would make the bounded walk cyclic or allow+-- it to escape its roots. Every load or decode failure becomes @False@.+fileQualifiesAsProfileDescriptor :: FilePath -> IO Bool+fileQualifiesAsProfileDescriptor path+  | FilePath.takeExtension path /= ".dhall" = pure False+  | otherwise = do+      exists <- safelyFalse (doesFileExist path)+      isSymlink <- safelyFalse (pathIsSymbolicLink path)+      if exists && not isSymlink+        then either (const False) (const True) <$> loadProfileDescriptorWithoutNetwork path+        else pure False++-- | Load one descriptor with local imports and the semantic cache enabled, but+-- with both fresh remote import paths disabled. A cached integrity-protected+-- remote may therefore resolve; an uncached text or bytes import cannot make a+-- network request. The file is parsed exactly once before import resolution.+loadProfileDescriptorWithoutNetwork :: FilePath -> IO (Either Text ProfileSpec)+loadProfileDescriptorWithoutNetwork path =+  action `catch` \(exception :: SomeException) -> pure (Left (Text.pack (show exception)))+  where+    action = do+      contents <- Text.IO.readFile path+      parsed <- either throw pure (Dhall.Parser.exprFromText path contents)+      let baseStatus = Dhall.Import.emptyStatus (FilePath.takeDirectory path)+          status =+            baseStatus+              { Dhall.Import._remote = \_ -> throw RemoteImportsDisabled,+                Dhall.Import._remoteBytes = \_ -> throw RemoteImportsDisabled+              }+      resolved <-+        Dhall.Import.loadWithStatus+          status+          Dhall.Import.UseSemanticCache+          parsed+      _ <- either throw pure (Dhall.TypeCheck.typeOf resolved)+      case decodeProfileExpr (Dhall.Core.normalize resolved) of+        Just profile -> pure (Right profile)+        Nothing -> pure (Left "Dhall value does not decode as an OKF profile descriptor")++data RemoteImportsDisabled = RemoteImportsDisabled+  deriving stock (Eq)++instance Show RemoteImportsDisabled where+  show RemoteImportsDisabled = "Remote imports are disabled during profile discovery"++instance Exception RemoteImportsDisabled++safelyFalse :: IO Bool -> IO Bool+safelyFalse action =+  action `catch` \(_ :: SomeException) -> pure False
src/Okf/Profile/Documentation.hs view
@@ -412,7 +412,8 @@         "- Cardinality: " <> renderCardinalityName (fieldRuleCardinality rule),         "- Format: " <> maybe "none" renderFieldFormatName (fieldRuleFormat rule),         "- Reference: " <> maybe "none" renderReference (fieldRuleReference rule),-        "- Path: " <> maybe "none" renderPathRule (fieldRulePath rule)+        "- Path: " <> maybe "none" renderPathRule (fieldRulePath rule),+        "- Unique by: " <> maybe "none" code (fieldRuleUniqueBy rule)       ]         <> conditionBullets         <> objectFieldBullets@@ -455,13 +456,13 @@ -- | Nested element rules are depth-bounded at one level, so this is flat by -- construction: 'fieldRuleElementFields' on a nested rule is always 'Nothing'. ----- The path clause is emitted only when the member declares one, unlike the--- fixed bullet list of 'renderFieldRule'. This line is already a dense--- semicolon-separated run and a member declares no path policy far more often--- than not, so a @path: none@ on every member of every record would cost more--- than it says. A nested path policy is nevertheless the motivating case for--- path rules — @sources[].resource@ lives here — so it must be visible when it--- is there.+-- The reference and path clauses are emitted only when the member declares+-- them, unlike the fixed bullet list of 'renderFieldRule'. This line is already+-- a dense semicolon-separated run and most members declare neither policy, so+-- @reference: none; path: none@ on every member of every record would cost more+-- than it says. Both policies are nevertheless meaningful at nested scope —+-- @dependencies[].ref@ and @sources[].resource@ live here — so each must be+-- visible when it is present. renderElementField :: Text -> EffectiveFieldRule -> Text renderElementField key rule =   code key@@ -473,6 +474,7 @@           "cardinality: " <> renderCardinalityName (fieldRuleCardinality rule),           "format: " <> maybe "none" renderFieldFormatName (fieldRuleFormat rule)         ]+          <> foldMap (\policy -> ["reference: " <> renderReference policy]) (fieldRuleReference rule)           <> foldMap (\policy -> ["path: " <> renderPathRule policy]) (fieldRulePath rule)       )     <> maybe "" (" — " <>) (nonBlank (fieldRuleDescription rule))@@ -506,11 +508,17 @@ renderReference policy =   Text.intercalate     "; "-    [ "local handles with prefix " <> code (policy ^. #localPrefix),-      externalPhrase,-      if policy ^. #allowSelf then "self-reference allowed" else "self-reference not allowed"-    ]+    ( [ "local handles with prefix " <> code (policy ^. #localPrefix),+        externalPhrase,+        localPermissionPhrase,+        if policy ^. #allowSelf then "self-reference allowed" else "self-reference not allowed"+      ]+        <> foldMap (\patternText -> ["external URI whole-value pattern " <> code patternText]) (policy ^. #externalUriPattern)+    )   where+    localPermissionPhrase =+      if policy ^. #allowLocal then "local handles allowed" else "local handles prohibited"+     externalPhrase =       case policy ^. #externalUriSchemes of         [] -> "external URIs not allowed"
src/Okf/Profile/Registry.hs view
@@ -13,32 +13,56 @@ module Okf.Profile.Registry   ( -- * References     RegistryRef (..),+    ProfileSource (..),     defaultRegistryReference,     resolveRegistryRef,     renderRegistryRef,+    renderProfileSourceLabel,+    renderProfileSourceReference,+    looksLikeRegistryPath,      -- * Enumeration     RegistryEntry (..),+    RegistryLoadError (..),+    registryLoadErrorCategory,+    renderRegistryLoadErrorMessage,+    SourceFailure (..),+    ProfileSourceLoadError (..),+    failedProfileSource,+    profileSourceLoadErrorCategory,+    renderProfileSourceLoadError,+    SourcedProfile (..),     loadRegistry,+    loadRegistryDetailed,+    loadProfileSource,+    loadProfileSourceDetailed,+    loadProfileSources,+    loadProfileSourcesDetailed,+    normalizeProfileSources,     registryEntries,     findRegistryEntry,+    findSourcedProfiles,     rootExportLabel,   ) where -import Control.Exception (SomeException, catch)+import Control.Exception (SomeException, catch, fromException) import Data.List qualified as List import Data.Text qualified as Text import Data.Text.IO qualified as Text.IO import Data.Void (Void) import Dhall qualified import Dhall.Core (Expr (RecordLit), recordFieldValue)+import Dhall.Import qualified as Dhall.Import import Dhall.Map qualified+import Dhall.Parser qualified as Dhall.Parser import Dhall.Src (Src)+import Dhall.TypeCheck qualified as Dhall.TypeCheck import Okf.Prelude import Okf.Profile (ProfileSpec, decodeProfileExpr)+import Okf.Profile.Discovery (loadProfileDescriptorWithoutNetwork) import System.Directory (doesDirectoryExist, doesFileExist)-import System.FilePath (takeDirectory, (</>))+import System.FilePath (normalise, takeBaseName, takeDirectory, takeFileName, (</>)) import "generic-lens" Data.Generics.Labels ()  -- | How a registry reference is to be evaluated. A file must be evaluated with@@ -51,6 +75,19 @@     RegistryExpression !Text   deriving stock (Generic, Eq, Show) +-- | One place profiles can come from. The text is the reference exactly as the+-- user supplied it; the resolved reference records how it will be evaluated.+--+-- This is deliberately a sum type even though registries are the only source+-- kind today. Other structural discovery mechanisms can add constructors+-- without overloading what a registry reference means.+data ProfileSource+  = -- | A registry reference, as the user wrote it, and how it resolved.+    RegistrySource !Text !RegistryRef+  | -- | One descriptor file found by bounded, network-silent local discovery.+    DescriptorSource !FilePath+  deriving stock (Generic, Eq, Show)+ -- | One profile published by a registry, under the dotted field path at which -- it was found. The export path is empty when the registry reference is itself -- a profile; 'rootExportLabel' is the display form for that case.@@ -60,6 +97,91 @@   }   deriving stock (Generic, Eq, Show) +-- | A stable, user-facing classification of registry evaluation failures.+-- Dhall's exception renderers deliberately include source excerpts and ANSI+-- styling; those are useful to a language implementer but are not a suitable+-- command-line contract for a user trying to identify a bad source.+data RegistryLoadError+  = RegistryDirectoryMissingPackage !FilePath+  | RegistryPathNotFound !FilePath+  | RegistryHashMismatch+  | RegistryImportFailure+  | RegistryInvalidDhall+  | RegistryEvaluationFailure+  deriving stock (Generic, Eq, Show)++registryLoadErrorCategory :: RegistryLoadError -> Text+registryLoadErrorCategory = \case+  RegistryDirectoryMissingPackage _path -> "directory-missing-package"+  RegistryPathNotFound _path -> "path-not-found"+  RegistryHashMismatch -> "hash-mismatch"+  RegistryImportFailure -> "import-failure"+  RegistryInvalidDhall -> "invalid-dhall"+  RegistryEvaluationFailure -> "evaluation-failure"++-- | Render a plain summary with no third-party exception text or terminal+-- escape sequences. The CLI adds the source identity and reference guidance.+renderRegistryLoadErrorMessage :: RegistryLoadError -> Text+renderRegistryLoadErrorMessage = \case+  RegistryDirectoryMissingPackage path ->+    "directory "+      <> Text.pack path+      <> " does not contain package.dhall; use `okf profiles` to discover loose descriptors and OKF_PROFILE_ROOTS to choose where it searches"+  RegistryPathNotFound path ->+    "registry path " <> Text.pack path <> " does not exist; check the spelling"+  RegistryHashMismatch ->+    "the registry import failed its integrity check; its content does not match the pinned hash"+  RegistryImportFailure ->+    "one or more registry imports could not be resolved; check local paths and network access"+  RegistryInvalidDhall ->+    "the registry is not valid, well-typed Dhall"+  RegistryEvaluationFailure ->+    "registry evaluation failed unexpectedly"++-- | One source that could not be enumerated, together with the captured load+-- error. Multi-source survey operations report these without hiding entries+-- from sources that did load.+data SourceFailure = SourceFailure+  { failedSource :: !ProfileSource,+    failureReason :: !Text+  }+  deriving stock (Generic, Eq, Show)++-- | A typed failure for one source. Registry errors retain their stable+-- category; descriptor errors remain a separate branch because descriptor+-- discovery uses a deliberately restricted, no-network evaluator.+data ProfileSourceLoadError+  = RegistryProfileSourceLoadError !ProfileSource !RegistryLoadError+  | DescriptorProfileSourceLoadError !ProfileSource+  deriving stock (Generic, Eq, Show)++failedProfileSource :: ProfileSourceLoadError -> ProfileSource+failedProfileSource = \case+  RegistryProfileSourceLoadError profileSource _error -> profileSource+  DescriptorProfileSourceLoadError profileSource -> profileSource++profileSourceLoadErrorCategory :: ProfileSourceLoadError -> Text+profileSourceLoadErrorCategory = \case+  RegistryProfileSourceLoadError _profileSource registryError ->+    registryLoadErrorCategory registryError+  DescriptorProfileSourceLoadError _profileSource -> "descriptor-load-failure"++renderProfileSourceLoadError :: ProfileSourceLoadError -> Text+renderProfileSourceLoadError = \case+  RegistryProfileSourceLoadError _profileSource registryError ->+    renderRegistryLoadErrorMessage registryError+  DescriptorProfileSourceLoadError _profileSource ->+    "the local profile descriptor could not be read or decoded"++-- | One registry entry paired with the source that published it. Provenance+-- wraps the existing source-agnostic 'RegistryEntry' rather than changing that+-- public type.+data SourcedProfile = SourcedProfile+  { source :: !ProfileSource,+    entry :: !RegistryEntry+  }+  deriving stock (Generic, Eq, Show)+ -- | The built-in registry: the @okf-profiles@ package, pinned by tag /and/ -- integrity hash. Pinning gives Dhall's content-addressed cache something -- stable to key on, so listing costs one network fetch ever, and a later@@ -67,8 +189,8 @@ -- newer tag means changing the URL and the hash together. defaultRegistryReference :: Text defaultRegistryReference =-  "https://raw.githubusercontent.com/shinzui/okf-profiles/v0.4.2/package.dhall\-  \ sha256:39e79b65672439cde9c1271e3d92abf68ba1e2427541598e0d04de23e741f0cb"+  "https://raw.githubusercontent.com/shinzui/okf-profiles/v0.10.0/package.dhall\+  \ sha256:c6882a5cb6ece28027f5f9d219d323cff64f131b97ecbf536ed54d77263f5edf"  -- | How an entry with an empty export path is displayed. rootExportLabel :: Text@@ -97,19 +219,196 @@             )         else pure (RegistryExpression reference) +-- | Whether text looks intended to name a filesystem path rather than a raw+-- Dhall expression. Remote URLs are excluded before checking path separators,+-- because both @https://@ and a hash-pinned URL contain slashes.+looksLikeRegistryPath :: Text -> Bool+looksLikeRegistryPath raw+  | Text.null reference = False+  | isRemoteReference lowered = False+  | otherwise =+      any (`Text.isPrefixOf` reference) ["./", "../", "~/", "/"]+        || Text.any (\character -> character == '/' || character == '\\') reference+        || ".dhall" `Text.isSuffixOf` Text.toLower reference+  where+    reference = Text.strip raw+    lowered = Text.toLower reference+    isRemoteReference value =+      "http://" `Text.isPrefixOf` value || "https://" `Text.isPrefixOf` value+ -- | Render a reference for display in messages. renderRegistryRef :: RegistryRef -> Text renderRegistryRef (RegistryFile path) = Text.pack path renderRegistryRef (RegistryExpression expression) = expression +-- | Render the complete user-facing identity of a source. Display labels are+-- intentionally not unique, so diagnostics that disambiguate sources use this+-- full reference instead.+renderProfileSourceReference :: ProfileSource -> Text+renderProfileSourceReference (RegistrySource reference _resolved) = reference+renderProfileSourceReference (DescriptorSource path) = Text.pack (normalise path)++-- | Render a compact source label suitable for a table column. A local package+-- uses its directory name, a direct file uses its basename, and a raw GitHub+-- URL uses the repository name. Other expressions fall back to a bounded form+-- of the original reference. Labels are display text, not source identity.+renderProfileSourceLabel :: ProfileSource -> Text+renderProfileSourceLabel (RegistrySource original resolved) =+  case resolved of+    RegistryFile path+      | takeFileName path == "package.dhall" -> Text.pack (takeFileName (takeDirectory path))+      | otherwise -> Text.pack (takeBaseName path)+    RegistryExpression _expression ->+      fromMaybe (truncateLabel (Text.strip original)) (rawGitHubRepository original)+  where+    rawGitHubRepository reference =+      case Text.splitOn "/" (Text.strip reference) of+        "https:" : "" : "raw.githubusercontent.com" : _owner : repository : _rest ->+          nonEmptyText repository+        "http:" : "" : "raw.githubusercontent.com" : _owner : repository : _rest ->+          nonEmptyText repository+        _ -> Nothing++    nonEmptyText value+      | Text.null value = Nothing+      | otherwise = Just value++    truncateLabel value+      | Text.length value <= 32 = value+      | otherwise = Text.take 31 value <> "…"+renderProfileSourceLabel (DescriptorSource _path) = "local"+ -- | Evaluate a registry and enumerate the profiles it publishes. Any parse, -- import, type, or IO failure is captured as a human-readable 'Left', matching -- how 'Okf.Profile.loadProfileFile' behaves. loadRegistry :: RegistryRef -> IO (Either Text [RegistryEntry])-loadRegistry reference =-  (Right . registryEntries <$> evaluateRef reference)-    `catch` \(e :: SomeException) -> pure (Left (Text.pack (show e)))+loadRegistry reference = first renderRegistryLoadErrorMessage <$> loadRegistryDetailed reference +-- | Evaluate a registry while preserving a stable error category. Path-like+-- expressions are checked before Dhall sees them so a missing file or a loose+-- descriptor directory produces an actionable message instead of an "unbound+-- variable" diagnostic.+loadRegistryDetailed :: RegistryRef -> IO (Either RegistryLoadError [RegistryEntry])+loadRegistryDetailed reference = do+  preflight <- registryReferencePreflight reference+  case preflight of+    Just registryError -> pure (Left registryError)+    Nothing ->+      (Right . registryEntries <$> evaluateRef reference)+        `catch` \(exception :: SomeException) ->+          pure (Left (classifyRegistryException exception))++registryReferencePreflight :: RegistryRef -> IO (Maybe RegistryLoadError)+registryReferencePreflight (RegistryFile path) = do+  exists <- doesFileExist path+  pure (if exists then Nothing else Just (RegistryPathNotFound path))+registryReferencePreflight (RegistryExpression expression) = do+  let pathExpression = fst (Text.breakOn " sha256:" (Text.strip expression))+      path = Text.unpack pathExpression+  isDirectory <- doesDirectoryExist path+  if isDirectory+    then pure (Just (RegistryDirectoryMissingPackage path))+    else do+      isFile <- doesFileExist path+      pure+        ( if looksLikeRegistryPath pathExpression && not isFile+            then Just (RegistryPathNotFound path)+            else Nothing+        )++classifyRegistryException :: SomeException -> RegistryLoadError+classifyRegistryException exception+  | isHashMismatch exception = RegistryHashMismatch+  | isInvalidDhall exception = RegistryInvalidDhall+  | Just (Dhall.Parser.SourcedException _source (Dhall.Import.MissingImports nested)) <-+      fromException exception =+      classifyMissingImports nested+  | otherwise = RegistryEvaluationFailure+  where+    isHashMismatch caught =+      isJust (fromException caught :: Maybe Dhall.Import.HashMismatch)+        || isJust (fromException caught :: Maybe (Dhall.Import.Imported Dhall.Import.HashMismatch))++    isInvalidDhall caught =+      isJust (fromException caught :: Maybe Dhall.Parser.ParseError)+        || isJust (fromException caught :: Maybe (Dhall.TypeCheck.TypeError Src Void))+        || isJust (fromException caught :: Maybe (Dhall.Import.Imported Dhall.Parser.ParseError))+        || isJust (fromException caught :: Maybe (Dhall.Import.Imported (Dhall.TypeCheck.TypeError Src Void)))++    classifyMissingImports nested+      | any isHashMismatch nested = RegistryHashMismatch+      | any isInvalidDhall nested = RegistryInvalidDhall+      | otherwise = RegistryImportFailure++-- | Load one profile source and attach it to every enumerated registry entry.+-- Pattern matches are exhaustive so adding another source kind requires its+-- loading behavior to be defined explicitly.+loadProfileSource :: ProfileSource -> IO (Either Text [SourcedProfile])+loadProfileSource profileSource =+  first renderProfileSourceLoadError <$> loadProfileSourceDetailed profileSource++loadProfileSourceDetailed :: ProfileSource -> IO (Either ProfileSourceLoadError [SourcedProfile])+loadProfileSourceDetailed profileSource@(RegistrySource _reference resolved) =+  first (RegistryProfileSourceLoadError profileSource)+    . fmap (map (SourcedProfile profileSource))+    <$> loadRegistryDetailed resolved+loadProfileSourceDetailed (DescriptorSource path) = do+  loaded <- loadProfileDescriptorWithoutNetwork normalizedPath+  pure $+    first (const (DescriptorProfileSourceLoadError normalizedSource)) $+      fmap+        ( \profile ->+            [ SourcedProfile+                normalizedSource+                RegistryEntry+                  { export = Text.pack (takeBaseName normalizedPath),+                    spec = profile+                  }+            ]+        )+        loaded+  where+    normalizedPath = normalise path+    normalizedSource = DescriptorSource normalizedPath++-- | Drop exact duplicate sources while preserving first-occurrence order.+-- Distinct sources are never deduplicated merely because their display labels+-- or export paths happen to collide.+normalizeProfileSources :: [ProfileSource] -> [ProfileSource]+normalizeProfileSources = List.nub . map normalizeSource+  where+    normalizeSource source@(RegistrySource _reference _resolved) = source+    normalizeSource (DescriptorSource path) = DescriptorSource (normalise path)++-- | Enumerate several sources in the order given. Results remain grouped by+-- source position, while 'registryEntries' keeps each source internally sorted+-- by export path. A failure from one source is returned alongside successful+-- entries from every other source rather than hiding them.+loadProfileSources :: [ProfileSource] -> IO ([SourceFailure], [SourcedProfile])+loadProfileSources sources = do+  (failures, profiles) <- loadProfileSourcesDetailed sources+  pure+    ( [ SourceFailure+          { failedSource = failedProfileSource profileSourceError,+            failureReason = renderProfileSourceLoadError profileSourceError+          }+      | profileSourceError <- failures+      ],+      profiles+    )++loadProfileSourcesDetailed :: [ProfileSource] -> IO ([ProfileSourceLoadError], [SourcedProfile])+loadProfileSourcesDetailed sources = go (normalizeProfileSources sources) [] []+  where+    go [] failures profiles = pure (reverse failures, reverse profiles)+    go (profileSource : rest) failures profiles = do+      loaded <- loadProfileSourceDetailed profileSource+      case loaded of+        Left reason ->+          go rest (reason : failures) profiles+        Right sourceProfiles ->+          go rest failures (reverse sourceProfiles <> profiles)+ -- | Parse, resolve imports, type check, and normalize a registry reference. evaluateRef :: RegistryRef -> IO (Expr Src Void) evaluateRef (RegistryFile path) = do@@ -172,3 +471,8 @@ -- | Look up an entry by its exact export path. findRegistryEntry :: Text -> [RegistryEntry] -> Maybe RegistryEntry findRegistryEntry path = List.find ((== path) . (^. #export))++-- | Find every source that publishes an exact export path. A list result makes+-- collisions explicit instead of silently choosing the first match.+findSourcedProfiles :: Text -> [SourcedProfile] -> [SourcedProfile]+findSourcedProfiles path = List.filter ((== path) . (^. #entry . #export))
+ src/Okf/Query.hs view
@@ -0,0 +1,399 @@+{-# LANGUAGE PackageImports #-}++-- | Selecting concepts out of a bundle by what their frontmatter says.+--+-- A __filter__ is one question asked of one concept: does @status@ hold+-- @accepted@, does the concept carry @completedAt@ at all, does it carry no+-- @status@. 'filterConcepts' answers a list of them at once, keeping the+-- concepts for which every question is satisfied.+--+-- This is OKF behavior rather than a command-line concern, so it lives here+-- and not in @okf-cli@: deciding whether a concept matches @status=accepted@ is+-- the same decision for a shell pipeline, a library consumer, and an agent, and+-- none of them should have to spawn a subprocess to get it.+--+-- Two readings are deliberately asymmetric and are worth stating up front. A+-- filter is __existential over a list__ — @tags=cli@ selects a concept tagged+-- @[profiles, cli]@ — because a person asking for @cli@ wants the concepts that+-- mention it. A profile's closed-vocabulary check is universal for the same+-- key, because there the question is "may this key ever hold that value". The+-- two never meet: 'checkFiltersAgainstProfile' checks the /filter/, and+-- 'Okf.Profile.validateProfile' checks the /bundle/.+module Okf.Query+  ( FieldSelector (..),+    ConceptFilter (..),+    FilterParseError (..),+    parseFieldSelector,+    parseFieldEquals,+    renderFieldSelector,+    renderFilter,+    renderFilterParseError,+    conceptFieldValues,+    scalarText,+    matchesFilter,+    filterConcepts,++    -- * Checking a filter against a profile+    FilterProfileError (..),+    checkFiltersAgainstProfile,+  )+where++import Data.Aeson qualified as Aeson+import Data.Aeson.Key qualified as AesonKey+import Data.Aeson.KeyMap qualified as KeyMap+import Data.ByteString.Lazy qualified as LazyByteString+import Data.List qualified as List+import Data.Map.Strict (Map)+import Data.Map.Strict qualified as Map+import Data.Set qualified as Set+import Data.Text qualified as Text+import Data.Text.Encoding qualified as Text.Encoding+import Data.Vector qualified as Vector+import Okf.Bundle (Concept, conceptDocument)+import Okf.Document (OKFDocument (frontmatter), coreFrontmatterFields, frontmatterLookup)+import Okf.Prelude+-- Imported with an explicit list that leaves out the 'Cardinality'+-- constructors: two of them are named 'List' and 'Object', which would clash+-- with aeson's 'Value' constructors of the same names.+import Okf.Profile+  ( CompiledProfile,+    EffectiveFieldRule,+    ProfileSpec,+    compiledProfileBaseRules,+    compiledProfileRulesForType,+    compiledProfileSpec,+    compiledProfileTypeNames,+    fieldRuleAllowedValues,+    fieldRuleElementFields,+    fieldRuleObjectFields,+  )+import "generic-lens" Data.Generics.Labels ()++-- | Which frontmatter value a filter is about.+data FieldSelector+  = -- | A top-level key: @status@.+    TopLevelField !Text+  | -- | One level of nesting: @reviews.outcome@ or @generated.by@. The first+    -- component names the parent key and the second a member of the record it+    -- holds, whether that record is the value itself or an element of a list.+    NestedField !Text !Text+  deriving stock (Generic, Eq, Ord, Show)++-- | One question asked of a concept.+data ConceptFilter+  = -- | The selected field holds this value. For a list, any element matching+    -- is enough.+    FieldEquals !FieldSelector !Text+  | -- | The concept carries the selected field at all, with any value.+    FieldPresent !FieldSelector+  | -- | The concept does not carry the selected field.+    FieldAbsent !FieldSelector+  deriving stock (Generic, Eq, Ord, Show)++-- | Why a filter string could not be read.+data FilterParseError+  = -- | The key, or one of its dotted components, was empty.+    EmptyFilterKey+  | -- | A @KEY=VALUE@ argument carried no @=@ at all. Holds the original text.+    MissingFilterSeparator !Text+  | -- | The key nests deeper than @parent.member@. Holds the original text.+    FilterKeyTooDeep !Text+  deriving stock (Generic, Eq, Show)++-- | Read a field selector such as @status@ or @reviews.outcome@.+--+-- One level of nesting is the limit because one level is exactly what a profile+-- can describe: @elementFields@ and @objectFields@ hold+-- 'Okf.Profile.NestedFieldRule' values that never nest further. A deeper path+-- would name a place no profile can constrain, so @--profile@ checking would+-- silently stop applying below the first level. Reporting the depth as its own+-- error is friendlier than quietly reading @b.c@ as a member name.+parseFieldSelector :: Text -> Either FilterParseError FieldSelector+parseFieldSelector raw =+  case Text.splitOn "." raw of+    [key]+      | not (Text.null key) -> Right (TopLevelField key)+    [parentKey, memberKey]+      | not (Text.null parentKey),+        not (Text.null memberKey) ->+          Right (NestedField parentKey memberKey)+    components+      | length components > 2 -> Left (FilterKeyTooDeep raw)+      | otherwise -> Left EmptyFilterKey++-- | Read a @KEY=VALUE@ argument into an equality filter.+--+-- Splits on the __first__ @=@ only, so a value may itself contain one; a+-- @resource@ holding @postgres:\/\/host\/db?a=b@ is a real case. The value is+-- taken verbatim with no trimming: whitespace in a shell argument was typed+-- deliberately, and silently trimming it would make @--where 'title= '@ mean+-- something other than what it says.+parseFieldEquals :: Text -> Either FilterParseError ConceptFilter+parseFieldEquals raw =+  case Text.breakOn "=" raw of+    (_, rest)+      | Text.null rest -> Left (MissingFilterSeparator raw)+    (rawKey, rest) -> do+      selector <- parseFieldSelector rawKey+      pure (FieldEquals selector (Text.drop 1 rest))++-- | The selector in the form a user types it.+renderFieldSelector :: FieldSelector -> Text+renderFieldSelector = \case+  TopLevelField key -> key+  NestedField parentKey memberKey -> parentKey <> "." <> memberKey++-- | The filter in the form a user types it, so a diagnostic can quote the+-- question back rather than guessing which flag produced it.+renderFilter :: ConceptFilter -> Text+renderFilter = \case+  FieldEquals selector wanted -> renderFieldSelector selector <> "=" <> wanted+  FieldPresent selector -> renderFieldSelector selector+  FieldAbsent selector -> "!" <> renderFieldSelector selector++renderFilterParseError :: FilterParseError -> Text+renderFilterParseError = \case+  EmptyFilterKey -> "a frontmatter key cannot be empty"+  MissingFilterSeparator raw -> "expected KEY=VALUE, got " <> raw+  FilterKeyTooDeep raw ->+    raw+      <> " nests deeper than one level; a filter key is KEY or PARENT.MEMBER"++-- | Every value the selected field holds in one concept, flattened.+--+-- A list value contributes its elements rather than itself, which is what makes+-- a filter existential over lists. A nested selector reads through both shapes a+-- profile can describe — a record-valued key (@objectFields@) and a list of+-- records (@elementFields@) — because OKF v0.2 itself permits @verified@ as+-- either one bare mapping or a list of them, and a filter that worked on only+-- one spelling would be wrong for that key.+conceptFieldValues :: FieldSelector -> Concept -> [Value]+conceptFieldValues selector concept =+  case selector of+    TopLevelField key -> maybe [] flatten (lookupTopLevel key)+    NestedField parentKey memberKey ->+      case lookupTopLevel parentKey of+        Just (Object parentObject) -> memberValues memberKey parentObject+        Just (Array items) ->+          concat [memberValues memberKey item | Object item <- Vector.toList items]+        _ -> []+  where+    lookupTopLevel key = frontmatterLookup key (frontmatter (conceptDocument concept))+    memberValues memberKey parentObject =+      maybe [] flatten (KeyMap.lookup (AesonKey.fromText memberKey) parentObject)+    flatten = \case+      Array items -> Vector.toList items+      value -> [value]++-- | The scalar text a value compares as, or 'Nothing' for a value that is not a+-- scalar.+--+-- Numbers and booleans compare as their JSON encoding, so @--where+-- usage_count=12@ matches a YAML @usage_count: 12@ and @--where verified=true@+-- matches a YAML boolean. Aeson writes an integral number without a trailing+-- @.0@, which is what makes the first of those work.+--+-- A container is never a scalar: a filter cannot usefully equal an array or a+-- mapping, and @Null@ is the absence of a value written down.+scalarText :: Value -> Maybe Text+scalarText value =+  case value of+    String text -> Just text+    Number _ -> Just (jsonText value)+    Bool _ -> Just (jsonText value)+    Array _ -> Nothing+    Object _ -> Nothing+    Null -> Nothing+  where+    -- Lenient decoding cannot differ from strict here: the JSON encoding of a+    -- number or a boolean is ASCII. It is used so that this stays total.+    jsonText =+      Text.Encoding.decodeUtf8Lenient . LazyByteString.toStrict . Aeson.encode++-- | Whether one concept answers one filter.+matchesFilter :: ConceptFilter -> Concept -> Bool+matchesFilter conceptFilter concept =+  case conceptFilter of+    FieldEquals selector wanted ->+      any ((== Just wanted) . scalarText) (conceptFieldValues selector concept)+    FieldPresent selector -> not (null (conceptFieldValues selector concept))+    FieldAbsent selector -> null (conceptFieldValues selector concept)++-- | Keep the concepts every filter accepts, in the order they arrived.+--+-- Repeating a key means \"or\" and naming different keys means \"and\": the+-- filters are grouped, and a concept survives when at least one filter in every+-- group matches it. Repetition reads as \"either\" because that is how the+-- profile language itself expresses a set of accepted values+-- ('Okf.Profile.FieldCondition' holds an any-of list for one field), and+-- because reading it as \"and\" would make the flag useless for a scalar key,+-- which cannot equal two different strings.+--+-- Grouping is by selector __and__ by which question is asked, so+-- @status=accepted@ together with a @status@-absent filter is an unsatisfiable+-- conjunction of two groups rather than an \"or\" that quietly accepts+-- everything. Order is 'walkBundle' order throughout: nothing here re-sorts, so+-- a filtered listing stays diffable in CI.+filterConcepts :: [ConceptFilter] -> [Concept] -> [Concept]+filterConcepts filters concepts =+  filter matchesEveryGroup concepts+  where+    groups =+      [ [candidate | candidate <- filters, filterGroupKey candidate == key]+      | key <- List.nub (map filterGroupKey filters)+      ]+    matchesEveryGroup concept =+      all (\group -> any (`matchesFilter` concept) group) groups++-- | The group a filter joins. The leading number distinguishes the three+-- questions, so that two filters naming the same key but asking different things+-- never collapse into one any-of group.+filterGroupKey :: ConceptFilter -> (Int, FieldSelector)+filterGroupKey = \case+  FieldEquals selector _ -> (0, selector)+  FieldPresent selector -> (1, selector)+  FieldAbsent selector -> (2, selector)++-- | Why a profile says a filter can never select anything.+data FilterProfileError+  = -- | The filter names a key no type in the profile declares.+    FilterFieldNotDeclared !FieldSelector+  | -- | The filter names a value outside the key's closed vocabulary. The list+    -- is the vocabulary, and it is never empty.+    FilterValueNotInVocabulary !FieldSelector !Text ![Text]+  deriving stock (Generic, Eq, Show)++-- | Check filters against a compiled profile, restricted to the concept types+-- the same command line selected (all of the profile's types when it selected+-- none).+--+-- The subject here is the /question/, not the bundle. A filter is a guess about+-- what the data says, and a wrong guess is invisible: @status=acepted@ and+-- @status=withdrawn@ both select nothing, but one is a typo and the other is a+-- true statement about the corpus. A profile already knows which is which, so a+-- caller can turn what this returns into a hard error without contradicting+-- @docs\/adr\/1-profile-declared-document-ids.md@, which keeps profile+-- deviations against a /bundle/ advisory.+--+-- Restricting to the requested types makes the check as precise as the question:+-- if the command line said @--type Note@, a key only @Improvement Request@+-- declares really is unusable for that query.+--+-- Offline and pure, like every other profile check: it receives a compiled+-- profile and decides, per+-- @docs\/adr\/5-compile-profile-rules-before-validation.md@.+checkFiltersAgainstProfile :: CompiledProfile -> [Text] -> [ConceptFilter] -> [FilterProfileError]+checkFiltersAgainstProfile compiled requestedTypes = concatMap checkFilter+  where+    checkFilter = \case+      FieldEquals selector wanted -> declarationErrors selector <> valueErrors selector wanted+      FieldPresent selector -> declarationErrors selector+      FieldAbsent selector -> declarationErrors selector++    -- The scopes a key may be declared in: one per relevant concept type.+    -- 'compiledProfileRulesForType' already merges the profile-wide rules into+    -- each type's map, so a type scope is the whole rule for a concept of that+    -- type and the base map is not a scope of its own.+    --+    -- __Adding the base map unconditionally would silently disable every+    -- per-type vocabulary.__ 'Okf.Profile.mergeVocabulary' lets a type-scope+    -- vocabulary stand where the profile scope declared none, so a key declared+    -- plainly profile-wide and closed on one type has an empty allowed-value+    -- list in the base map and a full one in that type's map — and an empty list+    -- means unconstrained, which under 'vocabularyFor' would win. The base map+    -- is therefore a scope only where it can actually govern a concept: when the+    -- profile declares no types at all, and when it allows types it does not+    -- declare, whose concepts fall back to exactly these rules.+    scopes :: [Map Text EffectiveFieldRule]+    scopes+      | null typeScopes = [baseRules]+      | profileSpec ^. #allowUnknownTypes = baseRules : typeScopes+      | otherwise = typeScopes++    baseRules = compiledProfileBaseRules compiled+    typeScopes = map (compiledProfileRulesForType compiled) relevantTypes++    relevantTypes+      | null requestedTypes = compiledProfileTypeNames compiled+      | otherwise = requestedTypes++    -- Every rule that governs the selected key, across the scopes in play. A+    -- parent declaring both nested shapes contributes from both, which is what+    -- a @recordOrList@ rule means.+    rulesFor :: FieldSelector -> [EffectiveFieldRule]+    rulesFor = \case+      TopLevelField key -> [rule | scope <- scopes, Just rule <- [Map.lookup key scope]]+      NestedField parentKey memberKey ->+        [ memberRule+        | scope <- scopes,+          Just parentRule <- [Map.lookup parentKey scope],+          Just nested <- [fieldRuleObjectFields parentRule, fieldRuleElementFields parentRule],+          Just memberRule <- [Map.lookup memberKey nested]+        ]++    declarationErrors selector+      | not (null (rulesFor selector)) = []+      | coreFieldFallback selector = []+      | otherwise = [FilterFieldNotDeclared selector]++    -- __A core OKF key is a fallback for declaration only, never an escape from+    -- a vocabulary.__ A profile rule is looked for first and governs when it+    -- exists; only a key no scope declares is saved from+    -- 'FilterFieldNotDeclared' by being one okf owns, and then it is+    -- unconstrained because nothing declared a vocabulary for it.+    --+    -- Getting that order wrong destroys the feature and is easy to do.+    -- @status@ is in 'coreFrontmatterFields' /and/ is the key a house profile is+    -- most likely to close, so asking "is this a core key?" first would wave+    -- @status=acepted@ straight through. A nested key falls back on its parent,+    -- because okf owns the shape of @generated@, @verified@, and @sources@ as+    -- much as it owns their names.+    coreFieldFallback = \case+      TopLevelField key -> Set.member key coreFrontmatterFields+      NestedField parentKey _ -> Set.member parentKey coreFrontmatterFields++    -- A declared key with a closed vocabulary rejects anything outside it.+    -- Otherwise, and only for @type@, the profile's declared type names are the+    -- vocabulary. The vocabulary error wins when both could fire, so a profile+    -- that closes @type@ with @allowedValues@ as well reports once.+    valueErrors selector wanted =+      case vocabularyErrors selector wanted of+        [] -> conceptTypeErrors selector wanted+        errors -> errors++    vocabularyErrors selector wanted =+      case vocabularyFor selector of+        [] -> []+        vocabulary+          | wanted `elem` vocabulary -> []+          | otherwise -> [FilterValueNotInVocabulary selector wanted vocabulary]++    -- The union of the declaring scopes' vocabularies -- unless any declaring+    -- scope leaves the key unconstrained, in which case nothing can be+    -- rejected. That exception is not a nicety: an __empty allowed-value list+    -- means unconstrained__, so taking the union without it would invent a+    -- vocabulary out of one type's rule and reject values another type permits.+    vocabularyFor selector =+      let vocabularies = map fieldRuleAllowedValues (rulesFor selector)+       in if null vocabularies || any null vocabularies+            then []+            else List.nub (concat vocabularies)++    -- @type@ needs its own check because its vocabulary is not written as+    -- @allowedValues@: a profile constrains concept types with type rules plus+    -- the @allowUnknownTypes@ switch. Since @type@ is the one key every concept+    -- carries and the most likely thing to filter on, leaving the most common+    -- typo unchecked would undercut the feature. Reusing+    -- 'FilterValueNotInVocabulary' rather than adding a third constructor keeps+    -- the rendered message right with no special case.+    conceptTypeErrors selector wanted+      | selector /= TopLevelField "type" = []+      | profileSpec ^. #allowUnknownTypes = []+      | wanted `elem` typeNames = []+      | otherwise = [FilterValueNotInVocabulary selector wanted typeNames]+      where+        typeNames = compiledProfileTypeNames compiled++    profileSpec :: ProfileSpec+    profileSpec = compiledProfileSpec compiled
test/Main.hs view
@@ -7,6 +7,7 @@ import Data.List qualified as List import Data.Map.Strict (Map) import Data.Map.Strict qualified as Map+import Data.Maybe (catMaybes) import Data.Set qualified as Set import Data.Text qualified as Text import Data.Text.IO qualified as Text.IO@@ -29,15 +30,19 @@ -- reached as 'Profile.HumanActor'. import Okf.Profile hiding (HumanActor) import Okf.Profile qualified as Profile+import Okf.Profile.Discovery qualified as ProfileDiscovery import Okf.Profile.Documentation import Okf.Profile.Registry+import Okf.Query import Okf.Trust import Okf.Validation import System.Directory   ( createDirectoryIfMissing,+    createFileLink,     doesDirectoryExist,     doesFileExist,     getTemporaryDirectory,+    makeAbsolute,     removeDirectoryRecursive,   ) import System.Exit (exitFailure)@@ -145,6 +150,7 @@         testIO "fixture attested computation bundle reports one missing runtime and no path problem" testFixtureAttestedComputation,         testIO "loadProfileFile decodes the postgresql fixture" testLoadProfileFixture,         testIO "loadProfileFile decodes record-completed document ID rules" testLoadDocumentIdProfileFixture,+        testIO "loadProfileFile exposes nested reference and uniqueness declarations" testLoadNestedReferenceProfileFixture,         testIO "loadProfileFile accepts the pre-type-frontmatter described schema" testLoadDescribedProfileFixture,         testIO "loadProfileFile accepts the frozen EP-1 type-aware schema" testLoadTypeAwareCompatibilityFixture,         testIO "loadProfileFile accepts the frozen EP-2 vocabulary schema" testLoadVocabularyCompatibilityFixture,@@ -155,6 +161,7 @@         testIO "loadProfileFile decodes same-scope conditions" testLoadConditionalFieldsProfileFixture,         testIO "loadProfileFile preserves the frozen condition-aware schema" testLoadConditionalCompatibilityFixture,         testIO "loadProfileFile preserves the frozen reference-aware schema" testLoadReferenceCompatibilityFixture,+        testIO "loadProfileFile preserves the complete 0.7.0.0 descriptor schema" testLoadPreNestedReferenceCompatibilityFixture,         testIO "every frozen generation fixture compiles, not merely decodes" testFrozenFixturesCompile,         testIO "loadProfileFile preserves the frozen pre-bundle-version schema" testLoadPreBundleVersionCompatibilityFixture,         testIO "loadProfileFile preserves the frozen pre-path schema" testLoadPrePathCompatibilityFixture,@@ -168,9 +175,27 @@         test "handle reference JSON encoding is stable" testHandleReferenceJsonShape,         test "field format JSON encoding is stable" testFieldFormatJsonShape,         testIO "loadRegistry enumerates nested profiles and skips non-profiles" testRegistryEnumeratesProfiles,+        testIO "loadRegistry decodes every profile in the pinned catalogue snapshot" testPinnedCatalogueDecodes,         testIO "loadRegistry reports a bare profile as a root entry" testRegistryRootProfile,         testIO "resolveRegistryRef prefers package.dhall inside a directory" testResolveRegistryRef,         testIO "loadRegistry reports a missing registry as Left" testRegistryLoadFailure,+        test "registry path intent is classified without mistaking remote URLs for paths" testLooksLikeRegistryPath,+        testIO "loadRegistryDetailed classifies actionable failures without rendered Dhall text" testRegistryDetailedFailures,+        testIO "profile discovery finds valid descriptors without pruning" testDiscoverProfileDescriptors,+        testIO "profile discovery excludes every non-descriptor fixture" testProfileDescriptorQualification,+        testIO "profile discovery treats a missing root as empty" testProfileDiscoveryMissingRoot,+        testIO "profile discovery skips symbolic links" testProfileDiscoverySkipsSymlink,+        testIO "profile discovery honours maxDepth" testProfileDiscoveryHonoursMaxDepth,+        testIO "profile discovery rejects remote text and bytes before I/O" testProfileDiscoveryRejectsRemote,+        test "profile source labels are compact and readable" testProfileSourceLabels,+        testIO "loadProfileSource attaches source provenance" testProfileSourceWrapper,+        testIO "DescriptorSource enumerates one basename export" testDescriptorSourceWrapper,+        testIO "DescriptorSource reports a non-profile as a source failure" testDescriptorSourceFailure,+        testIO "loadProfileSources merges registries in source order" testProfileSourcesMergeInOrder,+        testIO "loadProfileSources merges registry and descriptor sources in order" testMixedProfileSourcesMergeInOrder,+        testIO "loadProfileSources retains entries after a partial failure" testProfileSourcesPartialFailure,+        testIO "findSourcedProfiles exposes cross-source collisions" testProfileSourcesExposeCollisions,+        testIO "loadProfileSources drops exact duplicate references" testProfileSourcesDropDuplicates,         test "parseDocumentId accepts only canonical handles" testParseDocumentId,         testIO "documentIdsInBundle sorts handles by prefix and number" testDocumentIdsInBundle,         test "nextDocumentId skips gaps and starts unused prefixes at one" testNextDocumentId,@@ -185,6 +210,7 @@         test "profile value display names match the documented vocabulary" testProfileValueDisplayNames,         testIO "profile documentation renders a root concept" testProfileDocumentationRootConcept,         test "profile documentation renders object rules" testProfileDocumentationObjectFields,+        testIO "profile documentation renders nested references and list uniqueness" testProfileDocumentationNestedReferenceAndUniqueness,         test "profile documentation renders a required bundle version" testProfileDocumentationRequiredBundleVersion,         testIO "profile documentation renders one concept per declared type" testProfileDocumentationTypeConcept,         testIO "profile documentation renders inherited rules for a bare type" testProfileDocumentationInheritedRules,@@ -239,6 +265,9 @@         test "nested conditions use siblings and avoid cascading diagnostics" testNestedConditionalPresence,         test "compileProfile rejects invalid document reference policies" testReferenceDefinitionErrors,         test "document references resolve local handles and explicit external URIs" testDocumentReferenceValidation,+        testIO "compileProfile exposes nested references and record-list uniqueness" testCompileNestedReferenceAndUniqueness,+        testIO "nested references and record-list uniqueness validate in layers" testNestedReferenceAndUniquenessValidation,+        testIO "compileProfile rejects invalid nested reference and uniqueness declarations" testNestedReferenceAndUniquenessDefinitionErrors,         test "optional fields are never missing but are fully value-checked" testOptionalFieldPresence,         test "optional reference fields resolve handles when present" testOptionalReferenceValidation,         test "optional nested fields are never missing inside records" testOptionalNestedFieldPresence,@@ -270,7 +299,11 @@         testIO "nested review fixture validates records with indexed diagnostics" testNestedReviewsFixture,         testIO "conditional fixture covers ADR, PostgreSQL, and review scopes" testConditionalFieldsFixture,         testIO "document reference fixture covers local, external, self, and duplicate targets" testDocumentReferencesFixture,-        testIO "optional-field fixture reports only the recommendation and bad values" testOptionalFieldsFixture+        testIO "optional-field fixture reports only the recommendation and bad values" testOptionalFieldsFixture,+        test "parseFieldEquals and parseFieldSelector read the filter grammar" testParseConceptFilters,+        test "scalarText compares numbers and booleans as JSON, containers as nothing" testQueryScalarText,+        testIO "filterConcepts selects over lists, nested records, presence, and absence" testFilterConceptsOverFixture,+        testIO "checkFiltersAgainstProfile rejects undeclared keys and out-of-vocabulary values" testCheckFiltersAgainstProfile       ]   unless (and results) exitFailure @@ -2457,6 +2490,46 @@         [Just "The OKF concept type; must be a type rule below.", Nothing]         (map (^. #description) (spec ^. #frontmatter . #required)) +testLoadNestedReferenceProfileFixture :: IO (Either Text ())+testLoadNestedReferenceProfileFixture = do+  path <- fixtureFilePath "profiles/nested-references-and-uniqueness.dhall"+  result <- loadProfileFile path+  pure $ case result of+    Left err -> Left ("failed to load nested reference profile: " <> err)+    Right spec -> do+      dependencies <- lookupRawRule "dependencies" (spec ^. #frontmatter . #required)+      acceptanceCriteria <- lookupRawRule "acceptanceCriteria" (spec ^. #frontmatter . #required)+      assertEqual (Just "id") (acceptanceCriteria ^. #uniqueBy)+      case dependencies ^. #elementFields of+        Just NestedRules {required = [nestedReferenceRule]} -> do+          let expectedPolicy =+                HandleReferenceRule+                  "IR"+                  ["mori"]+                  False+                  False+                  (Just "mori://[^/]+/[^/]+/okf/improvement-requests/concepts/IR-[1-9][0-9]*")+          assertEqual (Just expectedPolicy) (nestedReferenceRule ^. #reference)+          assertEqual+            ( object+                [ "field" .= ("ref" :: Text),+                  "description" .= (Nothing :: Maybe Text),+                  "allowedValues" .= ([] :: [Text]),+                  "cardinality" .= ("scalar" :: Text),+                  "format" .= (Nothing :: Maybe Text),+                  "when" .= (Nothing :: Maybe FieldCondition),+                  "path" .= (Nothing :: Maybe PathReferenceRule),+                  "reference" .= Just expectedPolicy+                ]+            )+            (toJSON nestedReferenceRule)+        _ -> Left "expected dependencies.ref as one required nested rule"+  where+    lookupRawRule key rules =+      case [rule | rule <- rules, rule ^. #field == key] of+        [rule] -> Right rule+        _ -> Left ("expected one raw rule for " <> key)+ testLoadDescribedProfileFixture :: IO (Either Text ()) testLoadDescribedProfileFixture = do   path <- fixtureFilePath "profiles/described.dhall"@@ -2596,7 +2669,7 @@       case spec ^. #frontmatter . #recommended of         [referenceRule, conditionRule, reviewsRule] -> do           assertEqual-            (Just (HandleReferenceRule "ADR" ["mori"] False))+            (Just (handleReferenceRule "ADR" ["mori"] False))             (referenceRule ^. #reference)           assertEqual (Just (FieldCondition "status" ["superseded"])) (conditionRule ^. #when)           case reviewsRule ^. #elementFields of@@ -2664,6 +2737,7 @@     "formats-mp8-ep2.dhall",     "path-references-mp8-ep3.dhall",     "pre-bundle-version.dhall",+    "pre-nested-references-and-uniqueness-0.7.0.0.dhall",     -- Not a frozen generation but a *documented* one: this is the descriptor     -- @docs\/user\/profiles.md@ shows for the specification §10 contract as a     -- house convention. It is listed here so the documented descriptor cannot@@ -2671,6 +2745,30 @@     "attested-computation-house.dhall"   ] +testLoadPreNestedReferenceCompatibilityFixture :: IO (Either Text ())+testLoadPreNestedReferenceCompatibilityFixture = do+  path <- fixtureFilePath "profiles/pre-nested-references-and-uniqueness-0.7.0.0.dhall"+  result <- loadProfileFile path+  pure $ case result of+    Left err -> Left ("failed to load frozen 0.7.0.0 profile: " <> err)+    Right spec -> do+      assertEqual "pre-nested-references-and-uniqueness-0.7.0.0" (spec ^. #name)+      assertEqual (Just "0.2") (spec ^. #requireBundleVersion)+      let allTopRules = spec ^. #frontmatter . #required <> spec ^. #frontmatter . #recommended <> spec ^. #frontmatter . #optional+      assertEqual (replicate (length allTopRules) Nothing) (map (^. #uniqueBy) allTopRules)+      case [policy | rule <- allTopRules, Just policy <- [rule ^. #reference]] of+        [policy] -> do+          assertEqual True (policy ^. #allowLocal)+          assertEqual Nothing (policy ^. #externalUriPattern)+        _ -> Left "expected exactly one upgraded 0.7.0.0 reference policy"+      let nestedRules =+            [ nestedRule+            | rule <- allTopRules,+              rules <- catMaybes [rule ^. #elementFields, rule ^. #objectFields],+              nestedRule <- rules ^. #required <> rules ^. #recommended <> rules ^. #optional+            ]+      assertEqual (replicate (length nestedRules) Nothing) (map (^. #reference) nestedRules)+ -- | The generation frozen immediately before @requireBundleVersion@: a descriptor -- with no such member still loads, the member arrives as 'Nothing', and every -- member the frozen descriptor did declare survives the upgrade. The last part is@@ -2694,7 +2792,7 @@       assertEqual (Just "docId") (spec ^. #idField)       assertEqual ["type", "generated"] (map (^. #field) (spec ^. #frontmatter . #required))       assertEqual-        (Just (HandleReferenceRule "ADR" ["mori"] False))+        (Just (handleReferenceRule "ADR" ["mori"] False))         (case spec ^. #frontmatter . #optional of rule : _ -> rule ^. #reference; [] -> Nothing)       assertEqual         [Just Profile.HumanActor]@@ -2725,7 +2823,7 @@         (concatMap (map (^. #path) . (^. #frontmatter . #required)) (spec ^. #types))       -- Everything the frozen descriptor did declare survives the upgrade.       assertEqual-        (Just (HandleReferenceRule "ADR" ["mori"] False))+        (Just (handleReferenceRule "ADR" ["mori"] False))         (case spec ^. #frontmatter . #optional of rule : _ -> rule ^. #reference; [] -> Nothing)       assertEqual         [Just Profile.NonNegativeInteger]@@ -2810,7 +2908,7 @@       case spec ^. #frontmatter . #recommended of         [referenceRule, reviewsRule] -> do           assertEqual-            (Just (HandleReferenceRule "ADR" ["mori"] False))+            (Just (handleReferenceRule "ADR" ["mori"] False))             (referenceRule ^. #reference)           case reviewsRule ^. #elementFields of             Just NestedRules {required = [kindRule], recommended = [notesRule], optional = [urlRule]} -> do@@ -2905,7 +3003,8 @@                                "objectFields" .= (Nothing :: Maybe Value),                                "reference" .= (Nothing :: Maybe HandleReferenceRule),                                "path" .= (Nothing :: Maybe PathReferenceRule),-                               "when" .= (Nothing :: Maybe FieldCondition)+                               "when" .= (Nothing :: Maybe FieldCondition),+                               "uniqueBy" .= (Nothing :: Maybe Text)                              ],                            object                              [ "field" .= ("title" :: Text),@@ -2917,7 +3016,8 @@                                "objectFields" .= (Nothing :: Maybe Value),                                "reference" .= (Nothing :: Maybe HandleReferenceRule),                                "path" .= (Nothing :: Maybe PathReferenceRule),-                               "when" .= (Nothing :: Maybe FieldCondition)+                               "when" .= (Nothing :: Maybe FieldCondition),+                               "uniqueBy" .= (Nothing :: Maybe Text)                              ]                          ],                     "recommended"@@ -2932,7 +3032,8 @@                                "objectFields" .= (Nothing :: Maybe Value),                                "reference" .= (Nothing :: Maybe HandleReferenceRule),                                "path" .= (Nothing :: Maybe PathReferenceRule),-                               "when" .= (Nothing :: Maybe FieldCondition)+                               "when" .= (Nothing :: Maybe FieldCondition),+                               "uniqueBy" .= (Nothing :: Maybe Text)                              ]                          ],                     "optional"@@ -2947,7 +3048,8 @@                                "objectFields" .= (Nothing :: Maybe Value),                                "reference" .= (Nothing :: Maybe HandleReferenceRule),                                "path" .= (Nothing :: Maybe PathReferenceRule),-                               "when" .= (Nothing :: Maybe FieldCondition)+                               "when" .= (Nothing :: Maybe FieldCondition),+                               "uniqueBy" .= (Nothing :: Maybe Text)                              ]                          ]                   ],@@ -2996,10 +3098,12 @@     ( object         [ "localPrefix" .= ("ADR" :: Text),           "externalUriSchemes" .= (["mori", "https"] :: [Text]),-          "allowSelf" .= False+          "allowSelf" .= False,+          "allowLocal" .= True,+          "externalUriPattern" .= (Nothing :: Maybe Text)         ]     )-    (toJSON (HandleReferenceRule "ADR" ["mori", "https"] False))+    (toJSON (handleReferenceRule "ADR" ["mori", "https"] False))  -- | A registry record enumerates every field that decodes as a profile, one -- level down as well as at the top, sorted by export path. The @Profile@ schema@@ -3027,6 +3131,36 @@         "expected findRegistryEntry to resolve the nested export"         (isJust (findRegistryEntry "nested.decisions" entries)) +-- | The built-in registry pin and this offline snapshot move together. Loading+-- the snapshot catches a catalogue descriptor that the current decoder cannot+-- read without making the test suite depend on GitHub or Dhall's cache.+testPinnedCatalogueDecodes :: IO (Either Text ())+testPinnedCatalogueDecodes = do+  path <- fixtureFilePath "catalogue/package.dhall"+  loaded <- loadRegistry (RegistryFile path)+  pure $ case loaded of+    Left err -> Left ("failed to load pinned catalogue snapshot: " <> err)+    Right entries -> do+      assertEqual+        [ "coordination.bugReports",+          "coordination.capabilities",+          "coordination.improvementRequests",+          "coordination.useCases",+          "documentation.architectureDecisions",+          "documentation.patternCatalog",+          "documentation.researchDocuments",+          "okfV02",+          "postgresql",+          "tanPostgresql"+        ]+        (List.sort (map (^. #export) entries))+      assertBool+        "expected every pinned catalogue profile to have a non-empty name"+        (all (not . Text.null . (^. #spec . #name)) entries)+      assertBool+        "expected every pinned catalogue profile to have a non-empty okfVersion"+        (all (not . Text.null . (^. #spec . #okfVersion)) entries)+ -- | A registry reference that is itself a profile yields one entry whose export -- path is empty. testRegistryRootProfile :: IO (Either Text ())@@ -3061,6 +3195,258 @@     Right entries -> Left ("expected a load failure, got " <> Text.pack (show (length entries)) <> " entries")     Left message -> assertBool "expected a non-empty error message" (not (Text.null message)) +testLooksLikeRegistryPath :: Either Text ()+testLooksLikeRegistryPath = do+  assertEqual+    [True, True, True, True, True, True, False, False, False]+    ( map+        looksLikeRegistryPath+        [ "./profiles/package.dhall",+          "../profiles/package.dhall",+          "/profiles/package.dhall",+          "~/profiles/package.dhall",+          "profiles/package.dhall",+          "profile.dhall",+          "https://example.test/package.dhall sha256:abc",+          "http://example.test/package.dhall",+          "{ profile = 1 }"+        ]+    )++testRegistryDetailedFailures :: IO (Either Text ())+testRegistryDetailedFailures =+  withDiscoveryTree "okf-registry-errors" [] $ \root -> do+    profilePath <- fixtureFilePath "profiles/decisions.dhall"+    absoluteProfilePath <- makeAbsolute profilePath+    directoryResult <- loadRegistryDetailed (RegistryExpression (Text.pack root))+    missingResult <- loadRegistryDetailed (RegistryExpression (Text.pack (root </> "missing" </> "package.dhall")))+    invalidResult <- loadRegistryDetailed (RegistryExpression "{ profile =")+    hashResult <-+      loadRegistryDetailed+        ( RegistryExpression+            ( Text.pack absoluteProfilePath+                <> " sha256:0000000000000000000000000000000000000000000000000000000000000000"+            )+        )+    pure $ do+      assertEqual (Left (RegistryDirectoryMissingPackage root)) directoryResult+      assertEqual (Left (RegistryPathNotFound (root </> "missing" </> "package.dhall"))) missingResult+      assertEqual (Left RegistryInvalidDhall) invalidResult+      assertEqual (Left RegistryHashMismatch) hashResult+      assertBool+        "typed summaries must not contain ANSI escape bytes"+        ( all+            (not . Text.isInfixOf "\ESC[")+            [ renderRegistryLoadErrorMessage (RegistryDirectoryMissingPackage root),+              renderRegistryLoadErrorMessage RegistryHashMismatch,+              renderRegistryLoadErrorMessage RegistryInvalidDhall+            ]+        )++testDiscoverProfileDescriptors :: IO (Either Text ())+testDiscoverProfileDescriptors = do+  root <- fixturePath "profile-discovery"+  found <-+    ProfileDiscovery.discoverProfileDescriptors+      ProfileDiscovery.defaultProfileDiscoveryOptions+      root+  pure $+    assertEqual+      [ normalise (root </> "nested" </> "valid-nested.dhall"),+        normalise (root </> "valid.dhall")+      ]+      found++testProfileDescriptorQualification :: IO (Either Text ())+testProfileDescriptorQualification = do+  valid <- fixtureFilePath "profile-discovery/valid.dhall"+  registry <- fixtureFilePath "profile-discovery/registry.dhall"+  notProfile <- fixtureFilePath "profile-discovery/not-a-profile.dhall"+  invalid <- fixtureFilePath "profile-discovery/invalid.dhall"+  ignoredFile <- fixtureFilePath "profile-discovery/ignored.txt"+  results <-+    traverse+      ProfileDiscovery.fileQualifiesAsProfileDescriptor+      [valid, registry, notProfile, invalid, ignoredFile]+  pure (assertEqual [True, False, False, False, False] results)++testProfileDiscoveryMissingRoot :: IO (Either Text ())+testProfileDiscoveryMissingRoot = do+  found <-+    ProfileDiscovery.discoverProfileDescriptors+      ProfileDiscovery.defaultProfileDiscoveryOptions+      "/nonexistent/okf-profile-discovery-root"+  pure (assertEqual [] found)++testProfileDiscoverySkipsSymlink :: IO (Either Text ())+testProfileDiscoverySkipsSymlink =+  withDiscoveryTree "okf-profile-discovery-symlink" [] $ \root -> do+    target <- fixtureFilePath "profile-discovery/valid.dhall" >>= makeAbsolute+    createFileLink target (root </> "linked.dhall")+    found <-+      ProfileDiscovery.discoverProfileDescriptors+        ProfileDiscovery.defaultProfileDiscoveryOptions+        root+    pure (assertEqual [] found)++testProfileDiscoveryHonoursMaxDepth :: IO (Either Text ())+testProfileDiscoveryHonoursMaxDepth = do+  root <- fixturePath "profile-discovery"+  shallow <-+    ProfileDiscovery.discoverProfileDescriptors+      ProfileDiscovery.defaultProfileDiscoveryOptions+      root+  deeper <-+    ProfileDiscovery.discoverProfileDescriptors+      ProfileDiscovery.defaultProfileDiscoveryOptions {ProfileDiscovery.maxDepth = 6}+      root+  let deepest = normalise (root </> "deep" </> "a" </> "b" </> "c" </> "d" </> "e" </> "valid-too-deep.dhall")+  pure $ do+    assertBool "default depth should exclude the deep descriptor" (deepest `notElem` shallow)+    assertBool "expanded depth should include the deep descriptor" (deepest `elem` deeper)++testProfileDiscoveryRejectsRemote :: IO (Either Text ())+testProfileDiscoveryRejectsRemote = do+  textRemote <- fixtureFilePath "profile-discovery/remote.dhall"+  bytesRemote <- fixtureFilePath "profile-discovery/remote-bytes.dhall"+  loaded <- traverse ProfileDiscovery.loadProfileDescriptorWithoutNetwork [textRemote, bytesRemote]+  qualifies <- traverse ProfileDiscovery.fileQualifiesAsProfileDescriptor [textRemote, bytesRemote]+  pure $ do+    for_ loaded $ \case+      Right profile -> Left ("expected remote descriptor rejection, decoded " <> profile ^. #name)+      Left message ->+        assertBool+          "expected the dedicated no-network callback to reject the import"+          ("Remote imports are disabled during profile discovery" `Text.isInfixOf` message)+    assertEqual [False, False] qualifies++testProfileSourceLabels :: Either Text ()+testProfileSourceLabels = do+  assertEqual+    "okf-profiles"+    ( renderProfileSourceLabel+        (RegistrySource defaultRegistryReference (RegistryExpression defaultRegistryReference))+    )+  assertEqual+    "okf-v0-2"+    ( renderProfileSourceLabel+        (RegistrySource "docs/profiles/okf-v0-2.dhall" (RegistryFile "docs/profiles/okf-v0-2.dhall"))+    )+  assertEqual "local" (renderProfileSourceLabel (DescriptorSource "docs/profiles/okf-v0-2.dhall"))+  assertEqual+    (Text.pack (normalise "docs/profiles/../profiles/okf-v0-2.dhall"))+    (renderProfileSourceReference (DescriptorSource "docs/profiles/../profiles/okf-v0-2.dhall"))++-- | Loading one source wraps every otherwise unchanged registry entry with its+-- provenance.+testProfileSourceWrapper :: IO (Either Text ())+testProfileSourceWrapper = do+  path <- fixtureFilePath "profiles/decisions.dhall"+  let profileSource = RegistrySource (Text.pack path) (RegistryFile path)+  loaded <- loadProfileSource profileSource+  pure $ case loaded of+    Left err -> Left ("failed to load sourced profile fixture: " <> err)+    Right profiles -> do+      assertEqual [profileSource] (map (^. #source) profiles)+      assertEqual [""] (map (^. #entry . #export) profiles)++testDescriptorSourceWrapper :: IO (Either Text ())+testDescriptorSourceWrapper = do+  path <- fixtureFilePath "profile-discovery/valid.dhall"+  let profileSource = DescriptorSource (normalise path)+  loaded <- loadProfileSource (DescriptorSource (takeDirectory path </> "." </> "valid.dhall"))+  pure $ case loaded of+    Left err -> Left ("failed to load descriptor source fixture: " <> err)+    Right profiles -> do+      assertEqual [profileSource] (map (^. #source) profiles)+      assertEqual ["valid"] (map (^. #entry . #export) profiles)++testDescriptorSourceFailure :: IO (Either Text ())+testDescriptorSourceFailure = do+  path <- fixtureFilePath "profile-discovery/not-a-profile.dhall"+  let profileSource = DescriptorSource path+  (failures, profiles) <- loadProfileSources [profileSource]+  pure $ do+    assertEqual [] profiles+    assertEqual [DescriptorSource (normalise path)] (map (^. #failedSource) failures)+    assertBool+      "expected the descriptor decode failure to carry a reason"+      (all (not . Text.null . (^. #failureReason)) failures)++-- | Multi-source enumeration preserves source order and each registry's+-- export ordering rather than globally interleaving equal-looking paths.+testProfileSourcesMergeInOrder :: IO (Either Text ())+testProfileSourcesMergeInOrder = do+  (publicSource, houseSource) <- fixtureProfileSources+  (failures, profiles) <- loadProfileSources [publicSource, houseSource]+  pure $ do+    assertEqual [] failures+    assertEqual+      [ "legacy",+        "nested.decisions",+        "postgresql",+        "postgresql",+        "runbooks"+      ]+      (map (^. #entry . #export) profiles)+    assertEqual+      (replicate 3 publicSource <> replicate 2 houseSource)+      (map (^. #source) profiles)++testMixedProfileSourcesMergeInOrder :: IO (Either Text ())+testMixedProfileSourcesMergeInOrder = do+  (publicSource, _houseSource) <- fixtureProfileSources+  descriptorPath <- fixtureFilePath "profile-discovery/valid.dhall"+  let descriptorSource = DescriptorSource (normalise descriptorPath)+  (failures, profiles) <- loadProfileSources [publicSource, descriptorSource]+  pure $ do+    assertEqual [] failures+    assertEqual+      ["legacy", "nested.decisions", "postgresql", "valid"]+      (map (^. #entry . #export) profiles)+    assertEqual+      (replicate 3 publicSource <> [descriptorSource])+      (map (^. #source) profiles)++testProfileSourcesPartialFailure :: IO (Either Text ())+testProfileSourcesPartialFailure = do+  (_publicSource, houseSource) <- fixtureProfileSources+  let missingSource = RegistrySource "/nonexistent/registry.dhall" (RegistryFile "/nonexistent/registry.dhall")+  (failures, profiles) <- loadProfileSources [missingSource, houseSource]+  pure $ do+    assertEqual [missingSource] (map (^. #failedSource) failures)+    assertBool+      "expected the captured source failure to include a reason"+      (all (not . Text.null . (^. #failureReason)) failures)+    assertEqual ["postgresql", "runbooks"] (map (^. #entry . #export) profiles)++testProfileSourcesExposeCollisions :: IO (Either Text ())+testProfileSourcesExposeCollisions = do+  (publicSource, houseSource) <- fixtureProfileSources+  (_failures, profiles) <- loadProfileSources [publicSource, houseSource]+  pure $+    assertEqual+      [publicSource, houseSource]+      (map (^. #source) (findSourcedProfiles "postgresql" profiles))++testProfileSourcesDropDuplicates :: IO (Either Text ())+testProfileSourcesDropDuplicates = do+  (_publicSource, houseSource) <- fixtureProfileSources+  (failures, profiles) <- loadProfileSources [houseSource, houseSource]+  pure $ do+    assertEqual [] failures+    assertEqual [houseSource] (normalizeProfileSources [houseSource, houseSource])+    assertEqual ["postgresql", "runbooks"] (map (^. #entry . #export) profiles)++fixtureProfileSources :: IO (ProfileSource, ProfileSource)+fixtureProfileSources = do+  publicPath <- fixtureFilePath "registry/package.dhall"+  housePath <- fixtureFilePath "registry-house/package.dhall"+  pure+    ( RegistrySource (Text.pack publicPath) (RegistryFile publicPath),+      RegistrySource (Text.pack housePath) (RegistryFile housePath)+    )+ testParseDocumentId :: Either Text () testParseDocumentId = do   assertEqual@@ -3126,7 +3512,7 @@ -- | An undocumented frontmatter key: the validation tests care about names, not -- prose, and descriptions never affect validation. requiredField :: Text -> FieldRule-requiredField key = FieldRule {field = key, description = Nothing, allowedValues = [], cardinality = Any, format = Nothing, elementFields = Nothing, objectFields = Nothing, reference = Nothing, path = Nothing, when = Nothing}+requiredField key = FieldRule {field = key, description = Nothing, allowedValues = [], cardinality = Any, format = Nothing, elementFields = Nothing, objectFields = Nothing, reference = Nothing, path = Nothing, when = Nothing, uniqueBy = Nothing}  -- | Build a 'FieldRule' positionally in the argument order this file used -- before 'FieldRule' gained @objectFields@, filling that member in as@@ -3155,9 +3541,33 @@       objectFields = Nothing,       reference,       path = Nothing,-      when = condition+      when = condition,+      uniqueBy = Nothing     } +handleReferenceRule :: Text -> [Text] -> Bool -> HandleReferenceRule+handleReferenceRule prefix schemes selfAllowed =+  HandleReferenceRule+    { localPrefix = prefix,+      externalUriSchemes = schemes,+      allowSelf = selfAllowed,+      allowLocal = True,+      externalUriPattern = Nothing+    }++nestedFieldRule :: Text -> Maybe Text -> [Text] -> Cardinality -> Maybe FieldFormat -> Maybe PathReferenceRule -> Maybe FieldCondition -> NestedFieldRule+nestedFieldRule key description allowedValues cardinality format path condition =+  NestedFieldRule+    { field = key,+      description,+      allowedValues,+      cardinality,+      format,+      path,+      when = condition,+      reference = Nothing+    }+ -- | A standalone profile literal so the validation tests do not depend on the -- Dhall fixture. One rule: PostgreSQL Table, fully constrained. testProfileSpec :: ProfileSpec@@ -3736,15 +4146,15 @@ testCompiledNestedRules = do   let profileRules =         NestedRules-          { required = [NestedFieldRule "kind" Nothing ["decision", "implementation"] Any Nothing Nothing Nothing],-            recommended = [NestedFieldRule "notes" Nothing [] Scalar Nothing Nothing Nothing],+          { required = [nestedFieldRule "kind" Nothing ["decision", "implementation"] Any Nothing Nothing Nothing],+            recommended = [nestedFieldRule "notes" Nothing [] Scalar Nothing Nothing Nothing],             optional = []           }       typeRules =         NestedRules           { required =-              [ NestedFieldRule "kind" Nothing ["implementation", "operations"] Any Nothing Nothing Nothing,-                NestedFieldRule "outcome" Nothing ["approved", "rejected"] Any Nothing Nothing Nothing+              [ nestedFieldRule "kind" Nothing ["implementation", "operations"] Any Nothing Nothing Nothing,+                nestedFieldRule "outcome" Nothing ["approved", "rejected"] Any Nothing Nothing Nothing               ],             recommended = [],             optional = []@@ -3873,15 +4283,15 @@     nestedRules =       NestedRules         { required =-            [ NestedFieldRule "kind" Nothing ["human", "model"] Any Nothing Nothing Nothing,-              NestedFieldRule "reviewer" Nothing [] Scalar Nothing Nothing Nothing,-              NestedFieldRule "reviewed_at" Nothing [] Any (Just Rfc3339Utc) Nothing Nothing,-              NestedFieldRule "document_timestamp" Nothing [] Any (Just Rfc3339Utc) Nothing Nothing,-              NestedFieldRule "scope" Nothing reviewScopes Any Nothing Nothing Nothing,-              NestedFieldRule "outcome" Nothing ["approved", "changes-requested", "commented"] Any Nothing Nothing Nothing,-              NestedFieldRule "context" Nothing [] Scalar Nothing Nothing Nothing+            [ nestedFieldRule "kind" Nothing ["human", "model"] Any Nothing Nothing Nothing,+              nestedFieldRule "reviewer" Nothing [] Scalar Nothing Nothing Nothing,+              nestedFieldRule "reviewed_at" Nothing [] Any (Just Rfc3339Utc) Nothing Nothing,+              nestedFieldRule "document_timestamp" Nothing [] Any (Just Rfc3339Utc) Nothing Nothing,+              nestedFieldRule "scope" Nothing reviewScopes Any Nothing Nothing Nothing,+              nestedFieldRule "outcome" Nothing ["approved", "changes-requested", "commented"] Any Nothing Nothing Nothing,+              nestedFieldRule "context" Nothing [] Scalar Nothing Nothing Nothing             ],-          recommended = [NestedFieldRule "notes" Nothing [] Scalar Nothing Nothing Nothing],+          recommended = [nestedFieldRule "notes" Nothing [] Scalar Nothing Nothing Nothing],           optional = []         } @@ -3913,7 +4323,8 @@                     objectFields = objectRules,                     reference = Nothing,                     path = Nothing,-                    when = Nothing+                    when = Nothing,+                    uniqueBy = Nothing                   }               ],             recommended = [],@@ -3931,8 +4342,8 @@ provenanceMemberRules :: NestedRules provenanceMemberRules =   NestedRules-    { required = [NestedFieldRule "by" (Just "Who or what produced this content.") [] Any Nothing Nothing Nothing],-      recommended = [NestedFieldRule "at" Nothing [] Any (Just Rfc3339Utc) Nothing Nothing],+    { required = [nestedFieldRule "by" (Just "Who or what produced this content.") [] Any Nothing Nothing Nothing],+      recommended = [nestedFieldRule "at" Nothing [] Any (Just Rfc3339Utc) Nothing Nothing],       optional = []     } @@ -4062,7 +4473,7 @@     memberRules =       NestedRules         { required =-            [ (NestedFieldRule "resource" Nothing [] Any Nothing Nothing Nothing)+            [ (nestedFieldRule "resource" Nothing [] Any Nothing Nothing Nothing)                 { path = Just (PathReferenceRule permittedSchemes False)                 }             ],@@ -4127,7 +4538,7 @@         ( pathProfileWith             (Just (PathReferenceRule [] False))             Nothing-            (Just (HandleReferenceRule "ADR" [] False))+            (Just (handleReferenceRule "ADR" [] False))             Nothing         )     )@@ -4347,7 +4758,7 @@               ( Just                   NestedRules                     { required =-                        [ (NestedFieldRule "resource" Nothing [] Any Nothing Nothing Nothing)+                        [ (nestedFieldRule "resource" Nothing [] Any Nothing Nothing Nothing)                             { path = Just (PathReferenceRule [] False)                             }                         ],@@ -4583,8 +4994,8 @@   let nestedCrossScope =         NestedRules           { required =-              [ NestedFieldRule "kind" Nothing ["human", "model"] Scalar Nothing Nothing Nothing,-                NestedFieldRule "provider" Nothing [] Scalar Nothing Nothing (Just (FieldCondition "status" ["active"]))+              [ nestedFieldRule "kind" Nothing ["human", "model"] Scalar Nothing Nothing Nothing,+                nestedFieldRule "provider" Nothing [] Scalar Nothing Nothing (Just (FieldCondition "status" ["active"]))               ],             recommended = [],             optional = []@@ -4665,11 +5076,11 @@   let nestedRules =         NestedRules           { required =-              [ NestedFieldRule "kind" Nothing ["human", "model"] Scalar Nothing Nothing Nothing,-                NestedFieldRule "provider" Nothing [] Scalar Nothing Nothing (Just (FieldCondition "kind" ["model"]))+              [ nestedFieldRule "kind" Nothing ["human", "model"] Scalar Nothing Nothing Nothing,+                nestedFieldRule "provider" Nothing [] Scalar Nothing Nothing (Just (FieldCondition "kind" ["model"]))               ],             recommended =-              [NestedFieldRule "notes" Nothing [] Scalar Nothing Nothing (Just (FieldCondition "kind" ["human"]))],+              [nestedFieldRule "notes" Nothing [] Scalar Nothing Nothing (Just (FieldCondition "kind" ["human"]))],             optional = []           }       spec = nestedProfileWithRules List nestedRules Nothing@@ -4702,7 +5113,7 @@           Scalar           fieldFormat           Nothing-          (Just (HandleReferenceRule prefix schemes False))+          (Just (handleReferenceRule prefix schemes False))           Nothing       baseType = firstTypeRule testDocumentIdProfileSpec       specWith profileIdField typeRules profileRules =@@ -4743,10 +5154,215 @@     (Left (ConflictingReferencePrefix "Decision Record" path "ADR" "RFC" :| []))     (compileProfile conflictSpec) +testCompileNestedReferenceAndUniqueness :: IO (Either Text ())+testCompileNestedReferenceAndUniqueness = do+  loaded <- loadNestedReferenceSpec+  pure $ do+    spec <- loaded+    compiled <- firstShow (compileProfile spec)+    dependencies <- lookupBaseRule compiled "dependencies"+    acceptanceCriteria <- lookupBaseRule compiled "acceptanceCriteria"+    assertEqual (Just "id") (fieldRuleUniqueBy acceptanceCriteria)+    case fieldRuleElementFields dependencies >>= Map.lookup "ref" of+      Nothing -> Left "expected a compiled dependencies.ref rule"+      Just referenceRule ->+        assertEqual+          ( Just+              ( HandleReferenceRule+                  "IR"+                  ["mori"]+                  False+                  False+                  (Just nestedReferencePattern)+              )+          )+          (fieldRuleReference referenceRule)++testNestedReferenceAndUniquenessValidation :: IO (Either Text ())+testNestedReferenceAndUniquenessValidation = do+  loaded <- loadNestedReferenceSpec+  validRoot <- fixturePath "profile-nested-references-and-uniqueness-valid"+  invalidRoot <- fixturePath "profile-nested-references-and-uniqueness-invalid"+  validConcepts <- readBundle validRoot+  invalidConcepts <- readBundle invalidRoot+  pure $ do+    spec <- loaded+    compiled <- firstShow (compileProfile spec)+    assertEqual [] (validateProfile PermissiveConformance compiled validConcepts)+    duplicateId <- parseTestConceptId "requests/duplicate"+    assertEqual+      [DuplicateNestedFieldValue duplicateId (objectMemberPath "acceptanceCriteria" "id") (String "AC-1") (0 :| [1])]+      (validateProfile PermissiveConformance compiled invalidConcepts)+    assertReferenceCase compiled "local" "IR-1" (LocalDocumentReferenceNotAllowed <$> pureCaseId "local" <*> pure (nestedTestPathFor "dependencies" 0 "ref") <*> pure "IR-1")+    assertReferenceCase compiled "scheme" "https://example.test/IR-1" (ExternalReferenceSchemeNotAllowed <$> pureCaseId "scheme" <*> pure (nestedTestPathFor "dependencies" 0 "ref") <*> pure "https" <*> pure ["mori"])+    assertPatternCase compiled "artifact-kind" "mori://namespace/project/okf/decisions/concepts/IR-1"+    assertPatternCase compiled "leading-zero" "mori://namespace/project/okf/improvement-requests/concepts/IR-01"+    assertPatternCase compiled "query" "mori://namespace/project/okf/improvement-requests/concepts/IR-1?x=1"+    assertPatternCase compiled "fragment" "mori://namespace/project/okf/improvement-requests/concepts/IR-1#x"+    malformed <- referenceConcept "malformed" "not a reference" ["AC-1", "AC-2"]+    malformedId <- parseTestConceptId "requests/malformed"+    assertEqual+      [MalformedDocumentReference malformedId (nestedTestPathFor "dependencies" 0 "ref") (String "not a reference")]+      (validateProfile PermissiveConformance compiled [malformed])+    grouped <- referenceConcept "groups" canonicalNestedReference ["AC-1", "AC-2", "AC-1", "AC-2"]+    groupedId <- parseTestConceptId "requests/groups"+    assertEqual+      [ DuplicateNestedFieldValue groupedId (objectMemberPath "acceptanceCriteria" "id") (String "AC-1") (0 :| [2]),+        DuplicateNestedFieldValue groupedId (objectMemberPath "acceptanceCriteria" "id") (String "AC-2") (1 :| [3])+      ]+      (validateProfile PermissiveConformance compiled [grouped])+  where+    pureCaseId name = parseTestConceptId ("requests/" <> name)++    assertReferenceCase compiled name raw expectedAction = do+      concept <- referenceConcept name raw ["AC-1", "AC-2"]+      expected <- expectedAction+      assertEqual [expected] (validateProfile PermissiveConformance compiled [concept])++    assertPatternCase compiled name raw = do+      cid <- parseTestConceptId ("requests/" <> name)+      assertReferenceCase+        compiled+        name+        raw+        (Right (ExternalReferencePatternMismatch cid (nestedTestPathFor "dependencies" 0 "ref") raw nestedReferencePattern))++testNestedReferenceAndUniquenessDefinitionErrors :: IO (Either Text ())+testNestedReferenceAndUniquenessDefinitionErrors = do+  loaded <- loadNestedReferenceSpec+  pure $ do+    spec <- loaded+    dependencies <- lookupRaw "dependencies" spec+    acceptance <- lookupRaw "acceptanceCriteria" spec+    let invalidPattern = updateNestedRule "ref" (\rule -> rule {reference = setPattern "[" <$> rule ^. #reference}) dependencies+        invalidPatternSpec = replaceBaseRule invalidPattern spec+    assertSingleDefinitionError+      (\case InvalidExternalUriPattern Nothing path "[" _ -> path == objectMemberPath "dependencies" "ref"; _ -> False)+      (compileProfile invalidPatternSpec)++    let typePattern = updateNestedRule "ref" (\rule -> rule {reference = setPattern "mori://different" <$> rule ^. #reference}) dependencies+        patternConflictSpec = addTypeRule typePattern spec+    assertSingleDefinitionError+      (== ConflictingExternalUriPatterns "Improvement Request" (objectMemberPath "dependencies" "ref") nestedReferencePattern "mori://different")+      (compileProfile patternConflictSpec)++    let noElements = (requiredField "plainRecords") {uniqueBy = Just "id"}+    assertSingleDefinitionError+      (== UniqueByRequiresElementFields Nothing (fieldPath "plainRecords") "id")+      (compileProfile (replaceBaseRule noElements spec))++    let missingMember = acceptance {uniqueBy = Just "missing"}+    assertSingleDefinitionError+      (== UniqueByFieldNotDeclared Nothing (objectMemberPath "acceptanceCriteria" "missing"))+      (compileProfile (replaceBaseRule missingMember spec))++    let optionalMember = updateNestedPresence "id" acceptance+    assertSingleDefinitionError+      (== UniqueByFieldNotUnconditionallyRequired Nothing (objectMemberPath "acceptanceCriteria" "id"))+      (compileProfile (replaceBaseRule optionalMember spec))++    let listMember = updateNestedRule "id" (\rule -> rule {cardinality = List}) acceptance+    assertSingleDefinitionError+      (== UniqueByFieldNotScalar Nothing (objectMemberPath "acceptanceCriteria" "id") List)+      (compileProfile (replaceBaseRule listMember spec))++    let conflictingUnique = acceptance {uniqueBy = Just "text"}+    assertSingleDefinitionError+      (== ConflictingUniqueBy "Improvement Request" (fieldPath "acceptanceCriteria") "id" "text")+      (compileProfile (addTypeRule conflictingUnique spec))+  where+    setPattern :: Text -> HandleReferenceRule -> HandleReferenceRule+    setPattern patternText policy = policy {externalUriPattern = Just patternText}++    lookupRaw :: Text -> ProfileSpec -> Either Text FieldRule+    lookupRaw key spec =+      case [rule | rule <- spec ^. #frontmatter . #required, rule ^. #field == key] of+        [rule] -> Right rule+        _ -> Left ("expected one raw rule for " <> key)++    replaceBaseRule :: FieldRule -> ProfileSpec -> ProfileSpec+    replaceBaseRule replacement spec =+      spec+        { frontmatter =+            (spec ^. #frontmatter)+              { required = replacement : filter ((/= replacement ^. #field) . (^. #field)) (spec ^. #frontmatter . #required)+              }+        }++    addTypeRule :: FieldRule -> ProfileSpec -> ProfileSpec+    addTypeRule typeField spec =+      spec+        { types =+            [ typeRule+                { frontmatter = FrontmatterRules {required = [typeField], recommended = [], optional = []}+                }+            | typeRule <- spec ^. #types+            ]+        }++    updateNestedRule :: Text -> (NestedFieldRule -> NestedFieldRule) -> FieldRule -> FieldRule+    updateNestedRule key change parent =+      parent {elementFields = updateRules <$> parent ^. #elementFields}+      where+        updateRules :: NestedRules -> NestedRules+        updateRules rules =+          rules+            { required = map update (rules ^. #required),+              recommended = map update (rules ^. #recommended),+              optional = map update (rules ^. #optional)+            }+        update rule | rule ^. #field == key = change rule+        update rule = rule++    updateNestedPresence :: Text -> FieldRule -> FieldRule+    updateNestedPresence key parent =+      parent {elementFields = move <$> parent ^. #elementFields}+      where+        move :: NestedRules -> NestedRules+        move rules =+          let (selected, remaining) = List.partition ((== key) . (^. #field)) (rules ^. #required)+           in rules {required = remaining, optional = selected <> rules ^. #optional}++    assertSingleDefinitionError matches = \case+      Left (definitionError :| []) | matches definitionError -> Right ()+      Left errors -> Left ("unexpected definition errors: " <> Text.pack (show (toList errors)))+      Right _ -> Left "expected profile definition to fail"++loadNestedReferenceSpec :: IO (Either Text ProfileSpec)+loadNestedReferenceSpec = do+  descriptorPath <- fixtureFilePath "profiles/nested-references-and-uniqueness.dhall"+  first ("failed to load nested reference profile: " <>) <$> loadProfileFile descriptorPath++nestedReferencePattern :: Text+nestedReferencePattern = "mori://[^/]+/[^/]+/okf/improvement-requests/concepts/IR-[1-9][0-9]*"++canonicalNestedReference :: Text+canonicalNestedReference = "mori://namespace/project/okf/improvement-requests/concepts/IR-9"++referenceConcept :: Text -> Text -> [Text] -> Either Text Concept+referenceConcept name rawReference criterionIds =+  profileConcept+    ("requests/" <> name)+    [ ("type", String "Improvement Request"),+      ("requestId", String "IR-1"),+      ("dependencies", toJSON [object ["ref" .= rawReference]]),+      ( "acceptanceCriteria",+        toJSON+          [ object ["id" .= criterionId, "text" .= ("Criterion " <> criterionId)]+          | criterionId <- criterionIds+          ]+      )+    ]+    "# Request\n"++nestedTestPathFor :: Text -> Int -> Text -> FieldPath+nestedTestPathFor parent elementIndex child =+  FieldPath (FieldName parent :| [ArrayIndex elementIndex, FieldName child])+ testDocumentReferenceValidation :: Either Text () testDocumentReferenceValidation = do-  let referencePolicy = HandleReferenceRule "ADR" ["mori", "MORI"] False-      selfPolicy = HandleReferenceRule "ADR" [] True+  let referencePolicy = handleReferenceRule "ADR" ["mori", "MORI"] False+      selfPolicy = handleReferenceRule "ADR" [] True       referenceRules =         [ fieldRule "references" Nothing [] List Nothing Nothing (Just referencePolicy) Nothing,           fieldRule "selfReference" Nothing [] Scalar Nothing Nothing (Just selfPolicy) Nothing@@ -4883,7 +5499,7 @@           .~ FrontmatterRules             { required = [requiredField "type", requiredField "title"],               recommended = [],-              optional = [fieldRule "supersedes" Nothing [] Scalar Nothing Nothing (Just (HandleReferenceRule "ADR" [] False)) Nothing]+              optional = [fieldRule "supersedes" Nothing [] Scalar Nothing Nothing (Just (handleReferenceRule "ADR" [] False)) Nothing]             }   compiled <- firstShow (compileProfile spec)   target <- decisionTestConcept "decisions/target" "Target" "ADR-1" []@@ -4902,9 +5518,9 @@ testOptionalNestedFieldPresence = do   let nestedRules =         NestedRules-          { required = [NestedFieldRule "kind" Nothing ["human", "model"] Scalar Nothing Nothing Nothing],-            recommended = [NestedFieldRule "notes" Nothing [] Scalar Nothing Nothing Nothing],-            optional = [NestedFieldRule "model" Nothing ["opus", "sonnet"] Scalar Nothing Nothing Nothing]+          { required = [nestedFieldRule "kind" Nothing ["human", "model"] Scalar Nothing Nothing Nothing],+            recommended = [nestedFieldRule "notes" Nothing [] Scalar Nothing Nothing Nothing],+            optional = [nestedFieldRule "model" Nothing ["opus", "sonnet"] Scalar Nothing Nothing Nothing]           }   compiled <- firstShow (compileProfile (nestedProfileWithRules Any nestedRules Nothing))   concept <-@@ -5007,9 +5623,9 @@     )   let nestedRules =         NestedRules-          { required = [NestedFieldRule "kind" Nothing ["model"] Scalar Nothing Nothing Nothing],+          { required = [nestedFieldRule "kind" Nothing ["model"] Scalar Nothing Nothing Nothing],             recommended = [],-            optional = [NestedFieldRule "model" Nothing [] Scalar Nothing Nothing (Just (FieldCondition "kind" ["model"]))]+            optional = [nestedFieldRule "model" Nothing [] Scalar Nothing Nothing (Just (FieldCondition "kind" ["model"]))]           }   assertEqual     (Left (OptionalFieldWithCondition Nothing (FieldPath (FieldName "reviews" :| [FieldName "model"])) :| []))@@ -5648,7 +6264,7 @@         (presenceSummary supersededByRule)       supersedesRule <- lookupCompiledRule "supersedes" rules       assertEqual-        (Just (HandleReferenceRule "ADR" [] False))+        (Just (handleReferenceRule "ADR" [] False))         (fieldRuleReference supersedesRule)       reviewsRule <- lookupCompiledRule "reviews" rules       nested <- maybe (Left "reviews declares no element fields") Right (fieldRuleElementFields reviewsRule)@@ -5835,6 +6451,23 @@   -- list never shifts between rules.   assertHasLine "- Object fields: none" bodyLines +-- | Nested reference and parent uniqueness policies are compiled constraints,+-- so generated documentation must expose both rather than silently dropping+-- the rule kind that lives below the top-level field.+testProfileDocumentationNestedReferenceAndUniqueness :: IO (Either Text ())+testProfileDocumentationNestedReferenceAndUniqueness =+  withRenderedProfileDocumentation+    "profiles/nested-references-and-uniqueness.dhall"+    defaultDocumentationOptions+    ( \_compiled concepts -> do+        typeConcept <- conceptAt 1 concepts+        let bodyLines = conceptBodyLines typeConcept+        assertHasLine+          "    - `ref` — required; allowed values: any; cardinality: scalar; format: none; reference: local handles with prefix `IR`; external URIs with scheme `mori`; local handles prohibited; self-reference not allowed; external URI whole-value pattern `mori://[^/]+/[^/]+/okf/improvement-requests/concepts/IR-[1-9][0-9]*`"+          bodyLines+        assertHasLine "- Unique by: `id`" bodyLines+    )+ testProfileDocumentationTypeConcept :: IO (Either Text ()) testProfileDocumentationTypeConcept =   withRenderedProfileDocumentation@@ -5860,7 +6493,7 @@           "    - `kind` — required; allowed values: `human`, `model`; cardinality: scalar; format: none"           bodyLines         assertHasLine-          "- Reference: local handles with prefix `ADR`; external URIs not allowed; self-reference not allowed"+          "- Reference: local handles with prefix `ADR`; external URIs not allowed; local handles allowed; self-reference not allowed"           bodyLines         -- The profile-scope optional key must appear on the type page, under         -- Optional: this is the merge being visible, which is the whole point.@@ -6274,6 +6907,203 @@ validateInMemoryBundle :: ValidationProfile -> VersionDeclaration -> [Concept] -> [BundleValidationError] validateInMemoryBundle profile declaration concepts =   validateBundle profile declaration (bundleInventoryOfConcepts concepts) concepts++-- | The filter grammar @okf concepts@ hands to 'parseFieldEquals': one @=@, and+-- a key that is either top-level or one level deep.+testParseConceptFilters :: Either Text ()+testParseConceptFilters = do+  assertEqual+    (Right (FieldEquals (TopLevelField "status") "accepted"))+    (parseFieldEquals "status=accepted")+  assertEqual+    (Right (FieldEquals (NestedField "reviews" "outcome") "approved"))+    (parseFieldEquals "reviews.outcome=approved")+  -- Split on the first '=' only, so a value carrying its own survives intact.+  assertEqual+    (Right (FieldEquals (TopLevelField "resource") "postgres://host/db?a=b"))+    (parseFieldEquals "resource=postgres://host/db?a=b")+  -- The value is verbatim: whitespace in a shell argument was typed on purpose.+  assertEqual+    (Right (FieldEquals (TopLevelField "title") " "))+    (parseFieldEquals "title= ")+  assertEqual (Left (MissingFilterSeparator "status")) (parseFieldEquals "status")+  assertEqual (Left (FilterKeyTooDeep "a.b.c")) (parseFieldSelector "a.b.c")+  assertEqual (Left EmptyFilterKey) (parseFieldSelector ".x")+  assertEqual (Left EmptyFilterKey) (parseFieldSelector "reviews.")+  assertEqual (Left EmptyFilterKey) (parseFieldSelector "")+  -- Rendering is the inverse a diagnostic quotes back.+  assertEqual "status=accepted" (renderFilter (FieldEquals (TopLevelField "status") "accepted"))+  assertEqual "reviews.outcome" (renderFieldSelector (NestedField "reviews" "outcome"))+  assertEqual "completedAt" (renderFilter (FieldPresent (TopLevelField "completedAt")))+  assertEqual "!status" (renderFilter (FieldAbsent (TopLevelField "status")))++-- | A filter compares against text, so every non-textual scalar needs a+-- spelling. Aeson writes an integral number without a trailing @.0@, which is+-- what makes @--where usage_count=12@ match a YAML @usage_count: 12@.+testQueryScalarText :: Either Text ()+testQueryScalarText = do+  assertEqual (Just "accepted") (scalarText (String "accepted"))+  assertEqual (Just "12") (scalarText (Number 12))+  assertEqual (Just "0.5") (scalarText (Number 0.5))+  assertEqual (Just "true") (scalarText (Bool True))+  assertEqual Nothing (scalarText Null)+  assertEqual Nothing (scalarText (toJSON (["a", "b"] :: [Text])))+  assertEqual Nothing (scalarText (object ["by" .= ("human:nadeem" :: Text)]))++-- | 'filterConcepts' over the concept-filter fixture bundle, which is built so+-- that every matching shape appears exactly once: a key present on some+-- concepts and absent on another, a list-valued key with more elements than the+-- filter names, a nested key inside a list of records whose elements disagree,+-- and a nested key inside a plain record.+testFilterConceptsOverFixture :: IO (Either Text ())+testFilterConceptsOverFixture = do+  root <- fixturePath "concept-filters"+  concepts <- readBundle root+  pure $ do+    let selected filters = renderConceptId . conceptIdOf <$> filterConcepts filters concepts+    assertEqual+      ["notes/scratch", "requests/alpha", "requests/beta", "requests/gamma"]+      (selected [])+    assertEqual ["requests/alpha"] (selected [FieldEquals (TopLevelField "status") "accepted"])+    -- Existential over a list: alpha is tagged [profiles, cli] and still matches.+    assertEqual+      ["requests/alpha", "requests/beta"]+      (selected [FieldEquals (TopLevelField "tags") "cli"])+    -- Existential over list elements: gamma's first review is changes-requested.+    assertEqual+      ["requests/alpha", "requests/gamma"]+      (selected [FieldEquals (NestedField "reviews" "outcome") "approved"])+    -- The other nested shape: a record-valued key rather than a list of records.+    assertEqual+      ["notes/scratch", "requests/beta"]+      (selected [FieldEquals (NestedField "generated" "by") "human:nadeem"])+    assertEqual ["notes/scratch"] (selected [FieldAbsent (TopLevelField "status")])+    assertEqual ["requests/gamma"] (selected [FieldPresent (TopLevelField "completedAt")])+    -- A key no concept carries selects nothing, which is not an error.+    assertEqual [] (selected [FieldEquals (TopLevelField "status") "withdrawn"])+    -- Repeating a key is an "or".+    assertEqual+      ["requests/alpha", "requests/beta"]+      ( selected+          [ FieldEquals (TopLevelField "status") "accepted",+            FieldEquals (TopLevelField "status") "proposed"+          ]+      )+    -- Different keys are an "and".+    assertEqual+      ["requests/beta"]+      ( selected+          [ FieldEquals (TopLevelField "type") "Improvement Request",+            FieldEquals (TopLevelField "status") "proposed"+          ]+      )+    -- Grouping is by question as well as key, so these two are a conjunction of+    -- two groups and can never both hold.+    assertEqual+      []+      ( selected+          [ FieldEquals (TopLevelField "status") "accepted",+            FieldAbsent (TopLevelField "status")+          ]+      )++-- | A profile checks the /question/, not the bundle: a filter naming a key the+-- profile does not declare, or a value outside a closed vocabulary, can never+-- select anything, and saying so is the whole reason @okf concepts@ takes a+-- @--profile@.+testCheckFiltersAgainstProfile :: IO (Either Text ())+testCheckFiltersAgainstProfile = do+  descriptorPath <- fixtureFilePath "profiles/concept-filters.dhall"+  loaded <- loadProfileFile descriptorPath+  pure $ do+    spec <- first ("failed to load concept-filter profile: " <>) loaded+    compiled <- firstShow (compileProfile spec)+    openTypes <- firstShow (compileProfile (spec & #allowUnknownTypes .~ True))+    let checkAll = checkFiltersAgainstProfile compiled []+        checkFor wantedTypes = checkFiltersAgainstProfile compiled wantedTypes+        statusVocabulary = ["proposed", "accepted", "completed", "rejected"]+        reviewOutcomes = ["approved", "changes-requested", "commented"]+        typeNames = ["Improvement Request", "Note"]++    -- THE REGRESSION GUARD FOR THE ORDERING TRAP. 'status' is both an OKF v0.2+    -- core key ('coreFrontmatterFields' holds it) and a key this profile closes+    -- with four values. A refactor that asks "is this a core key?" before "does+    -- the profile declare it?" passes every other assertion in this test and+    -- silently waves the headline typo straight through.+    assertEqual+      [FilterValueNotInVocabulary (TopLevelField "status") "acepted" statusVocabulary]+      (checkAll [FieldEquals (TopLevelField "status") "acepted"])+    assertEqual [] (checkAll [FieldEquals (TopLevelField "status") "accepted"])++    -- A key no scope declares, whatever question is asked of it.+    assertEqual+      [FilterFieldNotDeclared (TopLevelField "statuz")]+      (checkAll [FieldEquals (TopLevelField "statuz") "x"])+    assertEqual+      [FilterFieldNotDeclared (TopLevelField "statuz")]+      (checkAll [FieldPresent (TopLevelField "statuz")])+    assertEqual+      [FilterFieldNotDeclared (TopLevelField "statuz")]+      (checkAll [FieldAbsent (TopLevelField "statuz")])+    assertEqual [] (checkAll [FieldPresent (TopLevelField "completedAt")])++    -- A nested member's vocabulary is reached through the parent's+    -- elementFields; a member declared without one accepts anything.+    assertEqual+      [FilterValueNotInVocabulary (NestedField "reviews" "outcome") "approvd" reviewOutcomes]+      (checkAll [FieldEquals (NestedField "reviews" "outcome") "approvd"])+    assertEqual [] (checkAll [FieldEquals (NestedField "reviews" "reviewer") "anyone"])+    assertEqual+      [FilterFieldNotDeclared (NestedField "reviews" "reviewr")]+      (checkAll [FieldEquals (NestedField "reviews" "reviewr") "anyone"])+    -- The other nested shape: objectFields on a record-valued key.+    assertEqual [] (checkAll [FieldEquals (NestedField "generated" "by") "human:nadeem"])++    -- The core-field fallback, for a key the profile never mentions: 'timestamp'+    -- is an OKF key, and okf owns the shape of 'verified' as well as its name.+    assertEqual [] (checkAll [FieldEquals (TopLevelField "timestamp") "2026-08-09T00:00:00Z"])+    assertEqual [] (checkAll [FieldEquals (NestedField "verified" "by") "human:nadeem"])++    -- 'type' has no allowedValues anywhere; its vocabulary is the profile's+    -- declared type names, and only while allowUnknownTypes is False.+    assertEqual+      [FilterValueNotInVocabulary (TopLevelField "type") "Ghost" typeNames]+      (checkAll [FieldEquals (TopLevelField "type") "Ghost"])+    assertEqual [] (checkAll [FieldEquals (TopLevelField "type") "Note"])+    assertEqual+      []+      (checkFiltersAgainstProfile openTypes [] [FieldEquals (TopLevelField "type") "Ghost"])++    -- THE REGRESSION GUARD FOR THE SCOPE TRAP. 'noteKind' is declared plainly+    -- profile-wide and closed on 'Note' alone. Treating the profile-wide rules+    -- as a scope of their own would see an empty allowed-value list there, read+    -- it as "unconstrained", and never report anything for this key at all.+    -- Asking about 'Note' specifically must report; asking about every type must+    -- not, because an 'Improvement Request' really may hold any value here.+    assertEqual+      [FilterValueNotInVocabulary (TopLevelField "noteKind") "bogus" ["scratch", "reference"]]+      (checkFor ["Note"] [FieldEquals (TopLevelField "noteKind") "bogus"])+    assertEqual [] (checkFor ["Note"] [FieldEquals (TopLevelField "noteKind") "scratch"])+    assertEqual [] (checkAll [FieldEquals (TopLevelField "noteKind") "bogus"])++    -- Restricting to the types the command line named is a real restriction:+    -- 'targetPlan' is declared only on 'Improvement Request'.+    assertEqual [] (checkAll [FieldPresent (TopLevelField "targetPlan")])+    assertEqual [] (checkFor ["Improvement Request"] [FieldPresent (TopLevelField "targetPlan")])+    assertEqual+      [FilterFieldNotDeclared (TopLevelField "targetPlan")]+      (checkFor ["Note"] [FieldPresent (TopLevelField "targetPlan")])++    -- Every error is reported, not only the first.+    assertEqual+      [ FilterValueNotInVocabulary (TopLevelField "status") "acepted" statusVocabulary,+        FilterFieldNotDeclared (TopLevelField "statuz")+      ]+      ( checkAll+          [ FieldEquals (TopLevelField "status") "acepted",+            FieldEquals (TopLevelField "statuz") "x"+          ]+      )  fixturePath :: FilePath -> IO FilePath fixturePath name = do
+ test/fixtures/catalogue/Profile/FrontmatterRules.dhall view
@@ -0,0 +1,5 @@+--| Schema for a profile's frontmatter expectations.+--+-- Both the type and its defaults come from okf's pinned canonical schema so this+-- package cannot accidentally drift from the decoder.+let okf = ./okf.dhall in okf.defaults.FrontmatterRules
+ test/fixtures/catalogue/Profile/ReviewRule.dhall view
@@ -0,0 +1,98 @@+--| Shared rule for optional review provenance used by coordination and research+-- profiles. When `reviews` is present, every element has a bounded record shape;+-- model reviews additionally require provider, model, and effort metadata.+let okf = ./okf.dhall++let FieldRule = okf.defaults.FieldRule++let NestedFieldRule = okf.defaults.NestedFieldRule++let Cardinality = okf.Cardinality++let FieldFormat = okf.FieldFormat++let condition =+      \(field : Text) -> \(hasValue : List Text) -> { field, hasValue }++let modelOnly = Some (condition "kind" [ "model" ])++in  FieldRule::{+    , field = "reviews"+    , description = Some+        "Chronological human or model review provenance for this document revision."+    , cardinality = Cardinality.List+    , elementFields = Some+      { required =+        [ NestedFieldRule::{+          , field = "kind"+          , description = Some "Whether a human or model performed the review."+          , allowedValues = [ "human", "model" ]+          , cardinality = Cardinality.Scalar+          }+        , NestedFieldRule::{+          , field = "reviewer"+          , description = Some+              "Stable identity of the reviewing person or agent."+          , cardinality = Cardinality.Scalar+          }+        , NestedFieldRule::{+          , field = "reviewed_at"+          , description = Some "UTC time at which the review completed."+          , cardinality = Cardinality.Scalar+          , format = Some FieldFormat.Rfc3339Utc+          }+        , NestedFieldRule::{+          , field = "document_timestamp"+          , description = Some+              "Document revision timestamp covered by the review."+          , cardinality = Cardinality.Scalar+          , format = Some FieldFormat.Rfc3339Utc+          }+        , NestedFieldRule::{+          , field = "scope"+          , description = Some "Aspect of the document covered by the review."+          , allowedValues =+            [ "content"+            , "technical-accuracy"+            , "editorial"+            , "catalog-metadata"+            , "content-and-metadata"+            ]+          , cardinality = Cardinality.Scalar+          }+        , NestedFieldRule::{+          , field = "outcome"+          , description = Some "Result recorded by the reviewer."+          , allowedValues = [ "approved", "changes-requested", "commented" ]+          , cardinality = Cardinality.Scalar+          }+        , NestedFieldRule::{+          , field = "context"+          , description = Some+              "Evidence and repository context used for the review."+          , cardinality = Cardinality.Scalar+          }+        , NestedFieldRule::{+          , field = "provider"+          , description = Some "Serving provider for a model review."+          , cardinality = Cardinality.Scalar+          , when = modelOnly+          }+        , NestedFieldRule::{+          , field = "model"+          , description = Some "Most specific available model identifier."+          , cardinality = Cardinality.Scalar+          , when = modelOnly+          }+        , NestedFieldRule::{+          , field = "effort"+          , description = Some "Provider-reported reasoning or thinking effort."+          , allowedValues = [ "low", "medium", "high", "xhigh", "unspecified" ]+          , cardinality = Cardinality.Scalar+          , when = modelOnly+          }+        ]+      , recommended = [] : List NestedFieldRule.Type+      , optional = [] : List NestedFieldRule.Type+      }+    }
+ test/fixtures/catalogue/Profile/Type.dhall view
@@ -0,0 +1,15 @@+--| Record-completion schema for a complete OKF house profile.+--+-- A profile is a declarative description of how a team uses the Open Knowledge+-- Format (OKF): which `type:` strings are allowed, which frontmatter keys are+-- required, what `resource:` URI scheme each type needs, where each type's files+-- must live, and what columns a `# Schema` table must have.+--+-- Profiles are NOT part of the OKF standard. A bundle that deviates from a+-- profile remains fully OKF-conformant; profiles are house conventions layered+-- on top, checked (advisory by default) with `okf validate --profile`.+--+-- Both the type and its defaults come from okf's pinned canonical schema so this+-- package cannot accidentally drift from the decoder. Values are built with+-- completion: `Profile::{ name = "…", types = [ … ] }`.+let okf = ./okf.dhall in okf.defaults.Profile
+ test/fixtures/catalogue/Profile/TypeRule.dhall view
@@ -0,0 +1,5 @@+--| Schema for a single per-`type` rule inside an OKF house profile.+--+-- Both the type and its defaults come from okf's pinned canonical schema so this+-- package cannot accidentally drift from the decoder.+let okf = ./okf.dhall in okf.defaults.TypeRule
+ test/fixtures/catalogue/Profile/V02.dhall view
@@ -0,0 +1,265 @@+--| The six OKF v0.2 frontmatter families, described once for the whole catalog.+--+-- Every profile in this repository that adopts OKF v0.2 splices its rules from+-- here rather than re-authoring them, so that a correction lands in one place+-- instead of drifting across seven files. Import it and name what you need:+--+--     let v02 = ../../Profile/V02.dhall+--+--     in  Profile::{ okfVersion = "0.2", frontmatter = FrontmatterRules::{+--         , required = [ …, v02.generated ]+--         , optional = [ v02.verified, v02.legacyTimestamp ]+--         } }+--+-- A consuming profile may reword a rule with the `//` operator:+--+--     v02.generated // { description = Some "How this decision record was produced." }+--+-- but must not redefine the constraint. If a shared value is wrong for one+-- profile it is wrong for all of them: fix it here and re-verify every consumer.+--+-- Descriptions are deliberately short. okf echoes a rule's description back+-- inside its missing-field diagnostic, so a paragraph there produces an+-- unreadable error line; explanations belong in comments like this one. They are+-- also worded to make sense in *any* profile in this catalog, since all of them+-- surface the same text.+--+-- The assembled, standalone form of these values ships as `../profiles/okf-v0-2.dhall`+-- (exported as `okfV02`), a format-level reference profile for a team with no+-- house conventions.+--+--+-- ## Policy one: where the house `status` key collides, the house key wins+--+-- OKF v0.2 §5.4 gives `status` the vocabulary `draft` / `stable` / `deprecated`.+-- Seven profiles in this repository use the same key name for a house lifecycle+-- vocabulary — five that predate v0.2, and two introduced after it that answer a+-- question v0.2's vocabulary cannot:+--+--   * `documentation.architectureDecisions` — `Accepted`, and siblings+--   * `documentation.patternCatalog`        — `current`, `deprecated`+--   * `documentation.researchDocuments`     — `active`, `complete`, `superseded`+--   * `coordination.improvementRequests`    — `proposed`, `accepted`, `in-progress`,+--                                             `completed`, `rejected`, `withdrawn`,+--                                             `superseded`+--   * `coordination.useCases`               — `draft`, `validated`, `planned`,+--                                             `in-progress`, `delivered`, `retired`+--   * `coordination.capabilities`           — `shipped`, `deprecated`, `withdrawn`+--   * `coordination.bugReports`             — `reported`, `confirmed`, `in-progress`,+--                                             `fixed`, `wont-fix`, `duplicate`,+--                                             `not-a-bug`, `cannot-reproduce`+--+-- Those seven keep their house vocabulary and do **not** splice in `status` or+-- `staleAfter` from this module. This is sanctioned rather than tolerated: a+-- profile key name does not imply the OKF core key of that name, and okf never+-- rejects a profile over it. What okf checks instead is value *formats*, because+-- a format has no house-convention reading.+--+-- Renaming the house key was considered and rejected — it would break every+-- consumer corpus, every cross-repository citation, and every downstream query,+-- for no conformance gain. The accepted consequence is that `okf trust` prints+-- the house value verbatim as a status it does not recognise.+--+-- Profiles with no collision — `postgresql`, `tanPostgresql`, and the `okfV02`+-- reference profile — do declare both `status` and `staleAfter`.+--+--+-- ## Policy two: the house `reviews` family and OKF `verified` coexist+--+-- `./ReviewRule.dhall` defines a rich house review record — reviewer identity,+-- review scope, outcome, serving provider, model identifier, reasoning effort,+-- and evidence context — used by `coordination.improvementRequests`,+-- `coordination.useCases`, and `documentation.researchDocuments`. OKF `verified`+-- records only `by` and `at`.+--+-- Neither is a superset of the other, so neither replaces the other. Dropping+-- `reviews` would destroy information three profiles already collect; omitting+-- `verified` would leave `okf trust` reporting every concept as `unverified`+-- even where a human approved it. Both are declared, and a producer that records+-- an approving `reviews` entry should mirror it into `verified` so the derived+-- trust tier is accurate.+--+--+-- ## Do not declare a `trust` key+--+-- A document's trust tier is computed on every read from `verified` and is never+-- written into a bundle. A document carrying `trust:` is carrying an ordinary+-- extension field that okf ignores.+let okf = ./okf.dhall++let FieldRule = okf.defaults.FieldRule++let NestedRules = okf.defaults.NestedRules++let Cardinality = okf.Cardinality++let FieldFormat = okf.FieldFormat++let field = okf.mk.FieldRule++let nested = okf.mk.NestedFieldRule++-- §5.2. `by` is REQUIRED within a trust record; `at` is the timestamp. The same+-- member rules describe `generated` and each `verified` entry, so they are+-- written once and shared.+let trustMembers =+      NestedRules::{+      , required =+        [ -- §7 states that producers MUST use the `human:` prefix for+          -- hand-authored content, because §5.3 makes that prefix the sole+          -- discriminator between the machine-confirmed and human-reviewed+          -- trust tiers. The `actor` format checks the shape; a profile that+          -- wants to demand the human tier uses `nested.humanActor` instead.+              nested.documented+                "by"+                "§7. The actor responsible: `<producer>/<version>`, `human:<id>`, or `process:<id>`."+          //  { format = Some FieldFormat.Actor }+        ]+      , recommended =+        [     nested.documented+                "at"+                "UTC RFC3339 timestamp, ending in `Z`, for when this happened."+          //  { format = Some FieldFormat.Rfc3339Utc }+        ]+      }++-- §5.2. A mapping, not a list: content is produced once. Supersedes the v0.1+-- `timestamp` key per §13.1 — see `legacyTimestamp` below.+let generated =+          field.record "generated" trustMembers+      //  { description = Some+              "§5.2. How this content was produced. Supersedes the v0.1 `timestamp` key."+          }++-- §5.2 permits `verified` as a list of mappings or as one bare mapping, and+-- requires a consumer to treat the bare mapping as a one-element list.+-- `recordOrList` declares both spellings against the same member rules, so+-- either is accepted and both are checked.+--+-- Place this in a profile's `optional` list, not `recommended`: §11 forbids+-- treating a missing optional family as a deficiency, so demanding it would make+-- `--strict` complain about every unverified concept.+let verified =+          field.recordOrList "verified" trustMembers+      //  { description = Some+              "§5.2. Independent confirmations that the content is accurate. A list of mappings, or one bare mapping."+          }++-- §5.4. Absence means `stable`, so this is never demanded.+--+-- Do NOT splice this into a profile that already uses `status` for a house+-- lifecycle vocabulary — see Policy one in the header.+let status =+      FieldRule::{+      , field = "status"+      , description = Some+          "§5.4. Lifecycle state. Absence means `stable`, so this is never demanded."+      , allowedValues = [ "draft", "stable", "deprecated" ]+      , cardinality = Cardinality.Scalar+      }++-- §5.5. Advisory: okf records the date but does not compare it against the+-- clock during validation. A concept is stale when `today >= stale_after`,+-- inclusive.+let staleAfter =+      FieldRule::{+      , field = "stale_after"+      , description = Some+          "§5.5. Calendar date after which the content should be re-confirmed."+      , cardinality = Cardinality.Scalar+      , format = Some FieldFormat.Date+      }++-- §5.1. Only `resource` is required within an entry.+let sourceMembers =+      NestedRules::{+      , required =+        [ -- Deliberately no path rule. §5.1 says this names either a concrete+          -- artifact a consumer can follow or a population or scope descriptor+          -- it cannot, so demanding a resolvable path is a house convention+          -- rather than a v0.2 rule. A profile that wants one writes+          -- `nested.localOrExternalPath "resource" [ "https" ]`.+          nested.documented+            "resource"+            "§5.1. What the source is: a followable artifact, or a scope descriptor."+        ]+      , optional =+        [ nested.documented+            "id"+            "§5.1. Short label for this entry, used to cite it from a footnote in the body."+        , nested.documented "title" "§5.1. Human-readable name for the source."+        ,     nested.documented+                "author"+                "§5.1. Who or what produced the source, per the §7 actor convention."+          //  { format = Some FieldFormat.Actor }+        , -- A YAML integer, not a quoted string: coercing `"40"` would hide a+          -- producer mistake, so okf does not read it.+              nested.documented+                "usage_count"+                "§5.1. How many times the source was drawn on. A count, so never negative."+          //  { format = Some FieldFormat.NonNegativeInteger }+        ,     nested.documented+                "last_modified"+                "§5.1. Calendar date the source itself last changed."+          //  { format = Some FieldFormat.Date }+        ]+      }++let sources =+          field.recordList "sources" sourceMembers+      //  { description = Some+              "§5.1. What this content was derived from, one entry per source."+          }++-- §5.1. A sibling of `sources`, not a member of it: it frames every entry's+-- usage count.+let usageWindowMembers =+      NestedRules::{+      , optional =+        [     nested.documented "from" "§5.1. Calendar date the window opens."+          //  { format = Some FieldFormat.Date }+        ,     nested.documented "to" "§5.1. Calendar date the window closes."+          //  { format = Some FieldFormat.Date }+        ]+      }++let usageWindow =+          field.record "usage_window" usageWindowMembers+      //  { description = Some+              "§5.1. The period the sources were observed over, when one applies to the whole concept."+          }++-- The superseded v0.1 key, for placement in a profile's `optional` list ONLY.+--+-- As of okf 0.5.0.0 a profile's declared `okfVersion` is compile-checked against+-- the rules it declares. Putting this rule in `required` or `recommended`+-- alongside `okfVersion = "0.2"` is a hard profile load failure:+--+--     Failed to load profile …: invalid profile definition:+--       - profile frontmatter: declared okfVersion 0.2 supersedes the frontmatter+--         key timestamp (OKF 0.2); move it to the optional list or replace it+--         with generated+--+-- `optional` is the right presence class and is explicitly legal: the key is+-- never reported when absent, in any mode, while its RFC3339-UTC format is still+-- checked whenever it is present. okf reads `timestamp` whenever `generated` is+-- absent, silently and with no removal horizon, so keeping the rule lets a+-- half-migrated corpus keep validating without letting a malformed legacy+-- timestamp through unnoticed.+let legacyTimestamp =+          field.rfc3339Utc "timestamp"+      //  { description = Some+              "Superseded v0.1 revision timestamp. Prefer `generated.at`; keep this in `optional` only."+          }++in  { trustMembers+    , generated+    , verified+    , status+    , staleAfter+    , sourceMembers+    , sources+    , usageWindowMembers+    , usageWindow+    , legacyTimestamp+    }
+ test/fixtures/catalogue/Profile/okf.dhall view
@@ -0,0 +1,12633 @@+{ Cardinality = < Any | List | Scalar >+, FieldCondition = { field : Text, hasValue : List Text }+, FieldFormat =+    < Actor+    | Boolean+    | Date+    | DocumentHandle : Text+    | HumanActor+    | Integer+    | NonNegativeInteger+    | Rfc3339Utc+    | Uri+    | UriWithScheme : Text+    >+, FieldRule =+    { allowedValues : List Text+    , cardinality : < Any | List | Scalar >+    , description : Optional Text+    , elementFields :+        Optional+          { optional :+              List+                { allowedValues : List Text+                , cardinality : < Any | List | Scalar >+                , description : Optional Text+                , field : Text+                , format :+                    Optional+                      < Actor+                      | Boolean+                      | Date+                      | DocumentHandle : Text+                      | HumanActor+                      | Integer+                      | NonNegativeInteger+                      | Rfc3339Utc+                      | Uri+                      | UriWithScheme : Text+                      >+                , path :+                    Optional+                      { allowSelf : Bool, externalUriSchemes : List Text }+                , when : Optional { field : Text, hasValue : List Text }+                }+          , recommended :+              List+                { allowedValues : List Text+                , cardinality : < Any | List | Scalar >+                , description : Optional Text+                , field : Text+                , format :+                    Optional+                      < Actor+                      | Boolean+                      | Date+                      | DocumentHandle : Text+                      | HumanActor+                      | Integer+                      | NonNegativeInteger+                      | Rfc3339Utc+                      | Uri+                      | UriWithScheme : Text+                      >+                , path :+                    Optional+                      { allowSelf : Bool, externalUriSchemes : List Text }+                , when : Optional { field : Text, hasValue : List Text }+                }+          , required :+              List+                { allowedValues : List Text+                , cardinality : < Any | List | Scalar >+                , description : Optional Text+                , field : Text+                , format :+                    Optional+                      < Actor+                      | Boolean+                      | Date+                      | DocumentHandle : Text+                      | HumanActor+                      | Integer+                      | NonNegativeInteger+                      | Rfc3339Utc+                      | Uri+                      | UriWithScheme : Text+                      >+                , path :+                    Optional+                      { allowSelf : Bool, externalUriSchemes : List Text }+                , when : Optional { field : Text, hasValue : List Text }+                }+          }+    , field : Text+    , format :+        Optional+          < Actor+          | Boolean+          | Date+          | DocumentHandle : Text+          | HumanActor+          | Integer+          | NonNegativeInteger+          | Rfc3339Utc+          | Uri+          | UriWithScheme : Text+          >+    , objectFields :+        Optional+          { optional :+              List+                { allowedValues : List Text+                , cardinality : < Any | List | Scalar >+                , description : Optional Text+                , field : Text+                , format :+                    Optional+                      < Actor+                      | Boolean+                      | Date+                      | DocumentHandle : Text+                      | HumanActor+                      | Integer+                      | NonNegativeInteger+                      | Rfc3339Utc+                      | Uri+                      | UriWithScheme : Text+                      >+                , path :+                    Optional+                      { allowSelf : Bool, externalUriSchemes : List Text }+                , when : Optional { field : Text, hasValue : List Text }+                }+          , recommended :+              List+                { allowedValues : List Text+                , cardinality : < Any | List | Scalar >+                , description : Optional Text+                , field : Text+                , format :+                    Optional+                      < Actor+                      | Boolean+                      | Date+                      | DocumentHandle : Text+                      | HumanActor+                      | Integer+                      | NonNegativeInteger+                      | Rfc3339Utc+                      | Uri+                      | UriWithScheme : Text+                      >+                , path :+                    Optional+                      { allowSelf : Bool, externalUriSchemes : List Text }+                , when : Optional { field : Text, hasValue : List Text }+                }+          , required :+              List+                { allowedValues : List Text+                , cardinality : < Any | List | Scalar >+                , description : Optional Text+                , field : Text+                , format :+                    Optional+                      < Actor+                      | Boolean+                      | Date+                      | DocumentHandle : Text+                      | HumanActor+                      | Integer+                      | NonNegativeInteger+                      | Rfc3339Utc+                      | Uri+                      | UriWithScheme : Text+                      >+                , path :+                    Optional+                      { allowSelf : Bool, externalUriSchemes : List Text }+                , when : Optional { field : Text, hasValue : List Text }+                }+          }+    , path : Optional { allowSelf : Bool, externalUriSchemes : List Text }+    , reference :+        Optional+          { allowSelf : Bool+          , externalUriSchemes : List Text+          , localPrefix : Text+          }+    , when : Optional { field : Text, hasValue : List Text }+    }+, FrontmatterRules =+    { optional :+        List+          { allowedValues : List Text+          , cardinality : < Any | List | Scalar >+          , description : Optional Text+          , elementFields :+              Optional+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , field : Text+          , format :+              Optional+                < Actor+                | Boolean+                | Date+                | DocumentHandle : Text+                | HumanActor+                | Integer+                | NonNegativeInteger+                | Rfc3339Utc+                | Uri+                | UriWithScheme : Text+                >+          , objectFields :+              Optional+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , path : Optional { allowSelf : Bool, externalUriSchemes : List Text }+          , reference :+              Optional+                { allowSelf : Bool+                , externalUriSchemes : List Text+                , localPrefix : Text+                }+          , when : Optional { field : Text, hasValue : List Text }+          }+    , recommended :+        List+          { allowedValues : List Text+          , cardinality : < Any | List | Scalar >+          , description : Optional Text+          , elementFields :+              Optional+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , field : Text+          , format :+              Optional+                < Actor+                | Boolean+                | Date+                | DocumentHandle : Text+                | HumanActor+                | Integer+                | NonNegativeInteger+                | Rfc3339Utc+                | Uri+                | UriWithScheme : Text+                >+          , objectFields :+              Optional+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , path : Optional { allowSelf : Bool, externalUriSchemes : List Text }+          , reference :+              Optional+                { allowSelf : Bool+                , externalUriSchemes : List Text+                , localPrefix : Text+                }+          , when : Optional { field : Text, hasValue : List Text }+          }+    , required :+        List+          { allowedValues : List Text+          , cardinality : < Any | List | Scalar >+          , description : Optional Text+          , elementFields :+              Optional+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , field : Text+          , format :+              Optional+                < Actor+                | Boolean+                | Date+                | DocumentHandle : Text+                | HumanActor+                | Integer+                | NonNegativeInteger+                | Rfc3339Utc+                | Uri+                | UriWithScheme : Text+                >+          , objectFields :+              Optional+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , path : Optional { allowSelf : Bool, externalUriSchemes : List Text }+          , reference :+              Optional+                { allowSelf : Bool+                , externalUriSchemes : List Text+                , localPrefix : Text+                }+          , when : Optional { field : Text, hasValue : List Text }+          }+    }+, HandleReferenceRule =+    { allowSelf : Bool, externalUriSchemes : List Text, localPrefix : Text }+, NestedFieldRule =+    { allowedValues : List Text+    , cardinality : < Any | List | Scalar >+    , description : Optional Text+    , field : Text+    , format :+        Optional+          < Actor+          | Boolean+          | Date+          | DocumentHandle : Text+          | HumanActor+          | Integer+          | NonNegativeInteger+          | Rfc3339Utc+          | Uri+          | UriWithScheme : Text+          >+    , path : Optional { allowSelf : Bool, externalUriSchemes : List Text }+    , when : Optional { field : Text, hasValue : List Text }+    }+, NestedRules =+    { optional :+        List+          { allowedValues : List Text+          , cardinality : < Any | List | Scalar >+          , description : Optional Text+          , field : Text+          , format :+              Optional+                < Actor+                | Boolean+                | Date+                | DocumentHandle : Text+                | HumanActor+                | Integer+                | NonNegativeInteger+                | Rfc3339Utc+                | Uri+                | UriWithScheme : Text+                >+          , path : Optional { allowSelf : Bool, externalUriSchemes : List Text }+          , when : Optional { field : Text, hasValue : List Text }+          }+    , recommended :+        List+          { allowedValues : List Text+          , cardinality : < Any | List | Scalar >+          , description : Optional Text+          , field : Text+          , format :+              Optional+                < Actor+                | Boolean+                | Date+                | DocumentHandle : Text+                | HumanActor+                | Integer+                | NonNegativeInteger+                | Rfc3339Utc+                | Uri+                | UriWithScheme : Text+                >+          , path : Optional { allowSelf : Bool, externalUriSchemes : List Text }+          , when : Optional { field : Text, hasValue : List Text }+          }+    , required :+        List+          { allowedValues : List Text+          , cardinality : < Any | List | Scalar >+          , description : Optional Text+          , field : Text+          , format :+              Optional+                < Actor+                | Boolean+                | Date+                | DocumentHandle : Text+                | HumanActor+                | Integer+                | NonNegativeInteger+                | Rfc3339Utc+                | Uri+                | UriWithScheme : Text+                >+          , path : Optional { allowSelf : Bool, externalUriSchemes : List Text }+          , when : Optional { field : Text, hasValue : List Text }+          }+    }+, PathReferenceRule = { allowSelf : Bool, externalUriSchemes : List Text }+, Profile =+    { allowUnknownFields : Bool+    , allowUnknownTypes : Bool+    , description : Optional Text+    , frontmatter :+        { optional :+            List+              { allowedValues : List Text+              , cardinality : < Any | List | Scalar >+              , description : Optional Text+              , elementFields :+                  Optional+                    { optional :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , recommended :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , required :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    }+              , field : Text+              , format :+                  Optional+                    < Actor+                    | Boolean+                    | Date+                    | DocumentHandle : Text+                    | HumanActor+                    | Integer+                    | NonNegativeInteger+                    | Rfc3339Utc+                    | Uri+                    | UriWithScheme : Text+                    >+              , objectFields :+                  Optional+                    { optional :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , recommended :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , required :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    }+              , path :+                  Optional { allowSelf : Bool, externalUriSchemes : List Text }+              , reference :+                  Optional+                    { allowSelf : Bool+                    , externalUriSchemes : List Text+                    , localPrefix : Text+                    }+              , when : Optional { field : Text, hasValue : List Text }+              }+        , recommended :+            List+              { allowedValues : List Text+              , cardinality : < Any | List | Scalar >+              , description : Optional Text+              , elementFields :+                  Optional+                    { optional :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , recommended :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , required :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    }+              , field : Text+              , format :+                  Optional+                    < Actor+                    | Boolean+                    | Date+                    | DocumentHandle : Text+                    | HumanActor+                    | Integer+                    | NonNegativeInteger+                    | Rfc3339Utc+                    | Uri+                    | UriWithScheme : Text+                    >+              , objectFields :+                  Optional+                    { optional :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , recommended :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , required :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    }+              , path :+                  Optional { allowSelf : Bool, externalUriSchemes : List Text }+              , reference :+                  Optional+                    { allowSelf : Bool+                    , externalUriSchemes : List Text+                    , localPrefix : Text+                    }+              , when : Optional { field : Text, hasValue : List Text }+              }+        , required :+            List+              { allowedValues : List Text+              , cardinality : < Any | List | Scalar >+              , description : Optional Text+              , elementFields :+                  Optional+                    { optional :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , recommended :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , required :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    }+              , field : Text+              , format :+                  Optional+                    < Actor+                    | Boolean+                    | Date+                    | DocumentHandle : Text+                    | HumanActor+                    | Integer+                    | NonNegativeInteger+                    | Rfc3339Utc+                    | Uri+                    | UriWithScheme : Text+                    >+              , objectFields :+                  Optional+                    { optional :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , recommended :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , required :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    }+              , path :+                  Optional { allowSelf : Bool, externalUriSchemes : List Text }+              , reference :+                  Optional+                    { allowSelf : Bool+                    , externalUriSchemes : List Text+                    , localPrefix : Text+                    }+              , when : Optional { field : Text, hasValue : List Text }+              }+        }+    , idField : Optional Text+    , name : Text+    , okfVersion : Text+    , requireBundleVersion : Optional Text+    , types :+        List+          { description : Optional Text+          , frontmatter :+              { optional :+                  List+                    { allowedValues : List Text+                    , cardinality : < Any | List | Scalar >+                    , description : Optional Text+                    , elementFields :+                        Optional+                          { optional :+                              List+                                { allowedValues : List Text+                                , cardinality : < Any | List | Scalar >+                                , description : Optional Text+                                , field : Text+                                , format :+                                    Optional+                                      < Actor+                                      | Boolean+                                      | Date+                                      | DocumentHandle : Text+                                      | HumanActor+                                      | Integer+                                      | NonNegativeInteger+                                      | Rfc3339Utc+                                      | Uri+                                      | UriWithScheme : Text+                                      >+                                , path :+                                    Optional+                                      { allowSelf : Bool+                                      , externalUriSchemes : List Text+                                      }+                                , when :+                                    Optional+                                      { field : Text, hasValue : List Text }+                                }+                          , recommended :+                              List+                                { allowedValues : List Text+                                , cardinality : < Any | List | Scalar >+                                , description : Optional Text+                                , field : Text+                                , format :+                                    Optional+                                      < Actor+                                      | Boolean+                                      | Date+                                      | DocumentHandle : Text+                                      | HumanActor+                                      | Integer+                                      | NonNegativeInteger+                                      | Rfc3339Utc+                                      | Uri+                                      | UriWithScheme : Text+                                      >+                                , path :+                                    Optional+                                      { allowSelf : Bool+                                      , externalUriSchemes : List Text+                                      }+                                , when :+                                    Optional+                                      { field : Text, hasValue : List Text }+                                }+                          , required :+                              List+                                { allowedValues : List Text+                                , cardinality : < Any | List | Scalar >+                                , description : Optional Text+                                , field : Text+                                , format :+                                    Optional+                                      < Actor+                                      | Boolean+                                      | Date+                                      | DocumentHandle : Text+                                      | HumanActor+                                      | Integer+                                      | NonNegativeInteger+                                      | Rfc3339Utc+                                      | Uri+                                      | UriWithScheme : Text+                                      >+                                , path :+                                    Optional+                                      { allowSelf : Bool+                                      , externalUriSchemes : List Text+                                      }+                                , when :+                                    Optional+                                      { field : Text, hasValue : List Text }+                                }+                          }+                    , field : Text+                    , format :+                        Optional+                          < Actor+                          | Boolean+                          | Date+                          | DocumentHandle : Text+                          | HumanActor+                          | Integer+                          | NonNegativeInteger+                          | Rfc3339Utc+                          | Uri+                          | UriWithScheme : Text+                          >+                    , objectFields :+                        Optional+                          { optional :+                              List+                                { allowedValues : List Text+                                , cardinality : < Any | List | Scalar >+                                , description : Optional Text+                                , field : Text+                                , format :+                                    Optional+                                      < Actor+                                      | Boolean+                                      | Date+                                      | DocumentHandle : Text+                                      | HumanActor+                                      | Integer+                                      | NonNegativeInteger+                                      | Rfc3339Utc+                                      | Uri+                                      | UriWithScheme : Text+                                      >+                                , path :+                                    Optional+                                      { allowSelf : Bool+                                      , externalUriSchemes : List Text+                                      }+                                , when :+                                    Optional+                                      { field : Text, hasValue : List Text }+                                }+                          , recommended :+                              List+                                { allowedValues : List Text+                                , cardinality : < Any | List | Scalar >+                                , description : Optional Text+                                , field : Text+                                , format :+                                    Optional+                                      < Actor+                                      | Boolean+                                      | Date+                                      | DocumentHandle : Text+                                      | HumanActor+                                      | Integer+                                      | NonNegativeInteger+                                      | Rfc3339Utc+                                      | Uri+                                      | UriWithScheme : Text+                                      >+                                , path :+                                    Optional+                                      { allowSelf : Bool+                                      , externalUriSchemes : List Text+                                      }+                                , when :+                                    Optional+                                      { field : Text, hasValue : List Text }+                                }+                          , required :+                              List+                                { allowedValues : List Text+                                , cardinality : < Any | List | Scalar >+                                , description : Optional Text+                                , field : Text+                                , format :+                                    Optional+                                      < Actor+                                      | Boolean+                                      | Date+                                      | DocumentHandle : Text+                                      | HumanActor+                                      | Integer+                                      | NonNegativeInteger+                                      | Rfc3339Utc+                                      | Uri+                                      | UriWithScheme : Text+                                      >+                                , path :+                                    Optional+                                      { allowSelf : Bool+                                      , externalUriSchemes : List Text+                                      }+                                , when :+                                    Optional+                                      { field : Text, hasValue : List Text }+                                }+                          }+                    , path :+                        Optional+                          { allowSelf : Bool, externalUriSchemes : List Text }+                    , reference :+                        Optional+                          { allowSelf : Bool+                          , externalUriSchemes : List Text+                          , localPrefix : Text+                          }+                    , when : Optional { field : Text, hasValue : List Text }+                    }+              , recommended :+                  List+                    { allowedValues : List Text+                    , cardinality : < Any | List | Scalar >+                    , description : Optional Text+                    , elementFields :+                        Optional+                          { optional :+                              List+                                { allowedValues : List Text+                                , cardinality : < Any | List | Scalar >+                                , description : Optional Text+                                , field : Text+                                , format :+                                    Optional+                                      < Actor+                                      | Boolean+                                      | Date+                                      | DocumentHandle : Text+                                      | HumanActor+                                      | Integer+                                      | NonNegativeInteger+                                      | Rfc3339Utc+                                      | Uri+                                      | UriWithScheme : Text+                                      >+                                , path :+                                    Optional+                                      { allowSelf : Bool+                                      , externalUriSchemes : List Text+                                      }+                                , when :+                                    Optional+                                      { field : Text, hasValue : List Text }+                                }+                          , recommended :+                              List+                                { allowedValues : List Text+                                , cardinality : < Any | List | Scalar >+                                , description : Optional Text+                                , field : Text+                                , format :+                                    Optional+                                      < Actor+                                      | Boolean+                                      | Date+                                      | DocumentHandle : Text+                                      | HumanActor+                                      | Integer+                                      | NonNegativeInteger+                                      | Rfc3339Utc+                                      | Uri+                                      | UriWithScheme : Text+                                      >+                                , path :+                                    Optional+                                      { allowSelf : Bool+                                      , externalUriSchemes : List Text+                                      }+                                , when :+                                    Optional+                                      { field : Text, hasValue : List Text }+                                }+                          , required :+                              List+                                { allowedValues : List Text+                                , cardinality : < Any | List | Scalar >+                                , description : Optional Text+                                , field : Text+                                , format :+                                    Optional+                                      < Actor+                                      | Boolean+                                      | Date+                                      | DocumentHandle : Text+                                      | HumanActor+                                      | Integer+                                      | NonNegativeInteger+                                      | Rfc3339Utc+                                      | Uri+                                      | UriWithScheme : Text+                                      >+                                , path :+                                    Optional+                                      { allowSelf : Bool+                                      , externalUriSchemes : List Text+                                      }+                                , when :+                                    Optional+                                      { field : Text, hasValue : List Text }+                                }+                          }+                    , field : Text+                    , format :+                        Optional+                          < Actor+                          | Boolean+                          | Date+                          | DocumentHandle : Text+                          | HumanActor+                          | Integer+                          | NonNegativeInteger+                          | Rfc3339Utc+                          | Uri+                          | UriWithScheme : Text+                          >+                    , objectFields :+                        Optional+                          { optional :+                              List+                                { allowedValues : List Text+                                , cardinality : < Any | List | Scalar >+                                , description : Optional Text+                                , field : Text+                                , format :+                                    Optional+                                      < Actor+                                      | Boolean+                                      | Date+                                      | DocumentHandle : Text+                                      | HumanActor+                                      | Integer+                                      | NonNegativeInteger+                                      | Rfc3339Utc+                                      | Uri+                                      | UriWithScheme : Text+                                      >+                                , path :+                                    Optional+                                      { allowSelf : Bool+                                      , externalUriSchemes : List Text+                                      }+                                , when :+                                    Optional+                                      { field : Text, hasValue : List Text }+                                }+                          , recommended :+                              List+                                { allowedValues : List Text+                                , cardinality : < Any | List | Scalar >+                                , description : Optional Text+                                , field : Text+                                , format :+                                    Optional+                                      < Actor+                                      | Boolean+                                      | Date+                                      | DocumentHandle : Text+                                      | HumanActor+                                      | Integer+                                      | NonNegativeInteger+                                      | Rfc3339Utc+                                      | Uri+                                      | UriWithScheme : Text+                                      >+                                , path :+                                    Optional+                                      { allowSelf : Bool+                                      , externalUriSchemes : List Text+                                      }+                                , when :+                                    Optional+                                      { field : Text, hasValue : List Text }+                                }+                          , required :+                              List+                                { allowedValues : List Text+                                , cardinality : < Any | List | Scalar >+                                , description : Optional Text+                                , field : Text+                                , format :+                                    Optional+                                      < Actor+                                      | Boolean+                                      | Date+                                      | DocumentHandle : Text+                                      | HumanActor+                                      | Integer+                                      | NonNegativeInteger+                                      | Rfc3339Utc+                                      | Uri+                                      | UriWithScheme : Text+                                      >+                                , path :+                                    Optional+                                      { allowSelf : Bool+                                      , externalUriSchemes : List Text+                                      }+                                , when :+                                    Optional+                                      { field : Text, hasValue : List Text }+                                }+                          }+                    , path :+                        Optional+                          { allowSelf : Bool, externalUriSchemes : List Text }+                    , reference :+                        Optional+                          { allowSelf : Bool+                          , externalUriSchemes : List Text+                          , localPrefix : Text+                          }+                    , when : Optional { field : Text, hasValue : List Text }+                    }+              , required :+                  List+                    { allowedValues : List Text+                    , cardinality : < Any | List | Scalar >+                    , description : Optional Text+                    , elementFields :+                        Optional+                          { optional :+                              List+                                { allowedValues : List Text+                                , cardinality : < Any | List | Scalar >+                                , description : Optional Text+                                , field : Text+                                , format :+                                    Optional+                                      < Actor+                                      | Boolean+                                      | Date+                                      | DocumentHandle : Text+                                      | HumanActor+                                      | Integer+                                      | NonNegativeInteger+                                      | Rfc3339Utc+                                      | Uri+                                      | UriWithScheme : Text+                                      >+                                , path :+                                    Optional+                                      { allowSelf : Bool+                                      , externalUriSchemes : List Text+                                      }+                                , when :+                                    Optional+                                      { field : Text, hasValue : List Text }+                                }+                          , recommended :+                              List+                                { allowedValues : List Text+                                , cardinality : < Any | List | Scalar >+                                , description : Optional Text+                                , field : Text+                                , format :+                                    Optional+                                      < Actor+                                      | Boolean+                                      | Date+                                      | DocumentHandle : Text+                                      | HumanActor+                                      | Integer+                                      | NonNegativeInteger+                                      | Rfc3339Utc+                                      | Uri+                                      | UriWithScheme : Text+                                      >+                                , path :+                                    Optional+                                      { allowSelf : Bool+                                      , externalUriSchemes : List Text+                                      }+                                , when :+                                    Optional+                                      { field : Text, hasValue : List Text }+                                }+                          , required :+                              List+                                { allowedValues : List Text+                                , cardinality : < Any | List | Scalar >+                                , description : Optional Text+                                , field : Text+                                , format :+                                    Optional+                                      < Actor+                                      | Boolean+                                      | Date+                                      | DocumentHandle : Text+                                      | HumanActor+                                      | Integer+                                      | NonNegativeInteger+                                      | Rfc3339Utc+                                      | Uri+                                      | UriWithScheme : Text+                                      >+                                , path :+                                    Optional+                                      { allowSelf : Bool+                                      , externalUriSchemes : List Text+                                      }+                                , when :+                                    Optional+                                      { field : Text, hasValue : List Text }+                                }+                          }+                    , field : Text+                    , format :+                        Optional+                          < Actor+                          | Boolean+                          | Date+                          | DocumentHandle : Text+                          | HumanActor+                          | Integer+                          | NonNegativeInteger+                          | Rfc3339Utc+                          | Uri+                          | UriWithScheme : Text+                          >+                    , objectFields :+                        Optional+                          { optional :+                              List+                                { allowedValues : List Text+                                , cardinality : < Any | List | Scalar >+                                , description : Optional Text+                                , field : Text+                                , format :+                                    Optional+                                      < Actor+                                      | Boolean+                                      | Date+                                      | DocumentHandle : Text+                                      | HumanActor+                                      | Integer+                                      | NonNegativeInteger+                                      | Rfc3339Utc+                                      | Uri+                                      | UriWithScheme : Text+                                      >+                                , path :+                                    Optional+                                      { allowSelf : Bool+                                      , externalUriSchemes : List Text+                                      }+                                , when :+                                    Optional+                                      { field : Text, hasValue : List Text }+                                }+                          , recommended :+                              List+                                { allowedValues : List Text+                                , cardinality : < Any | List | Scalar >+                                , description : Optional Text+                                , field : Text+                                , format :+                                    Optional+                                      < Actor+                                      | Boolean+                                      | Date+                                      | DocumentHandle : Text+                                      | HumanActor+                                      | Integer+                                      | NonNegativeInteger+                                      | Rfc3339Utc+                                      | Uri+                                      | UriWithScheme : Text+                                      >+                                , path :+                                    Optional+                                      { allowSelf : Bool+                                      , externalUriSchemes : List Text+                                      }+                                , when :+                                    Optional+                                      { field : Text, hasValue : List Text }+                                }+                          , required :+                              List+                                { allowedValues : List Text+                                , cardinality : < Any | List | Scalar >+                                , description : Optional Text+                                , field : Text+                                , format :+                                    Optional+                                      < Actor+                                      | Boolean+                                      | Date+                                      | DocumentHandle : Text+                                      | HumanActor+                                      | Integer+                                      | NonNegativeInteger+                                      | Rfc3339Utc+                                      | Uri+                                      | UriWithScheme : Text+                                      >+                                , path :+                                    Optional+                                      { allowSelf : Bool+                                      , externalUriSchemes : List Text+                                      }+                                , when :+                                    Optional+                                      { field : Text, hasValue : List Text }+                                }+                          }+                    , path :+                        Optional+                          { allowSelf : Bool, externalUriSchemes : List Text }+                    , reference :+                        Optional+                          { allowSelf : Bool+                          , externalUriSchemes : List Text+                          , localPrefix : Text+                          }+                    , when : Optional { field : Text, hasValue : List Text }+                    }+              }+          , idPrefix : Optional Text+          , pathPattern : Optional Text+          , requireSchemaSection : Bool+          , resourceScheme : Optional Text+          , schemaColumns : List Text+          , type : Text+          }+    }+, TypeRule =+    { description : Optional Text+    , frontmatter :+        { optional :+            List+              { allowedValues : List Text+              , cardinality : < Any | List | Scalar >+              , description : Optional Text+              , elementFields :+                  Optional+                    { optional :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , recommended :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , required :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    }+              , field : Text+              , format :+                  Optional+                    < Actor+                    | Boolean+                    | Date+                    | DocumentHandle : Text+                    | HumanActor+                    | Integer+                    | NonNegativeInteger+                    | Rfc3339Utc+                    | Uri+                    | UriWithScheme : Text+                    >+              , objectFields :+                  Optional+                    { optional :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , recommended :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , required :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    }+              , path :+                  Optional { allowSelf : Bool, externalUriSchemes : List Text }+              , reference :+                  Optional+                    { allowSelf : Bool+                    , externalUriSchemes : List Text+                    , localPrefix : Text+                    }+              , when : Optional { field : Text, hasValue : List Text }+              }+        , recommended :+            List+              { allowedValues : List Text+              , cardinality : < Any | List | Scalar >+              , description : Optional Text+              , elementFields :+                  Optional+                    { optional :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , recommended :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , required :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    }+              , field : Text+              , format :+                  Optional+                    < Actor+                    | Boolean+                    | Date+                    | DocumentHandle : Text+                    | HumanActor+                    | Integer+                    | NonNegativeInteger+                    | Rfc3339Utc+                    | Uri+                    | UriWithScheme : Text+                    >+              , objectFields :+                  Optional+                    { optional :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , recommended :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , required :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    }+              , path :+                  Optional { allowSelf : Bool, externalUriSchemes : List Text }+              , reference :+                  Optional+                    { allowSelf : Bool+                    , externalUriSchemes : List Text+                    , localPrefix : Text+                    }+              , when : Optional { field : Text, hasValue : List Text }+              }+        , required :+            List+              { allowedValues : List Text+              , cardinality : < Any | List | Scalar >+              , description : Optional Text+              , elementFields :+                  Optional+                    { optional :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , recommended :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , required :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    }+              , field : Text+              , format :+                  Optional+                    < Actor+                    | Boolean+                    | Date+                    | DocumentHandle : Text+                    | HumanActor+                    | Integer+                    | NonNegativeInteger+                    | Rfc3339Utc+                    | Uri+                    | UriWithScheme : Text+                    >+              , objectFields :+                  Optional+                    { optional :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , recommended :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , required :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    }+              , path :+                  Optional { allowSelf : Bool, externalUriSchemes : List Text }+              , reference :+                  Optional+                    { allowSelf : Bool+                    , externalUriSchemes : List Text+                    , localPrefix : Text+                    }+              , when : Optional { field : Text, hasValue : List Text }+              }+        }+    , idPrefix : Optional Text+    , pathPattern : Optional Text+    , requireSchemaSection : Bool+    , resourceScheme : Optional Text+    , schemaColumns : List Text+    , type : Text+    }+, defaults =+  { FieldRule =+    { Type =+        { allowedValues : List Text+        , cardinality : < Any | List | Scalar >+        , description : Optional Text+        , elementFields :+            Optional+              { optional :+                  List+                    { allowedValues : List Text+                    , cardinality : < Any | List | Scalar >+                    , description : Optional Text+                    , field : Text+                    , format :+                        Optional+                          < Actor+                          | Boolean+                          | Date+                          | DocumentHandle : Text+                          | HumanActor+                          | Integer+                          | NonNegativeInteger+                          | Rfc3339Utc+                          | Uri+                          | UriWithScheme : Text+                          >+                    , path :+                        Optional+                          { allowSelf : Bool, externalUriSchemes : List Text }+                    , when : Optional { field : Text, hasValue : List Text }+                    }+              , recommended :+                  List+                    { allowedValues : List Text+                    , cardinality : < Any | List | Scalar >+                    , description : Optional Text+                    , field : Text+                    , format :+                        Optional+                          < Actor+                          | Boolean+                          | Date+                          | DocumentHandle : Text+                          | HumanActor+                          | Integer+                          | NonNegativeInteger+                          | Rfc3339Utc+                          | Uri+                          | UriWithScheme : Text+                          >+                    , path :+                        Optional+                          { allowSelf : Bool, externalUriSchemes : List Text }+                    , when : Optional { field : Text, hasValue : List Text }+                    }+              , required :+                  List+                    { allowedValues : List Text+                    , cardinality : < Any | List | Scalar >+                    , description : Optional Text+                    , field : Text+                    , format :+                        Optional+                          < Actor+                          | Boolean+                          | Date+                          | DocumentHandle : Text+                          | HumanActor+                          | Integer+                          | NonNegativeInteger+                          | Rfc3339Utc+                          | Uri+                          | UriWithScheme : Text+                          >+                    , path :+                        Optional+                          { allowSelf : Bool, externalUriSchemes : List Text }+                    , when : Optional { field : Text, hasValue : List Text }+                    }+              }+        , field : Text+        , format :+            Optional+              < Actor+              | Boolean+              | Date+              | DocumentHandle : Text+              | HumanActor+              | Integer+              | NonNegativeInteger+              | Rfc3339Utc+              | Uri+              | UriWithScheme : Text+              >+        , objectFields :+            Optional+              { optional :+                  List+                    { allowedValues : List Text+                    , cardinality : < Any | List | Scalar >+                    , description : Optional Text+                    , field : Text+                    , format :+                        Optional+                          < Actor+                          | Boolean+                          | Date+                          | DocumentHandle : Text+                          | HumanActor+                          | Integer+                          | NonNegativeInteger+                          | Rfc3339Utc+                          | Uri+                          | UriWithScheme : Text+                          >+                    , path :+                        Optional+                          { allowSelf : Bool, externalUriSchemes : List Text }+                    , when : Optional { field : Text, hasValue : List Text }+                    }+              , recommended :+                  List+                    { allowedValues : List Text+                    , cardinality : < Any | List | Scalar >+                    , description : Optional Text+                    , field : Text+                    , format :+                        Optional+                          < Actor+                          | Boolean+                          | Date+                          | DocumentHandle : Text+                          | HumanActor+                          | Integer+                          | NonNegativeInteger+                          | Rfc3339Utc+                          | Uri+                          | UriWithScheme : Text+                          >+                    , path :+                        Optional+                          { allowSelf : Bool, externalUriSchemes : List Text }+                    , when : Optional { field : Text, hasValue : List Text }+                    }+              , required :+                  List+                    { allowedValues : List Text+                    , cardinality : < Any | List | Scalar >+                    , description : Optional Text+                    , field : Text+                    , format :+                        Optional+                          < Actor+                          | Boolean+                          | Date+                          | DocumentHandle : Text+                          | HumanActor+                          | Integer+                          | NonNegativeInteger+                          | Rfc3339Utc+                          | Uri+                          | UriWithScheme : Text+                          >+                    , path :+                        Optional+                          { allowSelf : Bool, externalUriSchemes : List Text }+                    , when : Optional { field : Text, hasValue : List Text }+                    }+              }+        , path : Optional { allowSelf : Bool, externalUriSchemes : List Text }+        , reference :+            Optional+              { allowSelf : Bool+              , externalUriSchemes : List Text+              , localPrefix : Text+              }+        , when : Optional { field : Text, hasValue : List Text }+        }+    , default =+      { allowedValues = [] : List Text+      , cardinality = < Any | List | Scalar >.Any+      , description = None Text+      , elementFields =+          None+            { optional :+                List+                  { allowedValues : List Text+                  , cardinality : < Any | List | Scalar >+                  , description : Optional Text+                  , field : Text+                  , format :+                      Optional+                        < Actor+                        | Boolean+                        | Date+                        | DocumentHandle : Text+                        | HumanActor+                        | Integer+                        | NonNegativeInteger+                        | Rfc3339Utc+                        | Uri+                        | UriWithScheme : Text+                        >+                  , path :+                      Optional+                        { allowSelf : Bool, externalUriSchemes : List Text }+                  , when : Optional { field : Text, hasValue : List Text }+                  }+            , recommended :+                List+                  { allowedValues : List Text+                  , cardinality : < Any | List | Scalar >+                  , description : Optional Text+                  , field : Text+                  , format :+                      Optional+                        < Actor+                        | Boolean+                        | Date+                        | DocumentHandle : Text+                        | HumanActor+                        | Integer+                        | NonNegativeInteger+                        | Rfc3339Utc+                        | Uri+                        | UriWithScheme : Text+                        >+                  , path :+                      Optional+                        { allowSelf : Bool, externalUriSchemes : List Text }+                  , when : Optional { field : Text, hasValue : List Text }+                  }+            , required :+                List+                  { allowedValues : List Text+                  , cardinality : < Any | List | Scalar >+                  , description : Optional Text+                  , field : Text+                  , format :+                      Optional+                        < Actor+                        | Boolean+                        | Date+                        | DocumentHandle : Text+                        | HumanActor+                        | Integer+                        | NonNegativeInteger+                        | Rfc3339Utc+                        | Uri+                        | UriWithScheme : Text+                        >+                  , path :+                      Optional+                        { allowSelf : Bool, externalUriSchemes : List Text }+                  , when : Optional { field : Text, hasValue : List Text }+                  }+            }+      , format =+          None+            < Actor+            | Boolean+            | Date+            | DocumentHandle : Text+            | HumanActor+            | Integer+            | NonNegativeInteger+            | Rfc3339Utc+            | Uri+            | UriWithScheme : Text+            >+      , objectFields =+          None+            { optional :+                List+                  { allowedValues : List Text+                  , cardinality : < Any | List | Scalar >+                  , description : Optional Text+                  , field : Text+                  , format :+                      Optional+                        < Actor+                        | Boolean+                        | Date+                        | DocumentHandle : Text+                        | HumanActor+                        | Integer+                        | NonNegativeInteger+                        | Rfc3339Utc+                        | Uri+                        | UriWithScheme : Text+                        >+                  , path :+                      Optional+                        { allowSelf : Bool, externalUriSchemes : List Text }+                  , when : Optional { field : Text, hasValue : List Text }+                  }+            , recommended :+                List+                  { allowedValues : List Text+                  , cardinality : < Any | List | Scalar >+                  , description : Optional Text+                  , field : Text+                  , format :+                      Optional+                        < Actor+                        | Boolean+                        | Date+                        | DocumentHandle : Text+                        | HumanActor+                        | Integer+                        | NonNegativeInteger+                        | Rfc3339Utc+                        | Uri+                        | UriWithScheme : Text+                        >+                  , path :+                      Optional+                        { allowSelf : Bool, externalUriSchemes : List Text }+                  , when : Optional { field : Text, hasValue : List Text }+                  }+            , required :+                List+                  { allowedValues : List Text+                  , cardinality : < Any | List | Scalar >+                  , description : Optional Text+                  , field : Text+                  , format :+                      Optional+                        < Actor+                        | Boolean+                        | Date+                        | DocumentHandle : Text+                        | HumanActor+                        | Integer+                        | NonNegativeInteger+                        | Rfc3339Utc+                        | Uri+                        | UriWithScheme : Text+                        >+                  , path :+                      Optional+                        { allowSelf : Bool, externalUriSchemes : List Text }+                  , when : Optional { field : Text, hasValue : List Text }+                  }+            }+      , path = None { allowSelf : Bool, externalUriSchemes : List Text }+      , reference =+          None+            { allowSelf : Bool+            , externalUriSchemes : List Text+            , localPrefix : Text+            }+      , when = None { field : Text, hasValue : List Text }+      }+    }+  , FrontmatterRules =+    { Type =+        { optional :+            List+              { allowedValues : List Text+              , cardinality : < Any | List | Scalar >+              , description : Optional Text+              , elementFields :+                  Optional+                    { optional :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , recommended :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , required :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    }+              , field : Text+              , format :+                  Optional+                    < Actor+                    | Boolean+                    | Date+                    | DocumentHandle : Text+                    | HumanActor+                    | Integer+                    | NonNegativeInteger+                    | Rfc3339Utc+                    | Uri+                    | UriWithScheme : Text+                    >+              , objectFields :+                  Optional+                    { optional :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , recommended :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , required :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    }+              , path :+                  Optional { allowSelf : Bool, externalUriSchemes : List Text }+              , reference :+                  Optional+                    { allowSelf : Bool+                    , externalUriSchemes : List Text+                    , localPrefix : Text+                    }+              , when : Optional { field : Text, hasValue : List Text }+              }+        , recommended :+            List+              { allowedValues : List Text+              , cardinality : < Any | List | Scalar >+              , description : Optional Text+              , elementFields :+                  Optional+                    { optional :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , recommended :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , required :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    }+              , field : Text+              , format :+                  Optional+                    < Actor+                    | Boolean+                    | Date+                    | DocumentHandle : Text+                    | HumanActor+                    | Integer+                    | NonNegativeInteger+                    | Rfc3339Utc+                    | Uri+                    | UriWithScheme : Text+                    >+              , objectFields :+                  Optional+                    { optional :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , recommended :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , required :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    }+              , path :+                  Optional { allowSelf : Bool, externalUriSchemes : List Text }+              , reference :+                  Optional+                    { allowSelf : Bool+                    , externalUriSchemes : List Text+                    , localPrefix : Text+                    }+              , when : Optional { field : Text, hasValue : List Text }+              }+        , required :+            List+              { allowedValues : List Text+              , cardinality : < Any | List | Scalar >+              , description : Optional Text+              , elementFields :+                  Optional+                    { optional :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , recommended :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , required :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    }+              , field : Text+              , format :+                  Optional+                    < Actor+                    | Boolean+                    | Date+                    | DocumentHandle : Text+                    | HumanActor+                    | Integer+                    | NonNegativeInteger+                    | Rfc3339Utc+                    | Uri+                    | UriWithScheme : Text+                    >+              , objectFields :+                  Optional+                    { optional :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , recommended :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    , required :+                        List+                          { allowedValues : List Text+                          , cardinality : < Any | List | Scalar >+                          , description : Optional Text+                          , field : Text+                          , format :+                              Optional+                                < Actor+                                | Boolean+                                | Date+                                | DocumentHandle : Text+                                | HumanActor+                                | Integer+                                | NonNegativeInteger+                                | Rfc3339Utc+                                | Uri+                                | UriWithScheme : Text+                                >+                          , path :+                              Optional+                                { allowSelf : Bool+                                , externalUriSchemes : List Text+                                }+                          , when :+                              Optional { field : Text, hasValue : List Text }+                          }+                    }+              , path :+                  Optional { allowSelf : Bool, externalUriSchemes : List Text }+              , reference :+                  Optional+                    { allowSelf : Bool+                    , externalUriSchemes : List Text+                    , localPrefix : Text+                    }+              , when : Optional { field : Text, hasValue : List Text }+              }+        }+    , default =+      { optional =+          [] : List+                 { allowedValues : List Text+                 , cardinality : < Any | List | Scalar >+                 , description : Optional Text+                 , elementFields :+                     Optional+                       { optional :+                           List+                             { allowedValues : List Text+                             , cardinality : < Any | List | Scalar >+                             , description : Optional Text+                             , field : Text+                             , format :+                                 Optional+                                   < Actor+                                   | Boolean+                                   | Date+                                   | DocumentHandle : Text+                                   | HumanActor+                                   | Integer+                                   | NonNegativeInteger+                                   | Rfc3339Utc+                                   | Uri+                                   | UriWithScheme : Text+                                   >+                             , path :+                                 Optional+                                   { allowSelf : Bool+                                   , externalUriSchemes : List Text+                                   }+                             , when :+                                 Optional { field : Text, hasValue : List Text }+                             }+                       , recommended :+                           List+                             { allowedValues : List Text+                             , cardinality : < Any | List | Scalar >+                             , description : Optional Text+                             , field : Text+                             , format :+                                 Optional+                                   < Actor+                                   | Boolean+                                   | Date+                                   | DocumentHandle : Text+                                   | HumanActor+                                   | Integer+                                   | NonNegativeInteger+                                   | Rfc3339Utc+                                   | Uri+                                   | UriWithScheme : Text+                                   >+                             , path :+                                 Optional+                                   { allowSelf : Bool+                                   , externalUriSchemes : List Text+                                   }+                             , when :+                                 Optional { field : Text, hasValue : List Text }+                             }+                       , required :+                           List+                             { allowedValues : List Text+                             , cardinality : < Any | List | Scalar >+                             , description : Optional Text+                             , field : Text+                             , format :+                                 Optional+                                   < Actor+                                   | Boolean+                                   | Date+                                   | DocumentHandle : Text+                                   | HumanActor+                                   | Integer+                                   | NonNegativeInteger+                                   | Rfc3339Utc+                                   | Uri+                                   | UriWithScheme : Text+                                   >+                             , path :+                                 Optional+                                   { allowSelf : Bool+                                   , externalUriSchemes : List Text+                                   }+                             , when :+                                 Optional { field : Text, hasValue : List Text }+                             }+                       }+                 , field : Text+                 , format :+                     Optional+                       < Actor+                       | Boolean+                       | Date+                       | DocumentHandle : Text+                       | HumanActor+                       | Integer+                       | NonNegativeInteger+                       | Rfc3339Utc+                       | Uri+                       | UriWithScheme : Text+                       >+                 , objectFields :+                     Optional+                       { optional :+                           List+                             { allowedValues : List Text+                             , cardinality : < Any | List | Scalar >+                             , description : Optional Text+                             , field : Text+                             , format :+                                 Optional+                                   < Actor+                                   | Boolean+                                   | Date+                                   | DocumentHandle : Text+                                   | HumanActor+                                   | Integer+                                   | NonNegativeInteger+                                   | Rfc3339Utc+                                   | Uri+                                   | UriWithScheme : Text+                                   >+                             , path :+                                 Optional+                                   { allowSelf : Bool+                                   , externalUriSchemes : List Text+                                   }+                             , when :+                                 Optional { field : Text, hasValue : List Text }+                             }+                       , recommended :+                           List+                             { allowedValues : List Text+                             , cardinality : < Any | List | Scalar >+                             , description : Optional Text+                             , field : Text+                             , format :+                                 Optional+                                   < Actor+                                   | Boolean+                                   | Date+                                   | DocumentHandle : Text+                                   | HumanActor+                                   | Integer+                                   | NonNegativeInteger+                                   | Rfc3339Utc+                                   | Uri+                                   | UriWithScheme : Text+                                   >+                             , path :+                                 Optional+                                   { allowSelf : Bool+                                   , externalUriSchemes : List Text+                                   }+                             , when :+                                 Optional { field : Text, hasValue : List Text }+                             }+                       , required :+                           List+                             { allowedValues : List Text+                             , cardinality : < Any | List | Scalar >+                             , description : Optional Text+                             , field : Text+                             , format :+                                 Optional+                                   < Actor+                                   | Boolean+                                   | Date+                                   | DocumentHandle : Text+                                   | HumanActor+                                   | Integer+                                   | NonNegativeInteger+                                   | Rfc3339Utc+                                   | Uri+                                   | UriWithScheme : Text+                                   >+                             , path :+                                 Optional+                                   { allowSelf : Bool+                                   , externalUriSchemes : List Text+                                   }+                             , when :+                                 Optional { field : Text, hasValue : List Text }+                             }+                       }+                 , path :+                     Optional+                       { allowSelf : Bool, externalUriSchemes : List Text }+                 , reference :+                     Optional+                       { allowSelf : Bool+                       , externalUriSchemes : List Text+                       , localPrefix : Text+                       }+                 , when : Optional { field : Text, hasValue : List Text }+                 }+      , recommended =+          [] : List+                 { allowedValues : List Text+                 , cardinality : < Any | List | Scalar >+                 , description : Optional Text+                 , elementFields :+                     Optional+                       { optional :+                           List+                             { allowedValues : List Text+                             , cardinality : < Any | List | Scalar >+                             , description : Optional Text+                             , field : Text+                             , format :+                                 Optional+                                   < Actor+                                   | Boolean+                                   | Date+                                   | DocumentHandle : Text+                                   | HumanActor+                                   | Integer+                                   | NonNegativeInteger+                                   | Rfc3339Utc+                                   | Uri+                                   | UriWithScheme : Text+                                   >+                             , path :+                                 Optional+                                   { allowSelf : Bool+                                   , externalUriSchemes : List Text+                                   }+                             , when :+                                 Optional { field : Text, hasValue : List Text }+                             }+                       , recommended :+                           List+                             { allowedValues : List Text+                             , cardinality : < Any | List | Scalar >+                             , description : Optional Text+                             , field : Text+                             , format :+                                 Optional+                                   < Actor+                                   | Boolean+                                   | Date+                                   | DocumentHandle : Text+                                   | HumanActor+                                   | Integer+                                   | NonNegativeInteger+                                   | Rfc3339Utc+                                   | Uri+                                   | UriWithScheme : Text+                                   >+                             , path :+                                 Optional+                                   { allowSelf : Bool+                                   , externalUriSchemes : List Text+                                   }+                             , when :+                                 Optional { field : Text, hasValue : List Text }+                             }+                       , required :+                           List+                             { allowedValues : List Text+                             , cardinality : < Any | List | Scalar >+                             , description : Optional Text+                             , field : Text+                             , format :+                                 Optional+                                   < Actor+                                   | Boolean+                                   | Date+                                   | DocumentHandle : Text+                                   | HumanActor+                                   | Integer+                                   | NonNegativeInteger+                                   | Rfc3339Utc+                                   | Uri+                                   | UriWithScheme : Text+                                   >+                             , path :+                                 Optional+                                   { allowSelf : Bool+                                   , externalUriSchemes : List Text+                                   }+                             , when :+                                 Optional { field : Text, hasValue : List Text }+                             }+                       }+                 , field : Text+                 , format :+                     Optional+                       < Actor+                       | Boolean+                       | Date+                       | DocumentHandle : Text+                       | HumanActor+                       | Integer+                       | NonNegativeInteger+                       | Rfc3339Utc+                       | Uri+                       | UriWithScheme : Text+                       >+                 , objectFields :+                     Optional+                       { optional :+                           List+                             { allowedValues : List Text+                             , cardinality : < Any | List | Scalar >+                             , description : Optional Text+                             , field : Text+                             , format :+                                 Optional+                                   < Actor+                                   | Boolean+                                   | Date+                                   | DocumentHandle : Text+                                   | HumanActor+                                   | Integer+                                   | NonNegativeInteger+                                   | Rfc3339Utc+                                   | Uri+                                   | UriWithScheme : Text+                                   >+                             , path :+                                 Optional+                                   { allowSelf : Bool+                                   , externalUriSchemes : List Text+                                   }+                             , when :+                                 Optional { field : Text, hasValue : List Text }+                             }+                       , recommended :+                           List+                             { allowedValues : List Text+                             , cardinality : < Any | List | Scalar >+                             , description : Optional Text+                             , field : Text+                             , format :+                                 Optional+                                   < Actor+                                   | Boolean+                                   | Date+                                   | DocumentHandle : Text+                                   | HumanActor+                                   | Integer+                                   | NonNegativeInteger+                                   | Rfc3339Utc+                                   | Uri+                                   | UriWithScheme : Text+                                   >+                             , path :+                                 Optional+                                   { allowSelf : Bool+                                   , externalUriSchemes : List Text+                                   }+                             , when :+                                 Optional { field : Text, hasValue : List Text }+                             }+                       , required :+                           List+                             { allowedValues : List Text+                             , cardinality : < Any | List | Scalar >+                             , description : Optional Text+                             , field : Text+                             , format :+                                 Optional+                                   < Actor+                                   | Boolean+                                   | Date+                                   | DocumentHandle : Text+                                   | HumanActor+                                   | Integer+                                   | NonNegativeInteger+                                   | Rfc3339Utc+                                   | Uri+                                   | UriWithScheme : Text+                                   >+                             , path :+                                 Optional+                                   { allowSelf : Bool+                                   , externalUriSchemes : List Text+                                   }+                             , when :+                                 Optional { field : Text, hasValue : List Text }+                             }+                       }+                 , path :+                     Optional+                       { allowSelf : Bool, externalUriSchemes : List Text }+                 , reference :+                     Optional+                       { allowSelf : Bool+                       , externalUriSchemes : List Text+                       , localPrefix : Text+                       }+                 , when : Optional { field : Text, hasValue : List Text }+                 }+      , required =+          [] : List+                 { allowedValues : List Text+                 , cardinality : < Any | List | Scalar >+                 , description : Optional Text+                 , elementFields :+                     Optional+                       { optional :+                           List+                             { allowedValues : List Text+                             , cardinality : < Any | List | Scalar >+                             , description : Optional Text+                             , field : Text+                             , format :+                                 Optional+                                   < Actor+                                   | Boolean+                                   | Date+                                   | DocumentHandle : Text+                                   | HumanActor+                                   | Integer+                                   | NonNegativeInteger+                                   | Rfc3339Utc+                                   | Uri+                                   | UriWithScheme : Text+                                   >+                             , path :+                                 Optional+                                   { allowSelf : Bool+                                   , externalUriSchemes : List Text+                                   }+                             , when :+                                 Optional { field : Text, hasValue : List Text }+                             }+                       , recommended :+                           List+                             { allowedValues : List Text+                             , cardinality : < Any | List | Scalar >+                             , description : Optional Text+                             , field : Text+                             , format :+                                 Optional+                                   < Actor+                                   | Boolean+                                   | Date+                                   | DocumentHandle : Text+                                   | HumanActor+                                   | Integer+                                   | NonNegativeInteger+                                   | Rfc3339Utc+                                   | Uri+                                   | UriWithScheme : Text+                                   >+                             , path :+                                 Optional+                                   { allowSelf : Bool+                                   , externalUriSchemes : List Text+                                   }+                             , when :+                                 Optional { field : Text, hasValue : List Text }+                             }+                       , required :+                           List+                             { allowedValues : List Text+                             , cardinality : < Any | List | Scalar >+                             , description : Optional Text+                             , field : Text+                             , format :+                                 Optional+                                   < Actor+                                   | Boolean+                                   | Date+                                   | DocumentHandle : Text+                                   | HumanActor+                                   | Integer+                                   | NonNegativeInteger+                                   | Rfc3339Utc+                                   | Uri+                                   | UriWithScheme : Text+                                   >+                             , path :+                                 Optional+                                   { allowSelf : Bool+                                   , externalUriSchemes : List Text+                                   }+                             , when :+                                 Optional { field : Text, hasValue : List Text }+                             }+                       }+                 , field : Text+                 , format :+                     Optional+                       < Actor+                       | Boolean+                       | Date+                       | DocumentHandle : Text+                       | HumanActor+                       | Integer+                       | NonNegativeInteger+                       | Rfc3339Utc+                       | Uri+                       | UriWithScheme : Text+                       >+                 , objectFields :+                     Optional+                       { optional :+                           List+                             { allowedValues : List Text+                             , cardinality : < Any | List | Scalar >+                             , description : Optional Text+                             , field : Text+                             , format :+                                 Optional+                                   < Actor+                                   | Boolean+                                   | Date+                                   | DocumentHandle : Text+                                   | HumanActor+                                   | Integer+                                   | NonNegativeInteger+                                   | Rfc3339Utc+                                   | Uri+                                   | UriWithScheme : Text+                                   >+                             , path :+                                 Optional+                                   { allowSelf : Bool+                                   , externalUriSchemes : List Text+                                   }+                             , when :+                                 Optional { field : Text, hasValue : List Text }+                             }+                       , recommended :+                           List+                             { allowedValues : List Text+                             , cardinality : < Any | List | Scalar >+                             , description : Optional Text+                             , field : Text+                             , format :+                                 Optional+                                   < Actor+                                   | Boolean+                                   | Date+                                   | DocumentHandle : Text+                                   | HumanActor+                                   | Integer+                                   | NonNegativeInteger+                                   | Rfc3339Utc+                                   | Uri+                                   | UriWithScheme : Text+                                   >+                             , path :+                                 Optional+                                   { allowSelf : Bool+                                   , externalUriSchemes : List Text+                                   }+                             , when :+                                 Optional { field : Text, hasValue : List Text }+                             }+                       , required :+                           List+                             { allowedValues : List Text+                             , cardinality : < Any | List | Scalar >+                             , description : Optional Text+                             , field : Text+                             , format :+                                 Optional+                                   < Actor+                                   | Boolean+                                   | Date+                                   | DocumentHandle : Text+                                   | HumanActor+                                   | Integer+                                   | NonNegativeInteger+                                   | Rfc3339Utc+                                   | Uri+                                   | UriWithScheme : Text+                                   >+                             , path :+                                 Optional+                                   { allowSelf : Bool+                                   , externalUriSchemes : List Text+                                   }+                             , when :+                                 Optional { field : Text, hasValue : List Text }+                             }+                       }+                 , path :+                     Optional+                       { allowSelf : Bool, externalUriSchemes : List Text }+                 , reference :+                     Optional+                       { allowSelf : Bool+                       , externalUriSchemes : List Text+                       , localPrefix : Text+                       }+                 , when : Optional { field : Text, hasValue : List Text }+                 }+      }+    }+  , HandleReferenceRule =+    { Type =+        { allowSelf : Bool, externalUriSchemes : List Text, localPrefix : Text }+    , default = { allowSelf = False, externalUriSchemes = [] : List Text }+    }+  , NestedFieldRule =+    { Type =+        { allowedValues : List Text+        , cardinality : < Any | List | Scalar >+        , description : Optional Text+        , field : Text+        , format :+            Optional+              < Actor+              | Boolean+              | Date+              | DocumentHandle : Text+              | HumanActor+              | Integer+              | NonNegativeInteger+              | Rfc3339Utc+              | Uri+              | UriWithScheme : Text+              >+        , path : Optional { allowSelf : Bool, externalUriSchemes : List Text }+        , when : Optional { field : Text, hasValue : List Text }+        }+    , default =+      { allowedValues = [] : List Text+      , cardinality = < Any | List | Scalar >.Any+      , description = None Text+      , format =+          None+            < Actor+            | Boolean+            | Date+            | DocumentHandle : Text+            | HumanActor+            | Integer+            | NonNegativeInteger+            | Rfc3339Utc+            | Uri+            | UriWithScheme : Text+            >+      , path = None { allowSelf : Bool, externalUriSchemes : List Text }+      , when = None { field : Text, hasValue : List Text }+      }+    }+  , NestedRules =+    { Type =+        { optional :+            List+              { allowedValues : List Text+              , cardinality : < Any | List | Scalar >+              , description : Optional Text+              , field : Text+              , format :+                  Optional+                    < Actor+                    | Boolean+                    | Date+                    | DocumentHandle : Text+                    | HumanActor+                    | Integer+                    | NonNegativeInteger+                    | Rfc3339Utc+                    | Uri+                    | UriWithScheme : Text+                    >+              , path :+                  Optional { allowSelf : Bool, externalUriSchemes : List Text }+              , when : Optional { field : Text, hasValue : List Text }+              }+        , recommended :+            List+              { allowedValues : List Text+              , cardinality : < Any | List | Scalar >+              , description : Optional Text+              , field : Text+              , format :+                  Optional+                    < Actor+                    | Boolean+                    | Date+                    | DocumentHandle : Text+                    | HumanActor+                    | Integer+                    | NonNegativeInteger+                    | Rfc3339Utc+                    | Uri+                    | UriWithScheme : Text+                    >+              , path :+                  Optional { allowSelf : Bool, externalUriSchemes : List Text }+              , when : Optional { field : Text, hasValue : List Text }+              }+        , required :+            List+              { allowedValues : List Text+              , cardinality : < Any | List | Scalar >+              , description : Optional Text+              , field : Text+              , format :+                  Optional+                    < Actor+                    | Boolean+                    | Date+                    | DocumentHandle : Text+                    | HumanActor+                    | Integer+                    | NonNegativeInteger+                    | Rfc3339Utc+                    | Uri+                    | UriWithScheme : Text+                    >+              , path :+                  Optional { allowSelf : Bool, externalUriSchemes : List Text }+              , when : Optional { field : Text, hasValue : List Text }+              }+        }+    , default =+      { optional =+          [] : List+                 { allowedValues : List Text+                 , cardinality : < Any | List | Scalar >+                 , description : Optional Text+                 , field : Text+                 , format :+                     Optional+                       < Actor+                       | Boolean+                       | Date+                       | DocumentHandle : Text+                       | HumanActor+                       | Integer+                       | NonNegativeInteger+                       | Rfc3339Utc+                       | Uri+                       | UriWithScheme : Text+                       >+                 , path :+                     Optional+                       { allowSelf : Bool, externalUriSchemes : List Text }+                 , when : Optional { field : Text, hasValue : List Text }+                 }+      , recommended =+          [] : List+                 { allowedValues : List Text+                 , cardinality : < Any | List | Scalar >+                 , description : Optional Text+                 , field : Text+                 , format :+                     Optional+                       < Actor+                       | Boolean+                       | Date+                       | DocumentHandle : Text+                       | HumanActor+                       | Integer+                       | NonNegativeInteger+                       | Rfc3339Utc+                       | Uri+                       | UriWithScheme : Text+                       >+                 , path :+                     Optional+                       { allowSelf : Bool, externalUriSchemes : List Text }+                 , when : Optional { field : Text, hasValue : List Text }+                 }+      , required =+          [] : List+                 { allowedValues : List Text+                 , cardinality : < Any | List | Scalar >+                 , description : Optional Text+                 , field : Text+                 , format :+                     Optional+                       < Actor+                       | Boolean+                       | Date+                       | DocumentHandle : Text+                       | HumanActor+                       | Integer+                       | NonNegativeInteger+                       | Rfc3339Utc+                       | Uri+                       | UriWithScheme : Text+                       >+                 , path :+                     Optional+                       { allowSelf : Bool, externalUriSchemes : List Text }+                 , when : Optional { field : Text, hasValue : List Text }+                 }+      }+    }+  , PathReferenceRule =+    { Type = { allowSelf : Bool, externalUriSchemes : List Text }+    , default = { allowSelf = False, externalUriSchemes = [] : List Text }+    }+  , Profile =+    { Type =+        { allowUnknownFields : Bool+        , allowUnknownTypes : Bool+        , description : Optional Text+        , frontmatter :+            { optional :+                List+                  { allowedValues : List Text+                  , cardinality : < Any | List | Scalar >+                  , description : Optional Text+                  , elementFields :+                      Optional+                        { optional :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        , recommended :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        , required :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        }+                  , field : Text+                  , format :+                      Optional+                        < Actor+                        | Boolean+                        | Date+                        | DocumentHandle : Text+                        | HumanActor+                        | Integer+                        | NonNegativeInteger+                        | Rfc3339Utc+                        | Uri+                        | UriWithScheme : Text+                        >+                  , objectFields :+                      Optional+                        { optional :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        , recommended :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        , required :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        }+                  , path :+                      Optional+                        { allowSelf : Bool, externalUriSchemes : List Text }+                  , reference :+                      Optional+                        { allowSelf : Bool+                        , externalUriSchemes : List Text+                        , localPrefix : Text+                        }+                  , when : Optional { field : Text, hasValue : List Text }+                  }+            , recommended :+                List+                  { allowedValues : List Text+                  , cardinality : < Any | List | Scalar >+                  , description : Optional Text+                  , elementFields :+                      Optional+                        { optional :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        , recommended :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        , required :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        }+                  , field : Text+                  , format :+                      Optional+                        < Actor+                        | Boolean+                        | Date+                        | DocumentHandle : Text+                        | HumanActor+                        | Integer+                        | NonNegativeInteger+                        | Rfc3339Utc+                        | Uri+                        | UriWithScheme : Text+                        >+                  , objectFields :+                      Optional+                        { optional :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        , recommended :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        , required :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        }+                  , path :+                      Optional+                        { allowSelf : Bool, externalUriSchemes : List Text }+                  , reference :+                      Optional+                        { allowSelf : Bool+                        , externalUriSchemes : List Text+                        , localPrefix : Text+                        }+                  , when : Optional { field : Text, hasValue : List Text }+                  }+            , required :+                List+                  { allowedValues : List Text+                  , cardinality : < Any | List | Scalar >+                  , description : Optional Text+                  , elementFields :+                      Optional+                        { optional :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        , recommended :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        , required :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        }+                  , field : Text+                  , format :+                      Optional+                        < Actor+                        | Boolean+                        | Date+                        | DocumentHandle : Text+                        | HumanActor+                        | Integer+                        | NonNegativeInteger+                        | Rfc3339Utc+                        | Uri+                        | UriWithScheme : Text+                        >+                  , objectFields :+                      Optional+                        { optional :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        , recommended :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        , required :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        }+                  , path :+                      Optional+                        { allowSelf : Bool, externalUriSchemes : List Text }+                  , reference :+                      Optional+                        { allowSelf : Bool+                        , externalUriSchemes : List Text+                        , localPrefix : Text+                        }+                  , when : Optional { field : Text, hasValue : List Text }+                  }+            }+        , idField : Optional Text+        , name : Text+        , okfVersion : Text+        , requireBundleVersion : Optional Text+        , types :+            List+              { description : Optional Text+              , frontmatter :+                  { optional :+                      List+                        { allowedValues : List Text+                        , cardinality : < Any | List | Scalar >+                        , description : Optional Text+                        , elementFields :+                            Optional+                              { optional :+                                  List+                                    { allowedValues : List Text+                                    , cardinality : < Any | List | Scalar >+                                    , description : Optional Text+                                    , field : Text+                                    , format :+                                        Optional+                                          < Actor+                                          | Boolean+                                          | Date+                                          | DocumentHandle : Text+                                          | HumanActor+                                          | Integer+                                          | NonNegativeInteger+                                          | Rfc3339Utc+                                          | Uri+                                          | UriWithScheme : Text+                                          >+                                    , path :+                                        Optional+                                          { allowSelf : Bool+                                          , externalUriSchemes : List Text+                                          }+                                    , when :+                                        Optional+                                          { field : Text, hasValue : List Text }+                                    }+                              , recommended :+                                  List+                                    { allowedValues : List Text+                                    , cardinality : < Any | List | Scalar >+                                    , description : Optional Text+                                    , field : Text+                                    , format :+                                        Optional+                                          < Actor+                                          | Boolean+                                          | Date+                                          | DocumentHandle : Text+                                          | HumanActor+                                          | Integer+                                          | NonNegativeInteger+                                          | Rfc3339Utc+                                          | Uri+                                          | UriWithScheme : Text+                                          >+                                    , path :+                                        Optional+                                          { allowSelf : Bool+                                          , externalUriSchemes : List Text+                                          }+                                    , when :+                                        Optional+                                          { field : Text, hasValue : List Text }+                                    }+                              , required :+                                  List+                                    { allowedValues : List Text+                                    , cardinality : < Any | List | Scalar >+                                    , description : Optional Text+                                    , field : Text+                                    , format :+                                        Optional+                                          < Actor+                                          | Boolean+                                          | Date+                                          | DocumentHandle : Text+                                          | HumanActor+                                          | Integer+                                          | NonNegativeInteger+                                          | Rfc3339Utc+                                          | Uri+                                          | UriWithScheme : Text+                                          >+                                    , path :+                                        Optional+                                          { allowSelf : Bool+                                          , externalUriSchemes : List Text+                                          }+                                    , when :+                                        Optional+                                          { field : Text, hasValue : List Text }+                                    }+                              }+                        , field : Text+                        , format :+                            Optional+                              < Actor+                              | Boolean+                              | Date+                              | DocumentHandle : Text+                              | HumanActor+                              | Integer+                              | NonNegativeInteger+                              | Rfc3339Utc+                              | Uri+                              | UriWithScheme : Text+                              >+                        , objectFields :+                            Optional+                              { optional :+                                  List+                                    { allowedValues : List Text+                                    , cardinality : < Any | List | Scalar >+                                    , description : Optional Text+                                    , field : Text+                                    , format :+                                        Optional+                                          < Actor+                                          | Boolean+                                          | Date+                                          | DocumentHandle : Text+                                          | HumanActor+                                          | Integer+                                          | NonNegativeInteger+                                          | Rfc3339Utc+                                          | Uri+                                          | UriWithScheme : Text+                                          >+                                    , path :+                                        Optional+                                          { allowSelf : Bool+                                          , externalUriSchemes : List Text+                                          }+                                    , when :+                                        Optional+                                          { field : Text, hasValue : List Text }+                                    }+                              , recommended :+                                  List+                                    { allowedValues : List Text+                                    , cardinality : < Any | List | Scalar >+                                    , description : Optional Text+                                    , field : Text+                                    , format :+                                        Optional+                                          < Actor+                                          | Boolean+                                          | Date+                                          | DocumentHandle : Text+                                          | HumanActor+                                          | Integer+                                          | NonNegativeInteger+                                          | Rfc3339Utc+                                          | Uri+                                          | UriWithScheme : Text+                                          >+                                    , path :+                                        Optional+                                          { allowSelf : Bool+                                          , externalUriSchemes : List Text+                                          }+                                    , when :+                                        Optional+                                          { field : Text, hasValue : List Text }+                                    }+                              , required :+                                  List+                                    { allowedValues : List Text+                                    , cardinality : < Any | List | Scalar >+                                    , description : Optional Text+                                    , field : Text+                                    , format :+                                        Optional+                                          < Actor+                                          | Boolean+                                          | Date+                                          | DocumentHandle : Text+                                          | HumanActor+                                          | Integer+                                          | NonNegativeInteger+                                          | Rfc3339Utc+                                          | Uri+                                          | UriWithScheme : Text+                                          >+                                    , path :+                                        Optional+                                          { allowSelf : Bool+                                          , externalUriSchemes : List Text+                                          }+                                    , when :+                                        Optional+                                          { field : Text, hasValue : List Text }+                                    }+                              }+                        , path :+                            Optional+                              { allowSelf : Bool+                              , externalUriSchemes : List Text+                              }+                        , reference :+                            Optional+                              { allowSelf : Bool+                              , externalUriSchemes : List Text+                              , localPrefix : Text+                              }+                        , when : Optional { field : Text, hasValue : List Text }+                        }+                  , recommended :+                      List+                        { allowedValues : List Text+                        , cardinality : < Any | List | Scalar >+                        , description : Optional Text+                        , elementFields :+                            Optional+                              { optional :+                                  List+                                    { allowedValues : List Text+                                    , cardinality : < Any | List | Scalar >+                                    , description : Optional Text+                                    , field : Text+                                    , format :+                                        Optional+                                          < Actor+                                          | Boolean+                                          | Date+                                          | DocumentHandle : Text+                                          | HumanActor+                                          | Integer+                                          | NonNegativeInteger+                                          | Rfc3339Utc+                                          | Uri+                                          | UriWithScheme : Text+                                          >+                                    , path :+                                        Optional+                                          { allowSelf : Bool+                                          , externalUriSchemes : List Text+                                          }+                                    , when :+                                        Optional+                                          { field : Text, hasValue : List Text }+                                    }+                              , recommended :+                                  List+                                    { allowedValues : List Text+                                    , cardinality : < Any | List | Scalar >+                                    , description : Optional Text+                                    , field : Text+                                    , format :+                                        Optional+                                          < Actor+                                          | Boolean+                                          | Date+                                          | DocumentHandle : Text+                                          | HumanActor+                                          | Integer+                                          | NonNegativeInteger+                                          | Rfc3339Utc+                                          | Uri+                                          | UriWithScheme : Text+                                          >+                                    , path :+                                        Optional+                                          { allowSelf : Bool+                                          , externalUriSchemes : List Text+                                          }+                                    , when :+                                        Optional+                                          { field : Text, hasValue : List Text }+                                    }+                              , required :+                                  List+                                    { allowedValues : List Text+                                    , cardinality : < Any | List | Scalar >+                                    , description : Optional Text+                                    , field : Text+                                    , format :+                                        Optional+                                          < Actor+                                          | Boolean+                                          | Date+                                          | DocumentHandle : Text+                                          | HumanActor+                                          | Integer+                                          | NonNegativeInteger+                                          | Rfc3339Utc+                                          | Uri+                                          | UriWithScheme : Text+                                          >+                                    , path :+                                        Optional+                                          { allowSelf : Bool+                                          , externalUriSchemes : List Text+                                          }+                                    , when :+                                        Optional+                                          { field : Text, hasValue : List Text }+                                    }+                              }+                        , field : Text+                        , format :+                            Optional+                              < Actor+                              | Boolean+                              | Date+                              | DocumentHandle : Text+                              | HumanActor+                              | Integer+                              | NonNegativeInteger+                              | Rfc3339Utc+                              | Uri+                              | UriWithScheme : Text+                              >+                        , objectFields :+                            Optional+                              { optional :+                                  List+                                    { allowedValues : List Text+                                    , cardinality : < Any | List | Scalar >+                                    , description : Optional Text+                                    , field : Text+                                    , format :+                                        Optional+                                          < Actor+                                          | Boolean+                                          | Date+                                          | DocumentHandle : Text+                                          | HumanActor+                                          | Integer+                                          | NonNegativeInteger+                                          | Rfc3339Utc+                                          | Uri+                                          | UriWithScheme : Text+                                          >+                                    , path :+                                        Optional+                                          { allowSelf : Bool+                                          , externalUriSchemes : List Text+                                          }+                                    , when :+                                        Optional+                                          { field : Text, hasValue : List Text }+                                    }+                              , recommended :+                                  List+                                    { allowedValues : List Text+                                    , cardinality : < Any | List | Scalar >+                                    , description : Optional Text+                                    , field : Text+                                    , format :+                                        Optional+                                          < Actor+                                          | Boolean+                                          | Date+                                          | DocumentHandle : Text+                                          | HumanActor+                                          | Integer+                                          | NonNegativeInteger+                                          | Rfc3339Utc+                                          | Uri+                                          | UriWithScheme : Text+                                          >+                                    , path :+                                        Optional+                                          { allowSelf : Bool+                                          , externalUriSchemes : List Text+                                          }+                                    , when :+                                        Optional+                                          { field : Text, hasValue : List Text }+                                    }+                              , required :+                                  List+                                    { allowedValues : List Text+                                    , cardinality : < Any | List | Scalar >+                                    , description : Optional Text+                                    , field : Text+                                    , format :+                                        Optional+                                          < Actor+                                          | Boolean+                                          | Date+                                          | DocumentHandle : Text+                                          | HumanActor+                                          | Integer+                                          | NonNegativeInteger+                                          | Rfc3339Utc+                                          | Uri+                                          | UriWithScheme : Text+                                          >+                                    , path :+                                        Optional+                                          { allowSelf : Bool+                                          , externalUriSchemes : List Text+                                          }+                                    , when :+                                        Optional+                                          { field : Text, hasValue : List Text }+                                    }+                              }+                        , path :+                            Optional+                              { allowSelf : Bool+                              , externalUriSchemes : List Text+                              }+                        , reference :+                            Optional+                              { allowSelf : Bool+                              , externalUriSchemes : List Text+                              , localPrefix : Text+                              }+                        , when : Optional { field : Text, hasValue : List Text }+                        }+                  , required :+                      List+                        { allowedValues : List Text+                        , cardinality : < Any | List | Scalar >+                        , description : Optional Text+                        , elementFields :+                            Optional+                              { optional :+                                  List+                                    { allowedValues : List Text+                                    , cardinality : < Any | List | Scalar >+                                    , description : Optional Text+                                    , field : Text+                                    , format :+                                        Optional+                                          < Actor+                                          | Boolean+                                          | Date+                                          | DocumentHandle : Text+                                          | HumanActor+                                          | Integer+                                          | NonNegativeInteger+                                          | Rfc3339Utc+                                          | Uri+                                          | UriWithScheme : Text+                                          >+                                    , path :+                                        Optional+                                          { allowSelf : Bool+                                          , externalUriSchemes : List Text+                                          }+                                    , when :+                                        Optional+                                          { field : Text, hasValue : List Text }+                                    }+                              , recommended :+                                  List+                                    { allowedValues : List Text+                                    , cardinality : < Any | List | Scalar >+                                    , description : Optional Text+                                    , field : Text+                                    , format :+                                        Optional+                                          < Actor+                                          | Boolean+                                          | Date+                                          | DocumentHandle : Text+                                          | HumanActor+                                          | Integer+                                          | NonNegativeInteger+                                          | Rfc3339Utc+                                          | Uri+                                          | UriWithScheme : Text+                                          >+                                    , path :+                                        Optional+                                          { allowSelf : Bool+                                          , externalUriSchemes : List Text+                                          }+                                    , when :+                                        Optional+                                          { field : Text, hasValue : List Text }+                                    }+                              , required :+                                  List+                                    { allowedValues : List Text+                                    , cardinality : < Any | List | Scalar >+                                    , description : Optional Text+                                    , field : Text+                                    , format :+                                        Optional+                                          < Actor+                                          | Boolean+                                          | Date+                                          | DocumentHandle : Text+                                          | HumanActor+                                          | Integer+                                          | NonNegativeInteger+                                          | Rfc3339Utc+                                          | Uri+                                          | UriWithScheme : Text+                                          >+                                    , path :+                                        Optional+                                          { allowSelf : Bool+                                          , externalUriSchemes : List Text+                                          }+                                    , when :+                                        Optional+                                          { field : Text, hasValue : List Text }+                                    }+                              }+                        , field : Text+                        , format :+                            Optional+                              < Actor+                              | Boolean+                              | Date+                              | DocumentHandle : Text+                              | HumanActor+                              | Integer+                              | NonNegativeInteger+                              | Rfc3339Utc+                              | Uri+                              | UriWithScheme : Text+                              >+                        , objectFields :+                            Optional+                              { optional :+                                  List+                                    { allowedValues : List Text+                                    , cardinality : < Any | List | Scalar >+                                    , description : Optional Text+                                    , field : Text+                                    , format :+                                        Optional+                                          < Actor+                                          | Boolean+                                          | Date+                                          | DocumentHandle : Text+                                          | HumanActor+                                          | Integer+                                          | NonNegativeInteger+                                          | Rfc3339Utc+                                          | Uri+                                          | UriWithScheme : Text+                                          >+                                    , path :+                                        Optional+                                          { allowSelf : Bool+                                          , externalUriSchemes : List Text+                                          }+                                    , when :+                                        Optional+                                          { field : Text, hasValue : List Text }+                                    }+                              , recommended :+                                  List+                                    { allowedValues : List Text+                                    , cardinality : < Any | List | Scalar >+                                    , description : Optional Text+                                    , field : Text+                                    , format :+                                        Optional+                                          < Actor+                                          | Boolean+                                          | Date+                                          | DocumentHandle : Text+                                          | HumanActor+                                          | Integer+                                          | NonNegativeInteger+                                          | Rfc3339Utc+                                          | Uri+                                          | UriWithScheme : Text+                                          >+                                    , path :+                                        Optional+                                          { allowSelf : Bool+                                          , externalUriSchemes : List Text+                                          }+                                    , when :+                                        Optional+                                          { field : Text, hasValue : List Text }+                                    }+                              , required :+                                  List+                                    { allowedValues : List Text+                                    , cardinality : < Any | List | Scalar >+                                    , description : Optional Text+                                    , field : Text+                                    , format :+                                        Optional+                                          < Actor+                                          | Boolean+                                          | Date+                                          | DocumentHandle : Text+                                          | HumanActor+                                          | Integer+                                          | NonNegativeInteger+                                          | Rfc3339Utc+                                          | Uri+                                          | UriWithScheme : Text+                                          >+                                    , path :+                                        Optional+                                          { allowSelf : Bool+                                          , externalUriSchemes : List Text+                                          }+                                    , when :+                                        Optional+                                          { field : Text, hasValue : List Text }+                                    }+                              }+                        , path :+                            Optional+                              { allowSelf : Bool+                              , externalUriSchemes : List Text+                              }+                        , reference :+                            Optional+                              { allowSelf : Bool+                              , externalUriSchemes : List Text+                              , localPrefix : Text+                              }+                        , when : Optional { field : Text, hasValue : List Text }+                        }+                  }+              , idPrefix : Optional Text+              , pathPattern : Optional Text+              , requireSchemaSection : Bool+              , resourceScheme : Optional Text+              , schemaColumns : List Text+              , type : Text+              }+        }+    , default =+      { allowUnknownFields = True+      , allowUnknownTypes = True+      , description = None Text+      , frontmatter =+        { optional =+            [] : List+                   { allowedValues : List Text+                   , cardinality : < Any | List | Scalar >+                   , description : Optional Text+                   , elementFields :+                       Optional+                         { optional :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         , recommended :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         , required :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         }+                   , field : Text+                   , format :+                       Optional+                         < Actor+                         | Boolean+                         | Date+                         | DocumentHandle : Text+                         | HumanActor+                         | Integer+                         | NonNegativeInteger+                         | Rfc3339Utc+                         | Uri+                         | UriWithScheme : Text+                         >+                   , objectFields :+                       Optional+                         { optional :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         , recommended :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         , required :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         }+                   , path :+                       Optional+                         { allowSelf : Bool, externalUriSchemes : List Text }+                   , reference :+                       Optional+                         { allowSelf : Bool+                         , externalUriSchemes : List Text+                         , localPrefix : Text+                         }+                   , when : Optional { field : Text, hasValue : List Text }+                   }+        , recommended =+            [] : List+                   { allowedValues : List Text+                   , cardinality : < Any | List | Scalar >+                   , description : Optional Text+                   , elementFields :+                       Optional+                         { optional :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         , recommended :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         , required :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         }+                   , field : Text+                   , format :+                       Optional+                         < Actor+                         | Boolean+                         | Date+                         | DocumentHandle : Text+                         | HumanActor+                         | Integer+                         | NonNegativeInteger+                         | Rfc3339Utc+                         | Uri+                         | UriWithScheme : Text+                         >+                   , objectFields :+                       Optional+                         { optional :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         , recommended :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         , required :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         }+                   , path :+                       Optional+                         { allowSelf : Bool, externalUriSchemes : List Text }+                   , reference :+                       Optional+                         { allowSelf : Bool+                         , externalUriSchemes : List Text+                         , localPrefix : Text+                         }+                   , when : Optional { field : Text, hasValue : List Text }+                   }+        , required =+            [] : List+                   { allowedValues : List Text+                   , cardinality : < Any | List | Scalar >+                   , description : Optional Text+                   , elementFields :+                       Optional+                         { optional :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         , recommended :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         , required :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         }+                   , field : Text+                   , format :+                       Optional+                         < Actor+                         | Boolean+                         | Date+                         | DocumentHandle : Text+                         | HumanActor+                         | Integer+                         | NonNegativeInteger+                         | Rfc3339Utc+                         | Uri+                         | UriWithScheme : Text+                         >+                   , objectFields :+                       Optional+                         { optional :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         , recommended :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         , required :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         }+                   , path :+                       Optional+                         { allowSelf : Bool, externalUriSchemes : List Text }+                   , reference :+                       Optional+                         { allowSelf : Bool+                         , externalUriSchemes : List Text+                         , localPrefix : Text+                         }+                   , when : Optional { field : Text, hasValue : List Text }+                   }+        }+      , idField = None Text+      , okfVersion = "0.1"+      , requireBundleVersion = None Text+      , types =+          [] : List+                 { description : Optional Text+                 , frontmatter :+                     { optional :+                         List+                           { allowedValues : List Text+                           , cardinality : < Any | List | Scalar >+                           , description : Optional Text+                           , elementFields :+                               Optional+                                 { optional :+                                     List+                                       { allowedValues : List Text+                                       , cardinality : < Any | List | Scalar >+                                       , description : Optional Text+                                       , field : Text+                                       , format :+                                           Optional+                                             < Actor+                                             | Boolean+                                             | Date+                                             | DocumentHandle : Text+                                             | HumanActor+                                             | Integer+                                             | NonNegativeInteger+                                             | Rfc3339Utc+                                             | Uri+                                             | UriWithScheme : Text+                                             >+                                       , path :+                                           Optional+                                             { allowSelf : Bool+                                             , externalUriSchemes : List Text+                                             }+                                       , when :+                                           Optional+                                             { field : Text+                                             , hasValue : List Text+                                             }+                                       }+                                 , recommended :+                                     List+                                       { allowedValues : List Text+                                       , cardinality : < Any | List | Scalar >+                                       , description : Optional Text+                                       , field : Text+                                       , format :+                                           Optional+                                             < Actor+                                             | Boolean+                                             | Date+                                             | DocumentHandle : Text+                                             | HumanActor+                                             | Integer+                                             | NonNegativeInteger+                                             | Rfc3339Utc+                                             | Uri+                                             | UriWithScheme : Text+                                             >+                                       , path :+                                           Optional+                                             { allowSelf : Bool+                                             , externalUriSchemes : List Text+                                             }+                                       , when :+                                           Optional+                                             { field : Text+                                             , hasValue : List Text+                                             }+                                       }+                                 , required :+                                     List+                                       { allowedValues : List Text+                                       , cardinality : < Any | List | Scalar >+                                       , description : Optional Text+                                       , field : Text+                                       , format :+                                           Optional+                                             < Actor+                                             | Boolean+                                             | Date+                                             | DocumentHandle : Text+                                             | HumanActor+                                             | Integer+                                             | NonNegativeInteger+                                             | Rfc3339Utc+                                             | Uri+                                             | UriWithScheme : Text+                                             >+                                       , path :+                                           Optional+                                             { allowSelf : Bool+                                             , externalUriSchemes : List Text+                                             }+                                       , when :+                                           Optional+                                             { field : Text+                                             , hasValue : List Text+                                             }+                                       }+                                 }+                           , field : Text+                           , format :+                               Optional+                                 < Actor+                                 | Boolean+                                 | Date+                                 | DocumentHandle : Text+                                 | HumanActor+                                 | Integer+                                 | NonNegativeInteger+                                 | Rfc3339Utc+                                 | Uri+                                 | UriWithScheme : Text+                                 >+                           , objectFields :+                               Optional+                                 { optional :+                                     List+                                       { allowedValues : List Text+                                       , cardinality : < Any | List | Scalar >+                                       , description : Optional Text+                                       , field : Text+                                       , format :+                                           Optional+                                             < Actor+                                             | Boolean+                                             | Date+                                             | DocumentHandle : Text+                                             | HumanActor+                                             | Integer+                                             | NonNegativeInteger+                                             | Rfc3339Utc+                                             | Uri+                                             | UriWithScheme : Text+                                             >+                                       , path :+                                           Optional+                                             { allowSelf : Bool+                                             , externalUriSchemes : List Text+                                             }+                                       , when :+                                           Optional+                                             { field : Text+                                             , hasValue : List Text+                                             }+                                       }+                                 , recommended :+                                     List+                                       { allowedValues : List Text+                                       , cardinality : < Any | List | Scalar >+                                       , description : Optional Text+                                       , field : Text+                                       , format :+                                           Optional+                                             < Actor+                                             | Boolean+                                             | Date+                                             | DocumentHandle : Text+                                             | HumanActor+                                             | Integer+                                             | NonNegativeInteger+                                             | Rfc3339Utc+                                             | Uri+                                             | UriWithScheme : Text+                                             >+                                       , path :+                                           Optional+                                             { allowSelf : Bool+                                             , externalUriSchemes : List Text+                                             }+                                       , when :+                                           Optional+                                             { field : Text+                                             , hasValue : List Text+                                             }+                                       }+                                 , required :+                                     List+                                       { allowedValues : List Text+                                       , cardinality : < Any | List | Scalar >+                                       , description : Optional Text+                                       , field : Text+                                       , format :+                                           Optional+                                             < Actor+                                             | Boolean+                                             | Date+                                             | DocumentHandle : Text+                                             | HumanActor+                                             | Integer+                                             | NonNegativeInteger+                                             | Rfc3339Utc+                                             | Uri+                                             | UriWithScheme : Text+                                             >+                                       , path :+                                           Optional+                                             { allowSelf : Bool+                                             , externalUriSchemes : List Text+                                             }+                                       , when :+                                           Optional+                                             { field : Text+                                             , hasValue : List Text+                                             }+                                       }+                                 }+                           , path :+                               Optional+                                 { allowSelf : Bool+                                 , externalUriSchemes : List Text+                                 }+                           , reference :+                               Optional+                                 { allowSelf : Bool+                                 , externalUriSchemes : List Text+                                 , localPrefix : Text+                                 }+                           , when :+                               Optional { field : Text, hasValue : List Text }+                           }+                     , recommended :+                         List+                           { allowedValues : List Text+                           , cardinality : < Any | List | Scalar >+                           , description : Optional Text+                           , elementFields :+                               Optional+                                 { optional :+                                     List+                                       { allowedValues : List Text+                                       , cardinality : < Any | List | Scalar >+                                       , description : Optional Text+                                       , field : Text+                                       , format :+                                           Optional+                                             < Actor+                                             | Boolean+                                             | Date+                                             | DocumentHandle : Text+                                             | HumanActor+                                             | Integer+                                             | NonNegativeInteger+                                             | Rfc3339Utc+                                             | Uri+                                             | UriWithScheme : Text+                                             >+                                       , path :+                                           Optional+                                             { allowSelf : Bool+                                             , externalUriSchemes : List Text+                                             }+                                       , when :+                                           Optional+                                             { field : Text+                                             , hasValue : List Text+                                             }+                                       }+                                 , recommended :+                                     List+                                       { allowedValues : List Text+                                       , cardinality : < Any | List | Scalar >+                                       , description : Optional Text+                                       , field : Text+                                       , format :+                                           Optional+                                             < Actor+                                             | Boolean+                                             | Date+                                             | DocumentHandle : Text+                                             | HumanActor+                                             | Integer+                                             | NonNegativeInteger+                                             | Rfc3339Utc+                                             | Uri+                                             | UriWithScheme : Text+                                             >+                                       , path :+                                           Optional+                                             { allowSelf : Bool+                                             , externalUriSchemes : List Text+                                             }+                                       , when :+                                           Optional+                                             { field : Text+                                             , hasValue : List Text+                                             }+                                       }+                                 , required :+                                     List+                                       { allowedValues : List Text+                                       , cardinality : < Any | List | Scalar >+                                       , description : Optional Text+                                       , field : Text+                                       , format :+                                           Optional+                                             < Actor+                                             | Boolean+                                             | Date+                                             | DocumentHandle : Text+                                             | HumanActor+                                             | Integer+                                             | NonNegativeInteger+                                             | Rfc3339Utc+                                             | Uri+                                             | UriWithScheme : Text+                                             >+                                       , path :+                                           Optional+                                             { allowSelf : Bool+                                             , externalUriSchemes : List Text+                                             }+                                       , when :+                                           Optional+                                             { field : Text+                                             , hasValue : List Text+                                             }+                                       }+                                 }+                           , field : Text+                           , format :+                               Optional+                                 < Actor+                                 | Boolean+                                 | Date+                                 | DocumentHandle : Text+                                 | HumanActor+                                 | Integer+                                 | NonNegativeInteger+                                 | Rfc3339Utc+                                 | Uri+                                 | UriWithScheme : Text+                                 >+                           , objectFields :+                               Optional+                                 { optional :+                                     List+                                       { allowedValues : List Text+                                       , cardinality : < Any | List | Scalar >+                                       , description : Optional Text+                                       , field : Text+                                       , format :+                                           Optional+                                             < Actor+                                             | Boolean+                                             | Date+                                             | DocumentHandle : Text+                                             | HumanActor+                                             | Integer+                                             | NonNegativeInteger+                                             | Rfc3339Utc+                                             | Uri+                                             | UriWithScheme : Text+                                             >+                                       , path :+                                           Optional+                                             { allowSelf : Bool+                                             , externalUriSchemes : List Text+                                             }+                                       , when :+                                           Optional+                                             { field : Text+                                             , hasValue : List Text+                                             }+                                       }+                                 , recommended :+                                     List+                                       { allowedValues : List Text+                                       , cardinality : < Any | List | Scalar >+                                       , description : Optional Text+                                       , field : Text+                                       , format :+                                           Optional+                                             < Actor+                                             | Boolean+                                             | Date+                                             | DocumentHandle : Text+                                             | HumanActor+                                             | Integer+                                             | NonNegativeInteger+                                             | Rfc3339Utc+                                             | Uri+                                             | UriWithScheme : Text+                                             >+                                       , path :+                                           Optional+                                             { allowSelf : Bool+                                             , externalUriSchemes : List Text+                                             }+                                       , when :+                                           Optional+                                             { field : Text+                                             , hasValue : List Text+                                             }+                                       }+                                 , required :+                                     List+                                       { allowedValues : List Text+                                       , cardinality : < Any | List | Scalar >+                                       , description : Optional Text+                                       , field : Text+                                       , format :+                                           Optional+                                             < Actor+                                             | Boolean+                                             | Date+                                             | DocumentHandle : Text+                                             | HumanActor+                                             | Integer+                                             | NonNegativeInteger+                                             | Rfc3339Utc+                                             | Uri+                                             | UriWithScheme : Text+                                             >+                                       , path :+                                           Optional+                                             { allowSelf : Bool+                                             , externalUriSchemes : List Text+                                             }+                                       , when :+                                           Optional+                                             { field : Text+                                             , hasValue : List Text+                                             }+                                       }+                                 }+                           , path :+                               Optional+                                 { allowSelf : Bool+                                 , externalUriSchemes : List Text+                                 }+                           , reference :+                               Optional+                                 { allowSelf : Bool+                                 , externalUriSchemes : List Text+                                 , localPrefix : Text+                                 }+                           , when :+                               Optional { field : Text, hasValue : List Text }+                           }+                     , required :+                         List+                           { allowedValues : List Text+                           , cardinality : < Any | List | Scalar >+                           , description : Optional Text+                           , elementFields :+                               Optional+                                 { optional :+                                     List+                                       { allowedValues : List Text+                                       , cardinality : < Any | List | Scalar >+                                       , description : Optional Text+                                       , field : Text+                                       , format :+                                           Optional+                                             < Actor+                                             | Boolean+                                             | Date+                                             | DocumentHandle : Text+                                             | HumanActor+                                             | Integer+                                             | NonNegativeInteger+                                             | Rfc3339Utc+                                             | Uri+                                             | UriWithScheme : Text+                                             >+                                       , path :+                                           Optional+                                             { allowSelf : Bool+                                             , externalUriSchemes : List Text+                                             }+                                       , when :+                                           Optional+                                             { field : Text+                                             , hasValue : List Text+                                             }+                                       }+                                 , recommended :+                                     List+                                       { allowedValues : List Text+                                       , cardinality : < Any | List | Scalar >+                                       , description : Optional Text+                                       , field : Text+                                       , format :+                                           Optional+                                             < Actor+                                             | Boolean+                                             | Date+                                             | DocumentHandle : Text+                                             | HumanActor+                                             | Integer+                                             | NonNegativeInteger+                                             | Rfc3339Utc+                                             | Uri+                                             | UriWithScheme : Text+                                             >+                                       , path :+                                           Optional+                                             { allowSelf : Bool+                                             , externalUriSchemes : List Text+                                             }+                                       , when :+                                           Optional+                                             { field : Text+                                             , hasValue : List Text+                                             }+                                       }+                                 , required :+                                     List+                                       { allowedValues : List Text+                                       , cardinality : < Any | List | Scalar >+                                       , description : Optional Text+                                       , field : Text+                                       , format :+                                           Optional+                                             < Actor+                                             | Boolean+                                             | Date+                                             | DocumentHandle : Text+                                             | HumanActor+                                             | Integer+                                             | NonNegativeInteger+                                             | Rfc3339Utc+                                             | Uri+                                             | UriWithScheme : Text+                                             >+                                       , path :+                                           Optional+                                             { allowSelf : Bool+                                             , externalUriSchemes : List Text+                                             }+                                       , when :+                                           Optional+                                             { field : Text+                                             , hasValue : List Text+                                             }+                                       }+                                 }+                           , field : Text+                           , format :+                               Optional+                                 < Actor+                                 | Boolean+                                 | Date+                                 | DocumentHandle : Text+                                 | HumanActor+                                 | Integer+                                 | NonNegativeInteger+                                 | Rfc3339Utc+                                 | Uri+                                 | UriWithScheme : Text+                                 >+                           , objectFields :+                               Optional+                                 { optional :+                                     List+                                       { allowedValues : List Text+                                       , cardinality : < Any | List | Scalar >+                                       , description : Optional Text+                                       , field : Text+                                       , format :+                                           Optional+                                             < Actor+                                             | Boolean+                                             | Date+                                             | DocumentHandle : Text+                                             | HumanActor+                                             | Integer+                                             | NonNegativeInteger+                                             | Rfc3339Utc+                                             | Uri+                                             | UriWithScheme : Text+                                             >+                                       , path :+                                           Optional+                                             { allowSelf : Bool+                                             , externalUriSchemes : List Text+                                             }+                                       , when :+                                           Optional+                                             { field : Text+                                             , hasValue : List Text+                                             }+                                       }+                                 , recommended :+                                     List+                                       { allowedValues : List Text+                                       , cardinality : < Any | List | Scalar >+                                       , description : Optional Text+                                       , field : Text+                                       , format :+                                           Optional+                                             < Actor+                                             | Boolean+                                             | Date+                                             | DocumentHandle : Text+                                             | HumanActor+                                             | Integer+                                             | NonNegativeInteger+                                             | Rfc3339Utc+                                             | Uri+                                             | UriWithScheme : Text+                                             >+                                       , path :+                                           Optional+                                             { allowSelf : Bool+                                             , externalUriSchemes : List Text+                                             }+                                       , when :+                                           Optional+                                             { field : Text+                                             , hasValue : List Text+                                             }+                                       }+                                 , required :+                                     List+                                       { allowedValues : List Text+                                       , cardinality : < Any | List | Scalar >+                                       , description : Optional Text+                                       , field : Text+                                       , format :+                                           Optional+                                             < Actor+                                             | Boolean+                                             | Date+                                             | DocumentHandle : Text+                                             | HumanActor+                                             | Integer+                                             | NonNegativeInteger+                                             | Rfc3339Utc+                                             | Uri+                                             | UriWithScheme : Text+                                             >+                                       , path :+                                           Optional+                                             { allowSelf : Bool+                                             , externalUriSchemes : List Text+                                             }+                                       , when :+                                           Optional+                                             { field : Text+                                             , hasValue : List Text+                                             }+                                       }+                                 }+                           , path :+                               Optional+                                 { allowSelf : Bool+                                 , externalUriSchemes : List Text+                                 }+                           , reference :+                               Optional+                                 { allowSelf : Bool+                                 , externalUriSchemes : List Text+                                 , localPrefix : Text+                                 }+                           , when :+                               Optional { field : Text, hasValue : List Text }+                           }+                     }+                 , idPrefix : Optional Text+                 , pathPattern : Optional Text+                 , requireSchemaSection : Bool+                 , resourceScheme : Optional Text+                 , schemaColumns : List Text+                 , type : Text+                 }+      }+    }+  , TypeRule =+    { Type =+        { description : Optional Text+        , frontmatter :+            { optional :+                List+                  { allowedValues : List Text+                  , cardinality : < Any | List | Scalar >+                  , description : Optional Text+                  , elementFields :+                      Optional+                        { optional :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        , recommended :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        , required :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        }+                  , field : Text+                  , format :+                      Optional+                        < Actor+                        | Boolean+                        | Date+                        | DocumentHandle : Text+                        | HumanActor+                        | Integer+                        | NonNegativeInteger+                        | Rfc3339Utc+                        | Uri+                        | UriWithScheme : Text+                        >+                  , objectFields :+                      Optional+                        { optional :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        , recommended :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        , required :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        }+                  , path :+                      Optional+                        { allowSelf : Bool, externalUriSchemes : List Text }+                  , reference :+                      Optional+                        { allowSelf : Bool+                        , externalUriSchemes : List Text+                        , localPrefix : Text+                        }+                  , when : Optional { field : Text, hasValue : List Text }+                  }+            , recommended :+                List+                  { allowedValues : List Text+                  , cardinality : < Any | List | Scalar >+                  , description : Optional Text+                  , elementFields :+                      Optional+                        { optional :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        , recommended :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        , required :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        }+                  , field : Text+                  , format :+                      Optional+                        < Actor+                        | Boolean+                        | Date+                        | DocumentHandle : Text+                        | HumanActor+                        | Integer+                        | NonNegativeInteger+                        | Rfc3339Utc+                        | Uri+                        | UriWithScheme : Text+                        >+                  , objectFields :+                      Optional+                        { optional :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        , recommended :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        , required :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        }+                  , path :+                      Optional+                        { allowSelf : Bool, externalUriSchemes : List Text }+                  , reference :+                      Optional+                        { allowSelf : Bool+                        , externalUriSchemes : List Text+                        , localPrefix : Text+                        }+                  , when : Optional { field : Text, hasValue : List Text }+                  }+            , required :+                List+                  { allowedValues : List Text+                  , cardinality : < Any | List | Scalar >+                  , description : Optional Text+                  , elementFields :+                      Optional+                        { optional :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        , recommended :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        , required :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        }+                  , field : Text+                  , format :+                      Optional+                        < Actor+                        | Boolean+                        | Date+                        | DocumentHandle : Text+                        | HumanActor+                        | Integer+                        | NonNegativeInteger+                        | Rfc3339Utc+                        | Uri+                        | UriWithScheme : Text+                        >+                  , objectFields :+                      Optional+                        { optional :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        , recommended :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        , required :+                            List+                              { allowedValues : List Text+                              , cardinality : < Any | List | Scalar >+                              , description : Optional Text+                              , field : Text+                              , format :+                                  Optional+                                    < Actor+                                    | Boolean+                                    | Date+                                    | DocumentHandle : Text+                                    | HumanActor+                                    | Integer+                                    | NonNegativeInteger+                                    | Rfc3339Utc+                                    | Uri+                                    | UriWithScheme : Text+                                    >+                              , path :+                                  Optional+                                    { allowSelf : Bool+                                    , externalUriSchemes : List Text+                                    }+                              , when :+                                  Optional+                                    { field : Text, hasValue : List Text }+                              }+                        }+                  , path :+                      Optional+                        { allowSelf : Bool, externalUriSchemes : List Text }+                  , reference :+                      Optional+                        { allowSelf : Bool+                        , externalUriSchemes : List Text+                        , localPrefix : Text+                        }+                  , when : Optional { field : Text, hasValue : List Text }+                  }+            }+        , idPrefix : Optional Text+        , pathPattern : Optional Text+        , requireSchemaSection : Bool+        , resourceScheme : Optional Text+        , schemaColumns : List Text+        , type : Text+        }+    , default =+      { description = None Text+      , frontmatter =+        { optional =+            [] : List+                   { allowedValues : List Text+                   , cardinality : < Any | List | Scalar >+                   , description : Optional Text+                   , elementFields :+                       Optional+                         { optional :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         , recommended :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         , required :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         }+                   , field : Text+                   , format :+                       Optional+                         < Actor+                         | Boolean+                         | Date+                         | DocumentHandle : Text+                         | HumanActor+                         | Integer+                         | NonNegativeInteger+                         | Rfc3339Utc+                         | Uri+                         | UriWithScheme : Text+                         >+                   , objectFields :+                       Optional+                         { optional :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         , recommended :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         , required :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         }+                   , path :+                       Optional+                         { allowSelf : Bool, externalUriSchemes : List Text }+                   , reference :+                       Optional+                         { allowSelf : Bool+                         , externalUriSchemes : List Text+                         , localPrefix : Text+                         }+                   , when : Optional { field : Text, hasValue : List Text }+                   }+        , recommended =+            [] : List+                   { allowedValues : List Text+                   , cardinality : < Any | List | Scalar >+                   , description : Optional Text+                   , elementFields :+                       Optional+                         { optional :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         , recommended :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         , required :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         }+                   , field : Text+                   , format :+                       Optional+                         < Actor+                         | Boolean+                         | Date+                         | DocumentHandle : Text+                         | HumanActor+                         | Integer+                         | NonNegativeInteger+                         | Rfc3339Utc+                         | Uri+                         | UriWithScheme : Text+                         >+                   , objectFields :+                       Optional+                         { optional :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         , recommended :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         , required :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         }+                   , path :+                       Optional+                         { allowSelf : Bool, externalUriSchemes : List Text }+                   , reference :+                       Optional+                         { allowSelf : Bool+                         , externalUriSchemes : List Text+                         , localPrefix : Text+                         }+                   , when : Optional { field : Text, hasValue : List Text }+                   }+        , required =+            [] : List+                   { allowedValues : List Text+                   , cardinality : < Any | List | Scalar >+                   , description : Optional Text+                   , elementFields :+                       Optional+                         { optional :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         , recommended :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         , required :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         }+                   , field : Text+                   , format :+                       Optional+                         < Actor+                         | Boolean+                         | Date+                         | DocumentHandle : Text+                         | HumanActor+                         | Integer+                         | NonNegativeInteger+                         | Rfc3339Utc+                         | Uri+                         | UriWithScheme : Text+                         >+                   , objectFields :+                       Optional+                         { optional :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         , recommended :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         , required :+                             List+                               { allowedValues : List Text+                               , cardinality : < Any | List | Scalar >+                               , description : Optional Text+                               , field : Text+                               , format :+                                   Optional+                                     < Actor+                                     | Boolean+                                     | Date+                                     | DocumentHandle : Text+                                     | HumanActor+                                     | Integer+                                     | NonNegativeInteger+                                     | Rfc3339Utc+                                     | Uri+                                     | UriWithScheme : Text+                                     >+                               , path :+                                   Optional+                                     { allowSelf : Bool+                                     , externalUriSchemes : List Text+                                     }+                               , when :+                                   Optional+                                     { field : Text, hasValue : List Text }+                               }+                         }+                   , path :+                       Optional+                         { allowSelf : Bool, externalUriSchemes : List Text }+                   , reference :+                       Optional+                         { allowSelf : Bool+                         , externalUriSchemes : List Text+                         , localPrefix : Text+                         }+                   , when : Optional { field : Text, hasValue : List Text }+                   }+        }+      , idPrefix = None Text+      , pathPattern = None Text+      , requireSchemaSection = False+      , resourceScheme = None Text+      , schemaColumns = [] : List Text+      }+    }+  }+, mk =+  { FieldRule =+    { actor =+        \(_ : Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , elementFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , field = _+          , format = Some+              < Actor+              | Boolean+              | Date+              | DocumentHandle : Text+              | HumanActor+              | Integer+              | NonNegativeInteger+              | Rfc3339Utc+              | Uri+              | UriWithScheme : Text+              >.Actor+          , objectFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , reference =+              None+                { allowSelf : Bool+                , externalUriSchemes : List Text+                , localPrefix : Text+                }+          , when = None { field : Text, hasValue : List Text }+          }+    , boolean =+        \(_ : Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , elementFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , field = _+          , format = Some+              < Actor+              | Boolean+              | Date+              | DocumentHandle : Text+              | HumanActor+              | Integer+              | NonNegativeInteger+              | Rfc3339Utc+              | Uri+              | UriWithScheme : Text+              >.Boolean+          , objectFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , reference =+              None+                { allowSelf : Bool+                , externalUriSchemes : List Text+                , localPrefix : Text+                }+          , when = None { field : Text, hasValue : List Text }+          }+    , bundlePath =+        \(_ : Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , elementFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , field = _+          , format =+              None+                < Actor+                | Boolean+                | Date+                | DocumentHandle : Text+                | HumanActor+                | Integer+                | NonNegativeInteger+                | Rfc3339Utc+                | Uri+                | UriWithScheme : Text+                >+          , objectFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , path = Some+            { allowSelf = False, externalUriSchemes = [] : List Text }+          , reference =+              None+                { allowSelf : Bool+                , externalUriSchemes : List Text+                , localPrefix : Text+                }+          , when = None { field : Text, hasValue : List Text }+          }+    , conditional =+        \ ( _+          : { allowedValues : List Text+            , cardinality : < Any | List | Scalar >+            , description : Optional Text+            , elementFields :+                Optional+                  { optional :+                      List+                        { allowedValues : List Text+                        , cardinality : < Any | List | Scalar >+                        , description : Optional Text+                        , field : Text+                        , format :+                            Optional+                              < Actor+                              | Boolean+                              | Date+                              | DocumentHandle : Text+                              | HumanActor+                              | Integer+                              | NonNegativeInteger+                              | Rfc3339Utc+                              | Uri+                              | UriWithScheme : Text+                              >+                        , path :+                            Optional+                              { allowSelf : Bool+                              , externalUriSchemes : List Text+                              }+                        , when : Optional { field : Text, hasValue : List Text }+                        }+                  , recommended :+                      List+                        { allowedValues : List Text+                        , cardinality : < Any | List | Scalar >+                        , description : Optional Text+                        , field : Text+                        , format :+                            Optional+                              < Actor+                              | Boolean+                              | Date+                              | DocumentHandle : Text+                              | HumanActor+                              | Integer+                              | NonNegativeInteger+                              | Rfc3339Utc+                              | Uri+                              | UriWithScheme : Text+                              >+                        , path :+                            Optional+                              { allowSelf : Bool+                              , externalUriSchemes : List Text+                              }+                        , when : Optional { field : Text, hasValue : List Text }+                        }+                  , required :+                      List+                        { allowedValues : List Text+                        , cardinality : < Any | List | Scalar >+                        , description : Optional Text+                        , field : Text+                        , format :+                            Optional+                              < Actor+                              | Boolean+                              | Date+                              | DocumentHandle : Text+                              | HumanActor+                              | Integer+                              | NonNegativeInteger+                              | Rfc3339Utc+                              | Uri+                              | UriWithScheme : Text+                              >+                        , path :+                            Optional+                              { allowSelf : Bool+                              , externalUriSchemes : List Text+                              }+                        , when : Optional { field : Text, hasValue : List Text }+                        }+                  }+            , field : Text+            , format :+                Optional+                  < Actor+                  | Boolean+                  | Date+                  | DocumentHandle : Text+                  | HumanActor+                  | Integer+                  | NonNegativeInteger+                  | Rfc3339Utc+                  | Uri+                  | UriWithScheme : Text+                  >+            , objectFields :+                Optional+                  { optional :+                      List+                        { allowedValues : List Text+                        , cardinality : < Any | List | Scalar >+                        , description : Optional Text+                        , field : Text+                        , format :+                            Optional+                              < Actor+                              | Boolean+                              | Date+                              | DocumentHandle : Text+                              | HumanActor+                              | Integer+                              | NonNegativeInteger+                              | Rfc3339Utc+                              | Uri+                              | UriWithScheme : Text+                              >+                        , path :+                            Optional+                              { allowSelf : Bool+                              , externalUriSchemes : List Text+                              }+                        , when : Optional { field : Text, hasValue : List Text }+                        }+                  , recommended :+                      List+                        { allowedValues : List Text+                        , cardinality : < Any | List | Scalar >+                        , description : Optional Text+                        , field : Text+                        , format :+                            Optional+                              < Actor+                              | Boolean+                              | Date+                              | DocumentHandle : Text+                              | HumanActor+                              | Integer+                              | NonNegativeInteger+                              | Rfc3339Utc+                              | Uri+                              | UriWithScheme : Text+                              >+                        , path :+                            Optional+                              { allowSelf : Bool+                              , externalUriSchemes : List Text+                              }+                        , when : Optional { field : Text, hasValue : List Text }+                        }+                  , required :+                      List+                        { allowedValues : List Text+                        , cardinality : < Any | List | Scalar >+                        , description : Optional Text+                        , field : Text+                        , format :+                            Optional+                              < Actor+                              | Boolean+                              | Date+                              | DocumentHandle : Text+                              | HumanActor+                              | Integer+                              | NonNegativeInteger+                              | Rfc3339Utc+                              | Uri+                              | UriWithScheme : Text+                              >+                        , path :+                            Optional+                              { allowSelf : Bool+                              , externalUriSchemes : List Text+                              }+                        , when : Optional { field : Text, hasValue : List Text }+                        }+                  }+            , path :+                Optional { allowSelf : Bool, externalUriSchemes : List Text }+            , reference :+                Optional+                  { allowSelf : Bool+                  , externalUriSchemes : List Text+                  , localPrefix : Text+                  }+            , when : Optional { field : Text, hasValue : List Text }+            }+          ) ->+        \(_ : { field : Text, hasValue : List Text }) ->+          _@1+          with when = Some _+    , date =+        \(_ : Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , elementFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , field = _+          , format = Some+              < Actor+              | Boolean+              | Date+              | DocumentHandle : Text+              | HumanActor+              | Integer+              | NonNegativeInteger+              | Rfc3339Utc+              | Uri+              | UriWithScheme : Text+              >.Date+          , objectFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , reference =+              None+                { allowSelf : Bool+                , externalUriSchemes : List Text+                , localPrefix : Text+                }+          , when = None { field : Text, hasValue : List Text }+          }+    , documentHandle =+        \(_ : Text) ->+        \(_ : Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , elementFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , field = _@1+          , format = Some+              ( < Actor+                | Boolean+                | Date+                | DocumentHandle : Text+                | HumanActor+                | Integer+                | NonNegativeInteger+                | Rfc3339Utc+                | Uri+                | UriWithScheme : Text+                >.DocumentHandle+                  _+              )+          , objectFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , reference =+              None+                { allowSelf : Bool+                , externalUriSchemes : List Text+                , localPrefix : Text+                }+          , when = None { field : Text, hasValue : List Text }+          }+    , documented =+        \(_ : Text) ->+        \(_ : Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = Some _+          , elementFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , field = _@1+          , format =+              None+                < Actor+                | Boolean+                | Date+                | DocumentHandle : Text+                | HumanActor+                | Integer+                | NonNegativeInteger+                | Rfc3339Utc+                | Uri+                | UriWithScheme : Text+                >+          , objectFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , reference =+              None+                { allowSelf : Bool+                , externalUriSchemes : List Text+                , localPrefix : Text+                }+          , when = None { field : Text, hasValue : List Text }+          }+    , enum =+        \(_ : Text) ->+        \(_ : List Text) ->+          { allowedValues = _+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , elementFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , field = _@1+          , format =+              None+                < Actor+                | Boolean+                | Date+                | DocumentHandle : Text+                | HumanActor+                | Integer+                | NonNegativeInteger+                | Rfc3339Utc+                | Uri+                | UriWithScheme : Text+                >+          , objectFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , reference =+              None+                { allowSelf : Bool+                , externalUriSchemes : List Text+                , localPrefix : Text+                }+          , when = None { field : Text, hasValue : List Text }+          }+    , humanActor =+        \(_ : Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , elementFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , field = _+          , format = Some+              < Actor+              | Boolean+              | Date+              | DocumentHandle : Text+              | HumanActor+              | Integer+              | NonNegativeInteger+              | Rfc3339Utc+              | Uri+              | UriWithScheme : Text+              >.HumanActor+          , objectFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , reference =+              None+                { allowSelf : Bool+                , externalUriSchemes : List Text+                , localPrefix : Text+                }+          , when = None { field : Text, hasValue : List Text }+          }+    , integer =+        \(_ : Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , elementFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , field = _+          , format = Some+              < Actor+              | Boolean+              | Date+              | DocumentHandle : Text+              | HumanActor+              | Integer+              | NonNegativeInteger+              | Rfc3339Utc+              | Uri+              | UriWithScheme : Text+              >.Integer+          , objectFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , reference =+              None+                { allowSelf : Bool+                , externalUriSchemes : List Text+                , localPrefix : Text+                }+          , when = None { field : Text, hasValue : List Text }+          }+    , list =+        \(_ : Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.List+          , description = None Text+          , elementFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , field = _+          , format =+              None+                < Actor+                | Boolean+                | Date+                | DocumentHandle : Text+                | HumanActor+                | Integer+                | NonNegativeInteger+                | Rfc3339Utc+                | Uri+                | UriWithScheme : Text+                >+          , objectFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , reference =+              None+                { allowSelf : Bool+                , externalUriSchemes : List Text+                , localPrefix : Text+                }+          , when = None { field : Text, hasValue : List Text }+          }+    , localOrExternalPath =+        \(_ : Text) ->+        \(_ : List Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , elementFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , field = _@1+          , format =+              None+                < Actor+                | Boolean+                | Date+                | DocumentHandle : Text+                | HumanActor+                | Integer+                | NonNegativeInteger+                | Rfc3339Utc+                | Uri+                | UriWithScheme : Text+                >+          , objectFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , path = Some { allowSelf = False, externalUriSchemes = _ }+          , reference =+              None+                { allowSelf : Bool+                , externalUriSchemes : List Text+                , localPrefix : Text+                }+          , when = None { field : Text, hasValue : List Text }+          }+    , localOrExternalReference =+        \(_ : Text) ->+        \(_ : Text) ->+        \(_ : List Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , elementFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , field = _@2+          , format =+              None+                < Actor+                | Boolean+                | Date+                | DocumentHandle : Text+                | HumanActor+                | Integer+                | NonNegativeInteger+                | Rfc3339Utc+                | Uri+                | UriWithScheme : Text+                >+          , objectFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , reference = Some+            { allowSelf = False, externalUriSchemes = _, localPrefix = _@1 }+          , when = None { field : Text, hasValue : List Text }+          }+    , localReference =+        \(_ : Text) ->+        \(_ : Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , elementFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , field = _@1+          , format =+              None+                < Actor+                | Boolean+                | Date+                | DocumentHandle : Text+                | HumanActor+                | Integer+                | NonNegativeInteger+                | Rfc3339Utc+                | Uri+                | UriWithScheme : Text+                >+          , objectFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , reference = Some+            { allowSelf = False+            , externalUriSchemes = [] : List Text+            , localPrefix = _+            }+          , when = None { field : Text, hasValue : List Text }+          }+    , nonNegativeInteger =+        \(_ : Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , elementFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , field = _+          , format = Some+              < Actor+              | Boolean+              | Date+              | DocumentHandle : Text+              | HumanActor+              | Integer+              | NonNegativeInteger+              | Rfc3339Utc+              | Uri+              | UriWithScheme : Text+              >.NonNegativeInteger+          , objectFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , reference =+              None+                { allowSelf : Bool+                , externalUriSchemes : List Text+                , localPrefix : Text+                }+          , when = None { field : Text, hasValue : List Text }+          }+    , plain =+        \(_ : Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , elementFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , field = _+          , format =+              None+                < Actor+                | Boolean+                | Date+                | DocumentHandle : Text+                | HumanActor+                | Integer+                | NonNegativeInteger+                | Rfc3339Utc+                | Uri+                | UriWithScheme : Text+                >+          , objectFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , reference =+              None+                { allowSelf : Bool+                , externalUriSchemes : List Text+                , localPrefix : Text+                }+          , when = None { field : Text, hasValue : List Text }+          }+    , record =+        \(_ : Text) ->+        \ ( _+          : { optional :+                List+                  { allowedValues : List Text+                  , cardinality : < Any | List | Scalar >+                  , description : Optional Text+                  , field : Text+                  , format :+                      Optional+                        < Actor+                        | Boolean+                        | Date+                        | DocumentHandle : Text+                        | HumanActor+                        | Integer+                        | NonNegativeInteger+                        | Rfc3339Utc+                        | Uri+                        | UriWithScheme : Text+                        >+                  , path :+                      Optional+                        { allowSelf : Bool, externalUriSchemes : List Text }+                  , when : Optional { field : Text, hasValue : List Text }+                  }+            , recommended :+                List+                  { allowedValues : List Text+                  , cardinality : < Any | List | Scalar >+                  , description : Optional Text+                  , field : Text+                  , format :+                      Optional+                        < Actor+                        | Boolean+                        | Date+                        | DocumentHandle : Text+                        | HumanActor+                        | Integer+                        | NonNegativeInteger+                        | Rfc3339Utc+                        | Uri+                        | UriWithScheme : Text+                        >+                  , path :+                      Optional+                        { allowSelf : Bool, externalUriSchemes : List Text }+                  , when : Optional { field : Text, hasValue : List Text }+                  }+            , required :+                List+                  { allowedValues : List Text+                  , cardinality : < Any | List | Scalar >+                  , description : Optional Text+                  , field : Text+                  , format :+                      Optional+                        < Actor+                        | Boolean+                        | Date+                        | DocumentHandle : Text+                        | HumanActor+                        | Integer+                        | NonNegativeInteger+                        | Rfc3339Utc+                        | Uri+                        | UriWithScheme : Text+                        >+                  , path :+                      Optional+                        { allowSelf : Bool, externalUriSchemes : List Text }+                  , when : Optional { field : Text, hasValue : List Text }+                  }+            }+          ) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , elementFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , field = _@1+          , format =+              None+                < Actor+                | Boolean+                | Date+                | DocumentHandle : Text+                | HumanActor+                | Integer+                | NonNegativeInteger+                | Rfc3339Utc+                | Uri+                | UriWithScheme : Text+                >+          , objectFields = Some _+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , reference =+              None+                { allowSelf : Bool+                , externalUriSchemes : List Text+                , localPrefix : Text+                }+          , when = None { field : Text, hasValue : List Text }+          }+    , recordList =+        \(_ : Text) ->+        \ ( _+          : { optional :+                List+                  { allowedValues : List Text+                  , cardinality : < Any | List | Scalar >+                  , description : Optional Text+                  , field : Text+                  , format :+                      Optional+                        < Actor+                        | Boolean+                        | Date+                        | DocumentHandle : Text+                        | HumanActor+                        | Integer+                        | NonNegativeInteger+                        | Rfc3339Utc+                        | Uri+                        | UriWithScheme : Text+                        >+                  , path :+                      Optional+                        { allowSelf : Bool, externalUriSchemes : List Text }+                  , when : Optional { field : Text, hasValue : List Text }+                  }+            , recommended :+                List+                  { allowedValues : List Text+                  , cardinality : < Any | List | Scalar >+                  , description : Optional Text+                  , field : Text+                  , format :+                      Optional+                        < Actor+                        | Boolean+                        | Date+                        | DocumentHandle : Text+                        | HumanActor+                        | Integer+                        | NonNegativeInteger+                        | Rfc3339Utc+                        | Uri+                        | UriWithScheme : Text+                        >+                  , path :+                      Optional+                        { allowSelf : Bool, externalUriSchemes : List Text }+                  , when : Optional { field : Text, hasValue : List Text }+                  }+            , required :+                List+                  { allowedValues : List Text+                  , cardinality : < Any | List | Scalar >+                  , description : Optional Text+                  , field : Text+                  , format :+                      Optional+                        < Actor+                        | Boolean+                        | Date+                        | DocumentHandle : Text+                        | HumanActor+                        | Integer+                        | NonNegativeInteger+                        | Rfc3339Utc+                        | Uri+                        | UriWithScheme : Text+                        >+                  , path :+                      Optional+                        { allowSelf : Bool, externalUriSchemes : List Text }+                  , when : Optional { field : Text, hasValue : List Text }+                  }+            }+          ) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.List+          , description = None Text+          , elementFields = Some _+          , field = _@1+          , format =+              None+                < Actor+                | Boolean+                | Date+                | DocumentHandle : Text+                | HumanActor+                | Integer+                | NonNegativeInteger+                | Rfc3339Utc+                | Uri+                | UriWithScheme : Text+                >+          , objectFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , reference =+              None+                { allowSelf : Bool+                , externalUriSchemes : List Text+                , localPrefix : Text+                }+          , when = None { field : Text, hasValue : List Text }+          }+    , recordOrList =+        \(_ : Text) ->+        \ ( _+          : { optional :+                List+                  { allowedValues : List Text+                  , cardinality : < Any | List | Scalar >+                  , description : Optional Text+                  , field : Text+                  , format :+                      Optional+                        < Actor+                        | Boolean+                        | Date+                        | DocumentHandle : Text+                        | HumanActor+                        | Integer+                        | NonNegativeInteger+                        | Rfc3339Utc+                        | Uri+                        | UriWithScheme : Text+                        >+                  , path :+                      Optional+                        { allowSelf : Bool, externalUriSchemes : List Text }+                  , when : Optional { field : Text, hasValue : List Text }+                  }+            , recommended :+                List+                  { allowedValues : List Text+                  , cardinality : < Any | List | Scalar >+                  , description : Optional Text+                  , field : Text+                  , format :+                      Optional+                        < Actor+                        | Boolean+                        | Date+                        | DocumentHandle : Text+                        | HumanActor+                        | Integer+                        | NonNegativeInteger+                        | Rfc3339Utc+                        | Uri+                        | UriWithScheme : Text+                        >+                  , path :+                      Optional+                        { allowSelf : Bool, externalUriSchemes : List Text }+                  , when : Optional { field : Text, hasValue : List Text }+                  }+            , required :+                List+                  { allowedValues : List Text+                  , cardinality : < Any | List | Scalar >+                  , description : Optional Text+                  , field : Text+                  , format :+                      Optional+                        < Actor+                        | Boolean+                        | Date+                        | DocumentHandle : Text+                        | HumanActor+                        | Integer+                        | NonNegativeInteger+                        | Rfc3339Utc+                        | Uri+                        | UriWithScheme : Text+                        >+                  , path :+                      Optional+                        { allowSelf : Bool, externalUriSchemes : List Text }+                  , when : Optional { field : Text, hasValue : List Text }+                  }+            }+          ) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , elementFields = Some _+          , field = _@1+          , format =+              None+                < Actor+                | Boolean+                | Date+                | DocumentHandle : Text+                | HumanActor+                | Integer+                | NonNegativeInteger+                | Rfc3339Utc+                | Uri+                | UriWithScheme : Text+                >+          , objectFields = Some _+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , reference =+              None+                { allowSelf : Bool+                , externalUriSchemes : List Text+                , localPrefix : Text+                }+          , when = None { field : Text, hasValue : List Text }+          }+    , rfc3339Utc =+        \(_ : Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , elementFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , field = _+          , format = Some+              < Actor+              | Boolean+              | Date+              | DocumentHandle : Text+              | HumanActor+              | Integer+              | NonNegativeInteger+              | Rfc3339Utc+              | Uri+              | UriWithScheme : Text+              >.Rfc3339Utc+          , objectFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , reference =+              None+                { allowSelf : Bool+                , externalUriSchemes : List Text+                , localPrefix : Text+                }+          , when = None { field : Text, hasValue : List Text }+          }+    , scalar =+        \(_ : Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Scalar+          , description = None Text+          , elementFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , field = _+          , format =+              None+                < Actor+                | Boolean+                | Date+                | DocumentHandle : Text+                | HumanActor+                | Integer+                | NonNegativeInteger+                | Rfc3339Utc+                | Uri+                | UriWithScheme : Text+                >+          , objectFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , reference =+              None+                { allowSelf : Bool+                , externalUriSchemes : List Text+                , localPrefix : Text+                }+          , when = None { field : Text, hasValue : List Text }+          }+    , uri =+        \(_ : Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , elementFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , field = _+          , format = Some+              < Actor+              | Boolean+              | Date+              | DocumentHandle : Text+              | HumanActor+              | Integer+              | NonNegativeInteger+              | Rfc3339Utc+              | Uri+              | UriWithScheme : Text+              >.Uri+          , objectFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , reference =+              None+                { allowSelf : Bool+                , externalUriSchemes : List Text+                , localPrefix : Text+                }+          , when = None { field : Text, hasValue : List Text }+          }+    , uriWithScheme =+        \(_ : Text) ->+        \(_ : Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , elementFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , field = _@1+          , format = Some+              ( < Actor+                | Boolean+                | Date+                | DocumentHandle : Text+                | HumanActor+                | Integer+                | NonNegativeInteger+                | Rfc3339Utc+                | Uri+                | UriWithScheme : Text+                >.UriWithScheme+                  _+              )+          , objectFields =+              None+                { optional :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , recommended :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                , required :+                    List+                      { allowedValues : List Text+                      , cardinality : < Any | List | Scalar >+                      , description : Optional Text+                      , field : Text+                      , format :+                          Optional+                            < Actor+                            | Boolean+                            | Date+                            | DocumentHandle : Text+                            | HumanActor+                            | Integer+                            | NonNegativeInteger+                            | Rfc3339Utc+                            | Uri+                            | UriWithScheme : Text+                            >+                      , path :+                          Optional+                            { allowSelf : Bool, externalUriSchemes : List Text }+                      , when : Optional { field : Text, hasValue : List Text }+                      }+                }+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , reference =+              None+                { allowSelf : Bool+                , externalUriSchemes : List Text+                , localPrefix : Text+                }+          , when = None { field : Text, hasValue : List Text }+          }+    }+  , NestedFieldRule =+    { actor =+        \(_ : Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , field = _+          , format = Some+              < Actor+              | Boolean+              | Date+              | DocumentHandle : Text+              | HumanActor+              | Integer+              | NonNegativeInteger+              | Rfc3339Utc+              | Uri+              | UriWithScheme : Text+              >.Actor+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , when = None { field : Text, hasValue : List Text }+          }+    , boolean =+        \(_ : Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , field = _+          , format = Some+              < Actor+              | Boolean+              | Date+              | DocumentHandle : Text+              | HumanActor+              | Integer+              | NonNegativeInteger+              | Rfc3339Utc+              | Uri+              | UriWithScheme : Text+              >.Boolean+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , when = None { field : Text, hasValue : List Text }+          }+    , bundlePath =+        \(_ : Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , field = _+          , format =+              None+                < Actor+                | Boolean+                | Date+                | DocumentHandle : Text+                | HumanActor+                | Integer+                | NonNegativeInteger+                | Rfc3339Utc+                | Uri+                | UriWithScheme : Text+                >+          , path = Some+            { allowSelf = False, externalUriSchemes = [] : List Text }+          , when = None { field : Text, hasValue : List Text }+          }+    , conditional =+        \ ( _+          : { allowedValues : List Text+            , cardinality : < Any | List | Scalar >+            , description : Optional Text+            , field : Text+            , format :+                Optional+                  < Actor+                  | Boolean+                  | Date+                  | DocumentHandle : Text+                  | HumanActor+                  | Integer+                  | NonNegativeInteger+                  | Rfc3339Utc+                  | Uri+                  | UriWithScheme : Text+                  >+            , path :+                Optional { allowSelf : Bool, externalUriSchemes : List Text }+            , when : Optional { field : Text, hasValue : List Text }+            }+          ) ->+        \(_ : { field : Text, hasValue : List Text }) ->+          _@1+          with when = Some _+    , date =+        \(_ : Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , field = _+          , format = Some+              < Actor+              | Boolean+              | Date+              | DocumentHandle : Text+              | HumanActor+              | Integer+              | NonNegativeInteger+              | Rfc3339Utc+              | Uri+              | UriWithScheme : Text+              >.Date+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , when = None { field : Text, hasValue : List Text }+          }+    , documentHandle =+        \(_ : Text) ->+        \(_ : Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , field = _@1+          , format = Some+              ( < Actor+                | Boolean+                | Date+                | DocumentHandle : Text+                | HumanActor+                | Integer+                | NonNegativeInteger+                | Rfc3339Utc+                | Uri+                | UriWithScheme : Text+                >.DocumentHandle+                  _+              )+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , when = None { field : Text, hasValue : List Text }+          }+    , documented =+        \(_ : Text) ->+        \(_ : Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = Some _+          , field = _@1+          , format =+              None+                < Actor+                | Boolean+                | Date+                | DocumentHandle : Text+                | HumanActor+                | Integer+                | NonNegativeInteger+                | Rfc3339Utc+                | Uri+                | UriWithScheme : Text+                >+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , when = None { field : Text, hasValue : List Text }+          }+    , enum =+        \(_ : Text) ->+        \(_ : List Text) ->+          { allowedValues = _+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , field = _@1+          , format =+              None+                < Actor+                | Boolean+                | Date+                | DocumentHandle : Text+                | HumanActor+                | Integer+                | NonNegativeInteger+                | Rfc3339Utc+                | Uri+                | UriWithScheme : Text+                >+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , when = None { field : Text, hasValue : List Text }+          }+    , humanActor =+        \(_ : Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , field = _+          , format = Some+              < Actor+              | Boolean+              | Date+              | DocumentHandle : Text+              | HumanActor+              | Integer+              | NonNegativeInteger+              | Rfc3339Utc+              | Uri+              | UriWithScheme : Text+              >.HumanActor+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , when = None { field : Text, hasValue : List Text }+          }+    , integer =+        \(_ : Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , field = _+          , format = Some+              < Actor+              | Boolean+              | Date+              | DocumentHandle : Text+              | HumanActor+              | Integer+              | NonNegativeInteger+              | Rfc3339Utc+              | Uri+              | UriWithScheme : Text+              >.Integer+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , when = None { field : Text, hasValue : List Text }+          }+    , list =+        \(_ : Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.List+          , description = None Text+          , field = _+          , format =+              None+                < Actor+                | Boolean+                | Date+                | DocumentHandle : Text+                | HumanActor+                | Integer+                | NonNegativeInteger+                | Rfc3339Utc+                | Uri+                | UriWithScheme : Text+                >+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , when = None { field : Text, hasValue : List Text }+          }+    , localOrExternalPath =+        \(_ : Text) ->+        \(_ : List Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , field = _@1+          , format =+              None+                < Actor+                | Boolean+                | Date+                | DocumentHandle : Text+                | HumanActor+                | Integer+                | NonNegativeInteger+                | Rfc3339Utc+                | Uri+                | UriWithScheme : Text+                >+          , path = Some { allowSelf = False, externalUriSchemes = _ }+          , when = None { field : Text, hasValue : List Text }+          }+    , nonNegativeInteger =+        \(_ : Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , field = _+          , format = Some+              < Actor+              | Boolean+              | Date+              | DocumentHandle : Text+              | HumanActor+              | Integer+              | NonNegativeInteger+              | Rfc3339Utc+              | Uri+              | UriWithScheme : Text+              >.NonNegativeInteger+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , when = None { field : Text, hasValue : List Text }+          }+    , plain =+        \(_ : Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , field = _+          , format =+              None+                < Actor+                | Boolean+                | Date+                | DocumentHandle : Text+                | HumanActor+                | Integer+                | NonNegativeInteger+                | Rfc3339Utc+                | Uri+                | UriWithScheme : Text+                >+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , when = None { field : Text, hasValue : List Text }+          }+    , rfc3339Utc =+        \(_ : Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , field = _+          , format = Some+              < Actor+              | Boolean+              | Date+              | DocumentHandle : Text+              | HumanActor+              | Integer+              | NonNegativeInteger+              | Rfc3339Utc+              | Uri+              | UriWithScheme : Text+              >.Rfc3339Utc+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , when = None { field : Text, hasValue : List Text }+          }+    , scalar =+        \(_ : Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Scalar+          , description = None Text+          , field = _+          , format =+              None+                < Actor+                | Boolean+                | Date+                | DocumentHandle : Text+                | HumanActor+                | Integer+                | NonNegativeInteger+                | Rfc3339Utc+                | Uri+                | UriWithScheme : Text+                >+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , when = None { field : Text, hasValue : List Text }+          }+    , uri =+        \(_ : Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , field = _+          , format = Some+              < Actor+              | Boolean+              | Date+              | DocumentHandle : Text+              | HumanActor+              | Integer+              | NonNegativeInteger+              | Rfc3339Utc+              | Uri+              | UriWithScheme : Text+              >.Uri+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , when = None { field : Text, hasValue : List Text }+          }+    , uriWithScheme =+        \(_ : Text) ->+        \(_ : Text) ->+          { allowedValues = [] : List Text+          , cardinality = < Any | List | Scalar >.Any+          , description = None Text+          , field = _@1+          , format = Some+              ( < Actor+                | Boolean+                | Date+                | DocumentHandle : Text+                | HumanActor+                | Integer+                | NonNegativeInteger+                | Rfc3339Utc+                | Uri+                | UriWithScheme : Text+                >.UriWithScheme+                  _+              )+          , path = None { allowSelf : Bool, externalUriSchemes : List Text }+          , when = None { field : Text, hasValue : List Text }+          }+    }+  }+}
+ test/fixtures/catalogue/package.dhall view
@@ -0,0 +1,39 @@+--| Offline snapshot of mori://shinzui/okf-profiles at v0.10.0.+-- Generated by scripts/refresh-default-registry.sh; do not edit by hand.+-- Profile/okf.dhall is the resolved schema pinned by that release, so this+-- fixture evaluates without network access.+--| Entry point for the okf-profiles package.+--+-- Import this from any project to get the profile schema types and the+-- ready-made profiles. With a versioned, hash-pinned remote import:+--+--     let okf =+--           https://raw.githubusercontent.com/shinzui/okf-profiles/v0.1.0/package.dhall+--             sha256:0000000000000000000000000000000000000000000000000000000000000000+--+--     in  okf.postgresql // { name = "acme-warehouse" }+--+-- See README.md for how to generate the real hash (`dhall freeze`) and for the+-- public-repo / pinning rationale.+let okf = ./Profile/okf.dhall++in  { Profile = okf.defaults.Profile+    , TypeRule = okf.defaults.TypeRule+    , FrontmatterRules = okf.defaults.FrontmatterRules+    , FieldRule = okf.defaults.FieldRule+    , NestedRules = okf.defaults.NestedRules+    , NestedFieldRule = okf.defaults.NestedFieldRule+    , HandleReferenceRule = okf.defaults.HandleReferenceRule+    , PathReferenceRule = okf.defaults.PathReferenceRule+    , FieldCondition = okf.FieldCondition+    , Cardinality = okf.Cardinality+    , FieldFormat = okf.FieldFormat+    , mk = okf.mk+    , reviewRule = ./Profile/ReviewRule.dhall+    , v02 = ./Profile/V02.dhall+    , coordination = ./profiles/coordination/package.dhall+    , documentation = ./profiles/documentation/package.dhall+    , okfV02 = ./profiles/okf-v0-2.dhall+    , postgresql = ./profiles/postgresql.dhall+    , tanPostgresql = ./profiles/tan-postgresql.dhall+    }
+ test/fixtures/catalogue/profiles/coordination/bug-reports.dhall view
@@ -0,0 +1,282 @@+--| Profile for defect reports against a repository's published behavior.+--+-- ## What a bug report is, and what it is not+--+-- A bug report is a *broken provision claim*: something this repository already+-- says it does, observably does not do. That is the whole line, and it is what+-- places the type in the coordination family rather than in documentation:+--+--   * Behavior that was never provided is NOT a bug. It is an improvement+--     request. "The exporter cannot resume" is a bug only if resumable export is+--     something the producer claims today; otherwise it is a request for it.+--   * A defect nobody can reach from the outside is NOT a bug report either. A+--     report names a version, an observation, and steps — if none of those can be+--     written down, what exists is a suspicion, and the right artifact is a+--     research document until it can be reproduced.+--   * Granularity: one report is one wrong behavior with one reproduction. Two+--     symptoms that share a reproduction are one report; two reproductions are+--     two reports even where the cause turns out to be shared. Merging them later+--     is cheap, and `duplicateOf` is how it is recorded.+--+-- `capability` makes the broken claim explicit where the producer publishes a+-- `coordination.capabilities` catalog: the report names the `CAP-N` handle it+-- contradicts. It is optional because not every repository has one, and because a+-- defect can break behavior that was documented rather than catalogued.+--+--+-- ## `observed` and `expected` are frontmatter, not prose+--+-- Both could live in the body, and in most trackers they do. They are keys here+-- because a corpus is queried: "every unusable defect where the expectation came+-- from a published guide" is a question a reader should be able to ask across+-- repositories without reading three hundred bodies. The body is for the+-- analysis; the keys are for the claim.+--+--+-- ## The house `status` vocabulary+--+-- Per ADR-1 this profile declares a house lifecycle vocabulary on `status` and+-- therefore does NOT splice OKF v0.2 §5.4's `status` or §5.5's `stale_after`.+-- Its question is "where has this defect got to", which is not the+-- draft/stable/deprecated question v0.2 asks of a document.+--+-- `confirmed` means the *owning* repository reproduced it, not that the reporter+-- is sure. That is the one transition an outside reporter cannot make, and+-- keeping it decidable is what stops the vocabulary collapsing into a mood.+--+-- Five statuses are terminal — `fixed`, `wont-fix`, `duplicate`, `not-a-bug`,+-- `cannot-reproduce` — and each demands `resolution` under `--strict`. A closed+-- report whose closing reason lives only in a chat log is the failure mode this+-- catches.+--+--+-- ## `severity` is an observable consequence, not a priority+--+-- The four values are ordered by what actually happens to a consumer, and are+-- assigned by observation rather than judgment:+--+--   * `data-loss`  — persisted data is destroyed, or a result is silently wrong.+--   * `unusable`   — the behavior cannot be had at all, and no workaround exists.+--   * `degraded`   — it works, but only via a workaround or with reduced function.+--   * `cosmetic`   — the output reads wrong; the behavior underneath is right.+--+-- `data-loss` outranks `unusable` deliberately: an outage is visible and a silently+-- wrong number is not. Where two values could apply, take the most severe that+-- actually occurs — and if that feels wrong, check whether two defects are being+-- reported as one.+--+-- Severity is not priority. Priority weighs severity against reach, cost, and+-- what else is in flight; it changes with the schedule, differs per consumer, and+-- has no place in a cross-repository record.+--+--+-- ## The three version keys+--+-- `affectedVersion`, `fixedVersion`, and `lastWorkingVersion` all take the same+-- fixed vocabulary: a bare released version, `unreleased` for the default branch+-- only, or `unknown` with the reason in the body. The profile cannot enforce it —+-- the values are free text — but a version field a consumer compares+-- mechanically is destroyed by commentary appended to it, so the history goes in+-- the body and the key stays a version.+--+-- `lastWorkingVersion` is what makes a report a regression, and is optional+-- because most defects were never absent.+--+--+-- ## `legacyTimestamp` is deliberately absent+--+-- `v02.legacyTimestamp` exists so a half-migrated v0.1 corpus keeps validating.+-- This profile is introduced at v0.2 and no v0.1 bug-report corpus exists, so+-- there is nothing to keep validating. Add the rule to `optional` if one ever+-- appears.+let Profile = ../../Profile/Type.dhall++let FrontmatterRules = ../../Profile/FrontmatterRules.dhall++let TypeRule = ../../Profile/TypeRule.dhall++let okf = ../../Profile/okf.dhall++let FieldRule = okf.defaults.FieldRule++let HandleReferenceRule = okf.defaults.HandleReferenceRule++let Cardinality = okf.Cardinality++let FieldFormat = okf.FieldFormat++let reviewRule = ../../Profile/ReviewRule.dhall++let v02 = ../../Profile/V02.dhall++let condition =+      \(field : Text) -> \(hasValue : List Text) -> { field, hasValue }++let terminal =+      condition+        "status"+        [ "fixed", "wont-fix", "duplicate", "not-a-bug", "cannot-reproduce" ]++let scalar =+      \(name : Text) ->+      \(description : Text) ->+        FieldRule::{+        , field = name+        , description = Some description+        , cardinality = Cardinality.Scalar+        }++let moriUri =+      \(name : Text) ->+      \(description : Text) ->+            scalar name description+        //  { format = Some (FieldFormat.UriWithScheme "mori") }++in  Profile::{+    , name = "bug-reports"+    , description = Some+        "Defect reports against behavior a repository already provides, with stable BUG handles, an observable severity scale, and a reproduction a reader can follow. Behavior that was never provided is an improvement request, not a bug. The house `reviews` family and OKF `verified` coexist: `reviews` records far more than `verified` can, so an approving `reviews` entry should also be mirrored into `verified` to keep the derived trust tier accurate."+    , okfVersion = "0.2"+    , requireBundleVersion = Some "0.2"+    , allowUnknownTypes = False+    , idField = Some "bugId"+    , frontmatter = FrontmatterRules::{+      , required =+        [ scalar "type" "The Bug Report concept type."+        , scalar "title" "Short statement of the wrong behavior."+        , scalar+            "description"+            "One sentence naming what is wrong, evaluable without the body."+        ,     v02.generated+          //  { description = Some+                  "§5.2. Who produced this report's current content, and when."+              }+        , FieldRule::{+          , field = "bugId"+          , description = Some "Bundle-scoped stable BUG-N handle."+          , cardinality = Cardinality.Scalar+          , format = Some (FieldFormat.DocumentHandle "BUG")+          }+        , FieldRule::{+          , field = "status"+          , description = Some+              "Where this report has got to. `confirmed` means the owning repository reproduced it."+          , allowedValues =+            [ "reported"+            , "confirmed"+            , "in-progress"+            , "fixed"+            , "wont-fix"+            , "duplicate"+            , "not-a-bug"+            , "cannot-reproduce"+            ]+          , cardinality = Cardinality.Scalar+          }+        , -- Consequence, not priority. Take the most severe value that actually+          -- occurs; see the header for what each one means.+          FieldRule::{+          , field = "severity"+          , description = Some+              "Observable consequence for a consumer, most severe first."+          , allowedValues = [ "data-loss", "unusable", "degraded", "cosmetic" ]+          , cardinality = Cardinality.Scalar+          }+        , moriUri+            "origin"+            "Mori URI of the project or artifact that observed the defect."+        , -- Distinct from `origin`, and the two differ in exactly the case this+          -- family exists for: a consumer reporting a defect in a dependency.+          moriUri+            "affects"+            "Mori URI of the project or artifact whose behavior is wrong."+        , scalar+            "affectedVersion"+            "Released version the defect was observed in; `unreleased` or `unknown` otherwise."+        , scalar "observed" "What actually happens, stated as a fact."+        , scalar+            "expected"+            "What should happen instead, and on whose authority — a guide, a capability, a test."+        , FieldRule::{+          , field = "reproduction"+          , description = Some+              "Ordered steps a reader can follow to see it, one step per entry."+          , cardinality = Cardinality.List+          }+        , -- The next two are conditionally required, which okf spells `required`+          -- plus `when`: a `when` condition gates a presence demand, and an+          -- `optional` rule makes no demand to gate.+          scalar+            "fixedVersion"+            "Released version carrying the fix; `unreleased` while it is on the default branch only."+          //  { when = Some (condition "status" [ "fixed" ]) }+        , FieldRule::{+          , field = "duplicateOf"+          , description = Some+              "The report this one duplicates, as a local BUG-N handle or an external Mori URI."+          , cardinality = Cardinality.Scalar+          , reference = Some HandleReferenceRule::{+            , localPrefix = "BUG"+            , externalUriSchemes = [ "mori" ]+            }+          , when = Some (condition "status" [ "duplicate" ])+          }+        ]+      , -- `reviews` is the family's one unconditional recommendation: a+        -- coordination corpus that records no review provenance is deficient and+        -- `--strict` should say so. The other two are conditional, so neither is+        -- reported on a report that has no occasion for it.+        recommended =+        [ reviewRule+        , FieldRule::{+          , field = "resolution"+          , description = Some+              "Why this report closed the way it did, recorded when it reaches a terminal status."+          , cardinality = Cardinality.Scalar+          , when = Some terminal+          }+        , -- `degraded` is *defined* as "a workaround exists", so a degraded+          -- report that names none is either incomplete or mis-graded.+          scalar+            "workaround"+            "What a consumer can do meanwhile. Demanded once `severity` is `degraded`."+          //  { when = Some (condition "severity" [ "degraded" ]) }+        ]+      , optional =+        [ -- Ordinarily absent: most producers publish no capability catalog, and+          -- a defect can break behavior that was documented rather than+          -- catalogued.+          --+          -- A Mori URI rather than a `CAP-N` handle reference, and not by+          -- preference: okf resolves a local handle against this bundle's own ID+          -- index, and ties every declared reference prefix to a type this+          -- profile declares. A capability catalog is a different bundle in a+          -- different repository, so the reference is external in every case+          -- that matters, and declaring `CAP` here is a profile load failure.+          moriUri+            "capability"+            "Mori URI of the capability whose provision claim this defect contradicts."+        , -- Ordinarily absent: most defects were never absent, so demanding this+          -- under `--strict` would report a normal state as a deficiency.+          scalar+            "lastWorkingVersion"+            "Newest release where the behavior was correct. Its presence makes this a regression."+        , scalar+            "environment"+            "Where the observation was made, when the defect does not reproduce everywhere."+        ,     v02.verified+          //  { description = Some+                  "§5.2. Independent confirmations that this report is accurate. Mirror an approving `reviews` entry here."+              }+        ]+      }+    , types =+      [ TypeRule::{+        , type = "Bug Report"+        , description = Some+            "One wrong behavior, in something this repository already provides, with one reproduction."+        , pathPattern = Some "*"+        , idPrefix = Some "BUG"+        }+      ]+    }
+ test/fixtures/catalogue/profiles/coordination/capabilities.dhall view
@@ -0,0 +1,272 @@+--| Profile for consumer-facing catalogs of what a repository provides today.+--+-- ## What a capability is, and what it is not+--+-- A capability is a *provision claim*: something this repository's code does+-- today, that a consumer can adopt on its own, backed by evidence a reader can+-- open. It completes the coordination family's triangle — a use case describes+-- what a consumer needs, a capability describes what a producer provides, and an+-- improvement request describes the gap between them:+--+--   * A capability that does not exist yet is NOT a capability record. It is an+--     improvement request. There is deliberately no `planned` status here, and+--     that omission is the profile's single most load-bearing decision.+--   * A capability that only exists when several repositories cooperate is NOT a+--     capability record either — no single repository can assert it or prove it.+--     It belongs to the consuming repository as a use-case feature.+--   * Granularity: one capability is one thing a consumer can adopt AND verify+--     independently. Where two candidates always ship together and are proven by+--     the same evidence, they are one capability. A catalog with one record per+--     exported module is a worse copy of the API reference.+--   * A record must read correctly to someone who has never heard of the+--     repositories that happen to consume it. In practice this test does more+--     than filter vocabulary: a claim that cannot be phrased without naming a+--     sibling service is usually a composition claim in disguise.+--+-- Where a capability grows materially in a later release, record the growth as a+-- new capability that `requires` the old one, rather than moving an older `since`+-- forward. Both alternatives misinform a consumer pinning an older version.+--+--+-- ## The house `status` vocabulary+--+-- Per ADR-1, this profile declares a house lifecycle vocabulary on `status` and+-- therefore does NOT splice OKF v0.2 §5.4's `status` or §5.5's `stale_after`.+-- `shipped` / `deprecated` / `withdrawn` answer "can a consumer use this right+-- now", which is not the draft/stable/deprecated question v0.2 asks.+--+-- `stability` is deliberately a separate key rather than more `status` values: a+-- shipped capability in a pre-1.0 project is available *and* unstable, and a+-- consumer choosing a dependency needs both answers. In a project with a uniform+-- compatibility promise the key is uniform too, and carries its signal to an+-- outside reader rather than between records.+--+--+-- ## `legacyTimestamp` is deliberately absent+--+-- `v02.legacyTimestamp` exists so a half-migrated v0.1 corpus keeps validating.+-- This profile is introduced at v0.2 and no v0.1 capability corpus exists, so+-- there is nothing to keep validating. Add the rule to `optional` if one ever+-- appears.+let Profile = ../../Profile/Type.dhall++let FrontmatterRules = ../../Profile/FrontmatterRules.dhall++let TypeRule = ../../Profile/TypeRule.dhall++let okf = ../../Profile/okf.dhall++let FieldRule = okf.defaults.FieldRule++let NestedRules = okf.defaults.NestedRules++let NestedFieldRule = okf.defaults.NestedFieldRule++let HandleReferenceRule = okf.defaults.HandleReferenceRule++let Cardinality = okf.Cardinality++let FieldFormat = okf.FieldFormat++let reviewRule = ../../Profile/ReviewRule.dhall++let v02 = ../../Profile/V02.dhall++let scalar =+      \(name : Text) ->+      \(description : Text) ->+        FieldRule::{+        , field = name+        , description = Some description+        , cardinality = Cardinality.Scalar+        }++let list =+      \(name : Text) ->+      \(description : Text) ->+        FieldRule::{+        , field = name+        , description = Some description+        , cardinality = Cardinality.List+        }++let nestedScalar =+      \(name : Text) ->+      \(description : Text) ->+        NestedFieldRule::{+        , field = name+        , description = Some description+        , cardinality = Cardinality.Scalar+        }++let capabilityReference =+      \(name : Text) ->+      \(description : Text) ->+        FieldRule::{+        , field = name+        , description = Some description+        , cardinality = Cardinality.List+        , reference = Some HandleReferenceRule::{+          , localPrefix = "CAP"+          , externalUriSchemes = [ "mori" ]+          }+        }++-- Evidence is what separates a capability record from a marketing bullet: every+-- claim names an artifact a reader can open and check.+--+-- `resource` is a plain scalar and deliberately NOT an okf `path` rule. A path+-- rule resolves against the bundle's own concept tree, and a path naming a `.md`+-- file must name a concept inside the bundle. Capability evidence is inherently+-- repository-wide — test modules, package targets, user guides outside the+-- bundle — so declaring `path` here would reject exactly the evidence that+-- matters most. The cost is that resources are unchecked by okf; a+-- repository-local CI check is the right place to resolve them.+let evidence =+      FieldRule::{+      , field = "evidence"+      , description = Some+          "Artifacts proving this capability works today. A record with no evidence is an improvement request, not a capability."+      , cardinality = Cardinality.List+      , elementFields = Some NestedRules::{+        , required =+          [ NestedFieldRule::{+            , field = "kind"+            , description = Some "What sort of proof this entry is."+            , allowedValues =+              [ "test"+              , "conformance"+              , "example"+              , "benchmark"+              , "module"+              , "guide"+              ]+            , cardinality = Cardinality.Scalar+            }+          , nestedScalar+              "resource"+              "Repository-relative path, package target, module name, or absolute URL a reader can open."+          ]+        , recommended =+          [ nestedScalar+              "proves"+              "What a reader learns by opening it. Without this an evidence entry is a bare path."+          ]+        , optional = [] : List NestedFieldRule.Type+        }+      }++in  Profile::{+    , name = "capabilities"+    , description = Some+        "Consumer-facing catalog of what a repository provides today: stable CAP-N handles, an explicit compatibility promise, and evidence. Provision claims only — absent capabilities are improvement requests, and capabilities that span repositories are use-case features owned by the consumer. The house `reviews` family and OKF `verified` coexist: `reviews` records far more than `verified` can, so an approving `reviews` entry should also be mirrored into `verified` to keep the derived trust tier accurate."+    , okfVersion = "0.2"+    , requireBundleVersion = Some "0.2"+    , allowUnknownTypes = False+    , idField = Some "capabilityId"+    , frontmatter = FrontmatterRules::{+      , required =+        [ scalar "type" "The Capability concept type."+        , scalar "title" "Human-readable capability name."+        , scalar+            "description"+            "One sentence a consumer can evaluate without reading the body."+        ,     v02.generated+          //  { description = Some+                  "§5.2. Who produced this capability record's current content, and when."+              }+        ]+      , recommended = [ reviewRule ]+      , optional =+        [ list "tags" "Producer-defined search and grouping tags."+        , list+            "links"+            "Additional navigation links retained as producer metadata."+        ,     v02.verified+          //  { description = Some+                  "§5.2. Independent confirmations that this content is accurate. Mirror an approving `reviews` entry here."+              }+        ]+      }+    , types =+      [ TypeRule::{+        , type = "Capability"+        , description = Some+            "One thing this repository's code does today that a consumer can adopt and verify independently."+        , frontmatter = FrontmatterRules::{+          , required =+            [ FieldRule::{+              , field = "capabilityId"+              , description = Some "Bundle-scoped stable CAP-N handle."+              , cardinality = Cardinality.Scalar+              , format = Some (FieldFormat.DocumentHandle "CAP")+              }+            , FieldRule::{+              , field = "provider"+              , description = Some+                  "Mori project URI that provides this capability. Redundant within one bundle, load-bearing once capabilities are aggregated across repositories."+              , cardinality = Cardinality.Scalar+              , format = Some (FieldFormat.UriWithScheme "mori")+              }+            , -- No `planned`: a capability that does not exist yet is an+              -- improvement request. See the header.+              FieldRule::{+              , field = "status"+              , description = Some+                  "Whether a consumer can use this capability right now."+              , allowedValues = [ "shipped", "deprecated", "withdrawn" ]+              , cardinality = Cardinality.Scalar+              }+            , FieldRule::{+              , field = "stability"+              , description = Some+                  "Compatibility promise. `experimental` may change without a major bump."+              , allowedValues = [ "experimental", "stable" ]+              , cardinality = Cardinality.Scalar+              }+            , scalar+                "since"+                "Released version in which this first became available to a consumer. `unreleased` when it exists only on the default branch."+            , list+                "packages"+                "Packages, artifacts, or deployables a consumer depends on to get this capability."+            , evidence+            , -- Demanded only once the capability is on its way out: a retirement+              -- with no forward path is the failure mode worth catching, and a+              -- live capability has nothing to say here.+              --+              -- This rule lives in `required` rather than `optional` because okf+              -- rejects a `when` condition on an optional field: `when` gates a+              -- presence demand, and `optional` makes no demand to gate.+              -- Conditionally-required is spelled `required` + `when`.+                  capabilityReference+                    "replacedBy"+                    "Where a consumer should go instead. Demanded once `status` is `deprecated` or `withdrawn`."+              //  { when = Some { field = "status"+                                , hasValue = [ "deprecated", "withdrawn" ]+                                }+                  }+            ]+          , recommended =+            [ list+                "interface"+                "Entry points a consumer actually touches: module names, endpoints, or commands."+            ]+          , optional =+            [ -- okf derives concept-to-concept graph edges from Markdown *body*+              -- links only; frontmatter is preserved and checked but never+              -- becomes an edge. A `requires` entry that is not also a body link+              -- validates cleanly and is invisible to `okf graph`. Declare each+              -- requirement twice: here, where it is typed and can name an+              -- external Mori URI, and as a body link, where it becomes an edge.+              -- okf cannot enforce the mirror; a repository-local check should.+              capabilityReference+                "requires"+                "Capabilities this one builds on, as local CAP-N handles or external Mori capability URIs. Mirror each entry as a body link so it becomes a graph edge."+            ]+          }+        , pathPattern = Some "*"+        , idPrefix = Some "CAP"+        }+      ]+    }
+ test/fixtures/catalogue/profiles/coordination/improvement-requests.dhall view
@@ -0,0 +1,156 @@+--| Profile for cross-repository improvement requests with stable IR-N handles.+let Profile = ../../Profile/Type.dhall++let FrontmatterRules = ../../Profile/FrontmatterRules.dhall++let TypeRule = ../../Profile/TypeRule.dhall++let okf = ../../Profile/okf.dhall++let FieldRule = okf.defaults.FieldRule++let HandleReferenceRule = okf.defaults.HandleReferenceRule++let Cardinality = okf.Cardinality++let FieldFormat = okf.FieldFormat++let reviewRule = ../../Profile/ReviewRule.dhall++let v02 = ../../Profile/V02.dhall++let condition =+      \(field : Text) -> \(hasValue : List Text) -> { field, hasValue }++let scalar =+      \(name : Text) ->+      \(description : Text) ->+        FieldRule::{+        , field = name+        , description = Some description+        , cardinality = Cardinality.Scalar+        }++in  Profile::{+    , name = "cross-repository-improvement-requests"+    , description = Some+        "Cross-repository improvement proposals with stable IR handles and review provenance. The house `reviews` family and OKF `verified` coexist: `reviews` records far more than `verified` can, so an approving `reviews` entry should also be mirrored into `verified` to keep the derived trust tier accurate."+    , frontmatter = FrontmatterRules::{+      , required =+        [ scalar "type" "The Improvement Request concept type."+        , scalar "title" "Short statement of the requested improvement."+        , scalar+            "description"+            "Concise explanation of the problem and desired outcome."+        ,     v02.generated+          //  { description = Some+                  "§5.2. Who produced this request's current content, and when."+              }+        , FieldRule::{+          , field = "requestId"+          , description = Some "Bundle-scoped stable IR-N handle."+          , cardinality = Cardinality.Scalar+          , format = Some (FieldFormat.DocumentHandle "IR")+          }+        , FieldRule::{+          , field = "status"+          , description = Some "Lifecycle decision for the request."+          , allowedValues =+            [ "proposed"+            , "accepted"+            , "in-progress"+            , "completed"+            , "rejected"+            , "withdrawn"+            , "superseded"+            ]+          , cardinality = Cardinality.Scalar+          }+        , FieldRule::{+          , field = "origin"+          , description = Some+              "Mori URI of the project or artifact raising the request."+          , cardinality = Cardinality.Scalar+          , format = Some (FieldFormat.UriWithScheme "mori")+          }+        , FieldRule::{+          , field = "completedAt"+          , description = Some+              "UTC time at which acceptance evidence proved the request complete."+          , cardinality = Cardinality.Scalar+          , format = Some FieldFormat.Rfc3339Utc+          , when = Some (condition "status" [ "completed" ])+          }+        , FieldRule::{+          , field = "supersededBy"+          , description = Some "Later request that replaces this request."+          , cardinality = Cardinality.Scalar+          , reference = Some HandleReferenceRule::{+            , localPrefix = "IR"+            , externalUriSchemes = [ "mori" ]+            }+          , when = Some (condition "status" [ "superseded" ])+          }+        ]+      , -- `reviews` is the only unconditional recommendation left: a coordination+        -- corpus that records no review provenance at all is deficient, and+        -- `--strict` should say so. `resolution` is conditional, so it is only+        -- demanded once a request reaches a terminal state — a proposed request+        -- with no resolution is not reported.+        recommended =+        [ reviewRule+        , FieldRule::{+          , field = "resolution"+          , description = Some+              "Evidence or rationale recorded when a request reaches a terminal state."+          , cardinality = Cardinality.Scalar+          , when = Some+              ( condition+                  "status"+                  [ "completed", "rejected", "withdrawn", "superseded" ]+              )+          }+        ]+      , optional =+        [ -- Ordinarily absent: a request that has not yet been planned has no+          -- target plan, so demanding it under `--strict` would report a normal+          -- state as a deficiency.+          FieldRule::{+          , field = "targetPlan"+          , description = Some+              "Repository-relative path or Mori URI of the implementation plan."+          , cardinality = Cardinality.Scalar+          }+        ,     v02.verified+          //  { description = Some+                  "§5.2. Independent confirmations that this request is accurate. Mirror an approving `reviews` entry here."+              }+        , -- The superseded v0.1 key. okf reads it whenever `generated` is+          -- absent, so an unmigrated corpus keeps validating; `optional` means+          -- its absence is never reported while its format is still checked+          -- whenever it is present. Declaring `okfVersion = "0.2"` with this+          -- rule in `required` or `recommended` is a hard profile load failure.+              v02.legacyTimestamp+          //  { description = Some+                  "Superseded v0.1 revision timestamp. Prefer `generated.at`."+              }+        ]+      }+    , -- The house `status` key above keeps its request lifecycle vocabulary and+      -- deliberately does not adopt OKF v0.2 §5.4's draft/stable/deprecated, nor+      -- `stale_after`. See the header of ../../Profile/V02.dhall for the policy+      -- and its reasoning.+      okfVersion = "0.2"+    , requireBundleVersion = Some "0.2"+    , allowUnknownTypes = False+    , idField = Some "requestId"+    , types =+      [ TypeRule::{+        , type = "Improvement Request"+        , description = Some+            "A request whose implementation may span repository ownership boundaries."+        , pathPattern = Some "*"+        , idPrefix = Some "IR"+        }+      ]+    }
+ test/fixtures/catalogue/profiles/coordination/package.dhall view
@@ -0,0 +1,12 @@+--| Reusable coordination profiles.+--+-- Three of them form one triangle: a use case states what a consumer needs, a+-- capability states what a producer provides, and an improvement request states+-- the gap between them. A bug report is the fourth corner: a capability that is+-- claimed but does not hold. Behavior that was never provided is an improvement+-- request rather than a bug, which is the line that keeps the two apart.+{ bugReports = ./bug-reports.dhall+, capabilities = ./capabilities.dhall+, improvementRequests = ./improvement-requests.dhall+, useCases = ./use-cases.dhall+}
+ test/fixtures/catalogue/profiles/coordination/use-cases.dhall view
@@ -0,0 +1,234 @@+--| Profile for JTBD use cases connected to repository-owned feature work.+let Profile = ../../Profile/Type.dhall++let FrontmatterRules = ../../Profile/FrontmatterRules.dhall++let TypeRule = ../../Profile/TypeRule.dhall++let okf = ../../Profile/okf.dhall++let FieldRule = okf.defaults.FieldRule++let NestedFieldRule = okf.defaults.NestedFieldRule++let HandleReferenceRule = okf.defaults.HandleReferenceRule++let Cardinality = okf.Cardinality++let FieldFormat = okf.FieldFormat++let reviewRule = ../../Profile/ReviewRule.dhall++let v02 = ../../Profile/V02.dhall++let scalar =+      \(name : Text) ->+      \(description : Text) ->+        FieldRule::{+        , field = name+        , description = Some description+        , cardinality = Cardinality.Scalar+        }++let nestedScalar =+      \(name : Text) ->+      \(description : Text) ->+        NestedFieldRule::{+        , field = name+        , description = Some description+        , cardinality = Cardinality.Scalar+        }++let moriList =+      \(name : Text) ->+      \(description : Text) ->+        NestedFieldRule::{+        , field = name+        , description = Some description+        , cardinality = Cardinality.List+        , format = Some (FieldFormat.UriWithScheme "mori")+        }++let jobs =+      FieldRule::{+      , field = "jobs"+      , description = Some+          "Jobs-to-be-Done statements describing the actor, situation, desired progress, and observable outcome."+      , cardinality = Cardinality.List+      , elementFields = Some+        { required =+          [ nestedScalar "name" "Stable name for this job within the use case."+          , nestedScalar "actor" "Person, role, or agent trying to make progress."+          , nestedScalar "situation" "Circumstance in which the job arises."+          , nestedScalar "motivation" "Progress the actor wants to make."+          , nestedScalar "outcome" "Observable result that satisfies the job."+          ]+        , recommended = [] : List NestedFieldRule.Type+        , optional = [] : List NestedFieldRule.Type+        }+      }++let features =+      FieldRule::{+      , field = "features"+      , description = Some+          "Capabilities whose delivery makes the use case possible, with ownership and request tracking."+      , cardinality = Cardinality.List+      , elementFields = Some+        { required =+          [ nestedScalar "name" "Stable feature name within the use case."+          , nestedScalar "description" "Capability or behavior the feature supplies."+          , NestedFieldRule::{+            , field = "status"+            , description = Some "Current delivery state of the feature."+            , allowedValues =+              [ "discovered"+              , "planned"+              , "in-progress"+              , "delivered"+              , "blocked"+              , "deferred"+              ]+            , cardinality = Cardinality.Scalar+            }+          , moriList "owners" "Mori project URIs accountable for delivering the feature."+          , nestedScalar "acceptance" "Observable evidence that proves the feature is delivered."+          ]+        , recommended = [] : List NestedFieldRule.Type+        , optional =+          [ NestedFieldRule::{+            , field = "jobs"+            , description = Some "Names of the JTBD records this feature advances."+            , cardinality = Cardinality.List+            }+          , moriList+              "improvementRequests"+              "Stable Mori concept URIs of repository-owned requests delivering this feature."+          ]+        }+      }++in  Profile::{+    , name = "jtbd-use-cases"+    , description = Some+        "Jobs-to-be-Done use cases connected to typed feature delivery and repository-owned improvement requests. The house `reviews` family and OKF `verified` coexist: `reviews` records far more than `verified` can, so an approving `reviews` entry should also be mirrored into `verified` to keep the derived trust tier accurate."+    , frontmatter = FrontmatterRules::{+      , required =+        [ scalar "type" "The Use Case or Use Case Theme concept type."+        , scalar "title" "Human-readable title."+        , scalar "description" "Concise statement of the use case or theme."+        , -- Profile-wide, not inside the `Use Case` type rule: a theme concept+          -- is a document like any other and should record its producer too.+              v02.generated+          //  { description = Some+                  "§5.2. Who produced this use case or theme's current content, and when."+              }+        ]+      , recommended = [ reviewRule ]+      , optional =+        [ FieldRule::{+          , field = "tags"+          , description = Some "Producer-defined search and grouping tags."+          , cardinality = Cardinality.List+          }+        , FieldRule::{+          , field = "links"+          , description = Some "Additional navigation links retained as producer metadata."+          , cardinality = Cardinality.List+          }+        ,     v02.verified+          //  { description = Some+                  "§5.2. Independent confirmations that this content is accurate. Mirror an approving `reviews` entry here."+              }+        , -- The superseded v0.1 key. okf reads it whenever `generated` is+          -- absent, so an unmigrated corpus keeps validating; `optional` means+          -- its absence is never reported while its format is still checked+          -- whenever it is present. Declaring `okfVersion = "0.2"` with this+          -- rule in `required` or `recommended` is a hard profile load failure.+              v02.legacyTimestamp+          //  { description = Some+                  "Superseded v0.1 revision timestamp. Prefer `generated.at`."+              }+        ]+      }+    , -- The `Use Case` type rule's house `status` key keeps its delivery+      -- lifecycle vocabulary and deliberately does not adopt OKF v0.2 §5.4's+      -- draft/stable/deprecated, nor `stale_after`. Its allowing `draft` is a+      -- coincidence, not partial conformance. See the header of+      -- ../../Profile/V02.dhall for the policy and its reasoning.+      okfVersion = "0.2"+    , requireBundleVersion = Some "0.2"+    , allowUnknownTypes = False+    , idField = Some "useCaseId"+    , types =+      [ TypeRule::{+        , type = "Use Case"+        , description = Some+            "A user-value scenario expressed as JTBD records and the features needed to deliver it."+        , frontmatter = FrontmatterRules::{+          , required =+            [ FieldRule::{+              , field = "useCaseId"+              , description = Some "Bundle-scoped stable UC-N handle."+              , cardinality = Cardinality.Scalar+              , format = Some (FieldFormat.DocumentHandle "UC")+              }+            , FieldRule::{+              , field = "status"+              , description = Some "Lifecycle state of the use case."+              , allowedValues =+                [ "draft"+                , "validated"+                , "planned"+                , "in-progress"+                , "delivered"+                , "retired"+                ]+              , cardinality = Cardinality.Scalar+              }+            , FieldRule::{+              , field = "origin"+              , description = Some "Mori project URI that owns this use case."+              , cardinality = Cardinality.Scalar+              , format = Some (FieldFormat.UriWithScheme "mori")+              }+            , jobs+            , features+            ]+          , recommended =+            [ FieldRule::{+              , field = "themes"+              , description = Some "Theme slugs mirrored by body links to theme concepts."+              , cardinality = Cardinality.List+              }+            ]+          , optional =+            [ FieldRule::{+              , field = "improvementRequests"+              , description = Some+                  "Stable Mori request URIs; mirror the union of feature-level request references."+              , cardinality = Cardinality.List+              , format = Some (FieldFormat.UriWithScheme "mori")+              }+            , FieldRule::{+              , field = "relatedUseCases"+              , description = Some "Related local UC handles or external Mori use-case URIs."+              , cardinality = Cardinality.List+              , reference = Some HandleReferenceRule::{+                , localPrefix = "UC"+                , externalUriSchemes = [ "mori" ]+                }+              }+            ]+          }+        , pathPattern = Some "*"+        , idPrefix = Some "UC"+        }+      , TypeRule::{+        , type = "Use Case Theme"+        , description = Some+            "A reusable business or product theme referenced by use cases in this bundle."+        , pathPattern = Some "themes/*"+        }+      ]+    }
+ test/fixtures/catalogue/profiles/documentation/architecture-decisions.dhall view
@@ -0,0 +1,115 @@+--| Profile for repository-owned Architecture Decision Records with stable ADR-N handles.+let Profile = ../../Profile/Type.dhall++let FrontmatterRules = ../../Profile/FrontmatterRules.dhall++let TypeRule = ../../Profile/TypeRule.dhall++let okf = ../../Profile/okf.dhall++let FieldRule = okf.defaults.FieldRule++let HandleReferenceRule = okf.defaults.HandleReferenceRule++let Cardinality = okf.Cardinality++let FieldFormat = okf.FieldFormat++let v02 = ../../Profile/V02.dhall++let scalar =+      \(name : Text) ->+      \(description : Text) ->+        FieldRule::{+        , field = name+        , description = Some description+        , cardinality = Cardinality.Scalar+        }++in  Profile::{+    , name = "architecture-decision-records"+    , description = Some+        "Flat repository-owned architecture decisions with stable ADR handles."+    , frontmatter = FrontmatterRules::{+      , required =+        [ scalar "type" "The Architecture Decision Record concept type."+        , scalar "title" "Decision title without the ADR number."+        , FieldRule::{+          , field = "docId"+          , description = Some "Bundle-scoped stable ADR-N handle."+          , cardinality = Cardinality.Scalar+          , format = Some (FieldFormat.DocumentHandle "ADR")+          }+        , scalar "status" "Repository-native decision status."+        , FieldRule::{+          , field = "date"+          , description = Some "Original calendar date of the decision."+          , cardinality = Cardinality.Scalar+          , format = Some FieldFormat.Date+          }+        , scalar "description" "One-sentence summary of the decision."+        ,     v02.generated+          //  { description = Some+                  "§5.2. Who produced this decision record's current content, and when."+              }+        ]+      , -- Nothing is recommended. Under `--strict` a recommended-and-absent+        -- field is an error, and the three provenance fields below are absent+        -- from essentially every real ADR corpus: a live decision that has never+        -- been superseded has nothing to record. They are `optional` instead, so+        -- their reference constraints still apply whenever they are present.+        recommended = [] : List FieldRule.Type+      , optional =+        [ FieldRule::{+          , field = "supersedes"+          , description = Some "Earlier ADR handles replaced by this decision."+          , reference = Some HandleReferenceRule::{+            , localPrefix = "ADR"+            , externalUriSchemes = [ "mori" ]+            }+          }+        , FieldRule::{+          , field = "supersededBy"+          , description = Some "Later ADR handle replacing this decision."+          , cardinality = Cardinality.Scalar+          , reference = Some HandleReferenceRule::{+            , localPrefix = "ADR"+            , externalUriSchemes = [ "mori" ]+            }+          }+        , scalar+            "originatingPlan"+            "Plan that produced the decision, when recorded."+        ,     v02.verified+          //  { description = Some+                  "§5.2. Independent confirmations that this decision record is accurate."+              }+        , -- The superseded v0.1 key. okf reads it whenever `generated` is+          -- absent, so an unmigrated corpus keeps validating; `optional` means+          -- its absence is never reported while its format is still checked+          -- whenever it is present. Declaring `okfVersion = "0.2"` with this+          -- rule in `required` or `recommended` is a hard profile load failure.+              v02.legacyTimestamp+          //  { description = Some+                  "Superseded v0.1 revision timestamp. Prefer `generated.at`."+              }+        ]+      }+    , -- The house `status` key above keeps its repository-native vocabulary and+      -- deliberately does not adopt OKF v0.2 §5.4's draft/stable/deprecated, nor+      -- `stale_after`. See the header of ../../Profile/V02.dhall for the policy+      -- and its reasoning.+      okfVersion = "0.2"+    , requireBundleVersion = Some "0.2"+    , allowUnknownTypes = False+    , idField = Some "docId"+    , types =+      [ TypeRule::{+        , type = "Architecture Decision Record"+        , description = Some+            "A durable record of one architecture decision and its rationale."+        , pathPattern = Some "*"+        , idPrefix = Some "ADR"+        }+      ]+    }
+ test/fixtures/catalogue/profiles/documentation/package.dhall view
@@ -0,0 +1,5 @@+--| Reusable documentation profiles.+{ architectureDecisions = ./architecture-decisions.dhall+, patternCatalog = ./pattern-catalog.dhall+, researchDocuments = ./research-documents.dhall+}
+ test/fixtures/catalogue/profiles/documentation/pattern-catalog.dhall view
@@ -0,0 +1,113 @@+--| Profile for a Mori-addressable catalog of implementation patterns and standards.+let Profile = ../../Profile/Type.dhall++let FrontmatterRules = ../../Profile/FrontmatterRules.dhall++let TypeRule = ../../Profile/TypeRule.dhall++let okf = ../../Profile/okf.dhall++let FieldRule = okf.defaults.FieldRule++let Cardinality = okf.Cardinality++let FieldFormat = okf.FieldFormat++let v02 = ../../Profile/V02.dhall++let scalar =+      \(name : Text) ->+      \(description : Text) ->+        FieldRule::{+        , field = name+        , description = Some description+        , cardinality = Cardinality.Scalar+        }++let rule =+      \(conceptType : Text) ->+      \(path : Text) ->+        TypeRule::{+        , type = conceptType+        , description = Some ("A catalog " ++ conceptType ++ " document.")+        , pathPattern = Some path+        , resourceScheme = Some "mori"+        }++in  Profile::{+    , name = "mori-documentation-pattern-catalog"+    , description = Some+        "Mori-addressable implementation patterns, standards, guides, and operational documentation."+    , frontmatter = FrontmatterRules::{+      , required =+        [ scalar "type" "The documentation category governed by a type rule."+        , scalar "title" "Human-readable document title."+        , scalar "description" "Concise statement of the document's purpose."+        ,     v02.generated+          //  { description = Some+                  "§5.2. Who produced this document's current content, and when."+              }+        , FieldRule::{+          , field = "resource"+          , description = Some "Canonical Mori URI for this document."+          , cardinality = Cardinality.Scalar+          , format = Some (FieldFormat.UriWithScheme "mori")+          }+        , FieldRule::{+          , field = "tags"+          , description = Some "Search and discovery terms."+          , cardinality = Cardinality.List+          }+        , FieldRule::{+          , field = "status"+          , description = Some "Publication state of this guidance."+          , allowedValues = [ "current", "deprecated" ]+          , cardinality = Cardinality.Scalar+          }+        ]+      , -- Nothing is recommended. Under `--strict` a recommended-and-absent+        -- field is an error, and both fields below are ordinarily absent: most+        -- catalog documents supersede nothing and cite no external source.+        recommended = [] : List FieldRule.Type+      , optional =+        [ -- Was a bare list of URI strings; now the OKF v0.2 §5.1+          -- list-of-records shape, where the former URI becomes each entry's+          -- required `resource` member. This is breaking for a consumer corpus.+          --+          -- Note this is unrelated to the top-level `resource` key above, which+          -- is OKF §4.1's canonical Mori URI for the document itself.+          v02.sources+        , FieldRule::{+          , field = "supersedes"+          , description = Some "Earlier guidance replaced by this document."+          }+        ,     v02.verified+          //  { description = Some+                  "§5.2. Independent confirmations that this guidance is accurate."+              }+        , -- The superseded v0.1 key, kept so an unmigrated catalog keeps+          -- validating. `optional` means its absence is never reported while its+          -- format is still checked whenever it is present.+              v02.legacyTimestamp+          //  { description = Some+                  "Superseded v0.1 revision timestamp. Prefer `generated.at`."+              }+        ]+      }+    , -- The house `status` key above keeps its `current`/`deprecated`+      -- vocabulary and deliberately does not adopt OKF v0.2 §5.4's+      -- draft/stable/deprecated, nor `stale_after`. See the header of+      -- ../../Profile/V02.dhall for the policy and its reasoning.+      okfVersion = "0.2"+    , requireBundleVersion = Some "0.2"+    , types =+      [ rule "Navigation" "getting-started"+      , rule "Overview" "*/overview"+      , rule "Standard" "*/**"+      , rule "Guide" "*/**"+      , rule "Pattern" "*/**"+      , rule "Runbook" "*/**"+      , rule "Reference" "*/**"+      , rule "Gotcha" "*/**"+      ]+    }
+ test/fixtures/catalogue/profiles/documentation/research-documents.dhall view
@@ -0,0 +1,139 @@+--| Profile for repository-owned research documents with stable RES-N handles.+let Profile = ../../Profile/Type.dhall++let FrontmatterRules = ../../Profile/FrontmatterRules.dhall++let TypeRule = ../../Profile/TypeRule.dhall++let okf = ../../Profile/okf.dhall++let FieldRule = okf.defaults.FieldRule++let HandleReferenceRule = okf.defaults.HandleReferenceRule++let Cardinality = okf.Cardinality++let FieldFormat = okf.FieldFormat++let reviewRule = ../../Profile/ReviewRule.dhall++let v02 = ../../Profile/V02.dhall++let scalar =+      \(name : Text) ->+      \(description : Text) ->+        FieldRule::{+        , field = name+        , description = Some description+        , cardinality = Cardinality.Scalar+        }++in  Profile::{+    , name = "research-documents"+    , description = Some+        "Repository-owned research records with stable RES handles and structured review provenance. The house `reviews` family and OKF `verified` coexist: `reviews` records far more than `verified` can, so an approving `reviews` entry should also be mirrored into `verified` to keep the derived trust tier accurate."+    , frontmatter = FrontmatterRules::{+      , required =+        [ scalar "type" "The Research Document concept type."+        , scalar "title" "Human-readable research title."+        , scalar "description" "Concise statement of the research purpose."+        ,     v02.generated+          //  { description = Some+                  "§5.2. Who produced this research record's current content, and when."+              }+        , FieldRule::{+          , field = "researchId"+          , description = Some "Bundle-scoped stable RES-N handle."+          , cardinality = Cardinality.Scalar+          , format = Some (FieldFormat.DocumentHandle "RES")+          }+        , FieldRule::{+          , field = "status"+          , description = Some "Lifecycle state of the research record."+          , allowedValues = [ "active", "complete", "superseded" ]+          , cardinality = Cardinality.Scalar+          }+        , scalar+            "scope"+            "Question boundary and evidence considered by the research."+        , FieldRule::{+          , field = "supersededBy"+          , description = Some "Later research replacing this record."+          , cardinality = Cardinality.Scalar+          , reference = Some HandleReferenceRule::{+            , localPrefix = "RES"+            , externalUriSchemes = [ "mori" ]+            }+          , when = Some { field = "status", hasValue = [ "superseded" ] }+          }+        ]+      , -- `reviews` stays RECOMMENDED, alone among the fields that were+        -- recommended before this migration. Research is the one corpus here+        -- where review provenance is part of the work rather than incidental+        -- metadata, so a research record that nobody reviewed is genuinely+        -- worth reporting under `--strict`. The others below moved to+        -- `optional`, where absence is ordinary rather than deficient.+        recommended = [ reviewRule ]+      , optional =+        [ -- Was a bare list of URI strings; now the OKF v0.2 §5.1+          -- list-of-records shape, where the former URI becomes each entry's+          -- required `resource` member. This is breaking for a consumer corpus.+              v02.sources+          //  { description = Some "§5.1. Evidence sources used by the research."+              }+        , FieldRule::{+          , field = "relatedPlans"+          , description = Some "Plans informed by this research."+          , cardinality = Cardinality.List+          }+        , FieldRule::{+          , field = "relatedDecisions"+          , description = Some+              "Architecture decisions informed by this research."+          , cardinality = Cardinality.List+          }+        , FieldRule::{+          , field = "supersedes"+          , description = Some "Earlier research replaced by this record."+          , reference = Some HandleReferenceRule::{+            , localPrefix = "RES"+            , externalUriSchemes = [ "mori" ]+            }+          }+        , -- Coexists with the house `reviews` family above rather than+          -- replacing it: `reviews` records reviewer identity, scope, outcome,+          -- provider, model, effort, and evidence context, while `verified`+          -- records only `by` and `at`. Neither is a superset. Mirror an+          -- approving `reviews` entry into `verified` so `okf trust` reports+          -- the right tier.+              v02.verified+          //  { description = Some+                  "§5.2. Independent confirmations that this research is accurate. Mirror approving `reviews` entries here."+              }+        , -- The superseded v0.1 key, kept so an unmigrated corpus keeps+          -- validating. `optional` means its absence is never reported while+          -- its format is still checked whenever it is present.+              v02.legacyTimestamp+          //  { description = Some+                  "Superseded v0.1 revision timestamp. Prefer `generated.at`."+              }+        ]+      }+    , -- The house `status` key above keeps its+      -- `active`/`complete`/`superseded` vocabulary and deliberately does not+      -- adopt OKF v0.2 §5.4's draft/stable/deprecated, nor `stale_after`. See+      -- the header of ../../Profile/V02.dhall for the policy and its reasoning.+      okfVersion = "0.2"+    , requireBundleVersion = Some "0.2"+    , allowUnknownTypes = False+    , idField = Some "researchId"+    , types =+      [ TypeRule::{+        , type = "Research Document"+        , description = Some+            "A durable record of evidence, alternatives, and conclusions within a bounded scope."+        , pathPattern = Some "**"+        , idPrefix = Some "RES"+        }+      ]+    }
+ test/fixtures/catalogue/profiles/okf-v0-2.dhall view
@@ -0,0 +1,90 @@+--| A reference profile for the OKF v0.2 frontmatter families.+--+-- Point `--profile` at it to check that a bundle's v0.2 families are well+-- formed, without authoring a profile of your own first:+--+--     okf validate BUNDLE --profile <this file> --strict+--+-- Exported from this repository's root package as `okfV02`, so a consumer pins+-- it by URL like any other profile in the catalog:+--+--     let okf = https://raw.githubusercontent.com/shinzui/okf-profiles/v0.8.0/package.dhall+--                 sha256:…+--+--     in  okf.okfV02+--+-- This is a *format-level* profile, not a house profile. It says how the v0.2+-- families must look when they are present and says nothing about which concept+-- types a team has, so `allowUnknownTypes` and `allowUnknownFields` are both+-- True and there are no type rules at all. Every other profile in this catalog+-- is a house profile and adds those; this one would be wrong to.+--+-- Profiles are not part of the Open Knowledge Format. A bundle that deviates+-- from this file is still fully OKF-conformant, and okf reports deviations as+-- advisories unless `--profile-enforce` is passed. What this file encodes is the+-- specification's own shape rules, not an additional layer of conformance.+--+-- The rules themselves live in `../Profile/V02.dhall`, shared with the house+-- profiles in this catalog so a correction lands in one place. Read that file's+-- header for the two catalog-wide policies on the `status` key and on the house+-- `reviews` family; neither applies here, because this profile has no house+-- conventions to collide with.+let Profile = ../Profile/Type.dhall++let TypeRule = ../Profile/TypeRule.dhall++let FrontmatterRules = ../Profile/FrontmatterRules.dhall++let okf = ../Profile/okf.dhall++let field = okf.mk.FieldRule++let v02 = ../Profile/V02.dhall++in  Profile::{+    , name = "okf-v0-2"+    , description = Some+        "Reference profile for the OKF v0.2 frontmatter families: provenance, trust, lifecycle, and sources."+    , okfVersion = "0.2"+    , frontmatter = FrontmatterRules::{+      , required =+        [ field.documented+            "type"+            "The concept type. This profile constrains no vocabulary, because OKF defines no fixed taxonomy and requires consumers to tolerate unknown types."+        , field.documented+            "title"+            "Human-readable name of the concept, as a reader would say it."+        , field.documented+            "description"+            "One or two sentences on what this concept is."+        , v02.generated+        ]+      , -- Nothing is recommended: every rule here is either required by this+        -- profile or optional per §11. `FrontmatterRules` defaults this to the+        -- empty list, but naming it says the emptiness is a decision.+        recommended = [] : List okf.defaults.FieldRule.Type+      , optional =+        [ -- All five are OPTIONAL deliberately. §11 forbids treating a missing+          -- optional family as a deficiency, so a reference profile that made+          -- `--strict` complain about an absent `verified` or `sources` would+          -- advise the opposite of the specification. A team that wants one of+          -- them demanded moves it to `required` or `recommended` in their own+          -- profile.+          v02.verified+        , v02.status+        , v02.staleAfter+        , v02.sources+        , v02.usageWindow+        ]+      }+    , allowUnknownTypes = True+    , allowUnknownFields = True+    , idField = None Text+    , -- Deliberately demanding nothing, for the same reason the families above+      -- are optional. §12 makes a bundle's `okf_version` declaration a MAY, so a+      -- format-level reference profile that required one would advise the+      -- opposite of the specification. The house profiles in this catalog have+      -- finished migrating and do write `Some "0.2"` here.+      requireBundleVersion = None Text+    , types = [] : List TypeRule.Type+    }
+ test/fixtures/catalogue/profiles/postgresql.dhall view
@@ -0,0 +1,129 @@+--| House profile for representing PostgreSQL database schemas as OKF bundles.+--+-- Conventions encoded here:+--+-- * `type:` vocabulary — `PostgreSQL Schema`, `PostgreSQL Table`, `PostgreSQL View`.+-- * Layout — schemas at `schemas/<schema>`, tables at `schemas/<schema>/tables/<table>`,+--   views at `schemas/<schema>/views/<view>`.+-- * `resource:` — a `postgresql://` URI on every concept.+-- * Tables and views carry a `# Schema` section; tables list+--   Column / Type / Nullable / Description, views Column / Type / Description.+--+-- Built with record completion (`Profile::{…}`, `TypeRule::{…}`): unset fields take+-- the schema defaults, so this value survives backward-compatible schema growth.+let Profile = ../Profile/Type.dhall++let TypeRule = ../Profile/TypeRule.dhall++let okf = ../Profile/okf.dhall++let FieldRule = okf.defaults.FieldRule++let Cardinality = okf.Cardinality++let FieldFormat = okf.FieldFormat++let v02 = ../Profile/V02.dhall++let scalar =+      \(name : Text) ->+      \(description : Text) ->+        FieldRule::{+        , field = name+        , description = Some description+        , cardinality = Cardinality.Scalar+        }++in  Profile::{+    , name = "shinzui-postgresql"+    , description = Some+        "Conventions for documenting PostgreSQL schemas, tables, and views as an OKF bundle. Targets OKF v0.2: provenance goes in `generated`, independent confirmation in `verified`, and lifecycle in `status` and `stale_after` — a database description decays whether or not anyone edits it."+    , frontmatter =+      { required =+        [ scalar+            "type"+            "The exact PostgreSQL concept type governed by this profile."+        , scalar "title" "Human-readable name of the database object."+        ]+      , -- `generated` is recommended rather than required, beside `description`+        -- and `resource`. This is the most permissive profile in the catalog by+        -- design — a large database is documented incrementally and a+        -- partially-documented bundle is still useful — so promoting provenance+        -- to required would invert that stance for one key. okf's own migrated+        -- `docs/profiles/postgresql.dhall` makes the same choice.+        recommended =+        [ scalar+            "description"+            "One or two sentences explaining the object's purpose."+        ,     v02.generated+          //  { description = Some+                  "§5.2. Who or what produced this description, and when it was last confirmed accurate."+              }+        , FieldRule::{+          , field = "resource"+          , description = Some "postgresql:// URI locating the live object."+          , cardinality = Cardinality.Scalar+          , format = Some (FieldFormat.UriWithScheme "postgresql")+          }+        ]+      , -- Unlike the profiles that carry a house lifecycle vocabulary on the+        -- `status` key, neither PostgreSQL profile declares one, so there is no+        -- collision and OKF v0.2 §5.4 `status` and §5.5 `stale_after` are+        -- adopted in full. See the header of ../Profile/V02.dhall for the policy,+        -- the current list, and why those profiles take the opposite branch.+        optional =+        [     v02.verified+          //  { description = Some+                  "§5.2. Independent confirmations that this description still matches the live object."+              }+        , v02.status+        ,     v02.staleAfter+          //  { description = Some+                  "§5.5. Date after which this description should be re-confirmed against the live object."+              }+        , -- The superseded v0.1 key. okf reads it whenever `generated` is+          -- absent, so an unmigrated corpus keeps validating; `optional` means+          -- its absence is never reported while its format is still checked+          -- whenever it is present. Declaring `okfVersion = "0.2"` with this+          -- rule in `required` or `recommended` is a hard profile load failure.+              v02.legacyTimestamp+          //  { description = Some+                  "Superseded v0.1 confirmation timestamp. Prefer `generated.at`."+              }+        ]+      }+    , okfVersion = "0.2"+    , -- A house convention, not a rule of the format: specification §12 makes+      -- the bundle's `okf_version` declaration a MAY, so okf never demands one.+      -- This profile's rules are written for v0.2, so a bundle it governs should+      -- say it is a v0.2 bundle. Write it with+      -- `okf index BUNDLE --write --okf-version 0.2`.+      requireBundleVersion = Some "0.2"+    , allowUnknownTypes = False+    , types =+      [ TypeRule::{+        , type = "PostgreSQL Schema"+        , description = Some+            "One PostgreSQL namespace and the objects it groups."+        , pathPattern = Some "schemas/*"+        , resourceScheme = Some "postgresql"+        }+      , TypeRule::{+        , type = "PostgreSQL Table"+        , description = Some+            "One physical table, including its column contract."+        , pathPattern = Some "schemas/*/tables/*"+        , resourceScheme = Some "postgresql"+        , requireSchemaSection = True+        , schemaColumns = [ "Column", "Type", "Nullable", "Description" ]+        }+      , TypeRule::{+        , type = "PostgreSQL View"+        , description = Some "One view and the columns it projects."+        , pathPattern = Some "schemas/*/views/*"+        , resourceScheme = Some "postgresql"+        , requireSchemaSection = True+        , schemaColumns = [ "Column", "Type", "Description" ]+        }+      ]+    }
+ test/fixtures/catalogue/profiles/tan-postgresql.dhall view
@@ -0,0 +1,102 @@+--| House profile for tan PostgreSQL databases as OKF bundles.+--+-- Extends the shared `shinzui-postgresql` profile (schemas, tables, views) with one extra+-- type that the base profile lacks:+--+-- * `Event Stream` — an abstract event-sourcing stream (aggregate category) at+--   `streams/<category>`. No `resource:` scheme (it is not a single physical table); it is+--   a logical stream of events inside `message_store.messages`.+--+-- Read-model projections and scratch/backup tables are NOT separate types: they are+-- physically PostgreSQL tables (`type: PostgreSQL Table`, living under+-- `schemas/<schema>/tables/<table>`). Their role is recorded in frontmatter — a convention+-- this profile now validates with type-specific field rules:+--+--   derivation : projection | event-store | operational | scratch+--   lifecycle  : durable | ephemeral+--   domain     : true | false+--   sourceStreams : [<event-stream category>, …]   (when derivation = projection)+let Profile = ../Profile/Type.dhall++let TypeRule = ../Profile/TypeRule.dhall++let okf = ../Profile/okf.dhall++let FieldRule = okf.defaults.FieldRule++let Cardinality = okf.Cardinality++let base = ./postgresql.dhall++in        base+      //  { name = "tan-postgresql"+          , description = Some+              "Tan PostgreSQL conventions, including table roles and logical event streams."+          , types =+            [ TypeRule::{+              , type = "PostgreSQL Schema"+              , description = Some+                  "One PostgreSQL namespace and the objects it groups."+              , pathPattern = Some "schemas/*"+              , resourceScheme = Some "postgresql"+              }+            , TypeRule::{+              , type = "PostgreSQL Table"+              , description = Some+                  "One physical table classified by derivation, lifecycle, and domain role."+              , frontmatter =+                { required =+                  [ FieldRule::{+                    , field = "derivation"+                    , description = Some "How the table's data is produced."+                    , allowedValues =+                      [ "projection", "event-store", "operational", "scratch" ]+                    , cardinality = Cardinality.Scalar+                    }+                  , FieldRule::{+                    , field = "lifecycle"+                    , description = Some+                        "Whether the table is durable or disposable."+                    , allowedValues = [ "durable", "ephemeral" ]+                    , cardinality = Cardinality.Scalar+                    }+                  , FieldRule::{+                    , field = "domain"+                    , description = Some+                        "Whether the table stores domain state."+                    , cardinality = Cardinality.Scalar+                    }+                  , FieldRule::{+                    , field = "sourceStreams"+                    , description = Some+                        "Event-stream categories feeding a projection table."+                    , cardinality = Cardinality.List+                    , when = Some+                      { field = "derivation", hasValue = [ "projection" ] }+                    }+                  ]+                , recommended = [] : List FieldRule.Type+                , optional = [] : List FieldRule.Type+                }+              , pathPattern = Some "schemas/*/tables/*"+              , resourceScheme = Some "postgresql"+              , requireSchemaSection = True+              , schemaColumns = [ "Column", "Type", "Nullable", "Description" ]+              }+            , TypeRule::{+              , type = "PostgreSQL View"+              , description = Some "One view and the columns it projects."+              , pathPattern = Some "schemas/*/views/*"+              , resourceScheme = Some "postgresql"+              , requireSchemaSection = True+              , schemaColumns = [ "Column", "Type", "Description" ]+              }+            , TypeRule::{+              , type = "Event Stream"+              , description = Some+                  "One logical event-sourcing aggregate category."+              , pathPattern = Some "streams/*"+              }+            ]+          }+    : Profile.Type
+ test/fixtures/concept-filters/index.md view
@@ -0,0 +1,9 @@+---+okf_version: "0.2"+---++# Subdirectories++- [notes/](notes/index.md)+- [requests/](requests/index.md)+
+ test/fixtures/concept-filters/log.md view
@@ -0,0 +1,5 @@+# Bundle Update Log++## 2026-08-09++* **Addition**: Fixture bundle for concept listing and filtering.
+ test/fixtures/concept-filters/notes/index.md view
@@ -0,0 +1,4 @@+# Note++- [Scratch](scratch.md) - A concept of a different type that carries no status at all.+
+ test/fixtures/concept-filters/notes/scratch.md view
@@ -0,0 +1,10 @@+---+type: Note+title: Scratch+description: A concept of a different type that carries no status at all.+generated:+  by: human:nadeem+  at: "2026-08-09T00:00:00Z"+---++# Scratch
+ test/fixtures/concept-filters/requests/alpha.md view
@@ -0,0 +1,19 @@+---+type: Improvement Request+title: Alpha+description: An accepted request with two tags and one approving model review.+requestId: IR-1+status: accepted+tags:+  - profiles+  - cli+generated:+  by: process:fixture+  at: "2026-08-09T00:00:00Z"+reviews:+  - kind: model+    reviewer: openai-codex+    outcome: approved+---++# Alpha
+ test/fixtures/concept-filters/requests/beta.md view
@@ -0,0 +1,14 @@+---+type: Improvement Request+title: Beta+description: A proposed request with one tag and no reviews.+requestId: IR-2+status: proposed+tags:+  - cli+generated:+  by: human:nadeem+  at: "2026-08-09T00:00:00Z"+---++# Beta
+ test/fixtures/concept-filters/requests/gamma.md view
@@ -0,0 +1,20 @@+---+type: Improvement Request+title: Gamma+description: A completed request with a human review that asked for changes.+requestId: IR-3+status: completed+completedAt: "2026-08-09T00:00:00Z"+generated:+  by: process:fixture+  at: "2026-08-09T00:00:00Z"+reviews:+  - kind: human+    reviewer: human:nadeem+    outcome: changes-requested+  - kind: model+    reviewer: openai-codex+    outcome: approved+---++# Gamma
+ test/fixtures/concept-filters/requests/index.md view
@@ -0,0 +1,6 @@+# Improvement Request++- [Alpha](alpha.md) - An accepted request with two tags and one approving model review.+- [Beta](beta.md) - A proposed request with one tag and no reviews.+- [Gamma](gamma.md) - A completed request with a human review that asked for changes.+
+ test/fixtures/profile-discovery/.hidden/valid-hidden.dhall view
@@ -0,0 +1,2 @@+-- Hidden directories are excluded from bounded discovery.+../../profiles/decisions.dhall
+ test/fixtures/profile-discovery/deep/a/b/c/d/e/valid-too-deep.dhall view
@@ -0,0 +1,2 @@+-- The default depth four cannot reach this otherwise valid descriptor.+../../../../../../valid.dhall
+ test/fixtures/profile-discovery/dist-newstyle/valid-build-output.dhall view
@@ -0,0 +1,2 @@+-- Build-output directories are excluded even when they contain valid profiles.+../../profiles/decisions.dhall
+ test/fixtures/profile-discovery/ignored.txt view
@@ -0,0 +1,1 @@+This non-Dhall file is never evaluated.
+ test/fixtures/profile-discovery/invalid.dhall view
@@ -0,0 +1,1 @@+this is not valid Dhall
+ test/fixtures/profile-discovery/nested/valid-nested.dhall view
@@ -0,0 +1,2 @@+-- Descriptor discovery descends after finding a profile in the parent directory.+../../profiles/postgresql.dhall
+ test/fixtures/profile-discovery/not-a-profile.dhall view
@@ -0,0 +1,2 @@+-- Valid Dhall that deliberately does not have the profile shape.+{ note = "hello" }
+ test/fixtures/profile-discovery/registry.dhall view
@@ -0,0 +1,2 @@+-- A registry record is valid Dhall but is not itself a single profile descriptor.+../registry/package.dhall
+ test/fixtures/profile-discovery/remote-bytes.dhall view
@@ -0,0 +1,2 @@+-- The bytes-fetch path is disabled independently of text imports.+https://example.invalid/profile.bin as Bytes
+ test/fixtures/profile-discovery/remote.dhall view
@@ -0,0 +1,2 @@+-- Automatic discovery must reject this import before any network I/O.+https://example.invalid/profile.dhall
+ test/fixtures/profile-discovery/valid.dhall view
@@ -0,0 +1,2 @@+-- A discoverable descriptor that proves local relative imports remain enabled.+../profiles/decisions.dhall
+ test/fixtures/profile-nested-references-and-uniqueness-invalid/requests/duplicate.md view
@@ -0,0 +1,13 @@+---+type: Improvement Request+requestId: IR-1+dependencies:+  - ref: mori://namespace/project/okf/improvement-requests/concepts/IR-9+acceptanceCriteria:+  - id: AC-1+    text: The first occurrence.+  - id: AC-1+    text: The duplicate occurrence.+---++# Duplicate criterion IDs
+ test/fixtures/profile-nested-references-and-uniqueness-valid/requests/first.md view
@@ -0,0 +1,13 @@+---+type: Improvement Request+requestId: IR-1+dependencies:+  - ref: mori://namespace/project/okf/improvement-requests/concepts/IR-9+acceptanceCriteria:+  - id: AC-1+    text: The first criterion.+  - id: AC-2+    text: The second criterion.+---++# First request
+ test/fixtures/profile-nested-references-and-uniqueness-valid/requests/second.md view
@@ -0,0 +1,11 @@+---+type: Improvement Request+requestId: IR-2+dependencies:+  - ref: mori://namespace/project/okf/improvement-requests/concepts/IR-9+acceptanceCriteria:+  - id: AC-1+    text: IDs are list-local and may be reused by another request.+---++# Second request
+ test/fixtures/profiles/concept-filters.dhall view
@@ -0,0 +1,106 @@+--| House profile for the concept-filter fixture bundle.+--+-- Mirrors the shape of the improvement-request profile this repository's own+-- `docs/improvement-requests/` bundle uses, small enough to reason about and+-- resolvable entirely from local relative imports so the test suites stay+-- offline.+--+-- Three declarations here carry the weight of the `okf concepts --profile`+-- tests. `status` is both an OKF v0.2 core key and a profile-declared closed+-- vocabulary, which is what proves a profile rule outranks the core key list.+-- `targetPlan` is declared only on `Improvement Request`, which is what proves+-- that restricting the check to the types `--type` named is a real restriction.+-- `noteKind` is declared plainly profile-wide and closed on `Note` alone, which+-- is the shape that catches a check treating the profile-wide rules as a scope+-- of their own: there `noteKind` has an empty allowed-value list, and an empty+-- list means unconstrained.+let Profile = ../../../dhall/Profile.dhall++let FieldRule = ../../../dhall/defaults/FieldRule.dhall++let FrontmatterRules = ../../../dhall/defaults/FrontmatterRules.dhall++let NestedFieldRule = ../../../dhall/defaults/NestedFieldRule.dhall++let TypeRule = ../../../dhall/defaults/TypeRule.dhall++let Cardinality = ../../../dhall/Cardinality.dhall++let FieldFormat = ../../../dhall/FieldFormat.dhall++let field = ../../../dhall/mk/FieldRule.dhall++in    { name = "concept-filters"+      , description = Some+          "Fixture profile for listing and filtering the concepts in a bundle."+      , okfVersion = "0.2"+      , frontmatter = FrontmatterRules::{+        , required = [ field.plain "type", field.plain "title" ]+        , optional =+          [ FieldRule::{+            , field = "status"+            , allowedValues = [ "proposed", "accepted", "completed", "rejected" ]+            , cardinality = Cardinality.Scalar+            }+          , field.documentHandle "requestId" "IR"+          , field.plain "noteKind"+          , field.list "tags"+          , field.rfc3339Utc "completedAt"+          , field.record+              "generated"+              { required =+                [ NestedFieldRule::{+                  , field = "by"+                  , format = Some FieldFormat.Actor+                  }+                ]+              , recommended = [] : List NestedFieldRule.Type+              , optional =+                [ NestedFieldRule::{+                  , field = "at"+                  , format = Some FieldFormat.Rfc3339Utc+                  }+                ]+              }+          , field.recordList+              "reviews"+              { required =+                [ NestedFieldRule::{+                  , field = "kind"+                  , allowedValues = [ "human", "model" ]+                  }+                , NestedFieldRule::{+                  , field = "reviewer"+                  , cardinality = Cardinality.Scalar+                  }+                , NestedFieldRule::{+                  , field = "outcome"+                  , allowedValues =+                    [ "approved", "changes-requested", "commented" ]+                  }+                ]+              , recommended = [] : List NestedFieldRule.Type+              , optional = [] : List NestedFieldRule.Type+              }+          ]+        }+      , allowUnknownTypes = False+      , allowUnknownFields = True+      , idField = Some "requestId"+      , requireBundleVersion = None Text+      , types =+        [ TypeRule::{+          , type = "Improvement Request"+          , frontmatter = FrontmatterRules::{+            , optional = [ field.plain "targetPlan" ]+            }+          }+        , TypeRule::{+          , type = "Note"+          , frontmatter = FrontmatterRules::{+            , optional = [ field.enum "noteKind" [ "scratch", "reference" ] ]+            }+          }+        ]+      }+    : Profile
+ test/fixtures/profiles/nested-references-and-uniqueness.dhall view
@@ -0,0 +1,69 @@+let Profile = ../../../dhall/Profile.dhall++let FieldRule = ../../../dhall/defaults/FieldRule.dhall++let NestedFieldRule = ../../../dhall/defaults/NestedFieldRule.dhall++let HandleReferenceRule = ../../../dhall/defaults/HandleReferenceRule.dhall++let TypeRule = ../../../dhall/defaults/TypeRule.dhall++let Cardinality = ../../../dhall/Cardinality.dhall++let FieldFormat = ../../../dhall/FieldFormat.dhall++let field = ../../../dhall/mk/FieldRule.dhall++let dependencyRules =+      { required =+        [ NestedFieldRule::{+          , field = "ref"+          , cardinality = Cardinality.Scalar+          , reference = Some HandleReferenceRule::{+            , localPrefix = "IR"+            , externalUriSchemes = [ "mori" ]+            , allowLocal = False+            , externalUriPattern = Some+                "mori://[^/]+/[^/]+/okf/improvement-requests/concepts/IR-[1-9][0-9]*"+            }+          }+        ]+      , recommended = [] : List NestedFieldRule.Type+      , optional = [] : List NestedFieldRule.Type+      }++let acceptanceCriteriaRules =+      { required =+        [ NestedFieldRule::{+          , field = "id"+          , cardinality = Cardinality.Scalar+          , format = Some (FieldFormat.DocumentHandle "AC")+          }+        , NestedFieldRule::{ field = "text", cardinality = Cardinality.Scalar }+        ]+      , recommended = [] : List NestedFieldRule.Type+      , optional = [] : List NestedFieldRule.Type+      }++in    { name = "nested-references-and-uniqueness"+      , description = Some+          "Exercises external-only nested Mori references and list-local acceptance criterion IDs."+      , okfVersion = "0.2"+      , frontmatter =+        { required =+          [ field.plain "type"+          , field.documentHandle "requestId" "IR"+          , field.recordList "dependencies" dependencyRules+          ,     field.recordList "acceptanceCriteria" acceptanceCriteriaRules+            //  { uniqueBy = Some "id" }+          ]+        , recommended = [] : List FieldRule.Type+        , optional = [] : List FieldRule.Type+        }+      , allowUnknownTypes = False+      , allowUnknownFields = True+      , idField = Some "requestId"+      , requireBundleVersion = None Text+      , types = [ TypeRule::{ type = "Improvement Request", idPrefix = Some "IR" } ]+      }+    : Profile
+ test/fixtures/profiles/pre-nested-references-and-uniqueness-0.7.0.0.dhall view
@@ -0,0 +1,187 @@+--| Frozen public descriptor generation from okf-core 0.7.0.0.+-- Every record and union is inline so this fixture cannot silently acquire new+-- members from the live schema. FROZEN: do not edit after release.+let Cardinality = < Any | Scalar | List >++let FieldFormat =+      < Rfc3339Utc+      | Date+      | Uri+      | UriWithScheme : Text+      | DocumentHandle : Text+      | Actor+      | HumanActor+      | Integer+      | NonNegativeInteger+      | Boolean+      >++let FieldCondition = { field : Text, hasValue : List Text }++let HandleReferenceRule =+      { localPrefix : Text+      , externalUriSchemes : List Text+      , allowSelf : Bool+      }++let PathReferenceRule = { externalUriSchemes : List Text, allowSelf : Bool }++let NestedFieldRule =+      { field : Text+      , description : Optional Text+      , allowedValues : List Text+      , cardinality : Cardinality+      , format : Optional FieldFormat+      , path : Optional PathReferenceRule+      , when : Optional FieldCondition+      }++let NestedRules =+      { required : List NestedFieldRule+      , recommended : List NestedFieldRule+      , optional : List NestedFieldRule+      }++let FieldRule =+      { field : Text+      , description : Optional Text+      , allowedValues : List Text+      , cardinality : Cardinality+      , format : Optional FieldFormat+      , elementFields : Optional NestedRules+      , objectFields : Optional NestedRules+      , reference : Optional HandleReferenceRule+      , path : Optional PathReferenceRule+      , when : Optional FieldCondition+      }++let FrontmatterRules =+      { required : List FieldRule+      , recommended : List FieldRule+      , optional : List FieldRule+      }++let TypeRule =+      { type : Text+      , description : Optional Text+      , frontmatter : FrontmatterRules+      , pathPattern : Optional Text+      , resourceScheme : Optional Text+      , requireSchemaSection : Bool+      , schemaColumns : List Text+      , idPrefix : Optional Text+      }++let Profile =+      { name : Text+      , description : Optional Text+      , okfVersion : Text+      , frontmatter : FrontmatterRules+      , allowUnknownTypes : Bool+      , allowUnknownFields : Bool+      , idField : Optional Text+      , requireBundleVersion : Optional Text+      , types : List TypeRule+      }++let plain =+      \(field : Text) ->+        { field+        , description = None Text+        , allowedValues = [] : List Text+        , cardinality = Cardinality.Any+        , format = None FieldFormat+        , elementFields = None NestedRules+        , objectFields = None NestedRules+        , reference = None HandleReferenceRule+        , path = None PathReferenceRule+        , when = None FieldCondition+        }++let nestedPlain =+      \(field : Text) ->+        { field+        , description = None Text+        , allowedValues = [] : List Text+        , cardinality = Cardinality.Any+        , format = None FieldFormat+        , path = None PathReferenceRule+        , when = None FieldCondition+        }++in    { name = "pre-nested-references-and-uniqueness-0.7.0.0"+      , description = Some "The complete public 0.7.0.0 descriptor shape."+      , okfVersion = "0.2"+      , frontmatter =+        { required =+          [ plain "type"+          ,     plain "sources"+            //  { cardinality = Cardinality.List+                , elementFields = Some+                  { required =+                    [     nestedPlain "resource"+                      //  { cardinality = Cardinality.Scalar+                          , path = Some+                            { externalUriSchemes = [ "https" ]+                            , allowSelf = False+                            }+                          }+                    ]+                  , recommended = [] : List NestedFieldRule+                  , optional = [ nestedPlain "note" ]+                  }+                }+          ,     plain "generated"+            //  { objectFields = Some+                  { required =+                    [     nestedPlain "by"+                      //  { cardinality = Cardinality.Scalar+                          , format = Some FieldFormat.Actor+                          }+                    ]+                  , recommended = [] : List NestedFieldRule+                  , optional = [] : List NestedFieldRule+                  }+                }+          ]+        , recommended =+          [     plain "usage_count"+            //  { format = Some FieldFormat.NonNegativeInteger }+          ]+        , optional =+          [     plain "supersededBy"+            //  { reference = Some+                  { localPrefix = "ADR"+                  , externalUriSchemes = [ "mori" ]+                  , allowSelf = False+                  }+                }+          , plain "statusNote"+          ]+        }+      , allowUnknownTypes = False+      , allowUnknownFields = True+      , idField = Some "docId"+      , requireBundleVersion = Some "0.2"+      , types =+        [ { type = "Metric"+          , description = Some "A measured quantity."+          , frontmatter =+            { required =+              [     plain "owner"+                //  { cardinality = Cardinality.Scalar+                    , format = Some FieldFormat.HumanActor+                    }+              ]+            , recommended = [] : List FieldRule+            , optional = [] : List FieldRule+            }+          , pathPattern = None Text+          , resourceScheme = None Text+          , requireSchemaSection = False+          , schemaColumns = [] : List Text+          , idPrefix = Some "ADR"+          }+        ]+      }+    : Profile
+ test/fixtures/registry-house/package.dhall view
@@ -0,0 +1,6 @@+--| Second registry for multi-source tests. It publishes one export that+-- collides with the main registry and one unique export, using only sibling+-- fixtures so enumeration stays offline.+{ postgresql = ../profiles/postgresql.dhall+, runbooks = ../profiles/decisions.dhall+}