seihou-okf-extension-0.16.0.0: profile/seihou-registry-docs.dhall
--| House profile for an OKF documentation bundle generated from a Seihou registry.
--
-- A profile is a house convention, not part of the OKF standard: a bundle that
-- deviates from this descriptor is still fully OKF-conformant. What this one
-- says is what `seihou-okf-extension docs` promises about the bundles it emits,
-- so that a consumer can check a bundle it did not generate itself.
--
-- `pathPattern` is matched against a concept ID (`modules/haskell-library`),
-- not a file path, so it carries no `.md` suffix; `*` matches exactly one
-- segment.
--
-- The descriptor is deliberately standalone -- every type is spelled out here
-- rather than imported -- because it is embedded in the generator and written
-- into the bundle root, where a relative import out of the bundle would not
-- resolve.
let Cardinality = < Any | Scalar | List >
let FieldFormat =
< Rfc3339Utc
| Date
| Uri
| UriWithScheme : Text
| DocumentHandle : Text
| Actor
| HumanActor
| Integer
| NonNegativeInteger
| Boolean
| FiniteDecimal
>
let FieldCondition = { field : Text, hasValue : List Text }
let HandleReferenceRule =
{ localPrefix : Text
, externalUriSchemes : List Text
, allowSelf : Bool
, allowLocal : Bool
, externalUriPattern : Optional Text
}
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
, reference : Optional HandleReferenceRule
}
let ValueSelector = { field : Text, member : Optional Text }
let PresenceConstraint =
{ when : Optional FieldCondition
, whenAnyPresent : List ValueSelector
, requireAll : List ValueSelector
, requireAny : List ValueSelector
}
let TimestampOrderConstraint = { before : Text, after : Text }
let MembershipConstraint = { source : ValueSelector, target : ValueSelector }
let UniqueValuesConstraint = { selectors : List ValueSelector }
let NestedRules =
{ allowUnknownFields : Bool
, presenceConstraints : List PresenceConstraint
, timestampOrderConstraints : List TimestampOrderConstraint
, 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
, uniqueBy : Optional Text
}
let FrontmatterRules =
{ presenceConstraints : List PresenceConstraint
, timestampOrderConstraints : List TimestampOrderConstraint
, membershipConstraints : List MembershipConstraint
, uniqueValuesConstraints : List UniqueValuesConstraint
, required : List FieldRule
, recommended : List FieldRule
, optional : List FieldRule
}
let TypeRule =
{ guidance : Optional Text
, type : Text
, description : Optional Text
, frontmatter : FrontmatterRules
, pathPattern : Optional Text
, resourceScheme : Optional Text
, requireSchemaSection : Bool
, schemaColumns : List Text
, idPrefix : Optional Text
}
let emptyRules
: FrontmatterRules
= { presenceConstraints = [] : List PresenceConstraint
, timestampOrderConstraints = [] : List TimestampOrderConstraint
, membershipConstraints = [] : List MembershipConstraint
, uniqueValuesConstraints = [] : List UniqueValuesConstraint
, required = [] : List FieldRule
, recommended = [] : List FieldRule
, optional = [] : List FieldRule
}
let emptyNestedRules
: NestedRules
= { allowUnknownFields = True
, presenceConstraints = [] : List PresenceConstraint
, timestampOrderConstraints = [] : List TimestampOrderConstraint
, required = [] : List NestedFieldRule
, recommended = [] : List NestedFieldRule
, optional = [] : List NestedFieldRule
}
let nestedScalar =
\(name : Text) ->
\(description : Text) ->
{ field = name
, description = Some description
, allowedValues = [] : List Text
, cardinality = Cardinality.Scalar
, format = None FieldFormat
, path = None PathReferenceRule
, when = None FieldCondition
, reference = None HandleReferenceRule
}
let field =
\(name : Text) ->
\(description : Text) ->
\(cardinality : Cardinality) ->
\(format : Optional FieldFormat) ->
\(objectFields : Optional NestedRules) ->
{ field = name
, description = Some description
, allowedValues = [] : List Text
, cardinality
, format
, elementFields = None NestedRules
, objectFields
, reference = None HandleReferenceRule
, path = None PathReferenceRule
, when = None FieldCondition
, uniqueBy = None Text
}
let scalar =
\(name : Text) ->
\(description : Text) ->
field name description Cardinality.Scalar (None FieldFormat) (None NestedRules)
let versionRule =
scalar
"version"
"The version the registry catalog records for this artifact. Optional rather than required, because `seihou-registry.dhall` itself declares `version : Optional Text`; a profile that demanded it would refuse a valid registry."
let artifactType =
\(name : Text) ->
\(description : Text) ->
\(directory : Text) ->
{ guidance = None Text
, type = name
, description = Some description
, frontmatter = emptyRules // { optional = [ versionRule ] }
, pathPattern = Some "${directory}/*"
, resourceScheme = Some "seihou"
, requireSchemaSection = False
, schemaColumns = [] : List Text
, idPrefix = None Text
}
in { guidance = None Text
, name = "seihou-registry-docs"
, description = Some
"Generated documentation for a Seihou registry: one concept per published module, recipe, blueprint, agent prompt and judgement, plus one describing the registry itself. Every concept names the registry artifact it was derived from through a `seihou://` resource and records the generator that produced it, so a reader can tell derived documentation from hand-written prose and can find the `.dhall` source it came from."
, okfVersion = "0.2"
, frontmatter =
emptyRules
// { required =
[ scalar "type" "Which kind of Seihou artifact this concept documents."
, scalar "title" "The artifact's name, exactly as the registry publishes it."
, scalar
"description"
"What the artifact is for. Taken from the registry catalog entry, else the artifact's own description, else synthesized."
, field
"resource"
"A `seihou://<registry>/<path>` pointer to the artifact this concept was derived from."
Cardinality.Scalar
(Some (FieldFormat.UriWithScheme "seihou"))
(None NestedRules)
, field
"generated"
"Which producer generated this concept, per OKF specification section 5.2. Always present, because this documentation is derived rather than written."
Cardinality.Any
(None FieldFormat)
( Some
( emptyNestedRules
// { required =
[ nestedScalar
"by"
"The producer actor, `seihou-okf-extension/<version>`."
// { format = Some FieldFormat.Actor }
]
, optional =
[ nestedScalar
"at"
"The generation time, present only when the operator passed --generated-at."
]
, recommended = [] : List NestedFieldRule
}
)
)
]
, recommended = [] : List FieldRule
, optional =
[ field
"tags"
"Catalog tags, when nonempty. An empty tag list is a valid registry declaration; generation never invents tags to satisfy the profile."
Cardinality.List
(None FieldFormat)
(None NestedRules)
, field
"status"
"The concept's lifecycle status, per OKF specification section 5.4."
Cardinality.Scalar
(None FieldFormat)
(None NestedRules)
]
}
, allowUnknownTypes = False
, allowUnknownFields = True
, idField = None Text
, requireBundleVersion = Some "0.2"
, types =
[ artifactType
"SeihouModule"
"A deterministic file-generation template: variables, generation steps, shell commands, dependencies, managed/seed/checkout ownership, an optional removal procedure, judgement references and optional migration edges."
"modules"
, artifactType
"SeihouRecipe"
"A declared composition of modules with sourced dependencies, preset variable bindings, an optional single base and explicit overrides."
"recipes"
, artifactType
"SeihouBlueprint"
"An agent-driven scaffold: a prompt, optional base modules, reference files and optional agent-guided migration edges."
"blueprints"
, artifactType
"SeihouPrompt"
"A reusable agent-session template."
"prompts"
, artifactType
"SeihouJudgement"
"Yes/no checks Seihou asks a model about staged changes or a commit range before a commit, with per-check thresholds and enforcement."
"judgements"
, artifactType
"SeihouRegistry"
"The registry itself: the repository publishing these artifacts, linking each of them."
"registry"
// { frontmatter = emptyRules }
]
}