Writing a profile
What the framework asks of a profile, in the order a specification states it.
This page is a guide to the framework, not a second statement of it. Every rule it mentions is cited by section, and where the two differ, the framework is right. The example throughout is the hypothetical Slipcase Handover Profile from the framework's Appendix A, for delivering engineering documents from a contractor to an owner.
1. A name, a URI and a table
A profile is identified by its profile URI, which is the same for every version and resolves to the specification (FRAMEWORK §3). Choose a URI on a domain you control and expect to keep: it will be written into every container that carries the profile, and a URI that stops resolving leaves those containers pointing at nothing. URIs under slipcaseformat.org/profiles/ are kept for official profiles (FRAMEWORK §9), which is why the handover example has one.
The profile owns one top-level table of the flyleaf and one directory of members, both named with the same lowercase word (FRAMEWORK §3, §4). Choose a word no listed profile uses: the list of profiles records the words taken, and two profiles with one table name cannot share a flyleaf. The handover profile's table is [handover] and its members live under handover/.
The specification then states its version, and the versions of the framework and of Slipcase it is written against (FRAMEWORK §6, §10).
2. Kinds, keys and members
A profile names what a container is with its kind key (FRAMEWORK §5). The handover profile has two kinds: document, one delivered document, and manifest, the delivery itself, whose handover/manifest.csv lists every document delivered. For each kind the specification lists the keys the table must and may carry, with their types, and the members the container must and may hold under the prefix.
Keys a specification does not define are permitted and preserved, unless the specification closes a table or a value to a set (FRAMEWORK §3). Close a vocabulary where an unrecognized value would make a tool quietly do the wrong thing, and say so in the specification.
3. The shared conventions
Identifiers, hashes, dates and instants, and chained logs each have one form, in the conventions, and a profile uses those forms rather than defining its own (FRAMEWORK §8). The specification says which conventions it uses. A document's id is an identifier, its content hash is a hash, and issued is a date.
Anything the conventions do not cover is the profile's own to define. The handover profile names the contractor and the owner with a form of its own, a name and an optional LEI, because no convention describes an organization outside the writer's; the Records Profile defines its own agent, an accountable person in the organization's directory, for the same reason. A form moves into the conventions when a second profile needs it.
A profile that defines a chained log states its entry name and the seed that ties the log to its container (FRAMEWORK §10, CONVENTIONS §5.3), and says either where the head is recorded, so that the last entry is protected too, or that it records none (CONVENTIONS §5.5). The handover profile's log is handover/events.toml, entry name event, seeded from the table's id.
4. What a conforming container is
State each property a container must have to conform so that it can be checked against the file and nothing else (FRAMEWORK §10). For the handover profile, every document a manifest names exists with the hash stated, and revision is not empty. A rule that depends on something outside the file, such as whether a person approved it, belongs to the implementation requirements, not to conformance.
5. What an implementation must do
The framework already requires an implementation to check the profile and its version before acting, to touch only its own table and prefix, and, when it acts over a set of containers in which the profile is expected, to report a non-conforming table rather than pass over it (FRAMEWORK §11). A profile states what it requires beyond that: in the handover profile, that an acceptance is recorded only after the hash has been verified.
6. Security considerations
A profile that drives an action must say what an implementation checks before acting, and must not let a value in the flyleaf alone authorize anything irreversible (FRAMEWORK §12). No key may be read as a path outside the container, a command, or an address to fetch on the container's say-so. The handover manifest names documents by identifier, never by path.
Then
Write a design document beside the specification that says why each rule is drawn where it is; the framework's and the Records Profile's show the form. The profile's URI has to resolve to the specification (FRAMEWORK §3); publishing the design document beside it helps a reader who wants the reasons. Example containers are what an implementation tests against, and an official profile carries them (FRAMEWORK §9); a few that fail to conform, each for one stated reason, are as useful as the ones that pass. Then list the profile.