Validation commands are pretty low-level and are inconvenient to write
by hand, at least because of huge quantity of TAKEs.
tcl/schema.tcl utility gives ability to convert much more nicer schemas
written on Tcl language to the KEKS-encoded commands. We call that
Tcl-written schemas KEKS/Schema.

Example with "our" structure ([schema/cmds]) can be written as:

    ai {{field . {str} >0}}
    fpr {{field . {bin} len=32}}
    our {
        {field a {with ai}}
        {field v {bin str}}
        {field fpr {with fpr}}
        {field comment {str} optional}
    }

and [cm/pub/] as:
[schemas/pub.tcl]
[schemas/fpr.tcl]
[schemas/pub-load.tcl]
[schemas/pub-sig-tbs.tcl]

schema.tcl calls "schemas {s0 cmds0 s1 cmds1 ...}"
commands to produce an encoded map with "cmds*" commands for
"s*" schemas. There is "field" command that helps creation of
commands related to the field.

Its first argument is either field's name in the map, or list's index or
dot, meaning the self-structure itself.

Second argument is a list of allowable types, written in lowercase. If
that list consists of "with S", then SCHEMA command will be called
instead of TYPE checking. If list consists of "set", then it is
checked to be a MAP with EACH value of NIL.

All other arguments are optional.

By default, if no "optional" argument is specified, then explicit
EXISTS check is called for the field. If "!exists" argument is
specified, then it is explicitly checked to be non-existent and
you can specify empty list of types in second argument.

">n" and "<n" arguments allow checking of the integer value or
the lengths. ">0" assures that either list/map or strings are not
empty. "len=n" checks the exact length. "=v" checks that given
element has specified string/binary value (use "len=" for integers).

"prec=p" issues TIMEPREC command, but instead of specifying the raw
integer values, you choose one of: s, ms, us, ns, ps, fs, as. "utc"
issues UTC command.

"of s" argument issues checking of EACH element of the list or map
against the specified schema, or against specified type if "s" is a
known type.

"schema-include filename.tcl" command used instead of "field" allows
inclusion of the specified file with the path relative to given schema
file.