Skip to content

feat(cli): export and validate OKF bundles #1550

Description

@phernandez

Summary

Add an explicit CLI boundary for producing and validating Open Knowledge Format (OKF) v0.2 bundles.

This is the remaining producer/conformance work split from #1246. Basic Memory already consumes project-local Markdown links as graph relations and preserves its wikilink-native canonical note format. The live Wiki projector is a Basic Memory view, not the interchange artifact.

Proposed commands

  • bm okf export — render a project into a static, self-contained OKF bundle.
  • bm okf check — validate a bundle against the supported OKF structural contract.

The final command shape can differ if it fits the existing CLI better, but export and validation should remain an explicit boundary rather than a project-wide canonical syntax mode.

Export requirements

  • Emit standard Markdown links for graph relationships.
  • Preserve useful Basic Memory semantics through a documented bm extension namespace where OKF has no native equivalent, including typed relation/context and observation categories.
  • Emit conformant reserved files:
    • index.md has no frontmatter except optional root okf_version;
    • index.md entries use standard Markdown links;
    • log.md has no frontmatter and uses ISO YYYY-MM-DD sections;
    • index.md and log.md are not concept documents.
  • Leave canonical project files unchanged.
  • Produce deterministic output for the same accepted project state.

Check requirements

Validate at least the normative OKF v0.2 structural rules:

  1. every non-reserved Markdown file has parseable YAML frontmatter;
  2. every concept has a non-empty type;
  3. reserved index.md and log.md files follow their required structure.

Diagnostics must name the offending file and rule. Validation must not reject unknown types, unknown frontmatter keys, missing optional fields, broken cross-links, or missing indexes.

Compatibility verification

  • Exercise an exported Basic Memory fixture against a pinned upstream OKF consumer/reference implementation.
  • Assert the expected concept count so silently skipped parse failures cannot look like success.
  • Validate and ingest a pinned upstream sample bundle, then prove project-local links are searchable/retrievable.
  • Keep the pin explicit: passing a permissive viewer is compatibility evidence, not a substitute for bm okf check.

Out of scope

  • A relation_link_style switch for canonical Basic Memory notes.
  • Rewriting existing project files in place.
  • Making the live Wiki projector itself strict OKF output.
  • Runtime execution or attestation support beyond preserving supported frontmatter.

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions