Skip to content

feat: adopt OKF page-level title, generated, and status keys - #14

Merged
SunsetDrifter merged 1 commit into
mainfrom
feat/okf-frontmatter-alignment
Oct 8, 2026
Merged

SunsetDrifter merged 1 commit into
mainfrom
feat/okf-frontmatter-alignment

Conversation

@SunsetDrifter

Copy link
Copy Markdown
Owner

Summary

Aligns page frontmatter with OKF v0.2's page-level keys, ahead of the real-data install (so nothing live needs migrating):

  • title: required in the template; the index uses it, falling back to the prettified filename for configs that don't require it.
  • generated: { by, at } replaces updated (SPEC §5.2). at must be an ISO 8601 datetime with an explicit offset, per the post-v0.2 timestamp rule; by follows the §7 actor convention (claude-code/<model-id>, human:<id>). Contested-age and created-ordering checks read generated.at, with a legacy updated fallback for non-OKF trees (mirroring §13.1's timestamp fallback).
  • status: validated against OKF's draft | stable | deprecated wherever present (§5.4). New supersedes_field knob: a page named in another page's supersedes must be status: deprecated, making the forward banner machine-readable.
  • sources: shape unchanged (already OKF); install CLAUDE.md now documents the optional id/title/author per-entry keys.

Engine: new wikilint/okf_fields.py (check_okf_fields, check_supersedes); parser supports one-level mappings, inline and block; parse_okf_datetime normalizes Z, fraction lengths and +HHMM so Python 3.9 matches 3.11+. Test bundles rename their colliding status fields (component_status, module_status, adr_status); membership rules gain status_field and are validated at configure(); ADR checks fall back to a legacy status.

taxonomy.md is unchanged: the page field is already OKF's tags, and the file (tag vocabulary plus type glossary) has no OKF counterpart.

Test plan

  • TDD: tests/test_okf_fields.py (parser mappings, datetime forms, required keys, generated shape, status values, supersedes rule, contested age incl. legacy fallback, index title/date) written red first
  • Review findings fixed with regression tests: braced scalars stay strings, 3.9 datetime forms, membership rule validation, legacy ADR status
  • python3 -m unittest discover -s tests: 141 tests OK on Python 3.9.6
  • Template lints clean (cd wiki && python3 lint.py check: 0 errors)
  • Field test on a fresh install: pre-commit hook blocks a superseded page without status: deprecated; date-only generated.at errors; inline and block generated both parse; index shows authored titles; fixed state commits

Pages now carry OKF v0.2's own page-level keys instead of near-equivalents:

- title is required in the template; the index already used it.
- generated { by, at } replaces updated. at must be an ISO 8601 datetime
  with an explicit offset (SPEC §5); by is required within generated
  (§5.2). Contested-age and created-ordering checks read generated.at,
  falling back to a legacy updated date for non-OKF trees.
- status is validated against OKF's draft|stable|deprecated wherever a
  page carries it (§5.4), and a new supersedes_field knob requires pages
  named in another page's supersedes to be deprecated.

The parser gains one-level mappings (inline { k: v } and indented k: v
under a bare key); braced scalars that are not k: v pairs stay strings.
parse_okf_datetime normalizes Z, fractions and +HHMM offsets so Python
3.9 and 3.11+ agree.

The test bundles' colliding status fields become component_status,
module_status and adr_status; membership rules name their status_field
and are validated at configure(). ADR checks fall back to a legacy status.
@SunsetDrifter
SunsetDrifter merged commit d358b3e into main Oct 8, 2026
1 check passed
@SunsetDrifter
SunsetDrifter deleted the feat/okf-frontmatter-alignment branch October 8, 2026 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant