Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions apps/decodex/src/docs_okf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ pub(crate) fn run_docs_check(root: &Path, scope: DocsCheckScope) -> Result<DocsC

if matches!(scope, DocsCheckScope::All | DocsCheckScope::Index) {
check_markdown_only(&files, &mut report);
check_acronym_capitalization(&files, &mut report);
check_concept_contracts(&files, &mut report);
}
if matches!(scope, DocsCheckScope::All | DocsCheckScope::Links) {
Expand Down Expand Up @@ -254,6 +255,23 @@ fn check_markdown_only(files: &[DocsFile], report: &mut DocsCheckReport) {
}
}

fn check_acronym_capitalization(files: &[DocsFile], report: &mut DocsCheckReport) {
for file in files.iter().filter(|file| is_markdown(&file.relative_path)) {
let Some(content) = file.content.as_deref() else {
continue;
};

if content.contains("Okf") {
report.issues.push(issue(
Some(file.relative_path.clone()),
String::from(
"use `OKF` in prose; lowercase `okf` is reserved for paths, slugs, tags, and URLs",
),
));
}
}
}

fn check_concept_contracts(files: &[DocsFile], report: &mut DocsCheckReport) {
for file in files.iter().filter(|file| is_concept_markdown(&file.relative_path)) {
report.concept_count += 1;
Expand Down Expand Up @@ -844,6 +862,23 @@ mod tests {
assert!(report.issues.iter().any(|issue| issue.message.contains("JSON artifacts")));
}

#[test]
fn docs_check_rejects_mis_capitalized_okf_acronym() {
let temp_dir = TempDir::new().expect("tempdir");
let docs = temp_dir.path().join("docs");

write_minimal_okf_bundle(&docs);
write(
&docs.join("policy.md"),
"---\ntype: Policy\ntitle: Okf policy\ndescription: Test concept.\nstatus: active\nauthority: non_authoritative\nowner: docs\nlast_verified: 2026-06-16\n---\n\n# Purpose\nOkf should be uppercase.\n",
);

let report = docs_okf::run_docs_check(&docs, DocsCheckScope::All).expect("check");

assert!(report.has_issues());
assert!(report.issues.iter().any(|issue| issue.message.contains("use `OKF`")));
}

#[test]
fn docs_check_passes_minimal_okf_bundle() {
let temp_dir = TempDir::new().expect("tempdir");
Expand Down
1 change: 1 addition & 0 deletions apps/decodex/src/plugin_surface_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ fn packaged_docs_skills_encode_okf_wiki_and_drift_boundaries() {
assert_contains(&docs_surface, "one authoritative concept per claim");
assert_contains(&docs_surface, "pass`, `fail`, or `needs-human");
assert_contains(&docs_surface, "Do not create a parallel `wiki/` or `okf/` root");
assert_not_contains(&docs_surface, "Okf");
}

#[test]
Expand Down
2 changes: 2 additions & 0 deletions docs/log.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@
- Clarified the Program Intake public/private boundary so generated Linear issue
descriptions omit internal Program and node identifiers while SQLite/operator
readback keeps private mappings.
- Standardized `OKF` as the all-caps prose form while preserving lowercase `okf` for
filenames, paths, skill IDs, tags, and URLs.
6 changes: 6 additions & 0 deletions docs/policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ or private execution evidence.
Runtime state may still use internal structured storage. The docs source of truth for
research, drift audit, decisions, references, runbooks, and specs is Markdown.

## Naming

Write `OKF` as an all-caps acronym in prose, matching the repository convention for
`CLI`. Lowercase `okf` is allowed only in machine identifiers such as filenames,
paths, skill IDs, tags, and URLs.

## Concept Frontmatter

Every concept must start with YAML frontmatter delimited by `---`.
Expand Down
1 change: 1 addition & 0 deletions plugins/decodex/references/docs-okf.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ concepts.
- `docs/index.md`, `docs/policy.md`, and `docs/log.md` must exist.
- Non-index, non-log Markdown documents are OKF concepts.
- Concepts start with YAML frontmatter delimited by `---`.
- Prose spells the acronym `OKF`; lowercase `okf` is slug-only.

## Required Frontmatter

Expand Down