feat(okf): OKF v0.2 document model — parse, write, provenance, validation with profiles, index files #73
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
qa:preview
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
quatrain/core#73
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Need
Applications that read and write OKF bundles (curation tools, ingestion pipelines) need the document model of OKF v0.2, not only a backend adapter: parse and write a concept, keep unknown keys, read provenance and trust, check a document against the specification and against the stricter rules of an application, upgrade v0.1 documents, and write
index.mdfiles.@quatrain/okfonly shipsOKFBackendAdaptertoday, which serialises entities and knows nothing ofsources,generated,verified, trust tiers or index files.Proposal
A document module in
@quatrain/okf, independent of the backend adapter:parseOkfDocument(text)/serializeOkfDocument(document): YAML frontmatter + markdown body; unknown keys preserved in their order; spec keys written first; a bareverifiedmapping read as a one-element list.human:,process:,<producer>/<version>),trustTier(),isStale(),lastChange()(falls back to a legacytimestamp), helpers to stampgeneratedand add a verification.validateOkfDocument(document, profile?): issues (error / warning) for the producer-side rules of the specification (non-emptytype, datetimes with an explicit offset, actor format,sources[].resource,statusvocabulary, reserved names); a profile lets an application add required keys, refuse empty values or legacy keys, and plug its own rules.upgradeOkfDocument(document, { by }): v0.1 → v0.2 (timestamp→generated), reporting what it cannot convert (# Citationsbody list).renderOkfIndex(sections, { okfVersion }):index.mdper §8, frontmatter only at the bundle root.Attested computations (§10) are out of scope.