Documentation
¶
Overview ¶
Package okf checks OKF v0.2 bundles.
The spec is deliberately permissive: only three rules are conformance failures. That split is why findings carry a severity — everything beyond §11 is advice and must never fail a build. A repo whose graph carries an invariant the spec cannot express passes it to CheckBundle as a Rule.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Main ¶
Main runs the `okf check` CLI and returns the process exit code. A repo with its own rules wires them in here rather than forking the command. `sweep` is dispatched by cmd/okf instead: it runs the fleet rules, which import this package, so the engine cannot reach them.
Types ¶
type Bundle ¶ added in v0.2.0
Bundle is every parsed document in one root, index.md and log.md included.
type BundleRule ¶ added in v0.2.0
BundleRule is a caller-supplied check over a whole bundle. A Rule runs per concept and so cannot see the reserved files, the link graph, or any pair of concepts at once.
type Doc ¶
type Doc struct {
Root string // bundle root, as given to CheckBundle
Rel string // bundle-relative path, slash-separated
FM map[string]any // frontmatter
Body string
}
Doc is one parsed concept, handed to a Rule.
type Finding ¶
func CheckBundle ¶
CheckBundle walks a bundle root and reports conformance errors (§11) and advisory warnings, plus whatever the caller's rules report.
func CheckBundleWith ¶ added in v0.2.0
CheckBundleWith is CheckBundle with bundle-wide rules as well. Their findings are appended after the per-concept ones and sorted among themselves, so adding one cannot move a line the stock check already prints.
type Rule ¶
Rule is a caller-supplied check over one concept. It runs on concepts only, never on the reserved index.md and log.md. A Finding with an empty Path is stamped with the concept's.
type Rules ¶ added in v0.2.0
type Rules struct {
Doc []Rule
Bundle []BundleRule
}
Rules is what a caller passes to CheckBundleWith and MainWith.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
okf
command
Command okf checks OKF bundles.
|
Command okf checks OKF bundles. |
|
okfrules
command
Command okfrules is okf's check with this fleet's shared rules wired in, for the repos that are not Go and cannot build one of their own.
|
Command okfrules is okf's check with this fleet's shared rules wired in, for the repos that are not Go and cannot build one of their own. |
|
Package rules holds the invariants every bundle in this fleet keeps but the OKF spec deliberately does not: §11 forbids rejecting a bundle over an unknown type, a missing key or a broken link, so a local vocabulary is only a rule while something asserts it.
|
Package rules holds the invariants every bundle in this fleet keeps but the OKF spec deliberately does not: §11 forbids rejecting a bundle over an unknown type, a missing key or a broken link, so a local vocabulary is only a rule while something asserts it. |