Expand description
Conformance checking and structural validation against OKF v0.2.
A bundle is conformant if (1) every non-reserved .md file has a
parseable frontmatter block, (2) every frontmatter has a non-empty type,
and (3) reserved files follow their structure when present. Everything else
is soft guidance: consumers MUST NOT reject a bundle for missing optional
fields, unknown types or keys, broken links, or missing index.md files.
Accordingly, validate_bundle reports only true conformance violations as
Severity::Error. Material soft-guidance deviations, data integrity issues,
temporal inconsistencies, contract discrepancies, and syntax errors are
reported as Severity::Warning (producer mistakes worth fixing)
or Severity::Info (permitted states worth noting).
Staleness is the one check that depends on the wall clock, so it is opt-in:
validate_bundle is deterministic and validate_bundle_at takes the
date to compare against.
| Code | Severity | Finding |
|---|---|---|
| V1 | error | unparseable concept document (frontmatter parse error) |
| V2 | error | missing or non-scalar required type field |
| V3 | warning | missing recommended frontmatter field (title, description, generated) |
| V4 | warning | concept body is empty |
| V5 | warning | tags is not a YAML list of strings |
| V6 | warning | generated is malformed, missing by, or at is not a valid ISO datetime |
| V7 | warning | verified is malformed, missing by, or at is not a valid ISO datetime |
| V8 | warning | latest verified.at predates generated.at (content modified after verification) |
| V9 | warning | timestamp in generated, verified, or sources is in the future |
| V10 | warning | unknown status value (not draft, stable, deprecated) |
| V11 | warning | stale_after is not a valid ISO datetime |
| V12 | info | stale concept (past stale_after with --today) |
| V13 | warning | sources malformed, missing resource, or duplicate id |
| V14 | warning | sources.last_modified or usage_window not valid ISO datetime |
| V15 | warning | sources.usage_count without usage_window or not an integer |
| V16 | warning | footnote attribution matches no sources[].id |
| V17 | warning | footnote is cited in body but never defined |
| V18 | warning | circular concept derivation in sources graph |
| V19 | warning | legacy v0.1 timestamp present (superseded by generated) |
| V20 | warning | legacy v0.1 body # Citations list present (superseded by sources) |
| V21 | warning | missing runtime or computation source on Attested Computation |
| V22 | warning | contract parameters, executor, or attester missing required fields |
| V23 | warning | executor, attester, or computation resource missing on disk |
| V24 | warning | code block syntax error in concept body |
| V25 | warning | computation, executor, or attester script syntax error |
| V26 | info | computation fields on non-computation concept type |
| V27 | info | explicit path field does not resolve to a file in the bundle |
| V28 | info | broken link (target does not resolve to a concept in the bundle) |
| V29 | warning | links to a status: deprecated concept |
| V30 | warning | title shared with another concept |
| V31 | warning | concept-id segment outside portable ASCII set |
| V32 | error | reserved index.md or log.md unreadable, unparseable, or bad frontmatter |
| V33 | error | reserved log.md structural errors or invalid ISO date format |
| V34 | warning | log.md contains duplicate date heading ## YYYY-MM-DD |
| V35 | warning | existing index.md is out of sync with its directory |
| V36 | info | bundle declares unrecognized or non-target okf_version |
Structs§
- Diagnostic
- A single finding about a bundle.
- Parse
Severity Error - Error returned when a string cannot be parsed into a
Severity. - Report
- The result of validating a bundle.
Enums§
- Severity
- Severity of a diagnostic.
Functions§
- index_
listed_ targets - Every link target an
index.mdlists, paired with the raw target as written, resolved to a concept id whether or not that concept exists in the bundle. - index_
source_ id - Synthesizes the concept id an
index.mdwould have if it were itself a concept, sookf_core::links::Link::resolve_allcan resolve its relative links against the index’s own directory. - is_
concept_ link truewhen a raw link target names a concept (a.mdfile or a bare id) rather than a non-markdown resource such asattester.py.- is_
iso8601_ datetime - Checks an ISO-8601 datetime with a time of day and an explicit UTC offset.
- validate_
bundle - Validates a loaded bundle, returning all findings.
- validate_
bundle_ at - Validates a bundle, additionally reporting concepts that are stale on
today.